Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] gcc: update to 11.2.1git20211128
@ 2022-01-06  6:15 Oreo639
  2022-01-26 19:41 ` dkwo
                   ` (264 more replies)
  0 siblings, 265 replies; 266+ messages in thread
From: Oreo639 @ 2022-01-06  6:15 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1723 bytes --]

There is a new pull request by Oreo639 against master on the void-packages repository

https://github.com/Oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 11.2.1git20211128
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Note: depends on https://github.com/void-linux/void-packages/pull/32330
(Otherwise, it would work until you try recompiling glibc)

I tested this PR with glibc and it appears to work fine so far, aside from the issue mentioned earlier.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 11 doesn't appear to result in any issues.

Please let me know if there are any issues.

(Related: https://github.com/void-linux/void-packages/pull/34153)

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 48461 bytes --]

From 3385c6500defc873cd57bf293c938f81421165d6 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 4 Jan 2022 20:41:41 -0800
Subject: [PATCH 1/3] binutils: update to 2.37

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch |  60 -----
 .../patches/bfd-close-file-descriptor.patch   | 232 ++++++++++++++++++
 .../patches/binutils-missing-man-pages.patch  |  32 +++
 .../patches/ppc64-revert-gnu-attributes.patch |  65 ++---
 srcpkgs/binutils/template                     |  19 +-
 5 files changed, 296 insertions(+), 112 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
 create mode 100644 srcpkgs/binutils/patches/bfd-close-file-descriptor.patch
 create mode 100644 srcpkgs/binutils/patches/binutils-missing-man-pages.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/bfd-close-file-descriptor.patch b/srcpkgs/binutils/patches/bfd-close-file-descriptor.patch
new file mode 100644
index 000000000000..192d4e02d456
--- /dev/null
+++ b/srcpkgs/binutils/patches/bfd-close-file-descriptor.patch
@@ -0,0 +1,232 @@
+From 1c611b40e6bfc8029bff7696814330b5bc0ee5c0 Mon Sep 17 00:00:00 2001
+From: "H.J. Lu" <hjl.tools@gmail.com>
+Date: Mon, 26 Jul 2021 05:59:55 -0700
+Subject: [PATCH] bfd: Close the file descriptor if there is no archive fd
+
+Close the file descriptor if there is no archive plugin file descriptor
+to avoid running out of file descriptors on thin archives with many
+archive members.
+
+bfd/
+
+	PR ld/28138
+	* plugin.c (bfd_plugin_close_file_descriptor): Close the file
+	descriptor there is no archive plugin file descriptor.
+
+ld/
+
+	PR ld/28138
+	* testsuite/ld-plugin/lto.exp: Run tmpdir/pr28138 only for
+	native build.
+
+	PR ld/28138
+	* testsuite/ld-plugin/lto.exp: Run ld/28138 tests.
+	* testsuite/ld-plugin/pr28138.c: New file.
+	* testsuite/ld-plugin/pr28138-1.c: Likewise.
+	* testsuite/ld-plugin/pr28138-2.c: Likewise.
+	* testsuite/ld-plugin/pr28138-3.c: Likewise.
+	* testsuite/ld-plugin/pr28138-4.c: Likewise.
+	* testsuite/ld-plugin/pr28138-5.c: Likewise.
+	* testsuite/ld-plugin/pr28138-6.c: Likewise.
+	* testsuite/ld-plugin/pr28138-7.c: Likewise.
+
+(cherry picked from commit 5a98fb7513b559e20dfebdbaa2a471afda3b4742)
+(cherry picked from commit 7dc37e1e1209c80e0bab784df6b6bac335e836f2)
+---
+ bfd/plugin.c                       |  8 +++++++
+ ld/testsuite/ld-plugin/lto.exp     | 34 ++++++++++++++++++++++++++++++
+ ld/testsuite/ld-plugin/pr28138-1.c |  6 ++++++
+ ld/testsuite/ld-plugin/pr28138-2.c |  6 ++++++
+ ld/testsuite/ld-plugin/pr28138-3.c |  6 ++++++
+ ld/testsuite/ld-plugin/pr28138-4.c |  6 ++++++
+ ld/testsuite/ld-plugin/pr28138-5.c |  6 ++++++
+ ld/testsuite/ld-plugin/pr28138-6.c |  6 ++++++
+ ld/testsuite/ld-plugin/pr28138-7.c |  6 ++++++
+ ld/testsuite/ld-plugin/pr28138.c   | 20 ++++++++++++++++++
+ 10 files changed, 104 insertions(+)
+ create mode 100644 ld/testsuite/ld-plugin/pr28138-1.c
+ create mode 100644 ld/testsuite/ld-plugin/pr28138-2.c
+ create mode 100644 ld/testsuite/ld-plugin/pr28138-3.c
+ create mode 100644 ld/testsuite/ld-plugin/pr28138-4.c
+ create mode 100644 ld/testsuite/ld-plugin/pr28138-5.c
+ create mode 100644 ld/testsuite/ld-plugin/pr28138-6.c
+ create mode 100644 ld/testsuite/ld-plugin/pr28138-7.c
+ create mode 100644 ld/testsuite/ld-plugin/pr28138.c
+
+diff --git a/bfd/plugin.c b/bfd/plugin.c
+index 6cfa2b66470..3bab8febe88 100644
+--- a/bfd/plugin.c
++++ b/bfd/plugin.c
+@@ -291,6 +291,14 @@ bfd_plugin_close_file_descriptor (bfd *abfd, int fd)
+ 	     && !bfd_is_thin_archive (abfd->my_archive))
+ 	abfd = abfd->my_archive;
+ 
++      /* Close the file descriptor if there is no archive plugin file
++	 descriptor.  */
++      if (abfd->archive_plugin_fd == -1)
++	{
++	  close (fd);
++	  return;
++	}
++
+       abfd->archive_plugin_fd_open_count--;
+       /* Dup the archive plugin file descriptor for later use, which
+ 	 will be closed by _bfd_archive_close_and_cleanup.  */
+diff --git a/ld/testsuite/ld-plugin/lto.exp b/ld/testsuite/ld-plugin/lto.exp
+index def69e43ab3..999d911ce6a 100644
+--- a/ld/testsuite/ld-plugin/lto.exp
++++ b/ld/testsuite/ld-plugin/lto.exp
+@@ -687,6 +687,40 @@ if { [is_elf_format] && [check_lto_shared_available] } {
+     }
+ }
+ 
++run_cc_link_tests [list \
++    [list \
++	"Build pr28138.a" \
++	"-T" "" \
++	{pr28138-1.c pr28138-2.c pr28138-3.c pr28138-4.c pr28138-5.c \
++	 pr28138-6.c pr28138-7.c} {} "pr28138.a" \
++    ] \
++    [list \
++	"Build pr28138.o" \
++	"" "" \
++	{pr28138.c} {} \
++    ] \
++]
++
++set exec_output [run_host_cmd "sh" \
++			      "-c \"ulimit -n 20; \
++			      $CC -Btmpdir/ld -o tmpdir/pr28138 \
++			      tmpdir/pr28138.o tmpdir/pr28138.a\""]
++set exec_output [prune_warnings $exec_output]
++if [string match "" $exec_output] then {
++    if { [isnative] } {
++	set exec_output [run_host_cmd "tmpdir/pr28138" ""]
++	if [string match "PASS" $exec_output] then {
++	    pass "PR ld/28138"
++	} else {
++	    fail "PR ld/28138"
++	}
++    } else {
++	pass "PR ld/28138"
++    }
++} else {
++    fail "PR ld/28138"
++}
++
+ set testname "Build liblto-11.a"
+ remote_file host delete "tmpdir/liblto-11.a"
+ set catch_output [run_host_cmd "$ar" "rc $plug_opt tmpdir/liblto-11.a tmpdir/lto-11a.o tmpdir/lto-11b.o tmpdir/lto-11c.o"]
+diff --git a/ld/testsuite/ld-plugin/pr28138-1.c b/ld/testsuite/ld-plugin/pr28138-1.c
+new file mode 100644
+index 00000000000..51d119e1642
+--- /dev/null
++++ b/ld/testsuite/ld-plugin/pr28138-1.c
+@@ -0,0 +1,6 @@
++extern int a0(void);
++int
++a1(void)
++{
++  return 1 + a0();
++}
+diff --git a/ld/testsuite/ld-plugin/pr28138-2.c b/ld/testsuite/ld-plugin/pr28138-2.c
+new file mode 100644
+index 00000000000..1120cd797e9
+--- /dev/null
++++ b/ld/testsuite/ld-plugin/pr28138-2.c
+@@ -0,0 +1,6 @@
++extern int a1(void);
++int
++a2(void)
++{
++  return 1 + a1();
++}
+diff --git a/ld/testsuite/ld-plugin/pr28138-3.c b/ld/testsuite/ld-plugin/pr28138-3.c
+new file mode 100644
+index 00000000000..ec464947ee6
+--- /dev/null
++++ b/ld/testsuite/ld-plugin/pr28138-3.c
+@@ -0,0 +1,6 @@
++extern int a2(void);
++int
++a3(void)
++{
++  return 1 + a2();
++}
+diff --git a/ld/testsuite/ld-plugin/pr28138-4.c b/ld/testsuite/ld-plugin/pr28138-4.c
+new file mode 100644
+index 00000000000..475701b2c5c
+--- /dev/null
++++ b/ld/testsuite/ld-plugin/pr28138-4.c
+@@ -0,0 +1,6 @@
++extern int a3(void);
++int
++a4(void)
++{
++  return 1 + a3();
++}
+diff --git a/ld/testsuite/ld-plugin/pr28138-5.c b/ld/testsuite/ld-plugin/pr28138-5.c
+new file mode 100644
+index 00000000000..e24f86c363e
+--- /dev/null
++++ b/ld/testsuite/ld-plugin/pr28138-5.c
+@@ -0,0 +1,6 @@
++extern int a4(void);
++int
++a5(void)
++{
++  return 1 + a4();
++}
+diff --git a/ld/testsuite/ld-plugin/pr28138-6.c b/ld/testsuite/ld-plugin/pr28138-6.c
+new file mode 100644
+index 00000000000..b5b938bdb21
+--- /dev/null
++++ b/ld/testsuite/ld-plugin/pr28138-6.c
+@@ -0,0 +1,6 @@
++extern int a5(void);
++int
++a6(void)
++{
++  return 1 + a5();
++}
+diff --git a/ld/testsuite/ld-plugin/pr28138-7.c b/ld/testsuite/ld-plugin/pr28138-7.c
+new file mode 100644
+index 00000000000..4ef75bf0f0c
+--- /dev/null
++++ b/ld/testsuite/ld-plugin/pr28138-7.c
+@@ -0,0 +1,6 @@
++extern int a6(void);
++int
++a7(void)
++{
++  return 1 + a6();
++}
+diff --git a/ld/testsuite/ld-plugin/pr28138.c b/ld/testsuite/ld-plugin/pr28138.c
+new file mode 100644
+index 00000000000..68252c9f382
+--- /dev/null
++++ b/ld/testsuite/ld-plugin/pr28138.c
+@@ -0,0 +1,20 @@
++#include <stdio.h>
++
++extern int a7(void);
++
++int
++a0(void)
++{
++  return 0;
++}
++
++int
++main()
++{
++  if (a7() == 7)
++    {
++      printf ("PASS\n");
++      return 0;
++    }
++  return 1;
++}
+-- 
+2.27.0
+
diff --git a/srcpkgs/binutils/patches/binutils-missing-man-pages.patch b/srcpkgs/binutils/patches/binutils-missing-man-pages.patch
new file mode 100644
index 000000000000..905f6620cc39
--- /dev/null
+++ b/srcpkgs/binutils/patches/binutils-missing-man-pages.patch
@@ -0,0 +1,32 @@
+From 96a7037cd8573cf065aa6b12baca68696f96d9ca Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <siarheit@google.com>
+Date: Mon, 26 Jul 2021 22:51:18 +0100
+Subject: [PATCH] texi2pod.pl: add no-op --no-split option support [PR28144]
+
+Change 2faf902da ("generate single html manual page by default")
+added use of --no-split option to makeinfo. binutils reuses
+makeinfo options for texi2pod.pl wrapper. Unsupported option
+led to silent manpage truncation.
+
+The change adds no-op option support.
+
+etc/
+
+	* texi2pod.pl: Handle no-op --no-split option.
+---
+ etc/texi2pod.pl | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/etc/texi2pod.pl b/etc/texi2pod.pl
+index 11f70d156be..dcf2b437640 100644
+--- a/etc/texi2pod.pl
++++ b/etc/texi2pod.pl
+@@ -59,6 +59,8 @@
+ 	    $flag = shift;
+ 	}
+         push (@ipath, $flag);
++    } elsif (/^--no-split$/) {
++	# ignore option for makeinfo compatibility
+     } elsif (/^-/) {
+ 	usage();
+     } else {
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..6e1fa7731c9e 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,5 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
+2.33.0
 
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..743618a216c3 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,25 +1,36 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.37
+revision=1
 bootstrap=yes
+hostmakedepends="pkg-config"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=820d9724f020a3e69cb337893a0b63c2db161dadcb0e06fc11dc29eb1e84a32c
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
 	subpackages+=" binutils-devel"
 fi
 
+pre_configure() {
+	# Binutils 2.37 ships empty man pages; we apply a patch that fixes the
+	# build system so that it doesn't generate empty man pages, but we need
+	# to delete the empty man pages for the build system to regenerate
+	# them.
+	if [ "$CHROOT_READY" ]; then
+		find -name \*.1 -delete
+	fi
+}
+
 _get_triplet() {
 	if [ -z "$XBPS_TRIPLET" ]; then
 		echo $(

From 6a5e4f2dd647ff6825bd1729db48aa28fec61f83 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 4 Jan 2022 20:42:09 -0800
Subject: [PATCH 2/3] gcc: update to 11.2.1git20211128

---
 common/shlibs                                 |   2 +-
 srcpkgs/gcc/files/libgnarl-musl.patch         |  39 +++--
 srcpkgs/gcc/files/libssp-musl.patch           |  49 +-----
 ...upport-for-musl-typedef-macro-guards.patch | 106 +++++++++++++
 srcpkgs/gcc/patches/fsplit-stack-musl.patch   | 112 ++++++++++++++
 .../gcc/patches/libgcc-ibm128-no-tag.patch    |  21 +--
 srcpkgs/gcc/patches/musl-ada.patch            | 141 ++++++++++--------
 srcpkgs/gcc/template                          |  30 ++--
 8 files changed, 352 insertions(+), 148 deletions(-)
 create mode 100644 srcpkgs/gcc/patches/0040-stddef.h-add-support-for-musl-typedef-macro-guards.patch
 create mode 100644 srcpkgs/gcc/patches/fsplit-stack-musl.patch

diff --git a/common/shlibs b/common/shlibs
index 999d3ad714b8..cbfc366082d8 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -58,7 +58,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.19 libgo-11.2.0_1
 libperl.so.5.34 perl-5.34.0_1
 libgmp.so.10 gmp-5.0.1_1
 libgmpxx.so.4 gmpxx-6.0.0_2
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..ec60c82f9289 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -2,10 +2,16 @@ Source: Alpine Linux
 Upstream: Unknown
 Reason: Patch libgnarl to not use function missing from musl.
 
-diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
---- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
-+++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+---
+ 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 2272f83d68d..1d78456544a 100644
+--- a/gcc/ada/libgnarl/s-osinte__linux.ads
++++ b/gcc/ada/libgnarl/s-osinte__linux.ads
+@@ -401,12 +401,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +24,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -468,11 +462,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -30,10 +36,11 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     type struct_sched_param is record
        sched_priority : int;  --  scheduling priority
     end record;
-diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
---- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
-+++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+diff --git a/gcc/ada/libgnarl/s-taprop__linux.adb b/gcc/ada/libgnarl/s-taprop__linux.adb
+index 757a6cdfdad..82df94f6a00 100644
+--- a/gcc/ada/libgnarl/s-taprop__linux.adb
++++ b/gcc/ada/libgnarl/s-taprop__linux.adb
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Operations is
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +50,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Operations is
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +83,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Operations is
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +99,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Operations is
           return Result;
        end if;
  
@@ -110,7 +117,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Operations is
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
@@ -122,4 +129,6 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
              Result := pthread_rwlock_init (L.RW'Access, RWlock_Attr'Access);
  
              pragma Assert (Result in 0 | ENOMEM);
+-- 
+2.34.0
 
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..ed4444dcdc52 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -1,19 +1,9 @@
-First part taken from Alpine.
-
-Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
+Taken from Alpine.
 
 --- a/gcc/gcc.c
 +++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
- #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
- #endif
+@@ -997,8 +997,7 @@ proper position among the other output files.  */
  
-+#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" \
@@ -22,15 +12,6 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,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:\
 --- 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
@@ -42,29 +23,3 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  The lower bound for a buffer to be considered for stack smashing protection.
  
  -param=stack-clash-protection-guard-size=
---- a/gcc/config/i386/gnu-user-common.h
-+++ b/gcc/config/i386/gnu-user-common.h
-@@ -64,9 +64,3 @@ along with GCC; see the file COPYING3.  If not see
- 
- /* Static stack checking is supported by means of probes.  */
- #define STACK_CHECK_STATIC_BUILTIN 1
--
--/* We only build the -fsplit-stack support in libgcc if the
--   assembler has full support for the CFI directives.  */
--#if HAVE_GAS_CFI_PERSONALITY_DIRECTIVE
--#define TARGET_CAN_SPLIT_STACK
--#endif
---- a/gcc/config/i386/gnu.h
-+++ b/gcc/config/i386/gnu.h
-@@ -40,11 +40,6 @@ along with GCC.  If not, see <http://www.gnu.org/licenses/>.
- /* i386 glibc provides __stack_chk_guard in %gs:0x14.  */
- #define TARGET_THREAD_SSP_OFFSET        0x14
- 
--/* We only build the -fsplit-stack support in libgcc if the
--   assembler has full support for the CFI directives.  */
--#if HAVE_GAS_CFI_PERSONALITY_DIRECTIVE
--#define TARGET_CAN_SPLIT_STACK
--#endif
- /* We steal the last transactional memory word.  */
- #define TARGET_THREAD_SPLIT_STACK_OFFSET 0x30
- #endif
diff --git a/srcpkgs/gcc/patches/0040-stddef.h-add-support-for-musl-typedef-macro-guards.patch b/srcpkgs/gcc/patches/0040-stddef.h-add-support-for-musl-typedef-macro-guards.patch
new file mode 100644
index 000000000000..c22f7f43f3d7
--- /dev/null
+++ b/srcpkgs/gcc/patches/0040-stddef.h-add-support-for-musl-typedef-macro-guards.patch
@@ -0,0 +1,106 @@
+From 5a76cf60df5c9ba274f1d0dcd79fc0cbad9d0fe0 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net>
+Date: Thu, 25 Nov 2021 17:44:04 +0100
+Subject: [PATCH] stddef.h: add support for musl typedef macro guards
+
+The stddef.h header checks/sets various hardcoded toolchain/os specific
+macro guards to prevent redefining types such as ptrdiff_t, wchar_t, or
+size_t. However, without this patch, the file does not check/set the
+typedef macro guards for musl libc. This causes types such as size_t to
+be defined twice for files which include both musl's stddef.h as well as
+GCC's ginclude/stddef.h. This is, for example, the case for
+libgo/sysinfo.c. If libgo/sysinfo.c has multiple typedefs for size_t
+this confuses -fdump-go-spec and causes size_t not to be included in the
+generated type definitions thereby causing a gcc-go compilation failure
+on musl with the following error message:
+
+	sysinfo.go:7765:13: error: use of undefined type '_size_t'
+	 7765 | type Size_t _size_t
+	      |             ^
+	libcall_posix.go:49:35: error: non-integer len argument in make
+	   49 |                 b := make([]byte, len)
+	      |
+
+This commit fixes this issue by ensuring that ptrdiff_t, wchar_t, and size_t
+are only defined once in the pre-processed libgo/sysinfo.c file by enhancing
+gcc/ginclude/stddef.h with musl-specific typedef macro guards.
+---
+ gcc/ginclude/stddef.h | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/gcc/ginclude/stddef.h b/gcc/ginclude/stddef.h
+index 66619fe43b1..50d710a5ab9 100644
+--- a/gcc/ginclude/stddef.h
++++ b/gcc/ginclude/stddef.h
+@@ -128,6 +128,7 @@ _TYPE_wchar_t;
+ #ifndef ___int_ptrdiff_t_h
+ #ifndef _GCC_PTRDIFF_T
+ #ifndef _PTRDIFF_T_DECLARED /* DragonFly */
++#ifndef __DEFINED_ptrdiff_t /* musl libc */
+ #define _PTRDIFF_T
+ #define _T_PTRDIFF_
+ #define _T_PTRDIFF
+@@ -137,10 +138,12 @@ _TYPE_wchar_t;
+ #define ___int_ptrdiff_t_h
+ #define _GCC_PTRDIFF_T
+ #define _PTRDIFF_T_DECLARED
++#define __DEFINED_ptrdiff_t
+ #ifndef __PTRDIFF_TYPE__
+ #define __PTRDIFF_TYPE__ long int
+ #endif
+ typedef __PTRDIFF_TYPE__ ptrdiff_t;
++#endif /* __DEFINED_ptrdiff_t */
+ #endif /* _PTRDIFF_T_DECLARED */
+ #endif /* _GCC_PTRDIFF_T */
+ #endif /* ___int_ptrdiff_t_h */
+@@ -174,6 +177,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t;
+ #ifndef _SIZE_T_DEFINED
+ #ifndef _BSD_SIZE_T_DEFINED_	/* Darwin */
+ #ifndef _SIZE_T_DECLARED	/* FreeBSD 5 */
++#ifndef __DEFINED_size_t	/* musl libc */
+ #ifndef ___int_size_t_h
+ #ifndef _GCC_SIZE_T
+ #ifndef _SIZET_
+@@ -191,6 +195,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t;
+ #define _SIZE_T_DEFINED
+ #define _BSD_SIZE_T_DEFINED_	/* Darwin */
+ #define _SIZE_T_DECLARED	/* FreeBSD 5 */
++#define __DEFINED_size_t	/* musl libc */
+ #define ___int_size_t_h
+ #define _GCC_SIZE_T
+ #define _SIZET_
+@@ -215,6 +220,7 @@ typedef long ssize_t;
+ #endif /* _SIZET_ */
+ #endif /* _GCC_SIZE_T */
+ #endif /* ___int_size_t_h */
++#endif /* __DEFINED_size_t */
+ #endif /* _SIZE_T_DECLARED */
+ #endif /* _BSD_SIZE_T_DEFINED_ */
+ #endif /* _SIZE_T_DEFINED */
+@@ -251,6 +257,7 @@ typedef long ssize_t;
+ #ifndef _BSD_WCHAR_T_DEFINED_    /* Darwin */
+ #ifndef _BSD_RUNE_T_DEFINED_	/* Darwin */
+ #ifndef _WCHAR_T_DECLARED /* FreeBSD 5 */
++#ifndef __DEFINED_wchar_t /* musl libc */
+ #ifndef _WCHAR_T_DEFINED_
+ #ifndef _WCHAR_T_DEFINED
+ #ifndef _WCHAR_T_H
+@@ -272,6 +279,7 @@ typedef long ssize_t;
+ #define __INT_WCHAR_T_H
+ #define _GCC_WCHAR_T
+ #define _WCHAR_T_DECLARED
++#define __DEFINED_wchar_t
+ 
+ /* On BSD/386 1.1, at least, machine/ansi.h defines _BSD_WCHAR_T_
+    instead of _WCHAR_T_, and _BSD_RUNE_T_ (which, unlike the other
+@@ -326,6 +334,7 @@ typedef __WCHAR_TYPE__ wchar_t;
+ #endif
+ #endif
+ #endif
++#endif /* __DEFINED_wchar_t */
+ #endif /* _WCHAR_T_DECLARED */
+ #endif /* _BSD_RUNE_T_DEFINED_ */
+ #endif
+-- 
+2.34.0
+
diff --git a/srcpkgs/gcc/patches/fsplit-stack-musl.patch b/srcpkgs/gcc/patches/fsplit-stack-musl.patch
new file mode 100644
index 000000000000..6b7b60d9d04b
--- /dev/null
+++ b/srcpkgs/gcc/patches/fsplit-stack-musl.patch
@@ -0,0 +1,112 @@
+Subject: [PATCH v2] Disable -fsplit-stack support on non-glibc targets
+From: Sören Tempel <soeren@soeren-tempel.net>
+
+The -fsplit-stack option requires the pthread_t TCB definition in the
+libc to provide certain struct fields at specific hardcoded offsets. As
+far as I know, only glibc provides these fields at the required offsets.
+Most notably, musl libc does not have these fields. However, since gcc
+accesses the fields using a fixed offset, this does not cause a
+compile-time error, but instead results in a silent memory corruption at
+run-time with musl libc. For example, on s390x libgcc's
+__stack_split_initialize CTOR will overwrite the cancel field in the
+pthread_t TCB on musl.
+
+The -fsplit-stack option is used within the gcc code base itself by
+gcc-go (if available). On musl-based systems with split-stack support
+(i.e. s390x or x86) this causes Go programs compiled with gcc-go to
+misbehave at run-time.
+
+This patch fixes gcc-go on musl by disabling -fsplit-stack in gcc itself
+since it is not supported on non-glibc targets anyhow. This is achieved
+by checking if gcc targets a glibc-based system. This check has been
+added for x86 and s390x, the rs6000 config already checks for
+TARGET_GLIBC_MAJOR. Other architectures do not have split-stack
+support. With this patch applied, the gcc-go configure script will
+detect that -fsplit-stack support is not available and will not use it.
+
+See https://www.openwall.com/lists/musl/2012/10/16/12
+
+This patch was written under the assumption that glibc is the only libc
+implementation which supports the required fields at the required
+offsets in the pthread_t TCB. The patch has been tested on Alpine Linux
+Edge on the s390x and x86 architectures by bootstrapping Google's Go
+implementation with gcc-go.
+
+Signed-off-by: Sören Tempel <soeren@soeren-tempel.net>
+
+gcc/ChangeLog:
+
+	* common/config/s390/s390-common.c (s390_supports_split_stack):
+	Only support split-stack on glibc targets.
+	* config/i386/gnu-user-common.h (STACK_CHECK_STATIC_BUILTIN): Ditto.
+	* config/i386/gnu.h (defined): Ditto.
+---
+This version of the patch addresses feedback by Andrew Pinski and uses
+OPTION_GLIBC as well as opts->x_linux_libc == LIBC_GLIBC to detect glibc
+targets (instead of relying on TARGET_GLIBC_MAJOR).
+
+ gcc/common/config/s390/s390-common.c | 11 +++++++++--
+ gcc/config/i386/gnu-user-common.h    |  5 +++--
+ gcc/config/i386/gnu.h                |  6 +++++-
+ 3 files changed, 17 insertions(+), 5 deletions(-)
+
+diff --git a/gcc/common/config/s390/s390-common.c b/gcc/common/config/s390/s390-common.c
+index b6bc8501742..fc86e0bc5e7 100644
+--- a/gcc/common/config/s390/s390-common.c
++++ b/gcc/common/config/s390/s390-common.c
+@@ -116,13 +116,20 @@ s390_handle_option (struct gcc_options *opts ATTRIBUTE_UNUSED,
+ 
+ /* -fsplit-stack uses a field in the TCB, available with glibc-2.23.
+    We don't verify it, since earlier versions just have padding at
+-   its place, which works just as well.  */
++   its place, which works just as well. For other libc implementations
++   we disable the feature entirely to avoid corrupting the TCB.  */
+ 
+ static bool
+ s390_supports_split_stack (bool report ATTRIBUTE_UNUSED,
+ 			   struct gcc_options *opts ATTRIBUTE_UNUSED)
+ {
+-  return true;
++  if (opts->x_linux_libc == LIBC_GLIBC) {
++    return true;
++  } else {
++    if (report)
++      error("%<-fsplit-stack%> currently only supported on GNU/Linux");
++    return false;
++  }
+ }
+ 
+ #undef TARGET_DEFAULT_TARGET_FLAGS
+diff --git a/gcc/config/i386/gnu-user-common.h b/gcc/config/i386/gnu-user-common.h
+index 00226f5a455..6e13315b5a3 100644
+--- a/gcc/config/i386/gnu-user-common.h
++++ b/gcc/config/i386/gnu-user-common.h
+@@ -66,7 +66,8 @@ along with GCC; see the file COPYING3.  If not see
+ #define STACK_CHECK_STATIC_BUILTIN 1
+ 
+ /* We only build the -fsplit-stack support in libgcc if the
+-   assembler has full support for the CFI directives.  */
+-#if HAVE_GAS_CFI_PERSONALITY_DIRECTIVE
++   assembler has full support for the CFI directives and
++   targets glibc.  */
++#if HAVE_GAS_CFI_PERSONALITY_DIRECTIVE && OPTION_GLIBC
+ #define TARGET_CAN_SPLIT_STACK
+ #endif
+diff --git a/gcc/config/i386/gnu.h b/gcc/config/i386/gnu.h
+index 25fbc07f58c..adfe817201e 100644
+--- a/gcc/config/i386/gnu.h
++++ b/gcc/config/i386/gnu.h
+@@ -35,7 +35,11 @@ along with GCC.  If not, see <http://www.gnu.org/licenses/>.
+    crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
+ #endif
+ 
+-#ifdef TARGET_LIBC_PROVIDES_SSP
++/* -fsplit-stack uses a field in the TCB at a fixed offset. This
++   field is only available for glibc. Disable -fsplit-stack for
++   other libc implementation to avoid silent TCB corruptions.  */
++
++#if defined (TARGET_LIBC_PROVIDES_SSP) && OPTION_GLIBC
+ 
+ /* i386 glibc provides __stack_chk_guard in %gs:0x14.  */
+ #define TARGET_THREAD_SSP_OFFSET        0x14
+
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..c2acec586cfc 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -17,22 +17,25 @@ diff --git a/libgcc/config/rs6000/t-ibm-ldouble b/libgcc/config/rs6000/t-ibm-ldo
 index b132784..fb5eca8 100644
 --- a/libgcc/config/rs6000/t-ibm-ldouble
 +++ b/libgcc/config/rs6000/t-ibm-ldouble
-@@ -1,6 +1,6 @@
- # GCC 128-bit long double support routines.
- LIB2ADD += $(srcdir)/config/rs6000/ibm-ldouble.c
+@@ -3,4 +3,6 @@
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ HOST_LIBGCC2_CFLAGS += -mlong-double-128
  
++HOST_LIBGCC2_CFLAGS += -mno-gnu-attribute
++
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-ibm-ldouble.ver
 diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
- SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
+@@ -2,6 +2,8 @@
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+ HOST_LIBGCC2_CFLAGS += -mlong-double-128
+ 
++HOST_LIBGCC2_CFLAGS += -mno-gnu-attribute
++
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+ # would need to take into account targets for which -mcmodel is invalid.
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/musl-ada.patch b/srcpkgs/gcc/patches/musl-ada.patch
index c2c79df0adb7..3a7075f96311 100644
--- a/srcpkgs/gcc/patches/musl-ada.patch
+++ b/srcpkgs/gcc/patches/musl-ada.patch
@@ -1,20 +1,81 @@
+From 0b879c9a3ef83b3b08a0d72bfe89816d52489408 Mon Sep 17 00:00:00 2001
+From: Ariadne Conill <ariadne@dereferenced.org>
+Date: Fri, 21 Aug 2020 07:07:48 +0000
+Subject: [PATCH] ada: musl support fixes
+
+---
+ 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 987eff0abba..03c8bc6f496 100644
+--- a/gcc/ada/Makefile.rtl
++++ b/gcc/ada/Makefile.rtl
+@@ -1748,7 +1748,7 @@ ifeq ($(strip $(filter-out %86 linux%,$(target_cpu) $(target_os))),)
+   s-intman.adb<libgnarl/s-intman__posix.adb \
+   s-tpopsp.adb<libgnarl/s-tpopsp__tls.adb \
+   $(TRASYM_DWARF_UNIX_PAIRS) \
+-  s-tsmona.adb<libgnat/s-tsmona__linux.adb \
++  s-tsmona.adb<libgnat/s-tsmona.adb \
+   a-exetim.adb<libgnarl/a-exetim__posix.adb \
+   a-exetim.ads<libgnarl/a-exetim__default.ads \
+   s-linux.ads<libgnarl/s-linux.ads \
+@@ -2355,7 +2355,7 @@ ifeq ($(strip $(filter-out powerpc% linux%,$(target_cpu) $(target_os))),)
+   s-tasinf.adb<libgnarl/s-tasinf__linux.adb \
+   s-taspri.ads<libgnarl/s-taspri__posix.ads \
+   $(TRASYM_DWARF_UNIX_PAIRS) \
+-  s-tsmona.adb<libgnat/s-tsmona__linux.adb \
++  s-tsmona.adb<libgnat/s-tsmona.adb \
+   $(ATOMICS_TARGET_PAIRS) \
+   $(ATOMICS_BUILTINS_TARGET_PAIRS) \
+   system.ads<libgnat/system-linux-ppc.ads
+@@ -2386,7 +2386,7 @@ ifeq ($(strip $(filter-out powerpc% linux%,$(target_cpu) $(target_os))),)
+ endif
+ 
+ # ARM linux, GNU eabi
+-ifeq ($(strip $(filter-out arm% linux-gnueabi%,$(target_cpu) $(target_os))),)
++ifeq ($(strip $(filter-out arm% linux-gnueabi% linux-musleabi% linux-muslgnueabi%,$(target_cpu) $(target_os))),)
+   LIBGNAT_TARGET_PAIRS = \
+   a-intnam.ads<libgnarl/a-intnam__linux.ads \
+   s-inmaop.adb<libgnarl/s-inmaop__posix.adb \
+@@ -2597,7 +2597,7 @@ ifeq ($(strip $(filter-out %ia64 linux%,$(target_cpu) $(target_os))),)
+   s-tpopsp.adb<libgnarl/s-tpopsp__tls.adb \
+   s-taspri.ads<libgnarl/s-taspri__posix-noaltstack.ads \
+   $(TRASYM_DWARF_UNIX_PAIRS) \
+-  s-tsmona.adb<libgnat/s-tsmona__linux.adb \
++  s-tsmona.adb<libgnat/s-tsmona.adb \
+   $(ATOMICS_TARGET_PAIRS) \
+   $(ATOMICS_BUILTINS_TARGET_PAIRS) \
+   $(GNATRTL_128BIT_PAIRS) \
+@@ -2699,7 +2699,7 @@ ifeq ($(strip $(filter-out %x86_64 linux%,$(target_cpu) $(target_os))),)
+   s-tpopsp.adb<libgnarl/s-tpopsp__tls.adb \
+   s-taspri.ads<libgnarl/s-taspri__posix.ads \
+   $(TRASYM_DWARF_UNIX_PAIRS) \
+-  s-tsmona.adb<libgnat/s-tsmona__linux.adb \
++  s-tsmona.adb<libgnat/s-tsmona.adb \
+   $(ATOMICS_TARGET_PAIRS) \
+   $(X86_64_TARGET_PAIRS) \
+   $(GNATRTL_128BIT_PAIRS) \
 diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c
-index 3b0aea9..ee0bb69 100644
+index 2e54e69643a..e7e6507e2e0 100644
 --- a/gcc/ada/adaint.c
 +++ b/gcc/ada/adaint.c
-@@ -76,6 +76,11 @@
+@@ -91,6 +91,11 @@
  #include <sys/param.h>
  #include <sys/pstat.h>
  #endif
 + 
-+#if defined (linux)
++#if defined (linux) || defined(__linux__)
 +#define _GNU_SOURCE 1
 +#include <sched.h>
 +#endif
  
  #ifdef __PikeOS__
  #define __BSD_VISIBLE 1
-@@ -3255,7 +3260,6 @@ __gnat_lwp_self (void)
+@@ -3442,7 +3447,6 @@ __gnat_lwp_self (void)
  #endif
  
  #if defined (__linux__)
@@ -22,7 +83,7 @@ index 3b0aea9..ee0bb69 100644
  
  /* glibc versions earlier than 2.7 do not define the routines to handle
     dynamically allocated CPU sets. For these targets, we use the static
-@@ -3265,7 +3269,7 @@ __gnat_lwp_self (void)
+@@ -3452,7 +3456,7 @@ __gnat_lwp_self (void)
  
  /* Dynamic cpu sets */
  
@@ -31,7 +92,7 @@ index 3b0aea9..ee0bb69 100644
  __gnat_cpu_alloc (size_t count)
  {
    return CPU_ALLOC (count);
-@@ -3278,33 +3282,33 @@ __gnat_cpu_alloc_size (size_t count)
+@@ -3465,33 +3469,33 @@ __gnat_cpu_alloc_size (size_t count)
  }
  
  void
@@ -73,7 +134,7 @@ index 3b0aea9..ee0bb69 100644
  }
  
  size_t
-@@ -3314,23 +3318,23 @@ __gnat_cpu_alloc_size (size_t count ATTRIBUTE_UNUSED)
+@@ -3501,23 +3505,23 @@ __gnat_cpu_alloc_size (size_t count ATTRIBUTE_UNUSED)
  }
  
  void
@@ -103,10 +164,10 @@ index 3b0aea9..ee0bb69 100644
  #endif /* !CPU_ALLOC */
  #endif /* __linux__ */
 diff --git a/gcc/ada/adaint.h b/gcc/ada/adaint.h
-index 0d12f7e..a063b47 100644
+index 85997b9ba68..fd10e5b5589 100644
 --- a/gcc/ada/adaint.h
 +++ b/gcc/ada/adaint.h
-@@ -316,13 +316,11 @@ extern void   *__gnat_lwp_self			   (void);
+@@ -325,13 +325,11 @@ extern void   *__gnat_lwp_self			   (void);
  
  /* Routines for interface to required CPU set primitives */
  
@@ -124,56 +185,11 @@ index 0d12f7e..a063b47 100644
  #endif
  
  #if defined (_WIN32)
---- a/gcc/ada/Makefile.rtl	2020-07-23 08:35:17.052381336 +0200
-+++ b/gcc/ada/Makefile.rtl	2020-07-23 08:35:17.052381336 +0200
-@@ -1533,7 +1533,7 @@
-   s-intman.adb<libgnarl/s-intman__posix.adb \
-   s-tpopsp.adb<libgnarl/s-tpopsp__tls.adb \
-   $(TRASYM_DWARF_UNIX_PAIRS) \
--  s-tsmona.adb<libgnat/s-tsmona__linux.adb \
-+  s-tsmona.adb<libgnat/s-tsmona.adb \
-   a-exetim.adb<libgnarl/a-exetim__posix.adb \
-   a-exetim.ads<libgnarl/a-exetim__default.ads \
-   s-linux.ads<libgnarl/s-linux.ads \
-@@ -2083,7 +2083,7 @@
-   s-osinte.adb<libgnarl/s-osinte__posix.adb \
-   s-tpopsp.adb<libgnarl/s-tpopsp__tls.adb \
-   $(TRASYM_DWARF_UNIX_PAIRS) \
--  s-tsmona.adb<libgnat/s-tsmona__linux.adb \
-+  s-tsmona.adb<libgnat/s-tsmona.adb \
-   $(ATOMICS_TARGET_PAIRS) \
-   $(ATOMICS_BUILTINS_TARGET_PAIRS) \
-   system.ads<libgnat/system-linux-ppc.ads
-@@ -2112,7 +2112,7 @@
- endif
- 
- # ARM linux, GNU eabi
--ifeq ($(strip $(filter-out arm% linux-gnueabi%,$(target_cpu) $(target_os))),)
-+ifeq ($(strip $(filter-out arm% linux-gnueabi% linux-musleabi% linux-muslgnueabi%,$(target_cpu) $(target_os))),)
-   LIBGNAT_TARGET_PAIRS = \
-   a-intnam.ads<libgnarl/a-intnam__linux.ads \
-   s-inmaop.adb<libgnarl/s-inmaop__posix.adb \
-@@ -2305,7 +2305,7 @@
-   s-tpopsp.adb<libgnarl/s-tpopsp__tls.adb \
-   s-taspri.ads<libgnarl/s-taspri__posix-noaltstack.ads \
-   $(TRASYM_DWARF_UNIX_PAIRS) \
--  s-tsmona.adb<libgnat/s-tsmona__linux.adb \
-+  s-tsmona.adb<libgnat/s-tsmona.adb \
-   $(ATOMICS_TARGET_PAIRS) \
-   $(ATOMICS_BUILTINS_TARGET_PAIRS) \
-   system.ads<libgnat/system-linux-ia64.ads
-@@ -2401,7 +2401,7 @@
-   s-tpopsp.adb<libgnarl/s-tpopsp__tls.adb \
-   s-taspri.ads<libgnarl/s-taspri__posix.ads \
-   $(TRASYM_DWARF_UNIX_PAIRS) \
--  s-tsmona.adb<libgnat/s-tsmona__linux.adb \
-+  s-tsmona.adb<libgnat/s-tsmona.adb \
-   $(ATOMICS_TARGET_PAIRS) \
-   $(X86_64_TARGET_PAIRS) \
-   system.ads<libgnat/system-linux-x86.ads
---- a/gcc/ada/terminals.c	2019-01-08 10:54:04.000000000 +0100
-+++ b/gcc/ada/terminals.c	2019-05-15 13:14:09.935742526 +0200
-@@ -1136,7 +1136,7 @@
+diff --git a/gcc/ada/terminals.c b/gcc/ada/terminals.c
+index ec9db3a6a4c..6f92e50dd67 100644
+--- a/gcc/ada/terminals.c
++++ b/gcc/ada/terminals.c
+@@ -1132,7 +1132,7 @@ __gnat_setup_winsize (void *desc ATTRIBUTE_UNUSED,
  /* POSIX does not specify how to open the master side of a terminal.Several
     methods are available (system specific):
        1- using a cloning device (USE_CLONE_DEVICE)
@@ -182,7 +198,7 @@ index 0d12f7e..a063b47 100644
        3- openpty                (USE_OPENPTY)
  
     When using the cloning device method, the macro USE_CLONE_DEVICE should
-@@ -1150,7 +1150,7 @@
+@@ -1146,7 +1146,7 @@ __gnat_setup_winsize (void *desc ATTRIBUTE_UNUSED,
  #if defined (__APPLE__) || defined (BSD)
  #define USE_OPENPTY
  #elif defined (__linux__)
@@ -191,7 +207,7 @@ index 0d12f7e..a063b47 100644
  #elif defined (__sun__)
  #define USE_CLONE_DEVICE "/dev/ptmx"
  #elif defined (_AIX)
-@@ -1199,8 +1199,8 @@
+@@ -1195,8 +1195,8 @@ allocate_pty_desc (pty_desc **desc) {
     int  master_fd   = -1;
     char *slave_name = NULL;
  
@@ -202,3 +218,6 @@ index 0d12f7e..a063b47 100644
  #elif defined (USE_OPENPTY)
    status = openpty (&master_fd, &slave_fd, NULL, NULL, NULL);
  #elif defined (USE_CLONE_DEVICE)
+-- 
+2.34.0
+
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..d7adc658eeb6 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,35 +3,35 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
-_patchver="${version%pre*}"
+# we are using an 11-stable 9b6ad13 git snapshot alpine is using
+# in order to get regression fixes not yet incorporated into the
+# latest stable release
+version=11.2.1git20211128
+revision=1
+_patchver="${version%git*}"
 _minorver="${_patchver%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
-wrksrc=gcc-${version/pre/_pre}
+_mpc_version=1.2.1
+_isl_version=0.24
+wrksrc=gcc-${version/git/_git}
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ https://dev.alpinelinux.org/~nenolod/gcc-${version/git/_git}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="a058c487c36f07a2c98ab2297c990136516cd7444f73199f0da8bf8232641d92
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes

From 9f344b4c442ead0f5365a0fa7246d0a5cbba2f23 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 4 Jan 2022 22:51:14 -0800
Subject: [PATCH 3/3] libtool: revbump for gcc update

---
 srcpkgs/libtool/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..46ddf4f1c70d 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
 version=2.4.6
-revision=6
+revision=7
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 11.2.1git20211128
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
@ 2022-01-26 19:41 ` dkwo
  2022-01-26 22:12 ` oreo639
                   ` (263 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: dkwo @ 2022-01-26 19:41 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 487 bytes --]

New comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1022539606

Comment:
I was getting a bunch of `WARNING: usr/lib/*.so should be in -devel package` as well as
```
=> WARNING: libada-11.2.1git20211128_1: libgnarl-11.so not found in common/shlibs!
=> WARNING: libada-11.2.1git20211128_1: libgnat-11.so not found in common/shlibs!
=> WARNING: gcc-11.2.1git20211128_1: libcp1plugin.so.0 not found in common/shlibs!
```

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 11.2.1git20211128
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
  2022-01-26 19:41 ` dkwo
@ 2022-01-26 22:12 ` oreo639
  2022-01-26 23:16 ` oreo639
                   ` (262 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-01-26 22:12 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 210 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1022651196

Comment:
Thank you for pointing those out, I'll fix that when I am available.

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 11.2.1git20211128
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
  2022-01-26 19:41 ` dkwo
  2022-01-26 22:12 ` oreo639
@ 2022-01-26 23:16 ` oreo639
  2022-01-26 23:16 ` [PR PATCH] [Updated] " oreo639
                   ` (261 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-01-26 23:16 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 364 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1022651196

Comment:
> => WARNING: gcc-11.2.1git20211128_1: libcp1plugin.so.0 not found in common/shlibs!

`libcp1plugin.so.0` is in the current gcc 10 package and isn't in shlibs, so I assume that isn't an issue since nothing depends on it.

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 11.2.1git20211128
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (2 preceding siblings ...)
  2022-01-26 23:16 ` oreo639
@ 2022-01-26 23:16 ` oreo639
  2022-01-26 23:25 ` oreo639
                   ` (260 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-01-26 23:16 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1728 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 11.2.1git20211128
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Note: depends on https://github.com/void-linux/void-packages/pull/32330
(Otherwise, it would work until you try recompiling glibc)

I tested this PR with glibc and it appears to work fine so far, aside from the issue mentioned earlier.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 11 doesn't appear to result in any issues.

Please let me know if there are any issues.

(Related: https://github.com/void-linux/void-packages/pull/34153)

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 48850 bytes --]

From 3385c6500defc873cd57bf293c938f81421165d6 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 4 Jan 2022 20:41:41 -0800
Subject: [PATCH 1/3] binutils: update to 2.37

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch |  60 -----
 .../patches/bfd-close-file-descriptor.patch   | 232 ++++++++++++++++++
 .../patches/binutils-missing-man-pages.patch  |  32 +++
 .../patches/ppc64-revert-gnu-attributes.patch |  65 ++---
 srcpkgs/binutils/template                     |  19 +-
 5 files changed, 296 insertions(+), 112 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
 create mode 100644 srcpkgs/binutils/patches/bfd-close-file-descriptor.patch
 create mode 100644 srcpkgs/binutils/patches/binutils-missing-man-pages.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/bfd-close-file-descriptor.patch b/srcpkgs/binutils/patches/bfd-close-file-descriptor.patch
new file mode 100644
index 000000000000..192d4e02d456
--- /dev/null
+++ b/srcpkgs/binutils/patches/bfd-close-file-descriptor.patch
@@ -0,0 +1,232 @@
+From 1c611b40e6bfc8029bff7696814330b5bc0ee5c0 Mon Sep 17 00:00:00 2001
+From: "H.J. Lu" <hjl.tools@gmail.com>
+Date: Mon, 26 Jul 2021 05:59:55 -0700
+Subject: [PATCH] bfd: Close the file descriptor if there is no archive fd
+
+Close the file descriptor if there is no archive plugin file descriptor
+to avoid running out of file descriptors on thin archives with many
+archive members.
+
+bfd/
+
+	PR ld/28138
+	* plugin.c (bfd_plugin_close_file_descriptor): Close the file
+	descriptor there is no archive plugin file descriptor.
+
+ld/
+
+	PR ld/28138
+	* testsuite/ld-plugin/lto.exp: Run tmpdir/pr28138 only for
+	native build.
+
+	PR ld/28138
+	* testsuite/ld-plugin/lto.exp: Run ld/28138 tests.
+	* testsuite/ld-plugin/pr28138.c: New file.
+	* testsuite/ld-plugin/pr28138-1.c: Likewise.
+	* testsuite/ld-plugin/pr28138-2.c: Likewise.
+	* testsuite/ld-plugin/pr28138-3.c: Likewise.
+	* testsuite/ld-plugin/pr28138-4.c: Likewise.
+	* testsuite/ld-plugin/pr28138-5.c: Likewise.
+	* testsuite/ld-plugin/pr28138-6.c: Likewise.
+	* testsuite/ld-plugin/pr28138-7.c: Likewise.
+
+(cherry picked from commit 5a98fb7513b559e20dfebdbaa2a471afda3b4742)
+(cherry picked from commit 7dc37e1e1209c80e0bab784df6b6bac335e836f2)
+---
+ bfd/plugin.c                       |  8 +++++++
+ ld/testsuite/ld-plugin/lto.exp     | 34 ++++++++++++++++++++++++++++++
+ ld/testsuite/ld-plugin/pr28138-1.c |  6 ++++++
+ ld/testsuite/ld-plugin/pr28138-2.c |  6 ++++++
+ ld/testsuite/ld-plugin/pr28138-3.c |  6 ++++++
+ ld/testsuite/ld-plugin/pr28138-4.c |  6 ++++++
+ ld/testsuite/ld-plugin/pr28138-5.c |  6 ++++++
+ ld/testsuite/ld-plugin/pr28138-6.c |  6 ++++++
+ ld/testsuite/ld-plugin/pr28138-7.c |  6 ++++++
+ ld/testsuite/ld-plugin/pr28138.c   | 20 ++++++++++++++++++
+ 10 files changed, 104 insertions(+)
+ create mode 100644 ld/testsuite/ld-plugin/pr28138-1.c
+ create mode 100644 ld/testsuite/ld-plugin/pr28138-2.c
+ create mode 100644 ld/testsuite/ld-plugin/pr28138-3.c
+ create mode 100644 ld/testsuite/ld-plugin/pr28138-4.c
+ create mode 100644 ld/testsuite/ld-plugin/pr28138-5.c
+ create mode 100644 ld/testsuite/ld-plugin/pr28138-6.c
+ create mode 100644 ld/testsuite/ld-plugin/pr28138-7.c
+ create mode 100644 ld/testsuite/ld-plugin/pr28138.c
+
+diff --git a/bfd/plugin.c b/bfd/plugin.c
+index 6cfa2b66470..3bab8febe88 100644
+--- a/bfd/plugin.c
++++ b/bfd/plugin.c
+@@ -291,6 +291,14 @@ bfd_plugin_close_file_descriptor (bfd *abfd, int fd)
+ 	     && !bfd_is_thin_archive (abfd->my_archive))
+ 	abfd = abfd->my_archive;
+ 
++      /* Close the file descriptor if there is no archive plugin file
++	 descriptor.  */
++      if (abfd->archive_plugin_fd == -1)
++	{
++	  close (fd);
++	  return;
++	}
++
+       abfd->archive_plugin_fd_open_count--;
+       /* Dup the archive plugin file descriptor for later use, which
+ 	 will be closed by _bfd_archive_close_and_cleanup.  */
+diff --git a/ld/testsuite/ld-plugin/lto.exp b/ld/testsuite/ld-plugin/lto.exp
+index def69e43ab3..999d911ce6a 100644
+--- a/ld/testsuite/ld-plugin/lto.exp
++++ b/ld/testsuite/ld-plugin/lto.exp
+@@ -687,6 +687,40 @@ if { [is_elf_format] && [check_lto_shared_available] } {
+     }
+ }
+ 
++run_cc_link_tests [list \
++    [list \
++	"Build pr28138.a" \
++	"-T" "" \
++	{pr28138-1.c pr28138-2.c pr28138-3.c pr28138-4.c pr28138-5.c \
++	 pr28138-6.c pr28138-7.c} {} "pr28138.a" \
++    ] \
++    [list \
++	"Build pr28138.o" \
++	"" "" \
++	{pr28138.c} {} \
++    ] \
++]
++
++set exec_output [run_host_cmd "sh" \
++			      "-c \"ulimit -n 20; \
++			      $CC -Btmpdir/ld -o tmpdir/pr28138 \
++			      tmpdir/pr28138.o tmpdir/pr28138.a\""]
++set exec_output [prune_warnings $exec_output]
++if [string match "" $exec_output] then {
++    if { [isnative] } {
++	set exec_output [run_host_cmd "tmpdir/pr28138" ""]
++	if [string match "PASS" $exec_output] then {
++	    pass "PR ld/28138"
++	} else {
++	    fail "PR ld/28138"
++	}
++    } else {
++	pass "PR ld/28138"
++    }
++} else {
++    fail "PR ld/28138"
++}
++
+ set testname "Build liblto-11.a"
+ remote_file host delete "tmpdir/liblto-11.a"
+ set catch_output [run_host_cmd "$ar" "rc $plug_opt tmpdir/liblto-11.a tmpdir/lto-11a.o tmpdir/lto-11b.o tmpdir/lto-11c.o"]
+diff --git a/ld/testsuite/ld-plugin/pr28138-1.c b/ld/testsuite/ld-plugin/pr28138-1.c
+new file mode 100644
+index 00000000000..51d119e1642
+--- /dev/null
++++ b/ld/testsuite/ld-plugin/pr28138-1.c
+@@ -0,0 +1,6 @@
++extern int a0(void);
++int
++a1(void)
++{
++  return 1 + a0();
++}
+diff --git a/ld/testsuite/ld-plugin/pr28138-2.c b/ld/testsuite/ld-plugin/pr28138-2.c
+new file mode 100644
+index 00000000000..1120cd797e9
+--- /dev/null
++++ b/ld/testsuite/ld-plugin/pr28138-2.c
+@@ -0,0 +1,6 @@
++extern int a1(void);
++int
++a2(void)
++{
++  return 1 + a1();
++}
+diff --git a/ld/testsuite/ld-plugin/pr28138-3.c b/ld/testsuite/ld-plugin/pr28138-3.c
+new file mode 100644
+index 00000000000..ec464947ee6
+--- /dev/null
++++ b/ld/testsuite/ld-plugin/pr28138-3.c
+@@ -0,0 +1,6 @@
++extern int a2(void);
++int
++a3(void)
++{
++  return 1 + a2();
++}
+diff --git a/ld/testsuite/ld-plugin/pr28138-4.c b/ld/testsuite/ld-plugin/pr28138-4.c
+new file mode 100644
+index 00000000000..475701b2c5c
+--- /dev/null
++++ b/ld/testsuite/ld-plugin/pr28138-4.c
+@@ -0,0 +1,6 @@
++extern int a3(void);
++int
++a4(void)
++{
++  return 1 + a3();
++}
+diff --git a/ld/testsuite/ld-plugin/pr28138-5.c b/ld/testsuite/ld-plugin/pr28138-5.c
+new file mode 100644
+index 00000000000..e24f86c363e
+--- /dev/null
++++ b/ld/testsuite/ld-plugin/pr28138-5.c
+@@ -0,0 +1,6 @@
++extern int a4(void);
++int
++a5(void)
++{
++  return 1 + a4();
++}
+diff --git a/ld/testsuite/ld-plugin/pr28138-6.c b/ld/testsuite/ld-plugin/pr28138-6.c
+new file mode 100644
+index 00000000000..b5b938bdb21
+--- /dev/null
++++ b/ld/testsuite/ld-plugin/pr28138-6.c
+@@ -0,0 +1,6 @@
++extern int a5(void);
++int
++a6(void)
++{
++  return 1 + a5();
++}
+diff --git a/ld/testsuite/ld-plugin/pr28138-7.c b/ld/testsuite/ld-plugin/pr28138-7.c
+new file mode 100644
+index 00000000000..4ef75bf0f0c
+--- /dev/null
++++ b/ld/testsuite/ld-plugin/pr28138-7.c
+@@ -0,0 +1,6 @@
++extern int a6(void);
++int
++a7(void)
++{
++  return 1 + a6();
++}
+diff --git a/ld/testsuite/ld-plugin/pr28138.c b/ld/testsuite/ld-plugin/pr28138.c
+new file mode 100644
+index 00000000000..68252c9f382
+--- /dev/null
++++ b/ld/testsuite/ld-plugin/pr28138.c
+@@ -0,0 +1,20 @@
++#include <stdio.h>
++
++extern int a7(void);
++
++int
++a0(void)
++{
++  return 0;
++}
++
++int
++main()
++{
++  if (a7() == 7)
++    {
++      printf ("PASS\n");
++      return 0;
++    }
++  return 1;
++}
+-- 
+2.27.0
+
diff --git a/srcpkgs/binutils/patches/binutils-missing-man-pages.patch b/srcpkgs/binutils/patches/binutils-missing-man-pages.patch
new file mode 100644
index 000000000000..905f6620cc39
--- /dev/null
+++ b/srcpkgs/binutils/patches/binutils-missing-man-pages.patch
@@ -0,0 +1,32 @@
+From 96a7037cd8573cf065aa6b12baca68696f96d9ca Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <siarheit@google.com>
+Date: Mon, 26 Jul 2021 22:51:18 +0100
+Subject: [PATCH] texi2pod.pl: add no-op --no-split option support [PR28144]
+
+Change 2faf902da ("generate single html manual page by default")
+added use of --no-split option to makeinfo. binutils reuses
+makeinfo options for texi2pod.pl wrapper. Unsupported option
+led to silent manpage truncation.
+
+The change adds no-op option support.
+
+etc/
+
+	* texi2pod.pl: Handle no-op --no-split option.
+---
+ etc/texi2pod.pl | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/etc/texi2pod.pl b/etc/texi2pod.pl
+index 11f70d156be..dcf2b437640 100644
+--- a/etc/texi2pod.pl
++++ b/etc/texi2pod.pl
+@@ -59,6 +59,8 @@
+ 	    $flag = shift;
+ 	}
+         push (@ipath, $flag);
++    } elsif (/^--no-split$/) {
++	# ignore option for makeinfo compatibility
+     } elsif (/^-/) {
+ 	usage();
+     } else {
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..6e1fa7731c9e 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,5 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
+2.33.0
 
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..743618a216c3 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,25 +1,36 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.37
+revision=1
 bootstrap=yes
+hostmakedepends="pkg-config"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=820d9724f020a3e69cb337893a0b63c2db161dadcb0e06fc11dc29eb1e84a32c
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
 	subpackages+=" binutils-devel"
 fi
 
+pre_configure() {
+	# Binutils 2.37 ships empty man pages; we apply a patch that fixes the
+	# build system so that it doesn't generate empty man pages, but we need
+	# to delete the empty man pages for the build system to regenerate
+	# them.
+	if [ "$CHROOT_READY" ]; then
+		find -name \*.1 -delete
+	fi
+}
+
 _get_triplet() {
 	if [ -z "$XBPS_TRIPLET" ]; then
 		echo $(

From 8288603096873e75fe36368ecb97aed22feb7f49 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 4 Jan 2022 20:42:09 -0800
Subject: [PATCH 2/3] gcc: update to 11.2.1git20211128

---
 common/shlibs                                 |   6 +-
 srcpkgs/gcc/files/libgnarl-musl.patch         |  39 +++--
 srcpkgs/gcc/files/libssp-musl.patch           |  49 +-----
 ...upport-for-musl-typedef-macro-guards.patch | 106 +++++++++++++
 srcpkgs/gcc/patches/fsplit-stack-musl.patch   | 112 ++++++++++++++
 .../gcc/patches/libgcc-ibm128-no-tag.patch    |  21 +--
 srcpkgs/gcc/patches/musl-ada.patch            | 141 ++++++++++--------
 srcpkgs/gcc/template                          |  30 ++--
 8 files changed, 354 insertions(+), 150 deletions(-)
 create mode 100644 srcpkgs/gcc/patches/0040-stddef.h-add-support-for-musl-typedef-macro-guards.patch
 create mode 100644 srcpkgs/gcc/patches/fsplit-stack-musl.patch

diff --git a/common/shlibs b/common/shlibs
index 999d3ad714b8..0d397db35298 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -58,7 +58,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.19 libgo-11.2.1_1
 libperl.so.5.34 perl-5.34.0_1
 libgmp.so.10 gmp-5.0.1_1
 libgmpxx.so.4 gmpxx-6.0.0_2
@@ -843,8 +843,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-11.so libada-11.2.1_1
+libgnat-11.so libada-11.2.1_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..ec60c82f9289 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -2,10 +2,16 @@ Source: Alpine Linux
 Upstream: Unknown
 Reason: Patch libgnarl to not use function missing from musl.
 
-diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
---- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
-+++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+---
+ 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 2272f83d68d..1d78456544a 100644
+--- a/gcc/ada/libgnarl/s-osinte__linux.ads
++++ b/gcc/ada/libgnarl/s-osinte__linux.ads
+@@ -401,12 +401,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +24,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -468,11 +462,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -30,10 +36,11 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     type struct_sched_param is record
        sched_priority : int;  --  scheduling priority
     end record;
-diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
---- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
-+++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+diff --git a/gcc/ada/libgnarl/s-taprop__linux.adb b/gcc/ada/libgnarl/s-taprop__linux.adb
+index 757a6cdfdad..82df94f6a00 100644
+--- a/gcc/ada/libgnarl/s-taprop__linux.adb
++++ b/gcc/ada/libgnarl/s-taprop__linux.adb
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Operations is
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +50,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Operations is
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +83,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Operations is
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +99,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Operations is
           return Result;
        end if;
  
@@ -110,7 +117,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Operations is
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
@@ -122,4 +129,6 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
              Result := pthread_rwlock_init (L.RW'Access, RWlock_Attr'Access);
  
              pragma Assert (Result in 0 | ENOMEM);
+-- 
+2.34.0
 
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..ed4444dcdc52 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -1,19 +1,9 @@
-First part taken from Alpine.
-
-Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
+Taken from Alpine.
 
 --- a/gcc/gcc.c
 +++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
- #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
- #endif
+@@ -997,8 +997,7 @@ proper position among the other output files.  */
  
-+#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" \
@@ -22,15 +12,6 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,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:\
 --- 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
@@ -42,29 +23,3 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  The lower bound for a buffer to be considered for stack smashing protection.
  
  -param=stack-clash-protection-guard-size=
---- a/gcc/config/i386/gnu-user-common.h
-+++ b/gcc/config/i386/gnu-user-common.h
-@@ -64,9 +64,3 @@ along with GCC; see the file COPYING3.  If not see
- 
- /* Static stack checking is supported by means of probes.  */
- #define STACK_CHECK_STATIC_BUILTIN 1
--
--/* We only build the -fsplit-stack support in libgcc if the
--   assembler has full support for the CFI directives.  */
--#if HAVE_GAS_CFI_PERSONALITY_DIRECTIVE
--#define TARGET_CAN_SPLIT_STACK
--#endif
---- a/gcc/config/i386/gnu.h
-+++ b/gcc/config/i386/gnu.h
-@@ -40,11 +40,6 @@ along with GCC.  If not, see <http://www.gnu.org/licenses/>.
- /* i386 glibc provides __stack_chk_guard in %gs:0x14.  */
- #define TARGET_THREAD_SSP_OFFSET        0x14
- 
--/* We only build the -fsplit-stack support in libgcc if the
--   assembler has full support for the CFI directives.  */
--#if HAVE_GAS_CFI_PERSONALITY_DIRECTIVE
--#define TARGET_CAN_SPLIT_STACK
--#endif
- /* We steal the last transactional memory word.  */
- #define TARGET_THREAD_SPLIT_STACK_OFFSET 0x30
- #endif
diff --git a/srcpkgs/gcc/patches/0040-stddef.h-add-support-for-musl-typedef-macro-guards.patch b/srcpkgs/gcc/patches/0040-stddef.h-add-support-for-musl-typedef-macro-guards.patch
new file mode 100644
index 000000000000..c22f7f43f3d7
--- /dev/null
+++ b/srcpkgs/gcc/patches/0040-stddef.h-add-support-for-musl-typedef-macro-guards.patch
@@ -0,0 +1,106 @@
+From 5a76cf60df5c9ba274f1d0dcd79fc0cbad9d0fe0 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net>
+Date: Thu, 25 Nov 2021 17:44:04 +0100
+Subject: [PATCH] stddef.h: add support for musl typedef macro guards
+
+The stddef.h header checks/sets various hardcoded toolchain/os specific
+macro guards to prevent redefining types such as ptrdiff_t, wchar_t, or
+size_t. However, without this patch, the file does not check/set the
+typedef macro guards for musl libc. This causes types such as size_t to
+be defined twice for files which include both musl's stddef.h as well as
+GCC's ginclude/stddef.h. This is, for example, the case for
+libgo/sysinfo.c. If libgo/sysinfo.c has multiple typedefs for size_t
+this confuses -fdump-go-spec and causes size_t not to be included in the
+generated type definitions thereby causing a gcc-go compilation failure
+on musl with the following error message:
+
+	sysinfo.go:7765:13: error: use of undefined type '_size_t'
+	 7765 | type Size_t _size_t
+	      |             ^
+	libcall_posix.go:49:35: error: non-integer len argument in make
+	   49 |                 b := make([]byte, len)
+	      |
+
+This commit fixes this issue by ensuring that ptrdiff_t, wchar_t, and size_t
+are only defined once in the pre-processed libgo/sysinfo.c file by enhancing
+gcc/ginclude/stddef.h with musl-specific typedef macro guards.
+---
+ gcc/ginclude/stddef.h | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/gcc/ginclude/stddef.h b/gcc/ginclude/stddef.h
+index 66619fe43b1..50d710a5ab9 100644
+--- a/gcc/ginclude/stddef.h
++++ b/gcc/ginclude/stddef.h
+@@ -128,6 +128,7 @@ _TYPE_wchar_t;
+ #ifndef ___int_ptrdiff_t_h
+ #ifndef _GCC_PTRDIFF_T
+ #ifndef _PTRDIFF_T_DECLARED /* DragonFly */
++#ifndef __DEFINED_ptrdiff_t /* musl libc */
+ #define _PTRDIFF_T
+ #define _T_PTRDIFF_
+ #define _T_PTRDIFF
+@@ -137,10 +138,12 @@ _TYPE_wchar_t;
+ #define ___int_ptrdiff_t_h
+ #define _GCC_PTRDIFF_T
+ #define _PTRDIFF_T_DECLARED
++#define __DEFINED_ptrdiff_t
+ #ifndef __PTRDIFF_TYPE__
+ #define __PTRDIFF_TYPE__ long int
+ #endif
+ typedef __PTRDIFF_TYPE__ ptrdiff_t;
++#endif /* __DEFINED_ptrdiff_t */
+ #endif /* _PTRDIFF_T_DECLARED */
+ #endif /* _GCC_PTRDIFF_T */
+ #endif /* ___int_ptrdiff_t_h */
+@@ -174,6 +177,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t;
+ #ifndef _SIZE_T_DEFINED
+ #ifndef _BSD_SIZE_T_DEFINED_	/* Darwin */
+ #ifndef _SIZE_T_DECLARED	/* FreeBSD 5 */
++#ifndef __DEFINED_size_t	/* musl libc */
+ #ifndef ___int_size_t_h
+ #ifndef _GCC_SIZE_T
+ #ifndef _SIZET_
+@@ -191,6 +195,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t;
+ #define _SIZE_T_DEFINED
+ #define _BSD_SIZE_T_DEFINED_	/* Darwin */
+ #define _SIZE_T_DECLARED	/* FreeBSD 5 */
++#define __DEFINED_size_t	/* musl libc */
+ #define ___int_size_t_h
+ #define _GCC_SIZE_T
+ #define _SIZET_
+@@ -215,6 +220,7 @@ typedef long ssize_t;
+ #endif /* _SIZET_ */
+ #endif /* _GCC_SIZE_T */
+ #endif /* ___int_size_t_h */
++#endif /* __DEFINED_size_t */
+ #endif /* _SIZE_T_DECLARED */
+ #endif /* _BSD_SIZE_T_DEFINED_ */
+ #endif /* _SIZE_T_DEFINED */
+@@ -251,6 +257,7 @@ typedef long ssize_t;
+ #ifndef _BSD_WCHAR_T_DEFINED_    /* Darwin */
+ #ifndef _BSD_RUNE_T_DEFINED_	/* Darwin */
+ #ifndef _WCHAR_T_DECLARED /* FreeBSD 5 */
++#ifndef __DEFINED_wchar_t /* musl libc */
+ #ifndef _WCHAR_T_DEFINED_
+ #ifndef _WCHAR_T_DEFINED
+ #ifndef _WCHAR_T_H
+@@ -272,6 +279,7 @@ typedef long ssize_t;
+ #define __INT_WCHAR_T_H
+ #define _GCC_WCHAR_T
+ #define _WCHAR_T_DECLARED
++#define __DEFINED_wchar_t
+ 
+ /* On BSD/386 1.1, at least, machine/ansi.h defines _BSD_WCHAR_T_
+    instead of _WCHAR_T_, and _BSD_RUNE_T_ (which, unlike the other
+@@ -326,6 +334,7 @@ typedef __WCHAR_TYPE__ wchar_t;
+ #endif
+ #endif
+ #endif
++#endif /* __DEFINED_wchar_t */
+ #endif /* _WCHAR_T_DECLARED */
+ #endif /* _BSD_RUNE_T_DEFINED_ */
+ #endif
+-- 
+2.34.0
+
diff --git a/srcpkgs/gcc/patches/fsplit-stack-musl.patch b/srcpkgs/gcc/patches/fsplit-stack-musl.patch
new file mode 100644
index 000000000000..6b7b60d9d04b
--- /dev/null
+++ b/srcpkgs/gcc/patches/fsplit-stack-musl.patch
@@ -0,0 +1,112 @@
+Subject: [PATCH v2] Disable -fsplit-stack support on non-glibc targets
+From: Sören Tempel <soeren@soeren-tempel.net>
+
+The -fsplit-stack option requires the pthread_t TCB definition in the
+libc to provide certain struct fields at specific hardcoded offsets. As
+far as I know, only glibc provides these fields at the required offsets.
+Most notably, musl libc does not have these fields. However, since gcc
+accesses the fields using a fixed offset, this does not cause a
+compile-time error, but instead results in a silent memory corruption at
+run-time with musl libc. For example, on s390x libgcc's
+__stack_split_initialize CTOR will overwrite the cancel field in the
+pthread_t TCB on musl.
+
+The -fsplit-stack option is used within the gcc code base itself by
+gcc-go (if available). On musl-based systems with split-stack support
+(i.e. s390x or x86) this causes Go programs compiled with gcc-go to
+misbehave at run-time.
+
+This patch fixes gcc-go on musl by disabling -fsplit-stack in gcc itself
+since it is not supported on non-glibc targets anyhow. This is achieved
+by checking if gcc targets a glibc-based system. This check has been
+added for x86 and s390x, the rs6000 config already checks for
+TARGET_GLIBC_MAJOR. Other architectures do not have split-stack
+support. With this patch applied, the gcc-go configure script will
+detect that -fsplit-stack support is not available and will not use it.
+
+See https://www.openwall.com/lists/musl/2012/10/16/12
+
+This patch was written under the assumption that glibc is the only libc
+implementation which supports the required fields at the required
+offsets in the pthread_t TCB. The patch has been tested on Alpine Linux
+Edge on the s390x and x86 architectures by bootstrapping Google's Go
+implementation with gcc-go.
+
+Signed-off-by: Sören Tempel <soeren@soeren-tempel.net>
+
+gcc/ChangeLog:
+
+	* common/config/s390/s390-common.c (s390_supports_split_stack):
+	Only support split-stack on glibc targets.
+	* config/i386/gnu-user-common.h (STACK_CHECK_STATIC_BUILTIN): Ditto.
+	* config/i386/gnu.h (defined): Ditto.
+---
+This version of the patch addresses feedback by Andrew Pinski and uses
+OPTION_GLIBC as well as opts->x_linux_libc == LIBC_GLIBC to detect glibc
+targets (instead of relying on TARGET_GLIBC_MAJOR).
+
+ gcc/common/config/s390/s390-common.c | 11 +++++++++--
+ gcc/config/i386/gnu-user-common.h    |  5 +++--
+ gcc/config/i386/gnu.h                |  6 +++++-
+ 3 files changed, 17 insertions(+), 5 deletions(-)
+
+diff --git a/gcc/common/config/s390/s390-common.c b/gcc/common/config/s390/s390-common.c
+index b6bc8501742..fc86e0bc5e7 100644
+--- a/gcc/common/config/s390/s390-common.c
++++ b/gcc/common/config/s390/s390-common.c
+@@ -116,13 +116,20 @@ s390_handle_option (struct gcc_options *opts ATTRIBUTE_UNUSED,
+ 
+ /* -fsplit-stack uses a field in the TCB, available with glibc-2.23.
+    We don't verify it, since earlier versions just have padding at
+-   its place, which works just as well.  */
++   its place, which works just as well. For other libc implementations
++   we disable the feature entirely to avoid corrupting the TCB.  */
+ 
+ static bool
+ s390_supports_split_stack (bool report ATTRIBUTE_UNUSED,
+ 			   struct gcc_options *opts ATTRIBUTE_UNUSED)
+ {
+-  return true;
++  if (opts->x_linux_libc == LIBC_GLIBC) {
++    return true;
++  } else {
++    if (report)
++      error("%<-fsplit-stack%> currently only supported on GNU/Linux");
++    return false;
++  }
+ }
+ 
+ #undef TARGET_DEFAULT_TARGET_FLAGS
+diff --git a/gcc/config/i386/gnu-user-common.h b/gcc/config/i386/gnu-user-common.h
+index 00226f5a455..6e13315b5a3 100644
+--- a/gcc/config/i386/gnu-user-common.h
++++ b/gcc/config/i386/gnu-user-common.h
+@@ -66,7 +66,8 @@ along with GCC; see the file COPYING3.  If not see
+ #define STACK_CHECK_STATIC_BUILTIN 1
+ 
+ /* We only build the -fsplit-stack support in libgcc if the
+-   assembler has full support for the CFI directives.  */
+-#if HAVE_GAS_CFI_PERSONALITY_DIRECTIVE
++   assembler has full support for the CFI directives and
++   targets glibc.  */
++#if HAVE_GAS_CFI_PERSONALITY_DIRECTIVE && OPTION_GLIBC
+ #define TARGET_CAN_SPLIT_STACK
+ #endif
+diff --git a/gcc/config/i386/gnu.h b/gcc/config/i386/gnu.h
+index 25fbc07f58c..adfe817201e 100644
+--- a/gcc/config/i386/gnu.h
++++ b/gcc/config/i386/gnu.h
+@@ -35,7 +35,11 @@ along with GCC.  If not, see <http://www.gnu.org/licenses/>.
+    crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
+ #endif
+ 
+-#ifdef TARGET_LIBC_PROVIDES_SSP
++/* -fsplit-stack uses a field in the TCB at a fixed offset. This
++   field is only available for glibc. Disable -fsplit-stack for
++   other libc implementation to avoid silent TCB corruptions.  */
++
++#if defined (TARGET_LIBC_PROVIDES_SSP) && OPTION_GLIBC
+ 
+ /* i386 glibc provides __stack_chk_guard in %gs:0x14.  */
+ #define TARGET_THREAD_SSP_OFFSET        0x14
+
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..c2acec586cfc 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -17,22 +17,25 @@ diff --git a/libgcc/config/rs6000/t-ibm-ldouble b/libgcc/config/rs6000/t-ibm-ldo
 index b132784..fb5eca8 100644
 --- a/libgcc/config/rs6000/t-ibm-ldouble
 +++ b/libgcc/config/rs6000/t-ibm-ldouble
-@@ -1,6 +1,6 @@
- # GCC 128-bit long double support routines.
- LIB2ADD += $(srcdir)/config/rs6000/ibm-ldouble.c
+@@ -3,4 +3,6 @@
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ HOST_LIBGCC2_CFLAGS += -mlong-double-128
  
++HOST_LIBGCC2_CFLAGS += -mno-gnu-attribute
++
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-ibm-ldouble.ver
 diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
- SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
+@@ -2,6 +2,8 @@
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+ HOST_LIBGCC2_CFLAGS += -mlong-double-128
+ 
++HOST_LIBGCC2_CFLAGS += -mno-gnu-attribute
++
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+ # would need to take into account targets for which -mcmodel is invalid.
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/musl-ada.patch b/srcpkgs/gcc/patches/musl-ada.patch
index c2c79df0adb7..3a7075f96311 100644
--- a/srcpkgs/gcc/patches/musl-ada.patch
+++ b/srcpkgs/gcc/patches/musl-ada.patch
@@ -1,20 +1,81 @@
+From 0b879c9a3ef83b3b08a0d72bfe89816d52489408 Mon Sep 17 00:00:00 2001
+From: Ariadne Conill <ariadne@dereferenced.org>
+Date: Fri, 21 Aug 2020 07:07:48 +0000
+Subject: [PATCH] ada: musl support fixes
+
+---
+ 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 987eff0abba..03c8bc6f496 100644
+--- a/gcc/ada/Makefile.rtl
++++ b/gcc/ada/Makefile.rtl
+@@ -1748,7 +1748,7 @@ ifeq ($(strip $(filter-out %86 linux%,$(target_cpu) $(target_os))),)
+   s-intman.adb<libgnarl/s-intman__posix.adb \
+   s-tpopsp.adb<libgnarl/s-tpopsp__tls.adb \
+   $(TRASYM_DWARF_UNIX_PAIRS) \
+-  s-tsmona.adb<libgnat/s-tsmona__linux.adb \
++  s-tsmona.adb<libgnat/s-tsmona.adb \
+   a-exetim.adb<libgnarl/a-exetim__posix.adb \
+   a-exetim.ads<libgnarl/a-exetim__default.ads \
+   s-linux.ads<libgnarl/s-linux.ads \
+@@ -2355,7 +2355,7 @@ ifeq ($(strip $(filter-out powerpc% linux%,$(target_cpu) $(target_os))),)
+   s-tasinf.adb<libgnarl/s-tasinf__linux.adb \
+   s-taspri.ads<libgnarl/s-taspri__posix.ads \
+   $(TRASYM_DWARF_UNIX_PAIRS) \
+-  s-tsmona.adb<libgnat/s-tsmona__linux.adb \
++  s-tsmona.adb<libgnat/s-tsmona.adb \
+   $(ATOMICS_TARGET_PAIRS) \
+   $(ATOMICS_BUILTINS_TARGET_PAIRS) \
+   system.ads<libgnat/system-linux-ppc.ads
+@@ -2386,7 +2386,7 @@ ifeq ($(strip $(filter-out powerpc% linux%,$(target_cpu) $(target_os))),)
+ endif
+ 
+ # ARM linux, GNU eabi
+-ifeq ($(strip $(filter-out arm% linux-gnueabi%,$(target_cpu) $(target_os))),)
++ifeq ($(strip $(filter-out arm% linux-gnueabi% linux-musleabi% linux-muslgnueabi%,$(target_cpu) $(target_os))),)
+   LIBGNAT_TARGET_PAIRS = \
+   a-intnam.ads<libgnarl/a-intnam__linux.ads \
+   s-inmaop.adb<libgnarl/s-inmaop__posix.adb \
+@@ -2597,7 +2597,7 @@ ifeq ($(strip $(filter-out %ia64 linux%,$(target_cpu) $(target_os))),)
+   s-tpopsp.adb<libgnarl/s-tpopsp__tls.adb \
+   s-taspri.ads<libgnarl/s-taspri__posix-noaltstack.ads \
+   $(TRASYM_DWARF_UNIX_PAIRS) \
+-  s-tsmona.adb<libgnat/s-tsmona__linux.adb \
++  s-tsmona.adb<libgnat/s-tsmona.adb \
+   $(ATOMICS_TARGET_PAIRS) \
+   $(ATOMICS_BUILTINS_TARGET_PAIRS) \
+   $(GNATRTL_128BIT_PAIRS) \
+@@ -2699,7 +2699,7 @@ ifeq ($(strip $(filter-out %x86_64 linux%,$(target_cpu) $(target_os))),)
+   s-tpopsp.adb<libgnarl/s-tpopsp__tls.adb \
+   s-taspri.ads<libgnarl/s-taspri__posix.ads \
+   $(TRASYM_DWARF_UNIX_PAIRS) \
+-  s-tsmona.adb<libgnat/s-tsmona__linux.adb \
++  s-tsmona.adb<libgnat/s-tsmona.adb \
+   $(ATOMICS_TARGET_PAIRS) \
+   $(X86_64_TARGET_PAIRS) \
+   $(GNATRTL_128BIT_PAIRS) \
 diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c
-index 3b0aea9..ee0bb69 100644
+index 2e54e69643a..e7e6507e2e0 100644
 --- a/gcc/ada/adaint.c
 +++ b/gcc/ada/adaint.c
-@@ -76,6 +76,11 @@
+@@ -91,6 +91,11 @@
  #include <sys/param.h>
  #include <sys/pstat.h>
  #endif
 + 
-+#if defined (linux)
++#if defined (linux) || defined(__linux__)
 +#define _GNU_SOURCE 1
 +#include <sched.h>
 +#endif
  
  #ifdef __PikeOS__
  #define __BSD_VISIBLE 1
-@@ -3255,7 +3260,6 @@ __gnat_lwp_self (void)
+@@ -3442,7 +3447,6 @@ __gnat_lwp_self (void)
  #endif
  
  #if defined (__linux__)
@@ -22,7 +83,7 @@ index 3b0aea9..ee0bb69 100644
  
  /* glibc versions earlier than 2.7 do not define the routines to handle
     dynamically allocated CPU sets. For these targets, we use the static
-@@ -3265,7 +3269,7 @@ __gnat_lwp_self (void)
+@@ -3452,7 +3456,7 @@ __gnat_lwp_self (void)
  
  /* Dynamic cpu sets */
  
@@ -31,7 +92,7 @@ index 3b0aea9..ee0bb69 100644
  __gnat_cpu_alloc (size_t count)
  {
    return CPU_ALLOC (count);
-@@ -3278,33 +3282,33 @@ __gnat_cpu_alloc_size (size_t count)
+@@ -3465,33 +3469,33 @@ __gnat_cpu_alloc_size (size_t count)
  }
  
  void
@@ -73,7 +134,7 @@ index 3b0aea9..ee0bb69 100644
  }
  
  size_t
-@@ -3314,23 +3318,23 @@ __gnat_cpu_alloc_size (size_t count ATTRIBUTE_UNUSED)
+@@ -3501,23 +3505,23 @@ __gnat_cpu_alloc_size (size_t count ATTRIBUTE_UNUSED)
  }
  
  void
@@ -103,10 +164,10 @@ index 3b0aea9..ee0bb69 100644
  #endif /* !CPU_ALLOC */
  #endif /* __linux__ */
 diff --git a/gcc/ada/adaint.h b/gcc/ada/adaint.h
-index 0d12f7e..a063b47 100644
+index 85997b9ba68..fd10e5b5589 100644
 --- a/gcc/ada/adaint.h
 +++ b/gcc/ada/adaint.h
-@@ -316,13 +316,11 @@ extern void   *__gnat_lwp_self			   (void);
+@@ -325,13 +325,11 @@ extern void   *__gnat_lwp_self			   (void);
  
  /* Routines for interface to required CPU set primitives */
  
@@ -124,56 +185,11 @@ index 0d12f7e..a063b47 100644
  #endif
  
  #if defined (_WIN32)
---- a/gcc/ada/Makefile.rtl	2020-07-23 08:35:17.052381336 +0200
-+++ b/gcc/ada/Makefile.rtl	2020-07-23 08:35:17.052381336 +0200
-@@ -1533,7 +1533,7 @@
-   s-intman.adb<libgnarl/s-intman__posix.adb \
-   s-tpopsp.adb<libgnarl/s-tpopsp__tls.adb \
-   $(TRASYM_DWARF_UNIX_PAIRS) \
--  s-tsmona.adb<libgnat/s-tsmona__linux.adb \
-+  s-tsmona.adb<libgnat/s-tsmona.adb \
-   a-exetim.adb<libgnarl/a-exetim__posix.adb \
-   a-exetim.ads<libgnarl/a-exetim__default.ads \
-   s-linux.ads<libgnarl/s-linux.ads \
-@@ -2083,7 +2083,7 @@
-   s-osinte.adb<libgnarl/s-osinte__posix.adb \
-   s-tpopsp.adb<libgnarl/s-tpopsp__tls.adb \
-   $(TRASYM_DWARF_UNIX_PAIRS) \
--  s-tsmona.adb<libgnat/s-tsmona__linux.adb \
-+  s-tsmona.adb<libgnat/s-tsmona.adb \
-   $(ATOMICS_TARGET_PAIRS) \
-   $(ATOMICS_BUILTINS_TARGET_PAIRS) \
-   system.ads<libgnat/system-linux-ppc.ads
-@@ -2112,7 +2112,7 @@
- endif
- 
- # ARM linux, GNU eabi
--ifeq ($(strip $(filter-out arm% linux-gnueabi%,$(target_cpu) $(target_os))),)
-+ifeq ($(strip $(filter-out arm% linux-gnueabi% linux-musleabi% linux-muslgnueabi%,$(target_cpu) $(target_os))),)
-   LIBGNAT_TARGET_PAIRS = \
-   a-intnam.ads<libgnarl/a-intnam__linux.ads \
-   s-inmaop.adb<libgnarl/s-inmaop__posix.adb \
-@@ -2305,7 +2305,7 @@
-   s-tpopsp.adb<libgnarl/s-tpopsp__tls.adb \
-   s-taspri.ads<libgnarl/s-taspri__posix-noaltstack.ads \
-   $(TRASYM_DWARF_UNIX_PAIRS) \
--  s-tsmona.adb<libgnat/s-tsmona__linux.adb \
-+  s-tsmona.adb<libgnat/s-tsmona.adb \
-   $(ATOMICS_TARGET_PAIRS) \
-   $(ATOMICS_BUILTINS_TARGET_PAIRS) \
-   system.ads<libgnat/system-linux-ia64.ads
-@@ -2401,7 +2401,7 @@
-   s-tpopsp.adb<libgnarl/s-tpopsp__tls.adb \
-   s-taspri.ads<libgnarl/s-taspri__posix.ads \
-   $(TRASYM_DWARF_UNIX_PAIRS) \
--  s-tsmona.adb<libgnat/s-tsmona__linux.adb \
-+  s-tsmona.adb<libgnat/s-tsmona.adb \
-   $(ATOMICS_TARGET_PAIRS) \
-   $(X86_64_TARGET_PAIRS) \
-   system.ads<libgnat/system-linux-x86.ads
---- a/gcc/ada/terminals.c	2019-01-08 10:54:04.000000000 +0100
-+++ b/gcc/ada/terminals.c	2019-05-15 13:14:09.935742526 +0200
-@@ -1136,7 +1136,7 @@
+diff --git a/gcc/ada/terminals.c b/gcc/ada/terminals.c
+index ec9db3a6a4c..6f92e50dd67 100644
+--- a/gcc/ada/terminals.c
++++ b/gcc/ada/terminals.c
+@@ -1132,7 +1132,7 @@ __gnat_setup_winsize (void *desc ATTRIBUTE_UNUSED,
  /* POSIX does not specify how to open the master side of a terminal.Several
     methods are available (system specific):
        1- using a cloning device (USE_CLONE_DEVICE)
@@ -182,7 +198,7 @@ index 0d12f7e..a063b47 100644
        3- openpty                (USE_OPENPTY)
  
     When using the cloning device method, the macro USE_CLONE_DEVICE should
-@@ -1150,7 +1150,7 @@
+@@ -1146,7 +1146,7 @@ __gnat_setup_winsize (void *desc ATTRIBUTE_UNUSED,
  #if defined (__APPLE__) || defined (BSD)
  #define USE_OPENPTY
  #elif defined (__linux__)
@@ -191,7 +207,7 @@ index 0d12f7e..a063b47 100644
  #elif defined (__sun__)
  #define USE_CLONE_DEVICE "/dev/ptmx"
  #elif defined (_AIX)
-@@ -1199,8 +1199,8 @@
+@@ -1195,8 +1195,8 @@ allocate_pty_desc (pty_desc **desc) {
     int  master_fd   = -1;
     char *slave_name = NULL;
  
@@ -202,3 +218,6 @@ index 0d12f7e..a063b47 100644
  #elif defined (USE_OPENPTY)
    status = openpty (&master_fd, &slave_fd, NULL, NULL, NULL);
  #elif defined (USE_CLONE_DEVICE)
+-- 
+2.34.0
+
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..d7adc658eeb6 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,35 +3,35 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
-_patchver="${version%pre*}"
+# we are using an 11-stable 9b6ad13 git snapshot alpine is using
+# in order to get regression fixes not yet incorporated into the
+# latest stable release
+version=11.2.1git20211128
+revision=1
+_patchver="${version%git*}"
 _minorver="${_patchver%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
-wrksrc=gcc-${version/pre/_pre}
+_mpc_version=1.2.1
+_isl_version=0.24
+wrksrc=gcc-${version/git/_git}
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ https://dev.alpinelinux.org/~nenolod/gcc-${version/git/_git}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="a058c487c36f07a2c98ab2297c990136516cd7444f73199f0da8bf8232641d92
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes

From 9bbfea5bb0a512550d8ab0f5abdbf415f86434ee Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 4 Jan 2022 22:51:14 -0800
Subject: [PATCH 3/3] libtool: revbump for gcc update

---
 srcpkgs/libtool/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..46ddf4f1c70d 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
 version=2.4.6
-revision=6
+revision=7
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 11.2.1git20211128
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (3 preceding siblings ...)
  2022-01-26 23:16 ` [PR PATCH] [Updated] " oreo639
@ 2022-01-26 23:25 ` oreo639
  2022-01-26 23:25 ` oreo639
                   ` (259 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-01-26 23:25 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 524 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1022651196

Comment:
> => WARNING: gcc-11.2.1git20211128_1: libcp1plugin.so.0 not found in common/shlibs!

`libcp1plugin.so.0` is in the current gcc 10 package and isn't in shlibs, so I assume that isn't an issue since nothing depends on it.

Same for all of the `WARNING: usr/lib/*.so should be in -devel package` afaik, so unless the maintainers think it is an issue, it probably isn't a big deal.

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 11.2.1git20211128
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (4 preceding siblings ...)
  2022-01-26 23:25 ` oreo639
@ 2022-01-26 23:25 ` oreo639
  2022-02-16 21:18 ` lane-brain
                   ` (258 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-01-26 23:25 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 525 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1022651196

Comment:
> => WARNING: gcc-11.2.1git20211128_1: libcp1plugin.so.0 not found in common/shlibs!

`libcp1plugin.so.0` is in the current gcc 10 package and isn't in shlibs, so I assume that isn't an issue since nothing depends on it.

Same for all of the `WARNING: usr/lib/*.so should be in -devel package` afaict, so unless the maintainers think it is an issue, it probably isn't a big deal.

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 11.2.1git20211128
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (5 preceding siblings ...)
  2022-01-26 23:25 ` oreo639
@ 2022-02-16 21:18 ` lane-brain
  2022-02-17  1:56 ` oreo639
                   ` (257 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: lane-brain @ 2022-02-16 21:18 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 201 bytes --]

New comment by lane-brain on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1042319967

Comment:
@oreo639 is there any way that I can assist this effort?

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 11.2.1git20211128
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (6 preceding siblings ...)
  2022-02-16 21:18 ` lane-brain
@ 2022-02-17  1:56 ` oreo639
  2022-02-17  1:56 ` oreo639
                   ` (256 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-02-17  1:56 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 317 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1042490083

Comment:
Not that I am aware of. If the maintainers want me to make any changes they can let me know. If they want to use it as a reference for their own gcc 11.2 port, they can do so.

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 11.2.1git20211128
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (7 preceding siblings ...)
  2022-02-17  1:56 ` oreo639
@ 2022-02-17  1:56 ` oreo639
  2022-04-14  2:41 ` oreo639
                   ` (255 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-02-17  1:56 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 331 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1042490083

Comment:
Not that I am aware of at the moment. If the maintainers want me to make any changes they can let me know. If they want to use it as a reference for their own gcc 11.2 port, they can do so.

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 11.2.1git20211128
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (8 preceding siblings ...)
  2022-02-17  1:56 ` oreo639
@ 2022-04-14  2:41 ` oreo639
  2022-07-14  2:13 ` github-actions
                   ` (254 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-04-14  2:41 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 741 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1022651196

Comment:
> => WARNING: libada-11.2.1git20211128_1: libgnarl-11.so not found in common/shlibs!
> => WARNING: libada-11.2.1git20211128_1: libgnat-11.so not found in common/shlibs!

Thank you for pointing that out, fixed.

> => WARNING: gcc-11.2.1git20211128_1: libcp1plugin.so.0 not found in common/shlibs!

`libcp1plugin.so.0` is in the current gcc 10 package and isn't in shlibs, so I assume that isn't an issue since nothing depends on it.

Same for all of the `WARNING: usr/lib/*.so should be in -devel package` afaict, so unless the maintainers think it is an issue, it probably isn't a big deal.

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 11.2.1git20211128
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (9 preceding siblings ...)
  2022-04-14  2:41 ` oreo639
@ 2022-07-14  2:13 ` github-actions
  2022-07-17 17:44 ` motorto
                   ` (253 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: github-actions @ 2022-07-14  2:13 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 305 bytes --]

New comment by github-actions[bot] on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1183905116

Comment:
Pull Requests become stale 90 days after last activity and are closed 14 days after that.  If this pull request is still relevant bump it or assign it.

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 11.2.1git20211128
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (10 preceding siblings ...)
  2022-07-14  2:13 ` github-actions
@ 2022-07-17 17:44 ` motorto
  2022-07-17 17:45 ` motorto
                   ` (252 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: motorto @ 2022-07-17 17:44 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 264 bytes --]

New comment by motorto on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1186579004

Comment:
@oreo639: could you bump this so that this work isn't lost ?  I will try to build on my x86_64-musl system and report back

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 11.2.1git20211128
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (11 preceding siblings ...)
  2022-07-17 17:44 ` motorto
@ 2022-07-17 17:45 ` motorto
  2022-08-12 13:29 ` [PR PATCH] [Updated] " oreo639
                   ` (251 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: motorto @ 2022-07-17 17:45 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 295 bytes --]

New comment by motorto on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1186579004

Comment:
@oreo639: could you bump this so that this work isn't lost ?  I will try to build on my x86_64-musl system and report back.

And maybe bump to 12.1.0 ?

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 11.2.1git20211128
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (12 preceding siblings ...)
  2022-07-17 17:45 ` motorto
@ 2022-08-12 13:29 ` oreo639
  2022-08-13  6:32 ` [PR PATCH] [Updated] gcc: update to 12.1.0 oreo639
                   ` (250 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-08-12 13:29 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1728 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 11.2.1git20211128
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Note: depends on https://github.com/void-linux/void-packages/pull/32330
(Otherwise, it would work until you try recompiling glibc)

I tested this PR with glibc and it appears to work fine so far, aside from the issue mentioned earlier.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 11 doesn't appear to result in any issues.

Please let me know if there are any issues.

(Related: https://github.com/void-linux/void-packages/pull/34153)

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 38315 bytes --]

From 4a911117ec972ee83d7a25e170798a892095b9df Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 1/3] binutils: update to 3.38

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     |  9 +--
 3 files changed, 22 insertions(+), 113 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..b2b1c47d22fc 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.38
+revision=1
 bootstrap=yes
+hostmakedepends="pkg-config"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=e316477a914f567eccc34d5d29785b8b0f5a10208d36bbacedcc39048ecfe024
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"

From 7d2107a49bcf027cb5ec277324e631427af72f19 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 2/3] gcc: update to 12.1.0

---
 common/shlibs                                 |  10 +-
 srcpkgs/gcc/files/gccgo-musl.patch            |  74 +++--------
 srcpkgs/gcc/files/libgnarl-musl.patch         |  18 +--
 srcpkgs/gcc/files/libssp-musl.patch           |  10 +-
 ...c21f3f5726823e19728fdd1571a14aae0fb3.patch | 105 ++++++++++++++++
 ...08065bdd36fb1a9b6aad9666b1edb5e06474.patch | 115 ++++++++++++++++++
 srcpkgs/gcc/patches/libffi_gnulinux.patch     |  11 --
 .../gcc/patches/libgcc-ibm128-no-tag.patch    |  10 +-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |   3 +-
 srcpkgs/gcc/template                          |  25 ++--
 10 files changed, 273 insertions(+), 108 deletions(-)
 create mode 100644 srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
 create mode 100644 srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index 61924610cc52..c6400b566966 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.1.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.34 perl-5.34.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -849,8 +849,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.1.0_1
+libgnat-12.so libada-12.1.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1701,8 +1701,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.1.0_1
+libasan.so.8 libsanitizer-12.1.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..632ef951097b 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,17 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ a/libgo/go/runtime/os_linux.go
+@@ -363,9 +363,9 @@
+ 
+ 	var timerid int32
+ 	var sevp _sigevent
+-	sevp.sigev_notify = _SIGEV_THREAD_ID
++	sevp.sigev_notify = 4
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.sigev_notify_function))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch b/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
new file mode 100644
index 000000000000..00929202a503
--- /dev/null
+++ b/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
@@ -0,0 +1,105 @@
+From 3b21c21f3f5726823e19728fdd1571a14aae0fb3 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <siarheit@google.com>
+Date: Mon, 27 Jun 2022 13:27:24 +0100
+Subject: [PATCH] c++: avoid <memory> poisoning on musl [PR106102]
+
+On musl <pthread.h> uses calloc() (via <sched.h>). <memory> includes
+it indirectly and exposes use of poisoned calloc() when module code
+is built:
+
+    /build/build/./prev-gcc/xg++ ... ../../gcc-13-20220626/gcc/cp/mapper-resolver.cc
+        In file included from /<<NIX>>/musl-1.2.3-dev/include/pthread.h:30,
+                 from /build/build/prev-x86_64-unknown-linux-musl/libstdc++-v3/include/x86_64-unknown-linux-musl/bits/gthr-default.h:35,
+                 ....
+                 from /build/build/prev-x86_64-unknown-linux-musl/libstdc++-v3/include/memory:77,
+                 from ../../gcc-13-20220626/gcc/../libcody/cody.hh:24,
+                 from ../../gcc-13-20220626/gcc/cp/../../c++tools/resolver.h:25,
+                 from ../../gcc-13-20220626/gcc/cp/../../c++tools/resolver.cc:23,
+                 from ../../gcc-13-20220626/gcc/cp/mapper-resolver.cc:32:
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:84:7: error: attempt to use poisoned "calloc"
+       84 | void *calloc(size_t, size_t);
+          |       ^
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:124:36: error: attempt to use poisoned "calloc"
+      124 | #define CPU_ALLOC(n) ((cpu_set_t *)calloc(1,CPU_ALLOC_SIZE(n)))
+          |                                    ^
+
+gcc/cp/
+
+	PR c++/106102
+	* mapper-client.cc: Include <memory> via "system.h".
+	* mapper-resolver.cc: Ditto.
+	* module.cc: Ditto.
+
+libcc1/
+
+	PR c++/106102
+	* libcc1plugin.cc: Include <memory> via "system.h".
+	* libcp1plugin.cc: Ditto.
+---
+ gcc/cp/mapper-client.cc   | 1 +
+ gcc/cp/mapper-resolver.cc | 1 +
+ gcc/cp/module.cc          | 1 +
+ libcc1/libcc1plugin.cc    | 1 +
+ libcc1/libcp1plugin.cc    | 1 +
+ 5 files changed, 5 insertions(+)
+
+diff --git a/gcc/cp/mapper-client.cc b/gcc/cp/mapper-client.cc
+index 8603a886a099..fe9544b5ba43 100644
+--- a/gcc/cp/mapper-client.cc
++++ b/gcc/cp/mapper-client.cc
+@@ -27,6 +27,7 @@ along with GCC; see the file COPYING3.  If not see
+ #define INCLUDE_STRING
+ #define INCLUDE_VECTOR
+ #define INCLUDE_MAP
++#define INCLUDE_MEMORY
+ #include "system.h"
+ 
+ #include "line-map.h"
+diff --git a/gcc/cp/mapper-resolver.cc b/gcc/cp/mapper-resolver.cc
+index e3d29fb5ada1..e70d1b4ae2ca 100644
+--- a/gcc/cp/mapper-resolver.cc
++++ b/gcc/cp/mapper-resolver.cc
+@@ -25,6 +25,7 @@ along with GCC; see the file COPYING3.  If not see
+ #define INCLUDE_VECTOR
+ #define INCLUDE_ALGORITHM
+ #define INCLUDE_MAP
++#define INCLUDE_MEMORY
+ #include "system.h"
+ 
+ // We don't want or need to be aware of networking
+diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc
+index 753963a4b246..8bb22c2b305a 100644
+--- a/gcc/cp/module.cc
++++ b/gcc/cp/module.cc
+@@ -206,6 +206,7 @@ Classes used:
+ 
+ #define _DEFAULT_SOURCE 1 /* To get TZ field of struct tm, if available.  */
+ #include "config.h"
++#define INCLUDE_MEMORY
+ #define INCLUDE_STRING
+ #define INCLUDE_VECTOR
+ #include "system.h"
+diff --git a/libcc1/libcc1plugin.cc b/libcc1/libcc1plugin.cc
+index 12ab5a57c8dd..bdd0bdabe77f 100644
+--- a/libcc1/libcc1plugin.cc
++++ b/libcc1/libcc1plugin.cc
+@@ -31,6 +31,7 @@
+ #undef PACKAGE_TARNAME
+ #undef PACKAGE_VERSION
+ 
++#define INCLUDE_MEMORY
+ #include "gcc-plugin.h"
+ #include "system.h"
+ #include "coretypes.h"
+diff --git a/libcc1/libcp1plugin.cc b/libcc1/libcp1plugin.cc
+index 83dab7f58b11..e2d5039a0a1f 100644
+--- a/libcc1/libcp1plugin.cc
++++ b/libcc1/libcp1plugin.cc
+@@ -32,6 +32,7 @@
+ #undef PACKAGE_TARNAME
+ #undef PACKAGE_VERSION
+ 
++#define INCLUDE_MEMORY
+ #include "gcc-plugin.h"
+ #include "system.h"
+ #include "coretypes.h"
diff --git a/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch b/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
new file mode 100644
index 000000000000..89bd053d6d04
--- /dev/null
+++ b/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
@@ -0,0 +1,115 @@
+From 49d508065bdd36fb1a9b6aad9666b1edb5e06474 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <siarheit@google.com>
+Date: Mon, 27 Jun 2022 23:42:44 +0100
+Subject: [PATCH] jit: avoid calloc() poisoning on musl [PR106102]
+
+On musl <pthread.h> uses calloc() (via <sched.h>). jit/ includes
+it directly and exposes use of poisoned calloc():
+
+    /build/build/./prev-gcc/xg++ ... ../../gcc-13-20220626/gcc/jit/jit-playback.cc
+    make[3]: *** [Makefile:1143: jit/libgccjit.o] Error 1
+    make[3]: *** Waiting for unfinished jobs....
+    In file included from /<<NIX>>/musl-1.2.3-dev/include/pthread.h:30,
+                     from ../../gcc-13-20220626/gcc/jit/jit-playback.cc:44:
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:84:7: error: attempt to use poisoned "calloc"
+       84 | void *calloc(size_t, size_t);
+          |       ^
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:124:36: error: attempt to use poisoned "calloc"
+      124 | #define CPU_ALLOC(n) ((cpu_set_t *)calloc(1,CPU_ALLOC_SIZE(n)))
+          |                                    ^
+
+The change moves <pthread.h> inclusion to "system.h" under new
+INCLUDE_PTHREAD_H guard and uses this mechanism in libgccjit.
+
+gcc/
+
+	PR c++/106102
+	* system.h: Introduce INCLUDE_PTHREAD_H macros to include <pthread.h>.
+
+gcc/jit/
+
+	PR c++/106102
+	* jit-playback.cc: Include <pthread.h> via "system.h" to avoid calloc()
+	poisoning.
+	* jit-recording.cc: Ditto.
+	* libgccjit.cc: Ditto.
+---
+ gcc/jit/jit-playback.cc  | 3 +--
+ gcc/jit/jit-recording.cc | 2 +-
+ gcc/jit/libgccjit.cc     | 2 +-
+ gcc/system.h             | 4 ++++
+ 4 files changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/gcc/jit/jit-playback.cc b/gcc/jit/jit-playback.cc
+index 6be6bdf8dea5..79714132b91a 100644
+--- a/gcc/jit/jit-playback.cc
++++ b/gcc/jit/jit-playback.cc
+@@ -19,6 +19,7 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "target.h"
+@@ -41,8 +42,6 @@ along with GCC; see the file COPYING3.  If not see
+ #include "diagnostic.h"
+ #include "stmt.h"
+ 
+-#include <pthread.h>
+-
+ #include "jit-playback.h"
+ #include "jit-result.h"
+ #include "jit-builtins.h"
+diff --git a/gcc/jit/jit-recording.cc b/gcc/jit/jit-recording.cc
+index 697dee66e733..f78daed2d71a 100644
+--- a/gcc/jit/jit-recording.cc
++++ b/gcc/jit/jit-recording.cc
+@@ -19,13 +19,13 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "tm.h"
+ #include "pretty-print.h"
+ #include "toplev.h"
+ 
+-#include <pthread.h>
+ 
+ #include "jit-builtins.h"
+ #include "jit-recording.h"
+diff --git a/gcc/jit/libgccjit.cc b/gcc/jit/libgccjit.cc
+index 0e76097b4bac..ca862662777e 100644
+--- a/gcc/jit/libgccjit.cc
++++ b/gcc/jit/libgccjit.cc
+@@ -19,12 +19,12 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "timevar.h"
+ #include "typed-splay-tree.h"
+ #include "cppbuiltin.h"
+-#include <pthread.h>
+ 
+ #include "libgccjit.h"
+ #include "jit-recording.h"
+diff --git a/gcc/system.h b/gcc/system.h
+index 67158b70c789..f8d42ff68150 100644
+--- a/gcc/system.h
++++ b/gcc/system.h
+@@ -753,6 +753,10 @@ extern int vsnprintf (char *, size_t, const char *, va_list);
+ #endif
+ #endif
+ 
++#ifdef INCLUDE_PTHREAD_H
++#include <pthread.h>
++#endif
++
+ #ifdef INCLUDE_ISL
+ #ifdef HAVE_isl
+ #include <isl/options.h>
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..78a2ce35875d 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,9 +3,10 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
  
  #  ifndef _ABIN32
+
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..32ee79e32f0d 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,15 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
+version=12.1.0
+revision=1
 _patchver="${version%pre*}"
 _minorver="${_patchver%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 wrksrc=gcc-${version/pre/_pre}
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +19,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -396,7 +393,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}

From 338f36a2e8fd5fa28c5b7221bc64cbc75635340c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 3/3] libtool: update to 2.4.7

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      |  6 ++--
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..08e35d466a44 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.1.0
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (13 preceding siblings ...)
  2022-08-12 13:29 ` [PR PATCH] [Updated] " oreo639
@ 2022-08-13  6:32 ` oreo639
  2022-08-13  6:49 ` oreo639
                   ` (249 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-08-13  6:32 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1754 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.1.0
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.1.0

This PR depends on: https://github.com/void-linux/void-packages/pull/32330

I tested this PR with glibc. It works for the most part, and while it is "usable" with glibc 3.32, it was very buggy and gjs failed to compile. Recompiling glibc didn't make a difference 3.32.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 56581 bytes --]

From 842b11688db1239c834f312d691a6b752237e94f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 1/7] binutils: update to 3.38

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     |  9 +--
 3 files changed, 22 insertions(+), 113 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..b2b1c47d22fc 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.38
+revision=1
 bootstrap=yes
+hostmakedepends="pkg-config"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=e316477a914f567eccc34d5d29785b8b0f5a10208d36bbacedcc39048ecfe024
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"

From d464e27001fd5fc8609566d1981b8cf0fca28742 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 2/7] gcc: update to 12.1.0

---
 common/shlibs                                 |  10 +-
 srcpkgs/gcc/files/gccgo-musl.patch            |  74 +++--------
 srcpkgs/gcc/files/libgnarl-musl.patch         |  18 +--
 srcpkgs/gcc/files/libssp-musl.patch           |  10 +-
 ...c21f3f5726823e19728fdd1571a14aae0fb3.patch | 105 ++++++++++++++++
 ...08065bdd36fb1a9b6aad9666b1edb5e06474.patch | 115 ++++++++++++++++++
 srcpkgs/gcc/patches/libffi_gnulinux.patch     |  11 --
 .../gcc/patches/libgcc-ibm128-no-tag.patch    |  10 +-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |   3 +-
 srcpkgs/gcc/template                          |  25 ++--
 10 files changed, 273 insertions(+), 108 deletions(-)
 create mode 100644 srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
 create mode 100644 srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index 61924610cc52..c6400b566966 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.1.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.34 perl-5.34.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -849,8 +849,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.1.0_1
+libgnat-12.so libada-12.1.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1701,8 +1701,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.1.0_1
+libasan.so.8 libsanitizer-12.1.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..632ef951097b 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,17 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ a/libgo/go/runtime/os_linux.go
+@@ -363,9 +363,9 @@
+ 
+ 	var timerid int32
+ 	var sevp _sigevent
+-	sevp.sigev_notify = _SIGEV_THREAD_ID
++	sevp.sigev_notify = 4
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.sigev_notify_function))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch b/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
new file mode 100644
index 000000000000..00929202a503
--- /dev/null
+++ b/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
@@ -0,0 +1,105 @@
+From 3b21c21f3f5726823e19728fdd1571a14aae0fb3 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <siarheit@google.com>
+Date: Mon, 27 Jun 2022 13:27:24 +0100
+Subject: [PATCH] c++: avoid <memory> poisoning on musl [PR106102]
+
+On musl <pthread.h> uses calloc() (via <sched.h>). <memory> includes
+it indirectly and exposes use of poisoned calloc() when module code
+is built:
+
+    /build/build/./prev-gcc/xg++ ... ../../gcc-13-20220626/gcc/cp/mapper-resolver.cc
+        In file included from /<<NIX>>/musl-1.2.3-dev/include/pthread.h:30,
+                 from /build/build/prev-x86_64-unknown-linux-musl/libstdc++-v3/include/x86_64-unknown-linux-musl/bits/gthr-default.h:35,
+                 ....
+                 from /build/build/prev-x86_64-unknown-linux-musl/libstdc++-v3/include/memory:77,
+                 from ../../gcc-13-20220626/gcc/../libcody/cody.hh:24,
+                 from ../../gcc-13-20220626/gcc/cp/../../c++tools/resolver.h:25,
+                 from ../../gcc-13-20220626/gcc/cp/../../c++tools/resolver.cc:23,
+                 from ../../gcc-13-20220626/gcc/cp/mapper-resolver.cc:32:
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:84:7: error: attempt to use poisoned "calloc"
+       84 | void *calloc(size_t, size_t);
+          |       ^
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:124:36: error: attempt to use poisoned "calloc"
+      124 | #define CPU_ALLOC(n) ((cpu_set_t *)calloc(1,CPU_ALLOC_SIZE(n)))
+          |                                    ^
+
+gcc/cp/
+
+	PR c++/106102
+	* mapper-client.cc: Include <memory> via "system.h".
+	* mapper-resolver.cc: Ditto.
+	* module.cc: Ditto.
+
+libcc1/
+
+	PR c++/106102
+	* libcc1plugin.cc: Include <memory> via "system.h".
+	* libcp1plugin.cc: Ditto.
+---
+ gcc/cp/mapper-client.cc   | 1 +
+ gcc/cp/mapper-resolver.cc | 1 +
+ gcc/cp/module.cc          | 1 +
+ libcc1/libcc1plugin.cc    | 1 +
+ libcc1/libcp1plugin.cc    | 1 +
+ 5 files changed, 5 insertions(+)
+
+diff --git a/gcc/cp/mapper-client.cc b/gcc/cp/mapper-client.cc
+index 8603a886a099..fe9544b5ba43 100644
+--- a/gcc/cp/mapper-client.cc
++++ b/gcc/cp/mapper-client.cc
+@@ -27,6 +27,7 @@ along with GCC; see the file COPYING3.  If not see
+ #define INCLUDE_STRING
+ #define INCLUDE_VECTOR
+ #define INCLUDE_MAP
++#define INCLUDE_MEMORY
+ #include "system.h"
+ 
+ #include "line-map.h"
+diff --git a/gcc/cp/mapper-resolver.cc b/gcc/cp/mapper-resolver.cc
+index e3d29fb5ada1..e70d1b4ae2ca 100644
+--- a/gcc/cp/mapper-resolver.cc
++++ b/gcc/cp/mapper-resolver.cc
+@@ -25,6 +25,7 @@ along with GCC; see the file COPYING3.  If not see
+ #define INCLUDE_VECTOR
+ #define INCLUDE_ALGORITHM
+ #define INCLUDE_MAP
++#define INCLUDE_MEMORY
+ #include "system.h"
+ 
+ // We don't want or need to be aware of networking
+diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc
+index 753963a4b246..8bb22c2b305a 100644
+--- a/gcc/cp/module.cc
++++ b/gcc/cp/module.cc
+@@ -206,6 +206,7 @@ Classes used:
+ 
+ #define _DEFAULT_SOURCE 1 /* To get TZ field of struct tm, if available.  */
+ #include "config.h"
++#define INCLUDE_MEMORY
+ #define INCLUDE_STRING
+ #define INCLUDE_VECTOR
+ #include "system.h"
+diff --git a/libcc1/libcc1plugin.cc b/libcc1/libcc1plugin.cc
+index 12ab5a57c8dd..bdd0bdabe77f 100644
+--- a/libcc1/libcc1plugin.cc
++++ b/libcc1/libcc1plugin.cc
+@@ -31,6 +31,7 @@
+ #undef PACKAGE_TARNAME
+ #undef PACKAGE_VERSION
+ 
++#define INCLUDE_MEMORY
+ #include "gcc-plugin.h"
+ #include "system.h"
+ #include "coretypes.h"
+diff --git a/libcc1/libcp1plugin.cc b/libcc1/libcp1plugin.cc
+index 83dab7f58b11..e2d5039a0a1f 100644
+--- a/libcc1/libcp1plugin.cc
++++ b/libcc1/libcp1plugin.cc
+@@ -32,6 +32,7 @@
+ #undef PACKAGE_TARNAME
+ #undef PACKAGE_VERSION
+ 
++#define INCLUDE_MEMORY
+ #include "gcc-plugin.h"
+ #include "system.h"
+ #include "coretypes.h"
diff --git a/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch b/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
new file mode 100644
index 000000000000..89bd053d6d04
--- /dev/null
+++ b/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
@@ -0,0 +1,115 @@
+From 49d508065bdd36fb1a9b6aad9666b1edb5e06474 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <siarheit@google.com>
+Date: Mon, 27 Jun 2022 23:42:44 +0100
+Subject: [PATCH] jit: avoid calloc() poisoning on musl [PR106102]
+
+On musl <pthread.h> uses calloc() (via <sched.h>). jit/ includes
+it directly and exposes use of poisoned calloc():
+
+    /build/build/./prev-gcc/xg++ ... ../../gcc-13-20220626/gcc/jit/jit-playback.cc
+    make[3]: *** [Makefile:1143: jit/libgccjit.o] Error 1
+    make[3]: *** Waiting for unfinished jobs....
+    In file included from /<<NIX>>/musl-1.2.3-dev/include/pthread.h:30,
+                     from ../../gcc-13-20220626/gcc/jit/jit-playback.cc:44:
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:84:7: error: attempt to use poisoned "calloc"
+       84 | void *calloc(size_t, size_t);
+          |       ^
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:124:36: error: attempt to use poisoned "calloc"
+      124 | #define CPU_ALLOC(n) ((cpu_set_t *)calloc(1,CPU_ALLOC_SIZE(n)))
+          |                                    ^
+
+The change moves <pthread.h> inclusion to "system.h" under new
+INCLUDE_PTHREAD_H guard and uses this mechanism in libgccjit.
+
+gcc/
+
+	PR c++/106102
+	* system.h: Introduce INCLUDE_PTHREAD_H macros to include <pthread.h>.
+
+gcc/jit/
+
+	PR c++/106102
+	* jit-playback.cc: Include <pthread.h> via "system.h" to avoid calloc()
+	poisoning.
+	* jit-recording.cc: Ditto.
+	* libgccjit.cc: Ditto.
+---
+ gcc/jit/jit-playback.cc  | 3 +--
+ gcc/jit/jit-recording.cc | 2 +-
+ gcc/jit/libgccjit.cc     | 2 +-
+ gcc/system.h             | 4 ++++
+ 4 files changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/gcc/jit/jit-playback.cc b/gcc/jit/jit-playback.cc
+index 6be6bdf8dea5..79714132b91a 100644
+--- a/gcc/jit/jit-playback.cc
++++ b/gcc/jit/jit-playback.cc
+@@ -19,6 +19,7 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "target.h"
+@@ -41,8 +42,6 @@ along with GCC; see the file COPYING3.  If not see
+ #include "diagnostic.h"
+ #include "stmt.h"
+ 
+-#include <pthread.h>
+-
+ #include "jit-playback.h"
+ #include "jit-result.h"
+ #include "jit-builtins.h"
+diff --git a/gcc/jit/jit-recording.cc b/gcc/jit/jit-recording.cc
+index 697dee66e733..f78daed2d71a 100644
+--- a/gcc/jit/jit-recording.cc
++++ b/gcc/jit/jit-recording.cc
+@@ -19,13 +19,13 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "tm.h"
+ #include "pretty-print.h"
+ #include "toplev.h"
+ 
+-#include <pthread.h>
+ 
+ #include "jit-builtins.h"
+ #include "jit-recording.h"
+diff --git a/gcc/jit/libgccjit.cc b/gcc/jit/libgccjit.cc
+index 0e76097b4bac..ca862662777e 100644
+--- a/gcc/jit/libgccjit.cc
++++ b/gcc/jit/libgccjit.cc
+@@ -19,12 +19,12 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "timevar.h"
+ #include "typed-splay-tree.h"
+ #include "cppbuiltin.h"
+-#include <pthread.h>
+ 
+ #include "libgccjit.h"
+ #include "jit-recording.h"
+diff --git a/gcc/system.h b/gcc/system.h
+index 67158b70c789..f8d42ff68150 100644
+--- a/gcc/system.h
++++ b/gcc/system.h
+@@ -753,6 +753,10 @@ extern int vsnprintf (char *, size_t, const char *, va_list);
+ #endif
+ #endif
+ 
++#ifdef INCLUDE_PTHREAD_H
++#include <pthread.h>
++#endif
++
+ #ifdef INCLUDE_ISL
+ #ifdef HAVE_isl
+ #include <isl/options.h>
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..78a2ce35875d 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,9 +3,10 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
  
  #  ifndef _ABIN32
+
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..32ee79e32f0d 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,15 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
+version=12.1.0
+revision=1
 _patchver="${version%pre*}"
 _minorver="${_patchver%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 wrksrc=gcc-${version/pre/_pre}
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +19,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -396,7 +393,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}

From a2c1762014112a6a0b352ac9b86f9908bd282fce Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 3/7] libtool: update to 2.4.7

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      |  6 ++--
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..08e35d466a44 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From 45a7db03aa91e08e1dd8d4a8c77070b03e4f6af6 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 4/7] libiberty-devel: update to 20220713

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 1a4e1ca3d594..b04268908c2e 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="q66 <daniel@octaforge.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From 96f361f00aadfe08f566077c324f9db7131f49d4 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 5/7] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 3 files changed, 55 insertions(+), 353 deletions(-)
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index c6400b566966..65f4d1b62b61 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From 8fa0ce4a86e5d4b6f6ba70024132974f5ff0bd31 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:08:52 -0700
Subject: [PATCH 6/7] openssh: suppress werror on gcc12

---
 srcpkgs/openssh/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/openssh/template b/srcpkgs/openssh/template
index 02a2dec35f42..6e8e343a9dca 100644
--- a/srcpkgs/openssh/template
+++ b/srcpkgs/openssh/template
@@ -40,7 +40,7 @@ if [ "$build_option_ldns" -a -z "$build_option_ssl" ]; then
 	broken="option 'ldns' requires option 'ssl'"
 fi
 
-CFLAGS="-Wno-format-truncation -Wno-stringop-truncation"
+CFLAGS="-Wno-format-truncation -Wno-stringop-truncation -Wno-error=maybe-uninitialized"
 
 case $XBPS_TARGET_MACHINE in
 	i686-musl)

From bd035a36c1848019d68455d33eaa20d33de0168d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:09:31 -0700
Subject: [PATCH 7/7] linux5.18: update dotconfigs for gcc12

---
 srcpkgs/linux5.18/files/x86_64-dotconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/linux5.18/files/x86_64-dotconfig b/srcpkgs/linux5.18/files/x86_64-dotconfig
index 4e73a3195d40..ea6204868e23 100644
--- a/srcpkgs/linux5.18/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.18/files/x86_64-dotconfig
@@ -512,6 +512,7 @@ CONFIG_RETHUNK=y
 CONFIG_CPU_UNRET_ENTRY=y
 CONFIG_CPU_IBPB_ENTRY=y
 CONFIG_CPU_IBRS_ENTRY=y
+CONFIG_SLS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10060,8 +10061,11 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
 # Memory initialization
 #
 CONFIG_INIT_STACK_NONE=y
+# CONFIG_INIT_STACK_ALL_PATTERN is not set
+# CONFIG_INIT_STACK_ALL_ZERO is not set
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
+# CONFIG_ZERO_CALL_USED_REGS is not set
 # end of Memory initialization
 # end of Kernel hardening options
 # end of Security options
@@ -10538,6 +10542,7 @@ CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
 # CONFIG_UBSAN is not set
 CONFIG_HAVE_ARCH_KCSAN=y
+# CONFIG_KCSAN is not set
 # end of Generic Kernel Debugging Instruments
 
 #

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.1.0
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (14 preceding siblings ...)
  2022-08-13  6:32 ` [PR PATCH] [Updated] gcc: update to 12.1.0 oreo639
@ 2022-08-13  6:49 ` oreo639
  2022-08-15  2:24 ` oreo639
                   ` (248 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-08-13  6:49 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1717 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.1.0
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.1.0

This PR depends on: https://github.com/void-linux/void-packages/pull/32330

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system to ensure that compiles and it appears to work fine.

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 56585 bytes --]

From bb6c79ed935b0a7513c85b5987c41aefcfaa0b00 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 1/7] binutils: update to 2.38.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     |  9 +--
 3 files changed, 22 insertions(+), 113 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..b2b1c47d22fc 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.38
+revision=1
 bootstrap=yes
+hostmakedepends="pkg-config"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=e316477a914f567eccc34d5d29785b8b0f5a10208d36bbacedcc39048ecfe024
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"

From e120b88e332b7b01fc62fb99bf71cb8577e9051f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 2/7] gcc: update to 12.1.0.

---
 common/shlibs                                 |  10 +-
 srcpkgs/gcc/files/gccgo-musl.patch            |  74 +++--------
 srcpkgs/gcc/files/libgnarl-musl.patch         |  18 +--
 srcpkgs/gcc/files/libssp-musl.patch           |  10 +-
 ...c21f3f5726823e19728fdd1571a14aae0fb3.patch | 105 ++++++++++++++++
 ...08065bdd36fb1a9b6aad9666b1edb5e06474.patch | 115 ++++++++++++++++++
 srcpkgs/gcc/patches/libffi_gnulinux.patch     |  11 --
 .../gcc/patches/libgcc-ibm128-no-tag.patch    |  10 +-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |   3 +-
 srcpkgs/gcc/template                          |  25 ++--
 10 files changed, 273 insertions(+), 108 deletions(-)
 create mode 100644 srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
 create mode 100644 srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index 61924610cc52..c6400b566966 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.1.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.34 perl-5.34.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -849,8 +849,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.1.0_1
+libgnat-12.so libada-12.1.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1701,8 +1701,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.1.0_1
+libasan.so.8 libsanitizer-12.1.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..632ef951097b 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,17 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ a/libgo/go/runtime/os_linux.go
+@@ -363,9 +363,9 @@
+ 
+ 	var timerid int32
+ 	var sevp _sigevent
+-	sevp.sigev_notify = _SIGEV_THREAD_ID
++	sevp.sigev_notify = 4
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.sigev_notify_function))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch b/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
new file mode 100644
index 000000000000..00929202a503
--- /dev/null
+++ b/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
@@ -0,0 +1,105 @@
+From 3b21c21f3f5726823e19728fdd1571a14aae0fb3 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <siarheit@google.com>
+Date: Mon, 27 Jun 2022 13:27:24 +0100
+Subject: [PATCH] c++: avoid <memory> poisoning on musl [PR106102]
+
+On musl <pthread.h> uses calloc() (via <sched.h>). <memory> includes
+it indirectly and exposes use of poisoned calloc() when module code
+is built:
+
+    /build/build/./prev-gcc/xg++ ... ../../gcc-13-20220626/gcc/cp/mapper-resolver.cc
+        In file included from /<<NIX>>/musl-1.2.3-dev/include/pthread.h:30,
+                 from /build/build/prev-x86_64-unknown-linux-musl/libstdc++-v3/include/x86_64-unknown-linux-musl/bits/gthr-default.h:35,
+                 ....
+                 from /build/build/prev-x86_64-unknown-linux-musl/libstdc++-v3/include/memory:77,
+                 from ../../gcc-13-20220626/gcc/../libcody/cody.hh:24,
+                 from ../../gcc-13-20220626/gcc/cp/../../c++tools/resolver.h:25,
+                 from ../../gcc-13-20220626/gcc/cp/../../c++tools/resolver.cc:23,
+                 from ../../gcc-13-20220626/gcc/cp/mapper-resolver.cc:32:
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:84:7: error: attempt to use poisoned "calloc"
+       84 | void *calloc(size_t, size_t);
+          |       ^
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:124:36: error: attempt to use poisoned "calloc"
+      124 | #define CPU_ALLOC(n) ((cpu_set_t *)calloc(1,CPU_ALLOC_SIZE(n)))
+          |                                    ^
+
+gcc/cp/
+
+	PR c++/106102
+	* mapper-client.cc: Include <memory> via "system.h".
+	* mapper-resolver.cc: Ditto.
+	* module.cc: Ditto.
+
+libcc1/
+
+	PR c++/106102
+	* libcc1plugin.cc: Include <memory> via "system.h".
+	* libcp1plugin.cc: Ditto.
+---
+ gcc/cp/mapper-client.cc   | 1 +
+ gcc/cp/mapper-resolver.cc | 1 +
+ gcc/cp/module.cc          | 1 +
+ libcc1/libcc1plugin.cc    | 1 +
+ libcc1/libcp1plugin.cc    | 1 +
+ 5 files changed, 5 insertions(+)
+
+diff --git a/gcc/cp/mapper-client.cc b/gcc/cp/mapper-client.cc
+index 8603a886a099..fe9544b5ba43 100644
+--- a/gcc/cp/mapper-client.cc
++++ b/gcc/cp/mapper-client.cc
+@@ -27,6 +27,7 @@ along with GCC; see the file COPYING3.  If not see
+ #define INCLUDE_STRING
+ #define INCLUDE_VECTOR
+ #define INCLUDE_MAP
++#define INCLUDE_MEMORY
+ #include "system.h"
+ 
+ #include "line-map.h"
+diff --git a/gcc/cp/mapper-resolver.cc b/gcc/cp/mapper-resolver.cc
+index e3d29fb5ada1..e70d1b4ae2ca 100644
+--- a/gcc/cp/mapper-resolver.cc
++++ b/gcc/cp/mapper-resolver.cc
+@@ -25,6 +25,7 @@ along with GCC; see the file COPYING3.  If not see
+ #define INCLUDE_VECTOR
+ #define INCLUDE_ALGORITHM
+ #define INCLUDE_MAP
++#define INCLUDE_MEMORY
+ #include "system.h"
+ 
+ // We don't want or need to be aware of networking
+diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc
+index 753963a4b246..8bb22c2b305a 100644
+--- a/gcc/cp/module.cc
++++ b/gcc/cp/module.cc
+@@ -206,6 +206,7 @@ Classes used:
+ 
+ #define _DEFAULT_SOURCE 1 /* To get TZ field of struct tm, if available.  */
+ #include "config.h"
++#define INCLUDE_MEMORY
+ #define INCLUDE_STRING
+ #define INCLUDE_VECTOR
+ #include "system.h"
+diff --git a/libcc1/libcc1plugin.cc b/libcc1/libcc1plugin.cc
+index 12ab5a57c8dd..bdd0bdabe77f 100644
+--- a/libcc1/libcc1plugin.cc
++++ b/libcc1/libcc1plugin.cc
+@@ -31,6 +31,7 @@
+ #undef PACKAGE_TARNAME
+ #undef PACKAGE_VERSION
+ 
++#define INCLUDE_MEMORY
+ #include "gcc-plugin.h"
+ #include "system.h"
+ #include "coretypes.h"
+diff --git a/libcc1/libcp1plugin.cc b/libcc1/libcp1plugin.cc
+index 83dab7f58b11..e2d5039a0a1f 100644
+--- a/libcc1/libcp1plugin.cc
++++ b/libcc1/libcp1plugin.cc
+@@ -32,6 +32,7 @@
+ #undef PACKAGE_TARNAME
+ #undef PACKAGE_VERSION
+ 
++#define INCLUDE_MEMORY
+ #include "gcc-plugin.h"
+ #include "system.h"
+ #include "coretypes.h"
diff --git a/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch b/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
new file mode 100644
index 000000000000..89bd053d6d04
--- /dev/null
+++ b/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
@@ -0,0 +1,115 @@
+From 49d508065bdd36fb1a9b6aad9666b1edb5e06474 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <siarheit@google.com>
+Date: Mon, 27 Jun 2022 23:42:44 +0100
+Subject: [PATCH] jit: avoid calloc() poisoning on musl [PR106102]
+
+On musl <pthread.h> uses calloc() (via <sched.h>). jit/ includes
+it directly and exposes use of poisoned calloc():
+
+    /build/build/./prev-gcc/xg++ ... ../../gcc-13-20220626/gcc/jit/jit-playback.cc
+    make[3]: *** [Makefile:1143: jit/libgccjit.o] Error 1
+    make[3]: *** Waiting for unfinished jobs....
+    In file included from /<<NIX>>/musl-1.2.3-dev/include/pthread.h:30,
+                     from ../../gcc-13-20220626/gcc/jit/jit-playback.cc:44:
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:84:7: error: attempt to use poisoned "calloc"
+       84 | void *calloc(size_t, size_t);
+          |       ^
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:124:36: error: attempt to use poisoned "calloc"
+      124 | #define CPU_ALLOC(n) ((cpu_set_t *)calloc(1,CPU_ALLOC_SIZE(n)))
+          |                                    ^
+
+The change moves <pthread.h> inclusion to "system.h" under new
+INCLUDE_PTHREAD_H guard and uses this mechanism in libgccjit.
+
+gcc/
+
+	PR c++/106102
+	* system.h: Introduce INCLUDE_PTHREAD_H macros to include <pthread.h>.
+
+gcc/jit/
+
+	PR c++/106102
+	* jit-playback.cc: Include <pthread.h> via "system.h" to avoid calloc()
+	poisoning.
+	* jit-recording.cc: Ditto.
+	* libgccjit.cc: Ditto.
+---
+ gcc/jit/jit-playback.cc  | 3 +--
+ gcc/jit/jit-recording.cc | 2 +-
+ gcc/jit/libgccjit.cc     | 2 +-
+ gcc/system.h             | 4 ++++
+ 4 files changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/gcc/jit/jit-playback.cc b/gcc/jit/jit-playback.cc
+index 6be6bdf8dea5..79714132b91a 100644
+--- a/gcc/jit/jit-playback.cc
++++ b/gcc/jit/jit-playback.cc
+@@ -19,6 +19,7 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "target.h"
+@@ -41,8 +42,6 @@ along with GCC; see the file COPYING3.  If not see
+ #include "diagnostic.h"
+ #include "stmt.h"
+ 
+-#include <pthread.h>
+-
+ #include "jit-playback.h"
+ #include "jit-result.h"
+ #include "jit-builtins.h"
+diff --git a/gcc/jit/jit-recording.cc b/gcc/jit/jit-recording.cc
+index 697dee66e733..f78daed2d71a 100644
+--- a/gcc/jit/jit-recording.cc
++++ b/gcc/jit/jit-recording.cc
+@@ -19,13 +19,13 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "tm.h"
+ #include "pretty-print.h"
+ #include "toplev.h"
+ 
+-#include <pthread.h>
+ 
+ #include "jit-builtins.h"
+ #include "jit-recording.h"
+diff --git a/gcc/jit/libgccjit.cc b/gcc/jit/libgccjit.cc
+index 0e76097b4bac..ca862662777e 100644
+--- a/gcc/jit/libgccjit.cc
++++ b/gcc/jit/libgccjit.cc
+@@ -19,12 +19,12 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "timevar.h"
+ #include "typed-splay-tree.h"
+ #include "cppbuiltin.h"
+-#include <pthread.h>
+ 
+ #include "libgccjit.h"
+ #include "jit-recording.h"
+diff --git a/gcc/system.h b/gcc/system.h
+index 67158b70c789..f8d42ff68150 100644
+--- a/gcc/system.h
++++ b/gcc/system.h
+@@ -753,6 +753,10 @@ extern int vsnprintf (char *, size_t, const char *, va_list);
+ #endif
+ #endif
+ 
++#ifdef INCLUDE_PTHREAD_H
++#include <pthread.h>
++#endif
++
+ #ifdef INCLUDE_ISL
+ #ifdef HAVE_isl
+ #include <isl/options.h>
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..78a2ce35875d 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,9 +3,10 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
  
  #  ifndef _ABIN32
+
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..32ee79e32f0d 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,15 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
+version=12.1.0
+revision=1
 _patchver="${version%pre*}"
 _minorver="${_patchver%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 wrksrc=gcc-${version/pre/_pre}
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +19,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -396,7 +393,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}

From c23c6ba9a800f0ec3447d796c619e85c1db8981b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 3/7] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      |  6 ++--
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..08e35d466a44 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From 55736ef1267cac9b070d71099fe7b2115ed56541 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 4/7] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 1a4e1ca3d594..b04268908c2e 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="q66 <daniel@octaforge.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From 57a8836f17e7b6f2c333ad4a0cfe09ae9bb4c482 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 5/7] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 3 files changed, 55 insertions(+), 353 deletions(-)
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index c6400b566966..65f4d1b62b61 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From 57ea64b1f2aae6338f9487aa58f2b87ccb5291d5 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:08:52 -0700
Subject: [PATCH 6/7] openssh: suppress werror on gcc12

---
 srcpkgs/openssh/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/openssh/template b/srcpkgs/openssh/template
index 02a2dec35f42..6e8e343a9dca 100644
--- a/srcpkgs/openssh/template
+++ b/srcpkgs/openssh/template
@@ -40,7 +40,7 @@ if [ "$build_option_ldns" -a -z "$build_option_ssl" ]; then
 	broken="option 'ldns' requires option 'ssl'"
 fi
 
-CFLAGS="-Wno-format-truncation -Wno-stringop-truncation"
+CFLAGS="-Wno-format-truncation -Wno-stringop-truncation -Wno-error=maybe-uninitialized"
 
 case $XBPS_TARGET_MACHINE in
 	i686-musl)

From 15315949d8817c1ca7eec99d4d42908cb192c4b3 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:09:31 -0700
Subject: [PATCH 7/7] linux5.18: update dotconfigs for gcc12

---
 srcpkgs/linux5.18/files/x86_64-dotconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/linux5.18/files/x86_64-dotconfig b/srcpkgs/linux5.18/files/x86_64-dotconfig
index 4e73a3195d40..ea6204868e23 100644
--- a/srcpkgs/linux5.18/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.18/files/x86_64-dotconfig
@@ -512,6 +512,7 @@ CONFIG_RETHUNK=y
 CONFIG_CPU_UNRET_ENTRY=y
 CONFIG_CPU_IBPB_ENTRY=y
 CONFIG_CPU_IBRS_ENTRY=y
+CONFIG_SLS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10060,8 +10061,11 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
 # Memory initialization
 #
 CONFIG_INIT_STACK_NONE=y
+# CONFIG_INIT_STACK_ALL_PATTERN is not set
+# CONFIG_INIT_STACK_ALL_ZERO is not set
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
+# CONFIG_ZERO_CALL_USED_REGS is not set
 # end of Memory initialization
 # end of Kernel hardening options
 # end of Security options
@@ -10538,6 +10542,7 @@ CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
 # CONFIG_UBSAN is not set
 CONFIG_HAVE_ARCH_KCSAN=y
+# CONFIG_KCSAN is not set
 # end of Generic Kernel Debugging Instruments
 
 #

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.1.0
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (15 preceding siblings ...)
  2022-08-13  6:49 ` oreo639
@ 2022-08-15  2:24 ` oreo639
  2022-08-15  2:31 ` oreo639
                   ` (247 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-08-15  2:24 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1717 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.1.0
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.1.0

This PR depends on: https://github.com/void-linux/void-packages/pull/32330

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system to ensure that compiles and it appears to work fine.

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 57999 bytes --]

From bb6c79ed935b0a7513c85b5987c41aefcfaa0b00 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 1/7] binutils: update to 2.38.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     |  9 +--
 3 files changed, 22 insertions(+), 113 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..b2b1c47d22fc 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.38
+revision=1
 bootstrap=yes
+hostmakedepends="pkg-config"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=e316477a914f567eccc34d5d29785b8b0f5a10208d36bbacedcc39048ecfe024
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"

From 81dea5b96efffd0287e26041a2141acc32a3ff21 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 2/7] gcc: update to 12.1.0.

---
 common/shlibs                                 |  10 +-
 srcpkgs/gcc/files/gccgo-musl.patch            |  74 +++--------
 srcpkgs/gcc/files/libgnarl-musl.patch         |  18 +--
 srcpkgs/gcc/files/libssp-musl.patch           |  10 +-
 ...c21f3f5726823e19728fdd1571a14aae0fb3.patch | 105 ++++++++++++++++
 ...08065bdd36fb1a9b6aad9666b1edb5e06474.patch | 115 ++++++++++++++++++
 ...65517a59565758107c5b1a51a5fa382f8d1a.patch |  32 +++++
 srcpkgs/gcc/patches/libffi_gnulinux.patch     |  11 --
 .../gcc/patches/libgcc-ibm128-no-tag.patch    |  10 +-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |   3 +-
 srcpkgs/gcc/template                          |  25 ++--
 11 files changed, 305 insertions(+), 108 deletions(-)
 create mode 100644 srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
 create mode 100644 srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
 create mode 100644 srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index 61924610cc52..c6400b566966 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.1.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.34 perl-5.34.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -849,8 +849,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.1.0_1
+libgnat-12.so libada-12.1.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1701,8 +1701,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.1.0_1
+libasan.so.8 libsanitizer-12.1.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..632ef951097b 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,17 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ a/libgo/go/runtime/os_linux.go
+@@ -363,9 +363,9 @@
+ 
+ 	var timerid int32
+ 	var sevp _sigevent
+-	sevp.sigev_notify = _SIGEV_THREAD_ID
++	sevp.sigev_notify = 4
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.sigev_notify_function))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch b/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
new file mode 100644
index 000000000000..00929202a503
--- /dev/null
+++ b/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
@@ -0,0 +1,105 @@
+From 3b21c21f3f5726823e19728fdd1571a14aae0fb3 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <siarheit@google.com>
+Date: Mon, 27 Jun 2022 13:27:24 +0100
+Subject: [PATCH] c++: avoid <memory> poisoning on musl [PR106102]
+
+On musl <pthread.h> uses calloc() (via <sched.h>). <memory> includes
+it indirectly and exposes use of poisoned calloc() when module code
+is built:
+
+    /build/build/./prev-gcc/xg++ ... ../../gcc-13-20220626/gcc/cp/mapper-resolver.cc
+        In file included from /<<NIX>>/musl-1.2.3-dev/include/pthread.h:30,
+                 from /build/build/prev-x86_64-unknown-linux-musl/libstdc++-v3/include/x86_64-unknown-linux-musl/bits/gthr-default.h:35,
+                 ....
+                 from /build/build/prev-x86_64-unknown-linux-musl/libstdc++-v3/include/memory:77,
+                 from ../../gcc-13-20220626/gcc/../libcody/cody.hh:24,
+                 from ../../gcc-13-20220626/gcc/cp/../../c++tools/resolver.h:25,
+                 from ../../gcc-13-20220626/gcc/cp/../../c++tools/resolver.cc:23,
+                 from ../../gcc-13-20220626/gcc/cp/mapper-resolver.cc:32:
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:84:7: error: attempt to use poisoned "calloc"
+       84 | void *calloc(size_t, size_t);
+          |       ^
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:124:36: error: attempt to use poisoned "calloc"
+      124 | #define CPU_ALLOC(n) ((cpu_set_t *)calloc(1,CPU_ALLOC_SIZE(n)))
+          |                                    ^
+
+gcc/cp/
+
+	PR c++/106102
+	* mapper-client.cc: Include <memory> via "system.h".
+	* mapper-resolver.cc: Ditto.
+	* module.cc: Ditto.
+
+libcc1/
+
+	PR c++/106102
+	* libcc1plugin.cc: Include <memory> via "system.h".
+	* libcp1plugin.cc: Ditto.
+---
+ gcc/cp/mapper-client.cc   | 1 +
+ gcc/cp/mapper-resolver.cc | 1 +
+ gcc/cp/module.cc          | 1 +
+ libcc1/libcc1plugin.cc    | 1 +
+ libcc1/libcp1plugin.cc    | 1 +
+ 5 files changed, 5 insertions(+)
+
+diff --git a/gcc/cp/mapper-client.cc b/gcc/cp/mapper-client.cc
+index 8603a886a099..fe9544b5ba43 100644
+--- a/gcc/cp/mapper-client.cc
++++ b/gcc/cp/mapper-client.cc
+@@ -27,6 +27,7 @@ along with GCC; see the file COPYING3.  If not see
+ #define INCLUDE_STRING
+ #define INCLUDE_VECTOR
+ #define INCLUDE_MAP
++#define INCLUDE_MEMORY
+ #include "system.h"
+ 
+ #include "line-map.h"
+diff --git a/gcc/cp/mapper-resolver.cc b/gcc/cp/mapper-resolver.cc
+index e3d29fb5ada1..e70d1b4ae2ca 100644
+--- a/gcc/cp/mapper-resolver.cc
++++ b/gcc/cp/mapper-resolver.cc
+@@ -25,6 +25,7 @@ along with GCC; see the file COPYING3.  If not see
+ #define INCLUDE_VECTOR
+ #define INCLUDE_ALGORITHM
+ #define INCLUDE_MAP
++#define INCLUDE_MEMORY
+ #include "system.h"
+ 
+ // We don't want or need to be aware of networking
+diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc
+index 753963a4b246..8bb22c2b305a 100644
+--- a/gcc/cp/module.cc
++++ b/gcc/cp/module.cc
+@@ -206,6 +206,7 @@ Classes used:
+ 
+ #define _DEFAULT_SOURCE 1 /* To get TZ field of struct tm, if available.  */
+ #include "config.h"
++#define INCLUDE_MEMORY
+ #define INCLUDE_STRING
+ #define INCLUDE_VECTOR
+ #include "system.h"
+diff --git a/libcc1/libcc1plugin.cc b/libcc1/libcc1plugin.cc
+index 12ab5a57c8dd..bdd0bdabe77f 100644
+--- a/libcc1/libcc1plugin.cc
++++ b/libcc1/libcc1plugin.cc
+@@ -31,6 +31,7 @@
+ #undef PACKAGE_TARNAME
+ #undef PACKAGE_VERSION
+ 
++#define INCLUDE_MEMORY
+ #include "gcc-plugin.h"
+ #include "system.h"
+ #include "coretypes.h"
+diff --git a/libcc1/libcp1plugin.cc b/libcc1/libcp1plugin.cc
+index 83dab7f58b11..e2d5039a0a1f 100644
+--- a/libcc1/libcp1plugin.cc
++++ b/libcc1/libcp1plugin.cc
+@@ -32,6 +32,7 @@
+ #undef PACKAGE_TARNAME
+ #undef PACKAGE_VERSION
+ 
++#define INCLUDE_MEMORY
+ #include "gcc-plugin.h"
+ #include "system.h"
+ #include "coretypes.h"
diff --git a/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch b/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
new file mode 100644
index 000000000000..89bd053d6d04
--- /dev/null
+++ b/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
@@ -0,0 +1,115 @@
+From 49d508065bdd36fb1a9b6aad9666b1edb5e06474 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <siarheit@google.com>
+Date: Mon, 27 Jun 2022 23:42:44 +0100
+Subject: [PATCH] jit: avoid calloc() poisoning on musl [PR106102]
+
+On musl <pthread.h> uses calloc() (via <sched.h>). jit/ includes
+it directly and exposes use of poisoned calloc():
+
+    /build/build/./prev-gcc/xg++ ... ../../gcc-13-20220626/gcc/jit/jit-playback.cc
+    make[3]: *** [Makefile:1143: jit/libgccjit.o] Error 1
+    make[3]: *** Waiting for unfinished jobs....
+    In file included from /<<NIX>>/musl-1.2.3-dev/include/pthread.h:30,
+                     from ../../gcc-13-20220626/gcc/jit/jit-playback.cc:44:
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:84:7: error: attempt to use poisoned "calloc"
+       84 | void *calloc(size_t, size_t);
+          |       ^
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:124:36: error: attempt to use poisoned "calloc"
+      124 | #define CPU_ALLOC(n) ((cpu_set_t *)calloc(1,CPU_ALLOC_SIZE(n)))
+          |                                    ^
+
+The change moves <pthread.h> inclusion to "system.h" under new
+INCLUDE_PTHREAD_H guard and uses this mechanism in libgccjit.
+
+gcc/
+
+	PR c++/106102
+	* system.h: Introduce INCLUDE_PTHREAD_H macros to include <pthread.h>.
+
+gcc/jit/
+
+	PR c++/106102
+	* jit-playback.cc: Include <pthread.h> via "system.h" to avoid calloc()
+	poisoning.
+	* jit-recording.cc: Ditto.
+	* libgccjit.cc: Ditto.
+---
+ gcc/jit/jit-playback.cc  | 3 +--
+ gcc/jit/jit-recording.cc | 2 +-
+ gcc/jit/libgccjit.cc     | 2 +-
+ gcc/system.h             | 4 ++++
+ 4 files changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/gcc/jit/jit-playback.cc b/gcc/jit/jit-playback.cc
+index 6be6bdf8dea5..79714132b91a 100644
+--- a/gcc/jit/jit-playback.cc
++++ b/gcc/jit/jit-playback.cc
+@@ -19,6 +19,7 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "target.h"
+@@ -41,8 +42,6 @@ along with GCC; see the file COPYING3.  If not see
+ #include "diagnostic.h"
+ #include "stmt.h"
+ 
+-#include <pthread.h>
+-
+ #include "jit-playback.h"
+ #include "jit-result.h"
+ #include "jit-builtins.h"
+diff --git a/gcc/jit/jit-recording.cc b/gcc/jit/jit-recording.cc
+index 697dee66e733..f78daed2d71a 100644
+--- a/gcc/jit/jit-recording.cc
++++ b/gcc/jit/jit-recording.cc
+@@ -19,13 +19,13 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "tm.h"
+ #include "pretty-print.h"
+ #include "toplev.h"
+ 
+-#include <pthread.h>
+ 
+ #include "jit-builtins.h"
+ #include "jit-recording.h"
+diff --git a/gcc/jit/libgccjit.cc b/gcc/jit/libgccjit.cc
+index 0e76097b4bac..ca862662777e 100644
+--- a/gcc/jit/libgccjit.cc
++++ b/gcc/jit/libgccjit.cc
+@@ -19,12 +19,12 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "timevar.h"
+ #include "typed-splay-tree.h"
+ #include "cppbuiltin.h"
+-#include <pthread.h>
+ 
+ #include "libgccjit.h"
+ #include "jit-recording.h"
+diff --git a/gcc/system.h b/gcc/system.h
+index 67158b70c789..f8d42ff68150 100644
+--- a/gcc/system.h
++++ b/gcc/system.h
+@@ -753,6 +753,10 @@ extern int vsnprintf (char *, size_t, const char *, va_list);
+ #endif
+ #endif
+ 
++#ifdef INCLUDE_PTHREAD_H
++#include <pthread.h>
++#endif
++
+ #ifdef INCLUDE_ISL
+ #ifdef HAVE_isl
+ #include <isl/options.h>
diff --git a/srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch b/srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch
new file mode 100644
index 000000000000..044a4fc29514
--- /dev/null
+++ b/srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch
@@ -0,0 +1,32 @@
+From f35d65517a59565758107c5b1a51a5fa382f8d1a Mon Sep 17 00:00:00 2001
+From: Ian Lance Taylor <iant@golang.org>
+Date: Tue, 12 Jul 2022 19:42:43 -0700
+Subject: [PATCH] libgo: don't include <linux/fs.h> when building
+ gen-sysinfo.go
+
+Removing this doesn't change anything at least with glibc 2.33.
+The include was added in https://go.dev/cl/6100049 but it's not
+clear why.
+
+Fixes PR go/106266
+
+Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/417294
+---
+ gcc/go/gofrontend/MERGE | 2 +-
+ libgo/sysinfo.c         | 3 ---
+ 2 files changed, 1 insertion(+), 4 deletions(-)
+
+diff --git a/libgo/sysinfo.c b/libgo/sysinfo.c
+index a4259c02ded4..fc0210992faa 100644
+--- a/libgo/sysinfo.c
++++ b/libgo/sysinfo.c
+@@ -158,9 +158,6 @@
+ #if defined(HAVE_LINUX_ETHER_H)
+ #include <linux/ether.h>
+ #endif
+-#if defined(HAVE_LINUX_FS_H)
+-#include <linux/fs.h>
+-#endif
+ #if defined(HAVE_LINUX_REBOOT_H)
+ #include <linux/reboot.h>
+ #endif
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..78a2ce35875d 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,9 +3,10 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
  
  #  ifndef _ABIN32
+
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..32ee79e32f0d 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,15 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
+version=12.1.0
+revision=1
 _patchver="${version%pre*}"
 _minorver="${_patchver%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 wrksrc=gcc-${version/pre/_pre}
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +19,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -396,7 +393,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}

From 2291feed5bcca91851d6b6ee3f55811a8748e1ce Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 3/7] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      |  6 ++--
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..08e35d466a44 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From f3bd650f31809e9deaa9bfd420e832f4af07e317 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 4/7] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 1a4e1ca3d594..b04268908c2e 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="q66 <daniel@octaforge.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From 936c4b5891dd215aa99776642b6d97707e77c955 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 5/7] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 3 files changed, 55 insertions(+), 353 deletions(-)
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index c6400b566966..65f4d1b62b61 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From f3b70709592a3466325f32ca1b495ec6d270b3d2 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:08:52 -0700
Subject: [PATCH 6/7] openssh: suppress werror on gcc12

---
 srcpkgs/openssh/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/openssh/template b/srcpkgs/openssh/template
index 02a2dec35f42..6e8e343a9dca 100644
--- a/srcpkgs/openssh/template
+++ b/srcpkgs/openssh/template
@@ -40,7 +40,7 @@ if [ "$build_option_ldns" -a -z "$build_option_ssl" ]; then
 	broken="option 'ldns' requires option 'ssl'"
 fi
 
-CFLAGS="-Wno-format-truncation -Wno-stringop-truncation"
+CFLAGS="-Wno-format-truncation -Wno-stringop-truncation -Wno-error=maybe-uninitialized"
 
 case $XBPS_TARGET_MACHINE in
 	i686-musl)

From 8d683f32ed93b2d36208f915cbd2b8275f5afd6d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:09:31 -0700
Subject: [PATCH 7/7] linux5.18: update dotconfigs for gcc12

---
 srcpkgs/linux5.18/files/x86_64-dotconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/linux5.18/files/x86_64-dotconfig b/srcpkgs/linux5.18/files/x86_64-dotconfig
index 4e73a3195d40..ea6204868e23 100644
--- a/srcpkgs/linux5.18/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.18/files/x86_64-dotconfig
@@ -512,6 +512,7 @@ CONFIG_RETHUNK=y
 CONFIG_CPU_UNRET_ENTRY=y
 CONFIG_CPU_IBPB_ENTRY=y
 CONFIG_CPU_IBRS_ENTRY=y
+CONFIG_SLS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10060,8 +10061,11 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
 # Memory initialization
 #
 CONFIG_INIT_STACK_NONE=y
+# CONFIG_INIT_STACK_ALL_PATTERN is not set
+# CONFIG_INIT_STACK_ALL_ZERO is not set
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
+# CONFIG_ZERO_CALL_USED_REGS is not set
 # end of Memory initialization
 # end of Kernel hardening options
 # end of Security options
@@ -10538,6 +10542,7 @@ CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
 # CONFIG_UBSAN is not set
 CONFIG_HAVE_ARCH_KCSAN=y
+# CONFIG_KCSAN is not set
 # end of Generic Kernel Debugging Instruments
 
 #

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.1.0
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (16 preceding siblings ...)
  2022-08-15  2:24 ` oreo639
@ 2022-08-15  2:31 ` oreo639
  2022-08-15  3:20 ` oreo639
                   ` (246 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-08-15  2:31 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1717 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.1.0
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.1.0

This PR depends on: https://github.com/void-linux/void-packages/pull/32330

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system to ensure that compiles and it appears to work fine.

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 58823 bytes --]

From bb6c79ed935b0a7513c85b5987c41aefcfaa0b00 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 1/8] binutils: update to 2.38.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     |  9 +--
 3 files changed, 22 insertions(+), 113 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..b2b1c47d22fc 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.38
+revision=1
 bootstrap=yes
+hostmakedepends="pkg-config"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=e316477a914f567eccc34d5d29785b8b0f5a10208d36bbacedcc39048ecfe024
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"

From 81dea5b96efffd0287e26041a2141acc32a3ff21 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 2/8] gcc: update to 12.1.0.

---
 common/shlibs                                 |  10 +-
 srcpkgs/gcc/files/gccgo-musl.patch            |  74 +++--------
 srcpkgs/gcc/files/libgnarl-musl.patch         |  18 +--
 srcpkgs/gcc/files/libssp-musl.patch           |  10 +-
 ...c21f3f5726823e19728fdd1571a14aae0fb3.patch | 105 ++++++++++++++++
 ...08065bdd36fb1a9b6aad9666b1edb5e06474.patch | 115 ++++++++++++++++++
 ...65517a59565758107c5b1a51a5fa382f8d1a.patch |  32 +++++
 srcpkgs/gcc/patches/libffi_gnulinux.patch     |  11 --
 .../gcc/patches/libgcc-ibm128-no-tag.patch    |  10 +-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |   3 +-
 srcpkgs/gcc/template                          |  25 ++--
 11 files changed, 305 insertions(+), 108 deletions(-)
 create mode 100644 srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
 create mode 100644 srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
 create mode 100644 srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index 61924610cc52..c6400b566966 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.1.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.34 perl-5.34.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -849,8 +849,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.1.0_1
+libgnat-12.so libada-12.1.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1701,8 +1701,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.1.0_1
+libasan.so.8 libsanitizer-12.1.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..632ef951097b 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,17 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ a/libgo/go/runtime/os_linux.go
+@@ -363,9 +363,9 @@
+ 
+ 	var timerid int32
+ 	var sevp _sigevent
+-	sevp.sigev_notify = _SIGEV_THREAD_ID
++	sevp.sigev_notify = 4
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.sigev_notify_function))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch b/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
new file mode 100644
index 000000000000..00929202a503
--- /dev/null
+++ b/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
@@ -0,0 +1,105 @@
+From 3b21c21f3f5726823e19728fdd1571a14aae0fb3 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <siarheit@google.com>
+Date: Mon, 27 Jun 2022 13:27:24 +0100
+Subject: [PATCH] c++: avoid <memory> poisoning on musl [PR106102]
+
+On musl <pthread.h> uses calloc() (via <sched.h>). <memory> includes
+it indirectly and exposes use of poisoned calloc() when module code
+is built:
+
+    /build/build/./prev-gcc/xg++ ... ../../gcc-13-20220626/gcc/cp/mapper-resolver.cc
+        In file included from /<<NIX>>/musl-1.2.3-dev/include/pthread.h:30,
+                 from /build/build/prev-x86_64-unknown-linux-musl/libstdc++-v3/include/x86_64-unknown-linux-musl/bits/gthr-default.h:35,
+                 ....
+                 from /build/build/prev-x86_64-unknown-linux-musl/libstdc++-v3/include/memory:77,
+                 from ../../gcc-13-20220626/gcc/../libcody/cody.hh:24,
+                 from ../../gcc-13-20220626/gcc/cp/../../c++tools/resolver.h:25,
+                 from ../../gcc-13-20220626/gcc/cp/../../c++tools/resolver.cc:23,
+                 from ../../gcc-13-20220626/gcc/cp/mapper-resolver.cc:32:
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:84:7: error: attempt to use poisoned "calloc"
+       84 | void *calloc(size_t, size_t);
+          |       ^
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:124:36: error: attempt to use poisoned "calloc"
+      124 | #define CPU_ALLOC(n) ((cpu_set_t *)calloc(1,CPU_ALLOC_SIZE(n)))
+          |                                    ^
+
+gcc/cp/
+
+	PR c++/106102
+	* mapper-client.cc: Include <memory> via "system.h".
+	* mapper-resolver.cc: Ditto.
+	* module.cc: Ditto.
+
+libcc1/
+
+	PR c++/106102
+	* libcc1plugin.cc: Include <memory> via "system.h".
+	* libcp1plugin.cc: Ditto.
+---
+ gcc/cp/mapper-client.cc   | 1 +
+ gcc/cp/mapper-resolver.cc | 1 +
+ gcc/cp/module.cc          | 1 +
+ libcc1/libcc1plugin.cc    | 1 +
+ libcc1/libcp1plugin.cc    | 1 +
+ 5 files changed, 5 insertions(+)
+
+diff --git a/gcc/cp/mapper-client.cc b/gcc/cp/mapper-client.cc
+index 8603a886a099..fe9544b5ba43 100644
+--- a/gcc/cp/mapper-client.cc
++++ b/gcc/cp/mapper-client.cc
+@@ -27,6 +27,7 @@ along with GCC; see the file COPYING3.  If not see
+ #define INCLUDE_STRING
+ #define INCLUDE_VECTOR
+ #define INCLUDE_MAP
++#define INCLUDE_MEMORY
+ #include "system.h"
+ 
+ #include "line-map.h"
+diff --git a/gcc/cp/mapper-resolver.cc b/gcc/cp/mapper-resolver.cc
+index e3d29fb5ada1..e70d1b4ae2ca 100644
+--- a/gcc/cp/mapper-resolver.cc
++++ b/gcc/cp/mapper-resolver.cc
+@@ -25,6 +25,7 @@ along with GCC; see the file COPYING3.  If not see
+ #define INCLUDE_VECTOR
+ #define INCLUDE_ALGORITHM
+ #define INCLUDE_MAP
++#define INCLUDE_MEMORY
+ #include "system.h"
+ 
+ // We don't want or need to be aware of networking
+diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc
+index 753963a4b246..8bb22c2b305a 100644
+--- a/gcc/cp/module.cc
++++ b/gcc/cp/module.cc
+@@ -206,6 +206,7 @@ Classes used:
+ 
+ #define _DEFAULT_SOURCE 1 /* To get TZ field of struct tm, if available.  */
+ #include "config.h"
++#define INCLUDE_MEMORY
+ #define INCLUDE_STRING
+ #define INCLUDE_VECTOR
+ #include "system.h"
+diff --git a/libcc1/libcc1plugin.cc b/libcc1/libcc1plugin.cc
+index 12ab5a57c8dd..bdd0bdabe77f 100644
+--- a/libcc1/libcc1plugin.cc
++++ b/libcc1/libcc1plugin.cc
+@@ -31,6 +31,7 @@
+ #undef PACKAGE_TARNAME
+ #undef PACKAGE_VERSION
+ 
++#define INCLUDE_MEMORY
+ #include "gcc-plugin.h"
+ #include "system.h"
+ #include "coretypes.h"
+diff --git a/libcc1/libcp1plugin.cc b/libcc1/libcp1plugin.cc
+index 83dab7f58b11..e2d5039a0a1f 100644
+--- a/libcc1/libcp1plugin.cc
++++ b/libcc1/libcp1plugin.cc
+@@ -32,6 +32,7 @@
+ #undef PACKAGE_TARNAME
+ #undef PACKAGE_VERSION
+ 
++#define INCLUDE_MEMORY
+ #include "gcc-plugin.h"
+ #include "system.h"
+ #include "coretypes.h"
diff --git a/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch b/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
new file mode 100644
index 000000000000..89bd053d6d04
--- /dev/null
+++ b/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
@@ -0,0 +1,115 @@
+From 49d508065bdd36fb1a9b6aad9666b1edb5e06474 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <siarheit@google.com>
+Date: Mon, 27 Jun 2022 23:42:44 +0100
+Subject: [PATCH] jit: avoid calloc() poisoning on musl [PR106102]
+
+On musl <pthread.h> uses calloc() (via <sched.h>). jit/ includes
+it directly and exposes use of poisoned calloc():
+
+    /build/build/./prev-gcc/xg++ ... ../../gcc-13-20220626/gcc/jit/jit-playback.cc
+    make[3]: *** [Makefile:1143: jit/libgccjit.o] Error 1
+    make[3]: *** Waiting for unfinished jobs....
+    In file included from /<<NIX>>/musl-1.2.3-dev/include/pthread.h:30,
+                     from ../../gcc-13-20220626/gcc/jit/jit-playback.cc:44:
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:84:7: error: attempt to use poisoned "calloc"
+       84 | void *calloc(size_t, size_t);
+          |       ^
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:124:36: error: attempt to use poisoned "calloc"
+      124 | #define CPU_ALLOC(n) ((cpu_set_t *)calloc(1,CPU_ALLOC_SIZE(n)))
+          |                                    ^
+
+The change moves <pthread.h> inclusion to "system.h" under new
+INCLUDE_PTHREAD_H guard and uses this mechanism in libgccjit.
+
+gcc/
+
+	PR c++/106102
+	* system.h: Introduce INCLUDE_PTHREAD_H macros to include <pthread.h>.
+
+gcc/jit/
+
+	PR c++/106102
+	* jit-playback.cc: Include <pthread.h> via "system.h" to avoid calloc()
+	poisoning.
+	* jit-recording.cc: Ditto.
+	* libgccjit.cc: Ditto.
+---
+ gcc/jit/jit-playback.cc  | 3 +--
+ gcc/jit/jit-recording.cc | 2 +-
+ gcc/jit/libgccjit.cc     | 2 +-
+ gcc/system.h             | 4 ++++
+ 4 files changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/gcc/jit/jit-playback.cc b/gcc/jit/jit-playback.cc
+index 6be6bdf8dea5..79714132b91a 100644
+--- a/gcc/jit/jit-playback.cc
++++ b/gcc/jit/jit-playback.cc
+@@ -19,6 +19,7 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "target.h"
+@@ -41,8 +42,6 @@ along with GCC; see the file COPYING3.  If not see
+ #include "diagnostic.h"
+ #include "stmt.h"
+ 
+-#include <pthread.h>
+-
+ #include "jit-playback.h"
+ #include "jit-result.h"
+ #include "jit-builtins.h"
+diff --git a/gcc/jit/jit-recording.cc b/gcc/jit/jit-recording.cc
+index 697dee66e733..f78daed2d71a 100644
+--- a/gcc/jit/jit-recording.cc
++++ b/gcc/jit/jit-recording.cc
+@@ -19,13 +19,13 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "tm.h"
+ #include "pretty-print.h"
+ #include "toplev.h"
+ 
+-#include <pthread.h>
+ 
+ #include "jit-builtins.h"
+ #include "jit-recording.h"
+diff --git a/gcc/jit/libgccjit.cc b/gcc/jit/libgccjit.cc
+index 0e76097b4bac..ca862662777e 100644
+--- a/gcc/jit/libgccjit.cc
++++ b/gcc/jit/libgccjit.cc
+@@ -19,12 +19,12 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "timevar.h"
+ #include "typed-splay-tree.h"
+ #include "cppbuiltin.h"
+-#include <pthread.h>
+ 
+ #include "libgccjit.h"
+ #include "jit-recording.h"
+diff --git a/gcc/system.h b/gcc/system.h
+index 67158b70c789..f8d42ff68150 100644
+--- a/gcc/system.h
++++ b/gcc/system.h
+@@ -753,6 +753,10 @@ extern int vsnprintf (char *, size_t, const char *, va_list);
+ #endif
+ #endif
+ 
++#ifdef INCLUDE_PTHREAD_H
++#include <pthread.h>
++#endif
++
+ #ifdef INCLUDE_ISL
+ #ifdef HAVE_isl
+ #include <isl/options.h>
diff --git a/srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch b/srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch
new file mode 100644
index 000000000000..044a4fc29514
--- /dev/null
+++ b/srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch
@@ -0,0 +1,32 @@
+From f35d65517a59565758107c5b1a51a5fa382f8d1a Mon Sep 17 00:00:00 2001
+From: Ian Lance Taylor <iant@golang.org>
+Date: Tue, 12 Jul 2022 19:42:43 -0700
+Subject: [PATCH] libgo: don't include <linux/fs.h> when building
+ gen-sysinfo.go
+
+Removing this doesn't change anything at least with glibc 2.33.
+The include was added in https://go.dev/cl/6100049 but it's not
+clear why.
+
+Fixes PR go/106266
+
+Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/417294
+---
+ gcc/go/gofrontend/MERGE | 2 +-
+ libgo/sysinfo.c         | 3 ---
+ 2 files changed, 1 insertion(+), 4 deletions(-)
+
+diff --git a/libgo/sysinfo.c b/libgo/sysinfo.c
+index a4259c02ded4..fc0210992faa 100644
+--- a/libgo/sysinfo.c
++++ b/libgo/sysinfo.c
+@@ -158,9 +158,6 @@
+ #if defined(HAVE_LINUX_ETHER_H)
+ #include <linux/ether.h>
+ #endif
+-#if defined(HAVE_LINUX_FS_H)
+-#include <linux/fs.h>
+-#endif
+ #if defined(HAVE_LINUX_REBOOT_H)
+ #include <linux/reboot.h>
+ #endif
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..78a2ce35875d 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,9 +3,10 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
  
  #  ifndef _ABIN32
+
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..32ee79e32f0d 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,15 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
+version=12.1.0
+revision=1
 _patchver="${version%pre*}"
 _minorver="${_patchver%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 wrksrc=gcc-${version/pre/_pre}
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +19,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -396,7 +393,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}

From 2291feed5bcca91851d6b6ee3f55811a8748e1ce Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 3/8] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      |  6 ++--
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..08e35d466a44 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From f3bd650f31809e9deaa9bfd420e832f4af07e317 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 4/8] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 1a4e1ca3d594..b04268908c2e 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="q66 <daniel@octaforge.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From 936c4b5891dd215aa99776642b6d97707e77c955 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 5/8] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 3 files changed, 55 insertions(+), 353 deletions(-)
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index c6400b566966..65f4d1b62b61 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From 9f0bb0215e0ffcaa5fe46b357ecbc3b59e7b72f9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 14 Aug 2022 19:29:36 -0700
Subject: [PATCH 6/8] build-style/void-cross: Update flags for gcc12

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289
---
 common/build-style/void-cross.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..c24013755704 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -132,6 +132,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \

From 771a941b24410fa91e9d609a8cbef8ffaf4cb2bb Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:08:52 -0700
Subject: [PATCH 7/8] openssh: suppress werror on gcc12

---
 srcpkgs/openssh/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/openssh/template b/srcpkgs/openssh/template
index 02a2dec35f42..6e8e343a9dca 100644
--- a/srcpkgs/openssh/template
+++ b/srcpkgs/openssh/template
@@ -40,7 +40,7 @@ if [ "$build_option_ldns" -a -z "$build_option_ssl" ]; then
 	broken="option 'ldns' requires option 'ssl'"
 fi
 
-CFLAGS="-Wno-format-truncation -Wno-stringop-truncation"
+CFLAGS="-Wno-format-truncation -Wno-stringop-truncation -Wno-error=maybe-uninitialized"
 
 case $XBPS_TARGET_MACHINE in
 	i686-musl)

From 7282249152fb9b23e2083c71c0ddc3c19b22e5c0 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:09:31 -0700
Subject: [PATCH 8/8] linux5.18: update dotconfigs for gcc12

---
 srcpkgs/linux5.18/files/x86_64-dotconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/linux5.18/files/x86_64-dotconfig b/srcpkgs/linux5.18/files/x86_64-dotconfig
index 4e73a3195d40..ea6204868e23 100644
--- a/srcpkgs/linux5.18/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.18/files/x86_64-dotconfig
@@ -512,6 +512,7 @@ CONFIG_RETHUNK=y
 CONFIG_CPU_UNRET_ENTRY=y
 CONFIG_CPU_IBPB_ENTRY=y
 CONFIG_CPU_IBRS_ENTRY=y
+CONFIG_SLS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10060,8 +10061,11 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
 # Memory initialization
 #
 CONFIG_INIT_STACK_NONE=y
+# CONFIG_INIT_STACK_ALL_PATTERN is not set
+# CONFIG_INIT_STACK_ALL_ZERO is not set
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
+# CONFIG_ZERO_CALL_USED_REGS is not set
 # end of Memory initialization
 # end of Kernel hardening options
 # end of Security options
@@ -10538,6 +10542,7 @@ CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
 # CONFIG_UBSAN is not set
 CONFIG_HAVE_ARCH_KCSAN=y
+# CONFIG_KCSAN is not set
 # end of Generic Kernel Debugging Instruments
 
 #

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.1.0
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (17 preceding siblings ...)
  2022-08-15  2:31 ` oreo639
@ 2022-08-15  3:20 ` oreo639
  2022-08-15  5:58 ` oreo639
                   ` (245 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-08-15  3:20 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1717 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.1.0
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.1.0

This PR depends on: https://github.com/void-linux/void-packages/pull/32330

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system to ensure that compiles and it appears to work fine.

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 61260 bytes --]

From bb6c79ed935b0a7513c85b5987c41aefcfaa0b00 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 1/9] binutils: update to 2.38.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     |  9 +--
 3 files changed, 22 insertions(+), 113 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..b2b1c47d22fc 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.38
+revision=1
 bootstrap=yes
+hostmakedepends="pkg-config"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=e316477a914f567eccc34d5d29785b8b0f5a10208d36bbacedcc39048ecfe024
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"

From 81dea5b96efffd0287e26041a2141acc32a3ff21 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 2/9] gcc: update to 12.1.0.

---
 common/shlibs                                 |  10 +-
 srcpkgs/gcc/files/gccgo-musl.patch            |  74 +++--------
 srcpkgs/gcc/files/libgnarl-musl.patch         |  18 +--
 srcpkgs/gcc/files/libssp-musl.patch           |  10 +-
 ...c21f3f5726823e19728fdd1571a14aae0fb3.patch | 105 ++++++++++++++++
 ...08065bdd36fb1a9b6aad9666b1edb5e06474.patch | 115 ++++++++++++++++++
 ...65517a59565758107c5b1a51a5fa382f8d1a.patch |  32 +++++
 srcpkgs/gcc/patches/libffi_gnulinux.patch     |  11 --
 .../gcc/patches/libgcc-ibm128-no-tag.patch    |  10 +-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |   3 +-
 srcpkgs/gcc/template                          |  25 ++--
 11 files changed, 305 insertions(+), 108 deletions(-)
 create mode 100644 srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
 create mode 100644 srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
 create mode 100644 srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index 61924610cc52..c6400b566966 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.1.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.34 perl-5.34.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -849,8 +849,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.1.0_1
+libgnat-12.so libada-12.1.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1701,8 +1701,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.1.0_1
+libasan.so.8 libsanitizer-12.1.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..632ef951097b 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,17 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ a/libgo/go/runtime/os_linux.go
+@@ -363,9 +363,9 @@
+ 
+ 	var timerid int32
+ 	var sevp _sigevent
+-	sevp.sigev_notify = _SIGEV_THREAD_ID
++	sevp.sigev_notify = 4
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.sigev_notify_function))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch b/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
new file mode 100644
index 000000000000..00929202a503
--- /dev/null
+++ b/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
@@ -0,0 +1,105 @@
+From 3b21c21f3f5726823e19728fdd1571a14aae0fb3 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <siarheit@google.com>
+Date: Mon, 27 Jun 2022 13:27:24 +0100
+Subject: [PATCH] c++: avoid <memory> poisoning on musl [PR106102]
+
+On musl <pthread.h> uses calloc() (via <sched.h>). <memory> includes
+it indirectly and exposes use of poisoned calloc() when module code
+is built:
+
+    /build/build/./prev-gcc/xg++ ... ../../gcc-13-20220626/gcc/cp/mapper-resolver.cc
+        In file included from /<<NIX>>/musl-1.2.3-dev/include/pthread.h:30,
+                 from /build/build/prev-x86_64-unknown-linux-musl/libstdc++-v3/include/x86_64-unknown-linux-musl/bits/gthr-default.h:35,
+                 ....
+                 from /build/build/prev-x86_64-unknown-linux-musl/libstdc++-v3/include/memory:77,
+                 from ../../gcc-13-20220626/gcc/../libcody/cody.hh:24,
+                 from ../../gcc-13-20220626/gcc/cp/../../c++tools/resolver.h:25,
+                 from ../../gcc-13-20220626/gcc/cp/../../c++tools/resolver.cc:23,
+                 from ../../gcc-13-20220626/gcc/cp/mapper-resolver.cc:32:
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:84:7: error: attempt to use poisoned "calloc"
+       84 | void *calloc(size_t, size_t);
+          |       ^
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:124:36: error: attempt to use poisoned "calloc"
+      124 | #define CPU_ALLOC(n) ((cpu_set_t *)calloc(1,CPU_ALLOC_SIZE(n)))
+          |                                    ^
+
+gcc/cp/
+
+	PR c++/106102
+	* mapper-client.cc: Include <memory> via "system.h".
+	* mapper-resolver.cc: Ditto.
+	* module.cc: Ditto.
+
+libcc1/
+
+	PR c++/106102
+	* libcc1plugin.cc: Include <memory> via "system.h".
+	* libcp1plugin.cc: Ditto.
+---
+ gcc/cp/mapper-client.cc   | 1 +
+ gcc/cp/mapper-resolver.cc | 1 +
+ gcc/cp/module.cc          | 1 +
+ libcc1/libcc1plugin.cc    | 1 +
+ libcc1/libcp1plugin.cc    | 1 +
+ 5 files changed, 5 insertions(+)
+
+diff --git a/gcc/cp/mapper-client.cc b/gcc/cp/mapper-client.cc
+index 8603a886a099..fe9544b5ba43 100644
+--- a/gcc/cp/mapper-client.cc
++++ b/gcc/cp/mapper-client.cc
+@@ -27,6 +27,7 @@ along with GCC; see the file COPYING3.  If not see
+ #define INCLUDE_STRING
+ #define INCLUDE_VECTOR
+ #define INCLUDE_MAP
++#define INCLUDE_MEMORY
+ #include "system.h"
+ 
+ #include "line-map.h"
+diff --git a/gcc/cp/mapper-resolver.cc b/gcc/cp/mapper-resolver.cc
+index e3d29fb5ada1..e70d1b4ae2ca 100644
+--- a/gcc/cp/mapper-resolver.cc
++++ b/gcc/cp/mapper-resolver.cc
+@@ -25,6 +25,7 @@ along with GCC; see the file COPYING3.  If not see
+ #define INCLUDE_VECTOR
+ #define INCLUDE_ALGORITHM
+ #define INCLUDE_MAP
++#define INCLUDE_MEMORY
+ #include "system.h"
+ 
+ // We don't want or need to be aware of networking
+diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc
+index 753963a4b246..8bb22c2b305a 100644
+--- a/gcc/cp/module.cc
++++ b/gcc/cp/module.cc
+@@ -206,6 +206,7 @@ Classes used:
+ 
+ #define _DEFAULT_SOURCE 1 /* To get TZ field of struct tm, if available.  */
+ #include "config.h"
++#define INCLUDE_MEMORY
+ #define INCLUDE_STRING
+ #define INCLUDE_VECTOR
+ #include "system.h"
+diff --git a/libcc1/libcc1plugin.cc b/libcc1/libcc1plugin.cc
+index 12ab5a57c8dd..bdd0bdabe77f 100644
+--- a/libcc1/libcc1plugin.cc
++++ b/libcc1/libcc1plugin.cc
+@@ -31,6 +31,7 @@
+ #undef PACKAGE_TARNAME
+ #undef PACKAGE_VERSION
+ 
++#define INCLUDE_MEMORY
+ #include "gcc-plugin.h"
+ #include "system.h"
+ #include "coretypes.h"
+diff --git a/libcc1/libcp1plugin.cc b/libcc1/libcp1plugin.cc
+index 83dab7f58b11..e2d5039a0a1f 100644
+--- a/libcc1/libcp1plugin.cc
++++ b/libcc1/libcp1plugin.cc
+@@ -32,6 +32,7 @@
+ #undef PACKAGE_TARNAME
+ #undef PACKAGE_VERSION
+ 
++#define INCLUDE_MEMORY
+ #include "gcc-plugin.h"
+ #include "system.h"
+ #include "coretypes.h"
diff --git a/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch b/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
new file mode 100644
index 000000000000..89bd053d6d04
--- /dev/null
+++ b/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
@@ -0,0 +1,115 @@
+From 49d508065bdd36fb1a9b6aad9666b1edb5e06474 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <siarheit@google.com>
+Date: Mon, 27 Jun 2022 23:42:44 +0100
+Subject: [PATCH] jit: avoid calloc() poisoning on musl [PR106102]
+
+On musl <pthread.h> uses calloc() (via <sched.h>). jit/ includes
+it directly and exposes use of poisoned calloc():
+
+    /build/build/./prev-gcc/xg++ ... ../../gcc-13-20220626/gcc/jit/jit-playback.cc
+    make[3]: *** [Makefile:1143: jit/libgccjit.o] Error 1
+    make[3]: *** Waiting for unfinished jobs....
+    In file included from /<<NIX>>/musl-1.2.3-dev/include/pthread.h:30,
+                     from ../../gcc-13-20220626/gcc/jit/jit-playback.cc:44:
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:84:7: error: attempt to use poisoned "calloc"
+       84 | void *calloc(size_t, size_t);
+          |       ^
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:124:36: error: attempt to use poisoned "calloc"
+      124 | #define CPU_ALLOC(n) ((cpu_set_t *)calloc(1,CPU_ALLOC_SIZE(n)))
+          |                                    ^
+
+The change moves <pthread.h> inclusion to "system.h" under new
+INCLUDE_PTHREAD_H guard and uses this mechanism in libgccjit.
+
+gcc/
+
+	PR c++/106102
+	* system.h: Introduce INCLUDE_PTHREAD_H macros to include <pthread.h>.
+
+gcc/jit/
+
+	PR c++/106102
+	* jit-playback.cc: Include <pthread.h> via "system.h" to avoid calloc()
+	poisoning.
+	* jit-recording.cc: Ditto.
+	* libgccjit.cc: Ditto.
+---
+ gcc/jit/jit-playback.cc  | 3 +--
+ gcc/jit/jit-recording.cc | 2 +-
+ gcc/jit/libgccjit.cc     | 2 +-
+ gcc/system.h             | 4 ++++
+ 4 files changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/gcc/jit/jit-playback.cc b/gcc/jit/jit-playback.cc
+index 6be6bdf8dea5..79714132b91a 100644
+--- a/gcc/jit/jit-playback.cc
++++ b/gcc/jit/jit-playback.cc
+@@ -19,6 +19,7 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "target.h"
+@@ -41,8 +42,6 @@ along with GCC; see the file COPYING3.  If not see
+ #include "diagnostic.h"
+ #include "stmt.h"
+ 
+-#include <pthread.h>
+-
+ #include "jit-playback.h"
+ #include "jit-result.h"
+ #include "jit-builtins.h"
+diff --git a/gcc/jit/jit-recording.cc b/gcc/jit/jit-recording.cc
+index 697dee66e733..f78daed2d71a 100644
+--- a/gcc/jit/jit-recording.cc
++++ b/gcc/jit/jit-recording.cc
+@@ -19,13 +19,13 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "tm.h"
+ #include "pretty-print.h"
+ #include "toplev.h"
+ 
+-#include <pthread.h>
+ 
+ #include "jit-builtins.h"
+ #include "jit-recording.h"
+diff --git a/gcc/jit/libgccjit.cc b/gcc/jit/libgccjit.cc
+index 0e76097b4bac..ca862662777e 100644
+--- a/gcc/jit/libgccjit.cc
++++ b/gcc/jit/libgccjit.cc
+@@ -19,12 +19,12 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "timevar.h"
+ #include "typed-splay-tree.h"
+ #include "cppbuiltin.h"
+-#include <pthread.h>
+ 
+ #include "libgccjit.h"
+ #include "jit-recording.h"
+diff --git a/gcc/system.h b/gcc/system.h
+index 67158b70c789..f8d42ff68150 100644
+--- a/gcc/system.h
++++ b/gcc/system.h
+@@ -753,6 +753,10 @@ extern int vsnprintf (char *, size_t, const char *, va_list);
+ #endif
+ #endif
+ 
++#ifdef INCLUDE_PTHREAD_H
++#include <pthread.h>
++#endif
++
+ #ifdef INCLUDE_ISL
+ #ifdef HAVE_isl
+ #include <isl/options.h>
diff --git a/srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch b/srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch
new file mode 100644
index 000000000000..044a4fc29514
--- /dev/null
+++ b/srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch
@@ -0,0 +1,32 @@
+From f35d65517a59565758107c5b1a51a5fa382f8d1a Mon Sep 17 00:00:00 2001
+From: Ian Lance Taylor <iant@golang.org>
+Date: Tue, 12 Jul 2022 19:42:43 -0700
+Subject: [PATCH] libgo: don't include <linux/fs.h> when building
+ gen-sysinfo.go
+
+Removing this doesn't change anything at least with glibc 2.33.
+The include was added in https://go.dev/cl/6100049 but it's not
+clear why.
+
+Fixes PR go/106266
+
+Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/417294
+---
+ gcc/go/gofrontend/MERGE | 2 +-
+ libgo/sysinfo.c         | 3 ---
+ 2 files changed, 1 insertion(+), 4 deletions(-)
+
+diff --git a/libgo/sysinfo.c b/libgo/sysinfo.c
+index a4259c02ded4..fc0210992faa 100644
+--- a/libgo/sysinfo.c
++++ b/libgo/sysinfo.c
+@@ -158,9 +158,6 @@
+ #if defined(HAVE_LINUX_ETHER_H)
+ #include <linux/ether.h>
+ #endif
+-#if defined(HAVE_LINUX_FS_H)
+-#include <linux/fs.h>
+-#endif
+ #if defined(HAVE_LINUX_REBOOT_H)
+ #include <linux/reboot.h>
+ #endif
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..78a2ce35875d 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,9 +3,10 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
  
  #  ifndef _ABIN32
+
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..32ee79e32f0d 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,15 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
+version=12.1.0
+revision=1
 _patchver="${version%pre*}"
 _minorver="${_patchver%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 wrksrc=gcc-${version/pre/_pre}
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +19,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -396,7 +393,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}

From 2291feed5bcca91851d6b6ee3f55811a8748e1ce Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 3/9] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      |  6 ++--
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..08e35d466a44 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From f3bd650f31809e9deaa9bfd420e832f4af07e317 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 4/9] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 1a4e1ca3d594..b04268908c2e 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="q66 <daniel@octaforge.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From 936c4b5891dd215aa99776642b6d97707e77c955 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 5/9] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 3 files changed, 55 insertions(+), 353 deletions(-)
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index c6400b566966..65f4d1b62b61 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From 9f0bb0215e0ffcaa5fe46b357ecbc3b59e7b72f9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 14 Aug 2022 19:29:36 -0700
Subject: [PATCH 6/9] build-style/void-cross: Update flags for gcc12

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289
---
 common/build-style/void-cross.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..c24013755704 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -132,6 +132,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \

From 771a941b24410fa91e9d609a8cbef8ffaf4cb2bb Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:08:52 -0700
Subject: [PATCH 7/9] openssh: suppress werror on gcc12

---
 srcpkgs/openssh/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/openssh/template b/srcpkgs/openssh/template
index 02a2dec35f42..6e8e343a9dca 100644
--- a/srcpkgs/openssh/template
+++ b/srcpkgs/openssh/template
@@ -40,7 +40,7 @@ if [ "$build_option_ldns" -a -z "$build_option_ssl" ]; then
 	broken="option 'ldns' requires option 'ssl'"
 fi
 
-CFLAGS="-Wno-format-truncation -Wno-stringop-truncation"
+CFLAGS="-Wno-format-truncation -Wno-stringop-truncation -Wno-error=maybe-uninitialized"
 
 case $XBPS_TARGET_MACHINE in
 	i686-musl)

From 7282249152fb9b23e2083c71c0ddc3c19b22e5c0 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:09:31 -0700
Subject: [PATCH 8/9] linux5.18: update dotconfigs for gcc12

---
 srcpkgs/linux5.18/files/x86_64-dotconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/linux5.18/files/x86_64-dotconfig b/srcpkgs/linux5.18/files/x86_64-dotconfig
index 4e73a3195d40..ea6204868e23 100644
--- a/srcpkgs/linux5.18/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.18/files/x86_64-dotconfig
@@ -512,6 +512,7 @@ CONFIG_RETHUNK=y
 CONFIG_CPU_UNRET_ENTRY=y
 CONFIG_CPU_IBPB_ENTRY=y
 CONFIG_CPU_IBRS_ENTRY=y
+CONFIG_SLS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10060,8 +10061,11 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
 # Memory initialization
 #
 CONFIG_INIT_STACK_NONE=y
+# CONFIG_INIT_STACK_ALL_PATTERN is not set
+# CONFIG_INIT_STACK_ALL_ZERO is not set
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
+# CONFIG_ZERO_CALL_USED_REGS is not set
 # end of Memory initialization
 # end of Kernel hardening options
 # end of Security options
@@ -10538,6 +10542,7 @@ CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
 # CONFIG_UBSAN is not set
 CONFIG_HAVE_ARCH_KCSAN=y
+# CONFIG_KCSAN is not set
 # end of Generic Kernel Debugging Instruments
 
 #

From c99d43e562e44d091ca13f594ea07e62e7d857cc Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 14 Aug 2022 20:20:34 -0700
Subject: [PATCH 9/9] cross-aarch64-linux-gnu: test commit

---
 srcpkgs/cross-aarch64-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..8a6976c5fb06 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,15 +1,15 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Leah Neukirchen <leah@vuxu.org>"
@@ -17,16 +17,17 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 
 cross_glibc_cflags="-O2 -march=armv8-a"
+#cross_glibc_configure_args="--disable-default-pie"
 
 if [ "$XBPS_TARGET_MACHINE" = "aarch64" ]; then
 	broken="Can't build crosstoolchain to itself"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.1.0
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (18 preceding siblings ...)
  2022-08-15  3:20 ` oreo639
@ 2022-08-15  5:58 ` oreo639
  2022-08-15  8:14 ` oreo639
                   ` (244 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-08-15  5:58 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1717 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.1.0
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.1.0

This PR depends on: https://github.com/void-linux/void-packages/pull/32330

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system to ensure that compiles and it appears to work fine.

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 59670 bytes --]

From 089d015613e2b4fa8555f3bc80701a181d470a23 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 1/8] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     |  9 +--
 3 files changed, 22 insertions(+), 113 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..6eb4f1a5e829 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkg-config"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"

From 5159209d72f3d4edff4978b823832d4000ce2b3a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 2/8] gcc: update to 12.1.0.

---
 common/shlibs                                 |  10 +-
 srcpkgs/gcc/files/gccgo-musl.patch            |  74 +++--------
 srcpkgs/gcc/files/libgnarl-musl.patch         |  18 +--
 srcpkgs/gcc/files/libssp-musl.patch           |  10 +-
 ...c21f3f5726823e19728fdd1571a14aae0fb3.patch | 105 ++++++++++++++++
 ...08065bdd36fb1a9b6aad9666b1edb5e06474.patch | 115 ++++++++++++++++++
 ...65517a59565758107c5b1a51a5fa382f8d1a.patch |  32 +++++
 srcpkgs/gcc/patches/libffi_gnulinux.patch     |  11 --
 .../gcc/patches/libgcc-ibm128-no-tag.patch    |  10 +-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |   3 +-
 srcpkgs/gcc/template                          |  25 ++--
 11 files changed, 305 insertions(+), 108 deletions(-)
 create mode 100644 srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
 create mode 100644 srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
 create mode 100644 srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index 61924610cc52..c6400b566966 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.1.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.34 perl-5.34.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -849,8 +849,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.1.0_1
+libgnat-12.so libada-12.1.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1701,8 +1701,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.1.0_1
+libasan.so.8 libsanitizer-12.1.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..632ef951097b 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,17 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ a/libgo/go/runtime/os_linux.go
+@@ -363,9 +363,9 @@
+ 
+ 	var timerid int32
+ 	var sevp _sigevent
+-	sevp.sigev_notify = _SIGEV_THREAD_ID
++	sevp.sigev_notify = 4
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.sigev_notify_function))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch b/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
new file mode 100644
index 000000000000..00929202a503
--- /dev/null
+++ b/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
@@ -0,0 +1,105 @@
+From 3b21c21f3f5726823e19728fdd1571a14aae0fb3 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <siarheit@google.com>
+Date: Mon, 27 Jun 2022 13:27:24 +0100
+Subject: [PATCH] c++: avoid <memory> poisoning on musl [PR106102]
+
+On musl <pthread.h> uses calloc() (via <sched.h>). <memory> includes
+it indirectly and exposes use of poisoned calloc() when module code
+is built:
+
+    /build/build/./prev-gcc/xg++ ... ../../gcc-13-20220626/gcc/cp/mapper-resolver.cc
+        In file included from /<<NIX>>/musl-1.2.3-dev/include/pthread.h:30,
+                 from /build/build/prev-x86_64-unknown-linux-musl/libstdc++-v3/include/x86_64-unknown-linux-musl/bits/gthr-default.h:35,
+                 ....
+                 from /build/build/prev-x86_64-unknown-linux-musl/libstdc++-v3/include/memory:77,
+                 from ../../gcc-13-20220626/gcc/../libcody/cody.hh:24,
+                 from ../../gcc-13-20220626/gcc/cp/../../c++tools/resolver.h:25,
+                 from ../../gcc-13-20220626/gcc/cp/../../c++tools/resolver.cc:23,
+                 from ../../gcc-13-20220626/gcc/cp/mapper-resolver.cc:32:
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:84:7: error: attempt to use poisoned "calloc"
+       84 | void *calloc(size_t, size_t);
+          |       ^
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:124:36: error: attempt to use poisoned "calloc"
+      124 | #define CPU_ALLOC(n) ((cpu_set_t *)calloc(1,CPU_ALLOC_SIZE(n)))
+          |                                    ^
+
+gcc/cp/
+
+	PR c++/106102
+	* mapper-client.cc: Include <memory> via "system.h".
+	* mapper-resolver.cc: Ditto.
+	* module.cc: Ditto.
+
+libcc1/
+
+	PR c++/106102
+	* libcc1plugin.cc: Include <memory> via "system.h".
+	* libcp1plugin.cc: Ditto.
+---
+ gcc/cp/mapper-client.cc   | 1 +
+ gcc/cp/mapper-resolver.cc | 1 +
+ gcc/cp/module.cc          | 1 +
+ libcc1/libcc1plugin.cc    | 1 +
+ libcc1/libcp1plugin.cc    | 1 +
+ 5 files changed, 5 insertions(+)
+
+diff --git a/gcc/cp/mapper-client.cc b/gcc/cp/mapper-client.cc
+index 8603a886a099..fe9544b5ba43 100644
+--- a/gcc/cp/mapper-client.cc
++++ b/gcc/cp/mapper-client.cc
+@@ -27,6 +27,7 @@ along with GCC; see the file COPYING3.  If not see
+ #define INCLUDE_STRING
+ #define INCLUDE_VECTOR
+ #define INCLUDE_MAP
++#define INCLUDE_MEMORY
+ #include "system.h"
+ 
+ #include "line-map.h"
+diff --git a/gcc/cp/mapper-resolver.cc b/gcc/cp/mapper-resolver.cc
+index e3d29fb5ada1..e70d1b4ae2ca 100644
+--- a/gcc/cp/mapper-resolver.cc
++++ b/gcc/cp/mapper-resolver.cc
+@@ -25,6 +25,7 @@ along with GCC; see the file COPYING3.  If not see
+ #define INCLUDE_VECTOR
+ #define INCLUDE_ALGORITHM
+ #define INCLUDE_MAP
++#define INCLUDE_MEMORY
+ #include "system.h"
+ 
+ // We don't want or need to be aware of networking
+diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc
+index 753963a4b246..8bb22c2b305a 100644
+--- a/gcc/cp/module.cc
++++ b/gcc/cp/module.cc
+@@ -206,6 +206,7 @@ Classes used:
+ 
+ #define _DEFAULT_SOURCE 1 /* To get TZ field of struct tm, if available.  */
+ #include "config.h"
++#define INCLUDE_MEMORY
+ #define INCLUDE_STRING
+ #define INCLUDE_VECTOR
+ #include "system.h"
+diff --git a/libcc1/libcc1plugin.cc b/libcc1/libcc1plugin.cc
+index 12ab5a57c8dd..bdd0bdabe77f 100644
+--- a/libcc1/libcc1plugin.cc
++++ b/libcc1/libcc1plugin.cc
+@@ -31,6 +31,7 @@
+ #undef PACKAGE_TARNAME
+ #undef PACKAGE_VERSION
+ 
++#define INCLUDE_MEMORY
+ #include "gcc-plugin.h"
+ #include "system.h"
+ #include "coretypes.h"
+diff --git a/libcc1/libcp1plugin.cc b/libcc1/libcp1plugin.cc
+index 83dab7f58b11..e2d5039a0a1f 100644
+--- a/libcc1/libcp1plugin.cc
++++ b/libcc1/libcp1plugin.cc
+@@ -32,6 +32,7 @@
+ #undef PACKAGE_TARNAME
+ #undef PACKAGE_VERSION
+ 
++#define INCLUDE_MEMORY
+ #include "gcc-plugin.h"
+ #include "system.h"
+ #include "coretypes.h"
diff --git a/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch b/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
new file mode 100644
index 000000000000..89bd053d6d04
--- /dev/null
+++ b/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
@@ -0,0 +1,115 @@
+From 49d508065bdd36fb1a9b6aad9666b1edb5e06474 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <siarheit@google.com>
+Date: Mon, 27 Jun 2022 23:42:44 +0100
+Subject: [PATCH] jit: avoid calloc() poisoning on musl [PR106102]
+
+On musl <pthread.h> uses calloc() (via <sched.h>). jit/ includes
+it directly and exposes use of poisoned calloc():
+
+    /build/build/./prev-gcc/xg++ ... ../../gcc-13-20220626/gcc/jit/jit-playback.cc
+    make[3]: *** [Makefile:1143: jit/libgccjit.o] Error 1
+    make[3]: *** Waiting for unfinished jobs....
+    In file included from /<<NIX>>/musl-1.2.3-dev/include/pthread.h:30,
+                     from ../../gcc-13-20220626/gcc/jit/jit-playback.cc:44:
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:84:7: error: attempt to use poisoned "calloc"
+       84 | void *calloc(size_t, size_t);
+          |       ^
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:124:36: error: attempt to use poisoned "calloc"
+      124 | #define CPU_ALLOC(n) ((cpu_set_t *)calloc(1,CPU_ALLOC_SIZE(n)))
+          |                                    ^
+
+The change moves <pthread.h> inclusion to "system.h" under new
+INCLUDE_PTHREAD_H guard and uses this mechanism in libgccjit.
+
+gcc/
+
+	PR c++/106102
+	* system.h: Introduce INCLUDE_PTHREAD_H macros to include <pthread.h>.
+
+gcc/jit/
+
+	PR c++/106102
+	* jit-playback.cc: Include <pthread.h> via "system.h" to avoid calloc()
+	poisoning.
+	* jit-recording.cc: Ditto.
+	* libgccjit.cc: Ditto.
+---
+ gcc/jit/jit-playback.cc  | 3 +--
+ gcc/jit/jit-recording.cc | 2 +-
+ gcc/jit/libgccjit.cc     | 2 +-
+ gcc/system.h             | 4 ++++
+ 4 files changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/gcc/jit/jit-playback.cc b/gcc/jit/jit-playback.cc
+index 6be6bdf8dea5..79714132b91a 100644
+--- a/gcc/jit/jit-playback.cc
++++ b/gcc/jit/jit-playback.cc
+@@ -19,6 +19,7 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "target.h"
+@@ -41,8 +42,6 @@ along with GCC; see the file COPYING3.  If not see
+ #include "diagnostic.h"
+ #include "stmt.h"
+ 
+-#include <pthread.h>
+-
+ #include "jit-playback.h"
+ #include "jit-result.h"
+ #include "jit-builtins.h"
+diff --git a/gcc/jit/jit-recording.cc b/gcc/jit/jit-recording.cc
+index 697dee66e733..f78daed2d71a 100644
+--- a/gcc/jit/jit-recording.cc
++++ b/gcc/jit/jit-recording.cc
+@@ -19,13 +19,13 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "tm.h"
+ #include "pretty-print.h"
+ #include "toplev.h"
+ 
+-#include <pthread.h>
+ 
+ #include "jit-builtins.h"
+ #include "jit-recording.h"
+diff --git a/gcc/jit/libgccjit.cc b/gcc/jit/libgccjit.cc
+index 0e76097b4bac..ca862662777e 100644
+--- a/gcc/jit/libgccjit.cc
++++ b/gcc/jit/libgccjit.cc
+@@ -19,12 +19,12 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "timevar.h"
+ #include "typed-splay-tree.h"
+ #include "cppbuiltin.h"
+-#include <pthread.h>
+ 
+ #include "libgccjit.h"
+ #include "jit-recording.h"
+diff --git a/gcc/system.h b/gcc/system.h
+index 67158b70c789..f8d42ff68150 100644
+--- a/gcc/system.h
++++ b/gcc/system.h
+@@ -753,6 +753,10 @@ extern int vsnprintf (char *, size_t, const char *, va_list);
+ #endif
+ #endif
+ 
++#ifdef INCLUDE_PTHREAD_H
++#include <pthread.h>
++#endif
++
+ #ifdef INCLUDE_ISL
+ #ifdef HAVE_isl
+ #include <isl/options.h>
diff --git a/srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch b/srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch
new file mode 100644
index 000000000000..044a4fc29514
--- /dev/null
+++ b/srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch
@@ -0,0 +1,32 @@
+From f35d65517a59565758107c5b1a51a5fa382f8d1a Mon Sep 17 00:00:00 2001
+From: Ian Lance Taylor <iant@golang.org>
+Date: Tue, 12 Jul 2022 19:42:43 -0700
+Subject: [PATCH] libgo: don't include <linux/fs.h> when building
+ gen-sysinfo.go
+
+Removing this doesn't change anything at least with glibc 2.33.
+The include was added in https://go.dev/cl/6100049 but it's not
+clear why.
+
+Fixes PR go/106266
+
+Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/417294
+---
+ gcc/go/gofrontend/MERGE | 2 +-
+ libgo/sysinfo.c         | 3 ---
+ 2 files changed, 1 insertion(+), 4 deletions(-)
+
+diff --git a/libgo/sysinfo.c b/libgo/sysinfo.c
+index a4259c02ded4..fc0210992faa 100644
+--- a/libgo/sysinfo.c
++++ b/libgo/sysinfo.c
+@@ -158,9 +158,6 @@
+ #if defined(HAVE_LINUX_ETHER_H)
+ #include <linux/ether.h>
+ #endif
+-#if defined(HAVE_LINUX_FS_H)
+-#include <linux/fs.h>
+-#endif
+ #if defined(HAVE_LINUX_REBOOT_H)
+ #include <linux/reboot.h>
+ #endif
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..78a2ce35875d 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,9 +3,10 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
  
  #  ifndef _ABIN32
+
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..32ee79e32f0d 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,15 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
+version=12.1.0
+revision=1
 _patchver="${version%pre*}"
 _minorver="${_patchver%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 wrksrc=gcc-${version/pre/_pre}
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +19,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -396,7 +393,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}

From 00980754f4f23e46126a980f4b7e96e7406b01d4 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 3/8] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      |  6 ++--
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..08e35d466a44 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From be75af2647f4e539b2e90c9e6025980a8da09418 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 4/8] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 1a4e1ca3d594..b04268908c2e 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="q66 <daniel@octaforge.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From c2c766aabce1472cea4d979dc86d631ec9aa52b9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 5/8] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 3 files changed, 55 insertions(+), 353 deletions(-)
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index c6400b566966..65f4d1b62b61 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From f8e0bd641b5216cecadb58d19e23c96f1b3745aa Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 14 Aug 2022 19:29:36 -0700
Subject: [PATCH 6/8] build-style/void-cross: Update flags for gcc12 and glibc
 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

glibc 2.35 ane newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..24d02865b164 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -132,6 +132,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -246,6 +247,15 @@ _void_cross_build_glibc() {
 	local tgt=$1
 	local ver=$2
 
+	# glibc 2.35 and newer uses -static-pie by default
+	# which does not work with -no-pie.
+	local oldcflags="${CFLAGS}"
+	local oldcxxflags="${CXXFLAGS}"
+	local oldldflags="${LDFLAGS}"
+	CFLAGS="${CFLAGS//"-fno-PIE"/}"
+	CXXFLAGS="${CXXFLAGS//"-fno-PIE"/}"
+	LDFLAGS="${LDFLAGS//"-no-pie"/}"
+
 	msg_normal "Building glibc for ${tgt}\n"
 
 	mkdir -p ${wrksrc}/glibc_build
@@ -279,6 +289,9 @@ _void_cross_build_glibc() {
 	make ${makejobs}
 	make install_root=${wrksrc}/build_root/usr/${tgt} install
 
+	CFLAGS="${oldcflags}"
+	CXXFLAGS="${oldcxxflags}"
+	LDFLAGS="${oldldflags}"
 	touch ${wrksrc}/.glibc_build_done
 }
 

From e988fa9835b5cd7d348c55edab39650dafc5aa7a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:08:52 -0700
Subject: [PATCH 7/8] openssh: suppress werror on gcc12

---
 srcpkgs/openssh/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/openssh/template b/srcpkgs/openssh/template
index 02a2dec35f42..6e8e343a9dca 100644
--- a/srcpkgs/openssh/template
+++ b/srcpkgs/openssh/template
@@ -40,7 +40,7 @@ if [ "$build_option_ldns" -a -z "$build_option_ssl" ]; then
 	broken="option 'ldns' requires option 'ssl'"
 fi
 
-CFLAGS="-Wno-format-truncation -Wno-stringop-truncation"
+CFLAGS="-Wno-format-truncation -Wno-stringop-truncation -Wno-error=maybe-uninitialized"
 
 case $XBPS_TARGET_MACHINE in
 	i686-musl)

From 407b3fd8dba1c57cf3ed045c7e4442e82527691d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:09:31 -0700
Subject: [PATCH 8/8] linux5.18: update dotconfigs for gcc12

---
 srcpkgs/linux5.18/files/x86_64-dotconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/linux5.18/files/x86_64-dotconfig b/srcpkgs/linux5.18/files/x86_64-dotconfig
index 4e73a3195d40..ea6204868e23 100644
--- a/srcpkgs/linux5.18/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.18/files/x86_64-dotconfig
@@ -512,6 +512,7 @@ CONFIG_RETHUNK=y
 CONFIG_CPU_UNRET_ENTRY=y
 CONFIG_CPU_IBPB_ENTRY=y
 CONFIG_CPU_IBRS_ENTRY=y
+CONFIG_SLS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10060,8 +10061,11 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
 # Memory initialization
 #
 CONFIG_INIT_STACK_NONE=y
+# CONFIG_INIT_STACK_ALL_PATTERN is not set
+# CONFIG_INIT_STACK_ALL_ZERO is not set
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
+# CONFIG_ZERO_CALL_USED_REGS is not set
 # end of Memory initialization
 # end of Kernel hardening options
 # end of Security options
@@ -10538,6 +10542,7 @@ CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
 # CONFIG_UBSAN is not set
 CONFIG_HAVE_ARCH_KCSAN=y
+# CONFIG_KCSAN is not set
 # end of Generic Kernel Debugging Instruments
 
 #

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.1.0
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (19 preceding siblings ...)
  2022-08-15  5:58 ` oreo639
@ 2022-08-15  8:14 ` oreo639
  2022-08-15  8:17 ` oreo639
                   ` (243 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-08-15  8:14 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2605 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.1.0
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.1.0

This PR depends on: https://github.com/void-linux/void-packages/pull/32330

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

Also, keep in mind that the libgo musl patch here will need to be updated once musl is updated:
https://github.com/void-linux/void-packages/pull/34902/files#diff-1f42a95b93c9550178ff1fbccbef2f47a72711df15c24c9472e2550076978129R163-R176

This is the updated patch for reference:
https://github.com/alpinelinux/aports/blob/8acb21b8ee881e7ab1c812d9a66a17d2501b8730/main/gcc/0049-libgo-adjust-name-of-union-in-sigevent-struct.patch

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 105042 bytes --]

From 089d015613e2b4fa8555f3bc80701a181d470a23 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 01/31] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     |  9 +--
 3 files changed, 22 insertions(+), 113 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..6eb4f1a5e829 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkg-config"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"

From 5159209d72f3d4edff4978b823832d4000ce2b3a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 02/31] gcc: update to 12.1.0.

---
 common/shlibs                                 |  10 +-
 srcpkgs/gcc/files/gccgo-musl.patch            |  74 +++--------
 srcpkgs/gcc/files/libgnarl-musl.patch         |  18 +--
 srcpkgs/gcc/files/libssp-musl.patch           |  10 +-
 ...c21f3f5726823e19728fdd1571a14aae0fb3.patch | 105 ++++++++++++++++
 ...08065bdd36fb1a9b6aad9666b1edb5e06474.patch | 115 ++++++++++++++++++
 ...65517a59565758107c5b1a51a5fa382f8d1a.patch |  32 +++++
 srcpkgs/gcc/patches/libffi_gnulinux.patch     |  11 --
 .../gcc/patches/libgcc-ibm128-no-tag.patch    |  10 +-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |   3 +-
 srcpkgs/gcc/template                          |  25 ++--
 11 files changed, 305 insertions(+), 108 deletions(-)
 create mode 100644 srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
 create mode 100644 srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
 create mode 100644 srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index 61924610cc52..c6400b566966 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.1.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.34 perl-5.34.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -849,8 +849,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.1.0_1
+libgnat-12.so libada-12.1.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1701,8 +1701,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.1.0_1
+libasan.so.8 libsanitizer-12.1.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..632ef951097b 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,17 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ a/libgo/go/runtime/os_linux.go
+@@ -363,9 +363,9 @@
+ 
+ 	var timerid int32
+ 	var sevp _sigevent
+-	sevp.sigev_notify = _SIGEV_THREAD_ID
++	sevp.sigev_notify = 4
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.sigev_notify_function))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch b/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
new file mode 100644
index 000000000000..00929202a503
--- /dev/null
+++ b/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
@@ -0,0 +1,105 @@
+From 3b21c21f3f5726823e19728fdd1571a14aae0fb3 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <siarheit@google.com>
+Date: Mon, 27 Jun 2022 13:27:24 +0100
+Subject: [PATCH] c++: avoid <memory> poisoning on musl [PR106102]
+
+On musl <pthread.h> uses calloc() (via <sched.h>). <memory> includes
+it indirectly and exposes use of poisoned calloc() when module code
+is built:
+
+    /build/build/./prev-gcc/xg++ ... ../../gcc-13-20220626/gcc/cp/mapper-resolver.cc
+        In file included from /<<NIX>>/musl-1.2.3-dev/include/pthread.h:30,
+                 from /build/build/prev-x86_64-unknown-linux-musl/libstdc++-v3/include/x86_64-unknown-linux-musl/bits/gthr-default.h:35,
+                 ....
+                 from /build/build/prev-x86_64-unknown-linux-musl/libstdc++-v3/include/memory:77,
+                 from ../../gcc-13-20220626/gcc/../libcody/cody.hh:24,
+                 from ../../gcc-13-20220626/gcc/cp/../../c++tools/resolver.h:25,
+                 from ../../gcc-13-20220626/gcc/cp/../../c++tools/resolver.cc:23,
+                 from ../../gcc-13-20220626/gcc/cp/mapper-resolver.cc:32:
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:84:7: error: attempt to use poisoned "calloc"
+       84 | void *calloc(size_t, size_t);
+          |       ^
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:124:36: error: attempt to use poisoned "calloc"
+      124 | #define CPU_ALLOC(n) ((cpu_set_t *)calloc(1,CPU_ALLOC_SIZE(n)))
+          |                                    ^
+
+gcc/cp/
+
+	PR c++/106102
+	* mapper-client.cc: Include <memory> via "system.h".
+	* mapper-resolver.cc: Ditto.
+	* module.cc: Ditto.
+
+libcc1/
+
+	PR c++/106102
+	* libcc1plugin.cc: Include <memory> via "system.h".
+	* libcp1plugin.cc: Ditto.
+---
+ gcc/cp/mapper-client.cc   | 1 +
+ gcc/cp/mapper-resolver.cc | 1 +
+ gcc/cp/module.cc          | 1 +
+ libcc1/libcc1plugin.cc    | 1 +
+ libcc1/libcp1plugin.cc    | 1 +
+ 5 files changed, 5 insertions(+)
+
+diff --git a/gcc/cp/mapper-client.cc b/gcc/cp/mapper-client.cc
+index 8603a886a099..fe9544b5ba43 100644
+--- a/gcc/cp/mapper-client.cc
++++ b/gcc/cp/mapper-client.cc
+@@ -27,6 +27,7 @@ along with GCC; see the file COPYING3.  If not see
+ #define INCLUDE_STRING
+ #define INCLUDE_VECTOR
+ #define INCLUDE_MAP
++#define INCLUDE_MEMORY
+ #include "system.h"
+ 
+ #include "line-map.h"
+diff --git a/gcc/cp/mapper-resolver.cc b/gcc/cp/mapper-resolver.cc
+index e3d29fb5ada1..e70d1b4ae2ca 100644
+--- a/gcc/cp/mapper-resolver.cc
++++ b/gcc/cp/mapper-resolver.cc
+@@ -25,6 +25,7 @@ along with GCC; see the file COPYING3.  If not see
+ #define INCLUDE_VECTOR
+ #define INCLUDE_ALGORITHM
+ #define INCLUDE_MAP
++#define INCLUDE_MEMORY
+ #include "system.h"
+ 
+ // We don't want or need to be aware of networking
+diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc
+index 753963a4b246..8bb22c2b305a 100644
+--- a/gcc/cp/module.cc
++++ b/gcc/cp/module.cc
+@@ -206,6 +206,7 @@ Classes used:
+ 
+ #define _DEFAULT_SOURCE 1 /* To get TZ field of struct tm, if available.  */
+ #include "config.h"
++#define INCLUDE_MEMORY
+ #define INCLUDE_STRING
+ #define INCLUDE_VECTOR
+ #include "system.h"
+diff --git a/libcc1/libcc1plugin.cc b/libcc1/libcc1plugin.cc
+index 12ab5a57c8dd..bdd0bdabe77f 100644
+--- a/libcc1/libcc1plugin.cc
++++ b/libcc1/libcc1plugin.cc
+@@ -31,6 +31,7 @@
+ #undef PACKAGE_TARNAME
+ #undef PACKAGE_VERSION
+ 
++#define INCLUDE_MEMORY
+ #include "gcc-plugin.h"
+ #include "system.h"
+ #include "coretypes.h"
+diff --git a/libcc1/libcp1plugin.cc b/libcc1/libcp1plugin.cc
+index 83dab7f58b11..e2d5039a0a1f 100644
+--- a/libcc1/libcp1plugin.cc
++++ b/libcc1/libcp1plugin.cc
+@@ -32,6 +32,7 @@
+ #undef PACKAGE_TARNAME
+ #undef PACKAGE_VERSION
+ 
++#define INCLUDE_MEMORY
+ #include "gcc-plugin.h"
+ #include "system.h"
+ #include "coretypes.h"
diff --git a/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch b/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
new file mode 100644
index 000000000000..89bd053d6d04
--- /dev/null
+++ b/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
@@ -0,0 +1,115 @@
+From 49d508065bdd36fb1a9b6aad9666b1edb5e06474 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <siarheit@google.com>
+Date: Mon, 27 Jun 2022 23:42:44 +0100
+Subject: [PATCH] jit: avoid calloc() poisoning on musl [PR106102]
+
+On musl <pthread.h> uses calloc() (via <sched.h>). jit/ includes
+it directly and exposes use of poisoned calloc():
+
+    /build/build/./prev-gcc/xg++ ... ../../gcc-13-20220626/gcc/jit/jit-playback.cc
+    make[3]: *** [Makefile:1143: jit/libgccjit.o] Error 1
+    make[3]: *** Waiting for unfinished jobs....
+    In file included from /<<NIX>>/musl-1.2.3-dev/include/pthread.h:30,
+                     from ../../gcc-13-20220626/gcc/jit/jit-playback.cc:44:
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:84:7: error: attempt to use poisoned "calloc"
+       84 | void *calloc(size_t, size_t);
+          |       ^
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:124:36: error: attempt to use poisoned "calloc"
+      124 | #define CPU_ALLOC(n) ((cpu_set_t *)calloc(1,CPU_ALLOC_SIZE(n)))
+          |                                    ^
+
+The change moves <pthread.h> inclusion to "system.h" under new
+INCLUDE_PTHREAD_H guard and uses this mechanism in libgccjit.
+
+gcc/
+
+	PR c++/106102
+	* system.h: Introduce INCLUDE_PTHREAD_H macros to include <pthread.h>.
+
+gcc/jit/
+
+	PR c++/106102
+	* jit-playback.cc: Include <pthread.h> via "system.h" to avoid calloc()
+	poisoning.
+	* jit-recording.cc: Ditto.
+	* libgccjit.cc: Ditto.
+---
+ gcc/jit/jit-playback.cc  | 3 +--
+ gcc/jit/jit-recording.cc | 2 +-
+ gcc/jit/libgccjit.cc     | 2 +-
+ gcc/system.h             | 4 ++++
+ 4 files changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/gcc/jit/jit-playback.cc b/gcc/jit/jit-playback.cc
+index 6be6bdf8dea5..79714132b91a 100644
+--- a/gcc/jit/jit-playback.cc
++++ b/gcc/jit/jit-playback.cc
+@@ -19,6 +19,7 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "target.h"
+@@ -41,8 +42,6 @@ along with GCC; see the file COPYING3.  If not see
+ #include "diagnostic.h"
+ #include "stmt.h"
+ 
+-#include <pthread.h>
+-
+ #include "jit-playback.h"
+ #include "jit-result.h"
+ #include "jit-builtins.h"
+diff --git a/gcc/jit/jit-recording.cc b/gcc/jit/jit-recording.cc
+index 697dee66e733..f78daed2d71a 100644
+--- a/gcc/jit/jit-recording.cc
++++ b/gcc/jit/jit-recording.cc
+@@ -19,13 +19,13 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "tm.h"
+ #include "pretty-print.h"
+ #include "toplev.h"
+ 
+-#include <pthread.h>
+ 
+ #include "jit-builtins.h"
+ #include "jit-recording.h"
+diff --git a/gcc/jit/libgccjit.cc b/gcc/jit/libgccjit.cc
+index 0e76097b4bac..ca862662777e 100644
+--- a/gcc/jit/libgccjit.cc
++++ b/gcc/jit/libgccjit.cc
+@@ -19,12 +19,12 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "timevar.h"
+ #include "typed-splay-tree.h"
+ #include "cppbuiltin.h"
+-#include <pthread.h>
+ 
+ #include "libgccjit.h"
+ #include "jit-recording.h"
+diff --git a/gcc/system.h b/gcc/system.h
+index 67158b70c789..f8d42ff68150 100644
+--- a/gcc/system.h
++++ b/gcc/system.h
+@@ -753,6 +753,10 @@ extern int vsnprintf (char *, size_t, const char *, va_list);
+ #endif
+ #endif
+ 
++#ifdef INCLUDE_PTHREAD_H
++#include <pthread.h>
++#endif
++
+ #ifdef INCLUDE_ISL
+ #ifdef HAVE_isl
+ #include <isl/options.h>
diff --git a/srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch b/srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch
new file mode 100644
index 000000000000..044a4fc29514
--- /dev/null
+++ b/srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch
@@ -0,0 +1,32 @@
+From f35d65517a59565758107c5b1a51a5fa382f8d1a Mon Sep 17 00:00:00 2001
+From: Ian Lance Taylor <iant@golang.org>
+Date: Tue, 12 Jul 2022 19:42:43 -0700
+Subject: [PATCH] libgo: don't include <linux/fs.h> when building
+ gen-sysinfo.go
+
+Removing this doesn't change anything at least with glibc 2.33.
+The include was added in https://go.dev/cl/6100049 but it's not
+clear why.
+
+Fixes PR go/106266
+
+Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/417294
+---
+ gcc/go/gofrontend/MERGE | 2 +-
+ libgo/sysinfo.c         | 3 ---
+ 2 files changed, 1 insertion(+), 4 deletions(-)
+
+diff --git a/libgo/sysinfo.c b/libgo/sysinfo.c
+index a4259c02ded4..fc0210992faa 100644
+--- a/libgo/sysinfo.c
++++ b/libgo/sysinfo.c
+@@ -158,9 +158,6 @@
+ #if defined(HAVE_LINUX_ETHER_H)
+ #include <linux/ether.h>
+ #endif
+-#if defined(HAVE_LINUX_FS_H)
+-#include <linux/fs.h>
+-#endif
+ #if defined(HAVE_LINUX_REBOOT_H)
+ #include <linux/reboot.h>
+ #endif
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..78a2ce35875d 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,9 +3,10 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
  
  #  ifndef _ABIN32
+
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..32ee79e32f0d 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,15 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
+version=12.1.0
+revision=1
 _patchver="${version%pre*}"
 _minorver="${_patchver%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 wrksrc=gcc-${version/pre/_pre}
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +19,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -396,7 +393,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}

From 00980754f4f23e46126a980f4b7e96e7406b01d4 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 03/31] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      |  6 ++--
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..08e35d466a44 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From be75af2647f4e539b2e90c9e6025980a8da09418 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 04/31] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 1a4e1ca3d594..b04268908c2e 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="q66 <daniel@octaforge.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From c2c766aabce1472cea4d979dc86d631ec9aa52b9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 05/31] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 3 files changed, 55 insertions(+), 353 deletions(-)
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index c6400b566966..65f4d1b62b61 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From f8e0bd641b5216cecadb58d19e23c96f1b3745aa Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 14 Aug 2022 19:29:36 -0700
Subject: [PATCH 06/31] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

glibc 2.35 ane newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..24d02865b164 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -132,6 +132,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -246,6 +247,15 @@ _void_cross_build_glibc() {
 	local tgt=$1
 	local ver=$2
 
+	# glibc 2.35 and newer uses -static-pie by default
+	# which does not work with -no-pie.
+	local oldcflags="${CFLAGS}"
+	local oldcxxflags="${CXXFLAGS}"
+	local oldldflags="${LDFLAGS}"
+	CFLAGS="${CFLAGS//"-fno-PIE"/}"
+	CXXFLAGS="${CXXFLAGS//"-fno-PIE"/}"
+	LDFLAGS="${LDFLAGS//"-no-pie"/}"
+
 	msg_normal "Building glibc for ${tgt}\n"
 
 	mkdir -p ${wrksrc}/glibc_build
@@ -279,6 +289,9 @@ _void_cross_build_glibc() {
 	make ${makejobs}
 	make install_root=${wrksrc}/build_root/usr/${tgt} install
 
+	CFLAGS="${oldcflags}"
+	CXXFLAGS="${oldcxxflags}"
+	LDFLAGS="${oldldflags}"
 	touch ${wrksrc}/.glibc_build_done
 }
 

From e988fa9835b5cd7d348c55edab39650dafc5aa7a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:08:52 -0700
Subject: [PATCH 07/31] openssh: suppress werror on gcc12

---
 srcpkgs/openssh/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/openssh/template b/srcpkgs/openssh/template
index 02a2dec35f42..6e8e343a9dca 100644
--- a/srcpkgs/openssh/template
+++ b/srcpkgs/openssh/template
@@ -40,7 +40,7 @@ if [ "$build_option_ldns" -a -z "$build_option_ssl" ]; then
 	broken="option 'ldns' requires option 'ssl'"
 fi
 
-CFLAGS="-Wno-format-truncation -Wno-stringop-truncation"
+CFLAGS="-Wno-format-truncation -Wno-stringop-truncation -Wno-error=maybe-uninitialized"
 
 case $XBPS_TARGET_MACHINE in
 	i686-musl)

From 407b3fd8dba1c57cf3ed045c7e4442e82527691d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:09:31 -0700
Subject: [PATCH 08/31] linux5.18: update dotconfigs for gcc12

---
 srcpkgs/linux5.18/files/x86_64-dotconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/linux5.18/files/x86_64-dotconfig b/srcpkgs/linux5.18/files/x86_64-dotconfig
index 4e73a3195d40..ea6204868e23 100644
--- a/srcpkgs/linux5.18/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.18/files/x86_64-dotconfig
@@ -512,6 +512,7 @@ CONFIG_RETHUNK=y
 CONFIG_CPU_UNRET_ENTRY=y
 CONFIG_CPU_IBPB_ENTRY=y
 CONFIG_CPU_IBRS_ENTRY=y
+CONFIG_SLS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10060,8 +10061,11 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
 # Memory initialization
 #
 CONFIG_INIT_STACK_NONE=y
+# CONFIG_INIT_STACK_ALL_PATTERN is not set
+# CONFIG_INIT_STACK_ALL_ZERO is not set
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
+# CONFIG_ZERO_CALL_USED_REGS is not set
 # end of Memory initialization
 # end of Kernel hardening options
 # end of Security options
@@ -10538,6 +10542,7 @@ CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
 # CONFIG_UBSAN is not set
 CONFIG_HAVE_ARCH_KCSAN=y
+# CONFIG_KCSAN is not set
 # end of Generic Kernel Debugging Instruments
 
 #

From aae067274e632d0ae18cd8cf46f47e24d11d1554 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:54 -0700
Subject: [PATCH 09/31] cross-aarch64-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..cb7ae97e7efe 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 80ca04e163990ed72378b1dd8995bb8c142ee8b9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:54 -0700
Subject: [PATCH 10/31] cross-aarch64-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..4fa950f334d4 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 705d5d10eaf9b3f8c55690169edab6b9d26211af Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:54 -0700
Subject: [PATCH 11/31] cross-arm-linux-gnueabi: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..194c0ab774b7 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From f11f02cceb2db3c3d1b3c37271f397aa2dfb6993 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 12/31] cross-arm-linux-gnueabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..3f3242b85b07 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 9ed38a7006eb817c196096d398eb04e6fcb4567b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 13/31] cross-arm-linux-musleabi: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..b0cdade60a6d 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From e4e6df8cedcd9df54c58d334d9bddf255acae7f1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 14/31] cross-arm-linux-musleabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..1924be24d483 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 7afca911df0f1c59c488389623f233a864aa703b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 15/31] cross-armv7l-linux-gnueabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..a7997d6db937 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From f4276b1cf752a503c98d0bfed9c0b0234cf13d07 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 16/31] cross-armv7l-linux-musleabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..aaa7040fbfef 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 4c7e5ae9fe15df6e027fdf16c6de2b96890bfc62 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 17/31] cross-i686-pc-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..765cf675e95c 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From a1dc60cb5bd22ea51c2a6823fc3df4f1c664f673 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 18/31] cross-mips-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-mips-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..b6cf50add587 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
+version=0.35
 revision=3
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 0fe96b4d1d00d74257ee0006aef89753479db703 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 19/31] cross-mips-linux-muslhf: update to gcc 12.1.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..fe74faf15d55 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 7da29dd104a3109097f766c587410ef88a9498d0 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 20/31] cross-mipsel-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..aa74d0b1acc7 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_musl_version=1.1.24
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 30a66421affb9355bfe11a9799579b17094dbde2 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 21/31] cross-mipsel-linux-muslhf: update to gcc 12.1.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..83ab7f187085 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_musl_version=1.1.24
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 0c02419f83befa5f867ca7157fb5aed5f4137b2e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 22/31] cross-powerpc-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..3ab1a4ea40fa 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From c09a18550fc007be19c6d9bac1972f781ad3b95d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 23/31] cross-powerpc-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..af5586cacc77 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 692530b11302a0169ba3286997105e9136a65425 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 24/31] cross-powerpc64-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..2604b268046b 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From eefe74c38fc46e31f9db88d8c47c82ae1e12dec4 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 25/31] cross-powerpc64-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 1ebd0fb2048d..c7894721b900 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
@@ -19,12 +19,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From ad83cbdacb73a1866d1b09583e3fcfb71a40d7dd Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 26/31] cross-powerpc64le-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 733f5851da5c..618235468970 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 41c50692eb50cc2be104c2d634dcef36ab25ef7e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 27/31] cross-powerpc64le-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index 76a70aa1d6db..ae847b296366 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,6 +1,6 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
@@ -19,12 +19,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 8cf42ec7a72a18fcefb694dc347a7594582e64eb Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 28/31] cross-powerpcle-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 347b8fcf4f55..cc10b7cbd88b 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 42cdab1c79234e50fefa5753221b5f55db4ccd3b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 29/31] cross-powerpcle-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index ec9324ddaa99..1d38a3fa3559 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 688974cd95af523ff7c3741a597b691cb54971f9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 30/31] cross-x86_64-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 0078fbe7224b..9f740b00a80c 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 3bf2def0b623534deb14aa43c1fd928bbaad9ccb Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 31/31] cross-x86_64-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..19e13f3818e9 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
@@ -17,12 +17,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.1.0
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (20 preceding siblings ...)
  2022-08-15  8:14 ` oreo639
@ 2022-08-15  8:17 ` oreo639
  2022-08-15  8:20 ` oreo639
                   ` (242 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-08-15  8:17 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2605 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.1.0
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.1.0

This PR depends on: https://github.com/void-linux/void-packages/pull/32330

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

Also, keep in mind that the libgo musl patch here will need to be updated once musl is updated:
https://github.com/void-linux/void-packages/pull/34902/files#diff-1f42a95b93c9550178ff1fbccbef2f47a72711df15c24c9472e2550076978129R163-R176

This is the updated patch for reference:
https://github.com/alpinelinux/aports/blob/8acb21b8ee881e7ab1c812d9a66a17d2501b8730/main/gcc/0049-libgo-adjust-name-of-union-in-sigevent-struct.patch

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 105299 bytes --]

From 089d015613e2b4fa8555f3bc80701a181d470a23 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 01/31] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     |  9 +--
 3 files changed, 22 insertions(+), 113 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..6eb4f1a5e829 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkg-config"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"

From 5159209d72f3d4edff4978b823832d4000ce2b3a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 02/31] gcc: update to 12.1.0.

---
 common/shlibs                                 |  10 +-
 srcpkgs/gcc/files/gccgo-musl.patch            |  74 +++--------
 srcpkgs/gcc/files/libgnarl-musl.patch         |  18 +--
 srcpkgs/gcc/files/libssp-musl.patch           |  10 +-
 ...c21f3f5726823e19728fdd1571a14aae0fb3.patch | 105 ++++++++++++++++
 ...08065bdd36fb1a9b6aad9666b1edb5e06474.patch | 115 ++++++++++++++++++
 ...65517a59565758107c5b1a51a5fa382f8d1a.patch |  32 +++++
 srcpkgs/gcc/patches/libffi_gnulinux.patch     |  11 --
 .../gcc/patches/libgcc-ibm128-no-tag.patch    |  10 +-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |   3 +-
 srcpkgs/gcc/template                          |  25 ++--
 11 files changed, 305 insertions(+), 108 deletions(-)
 create mode 100644 srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
 create mode 100644 srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
 create mode 100644 srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index 61924610cc52..c6400b566966 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.1.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.34 perl-5.34.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -849,8 +849,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.1.0_1
+libgnat-12.so libada-12.1.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1701,8 +1701,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.1.0_1
+libasan.so.8 libsanitizer-12.1.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..632ef951097b 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,17 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ a/libgo/go/runtime/os_linux.go
+@@ -363,9 +363,9 @@
+ 
+ 	var timerid int32
+ 	var sevp _sigevent
+-	sevp.sigev_notify = _SIGEV_THREAD_ID
++	sevp.sigev_notify = 4
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.sigev_notify_function))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch b/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
new file mode 100644
index 000000000000..00929202a503
--- /dev/null
+++ b/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
@@ -0,0 +1,105 @@
+From 3b21c21f3f5726823e19728fdd1571a14aae0fb3 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <siarheit@google.com>
+Date: Mon, 27 Jun 2022 13:27:24 +0100
+Subject: [PATCH] c++: avoid <memory> poisoning on musl [PR106102]
+
+On musl <pthread.h> uses calloc() (via <sched.h>). <memory> includes
+it indirectly and exposes use of poisoned calloc() when module code
+is built:
+
+    /build/build/./prev-gcc/xg++ ... ../../gcc-13-20220626/gcc/cp/mapper-resolver.cc
+        In file included from /<<NIX>>/musl-1.2.3-dev/include/pthread.h:30,
+                 from /build/build/prev-x86_64-unknown-linux-musl/libstdc++-v3/include/x86_64-unknown-linux-musl/bits/gthr-default.h:35,
+                 ....
+                 from /build/build/prev-x86_64-unknown-linux-musl/libstdc++-v3/include/memory:77,
+                 from ../../gcc-13-20220626/gcc/../libcody/cody.hh:24,
+                 from ../../gcc-13-20220626/gcc/cp/../../c++tools/resolver.h:25,
+                 from ../../gcc-13-20220626/gcc/cp/../../c++tools/resolver.cc:23,
+                 from ../../gcc-13-20220626/gcc/cp/mapper-resolver.cc:32:
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:84:7: error: attempt to use poisoned "calloc"
+       84 | void *calloc(size_t, size_t);
+          |       ^
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:124:36: error: attempt to use poisoned "calloc"
+      124 | #define CPU_ALLOC(n) ((cpu_set_t *)calloc(1,CPU_ALLOC_SIZE(n)))
+          |                                    ^
+
+gcc/cp/
+
+	PR c++/106102
+	* mapper-client.cc: Include <memory> via "system.h".
+	* mapper-resolver.cc: Ditto.
+	* module.cc: Ditto.
+
+libcc1/
+
+	PR c++/106102
+	* libcc1plugin.cc: Include <memory> via "system.h".
+	* libcp1plugin.cc: Ditto.
+---
+ gcc/cp/mapper-client.cc   | 1 +
+ gcc/cp/mapper-resolver.cc | 1 +
+ gcc/cp/module.cc          | 1 +
+ libcc1/libcc1plugin.cc    | 1 +
+ libcc1/libcp1plugin.cc    | 1 +
+ 5 files changed, 5 insertions(+)
+
+diff --git a/gcc/cp/mapper-client.cc b/gcc/cp/mapper-client.cc
+index 8603a886a099..fe9544b5ba43 100644
+--- a/gcc/cp/mapper-client.cc
++++ b/gcc/cp/mapper-client.cc
+@@ -27,6 +27,7 @@ along with GCC; see the file COPYING3.  If not see
+ #define INCLUDE_STRING
+ #define INCLUDE_VECTOR
+ #define INCLUDE_MAP
++#define INCLUDE_MEMORY
+ #include "system.h"
+ 
+ #include "line-map.h"
+diff --git a/gcc/cp/mapper-resolver.cc b/gcc/cp/mapper-resolver.cc
+index e3d29fb5ada1..e70d1b4ae2ca 100644
+--- a/gcc/cp/mapper-resolver.cc
++++ b/gcc/cp/mapper-resolver.cc
+@@ -25,6 +25,7 @@ along with GCC; see the file COPYING3.  If not see
+ #define INCLUDE_VECTOR
+ #define INCLUDE_ALGORITHM
+ #define INCLUDE_MAP
++#define INCLUDE_MEMORY
+ #include "system.h"
+ 
+ // We don't want or need to be aware of networking
+diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc
+index 753963a4b246..8bb22c2b305a 100644
+--- a/gcc/cp/module.cc
++++ b/gcc/cp/module.cc
+@@ -206,6 +206,7 @@ Classes used:
+ 
+ #define _DEFAULT_SOURCE 1 /* To get TZ field of struct tm, if available.  */
+ #include "config.h"
++#define INCLUDE_MEMORY
+ #define INCLUDE_STRING
+ #define INCLUDE_VECTOR
+ #include "system.h"
+diff --git a/libcc1/libcc1plugin.cc b/libcc1/libcc1plugin.cc
+index 12ab5a57c8dd..bdd0bdabe77f 100644
+--- a/libcc1/libcc1plugin.cc
++++ b/libcc1/libcc1plugin.cc
+@@ -31,6 +31,7 @@
+ #undef PACKAGE_TARNAME
+ #undef PACKAGE_VERSION
+ 
++#define INCLUDE_MEMORY
+ #include "gcc-plugin.h"
+ #include "system.h"
+ #include "coretypes.h"
+diff --git a/libcc1/libcp1plugin.cc b/libcc1/libcp1plugin.cc
+index 83dab7f58b11..e2d5039a0a1f 100644
+--- a/libcc1/libcp1plugin.cc
++++ b/libcc1/libcp1plugin.cc
+@@ -32,6 +32,7 @@
+ #undef PACKAGE_TARNAME
+ #undef PACKAGE_VERSION
+ 
++#define INCLUDE_MEMORY
+ #include "gcc-plugin.h"
+ #include "system.h"
+ #include "coretypes.h"
diff --git a/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch b/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
new file mode 100644
index 000000000000..89bd053d6d04
--- /dev/null
+++ b/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
@@ -0,0 +1,115 @@
+From 49d508065bdd36fb1a9b6aad9666b1edb5e06474 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <siarheit@google.com>
+Date: Mon, 27 Jun 2022 23:42:44 +0100
+Subject: [PATCH] jit: avoid calloc() poisoning on musl [PR106102]
+
+On musl <pthread.h> uses calloc() (via <sched.h>). jit/ includes
+it directly and exposes use of poisoned calloc():
+
+    /build/build/./prev-gcc/xg++ ... ../../gcc-13-20220626/gcc/jit/jit-playback.cc
+    make[3]: *** [Makefile:1143: jit/libgccjit.o] Error 1
+    make[3]: *** Waiting for unfinished jobs....
+    In file included from /<<NIX>>/musl-1.2.3-dev/include/pthread.h:30,
+                     from ../../gcc-13-20220626/gcc/jit/jit-playback.cc:44:
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:84:7: error: attempt to use poisoned "calloc"
+       84 | void *calloc(size_t, size_t);
+          |       ^
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:124:36: error: attempt to use poisoned "calloc"
+      124 | #define CPU_ALLOC(n) ((cpu_set_t *)calloc(1,CPU_ALLOC_SIZE(n)))
+          |                                    ^
+
+The change moves <pthread.h> inclusion to "system.h" under new
+INCLUDE_PTHREAD_H guard and uses this mechanism in libgccjit.
+
+gcc/
+
+	PR c++/106102
+	* system.h: Introduce INCLUDE_PTHREAD_H macros to include <pthread.h>.
+
+gcc/jit/
+
+	PR c++/106102
+	* jit-playback.cc: Include <pthread.h> via "system.h" to avoid calloc()
+	poisoning.
+	* jit-recording.cc: Ditto.
+	* libgccjit.cc: Ditto.
+---
+ gcc/jit/jit-playback.cc  | 3 +--
+ gcc/jit/jit-recording.cc | 2 +-
+ gcc/jit/libgccjit.cc     | 2 +-
+ gcc/system.h             | 4 ++++
+ 4 files changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/gcc/jit/jit-playback.cc b/gcc/jit/jit-playback.cc
+index 6be6bdf8dea5..79714132b91a 100644
+--- a/gcc/jit/jit-playback.cc
++++ b/gcc/jit/jit-playback.cc
+@@ -19,6 +19,7 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "target.h"
+@@ -41,8 +42,6 @@ along with GCC; see the file COPYING3.  If not see
+ #include "diagnostic.h"
+ #include "stmt.h"
+ 
+-#include <pthread.h>
+-
+ #include "jit-playback.h"
+ #include "jit-result.h"
+ #include "jit-builtins.h"
+diff --git a/gcc/jit/jit-recording.cc b/gcc/jit/jit-recording.cc
+index 697dee66e733..f78daed2d71a 100644
+--- a/gcc/jit/jit-recording.cc
++++ b/gcc/jit/jit-recording.cc
+@@ -19,13 +19,13 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "tm.h"
+ #include "pretty-print.h"
+ #include "toplev.h"
+ 
+-#include <pthread.h>
+ 
+ #include "jit-builtins.h"
+ #include "jit-recording.h"
+diff --git a/gcc/jit/libgccjit.cc b/gcc/jit/libgccjit.cc
+index 0e76097b4bac..ca862662777e 100644
+--- a/gcc/jit/libgccjit.cc
++++ b/gcc/jit/libgccjit.cc
+@@ -19,12 +19,12 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "timevar.h"
+ #include "typed-splay-tree.h"
+ #include "cppbuiltin.h"
+-#include <pthread.h>
+ 
+ #include "libgccjit.h"
+ #include "jit-recording.h"
+diff --git a/gcc/system.h b/gcc/system.h
+index 67158b70c789..f8d42ff68150 100644
+--- a/gcc/system.h
++++ b/gcc/system.h
+@@ -753,6 +753,10 @@ extern int vsnprintf (char *, size_t, const char *, va_list);
+ #endif
+ #endif
+ 
++#ifdef INCLUDE_PTHREAD_H
++#include <pthread.h>
++#endif
++
+ #ifdef INCLUDE_ISL
+ #ifdef HAVE_isl
+ #include <isl/options.h>
diff --git a/srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch b/srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch
new file mode 100644
index 000000000000..044a4fc29514
--- /dev/null
+++ b/srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch
@@ -0,0 +1,32 @@
+From f35d65517a59565758107c5b1a51a5fa382f8d1a Mon Sep 17 00:00:00 2001
+From: Ian Lance Taylor <iant@golang.org>
+Date: Tue, 12 Jul 2022 19:42:43 -0700
+Subject: [PATCH] libgo: don't include <linux/fs.h> when building
+ gen-sysinfo.go
+
+Removing this doesn't change anything at least with glibc 2.33.
+The include was added in https://go.dev/cl/6100049 but it's not
+clear why.
+
+Fixes PR go/106266
+
+Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/417294
+---
+ gcc/go/gofrontend/MERGE | 2 +-
+ libgo/sysinfo.c         | 3 ---
+ 2 files changed, 1 insertion(+), 4 deletions(-)
+
+diff --git a/libgo/sysinfo.c b/libgo/sysinfo.c
+index a4259c02ded4..fc0210992faa 100644
+--- a/libgo/sysinfo.c
++++ b/libgo/sysinfo.c
+@@ -158,9 +158,6 @@
+ #if defined(HAVE_LINUX_ETHER_H)
+ #include <linux/ether.h>
+ #endif
+-#if defined(HAVE_LINUX_FS_H)
+-#include <linux/fs.h>
+-#endif
+ #if defined(HAVE_LINUX_REBOOT_H)
+ #include <linux/reboot.h>
+ #endif
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..78a2ce35875d 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,9 +3,10 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
  
  #  ifndef _ABIN32
+
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..32ee79e32f0d 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,15 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
+version=12.1.0
+revision=1
 _patchver="${version%pre*}"
 _minorver="${_patchver%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 wrksrc=gcc-${version/pre/_pre}
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +19,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -396,7 +393,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}

From 00980754f4f23e46126a980f4b7e96e7406b01d4 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 03/31] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      |  6 ++--
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..08e35d466a44 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From be75af2647f4e539b2e90c9e6025980a8da09418 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 04/31] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 1a4e1ca3d594..b04268908c2e 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="q66 <daniel@octaforge.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From c2c766aabce1472cea4d979dc86d631ec9aa52b9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 05/31] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 3 files changed, 55 insertions(+), 353 deletions(-)
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index c6400b566966..65f4d1b62b61 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From f8e0bd641b5216cecadb58d19e23c96f1b3745aa Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 14 Aug 2022 19:29:36 -0700
Subject: [PATCH 06/31] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

glibc 2.35 ane newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..24d02865b164 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -132,6 +132,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -246,6 +247,15 @@ _void_cross_build_glibc() {
 	local tgt=$1
 	local ver=$2
 
+	# glibc 2.35 and newer uses -static-pie by default
+	# which does not work with -no-pie.
+	local oldcflags="${CFLAGS}"
+	local oldcxxflags="${CXXFLAGS}"
+	local oldldflags="${LDFLAGS}"
+	CFLAGS="${CFLAGS//"-fno-PIE"/}"
+	CXXFLAGS="${CXXFLAGS//"-fno-PIE"/}"
+	LDFLAGS="${LDFLAGS//"-no-pie"/}"
+
 	msg_normal "Building glibc for ${tgt}\n"
 
 	mkdir -p ${wrksrc}/glibc_build
@@ -279,6 +289,9 @@ _void_cross_build_glibc() {
 	make ${makejobs}
 	make install_root=${wrksrc}/build_root/usr/${tgt} install
 
+	CFLAGS="${oldcflags}"
+	CXXFLAGS="${oldcxxflags}"
+	LDFLAGS="${oldldflags}"
 	touch ${wrksrc}/.glibc_build_done
 }
 

From e988fa9835b5cd7d348c55edab39650dafc5aa7a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:08:52 -0700
Subject: [PATCH 07/31] openssh: suppress werror on gcc12

---
 srcpkgs/openssh/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/openssh/template b/srcpkgs/openssh/template
index 02a2dec35f42..6e8e343a9dca 100644
--- a/srcpkgs/openssh/template
+++ b/srcpkgs/openssh/template
@@ -40,7 +40,7 @@ if [ "$build_option_ldns" -a -z "$build_option_ssl" ]; then
 	broken="option 'ldns' requires option 'ssl'"
 fi
 
-CFLAGS="-Wno-format-truncation -Wno-stringop-truncation"
+CFLAGS="-Wno-format-truncation -Wno-stringop-truncation -Wno-error=maybe-uninitialized"
 
 case $XBPS_TARGET_MACHINE in
 	i686-musl)

From 407b3fd8dba1c57cf3ed045c7e4442e82527691d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:09:31 -0700
Subject: [PATCH 08/31] linux5.18: update dotconfigs for gcc12

---
 srcpkgs/linux5.18/files/x86_64-dotconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/linux5.18/files/x86_64-dotconfig b/srcpkgs/linux5.18/files/x86_64-dotconfig
index 4e73a3195d40..ea6204868e23 100644
--- a/srcpkgs/linux5.18/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.18/files/x86_64-dotconfig
@@ -512,6 +512,7 @@ CONFIG_RETHUNK=y
 CONFIG_CPU_UNRET_ENTRY=y
 CONFIG_CPU_IBPB_ENTRY=y
 CONFIG_CPU_IBRS_ENTRY=y
+CONFIG_SLS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10060,8 +10061,11 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
 # Memory initialization
 #
 CONFIG_INIT_STACK_NONE=y
+# CONFIG_INIT_STACK_ALL_PATTERN is not set
+# CONFIG_INIT_STACK_ALL_ZERO is not set
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
+# CONFIG_ZERO_CALL_USED_REGS is not set
 # end of Memory initialization
 # end of Kernel hardening options
 # end of Security options
@@ -10538,6 +10542,7 @@ CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
 # CONFIG_UBSAN is not set
 CONFIG_HAVE_ARCH_KCSAN=y
+# CONFIG_KCSAN is not set
 # end of Generic Kernel Debugging Instruments
 
 #

From aae067274e632d0ae18cd8cf46f47e24d11d1554 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:54 -0700
Subject: [PATCH 09/31] cross-aarch64-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..cb7ae97e7efe 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 80ca04e163990ed72378b1dd8995bb8c142ee8b9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:54 -0700
Subject: [PATCH 10/31] cross-aarch64-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..4fa950f334d4 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 705d5d10eaf9b3f8c55690169edab6b9d26211af Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:54 -0700
Subject: [PATCH 11/31] cross-arm-linux-gnueabi: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..194c0ab774b7 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From f11f02cceb2db3c3d1b3c37271f397aa2dfb6993 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 12/31] cross-arm-linux-gnueabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..3f3242b85b07 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 9ed38a7006eb817c196096d398eb04e6fcb4567b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 13/31] cross-arm-linux-musleabi: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..b0cdade60a6d 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From e4e6df8cedcd9df54c58d334d9bddf255acae7f1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 14/31] cross-arm-linux-musleabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..1924be24d483 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 7afca911df0f1c59c488389623f233a864aa703b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 15/31] cross-armv7l-linux-gnueabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..a7997d6db937 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From f4276b1cf752a503c98d0bfed9c0b0234cf13d07 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 16/31] cross-armv7l-linux-musleabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..aaa7040fbfef 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 4c7e5ae9fe15df6e027fdf16c6de2b96890bfc62 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 17/31] cross-i686-pc-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..765cf675e95c 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From a1dc60cb5bd22ea51c2a6823fc3df4f1c664f673 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 18/31] cross-mips-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-mips-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..b6cf50add587 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
+version=0.35
 revision=3
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 0fe96b4d1d00d74257ee0006aef89753479db703 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 19/31] cross-mips-linux-muslhf: update to gcc 12.1.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..fe74faf15d55 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 7da29dd104a3109097f766c587410ef88a9498d0 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 20/31] cross-mipsel-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..aa74d0b1acc7 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_musl_version=1.1.24
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 30a66421affb9355bfe11a9799579b17094dbde2 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 21/31] cross-mipsel-linux-muslhf: update to gcc 12.1.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..83ab7f187085 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_musl_version=1.1.24
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 0c02419f83befa5f867ca7157fb5aed5f4137b2e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 22/31] cross-powerpc-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..3ab1a4ea40fa 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From c09a18550fc007be19c6d9bac1972f781ad3b95d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 23/31] cross-powerpc-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..af5586cacc77 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 692530b11302a0169ba3286997105e9136a65425 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 24/31] cross-powerpc64-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..2604b268046b 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From eefe74c38fc46e31f9db88d8c47c82ae1e12dec4 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 25/31] cross-powerpc64-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 1ebd0fb2048d..c7894721b900 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
@@ -19,12 +19,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From ad83cbdacb73a1866d1b09583e3fcfb71a40d7dd Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 26/31] cross-powerpc64le-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 733f5851da5c..618235468970 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From cd6338bd4b7e2617513986a2169fd733db14df0c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 27/31] cross-powerpc64le-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index 76a70aa1d6db..7edf9605e60d 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
@@ -19,12 +19,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From df8c58086499b811db8c5927691f562680948722 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 28/31] cross-powerpcle-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 347b8fcf4f55..cc10b7cbd88b 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 3b027fb769771cf1989ed642106459bf1fe8c6a7 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 29/31] cross-powerpcle-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index ec9324ddaa99..1d38a3fa3559 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From a9fcf1ca911862006ad780e170f18b1a9681b061 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 30/31] cross-x86_64-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 0078fbe7224b..9f740b00a80c 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 6b4d9b1f4e46fe9abba9f16bc0d44e75ee46fb9f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 31/31] cross-x86_64-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..19e13f3818e9 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
@@ -17,12 +17,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.1.0
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (21 preceding siblings ...)
  2022-08-15  8:17 ` oreo639
@ 2022-08-15  8:20 ` oreo639
  2022-08-15  8:20 ` oreo639
                   ` (241 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-08-15  8:20 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2605 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.1.0
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.1.0

This PR depends on: https://github.com/void-linux/void-packages/pull/32330

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

Also, keep in mind that the libgo musl patch here will need to be updated once musl is updated:
https://github.com/void-linux/void-packages/pull/34902/files#diff-1f42a95b93c9550178ff1fbccbef2f47a72711df15c24c9472e2550076978129R163-R176

This is the updated patch for reference:
https://github.com/alpinelinux/aports/blob/8acb21b8ee881e7ab1c812d9a66a17d2501b8730/main/gcc/0049-libgo-adjust-name-of-union-in-sigevent-struct.patch

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 105346 bytes --]

From 089d015613e2b4fa8555f3bc80701a181d470a23 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 01/31] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     |  9 +--
 3 files changed, 22 insertions(+), 113 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..6eb4f1a5e829 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkg-config"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"

From 5159209d72f3d4edff4978b823832d4000ce2b3a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 02/31] gcc: update to 12.1.0.

---
 common/shlibs                                 |  10 +-
 srcpkgs/gcc/files/gccgo-musl.patch            |  74 +++--------
 srcpkgs/gcc/files/libgnarl-musl.patch         |  18 +--
 srcpkgs/gcc/files/libssp-musl.patch           |  10 +-
 ...c21f3f5726823e19728fdd1571a14aae0fb3.patch | 105 ++++++++++++++++
 ...08065bdd36fb1a9b6aad9666b1edb5e06474.patch | 115 ++++++++++++++++++
 ...65517a59565758107c5b1a51a5fa382f8d1a.patch |  32 +++++
 srcpkgs/gcc/patches/libffi_gnulinux.patch     |  11 --
 .../gcc/patches/libgcc-ibm128-no-tag.patch    |  10 +-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |   3 +-
 srcpkgs/gcc/template                          |  25 ++--
 11 files changed, 305 insertions(+), 108 deletions(-)
 create mode 100644 srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
 create mode 100644 srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
 create mode 100644 srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index 61924610cc52..c6400b566966 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.1.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.34 perl-5.34.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -849,8 +849,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.1.0_1
+libgnat-12.so libada-12.1.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1701,8 +1701,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.1.0_1
+libasan.so.8 libsanitizer-12.1.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..632ef951097b 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,17 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ a/libgo/go/runtime/os_linux.go
+@@ -363,9 +363,9 @@
+ 
+ 	var timerid int32
+ 	var sevp _sigevent
+-	sevp.sigev_notify = _SIGEV_THREAD_ID
++	sevp.sigev_notify = 4
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.sigev_notify_function))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch b/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
new file mode 100644
index 000000000000..00929202a503
--- /dev/null
+++ b/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
@@ -0,0 +1,105 @@
+From 3b21c21f3f5726823e19728fdd1571a14aae0fb3 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <siarheit@google.com>
+Date: Mon, 27 Jun 2022 13:27:24 +0100
+Subject: [PATCH] c++: avoid <memory> poisoning on musl [PR106102]
+
+On musl <pthread.h> uses calloc() (via <sched.h>). <memory> includes
+it indirectly and exposes use of poisoned calloc() when module code
+is built:
+
+    /build/build/./prev-gcc/xg++ ... ../../gcc-13-20220626/gcc/cp/mapper-resolver.cc
+        In file included from /<<NIX>>/musl-1.2.3-dev/include/pthread.h:30,
+                 from /build/build/prev-x86_64-unknown-linux-musl/libstdc++-v3/include/x86_64-unknown-linux-musl/bits/gthr-default.h:35,
+                 ....
+                 from /build/build/prev-x86_64-unknown-linux-musl/libstdc++-v3/include/memory:77,
+                 from ../../gcc-13-20220626/gcc/../libcody/cody.hh:24,
+                 from ../../gcc-13-20220626/gcc/cp/../../c++tools/resolver.h:25,
+                 from ../../gcc-13-20220626/gcc/cp/../../c++tools/resolver.cc:23,
+                 from ../../gcc-13-20220626/gcc/cp/mapper-resolver.cc:32:
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:84:7: error: attempt to use poisoned "calloc"
+       84 | void *calloc(size_t, size_t);
+          |       ^
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:124:36: error: attempt to use poisoned "calloc"
+      124 | #define CPU_ALLOC(n) ((cpu_set_t *)calloc(1,CPU_ALLOC_SIZE(n)))
+          |                                    ^
+
+gcc/cp/
+
+	PR c++/106102
+	* mapper-client.cc: Include <memory> via "system.h".
+	* mapper-resolver.cc: Ditto.
+	* module.cc: Ditto.
+
+libcc1/
+
+	PR c++/106102
+	* libcc1plugin.cc: Include <memory> via "system.h".
+	* libcp1plugin.cc: Ditto.
+---
+ gcc/cp/mapper-client.cc   | 1 +
+ gcc/cp/mapper-resolver.cc | 1 +
+ gcc/cp/module.cc          | 1 +
+ libcc1/libcc1plugin.cc    | 1 +
+ libcc1/libcp1plugin.cc    | 1 +
+ 5 files changed, 5 insertions(+)
+
+diff --git a/gcc/cp/mapper-client.cc b/gcc/cp/mapper-client.cc
+index 8603a886a099..fe9544b5ba43 100644
+--- a/gcc/cp/mapper-client.cc
++++ b/gcc/cp/mapper-client.cc
+@@ -27,6 +27,7 @@ along with GCC; see the file COPYING3.  If not see
+ #define INCLUDE_STRING
+ #define INCLUDE_VECTOR
+ #define INCLUDE_MAP
++#define INCLUDE_MEMORY
+ #include "system.h"
+ 
+ #include "line-map.h"
+diff --git a/gcc/cp/mapper-resolver.cc b/gcc/cp/mapper-resolver.cc
+index e3d29fb5ada1..e70d1b4ae2ca 100644
+--- a/gcc/cp/mapper-resolver.cc
++++ b/gcc/cp/mapper-resolver.cc
+@@ -25,6 +25,7 @@ along with GCC; see the file COPYING3.  If not see
+ #define INCLUDE_VECTOR
+ #define INCLUDE_ALGORITHM
+ #define INCLUDE_MAP
++#define INCLUDE_MEMORY
+ #include "system.h"
+ 
+ // We don't want or need to be aware of networking
+diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc
+index 753963a4b246..8bb22c2b305a 100644
+--- a/gcc/cp/module.cc
++++ b/gcc/cp/module.cc
+@@ -206,6 +206,7 @@ Classes used:
+ 
+ #define _DEFAULT_SOURCE 1 /* To get TZ field of struct tm, if available.  */
+ #include "config.h"
++#define INCLUDE_MEMORY
+ #define INCLUDE_STRING
+ #define INCLUDE_VECTOR
+ #include "system.h"
+diff --git a/libcc1/libcc1plugin.cc b/libcc1/libcc1plugin.cc
+index 12ab5a57c8dd..bdd0bdabe77f 100644
+--- a/libcc1/libcc1plugin.cc
++++ b/libcc1/libcc1plugin.cc
+@@ -31,6 +31,7 @@
+ #undef PACKAGE_TARNAME
+ #undef PACKAGE_VERSION
+ 
++#define INCLUDE_MEMORY
+ #include "gcc-plugin.h"
+ #include "system.h"
+ #include "coretypes.h"
+diff --git a/libcc1/libcp1plugin.cc b/libcc1/libcp1plugin.cc
+index 83dab7f58b11..e2d5039a0a1f 100644
+--- a/libcc1/libcp1plugin.cc
++++ b/libcc1/libcp1plugin.cc
+@@ -32,6 +32,7 @@
+ #undef PACKAGE_TARNAME
+ #undef PACKAGE_VERSION
+ 
++#define INCLUDE_MEMORY
+ #include "gcc-plugin.h"
+ #include "system.h"
+ #include "coretypes.h"
diff --git a/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch b/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
new file mode 100644
index 000000000000..89bd053d6d04
--- /dev/null
+++ b/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
@@ -0,0 +1,115 @@
+From 49d508065bdd36fb1a9b6aad9666b1edb5e06474 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <siarheit@google.com>
+Date: Mon, 27 Jun 2022 23:42:44 +0100
+Subject: [PATCH] jit: avoid calloc() poisoning on musl [PR106102]
+
+On musl <pthread.h> uses calloc() (via <sched.h>). jit/ includes
+it directly and exposes use of poisoned calloc():
+
+    /build/build/./prev-gcc/xg++ ... ../../gcc-13-20220626/gcc/jit/jit-playback.cc
+    make[3]: *** [Makefile:1143: jit/libgccjit.o] Error 1
+    make[3]: *** Waiting for unfinished jobs....
+    In file included from /<<NIX>>/musl-1.2.3-dev/include/pthread.h:30,
+                     from ../../gcc-13-20220626/gcc/jit/jit-playback.cc:44:
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:84:7: error: attempt to use poisoned "calloc"
+       84 | void *calloc(size_t, size_t);
+          |       ^
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:124:36: error: attempt to use poisoned "calloc"
+      124 | #define CPU_ALLOC(n) ((cpu_set_t *)calloc(1,CPU_ALLOC_SIZE(n)))
+          |                                    ^
+
+The change moves <pthread.h> inclusion to "system.h" under new
+INCLUDE_PTHREAD_H guard and uses this mechanism in libgccjit.
+
+gcc/
+
+	PR c++/106102
+	* system.h: Introduce INCLUDE_PTHREAD_H macros to include <pthread.h>.
+
+gcc/jit/
+
+	PR c++/106102
+	* jit-playback.cc: Include <pthread.h> via "system.h" to avoid calloc()
+	poisoning.
+	* jit-recording.cc: Ditto.
+	* libgccjit.cc: Ditto.
+---
+ gcc/jit/jit-playback.cc  | 3 +--
+ gcc/jit/jit-recording.cc | 2 +-
+ gcc/jit/libgccjit.cc     | 2 +-
+ gcc/system.h             | 4 ++++
+ 4 files changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/gcc/jit/jit-playback.cc b/gcc/jit/jit-playback.cc
+index 6be6bdf8dea5..79714132b91a 100644
+--- a/gcc/jit/jit-playback.cc
++++ b/gcc/jit/jit-playback.cc
+@@ -19,6 +19,7 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "target.h"
+@@ -41,8 +42,6 @@ along with GCC; see the file COPYING3.  If not see
+ #include "diagnostic.h"
+ #include "stmt.h"
+ 
+-#include <pthread.h>
+-
+ #include "jit-playback.h"
+ #include "jit-result.h"
+ #include "jit-builtins.h"
+diff --git a/gcc/jit/jit-recording.cc b/gcc/jit/jit-recording.cc
+index 697dee66e733..f78daed2d71a 100644
+--- a/gcc/jit/jit-recording.cc
++++ b/gcc/jit/jit-recording.cc
+@@ -19,13 +19,13 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "tm.h"
+ #include "pretty-print.h"
+ #include "toplev.h"
+ 
+-#include <pthread.h>
+ 
+ #include "jit-builtins.h"
+ #include "jit-recording.h"
+diff --git a/gcc/jit/libgccjit.cc b/gcc/jit/libgccjit.cc
+index 0e76097b4bac..ca862662777e 100644
+--- a/gcc/jit/libgccjit.cc
++++ b/gcc/jit/libgccjit.cc
+@@ -19,12 +19,12 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "timevar.h"
+ #include "typed-splay-tree.h"
+ #include "cppbuiltin.h"
+-#include <pthread.h>
+ 
+ #include "libgccjit.h"
+ #include "jit-recording.h"
+diff --git a/gcc/system.h b/gcc/system.h
+index 67158b70c789..f8d42ff68150 100644
+--- a/gcc/system.h
++++ b/gcc/system.h
+@@ -753,6 +753,10 @@ extern int vsnprintf (char *, size_t, const char *, va_list);
+ #endif
+ #endif
+ 
++#ifdef INCLUDE_PTHREAD_H
++#include <pthread.h>
++#endif
++
+ #ifdef INCLUDE_ISL
+ #ifdef HAVE_isl
+ #include <isl/options.h>
diff --git a/srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch b/srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch
new file mode 100644
index 000000000000..044a4fc29514
--- /dev/null
+++ b/srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch
@@ -0,0 +1,32 @@
+From f35d65517a59565758107c5b1a51a5fa382f8d1a Mon Sep 17 00:00:00 2001
+From: Ian Lance Taylor <iant@golang.org>
+Date: Tue, 12 Jul 2022 19:42:43 -0700
+Subject: [PATCH] libgo: don't include <linux/fs.h> when building
+ gen-sysinfo.go
+
+Removing this doesn't change anything at least with glibc 2.33.
+The include was added in https://go.dev/cl/6100049 but it's not
+clear why.
+
+Fixes PR go/106266
+
+Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/417294
+---
+ gcc/go/gofrontend/MERGE | 2 +-
+ libgo/sysinfo.c         | 3 ---
+ 2 files changed, 1 insertion(+), 4 deletions(-)
+
+diff --git a/libgo/sysinfo.c b/libgo/sysinfo.c
+index a4259c02ded4..fc0210992faa 100644
+--- a/libgo/sysinfo.c
++++ b/libgo/sysinfo.c
+@@ -158,9 +158,6 @@
+ #if defined(HAVE_LINUX_ETHER_H)
+ #include <linux/ether.h>
+ #endif
+-#if defined(HAVE_LINUX_FS_H)
+-#include <linux/fs.h>
+-#endif
+ #if defined(HAVE_LINUX_REBOOT_H)
+ #include <linux/reboot.h>
+ #endif
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..78a2ce35875d 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,9 +3,10 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
  
  #  ifndef _ABIN32
+
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..32ee79e32f0d 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,15 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
+version=12.1.0
+revision=1
 _patchver="${version%pre*}"
 _minorver="${_patchver%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 wrksrc=gcc-${version/pre/_pre}
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +19,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -396,7 +393,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}

From 00980754f4f23e46126a980f4b7e96e7406b01d4 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 03/31] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      |  6 ++--
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..08e35d466a44 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From be75af2647f4e539b2e90c9e6025980a8da09418 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 04/31] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 1a4e1ca3d594..b04268908c2e 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="q66 <daniel@octaforge.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From c2c766aabce1472cea4d979dc86d631ec9aa52b9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 05/31] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 3 files changed, 55 insertions(+), 353 deletions(-)
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index c6400b566966..65f4d1b62b61 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From f8e0bd641b5216cecadb58d19e23c96f1b3745aa Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 14 Aug 2022 19:29:36 -0700
Subject: [PATCH 06/31] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

glibc 2.35 ane newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..24d02865b164 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -132,6 +132,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -246,6 +247,15 @@ _void_cross_build_glibc() {
 	local tgt=$1
 	local ver=$2
 
+	# glibc 2.35 and newer uses -static-pie by default
+	# which does not work with -no-pie.
+	local oldcflags="${CFLAGS}"
+	local oldcxxflags="${CXXFLAGS}"
+	local oldldflags="${LDFLAGS}"
+	CFLAGS="${CFLAGS//"-fno-PIE"/}"
+	CXXFLAGS="${CXXFLAGS//"-fno-PIE"/}"
+	LDFLAGS="${LDFLAGS//"-no-pie"/}"
+
 	msg_normal "Building glibc for ${tgt}\n"
 
 	mkdir -p ${wrksrc}/glibc_build
@@ -279,6 +289,9 @@ _void_cross_build_glibc() {
 	make ${makejobs}
 	make install_root=${wrksrc}/build_root/usr/${tgt} install
 
+	CFLAGS="${oldcflags}"
+	CXXFLAGS="${oldcxxflags}"
+	LDFLAGS="${oldldflags}"
 	touch ${wrksrc}/.glibc_build_done
 }
 

From e988fa9835b5cd7d348c55edab39650dafc5aa7a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:08:52 -0700
Subject: [PATCH 07/31] openssh: suppress werror on gcc12

---
 srcpkgs/openssh/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/openssh/template b/srcpkgs/openssh/template
index 02a2dec35f42..6e8e343a9dca 100644
--- a/srcpkgs/openssh/template
+++ b/srcpkgs/openssh/template
@@ -40,7 +40,7 @@ if [ "$build_option_ldns" -a -z "$build_option_ssl" ]; then
 	broken="option 'ldns' requires option 'ssl'"
 fi
 
-CFLAGS="-Wno-format-truncation -Wno-stringop-truncation"
+CFLAGS="-Wno-format-truncation -Wno-stringop-truncation -Wno-error=maybe-uninitialized"
 
 case $XBPS_TARGET_MACHINE in
 	i686-musl)

From 407b3fd8dba1c57cf3ed045c7e4442e82527691d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:09:31 -0700
Subject: [PATCH 08/31] linux5.18: update dotconfigs for gcc12

---
 srcpkgs/linux5.18/files/x86_64-dotconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/linux5.18/files/x86_64-dotconfig b/srcpkgs/linux5.18/files/x86_64-dotconfig
index 4e73a3195d40..ea6204868e23 100644
--- a/srcpkgs/linux5.18/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.18/files/x86_64-dotconfig
@@ -512,6 +512,7 @@ CONFIG_RETHUNK=y
 CONFIG_CPU_UNRET_ENTRY=y
 CONFIG_CPU_IBPB_ENTRY=y
 CONFIG_CPU_IBRS_ENTRY=y
+CONFIG_SLS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10060,8 +10061,11 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
 # Memory initialization
 #
 CONFIG_INIT_STACK_NONE=y
+# CONFIG_INIT_STACK_ALL_PATTERN is not set
+# CONFIG_INIT_STACK_ALL_ZERO is not set
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
+# CONFIG_ZERO_CALL_USED_REGS is not set
 # end of Memory initialization
 # end of Kernel hardening options
 # end of Security options
@@ -10538,6 +10542,7 @@ CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
 # CONFIG_UBSAN is not set
 CONFIG_HAVE_ARCH_KCSAN=y
+# CONFIG_KCSAN is not set
 # end of Generic Kernel Debugging Instruments
 
 #

From aae067274e632d0ae18cd8cf46f47e24d11d1554 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:54 -0700
Subject: [PATCH 09/31] cross-aarch64-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..cb7ae97e7efe 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 80ca04e163990ed72378b1dd8995bb8c142ee8b9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:54 -0700
Subject: [PATCH 10/31] cross-aarch64-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..4fa950f334d4 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 705d5d10eaf9b3f8c55690169edab6b9d26211af Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:54 -0700
Subject: [PATCH 11/31] cross-arm-linux-gnueabi: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..194c0ab774b7 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From f11f02cceb2db3c3d1b3c37271f397aa2dfb6993 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 12/31] cross-arm-linux-gnueabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..3f3242b85b07 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 9ed38a7006eb817c196096d398eb04e6fcb4567b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 13/31] cross-arm-linux-musleabi: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..b0cdade60a6d 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From e4e6df8cedcd9df54c58d334d9bddf255acae7f1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 14/31] cross-arm-linux-musleabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..1924be24d483 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 7afca911df0f1c59c488389623f233a864aa703b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 15/31] cross-armv7l-linux-gnueabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..a7997d6db937 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From f4276b1cf752a503c98d0bfed9c0b0234cf13d07 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 16/31] cross-armv7l-linux-musleabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..aaa7040fbfef 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 4c7e5ae9fe15df6e027fdf16c6de2b96890bfc62 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 17/31] cross-i686-pc-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..765cf675e95c 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 1154f6a908838b6cd284e7b6915978288c93d653 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 18/31] cross-mips-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-mips-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..26928ba9442d 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 287fa9ac02068bd90d9c6b0664f84c11ffce6278 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 19/31] cross-mips-linux-muslhf: update to gcc 12.1.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..fe74faf15d55 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From c651f8559ffb90df9db917bdbcb4c8d7d9a0f0ff Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 20/31] cross-mipsel-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..aa74d0b1acc7 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_musl_version=1.1.24
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From cdf76dcece1b0c6a153182b1e1ad9c5c2c2d94da Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 21/31] cross-mipsel-linux-muslhf: update to gcc 12.1.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..83ab7f187085 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_musl_version=1.1.24
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From eeaddb7ad1b4bea56cc23bf16c72842c51af6065 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 22/31] cross-powerpc-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..3ab1a4ea40fa 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 3c95271e8f4116ddd012707086f4fc266d0a1714 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 23/31] cross-powerpc-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..af5586cacc77 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 94e284ff8d23de24f435914a0f373146c965752e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 24/31] cross-powerpc64-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..2604b268046b 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 5b8905771fd845b16f710ff3f80e3592e513cc1e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 25/31] cross-powerpc64-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 1ebd0fb2048d..c7894721b900 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
@@ -19,12 +19,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 5f15d77b1da35621186aa651596c262595eb631b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 26/31] cross-powerpc64le-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 733f5851da5c..618235468970 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 74e304b18a1fe04e80834d4ab70bd8d23cf7d026 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 27/31] cross-powerpc64le-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index 76a70aa1d6db..7edf9605e60d 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
@@ -19,12 +19,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 2789bad57900dee289cb1c866a7713cd85f0c441 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 28/31] cross-powerpcle-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 347b8fcf4f55..cc10b7cbd88b 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From ebfa4a1f64cf57b06738c43231e003c51121430c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 29/31] cross-powerpcle-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index ec9324ddaa99..1d38a3fa3559 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From a607557a5f453330d0eaad133a24e5b0b0c282fc Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 30/31] cross-x86_64-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 0078fbe7224b..9f740b00a80c 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 4c0ca83c0a40cf8baf50fd21ab535f442e38a978 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 31/31] cross-x86_64-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..19e13f3818e9 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
@@ -17,12 +17,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.1.0
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (22 preceding siblings ...)
  2022-08-15  8:20 ` oreo639
@ 2022-08-15  8:20 ` oreo639
  2022-08-15 20:12 ` lane-brain
                   ` (240 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-08-15  8:20 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2605 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.1.0
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.1.0

This PR depends on: https://github.com/void-linux/void-packages/pull/32330

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

Also, keep in mind that the libgo musl patch here will need to be updated once musl is updated:
https://github.com/void-linux/void-packages/pull/34902/files#diff-1f42a95b93c9550178ff1fbccbef2f47a72711df15c24c9472e2550076978129R163-R176

This is the updated patch for reference:
https://github.com/alpinelinux/aports/blob/8acb21b8ee881e7ab1c812d9a66a17d2501b8730/main/gcc/0049-libgo-adjust-name-of-union-in-sigevent-struct.patch

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 105346 bytes --]

From 6bfc3c428d190be31b433864e528c31ea44bb6fb Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 01/31] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     |  9 +--
 3 files changed, 22 insertions(+), 113 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..6eb4f1a5e829 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkg-config"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"

From ab31583359fe4aaa466044ccd2bd44f52117bdab Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 02/31] gcc: update to 12.1.0.

---
 common/shlibs                                 |  10 +-
 srcpkgs/gcc/files/gccgo-musl.patch            |  74 +++--------
 srcpkgs/gcc/files/libgnarl-musl.patch         |  18 +--
 srcpkgs/gcc/files/libssp-musl.patch           |  10 +-
 ...c21f3f5726823e19728fdd1571a14aae0fb3.patch | 105 ++++++++++++++++
 ...08065bdd36fb1a9b6aad9666b1edb5e06474.patch | 115 ++++++++++++++++++
 ...65517a59565758107c5b1a51a5fa382f8d1a.patch |  32 +++++
 srcpkgs/gcc/patches/libffi_gnulinux.patch     |  11 --
 .../gcc/patches/libgcc-ibm128-no-tag.patch    |  10 +-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |   3 +-
 srcpkgs/gcc/template                          |  25 ++--
 11 files changed, 305 insertions(+), 108 deletions(-)
 create mode 100644 srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
 create mode 100644 srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
 create mode 100644 srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index 01f6f2753fc3..ee15983a75b2 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.1.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.34 perl-5.34.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -849,8 +849,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.1.0_1
+libgnat-12.so libada-12.1.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1701,8 +1701,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.1.0_1
+libasan.so.8 libsanitizer-12.1.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..632ef951097b 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,17 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ a/libgo/go/runtime/os_linux.go
+@@ -363,9 +363,9 @@
+ 
+ 	var timerid int32
+ 	var sevp _sigevent
+-	sevp.sigev_notify = _SIGEV_THREAD_ID
++	sevp.sigev_notify = 4
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.sigev_notify_function))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch b/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
new file mode 100644
index 000000000000..00929202a503
--- /dev/null
+++ b/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
@@ -0,0 +1,105 @@
+From 3b21c21f3f5726823e19728fdd1571a14aae0fb3 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <siarheit@google.com>
+Date: Mon, 27 Jun 2022 13:27:24 +0100
+Subject: [PATCH] c++: avoid <memory> poisoning on musl [PR106102]
+
+On musl <pthread.h> uses calloc() (via <sched.h>). <memory> includes
+it indirectly and exposes use of poisoned calloc() when module code
+is built:
+
+    /build/build/./prev-gcc/xg++ ... ../../gcc-13-20220626/gcc/cp/mapper-resolver.cc
+        In file included from /<<NIX>>/musl-1.2.3-dev/include/pthread.h:30,
+                 from /build/build/prev-x86_64-unknown-linux-musl/libstdc++-v3/include/x86_64-unknown-linux-musl/bits/gthr-default.h:35,
+                 ....
+                 from /build/build/prev-x86_64-unknown-linux-musl/libstdc++-v3/include/memory:77,
+                 from ../../gcc-13-20220626/gcc/../libcody/cody.hh:24,
+                 from ../../gcc-13-20220626/gcc/cp/../../c++tools/resolver.h:25,
+                 from ../../gcc-13-20220626/gcc/cp/../../c++tools/resolver.cc:23,
+                 from ../../gcc-13-20220626/gcc/cp/mapper-resolver.cc:32:
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:84:7: error: attempt to use poisoned "calloc"
+       84 | void *calloc(size_t, size_t);
+          |       ^
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:124:36: error: attempt to use poisoned "calloc"
+      124 | #define CPU_ALLOC(n) ((cpu_set_t *)calloc(1,CPU_ALLOC_SIZE(n)))
+          |                                    ^
+
+gcc/cp/
+
+	PR c++/106102
+	* mapper-client.cc: Include <memory> via "system.h".
+	* mapper-resolver.cc: Ditto.
+	* module.cc: Ditto.
+
+libcc1/
+
+	PR c++/106102
+	* libcc1plugin.cc: Include <memory> via "system.h".
+	* libcp1plugin.cc: Ditto.
+---
+ gcc/cp/mapper-client.cc   | 1 +
+ gcc/cp/mapper-resolver.cc | 1 +
+ gcc/cp/module.cc          | 1 +
+ libcc1/libcc1plugin.cc    | 1 +
+ libcc1/libcp1plugin.cc    | 1 +
+ 5 files changed, 5 insertions(+)
+
+diff --git a/gcc/cp/mapper-client.cc b/gcc/cp/mapper-client.cc
+index 8603a886a099..fe9544b5ba43 100644
+--- a/gcc/cp/mapper-client.cc
++++ b/gcc/cp/mapper-client.cc
+@@ -27,6 +27,7 @@ along with GCC; see the file COPYING3.  If not see
+ #define INCLUDE_STRING
+ #define INCLUDE_VECTOR
+ #define INCLUDE_MAP
++#define INCLUDE_MEMORY
+ #include "system.h"
+ 
+ #include "line-map.h"
+diff --git a/gcc/cp/mapper-resolver.cc b/gcc/cp/mapper-resolver.cc
+index e3d29fb5ada1..e70d1b4ae2ca 100644
+--- a/gcc/cp/mapper-resolver.cc
++++ b/gcc/cp/mapper-resolver.cc
+@@ -25,6 +25,7 @@ along with GCC; see the file COPYING3.  If not see
+ #define INCLUDE_VECTOR
+ #define INCLUDE_ALGORITHM
+ #define INCLUDE_MAP
++#define INCLUDE_MEMORY
+ #include "system.h"
+ 
+ // We don't want or need to be aware of networking
+diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc
+index 753963a4b246..8bb22c2b305a 100644
+--- a/gcc/cp/module.cc
++++ b/gcc/cp/module.cc
+@@ -206,6 +206,7 @@ Classes used:
+ 
+ #define _DEFAULT_SOURCE 1 /* To get TZ field of struct tm, if available.  */
+ #include "config.h"
++#define INCLUDE_MEMORY
+ #define INCLUDE_STRING
+ #define INCLUDE_VECTOR
+ #include "system.h"
+diff --git a/libcc1/libcc1plugin.cc b/libcc1/libcc1plugin.cc
+index 12ab5a57c8dd..bdd0bdabe77f 100644
+--- a/libcc1/libcc1plugin.cc
++++ b/libcc1/libcc1plugin.cc
+@@ -31,6 +31,7 @@
+ #undef PACKAGE_TARNAME
+ #undef PACKAGE_VERSION
+ 
++#define INCLUDE_MEMORY
+ #include "gcc-plugin.h"
+ #include "system.h"
+ #include "coretypes.h"
+diff --git a/libcc1/libcp1plugin.cc b/libcc1/libcp1plugin.cc
+index 83dab7f58b11..e2d5039a0a1f 100644
+--- a/libcc1/libcp1plugin.cc
++++ b/libcc1/libcp1plugin.cc
+@@ -32,6 +32,7 @@
+ #undef PACKAGE_TARNAME
+ #undef PACKAGE_VERSION
+ 
++#define INCLUDE_MEMORY
+ #include "gcc-plugin.h"
+ #include "system.h"
+ #include "coretypes.h"
diff --git a/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch b/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
new file mode 100644
index 000000000000..89bd053d6d04
--- /dev/null
+++ b/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
@@ -0,0 +1,115 @@
+From 49d508065bdd36fb1a9b6aad9666b1edb5e06474 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <siarheit@google.com>
+Date: Mon, 27 Jun 2022 23:42:44 +0100
+Subject: [PATCH] jit: avoid calloc() poisoning on musl [PR106102]
+
+On musl <pthread.h> uses calloc() (via <sched.h>). jit/ includes
+it directly and exposes use of poisoned calloc():
+
+    /build/build/./prev-gcc/xg++ ... ../../gcc-13-20220626/gcc/jit/jit-playback.cc
+    make[3]: *** [Makefile:1143: jit/libgccjit.o] Error 1
+    make[3]: *** Waiting for unfinished jobs....
+    In file included from /<<NIX>>/musl-1.2.3-dev/include/pthread.h:30,
+                     from ../../gcc-13-20220626/gcc/jit/jit-playback.cc:44:
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:84:7: error: attempt to use poisoned "calloc"
+       84 | void *calloc(size_t, size_t);
+          |       ^
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:124:36: error: attempt to use poisoned "calloc"
+      124 | #define CPU_ALLOC(n) ((cpu_set_t *)calloc(1,CPU_ALLOC_SIZE(n)))
+          |                                    ^
+
+The change moves <pthread.h> inclusion to "system.h" under new
+INCLUDE_PTHREAD_H guard and uses this mechanism in libgccjit.
+
+gcc/
+
+	PR c++/106102
+	* system.h: Introduce INCLUDE_PTHREAD_H macros to include <pthread.h>.
+
+gcc/jit/
+
+	PR c++/106102
+	* jit-playback.cc: Include <pthread.h> via "system.h" to avoid calloc()
+	poisoning.
+	* jit-recording.cc: Ditto.
+	* libgccjit.cc: Ditto.
+---
+ gcc/jit/jit-playback.cc  | 3 +--
+ gcc/jit/jit-recording.cc | 2 +-
+ gcc/jit/libgccjit.cc     | 2 +-
+ gcc/system.h             | 4 ++++
+ 4 files changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/gcc/jit/jit-playback.cc b/gcc/jit/jit-playback.cc
+index 6be6bdf8dea5..79714132b91a 100644
+--- a/gcc/jit/jit-playback.cc
++++ b/gcc/jit/jit-playback.cc
+@@ -19,6 +19,7 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "target.h"
+@@ -41,8 +42,6 @@ along with GCC; see the file COPYING3.  If not see
+ #include "diagnostic.h"
+ #include "stmt.h"
+ 
+-#include <pthread.h>
+-
+ #include "jit-playback.h"
+ #include "jit-result.h"
+ #include "jit-builtins.h"
+diff --git a/gcc/jit/jit-recording.cc b/gcc/jit/jit-recording.cc
+index 697dee66e733..f78daed2d71a 100644
+--- a/gcc/jit/jit-recording.cc
++++ b/gcc/jit/jit-recording.cc
+@@ -19,13 +19,13 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "tm.h"
+ #include "pretty-print.h"
+ #include "toplev.h"
+ 
+-#include <pthread.h>
+ 
+ #include "jit-builtins.h"
+ #include "jit-recording.h"
+diff --git a/gcc/jit/libgccjit.cc b/gcc/jit/libgccjit.cc
+index 0e76097b4bac..ca862662777e 100644
+--- a/gcc/jit/libgccjit.cc
++++ b/gcc/jit/libgccjit.cc
+@@ -19,12 +19,12 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "timevar.h"
+ #include "typed-splay-tree.h"
+ #include "cppbuiltin.h"
+-#include <pthread.h>
+ 
+ #include "libgccjit.h"
+ #include "jit-recording.h"
+diff --git a/gcc/system.h b/gcc/system.h
+index 67158b70c789..f8d42ff68150 100644
+--- a/gcc/system.h
++++ b/gcc/system.h
+@@ -753,6 +753,10 @@ extern int vsnprintf (char *, size_t, const char *, va_list);
+ #endif
+ #endif
+ 
++#ifdef INCLUDE_PTHREAD_H
++#include <pthread.h>
++#endif
++
+ #ifdef INCLUDE_ISL
+ #ifdef HAVE_isl
+ #include <isl/options.h>
diff --git a/srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch b/srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch
new file mode 100644
index 000000000000..044a4fc29514
--- /dev/null
+++ b/srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch
@@ -0,0 +1,32 @@
+From f35d65517a59565758107c5b1a51a5fa382f8d1a Mon Sep 17 00:00:00 2001
+From: Ian Lance Taylor <iant@golang.org>
+Date: Tue, 12 Jul 2022 19:42:43 -0700
+Subject: [PATCH] libgo: don't include <linux/fs.h> when building
+ gen-sysinfo.go
+
+Removing this doesn't change anything at least with glibc 2.33.
+The include was added in https://go.dev/cl/6100049 but it's not
+clear why.
+
+Fixes PR go/106266
+
+Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/417294
+---
+ gcc/go/gofrontend/MERGE | 2 +-
+ libgo/sysinfo.c         | 3 ---
+ 2 files changed, 1 insertion(+), 4 deletions(-)
+
+diff --git a/libgo/sysinfo.c b/libgo/sysinfo.c
+index a4259c02ded4..fc0210992faa 100644
+--- a/libgo/sysinfo.c
++++ b/libgo/sysinfo.c
+@@ -158,9 +158,6 @@
+ #if defined(HAVE_LINUX_ETHER_H)
+ #include <linux/ether.h>
+ #endif
+-#if defined(HAVE_LINUX_FS_H)
+-#include <linux/fs.h>
+-#endif
+ #if defined(HAVE_LINUX_REBOOT_H)
+ #include <linux/reboot.h>
+ #endif
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..78a2ce35875d 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,9 +3,10 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
  
  #  ifndef _ABIN32
+
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..32ee79e32f0d 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,15 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
+version=12.1.0
+revision=1
 _patchver="${version%pre*}"
 _minorver="${_patchver%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 wrksrc=gcc-${version/pre/_pre}
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +19,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -396,7 +393,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}

From c5b1812ace928e11eb9095989296d99551ebf63b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 03/31] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      |  6 ++--
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..08e35d466a44 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From 72fb27aac3fb8dc00486ee9e64c443d2a2153eb3 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 04/31] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 1a4e1ca3d594..b04268908c2e 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="q66 <daniel@octaforge.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From 7274db5bc0f699043a2c9528b0733c21c421dcdb Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 05/31] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 3 files changed, 55 insertions(+), 353 deletions(-)
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index ee15983a75b2..ecddb4459d9e 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From bbb7052011c23098751daba60e752304d9986813 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 14 Aug 2022 19:29:36 -0700
Subject: [PATCH 06/31] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

glibc 2.35 ane newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..24d02865b164 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -132,6 +132,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -246,6 +247,15 @@ _void_cross_build_glibc() {
 	local tgt=$1
 	local ver=$2
 
+	# glibc 2.35 and newer uses -static-pie by default
+	# which does not work with -no-pie.
+	local oldcflags="${CFLAGS}"
+	local oldcxxflags="${CXXFLAGS}"
+	local oldldflags="${LDFLAGS}"
+	CFLAGS="${CFLAGS//"-fno-PIE"/}"
+	CXXFLAGS="${CXXFLAGS//"-fno-PIE"/}"
+	LDFLAGS="${LDFLAGS//"-no-pie"/}"
+
 	msg_normal "Building glibc for ${tgt}\n"
 
 	mkdir -p ${wrksrc}/glibc_build
@@ -279,6 +289,9 @@ _void_cross_build_glibc() {
 	make ${makejobs}
 	make install_root=${wrksrc}/build_root/usr/${tgt} install
 
+	CFLAGS="${oldcflags}"
+	CXXFLAGS="${oldcxxflags}"
+	LDFLAGS="${oldldflags}"
 	touch ${wrksrc}/.glibc_build_done
 }
 

From 8370f5c274b7f83d4880d5f63a7830ca913d24fb Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:08:52 -0700
Subject: [PATCH 07/31] openssh: suppress werror on gcc12

---
 srcpkgs/openssh/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/openssh/template b/srcpkgs/openssh/template
index 02a2dec35f42..6e8e343a9dca 100644
--- a/srcpkgs/openssh/template
+++ b/srcpkgs/openssh/template
@@ -40,7 +40,7 @@ if [ "$build_option_ldns" -a -z "$build_option_ssl" ]; then
 	broken="option 'ldns' requires option 'ssl'"
 fi
 
-CFLAGS="-Wno-format-truncation -Wno-stringop-truncation"
+CFLAGS="-Wno-format-truncation -Wno-stringop-truncation -Wno-error=maybe-uninitialized"
 
 case $XBPS_TARGET_MACHINE in
 	i686-musl)

From 1dff748200a3044caba6a75061a0e4eb668c1252 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:09:31 -0700
Subject: [PATCH 08/31] linux5.18: update dotconfigs for gcc12

---
 srcpkgs/linux5.18/files/x86_64-dotconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/linux5.18/files/x86_64-dotconfig b/srcpkgs/linux5.18/files/x86_64-dotconfig
index 4e73a3195d40..ea6204868e23 100644
--- a/srcpkgs/linux5.18/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.18/files/x86_64-dotconfig
@@ -512,6 +512,7 @@ CONFIG_RETHUNK=y
 CONFIG_CPU_UNRET_ENTRY=y
 CONFIG_CPU_IBPB_ENTRY=y
 CONFIG_CPU_IBRS_ENTRY=y
+CONFIG_SLS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10060,8 +10061,11 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
 # Memory initialization
 #
 CONFIG_INIT_STACK_NONE=y
+# CONFIG_INIT_STACK_ALL_PATTERN is not set
+# CONFIG_INIT_STACK_ALL_ZERO is not set
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
+# CONFIG_ZERO_CALL_USED_REGS is not set
 # end of Memory initialization
 # end of Kernel hardening options
 # end of Security options
@@ -10538,6 +10542,7 @@ CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
 # CONFIG_UBSAN is not set
 CONFIG_HAVE_ARCH_KCSAN=y
+# CONFIG_KCSAN is not set
 # end of Generic Kernel Debugging Instruments
 
 #

From f3a87263b2e1fce4794ee7a7a33e471865e70357 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:54 -0700
Subject: [PATCH 09/31] cross-aarch64-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..cb7ae97e7efe 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 1e260d8b33be993af775a83c541dad0734cbf579 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:54 -0700
Subject: [PATCH 10/31] cross-aarch64-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..4fa950f334d4 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 8c3034492499a625e0e20e8c5cec6146007e7cf1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:54 -0700
Subject: [PATCH 11/31] cross-arm-linux-gnueabi: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..194c0ab774b7 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From a4efe39c2d08e1e9070ae71e9c6246c3ded8c6b0 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 12/31] cross-arm-linux-gnueabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..3f3242b85b07 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 3ef2467fd6609305938c004c9bbd5da9759fbb0e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 13/31] cross-arm-linux-musleabi: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..b0cdade60a6d 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 651486ae4410eb28a6b2cb65b3778d44dcb154f4 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 14/31] cross-arm-linux-musleabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..1924be24d483 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From dd74a5ff6471f8434d898be699f7e5bd871258d6 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 15/31] cross-armv7l-linux-gnueabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..a7997d6db937 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 16bb64fa3d0f09b6b2f39805efbfd0a818399083 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 16/31] cross-armv7l-linux-musleabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..aaa7040fbfef 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 3bc60c94645520d0a45e0c8267de23f7c0813c26 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 17/31] cross-i686-pc-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..765cf675e95c 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 48e29a4c79f99798fa51443cd762f26961759a81 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 18/31] cross-mips-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-mips-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..26928ba9442d 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From b3d5273227225235c10d2f36d89fec49af164ef0 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 19/31] cross-mips-linux-muslhf: update to gcc 12.1.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..fe74faf15d55 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 10961dbfc65202d6f5695c5b503aa00f65228092 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 20/31] cross-mipsel-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..aa74d0b1acc7 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_musl_version=1.1.24
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From c3d12fc809a417ff47a57f6c965d4e71aa883870 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 21/31] cross-mipsel-linux-muslhf: update to gcc 12.1.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..83ab7f187085 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_musl_version=1.1.24
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 3e1e28b31ef521268f8ac9ca44270c5f21144acf Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 22/31] cross-powerpc-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..3ab1a4ea40fa 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From e11ff5d4800d7634884a8fc36cc148a9c1a16fd8 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 23/31] cross-powerpc-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..af5586cacc77 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 8aaedbef2a10b0be7d258b2d989639ed393fdeb8 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 24/31] cross-powerpc64-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..2604b268046b 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 50ab5a4014a3afbe6d1336e5cb2788e1bfa7cbca Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 25/31] cross-powerpc64-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 1ebd0fb2048d..c7894721b900 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
@@ -19,12 +19,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 342dc7886854d6d92ef0662a6c09f1bc549fb616 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 26/31] cross-powerpc64le-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 733f5851da5c..618235468970 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 1f1a14a8865592e00cdec7afb59c0b6c7e51a410 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 27/31] cross-powerpc64le-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index 76a70aa1d6db..7edf9605e60d 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
@@ -19,12 +19,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 3dca8dfe50ae61eb17f2ef378dbbff480080e296 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 28/31] cross-powerpcle-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 347b8fcf4f55..cc10b7cbd88b 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 65f8b7fd4790836109abe249845315ac545ea58d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 29/31] cross-powerpcle-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index ec9324ddaa99..1d38a3fa3559 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 74b742656023d7fa74d31b61035d69824235f130 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 30/31] cross-x86_64-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 0078fbe7224b..9f740b00a80c 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From cc0fc1fd5fece9c46c717c72e41a62431b8700fb Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 31/31] cross-x86_64-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..19e13f3818e9 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
@@ -17,12 +17,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.1.0
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (23 preceding siblings ...)
  2022-08-15  8:20 ` oreo639
@ 2022-08-15 20:12 ` lane-brain
  2022-08-15 21:48 ` [PR PATCH] [Updated] " oreo639
                   ` (239 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: lane-brain @ 2022-08-15 20:12 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 155 bytes --]

New comment by lane-brain on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1215741630

Comment:
👀 🥇 

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.1.0
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (24 preceding siblings ...)
  2022-08-15 20:12 ` lane-brain
@ 2022-08-15 21:48 ` oreo639
  2022-08-16  1:01 ` oreo639
                   ` (238 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-08-15 21:48 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2785 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.1.0
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.1.0

This PR depends on: https://github.com/void-linux/void-packages/pull/32330

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

Also, keep in mind that the libgo musl patch here will need to be updated once musl is updated:
https://github.com/void-linux/void-packages/pull/34902/files#diff-1f42a95b93c9550178ff1fbccbef2f47a72711df15c24c9472e2550076978129R163-R176

This is the updated patch for reference:
https://github.com/alpinelinux/aports/blob/8acb21b8ee881e7ab1c812d9a66a17d2501b8730/main/gcc/0049-libgo-adjust-name-of-union-in-sigevent-struct.patch

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Known packages that need to be fixed for glibc 2.36:
- [ ] samba
- [ ] qemu
- [ ] llvm

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 105637 bytes --]

From 36303359d3d5a7d2fd574201835ae61543952c32 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 01/31] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 15 +++--
 3 files changed, 28 insertions(+), 113 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..4bdaee582d71 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkg-config"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -44,6 +45,12 @@ do_configure() {
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	case "$XBPS_TARGET_MACHINE" in
+		*-musl)
+			conf+=" --disable-gprofng"
+			;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"

From 8325e68c80b0a39519cf43410327365a2ea9fd1a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 02/31] gcc: update to 12.1.0.

---
 common/shlibs                                 |  10 +-
 srcpkgs/gcc/files/gccgo-musl.patch            |  74 +++--------
 srcpkgs/gcc/files/libgnarl-musl.patch         |  18 +--
 srcpkgs/gcc/files/libssp-musl.patch           |  10 +-
 ...c21f3f5726823e19728fdd1571a14aae0fb3.patch | 105 ++++++++++++++++
 ...08065bdd36fb1a9b6aad9666b1edb5e06474.patch | 115 ++++++++++++++++++
 ...65517a59565758107c5b1a51a5fa382f8d1a.patch |  32 +++++
 srcpkgs/gcc/patches/libffi_gnulinux.patch     |  11 --
 .../gcc/patches/libgcc-ibm128-no-tag.patch    |  10 +-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |   3 +-
 srcpkgs/gcc/template                          |  25 ++--
 11 files changed, 305 insertions(+), 108 deletions(-)
 create mode 100644 srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
 create mode 100644 srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
 create mode 100644 srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index 01f6f2753fc3..ee15983a75b2 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.1.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.34 perl-5.34.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -849,8 +849,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.1.0_1
+libgnat-12.so libada-12.1.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1701,8 +1701,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.1.0_1
+libasan.so.8 libsanitizer-12.1.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..632ef951097b 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,17 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ a/libgo/go/runtime/os_linux.go
+@@ -363,9 +363,9 @@
+ 
+ 	var timerid int32
+ 	var sevp _sigevent
+-	sevp.sigev_notify = _SIGEV_THREAD_ID
++	sevp.sigev_notify = 4
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.sigev_notify_function))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch b/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
new file mode 100644
index 000000000000..00929202a503
--- /dev/null
+++ b/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
@@ -0,0 +1,105 @@
+From 3b21c21f3f5726823e19728fdd1571a14aae0fb3 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <siarheit@google.com>
+Date: Mon, 27 Jun 2022 13:27:24 +0100
+Subject: [PATCH] c++: avoid <memory> poisoning on musl [PR106102]
+
+On musl <pthread.h> uses calloc() (via <sched.h>). <memory> includes
+it indirectly and exposes use of poisoned calloc() when module code
+is built:
+
+    /build/build/./prev-gcc/xg++ ... ../../gcc-13-20220626/gcc/cp/mapper-resolver.cc
+        In file included from /<<NIX>>/musl-1.2.3-dev/include/pthread.h:30,
+                 from /build/build/prev-x86_64-unknown-linux-musl/libstdc++-v3/include/x86_64-unknown-linux-musl/bits/gthr-default.h:35,
+                 ....
+                 from /build/build/prev-x86_64-unknown-linux-musl/libstdc++-v3/include/memory:77,
+                 from ../../gcc-13-20220626/gcc/../libcody/cody.hh:24,
+                 from ../../gcc-13-20220626/gcc/cp/../../c++tools/resolver.h:25,
+                 from ../../gcc-13-20220626/gcc/cp/../../c++tools/resolver.cc:23,
+                 from ../../gcc-13-20220626/gcc/cp/mapper-resolver.cc:32:
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:84:7: error: attempt to use poisoned "calloc"
+       84 | void *calloc(size_t, size_t);
+          |       ^
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:124:36: error: attempt to use poisoned "calloc"
+      124 | #define CPU_ALLOC(n) ((cpu_set_t *)calloc(1,CPU_ALLOC_SIZE(n)))
+          |                                    ^
+
+gcc/cp/
+
+	PR c++/106102
+	* mapper-client.cc: Include <memory> via "system.h".
+	* mapper-resolver.cc: Ditto.
+	* module.cc: Ditto.
+
+libcc1/
+
+	PR c++/106102
+	* libcc1plugin.cc: Include <memory> via "system.h".
+	* libcp1plugin.cc: Ditto.
+---
+ gcc/cp/mapper-client.cc   | 1 +
+ gcc/cp/mapper-resolver.cc | 1 +
+ gcc/cp/module.cc          | 1 +
+ libcc1/libcc1plugin.cc    | 1 +
+ libcc1/libcp1plugin.cc    | 1 +
+ 5 files changed, 5 insertions(+)
+
+diff --git a/gcc/cp/mapper-client.cc b/gcc/cp/mapper-client.cc
+index 8603a886a099..fe9544b5ba43 100644
+--- a/gcc/cp/mapper-client.cc
++++ b/gcc/cp/mapper-client.cc
+@@ -27,6 +27,7 @@ along with GCC; see the file COPYING3.  If not see
+ #define INCLUDE_STRING
+ #define INCLUDE_VECTOR
+ #define INCLUDE_MAP
++#define INCLUDE_MEMORY
+ #include "system.h"
+ 
+ #include "line-map.h"
+diff --git a/gcc/cp/mapper-resolver.cc b/gcc/cp/mapper-resolver.cc
+index e3d29fb5ada1..e70d1b4ae2ca 100644
+--- a/gcc/cp/mapper-resolver.cc
++++ b/gcc/cp/mapper-resolver.cc
+@@ -25,6 +25,7 @@ along with GCC; see the file COPYING3.  If not see
+ #define INCLUDE_VECTOR
+ #define INCLUDE_ALGORITHM
+ #define INCLUDE_MAP
++#define INCLUDE_MEMORY
+ #include "system.h"
+ 
+ // We don't want or need to be aware of networking
+diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc
+index 753963a4b246..8bb22c2b305a 100644
+--- a/gcc/cp/module.cc
++++ b/gcc/cp/module.cc
+@@ -206,6 +206,7 @@ Classes used:
+ 
+ #define _DEFAULT_SOURCE 1 /* To get TZ field of struct tm, if available.  */
+ #include "config.h"
++#define INCLUDE_MEMORY
+ #define INCLUDE_STRING
+ #define INCLUDE_VECTOR
+ #include "system.h"
+diff --git a/libcc1/libcc1plugin.cc b/libcc1/libcc1plugin.cc
+index 12ab5a57c8dd..bdd0bdabe77f 100644
+--- a/libcc1/libcc1plugin.cc
++++ b/libcc1/libcc1plugin.cc
+@@ -31,6 +31,7 @@
+ #undef PACKAGE_TARNAME
+ #undef PACKAGE_VERSION
+ 
++#define INCLUDE_MEMORY
+ #include "gcc-plugin.h"
+ #include "system.h"
+ #include "coretypes.h"
+diff --git a/libcc1/libcp1plugin.cc b/libcc1/libcp1plugin.cc
+index 83dab7f58b11..e2d5039a0a1f 100644
+--- a/libcc1/libcp1plugin.cc
++++ b/libcc1/libcp1plugin.cc
+@@ -32,6 +32,7 @@
+ #undef PACKAGE_TARNAME
+ #undef PACKAGE_VERSION
+ 
++#define INCLUDE_MEMORY
+ #include "gcc-plugin.h"
+ #include "system.h"
+ #include "coretypes.h"
diff --git a/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch b/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
new file mode 100644
index 000000000000..89bd053d6d04
--- /dev/null
+++ b/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
@@ -0,0 +1,115 @@
+From 49d508065bdd36fb1a9b6aad9666b1edb5e06474 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <siarheit@google.com>
+Date: Mon, 27 Jun 2022 23:42:44 +0100
+Subject: [PATCH] jit: avoid calloc() poisoning on musl [PR106102]
+
+On musl <pthread.h> uses calloc() (via <sched.h>). jit/ includes
+it directly and exposes use of poisoned calloc():
+
+    /build/build/./prev-gcc/xg++ ... ../../gcc-13-20220626/gcc/jit/jit-playback.cc
+    make[3]: *** [Makefile:1143: jit/libgccjit.o] Error 1
+    make[3]: *** Waiting for unfinished jobs....
+    In file included from /<<NIX>>/musl-1.2.3-dev/include/pthread.h:30,
+                     from ../../gcc-13-20220626/gcc/jit/jit-playback.cc:44:
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:84:7: error: attempt to use poisoned "calloc"
+       84 | void *calloc(size_t, size_t);
+          |       ^
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:124:36: error: attempt to use poisoned "calloc"
+      124 | #define CPU_ALLOC(n) ((cpu_set_t *)calloc(1,CPU_ALLOC_SIZE(n)))
+          |                                    ^
+
+The change moves <pthread.h> inclusion to "system.h" under new
+INCLUDE_PTHREAD_H guard and uses this mechanism in libgccjit.
+
+gcc/
+
+	PR c++/106102
+	* system.h: Introduce INCLUDE_PTHREAD_H macros to include <pthread.h>.
+
+gcc/jit/
+
+	PR c++/106102
+	* jit-playback.cc: Include <pthread.h> via "system.h" to avoid calloc()
+	poisoning.
+	* jit-recording.cc: Ditto.
+	* libgccjit.cc: Ditto.
+---
+ gcc/jit/jit-playback.cc  | 3 +--
+ gcc/jit/jit-recording.cc | 2 +-
+ gcc/jit/libgccjit.cc     | 2 +-
+ gcc/system.h             | 4 ++++
+ 4 files changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/gcc/jit/jit-playback.cc b/gcc/jit/jit-playback.cc
+index 6be6bdf8dea5..79714132b91a 100644
+--- a/gcc/jit/jit-playback.cc
++++ b/gcc/jit/jit-playback.cc
+@@ -19,6 +19,7 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "target.h"
+@@ -41,8 +42,6 @@ along with GCC; see the file COPYING3.  If not see
+ #include "diagnostic.h"
+ #include "stmt.h"
+ 
+-#include <pthread.h>
+-
+ #include "jit-playback.h"
+ #include "jit-result.h"
+ #include "jit-builtins.h"
+diff --git a/gcc/jit/jit-recording.cc b/gcc/jit/jit-recording.cc
+index 697dee66e733..f78daed2d71a 100644
+--- a/gcc/jit/jit-recording.cc
++++ b/gcc/jit/jit-recording.cc
+@@ -19,13 +19,13 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "tm.h"
+ #include "pretty-print.h"
+ #include "toplev.h"
+ 
+-#include <pthread.h>
+ 
+ #include "jit-builtins.h"
+ #include "jit-recording.h"
+diff --git a/gcc/jit/libgccjit.cc b/gcc/jit/libgccjit.cc
+index 0e76097b4bac..ca862662777e 100644
+--- a/gcc/jit/libgccjit.cc
++++ b/gcc/jit/libgccjit.cc
+@@ -19,12 +19,12 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "timevar.h"
+ #include "typed-splay-tree.h"
+ #include "cppbuiltin.h"
+-#include <pthread.h>
+ 
+ #include "libgccjit.h"
+ #include "jit-recording.h"
+diff --git a/gcc/system.h b/gcc/system.h
+index 67158b70c789..f8d42ff68150 100644
+--- a/gcc/system.h
++++ b/gcc/system.h
+@@ -753,6 +753,10 @@ extern int vsnprintf (char *, size_t, const char *, va_list);
+ #endif
+ #endif
+ 
++#ifdef INCLUDE_PTHREAD_H
++#include <pthread.h>
++#endif
++
+ #ifdef INCLUDE_ISL
+ #ifdef HAVE_isl
+ #include <isl/options.h>
diff --git a/srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch b/srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch
new file mode 100644
index 000000000000..044a4fc29514
--- /dev/null
+++ b/srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch
@@ -0,0 +1,32 @@
+From f35d65517a59565758107c5b1a51a5fa382f8d1a Mon Sep 17 00:00:00 2001
+From: Ian Lance Taylor <iant@golang.org>
+Date: Tue, 12 Jul 2022 19:42:43 -0700
+Subject: [PATCH] libgo: don't include <linux/fs.h> when building
+ gen-sysinfo.go
+
+Removing this doesn't change anything at least with glibc 2.33.
+The include was added in https://go.dev/cl/6100049 but it's not
+clear why.
+
+Fixes PR go/106266
+
+Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/417294
+---
+ gcc/go/gofrontend/MERGE | 2 +-
+ libgo/sysinfo.c         | 3 ---
+ 2 files changed, 1 insertion(+), 4 deletions(-)
+
+diff --git a/libgo/sysinfo.c b/libgo/sysinfo.c
+index a4259c02ded4..fc0210992faa 100644
+--- a/libgo/sysinfo.c
++++ b/libgo/sysinfo.c
+@@ -158,9 +158,6 @@
+ #if defined(HAVE_LINUX_ETHER_H)
+ #include <linux/ether.h>
+ #endif
+-#if defined(HAVE_LINUX_FS_H)
+-#include <linux/fs.h>
+-#endif
+ #if defined(HAVE_LINUX_REBOOT_H)
+ #include <linux/reboot.h>
+ #endif
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..78a2ce35875d 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,9 +3,10 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
  
  #  ifndef _ABIN32
+
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..32ee79e32f0d 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,15 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
+version=12.1.0
+revision=1
 _patchver="${version%pre*}"
 _minorver="${_patchver%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 wrksrc=gcc-${version/pre/_pre}
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +19,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -396,7 +393,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}

From ee6b8986a028be25ace657a8f845649c1cda407d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 03/31] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      |  6 ++--
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..08e35d466a44 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From 6dae02b8633e151218abf166e9dfb022810ce26b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 04/31] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 1a4e1ca3d594..b04268908c2e 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="q66 <daniel@octaforge.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From b24ff7f1859ad7963948e34a244e5679c32360ed Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 05/31] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 3 files changed, 55 insertions(+), 353 deletions(-)
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index ee15983a75b2..ecddb4459d9e 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From 7c5b53a7c88e1d903475f0a96554d0651c81ab61 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 14 Aug 2022 19:29:36 -0700
Subject: [PATCH 06/31] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

glibc 2.35 ane newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..24d02865b164 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -132,6 +132,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -246,6 +247,15 @@ _void_cross_build_glibc() {
 	local tgt=$1
 	local ver=$2
 
+	# glibc 2.35 and newer uses -static-pie by default
+	# which does not work with -no-pie.
+	local oldcflags="${CFLAGS}"
+	local oldcxxflags="${CXXFLAGS}"
+	local oldldflags="${LDFLAGS}"
+	CFLAGS="${CFLAGS//"-fno-PIE"/}"
+	CXXFLAGS="${CXXFLAGS//"-fno-PIE"/}"
+	LDFLAGS="${LDFLAGS//"-no-pie"/}"
+
 	msg_normal "Building glibc for ${tgt}\n"
 
 	mkdir -p ${wrksrc}/glibc_build
@@ -279,6 +289,9 @@ _void_cross_build_glibc() {
 	make ${makejobs}
 	make install_root=${wrksrc}/build_root/usr/${tgt} install
 
+	CFLAGS="${oldcflags}"
+	CXXFLAGS="${oldcxxflags}"
+	LDFLAGS="${oldldflags}"
 	touch ${wrksrc}/.glibc_build_done
 }
 

From 2c153325726627c263014641dc46a46738c8bea0 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:08:52 -0700
Subject: [PATCH 07/31] openssh: suppress werror on gcc12

---
 srcpkgs/openssh/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/openssh/template b/srcpkgs/openssh/template
index 02a2dec35f42..6e8e343a9dca 100644
--- a/srcpkgs/openssh/template
+++ b/srcpkgs/openssh/template
@@ -40,7 +40,7 @@ if [ "$build_option_ldns" -a -z "$build_option_ssl" ]; then
 	broken="option 'ldns' requires option 'ssl'"
 fi
 
-CFLAGS="-Wno-format-truncation -Wno-stringop-truncation"
+CFLAGS="-Wno-format-truncation -Wno-stringop-truncation -Wno-error=maybe-uninitialized"
 
 case $XBPS_TARGET_MACHINE in
 	i686-musl)

From b84773d94e358c1bf19040e5fb2721e4b7bdfead Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:09:31 -0700
Subject: [PATCH 08/31] linux5.18: update dotconfigs for gcc12

---
 srcpkgs/linux5.18/files/x86_64-dotconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/linux5.18/files/x86_64-dotconfig b/srcpkgs/linux5.18/files/x86_64-dotconfig
index 4e73a3195d40..ea6204868e23 100644
--- a/srcpkgs/linux5.18/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.18/files/x86_64-dotconfig
@@ -512,6 +512,7 @@ CONFIG_RETHUNK=y
 CONFIG_CPU_UNRET_ENTRY=y
 CONFIG_CPU_IBPB_ENTRY=y
 CONFIG_CPU_IBRS_ENTRY=y
+CONFIG_SLS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10060,8 +10061,11 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
 # Memory initialization
 #
 CONFIG_INIT_STACK_NONE=y
+# CONFIG_INIT_STACK_ALL_PATTERN is not set
+# CONFIG_INIT_STACK_ALL_ZERO is not set
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
+# CONFIG_ZERO_CALL_USED_REGS is not set
 # end of Memory initialization
 # end of Kernel hardening options
 # end of Security options
@@ -10538,6 +10542,7 @@ CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
 # CONFIG_UBSAN is not set
 CONFIG_HAVE_ARCH_KCSAN=y
+# CONFIG_KCSAN is not set
 # end of Generic Kernel Debugging Instruments
 
 #

From 974b3172e9487389216ecc8eb6340fffe5009d80 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:54 -0700
Subject: [PATCH 09/31] cross-aarch64-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..cb7ae97e7efe 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 649df9f68d856b66c1354c31a34d58e3750f3d9d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:54 -0700
Subject: [PATCH 10/31] cross-aarch64-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..4fa950f334d4 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 531e8140b3d2cbbdbe6229e346520e7b68c27b31 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:54 -0700
Subject: [PATCH 11/31] cross-arm-linux-gnueabi: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..194c0ab774b7 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From d06d6db30c272de8f676e2ac3e645e788fadd425 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 12/31] cross-arm-linux-gnueabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..3f3242b85b07 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 79ef6b622095f02e1388cb828eed110f89dc0718 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 13/31] cross-arm-linux-musleabi: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..b0cdade60a6d 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From d5867172992c89a95e8c43ed7e56a51506cacb8e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 14/31] cross-arm-linux-musleabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..1924be24d483 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 121db5248970e733dd7ad09441e956553c8af8f4 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 15/31] cross-armv7l-linux-gnueabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..a7997d6db937 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 3dfcead2d994a9dcb3513ce9a07c093b4aed77ea Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 16/31] cross-armv7l-linux-musleabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..aaa7040fbfef 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 8e898cc5f129f06d047e280106da5d05fa061117 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 17/31] cross-i686-pc-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..765cf675e95c 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From c718fda35255e71cc0d9e1b58d1946f7aac7724b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 18/31] cross-mips-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-mips-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..26928ba9442d 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 00e10fa236aac44f3a14f248a34abb81cce5c1e1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 19/31] cross-mips-linux-muslhf: update to gcc 12.1.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..fe74faf15d55 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From e2ebbba5aed766e96a3e541940f240dff918ca29 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 20/31] cross-mipsel-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..aa74d0b1acc7 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_musl_version=1.1.24
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 6e5ec8ad73cdd023a119e960d977bd375495dc50 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 21/31] cross-mipsel-linux-muslhf: update to gcc 12.1.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..83ab7f187085 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_musl_version=1.1.24
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From e3becc5504d20fc7fdc016098c3cbc334de04855 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 22/31] cross-powerpc-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..3ab1a4ea40fa 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 11af86bf30c78daf131aff481ad6521ccc642776 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 23/31] cross-powerpc-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..af5586cacc77 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From f0ea5e24a3e1acebedd4f4fb7b8237ce3589c43b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 24/31] cross-powerpc64-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..2604b268046b 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 656de345ead2aa3929aeab98eff7a23023ae178a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 25/31] cross-powerpc64-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 1ebd0fb2048d..c7894721b900 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
@@ -19,12 +19,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From d4dc15d654d44c220b64292c04ac79b2f885104a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 26/31] cross-powerpc64le-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 733f5851da5c..618235468970 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 7f3acc3bb042d459209d4fc263c9df50fa833da5 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 27/31] cross-powerpc64le-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index 76a70aa1d6db..7edf9605e60d 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
@@ -19,12 +19,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 00ac615fb9fcf67e9db70d11a83b9ff37a2dc0ed Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 28/31] cross-powerpcle-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 347b8fcf4f55..cc10b7cbd88b 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 3481bc998e7eabaef799d5c2d32b01340ba95a88 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 29/31] cross-powerpcle-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index ec9324ddaa99..1d38a3fa3559 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From b0479063f3ac513a5b71495f621589aad4dbdf46 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 30/31] cross-x86_64-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 0078fbe7224b..9f740b00a80c 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 6fbe13ade2aba0e4caed8fe5fb55864d1af806d0 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 31/31] cross-x86_64-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..19e13f3818e9 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
@@ -17,12 +17,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.1.0
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (25 preceding siblings ...)
  2022-08-15 21:48 ` [PR PATCH] [Updated] " oreo639
@ 2022-08-16  1:01 ` oreo639
  2022-08-16  1:55 ` oreo639
                   ` (237 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-08-16  1:01 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2785 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.1.0
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.1.0

This PR depends on: https://github.com/void-linux/void-packages/pull/32330

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

Also, keep in mind that the libgo musl patch here will need to be updated once musl is updated:
https://github.com/void-linux/void-packages/pull/34902/files#diff-1f42a95b93c9550178ff1fbccbef2f47a72711df15c24c9472e2550076978129R163-R176

This is the updated patch for reference:
https://github.com/alpinelinux/aports/blob/8acb21b8ee881e7ab1c812d9a66a17d2501b8730/main/gcc/0049-libgo-adjust-name-of-union-in-sigevent-struct.patch

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Known packages that need to be fixed for glibc 2.36:
- [ ] samba
- [ ] qemu
- [ ] llvm

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 107549 bytes --]

From d43d22b8efb8a2e159548f350a4ef6b00fddac1f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 01/32] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 15 +++--
 3 files changed, 28 insertions(+), 113 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..4bdaee582d71 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkg-config"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -44,6 +45,12 @@ do_configure() {
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	case "$XBPS_TARGET_MACHINE" in
+		*-musl)
+			conf+=" --disable-gprofng"
+			;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"

From f1316eeb925f76a224a21acae2dcf019b264dc2c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 02/32] gcc: update to 12.1.0.

---
 common/shlibs                                 |  10 +-
 srcpkgs/gcc/files/gccgo-musl.patch            |  74 +++--------
 srcpkgs/gcc/files/libgnarl-musl.patch         |  18 +--
 srcpkgs/gcc/files/libssp-musl.patch           |  10 +-
 ...c21f3f5726823e19728fdd1571a14aae0fb3.patch | 105 ++++++++++++++++
 ...08065bdd36fb1a9b6aad9666b1edb5e06474.patch | 115 ++++++++++++++++++
 ...65517a59565758107c5b1a51a5fa382f8d1a.patch |  32 +++++
 srcpkgs/gcc/patches/libffi_gnulinux.patch     |  11 --
 .../gcc/patches/libgcc-ibm128-no-tag.patch    |  10 +-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |   3 +-
 srcpkgs/gcc/template                          |  25 ++--
 11 files changed, 305 insertions(+), 108 deletions(-)
 create mode 100644 srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
 create mode 100644 srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
 create mode 100644 srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index ed75e4dcb36b..efc9db862ed5 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.1.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.34 perl-5.34.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -849,8 +849,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.1.0_1
+libgnat-12.so libada-12.1.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1701,8 +1701,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.1.0_1
+libasan.so.8 libsanitizer-12.1.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..632ef951097b 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,17 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ a/libgo/go/runtime/os_linux.go
+@@ -363,9 +363,9 @@
+ 
+ 	var timerid int32
+ 	var sevp _sigevent
+-	sevp.sigev_notify = _SIGEV_THREAD_ID
++	sevp.sigev_notify = 4
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.sigev_notify_function))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch b/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
new file mode 100644
index 000000000000..00929202a503
--- /dev/null
+++ b/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
@@ -0,0 +1,105 @@
+From 3b21c21f3f5726823e19728fdd1571a14aae0fb3 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <siarheit@google.com>
+Date: Mon, 27 Jun 2022 13:27:24 +0100
+Subject: [PATCH] c++: avoid <memory> poisoning on musl [PR106102]
+
+On musl <pthread.h> uses calloc() (via <sched.h>). <memory> includes
+it indirectly and exposes use of poisoned calloc() when module code
+is built:
+
+    /build/build/./prev-gcc/xg++ ... ../../gcc-13-20220626/gcc/cp/mapper-resolver.cc
+        In file included from /<<NIX>>/musl-1.2.3-dev/include/pthread.h:30,
+                 from /build/build/prev-x86_64-unknown-linux-musl/libstdc++-v3/include/x86_64-unknown-linux-musl/bits/gthr-default.h:35,
+                 ....
+                 from /build/build/prev-x86_64-unknown-linux-musl/libstdc++-v3/include/memory:77,
+                 from ../../gcc-13-20220626/gcc/../libcody/cody.hh:24,
+                 from ../../gcc-13-20220626/gcc/cp/../../c++tools/resolver.h:25,
+                 from ../../gcc-13-20220626/gcc/cp/../../c++tools/resolver.cc:23,
+                 from ../../gcc-13-20220626/gcc/cp/mapper-resolver.cc:32:
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:84:7: error: attempt to use poisoned "calloc"
+       84 | void *calloc(size_t, size_t);
+          |       ^
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:124:36: error: attempt to use poisoned "calloc"
+      124 | #define CPU_ALLOC(n) ((cpu_set_t *)calloc(1,CPU_ALLOC_SIZE(n)))
+          |                                    ^
+
+gcc/cp/
+
+	PR c++/106102
+	* mapper-client.cc: Include <memory> via "system.h".
+	* mapper-resolver.cc: Ditto.
+	* module.cc: Ditto.
+
+libcc1/
+
+	PR c++/106102
+	* libcc1plugin.cc: Include <memory> via "system.h".
+	* libcp1plugin.cc: Ditto.
+---
+ gcc/cp/mapper-client.cc   | 1 +
+ gcc/cp/mapper-resolver.cc | 1 +
+ gcc/cp/module.cc          | 1 +
+ libcc1/libcc1plugin.cc    | 1 +
+ libcc1/libcp1plugin.cc    | 1 +
+ 5 files changed, 5 insertions(+)
+
+diff --git a/gcc/cp/mapper-client.cc b/gcc/cp/mapper-client.cc
+index 8603a886a099..fe9544b5ba43 100644
+--- a/gcc/cp/mapper-client.cc
++++ b/gcc/cp/mapper-client.cc
+@@ -27,6 +27,7 @@ along with GCC; see the file COPYING3.  If not see
+ #define INCLUDE_STRING
+ #define INCLUDE_VECTOR
+ #define INCLUDE_MAP
++#define INCLUDE_MEMORY
+ #include "system.h"
+ 
+ #include "line-map.h"
+diff --git a/gcc/cp/mapper-resolver.cc b/gcc/cp/mapper-resolver.cc
+index e3d29fb5ada1..e70d1b4ae2ca 100644
+--- a/gcc/cp/mapper-resolver.cc
++++ b/gcc/cp/mapper-resolver.cc
+@@ -25,6 +25,7 @@ along with GCC; see the file COPYING3.  If not see
+ #define INCLUDE_VECTOR
+ #define INCLUDE_ALGORITHM
+ #define INCLUDE_MAP
++#define INCLUDE_MEMORY
+ #include "system.h"
+ 
+ // We don't want or need to be aware of networking
+diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc
+index 753963a4b246..8bb22c2b305a 100644
+--- a/gcc/cp/module.cc
++++ b/gcc/cp/module.cc
+@@ -206,6 +206,7 @@ Classes used:
+ 
+ #define _DEFAULT_SOURCE 1 /* To get TZ field of struct tm, if available.  */
+ #include "config.h"
++#define INCLUDE_MEMORY
+ #define INCLUDE_STRING
+ #define INCLUDE_VECTOR
+ #include "system.h"
+diff --git a/libcc1/libcc1plugin.cc b/libcc1/libcc1plugin.cc
+index 12ab5a57c8dd..bdd0bdabe77f 100644
+--- a/libcc1/libcc1plugin.cc
++++ b/libcc1/libcc1plugin.cc
+@@ -31,6 +31,7 @@
+ #undef PACKAGE_TARNAME
+ #undef PACKAGE_VERSION
+ 
++#define INCLUDE_MEMORY
+ #include "gcc-plugin.h"
+ #include "system.h"
+ #include "coretypes.h"
+diff --git a/libcc1/libcp1plugin.cc b/libcc1/libcp1plugin.cc
+index 83dab7f58b11..e2d5039a0a1f 100644
+--- a/libcc1/libcp1plugin.cc
++++ b/libcc1/libcp1plugin.cc
+@@ -32,6 +32,7 @@
+ #undef PACKAGE_TARNAME
+ #undef PACKAGE_VERSION
+ 
++#define INCLUDE_MEMORY
+ #include "gcc-plugin.h"
+ #include "system.h"
+ #include "coretypes.h"
diff --git a/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch b/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
new file mode 100644
index 000000000000..89bd053d6d04
--- /dev/null
+++ b/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
@@ -0,0 +1,115 @@
+From 49d508065bdd36fb1a9b6aad9666b1edb5e06474 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <siarheit@google.com>
+Date: Mon, 27 Jun 2022 23:42:44 +0100
+Subject: [PATCH] jit: avoid calloc() poisoning on musl [PR106102]
+
+On musl <pthread.h> uses calloc() (via <sched.h>). jit/ includes
+it directly and exposes use of poisoned calloc():
+
+    /build/build/./prev-gcc/xg++ ... ../../gcc-13-20220626/gcc/jit/jit-playback.cc
+    make[3]: *** [Makefile:1143: jit/libgccjit.o] Error 1
+    make[3]: *** Waiting for unfinished jobs....
+    In file included from /<<NIX>>/musl-1.2.3-dev/include/pthread.h:30,
+                     from ../../gcc-13-20220626/gcc/jit/jit-playback.cc:44:
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:84:7: error: attempt to use poisoned "calloc"
+       84 | void *calloc(size_t, size_t);
+          |       ^
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:124:36: error: attempt to use poisoned "calloc"
+      124 | #define CPU_ALLOC(n) ((cpu_set_t *)calloc(1,CPU_ALLOC_SIZE(n)))
+          |                                    ^
+
+The change moves <pthread.h> inclusion to "system.h" under new
+INCLUDE_PTHREAD_H guard and uses this mechanism in libgccjit.
+
+gcc/
+
+	PR c++/106102
+	* system.h: Introduce INCLUDE_PTHREAD_H macros to include <pthread.h>.
+
+gcc/jit/
+
+	PR c++/106102
+	* jit-playback.cc: Include <pthread.h> via "system.h" to avoid calloc()
+	poisoning.
+	* jit-recording.cc: Ditto.
+	* libgccjit.cc: Ditto.
+---
+ gcc/jit/jit-playback.cc  | 3 +--
+ gcc/jit/jit-recording.cc | 2 +-
+ gcc/jit/libgccjit.cc     | 2 +-
+ gcc/system.h             | 4 ++++
+ 4 files changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/gcc/jit/jit-playback.cc b/gcc/jit/jit-playback.cc
+index 6be6bdf8dea5..79714132b91a 100644
+--- a/gcc/jit/jit-playback.cc
++++ b/gcc/jit/jit-playback.cc
+@@ -19,6 +19,7 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "target.h"
+@@ -41,8 +42,6 @@ along with GCC; see the file COPYING3.  If not see
+ #include "diagnostic.h"
+ #include "stmt.h"
+ 
+-#include <pthread.h>
+-
+ #include "jit-playback.h"
+ #include "jit-result.h"
+ #include "jit-builtins.h"
+diff --git a/gcc/jit/jit-recording.cc b/gcc/jit/jit-recording.cc
+index 697dee66e733..f78daed2d71a 100644
+--- a/gcc/jit/jit-recording.cc
++++ b/gcc/jit/jit-recording.cc
+@@ -19,13 +19,13 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "tm.h"
+ #include "pretty-print.h"
+ #include "toplev.h"
+ 
+-#include <pthread.h>
+ 
+ #include "jit-builtins.h"
+ #include "jit-recording.h"
+diff --git a/gcc/jit/libgccjit.cc b/gcc/jit/libgccjit.cc
+index 0e76097b4bac..ca862662777e 100644
+--- a/gcc/jit/libgccjit.cc
++++ b/gcc/jit/libgccjit.cc
+@@ -19,12 +19,12 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "timevar.h"
+ #include "typed-splay-tree.h"
+ #include "cppbuiltin.h"
+-#include <pthread.h>
+ 
+ #include "libgccjit.h"
+ #include "jit-recording.h"
+diff --git a/gcc/system.h b/gcc/system.h
+index 67158b70c789..f8d42ff68150 100644
+--- a/gcc/system.h
++++ b/gcc/system.h
+@@ -753,6 +753,10 @@ extern int vsnprintf (char *, size_t, const char *, va_list);
+ #endif
+ #endif
+ 
++#ifdef INCLUDE_PTHREAD_H
++#include <pthread.h>
++#endif
++
+ #ifdef INCLUDE_ISL
+ #ifdef HAVE_isl
+ #include <isl/options.h>
diff --git a/srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch b/srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch
new file mode 100644
index 000000000000..044a4fc29514
--- /dev/null
+++ b/srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch
@@ -0,0 +1,32 @@
+From f35d65517a59565758107c5b1a51a5fa382f8d1a Mon Sep 17 00:00:00 2001
+From: Ian Lance Taylor <iant@golang.org>
+Date: Tue, 12 Jul 2022 19:42:43 -0700
+Subject: [PATCH] libgo: don't include <linux/fs.h> when building
+ gen-sysinfo.go
+
+Removing this doesn't change anything at least with glibc 2.33.
+The include was added in https://go.dev/cl/6100049 but it's not
+clear why.
+
+Fixes PR go/106266
+
+Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/417294
+---
+ gcc/go/gofrontend/MERGE | 2 +-
+ libgo/sysinfo.c         | 3 ---
+ 2 files changed, 1 insertion(+), 4 deletions(-)
+
+diff --git a/libgo/sysinfo.c b/libgo/sysinfo.c
+index a4259c02ded4..fc0210992faa 100644
+--- a/libgo/sysinfo.c
++++ b/libgo/sysinfo.c
+@@ -158,9 +158,6 @@
+ #if defined(HAVE_LINUX_ETHER_H)
+ #include <linux/ether.h>
+ #endif
+-#if defined(HAVE_LINUX_FS_H)
+-#include <linux/fs.h>
+-#endif
+ #if defined(HAVE_LINUX_REBOOT_H)
+ #include <linux/reboot.h>
+ #endif
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..78a2ce35875d 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,9 +3,10 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
  
  #  ifndef _ABIN32
+
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..32ee79e32f0d 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,15 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
+version=12.1.0
+revision=1
 _patchver="${version%pre*}"
 _minorver="${_patchver%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 wrksrc=gcc-${version/pre/_pre}
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +19,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -396,7 +393,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}

From bc0e683e454ca96f39af05770c6d67ef98b8799a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 03/32] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      |  6 ++--
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..08e35d466a44 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From 67880df64a47418e98ff1d6133cad685d29e2422 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 04/32] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 1a4e1ca3d594..b04268908c2e 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="q66 <daniel@octaforge.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From 7df6e2b61fe218743ab34ee36b1b74d054fd62d9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 05/32] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 3 files changed, 55 insertions(+), 353 deletions(-)
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index efc9db862ed5..30e2cdf19e72 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From 5f2621c708dd78b45111300bbe43e7bc518b9a38 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 14 Aug 2022 19:29:36 -0700
Subject: [PATCH 06/32] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

glibc 2.35 ane newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..24d02865b164 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -132,6 +132,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -246,6 +247,15 @@ _void_cross_build_glibc() {
 	local tgt=$1
 	local ver=$2
 
+	# glibc 2.35 and newer uses -static-pie by default
+	# which does not work with -no-pie.
+	local oldcflags="${CFLAGS}"
+	local oldcxxflags="${CXXFLAGS}"
+	local oldldflags="${LDFLAGS}"
+	CFLAGS="${CFLAGS//"-fno-PIE"/}"
+	CXXFLAGS="${CXXFLAGS//"-fno-PIE"/}"
+	LDFLAGS="${LDFLAGS//"-no-pie"/}"
+
 	msg_normal "Building glibc for ${tgt}\n"
 
 	mkdir -p ${wrksrc}/glibc_build
@@ -279,6 +289,9 @@ _void_cross_build_glibc() {
 	make ${makejobs}
 	make install_root=${wrksrc}/build_root/usr/${tgt} install
 
+	CFLAGS="${oldcflags}"
+	CXXFLAGS="${oldcxxflags}"
+	LDFLAGS="${oldldflags}"
 	touch ${wrksrc}/.glibc_build_done
 }
 

From 03e527508d9b81aa7cc14127d6b3d3958f424f3c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:08:52 -0700
Subject: [PATCH 07/32] openssh: suppress werror on gcc12

---
 srcpkgs/openssh/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/openssh/template b/srcpkgs/openssh/template
index 02a2dec35f42..6e8e343a9dca 100644
--- a/srcpkgs/openssh/template
+++ b/srcpkgs/openssh/template
@@ -40,7 +40,7 @@ if [ "$build_option_ldns" -a -z "$build_option_ssl" ]; then
 	broken="option 'ldns' requires option 'ssl'"
 fi
 
-CFLAGS="-Wno-format-truncation -Wno-stringop-truncation"
+CFLAGS="-Wno-format-truncation -Wno-stringop-truncation -Wno-error=maybe-uninitialized"
 
 case $XBPS_TARGET_MACHINE in
 	i686-musl)

From 12197219377ec08f723d84f6e8ee7cabf16a083e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:09:31 -0700
Subject: [PATCH 08/32] linux5.18: update dotconfigs for gcc12

---
 srcpkgs/linux5.18/files/x86_64-dotconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/linux5.18/files/x86_64-dotconfig b/srcpkgs/linux5.18/files/x86_64-dotconfig
index 4e73a3195d40..ea6204868e23 100644
--- a/srcpkgs/linux5.18/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.18/files/x86_64-dotconfig
@@ -512,6 +512,7 @@ CONFIG_RETHUNK=y
 CONFIG_CPU_UNRET_ENTRY=y
 CONFIG_CPU_IBPB_ENTRY=y
 CONFIG_CPU_IBRS_ENTRY=y
+CONFIG_SLS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10060,8 +10061,11 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
 # Memory initialization
 #
 CONFIG_INIT_STACK_NONE=y
+# CONFIG_INIT_STACK_ALL_PATTERN is not set
+# CONFIG_INIT_STACK_ALL_ZERO is not set
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
+# CONFIG_ZERO_CALL_USED_REGS is not set
 # end of Memory initialization
 # end of Kernel hardening options
 # end of Security options
@@ -10538,6 +10542,7 @@ CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
 # CONFIG_UBSAN is not set
 CONFIG_HAVE_ARCH_KCSAN=y
+# CONFIG_KCSAN is not set
 # end of Generic Kernel Debugging Instruments
 
 #

From fef1b1bc80f04440917d5b8445dbbfd482416cae Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 18:00:42 -0700
Subject: [PATCH 09/32] xf86-video-vmware: fix build on gcc12

---
 ...183b3395333d5d4c73e25c2d011748f15eda.patch | 30 +++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch

diff --git a/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch b/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch
new file mode 100644
index 000000000000..ff839f16e628
--- /dev/null
+++ b/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch
@@ -0,0 +1,30 @@
+From 77b8183b3395333d5d4c73e25c2d011748f15eda Mon Sep 17 00:00:00 2001
+From: Rudi Heitbaum <rudi@heitbaum.com>
+Date: Sun, 8 May 2022 03:00:10 +0000
+Subject: [PATCH] vmwgfx: fix missing array notation
+
+ Fixes error identified by gcc-12.1.0 compiler
+
+make
+  CC       libvmwgfx_la-vmwgfx_tex_video.lo
+vmwgfx_tex_video.c: In function 'stop_video':
+vmwgfx_tex_video.c:240:20: error: the comparison will always evaluate as 'true' for the address of 'yuv' will never be NULL [-Werror=address]
+  240 |                if (priv->yuv[i]) {
+      |                    ^~~~
+---
+ vmwgfx/vmwgfx_tex_video.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/vmwgfx/vmwgfx_tex_video.c b/vmwgfx/vmwgfx_tex_video.c
+index acc2b56..480a5f1 100644
+--- a/vmwgfx/vmwgfx_tex_video.c
++++ b/vmwgfx/vmwgfx_tex_video.c
+@@ -237,7 +237,7 @@ stop_video(ScrnInfoPtr pScrn, pointer data, Bool shutdown)
+ 
+        for (i=0; i<3; ++i) {
+ 	   for (j=0; j<2; ++j) {
+-	       if (priv->yuv[i]) {
++	       if (priv->yuv[j][i]) {
+ 		   xa_surface_destroy(priv->yuv[j][i]);
+ 		   priv->yuv[j][i] = NULL;
+ 	       }

From a612f053564d94c86e37e9389b9f1f8903b1d17c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:54 -0700
Subject: [PATCH 10/32] cross-aarch64-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..cb7ae97e7efe 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 20ef0feacf9962b259e26d92887008447e2ec8bd Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:54 -0700
Subject: [PATCH 11/32] cross-aarch64-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..4fa950f334d4 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From dc889ad15d7fbab2e8515e68421d9492ff9b7ced Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:54 -0700
Subject: [PATCH 12/32] cross-arm-linux-gnueabi: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..194c0ab774b7 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 01cd98e97051db85986fd66c47ccb3cd453b8797 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 13/32] cross-arm-linux-gnueabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..3f3242b85b07 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From e23f1da02de6c81179797752136aa0d44b7c6ca2 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 14/32] cross-arm-linux-musleabi: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..b0cdade60a6d 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 9ba898bf23151ab922f46afe8fdbc05d2e7a8843 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 15/32] cross-arm-linux-musleabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..1924be24d483 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 98ed6a28f6b26b4e855436516c412c4dcd84e88d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 16/32] cross-armv7l-linux-gnueabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..a7997d6db937 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From c1685fa8c1b38c6468bd5c2c5a3f0c37ded0449d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 17/32] cross-armv7l-linux-musleabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..aaa7040fbfef 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From f7f27e3c27237f4537f35eb73a7c071733f59883 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 18/32] cross-i686-pc-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..765cf675e95c 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From af52a5b33df22da4fb5490bed0deaf4a18163307 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 19/32] cross-mips-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-mips-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..26928ba9442d 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From ee9f4eb1095ac1ae29ef3a307be48ca067482cff Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 20/32] cross-mips-linux-muslhf: update to gcc 12.1.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..fe74faf15d55 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 50d2be49dffe234982adcfb57794ed7121b2b95f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 21/32] cross-mipsel-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..aa74d0b1acc7 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_musl_version=1.1.24
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 60fe3b4f16b616b1857cc587bd702e01d42a56b9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 22/32] cross-mipsel-linux-muslhf: update to gcc 12.1.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..83ab7f187085 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_musl_version=1.1.24
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 9fef40535290af17477027992cedff660a8a71ab Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 23/32] cross-powerpc-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..3ab1a4ea40fa 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 86349d103869515b71da2d2bf941685f8b003a87 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 24/32] cross-powerpc-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..af5586cacc77 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 255eb766ac9d6eed0a23775f788d5f624219e819 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 25/32] cross-powerpc64-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..2604b268046b 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From fbbff4661c57affa3c164f1f324513b6df3629b4 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 26/32] cross-powerpc64-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 1ebd0fb2048d..c7894721b900 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
@@ -19,12 +19,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From faf3ac9a9f2981f31d52a4944dd54970c833d7dd Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 27/32] cross-powerpc64le-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 733f5851da5c..618235468970 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 4e392aecd62521d37fa5dfd37964d881433e5bd8 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 28/32] cross-powerpc64le-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index 76a70aa1d6db..7edf9605e60d 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
@@ -19,12 +19,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 7db321100d2c62a6d5cce4d18d8e842bc7576745 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 29/32] cross-powerpcle-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 347b8fcf4f55..cc10b7cbd88b 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From bcff1be7ef65c5f9e6af2bc958519db3d2ae1017 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 30/32] cross-powerpcle-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index ec9324ddaa99..1d38a3fa3559 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 653e1b8a2485b6e625c3829b906a5eeb03e1b4c0 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 31/32] cross-x86_64-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 0078fbe7224b..9f740b00a80c 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From d3270492eb7f7f7819c49da860c767cf8b19c068 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 32/32] cross-x86_64-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..19e13f3818e9 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
@@ -17,12 +17,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.1.0
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (26 preceding siblings ...)
  2022-08-16  1:01 ` oreo639
@ 2022-08-16  1:55 ` oreo639
  2022-08-18 23:23 ` oreo639
                   ` (236 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-08-16  1:55 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2785 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.1.0
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.1.0

This PR depends on: https://github.com/void-linux/void-packages/pull/32330

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

Also, keep in mind that the libgo musl patch here will need to be updated once musl is updated:
https://github.com/void-linux/void-packages/pull/34902/files#diff-1f42a95b93c9550178ff1fbccbef2f47a72711df15c24c9472e2550076978129R163-R176

This is the updated patch for reference:
https://github.com/alpinelinux/aports/blob/8acb21b8ee881e7ab1c812d9a66a17d2501b8730/main/gcc/0049-libgo-adjust-name-of-union-in-sigevent-struct.patch

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Known packages that need to be fixed for glibc 2.36:
- [ ] samba
- [ ] qemu
- [ ] llvm

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 108684 bytes --]

From d43d22b8efb8a2e159548f350a4ef6b00fddac1f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 01/33] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 15 +++--
 3 files changed, 28 insertions(+), 113 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..4bdaee582d71 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkg-config"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -44,6 +45,12 @@ do_configure() {
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	case "$XBPS_TARGET_MACHINE" in
+		*-musl)
+			conf+=" --disable-gprofng"
+			;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"

From f1316eeb925f76a224a21acae2dcf019b264dc2c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 02/33] gcc: update to 12.1.0.

---
 common/shlibs                                 |  10 +-
 srcpkgs/gcc/files/gccgo-musl.patch            |  74 +++--------
 srcpkgs/gcc/files/libgnarl-musl.patch         |  18 +--
 srcpkgs/gcc/files/libssp-musl.patch           |  10 +-
 ...c21f3f5726823e19728fdd1571a14aae0fb3.patch | 105 ++++++++++++++++
 ...08065bdd36fb1a9b6aad9666b1edb5e06474.patch | 115 ++++++++++++++++++
 ...65517a59565758107c5b1a51a5fa382f8d1a.patch |  32 +++++
 srcpkgs/gcc/patches/libffi_gnulinux.patch     |  11 --
 .../gcc/patches/libgcc-ibm128-no-tag.patch    |  10 +-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |   3 +-
 srcpkgs/gcc/template                          |  25 ++--
 11 files changed, 305 insertions(+), 108 deletions(-)
 create mode 100644 srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
 create mode 100644 srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
 create mode 100644 srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index ed75e4dcb36b..efc9db862ed5 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.1.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.34 perl-5.34.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -849,8 +849,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.1.0_1
+libgnat-12.so libada-12.1.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1701,8 +1701,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.1.0_1
+libasan.so.8 libsanitizer-12.1.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..632ef951097b 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,17 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ a/libgo/go/runtime/os_linux.go
+@@ -363,9 +363,9 @@
+ 
+ 	var timerid int32
+ 	var sevp _sigevent
+-	sevp.sigev_notify = _SIGEV_THREAD_ID
++	sevp.sigev_notify = 4
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.sigev_notify_function))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch b/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
new file mode 100644
index 000000000000..00929202a503
--- /dev/null
+++ b/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
@@ -0,0 +1,105 @@
+From 3b21c21f3f5726823e19728fdd1571a14aae0fb3 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <siarheit@google.com>
+Date: Mon, 27 Jun 2022 13:27:24 +0100
+Subject: [PATCH] c++: avoid <memory> poisoning on musl [PR106102]
+
+On musl <pthread.h> uses calloc() (via <sched.h>). <memory> includes
+it indirectly and exposes use of poisoned calloc() when module code
+is built:
+
+    /build/build/./prev-gcc/xg++ ... ../../gcc-13-20220626/gcc/cp/mapper-resolver.cc
+        In file included from /<<NIX>>/musl-1.2.3-dev/include/pthread.h:30,
+                 from /build/build/prev-x86_64-unknown-linux-musl/libstdc++-v3/include/x86_64-unknown-linux-musl/bits/gthr-default.h:35,
+                 ....
+                 from /build/build/prev-x86_64-unknown-linux-musl/libstdc++-v3/include/memory:77,
+                 from ../../gcc-13-20220626/gcc/../libcody/cody.hh:24,
+                 from ../../gcc-13-20220626/gcc/cp/../../c++tools/resolver.h:25,
+                 from ../../gcc-13-20220626/gcc/cp/../../c++tools/resolver.cc:23,
+                 from ../../gcc-13-20220626/gcc/cp/mapper-resolver.cc:32:
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:84:7: error: attempt to use poisoned "calloc"
+       84 | void *calloc(size_t, size_t);
+          |       ^
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:124:36: error: attempt to use poisoned "calloc"
+      124 | #define CPU_ALLOC(n) ((cpu_set_t *)calloc(1,CPU_ALLOC_SIZE(n)))
+          |                                    ^
+
+gcc/cp/
+
+	PR c++/106102
+	* mapper-client.cc: Include <memory> via "system.h".
+	* mapper-resolver.cc: Ditto.
+	* module.cc: Ditto.
+
+libcc1/
+
+	PR c++/106102
+	* libcc1plugin.cc: Include <memory> via "system.h".
+	* libcp1plugin.cc: Ditto.
+---
+ gcc/cp/mapper-client.cc   | 1 +
+ gcc/cp/mapper-resolver.cc | 1 +
+ gcc/cp/module.cc          | 1 +
+ libcc1/libcc1plugin.cc    | 1 +
+ libcc1/libcp1plugin.cc    | 1 +
+ 5 files changed, 5 insertions(+)
+
+diff --git a/gcc/cp/mapper-client.cc b/gcc/cp/mapper-client.cc
+index 8603a886a099..fe9544b5ba43 100644
+--- a/gcc/cp/mapper-client.cc
++++ b/gcc/cp/mapper-client.cc
+@@ -27,6 +27,7 @@ along with GCC; see the file COPYING3.  If not see
+ #define INCLUDE_STRING
+ #define INCLUDE_VECTOR
+ #define INCLUDE_MAP
++#define INCLUDE_MEMORY
+ #include "system.h"
+ 
+ #include "line-map.h"
+diff --git a/gcc/cp/mapper-resolver.cc b/gcc/cp/mapper-resolver.cc
+index e3d29fb5ada1..e70d1b4ae2ca 100644
+--- a/gcc/cp/mapper-resolver.cc
++++ b/gcc/cp/mapper-resolver.cc
+@@ -25,6 +25,7 @@ along with GCC; see the file COPYING3.  If not see
+ #define INCLUDE_VECTOR
+ #define INCLUDE_ALGORITHM
+ #define INCLUDE_MAP
++#define INCLUDE_MEMORY
+ #include "system.h"
+ 
+ // We don't want or need to be aware of networking
+diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc
+index 753963a4b246..8bb22c2b305a 100644
+--- a/gcc/cp/module.cc
++++ b/gcc/cp/module.cc
+@@ -206,6 +206,7 @@ Classes used:
+ 
+ #define _DEFAULT_SOURCE 1 /* To get TZ field of struct tm, if available.  */
+ #include "config.h"
++#define INCLUDE_MEMORY
+ #define INCLUDE_STRING
+ #define INCLUDE_VECTOR
+ #include "system.h"
+diff --git a/libcc1/libcc1plugin.cc b/libcc1/libcc1plugin.cc
+index 12ab5a57c8dd..bdd0bdabe77f 100644
+--- a/libcc1/libcc1plugin.cc
++++ b/libcc1/libcc1plugin.cc
+@@ -31,6 +31,7 @@
+ #undef PACKAGE_TARNAME
+ #undef PACKAGE_VERSION
+ 
++#define INCLUDE_MEMORY
+ #include "gcc-plugin.h"
+ #include "system.h"
+ #include "coretypes.h"
+diff --git a/libcc1/libcp1plugin.cc b/libcc1/libcp1plugin.cc
+index 83dab7f58b11..e2d5039a0a1f 100644
+--- a/libcc1/libcp1plugin.cc
++++ b/libcc1/libcp1plugin.cc
+@@ -32,6 +32,7 @@
+ #undef PACKAGE_TARNAME
+ #undef PACKAGE_VERSION
+ 
++#define INCLUDE_MEMORY
+ #include "gcc-plugin.h"
+ #include "system.h"
+ #include "coretypes.h"
diff --git a/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch b/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
new file mode 100644
index 000000000000..89bd053d6d04
--- /dev/null
+++ b/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
@@ -0,0 +1,115 @@
+From 49d508065bdd36fb1a9b6aad9666b1edb5e06474 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <siarheit@google.com>
+Date: Mon, 27 Jun 2022 23:42:44 +0100
+Subject: [PATCH] jit: avoid calloc() poisoning on musl [PR106102]
+
+On musl <pthread.h> uses calloc() (via <sched.h>). jit/ includes
+it directly and exposes use of poisoned calloc():
+
+    /build/build/./prev-gcc/xg++ ... ../../gcc-13-20220626/gcc/jit/jit-playback.cc
+    make[3]: *** [Makefile:1143: jit/libgccjit.o] Error 1
+    make[3]: *** Waiting for unfinished jobs....
+    In file included from /<<NIX>>/musl-1.2.3-dev/include/pthread.h:30,
+                     from ../../gcc-13-20220626/gcc/jit/jit-playback.cc:44:
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:84:7: error: attempt to use poisoned "calloc"
+       84 | void *calloc(size_t, size_t);
+          |       ^
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:124:36: error: attempt to use poisoned "calloc"
+      124 | #define CPU_ALLOC(n) ((cpu_set_t *)calloc(1,CPU_ALLOC_SIZE(n)))
+          |                                    ^
+
+The change moves <pthread.h> inclusion to "system.h" under new
+INCLUDE_PTHREAD_H guard and uses this mechanism in libgccjit.
+
+gcc/
+
+	PR c++/106102
+	* system.h: Introduce INCLUDE_PTHREAD_H macros to include <pthread.h>.
+
+gcc/jit/
+
+	PR c++/106102
+	* jit-playback.cc: Include <pthread.h> via "system.h" to avoid calloc()
+	poisoning.
+	* jit-recording.cc: Ditto.
+	* libgccjit.cc: Ditto.
+---
+ gcc/jit/jit-playback.cc  | 3 +--
+ gcc/jit/jit-recording.cc | 2 +-
+ gcc/jit/libgccjit.cc     | 2 +-
+ gcc/system.h             | 4 ++++
+ 4 files changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/gcc/jit/jit-playback.cc b/gcc/jit/jit-playback.cc
+index 6be6bdf8dea5..79714132b91a 100644
+--- a/gcc/jit/jit-playback.cc
++++ b/gcc/jit/jit-playback.cc
+@@ -19,6 +19,7 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "target.h"
+@@ -41,8 +42,6 @@ along with GCC; see the file COPYING3.  If not see
+ #include "diagnostic.h"
+ #include "stmt.h"
+ 
+-#include <pthread.h>
+-
+ #include "jit-playback.h"
+ #include "jit-result.h"
+ #include "jit-builtins.h"
+diff --git a/gcc/jit/jit-recording.cc b/gcc/jit/jit-recording.cc
+index 697dee66e733..f78daed2d71a 100644
+--- a/gcc/jit/jit-recording.cc
++++ b/gcc/jit/jit-recording.cc
+@@ -19,13 +19,13 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "tm.h"
+ #include "pretty-print.h"
+ #include "toplev.h"
+ 
+-#include <pthread.h>
+ 
+ #include "jit-builtins.h"
+ #include "jit-recording.h"
+diff --git a/gcc/jit/libgccjit.cc b/gcc/jit/libgccjit.cc
+index 0e76097b4bac..ca862662777e 100644
+--- a/gcc/jit/libgccjit.cc
++++ b/gcc/jit/libgccjit.cc
+@@ -19,12 +19,12 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "timevar.h"
+ #include "typed-splay-tree.h"
+ #include "cppbuiltin.h"
+-#include <pthread.h>
+ 
+ #include "libgccjit.h"
+ #include "jit-recording.h"
+diff --git a/gcc/system.h b/gcc/system.h
+index 67158b70c789..f8d42ff68150 100644
+--- a/gcc/system.h
++++ b/gcc/system.h
+@@ -753,6 +753,10 @@ extern int vsnprintf (char *, size_t, const char *, va_list);
+ #endif
+ #endif
+ 
++#ifdef INCLUDE_PTHREAD_H
++#include <pthread.h>
++#endif
++
+ #ifdef INCLUDE_ISL
+ #ifdef HAVE_isl
+ #include <isl/options.h>
diff --git a/srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch b/srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch
new file mode 100644
index 000000000000..044a4fc29514
--- /dev/null
+++ b/srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch
@@ -0,0 +1,32 @@
+From f35d65517a59565758107c5b1a51a5fa382f8d1a Mon Sep 17 00:00:00 2001
+From: Ian Lance Taylor <iant@golang.org>
+Date: Tue, 12 Jul 2022 19:42:43 -0700
+Subject: [PATCH] libgo: don't include <linux/fs.h> when building
+ gen-sysinfo.go
+
+Removing this doesn't change anything at least with glibc 2.33.
+The include was added in https://go.dev/cl/6100049 but it's not
+clear why.
+
+Fixes PR go/106266
+
+Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/417294
+---
+ gcc/go/gofrontend/MERGE | 2 +-
+ libgo/sysinfo.c         | 3 ---
+ 2 files changed, 1 insertion(+), 4 deletions(-)
+
+diff --git a/libgo/sysinfo.c b/libgo/sysinfo.c
+index a4259c02ded4..fc0210992faa 100644
+--- a/libgo/sysinfo.c
++++ b/libgo/sysinfo.c
+@@ -158,9 +158,6 @@
+ #if defined(HAVE_LINUX_ETHER_H)
+ #include <linux/ether.h>
+ #endif
+-#if defined(HAVE_LINUX_FS_H)
+-#include <linux/fs.h>
+-#endif
+ #if defined(HAVE_LINUX_REBOOT_H)
+ #include <linux/reboot.h>
+ #endif
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..78a2ce35875d 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,9 +3,10 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
  
  #  ifndef _ABIN32
+
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..32ee79e32f0d 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,15 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
+version=12.1.0
+revision=1
 _patchver="${version%pre*}"
 _minorver="${_patchver%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 wrksrc=gcc-${version/pre/_pre}
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +19,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -396,7 +393,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}

From bc0e683e454ca96f39af05770c6d67ef98b8799a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 03/33] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      |  6 ++--
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..08e35d466a44 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From 67880df64a47418e98ff1d6133cad685d29e2422 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 04/33] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 1a4e1ca3d594..b04268908c2e 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="q66 <daniel@octaforge.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From 7df6e2b61fe218743ab34ee36b1b74d054fd62d9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 05/33] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 3 files changed, 55 insertions(+), 353 deletions(-)
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index efc9db862ed5..30e2cdf19e72 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From 5f2621c708dd78b45111300bbe43e7bc518b9a38 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 14 Aug 2022 19:29:36 -0700
Subject: [PATCH 06/33] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

glibc 2.35 ane newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..24d02865b164 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -132,6 +132,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -246,6 +247,15 @@ _void_cross_build_glibc() {
 	local tgt=$1
 	local ver=$2
 
+	# glibc 2.35 and newer uses -static-pie by default
+	# which does not work with -no-pie.
+	local oldcflags="${CFLAGS}"
+	local oldcxxflags="${CXXFLAGS}"
+	local oldldflags="${LDFLAGS}"
+	CFLAGS="${CFLAGS//"-fno-PIE"/}"
+	CXXFLAGS="${CXXFLAGS//"-fno-PIE"/}"
+	LDFLAGS="${LDFLAGS//"-no-pie"/}"
+
 	msg_normal "Building glibc for ${tgt}\n"
 
 	mkdir -p ${wrksrc}/glibc_build
@@ -279,6 +289,9 @@ _void_cross_build_glibc() {
 	make ${makejobs}
 	make install_root=${wrksrc}/build_root/usr/${tgt} install
 
+	CFLAGS="${oldcflags}"
+	CXXFLAGS="${oldcxxflags}"
+	LDFLAGS="${oldldflags}"
 	touch ${wrksrc}/.glibc_build_done
 }
 

From 03e527508d9b81aa7cc14127d6b3d3958f424f3c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:08:52 -0700
Subject: [PATCH 07/33] openssh: suppress werror on gcc12

---
 srcpkgs/openssh/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/openssh/template b/srcpkgs/openssh/template
index 02a2dec35f42..6e8e343a9dca 100644
--- a/srcpkgs/openssh/template
+++ b/srcpkgs/openssh/template
@@ -40,7 +40,7 @@ if [ "$build_option_ldns" -a -z "$build_option_ssl" ]; then
 	broken="option 'ldns' requires option 'ssl'"
 fi
 
-CFLAGS="-Wno-format-truncation -Wno-stringop-truncation"
+CFLAGS="-Wno-format-truncation -Wno-stringop-truncation -Wno-error=maybe-uninitialized"
 
 case $XBPS_TARGET_MACHINE in
 	i686-musl)

From 12197219377ec08f723d84f6e8ee7cabf16a083e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:09:31 -0700
Subject: [PATCH 08/33] linux5.18: update dotconfigs for gcc12

---
 srcpkgs/linux5.18/files/x86_64-dotconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/linux5.18/files/x86_64-dotconfig b/srcpkgs/linux5.18/files/x86_64-dotconfig
index 4e73a3195d40..ea6204868e23 100644
--- a/srcpkgs/linux5.18/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.18/files/x86_64-dotconfig
@@ -512,6 +512,7 @@ CONFIG_RETHUNK=y
 CONFIG_CPU_UNRET_ENTRY=y
 CONFIG_CPU_IBPB_ENTRY=y
 CONFIG_CPU_IBRS_ENTRY=y
+CONFIG_SLS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10060,8 +10061,11 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
 # Memory initialization
 #
 CONFIG_INIT_STACK_NONE=y
+# CONFIG_INIT_STACK_ALL_PATTERN is not set
+# CONFIG_INIT_STACK_ALL_ZERO is not set
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
+# CONFIG_ZERO_CALL_USED_REGS is not set
 # end of Memory initialization
 # end of Kernel hardening options
 # end of Security options
@@ -10538,6 +10542,7 @@ CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
 # CONFIG_UBSAN is not set
 CONFIG_HAVE_ARCH_KCSAN=y
+# CONFIG_KCSAN is not set
 # end of Generic Kernel Debugging Instruments
 
 #

From fef1b1bc80f04440917d5b8445dbbfd482416cae Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 18:00:42 -0700
Subject: [PATCH 09/33] xf86-video-vmware: fix build on gcc12

---
 ...183b3395333d5d4c73e25c2d011748f15eda.patch | 30 +++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch

diff --git a/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch b/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch
new file mode 100644
index 000000000000..ff839f16e628
--- /dev/null
+++ b/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch
@@ -0,0 +1,30 @@
+From 77b8183b3395333d5d4c73e25c2d011748f15eda Mon Sep 17 00:00:00 2001
+From: Rudi Heitbaum <rudi@heitbaum.com>
+Date: Sun, 8 May 2022 03:00:10 +0000
+Subject: [PATCH] vmwgfx: fix missing array notation
+
+ Fixes error identified by gcc-12.1.0 compiler
+
+make
+  CC       libvmwgfx_la-vmwgfx_tex_video.lo
+vmwgfx_tex_video.c: In function 'stop_video':
+vmwgfx_tex_video.c:240:20: error: the comparison will always evaluate as 'true' for the address of 'yuv' will never be NULL [-Werror=address]
+  240 |                if (priv->yuv[i]) {
+      |                    ^~~~
+---
+ vmwgfx/vmwgfx_tex_video.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/vmwgfx/vmwgfx_tex_video.c b/vmwgfx/vmwgfx_tex_video.c
+index acc2b56..480a5f1 100644
+--- a/vmwgfx/vmwgfx_tex_video.c
++++ b/vmwgfx/vmwgfx_tex_video.c
+@@ -237,7 +237,7 @@ stop_video(ScrnInfoPtr pScrn, pointer data, Bool shutdown)
+ 
+        for (i=0; i<3; ++i) {
+ 	   for (j=0; j<2; ++j) {
+-	       if (priv->yuv[i]) {
++	       if (priv->yuv[j][i]) {
+ 		   xa_surface_destroy(priv->yuv[j][i]);
+ 		   priv->yuv[j][i] = NULL;
+ 	       }

From 37fa289ff241a0268f9b2ab1a048273cab75fe96 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 18:54:53 -0700
Subject: [PATCH 10/33] qt5-webengine: fix build on gcc12

---
 .../patches/qt5-webengine-gcc12.patch             | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
 create mode 100644 srcpkgs/qt5-webengine/patches/qt5-webengine-gcc12.patch

diff --git a/srcpkgs/qt5-webengine/patches/qt5-webengine-gcc12.patch b/srcpkgs/qt5-webengine/patches/qt5-webengine-gcc12.patch
new file mode 100644
index 000000000000..366d25e012e4
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/qt5-webengine-gcc12.patch
@@ -0,0 +1,15 @@
+Add missing include for std::begin and std::end in SkParseColor.cpp
+
+https://skia-review.googlesource.com/c/skia/+/533981
+
+--- a/src/3rdparty/chromium/third_party/skia/src/utils/SkParseColor.cpp
++++ b/src/3rdparty/chromium/third_party/skia/src/utils/SkParseColor.cpp
+@@ -8,6 +8,8 @@
+ 
+ #include "include/utils/SkParse.h"
+ 
++#include <iterator>
++
+ static constexpr const char* gColorNames[] = {
+     "aliceblue",
+     "antiquewhite",

From 037aa73376e204f6cd083f37b7263ca2b06c5627 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:54 -0700
Subject: [PATCH 11/33] cross-aarch64-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..cb7ae97e7efe 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 08e7e16832b6992ae4b397fd4db1067e82fa00bc Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:54 -0700
Subject: [PATCH 12/33] cross-aarch64-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..4fa950f334d4 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 0307f9c4f361d89f09e0d93aa169560abc4f3aa1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:54 -0700
Subject: [PATCH 13/33] cross-arm-linux-gnueabi: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..194c0ab774b7 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 759a0e30292e38724cced9b379d0e7d55b3c7c0f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 14/33] cross-arm-linux-gnueabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..3f3242b85b07 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 6ba427d7d1b764603120f3e8a3687b6c3e4f78c9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 15/33] cross-arm-linux-musleabi: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..b0cdade60a6d 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From cd0fa52f3ca04df8273311c0785f268762b2cc05 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 16/33] cross-arm-linux-musleabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..1924be24d483 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 77fd692244499145910c2c07ef95b8bdd7bdc7af Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 17/33] cross-armv7l-linux-gnueabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..a7997d6db937 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 5c2136a6cfa2d5c3403b97c0cef0de18975540ca Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 18/33] cross-armv7l-linux-musleabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..aaa7040fbfef 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 18aa13f4de7f28a0459dc31f8e4fe213faefec2d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 19/33] cross-i686-pc-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..765cf675e95c 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From aa4d3b4629247f8ed8ccdb61a570309419ef6b19 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 20/33] cross-mips-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-mips-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..26928ba9442d 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From f762449e9557830e0215d2fdbf8095a4991e1896 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 21/33] cross-mips-linux-muslhf: update to gcc 12.1.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..fe74faf15d55 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From e7e541ff4ea06f4b4df0f089f9cb6348c0b60988 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 22/33] cross-mipsel-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..aa74d0b1acc7 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_musl_version=1.1.24
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From da5a65fecac1ac13fa52645d424f12890e8adee6 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 23/33] cross-mipsel-linux-muslhf: update to gcc 12.1.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..83ab7f187085 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_musl_version=1.1.24
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 1c562a10c52fc58b8d808385228a01e4ff7cdd11 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 24/33] cross-powerpc-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..3ab1a4ea40fa 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From bff97c5452579897ac9f2c8c4aa1e9b72e3ad4b9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 25/33] cross-powerpc-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..af5586cacc77 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 18c52fd28b12471f3382c7d7446d687072b82202 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 26/33] cross-powerpc64-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..2604b268046b 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From d9ff14f8dd8297e7af42a9ebb39a89e12771984f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 27/33] cross-powerpc64-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 1ebd0fb2048d..c7894721b900 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
@@ -19,12 +19,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 0deb1f108c4da2f83b7129220fad28311eee2e04 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 28/33] cross-powerpc64le-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 733f5851da5c..618235468970 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From d24f8589591bf15ca52a76a38fddb3db3b5446ef Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 29/33] cross-powerpc64le-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index 76a70aa1d6db..7edf9605e60d 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
@@ -19,12 +19,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 73a1b2b73cdde6db4102b01c819f75b8fc260405 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 30/33] cross-powerpcle-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 347b8fcf4f55..cc10b7cbd88b 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From ca4b47965516c3bc1a55cb4567bb9c2b236a62fc Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 31/33] cross-powerpcle-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index ec9324ddaa99..1d38a3fa3559 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 508108707faab6f3b8b9875770820205fe3b7d6f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 32/33] cross-x86_64-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 0078fbe7224b..9f740b00a80c 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 93fc6ee39229f5401e19f790c454360bec371570 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 33/33] cross-x86_64-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..19e13f3818e9 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
@@ -17,12 +17,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.1.0
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (27 preceding siblings ...)
  2022-08-16  1:55 ` oreo639
@ 2022-08-18 23:23 ` oreo639
  2022-08-19  0:22 ` oreo639
                   ` (235 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-08-18 23:23 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2895 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.1.0
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.1.0

This PR depends on: https://github.com/void-linux/void-packages/pull/32330

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

Also, keep in mind that the libgo musl patch here will need to be updated once musl is updated:
https://github.com/void-linux/void-packages/pull/34902/files#diff-1f42a95b93c9550178ff1fbccbef2f47a72711df15c24c9472e2550076978129R163-R176

This is the updated patch for reference:
https://github.com/alpinelinux/aports/blob/8acb21b8ee881e7ab1c812d9a66a17d2501b8730/main/gcc/0049-libgo-adjust-name-of-union-in-sigevent-struct.patch

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Known packages that need to be fixed for glibc 2.36:
- [ ] samba https://github.com/void-linux/void-packages/pull/38700
- [ ] qemu
- [ ] llvm https://github.com/void-linux/void-packages/pull/38694

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 122679 bytes --]

From 9366a422c7e57a75bf7821c1bd5f34f95bd476cf Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 01/36] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 15 +++--
 3 files changed, 28 insertions(+), 113 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..4bdaee582d71 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkg-config"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -44,6 +45,12 @@ do_configure() {
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	case "$XBPS_TARGET_MACHINE" in
+		*-musl)
+			conf+=" --disable-gprofng"
+			;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"

From 2e37d51320d9beb02f6f0d300ba8a32e511c9caf Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 02/36] gcc: update to 12.1.0.

---
 common/shlibs                                 |  10 +-
 srcpkgs/gcc/files/gccgo-musl.patch            |  74 +++--------
 srcpkgs/gcc/files/libgnarl-musl.patch         |  18 +--
 srcpkgs/gcc/files/libssp-musl.patch           |  10 +-
 ...c21f3f5726823e19728fdd1571a14aae0fb3.patch | 105 ++++++++++++++++
 ...08065bdd36fb1a9b6aad9666b1edb5e06474.patch | 115 ++++++++++++++++++
 ...65517a59565758107c5b1a51a5fa382f8d1a.patch |  32 +++++
 srcpkgs/gcc/patches/libffi_gnulinux.patch     |  11 --
 .../gcc/patches/libgcc-ibm128-no-tag.patch    |  10 +-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |   3 +-
 srcpkgs/gcc/template                          |  25 ++--
 11 files changed, 305 insertions(+), 108 deletions(-)
 create mode 100644 srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
 create mode 100644 srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
 create mode 100644 srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index 2e5258f3a243..4ed747b361a2 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.1.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.34 perl-5.34.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -849,8 +849,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.1.0_1
+libgnat-12.so libada-12.1.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1701,8 +1701,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.1.0_1
+libasan.so.8 libsanitizer-12.1.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..632ef951097b 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,17 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ a/libgo/go/runtime/os_linux.go
+@@ -363,9 +363,9 @@
+ 
+ 	var timerid int32
+ 	var sevp _sigevent
+-	sevp.sigev_notify = _SIGEV_THREAD_ID
++	sevp.sigev_notify = 4
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.sigev_notify_function))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch b/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
new file mode 100644
index 000000000000..00929202a503
--- /dev/null
+++ b/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
@@ -0,0 +1,105 @@
+From 3b21c21f3f5726823e19728fdd1571a14aae0fb3 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <siarheit@google.com>
+Date: Mon, 27 Jun 2022 13:27:24 +0100
+Subject: [PATCH] c++: avoid <memory> poisoning on musl [PR106102]
+
+On musl <pthread.h> uses calloc() (via <sched.h>). <memory> includes
+it indirectly and exposes use of poisoned calloc() when module code
+is built:
+
+    /build/build/./prev-gcc/xg++ ... ../../gcc-13-20220626/gcc/cp/mapper-resolver.cc
+        In file included from /<<NIX>>/musl-1.2.3-dev/include/pthread.h:30,
+                 from /build/build/prev-x86_64-unknown-linux-musl/libstdc++-v3/include/x86_64-unknown-linux-musl/bits/gthr-default.h:35,
+                 ....
+                 from /build/build/prev-x86_64-unknown-linux-musl/libstdc++-v3/include/memory:77,
+                 from ../../gcc-13-20220626/gcc/../libcody/cody.hh:24,
+                 from ../../gcc-13-20220626/gcc/cp/../../c++tools/resolver.h:25,
+                 from ../../gcc-13-20220626/gcc/cp/../../c++tools/resolver.cc:23,
+                 from ../../gcc-13-20220626/gcc/cp/mapper-resolver.cc:32:
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:84:7: error: attempt to use poisoned "calloc"
+       84 | void *calloc(size_t, size_t);
+          |       ^
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:124:36: error: attempt to use poisoned "calloc"
+      124 | #define CPU_ALLOC(n) ((cpu_set_t *)calloc(1,CPU_ALLOC_SIZE(n)))
+          |                                    ^
+
+gcc/cp/
+
+	PR c++/106102
+	* mapper-client.cc: Include <memory> via "system.h".
+	* mapper-resolver.cc: Ditto.
+	* module.cc: Ditto.
+
+libcc1/
+
+	PR c++/106102
+	* libcc1plugin.cc: Include <memory> via "system.h".
+	* libcp1plugin.cc: Ditto.
+---
+ gcc/cp/mapper-client.cc   | 1 +
+ gcc/cp/mapper-resolver.cc | 1 +
+ gcc/cp/module.cc          | 1 +
+ libcc1/libcc1plugin.cc    | 1 +
+ libcc1/libcp1plugin.cc    | 1 +
+ 5 files changed, 5 insertions(+)
+
+diff --git a/gcc/cp/mapper-client.cc b/gcc/cp/mapper-client.cc
+index 8603a886a099..fe9544b5ba43 100644
+--- a/gcc/cp/mapper-client.cc
++++ b/gcc/cp/mapper-client.cc
+@@ -27,6 +27,7 @@ along with GCC; see the file COPYING3.  If not see
+ #define INCLUDE_STRING
+ #define INCLUDE_VECTOR
+ #define INCLUDE_MAP
++#define INCLUDE_MEMORY
+ #include "system.h"
+ 
+ #include "line-map.h"
+diff --git a/gcc/cp/mapper-resolver.cc b/gcc/cp/mapper-resolver.cc
+index e3d29fb5ada1..e70d1b4ae2ca 100644
+--- a/gcc/cp/mapper-resolver.cc
++++ b/gcc/cp/mapper-resolver.cc
+@@ -25,6 +25,7 @@ along with GCC; see the file COPYING3.  If not see
+ #define INCLUDE_VECTOR
+ #define INCLUDE_ALGORITHM
+ #define INCLUDE_MAP
++#define INCLUDE_MEMORY
+ #include "system.h"
+ 
+ // We don't want or need to be aware of networking
+diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc
+index 753963a4b246..8bb22c2b305a 100644
+--- a/gcc/cp/module.cc
++++ b/gcc/cp/module.cc
+@@ -206,6 +206,7 @@ Classes used:
+ 
+ #define _DEFAULT_SOURCE 1 /* To get TZ field of struct tm, if available.  */
+ #include "config.h"
++#define INCLUDE_MEMORY
+ #define INCLUDE_STRING
+ #define INCLUDE_VECTOR
+ #include "system.h"
+diff --git a/libcc1/libcc1plugin.cc b/libcc1/libcc1plugin.cc
+index 12ab5a57c8dd..bdd0bdabe77f 100644
+--- a/libcc1/libcc1plugin.cc
++++ b/libcc1/libcc1plugin.cc
+@@ -31,6 +31,7 @@
+ #undef PACKAGE_TARNAME
+ #undef PACKAGE_VERSION
+ 
++#define INCLUDE_MEMORY
+ #include "gcc-plugin.h"
+ #include "system.h"
+ #include "coretypes.h"
+diff --git a/libcc1/libcp1plugin.cc b/libcc1/libcp1plugin.cc
+index 83dab7f58b11..e2d5039a0a1f 100644
+--- a/libcc1/libcp1plugin.cc
++++ b/libcc1/libcp1plugin.cc
+@@ -32,6 +32,7 @@
+ #undef PACKAGE_TARNAME
+ #undef PACKAGE_VERSION
+ 
++#define INCLUDE_MEMORY
+ #include "gcc-plugin.h"
+ #include "system.h"
+ #include "coretypes.h"
diff --git a/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch b/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
new file mode 100644
index 000000000000..89bd053d6d04
--- /dev/null
+++ b/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
@@ -0,0 +1,115 @@
+From 49d508065bdd36fb1a9b6aad9666b1edb5e06474 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <siarheit@google.com>
+Date: Mon, 27 Jun 2022 23:42:44 +0100
+Subject: [PATCH] jit: avoid calloc() poisoning on musl [PR106102]
+
+On musl <pthread.h> uses calloc() (via <sched.h>). jit/ includes
+it directly and exposes use of poisoned calloc():
+
+    /build/build/./prev-gcc/xg++ ... ../../gcc-13-20220626/gcc/jit/jit-playback.cc
+    make[3]: *** [Makefile:1143: jit/libgccjit.o] Error 1
+    make[3]: *** Waiting for unfinished jobs....
+    In file included from /<<NIX>>/musl-1.2.3-dev/include/pthread.h:30,
+                     from ../../gcc-13-20220626/gcc/jit/jit-playback.cc:44:
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:84:7: error: attempt to use poisoned "calloc"
+       84 | void *calloc(size_t, size_t);
+          |       ^
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:124:36: error: attempt to use poisoned "calloc"
+      124 | #define CPU_ALLOC(n) ((cpu_set_t *)calloc(1,CPU_ALLOC_SIZE(n)))
+          |                                    ^
+
+The change moves <pthread.h> inclusion to "system.h" under new
+INCLUDE_PTHREAD_H guard and uses this mechanism in libgccjit.
+
+gcc/
+
+	PR c++/106102
+	* system.h: Introduce INCLUDE_PTHREAD_H macros to include <pthread.h>.
+
+gcc/jit/
+
+	PR c++/106102
+	* jit-playback.cc: Include <pthread.h> via "system.h" to avoid calloc()
+	poisoning.
+	* jit-recording.cc: Ditto.
+	* libgccjit.cc: Ditto.
+---
+ gcc/jit/jit-playback.cc  | 3 +--
+ gcc/jit/jit-recording.cc | 2 +-
+ gcc/jit/libgccjit.cc     | 2 +-
+ gcc/system.h             | 4 ++++
+ 4 files changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/gcc/jit/jit-playback.cc b/gcc/jit/jit-playback.cc
+index 6be6bdf8dea5..79714132b91a 100644
+--- a/gcc/jit/jit-playback.cc
++++ b/gcc/jit/jit-playback.cc
+@@ -19,6 +19,7 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "target.h"
+@@ -41,8 +42,6 @@ along with GCC; see the file COPYING3.  If not see
+ #include "diagnostic.h"
+ #include "stmt.h"
+ 
+-#include <pthread.h>
+-
+ #include "jit-playback.h"
+ #include "jit-result.h"
+ #include "jit-builtins.h"
+diff --git a/gcc/jit/jit-recording.cc b/gcc/jit/jit-recording.cc
+index 697dee66e733..f78daed2d71a 100644
+--- a/gcc/jit/jit-recording.cc
++++ b/gcc/jit/jit-recording.cc
+@@ -19,13 +19,13 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "tm.h"
+ #include "pretty-print.h"
+ #include "toplev.h"
+ 
+-#include <pthread.h>
+ 
+ #include "jit-builtins.h"
+ #include "jit-recording.h"
+diff --git a/gcc/jit/libgccjit.cc b/gcc/jit/libgccjit.cc
+index 0e76097b4bac..ca862662777e 100644
+--- a/gcc/jit/libgccjit.cc
++++ b/gcc/jit/libgccjit.cc
+@@ -19,12 +19,12 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "timevar.h"
+ #include "typed-splay-tree.h"
+ #include "cppbuiltin.h"
+-#include <pthread.h>
+ 
+ #include "libgccjit.h"
+ #include "jit-recording.h"
+diff --git a/gcc/system.h b/gcc/system.h
+index 67158b70c789..f8d42ff68150 100644
+--- a/gcc/system.h
++++ b/gcc/system.h
+@@ -753,6 +753,10 @@ extern int vsnprintf (char *, size_t, const char *, va_list);
+ #endif
+ #endif
+ 
++#ifdef INCLUDE_PTHREAD_H
++#include <pthread.h>
++#endif
++
+ #ifdef INCLUDE_ISL
+ #ifdef HAVE_isl
+ #include <isl/options.h>
diff --git a/srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch b/srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch
new file mode 100644
index 000000000000..044a4fc29514
--- /dev/null
+++ b/srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch
@@ -0,0 +1,32 @@
+From f35d65517a59565758107c5b1a51a5fa382f8d1a Mon Sep 17 00:00:00 2001
+From: Ian Lance Taylor <iant@golang.org>
+Date: Tue, 12 Jul 2022 19:42:43 -0700
+Subject: [PATCH] libgo: don't include <linux/fs.h> when building
+ gen-sysinfo.go
+
+Removing this doesn't change anything at least with glibc 2.33.
+The include was added in https://go.dev/cl/6100049 but it's not
+clear why.
+
+Fixes PR go/106266
+
+Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/417294
+---
+ gcc/go/gofrontend/MERGE | 2 +-
+ libgo/sysinfo.c         | 3 ---
+ 2 files changed, 1 insertion(+), 4 deletions(-)
+
+diff --git a/libgo/sysinfo.c b/libgo/sysinfo.c
+index a4259c02ded4..fc0210992faa 100644
+--- a/libgo/sysinfo.c
++++ b/libgo/sysinfo.c
+@@ -158,9 +158,6 @@
+ #if defined(HAVE_LINUX_ETHER_H)
+ #include <linux/ether.h>
+ #endif
+-#if defined(HAVE_LINUX_FS_H)
+-#include <linux/fs.h>
+-#endif
+ #if defined(HAVE_LINUX_REBOOT_H)
+ #include <linux/reboot.h>
+ #endif
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..78a2ce35875d 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,9 +3,10 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
  
  #  ifndef _ABIN32
+
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..32ee79e32f0d 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,15 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
+version=12.1.0
+revision=1
 _patchver="${version%pre*}"
 _minorver="${_patchver%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 wrksrc=gcc-${version/pre/_pre}
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +19,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -396,7 +393,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}

From b9014d4d9c032dabbdad252e2801e4332c4cfd4f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 03/36] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      |  6 ++--
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..08e35d466a44 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From f359203e193fb19dff85868f3a448c6a6e4ca7f7 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 04/36] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 1a4e1ca3d594..b04268908c2e 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="q66 <daniel@octaforge.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From 42bd9e22f93f8aab4c55b8a98e89b1c0c364cbda Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 05/36] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 3 files changed, 55 insertions(+), 353 deletions(-)
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index 4ed747b361a2..46e4674c7fe0 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From fccc027b73a8ff2d1873f9ebd47f8b89faef886d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 16:22:03 -0700
Subject: [PATCH 06/36] llvm12: fix build for glibc 2.36

---
 .../compiler-rt-sanitizer-glibc-2.36.patch    | 59 +++++++++++++++++++
 .../compiler-rt-sanitizer-glibc-2.36.patch    | 59 +++++++++++++++++++
 2 files changed, 118 insertions(+)
 create mode 100644 srcpkgs/llvm12/compiler-rt-sanitizer-glibc-2.36.patch
 create mode 100644 srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch

diff --git a/srcpkgs/llvm12/compiler-rt-sanitizer-glibc-2.36.patch b/srcpkgs/llvm12/compiler-rt-sanitizer-glibc-2.36.patch
new file mode 100644
index 000000000000..e5f24dab8935
--- /dev/null
+++ b/srcpkgs/llvm12/compiler-rt-sanitizer-glibc-2.36.patch
@@ -0,0 +1,59 @@
+From 9cf13067cb5088626ba7ee1ec4c42ec59c7995a0 Mon Sep 17 00:00:00 2001
+From: Fangrui Song <i@maskray.me>
+Date: Mon, 11 Jul 2022 12:53:34 -0700
+Subject: [PATCH] [sanitizer] Remove #include <linux/fs.h> to resolve
+ fsconfig_command/mount_attr conflict with glibc 2.36
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+It is generally not a good idea to mix usage of glibc headers and Linux UAPI
+headers (https://sourceware.org/glibc/wiki/Synchronizing_Headers). In glibc
+since 7eae6a91e9b1670330c9f15730082c91c0b1d570 (milestone: 2.36), sys/mount.h
+defines `fsconfig_command` which conflicts with linux/mount.h:
+
+    .../usr/include/linux/mount.h:95:6: error: redeclaration of ‘enum fsconfig_command’
+
+Remove #include <linux/fs.h> which pulls in linux/mount.h. Expand its 4 macros manually.
+Android sys/mount.h doesn't define BLKBSZGET and it still needs linux/fs.h.
+In the long term we should move Linux specific definitions to sanitizer_platform_limits_linux.cpp
+but this commit is easy to cherry pick into older compiler-rt releases.
+
+Fix https://github.com/llvm/llvm-project/issues/56421
+
+Reviewed By: #sanitizers, vitalybuka, zatrazz
+
+Differential Revision: https://reviews.llvm.org/D129471
+---
+ .../sanitizer_platform_limits_posix.cpp                | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+index 4bd425435d56d..3a94b260686f1 100644
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -73,7 +73,9 @@
+ #include <sys/vt.h>
+ #include <linux/cdrom.h>
+ #include <linux/fd.h>
++#if SANITIZER_ANDROID
+ #include <linux/fs.h>
++#endif
+ #include <linux/hdreg.h>
+ #include <linux/input.h>
+ #include <linux/ioctl.h>
+@@ -876,10 +878,10 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
+   unsigned IOCTL_EVIOCGPROP = IOCTL_NOT_PRESENT;
+   unsigned IOCTL_EVIOCSKEYCODE_V2 = IOCTL_NOT_PRESENT;
+ #endif
+-  unsigned IOCTL_FS_IOC_GETFLAGS = FS_IOC_GETFLAGS;
+-  unsigned IOCTL_FS_IOC_GETVERSION = FS_IOC_GETVERSION;
+-  unsigned IOCTL_FS_IOC_SETFLAGS = FS_IOC_SETFLAGS;
+-  unsigned IOCTL_FS_IOC_SETVERSION = FS_IOC_SETVERSION;
++  unsigned IOCTL_FS_IOC_GETFLAGS = _IOR('f', 1, long);
++  unsigned IOCTL_FS_IOC_GETVERSION = _IOR('v', 1, long);
++  unsigned IOCTL_FS_IOC_SETFLAGS = _IOW('f', 2, long);
++  unsigned IOCTL_FS_IOC_SETVERSION = _IOW('v', 2, long);
+   unsigned IOCTL_GIO_CMAP = GIO_CMAP;
+   unsigned IOCTL_GIO_FONT = GIO_FONT;
+   unsigned IOCTL_GIO_UNIMAP = GIO_UNIMAP;
diff --git a/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch b/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch
new file mode 100644
index 000000000000..e5f24dab8935
--- /dev/null
+++ b/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch
@@ -0,0 +1,59 @@
+From 9cf13067cb5088626ba7ee1ec4c42ec59c7995a0 Mon Sep 17 00:00:00 2001
+From: Fangrui Song <i@maskray.me>
+Date: Mon, 11 Jul 2022 12:53:34 -0700
+Subject: [PATCH] [sanitizer] Remove #include <linux/fs.h> to resolve
+ fsconfig_command/mount_attr conflict with glibc 2.36
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+It is generally not a good idea to mix usage of glibc headers and Linux UAPI
+headers (https://sourceware.org/glibc/wiki/Synchronizing_Headers). In glibc
+since 7eae6a91e9b1670330c9f15730082c91c0b1d570 (milestone: 2.36), sys/mount.h
+defines `fsconfig_command` which conflicts with linux/mount.h:
+
+    .../usr/include/linux/mount.h:95:6: error: redeclaration of ‘enum fsconfig_command’
+
+Remove #include <linux/fs.h> which pulls in linux/mount.h. Expand its 4 macros manually.
+Android sys/mount.h doesn't define BLKBSZGET and it still needs linux/fs.h.
+In the long term we should move Linux specific definitions to sanitizer_platform_limits_linux.cpp
+but this commit is easy to cherry pick into older compiler-rt releases.
+
+Fix https://github.com/llvm/llvm-project/issues/56421
+
+Reviewed By: #sanitizers, vitalybuka, zatrazz
+
+Differential Revision: https://reviews.llvm.org/D129471
+---
+ .../sanitizer_platform_limits_posix.cpp                | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+index 4bd425435d56d..3a94b260686f1 100644
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -73,7 +73,9 @@
+ #include <sys/vt.h>
+ #include <linux/cdrom.h>
+ #include <linux/fd.h>
++#if SANITIZER_ANDROID
+ #include <linux/fs.h>
++#endif
+ #include <linux/hdreg.h>
+ #include <linux/input.h>
+ #include <linux/ioctl.h>
+@@ -876,10 +878,10 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
+   unsigned IOCTL_EVIOCGPROP = IOCTL_NOT_PRESENT;
+   unsigned IOCTL_EVIOCSKEYCODE_V2 = IOCTL_NOT_PRESENT;
+ #endif
+-  unsigned IOCTL_FS_IOC_GETFLAGS = FS_IOC_GETFLAGS;
+-  unsigned IOCTL_FS_IOC_GETVERSION = FS_IOC_GETVERSION;
+-  unsigned IOCTL_FS_IOC_SETFLAGS = FS_IOC_SETFLAGS;
+-  unsigned IOCTL_FS_IOC_SETVERSION = FS_IOC_SETVERSION;
++  unsigned IOCTL_FS_IOC_GETFLAGS = _IOR('f', 1, long);
++  unsigned IOCTL_FS_IOC_GETVERSION = _IOR('v', 1, long);
++  unsigned IOCTL_FS_IOC_SETFLAGS = _IOW('f', 2, long);
++  unsigned IOCTL_FS_IOC_SETVERSION = _IOW('v', 2, long);
+   unsigned IOCTL_GIO_CMAP = GIO_CMAP;
+   unsigned IOCTL_GIO_FONT = GIO_FONT;
+   unsigned IOCTL_GIO_UNIMAP = GIO_UNIMAP;

From 5decce17bde82ecb83baf8b68135290e638fb87e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 16:22:29 -0700
Subject: [PATCH 07/36] samba: fix build for glibc 2.36

---
 srcpkgs/samba/patches/fix-glibc-2.36.patch | 59 ++++++++++++++++++++++
 1 file changed, 59 insertions(+)
 create mode 100644 srcpkgs/samba/patches/fix-glibc-2.36.patch

diff --git a/srcpkgs/samba/patches/fix-glibc-2.36.patch b/srcpkgs/samba/patches/fix-glibc-2.36.patch
new file mode 100644
index 000000000000..beb84ce6a8de
--- /dev/null
+++ b/srcpkgs/samba/patches/fix-glibc-2.36.patch
@@ -0,0 +1,59 @@
+From 766151bf5b7ef95ae4c8c98b8994e5c21c5bbec0 Mon Sep 17 00:00:00 2001
+From: Andreas Schneider <asn@samba.org>
+Date: Tue, 2 Aug 2022 07:55:46 +0200
+Subject: [PATCH] lib:replace: Only include <sys/mount.h> on non-Linux systems
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Details at:
+https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
+
+BUG: https://bugzilla.samba.org/show_bug.cgi?id=15132
+
+Signed-off-by: Andreas Schneider <asn@samba.org>
+Reviewed-by: Ralph Boehme <slow@samba.org>
+
+Autobuild-User(master): Ralph Böhme <slow@samba.org>
+Autobuild-Date(master): Tue Aug  2 11:05:14 UTC 2022 on sn-devel-184
+---
+ lib/replace/system/filesys.h | 4 +++-
+ lib/replace/wscript          | 3 +++
+ 2 files changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/lib/replace/system/filesys.h b/lib/replace/system/filesys.h
+index 034e5d5886c..bb9482c69af 100644
+--- a/lib/replace/system/filesys.h
++++ b/lib/replace/system/filesys.h
+@@ -36,7 +36,8 @@
+ #include <sys/param.h>
+ #endif
+ 
+-#ifdef HAVE_SYS_MOUNT_H
++/* This include is required on UNIX (*BSD, AIX, ...) for statfs() */
++#if !defined(LINUX) && defined(HAVE_SYS_MOUNT_H)
+ #include <sys/mount.h>
+ #endif
+ 
+@@ -44,6 +45,7 @@
+ #include <mntent.h>
+ #endif
+ 
++/* This include is required on Linux for statfs() */
+ #ifdef HAVE_SYS_VFS_H
+ #include <sys/vfs.h>
+ #endif
+diff --git a/lib/replace/wscript b/lib/replace/wscript
+index 4c774d9f0c3..dd9b19219a1 100644
+--- a/lib/replace/wscript
++++ b/lib/replace/wscript
+@@ -31,6 +31,9 @@ def configure(conf):
+ 
+     conf.env.standalone_replace = conf.IN_LAUNCH_DIR()
+ 
++    if sys.platform.rfind('linux') > -1:
++        conf.DEFINE('LINUX', '1')
++
+     conf.DEFINE('BOOL_DEFINED', 1)
+     conf.DEFINE('HAVE_LIBREPLACE', 1)
+     conf.DEFINE('LIBREPLACE_NETWORK_CHECKS', 1)

From 8f3b5a03d6f955229e3634e8172a79a2839cd6d5 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 16:22:47 -0700
Subject: [PATCH 08/36] qemu: fix build for glibc 2.36

---
 .../qemu/patches/fix-compat-glibc-2.36.patch  | 100 ++++++++++++++++++
 1 file changed, 100 insertions(+)
 create mode 100644 srcpkgs/qemu/patches/fix-compat-glibc-2.36.patch

diff --git a/srcpkgs/qemu/patches/fix-compat-glibc-2.36.patch b/srcpkgs/qemu/patches/fix-compat-glibc-2.36.patch
new file mode 100644
index 000000000000..e7239ad06313
--- /dev/null
+++ b/srcpkgs/qemu/patches/fix-compat-glibc-2.36.patch
@@ -0,0 +1,100 @@
+From 3cd3df2a9584e6f753bb62a0028bd67124ab5532 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= <berrange@redhat.com>
+Date: Tue, 2 Aug 2022 12:41:34 -0400
+Subject: [PATCH] linux-user: fix compat with glibc >= 2.36 sys/mount.h
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The latest glibc 2.36 has extended sys/mount.h so that it
+defines the FSCONFIG_* enum constants. These are historically
+defined in linux/mount.h, and thus if you include both headers
+the compiler complains:
+
+In file included from /usr/include/linux/fs.h:19,
+                 from ../linux-user/syscall.c:98:
+/usr/include/linux/mount.h:95:6: error: redeclaration of 'enum fsconfig_command'
+   95 | enum fsconfig_command {
+      |      ^~~~~~~~~~~~~~~~
+In file included from ../linux-user/syscall.c:31:
+/usr/include/sys/mount.h:189:6: note: originally defined here
+  189 | enum fsconfig_command
+      |      ^~~~~~~~~~~~~~~~
+/usr/include/linux/mount.h:96:9: error: redeclaration of enumerator 'FSCONFIG_SET_FLAG'
+   96 |         FSCONFIG_SET_FLAG       = 0,    /* Set parameter, supplying no value */
+      |         ^~~~~~~~~~~~~~~~~
+/usr/include/sys/mount.h:191:3: note: previous definition of 'FSCONFIG_SET_FLAG' with type 'enum fsconfig_command'
+  191 |   FSCONFIG_SET_FLAG       = 0,    /* Set parameter, supplying no value */
+      |   ^~~~~~~~~~~~~~~~~
+...snip...
+
+QEMU doesn't include linux/mount.h, but it does use
+linux/fs.h and thus gets linux/mount.h indirectly.
+
+glibc acknowledges this problem but does not appear to
+be intending to fix it in the forseeable future, simply
+documenting it as a known incompatibility with no
+workaround:
+
+  https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
+  https://sourceware.org/glibc/wiki/Synchronizing_Headers
+
+To address this requires either removing use of sys/mount.h
+or linux/fs.h, despite QEMU needing declarations from
+both.
+
+This patch removes linux/fs.h, meaning we have to define
+various FS_IOC constants that are now unavailable.
+
+Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
+Tested-by: Richard W.M. Jones <rjones@redhat.com>
+Message-Id: <20220802164134.1851910-1-berrange@redhat.com>
+Signed-off-by: Laurent Vivier <laurent@vivier.eu>
+---
+ linux-user/syscall.c | 18 ++++++++++++++++++
+ meson.build          |  2 ++
+ 2 files changed, 20 insertions(+)
+
+diff --git a/linux-user/syscall.c b/linux-user/syscall.c
+index ef53feb5ab45..f4091212027c 100644
+--- a/linux-user/syscall.c
++++ b/linux-user/syscall.c
+@@ -95,7 +95,25 @@
+ #include <linux/soundcard.h>
+ #include <linux/kd.h>
+ #include <linux/mtio.h>
++
++#ifdef HAVE_SYS_MOUNT_FSCONFIG
++/*
++ * glibc >= 2.36 linux/mount.h conflicts with sys/mount.h,
++ * which in turn prevents use of linux/fs.h. So we have to
++ * define the constants ourselves for now.
++ */
++#define FS_IOC_GETFLAGS                _IOR('f', 1, long)
++#define FS_IOC_SETFLAGS                _IOW('f', 2, long)
++#define FS_IOC_GETVERSION              _IOR('v', 1, long)
++#define FS_IOC_SETVERSION              _IOW('v', 2, long)
++#define FS_IOC_FIEMAP                  _IOWR('f', 11, struct fiemap)
++#define FS_IOC32_GETFLAGS              _IOR('f', 1, int)
++#define FS_IOC32_SETFLAGS              _IOW('f', 2, int)
++#define FS_IOC32_GETVERSION            _IOR('v', 1, int)
++#define FS_IOC32_SETVERSION            _IOW('v', 2, int)
++#else
+ #include <linux/fs.h>
++#endif
+ #include <linux/fd.h>
+ #if defined(CONFIG_FIEMAP)
+ #include <linux/fiemap.h>
+diff --git a/meson.build b/meson.build
+index 294e9a8f329e..30a380752c0d 100644
+--- a/meson.build
++++ b/meson.build
+@@ -1963,6 +1963,8 @@ config_host_data.set('HAVE_OPTRESET',
+                      cc.has_header_symbol('getopt.h', 'optreset'))
+ config_host_data.set('HAVE_IPPROTO_MPTCP',
+                      cc.has_header_symbol('netinet/in.h', 'IPPROTO_MPTCP'))
++config_host_data.set('HAVE_SYS_MOUNT_FSCONFIG',
++                     cc.has_header_symbol('sys/mount.h', 'FSCONFIG_SET_FLAG'))
+ 
+ # has_member
+ config_host_data.set('HAVE_SIGEV_NOTIFY_THREAD_ID',

From 81ddd3185ff9ad1818aebc457cd1efe53e31ff6a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 14 Aug 2022 19:29:36 -0700
Subject: [PATCH 09/36] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

glibc 2.35 ane newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..24d02865b164 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -132,6 +132,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -246,6 +247,15 @@ _void_cross_build_glibc() {
 	local tgt=$1
 	local ver=$2
 
+	# glibc 2.35 and newer uses -static-pie by default
+	# which does not work with -no-pie.
+	local oldcflags="${CFLAGS}"
+	local oldcxxflags="${CXXFLAGS}"
+	local oldldflags="${LDFLAGS}"
+	CFLAGS="${CFLAGS//"-fno-PIE"/}"
+	CXXFLAGS="${CXXFLAGS//"-fno-PIE"/}"
+	LDFLAGS="${LDFLAGS//"-no-pie"/}"
+
 	msg_normal "Building glibc for ${tgt}\n"
 
 	mkdir -p ${wrksrc}/glibc_build
@@ -279,6 +289,9 @@ _void_cross_build_glibc() {
 	make ${makejobs}
 	make install_root=${wrksrc}/build_root/usr/${tgt} install
 
+	CFLAGS="${oldcflags}"
+	CXXFLAGS="${oldcxxflags}"
+	LDFLAGS="${oldldflags}"
 	touch ${wrksrc}/.glibc_build_done
 }
 

From aaac0b15521b71b736777bee1a8ddadf6f1e5ef9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:08:52 -0700
Subject: [PATCH 10/36] openssh: suppress werror on gcc12

---
 srcpkgs/openssh/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/openssh/template b/srcpkgs/openssh/template
index 02a2dec35f42..6e8e343a9dca 100644
--- a/srcpkgs/openssh/template
+++ b/srcpkgs/openssh/template
@@ -40,7 +40,7 @@ if [ "$build_option_ldns" -a -z "$build_option_ssl" ]; then
 	broken="option 'ldns' requires option 'ssl'"
 fi
 
-CFLAGS="-Wno-format-truncation -Wno-stringop-truncation"
+CFLAGS="-Wno-format-truncation -Wno-stringop-truncation -Wno-error=maybe-uninitialized"
 
 case $XBPS_TARGET_MACHINE in
 	i686-musl)

From 0dbef6fd9fba43474ca926757847db6ed07e8f94 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:09:31 -0700
Subject: [PATCH 11/36] linux5.18: update dotconfigs for gcc12

---
 srcpkgs/linux5.18/files/x86_64-dotconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/linux5.18/files/x86_64-dotconfig b/srcpkgs/linux5.18/files/x86_64-dotconfig
index 4e73a3195d40..ea6204868e23 100644
--- a/srcpkgs/linux5.18/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.18/files/x86_64-dotconfig
@@ -512,6 +512,7 @@ CONFIG_RETHUNK=y
 CONFIG_CPU_UNRET_ENTRY=y
 CONFIG_CPU_IBPB_ENTRY=y
 CONFIG_CPU_IBRS_ENTRY=y
+CONFIG_SLS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10060,8 +10061,11 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
 # Memory initialization
 #
 CONFIG_INIT_STACK_NONE=y
+# CONFIG_INIT_STACK_ALL_PATTERN is not set
+# CONFIG_INIT_STACK_ALL_ZERO is not set
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
+# CONFIG_ZERO_CALL_USED_REGS is not set
 # end of Memory initialization
 # end of Kernel hardening options
 # end of Security options
@@ -10538,6 +10542,7 @@ CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
 # CONFIG_UBSAN is not set
 CONFIG_HAVE_ARCH_KCSAN=y
+# CONFIG_KCSAN is not set
 # end of Generic Kernel Debugging Instruments
 
 #

From 62e1274b3e2a25d3b22faa8a43d2a274f96ae2ff Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 18:00:42 -0700
Subject: [PATCH 12/36] xf86-video-vmware: fix build on gcc12

---
 ...183b3395333d5d4c73e25c2d011748f15eda.patch | 30 +++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch

diff --git a/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch b/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch
new file mode 100644
index 000000000000..ff839f16e628
--- /dev/null
+++ b/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch
@@ -0,0 +1,30 @@
+From 77b8183b3395333d5d4c73e25c2d011748f15eda Mon Sep 17 00:00:00 2001
+From: Rudi Heitbaum <rudi@heitbaum.com>
+Date: Sun, 8 May 2022 03:00:10 +0000
+Subject: [PATCH] vmwgfx: fix missing array notation
+
+ Fixes error identified by gcc-12.1.0 compiler
+
+make
+  CC       libvmwgfx_la-vmwgfx_tex_video.lo
+vmwgfx_tex_video.c: In function 'stop_video':
+vmwgfx_tex_video.c:240:20: error: the comparison will always evaluate as 'true' for the address of 'yuv' will never be NULL [-Werror=address]
+  240 |                if (priv->yuv[i]) {
+      |                    ^~~~
+---
+ vmwgfx/vmwgfx_tex_video.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/vmwgfx/vmwgfx_tex_video.c b/vmwgfx/vmwgfx_tex_video.c
+index acc2b56..480a5f1 100644
+--- a/vmwgfx/vmwgfx_tex_video.c
++++ b/vmwgfx/vmwgfx_tex_video.c
+@@ -237,7 +237,7 @@ stop_video(ScrnInfoPtr pScrn, pointer data, Bool shutdown)
+ 
+        for (i=0; i<3; ++i) {
+ 	   for (j=0; j<2; ++j) {
+-	       if (priv->yuv[i]) {
++	       if (priv->yuv[j][i]) {
+ 		   xa_surface_destroy(priv->yuv[j][i]);
+ 		   priv->yuv[j][i] = NULL;
+ 	       }

From 02ebec2937e580dbb90ddb65b7fc9cd7e3496530 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 18:54:53 -0700
Subject: [PATCH 13/36] qt5-webengine: fix build on gcc12

---
 .../patches/qt5-webengine-gcc12.patch             | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
 create mode 100644 srcpkgs/qt5-webengine/patches/qt5-webengine-gcc12.patch

diff --git a/srcpkgs/qt5-webengine/patches/qt5-webengine-gcc12.patch b/srcpkgs/qt5-webengine/patches/qt5-webengine-gcc12.patch
new file mode 100644
index 000000000000..366d25e012e4
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/qt5-webengine-gcc12.patch
@@ -0,0 +1,15 @@
+Add missing include for std::begin and std::end in SkParseColor.cpp
+
+https://skia-review.googlesource.com/c/skia/+/533981
+
+--- a/src/3rdparty/chromium/third_party/skia/src/utils/SkParseColor.cpp
++++ b/src/3rdparty/chromium/third_party/skia/src/utils/SkParseColor.cpp
+@@ -8,6 +8,8 @@
+ 
+ #include "include/utils/SkParse.h"
+ 
++#include <iterator>
++
+ static constexpr const char* gColorNames[] = {
+     "aliceblue",
+     "antiquewhite",

From 2e2614ae62bce9131f43ea174e232a59c2eec45c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:54 -0700
Subject: [PATCH 14/36] cross-aarch64-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..cb7ae97e7efe 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 0299cfd18f9829646212bfb9ea684d71d54c3dff Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:54 -0700
Subject: [PATCH 15/36] cross-aarch64-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..4fa950f334d4 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 53e620544c294b5806c0e89beb78822e3ede7b55 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:54 -0700
Subject: [PATCH 16/36] cross-arm-linux-gnueabi: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..194c0ab774b7 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From d6039e45d5c8f2a9769c92cb66c8013d979ac3be Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 17/36] cross-arm-linux-gnueabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..3f3242b85b07 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 027bc05acd1bc8d3c9e8f508db1a3ef6b61a6761 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 18/36] cross-arm-linux-musleabi: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..b0cdade60a6d 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 97d3e28b82b2bdf711421b49cc5cc4018e064f01 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 19/36] cross-arm-linux-musleabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..1924be24d483 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 6c422932e6cca92a5b5e24b260a24316ff62d148 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 20/36] cross-armv7l-linux-gnueabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..a7997d6db937 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 6debfe832bf40f6540cb16ca3e97ac458965d5e9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 21/36] cross-armv7l-linux-musleabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..aaa7040fbfef 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 2ba843741040b3b02fd0e36b077d88d87051b069 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 22/36] cross-i686-pc-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..765cf675e95c 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 6380ef64186d76c9826915397a7d5592667f0f37 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 23/36] cross-mips-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-mips-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..26928ba9442d 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 03a27620c041134898168ac2babf4423336f7617 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 24/36] cross-mips-linux-muslhf: update to gcc 12.1.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..fe74faf15d55 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 68e912c6d543cd3cafc386bef9662b25f9389c24 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 25/36] cross-mipsel-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..aa74d0b1acc7 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_musl_version=1.1.24
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From c3c114c1aea4233afd329bd2d2b5cc95d50b7cf2 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 26/36] cross-mipsel-linux-muslhf: update to gcc 12.1.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..83ab7f187085 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_musl_version=1.1.24
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 87871b5377993031bcd58d97e3d1b8c3f990c097 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 27/36] cross-powerpc-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..3ab1a4ea40fa 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 5397c9c34c24415391747ca496bda35494a6b9ed Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 28/36] cross-powerpc-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..af5586cacc77 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From e3d2cfe0e939adee97103ec0c3b82491713a90ff Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 29/36] cross-powerpc64-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..2604b268046b 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 3ede6e364d17c2356b7043c436c1b9633278ac09 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 30/36] cross-powerpc64-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 1ebd0fb2048d..c7894721b900 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
@@ -19,12 +19,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 2b4f44fe3996a8344fd034d6754fd025567c56ed Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 31/36] cross-powerpc64le-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 733f5851da5c..618235468970 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 3e5628ad2a9000aeb53232b2c743bc1e204304eb Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 32/36] cross-powerpc64le-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index 76a70aa1d6db..7edf9605e60d 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
@@ -19,12 +19,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From cbb862f1ff4580373b1fe91d074890b22ed99746 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 33/36] cross-powerpcle-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 347b8fcf4f55..cc10b7cbd88b 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 31534499731614bdfc080ad97cfc8c63fdd01a38 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 34/36] cross-powerpcle-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index ec9324ddaa99..1d38a3fa3559 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 1737b4fc345d71ca05f39da502dcc451b4a3dade Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 35/36] cross-x86_64-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 0078fbe7224b..9f740b00a80c 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 96657b5de3c18936276d3ef2a76d770520e474df Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 36/36] cross-x86_64-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..19e13f3818e9 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
@@ -17,12 +17,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.1.0
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (28 preceding siblings ...)
  2022-08-18 23:23 ` oreo639
@ 2022-08-19  0:22 ` oreo639
  2022-08-19  5:51 ` oreo639
                   ` (234 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-08-19  0:22 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 3015 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.1.0
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.1.0

This PR depends on: https://github.com/void-linux/void-packages/pull/32330

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

Also, keep in mind that the libgo musl patch here will need to be updated once musl is updated:
https://github.com/void-linux/void-packages/pull/34902/files#diff-1f42a95b93c9550178ff1fbccbef2f47a72711df15c24c9472e2550076978129R163-R176

This is the updated patch for reference:
https://github.com/alpinelinux/aports/blob/8acb21b8ee881e7ab1c812d9a66a17d2501b8730/main/gcc/0049-libgo-adjust-name-of-union-in-sigevent-struct.patch

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Known packages that need to be fixed for glibc 2.36:
- [ ] samba https://github.com/void-linux/void-packages/pull/38700
- [ ] qemu https://github.com/void-linux/void-packages/pull/38769
- [ ] llvm https://github.com/void-linux/void-packages/pull/38694
- [ ] m4 https://github.com/void-linux/void-packages/pull/33730

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 131345 bytes --]

From 9366a422c7e57a75bf7821c1bd5f34f95bd476cf Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 01/37] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 15 +++--
 3 files changed, 28 insertions(+), 113 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..4bdaee582d71 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkg-config"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -44,6 +45,12 @@ do_configure() {
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	case "$XBPS_TARGET_MACHINE" in
+		*-musl)
+			conf+=" --disable-gprofng"
+			;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"

From 2e37d51320d9beb02f6f0d300ba8a32e511c9caf Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 02/37] gcc: update to 12.1.0.

---
 common/shlibs                                 |  10 +-
 srcpkgs/gcc/files/gccgo-musl.patch            |  74 +++--------
 srcpkgs/gcc/files/libgnarl-musl.patch         |  18 +--
 srcpkgs/gcc/files/libssp-musl.patch           |  10 +-
 ...c21f3f5726823e19728fdd1571a14aae0fb3.patch | 105 ++++++++++++++++
 ...08065bdd36fb1a9b6aad9666b1edb5e06474.patch | 115 ++++++++++++++++++
 ...65517a59565758107c5b1a51a5fa382f8d1a.patch |  32 +++++
 srcpkgs/gcc/patches/libffi_gnulinux.patch     |  11 --
 .../gcc/patches/libgcc-ibm128-no-tag.patch    |  10 +-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |   3 +-
 srcpkgs/gcc/template                          |  25 ++--
 11 files changed, 305 insertions(+), 108 deletions(-)
 create mode 100644 srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
 create mode 100644 srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
 create mode 100644 srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index 2e5258f3a243..4ed747b361a2 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.1.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.34 perl-5.34.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -849,8 +849,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.1.0_1
+libgnat-12.so libada-12.1.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1701,8 +1701,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.1.0_1
+libasan.so.8 libsanitizer-12.1.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..632ef951097b 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,17 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ a/libgo/go/runtime/os_linux.go
+@@ -363,9 +363,9 @@
+ 
+ 	var timerid int32
+ 	var sevp _sigevent
+-	sevp.sigev_notify = _SIGEV_THREAD_ID
++	sevp.sigev_notify = 4
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.sigev_notify_function))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch b/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
new file mode 100644
index 000000000000..00929202a503
--- /dev/null
+++ b/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
@@ -0,0 +1,105 @@
+From 3b21c21f3f5726823e19728fdd1571a14aae0fb3 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <siarheit@google.com>
+Date: Mon, 27 Jun 2022 13:27:24 +0100
+Subject: [PATCH] c++: avoid <memory> poisoning on musl [PR106102]
+
+On musl <pthread.h> uses calloc() (via <sched.h>). <memory> includes
+it indirectly and exposes use of poisoned calloc() when module code
+is built:
+
+    /build/build/./prev-gcc/xg++ ... ../../gcc-13-20220626/gcc/cp/mapper-resolver.cc
+        In file included from /<<NIX>>/musl-1.2.3-dev/include/pthread.h:30,
+                 from /build/build/prev-x86_64-unknown-linux-musl/libstdc++-v3/include/x86_64-unknown-linux-musl/bits/gthr-default.h:35,
+                 ....
+                 from /build/build/prev-x86_64-unknown-linux-musl/libstdc++-v3/include/memory:77,
+                 from ../../gcc-13-20220626/gcc/../libcody/cody.hh:24,
+                 from ../../gcc-13-20220626/gcc/cp/../../c++tools/resolver.h:25,
+                 from ../../gcc-13-20220626/gcc/cp/../../c++tools/resolver.cc:23,
+                 from ../../gcc-13-20220626/gcc/cp/mapper-resolver.cc:32:
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:84:7: error: attempt to use poisoned "calloc"
+       84 | void *calloc(size_t, size_t);
+          |       ^
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:124:36: error: attempt to use poisoned "calloc"
+      124 | #define CPU_ALLOC(n) ((cpu_set_t *)calloc(1,CPU_ALLOC_SIZE(n)))
+          |                                    ^
+
+gcc/cp/
+
+	PR c++/106102
+	* mapper-client.cc: Include <memory> via "system.h".
+	* mapper-resolver.cc: Ditto.
+	* module.cc: Ditto.
+
+libcc1/
+
+	PR c++/106102
+	* libcc1plugin.cc: Include <memory> via "system.h".
+	* libcp1plugin.cc: Ditto.
+---
+ gcc/cp/mapper-client.cc   | 1 +
+ gcc/cp/mapper-resolver.cc | 1 +
+ gcc/cp/module.cc          | 1 +
+ libcc1/libcc1plugin.cc    | 1 +
+ libcc1/libcp1plugin.cc    | 1 +
+ 5 files changed, 5 insertions(+)
+
+diff --git a/gcc/cp/mapper-client.cc b/gcc/cp/mapper-client.cc
+index 8603a886a099..fe9544b5ba43 100644
+--- a/gcc/cp/mapper-client.cc
++++ b/gcc/cp/mapper-client.cc
+@@ -27,6 +27,7 @@ along with GCC; see the file COPYING3.  If not see
+ #define INCLUDE_STRING
+ #define INCLUDE_VECTOR
+ #define INCLUDE_MAP
++#define INCLUDE_MEMORY
+ #include "system.h"
+ 
+ #include "line-map.h"
+diff --git a/gcc/cp/mapper-resolver.cc b/gcc/cp/mapper-resolver.cc
+index e3d29fb5ada1..e70d1b4ae2ca 100644
+--- a/gcc/cp/mapper-resolver.cc
++++ b/gcc/cp/mapper-resolver.cc
+@@ -25,6 +25,7 @@ along with GCC; see the file COPYING3.  If not see
+ #define INCLUDE_VECTOR
+ #define INCLUDE_ALGORITHM
+ #define INCLUDE_MAP
++#define INCLUDE_MEMORY
+ #include "system.h"
+ 
+ // We don't want or need to be aware of networking
+diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc
+index 753963a4b246..8bb22c2b305a 100644
+--- a/gcc/cp/module.cc
++++ b/gcc/cp/module.cc
+@@ -206,6 +206,7 @@ Classes used:
+ 
+ #define _DEFAULT_SOURCE 1 /* To get TZ field of struct tm, if available.  */
+ #include "config.h"
++#define INCLUDE_MEMORY
+ #define INCLUDE_STRING
+ #define INCLUDE_VECTOR
+ #include "system.h"
+diff --git a/libcc1/libcc1plugin.cc b/libcc1/libcc1plugin.cc
+index 12ab5a57c8dd..bdd0bdabe77f 100644
+--- a/libcc1/libcc1plugin.cc
++++ b/libcc1/libcc1plugin.cc
+@@ -31,6 +31,7 @@
+ #undef PACKAGE_TARNAME
+ #undef PACKAGE_VERSION
+ 
++#define INCLUDE_MEMORY
+ #include "gcc-plugin.h"
+ #include "system.h"
+ #include "coretypes.h"
+diff --git a/libcc1/libcp1plugin.cc b/libcc1/libcp1plugin.cc
+index 83dab7f58b11..e2d5039a0a1f 100644
+--- a/libcc1/libcp1plugin.cc
++++ b/libcc1/libcp1plugin.cc
+@@ -32,6 +32,7 @@
+ #undef PACKAGE_TARNAME
+ #undef PACKAGE_VERSION
+ 
++#define INCLUDE_MEMORY
+ #include "gcc-plugin.h"
+ #include "system.h"
+ #include "coretypes.h"
diff --git a/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch b/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
new file mode 100644
index 000000000000..89bd053d6d04
--- /dev/null
+++ b/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
@@ -0,0 +1,115 @@
+From 49d508065bdd36fb1a9b6aad9666b1edb5e06474 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <siarheit@google.com>
+Date: Mon, 27 Jun 2022 23:42:44 +0100
+Subject: [PATCH] jit: avoid calloc() poisoning on musl [PR106102]
+
+On musl <pthread.h> uses calloc() (via <sched.h>). jit/ includes
+it directly and exposes use of poisoned calloc():
+
+    /build/build/./prev-gcc/xg++ ... ../../gcc-13-20220626/gcc/jit/jit-playback.cc
+    make[3]: *** [Makefile:1143: jit/libgccjit.o] Error 1
+    make[3]: *** Waiting for unfinished jobs....
+    In file included from /<<NIX>>/musl-1.2.3-dev/include/pthread.h:30,
+                     from ../../gcc-13-20220626/gcc/jit/jit-playback.cc:44:
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:84:7: error: attempt to use poisoned "calloc"
+       84 | void *calloc(size_t, size_t);
+          |       ^
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:124:36: error: attempt to use poisoned "calloc"
+      124 | #define CPU_ALLOC(n) ((cpu_set_t *)calloc(1,CPU_ALLOC_SIZE(n)))
+          |                                    ^
+
+The change moves <pthread.h> inclusion to "system.h" under new
+INCLUDE_PTHREAD_H guard and uses this mechanism in libgccjit.
+
+gcc/
+
+	PR c++/106102
+	* system.h: Introduce INCLUDE_PTHREAD_H macros to include <pthread.h>.
+
+gcc/jit/
+
+	PR c++/106102
+	* jit-playback.cc: Include <pthread.h> via "system.h" to avoid calloc()
+	poisoning.
+	* jit-recording.cc: Ditto.
+	* libgccjit.cc: Ditto.
+---
+ gcc/jit/jit-playback.cc  | 3 +--
+ gcc/jit/jit-recording.cc | 2 +-
+ gcc/jit/libgccjit.cc     | 2 +-
+ gcc/system.h             | 4 ++++
+ 4 files changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/gcc/jit/jit-playback.cc b/gcc/jit/jit-playback.cc
+index 6be6bdf8dea5..79714132b91a 100644
+--- a/gcc/jit/jit-playback.cc
++++ b/gcc/jit/jit-playback.cc
+@@ -19,6 +19,7 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "target.h"
+@@ -41,8 +42,6 @@ along with GCC; see the file COPYING3.  If not see
+ #include "diagnostic.h"
+ #include "stmt.h"
+ 
+-#include <pthread.h>
+-
+ #include "jit-playback.h"
+ #include "jit-result.h"
+ #include "jit-builtins.h"
+diff --git a/gcc/jit/jit-recording.cc b/gcc/jit/jit-recording.cc
+index 697dee66e733..f78daed2d71a 100644
+--- a/gcc/jit/jit-recording.cc
++++ b/gcc/jit/jit-recording.cc
+@@ -19,13 +19,13 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "tm.h"
+ #include "pretty-print.h"
+ #include "toplev.h"
+ 
+-#include <pthread.h>
+ 
+ #include "jit-builtins.h"
+ #include "jit-recording.h"
+diff --git a/gcc/jit/libgccjit.cc b/gcc/jit/libgccjit.cc
+index 0e76097b4bac..ca862662777e 100644
+--- a/gcc/jit/libgccjit.cc
++++ b/gcc/jit/libgccjit.cc
+@@ -19,12 +19,12 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "timevar.h"
+ #include "typed-splay-tree.h"
+ #include "cppbuiltin.h"
+-#include <pthread.h>
+ 
+ #include "libgccjit.h"
+ #include "jit-recording.h"
+diff --git a/gcc/system.h b/gcc/system.h
+index 67158b70c789..f8d42ff68150 100644
+--- a/gcc/system.h
++++ b/gcc/system.h
+@@ -753,6 +753,10 @@ extern int vsnprintf (char *, size_t, const char *, va_list);
+ #endif
+ #endif
+ 
++#ifdef INCLUDE_PTHREAD_H
++#include <pthread.h>
++#endif
++
+ #ifdef INCLUDE_ISL
+ #ifdef HAVE_isl
+ #include <isl/options.h>
diff --git a/srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch b/srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch
new file mode 100644
index 000000000000..044a4fc29514
--- /dev/null
+++ b/srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch
@@ -0,0 +1,32 @@
+From f35d65517a59565758107c5b1a51a5fa382f8d1a Mon Sep 17 00:00:00 2001
+From: Ian Lance Taylor <iant@golang.org>
+Date: Tue, 12 Jul 2022 19:42:43 -0700
+Subject: [PATCH] libgo: don't include <linux/fs.h> when building
+ gen-sysinfo.go
+
+Removing this doesn't change anything at least with glibc 2.33.
+The include was added in https://go.dev/cl/6100049 but it's not
+clear why.
+
+Fixes PR go/106266
+
+Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/417294
+---
+ gcc/go/gofrontend/MERGE | 2 +-
+ libgo/sysinfo.c         | 3 ---
+ 2 files changed, 1 insertion(+), 4 deletions(-)
+
+diff --git a/libgo/sysinfo.c b/libgo/sysinfo.c
+index a4259c02ded4..fc0210992faa 100644
+--- a/libgo/sysinfo.c
++++ b/libgo/sysinfo.c
+@@ -158,9 +158,6 @@
+ #if defined(HAVE_LINUX_ETHER_H)
+ #include <linux/ether.h>
+ #endif
+-#if defined(HAVE_LINUX_FS_H)
+-#include <linux/fs.h>
+-#endif
+ #if defined(HAVE_LINUX_REBOOT_H)
+ #include <linux/reboot.h>
+ #endif
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..78a2ce35875d 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,9 +3,10 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
  
  #  ifndef _ABIN32
+
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..32ee79e32f0d 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,15 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
+version=12.1.0
+revision=1
 _patchver="${version%pre*}"
 _minorver="${_patchver%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 wrksrc=gcc-${version/pre/_pre}
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +19,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -396,7 +393,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}

From b9014d4d9c032dabbdad252e2801e4332c4cfd4f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 03/37] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      |  6 ++--
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..08e35d466a44 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From f359203e193fb19dff85868f3a448c6a6e4ca7f7 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 04/37] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 1a4e1ca3d594..b04268908c2e 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="q66 <daniel@octaforge.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From 42bd9e22f93f8aab4c55b8a98e89b1c0c364cbda Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 05/37] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 3 files changed, 55 insertions(+), 353 deletions(-)
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index 4ed747b361a2..46e4674c7fe0 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From fccc027b73a8ff2d1873f9ebd47f8b89faef886d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 16:22:03 -0700
Subject: [PATCH 06/37] llvm12: fix build for glibc 2.36

---
 .../compiler-rt-sanitizer-glibc-2.36.patch    | 59 +++++++++++++++++++
 .../compiler-rt-sanitizer-glibc-2.36.patch    | 59 +++++++++++++++++++
 2 files changed, 118 insertions(+)
 create mode 100644 srcpkgs/llvm12/compiler-rt-sanitizer-glibc-2.36.patch
 create mode 100644 srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch

diff --git a/srcpkgs/llvm12/compiler-rt-sanitizer-glibc-2.36.patch b/srcpkgs/llvm12/compiler-rt-sanitizer-glibc-2.36.patch
new file mode 100644
index 000000000000..e5f24dab8935
--- /dev/null
+++ b/srcpkgs/llvm12/compiler-rt-sanitizer-glibc-2.36.patch
@@ -0,0 +1,59 @@
+From 9cf13067cb5088626ba7ee1ec4c42ec59c7995a0 Mon Sep 17 00:00:00 2001
+From: Fangrui Song <i@maskray.me>
+Date: Mon, 11 Jul 2022 12:53:34 -0700
+Subject: [PATCH] [sanitizer] Remove #include <linux/fs.h> to resolve
+ fsconfig_command/mount_attr conflict with glibc 2.36
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+It is generally not a good idea to mix usage of glibc headers and Linux UAPI
+headers (https://sourceware.org/glibc/wiki/Synchronizing_Headers). In glibc
+since 7eae6a91e9b1670330c9f15730082c91c0b1d570 (milestone: 2.36), sys/mount.h
+defines `fsconfig_command` which conflicts with linux/mount.h:
+
+    .../usr/include/linux/mount.h:95:6: error: redeclaration of ‘enum fsconfig_command’
+
+Remove #include <linux/fs.h> which pulls in linux/mount.h. Expand its 4 macros manually.
+Android sys/mount.h doesn't define BLKBSZGET and it still needs linux/fs.h.
+In the long term we should move Linux specific definitions to sanitizer_platform_limits_linux.cpp
+but this commit is easy to cherry pick into older compiler-rt releases.
+
+Fix https://github.com/llvm/llvm-project/issues/56421
+
+Reviewed By: #sanitizers, vitalybuka, zatrazz
+
+Differential Revision: https://reviews.llvm.org/D129471
+---
+ .../sanitizer_platform_limits_posix.cpp                | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+index 4bd425435d56d..3a94b260686f1 100644
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -73,7 +73,9 @@
+ #include <sys/vt.h>
+ #include <linux/cdrom.h>
+ #include <linux/fd.h>
++#if SANITIZER_ANDROID
+ #include <linux/fs.h>
++#endif
+ #include <linux/hdreg.h>
+ #include <linux/input.h>
+ #include <linux/ioctl.h>
+@@ -876,10 +878,10 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
+   unsigned IOCTL_EVIOCGPROP = IOCTL_NOT_PRESENT;
+   unsigned IOCTL_EVIOCSKEYCODE_V2 = IOCTL_NOT_PRESENT;
+ #endif
+-  unsigned IOCTL_FS_IOC_GETFLAGS = FS_IOC_GETFLAGS;
+-  unsigned IOCTL_FS_IOC_GETVERSION = FS_IOC_GETVERSION;
+-  unsigned IOCTL_FS_IOC_SETFLAGS = FS_IOC_SETFLAGS;
+-  unsigned IOCTL_FS_IOC_SETVERSION = FS_IOC_SETVERSION;
++  unsigned IOCTL_FS_IOC_GETFLAGS = _IOR('f', 1, long);
++  unsigned IOCTL_FS_IOC_GETVERSION = _IOR('v', 1, long);
++  unsigned IOCTL_FS_IOC_SETFLAGS = _IOW('f', 2, long);
++  unsigned IOCTL_FS_IOC_SETVERSION = _IOW('v', 2, long);
+   unsigned IOCTL_GIO_CMAP = GIO_CMAP;
+   unsigned IOCTL_GIO_FONT = GIO_FONT;
+   unsigned IOCTL_GIO_UNIMAP = GIO_UNIMAP;
diff --git a/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch b/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch
new file mode 100644
index 000000000000..e5f24dab8935
--- /dev/null
+++ b/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch
@@ -0,0 +1,59 @@
+From 9cf13067cb5088626ba7ee1ec4c42ec59c7995a0 Mon Sep 17 00:00:00 2001
+From: Fangrui Song <i@maskray.me>
+Date: Mon, 11 Jul 2022 12:53:34 -0700
+Subject: [PATCH] [sanitizer] Remove #include <linux/fs.h> to resolve
+ fsconfig_command/mount_attr conflict with glibc 2.36
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+It is generally not a good idea to mix usage of glibc headers and Linux UAPI
+headers (https://sourceware.org/glibc/wiki/Synchronizing_Headers). In glibc
+since 7eae6a91e9b1670330c9f15730082c91c0b1d570 (milestone: 2.36), sys/mount.h
+defines `fsconfig_command` which conflicts with linux/mount.h:
+
+    .../usr/include/linux/mount.h:95:6: error: redeclaration of ‘enum fsconfig_command’
+
+Remove #include <linux/fs.h> which pulls in linux/mount.h. Expand its 4 macros manually.
+Android sys/mount.h doesn't define BLKBSZGET and it still needs linux/fs.h.
+In the long term we should move Linux specific definitions to sanitizer_platform_limits_linux.cpp
+but this commit is easy to cherry pick into older compiler-rt releases.
+
+Fix https://github.com/llvm/llvm-project/issues/56421
+
+Reviewed By: #sanitizers, vitalybuka, zatrazz
+
+Differential Revision: https://reviews.llvm.org/D129471
+---
+ .../sanitizer_platform_limits_posix.cpp                | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+index 4bd425435d56d..3a94b260686f1 100644
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -73,7 +73,9 @@
+ #include <sys/vt.h>
+ #include <linux/cdrom.h>
+ #include <linux/fd.h>
++#if SANITIZER_ANDROID
+ #include <linux/fs.h>
++#endif
+ #include <linux/hdreg.h>
+ #include <linux/input.h>
+ #include <linux/ioctl.h>
+@@ -876,10 +878,10 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
+   unsigned IOCTL_EVIOCGPROP = IOCTL_NOT_PRESENT;
+   unsigned IOCTL_EVIOCSKEYCODE_V2 = IOCTL_NOT_PRESENT;
+ #endif
+-  unsigned IOCTL_FS_IOC_GETFLAGS = FS_IOC_GETFLAGS;
+-  unsigned IOCTL_FS_IOC_GETVERSION = FS_IOC_GETVERSION;
+-  unsigned IOCTL_FS_IOC_SETFLAGS = FS_IOC_SETFLAGS;
+-  unsigned IOCTL_FS_IOC_SETVERSION = FS_IOC_SETVERSION;
++  unsigned IOCTL_FS_IOC_GETFLAGS = _IOR('f', 1, long);
++  unsigned IOCTL_FS_IOC_GETVERSION = _IOR('v', 1, long);
++  unsigned IOCTL_FS_IOC_SETFLAGS = _IOW('f', 2, long);
++  unsigned IOCTL_FS_IOC_SETVERSION = _IOW('v', 2, long);
+   unsigned IOCTL_GIO_CMAP = GIO_CMAP;
+   unsigned IOCTL_GIO_FONT = GIO_FONT;
+   unsigned IOCTL_GIO_UNIMAP = GIO_UNIMAP;

From 5decce17bde82ecb83baf8b68135290e638fb87e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 16:22:29 -0700
Subject: [PATCH 07/37] samba: fix build for glibc 2.36

---
 srcpkgs/samba/patches/fix-glibc-2.36.patch | 59 ++++++++++++++++++++++
 1 file changed, 59 insertions(+)
 create mode 100644 srcpkgs/samba/patches/fix-glibc-2.36.patch

diff --git a/srcpkgs/samba/patches/fix-glibc-2.36.patch b/srcpkgs/samba/patches/fix-glibc-2.36.patch
new file mode 100644
index 000000000000..beb84ce6a8de
--- /dev/null
+++ b/srcpkgs/samba/patches/fix-glibc-2.36.patch
@@ -0,0 +1,59 @@
+From 766151bf5b7ef95ae4c8c98b8994e5c21c5bbec0 Mon Sep 17 00:00:00 2001
+From: Andreas Schneider <asn@samba.org>
+Date: Tue, 2 Aug 2022 07:55:46 +0200
+Subject: [PATCH] lib:replace: Only include <sys/mount.h> on non-Linux systems
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Details at:
+https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
+
+BUG: https://bugzilla.samba.org/show_bug.cgi?id=15132
+
+Signed-off-by: Andreas Schneider <asn@samba.org>
+Reviewed-by: Ralph Boehme <slow@samba.org>
+
+Autobuild-User(master): Ralph Böhme <slow@samba.org>
+Autobuild-Date(master): Tue Aug  2 11:05:14 UTC 2022 on sn-devel-184
+---
+ lib/replace/system/filesys.h | 4 +++-
+ lib/replace/wscript          | 3 +++
+ 2 files changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/lib/replace/system/filesys.h b/lib/replace/system/filesys.h
+index 034e5d5886c..bb9482c69af 100644
+--- a/lib/replace/system/filesys.h
++++ b/lib/replace/system/filesys.h
+@@ -36,7 +36,8 @@
+ #include <sys/param.h>
+ #endif
+ 
+-#ifdef HAVE_SYS_MOUNT_H
++/* This include is required on UNIX (*BSD, AIX, ...) for statfs() */
++#if !defined(LINUX) && defined(HAVE_SYS_MOUNT_H)
+ #include <sys/mount.h>
+ #endif
+ 
+@@ -44,6 +45,7 @@
+ #include <mntent.h>
+ #endif
+ 
++/* This include is required on Linux for statfs() */
+ #ifdef HAVE_SYS_VFS_H
+ #include <sys/vfs.h>
+ #endif
+diff --git a/lib/replace/wscript b/lib/replace/wscript
+index 4c774d9f0c3..dd9b19219a1 100644
+--- a/lib/replace/wscript
++++ b/lib/replace/wscript
+@@ -31,6 +31,9 @@ def configure(conf):
+ 
+     conf.env.standalone_replace = conf.IN_LAUNCH_DIR()
+ 
++    if sys.platform.rfind('linux') > -1:
++        conf.DEFINE('LINUX', '1')
++
+     conf.DEFINE('BOOL_DEFINED', 1)
+     conf.DEFINE('HAVE_LIBREPLACE', 1)
+     conf.DEFINE('LIBREPLACE_NETWORK_CHECKS', 1)

From 8f3b5a03d6f955229e3634e8172a79a2839cd6d5 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 16:22:47 -0700
Subject: [PATCH 08/37] qemu: fix build for glibc 2.36

---
 .../qemu/patches/fix-compat-glibc-2.36.patch  | 100 ++++++++++++++++++
 1 file changed, 100 insertions(+)
 create mode 100644 srcpkgs/qemu/patches/fix-compat-glibc-2.36.patch

diff --git a/srcpkgs/qemu/patches/fix-compat-glibc-2.36.patch b/srcpkgs/qemu/patches/fix-compat-glibc-2.36.patch
new file mode 100644
index 000000000000..e7239ad06313
--- /dev/null
+++ b/srcpkgs/qemu/patches/fix-compat-glibc-2.36.patch
@@ -0,0 +1,100 @@
+From 3cd3df2a9584e6f753bb62a0028bd67124ab5532 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= <berrange@redhat.com>
+Date: Tue, 2 Aug 2022 12:41:34 -0400
+Subject: [PATCH] linux-user: fix compat with glibc >= 2.36 sys/mount.h
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The latest glibc 2.36 has extended sys/mount.h so that it
+defines the FSCONFIG_* enum constants. These are historically
+defined in linux/mount.h, and thus if you include both headers
+the compiler complains:
+
+In file included from /usr/include/linux/fs.h:19,
+                 from ../linux-user/syscall.c:98:
+/usr/include/linux/mount.h:95:6: error: redeclaration of 'enum fsconfig_command'
+   95 | enum fsconfig_command {
+      |      ^~~~~~~~~~~~~~~~
+In file included from ../linux-user/syscall.c:31:
+/usr/include/sys/mount.h:189:6: note: originally defined here
+  189 | enum fsconfig_command
+      |      ^~~~~~~~~~~~~~~~
+/usr/include/linux/mount.h:96:9: error: redeclaration of enumerator 'FSCONFIG_SET_FLAG'
+   96 |         FSCONFIG_SET_FLAG       = 0,    /* Set parameter, supplying no value */
+      |         ^~~~~~~~~~~~~~~~~
+/usr/include/sys/mount.h:191:3: note: previous definition of 'FSCONFIG_SET_FLAG' with type 'enum fsconfig_command'
+  191 |   FSCONFIG_SET_FLAG       = 0,    /* Set parameter, supplying no value */
+      |   ^~~~~~~~~~~~~~~~~
+...snip...
+
+QEMU doesn't include linux/mount.h, but it does use
+linux/fs.h and thus gets linux/mount.h indirectly.
+
+glibc acknowledges this problem but does not appear to
+be intending to fix it in the forseeable future, simply
+documenting it as a known incompatibility with no
+workaround:
+
+  https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
+  https://sourceware.org/glibc/wiki/Synchronizing_Headers
+
+To address this requires either removing use of sys/mount.h
+or linux/fs.h, despite QEMU needing declarations from
+both.
+
+This patch removes linux/fs.h, meaning we have to define
+various FS_IOC constants that are now unavailable.
+
+Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
+Tested-by: Richard W.M. Jones <rjones@redhat.com>
+Message-Id: <20220802164134.1851910-1-berrange@redhat.com>
+Signed-off-by: Laurent Vivier <laurent@vivier.eu>
+---
+ linux-user/syscall.c | 18 ++++++++++++++++++
+ meson.build          |  2 ++
+ 2 files changed, 20 insertions(+)
+
+diff --git a/linux-user/syscall.c b/linux-user/syscall.c
+index ef53feb5ab45..f4091212027c 100644
+--- a/linux-user/syscall.c
++++ b/linux-user/syscall.c
+@@ -95,7 +95,25 @@
+ #include <linux/soundcard.h>
+ #include <linux/kd.h>
+ #include <linux/mtio.h>
++
++#ifdef HAVE_SYS_MOUNT_FSCONFIG
++/*
++ * glibc >= 2.36 linux/mount.h conflicts with sys/mount.h,
++ * which in turn prevents use of linux/fs.h. So we have to
++ * define the constants ourselves for now.
++ */
++#define FS_IOC_GETFLAGS                _IOR('f', 1, long)
++#define FS_IOC_SETFLAGS                _IOW('f', 2, long)
++#define FS_IOC_GETVERSION              _IOR('v', 1, long)
++#define FS_IOC_SETVERSION              _IOW('v', 2, long)
++#define FS_IOC_FIEMAP                  _IOWR('f', 11, struct fiemap)
++#define FS_IOC32_GETFLAGS              _IOR('f', 1, int)
++#define FS_IOC32_SETFLAGS              _IOW('f', 2, int)
++#define FS_IOC32_GETVERSION            _IOR('v', 1, int)
++#define FS_IOC32_SETVERSION            _IOW('v', 2, int)
++#else
+ #include <linux/fs.h>
++#endif
+ #include <linux/fd.h>
+ #if defined(CONFIG_FIEMAP)
+ #include <linux/fiemap.h>
+diff --git a/meson.build b/meson.build
+index 294e9a8f329e..30a380752c0d 100644
+--- a/meson.build
++++ b/meson.build
+@@ -1963,6 +1963,8 @@ config_host_data.set('HAVE_OPTRESET',
+                      cc.has_header_symbol('getopt.h', 'optreset'))
+ config_host_data.set('HAVE_IPPROTO_MPTCP',
+                      cc.has_header_symbol('netinet/in.h', 'IPPROTO_MPTCP'))
++config_host_data.set('HAVE_SYS_MOUNT_FSCONFIG',
++                     cc.has_header_symbol('sys/mount.h', 'FSCONFIG_SET_FLAG'))
+ 
+ # has_member
+ config_host_data.set('HAVE_SIGEV_NOTIFY_THREAD_ID',

From 50b370142ad6df88b7c1660c23ac36114828ee44 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 17:21:40 -0700
Subject: [PATCH 09/37] m4: update to 1.4.19.

---
 srcpkgs/m4/patches/fix-glibc-2.27.patch | 167 ------------------------
 srcpkgs/m4/template                     |  12 +-
 2 files changed, 6 insertions(+), 173 deletions(-)
 delete mode 100644 srcpkgs/m4/patches/fix-glibc-2.27.patch

diff --git a/srcpkgs/m4/patches/fix-glibc-2.27.patch b/srcpkgs/m4/patches/fix-glibc-2.27.patch
deleted file mode 100644
index 59d33cff164d..000000000000
--- a/srcpkgs/m4/patches/fix-glibc-2.27.patch
+++ /dev/null
@@ -1,167 +0,0 @@
-From 4af4a4a71827c0bc5e0ec67af23edef4f15cee8e Mon Sep 17 00:00:00 2001
-From: Paul Eggert <eggert@cs.ucla.edu>
-Date: Mon, 5 Mar 2018 10:56:29 -0800
-Subject: [PATCH] fflush: adjust to glibc 2.28 libio.h removal
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Problem reported by Daniel P. Berrangé in:
-https://lists.gnu.org/r/bug-gnulib/2018-03/msg00000.html
-* lib/fbufmode.c (fbufmode):
-* lib/fflush.c (clear_ungetc_buffer_preserving_position)
-(disable_seek_optimization, rpl_fflush):
-* lib/fpending.c (__fpending):
-* lib/fpurge.c (fpurge):
-* lib/freadable.c (freadable):
-* lib/freadahead.c (freadahead):
-* lib/freading.c (freading):
-* lib/freadptr.c (freadptr):
-* lib/freadseek.c (freadptrinc):
-* lib/fseeko.c (fseeko):
-* lib/fseterr.c (fseterr):
-* lib/fwritable.c (fwritable):
-* lib/fwriting.c (fwriting):
-Check _IO_EOF_SEEN instead of _IO_ftrylockfile.
-* lib/stdio-impl.h (_IO_IN_BACKUP) [_IO_EOF_SEEN]:
-Define if not already defined.
-
-[yann.morin.1998@free.fr: partially backport from upstream gnulib]
-Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
-
----
- lib/fflush.c     |  6 +++---
- lib/fpending.c   |  2 +-
- lib/fpurge.c     |  2 +-
- lib/freadahead.c |  2 +-
- lib/freading.c   |  2 +-
- lib/fseeko.c     |  4 ++--
- lib/stdio-impl.h |  6 ++++++
- 7 files changed, 15 insertions(+), 9 deletions(-)
-
-diff --git a/lib/fflush.c b/build-aux/gnulib/lib/fflush.c
-index 983ade0ff..a6edfa105 100644
---- a/lib/fflush.c
-+++ b/lib/fflush.c
-@@ -33,7 +33,7 @@
- #undef fflush
- 
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- 
- /* Clear the stream's ungetc buffer, preserving the value of ftello (fp).  */
- static void
-@@ -72,7 +72,7 @@ clear_ungetc_buffer (FILE *fp)
- 
- #endif
- 
--#if ! (defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
-+#if ! (defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
- 
- # if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT
- /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
-@@ -148,7 +148,7 @@ rpl_fflush (FILE *stream)
-   if (stream == NULL || ! freading (stream))
-     return fflush (stream);
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- 
-   clear_ungetc_buffer_preserving_position (stream);
- 
-diff --git a/lib/fpending.c b/build-aux/gnulib/lib/fpending.c
-index c84e3a5b4..789f50e4e 100644
---- a/lib/fpending.c
-+++ b/lib/fpending.c
-@@ -32,7 +32,7 @@ __fpending (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   return fp->_IO_write_ptr - fp->_IO_write_base;
- #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
-   /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
-diff --git a/lib/fpurge.c b/build-aux/gnulib/lib/fpurge.c
-index b1d417c7a..3aedcc373 100644
---- a/lib/fpurge.c
-+++ b/lib/fpurge.c
-@@ -62,7 +62,7 @@ fpurge (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   fp->_IO_read_end = fp->_IO_read_ptr;
-   fp->_IO_write_ptr = fp->_IO_write_base;
-   /* Avoid memory leak when there is an active ungetc buffer.  */
-diff --git a/lib/freadahead.c b/build-aux/gnulib/lib/freadahead.c
-index c2ecb5b28..23ec76ee5 100644
---- a/lib/freadahead.c
-+++ b/lib/freadahead.c
-@@ -30,7 +30,7 @@ extern size_t __sreadahead (FILE *);
- size_t
- freadahead (FILE *fp)
- {
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   if (fp->_IO_write_ptr > fp->_IO_write_base)
-     return 0;
-   return (fp->_IO_read_end - fp->_IO_read_ptr)
-diff --git a/lib/freading.c b/build-aux/gnulib/lib/freading.c
-index 73c28acdd..c24d0c88a 100644
---- a/lib/freading.c
-+++ b/lib/freading.c
-@@ -31,7 +31,7 @@ freading (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   return ((fp->_flags & _IO_NO_WRITES) != 0
-           || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0
-               && fp->_IO_read_base != NULL));
-diff --git a/lib/fseeko.c b/build-aux/gnulib/lib/fseeko.c
-index 0101ab55f..193f4e8ce 100644
---- a/lib/fseeko.c
-+++ b/lib/fseeko.c
-@@ -47,7 +47,7 @@ fseeko (FILE *fp, off_t offset, int whence)
- #endif
- 
-   /* These tests are based on fpurge.c.  */
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   if (fp->_IO_read_end == fp->_IO_read_ptr
-       && fp->_IO_write_ptr == fp->_IO_write_base
-       && fp->_IO_save_base == NULL)
-@@ -123,7 +123,7 @@ fseeko (FILE *fp, off_t offset, int whence)
-           return -1;
-         }
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-       fp->_flags &= ~_IO_EOF_SEEN;
-       fp->_offset = pos;
- #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
-diff --git a/lib/stdio-impl.h b/build-aux/gnulib/lib/stdio-impl.h
-index 78d896e9f..05c5752a2 100644
---- a/lib/stdio-impl.h
-+++ b/lib/stdio-impl.h
-@@ -18,6 +18,12 @@
-    the same implementation of stdio extension API, except that some fields
-    have different naming conventions, or their access requires some casts.  */
- 
-+/* Glibc 2.28 made _IO_IN_BACKUP private.  For now, work around this
-+   problem by defining it ourselves.  FIXME: Do not rely on glibc
-+   internals.  */
-+#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN
-+# define _IO_IN_BACKUP 0x100
-+#endif
- 
- /* BSD stdio derived implementations.  */
- 
--- 
-2.14.1
-
-
diff --git a/srcpkgs/m4/template b/srcpkgs/m4/template
index 78f3dae6184a..762593d883bd 100644
--- a/srcpkgs/m4/template
+++ b/srcpkgs/m4/template
@@ -1,17 +1,17 @@
 # Template file for 'm4'
 pkgname=m4
-version=1.4.18
-revision=2
+version=1.4.19
+revision=1
 bootstrap=yes
-replaces="chroot-m4>=0"
 build_style=gnu-configure
 configure_args="--enable-changeword --enable-threads"
 short_desc="GNU version of UNIX m4 macro language processor"
-homepage="https://www.gnu.org/software/m4/"
-license="GPL-3.0-or-later"
 maintainer="Enno Boland <gottox@voidlinux.org>"
+license="GPL-3.0-or-later"
+homepage="https://www.gnu.org/software/m4/"
 distfiles="${GNU_SITE}/${pkgname}/${pkgname}-${version}.tar.xz"
-checksum=f2c1e86ca0a404ff281631bdc8377638992744b175afb806e25871a24a934e07
+checksum=63aede5c6d33b6d9b13511cd0be2cac046f2e70fd0a07aa9573a04a82783af96
+replaces="chroot-m4>=0"
 
 if [ "$XBPS_TARGET_LIBC" = musl ]; then
 	export ac_cv_lib_error_at_line=no

From f5b6782a1803288e0326460b182e2fa8eccdf3c6 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 14 Aug 2022 19:29:36 -0700
Subject: [PATCH 10/37] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

glibc 2.35 ane newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..24d02865b164 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -132,6 +132,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -246,6 +247,15 @@ _void_cross_build_glibc() {
 	local tgt=$1
 	local ver=$2
 
+	# glibc 2.35 and newer uses -static-pie by default
+	# which does not work with -no-pie.
+	local oldcflags="${CFLAGS}"
+	local oldcxxflags="${CXXFLAGS}"
+	local oldldflags="${LDFLAGS}"
+	CFLAGS="${CFLAGS//"-fno-PIE"/}"
+	CXXFLAGS="${CXXFLAGS//"-fno-PIE"/}"
+	LDFLAGS="${LDFLAGS//"-no-pie"/}"
+
 	msg_normal "Building glibc for ${tgt}\n"
 
 	mkdir -p ${wrksrc}/glibc_build
@@ -279,6 +289,9 @@ _void_cross_build_glibc() {
 	make ${makejobs}
 	make install_root=${wrksrc}/build_root/usr/${tgt} install
 
+	CFLAGS="${oldcflags}"
+	CXXFLAGS="${oldcxxflags}"
+	LDFLAGS="${oldldflags}"
 	touch ${wrksrc}/.glibc_build_done
 }
 

From 6cf9f88e94ec08aa7e3f6b027896491009f4df29 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:08:52 -0700
Subject: [PATCH 11/37] openssh: suppress werror on gcc12

---
 srcpkgs/openssh/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/openssh/template b/srcpkgs/openssh/template
index 02a2dec35f42..6e8e343a9dca 100644
--- a/srcpkgs/openssh/template
+++ b/srcpkgs/openssh/template
@@ -40,7 +40,7 @@ if [ "$build_option_ldns" -a -z "$build_option_ssl" ]; then
 	broken="option 'ldns' requires option 'ssl'"
 fi
 
-CFLAGS="-Wno-format-truncation -Wno-stringop-truncation"
+CFLAGS="-Wno-format-truncation -Wno-stringop-truncation -Wno-error=maybe-uninitialized"
 
 case $XBPS_TARGET_MACHINE in
 	i686-musl)

From 5f09324c0c65d57d18818182256f8c035a504d4e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:09:31 -0700
Subject: [PATCH 12/37] linux5.18: update dotconfigs for gcc12

---
 srcpkgs/linux5.18/files/x86_64-dotconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/linux5.18/files/x86_64-dotconfig b/srcpkgs/linux5.18/files/x86_64-dotconfig
index 4e73a3195d40..ea6204868e23 100644
--- a/srcpkgs/linux5.18/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.18/files/x86_64-dotconfig
@@ -512,6 +512,7 @@ CONFIG_RETHUNK=y
 CONFIG_CPU_UNRET_ENTRY=y
 CONFIG_CPU_IBPB_ENTRY=y
 CONFIG_CPU_IBRS_ENTRY=y
+CONFIG_SLS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10060,8 +10061,11 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
 # Memory initialization
 #
 CONFIG_INIT_STACK_NONE=y
+# CONFIG_INIT_STACK_ALL_PATTERN is not set
+# CONFIG_INIT_STACK_ALL_ZERO is not set
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
+# CONFIG_ZERO_CALL_USED_REGS is not set
 # end of Memory initialization
 # end of Kernel hardening options
 # end of Security options
@@ -10538,6 +10542,7 @@ CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
 # CONFIG_UBSAN is not set
 CONFIG_HAVE_ARCH_KCSAN=y
+# CONFIG_KCSAN is not set
 # end of Generic Kernel Debugging Instruments
 
 #

From 2cdf2116402d410767c2f785144c720bb811374c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 18:00:42 -0700
Subject: [PATCH 13/37] xf86-video-vmware: fix build on gcc12

---
 ...183b3395333d5d4c73e25c2d011748f15eda.patch | 30 +++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch

diff --git a/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch b/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch
new file mode 100644
index 000000000000..ff839f16e628
--- /dev/null
+++ b/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch
@@ -0,0 +1,30 @@
+From 77b8183b3395333d5d4c73e25c2d011748f15eda Mon Sep 17 00:00:00 2001
+From: Rudi Heitbaum <rudi@heitbaum.com>
+Date: Sun, 8 May 2022 03:00:10 +0000
+Subject: [PATCH] vmwgfx: fix missing array notation
+
+ Fixes error identified by gcc-12.1.0 compiler
+
+make
+  CC       libvmwgfx_la-vmwgfx_tex_video.lo
+vmwgfx_tex_video.c: In function 'stop_video':
+vmwgfx_tex_video.c:240:20: error: the comparison will always evaluate as 'true' for the address of 'yuv' will never be NULL [-Werror=address]
+  240 |                if (priv->yuv[i]) {
+      |                    ^~~~
+---
+ vmwgfx/vmwgfx_tex_video.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/vmwgfx/vmwgfx_tex_video.c b/vmwgfx/vmwgfx_tex_video.c
+index acc2b56..480a5f1 100644
+--- a/vmwgfx/vmwgfx_tex_video.c
++++ b/vmwgfx/vmwgfx_tex_video.c
+@@ -237,7 +237,7 @@ stop_video(ScrnInfoPtr pScrn, pointer data, Bool shutdown)
+ 
+        for (i=0; i<3; ++i) {
+ 	   for (j=0; j<2; ++j) {
+-	       if (priv->yuv[i]) {
++	       if (priv->yuv[j][i]) {
+ 		   xa_surface_destroy(priv->yuv[j][i]);
+ 		   priv->yuv[j][i] = NULL;
+ 	       }

From 85173ead8dab1cdb22b063852c8ce254599c5f5e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 18:54:53 -0700
Subject: [PATCH 14/37] qt5-webengine: fix build on gcc12

---
 .../patches/qt5-webengine-gcc12.patch             | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
 create mode 100644 srcpkgs/qt5-webengine/patches/qt5-webengine-gcc12.patch

diff --git a/srcpkgs/qt5-webengine/patches/qt5-webengine-gcc12.patch b/srcpkgs/qt5-webengine/patches/qt5-webengine-gcc12.patch
new file mode 100644
index 000000000000..366d25e012e4
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/qt5-webengine-gcc12.patch
@@ -0,0 +1,15 @@
+Add missing include for std::begin and std::end in SkParseColor.cpp
+
+https://skia-review.googlesource.com/c/skia/+/533981
+
+--- a/src/3rdparty/chromium/third_party/skia/src/utils/SkParseColor.cpp
++++ b/src/3rdparty/chromium/third_party/skia/src/utils/SkParseColor.cpp
+@@ -8,6 +8,8 @@
+ 
+ #include "include/utils/SkParse.h"
+ 
++#include <iterator>
++
+ static constexpr const char* gColorNames[] = {
+     "aliceblue",
+     "antiquewhite",

From c5b595c770307879913d4530f3f15b980d546b71 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:54 -0700
Subject: [PATCH 15/37] cross-aarch64-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..cb7ae97e7efe 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 6ef630fee22e5abbad1e39fc618b86f5470b8337 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:54 -0700
Subject: [PATCH 16/37] cross-aarch64-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..4fa950f334d4 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 179497e3f2d6d6d5ea9fd70b93d79f53caaf266f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:54 -0700
Subject: [PATCH 17/37] cross-arm-linux-gnueabi: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..194c0ab774b7 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From aa47e8fa1a1a08ab7d29b106fc2a092f451ad3d9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 18/37] cross-arm-linux-gnueabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..3f3242b85b07 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 3c668ec63b8da1feb23b23f2e32880975f7776bc Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 19/37] cross-arm-linux-musleabi: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..b0cdade60a6d 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 84abbad0f9dd6a08d348a8edc0d159416407e2b4 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 20/37] cross-arm-linux-musleabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..1924be24d483 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From acceb61786483ab173282dfeda744f753756face Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 21/37] cross-armv7l-linux-gnueabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..a7997d6db937 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 65f0f480a99a9231deb326d794e7a1ced94ef624 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 22/37] cross-armv7l-linux-musleabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..aaa7040fbfef 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 273890de33321b021ff09e87a562f57b9788ee47 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 23/37] cross-i686-pc-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..765cf675e95c 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 0e94329bfd3ba1866506b4d856fc1068ab9a75b1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 24/37] cross-mips-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-mips-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..26928ba9442d 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 1eaa863b4cb082bc118c761b8d209d92e2383131 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 25/37] cross-mips-linux-muslhf: update to gcc 12.1.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..fe74faf15d55 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From be6e77ce597a9809ee66decabfb7c01cd3d2ca66 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 26/37] cross-mipsel-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..aa74d0b1acc7 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_musl_version=1.1.24
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 6599f43b3bab55eed30724c17ad8e1091d06ff9a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 27/37] cross-mipsel-linux-muslhf: update to gcc 12.1.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..83ab7f187085 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_musl_version=1.1.24
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 7299132d25f05cc810fc26effd0248ea69070ca8 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 28/37] cross-powerpc-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..3ab1a4ea40fa 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From c88ac75b0b840ac1e3394511708d95e54b319ef8 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 29/37] cross-powerpc-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..af5586cacc77 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From fdafe30f5e4b882e603b8411b7a36b488a5fbdce Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 30/37] cross-powerpc64-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..2604b268046b 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 8553a108fce67448af4344e2e26aa595331a0dfb Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 31/37] cross-powerpc64-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 1ebd0fb2048d..c7894721b900 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
@@ -19,12 +19,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 9a10678b0ae7ad9ca5ddcb5aca04a82f736411b5 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 32/37] cross-powerpc64le-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 733f5851da5c..618235468970 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 8fb64e96039e3c6ed7911ee199965bc96c8db6a6 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 33/37] cross-powerpc64le-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index 76a70aa1d6db..7edf9605e60d 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
@@ -19,12 +19,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 96517aee7e9b22d98bc3e1b4be067a24679717f4 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 34/37] cross-powerpcle-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 347b8fcf4f55..cc10b7cbd88b 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 4057a81091e74f7d035583fc07c7c21cfc7221b2 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 35/37] cross-powerpcle-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index ec9324ddaa99..1d38a3fa3559 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 43c2f8b33f61b401af16ddb848b3723ac2f9d307 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 36/37] cross-x86_64-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 0078fbe7224b..9f740b00a80c 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From b684ad3b460d68048172533c67f02b4c164bfaed Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 37/37] cross-x86_64-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..19e13f3818e9 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
@@ -17,12 +17,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.1.0
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (29 preceding siblings ...)
  2022-08-19  0:22 ` oreo639
@ 2022-08-19  5:51 ` oreo639
  2022-08-19  5:57 ` oreo639
                   ` (233 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-08-19  5:51 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 3181 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.1.0
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.1.0

This PR depends on: https://github.com/void-linux/void-packages/pull/32330

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

Also, keep in mind that the libgo musl patch here will need to be updated once musl is updated:
https://github.com/void-linux/void-packages/pull/34902/files#diff-1f42a95b93c9550178ff1fbccbef2f47a72711df15c24c9472e2550076978129R163-R176

This is the updated patch for reference:
https://github.com/alpinelinux/aports/blob/8acb21b8ee881e7ab1c812d9a66a17d2501b8730/main/gcc/0049-libgo-adjust-name-of-union-in-sigevent-struct.patch

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Known packages that need to be fixed/updated for glibc 2.36:
- [ ] samba https://github.com/void-linux/void-packages/pull/38700
- [ ] qemu https://github.com/void-linux/void-packages/pull/38769
- [ ] llvm https://github.com/void-linux/void-packages/pull/38694
- [ ] m4 https://github.com/void-linux/void-packages/pull/33730
- [ ] btrfs-progs
- [ ] ntp https://github.com/void-linux/void-packages/pull/38772
- [ ] libarchive https://github.com/void-linux/void-packages/pull/38773

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 132824 bytes --]

From 9366a422c7e57a75bf7821c1bd5f34f95bd476cf Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 01/37] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 15 +++--
 3 files changed, 28 insertions(+), 113 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..4bdaee582d71 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkg-config"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -44,6 +45,12 @@ do_configure() {
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	case "$XBPS_TARGET_MACHINE" in
+		*-musl)
+			conf+=" --disable-gprofng"
+			;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"

From 2e37d51320d9beb02f6f0d300ba8a32e511c9caf Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 02/37] gcc: update to 12.1.0.

---
 common/shlibs                                 |  10 +-
 srcpkgs/gcc/files/gccgo-musl.patch            |  74 +++--------
 srcpkgs/gcc/files/libgnarl-musl.patch         |  18 +--
 srcpkgs/gcc/files/libssp-musl.patch           |  10 +-
 ...c21f3f5726823e19728fdd1571a14aae0fb3.patch | 105 ++++++++++++++++
 ...08065bdd36fb1a9b6aad9666b1edb5e06474.patch | 115 ++++++++++++++++++
 ...65517a59565758107c5b1a51a5fa382f8d1a.patch |  32 +++++
 srcpkgs/gcc/patches/libffi_gnulinux.patch     |  11 --
 .../gcc/patches/libgcc-ibm128-no-tag.patch    |  10 +-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |   3 +-
 srcpkgs/gcc/template                          |  25 ++--
 11 files changed, 305 insertions(+), 108 deletions(-)
 create mode 100644 srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
 create mode 100644 srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
 create mode 100644 srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index 2e5258f3a243..4ed747b361a2 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.1.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.34 perl-5.34.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -849,8 +849,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.1.0_1
+libgnat-12.so libada-12.1.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1701,8 +1701,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.1.0_1
+libasan.so.8 libsanitizer-12.1.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..632ef951097b 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,17 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ a/libgo/go/runtime/os_linux.go
+@@ -363,9 +363,9 @@
+ 
+ 	var timerid int32
+ 	var sevp _sigevent
+-	sevp.sigev_notify = _SIGEV_THREAD_ID
++	sevp.sigev_notify = 4
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.sigev_notify_function))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch b/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
new file mode 100644
index 000000000000..00929202a503
--- /dev/null
+++ b/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
@@ -0,0 +1,105 @@
+From 3b21c21f3f5726823e19728fdd1571a14aae0fb3 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <siarheit@google.com>
+Date: Mon, 27 Jun 2022 13:27:24 +0100
+Subject: [PATCH] c++: avoid <memory> poisoning on musl [PR106102]
+
+On musl <pthread.h> uses calloc() (via <sched.h>). <memory> includes
+it indirectly and exposes use of poisoned calloc() when module code
+is built:
+
+    /build/build/./prev-gcc/xg++ ... ../../gcc-13-20220626/gcc/cp/mapper-resolver.cc
+        In file included from /<<NIX>>/musl-1.2.3-dev/include/pthread.h:30,
+                 from /build/build/prev-x86_64-unknown-linux-musl/libstdc++-v3/include/x86_64-unknown-linux-musl/bits/gthr-default.h:35,
+                 ....
+                 from /build/build/prev-x86_64-unknown-linux-musl/libstdc++-v3/include/memory:77,
+                 from ../../gcc-13-20220626/gcc/../libcody/cody.hh:24,
+                 from ../../gcc-13-20220626/gcc/cp/../../c++tools/resolver.h:25,
+                 from ../../gcc-13-20220626/gcc/cp/../../c++tools/resolver.cc:23,
+                 from ../../gcc-13-20220626/gcc/cp/mapper-resolver.cc:32:
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:84:7: error: attempt to use poisoned "calloc"
+       84 | void *calloc(size_t, size_t);
+          |       ^
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:124:36: error: attempt to use poisoned "calloc"
+      124 | #define CPU_ALLOC(n) ((cpu_set_t *)calloc(1,CPU_ALLOC_SIZE(n)))
+          |                                    ^
+
+gcc/cp/
+
+	PR c++/106102
+	* mapper-client.cc: Include <memory> via "system.h".
+	* mapper-resolver.cc: Ditto.
+	* module.cc: Ditto.
+
+libcc1/
+
+	PR c++/106102
+	* libcc1plugin.cc: Include <memory> via "system.h".
+	* libcp1plugin.cc: Ditto.
+---
+ gcc/cp/mapper-client.cc   | 1 +
+ gcc/cp/mapper-resolver.cc | 1 +
+ gcc/cp/module.cc          | 1 +
+ libcc1/libcc1plugin.cc    | 1 +
+ libcc1/libcp1plugin.cc    | 1 +
+ 5 files changed, 5 insertions(+)
+
+diff --git a/gcc/cp/mapper-client.cc b/gcc/cp/mapper-client.cc
+index 8603a886a099..fe9544b5ba43 100644
+--- a/gcc/cp/mapper-client.cc
++++ b/gcc/cp/mapper-client.cc
+@@ -27,6 +27,7 @@ along with GCC; see the file COPYING3.  If not see
+ #define INCLUDE_STRING
+ #define INCLUDE_VECTOR
+ #define INCLUDE_MAP
++#define INCLUDE_MEMORY
+ #include "system.h"
+ 
+ #include "line-map.h"
+diff --git a/gcc/cp/mapper-resolver.cc b/gcc/cp/mapper-resolver.cc
+index e3d29fb5ada1..e70d1b4ae2ca 100644
+--- a/gcc/cp/mapper-resolver.cc
++++ b/gcc/cp/mapper-resolver.cc
+@@ -25,6 +25,7 @@ along with GCC; see the file COPYING3.  If not see
+ #define INCLUDE_VECTOR
+ #define INCLUDE_ALGORITHM
+ #define INCLUDE_MAP
++#define INCLUDE_MEMORY
+ #include "system.h"
+ 
+ // We don't want or need to be aware of networking
+diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc
+index 753963a4b246..8bb22c2b305a 100644
+--- a/gcc/cp/module.cc
++++ b/gcc/cp/module.cc
+@@ -206,6 +206,7 @@ Classes used:
+ 
+ #define _DEFAULT_SOURCE 1 /* To get TZ field of struct tm, if available.  */
+ #include "config.h"
++#define INCLUDE_MEMORY
+ #define INCLUDE_STRING
+ #define INCLUDE_VECTOR
+ #include "system.h"
+diff --git a/libcc1/libcc1plugin.cc b/libcc1/libcc1plugin.cc
+index 12ab5a57c8dd..bdd0bdabe77f 100644
+--- a/libcc1/libcc1plugin.cc
++++ b/libcc1/libcc1plugin.cc
+@@ -31,6 +31,7 @@
+ #undef PACKAGE_TARNAME
+ #undef PACKAGE_VERSION
+ 
++#define INCLUDE_MEMORY
+ #include "gcc-plugin.h"
+ #include "system.h"
+ #include "coretypes.h"
+diff --git a/libcc1/libcp1plugin.cc b/libcc1/libcp1plugin.cc
+index 83dab7f58b11..e2d5039a0a1f 100644
+--- a/libcc1/libcp1plugin.cc
++++ b/libcc1/libcp1plugin.cc
+@@ -32,6 +32,7 @@
+ #undef PACKAGE_TARNAME
+ #undef PACKAGE_VERSION
+ 
++#define INCLUDE_MEMORY
+ #include "gcc-plugin.h"
+ #include "system.h"
+ #include "coretypes.h"
diff --git a/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch b/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
new file mode 100644
index 000000000000..89bd053d6d04
--- /dev/null
+++ b/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
@@ -0,0 +1,115 @@
+From 49d508065bdd36fb1a9b6aad9666b1edb5e06474 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <siarheit@google.com>
+Date: Mon, 27 Jun 2022 23:42:44 +0100
+Subject: [PATCH] jit: avoid calloc() poisoning on musl [PR106102]
+
+On musl <pthread.h> uses calloc() (via <sched.h>). jit/ includes
+it directly and exposes use of poisoned calloc():
+
+    /build/build/./prev-gcc/xg++ ... ../../gcc-13-20220626/gcc/jit/jit-playback.cc
+    make[3]: *** [Makefile:1143: jit/libgccjit.o] Error 1
+    make[3]: *** Waiting for unfinished jobs....
+    In file included from /<<NIX>>/musl-1.2.3-dev/include/pthread.h:30,
+                     from ../../gcc-13-20220626/gcc/jit/jit-playback.cc:44:
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:84:7: error: attempt to use poisoned "calloc"
+       84 | void *calloc(size_t, size_t);
+          |       ^
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:124:36: error: attempt to use poisoned "calloc"
+      124 | #define CPU_ALLOC(n) ((cpu_set_t *)calloc(1,CPU_ALLOC_SIZE(n)))
+          |                                    ^
+
+The change moves <pthread.h> inclusion to "system.h" under new
+INCLUDE_PTHREAD_H guard and uses this mechanism in libgccjit.
+
+gcc/
+
+	PR c++/106102
+	* system.h: Introduce INCLUDE_PTHREAD_H macros to include <pthread.h>.
+
+gcc/jit/
+
+	PR c++/106102
+	* jit-playback.cc: Include <pthread.h> via "system.h" to avoid calloc()
+	poisoning.
+	* jit-recording.cc: Ditto.
+	* libgccjit.cc: Ditto.
+---
+ gcc/jit/jit-playback.cc  | 3 +--
+ gcc/jit/jit-recording.cc | 2 +-
+ gcc/jit/libgccjit.cc     | 2 +-
+ gcc/system.h             | 4 ++++
+ 4 files changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/gcc/jit/jit-playback.cc b/gcc/jit/jit-playback.cc
+index 6be6bdf8dea5..79714132b91a 100644
+--- a/gcc/jit/jit-playback.cc
++++ b/gcc/jit/jit-playback.cc
+@@ -19,6 +19,7 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "target.h"
+@@ -41,8 +42,6 @@ along with GCC; see the file COPYING3.  If not see
+ #include "diagnostic.h"
+ #include "stmt.h"
+ 
+-#include <pthread.h>
+-
+ #include "jit-playback.h"
+ #include "jit-result.h"
+ #include "jit-builtins.h"
+diff --git a/gcc/jit/jit-recording.cc b/gcc/jit/jit-recording.cc
+index 697dee66e733..f78daed2d71a 100644
+--- a/gcc/jit/jit-recording.cc
++++ b/gcc/jit/jit-recording.cc
+@@ -19,13 +19,13 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "tm.h"
+ #include "pretty-print.h"
+ #include "toplev.h"
+ 
+-#include <pthread.h>
+ 
+ #include "jit-builtins.h"
+ #include "jit-recording.h"
+diff --git a/gcc/jit/libgccjit.cc b/gcc/jit/libgccjit.cc
+index 0e76097b4bac..ca862662777e 100644
+--- a/gcc/jit/libgccjit.cc
++++ b/gcc/jit/libgccjit.cc
+@@ -19,12 +19,12 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "timevar.h"
+ #include "typed-splay-tree.h"
+ #include "cppbuiltin.h"
+-#include <pthread.h>
+ 
+ #include "libgccjit.h"
+ #include "jit-recording.h"
+diff --git a/gcc/system.h b/gcc/system.h
+index 67158b70c789..f8d42ff68150 100644
+--- a/gcc/system.h
++++ b/gcc/system.h
+@@ -753,6 +753,10 @@ extern int vsnprintf (char *, size_t, const char *, va_list);
+ #endif
+ #endif
+ 
++#ifdef INCLUDE_PTHREAD_H
++#include <pthread.h>
++#endif
++
+ #ifdef INCLUDE_ISL
+ #ifdef HAVE_isl
+ #include <isl/options.h>
diff --git a/srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch b/srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch
new file mode 100644
index 000000000000..044a4fc29514
--- /dev/null
+++ b/srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch
@@ -0,0 +1,32 @@
+From f35d65517a59565758107c5b1a51a5fa382f8d1a Mon Sep 17 00:00:00 2001
+From: Ian Lance Taylor <iant@golang.org>
+Date: Tue, 12 Jul 2022 19:42:43 -0700
+Subject: [PATCH] libgo: don't include <linux/fs.h> when building
+ gen-sysinfo.go
+
+Removing this doesn't change anything at least with glibc 2.33.
+The include was added in https://go.dev/cl/6100049 but it's not
+clear why.
+
+Fixes PR go/106266
+
+Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/417294
+---
+ gcc/go/gofrontend/MERGE | 2 +-
+ libgo/sysinfo.c         | 3 ---
+ 2 files changed, 1 insertion(+), 4 deletions(-)
+
+diff --git a/libgo/sysinfo.c b/libgo/sysinfo.c
+index a4259c02ded4..fc0210992faa 100644
+--- a/libgo/sysinfo.c
++++ b/libgo/sysinfo.c
+@@ -158,9 +158,6 @@
+ #if defined(HAVE_LINUX_ETHER_H)
+ #include <linux/ether.h>
+ #endif
+-#if defined(HAVE_LINUX_FS_H)
+-#include <linux/fs.h>
+-#endif
+ #if defined(HAVE_LINUX_REBOOT_H)
+ #include <linux/reboot.h>
+ #endif
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..78a2ce35875d 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,9 +3,10 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
  
  #  ifndef _ABIN32
+
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..32ee79e32f0d 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,15 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
+version=12.1.0
+revision=1
 _patchver="${version%pre*}"
 _minorver="${_patchver%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 wrksrc=gcc-${version/pre/_pre}
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +19,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -396,7 +393,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}

From b9014d4d9c032dabbdad252e2801e4332c4cfd4f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 03/37] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      |  6 ++--
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..08e35d466a44 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From f359203e193fb19dff85868f3a448c6a6e4ca7f7 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 04/37] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 1a4e1ca3d594..b04268908c2e 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="q66 <daniel@octaforge.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From 42bd9e22f93f8aab4c55b8a98e89b1c0c364cbda Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 05/37] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 3 files changed, 55 insertions(+), 353 deletions(-)
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index 4ed747b361a2..46e4674c7fe0 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From fccc027b73a8ff2d1873f9ebd47f8b89faef886d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 16:22:03 -0700
Subject: [PATCH 06/37] llvm12: fix build for glibc 2.36

---
 .../compiler-rt-sanitizer-glibc-2.36.patch    | 59 +++++++++++++++++++
 .../compiler-rt-sanitizer-glibc-2.36.patch    | 59 +++++++++++++++++++
 2 files changed, 118 insertions(+)
 create mode 100644 srcpkgs/llvm12/compiler-rt-sanitizer-glibc-2.36.patch
 create mode 100644 srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch

diff --git a/srcpkgs/llvm12/compiler-rt-sanitizer-glibc-2.36.patch b/srcpkgs/llvm12/compiler-rt-sanitizer-glibc-2.36.patch
new file mode 100644
index 000000000000..e5f24dab8935
--- /dev/null
+++ b/srcpkgs/llvm12/compiler-rt-sanitizer-glibc-2.36.patch
@@ -0,0 +1,59 @@
+From 9cf13067cb5088626ba7ee1ec4c42ec59c7995a0 Mon Sep 17 00:00:00 2001
+From: Fangrui Song <i@maskray.me>
+Date: Mon, 11 Jul 2022 12:53:34 -0700
+Subject: [PATCH] [sanitizer] Remove #include <linux/fs.h> to resolve
+ fsconfig_command/mount_attr conflict with glibc 2.36
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+It is generally not a good idea to mix usage of glibc headers and Linux UAPI
+headers (https://sourceware.org/glibc/wiki/Synchronizing_Headers). In glibc
+since 7eae6a91e9b1670330c9f15730082c91c0b1d570 (milestone: 2.36), sys/mount.h
+defines `fsconfig_command` which conflicts with linux/mount.h:
+
+    .../usr/include/linux/mount.h:95:6: error: redeclaration of ‘enum fsconfig_command’
+
+Remove #include <linux/fs.h> which pulls in linux/mount.h. Expand its 4 macros manually.
+Android sys/mount.h doesn't define BLKBSZGET and it still needs linux/fs.h.
+In the long term we should move Linux specific definitions to sanitizer_platform_limits_linux.cpp
+but this commit is easy to cherry pick into older compiler-rt releases.
+
+Fix https://github.com/llvm/llvm-project/issues/56421
+
+Reviewed By: #sanitizers, vitalybuka, zatrazz
+
+Differential Revision: https://reviews.llvm.org/D129471
+---
+ .../sanitizer_platform_limits_posix.cpp                | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+index 4bd425435d56d..3a94b260686f1 100644
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -73,7 +73,9 @@
+ #include <sys/vt.h>
+ #include <linux/cdrom.h>
+ #include <linux/fd.h>
++#if SANITIZER_ANDROID
+ #include <linux/fs.h>
++#endif
+ #include <linux/hdreg.h>
+ #include <linux/input.h>
+ #include <linux/ioctl.h>
+@@ -876,10 +878,10 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
+   unsigned IOCTL_EVIOCGPROP = IOCTL_NOT_PRESENT;
+   unsigned IOCTL_EVIOCSKEYCODE_V2 = IOCTL_NOT_PRESENT;
+ #endif
+-  unsigned IOCTL_FS_IOC_GETFLAGS = FS_IOC_GETFLAGS;
+-  unsigned IOCTL_FS_IOC_GETVERSION = FS_IOC_GETVERSION;
+-  unsigned IOCTL_FS_IOC_SETFLAGS = FS_IOC_SETFLAGS;
+-  unsigned IOCTL_FS_IOC_SETVERSION = FS_IOC_SETVERSION;
++  unsigned IOCTL_FS_IOC_GETFLAGS = _IOR('f', 1, long);
++  unsigned IOCTL_FS_IOC_GETVERSION = _IOR('v', 1, long);
++  unsigned IOCTL_FS_IOC_SETFLAGS = _IOW('f', 2, long);
++  unsigned IOCTL_FS_IOC_SETVERSION = _IOW('v', 2, long);
+   unsigned IOCTL_GIO_CMAP = GIO_CMAP;
+   unsigned IOCTL_GIO_FONT = GIO_FONT;
+   unsigned IOCTL_GIO_UNIMAP = GIO_UNIMAP;
diff --git a/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch b/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch
new file mode 100644
index 000000000000..e5f24dab8935
--- /dev/null
+++ b/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch
@@ -0,0 +1,59 @@
+From 9cf13067cb5088626ba7ee1ec4c42ec59c7995a0 Mon Sep 17 00:00:00 2001
+From: Fangrui Song <i@maskray.me>
+Date: Mon, 11 Jul 2022 12:53:34 -0700
+Subject: [PATCH] [sanitizer] Remove #include <linux/fs.h> to resolve
+ fsconfig_command/mount_attr conflict with glibc 2.36
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+It is generally not a good idea to mix usage of glibc headers and Linux UAPI
+headers (https://sourceware.org/glibc/wiki/Synchronizing_Headers). In glibc
+since 7eae6a91e9b1670330c9f15730082c91c0b1d570 (milestone: 2.36), sys/mount.h
+defines `fsconfig_command` which conflicts with linux/mount.h:
+
+    .../usr/include/linux/mount.h:95:6: error: redeclaration of ‘enum fsconfig_command’
+
+Remove #include <linux/fs.h> which pulls in linux/mount.h. Expand its 4 macros manually.
+Android sys/mount.h doesn't define BLKBSZGET and it still needs linux/fs.h.
+In the long term we should move Linux specific definitions to sanitizer_platform_limits_linux.cpp
+but this commit is easy to cherry pick into older compiler-rt releases.
+
+Fix https://github.com/llvm/llvm-project/issues/56421
+
+Reviewed By: #sanitizers, vitalybuka, zatrazz
+
+Differential Revision: https://reviews.llvm.org/D129471
+---
+ .../sanitizer_platform_limits_posix.cpp                | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+index 4bd425435d56d..3a94b260686f1 100644
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -73,7 +73,9 @@
+ #include <sys/vt.h>
+ #include <linux/cdrom.h>
+ #include <linux/fd.h>
++#if SANITIZER_ANDROID
+ #include <linux/fs.h>
++#endif
+ #include <linux/hdreg.h>
+ #include <linux/input.h>
+ #include <linux/ioctl.h>
+@@ -876,10 +878,10 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
+   unsigned IOCTL_EVIOCGPROP = IOCTL_NOT_PRESENT;
+   unsigned IOCTL_EVIOCSKEYCODE_V2 = IOCTL_NOT_PRESENT;
+ #endif
+-  unsigned IOCTL_FS_IOC_GETFLAGS = FS_IOC_GETFLAGS;
+-  unsigned IOCTL_FS_IOC_GETVERSION = FS_IOC_GETVERSION;
+-  unsigned IOCTL_FS_IOC_SETFLAGS = FS_IOC_SETFLAGS;
+-  unsigned IOCTL_FS_IOC_SETVERSION = FS_IOC_SETVERSION;
++  unsigned IOCTL_FS_IOC_GETFLAGS = _IOR('f', 1, long);
++  unsigned IOCTL_FS_IOC_GETVERSION = _IOR('v', 1, long);
++  unsigned IOCTL_FS_IOC_SETFLAGS = _IOW('f', 2, long);
++  unsigned IOCTL_FS_IOC_SETVERSION = _IOW('v', 2, long);
+   unsigned IOCTL_GIO_CMAP = GIO_CMAP;
+   unsigned IOCTL_GIO_FONT = GIO_FONT;
+   unsigned IOCTL_GIO_UNIMAP = GIO_UNIMAP;

From 5decce17bde82ecb83baf8b68135290e638fb87e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 16:22:29 -0700
Subject: [PATCH 07/37] samba: fix build for glibc 2.36

---
 srcpkgs/samba/patches/fix-glibc-2.36.patch | 59 ++++++++++++++++++++++
 1 file changed, 59 insertions(+)
 create mode 100644 srcpkgs/samba/patches/fix-glibc-2.36.patch

diff --git a/srcpkgs/samba/patches/fix-glibc-2.36.patch b/srcpkgs/samba/patches/fix-glibc-2.36.patch
new file mode 100644
index 000000000000..beb84ce6a8de
--- /dev/null
+++ b/srcpkgs/samba/patches/fix-glibc-2.36.patch
@@ -0,0 +1,59 @@
+From 766151bf5b7ef95ae4c8c98b8994e5c21c5bbec0 Mon Sep 17 00:00:00 2001
+From: Andreas Schneider <asn@samba.org>
+Date: Tue, 2 Aug 2022 07:55:46 +0200
+Subject: [PATCH] lib:replace: Only include <sys/mount.h> on non-Linux systems
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Details at:
+https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
+
+BUG: https://bugzilla.samba.org/show_bug.cgi?id=15132
+
+Signed-off-by: Andreas Schneider <asn@samba.org>
+Reviewed-by: Ralph Boehme <slow@samba.org>
+
+Autobuild-User(master): Ralph Böhme <slow@samba.org>
+Autobuild-Date(master): Tue Aug  2 11:05:14 UTC 2022 on sn-devel-184
+---
+ lib/replace/system/filesys.h | 4 +++-
+ lib/replace/wscript          | 3 +++
+ 2 files changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/lib/replace/system/filesys.h b/lib/replace/system/filesys.h
+index 034e5d5886c..bb9482c69af 100644
+--- a/lib/replace/system/filesys.h
++++ b/lib/replace/system/filesys.h
+@@ -36,7 +36,8 @@
+ #include <sys/param.h>
+ #endif
+ 
+-#ifdef HAVE_SYS_MOUNT_H
++/* This include is required on UNIX (*BSD, AIX, ...) for statfs() */
++#if !defined(LINUX) && defined(HAVE_SYS_MOUNT_H)
+ #include <sys/mount.h>
+ #endif
+ 
+@@ -44,6 +45,7 @@
+ #include <mntent.h>
+ #endif
+ 
++/* This include is required on Linux for statfs() */
+ #ifdef HAVE_SYS_VFS_H
+ #include <sys/vfs.h>
+ #endif
+diff --git a/lib/replace/wscript b/lib/replace/wscript
+index 4c774d9f0c3..dd9b19219a1 100644
+--- a/lib/replace/wscript
++++ b/lib/replace/wscript
+@@ -31,6 +31,9 @@ def configure(conf):
+ 
+     conf.env.standalone_replace = conf.IN_LAUNCH_DIR()
+ 
++    if sys.platform.rfind('linux') > -1:
++        conf.DEFINE('LINUX', '1')
++
+     conf.DEFINE('BOOL_DEFINED', 1)
+     conf.DEFINE('HAVE_LIBREPLACE', 1)
+     conf.DEFINE('LIBREPLACE_NETWORK_CHECKS', 1)

From 8f3b5a03d6f955229e3634e8172a79a2839cd6d5 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 16:22:47 -0700
Subject: [PATCH 08/37] qemu: fix build for glibc 2.36

---
 .../qemu/patches/fix-compat-glibc-2.36.patch  | 100 ++++++++++++++++++
 1 file changed, 100 insertions(+)
 create mode 100644 srcpkgs/qemu/patches/fix-compat-glibc-2.36.patch

diff --git a/srcpkgs/qemu/patches/fix-compat-glibc-2.36.patch b/srcpkgs/qemu/patches/fix-compat-glibc-2.36.patch
new file mode 100644
index 000000000000..e7239ad06313
--- /dev/null
+++ b/srcpkgs/qemu/patches/fix-compat-glibc-2.36.patch
@@ -0,0 +1,100 @@
+From 3cd3df2a9584e6f753bb62a0028bd67124ab5532 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= <berrange@redhat.com>
+Date: Tue, 2 Aug 2022 12:41:34 -0400
+Subject: [PATCH] linux-user: fix compat with glibc >= 2.36 sys/mount.h
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The latest glibc 2.36 has extended sys/mount.h so that it
+defines the FSCONFIG_* enum constants. These are historically
+defined in linux/mount.h, and thus if you include both headers
+the compiler complains:
+
+In file included from /usr/include/linux/fs.h:19,
+                 from ../linux-user/syscall.c:98:
+/usr/include/linux/mount.h:95:6: error: redeclaration of 'enum fsconfig_command'
+   95 | enum fsconfig_command {
+      |      ^~~~~~~~~~~~~~~~
+In file included from ../linux-user/syscall.c:31:
+/usr/include/sys/mount.h:189:6: note: originally defined here
+  189 | enum fsconfig_command
+      |      ^~~~~~~~~~~~~~~~
+/usr/include/linux/mount.h:96:9: error: redeclaration of enumerator 'FSCONFIG_SET_FLAG'
+   96 |         FSCONFIG_SET_FLAG       = 0,    /* Set parameter, supplying no value */
+      |         ^~~~~~~~~~~~~~~~~
+/usr/include/sys/mount.h:191:3: note: previous definition of 'FSCONFIG_SET_FLAG' with type 'enum fsconfig_command'
+  191 |   FSCONFIG_SET_FLAG       = 0,    /* Set parameter, supplying no value */
+      |   ^~~~~~~~~~~~~~~~~
+...snip...
+
+QEMU doesn't include linux/mount.h, but it does use
+linux/fs.h and thus gets linux/mount.h indirectly.
+
+glibc acknowledges this problem but does not appear to
+be intending to fix it in the forseeable future, simply
+documenting it as a known incompatibility with no
+workaround:
+
+  https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
+  https://sourceware.org/glibc/wiki/Synchronizing_Headers
+
+To address this requires either removing use of sys/mount.h
+or linux/fs.h, despite QEMU needing declarations from
+both.
+
+This patch removes linux/fs.h, meaning we have to define
+various FS_IOC constants that are now unavailable.
+
+Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
+Tested-by: Richard W.M. Jones <rjones@redhat.com>
+Message-Id: <20220802164134.1851910-1-berrange@redhat.com>
+Signed-off-by: Laurent Vivier <laurent@vivier.eu>
+---
+ linux-user/syscall.c | 18 ++++++++++++++++++
+ meson.build          |  2 ++
+ 2 files changed, 20 insertions(+)
+
+diff --git a/linux-user/syscall.c b/linux-user/syscall.c
+index ef53feb5ab45..f4091212027c 100644
+--- a/linux-user/syscall.c
++++ b/linux-user/syscall.c
+@@ -95,7 +95,25 @@
+ #include <linux/soundcard.h>
+ #include <linux/kd.h>
+ #include <linux/mtio.h>
++
++#ifdef HAVE_SYS_MOUNT_FSCONFIG
++/*
++ * glibc >= 2.36 linux/mount.h conflicts with sys/mount.h,
++ * which in turn prevents use of linux/fs.h. So we have to
++ * define the constants ourselves for now.
++ */
++#define FS_IOC_GETFLAGS                _IOR('f', 1, long)
++#define FS_IOC_SETFLAGS                _IOW('f', 2, long)
++#define FS_IOC_GETVERSION              _IOR('v', 1, long)
++#define FS_IOC_SETVERSION              _IOW('v', 2, long)
++#define FS_IOC_FIEMAP                  _IOWR('f', 11, struct fiemap)
++#define FS_IOC32_GETFLAGS              _IOR('f', 1, int)
++#define FS_IOC32_SETFLAGS              _IOW('f', 2, int)
++#define FS_IOC32_GETVERSION            _IOR('v', 1, int)
++#define FS_IOC32_SETVERSION            _IOW('v', 2, int)
++#else
+ #include <linux/fs.h>
++#endif
+ #include <linux/fd.h>
+ #if defined(CONFIG_FIEMAP)
+ #include <linux/fiemap.h>
+diff --git a/meson.build b/meson.build
+index 294e9a8f329e..30a380752c0d 100644
+--- a/meson.build
++++ b/meson.build
+@@ -1963,6 +1963,8 @@ config_host_data.set('HAVE_OPTRESET',
+                      cc.has_header_symbol('getopt.h', 'optreset'))
+ config_host_data.set('HAVE_IPPROTO_MPTCP',
+                      cc.has_header_symbol('netinet/in.h', 'IPPROTO_MPTCP'))
++config_host_data.set('HAVE_SYS_MOUNT_FSCONFIG',
++                     cc.has_header_symbol('sys/mount.h', 'FSCONFIG_SET_FLAG'))
+ 
+ # has_member
+ config_host_data.set('HAVE_SIGEV_NOTIFY_THREAD_ID',

From 50b370142ad6df88b7c1660c23ac36114828ee44 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 17:21:40 -0700
Subject: [PATCH 09/37] m4: update to 1.4.19.

---
 srcpkgs/m4/patches/fix-glibc-2.27.patch | 167 ------------------------
 srcpkgs/m4/template                     |  12 +-
 2 files changed, 6 insertions(+), 173 deletions(-)
 delete mode 100644 srcpkgs/m4/patches/fix-glibc-2.27.patch

diff --git a/srcpkgs/m4/patches/fix-glibc-2.27.patch b/srcpkgs/m4/patches/fix-glibc-2.27.patch
deleted file mode 100644
index 59d33cff164d..000000000000
--- a/srcpkgs/m4/patches/fix-glibc-2.27.patch
+++ /dev/null
@@ -1,167 +0,0 @@
-From 4af4a4a71827c0bc5e0ec67af23edef4f15cee8e Mon Sep 17 00:00:00 2001
-From: Paul Eggert <eggert@cs.ucla.edu>
-Date: Mon, 5 Mar 2018 10:56:29 -0800
-Subject: [PATCH] fflush: adjust to glibc 2.28 libio.h removal
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Problem reported by Daniel P. Berrangé in:
-https://lists.gnu.org/r/bug-gnulib/2018-03/msg00000.html
-* lib/fbufmode.c (fbufmode):
-* lib/fflush.c (clear_ungetc_buffer_preserving_position)
-(disable_seek_optimization, rpl_fflush):
-* lib/fpending.c (__fpending):
-* lib/fpurge.c (fpurge):
-* lib/freadable.c (freadable):
-* lib/freadahead.c (freadahead):
-* lib/freading.c (freading):
-* lib/freadptr.c (freadptr):
-* lib/freadseek.c (freadptrinc):
-* lib/fseeko.c (fseeko):
-* lib/fseterr.c (fseterr):
-* lib/fwritable.c (fwritable):
-* lib/fwriting.c (fwriting):
-Check _IO_EOF_SEEN instead of _IO_ftrylockfile.
-* lib/stdio-impl.h (_IO_IN_BACKUP) [_IO_EOF_SEEN]:
-Define if not already defined.
-
-[yann.morin.1998@free.fr: partially backport from upstream gnulib]
-Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
-
----
- lib/fflush.c     |  6 +++---
- lib/fpending.c   |  2 +-
- lib/fpurge.c     |  2 +-
- lib/freadahead.c |  2 +-
- lib/freading.c   |  2 +-
- lib/fseeko.c     |  4 ++--
- lib/stdio-impl.h |  6 ++++++
- 7 files changed, 15 insertions(+), 9 deletions(-)
-
-diff --git a/lib/fflush.c b/build-aux/gnulib/lib/fflush.c
-index 983ade0ff..a6edfa105 100644
---- a/lib/fflush.c
-+++ b/lib/fflush.c
-@@ -33,7 +33,7 @@
- #undef fflush
- 
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- 
- /* Clear the stream's ungetc buffer, preserving the value of ftello (fp).  */
- static void
-@@ -72,7 +72,7 @@ clear_ungetc_buffer (FILE *fp)
- 
- #endif
- 
--#if ! (defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
-+#if ! (defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
- 
- # if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT
- /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
-@@ -148,7 +148,7 @@ rpl_fflush (FILE *stream)
-   if (stream == NULL || ! freading (stream))
-     return fflush (stream);
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- 
-   clear_ungetc_buffer_preserving_position (stream);
- 
-diff --git a/lib/fpending.c b/build-aux/gnulib/lib/fpending.c
-index c84e3a5b4..789f50e4e 100644
---- a/lib/fpending.c
-+++ b/lib/fpending.c
-@@ -32,7 +32,7 @@ __fpending (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   return fp->_IO_write_ptr - fp->_IO_write_base;
- #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
-   /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
-diff --git a/lib/fpurge.c b/build-aux/gnulib/lib/fpurge.c
-index b1d417c7a..3aedcc373 100644
---- a/lib/fpurge.c
-+++ b/lib/fpurge.c
-@@ -62,7 +62,7 @@ fpurge (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   fp->_IO_read_end = fp->_IO_read_ptr;
-   fp->_IO_write_ptr = fp->_IO_write_base;
-   /* Avoid memory leak when there is an active ungetc buffer.  */
-diff --git a/lib/freadahead.c b/build-aux/gnulib/lib/freadahead.c
-index c2ecb5b28..23ec76ee5 100644
---- a/lib/freadahead.c
-+++ b/lib/freadahead.c
-@@ -30,7 +30,7 @@ extern size_t __sreadahead (FILE *);
- size_t
- freadahead (FILE *fp)
- {
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   if (fp->_IO_write_ptr > fp->_IO_write_base)
-     return 0;
-   return (fp->_IO_read_end - fp->_IO_read_ptr)
-diff --git a/lib/freading.c b/build-aux/gnulib/lib/freading.c
-index 73c28acdd..c24d0c88a 100644
---- a/lib/freading.c
-+++ b/lib/freading.c
-@@ -31,7 +31,7 @@ freading (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   return ((fp->_flags & _IO_NO_WRITES) != 0
-           || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0
-               && fp->_IO_read_base != NULL));
-diff --git a/lib/fseeko.c b/build-aux/gnulib/lib/fseeko.c
-index 0101ab55f..193f4e8ce 100644
---- a/lib/fseeko.c
-+++ b/lib/fseeko.c
-@@ -47,7 +47,7 @@ fseeko (FILE *fp, off_t offset, int whence)
- #endif
- 
-   /* These tests are based on fpurge.c.  */
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   if (fp->_IO_read_end == fp->_IO_read_ptr
-       && fp->_IO_write_ptr == fp->_IO_write_base
-       && fp->_IO_save_base == NULL)
-@@ -123,7 +123,7 @@ fseeko (FILE *fp, off_t offset, int whence)
-           return -1;
-         }
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-       fp->_flags &= ~_IO_EOF_SEEN;
-       fp->_offset = pos;
- #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
-diff --git a/lib/stdio-impl.h b/build-aux/gnulib/lib/stdio-impl.h
-index 78d896e9f..05c5752a2 100644
---- a/lib/stdio-impl.h
-+++ b/lib/stdio-impl.h
-@@ -18,6 +18,12 @@
-    the same implementation of stdio extension API, except that some fields
-    have different naming conventions, or their access requires some casts.  */
- 
-+/* Glibc 2.28 made _IO_IN_BACKUP private.  For now, work around this
-+   problem by defining it ourselves.  FIXME: Do not rely on glibc
-+   internals.  */
-+#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN
-+# define _IO_IN_BACKUP 0x100
-+#endif
- 
- /* BSD stdio derived implementations.  */
- 
--- 
-2.14.1
-
-
diff --git a/srcpkgs/m4/template b/srcpkgs/m4/template
index 78f3dae6184a..762593d883bd 100644
--- a/srcpkgs/m4/template
+++ b/srcpkgs/m4/template
@@ -1,17 +1,17 @@
 # Template file for 'm4'
 pkgname=m4
-version=1.4.18
-revision=2
+version=1.4.19
+revision=1
 bootstrap=yes
-replaces="chroot-m4>=0"
 build_style=gnu-configure
 configure_args="--enable-changeword --enable-threads"
 short_desc="GNU version of UNIX m4 macro language processor"
-homepage="https://www.gnu.org/software/m4/"
-license="GPL-3.0-or-later"
 maintainer="Enno Boland <gottox@voidlinux.org>"
+license="GPL-3.0-or-later"
+homepage="https://www.gnu.org/software/m4/"
 distfiles="${GNU_SITE}/${pkgname}/${pkgname}-${version}.tar.xz"
-checksum=f2c1e86ca0a404ff281631bdc8377638992744b175afb806e25871a24a934e07
+checksum=63aede5c6d33b6d9b13511cd0be2cac046f2e70fd0a07aa9573a04a82783af96
+replaces="chroot-m4>=0"
 
 if [ "$XBPS_TARGET_LIBC" = musl ]; then
 	export ac_cv_lib_error_at_line=no

From 7652b9b2ac3b80a5387a4f432f752779de8c3689 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 14 Aug 2022 19:29:36 -0700
Subject: [PATCH 10/37] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove nopie=yes. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh             |  1 +
 common/environment/build-style/void-cross.sh | 36 +++++++++++++++++++-
 2 files changed, 36 insertions(+), 1 deletion(-)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..c24013755704 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -132,6 +132,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
diff --git a/common/environment/build-style/void-cross.sh b/common/environment/build-style/void-cross.sh
index 62ce9eaa2e4a..4b77c90efc8b 100644
--- a/common/environment/build-style/void-cross.sh
+++ b/common/environment/build-style/void-cross.sh
@@ -1,6 +1,40 @@
 lib32disabled=yes
-nopie=yes
 create_wrksrc=yes
 
 nostrip_files+=" libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a libgmem.a"
+nopie_files+=" /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/go1
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/lto-wrapper
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/plugin/gengtype
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/cc1objplus
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/cc1obj
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/collect2
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/lto1
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/f951
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/cc1
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/gnat1
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/cc1plus
+ /usr/bin/${sourcepkg/cross-}-gcov-dump
+ /usr/bin/${sourcepkg/cross-}-gnatlink
+ /usr/bin/${sourcepkg/cross-}-gnatbind
+ /usr/bin/${sourcepkg/cross-}-gcc
+ /usr/bin/${sourcepkg/cross-}-cpp
+ /usr/bin/${sourcepkg/cross-}-gnatchop
+ /usr/bin/${sourcepkg/cross-}-gfortran
+ /usr/bin/${sourcepkg/cross-}-gccgo
+ /usr/bin/${sourcepkg/cross-}-c++
+ /usr/bin/${sourcepkg/cross-}-lto-dump
+ /usr/bin/${sourcepkg/cross-}-gnatname
+ /usr/bin/${sourcepkg/cross-}-gnatprep
+ /usr/bin/${sourcepkg/cross-}-g++
+ /usr/bin/${sourcepkg/cross-}-gnat
+ /usr/bin/${sourcepkg/cross-}-gcc-ranlib
+ /usr/bin/${sourcepkg/cross-}-gnatkr
+ /usr/bin/${sourcepkg/cross-}-gnatmake
+ /usr/bin/${sourcepkg/cross-}-gcc-${_gcc_version}
+ /usr/bin/${sourcepkg/cross-}-gcc-ar
+ /usr/bin/${sourcepkg/cross-}-gnatclean
+ /usr/bin/${sourcepkg/cross-}-gcov
+ /usr/bin/${sourcepkg/cross-}-gnatls
+ /usr/bin/${sourcepkg/cross-}-gcc-nm
+ /usr/bin/${sourcepkg/cross-}-gcov-tool"

From c541b4d7aaac02556027fc403c3a7efbba531dda Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:08:52 -0700
Subject: [PATCH 11/37] openssh: suppress werror on gcc12

---
 srcpkgs/openssh/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/openssh/template b/srcpkgs/openssh/template
index 02a2dec35f42..6e8e343a9dca 100644
--- a/srcpkgs/openssh/template
+++ b/srcpkgs/openssh/template
@@ -40,7 +40,7 @@ if [ "$build_option_ldns" -a -z "$build_option_ssl" ]; then
 	broken="option 'ldns' requires option 'ssl'"
 fi
 
-CFLAGS="-Wno-format-truncation -Wno-stringop-truncation"
+CFLAGS="-Wno-format-truncation -Wno-stringop-truncation -Wno-error=maybe-uninitialized"
 
 case $XBPS_TARGET_MACHINE in
 	i686-musl)

From c2a70c6ec4e8204b1a115b0eb607ce6403363b0b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:09:31 -0700
Subject: [PATCH 12/37] linux5.18: update dotconfigs for gcc12

---
 srcpkgs/linux5.18/files/x86_64-dotconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/linux5.18/files/x86_64-dotconfig b/srcpkgs/linux5.18/files/x86_64-dotconfig
index 4e73a3195d40..ea6204868e23 100644
--- a/srcpkgs/linux5.18/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.18/files/x86_64-dotconfig
@@ -512,6 +512,7 @@ CONFIG_RETHUNK=y
 CONFIG_CPU_UNRET_ENTRY=y
 CONFIG_CPU_IBPB_ENTRY=y
 CONFIG_CPU_IBRS_ENTRY=y
+CONFIG_SLS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10060,8 +10061,11 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
 # Memory initialization
 #
 CONFIG_INIT_STACK_NONE=y
+# CONFIG_INIT_STACK_ALL_PATTERN is not set
+# CONFIG_INIT_STACK_ALL_ZERO is not set
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
+# CONFIG_ZERO_CALL_USED_REGS is not set
 # end of Memory initialization
 # end of Kernel hardening options
 # end of Security options
@@ -10538,6 +10542,7 @@ CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
 # CONFIG_UBSAN is not set
 CONFIG_HAVE_ARCH_KCSAN=y
+# CONFIG_KCSAN is not set
 # end of Generic Kernel Debugging Instruments
 
 #

From d862a555c1a4f5a961fdd7712dead2f3890a4617 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 18:00:42 -0700
Subject: [PATCH 13/37] xf86-video-vmware: fix build on gcc12

---
 ...183b3395333d5d4c73e25c2d011748f15eda.patch | 30 +++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch

diff --git a/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch b/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch
new file mode 100644
index 000000000000..ff839f16e628
--- /dev/null
+++ b/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch
@@ -0,0 +1,30 @@
+From 77b8183b3395333d5d4c73e25c2d011748f15eda Mon Sep 17 00:00:00 2001
+From: Rudi Heitbaum <rudi@heitbaum.com>
+Date: Sun, 8 May 2022 03:00:10 +0000
+Subject: [PATCH] vmwgfx: fix missing array notation
+
+ Fixes error identified by gcc-12.1.0 compiler
+
+make
+  CC       libvmwgfx_la-vmwgfx_tex_video.lo
+vmwgfx_tex_video.c: In function 'stop_video':
+vmwgfx_tex_video.c:240:20: error: the comparison will always evaluate as 'true' for the address of 'yuv' will never be NULL [-Werror=address]
+  240 |                if (priv->yuv[i]) {
+      |                    ^~~~
+---
+ vmwgfx/vmwgfx_tex_video.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/vmwgfx/vmwgfx_tex_video.c b/vmwgfx/vmwgfx_tex_video.c
+index acc2b56..480a5f1 100644
+--- a/vmwgfx/vmwgfx_tex_video.c
++++ b/vmwgfx/vmwgfx_tex_video.c
+@@ -237,7 +237,7 @@ stop_video(ScrnInfoPtr pScrn, pointer data, Bool shutdown)
+ 
+        for (i=0; i<3; ++i) {
+ 	   for (j=0; j<2; ++j) {
+-	       if (priv->yuv[i]) {
++	       if (priv->yuv[j][i]) {
+ 		   xa_surface_destroy(priv->yuv[j][i]);
+ 		   priv->yuv[j][i] = NULL;
+ 	       }

From 84f32cb93459d87df35164e1b7261ee797280caa Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 18:54:53 -0700
Subject: [PATCH 14/37] qt5-webengine: fix build on gcc12

---
 .../patches/qt5-webengine-gcc12.patch             | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
 create mode 100644 srcpkgs/qt5-webengine/patches/qt5-webengine-gcc12.patch

diff --git a/srcpkgs/qt5-webengine/patches/qt5-webengine-gcc12.patch b/srcpkgs/qt5-webengine/patches/qt5-webengine-gcc12.patch
new file mode 100644
index 000000000000..366d25e012e4
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/qt5-webengine-gcc12.patch
@@ -0,0 +1,15 @@
+Add missing include for std::begin and std::end in SkParseColor.cpp
+
+https://skia-review.googlesource.com/c/skia/+/533981
+
+--- a/src/3rdparty/chromium/third_party/skia/src/utils/SkParseColor.cpp
++++ b/src/3rdparty/chromium/third_party/skia/src/utils/SkParseColor.cpp
+@@ -8,6 +8,8 @@
+ 
+ #include "include/utils/SkParse.h"
+ 
++#include <iterator>
++
+ static constexpr const char* gColorNames[] = {
+     "aliceblue",
+     "antiquewhite",

From 256721b70b53dfc3df30b02305199b64a86d4dfa Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:54 -0700
Subject: [PATCH 15/37] cross-aarch64-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..cb7ae97e7efe 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From fa9840d574f5020c61556591352f41d7eb0449ec Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:54 -0700
Subject: [PATCH 16/37] cross-aarch64-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..4fa950f334d4 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From f1efc931f24bc42e7f8912d395b5107c290003f6 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:54 -0700
Subject: [PATCH 17/37] cross-arm-linux-gnueabi: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..194c0ab774b7 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From e8fe382c116215e5fe11128aed512b21bd0c9ead Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 18/37] cross-arm-linux-gnueabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..3f3242b85b07 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 0ea46bcb2da9f3901dde4e2261897fed800ab1f0 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 19/37] cross-arm-linux-musleabi: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..b0cdade60a6d 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 43e96184dd369686f4865349fd867da933b10661 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 20/37] cross-arm-linux-musleabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..1924be24d483 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From fe81f1432cf33cc8dd9d40f24537769e90a9751e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 21/37] cross-armv7l-linux-gnueabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..a7997d6db937 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From b961aa8a20413eb98df77816f52a30c6f7d0e017 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 22/37] cross-armv7l-linux-musleabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..aaa7040fbfef 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 4cfbac9a4aae50482bc22d47e25574b388dffb65 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 23/37] cross-i686-pc-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..765cf675e95c 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 53eec725237a0c6da6085b680eb98f3bb34eee6d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 24/37] cross-mips-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-mips-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..26928ba9442d 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From b5486970d7ad49da8de9d753dc76aa9b9eb56856 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 25/37] cross-mips-linux-muslhf: update to gcc 12.1.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..fe74faf15d55 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From e15ce70799dbf6d22ec69bcbee6fe71f9521cd1f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 26/37] cross-mipsel-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..aa74d0b1acc7 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_musl_version=1.1.24
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 3e7b98157ccb55b734e3f1941edeba5f3baa3723 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 27/37] cross-mipsel-linux-muslhf: update to gcc 12.1.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..83ab7f187085 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_musl_version=1.1.24
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 35b07331dba4e2ca5b686553c1b189da6d259a1d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 28/37] cross-powerpc-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..3ab1a4ea40fa 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 5701c004e41fb76db04a91d75acf60b7f0e280bf Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 29/37] cross-powerpc-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..af5586cacc77 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From b18f0dd997feaccc6760f75eb8af4b2a7e2fcd9f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 30/37] cross-powerpc64-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..2604b268046b 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From f4120d757a7e351fa51d7290442b9f68d064ae50 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 31/37] cross-powerpc64-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 1ebd0fb2048d..c7894721b900 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
@@ -19,12 +19,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From c68e0d7348b60353019c441c02579746182bac38 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 32/37] cross-powerpc64le-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 733f5851da5c..618235468970 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 0bc93f6195e603733ce776ff8fa0044b619bab85 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 33/37] cross-powerpc64le-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index 76a70aa1d6db..7edf9605e60d 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
@@ -19,12 +19,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 97c8682f17fe64dcbbb39428342636465794e521 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 34/37] cross-powerpcle-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 347b8fcf4f55..cc10b7cbd88b 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 74209b7908d0c74c7afae2be4825492eab5f21dd Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 35/37] cross-powerpcle-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index ec9324ddaa99..1d38a3fa3559 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From c8bbd749e6606722bef73c2d40792d19ae6a3495 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 36/37] cross-x86_64-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 0078fbe7224b..9f740b00a80c 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 9f6f597d77a95bda22bc0927b5fb592d61292df2 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 37/37] cross-x86_64-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..19e13f3818e9 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
@@ -17,12 +17,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.1.0
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (30 preceding siblings ...)
  2022-08-19  5:51 ` oreo639
@ 2022-08-19  5:57 ` oreo639
  2022-08-19  5:58 ` oreo639
                   ` (232 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-08-19  5:57 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 3181 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.1.0
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.1.0

This PR depends on: https://github.com/void-linux/void-packages/pull/32330

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

Also, keep in mind that the libgo musl patch here will need to be updated once musl is updated:
https://github.com/void-linux/void-packages/pull/34902/files#diff-1f42a95b93c9550178ff1fbccbef2f47a72711df15c24c9472e2550076978129R163-R176

This is the updated patch for reference:
https://github.com/alpinelinux/aports/blob/8acb21b8ee881e7ab1c812d9a66a17d2501b8730/main/gcc/0049-libgo-adjust-name-of-union-in-sigevent-struct.patch

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Known packages that need to be fixed/updated for glibc 2.36:
- [ ] samba https://github.com/void-linux/void-packages/pull/38700
- [ ] qemu https://github.com/void-linux/void-packages/pull/38769
- [ ] llvm https://github.com/void-linux/void-packages/pull/38694
- [ ] m4 https://github.com/void-linux/void-packages/pull/33730
- [ ] btrfs-progs
- [ ] ntp https://github.com/void-linux/void-packages/pull/38772
- [ ] libarchive https://github.com/void-linux/void-packages/pull/38773

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 137280 bytes --]

From 9366a422c7e57a75bf7821c1bd5f34f95bd476cf Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 01/39] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 15 +++--
 3 files changed, 28 insertions(+), 113 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..4bdaee582d71 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkg-config"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -44,6 +45,12 @@ do_configure() {
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	case "$XBPS_TARGET_MACHINE" in
+		*-musl)
+			conf+=" --disable-gprofng"
+			;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"

From 2e37d51320d9beb02f6f0d300ba8a32e511c9caf Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 02/39] gcc: update to 12.1.0.

---
 common/shlibs                                 |  10 +-
 srcpkgs/gcc/files/gccgo-musl.patch            |  74 +++--------
 srcpkgs/gcc/files/libgnarl-musl.patch         |  18 +--
 srcpkgs/gcc/files/libssp-musl.patch           |  10 +-
 ...c21f3f5726823e19728fdd1571a14aae0fb3.patch | 105 ++++++++++++++++
 ...08065bdd36fb1a9b6aad9666b1edb5e06474.patch | 115 ++++++++++++++++++
 ...65517a59565758107c5b1a51a5fa382f8d1a.patch |  32 +++++
 srcpkgs/gcc/patches/libffi_gnulinux.patch     |  11 --
 .../gcc/patches/libgcc-ibm128-no-tag.patch    |  10 +-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |   3 +-
 srcpkgs/gcc/template                          |  25 ++--
 11 files changed, 305 insertions(+), 108 deletions(-)
 create mode 100644 srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
 create mode 100644 srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
 create mode 100644 srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index 2e5258f3a243..4ed747b361a2 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.1.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.34 perl-5.34.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -849,8 +849,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.1.0_1
+libgnat-12.so libada-12.1.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1701,8 +1701,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.1.0_1
+libasan.so.8 libsanitizer-12.1.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..632ef951097b 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,17 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ a/libgo/go/runtime/os_linux.go
+@@ -363,9 +363,9 @@
+ 
+ 	var timerid int32
+ 	var sevp _sigevent
+-	sevp.sigev_notify = _SIGEV_THREAD_ID
++	sevp.sigev_notify = 4
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.sigev_notify_function))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch b/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
new file mode 100644
index 000000000000..00929202a503
--- /dev/null
+++ b/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
@@ -0,0 +1,105 @@
+From 3b21c21f3f5726823e19728fdd1571a14aae0fb3 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <siarheit@google.com>
+Date: Mon, 27 Jun 2022 13:27:24 +0100
+Subject: [PATCH] c++: avoid <memory> poisoning on musl [PR106102]
+
+On musl <pthread.h> uses calloc() (via <sched.h>). <memory> includes
+it indirectly and exposes use of poisoned calloc() when module code
+is built:
+
+    /build/build/./prev-gcc/xg++ ... ../../gcc-13-20220626/gcc/cp/mapper-resolver.cc
+        In file included from /<<NIX>>/musl-1.2.3-dev/include/pthread.h:30,
+                 from /build/build/prev-x86_64-unknown-linux-musl/libstdc++-v3/include/x86_64-unknown-linux-musl/bits/gthr-default.h:35,
+                 ....
+                 from /build/build/prev-x86_64-unknown-linux-musl/libstdc++-v3/include/memory:77,
+                 from ../../gcc-13-20220626/gcc/../libcody/cody.hh:24,
+                 from ../../gcc-13-20220626/gcc/cp/../../c++tools/resolver.h:25,
+                 from ../../gcc-13-20220626/gcc/cp/../../c++tools/resolver.cc:23,
+                 from ../../gcc-13-20220626/gcc/cp/mapper-resolver.cc:32:
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:84:7: error: attempt to use poisoned "calloc"
+       84 | void *calloc(size_t, size_t);
+          |       ^
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:124:36: error: attempt to use poisoned "calloc"
+      124 | #define CPU_ALLOC(n) ((cpu_set_t *)calloc(1,CPU_ALLOC_SIZE(n)))
+          |                                    ^
+
+gcc/cp/
+
+	PR c++/106102
+	* mapper-client.cc: Include <memory> via "system.h".
+	* mapper-resolver.cc: Ditto.
+	* module.cc: Ditto.
+
+libcc1/
+
+	PR c++/106102
+	* libcc1plugin.cc: Include <memory> via "system.h".
+	* libcp1plugin.cc: Ditto.
+---
+ gcc/cp/mapper-client.cc   | 1 +
+ gcc/cp/mapper-resolver.cc | 1 +
+ gcc/cp/module.cc          | 1 +
+ libcc1/libcc1plugin.cc    | 1 +
+ libcc1/libcp1plugin.cc    | 1 +
+ 5 files changed, 5 insertions(+)
+
+diff --git a/gcc/cp/mapper-client.cc b/gcc/cp/mapper-client.cc
+index 8603a886a099..fe9544b5ba43 100644
+--- a/gcc/cp/mapper-client.cc
++++ b/gcc/cp/mapper-client.cc
+@@ -27,6 +27,7 @@ along with GCC; see the file COPYING3.  If not see
+ #define INCLUDE_STRING
+ #define INCLUDE_VECTOR
+ #define INCLUDE_MAP
++#define INCLUDE_MEMORY
+ #include "system.h"
+ 
+ #include "line-map.h"
+diff --git a/gcc/cp/mapper-resolver.cc b/gcc/cp/mapper-resolver.cc
+index e3d29fb5ada1..e70d1b4ae2ca 100644
+--- a/gcc/cp/mapper-resolver.cc
++++ b/gcc/cp/mapper-resolver.cc
+@@ -25,6 +25,7 @@ along with GCC; see the file COPYING3.  If not see
+ #define INCLUDE_VECTOR
+ #define INCLUDE_ALGORITHM
+ #define INCLUDE_MAP
++#define INCLUDE_MEMORY
+ #include "system.h"
+ 
+ // We don't want or need to be aware of networking
+diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc
+index 753963a4b246..8bb22c2b305a 100644
+--- a/gcc/cp/module.cc
++++ b/gcc/cp/module.cc
+@@ -206,6 +206,7 @@ Classes used:
+ 
+ #define _DEFAULT_SOURCE 1 /* To get TZ field of struct tm, if available.  */
+ #include "config.h"
++#define INCLUDE_MEMORY
+ #define INCLUDE_STRING
+ #define INCLUDE_VECTOR
+ #include "system.h"
+diff --git a/libcc1/libcc1plugin.cc b/libcc1/libcc1plugin.cc
+index 12ab5a57c8dd..bdd0bdabe77f 100644
+--- a/libcc1/libcc1plugin.cc
++++ b/libcc1/libcc1plugin.cc
+@@ -31,6 +31,7 @@
+ #undef PACKAGE_TARNAME
+ #undef PACKAGE_VERSION
+ 
++#define INCLUDE_MEMORY
+ #include "gcc-plugin.h"
+ #include "system.h"
+ #include "coretypes.h"
+diff --git a/libcc1/libcp1plugin.cc b/libcc1/libcp1plugin.cc
+index 83dab7f58b11..e2d5039a0a1f 100644
+--- a/libcc1/libcp1plugin.cc
++++ b/libcc1/libcp1plugin.cc
+@@ -32,6 +32,7 @@
+ #undef PACKAGE_TARNAME
+ #undef PACKAGE_VERSION
+ 
++#define INCLUDE_MEMORY
+ #include "gcc-plugin.h"
+ #include "system.h"
+ #include "coretypes.h"
diff --git a/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch b/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
new file mode 100644
index 000000000000..89bd053d6d04
--- /dev/null
+++ b/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
@@ -0,0 +1,115 @@
+From 49d508065bdd36fb1a9b6aad9666b1edb5e06474 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <siarheit@google.com>
+Date: Mon, 27 Jun 2022 23:42:44 +0100
+Subject: [PATCH] jit: avoid calloc() poisoning on musl [PR106102]
+
+On musl <pthread.h> uses calloc() (via <sched.h>). jit/ includes
+it directly and exposes use of poisoned calloc():
+
+    /build/build/./prev-gcc/xg++ ... ../../gcc-13-20220626/gcc/jit/jit-playback.cc
+    make[3]: *** [Makefile:1143: jit/libgccjit.o] Error 1
+    make[3]: *** Waiting for unfinished jobs....
+    In file included from /<<NIX>>/musl-1.2.3-dev/include/pthread.h:30,
+                     from ../../gcc-13-20220626/gcc/jit/jit-playback.cc:44:
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:84:7: error: attempt to use poisoned "calloc"
+       84 | void *calloc(size_t, size_t);
+          |       ^
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:124:36: error: attempt to use poisoned "calloc"
+      124 | #define CPU_ALLOC(n) ((cpu_set_t *)calloc(1,CPU_ALLOC_SIZE(n)))
+          |                                    ^
+
+The change moves <pthread.h> inclusion to "system.h" under new
+INCLUDE_PTHREAD_H guard and uses this mechanism in libgccjit.
+
+gcc/
+
+	PR c++/106102
+	* system.h: Introduce INCLUDE_PTHREAD_H macros to include <pthread.h>.
+
+gcc/jit/
+
+	PR c++/106102
+	* jit-playback.cc: Include <pthread.h> via "system.h" to avoid calloc()
+	poisoning.
+	* jit-recording.cc: Ditto.
+	* libgccjit.cc: Ditto.
+---
+ gcc/jit/jit-playback.cc  | 3 +--
+ gcc/jit/jit-recording.cc | 2 +-
+ gcc/jit/libgccjit.cc     | 2 +-
+ gcc/system.h             | 4 ++++
+ 4 files changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/gcc/jit/jit-playback.cc b/gcc/jit/jit-playback.cc
+index 6be6bdf8dea5..79714132b91a 100644
+--- a/gcc/jit/jit-playback.cc
++++ b/gcc/jit/jit-playback.cc
+@@ -19,6 +19,7 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "target.h"
+@@ -41,8 +42,6 @@ along with GCC; see the file COPYING3.  If not see
+ #include "diagnostic.h"
+ #include "stmt.h"
+ 
+-#include <pthread.h>
+-
+ #include "jit-playback.h"
+ #include "jit-result.h"
+ #include "jit-builtins.h"
+diff --git a/gcc/jit/jit-recording.cc b/gcc/jit/jit-recording.cc
+index 697dee66e733..f78daed2d71a 100644
+--- a/gcc/jit/jit-recording.cc
++++ b/gcc/jit/jit-recording.cc
+@@ -19,13 +19,13 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "tm.h"
+ #include "pretty-print.h"
+ #include "toplev.h"
+ 
+-#include <pthread.h>
+ 
+ #include "jit-builtins.h"
+ #include "jit-recording.h"
+diff --git a/gcc/jit/libgccjit.cc b/gcc/jit/libgccjit.cc
+index 0e76097b4bac..ca862662777e 100644
+--- a/gcc/jit/libgccjit.cc
++++ b/gcc/jit/libgccjit.cc
+@@ -19,12 +19,12 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "timevar.h"
+ #include "typed-splay-tree.h"
+ #include "cppbuiltin.h"
+-#include <pthread.h>
+ 
+ #include "libgccjit.h"
+ #include "jit-recording.h"
+diff --git a/gcc/system.h b/gcc/system.h
+index 67158b70c789..f8d42ff68150 100644
+--- a/gcc/system.h
++++ b/gcc/system.h
+@@ -753,6 +753,10 @@ extern int vsnprintf (char *, size_t, const char *, va_list);
+ #endif
+ #endif
+ 
++#ifdef INCLUDE_PTHREAD_H
++#include <pthread.h>
++#endif
++
+ #ifdef INCLUDE_ISL
+ #ifdef HAVE_isl
+ #include <isl/options.h>
diff --git a/srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch b/srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch
new file mode 100644
index 000000000000..044a4fc29514
--- /dev/null
+++ b/srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch
@@ -0,0 +1,32 @@
+From f35d65517a59565758107c5b1a51a5fa382f8d1a Mon Sep 17 00:00:00 2001
+From: Ian Lance Taylor <iant@golang.org>
+Date: Tue, 12 Jul 2022 19:42:43 -0700
+Subject: [PATCH] libgo: don't include <linux/fs.h> when building
+ gen-sysinfo.go
+
+Removing this doesn't change anything at least with glibc 2.33.
+The include was added in https://go.dev/cl/6100049 but it's not
+clear why.
+
+Fixes PR go/106266
+
+Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/417294
+---
+ gcc/go/gofrontend/MERGE | 2 +-
+ libgo/sysinfo.c         | 3 ---
+ 2 files changed, 1 insertion(+), 4 deletions(-)
+
+diff --git a/libgo/sysinfo.c b/libgo/sysinfo.c
+index a4259c02ded4..fc0210992faa 100644
+--- a/libgo/sysinfo.c
++++ b/libgo/sysinfo.c
+@@ -158,9 +158,6 @@
+ #if defined(HAVE_LINUX_ETHER_H)
+ #include <linux/ether.h>
+ #endif
+-#if defined(HAVE_LINUX_FS_H)
+-#include <linux/fs.h>
+-#endif
+ #if defined(HAVE_LINUX_REBOOT_H)
+ #include <linux/reboot.h>
+ #endif
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..78a2ce35875d 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,9 +3,10 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
  
  #  ifndef _ABIN32
+
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..32ee79e32f0d 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,15 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
+version=12.1.0
+revision=1
 _patchver="${version%pre*}"
 _minorver="${_patchver%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 wrksrc=gcc-${version/pre/_pre}
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +19,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -396,7 +393,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}

From b9014d4d9c032dabbdad252e2801e4332c4cfd4f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 03/39] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      |  6 ++--
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..08e35d466a44 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From f359203e193fb19dff85868f3a448c6a6e4ca7f7 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 04/39] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 1a4e1ca3d594..b04268908c2e 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="q66 <daniel@octaforge.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From 42bd9e22f93f8aab4c55b8a98e89b1c0c364cbda Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 05/39] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 3 files changed, 55 insertions(+), 353 deletions(-)
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index 4ed747b361a2..46e4674c7fe0 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From fccc027b73a8ff2d1873f9ebd47f8b89faef886d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 16:22:03 -0700
Subject: [PATCH 06/39] llvm12: fix build for glibc 2.36

---
 .../compiler-rt-sanitizer-glibc-2.36.patch    | 59 +++++++++++++++++++
 .../compiler-rt-sanitizer-glibc-2.36.patch    | 59 +++++++++++++++++++
 2 files changed, 118 insertions(+)
 create mode 100644 srcpkgs/llvm12/compiler-rt-sanitizer-glibc-2.36.patch
 create mode 100644 srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch

diff --git a/srcpkgs/llvm12/compiler-rt-sanitizer-glibc-2.36.patch b/srcpkgs/llvm12/compiler-rt-sanitizer-glibc-2.36.patch
new file mode 100644
index 000000000000..e5f24dab8935
--- /dev/null
+++ b/srcpkgs/llvm12/compiler-rt-sanitizer-glibc-2.36.patch
@@ -0,0 +1,59 @@
+From 9cf13067cb5088626ba7ee1ec4c42ec59c7995a0 Mon Sep 17 00:00:00 2001
+From: Fangrui Song <i@maskray.me>
+Date: Mon, 11 Jul 2022 12:53:34 -0700
+Subject: [PATCH] [sanitizer] Remove #include <linux/fs.h> to resolve
+ fsconfig_command/mount_attr conflict with glibc 2.36
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+It is generally not a good idea to mix usage of glibc headers and Linux UAPI
+headers (https://sourceware.org/glibc/wiki/Synchronizing_Headers). In glibc
+since 7eae6a91e9b1670330c9f15730082c91c0b1d570 (milestone: 2.36), sys/mount.h
+defines `fsconfig_command` which conflicts with linux/mount.h:
+
+    .../usr/include/linux/mount.h:95:6: error: redeclaration of ‘enum fsconfig_command’
+
+Remove #include <linux/fs.h> which pulls in linux/mount.h. Expand its 4 macros manually.
+Android sys/mount.h doesn't define BLKBSZGET and it still needs linux/fs.h.
+In the long term we should move Linux specific definitions to sanitizer_platform_limits_linux.cpp
+but this commit is easy to cherry pick into older compiler-rt releases.
+
+Fix https://github.com/llvm/llvm-project/issues/56421
+
+Reviewed By: #sanitizers, vitalybuka, zatrazz
+
+Differential Revision: https://reviews.llvm.org/D129471
+---
+ .../sanitizer_platform_limits_posix.cpp                | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+index 4bd425435d56d..3a94b260686f1 100644
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -73,7 +73,9 @@
+ #include <sys/vt.h>
+ #include <linux/cdrom.h>
+ #include <linux/fd.h>
++#if SANITIZER_ANDROID
+ #include <linux/fs.h>
++#endif
+ #include <linux/hdreg.h>
+ #include <linux/input.h>
+ #include <linux/ioctl.h>
+@@ -876,10 +878,10 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
+   unsigned IOCTL_EVIOCGPROP = IOCTL_NOT_PRESENT;
+   unsigned IOCTL_EVIOCSKEYCODE_V2 = IOCTL_NOT_PRESENT;
+ #endif
+-  unsigned IOCTL_FS_IOC_GETFLAGS = FS_IOC_GETFLAGS;
+-  unsigned IOCTL_FS_IOC_GETVERSION = FS_IOC_GETVERSION;
+-  unsigned IOCTL_FS_IOC_SETFLAGS = FS_IOC_SETFLAGS;
+-  unsigned IOCTL_FS_IOC_SETVERSION = FS_IOC_SETVERSION;
++  unsigned IOCTL_FS_IOC_GETFLAGS = _IOR('f', 1, long);
++  unsigned IOCTL_FS_IOC_GETVERSION = _IOR('v', 1, long);
++  unsigned IOCTL_FS_IOC_SETFLAGS = _IOW('f', 2, long);
++  unsigned IOCTL_FS_IOC_SETVERSION = _IOW('v', 2, long);
+   unsigned IOCTL_GIO_CMAP = GIO_CMAP;
+   unsigned IOCTL_GIO_FONT = GIO_FONT;
+   unsigned IOCTL_GIO_UNIMAP = GIO_UNIMAP;
diff --git a/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch b/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch
new file mode 100644
index 000000000000..e5f24dab8935
--- /dev/null
+++ b/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch
@@ -0,0 +1,59 @@
+From 9cf13067cb5088626ba7ee1ec4c42ec59c7995a0 Mon Sep 17 00:00:00 2001
+From: Fangrui Song <i@maskray.me>
+Date: Mon, 11 Jul 2022 12:53:34 -0700
+Subject: [PATCH] [sanitizer] Remove #include <linux/fs.h> to resolve
+ fsconfig_command/mount_attr conflict with glibc 2.36
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+It is generally not a good idea to mix usage of glibc headers and Linux UAPI
+headers (https://sourceware.org/glibc/wiki/Synchronizing_Headers). In glibc
+since 7eae6a91e9b1670330c9f15730082c91c0b1d570 (milestone: 2.36), sys/mount.h
+defines `fsconfig_command` which conflicts with linux/mount.h:
+
+    .../usr/include/linux/mount.h:95:6: error: redeclaration of ‘enum fsconfig_command’
+
+Remove #include <linux/fs.h> which pulls in linux/mount.h. Expand its 4 macros manually.
+Android sys/mount.h doesn't define BLKBSZGET and it still needs linux/fs.h.
+In the long term we should move Linux specific definitions to sanitizer_platform_limits_linux.cpp
+but this commit is easy to cherry pick into older compiler-rt releases.
+
+Fix https://github.com/llvm/llvm-project/issues/56421
+
+Reviewed By: #sanitizers, vitalybuka, zatrazz
+
+Differential Revision: https://reviews.llvm.org/D129471
+---
+ .../sanitizer_platform_limits_posix.cpp                | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+index 4bd425435d56d..3a94b260686f1 100644
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -73,7 +73,9 @@
+ #include <sys/vt.h>
+ #include <linux/cdrom.h>
+ #include <linux/fd.h>
++#if SANITIZER_ANDROID
+ #include <linux/fs.h>
++#endif
+ #include <linux/hdreg.h>
+ #include <linux/input.h>
+ #include <linux/ioctl.h>
+@@ -876,10 +878,10 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
+   unsigned IOCTL_EVIOCGPROP = IOCTL_NOT_PRESENT;
+   unsigned IOCTL_EVIOCSKEYCODE_V2 = IOCTL_NOT_PRESENT;
+ #endif
+-  unsigned IOCTL_FS_IOC_GETFLAGS = FS_IOC_GETFLAGS;
+-  unsigned IOCTL_FS_IOC_GETVERSION = FS_IOC_GETVERSION;
+-  unsigned IOCTL_FS_IOC_SETFLAGS = FS_IOC_SETFLAGS;
+-  unsigned IOCTL_FS_IOC_SETVERSION = FS_IOC_SETVERSION;
++  unsigned IOCTL_FS_IOC_GETFLAGS = _IOR('f', 1, long);
++  unsigned IOCTL_FS_IOC_GETVERSION = _IOR('v', 1, long);
++  unsigned IOCTL_FS_IOC_SETFLAGS = _IOW('f', 2, long);
++  unsigned IOCTL_FS_IOC_SETVERSION = _IOW('v', 2, long);
+   unsigned IOCTL_GIO_CMAP = GIO_CMAP;
+   unsigned IOCTL_GIO_FONT = GIO_FONT;
+   unsigned IOCTL_GIO_UNIMAP = GIO_UNIMAP;

From 5decce17bde82ecb83baf8b68135290e638fb87e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 16:22:29 -0700
Subject: [PATCH 07/39] samba: fix build for glibc 2.36

---
 srcpkgs/samba/patches/fix-glibc-2.36.patch | 59 ++++++++++++++++++++++
 1 file changed, 59 insertions(+)
 create mode 100644 srcpkgs/samba/patches/fix-glibc-2.36.patch

diff --git a/srcpkgs/samba/patches/fix-glibc-2.36.patch b/srcpkgs/samba/patches/fix-glibc-2.36.patch
new file mode 100644
index 000000000000..beb84ce6a8de
--- /dev/null
+++ b/srcpkgs/samba/patches/fix-glibc-2.36.patch
@@ -0,0 +1,59 @@
+From 766151bf5b7ef95ae4c8c98b8994e5c21c5bbec0 Mon Sep 17 00:00:00 2001
+From: Andreas Schneider <asn@samba.org>
+Date: Tue, 2 Aug 2022 07:55:46 +0200
+Subject: [PATCH] lib:replace: Only include <sys/mount.h> on non-Linux systems
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Details at:
+https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
+
+BUG: https://bugzilla.samba.org/show_bug.cgi?id=15132
+
+Signed-off-by: Andreas Schneider <asn@samba.org>
+Reviewed-by: Ralph Boehme <slow@samba.org>
+
+Autobuild-User(master): Ralph Böhme <slow@samba.org>
+Autobuild-Date(master): Tue Aug  2 11:05:14 UTC 2022 on sn-devel-184
+---
+ lib/replace/system/filesys.h | 4 +++-
+ lib/replace/wscript          | 3 +++
+ 2 files changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/lib/replace/system/filesys.h b/lib/replace/system/filesys.h
+index 034e5d5886c..bb9482c69af 100644
+--- a/lib/replace/system/filesys.h
++++ b/lib/replace/system/filesys.h
+@@ -36,7 +36,8 @@
+ #include <sys/param.h>
+ #endif
+ 
+-#ifdef HAVE_SYS_MOUNT_H
++/* This include is required on UNIX (*BSD, AIX, ...) for statfs() */
++#if !defined(LINUX) && defined(HAVE_SYS_MOUNT_H)
+ #include <sys/mount.h>
+ #endif
+ 
+@@ -44,6 +45,7 @@
+ #include <mntent.h>
+ #endif
+ 
++/* This include is required on Linux for statfs() */
+ #ifdef HAVE_SYS_VFS_H
+ #include <sys/vfs.h>
+ #endif
+diff --git a/lib/replace/wscript b/lib/replace/wscript
+index 4c774d9f0c3..dd9b19219a1 100644
+--- a/lib/replace/wscript
++++ b/lib/replace/wscript
+@@ -31,6 +31,9 @@ def configure(conf):
+ 
+     conf.env.standalone_replace = conf.IN_LAUNCH_DIR()
+ 
++    if sys.platform.rfind('linux') > -1:
++        conf.DEFINE('LINUX', '1')
++
+     conf.DEFINE('BOOL_DEFINED', 1)
+     conf.DEFINE('HAVE_LIBREPLACE', 1)
+     conf.DEFINE('LIBREPLACE_NETWORK_CHECKS', 1)

From 8f3b5a03d6f955229e3634e8172a79a2839cd6d5 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 16:22:47 -0700
Subject: [PATCH 08/39] qemu: fix build for glibc 2.36

---
 .../qemu/patches/fix-compat-glibc-2.36.patch  | 100 ++++++++++++++++++
 1 file changed, 100 insertions(+)
 create mode 100644 srcpkgs/qemu/patches/fix-compat-glibc-2.36.patch

diff --git a/srcpkgs/qemu/patches/fix-compat-glibc-2.36.patch b/srcpkgs/qemu/patches/fix-compat-glibc-2.36.patch
new file mode 100644
index 000000000000..e7239ad06313
--- /dev/null
+++ b/srcpkgs/qemu/patches/fix-compat-glibc-2.36.patch
@@ -0,0 +1,100 @@
+From 3cd3df2a9584e6f753bb62a0028bd67124ab5532 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= <berrange@redhat.com>
+Date: Tue, 2 Aug 2022 12:41:34 -0400
+Subject: [PATCH] linux-user: fix compat with glibc >= 2.36 sys/mount.h
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The latest glibc 2.36 has extended sys/mount.h so that it
+defines the FSCONFIG_* enum constants. These are historically
+defined in linux/mount.h, and thus if you include both headers
+the compiler complains:
+
+In file included from /usr/include/linux/fs.h:19,
+                 from ../linux-user/syscall.c:98:
+/usr/include/linux/mount.h:95:6: error: redeclaration of 'enum fsconfig_command'
+   95 | enum fsconfig_command {
+      |      ^~~~~~~~~~~~~~~~
+In file included from ../linux-user/syscall.c:31:
+/usr/include/sys/mount.h:189:6: note: originally defined here
+  189 | enum fsconfig_command
+      |      ^~~~~~~~~~~~~~~~
+/usr/include/linux/mount.h:96:9: error: redeclaration of enumerator 'FSCONFIG_SET_FLAG'
+   96 |         FSCONFIG_SET_FLAG       = 0,    /* Set parameter, supplying no value */
+      |         ^~~~~~~~~~~~~~~~~
+/usr/include/sys/mount.h:191:3: note: previous definition of 'FSCONFIG_SET_FLAG' with type 'enum fsconfig_command'
+  191 |   FSCONFIG_SET_FLAG       = 0,    /* Set parameter, supplying no value */
+      |   ^~~~~~~~~~~~~~~~~
+...snip...
+
+QEMU doesn't include linux/mount.h, but it does use
+linux/fs.h and thus gets linux/mount.h indirectly.
+
+glibc acknowledges this problem but does not appear to
+be intending to fix it in the forseeable future, simply
+documenting it as a known incompatibility with no
+workaround:
+
+  https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
+  https://sourceware.org/glibc/wiki/Synchronizing_Headers
+
+To address this requires either removing use of sys/mount.h
+or linux/fs.h, despite QEMU needing declarations from
+both.
+
+This patch removes linux/fs.h, meaning we have to define
+various FS_IOC constants that are now unavailable.
+
+Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
+Tested-by: Richard W.M. Jones <rjones@redhat.com>
+Message-Id: <20220802164134.1851910-1-berrange@redhat.com>
+Signed-off-by: Laurent Vivier <laurent@vivier.eu>
+---
+ linux-user/syscall.c | 18 ++++++++++++++++++
+ meson.build          |  2 ++
+ 2 files changed, 20 insertions(+)
+
+diff --git a/linux-user/syscall.c b/linux-user/syscall.c
+index ef53feb5ab45..f4091212027c 100644
+--- a/linux-user/syscall.c
++++ b/linux-user/syscall.c
+@@ -95,7 +95,25 @@
+ #include <linux/soundcard.h>
+ #include <linux/kd.h>
+ #include <linux/mtio.h>
++
++#ifdef HAVE_SYS_MOUNT_FSCONFIG
++/*
++ * glibc >= 2.36 linux/mount.h conflicts with sys/mount.h,
++ * which in turn prevents use of linux/fs.h. So we have to
++ * define the constants ourselves for now.
++ */
++#define FS_IOC_GETFLAGS                _IOR('f', 1, long)
++#define FS_IOC_SETFLAGS                _IOW('f', 2, long)
++#define FS_IOC_GETVERSION              _IOR('v', 1, long)
++#define FS_IOC_SETVERSION              _IOW('v', 2, long)
++#define FS_IOC_FIEMAP                  _IOWR('f', 11, struct fiemap)
++#define FS_IOC32_GETFLAGS              _IOR('f', 1, int)
++#define FS_IOC32_SETFLAGS              _IOW('f', 2, int)
++#define FS_IOC32_GETVERSION            _IOR('v', 1, int)
++#define FS_IOC32_SETVERSION            _IOW('v', 2, int)
++#else
+ #include <linux/fs.h>
++#endif
+ #include <linux/fd.h>
+ #if defined(CONFIG_FIEMAP)
+ #include <linux/fiemap.h>
+diff --git a/meson.build b/meson.build
+index 294e9a8f329e..30a380752c0d 100644
+--- a/meson.build
++++ b/meson.build
+@@ -1963,6 +1963,8 @@ config_host_data.set('HAVE_OPTRESET',
+                      cc.has_header_symbol('getopt.h', 'optreset'))
+ config_host_data.set('HAVE_IPPROTO_MPTCP',
+                      cc.has_header_symbol('netinet/in.h', 'IPPROTO_MPTCP'))
++config_host_data.set('HAVE_SYS_MOUNT_FSCONFIG',
++                     cc.has_header_symbol('sys/mount.h', 'FSCONFIG_SET_FLAG'))
+ 
+ # has_member
+ config_host_data.set('HAVE_SIGEV_NOTIFY_THREAD_ID',

From 50b370142ad6df88b7c1660c23ac36114828ee44 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 17:21:40 -0700
Subject: [PATCH 09/39] m4: update to 1.4.19.

---
 srcpkgs/m4/patches/fix-glibc-2.27.patch | 167 ------------------------
 srcpkgs/m4/template                     |  12 +-
 2 files changed, 6 insertions(+), 173 deletions(-)
 delete mode 100644 srcpkgs/m4/patches/fix-glibc-2.27.patch

diff --git a/srcpkgs/m4/patches/fix-glibc-2.27.patch b/srcpkgs/m4/patches/fix-glibc-2.27.patch
deleted file mode 100644
index 59d33cff164d..000000000000
--- a/srcpkgs/m4/patches/fix-glibc-2.27.patch
+++ /dev/null
@@ -1,167 +0,0 @@
-From 4af4a4a71827c0bc5e0ec67af23edef4f15cee8e Mon Sep 17 00:00:00 2001
-From: Paul Eggert <eggert@cs.ucla.edu>
-Date: Mon, 5 Mar 2018 10:56:29 -0800
-Subject: [PATCH] fflush: adjust to glibc 2.28 libio.h removal
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Problem reported by Daniel P. Berrangé in:
-https://lists.gnu.org/r/bug-gnulib/2018-03/msg00000.html
-* lib/fbufmode.c (fbufmode):
-* lib/fflush.c (clear_ungetc_buffer_preserving_position)
-(disable_seek_optimization, rpl_fflush):
-* lib/fpending.c (__fpending):
-* lib/fpurge.c (fpurge):
-* lib/freadable.c (freadable):
-* lib/freadahead.c (freadahead):
-* lib/freading.c (freading):
-* lib/freadptr.c (freadptr):
-* lib/freadseek.c (freadptrinc):
-* lib/fseeko.c (fseeko):
-* lib/fseterr.c (fseterr):
-* lib/fwritable.c (fwritable):
-* lib/fwriting.c (fwriting):
-Check _IO_EOF_SEEN instead of _IO_ftrylockfile.
-* lib/stdio-impl.h (_IO_IN_BACKUP) [_IO_EOF_SEEN]:
-Define if not already defined.
-
-[yann.morin.1998@free.fr: partially backport from upstream gnulib]
-Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
-
----
- lib/fflush.c     |  6 +++---
- lib/fpending.c   |  2 +-
- lib/fpurge.c     |  2 +-
- lib/freadahead.c |  2 +-
- lib/freading.c   |  2 +-
- lib/fseeko.c     |  4 ++--
- lib/stdio-impl.h |  6 ++++++
- 7 files changed, 15 insertions(+), 9 deletions(-)
-
-diff --git a/lib/fflush.c b/build-aux/gnulib/lib/fflush.c
-index 983ade0ff..a6edfa105 100644
---- a/lib/fflush.c
-+++ b/lib/fflush.c
-@@ -33,7 +33,7 @@
- #undef fflush
- 
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- 
- /* Clear the stream's ungetc buffer, preserving the value of ftello (fp).  */
- static void
-@@ -72,7 +72,7 @@ clear_ungetc_buffer (FILE *fp)
- 
- #endif
- 
--#if ! (defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
-+#if ! (defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
- 
- # if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT
- /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
-@@ -148,7 +148,7 @@ rpl_fflush (FILE *stream)
-   if (stream == NULL || ! freading (stream))
-     return fflush (stream);
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- 
-   clear_ungetc_buffer_preserving_position (stream);
- 
-diff --git a/lib/fpending.c b/build-aux/gnulib/lib/fpending.c
-index c84e3a5b4..789f50e4e 100644
---- a/lib/fpending.c
-+++ b/lib/fpending.c
-@@ -32,7 +32,7 @@ __fpending (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   return fp->_IO_write_ptr - fp->_IO_write_base;
- #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
-   /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
-diff --git a/lib/fpurge.c b/build-aux/gnulib/lib/fpurge.c
-index b1d417c7a..3aedcc373 100644
---- a/lib/fpurge.c
-+++ b/lib/fpurge.c
-@@ -62,7 +62,7 @@ fpurge (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   fp->_IO_read_end = fp->_IO_read_ptr;
-   fp->_IO_write_ptr = fp->_IO_write_base;
-   /* Avoid memory leak when there is an active ungetc buffer.  */
-diff --git a/lib/freadahead.c b/build-aux/gnulib/lib/freadahead.c
-index c2ecb5b28..23ec76ee5 100644
---- a/lib/freadahead.c
-+++ b/lib/freadahead.c
-@@ -30,7 +30,7 @@ extern size_t __sreadahead (FILE *);
- size_t
- freadahead (FILE *fp)
- {
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   if (fp->_IO_write_ptr > fp->_IO_write_base)
-     return 0;
-   return (fp->_IO_read_end - fp->_IO_read_ptr)
-diff --git a/lib/freading.c b/build-aux/gnulib/lib/freading.c
-index 73c28acdd..c24d0c88a 100644
---- a/lib/freading.c
-+++ b/lib/freading.c
-@@ -31,7 +31,7 @@ freading (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   return ((fp->_flags & _IO_NO_WRITES) != 0
-           || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0
-               && fp->_IO_read_base != NULL));
-diff --git a/lib/fseeko.c b/build-aux/gnulib/lib/fseeko.c
-index 0101ab55f..193f4e8ce 100644
---- a/lib/fseeko.c
-+++ b/lib/fseeko.c
-@@ -47,7 +47,7 @@ fseeko (FILE *fp, off_t offset, int whence)
- #endif
- 
-   /* These tests are based on fpurge.c.  */
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   if (fp->_IO_read_end == fp->_IO_read_ptr
-       && fp->_IO_write_ptr == fp->_IO_write_base
-       && fp->_IO_save_base == NULL)
-@@ -123,7 +123,7 @@ fseeko (FILE *fp, off_t offset, int whence)
-           return -1;
-         }
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-       fp->_flags &= ~_IO_EOF_SEEN;
-       fp->_offset = pos;
- #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
-diff --git a/lib/stdio-impl.h b/build-aux/gnulib/lib/stdio-impl.h
-index 78d896e9f..05c5752a2 100644
---- a/lib/stdio-impl.h
-+++ b/lib/stdio-impl.h
-@@ -18,6 +18,12 @@
-    the same implementation of stdio extension API, except that some fields
-    have different naming conventions, or their access requires some casts.  */
- 
-+/* Glibc 2.28 made _IO_IN_BACKUP private.  For now, work around this
-+   problem by defining it ourselves.  FIXME: Do not rely on glibc
-+   internals.  */
-+#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN
-+# define _IO_IN_BACKUP 0x100
-+#endif
- 
- /* BSD stdio derived implementations.  */
- 
--- 
-2.14.1
-
-
diff --git a/srcpkgs/m4/template b/srcpkgs/m4/template
index 78f3dae6184a..762593d883bd 100644
--- a/srcpkgs/m4/template
+++ b/srcpkgs/m4/template
@@ -1,17 +1,17 @@
 # Template file for 'm4'
 pkgname=m4
-version=1.4.18
-revision=2
+version=1.4.19
+revision=1
 bootstrap=yes
-replaces="chroot-m4>=0"
 build_style=gnu-configure
 configure_args="--enable-changeword --enable-threads"
 short_desc="GNU version of UNIX m4 macro language processor"
-homepage="https://www.gnu.org/software/m4/"
-license="GPL-3.0-or-later"
 maintainer="Enno Boland <gottox@voidlinux.org>"
+license="GPL-3.0-or-later"
+homepage="https://www.gnu.org/software/m4/"
 distfiles="${GNU_SITE}/${pkgname}/${pkgname}-${version}.tar.xz"
-checksum=f2c1e86ca0a404ff281631bdc8377638992744b175afb806e25871a24a934e07
+checksum=63aede5c6d33b6d9b13511cd0be2cac046f2e70fd0a07aa9573a04a82783af96
+replaces="chroot-m4>=0"
 
 if [ "$XBPS_TARGET_LIBC" = musl ]; then
 	export ac_cv_lib_error_at_line=no

From 57ba66c30d5f972dcb46b7dc4f868aef50b7c189 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 22:56:22 -0700
Subject: [PATCH 10/39] ntp: fix build with glibc 2.34

---
 srcpkgs/ntp/patches/compat-glibc-2.34.patch | 55 +++++++++++++++++++++
 1 file changed, 55 insertions(+)
 create mode 100644 srcpkgs/ntp/patches/compat-glibc-2.34.patch

diff --git a/srcpkgs/ntp/patches/compat-glibc-2.34.patch b/srcpkgs/ntp/patches/compat-glibc-2.34.patch
new file mode 100644
index 000000000000..4e75cc845282
--- /dev/null
+++ b/srcpkgs/ntp/patches/compat-glibc-2.34.patch
@@ -0,0 +1,55 @@
+diff -Nru a/libntp/work_thread.c b/libntp/work_thread.c
+--- a/libntp/work_thread.c	2022-01-16 11:35:17.290791372 +0100
++++ b/libntp/work_thread.c	2022-01-16 11:35:17.290791372 +0100
+@@ -41,20 +41,10 @@
+ #ifndef THREAD_MINSTACKSIZE
+ # define THREAD_MINSTACKSIZE	(64U * 1024)
+ #endif
+-#ifndef __sun
+-#if defined(PTHREAD_STACK_MIN) && THREAD_MINSTACKSIZE < PTHREAD_STACK_MIN
+-# undef THREAD_MINSTACKSIZE
+-# define THREAD_MINSTACKSIZE PTHREAD_STACK_MIN
+-#endif
+-#endif
+ 
+ #ifndef THREAD_MAXSTACKSIZE
+ # define THREAD_MAXSTACKSIZE	(256U * 1024)
+ #endif
+-#if THREAD_MAXSTACKSIZE < THREAD_MINSTACKSIZE
+-# undef  THREAD_MAXSTACKSIZE
+-# define THREAD_MAXSTACKSIZE THREAD_MINSTACKSIZE
+-#endif
+ 
+ /* need a good integer to store a pointer... */
+ #ifndef UINTPTR_T
+@@ -594,12 +584,25 @@
+ 			"start_blocking_thread: pthread_attr_getstacksize() -> %s",
+ 			strerror(rc));
+ 	} else {
+-		if (ostacksize < THREAD_MINSTACKSIZE)
+-			nstacksize = THREAD_MINSTACKSIZE;
+-		else if (ostacksize > THREAD_MAXSTACKSIZE)
++		nstacksize = ostacksize;
++		/* order is important here: first clamp on upper limit,
++		 * and the PTHREAD min stack size is ultimate override!
++		 */ 
++		if (nstacksize > THREAD_MAXSTACKSIZE)
+ 			nstacksize = THREAD_MAXSTACKSIZE;
+-		else
+-			nstacksize = ostacksize;
++#            ifdef PTHREAD_STACK_MAX
++		if (nstacksize > PTHREAD_STACK_MAX)
++			nstacksize = PTHREAD_STACK_MAX;
++#            endif
++
++		/* now clamp on lower stack limit. */
++		if (nstacksize < THREAD_MINSTACKSIZE)
++			nstacksize = THREAD_MINSTACKSIZE;
++#            ifdef PTHREAD_STACK_MIN
++		if (nstacksize < PTHREAD_STACK_MIN)
++			nstacksize = PTHREAD_STACK_MIN;
++#            endif
++
+ 		if (nstacksize != ostacksize)
+ 			rc = pthread_attr_setstacksize(&thr_attr, nstacksize);
+ 		if (0 != rc)

From 603fecc6a420b24056051b8c60464aacaacaad01 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 22:56:41 -0700
Subject: [PATCH 11/39] libarchive: fix for glibc 2.36

---
 .../patches/fix-build-glibc-2.36.patch        | 41 +++++++++++++++++++
 1 file changed, 41 insertions(+)
 create mode 100644 srcpkgs/libarchive/patches/fix-build-glibc-2.36.patch

diff --git a/srcpkgs/libarchive/patches/fix-build-glibc-2.36.patch b/srcpkgs/libarchive/patches/fix-build-glibc-2.36.patch
new file mode 100644
index 000000000000..7c88ca1b1ca0
--- /dev/null
+++ b/srcpkgs/libarchive/patches/fix-build-glibc-2.36.patch
@@ -0,0 +1,41 @@
+From a2f68263a1da5ad227bcb9cd8fa91b93c8b6c99f Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 25 Jul 2022 10:56:53 -0700
+Subject: [PATCH] libarchive: Do not include sys/mount.h when linux/fs.h is
+ present
+
+These headers are in conflict and only one is needed by
+archive_read_disk_posix.c therefore include linux/fs.h if it exists
+otherwise include sys/mount.h
+
+It also helps compiling with glibc 2.36
+where sys/mount.h conflicts with linux/mount.h see [1]
+
+[1] https://sourceware.org/glibc/wiki/Release/2.36
+---
+ libarchive/archive_read_disk_posix.c | 5 ++---
+ 1 file changed, 2 insertions(+), 3 deletions(-)
+
+diff --git a/libarchive/archive_read_disk_posix.c b/libarchive/archive_read_disk_posix.c
+index 2b39e672b..a96008db7 100644
+--- a/libarchive/archive_read_disk_posix.c
++++ b/libarchive/archive_read_disk_posix.c
+@@ -34,9 +34,6 @@ __FBSDID("$FreeBSD$");
+ #ifdef HAVE_SYS_PARAM_H
+ #include <sys/param.h>
+ #endif
+-#ifdef HAVE_SYS_MOUNT_H
+-#include <sys/mount.h>
+-#endif
+ #ifdef HAVE_SYS_STAT_H
+ #include <sys/stat.h>
+ #endif
+@@ -54,6 +51,8 @@ __FBSDID("$FreeBSD$");
+ #endif
+ #ifdef HAVE_LINUX_FS_H
+ #include <linux/fs.h>
++#elif HAVE_SYS_MOUNT_H
++#include <sys/mount.h>
+ #endif
+ /*
+  * Some Linux distributions have both linux/ext2_fs.h and ext2fs/ext2_fs.h.

From eb0dd26d4cae61895bef6b42b7259f9d4ac3cced Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 14 Aug 2022 19:29:36 -0700
Subject: [PATCH 12/39] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove nopie=yes. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh             |  1 +
 common/environment/build-style/void-cross.sh | 36 +++++++++++++++++++-
 2 files changed, 36 insertions(+), 1 deletion(-)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..c24013755704 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -132,6 +132,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
diff --git a/common/environment/build-style/void-cross.sh b/common/environment/build-style/void-cross.sh
index 62ce9eaa2e4a..4b77c90efc8b 100644
--- a/common/environment/build-style/void-cross.sh
+++ b/common/environment/build-style/void-cross.sh
@@ -1,6 +1,40 @@
 lib32disabled=yes
-nopie=yes
 create_wrksrc=yes
 
 nostrip_files+=" libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a libgmem.a"
+nopie_files+=" /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/go1
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/lto-wrapper
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/plugin/gengtype
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/cc1objplus
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/cc1obj
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/collect2
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/lto1
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/f951
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/cc1
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/gnat1
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/cc1plus
+ /usr/bin/${sourcepkg/cross-}-gcov-dump
+ /usr/bin/${sourcepkg/cross-}-gnatlink
+ /usr/bin/${sourcepkg/cross-}-gnatbind
+ /usr/bin/${sourcepkg/cross-}-gcc
+ /usr/bin/${sourcepkg/cross-}-cpp
+ /usr/bin/${sourcepkg/cross-}-gnatchop
+ /usr/bin/${sourcepkg/cross-}-gfortran
+ /usr/bin/${sourcepkg/cross-}-gccgo
+ /usr/bin/${sourcepkg/cross-}-c++
+ /usr/bin/${sourcepkg/cross-}-lto-dump
+ /usr/bin/${sourcepkg/cross-}-gnatname
+ /usr/bin/${sourcepkg/cross-}-gnatprep
+ /usr/bin/${sourcepkg/cross-}-g++
+ /usr/bin/${sourcepkg/cross-}-gnat
+ /usr/bin/${sourcepkg/cross-}-gcc-ranlib
+ /usr/bin/${sourcepkg/cross-}-gnatkr
+ /usr/bin/${sourcepkg/cross-}-gnatmake
+ /usr/bin/${sourcepkg/cross-}-gcc-${_gcc_version}
+ /usr/bin/${sourcepkg/cross-}-gcc-ar
+ /usr/bin/${sourcepkg/cross-}-gnatclean
+ /usr/bin/${sourcepkg/cross-}-gcov
+ /usr/bin/${sourcepkg/cross-}-gnatls
+ /usr/bin/${sourcepkg/cross-}-gcc-nm
+ /usr/bin/${sourcepkg/cross-}-gcov-tool"

From 127f8f42ab7646832aac5fef5fa9e4ba309b6d3a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:08:52 -0700
Subject: [PATCH 13/39] openssh: suppress werror on gcc12

---
 srcpkgs/openssh/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/openssh/template b/srcpkgs/openssh/template
index 02a2dec35f42..6e8e343a9dca 100644
--- a/srcpkgs/openssh/template
+++ b/srcpkgs/openssh/template
@@ -40,7 +40,7 @@ if [ "$build_option_ldns" -a -z "$build_option_ssl" ]; then
 	broken="option 'ldns' requires option 'ssl'"
 fi
 
-CFLAGS="-Wno-format-truncation -Wno-stringop-truncation"
+CFLAGS="-Wno-format-truncation -Wno-stringop-truncation -Wno-error=maybe-uninitialized"
 
 case $XBPS_TARGET_MACHINE in
 	i686-musl)

From 4026277f72cab283a9a9ae0d6433b6d9ba2f9795 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:09:31 -0700
Subject: [PATCH 14/39] linux5.18: update dotconfigs for gcc12

---
 srcpkgs/linux5.18/files/x86_64-dotconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/linux5.18/files/x86_64-dotconfig b/srcpkgs/linux5.18/files/x86_64-dotconfig
index 4e73a3195d40..ea6204868e23 100644
--- a/srcpkgs/linux5.18/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.18/files/x86_64-dotconfig
@@ -512,6 +512,7 @@ CONFIG_RETHUNK=y
 CONFIG_CPU_UNRET_ENTRY=y
 CONFIG_CPU_IBPB_ENTRY=y
 CONFIG_CPU_IBRS_ENTRY=y
+CONFIG_SLS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10060,8 +10061,11 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
 # Memory initialization
 #
 CONFIG_INIT_STACK_NONE=y
+# CONFIG_INIT_STACK_ALL_PATTERN is not set
+# CONFIG_INIT_STACK_ALL_ZERO is not set
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
+# CONFIG_ZERO_CALL_USED_REGS is not set
 # end of Memory initialization
 # end of Kernel hardening options
 # end of Security options
@@ -10538,6 +10542,7 @@ CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
 # CONFIG_UBSAN is not set
 CONFIG_HAVE_ARCH_KCSAN=y
+# CONFIG_KCSAN is not set
 # end of Generic Kernel Debugging Instruments
 
 #

From 04107e71d766a20d6660e087cc21d535b2485e78 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 18:00:42 -0700
Subject: [PATCH 15/39] xf86-video-vmware: fix build on gcc12

---
 ...183b3395333d5d4c73e25c2d011748f15eda.patch | 30 +++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch

diff --git a/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch b/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch
new file mode 100644
index 000000000000..ff839f16e628
--- /dev/null
+++ b/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch
@@ -0,0 +1,30 @@
+From 77b8183b3395333d5d4c73e25c2d011748f15eda Mon Sep 17 00:00:00 2001
+From: Rudi Heitbaum <rudi@heitbaum.com>
+Date: Sun, 8 May 2022 03:00:10 +0000
+Subject: [PATCH] vmwgfx: fix missing array notation
+
+ Fixes error identified by gcc-12.1.0 compiler
+
+make
+  CC       libvmwgfx_la-vmwgfx_tex_video.lo
+vmwgfx_tex_video.c: In function 'stop_video':
+vmwgfx_tex_video.c:240:20: error: the comparison will always evaluate as 'true' for the address of 'yuv' will never be NULL [-Werror=address]
+  240 |                if (priv->yuv[i]) {
+      |                    ^~~~
+---
+ vmwgfx/vmwgfx_tex_video.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/vmwgfx/vmwgfx_tex_video.c b/vmwgfx/vmwgfx_tex_video.c
+index acc2b56..480a5f1 100644
+--- a/vmwgfx/vmwgfx_tex_video.c
++++ b/vmwgfx/vmwgfx_tex_video.c
+@@ -237,7 +237,7 @@ stop_video(ScrnInfoPtr pScrn, pointer data, Bool shutdown)
+ 
+        for (i=0; i<3; ++i) {
+ 	   for (j=0; j<2; ++j) {
+-	       if (priv->yuv[i]) {
++	       if (priv->yuv[j][i]) {
+ 		   xa_surface_destroy(priv->yuv[j][i]);
+ 		   priv->yuv[j][i] = NULL;
+ 	       }

From ffbe296a29a35c98a7402b304f36cf2b3f121892 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 18:54:53 -0700
Subject: [PATCH 16/39] qt5-webengine: fix build on gcc12

---
 .../patches/qt5-webengine-gcc12.patch             | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
 create mode 100644 srcpkgs/qt5-webengine/patches/qt5-webengine-gcc12.patch

diff --git a/srcpkgs/qt5-webengine/patches/qt5-webengine-gcc12.patch b/srcpkgs/qt5-webengine/patches/qt5-webengine-gcc12.patch
new file mode 100644
index 000000000000..366d25e012e4
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/qt5-webengine-gcc12.patch
@@ -0,0 +1,15 @@
+Add missing include for std::begin and std::end in SkParseColor.cpp
+
+https://skia-review.googlesource.com/c/skia/+/533981
+
+--- a/src/3rdparty/chromium/third_party/skia/src/utils/SkParseColor.cpp
++++ b/src/3rdparty/chromium/third_party/skia/src/utils/SkParseColor.cpp
+@@ -8,6 +8,8 @@
+ 
+ #include "include/utils/SkParse.h"
+ 
++#include <iterator>
++
+ static constexpr const char* gColorNames[] = {
+     "aliceblue",
+     "antiquewhite",

From 7fb222ea6ae61912d56813ec7caf0ff01084cc25 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:54 -0700
Subject: [PATCH 17/39] cross-aarch64-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..cb7ae97e7efe 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 490580caa2abb88d7934049d24197472b72ddf22 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:54 -0700
Subject: [PATCH 18/39] cross-aarch64-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..4fa950f334d4 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From e21c79dbde1374c851d9a33431653bb171ef079b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:54 -0700
Subject: [PATCH 19/39] cross-arm-linux-gnueabi: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..194c0ab774b7 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 0fd45e4c84857ed3fe71f6a1c584a6ce4d756035 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 20/39] cross-arm-linux-gnueabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..3f3242b85b07 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 284298c967a6f86ba3fbea9f11f2e9735e704aec Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 21/39] cross-arm-linux-musleabi: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..b0cdade60a6d 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 15a7edb8eb44490bc815782916e97c3e0ba7ce0c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 22/39] cross-arm-linux-musleabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..1924be24d483 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From c54328f96668484206fd81dec10b4d0e3612707a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 23/39] cross-armv7l-linux-gnueabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..a7997d6db937 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 63eca58af8d7630cdf2abd809e53cf9812e30f74 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 24/39] cross-armv7l-linux-musleabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..aaa7040fbfef 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From b5447e08f3e7b9a702077a579f57bddb5a7210bb Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 25/39] cross-i686-pc-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..765cf675e95c 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From c09b7fc16fee522153e8a0e37ae13f16ad922e23 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 26/39] cross-mips-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-mips-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..26928ba9442d 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 8f1f34adc57a341a65ed1357369bb121b64090bc Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 27/39] cross-mips-linux-muslhf: update to gcc 12.1.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..fe74faf15d55 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 2c963d0ee92a9f85dccf77c2d8e246ff4832f7e0 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 28/39] cross-mipsel-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..aa74d0b1acc7 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_musl_version=1.1.24
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From c49f47bffdc86887a29393c83f45778ac149ef25 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 29/39] cross-mipsel-linux-muslhf: update to gcc 12.1.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..83ab7f187085 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_musl_version=1.1.24
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 8271f685835322d2747bf8f2798e979b9c102797 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 30/39] cross-powerpc-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..3ab1a4ea40fa 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 1ff024c43dc5c2810a0d55cfdf3d1a8a15fe46d7 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 31/39] cross-powerpc-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..af5586cacc77 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 6f99a2f5fec2218bbbf94c31e00f007c58ec299f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 32/39] cross-powerpc64-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..2604b268046b 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 18ae9211d7ca51f8d73d2cbade8e39b708940b97 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 33/39] cross-powerpc64-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 1ebd0fb2048d..c7894721b900 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
@@ -19,12 +19,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From c6d18666e680af7839d0d81892f452380de32c03 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 34/39] cross-powerpc64le-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 733f5851da5c..618235468970 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 79394423d3f0dd2e45da96da31f745245d5b0c8a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 35/39] cross-powerpc64le-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index 76a70aa1d6db..7edf9605e60d 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
@@ -19,12 +19,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From abeacce4371ba51587b8c36010bfb5d5d907da5b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 36/39] cross-powerpcle-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 347b8fcf4f55..cc10b7cbd88b 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 7b59f989443e8b4a6640bb5936c7fcf9e94b5624 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 37/39] cross-powerpcle-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index ec9324ddaa99..1d38a3fa3559 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 7bc306886a3c85b84a1808f0c24b7852edf6e999 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 38/39] cross-x86_64-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 0078fbe7224b..9f740b00a80c 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From e0a79f25503f390a6cc17093e1cfef6f8807b5c0 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 39/39] cross-x86_64-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..19e13f3818e9 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
@@ -17,12 +17,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.1.0
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (31 preceding siblings ...)
  2022-08-19  5:57 ` oreo639
@ 2022-08-19  5:58 ` oreo639
  2022-08-20 18:30 ` oreo639
                   ` (231 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-08-19  5:58 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 3181 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.1.0
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.1.0

This PR depends on: https://github.com/void-linux/void-packages/pull/32330

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

Also, keep in mind that the libgo musl patch here will need to be updated once musl is updated:
https://github.com/void-linux/void-packages/pull/34902/files#diff-1f42a95b93c9550178ff1fbccbef2f47a72711df15c24c9472e2550076978129R163-R176

This is the updated patch for reference:
https://github.com/alpinelinux/aports/blob/8acb21b8ee881e7ab1c812d9a66a17d2501b8730/main/gcc/0049-libgo-adjust-name-of-union-in-sigevent-struct.patch

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Known packages that need to be fixed/updated for glibc 2.36:
- [ ] samba https://github.com/void-linux/void-packages/pull/38700
- [ ] qemu https://github.com/void-linux/void-packages/pull/38769
- [ ] llvm https://github.com/void-linux/void-packages/pull/38694
- [ ] m4 https://github.com/void-linux/void-packages/pull/33730
- [ ] btrfs-progs
- [ ] ntp https://github.com/void-linux/void-packages/pull/38772
- [ ] libarchive https://github.com/void-linux/void-packages/pull/38773

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 138520 bytes --]

From 9366a422c7e57a75bf7821c1bd5f34f95bd476cf Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 01/40] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 15 +++--
 3 files changed, 28 insertions(+), 113 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..4bdaee582d71 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkg-config"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -44,6 +45,12 @@ do_configure() {
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	case "$XBPS_TARGET_MACHINE" in
+		*-musl)
+			conf+=" --disable-gprofng"
+			;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"

From 2e37d51320d9beb02f6f0d300ba8a32e511c9caf Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 02/40] gcc: update to 12.1.0.

---
 common/shlibs                                 |  10 +-
 srcpkgs/gcc/files/gccgo-musl.patch            |  74 +++--------
 srcpkgs/gcc/files/libgnarl-musl.patch         |  18 +--
 srcpkgs/gcc/files/libssp-musl.patch           |  10 +-
 ...c21f3f5726823e19728fdd1571a14aae0fb3.patch | 105 ++++++++++++++++
 ...08065bdd36fb1a9b6aad9666b1edb5e06474.patch | 115 ++++++++++++++++++
 ...65517a59565758107c5b1a51a5fa382f8d1a.patch |  32 +++++
 srcpkgs/gcc/patches/libffi_gnulinux.patch     |  11 --
 .../gcc/patches/libgcc-ibm128-no-tag.patch    |  10 +-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |   3 +-
 srcpkgs/gcc/template                          |  25 ++--
 11 files changed, 305 insertions(+), 108 deletions(-)
 create mode 100644 srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
 create mode 100644 srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
 create mode 100644 srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index 2e5258f3a243..4ed747b361a2 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.1.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.34 perl-5.34.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -849,8 +849,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.1.0_1
+libgnat-12.so libada-12.1.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1701,8 +1701,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.1.0_1
+libasan.so.8 libsanitizer-12.1.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..632ef951097b 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,17 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ a/libgo/go/runtime/os_linux.go
+@@ -363,9 +363,9 @@
+ 
+ 	var timerid int32
+ 	var sevp _sigevent
+-	sevp.sigev_notify = _SIGEV_THREAD_ID
++	sevp.sigev_notify = 4
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.sigev_notify_function))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch b/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
new file mode 100644
index 000000000000..00929202a503
--- /dev/null
+++ b/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
@@ -0,0 +1,105 @@
+From 3b21c21f3f5726823e19728fdd1571a14aae0fb3 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <siarheit@google.com>
+Date: Mon, 27 Jun 2022 13:27:24 +0100
+Subject: [PATCH] c++: avoid <memory> poisoning on musl [PR106102]
+
+On musl <pthread.h> uses calloc() (via <sched.h>). <memory> includes
+it indirectly and exposes use of poisoned calloc() when module code
+is built:
+
+    /build/build/./prev-gcc/xg++ ... ../../gcc-13-20220626/gcc/cp/mapper-resolver.cc
+        In file included from /<<NIX>>/musl-1.2.3-dev/include/pthread.h:30,
+                 from /build/build/prev-x86_64-unknown-linux-musl/libstdc++-v3/include/x86_64-unknown-linux-musl/bits/gthr-default.h:35,
+                 ....
+                 from /build/build/prev-x86_64-unknown-linux-musl/libstdc++-v3/include/memory:77,
+                 from ../../gcc-13-20220626/gcc/../libcody/cody.hh:24,
+                 from ../../gcc-13-20220626/gcc/cp/../../c++tools/resolver.h:25,
+                 from ../../gcc-13-20220626/gcc/cp/../../c++tools/resolver.cc:23,
+                 from ../../gcc-13-20220626/gcc/cp/mapper-resolver.cc:32:
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:84:7: error: attempt to use poisoned "calloc"
+       84 | void *calloc(size_t, size_t);
+          |       ^
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:124:36: error: attempt to use poisoned "calloc"
+      124 | #define CPU_ALLOC(n) ((cpu_set_t *)calloc(1,CPU_ALLOC_SIZE(n)))
+          |                                    ^
+
+gcc/cp/
+
+	PR c++/106102
+	* mapper-client.cc: Include <memory> via "system.h".
+	* mapper-resolver.cc: Ditto.
+	* module.cc: Ditto.
+
+libcc1/
+
+	PR c++/106102
+	* libcc1plugin.cc: Include <memory> via "system.h".
+	* libcp1plugin.cc: Ditto.
+---
+ gcc/cp/mapper-client.cc   | 1 +
+ gcc/cp/mapper-resolver.cc | 1 +
+ gcc/cp/module.cc          | 1 +
+ libcc1/libcc1plugin.cc    | 1 +
+ libcc1/libcp1plugin.cc    | 1 +
+ 5 files changed, 5 insertions(+)
+
+diff --git a/gcc/cp/mapper-client.cc b/gcc/cp/mapper-client.cc
+index 8603a886a099..fe9544b5ba43 100644
+--- a/gcc/cp/mapper-client.cc
++++ b/gcc/cp/mapper-client.cc
+@@ -27,6 +27,7 @@ along with GCC; see the file COPYING3.  If not see
+ #define INCLUDE_STRING
+ #define INCLUDE_VECTOR
+ #define INCLUDE_MAP
++#define INCLUDE_MEMORY
+ #include "system.h"
+ 
+ #include "line-map.h"
+diff --git a/gcc/cp/mapper-resolver.cc b/gcc/cp/mapper-resolver.cc
+index e3d29fb5ada1..e70d1b4ae2ca 100644
+--- a/gcc/cp/mapper-resolver.cc
++++ b/gcc/cp/mapper-resolver.cc
+@@ -25,6 +25,7 @@ along with GCC; see the file COPYING3.  If not see
+ #define INCLUDE_VECTOR
+ #define INCLUDE_ALGORITHM
+ #define INCLUDE_MAP
++#define INCLUDE_MEMORY
+ #include "system.h"
+ 
+ // We don't want or need to be aware of networking
+diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc
+index 753963a4b246..8bb22c2b305a 100644
+--- a/gcc/cp/module.cc
++++ b/gcc/cp/module.cc
+@@ -206,6 +206,7 @@ Classes used:
+ 
+ #define _DEFAULT_SOURCE 1 /* To get TZ field of struct tm, if available.  */
+ #include "config.h"
++#define INCLUDE_MEMORY
+ #define INCLUDE_STRING
+ #define INCLUDE_VECTOR
+ #include "system.h"
+diff --git a/libcc1/libcc1plugin.cc b/libcc1/libcc1plugin.cc
+index 12ab5a57c8dd..bdd0bdabe77f 100644
+--- a/libcc1/libcc1plugin.cc
++++ b/libcc1/libcc1plugin.cc
+@@ -31,6 +31,7 @@
+ #undef PACKAGE_TARNAME
+ #undef PACKAGE_VERSION
+ 
++#define INCLUDE_MEMORY
+ #include "gcc-plugin.h"
+ #include "system.h"
+ #include "coretypes.h"
+diff --git a/libcc1/libcp1plugin.cc b/libcc1/libcp1plugin.cc
+index 83dab7f58b11..e2d5039a0a1f 100644
+--- a/libcc1/libcp1plugin.cc
++++ b/libcc1/libcp1plugin.cc
+@@ -32,6 +32,7 @@
+ #undef PACKAGE_TARNAME
+ #undef PACKAGE_VERSION
+ 
++#define INCLUDE_MEMORY
+ #include "gcc-plugin.h"
+ #include "system.h"
+ #include "coretypes.h"
diff --git a/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch b/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
new file mode 100644
index 000000000000..89bd053d6d04
--- /dev/null
+++ b/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
@@ -0,0 +1,115 @@
+From 49d508065bdd36fb1a9b6aad9666b1edb5e06474 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <siarheit@google.com>
+Date: Mon, 27 Jun 2022 23:42:44 +0100
+Subject: [PATCH] jit: avoid calloc() poisoning on musl [PR106102]
+
+On musl <pthread.h> uses calloc() (via <sched.h>). jit/ includes
+it directly and exposes use of poisoned calloc():
+
+    /build/build/./prev-gcc/xg++ ... ../../gcc-13-20220626/gcc/jit/jit-playback.cc
+    make[3]: *** [Makefile:1143: jit/libgccjit.o] Error 1
+    make[3]: *** Waiting for unfinished jobs....
+    In file included from /<<NIX>>/musl-1.2.3-dev/include/pthread.h:30,
+                     from ../../gcc-13-20220626/gcc/jit/jit-playback.cc:44:
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:84:7: error: attempt to use poisoned "calloc"
+       84 | void *calloc(size_t, size_t);
+          |       ^
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:124:36: error: attempt to use poisoned "calloc"
+      124 | #define CPU_ALLOC(n) ((cpu_set_t *)calloc(1,CPU_ALLOC_SIZE(n)))
+          |                                    ^
+
+The change moves <pthread.h> inclusion to "system.h" under new
+INCLUDE_PTHREAD_H guard and uses this mechanism in libgccjit.
+
+gcc/
+
+	PR c++/106102
+	* system.h: Introduce INCLUDE_PTHREAD_H macros to include <pthread.h>.
+
+gcc/jit/
+
+	PR c++/106102
+	* jit-playback.cc: Include <pthread.h> via "system.h" to avoid calloc()
+	poisoning.
+	* jit-recording.cc: Ditto.
+	* libgccjit.cc: Ditto.
+---
+ gcc/jit/jit-playback.cc  | 3 +--
+ gcc/jit/jit-recording.cc | 2 +-
+ gcc/jit/libgccjit.cc     | 2 +-
+ gcc/system.h             | 4 ++++
+ 4 files changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/gcc/jit/jit-playback.cc b/gcc/jit/jit-playback.cc
+index 6be6bdf8dea5..79714132b91a 100644
+--- a/gcc/jit/jit-playback.cc
++++ b/gcc/jit/jit-playback.cc
+@@ -19,6 +19,7 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "target.h"
+@@ -41,8 +42,6 @@ along with GCC; see the file COPYING3.  If not see
+ #include "diagnostic.h"
+ #include "stmt.h"
+ 
+-#include <pthread.h>
+-
+ #include "jit-playback.h"
+ #include "jit-result.h"
+ #include "jit-builtins.h"
+diff --git a/gcc/jit/jit-recording.cc b/gcc/jit/jit-recording.cc
+index 697dee66e733..f78daed2d71a 100644
+--- a/gcc/jit/jit-recording.cc
++++ b/gcc/jit/jit-recording.cc
+@@ -19,13 +19,13 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "tm.h"
+ #include "pretty-print.h"
+ #include "toplev.h"
+ 
+-#include <pthread.h>
+ 
+ #include "jit-builtins.h"
+ #include "jit-recording.h"
+diff --git a/gcc/jit/libgccjit.cc b/gcc/jit/libgccjit.cc
+index 0e76097b4bac..ca862662777e 100644
+--- a/gcc/jit/libgccjit.cc
++++ b/gcc/jit/libgccjit.cc
+@@ -19,12 +19,12 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "timevar.h"
+ #include "typed-splay-tree.h"
+ #include "cppbuiltin.h"
+-#include <pthread.h>
+ 
+ #include "libgccjit.h"
+ #include "jit-recording.h"
+diff --git a/gcc/system.h b/gcc/system.h
+index 67158b70c789..f8d42ff68150 100644
+--- a/gcc/system.h
++++ b/gcc/system.h
+@@ -753,6 +753,10 @@ extern int vsnprintf (char *, size_t, const char *, va_list);
+ #endif
+ #endif
+ 
++#ifdef INCLUDE_PTHREAD_H
++#include <pthread.h>
++#endif
++
+ #ifdef INCLUDE_ISL
+ #ifdef HAVE_isl
+ #include <isl/options.h>
diff --git a/srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch b/srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch
new file mode 100644
index 000000000000..044a4fc29514
--- /dev/null
+++ b/srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch
@@ -0,0 +1,32 @@
+From f35d65517a59565758107c5b1a51a5fa382f8d1a Mon Sep 17 00:00:00 2001
+From: Ian Lance Taylor <iant@golang.org>
+Date: Tue, 12 Jul 2022 19:42:43 -0700
+Subject: [PATCH] libgo: don't include <linux/fs.h> when building
+ gen-sysinfo.go
+
+Removing this doesn't change anything at least with glibc 2.33.
+The include was added in https://go.dev/cl/6100049 but it's not
+clear why.
+
+Fixes PR go/106266
+
+Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/417294
+---
+ gcc/go/gofrontend/MERGE | 2 +-
+ libgo/sysinfo.c         | 3 ---
+ 2 files changed, 1 insertion(+), 4 deletions(-)
+
+diff --git a/libgo/sysinfo.c b/libgo/sysinfo.c
+index a4259c02ded4..fc0210992faa 100644
+--- a/libgo/sysinfo.c
++++ b/libgo/sysinfo.c
+@@ -158,9 +158,6 @@
+ #if defined(HAVE_LINUX_ETHER_H)
+ #include <linux/ether.h>
+ #endif
+-#if defined(HAVE_LINUX_FS_H)
+-#include <linux/fs.h>
+-#endif
+ #if defined(HAVE_LINUX_REBOOT_H)
+ #include <linux/reboot.h>
+ #endif
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..78a2ce35875d 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,9 +3,10 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
  
  #  ifndef _ABIN32
+
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..32ee79e32f0d 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,15 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
+version=12.1.0
+revision=1
 _patchver="${version%pre*}"
 _minorver="${_patchver%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 wrksrc=gcc-${version/pre/_pre}
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +19,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -396,7 +393,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}

From b9014d4d9c032dabbdad252e2801e4332c4cfd4f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 03/40] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      |  6 ++--
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..08e35d466a44 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From f359203e193fb19dff85868f3a448c6a6e4ca7f7 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 04/40] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 1a4e1ca3d594..b04268908c2e 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="q66 <daniel@octaforge.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From 42bd9e22f93f8aab4c55b8a98e89b1c0c364cbda Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 05/40] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 3 files changed, 55 insertions(+), 353 deletions(-)
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index 4ed747b361a2..46e4674c7fe0 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From fccc027b73a8ff2d1873f9ebd47f8b89faef886d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 16:22:03 -0700
Subject: [PATCH 06/40] llvm12: fix build for glibc 2.36

---
 .../compiler-rt-sanitizer-glibc-2.36.patch    | 59 +++++++++++++++++++
 .../compiler-rt-sanitizer-glibc-2.36.patch    | 59 +++++++++++++++++++
 2 files changed, 118 insertions(+)
 create mode 100644 srcpkgs/llvm12/compiler-rt-sanitizer-glibc-2.36.patch
 create mode 100644 srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch

diff --git a/srcpkgs/llvm12/compiler-rt-sanitizer-glibc-2.36.patch b/srcpkgs/llvm12/compiler-rt-sanitizer-glibc-2.36.patch
new file mode 100644
index 000000000000..e5f24dab8935
--- /dev/null
+++ b/srcpkgs/llvm12/compiler-rt-sanitizer-glibc-2.36.patch
@@ -0,0 +1,59 @@
+From 9cf13067cb5088626ba7ee1ec4c42ec59c7995a0 Mon Sep 17 00:00:00 2001
+From: Fangrui Song <i@maskray.me>
+Date: Mon, 11 Jul 2022 12:53:34 -0700
+Subject: [PATCH] [sanitizer] Remove #include <linux/fs.h> to resolve
+ fsconfig_command/mount_attr conflict with glibc 2.36
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+It is generally not a good idea to mix usage of glibc headers and Linux UAPI
+headers (https://sourceware.org/glibc/wiki/Synchronizing_Headers). In glibc
+since 7eae6a91e9b1670330c9f15730082c91c0b1d570 (milestone: 2.36), sys/mount.h
+defines `fsconfig_command` which conflicts with linux/mount.h:
+
+    .../usr/include/linux/mount.h:95:6: error: redeclaration of ‘enum fsconfig_command’
+
+Remove #include <linux/fs.h> which pulls in linux/mount.h. Expand its 4 macros manually.
+Android sys/mount.h doesn't define BLKBSZGET and it still needs linux/fs.h.
+In the long term we should move Linux specific definitions to sanitizer_platform_limits_linux.cpp
+but this commit is easy to cherry pick into older compiler-rt releases.
+
+Fix https://github.com/llvm/llvm-project/issues/56421
+
+Reviewed By: #sanitizers, vitalybuka, zatrazz
+
+Differential Revision: https://reviews.llvm.org/D129471
+---
+ .../sanitizer_platform_limits_posix.cpp                | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+index 4bd425435d56d..3a94b260686f1 100644
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -73,7 +73,9 @@
+ #include <sys/vt.h>
+ #include <linux/cdrom.h>
+ #include <linux/fd.h>
++#if SANITIZER_ANDROID
+ #include <linux/fs.h>
++#endif
+ #include <linux/hdreg.h>
+ #include <linux/input.h>
+ #include <linux/ioctl.h>
+@@ -876,10 +878,10 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
+   unsigned IOCTL_EVIOCGPROP = IOCTL_NOT_PRESENT;
+   unsigned IOCTL_EVIOCSKEYCODE_V2 = IOCTL_NOT_PRESENT;
+ #endif
+-  unsigned IOCTL_FS_IOC_GETFLAGS = FS_IOC_GETFLAGS;
+-  unsigned IOCTL_FS_IOC_GETVERSION = FS_IOC_GETVERSION;
+-  unsigned IOCTL_FS_IOC_SETFLAGS = FS_IOC_SETFLAGS;
+-  unsigned IOCTL_FS_IOC_SETVERSION = FS_IOC_SETVERSION;
++  unsigned IOCTL_FS_IOC_GETFLAGS = _IOR('f', 1, long);
++  unsigned IOCTL_FS_IOC_GETVERSION = _IOR('v', 1, long);
++  unsigned IOCTL_FS_IOC_SETFLAGS = _IOW('f', 2, long);
++  unsigned IOCTL_FS_IOC_SETVERSION = _IOW('v', 2, long);
+   unsigned IOCTL_GIO_CMAP = GIO_CMAP;
+   unsigned IOCTL_GIO_FONT = GIO_FONT;
+   unsigned IOCTL_GIO_UNIMAP = GIO_UNIMAP;
diff --git a/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch b/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch
new file mode 100644
index 000000000000..e5f24dab8935
--- /dev/null
+++ b/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch
@@ -0,0 +1,59 @@
+From 9cf13067cb5088626ba7ee1ec4c42ec59c7995a0 Mon Sep 17 00:00:00 2001
+From: Fangrui Song <i@maskray.me>
+Date: Mon, 11 Jul 2022 12:53:34 -0700
+Subject: [PATCH] [sanitizer] Remove #include <linux/fs.h> to resolve
+ fsconfig_command/mount_attr conflict with glibc 2.36
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+It is generally not a good idea to mix usage of glibc headers and Linux UAPI
+headers (https://sourceware.org/glibc/wiki/Synchronizing_Headers). In glibc
+since 7eae6a91e9b1670330c9f15730082c91c0b1d570 (milestone: 2.36), sys/mount.h
+defines `fsconfig_command` which conflicts with linux/mount.h:
+
+    .../usr/include/linux/mount.h:95:6: error: redeclaration of ‘enum fsconfig_command’
+
+Remove #include <linux/fs.h> which pulls in linux/mount.h. Expand its 4 macros manually.
+Android sys/mount.h doesn't define BLKBSZGET and it still needs linux/fs.h.
+In the long term we should move Linux specific definitions to sanitizer_platform_limits_linux.cpp
+but this commit is easy to cherry pick into older compiler-rt releases.
+
+Fix https://github.com/llvm/llvm-project/issues/56421
+
+Reviewed By: #sanitizers, vitalybuka, zatrazz
+
+Differential Revision: https://reviews.llvm.org/D129471
+---
+ .../sanitizer_platform_limits_posix.cpp                | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+index 4bd425435d56d..3a94b260686f1 100644
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -73,7 +73,9 @@
+ #include <sys/vt.h>
+ #include <linux/cdrom.h>
+ #include <linux/fd.h>
++#if SANITIZER_ANDROID
+ #include <linux/fs.h>
++#endif
+ #include <linux/hdreg.h>
+ #include <linux/input.h>
+ #include <linux/ioctl.h>
+@@ -876,10 +878,10 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
+   unsigned IOCTL_EVIOCGPROP = IOCTL_NOT_PRESENT;
+   unsigned IOCTL_EVIOCSKEYCODE_V2 = IOCTL_NOT_PRESENT;
+ #endif
+-  unsigned IOCTL_FS_IOC_GETFLAGS = FS_IOC_GETFLAGS;
+-  unsigned IOCTL_FS_IOC_GETVERSION = FS_IOC_GETVERSION;
+-  unsigned IOCTL_FS_IOC_SETFLAGS = FS_IOC_SETFLAGS;
+-  unsigned IOCTL_FS_IOC_SETVERSION = FS_IOC_SETVERSION;
++  unsigned IOCTL_FS_IOC_GETFLAGS = _IOR('f', 1, long);
++  unsigned IOCTL_FS_IOC_GETVERSION = _IOR('v', 1, long);
++  unsigned IOCTL_FS_IOC_SETFLAGS = _IOW('f', 2, long);
++  unsigned IOCTL_FS_IOC_SETVERSION = _IOW('v', 2, long);
+   unsigned IOCTL_GIO_CMAP = GIO_CMAP;
+   unsigned IOCTL_GIO_FONT = GIO_FONT;
+   unsigned IOCTL_GIO_UNIMAP = GIO_UNIMAP;

From 5decce17bde82ecb83baf8b68135290e638fb87e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 16:22:29 -0700
Subject: [PATCH 07/40] samba: fix build for glibc 2.36

---
 srcpkgs/samba/patches/fix-glibc-2.36.patch | 59 ++++++++++++++++++++++
 1 file changed, 59 insertions(+)
 create mode 100644 srcpkgs/samba/patches/fix-glibc-2.36.patch

diff --git a/srcpkgs/samba/patches/fix-glibc-2.36.patch b/srcpkgs/samba/patches/fix-glibc-2.36.patch
new file mode 100644
index 000000000000..beb84ce6a8de
--- /dev/null
+++ b/srcpkgs/samba/patches/fix-glibc-2.36.patch
@@ -0,0 +1,59 @@
+From 766151bf5b7ef95ae4c8c98b8994e5c21c5bbec0 Mon Sep 17 00:00:00 2001
+From: Andreas Schneider <asn@samba.org>
+Date: Tue, 2 Aug 2022 07:55:46 +0200
+Subject: [PATCH] lib:replace: Only include <sys/mount.h> on non-Linux systems
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Details at:
+https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
+
+BUG: https://bugzilla.samba.org/show_bug.cgi?id=15132
+
+Signed-off-by: Andreas Schneider <asn@samba.org>
+Reviewed-by: Ralph Boehme <slow@samba.org>
+
+Autobuild-User(master): Ralph Böhme <slow@samba.org>
+Autobuild-Date(master): Tue Aug  2 11:05:14 UTC 2022 on sn-devel-184
+---
+ lib/replace/system/filesys.h | 4 +++-
+ lib/replace/wscript          | 3 +++
+ 2 files changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/lib/replace/system/filesys.h b/lib/replace/system/filesys.h
+index 034e5d5886c..bb9482c69af 100644
+--- a/lib/replace/system/filesys.h
++++ b/lib/replace/system/filesys.h
+@@ -36,7 +36,8 @@
+ #include <sys/param.h>
+ #endif
+ 
+-#ifdef HAVE_SYS_MOUNT_H
++/* This include is required on UNIX (*BSD, AIX, ...) for statfs() */
++#if !defined(LINUX) && defined(HAVE_SYS_MOUNT_H)
+ #include <sys/mount.h>
+ #endif
+ 
+@@ -44,6 +45,7 @@
+ #include <mntent.h>
+ #endif
+ 
++/* This include is required on Linux for statfs() */
+ #ifdef HAVE_SYS_VFS_H
+ #include <sys/vfs.h>
+ #endif
+diff --git a/lib/replace/wscript b/lib/replace/wscript
+index 4c774d9f0c3..dd9b19219a1 100644
+--- a/lib/replace/wscript
++++ b/lib/replace/wscript
+@@ -31,6 +31,9 @@ def configure(conf):
+ 
+     conf.env.standalone_replace = conf.IN_LAUNCH_DIR()
+ 
++    if sys.platform.rfind('linux') > -1:
++        conf.DEFINE('LINUX', '1')
++
+     conf.DEFINE('BOOL_DEFINED', 1)
+     conf.DEFINE('HAVE_LIBREPLACE', 1)
+     conf.DEFINE('LIBREPLACE_NETWORK_CHECKS', 1)

From 8f3b5a03d6f955229e3634e8172a79a2839cd6d5 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 16:22:47 -0700
Subject: [PATCH 08/40] qemu: fix build for glibc 2.36

---
 .../qemu/patches/fix-compat-glibc-2.36.patch  | 100 ++++++++++++++++++
 1 file changed, 100 insertions(+)
 create mode 100644 srcpkgs/qemu/patches/fix-compat-glibc-2.36.patch

diff --git a/srcpkgs/qemu/patches/fix-compat-glibc-2.36.patch b/srcpkgs/qemu/patches/fix-compat-glibc-2.36.patch
new file mode 100644
index 000000000000..e7239ad06313
--- /dev/null
+++ b/srcpkgs/qemu/patches/fix-compat-glibc-2.36.patch
@@ -0,0 +1,100 @@
+From 3cd3df2a9584e6f753bb62a0028bd67124ab5532 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= <berrange@redhat.com>
+Date: Tue, 2 Aug 2022 12:41:34 -0400
+Subject: [PATCH] linux-user: fix compat with glibc >= 2.36 sys/mount.h
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The latest glibc 2.36 has extended sys/mount.h so that it
+defines the FSCONFIG_* enum constants. These are historically
+defined in linux/mount.h, and thus if you include both headers
+the compiler complains:
+
+In file included from /usr/include/linux/fs.h:19,
+                 from ../linux-user/syscall.c:98:
+/usr/include/linux/mount.h:95:6: error: redeclaration of 'enum fsconfig_command'
+   95 | enum fsconfig_command {
+      |      ^~~~~~~~~~~~~~~~
+In file included from ../linux-user/syscall.c:31:
+/usr/include/sys/mount.h:189:6: note: originally defined here
+  189 | enum fsconfig_command
+      |      ^~~~~~~~~~~~~~~~
+/usr/include/linux/mount.h:96:9: error: redeclaration of enumerator 'FSCONFIG_SET_FLAG'
+   96 |         FSCONFIG_SET_FLAG       = 0,    /* Set parameter, supplying no value */
+      |         ^~~~~~~~~~~~~~~~~
+/usr/include/sys/mount.h:191:3: note: previous definition of 'FSCONFIG_SET_FLAG' with type 'enum fsconfig_command'
+  191 |   FSCONFIG_SET_FLAG       = 0,    /* Set parameter, supplying no value */
+      |   ^~~~~~~~~~~~~~~~~
+...snip...
+
+QEMU doesn't include linux/mount.h, but it does use
+linux/fs.h and thus gets linux/mount.h indirectly.
+
+glibc acknowledges this problem but does not appear to
+be intending to fix it in the forseeable future, simply
+documenting it as a known incompatibility with no
+workaround:
+
+  https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
+  https://sourceware.org/glibc/wiki/Synchronizing_Headers
+
+To address this requires either removing use of sys/mount.h
+or linux/fs.h, despite QEMU needing declarations from
+both.
+
+This patch removes linux/fs.h, meaning we have to define
+various FS_IOC constants that are now unavailable.
+
+Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
+Tested-by: Richard W.M. Jones <rjones@redhat.com>
+Message-Id: <20220802164134.1851910-1-berrange@redhat.com>
+Signed-off-by: Laurent Vivier <laurent@vivier.eu>
+---
+ linux-user/syscall.c | 18 ++++++++++++++++++
+ meson.build          |  2 ++
+ 2 files changed, 20 insertions(+)
+
+diff --git a/linux-user/syscall.c b/linux-user/syscall.c
+index ef53feb5ab45..f4091212027c 100644
+--- a/linux-user/syscall.c
++++ b/linux-user/syscall.c
+@@ -95,7 +95,25 @@
+ #include <linux/soundcard.h>
+ #include <linux/kd.h>
+ #include <linux/mtio.h>
++
++#ifdef HAVE_SYS_MOUNT_FSCONFIG
++/*
++ * glibc >= 2.36 linux/mount.h conflicts with sys/mount.h,
++ * which in turn prevents use of linux/fs.h. So we have to
++ * define the constants ourselves for now.
++ */
++#define FS_IOC_GETFLAGS                _IOR('f', 1, long)
++#define FS_IOC_SETFLAGS                _IOW('f', 2, long)
++#define FS_IOC_GETVERSION              _IOR('v', 1, long)
++#define FS_IOC_SETVERSION              _IOW('v', 2, long)
++#define FS_IOC_FIEMAP                  _IOWR('f', 11, struct fiemap)
++#define FS_IOC32_GETFLAGS              _IOR('f', 1, int)
++#define FS_IOC32_SETFLAGS              _IOW('f', 2, int)
++#define FS_IOC32_GETVERSION            _IOR('v', 1, int)
++#define FS_IOC32_SETVERSION            _IOW('v', 2, int)
++#else
+ #include <linux/fs.h>
++#endif
+ #include <linux/fd.h>
+ #if defined(CONFIG_FIEMAP)
+ #include <linux/fiemap.h>
+diff --git a/meson.build b/meson.build
+index 294e9a8f329e..30a380752c0d 100644
+--- a/meson.build
++++ b/meson.build
+@@ -1963,6 +1963,8 @@ config_host_data.set('HAVE_OPTRESET',
+                      cc.has_header_symbol('getopt.h', 'optreset'))
+ config_host_data.set('HAVE_IPPROTO_MPTCP',
+                      cc.has_header_symbol('netinet/in.h', 'IPPROTO_MPTCP'))
++config_host_data.set('HAVE_SYS_MOUNT_FSCONFIG',
++                     cc.has_header_symbol('sys/mount.h', 'FSCONFIG_SET_FLAG'))
+ 
+ # has_member
+ config_host_data.set('HAVE_SIGEV_NOTIFY_THREAD_ID',

From 50b370142ad6df88b7c1660c23ac36114828ee44 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 17:21:40 -0700
Subject: [PATCH 09/40] m4: update to 1.4.19.

---
 srcpkgs/m4/patches/fix-glibc-2.27.patch | 167 ------------------------
 srcpkgs/m4/template                     |  12 +-
 2 files changed, 6 insertions(+), 173 deletions(-)
 delete mode 100644 srcpkgs/m4/patches/fix-glibc-2.27.patch

diff --git a/srcpkgs/m4/patches/fix-glibc-2.27.patch b/srcpkgs/m4/patches/fix-glibc-2.27.patch
deleted file mode 100644
index 59d33cff164d..000000000000
--- a/srcpkgs/m4/patches/fix-glibc-2.27.patch
+++ /dev/null
@@ -1,167 +0,0 @@
-From 4af4a4a71827c0bc5e0ec67af23edef4f15cee8e Mon Sep 17 00:00:00 2001
-From: Paul Eggert <eggert@cs.ucla.edu>
-Date: Mon, 5 Mar 2018 10:56:29 -0800
-Subject: [PATCH] fflush: adjust to glibc 2.28 libio.h removal
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Problem reported by Daniel P. Berrangé in:
-https://lists.gnu.org/r/bug-gnulib/2018-03/msg00000.html
-* lib/fbufmode.c (fbufmode):
-* lib/fflush.c (clear_ungetc_buffer_preserving_position)
-(disable_seek_optimization, rpl_fflush):
-* lib/fpending.c (__fpending):
-* lib/fpurge.c (fpurge):
-* lib/freadable.c (freadable):
-* lib/freadahead.c (freadahead):
-* lib/freading.c (freading):
-* lib/freadptr.c (freadptr):
-* lib/freadseek.c (freadptrinc):
-* lib/fseeko.c (fseeko):
-* lib/fseterr.c (fseterr):
-* lib/fwritable.c (fwritable):
-* lib/fwriting.c (fwriting):
-Check _IO_EOF_SEEN instead of _IO_ftrylockfile.
-* lib/stdio-impl.h (_IO_IN_BACKUP) [_IO_EOF_SEEN]:
-Define if not already defined.
-
-[yann.morin.1998@free.fr: partially backport from upstream gnulib]
-Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
-
----
- lib/fflush.c     |  6 +++---
- lib/fpending.c   |  2 +-
- lib/fpurge.c     |  2 +-
- lib/freadahead.c |  2 +-
- lib/freading.c   |  2 +-
- lib/fseeko.c     |  4 ++--
- lib/stdio-impl.h |  6 ++++++
- 7 files changed, 15 insertions(+), 9 deletions(-)
-
-diff --git a/lib/fflush.c b/build-aux/gnulib/lib/fflush.c
-index 983ade0ff..a6edfa105 100644
---- a/lib/fflush.c
-+++ b/lib/fflush.c
-@@ -33,7 +33,7 @@
- #undef fflush
- 
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- 
- /* Clear the stream's ungetc buffer, preserving the value of ftello (fp).  */
- static void
-@@ -72,7 +72,7 @@ clear_ungetc_buffer (FILE *fp)
- 
- #endif
- 
--#if ! (defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
-+#if ! (defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
- 
- # if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT
- /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
-@@ -148,7 +148,7 @@ rpl_fflush (FILE *stream)
-   if (stream == NULL || ! freading (stream))
-     return fflush (stream);
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- 
-   clear_ungetc_buffer_preserving_position (stream);
- 
-diff --git a/lib/fpending.c b/build-aux/gnulib/lib/fpending.c
-index c84e3a5b4..789f50e4e 100644
---- a/lib/fpending.c
-+++ b/lib/fpending.c
-@@ -32,7 +32,7 @@ __fpending (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   return fp->_IO_write_ptr - fp->_IO_write_base;
- #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
-   /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
-diff --git a/lib/fpurge.c b/build-aux/gnulib/lib/fpurge.c
-index b1d417c7a..3aedcc373 100644
---- a/lib/fpurge.c
-+++ b/lib/fpurge.c
-@@ -62,7 +62,7 @@ fpurge (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   fp->_IO_read_end = fp->_IO_read_ptr;
-   fp->_IO_write_ptr = fp->_IO_write_base;
-   /* Avoid memory leak when there is an active ungetc buffer.  */
-diff --git a/lib/freadahead.c b/build-aux/gnulib/lib/freadahead.c
-index c2ecb5b28..23ec76ee5 100644
---- a/lib/freadahead.c
-+++ b/lib/freadahead.c
-@@ -30,7 +30,7 @@ extern size_t __sreadahead (FILE *);
- size_t
- freadahead (FILE *fp)
- {
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   if (fp->_IO_write_ptr > fp->_IO_write_base)
-     return 0;
-   return (fp->_IO_read_end - fp->_IO_read_ptr)
-diff --git a/lib/freading.c b/build-aux/gnulib/lib/freading.c
-index 73c28acdd..c24d0c88a 100644
---- a/lib/freading.c
-+++ b/lib/freading.c
-@@ -31,7 +31,7 @@ freading (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   return ((fp->_flags & _IO_NO_WRITES) != 0
-           || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0
-               && fp->_IO_read_base != NULL));
-diff --git a/lib/fseeko.c b/build-aux/gnulib/lib/fseeko.c
-index 0101ab55f..193f4e8ce 100644
---- a/lib/fseeko.c
-+++ b/lib/fseeko.c
-@@ -47,7 +47,7 @@ fseeko (FILE *fp, off_t offset, int whence)
- #endif
- 
-   /* These tests are based on fpurge.c.  */
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   if (fp->_IO_read_end == fp->_IO_read_ptr
-       && fp->_IO_write_ptr == fp->_IO_write_base
-       && fp->_IO_save_base == NULL)
-@@ -123,7 +123,7 @@ fseeko (FILE *fp, off_t offset, int whence)
-           return -1;
-         }
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-       fp->_flags &= ~_IO_EOF_SEEN;
-       fp->_offset = pos;
- #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
-diff --git a/lib/stdio-impl.h b/build-aux/gnulib/lib/stdio-impl.h
-index 78d896e9f..05c5752a2 100644
---- a/lib/stdio-impl.h
-+++ b/lib/stdio-impl.h
-@@ -18,6 +18,12 @@
-    the same implementation of stdio extension API, except that some fields
-    have different naming conventions, or their access requires some casts.  */
- 
-+/* Glibc 2.28 made _IO_IN_BACKUP private.  For now, work around this
-+   problem by defining it ourselves.  FIXME: Do not rely on glibc
-+   internals.  */
-+#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN
-+# define _IO_IN_BACKUP 0x100
-+#endif
- 
- /* BSD stdio derived implementations.  */
- 
--- 
-2.14.1
-
-
diff --git a/srcpkgs/m4/template b/srcpkgs/m4/template
index 78f3dae6184a..762593d883bd 100644
--- a/srcpkgs/m4/template
+++ b/srcpkgs/m4/template
@@ -1,17 +1,17 @@
 # Template file for 'm4'
 pkgname=m4
-version=1.4.18
-revision=2
+version=1.4.19
+revision=1
 bootstrap=yes
-replaces="chroot-m4>=0"
 build_style=gnu-configure
 configure_args="--enable-changeword --enable-threads"
 short_desc="GNU version of UNIX m4 macro language processor"
-homepage="https://www.gnu.org/software/m4/"
-license="GPL-3.0-or-later"
 maintainer="Enno Boland <gottox@voidlinux.org>"
+license="GPL-3.0-or-later"
+homepage="https://www.gnu.org/software/m4/"
 distfiles="${GNU_SITE}/${pkgname}/${pkgname}-${version}.tar.xz"
-checksum=f2c1e86ca0a404ff281631bdc8377638992744b175afb806e25871a24a934e07
+checksum=63aede5c6d33b6d9b13511cd0be2cac046f2e70fd0a07aa9573a04a82783af96
+replaces="chroot-m4>=0"
 
 if [ "$XBPS_TARGET_LIBC" = musl ]; then
 	export ac_cv_lib_error_at_line=no

From 57ba66c30d5f972dcb46b7dc4f868aef50b7c189 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 22:56:22 -0700
Subject: [PATCH 10/40] ntp: fix build with glibc 2.34

---
 srcpkgs/ntp/patches/compat-glibc-2.34.patch | 55 +++++++++++++++++++++
 1 file changed, 55 insertions(+)
 create mode 100644 srcpkgs/ntp/patches/compat-glibc-2.34.patch

diff --git a/srcpkgs/ntp/patches/compat-glibc-2.34.patch b/srcpkgs/ntp/patches/compat-glibc-2.34.patch
new file mode 100644
index 000000000000..4e75cc845282
--- /dev/null
+++ b/srcpkgs/ntp/patches/compat-glibc-2.34.patch
@@ -0,0 +1,55 @@
+diff -Nru a/libntp/work_thread.c b/libntp/work_thread.c
+--- a/libntp/work_thread.c	2022-01-16 11:35:17.290791372 +0100
++++ b/libntp/work_thread.c	2022-01-16 11:35:17.290791372 +0100
+@@ -41,20 +41,10 @@
+ #ifndef THREAD_MINSTACKSIZE
+ # define THREAD_MINSTACKSIZE	(64U * 1024)
+ #endif
+-#ifndef __sun
+-#if defined(PTHREAD_STACK_MIN) && THREAD_MINSTACKSIZE < PTHREAD_STACK_MIN
+-# undef THREAD_MINSTACKSIZE
+-# define THREAD_MINSTACKSIZE PTHREAD_STACK_MIN
+-#endif
+-#endif
+ 
+ #ifndef THREAD_MAXSTACKSIZE
+ # define THREAD_MAXSTACKSIZE	(256U * 1024)
+ #endif
+-#if THREAD_MAXSTACKSIZE < THREAD_MINSTACKSIZE
+-# undef  THREAD_MAXSTACKSIZE
+-# define THREAD_MAXSTACKSIZE THREAD_MINSTACKSIZE
+-#endif
+ 
+ /* need a good integer to store a pointer... */
+ #ifndef UINTPTR_T
+@@ -594,12 +584,25 @@
+ 			"start_blocking_thread: pthread_attr_getstacksize() -> %s",
+ 			strerror(rc));
+ 	} else {
+-		if (ostacksize < THREAD_MINSTACKSIZE)
+-			nstacksize = THREAD_MINSTACKSIZE;
+-		else if (ostacksize > THREAD_MAXSTACKSIZE)
++		nstacksize = ostacksize;
++		/* order is important here: first clamp on upper limit,
++		 * and the PTHREAD min stack size is ultimate override!
++		 */ 
++		if (nstacksize > THREAD_MAXSTACKSIZE)
+ 			nstacksize = THREAD_MAXSTACKSIZE;
+-		else
+-			nstacksize = ostacksize;
++#            ifdef PTHREAD_STACK_MAX
++		if (nstacksize > PTHREAD_STACK_MAX)
++			nstacksize = PTHREAD_STACK_MAX;
++#            endif
++
++		/* now clamp on lower stack limit. */
++		if (nstacksize < THREAD_MINSTACKSIZE)
++			nstacksize = THREAD_MINSTACKSIZE;
++#            ifdef PTHREAD_STACK_MIN
++		if (nstacksize < PTHREAD_STACK_MIN)
++			nstacksize = PTHREAD_STACK_MIN;
++#            endif
++
+ 		if (nstacksize != ostacksize)
+ 			rc = pthread_attr_setstacksize(&thr_attr, nstacksize);
+ 		if (0 != rc)

From 603fecc6a420b24056051b8c60464aacaacaad01 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 22:56:41 -0700
Subject: [PATCH 11/40] libarchive: fix for glibc 2.36

---
 .../patches/fix-build-glibc-2.36.patch        | 41 +++++++++++++++++++
 1 file changed, 41 insertions(+)
 create mode 100644 srcpkgs/libarchive/patches/fix-build-glibc-2.36.patch

diff --git a/srcpkgs/libarchive/patches/fix-build-glibc-2.36.patch b/srcpkgs/libarchive/patches/fix-build-glibc-2.36.patch
new file mode 100644
index 000000000000..7c88ca1b1ca0
--- /dev/null
+++ b/srcpkgs/libarchive/patches/fix-build-glibc-2.36.patch
@@ -0,0 +1,41 @@
+From a2f68263a1da5ad227bcb9cd8fa91b93c8b6c99f Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 25 Jul 2022 10:56:53 -0700
+Subject: [PATCH] libarchive: Do not include sys/mount.h when linux/fs.h is
+ present
+
+These headers are in conflict and only one is needed by
+archive_read_disk_posix.c therefore include linux/fs.h if it exists
+otherwise include sys/mount.h
+
+It also helps compiling with glibc 2.36
+where sys/mount.h conflicts with linux/mount.h see [1]
+
+[1] https://sourceware.org/glibc/wiki/Release/2.36
+---
+ libarchive/archive_read_disk_posix.c | 5 ++---
+ 1 file changed, 2 insertions(+), 3 deletions(-)
+
+diff --git a/libarchive/archive_read_disk_posix.c b/libarchive/archive_read_disk_posix.c
+index 2b39e672b..a96008db7 100644
+--- a/libarchive/archive_read_disk_posix.c
++++ b/libarchive/archive_read_disk_posix.c
+@@ -34,9 +34,6 @@ __FBSDID("$FreeBSD$");
+ #ifdef HAVE_SYS_PARAM_H
+ #include <sys/param.h>
+ #endif
+-#ifdef HAVE_SYS_MOUNT_H
+-#include <sys/mount.h>
+-#endif
+ #ifdef HAVE_SYS_STAT_H
+ #include <sys/stat.h>
+ #endif
+@@ -54,6 +51,8 @@ __FBSDID("$FreeBSD$");
+ #endif
+ #ifdef HAVE_LINUX_FS_H
+ #include <linux/fs.h>
++#elif HAVE_SYS_MOUNT_H
++#include <sys/mount.h>
+ #endif
+ /*
+  * Some Linux distributions have both linux/ext2_fs.h and ext2fs/ext2_fs.h.

From 86d9608ce232e4fc7ad68824e04335ce3179e809 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 22:57:59 -0700
Subject: [PATCH 12/40] btrfs-progs: update to 5.19.

---
 srcpkgs/btrfs-progs/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/btrfs-progs/template b/srcpkgs/btrfs-progs/template
index f6c53d8587e1..292d5110106b 100644
--- a/srcpkgs/btrfs-progs/template
+++ b/srcpkgs/btrfs-progs/template
@@ -1,6 +1,6 @@
 # Template file for 'btrfs-progs'
 pkgname=btrfs-progs
-version=5.18.1
+version=5.19
 revision=1
 wrksrc="${pkgname}-v${version}"
 build_style=gnu-configure
@@ -16,7 +16,7 @@ license="GPL-2.0-only, LGPL-2.1-or-later"
 homepage="https://btrfs.wiki.kernel.org/index.php/Main_Page"
 changelog="https://raw.githubusercontent.com/kdave/btrfs-progs/master/CHANGES"
 distfiles="${KERNEL_SITE}/kernel/people/kdave/${pkgname}/${pkgname}-v${version}.tar.xz"
-checksum=6e98a75ccff52e9354daa1ad284c614c490f844273a2fa524cbac9eb841c7255
+checksum=1fbcf06e4b2f80e7a127fd687ed4625a5b74fa674fe212c836ff70e0edfcccf9
 # Most of the tests depend on `mount` and `fallocate` commands, which are not
 # presented in chroot-util-linux
 make_check=no

From 5bbd2f7b7b488a912589d7d41995024e59f64ab2 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 14 Aug 2022 19:29:36 -0700
Subject: [PATCH 13/40] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove nopie=yes. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh             |  1 +
 common/environment/build-style/void-cross.sh | 36 +++++++++++++++++++-
 2 files changed, 36 insertions(+), 1 deletion(-)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..c24013755704 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -132,6 +132,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
diff --git a/common/environment/build-style/void-cross.sh b/common/environment/build-style/void-cross.sh
index 62ce9eaa2e4a..4b77c90efc8b 100644
--- a/common/environment/build-style/void-cross.sh
+++ b/common/environment/build-style/void-cross.sh
@@ -1,6 +1,40 @@
 lib32disabled=yes
-nopie=yes
 create_wrksrc=yes
 
 nostrip_files+=" libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a libgmem.a"
+nopie_files+=" /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/go1
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/lto-wrapper
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/plugin/gengtype
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/cc1objplus
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/cc1obj
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/collect2
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/lto1
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/f951
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/cc1
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/gnat1
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/cc1plus
+ /usr/bin/${sourcepkg/cross-}-gcov-dump
+ /usr/bin/${sourcepkg/cross-}-gnatlink
+ /usr/bin/${sourcepkg/cross-}-gnatbind
+ /usr/bin/${sourcepkg/cross-}-gcc
+ /usr/bin/${sourcepkg/cross-}-cpp
+ /usr/bin/${sourcepkg/cross-}-gnatchop
+ /usr/bin/${sourcepkg/cross-}-gfortran
+ /usr/bin/${sourcepkg/cross-}-gccgo
+ /usr/bin/${sourcepkg/cross-}-c++
+ /usr/bin/${sourcepkg/cross-}-lto-dump
+ /usr/bin/${sourcepkg/cross-}-gnatname
+ /usr/bin/${sourcepkg/cross-}-gnatprep
+ /usr/bin/${sourcepkg/cross-}-g++
+ /usr/bin/${sourcepkg/cross-}-gnat
+ /usr/bin/${sourcepkg/cross-}-gcc-ranlib
+ /usr/bin/${sourcepkg/cross-}-gnatkr
+ /usr/bin/${sourcepkg/cross-}-gnatmake
+ /usr/bin/${sourcepkg/cross-}-gcc-${_gcc_version}
+ /usr/bin/${sourcepkg/cross-}-gcc-ar
+ /usr/bin/${sourcepkg/cross-}-gnatclean
+ /usr/bin/${sourcepkg/cross-}-gcov
+ /usr/bin/${sourcepkg/cross-}-gnatls
+ /usr/bin/${sourcepkg/cross-}-gcc-nm
+ /usr/bin/${sourcepkg/cross-}-gcov-tool"

From 6feec8af9471579e439c03bc065d3d7002325a40 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:08:52 -0700
Subject: [PATCH 14/40] openssh: suppress werror on gcc12

---
 srcpkgs/openssh/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/openssh/template b/srcpkgs/openssh/template
index 02a2dec35f42..6e8e343a9dca 100644
--- a/srcpkgs/openssh/template
+++ b/srcpkgs/openssh/template
@@ -40,7 +40,7 @@ if [ "$build_option_ldns" -a -z "$build_option_ssl" ]; then
 	broken="option 'ldns' requires option 'ssl'"
 fi
 
-CFLAGS="-Wno-format-truncation -Wno-stringop-truncation"
+CFLAGS="-Wno-format-truncation -Wno-stringop-truncation -Wno-error=maybe-uninitialized"
 
 case $XBPS_TARGET_MACHINE in
 	i686-musl)

From a31a998e0a86ccfa4baed4d30db2d4538f8afe94 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:09:31 -0700
Subject: [PATCH 15/40] linux5.18: update dotconfigs for gcc12

---
 srcpkgs/linux5.18/files/x86_64-dotconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/linux5.18/files/x86_64-dotconfig b/srcpkgs/linux5.18/files/x86_64-dotconfig
index 4e73a3195d40..ea6204868e23 100644
--- a/srcpkgs/linux5.18/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.18/files/x86_64-dotconfig
@@ -512,6 +512,7 @@ CONFIG_RETHUNK=y
 CONFIG_CPU_UNRET_ENTRY=y
 CONFIG_CPU_IBPB_ENTRY=y
 CONFIG_CPU_IBRS_ENTRY=y
+CONFIG_SLS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10060,8 +10061,11 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
 # Memory initialization
 #
 CONFIG_INIT_STACK_NONE=y
+# CONFIG_INIT_STACK_ALL_PATTERN is not set
+# CONFIG_INIT_STACK_ALL_ZERO is not set
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
+# CONFIG_ZERO_CALL_USED_REGS is not set
 # end of Memory initialization
 # end of Kernel hardening options
 # end of Security options
@@ -10538,6 +10542,7 @@ CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
 # CONFIG_UBSAN is not set
 CONFIG_HAVE_ARCH_KCSAN=y
+# CONFIG_KCSAN is not set
 # end of Generic Kernel Debugging Instruments
 
 #

From 4d08cf3243d78434409333152cdfb48533fa8973 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 18:00:42 -0700
Subject: [PATCH 16/40] xf86-video-vmware: fix build on gcc12

---
 ...183b3395333d5d4c73e25c2d011748f15eda.patch | 30 +++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch

diff --git a/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch b/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch
new file mode 100644
index 000000000000..ff839f16e628
--- /dev/null
+++ b/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch
@@ -0,0 +1,30 @@
+From 77b8183b3395333d5d4c73e25c2d011748f15eda Mon Sep 17 00:00:00 2001
+From: Rudi Heitbaum <rudi@heitbaum.com>
+Date: Sun, 8 May 2022 03:00:10 +0000
+Subject: [PATCH] vmwgfx: fix missing array notation
+
+ Fixes error identified by gcc-12.1.0 compiler
+
+make
+  CC       libvmwgfx_la-vmwgfx_tex_video.lo
+vmwgfx_tex_video.c: In function 'stop_video':
+vmwgfx_tex_video.c:240:20: error: the comparison will always evaluate as 'true' for the address of 'yuv' will never be NULL [-Werror=address]
+  240 |                if (priv->yuv[i]) {
+      |                    ^~~~
+---
+ vmwgfx/vmwgfx_tex_video.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/vmwgfx/vmwgfx_tex_video.c b/vmwgfx/vmwgfx_tex_video.c
+index acc2b56..480a5f1 100644
+--- a/vmwgfx/vmwgfx_tex_video.c
++++ b/vmwgfx/vmwgfx_tex_video.c
+@@ -237,7 +237,7 @@ stop_video(ScrnInfoPtr pScrn, pointer data, Bool shutdown)
+ 
+        for (i=0; i<3; ++i) {
+ 	   for (j=0; j<2; ++j) {
+-	       if (priv->yuv[i]) {
++	       if (priv->yuv[j][i]) {
+ 		   xa_surface_destroy(priv->yuv[j][i]);
+ 		   priv->yuv[j][i] = NULL;
+ 	       }

From 184c1b696e4d8576b65a6a103dc63e70bc248789 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 18:54:53 -0700
Subject: [PATCH 17/40] qt5-webengine: fix build on gcc12

---
 .../patches/qt5-webengine-gcc12.patch             | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
 create mode 100644 srcpkgs/qt5-webengine/patches/qt5-webengine-gcc12.patch

diff --git a/srcpkgs/qt5-webengine/patches/qt5-webengine-gcc12.patch b/srcpkgs/qt5-webengine/patches/qt5-webengine-gcc12.patch
new file mode 100644
index 000000000000..366d25e012e4
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/qt5-webengine-gcc12.patch
@@ -0,0 +1,15 @@
+Add missing include for std::begin and std::end in SkParseColor.cpp
+
+https://skia-review.googlesource.com/c/skia/+/533981
+
+--- a/src/3rdparty/chromium/third_party/skia/src/utils/SkParseColor.cpp
++++ b/src/3rdparty/chromium/third_party/skia/src/utils/SkParseColor.cpp
+@@ -8,6 +8,8 @@
+ 
+ #include "include/utils/SkParse.h"
+ 
++#include <iterator>
++
+ static constexpr const char* gColorNames[] = {
+     "aliceblue",
+     "antiquewhite",

From 3c43466d6fc356d1bb72e13e997d42da01b565a1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:54 -0700
Subject: [PATCH 18/40] cross-aarch64-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..cb7ae97e7efe 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 6d6c8da9d1b4fd95659beb8ae7749ee564ab66b3 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:54 -0700
Subject: [PATCH 19/40] cross-aarch64-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..4fa950f334d4 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 85abe2cc10e5077df71d33c1c68f3ba20d68ca6b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:54 -0700
Subject: [PATCH 20/40] cross-arm-linux-gnueabi: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..194c0ab774b7 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 08dcfa42309264bc9d36e19f14f60988a11607e3 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 21/40] cross-arm-linux-gnueabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..3f3242b85b07 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From fa6ad0513b20fe59db9334a3dc77cc994b9040fb Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 22/40] cross-arm-linux-musleabi: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..b0cdade60a6d 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 6cc0a286d04198e409f81e47c554319278814cb3 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 23/40] cross-arm-linux-musleabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..1924be24d483 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From e7c4354f7a4413b46385655bb9b0385ff95daf52 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 24/40] cross-armv7l-linux-gnueabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..a7997d6db937 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 2fa8dfbe65aa77def5f093b67ff42a6c13d2b728 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 25/40] cross-armv7l-linux-musleabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..aaa7040fbfef 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 77c1abada5b61994fcd487d7309523e209ebc9aa Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 26/40] cross-i686-pc-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..765cf675e95c 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From e2bfac96bdd73d6b7a0a988ca42f1895c004ccb1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 27/40] cross-mips-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-mips-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..26928ba9442d 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 3718fba7d48733cd309f07f12e69c423d24b999c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 28/40] cross-mips-linux-muslhf: update to gcc 12.1.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..fe74faf15d55 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From c2dfaab861e6d7754b02dc070022e03813aa37de Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 29/40] cross-mipsel-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..aa74d0b1acc7 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_musl_version=1.1.24
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 004ed4ecf3eb7c8c3676631b1c288d1a41c83556 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 30/40] cross-mipsel-linux-muslhf: update to gcc 12.1.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..83ab7f187085 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_musl_version=1.1.24
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 023e6f49b0cda8f29f1755f8601e3d61c38e73c4 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 31/40] cross-powerpc-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..3ab1a4ea40fa 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 880d819df813887ca150ae13fd09a292565b7891 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 32/40] cross-powerpc-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..af5586cacc77 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From e1fe59764e612899d6d7e8c53bd0a7a35d63c99f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 33/40] cross-powerpc64-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..2604b268046b 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 6bee83fcf3a68b37bbe5d1f1ab617fdfd68276cd Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 34/40] cross-powerpc64-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 1ebd0fb2048d..c7894721b900 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
@@ -19,12 +19,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 4feffcab8e83d5420e72bc534f1db75d4a009bb5 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 35/40] cross-powerpc64le-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 733f5851da5c..618235468970 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 2ed15e0e1b5f102a4be308b94c285e84d0f85b5f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 36/40] cross-powerpc64le-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index 76a70aa1d6db..7edf9605e60d 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
@@ -19,12 +19,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 144ddb263c46ca9c0e33049222d0883fc56449c3 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 37/40] cross-powerpcle-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 347b8fcf4f55..cc10b7cbd88b 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From f8896661c53c85dfb0eeb810e62fe1b1194acee6 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 38/40] cross-powerpcle-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index ec9324ddaa99..1d38a3fa3559 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 65a8d777fcddd4944472bc233e0b75fae9d8d8c2 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 39/40] cross-x86_64-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 0078fbe7224b..9f740b00a80c 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From b4ba4195b6f9c0e29bcb2c9009820a550ede1c6d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 40/40] cross-x86_64-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..19e13f3818e9 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
@@ -17,12 +17,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.1.0
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (32 preceding siblings ...)
  2022-08-19  5:58 ` oreo639
@ 2022-08-20 18:30 ` oreo639
  2022-08-21 22:46 ` oreo639
                   ` (230 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-08-20 18:30 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 3426 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.1.0
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.1.0

This PR depends on: https://github.com/void-linux/void-packages/pull/32330

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

Also, keep in mind that the libgo musl patch here will need to be updated once musl is updated:
https://github.com/void-linux/void-packages/pull/34902/files#diff-1f42a95b93c9550178ff1fbccbef2f47a72711df15c24c9472e2550076978129R163-R176

This is the updated patch for reference:
https://github.com/alpinelinux/aports/blob/8acb21b8ee881e7ab1c812d9a66a17d2501b8730/main/gcc/0049-libgo-adjust-name-of-union-in-sigevent-struct.patch

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [ ] llvm https://github.com/void-linux/void-packages/pull/38694
- [ ] m4 https://github.com/void-linux/void-packages/pull/33730
- [ ] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [ ] chroot-grep https://github.com/void-linux/void-packages/pull/38785

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 126801 bytes --]

From d87f75a8029f571d236fdd28318f47f0fd5dec1e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 01/36] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 15 +++--
 3 files changed, 28 insertions(+), 113 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..4bdaee582d71 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkg-config"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -44,6 +45,12 @@ do_configure() {
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	case "$XBPS_TARGET_MACHINE" in
+		*-musl)
+			conf+=" --disable-gprofng"
+			;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"

From f1924b03f847f5c7739371e9a76e4032f0f78521 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 02/36] gcc: update to 12.1.0.

---
 common/shlibs                                 |  10 +-
 srcpkgs/gcc/files/gccgo-musl.patch            |  74 +++--------
 srcpkgs/gcc/files/libgnarl-musl.patch         |  18 +--
 srcpkgs/gcc/files/libssp-musl.patch           |  10 +-
 ...c21f3f5726823e19728fdd1571a14aae0fb3.patch | 105 ++++++++++++++++
 ...08065bdd36fb1a9b6aad9666b1edb5e06474.patch | 115 ++++++++++++++++++
 ...65517a59565758107c5b1a51a5fa382f8d1a.patch |  32 +++++
 srcpkgs/gcc/patches/libffi_gnulinux.patch     |  11 --
 .../gcc/patches/libgcc-ibm128-no-tag.patch    |  10 +-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |   3 +-
 srcpkgs/gcc/template                          |  25 ++--
 11 files changed, 305 insertions(+), 108 deletions(-)
 create mode 100644 srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
 create mode 100644 srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
 create mode 100644 srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index 2e5258f3a243..4ed747b361a2 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.1.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.34 perl-5.34.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -849,8 +849,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.1.0_1
+libgnat-12.so libada-12.1.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1701,8 +1701,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.1.0_1
+libasan.so.8 libsanitizer-12.1.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..632ef951097b 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,17 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ a/libgo/go/runtime/os_linux.go
+@@ -363,9 +363,9 @@
+ 
+ 	var timerid int32
+ 	var sevp _sigevent
+-	sevp.sigev_notify = _SIGEV_THREAD_ID
++	sevp.sigev_notify = 4
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.sigev_notify_function))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch b/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
new file mode 100644
index 000000000000..00929202a503
--- /dev/null
+++ b/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
@@ -0,0 +1,105 @@
+From 3b21c21f3f5726823e19728fdd1571a14aae0fb3 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <siarheit@google.com>
+Date: Mon, 27 Jun 2022 13:27:24 +0100
+Subject: [PATCH] c++: avoid <memory> poisoning on musl [PR106102]
+
+On musl <pthread.h> uses calloc() (via <sched.h>). <memory> includes
+it indirectly and exposes use of poisoned calloc() when module code
+is built:
+
+    /build/build/./prev-gcc/xg++ ... ../../gcc-13-20220626/gcc/cp/mapper-resolver.cc
+        In file included from /<<NIX>>/musl-1.2.3-dev/include/pthread.h:30,
+                 from /build/build/prev-x86_64-unknown-linux-musl/libstdc++-v3/include/x86_64-unknown-linux-musl/bits/gthr-default.h:35,
+                 ....
+                 from /build/build/prev-x86_64-unknown-linux-musl/libstdc++-v3/include/memory:77,
+                 from ../../gcc-13-20220626/gcc/../libcody/cody.hh:24,
+                 from ../../gcc-13-20220626/gcc/cp/../../c++tools/resolver.h:25,
+                 from ../../gcc-13-20220626/gcc/cp/../../c++tools/resolver.cc:23,
+                 from ../../gcc-13-20220626/gcc/cp/mapper-resolver.cc:32:
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:84:7: error: attempt to use poisoned "calloc"
+       84 | void *calloc(size_t, size_t);
+          |       ^
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:124:36: error: attempt to use poisoned "calloc"
+      124 | #define CPU_ALLOC(n) ((cpu_set_t *)calloc(1,CPU_ALLOC_SIZE(n)))
+          |                                    ^
+
+gcc/cp/
+
+	PR c++/106102
+	* mapper-client.cc: Include <memory> via "system.h".
+	* mapper-resolver.cc: Ditto.
+	* module.cc: Ditto.
+
+libcc1/
+
+	PR c++/106102
+	* libcc1plugin.cc: Include <memory> via "system.h".
+	* libcp1plugin.cc: Ditto.
+---
+ gcc/cp/mapper-client.cc   | 1 +
+ gcc/cp/mapper-resolver.cc | 1 +
+ gcc/cp/module.cc          | 1 +
+ libcc1/libcc1plugin.cc    | 1 +
+ libcc1/libcp1plugin.cc    | 1 +
+ 5 files changed, 5 insertions(+)
+
+diff --git a/gcc/cp/mapper-client.cc b/gcc/cp/mapper-client.cc
+index 8603a886a099..fe9544b5ba43 100644
+--- a/gcc/cp/mapper-client.cc
++++ b/gcc/cp/mapper-client.cc
+@@ -27,6 +27,7 @@ along with GCC; see the file COPYING3.  If not see
+ #define INCLUDE_STRING
+ #define INCLUDE_VECTOR
+ #define INCLUDE_MAP
++#define INCLUDE_MEMORY
+ #include "system.h"
+ 
+ #include "line-map.h"
+diff --git a/gcc/cp/mapper-resolver.cc b/gcc/cp/mapper-resolver.cc
+index e3d29fb5ada1..e70d1b4ae2ca 100644
+--- a/gcc/cp/mapper-resolver.cc
++++ b/gcc/cp/mapper-resolver.cc
+@@ -25,6 +25,7 @@ along with GCC; see the file COPYING3.  If not see
+ #define INCLUDE_VECTOR
+ #define INCLUDE_ALGORITHM
+ #define INCLUDE_MAP
++#define INCLUDE_MEMORY
+ #include "system.h"
+ 
+ // We don't want or need to be aware of networking
+diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc
+index 753963a4b246..8bb22c2b305a 100644
+--- a/gcc/cp/module.cc
++++ b/gcc/cp/module.cc
+@@ -206,6 +206,7 @@ Classes used:
+ 
+ #define _DEFAULT_SOURCE 1 /* To get TZ field of struct tm, if available.  */
+ #include "config.h"
++#define INCLUDE_MEMORY
+ #define INCLUDE_STRING
+ #define INCLUDE_VECTOR
+ #include "system.h"
+diff --git a/libcc1/libcc1plugin.cc b/libcc1/libcc1plugin.cc
+index 12ab5a57c8dd..bdd0bdabe77f 100644
+--- a/libcc1/libcc1plugin.cc
++++ b/libcc1/libcc1plugin.cc
+@@ -31,6 +31,7 @@
+ #undef PACKAGE_TARNAME
+ #undef PACKAGE_VERSION
+ 
++#define INCLUDE_MEMORY
+ #include "gcc-plugin.h"
+ #include "system.h"
+ #include "coretypes.h"
+diff --git a/libcc1/libcp1plugin.cc b/libcc1/libcp1plugin.cc
+index 83dab7f58b11..e2d5039a0a1f 100644
+--- a/libcc1/libcp1plugin.cc
++++ b/libcc1/libcp1plugin.cc
+@@ -32,6 +32,7 @@
+ #undef PACKAGE_TARNAME
+ #undef PACKAGE_VERSION
+ 
++#define INCLUDE_MEMORY
+ #include "gcc-plugin.h"
+ #include "system.h"
+ #include "coretypes.h"
diff --git a/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch b/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
new file mode 100644
index 000000000000..89bd053d6d04
--- /dev/null
+++ b/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
@@ -0,0 +1,115 @@
+From 49d508065bdd36fb1a9b6aad9666b1edb5e06474 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <siarheit@google.com>
+Date: Mon, 27 Jun 2022 23:42:44 +0100
+Subject: [PATCH] jit: avoid calloc() poisoning on musl [PR106102]
+
+On musl <pthread.h> uses calloc() (via <sched.h>). jit/ includes
+it directly and exposes use of poisoned calloc():
+
+    /build/build/./prev-gcc/xg++ ... ../../gcc-13-20220626/gcc/jit/jit-playback.cc
+    make[3]: *** [Makefile:1143: jit/libgccjit.o] Error 1
+    make[3]: *** Waiting for unfinished jobs....
+    In file included from /<<NIX>>/musl-1.2.3-dev/include/pthread.h:30,
+                     from ../../gcc-13-20220626/gcc/jit/jit-playback.cc:44:
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:84:7: error: attempt to use poisoned "calloc"
+       84 | void *calloc(size_t, size_t);
+          |       ^
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:124:36: error: attempt to use poisoned "calloc"
+      124 | #define CPU_ALLOC(n) ((cpu_set_t *)calloc(1,CPU_ALLOC_SIZE(n)))
+          |                                    ^
+
+The change moves <pthread.h> inclusion to "system.h" under new
+INCLUDE_PTHREAD_H guard and uses this mechanism in libgccjit.
+
+gcc/
+
+	PR c++/106102
+	* system.h: Introduce INCLUDE_PTHREAD_H macros to include <pthread.h>.
+
+gcc/jit/
+
+	PR c++/106102
+	* jit-playback.cc: Include <pthread.h> via "system.h" to avoid calloc()
+	poisoning.
+	* jit-recording.cc: Ditto.
+	* libgccjit.cc: Ditto.
+---
+ gcc/jit/jit-playback.cc  | 3 +--
+ gcc/jit/jit-recording.cc | 2 +-
+ gcc/jit/libgccjit.cc     | 2 +-
+ gcc/system.h             | 4 ++++
+ 4 files changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/gcc/jit/jit-playback.cc b/gcc/jit/jit-playback.cc
+index 6be6bdf8dea5..79714132b91a 100644
+--- a/gcc/jit/jit-playback.cc
++++ b/gcc/jit/jit-playback.cc
+@@ -19,6 +19,7 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "target.h"
+@@ -41,8 +42,6 @@ along with GCC; see the file COPYING3.  If not see
+ #include "diagnostic.h"
+ #include "stmt.h"
+ 
+-#include <pthread.h>
+-
+ #include "jit-playback.h"
+ #include "jit-result.h"
+ #include "jit-builtins.h"
+diff --git a/gcc/jit/jit-recording.cc b/gcc/jit/jit-recording.cc
+index 697dee66e733..f78daed2d71a 100644
+--- a/gcc/jit/jit-recording.cc
++++ b/gcc/jit/jit-recording.cc
+@@ -19,13 +19,13 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "tm.h"
+ #include "pretty-print.h"
+ #include "toplev.h"
+ 
+-#include <pthread.h>
+ 
+ #include "jit-builtins.h"
+ #include "jit-recording.h"
+diff --git a/gcc/jit/libgccjit.cc b/gcc/jit/libgccjit.cc
+index 0e76097b4bac..ca862662777e 100644
+--- a/gcc/jit/libgccjit.cc
++++ b/gcc/jit/libgccjit.cc
+@@ -19,12 +19,12 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "timevar.h"
+ #include "typed-splay-tree.h"
+ #include "cppbuiltin.h"
+-#include <pthread.h>
+ 
+ #include "libgccjit.h"
+ #include "jit-recording.h"
+diff --git a/gcc/system.h b/gcc/system.h
+index 67158b70c789..f8d42ff68150 100644
+--- a/gcc/system.h
++++ b/gcc/system.h
+@@ -753,6 +753,10 @@ extern int vsnprintf (char *, size_t, const char *, va_list);
+ #endif
+ #endif
+ 
++#ifdef INCLUDE_PTHREAD_H
++#include <pthread.h>
++#endif
++
+ #ifdef INCLUDE_ISL
+ #ifdef HAVE_isl
+ #include <isl/options.h>
diff --git a/srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch b/srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch
new file mode 100644
index 000000000000..044a4fc29514
--- /dev/null
+++ b/srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch
@@ -0,0 +1,32 @@
+From f35d65517a59565758107c5b1a51a5fa382f8d1a Mon Sep 17 00:00:00 2001
+From: Ian Lance Taylor <iant@golang.org>
+Date: Tue, 12 Jul 2022 19:42:43 -0700
+Subject: [PATCH] libgo: don't include <linux/fs.h> when building
+ gen-sysinfo.go
+
+Removing this doesn't change anything at least with glibc 2.33.
+The include was added in https://go.dev/cl/6100049 but it's not
+clear why.
+
+Fixes PR go/106266
+
+Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/417294
+---
+ gcc/go/gofrontend/MERGE | 2 +-
+ libgo/sysinfo.c         | 3 ---
+ 2 files changed, 1 insertion(+), 4 deletions(-)
+
+diff --git a/libgo/sysinfo.c b/libgo/sysinfo.c
+index a4259c02ded4..fc0210992faa 100644
+--- a/libgo/sysinfo.c
++++ b/libgo/sysinfo.c
+@@ -158,9 +158,6 @@
+ #if defined(HAVE_LINUX_ETHER_H)
+ #include <linux/ether.h>
+ #endif
+-#if defined(HAVE_LINUX_FS_H)
+-#include <linux/fs.h>
+-#endif
+ #if defined(HAVE_LINUX_REBOOT_H)
+ #include <linux/reboot.h>
+ #endif
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..78a2ce35875d 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,9 +3,10 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
  
  #  ifndef _ABIN32
+
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..32ee79e32f0d 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,15 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
+version=12.1.0
+revision=1
 _patchver="${version%pre*}"
 _minorver="${_patchver%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 wrksrc=gcc-${version/pre/_pre}
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +19,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -396,7 +393,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}

From 3367c06bf9df2be343314db65d1a9fb2d81ee46f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 03/36] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      |  6 ++--
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..08e35d466a44 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From 9fd63820eea1f2471a995894405a02b387013e5a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 04/36] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 1a4e1ca3d594..b04268908c2e 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="q66 <daniel@octaforge.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From 04674f0c6125c4b62b84c79023b32bc6839282db Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 05/36] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 3 files changed, 55 insertions(+), 353 deletions(-)
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index 4ed747b361a2..46e4674c7fe0 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From 78c7391888b6c275766f90a1e0cf10ebcedbfe94 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 16:22:03 -0700
Subject: [PATCH 06/36] llvm12: fix build for glibc 2.36

---
 .../compiler-rt-sanitizer-glibc-2.36.patch    | 59 +++++++++++++++++++
 .../compiler-rt-sanitizer-glibc-2.36.patch    | 59 +++++++++++++++++++
 2 files changed, 118 insertions(+)
 create mode 100644 srcpkgs/llvm12/compiler-rt-sanitizer-glibc-2.36.patch
 create mode 100644 srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch

diff --git a/srcpkgs/llvm12/compiler-rt-sanitizer-glibc-2.36.patch b/srcpkgs/llvm12/compiler-rt-sanitizer-glibc-2.36.patch
new file mode 100644
index 000000000000..e5f24dab8935
--- /dev/null
+++ b/srcpkgs/llvm12/compiler-rt-sanitizer-glibc-2.36.patch
@@ -0,0 +1,59 @@
+From 9cf13067cb5088626ba7ee1ec4c42ec59c7995a0 Mon Sep 17 00:00:00 2001
+From: Fangrui Song <i@maskray.me>
+Date: Mon, 11 Jul 2022 12:53:34 -0700
+Subject: [PATCH] [sanitizer] Remove #include <linux/fs.h> to resolve
+ fsconfig_command/mount_attr conflict with glibc 2.36
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+It is generally not a good idea to mix usage of glibc headers and Linux UAPI
+headers (https://sourceware.org/glibc/wiki/Synchronizing_Headers). In glibc
+since 7eae6a91e9b1670330c9f15730082c91c0b1d570 (milestone: 2.36), sys/mount.h
+defines `fsconfig_command` which conflicts with linux/mount.h:
+
+    .../usr/include/linux/mount.h:95:6: error: redeclaration of ‘enum fsconfig_command’
+
+Remove #include <linux/fs.h> which pulls in linux/mount.h. Expand its 4 macros manually.
+Android sys/mount.h doesn't define BLKBSZGET and it still needs linux/fs.h.
+In the long term we should move Linux specific definitions to sanitizer_platform_limits_linux.cpp
+but this commit is easy to cherry pick into older compiler-rt releases.
+
+Fix https://github.com/llvm/llvm-project/issues/56421
+
+Reviewed By: #sanitizers, vitalybuka, zatrazz
+
+Differential Revision: https://reviews.llvm.org/D129471
+---
+ .../sanitizer_platform_limits_posix.cpp                | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+index 4bd425435d56d..3a94b260686f1 100644
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -73,7 +73,9 @@
+ #include <sys/vt.h>
+ #include <linux/cdrom.h>
+ #include <linux/fd.h>
++#if SANITIZER_ANDROID
+ #include <linux/fs.h>
++#endif
+ #include <linux/hdreg.h>
+ #include <linux/input.h>
+ #include <linux/ioctl.h>
+@@ -876,10 +878,10 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
+   unsigned IOCTL_EVIOCGPROP = IOCTL_NOT_PRESENT;
+   unsigned IOCTL_EVIOCSKEYCODE_V2 = IOCTL_NOT_PRESENT;
+ #endif
+-  unsigned IOCTL_FS_IOC_GETFLAGS = FS_IOC_GETFLAGS;
+-  unsigned IOCTL_FS_IOC_GETVERSION = FS_IOC_GETVERSION;
+-  unsigned IOCTL_FS_IOC_SETFLAGS = FS_IOC_SETFLAGS;
+-  unsigned IOCTL_FS_IOC_SETVERSION = FS_IOC_SETVERSION;
++  unsigned IOCTL_FS_IOC_GETFLAGS = _IOR('f', 1, long);
++  unsigned IOCTL_FS_IOC_GETVERSION = _IOR('v', 1, long);
++  unsigned IOCTL_FS_IOC_SETFLAGS = _IOW('f', 2, long);
++  unsigned IOCTL_FS_IOC_SETVERSION = _IOW('v', 2, long);
+   unsigned IOCTL_GIO_CMAP = GIO_CMAP;
+   unsigned IOCTL_GIO_FONT = GIO_FONT;
+   unsigned IOCTL_GIO_UNIMAP = GIO_UNIMAP;
diff --git a/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch b/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch
new file mode 100644
index 000000000000..e5f24dab8935
--- /dev/null
+++ b/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch
@@ -0,0 +1,59 @@
+From 9cf13067cb5088626ba7ee1ec4c42ec59c7995a0 Mon Sep 17 00:00:00 2001
+From: Fangrui Song <i@maskray.me>
+Date: Mon, 11 Jul 2022 12:53:34 -0700
+Subject: [PATCH] [sanitizer] Remove #include <linux/fs.h> to resolve
+ fsconfig_command/mount_attr conflict with glibc 2.36
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+It is generally not a good idea to mix usage of glibc headers and Linux UAPI
+headers (https://sourceware.org/glibc/wiki/Synchronizing_Headers). In glibc
+since 7eae6a91e9b1670330c9f15730082c91c0b1d570 (milestone: 2.36), sys/mount.h
+defines `fsconfig_command` which conflicts with linux/mount.h:
+
+    .../usr/include/linux/mount.h:95:6: error: redeclaration of ‘enum fsconfig_command’
+
+Remove #include <linux/fs.h> which pulls in linux/mount.h. Expand its 4 macros manually.
+Android sys/mount.h doesn't define BLKBSZGET and it still needs linux/fs.h.
+In the long term we should move Linux specific definitions to sanitizer_platform_limits_linux.cpp
+but this commit is easy to cherry pick into older compiler-rt releases.
+
+Fix https://github.com/llvm/llvm-project/issues/56421
+
+Reviewed By: #sanitizers, vitalybuka, zatrazz
+
+Differential Revision: https://reviews.llvm.org/D129471
+---
+ .../sanitizer_platform_limits_posix.cpp                | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+index 4bd425435d56d..3a94b260686f1 100644
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -73,7 +73,9 @@
+ #include <sys/vt.h>
+ #include <linux/cdrom.h>
+ #include <linux/fd.h>
++#if SANITIZER_ANDROID
+ #include <linux/fs.h>
++#endif
+ #include <linux/hdreg.h>
+ #include <linux/input.h>
+ #include <linux/ioctl.h>
+@@ -876,10 +878,10 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
+   unsigned IOCTL_EVIOCGPROP = IOCTL_NOT_PRESENT;
+   unsigned IOCTL_EVIOCSKEYCODE_V2 = IOCTL_NOT_PRESENT;
+ #endif
+-  unsigned IOCTL_FS_IOC_GETFLAGS = FS_IOC_GETFLAGS;
+-  unsigned IOCTL_FS_IOC_GETVERSION = FS_IOC_GETVERSION;
+-  unsigned IOCTL_FS_IOC_SETFLAGS = FS_IOC_SETFLAGS;
+-  unsigned IOCTL_FS_IOC_SETVERSION = FS_IOC_SETVERSION;
++  unsigned IOCTL_FS_IOC_GETFLAGS = _IOR('f', 1, long);
++  unsigned IOCTL_FS_IOC_GETVERSION = _IOR('v', 1, long);
++  unsigned IOCTL_FS_IOC_SETFLAGS = _IOW('f', 2, long);
++  unsigned IOCTL_FS_IOC_SETVERSION = _IOW('v', 2, long);
+   unsigned IOCTL_GIO_CMAP = GIO_CMAP;
+   unsigned IOCTL_GIO_FONT = GIO_FONT;
+   unsigned IOCTL_GIO_UNIMAP = GIO_UNIMAP;

From dbf08991952d3da0ddfeb01fce409e5da587aff5 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 17:21:40 -0700
Subject: [PATCH 07/36] m4: update to 1.4.19.

---
 srcpkgs/m4/patches/fix-glibc-2.27.patch | 167 ------------------------
 srcpkgs/m4/template                     |  12 +-
 2 files changed, 6 insertions(+), 173 deletions(-)
 delete mode 100644 srcpkgs/m4/patches/fix-glibc-2.27.patch

diff --git a/srcpkgs/m4/patches/fix-glibc-2.27.patch b/srcpkgs/m4/patches/fix-glibc-2.27.patch
deleted file mode 100644
index 59d33cff164d..000000000000
--- a/srcpkgs/m4/patches/fix-glibc-2.27.patch
+++ /dev/null
@@ -1,167 +0,0 @@
-From 4af4a4a71827c0bc5e0ec67af23edef4f15cee8e Mon Sep 17 00:00:00 2001
-From: Paul Eggert <eggert@cs.ucla.edu>
-Date: Mon, 5 Mar 2018 10:56:29 -0800
-Subject: [PATCH] fflush: adjust to glibc 2.28 libio.h removal
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Problem reported by Daniel P. Berrangé in:
-https://lists.gnu.org/r/bug-gnulib/2018-03/msg00000.html
-* lib/fbufmode.c (fbufmode):
-* lib/fflush.c (clear_ungetc_buffer_preserving_position)
-(disable_seek_optimization, rpl_fflush):
-* lib/fpending.c (__fpending):
-* lib/fpurge.c (fpurge):
-* lib/freadable.c (freadable):
-* lib/freadahead.c (freadahead):
-* lib/freading.c (freading):
-* lib/freadptr.c (freadptr):
-* lib/freadseek.c (freadptrinc):
-* lib/fseeko.c (fseeko):
-* lib/fseterr.c (fseterr):
-* lib/fwritable.c (fwritable):
-* lib/fwriting.c (fwriting):
-Check _IO_EOF_SEEN instead of _IO_ftrylockfile.
-* lib/stdio-impl.h (_IO_IN_BACKUP) [_IO_EOF_SEEN]:
-Define if not already defined.
-
-[yann.morin.1998@free.fr: partially backport from upstream gnulib]
-Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
-
----
- lib/fflush.c     |  6 +++---
- lib/fpending.c   |  2 +-
- lib/fpurge.c     |  2 +-
- lib/freadahead.c |  2 +-
- lib/freading.c   |  2 +-
- lib/fseeko.c     |  4 ++--
- lib/stdio-impl.h |  6 ++++++
- 7 files changed, 15 insertions(+), 9 deletions(-)
-
-diff --git a/lib/fflush.c b/build-aux/gnulib/lib/fflush.c
-index 983ade0ff..a6edfa105 100644
---- a/lib/fflush.c
-+++ b/lib/fflush.c
-@@ -33,7 +33,7 @@
- #undef fflush
- 
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- 
- /* Clear the stream's ungetc buffer, preserving the value of ftello (fp).  */
- static void
-@@ -72,7 +72,7 @@ clear_ungetc_buffer (FILE *fp)
- 
- #endif
- 
--#if ! (defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
-+#if ! (defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
- 
- # if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT
- /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
-@@ -148,7 +148,7 @@ rpl_fflush (FILE *stream)
-   if (stream == NULL || ! freading (stream))
-     return fflush (stream);
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- 
-   clear_ungetc_buffer_preserving_position (stream);
- 
-diff --git a/lib/fpending.c b/build-aux/gnulib/lib/fpending.c
-index c84e3a5b4..789f50e4e 100644
---- a/lib/fpending.c
-+++ b/lib/fpending.c
-@@ -32,7 +32,7 @@ __fpending (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   return fp->_IO_write_ptr - fp->_IO_write_base;
- #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
-   /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
-diff --git a/lib/fpurge.c b/build-aux/gnulib/lib/fpurge.c
-index b1d417c7a..3aedcc373 100644
---- a/lib/fpurge.c
-+++ b/lib/fpurge.c
-@@ -62,7 +62,7 @@ fpurge (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   fp->_IO_read_end = fp->_IO_read_ptr;
-   fp->_IO_write_ptr = fp->_IO_write_base;
-   /* Avoid memory leak when there is an active ungetc buffer.  */
-diff --git a/lib/freadahead.c b/build-aux/gnulib/lib/freadahead.c
-index c2ecb5b28..23ec76ee5 100644
---- a/lib/freadahead.c
-+++ b/lib/freadahead.c
-@@ -30,7 +30,7 @@ extern size_t __sreadahead (FILE *);
- size_t
- freadahead (FILE *fp)
- {
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   if (fp->_IO_write_ptr > fp->_IO_write_base)
-     return 0;
-   return (fp->_IO_read_end - fp->_IO_read_ptr)
-diff --git a/lib/freading.c b/build-aux/gnulib/lib/freading.c
-index 73c28acdd..c24d0c88a 100644
---- a/lib/freading.c
-+++ b/lib/freading.c
-@@ -31,7 +31,7 @@ freading (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   return ((fp->_flags & _IO_NO_WRITES) != 0
-           || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0
-               && fp->_IO_read_base != NULL));
-diff --git a/lib/fseeko.c b/build-aux/gnulib/lib/fseeko.c
-index 0101ab55f..193f4e8ce 100644
---- a/lib/fseeko.c
-+++ b/lib/fseeko.c
-@@ -47,7 +47,7 @@ fseeko (FILE *fp, off_t offset, int whence)
- #endif
- 
-   /* These tests are based on fpurge.c.  */
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   if (fp->_IO_read_end == fp->_IO_read_ptr
-       && fp->_IO_write_ptr == fp->_IO_write_base
-       && fp->_IO_save_base == NULL)
-@@ -123,7 +123,7 @@ fseeko (FILE *fp, off_t offset, int whence)
-           return -1;
-         }
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-       fp->_flags &= ~_IO_EOF_SEEN;
-       fp->_offset = pos;
- #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
-diff --git a/lib/stdio-impl.h b/build-aux/gnulib/lib/stdio-impl.h
-index 78d896e9f..05c5752a2 100644
---- a/lib/stdio-impl.h
-+++ b/lib/stdio-impl.h
-@@ -18,6 +18,12 @@
-    the same implementation of stdio extension API, except that some fields
-    have different naming conventions, or their access requires some casts.  */
- 
-+/* Glibc 2.28 made _IO_IN_BACKUP private.  For now, work around this
-+   problem by defining it ourselves.  FIXME: Do not rely on glibc
-+   internals.  */
-+#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN
-+# define _IO_IN_BACKUP 0x100
-+#endif
- 
- /* BSD stdio derived implementations.  */
- 
--- 
-2.14.1
-
-
diff --git a/srcpkgs/m4/template b/srcpkgs/m4/template
index 78f3dae6184a..762593d883bd 100644
--- a/srcpkgs/m4/template
+++ b/srcpkgs/m4/template
@@ -1,17 +1,17 @@
 # Template file for 'm4'
 pkgname=m4
-version=1.4.18
-revision=2
+version=1.4.19
+revision=1
 bootstrap=yes
-replaces="chroot-m4>=0"
 build_style=gnu-configure
 configure_args="--enable-changeword --enable-threads"
 short_desc="GNU version of UNIX m4 macro language processor"
-homepage="https://www.gnu.org/software/m4/"
-license="GPL-3.0-or-later"
 maintainer="Enno Boland <gottox@voidlinux.org>"
+license="GPL-3.0-or-later"
+homepage="https://www.gnu.org/software/m4/"
 distfiles="${GNU_SITE}/${pkgname}/${pkgname}-${version}.tar.xz"
-checksum=f2c1e86ca0a404ff281631bdc8377638992744b175afb806e25871a24a934e07
+checksum=63aede5c6d33b6d9b13511cd0be2cac046f2e70fd0a07aa9573a04a82783af96
+replaces="chroot-m4>=0"
 
 if [ "$XBPS_TARGET_LIBC" = musl ]; then
 	export ac_cv_lib_error_at_line=no

From 42a4f081cac6a2ff36ff3f5e03c61d9d6e764f1f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 22:57:59 -0700
Subject: [PATCH 08/36] btrfs-progs: update to 5.19.

---
 srcpkgs/btrfs-progs/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/btrfs-progs/template b/srcpkgs/btrfs-progs/template
index f6c53d8587e1..292d5110106b 100644
--- a/srcpkgs/btrfs-progs/template
+++ b/srcpkgs/btrfs-progs/template
@@ -1,6 +1,6 @@
 # Template file for 'btrfs-progs'
 pkgname=btrfs-progs
-version=5.18.1
+version=5.19
 revision=1
 wrksrc="${pkgname}-v${version}"
 build_style=gnu-configure
@@ -16,7 +16,7 @@ license="GPL-2.0-only, LGPL-2.1-or-later"
 homepage="https://btrfs.wiki.kernel.org/index.php/Main_Page"
 changelog="https://raw.githubusercontent.com/kdave/btrfs-progs/master/CHANGES"
 distfiles="${KERNEL_SITE}/kernel/people/kdave/${pkgname}/${pkgname}-v${version}.tar.xz"
-checksum=6e98a75ccff52e9354daa1ad284c614c490f844273a2fa524cbac9eb841c7255
+checksum=1fbcf06e4b2f80e7a127fd687ed4625a5b74fa674fe212c836ff70e0edfcccf9
 # Most of the tests depend on `mount` and `fallocate` commands, which are not
 # presented in chroot-util-linux
 make_check=no

From d52d723e76f6b43488b1d40c21f58bf16c4a08ce Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 19 Aug 2022 11:48:54 -0700
Subject: [PATCH 09/36] chroot-grep: update to 3.7

---
 srcpkgs/chroot-grep/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/chroot-grep/template b/srcpkgs/chroot-grep/template
index 022b01d20de2..828c35fe1992 100644
--- a/srcpkgs/chroot-grep/template
+++ b/srcpkgs/chroot-grep/template
@@ -1,17 +1,17 @@
 # Template file for 'chroot-grep'
 pkgname=chroot-grep
-version=3.3
+version=3.7
 revision=1
 wrksrc="grep-${version}"
 bootstrap=yes
 build_style=gnu-configure
 configure_args="--disable-perl-regexp --disable-nls ac_cv_path_GREP=grep"
-short_desc="The GNU grep utility - for use with xbps-src"
+short_desc="GNU grep utility - for use with xbps-src"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/grep/"
 distfiles="${GNU_SITE}/grep/grep-${version}.tar.xz"
-checksum=b960541c499619efd6afe1fa795402e4733c8e11ebf9fafccc0bb4bccdc5b514
+checksum=5c10da312460aec721984d5d83246d24520ec438dd48d7ab5a05dbc0d6d6823c
 conflicts="grep>=0"
 provides="grep-${version}_${revision}"
 

From c359a639aea137b2946c7fe8653e5dc0baa79145 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 14 Aug 2022 19:29:36 -0700
Subject: [PATCH 10/36] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove nopie=yes. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh             |  1 +
 common/environment/build-style/void-cross.sh | 36 +++++++++++++++++++-
 2 files changed, 36 insertions(+), 1 deletion(-)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..c24013755704 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -132,6 +132,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
diff --git a/common/environment/build-style/void-cross.sh b/common/environment/build-style/void-cross.sh
index 62ce9eaa2e4a..4b77c90efc8b 100644
--- a/common/environment/build-style/void-cross.sh
+++ b/common/environment/build-style/void-cross.sh
@@ -1,6 +1,40 @@
 lib32disabled=yes
-nopie=yes
 create_wrksrc=yes
 
 nostrip_files+=" libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a libgmem.a"
+nopie_files+=" /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/go1
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/lto-wrapper
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/plugin/gengtype
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/cc1objplus
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/cc1obj
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/collect2
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/lto1
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/f951
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/cc1
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/gnat1
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/cc1plus
+ /usr/bin/${sourcepkg/cross-}-gcov-dump
+ /usr/bin/${sourcepkg/cross-}-gnatlink
+ /usr/bin/${sourcepkg/cross-}-gnatbind
+ /usr/bin/${sourcepkg/cross-}-gcc
+ /usr/bin/${sourcepkg/cross-}-cpp
+ /usr/bin/${sourcepkg/cross-}-gnatchop
+ /usr/bin/${sourcepkg/cross-}-gfortran
+ /usr/bin/${sourcepkg/cross-}-gccgo
+ /usr/bin/${sourcepkg/cross-}-c++
+ /usr/bin/${sourcepkg/cross-}-lto-dump
+ /usr/bin/${sourcepkg/cross-}-gnatname
+ /usr/bin/${sourcepkg/cross-}-gnatprep
+ /usr/bin/${sourcepkg/cross-}-g++
+ /usr/bin/${sourcepkg/cross-}-gnat
+ /usr/bin/${sourcepkg/cross-}-gcc-ranlib
+ /usr/bin/${sourcepkg/cross-}-gnatkr
+ /usr/bin/${sourcepkg/cross-}-gnatmake
+ /usr/bin/${sourcepkg/cross-}-gcc-${_gcc_version}
+ /usr/bin/${sourcepkg/cross-}-gcc-ar
+ /usr/bin/${sourcepkg/cross-}-gnatclean
+ /usr/bin/${sourcepkg/cross-}-gcov
+ /usr/bin/${sourcepkg/cross-}-gnatls
+ /usr/bin/${sourcepkg/cross-}-gcc-nm
+ /usr/bin/${sourcepkg/cross-}-gcov-tool"

From 7c61c8609e412f3140e15534ac4c7f51861ffb90 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:08:52 -0700
Subject: [PATCH 11/36] openssh: suppress werror on gcc12

---
 srcpkgs/openssh/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/openssh/template b/srcpkgs/openssh/template
index 02a2dec35f42..6e8e343a9dca 100644
--- a/srcpkgs/openssh/template
+++ b/srcpkgs/openssh/template
@@ -40,7 +40,7 @@ if [ "$build_option_ldns" -a -z "$build_option_ssl" ]; then
 	broken="option 'ldns' requires option 'ssl'"
 fi
 
-CFLAGS="-Wno-format-truncation -Wno-stringop-truncation"
+CFLAGS="-Wno-format-truncation -Wno-stringop-truncation -Wno-error=maybe-uninitialized"
 
 case $XBPS_TARGET_MACHINE in
 	i686-musl)

From 0869d7f599dff88b24d886e056c3fc7ab0d14289 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:09:31 -0700
Subject: [PATCH 12/36] linux5.18: update dotconfigs for gcc12

---
 srcpkgs/linux5.18/files/x86_64-dotconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/linux5.18/files/x86_64-dotconfig b/srcpkgs/linux5.18/files/x86_64-dotconfig
index 4e73a3195d40..ea6204868e23 100644
--- a/srcpkgs/linux5.18/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.18/files/x86_64-dotconfig
@@ -512,6 +512,7 @@ CONFIG_RETHUNK=y
 CONFIG_CPU_UNRET_ENTRY=y
 CONFIG_CPU_IBPB_ENTRY=y
 CONFIG_CPU_IBRS_ENTRY=y
+CONFIG_SLS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10060,8 +10061,11 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
 # Memory initialization
 #
 CONFIG_INIT_STACK_NONE=y
+# CONFIG_INIT_STACK_ALL_PATTERN is not set
+# CONFIG_INIT_STACK_ALL_ZERO is not set
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
+# CONFIG_ZERO_CALL_USED_REGS is not set
 # end of Memory initialization
 # end of Kernel hardening options
 # end of Security options
@@ -10538,6 +10542,7 @@ CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
 # CONFIG_UBSAN is not set
 CONFIG_HAVE_ARCH_KCSAN=y
+# CONFIG_KCSAN is not set
 # end of Generic Kernel Debugging Instruments
 
 #

From 8021550a362e29e3295f1204d88d9b7742b079e5 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 18:00:42 -0700
Subject: [PATCH 13/36] xf86-video-vmware: fix build on gcc12

---
 ...183b3395333d5d4c73e25c2d011748f15eda.patch | 30 +++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch

diff --git a/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch b/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch
new file mode 100644
index 000000000000..ff839f16e628
--- /dev/null
+++ b/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch
@@ -0,0 +1,30 @@
+From 77b8183b3395333d5d4c73e25c2d011748f15eda Mon Sep 17 00:00:00 2001
+From: Rudi Heitbaum <rudi@heitbaum.com>
+Date: Sun, 8 May 2022 03:00:10 +0000
+Subject: [PATCH] vmwgfx: fix missing array notation
+
+ Fixes error identified by gcc-12.1.0 compiler
+
+make
+  CC       libvmwgfx_la-vmwgfx_tex_video.lo
+vmwgfx_tex_video.c: In function 'stop_video':
+vmwgfx_tex_video.c:240:20: error: the comparison will always evaluate as 'true' for the address of 'yuv' will never be NULL [-Werror=address]
+  240 |                if (priv->yuv[i]) {
+      |                    ^~~~
+---
+ vmwgfx/vmwgfx_tex_video.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/vmwgfx/vmwgfx_tex_video.c b/vmwgfx/vmwgfx_tex_video.c
+index acc2b56..480a5f1 100644
+--- a/vmwgfx/vmwgfx_tex_video.c
++++ b/vmwgfx/vmwgfx_tex_video.c
+@@ -237,7 +237,7 @@ stop_video(ScrnInfoPtr pScrn, pointer data, Bool shutdown)
+ 
+        for (i=0; i<3; ++i) {
+ 	   for (j=0; j<2; ++j) {
+-	       if (priv->yuv[i]) {
++	       if (priv->yuv[j][i]) {
+ 		   xa_surface_destroy(priv->yuv[j][i]);
+ 		   priv->yuv[j][i] = NULL;
+ 	       }

From 39b74829003277845ec54f52192f3fbf25c68635 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:54 -0700
Subject: [PATCH 14/36] cross-aarch64-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..cb7ae97e7efe 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 7c6527c255c77a081145f990c46830b616a04d98 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:54 -0700
Subject: [PATCH 15/36] cross-aarch64-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..4fa950f334d4 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From d4d96f40d3abe5aaa41190da5cb9c24ef6189a66 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:54 -0700
Subject: [PATCH 16/36] cross-arm-linux-gnueabi: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..194c0ab774b7 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From ad7152476e5b1fe1c3c59b0665f493905683843b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 17/36] cross-arm-linux-gnueabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..3f3242b85b07 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From a8eaf49fcecdc9417694269d399436bb29d343a5 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 18/36] cross-arm-linux-musleabi: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..b0cdade60a6d 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From eb5f71ac3f408a7c9969bc9ce2af8bad432a508f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 19/36] cross-arm-linux-musleabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..1924be24d483 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 1662c32b19eb93c092dc7ca64c0d4dee35f077c7 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 20/36] cross-armv7l-linux-gnueabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..a7997d6db937 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 01d1dd6cc8adaa0aaa1c957fc7711f59923997d3 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 21/36] cross-armv7l-linux-musleabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..aaa7040fbfef 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From c9bab3d8d0de97e215ec3a840cbf31213dc2ce4c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 22/36] cross-i686-pc-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..765cf675e95c 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 065aee59a36331d171b7a028a9d5e88720f0e9cf Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 23/36] cross-mips-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-mips-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..26928ba9442d 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 83b190d6fc9d0688bbb07fbc11497a8360aab533 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 24/36] cross-mips-linux-muslhf: update to gcc 12.1.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..fe74faf15d55 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 051b3bed9c2e10572c429bb4870bdfe9772c342f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 25/36] cross-mipsel-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..aa74d0b1acc7 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_musl_version=1.1.24
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 794603122f2aa220d9af376202ed32b25dd562a3 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 26/36] cross-mipsel-linux-muslhf: update to gcc 12.1.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..83ab7f187085 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_musl_version=1.1.24
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 984478582fdfe9c4ff316ad3d21c3fa8cf3b8f99 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 27/36] cross-powerpc-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..3ab1a4ea40fa 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 7db30e3b6c8b9a695b04c2ac11e8c6ed4498392b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 28/36] cross-powerpc-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..af5586cacc77 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 6bd715d467b3a9f9700f152a3566726fb02acedd Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 29/36] cross-powerpc64-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..2604b268046b 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From f5220eb972c6708e7e7a32b206bc2db208e0ff7f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 30/36] cross-powerpc64-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 1ebd0fb2048d..c7894721b900 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
@@ -19,12 +19,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 77702dc40d801ce094149fbcabb3f1102d301589 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 31/36] cross-powerpc64le-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 733f5851da5c..618235468970 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From e6286b3f188f8ade478c8aa4067797a047e4d1a5 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 32/36] cross-powerpc64le-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index 76a70aa1d6db..7edf9605e60d 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
@@ -19,12 +19,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 5923ed9212cc17eebf38b1ad192d598421cfa7c5 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 33/36] cross-powerpcle-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 347b8fcf4f55..cc10b7cbd88b 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 78f8692dae6d539012259b8ea42206f83002e4f9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 34/36] cross-powerpcle-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index ec9324ddaa99..1d38a3fa3559 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 276eb8b54a535e0295ce4f7950f05ef5af1c0b54 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 35/36] cross-x86_64-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 0078fbe7224b..9f740b00a80c 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 3f441309269352fe22c8e1e429dc621423ce5d2f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 36/36] cross-x86_64-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..19e13f3818e9 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
@@ -17,12 +17,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.1.0
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (33 preceding siblings ...)
  2022-08-20 18:30 ` oreo639
@ 2022-08-21 22:46 ` oreo639
  2022-08-23  3:27 ` oreo639
                   ` (229 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-08-21 22:46 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 3702 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.1.0
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.1.0

This PR depends on: https://github.com/void-linux/void-packages/pull/32330

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

Also, keep in mind that the libgo musl patch here will need to be updated once musl is updated:
https://github.com/void-linux/void-packages/pull/34902/files#diff-1f42a95b93c9550178ff1fbccbef2f47a72711df15c24c9472e2550076978129R163-R176

This is the updated patch for reference:
https://github.com/alpinelinux/aports/blob/8acb21b8ee881e7ab1c812d9a66a17d2501b8730/main/gcc/0049-libgo-adjust-name-of-union-in-sigevent-struct.patch

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [ ] llvm https://github.com/void-linux/void-packages/pull/38694
- [ ] m4 https://github.com/void-linux/void-packages/pull/33730
- [ ] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785

Known packages that needed to be fixed/updated for gcc12:
- [ ] linux5.18 (in this PR)
- [ ] openssh
- [ ] xf86-video-vmware
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/38817
- [ ] libproxy https://github.com/void-linux/void-packages/pull/38818

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 130492 bytes --]

From 71ff8e63ee0fa506c4215869df097c635e9d3142 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 01/40] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 15 +++--
 3 files changed, 28 insertions(+), 113 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..4bdaee582d71 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkg-config"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -44,6 +45,12 @@ do_configure() {
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	case "$XBPS_TARGET_MACHINE" in
+		*-musl)
+			conf+=" --disable-gprofng"
+			;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"

From e10a388594fc03b234567e1b09e30b46c71c54e5 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 02/40] gcc: update to 12.1.0.

---
 common/shlibs                                 |  10 +-
 srcpkgs/gcc/files/gccgo-musl.patch            |  74 +++--------
 srcpkgs/gcc/files/libgnarl-musl.patch         |  18 +--
 srcpkgs/gcc/files/libssp-musl.patch           |  10 +-
 ...c21f3f5726823e19728fdd1571a14aae0fb3.patch | 105 ++++++++++++++++
 ...08065bdd36fb1a9b6aad9666b1edb5e06474.patch | 115 ++++++++++++++++++
 ...65517a59565758107c5b1a51a5fa382f8d1a.patch |  32 +++++
 srcpkgs/gcc/patches/libffi_gnulinux.patch     |  11 --
 .../gcc/patches/libgcc-ibm128-no-tag.patch    |  10 +-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |   3 +-
 srcpkgs/gcc/template                          |  25 ++--
 11 files changed, 305 insertions(+), 108 deletions(-)
 create mode 100644 srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
 create mode 100644 srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
 create mode 100644 srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index e2edb9f7a1b5..bd28f49ee93b 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.1.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.34 perl-5.34.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -848,8 +848,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.1.0_1
+libgnat-12.so libada-12.1.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1700,8 +1700,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.1.0_1
+libasan.so.8 libsanitizer-12.1.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..632ef951097b 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,17 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ a/libgo/go/runtime/os_linux.go
+@@ -363,9 +363,9 @@
+ 
+ 	var timerid int32
+ 	var sevp _sigevent
+-	sevp.sigev_notify = _SIGEV_THREAD_ID
++	sevp.sigev_notify = 4
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.sigev_notify_function))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch b/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
new file mode 100644
index 000000000000..00929202a503
--- /dev/null
+++ b/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
@@ -0,0 +1,105 @@
+From 3b21c21f3f5726823e19728fdd1571a14aae0fb3 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <siarheit@google.com>
+Date: Mon, 27 Jun 2022 13:27:24 +0100
+Subject: [PATCH] c++: avoid <memory> poisoning on musl [PR106102]
+
+On musl <pthread.h> uses calloc() (via <sched.h>). <memory> includes
+it indirectly and exposes use of poisoned calloc() when module code
+is built:
+
+    /build/build/./prev-gcc/xg++ ... ../../gcc-13-20220626/gcc/cp/mapper-resolver.cc
+        In file included from /<<NIX>>/musl-1.2.3-dev/include/pthread.h:30,
+                 from /build/build/prev-x86_64-unknown-linux-musl/libstdc++-v3/include/x86_64-unknown-linux-musl/bits/gthr-default.h:35,
+                 ....
+                 from /build/build/prev-x86_64-unknown-linux-musl/libstdc++-v3/include/memory:77,
+                 from ../../gcc-13-20220626/gcc/../libcody/cody.hh:24,
+                 from ../../gcc-13-20220626/gcc/cp/../../c++tools/resolver.h:25,
+                 from ../../gcc-13-20220626/gcc/cp/../../c++tools/resolver.cc:23,
+                 from ../../gcc-13-20220626/gcc/cp/mapper-resolver.cc:32:
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:84:7: error: attempt to use poisoned "calloc"
+       84 | void *calloc(size_t, size_t);
+          |       ^
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:124:36: error: attempt to use poisoned "calloc"
+      124 | #define CPU_ALLOC(n) ((cpu_set_t *)calloc(1,CPU_ALLOC_SIZE(n)))
+          |                                    ^
+
+gcc/cp/
+
+	PR c++/106102
+	* mapper-client.cc: Include <memory> via "system.h".
+	* mapper-resolver.cc: Ditto.
+	* module.cc: Ditto.
+
+libcc1/
+
+	PR c++/106102
+	* libcc1plugin.cc: Include <memory> via "system.h".
+	* libcp1plugin.cc: Ditto.
+---
+ gcc/cp/mapper-client.cc   | 1 +
+ gcc/cp/mapper-resolver.cc | 1 +
+ gcc/cp/module.cc          | 1 +
+ libcc1/libcc1plugin.cc    | 1 +
+ libcc1/libcp1plugin.cc    | 1 +
+ 5 files changed, 5 insertions(+)
+
+diff --git a/gcc/cp/mapper-client.cc b/gcc/cp/mapper-client.cc
+index 8603a886a099..fe9544b5ba43 100644
+--- a/gcc/cp/mapper-client.cc
++++ b/gcc/cp/mapper-client.cc
+@@ -27,6 +27,7 @@ along with GCC; see the file COPYING3.  If not see
+ #define INCLUDE_STRING
+ #define INCLUDE_VECTOR
+ #define INCLUDE_MAP
++#define INCLUDE_MEMORY
+ #include "system.h"
+ 
+ #include "line-map.h"
+diff --git a/gcc/cp/mapper-resolver.cc b/gcc/cp/mapper-resolver.cc
+index e3d29fb5ada1..e70d1b4ae2ca 100644
+--- a/gcc/cp/mapper-resolver.cc
++++ b/gcc/cp/mapper-resolver.cc
+@@ -25,6 +25,7 @@ along with GCC; see the file COPYING3.  If not see
+ #define INCLUDE_VECTOR
+ #define INCLUDE_ALGORITHM
+ #define INCLUDE_MAP
++#define INCLUDE_MEMORY
+ #include "system.h"
+ 
+ // We don't want or need to be aware of networking
+diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc
+index 753963a4b246..8bb22c2b305a 100644
+--- a/gcc/cp/module.cc
++++ b/gcc/cp/module.cc
+@@ -206,6 +206,7 @@ Classes used:
+ 
+ #define _DEFAULT_SOURCE 1 /* To get TZ field of struct tm, if available.  */
+ #include "config.h"
++#define INCLUDE_MEMORY
+ #define INCLUDE_STRING
+ #define INCLUDE_VECTOR
+ #include "system.h"
+diff --git a/libcc1/libcc1plugin.cc b/libcc1/libcc1plugin.cc
+index 12ab5a57c8dd..bdd0bdabe77f 100644
+--- a/libcc1/libcc1plugin.cc
++++ b/libcc1/libcc1plugin.cc
+@@ -31,6 +31,7 @@
+ #undef PACKAGE_TARNAME
+ #undef PACKAGE_VERSION
+ 
++#define INCLUDE_MEMORY
+ #include "gcc-plugin.h"
+ #include "system.h"
+ #include "coretypes.h"
+diff --git a/libcc1/libcp1plugin.cc b/libcc1/libcp1plugin.cc
+index 83dab7f58b11..e2d5039a0a1f 100644
+--- a/libcc1/libcp1plugin.cc
++++ b/libcc1/libcp1plugin.cc
+@@ -32,6 +32,7 @@
+ #undef PACKAGE_TARNAME
+ #undef PACKAGE_VERSION
+ 
++#define INCLUDE_MEMORY
+ #include "gcc-plugin.h"
+ #include "system.h"
+ #include "coretypes.h"
diff --git a/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch b/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
new file mode 100644
index 000000000000..89bd053d6d04
--- /dev/null
+++ b/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
@@ -0,0 +1,115 @@
+From 49d508065bdd36fb1a9b6aad9666b1edb5e06474 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <siarheit@google.com>
+Date: Mon, 27 Jun 2022 23:42:44 +0100
+Subject: [PATCH] jit: avoid calloc() poisoning on musl [PR106102]
+
+On musl <pthread.h> uses calloc() (via <sched.h>). jit/ includes
+it directly and exposes use of poisoned calloc():
+
+    /build/build/./prev-gcc/xg++ ... ../../gcc-13-20220626/gcc/jit/jit-playback.cc
+    make[3]: *** [Makefile:1143: jit/libgccjit.o] Error 1
+    make[3]: *** Waiting for unfinished jobs....
+    In file included from /<<NIX>>/musl-1.2.3-dev/include/pthread.h:30,
+                     from ../../gcc-13-20220626/gcc/jit/jit-playback.cc:44:
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:84:7: error: attempt to use poisoned "calloc"
+       84 | void *calloc(size_t, size_t);
+          |       ^
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:124:36: error: attempt to use poisoned "calloc"
+      124 | #define CPU_ALLOC(n) ((cpu_set_t *)calloc(1,CPU_ALLOC_SIZE(n)))
+          |                                    ^
+
+The change moves <pthread.h> inclusion to "system.h" under new
+INCLUDE_PTHREAD_H guard and uses this mechanism in libgccjit.
+
+gcc/
+
+	PR c++/106102
+	* system.h: Introduce INCLUDE_PTHREAD_H macros to include <pthread.h>.
+
+gcc/jit/
+
+	PR c++/106102
+	* jit-playback.cc: Include <pthread.h> via "system.h" to avoid calloc()
+	poisoning.
+	* jit-recording.cc: Ditto.
+	* libgccjit.cc: Ditto.
+---
+ gcc/jit/jit-playback.cc  | 3 +--
+ gcc/jit/jit-recording.cc | 2 +-
+ gcc/jit/libgccjit.cc     | 2 +-
+ gcc/system.h             | 4 ++++
+ 4 files changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/gcc/jit/jit-playback.cc b/gcc/jit/jit-playback.cc
+index 6be6bdf8dea5..79714132b91a 100644
+--- a/gcc/jit/jit-playback.cc
++++ b/gcc/jit/jit-playback.cc
+@@ -19,6 +19,7 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "target.h"
+@@ -41,8 +42,6 @@ along with GCC; see the file COPYING3.  If not see
+ #include "diagnostic.h"
+ #include "stmt.h"
+ 
+-#include <pthread.h>
+-
+ #include "jit-playback.h"
+ #include "jit-result.h"
+ #include "jit-builtins.h"
+diff --git a/gcc/jit/jit-recording.cc b/gcc/jit/jit-recording.cc
+index 697dee66e733..f78daed2d71a 100644
+--- a/gcc/jit/jit-recording.cc
++++ b/gcc/jit/jit-recording.cc
+@@ -19,13 +19,13 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "tm.h"
+ #include "pretty-print.h"
+ #include "toplev.h"
+ 
+-#include <pthread.h>
+ 
+ #include "jit-builtins.h"
+ #include "jit-recording.h"
+diff --git a/gcc/jit/libgccjit.cc b/gcc/jit/libgccjit.cc
+index 0e76097b4bac..ca862662777e 100644
+--- a/gcc/jit/libgccjit.cc
++++ b/gcc/jit/libgccjit.cc
+@@ -19,12 +19,12 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "timevar.h"
+ #include "typed-splay-tree.h"
+ #include "cppbuiltin.h"
+-#include <pthread.h>
+ 
+ #include "libgccjit.h"
+ #include "jit-recording.h"
+diff --git a/gcc/system.h b/gcc/system.h
+index 67158b70c789..f8d42ff68150 100644
+--- a/gcc/system.h
++++ b/gcc/system.h
+@@ -753,6 +753,10 @@ extern int vsnprintf (char *, size_t, const char *, va_list);
+ #endif
+ #endif
+ 
++#ifdef INCLUDE_PTHREAD_H
++#include <pthread.h>
++#endif
++
+ #ifdef INCLUDE_ISL
+ #ifdef HAVE_isl
+ #include <isl/options.h>
diff --git a/srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch b/srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch
new file mode 100644
index 000000000000..044a4fc29514
--- /dev/null
+++ b/srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch
@@ -0,0 +1,32 @@
+From f35d65517a59565758107c5b1a51a5fa382f8d1a Mon Sep 17 00:00:00 2001
+From: Ian Lance Taylor <iant@golang.org>
+Date: Tue, 12 Jul 2022 19:42:43 -0700
+Subject: [PATCH] libgo: don't include <linux/fs.h> when building
+ gen-sysinfo.go
+
+Removing this doesn't change anything at least with glibc 2.33.
+The include was added in https://go.dev/cl/6100049 but it's not
+clear why.
+
+Fixes PR go/106266
+
+Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/417294
+---
+ gcc/go/gofrontend/MERGE | 2 +-
+ libgo/sysinfo.c         | 3 ---
+ 2 files changed, 1 insertion(+), 4 deletions(-)
+
+diff --git a/libgo/sysinfo.c b/libgo/sysinfo.c
+index a4259c02ded4..fc0210992faa 100644
+--- a/libgo/sysinfo.c
++++ b/libgo/sysinfo.c
+@@ -158,9 +158,6 @@
+ #if defined(HAVE_LINUX_ETHER_H)
+ #include <linux/ether.h>
+ #endif
+-#if defined(HAVE_LINUX_FS_H)
+-#include <linux/fs.h>
+-#endif
+ #if defined(HAVE_LINUX_REBOOT_H)
+ #include <linux/reboot.h>
+ #endif
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..78a2ce35875d 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,9 +3,10 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
  
  #  ifndef _ABIN32
+
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..32ee79e32f0d 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,15 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
+version=12.1.0
+revision=1
 _patchver="${version%pre*}"
 _minorver="${_patchver%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 wrksrc=gcc-${version/pre/_pre}
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +19,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -396,7 +393,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}

From 96172d2a0d345110ea405459e88cf875f9086637 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 03/40] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      |  6 ++--
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..08e35d466a44 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From 784189c456f173a734f6c58765008ecfc79b5d3b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 04/40] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 1a4e1ca3d594..b04268908c2e 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="q66 <daniel@octaforge.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From f1aedffa776ac4b1979cc523ac9e8c3ff1172d8d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 05/40] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 3 files changed, 55 insertions(+), 353 deletions(-)
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index bd28f49ee93b..1710c1732abd 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From 1996f26665a857b96109b1099fac6c30c45bf9ef Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 16:22:03 -0700
Subject: [PATCH 06/40] llvm12: fix build for glibc 2.36

---
 .../compiler-rt-sanitizer-glibc-2.36.patch    | 59 +++++++++++++++++++
 .../compiler-rt-sanitizer-glibc-2.36.patch    | 59 +++++++++++++++++++
 2 files changed, 118 insertions(+)
 create mode 100644 srcpkgs/llvm12/compiler-rt-sanitizer-glibc-2.36.patch
 create mode 100644 srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch

diff --git a/srcpkgs/llvm12/compiler-rt-sanitizer-glibc-2.36.patch b/srcpkgs/llvm12/compiler-rt-sanitizer-glibc-2.36.patch
new file mode 100644
index 000000000000..e5f24dab8935
--- /dev/null
+++ b/srcpkgs/llvm12/compiler-rt-sanitizer-glibc-2.36.patch
@@ -0,0 +1,59 @@
+From 9cf13067cb5088626ba7ee1ec4c42ec59c7995a0 Mon Sep 17 00:00:00 2001
+From: Fangrui Song <i@maskray.me>
+Date: Mon, 11 Jul 2022 12:53:34 -0700
+Subject: [PATCH] [sanitizer] Remove #include <linux/fs.h> to resolve
+ fsconfig_command/mount_attr conflict with glibc 2.36
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+It is generally not a good idea to mix usage of glibc headers and Linux UAPI
+headers (https://sourceware.org/glibc/wiki/Synchronizing_Headers). In glibc
+since 7eae6a91e9b1670330c9f15730082c91c0b1d570 (milestone: 2.36), sys/mount.h
+defines `fsconfig_command` which conflicts with linux/mount.h:
+
+    .../usr/include/linux/mount.h:95:6: error: redeclaration of ‘enum fsconfig_command’
+
+Remove #include <linux/fs.h> which pulls in linux/mount.h. Expand its 4 macros manually.
+Android sys/mount.h doesn't define BLKBSZGET and it still needs linux/fs.h.
+In the long term we should move Linux specific definitions to sanitizer_platform_limits_linux.cpp
+but this commit is easy to cherry pick into older compiler-rt releases.
+
+Fix https://github.com/llvm/llvm-project/issues/56421
+
+Reviewed By: #sanitizers, vitalybuka, zatrazz
+
+Differential Revision: https://reviews.llvm.org/D129471
+---
+ .../sanitizer_platform_limits_posix.cpp                | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+index 4bd425435d56d..3a94b260686f1 100644
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -73,7 +73,9 @@
+ #include <sys/vt.h>
+ #include <linux/cdrom.h>
+ #include <linux/fd.h>
++#if SANITIZER_ANDROID
+ #include <linux/fs.h>
++#endif
+ #include <linux/hdreg.h>
+ #include <linux/input.h>
+ #include <linux/ioctl.h>
+@@ -876,10 +878,10 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
+   unsigned IOCTL_EVIOCGPROP = IOCTL_NOT_PRESENT;
+   unsigned IOCTL_EVIOCSKEYCODE_V2 = IOCTL_NOT_PRESENT;
+ #endif
+-  unsigned IOCTL_FS_IOC_GETFLAGS = FS_IOC_GETFLAGS;
+-  unsigned IOCTL_FS_IOC_GETVERSION = FS_IOC_GETVERSION;
+-  unsigned IOCTL_FS_IOC_SETFLAGS = FS_IOC_SETFLAGS;
+-  unsigned IOCTL_FS_IOC_SETVERSION = FS_IOC_SETVERSION;
++  unsigned IOCTL_FS_IOC_GETFLAGS = _IOR('f', 1, long);
++  unsigned IOCTL_FS_IOC_GETVERSION = _IOR('v', 1, long);
++  unsigned IOCTL_FS_IOC_SETFLAGS = _IOW('f', 2, long);
++  unsigned IOCTL_FS_IOC_SETVERSION = _IOW('v', 2, long);
+   unsigned IOCTL_GIO_CMAP = GIO_CMAP;
+   unsigned IOCTL_GIO_FONT = GIO_FONT;
+   unsigned IOCTL_GIO_UNIMAP = GIO_UNIMAP;
diff --git a/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch b/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch
new file mode 100644
index 000000000000..e5f24dab8935
--- /dev/null
+++ b/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch
@@ -0,0 +1,59 @@
+From 9cf13067cb5088626ba7ee1ec4c42ec59c7995a0 Mon Sep 17 00:00:00 2001
+From: Fangrui Song <i@maskray.me>
+Date: Mon, 11 Jul 2022 12:53:34 -0700
+Subject: [PATCH] [sanitizer] Remove #include <linux/fs.h> to resolve
+ fsconfig_command/mount_attr conflict with glibc 2.36
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+It is generally not a good idea to mix usage of glibc headers and Linux UAPI
+headers (https://sourceware.org/glibc/wiki/Synchronizing_Headers). In glibc
+since 7eae6a91e9b1670330c9f15730082c91c0b1d570 (milestone: 2.36), sys/mount.h
+defines `fsconfig_command` which conflicts with linux/mount.h:
+
+    .../usr/include/linux/mount.h:95:6: error: redeclaration of ‘enum fsconfig_command’
+
+Remove #include <linux/fs.h> which pulls in linux/mount.h. Expand its 4 macros manually.
+Android sys/mount.h doesn't define BLKBSZGET and it still needs linux/fs.h.
+In the long term we should move Linux specific definitions to sanitizer_platform_limits_linux.cpp
+but this commit is easy to cherry pick into older compiler-rt releases.
+
+Fix https://github.com/llvm/llvm-project/issues/56421
+
+Reviewed By: #sanitizers, vitalybuka, zatrazz
+
+Differential Revision: https://reviews.llvm.org/D129471
+---
+ .../sanitizer_platform_limits_posix.cpp                | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+index 4bd425435d56d..3a94b260686f1 100644
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -73,7 +73,9 @@
+ #include <sys/vt.h>
+ #include <linux/cdrom.h>
+ #include <linux/fd.h>
++#if SANITIZER_ANDROID
+ #include <linux/fs.h>
++#endif
+ #include <linux/hdreg.h>
+ #include <linux/input.h>
+ #include <linux/ioctl.h>
+@@ -876,10 +878,10 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
+   unsigned IOCTL_EVIOCGPROP = IOCTL_NOT_PRESENT;
+   unsigned IOCTL_EVIOCSKEYCODE_V2 = IOCTL_NOT_PRESENT;
+ #endif
+-  unsigned IOCTL_FS_IOC_GETFLAGS = FS_IOC_GETFLAGS;
+-  unsigned IOCTL_FS_IOC_GETVERSION = FS_IOC_GETVERSION;
+-  unsigned IOCTL_FS_IOC_SETFLAGS = FS_IOC_SETFLAGS;
+-  unsigned IOCTL_FS_IOC_SETVERSION = FS_IOC_SETVERSION;
++  unsigned IOCTL_FS_IOC_GETFLAGS = _IOR('f', 1, long);
++  unsigned IOCTL_FS_IOC_GETVERSION = _IOR('v', 1, long);
++  unsigned IOCTL_FS_IOC_SETFLAGS = _IOW('f', 2, long);
++  unsigned IOCTL_FS_IOC_SETVERSION = _IOW('v', 2, long);
+   unsigned IOCTL_GIO_CMAP = GIO_CMAP;
+   unsigned IOCTL_GIO_FONT = GIO_FONT;
+   unsigned IOCTL_GIO_UNIMAP = GIO_UNIMAP;

From 3fa145c49d2c02a59f1da0f4de0b23fa2faf127f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 17:21:40 -0700
Subject: [PATCH 07/40] m4: update to 1.4.19.

---
 srcpkgs/m4/patches/fix-glibc-2.27.patch | 167 ------------------------
 srcpkgs/m4/template                     |  12 +-
 2 files changed, 6 insertions(+), 173 deletions(-)
 delete mode 100644 srcpkgs/m4/patches/fix-glibc-2.27.patch

diff --git a/srcpkgs/m4/patches/fix-glibc-2.27.patch b/srcpkgs/m4/patches/fix-glibc-2.27.patch
deleted file mode 100644
index 59d33cff164d..000000000000
--- a/srcpkgs/m4/patches/fix-glibc-2.27.patch
+++ /dev/null
@@ -1,167 +0,0 @@
-From 4af4a4a71827c0bc5e0ec67af23edef4f15cee8e Mon Sep 17 00:00:00 2001
-From: Paul Eggert <eggert@cs.ucla.edu>
-Date: Mon, 5 Mar 2018 10:56:29 -0800
-Subject: [PATCH] fflush: adjust to glibc 2.28 libio.h removal
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Problem reported by Daniel P. Berrangé in:
-https://lists.gnu.org/r/bug-gnulib/2018-03/msg00000.html
-* lib/fbufmode.c (fbufmode):
-* lib/fflush.c (clear_ungetc_buffer_preserving_position)
-(disable_seek_optimization, rpl_fflush):
-* lib/fpending.c (__fpending):
-* lib/fpurge.c (fpurge):
-* lib/freadable.c (freadable):
-* lib/freadahead.c (freadahead):
-* lib/freading.c (freading):
-* lib/freadptr.c (freadptr):
-* lib/freadseek.c (freadptrinc):
-* lib/fseeko.c (fseeko):
-* lib/fseterr.c (fseterr):
-* lib/fwritable.c (fwritable):
-* lib/fwriting.c (fwriting):
-Check _IO_EOF_SEEN instead of _IO_ftrylockfile.
-* lib/stdio-impl.h (_IO_IN_BACKUP) [_IO_EOF_SEEN]:
-Define if not already defined.
-
-[yann.morin.1998@free.fr: partially backport from upstream gnulib]
-Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
-
----
- lib/fflush.c     |  6 +++---
- lib/fpending.c   |  2 +-
- lib/fpurge.c     |  2 +-
- lib/freadahead.c |  2 +-
- lib/freading.c   |  2 +-
- lib/fseeko.c     |  4 ++--
- lib/stdio-impl.h |  6 ++++++
- 7 files changed, 15 insertions(+), 9 deletions(-)
-
-diff --git a/lib/fflush.c b/build-aux/gnulib/lib/fflush.c
-index 983ade0ff..a6edfa105 100644
---- a/lib/fflush.c
-+++ b/lib/fflush.c
-@@ -33,7 +33,7 @@
- #undef fflush
- 
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- 
- /* Clear the stream's ungetc buffer, preserving the value of ftello (fp).  */
- static void
-@@ -72,7 +72,7 @@ clear_ungetc_buffer (FILE *fp)
- 
- #endif
- 
--#if ! (defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
-+#if ! (defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
- 
- # if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT
- /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
-@@ -148,7 +148,7 @@ rpl_fflush (FILE *stream)
-   if (stream == NULL || ! freading (stream))
-     return fflush (stream);
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- 
-   clear_ungetc_buffer_preserving_position (stream);
- 
-diff --git a/lib/fpending.c b/build-aux/gnulib/lib/fpending.c
-index c84e3a5b4..789f50e4e 100644
---- a/lib/fpending.c
-+++ b/lib/fpending.c
-@@ -32,7 +32,7 @@ __fpending (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   return fp->_IO_write_ptr - fp->_IO_write_base;
- #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
-   /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
-diff --git a/lib/fpurge.c b/build-aux/gnulib/lib/fpurge.c
-index b1d417c7a..3aedcc373 100644
---- a/lib/fpurge.c
-+++ b/lib/fpurge.c
-@@ -62,7 +62,7 @@ fpurge (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   fp->_IO_read_end = fp->_IO_read_ptr;
-   fp->_IO_write_ptr = fp->_IO_write_base;
-   /* Avoid memory leak when there is an active ungetc buffer.  */
-diff --git a/lib/freadahead.c b/build-aux/gnulib/lib/freadahead.c
-index c2ecb5b28..23ec76ee5 100644
---- a/lib/freadahead.c
-+++ b/lib/freadahead.c
-@@ -30,7 +30,7 @@ extern size_t __sreadahead (FILE *);
- size_t
- freadahead (FILE *fp)
- {
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   if (fp->_IO_write_ptr > fp->_IO_write_base)
-     return 0;
-   return (fp->_IO_read_end - fp->_IO_read_ptr)
-diff --git a/lib/freading.c b/build-aux/gnulib/lib/freading.c
-index 73c28acdd..c24d0c88a 100644
---- a/lib/freading.c
-+++ b/lib/freading.c
-@@ -31,7 +31,7 @@ freading (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   return ((fp->_flags & _IO_NO_WRITES) != 0
-           || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0
-               && fp->_IO_read_base != NULL));
-diff --git a/lib/fseeko.c b/build-aux/gnulib/lib/fseeko.c
-index 0101ab55f..193f4e8ce 100644
---- a/lib/fseeko.c
-+++ b/lib/fseeko.c
-@@ -47,7 +47,7 @@ fseeko (FILE *fp, off_t offset, int whence)
- #endif
- 
-   /* These tests are based on fpurge.c.  */
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   if (fp->_IO_read_end == fp->_IO_read_ptr
-       && fp->_IO_write_ptr == fp->_IO_write_base
-       && fp->_IO_save_base == NULL)
-@@ -123,7 +123,7 @@ fseeko (FILE *fp, off_t offset, int whence)
-           return -1;
-         }
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-       fp->_flags &= ~_IO_EOF_SEEN;
-       fp->_offset = pos;
- #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
-diff --git a/lib/stdio-impl.h b/build-aux/gnulib/lib/stdio-impl.h
-index 78d896e9f..05c5752a2 100644
---- a/lib/stdio-impl.h
-+++ b/lib/stdio-impl.h
-@@ -18,6 +18,12 @@
-    the same implementation of stdio extension API, except that some fields
-    have different naming conventions, or their access requires some casts.  */
- 
-+/* Glibc 2.28 made _IO_IN_BACKUP private.  For now, work around this
-+   problem by defining it ourselves.  FIXME: Do not rely on glibc
-+   internals.  */
-+#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN
-+# define _IO_IN_BACKUP 0x100
-+#endif
- 
- /* BSD stdio derived implementations.  */
- 
--- 
-2.14.1
-
-
diff --git a/srcpkgs/m4/template b/srcpkgs/m4/template
index 78f3dae6184a..762593d883bd 100644
--- a/srcpkgs/m4/template
+++ b/srcpkgs/m4/template
@@ -1,17 +1,17 @@
 # Template file for 'm4'
 pkgname=m4
-version=1.4.18
-revision=2
+version=1.4.19
+revision=1
 bootstrap=yes
-replaces="chroot-m4>=0"
 build_style=gnu-configure
 configure_args="--enable-changeword --enable-threads"
 short_desc="GNU version of UNIX m4 macro language processor"
-homepage="https://www.gnu.org/software/m4/"
-license="GPL-3.0-or-later"
 maintainer="Enno Boland <gottox@voidlinux.org>"
+license="GPL-3.0-or-later"
+homepage="https://www.gnu.org/software/m4/"
 distfiles="${GNU_SITE}/${pkgname}/${pkgname}-${version}.tar.xz"
-checksum=f2c1e86ca0a404ff281631bdc8377638992744b175afb806e25871a24a934e07
+checksum=63aede5c6d33b6d9b13511cd0be2cac046f2e70fd0a07aa9573a04a82783af96
+replaces="chroot-m4>=0"
 
 if [ "$XBPS_TARGET_LIBC" = musl ]; then
 	export ac_cv_lib_error_at_line=no

From 0f500c11e651e88f6005d2ea84a7ee2802042541 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 22:57:59 -0700
Subject: [PATCH 08/40] btrfs-progs: update to 5.19.

---
 srcpkgs/btrfs-progs/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/btrfs-progs/template b/srcpkgs/btrfs-progs/template
index f6c53d8587e1..292d5110106b 100644
--- a/srcpkgs/btrfs-progs/template
+++ b/srcpkgs/btrfs-progs/template
@@ -1,6 +1,6 @@
 # Template file for 'btrfs-progs'
 pkgname=btrfs-progs
-version=5.18.1
+version=5.19
 revision=1
 wrksrc="${pkgname}-v${version}"
 build_style=gnu-configure
@@ -16,7 +16,7 @@ license="GPL-2.0-only, LGPL-2.1-or-later"
 homepage="https://btrfs.wiki.kernel.org/index.php/Main_Page"
 changelog="https://raw.githubusercontent.com/kdave/btrfs-progs/master/CHANGES"
 distfiles="${KERNEL_SITE}/kernel/people/kdave/${pkgname}/${pkgname}-v${version}.tar.xz"
-checksum=6e98a75ccff52e9354daa1ad284c614c490f844273a2fa524cbac9eb841c7255
+checksum=1fbcf06e4b2f80e7a127fd687ed4625a5b74fa674fe212c836ff70e0edfcccf9
 # Most of the tests depend on `mount` and `fallocate` commands, which are not
 # presented in chroot-util-linux
 make_check=no

From 30fb6fd8c6490a62b2b6f9cfd102ba8c21c496c6 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 14 Aug 2022 19:29:36 -0700
Subject: [PATCH 09/40] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove nopie=yes. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh             |  1 +
 common/environment/build-style/void-cross.sh | 36 +++++++++++++++++++-
 2 files changed, 36 insertions(+), 1 deletion(-)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..c24013755704 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -132,6 +132,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
diff --git a/common/environment/build-style/void-cross.sh b/common/environment/build-style/void-cross.sh
index 62ce9eaa2e4a..4b77c90efc8b 100644
--- a/common/environment/build-style/void-cross.sh
+++ b/common/environment/build-style/void-cross.sh
@@ -1,6 +1,40 @@
 lib32disabled=yes
-nopie=yes
 create_wrksrc=yes
 
 nostrip_files+=" libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a libgmem.a"
+nopie_files+=" /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/go1
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/lto-wrapper
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/plugin/gengtype
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/cc1objplus
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/cc1obj
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/collect2
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/lto1
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/f951
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/cc1
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/gnat1
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/cc1plus
+ /usr/bin/${sourcepkg/cross-}-gcov-dump
+ /usr/bin/${sourcepkg/cross-}-gnatlink
+ /usr/bin/${sourcepkg/cross-}-gnatbind
+ /usr/bin/${sourcepkg/cross-}-gcc
+ /usr/bin/${sourcepkg/cross-}-cpp
+ /usr/bin/${sourcepkg/cross-}-gnatchop
+ /usr/bin/${sourcepkg/cross-}-gfortran
+ /usr/bin/${sourcepkg/cross-}-gccgo
+ /usr/bin/${sourcepkg/cross-}-c++
+ /usr/bin/${sourcepkg/cross-}-lto-dump
+ /usr/bin/${sourcepkg/cross-}-gnatname
+ /usr/bin/${sourcepkg/cross-}-gnatprep
+ /usr/bin/${sourcepkg/cross-}-g++
+ /usr/bin/${sourcepkg/cross-}-gnat
+ /usr/bin/${sourcepkg/cross-}-gcc-ranlib
+ /usr/bin/${sourcepkg/cross-}-gnatkr
+ /usr/bin/${sourcepkg/cross-}-gnatmake
+ /usr/bin/${sourcepkg/cross-}-gcc-${_gcc_version}
+ /usr/bin/${sourcepkg/cross-}-gcc-ar
+ /usr/bin/${sourcepkg/cross-}-gnatclean
+ /usr/bin/${sourcepkg/cross-}-gcov
+ /usr/bin/${sourcepkg/cross-}-gnatls
+ /usr/bin/${sourcepkg/cross-}-gcc-nm
+ /usr/bin/${sourcepkg/cross-}-gcov-tool"

From ef69ba7a0702d32b6b3843617642027d59adc2dd Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:08:52 -0700
Subject: [PATCH 10/40] openssh: suppress werror on gcc12

---
 srcpkgs/openssh/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/openssh/template b/srcpkgs/openssh/template
index 02a2dec35f42..6e8e343a9dca 100644
--- a/srcpkgs/openssh/template
+++ b/srcpkgs/openssh/template
@@ -40,7 +40,7 @@ if [ "$build_option_ldns" -a -z "$build_option_ssl" ]; then
 	broken="option 'ldns' requires option 'ssl'"
 fi
 
-CFLAGS="-Wno-format-truncation -Wno-stringop-truncation"
+CFLAGS="-Wno-format-truncation -Wno-stringop-truncation -Wno-error=maybe-uninitialized"
 
 case $XBPS_TARGET_MACHINE in
 	i686-musl)

From c05d7ff1cb477e26f2cf19fff6318804042ee049 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:09:31 -0700
Subject: [PATCH 11/40] linux5.18: update dotconfigs for gcc12

---
 srcpkgs/linux5.18/files/x86_64-dotconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/linux5.18/files/x86_64-dotconfig b/srcpkgs/linux5.18/files/x86_64-dotconfig
index 4e73a3195d40..ea6204868e23 100644
--- a/srcpkgs/linux5.18/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.18/files/x86_64-dotconfig
@@ -512,6 +512,7 @@ CONFIG_RETHUNK=y
 CONFIG_CPU_UNRET_ENTRY=y
 CONFIG_CPU_IBPB_ENTRY=y
 CONFIG_CPU_IBRS_ENTRY=y
+CONFIG_SLS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10060,8 +10061,11 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
 # Memory initialization
 #
 CONFIG_INIT_STACK_NONE=y
+# CONFIG_INIT_STACK_ALL_PATTERN is not set
+# CONFIG_INIT_STACK_ALL_ZERO is not set
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
+# CONFIG_ZERO_CALL_USED_REGS is not set
 # end of Memory initialization
 # end of Kernel hardening options
 # end of Security options
@@ -10538,6 +10542,7 @@ CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
 # CONFIG_UBSAN is not set
 CONFIG_HAVE_ARCH_KCSAN=y
+# CONFIG_KCSAN is not set
 # end of Generic Kernel Debugging Instruments
 
 #

From b633e818719d20a02f3a9e9ac9d27995ccd2e89f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 18:00:42 -0700
Subject: [PATCH 12/40] xf86-video-vmware: fix build on gcc12

---
 ...183b3395333d5d4c73e25c2d011748f15eda.patch | 30 +++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch

diff --git a/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch b/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch
new file mode 100644
index 000000000000..ff839f16e628
--- /dev/null
+++ b/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch
@@ -0,0 +1,30 @@
+From 77b8183b3395333d5d4c73e25c2d011748f15eda Mon Sep 17 00:00:00 2001
+From: Rudi Heitbaum <rudi@heitbaum.com>
+Date: Sun, 8 May 2022 03:00:10 +0000
+Subject: [PATCH] vmwgfx: fix missing array notation
+
+ Fixes error identified by gcc-12.1.0 compiler
+
+make
+  CC       libvmwgfx_la-vmwgfx_tex_video.lo
+vmwgfx_tex_video.c: In function 'stop_video':
+vmwgfx_tex_video.c:240:20: error: the comparison will always evaluate as 'true' for the address of 'yuv' will never be NULL [-Werror=address]
+  240 |                if (priv->yuv[i]) {
+      |                    ^~~~
+---
+ vmwgfx/vmwgfx_tex_video.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/vmwgfx/vmwgfx_tex_video.c b/vmwgfx/vmwgfx_tex_video.c
+index acc2b56..480a5f1 100644
+--- a/vmwgfx/vmwgfx_tex_video.c
++++ b/vmwgfx/vmwgfx_tex_video.c
+@@ -237,7 +237,7 @@ stop_video(ScrnInfoPtr pScrn, pointer data, Bool shutdown)
+ 
+        for (i=0; i<3; ++i) {
+ 	   for (j=0; j<2; ++j) {
+-	       if (priv->yuv[i]) {
++	       if (priv->yuv[j][i]) {
+ 		   xa_surface_destroy(priv->yuv[j][i]);
+ 		   priv->yuv[j][i] = NULL;
+ 	       }

From 20500a4ed303e08611bd364ad4a50f42240b337e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 18:24:37 -0700
Subject: [PATCH 13/40] doxygen: fix build for gcc 12

---
 srcpkgs/doxygen/patches/compat-gcc12.patch | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100644 srcpkgs/doxygen/patches/compat-gcc12.patch

diff --git a/srcpkgs/doxygen/patches/compat-gcc12.patch b/srcpkgs/doxygen/patches/compat-gcc12.patch
new file mode 100644
index 000000000000..666744a1dceb
--- /dev/null
+++ b/srcpkgs/doxygen/patches/compat-gcc12.patch
@@ -0,0 +1,22 @@
+From 5198966c8d5fec89116d025c74934ac03ea511fa Mon Sep 17 00:00:00 2001
+From: Dimitri van Heesch <doxygen@gmail.com>
+Date: Fri, 6 May 2022 09:55:16 +0200
+Subject: [PATCH] issue #9312: Build: cache.h:53:14: error: 'exchange' is not a
+ member of 'std'
+
+---
+ src/cache.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/cache.h b/src/cache.h
+index 0ff3092ed5..e218eb27d2 100644
+--- a/src/cache.h
++++ b/src/cache.h
+@@ -19,6 +19,7 @@
+ #include <list>
+ #include <unordered_map>
+ #include <mutex>
++#include <utility>
+ #include <ctype.h>
+ 
+ /*! Fixed size cache for value type V using keys of type K.

From 092e9749c245d93e95ced7df1d4d99207b08cc2f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 21 Aug 2022 15:12:00 -0700
Subject: [PATCH 14/40] libproxy: update to 0.4.18

---
 srcpkgs/libproxy/template | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/libproxy/template b/srcpkgs/libproxy/template
index d6103007032e..6599dfb69b98 100644
--- a/srcpkgs/libproxy/template
+++ b/srcpkgs/libproxy/template
@@ -1,18 +1,22 @@
 # Template file for 'libproxy'
 pkgname=libproxy
-version=0.4.15
+version=0.4.18
 revision=1
 build_style=cmake
 configure_args="-DWITH_GNOME=0 -DWITH_KDE4=0 -DWITH_MOZJS=0 -DWITH_NM=0
  -DWITH_PERL=0 -DWITH_PYTHON=1 -DWITH_WEBKIT=0"
 hostmakedepends="pkg-config python"
 makedepends="zlib-devel"
-short_desc="A library handling all the details of proxy configuration"
+short_desc="Library handling all the details of proxy configuration"
 maintainer="Orphaned <orphan@voidlinux.org>"
+license="LGPL-2.1-or-later"
 homepage="http://github.com/libproxy/libproxy"
-license="LGPL-2.1"
-distfiles="https://github.com/libproxy/libproxy/archive/${version}.tar.gz>${pkgname}-${version}.tar.gz"
-checksum=18f58b0a0043b6881774187427ead158d310127fc46a1c668ad6d207fb28b4e0
+distfiles="https://github.com/libproxy/libproxy/archive/${version}.tar.gz"
+checksum=0b4a9218d88f6cf9fa25996a3f38329a11f688a9d026141d9d0e966d8fa63837
+
+post_patch() {
+	vsed '/add_test(NAME url-test/d' -i libproxy/test/CMakeLists.txt
+}
 
 libproxy-devel_package() {
 	depends="libproxy>=${version}_${revision}"

From 0f78eb2bdda525d2b826b93f3591c56367375525 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 14:45:28 -0700
Subject: [PATCH 15/40] libsasl: fix build for libtool 2.4.7

---
 srcpkgs/libsasl/template | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/libsasl/template b/srcpkgs/libsasl/template
index a8817042f843..a2993b39f4a1 100644
--- a/srcpkgs/libsasl/template
+++ b/srcpkgs/libsasl/template
@@ -19,6 +19,7 @@ distfiles="https://github.com/cyrusimap/cyrus-sasl/releases/download/cyrus-sasl-
 checksum=26866b1549b00ffd020f188a43c258017fa1c382b3ddadd8201536f72efb05d5
 
 pre_configure() {
+	rm -f m4/ltversion.m4
 	autoreconf -fi
 }
 

From 84fee87c2d9d38d3cf327243cbfcc749692e1f20 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:08 -0700
Subject: [PATCH 16/40] subversion: fix build for libtool 2.4.7

---
 srcpkgs/subversion/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion/template b/srcpkgs/subversion/template
index 8ad178264942..3f1c9e254e61 100644
--- a/srcpkgs/subversion/template
+++ b/srcpkgs/subversion/template
@@ -57,7 +57,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From f092953f43ef2a073bc185f04efe6198e6915247 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:38 -0700
Subject: [PATCH 17/40] subversion-kwallet-auth: fix build for libtool 2.4.7

---
 srcpkgs/subversion-kwallet-auth/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion-kwallet-auth/template b/srcpkgs/subversion-kwallet-auth/template
index 12210f250d51..b4d8621456ea 100644
--- a/srcpkgs/subversion-kwallet-auth/template
+++ b/srcpkgs/subversion-kwallet-auth/template
@@ -59,7 +59,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From ec99076a425375e17c65952287ad615aedf3646a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:54 -0700
Subject: [PATCH 18/40] cross-aarch64-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..cb7ae97e7efe 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 07bc3faaf774b9e5aa243c1c1e5acbb053e7be0a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:54 -0700
Subject: [PATCH 19/40] cross-aarch64-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..4fa950f334d4 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From a3de30989715dfe55f974baa8aebb18bfd05a0ae Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:54 -0700
Subject: [PATCH 20/40] cross-arm-linux-gnueabi: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..194c0ab774b7 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 77eda7cd199a203d0e48bf34e3c0594472bb7b12 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 21/40] cross-arm-linux-gnueabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..3f3242b85b07 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 92e2407208ce59214baad9b1aeb908d4113b47ab Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 22/40] cross-arm-linux-musleabi: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..b0cdade60a6d 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 9b4f5cb39295cb078e5c79b6b8c1098346ee7130 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 23/40] cross-arm-linux-musleabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..1924be24d483 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 7583efafb2faf5060e2f1c3e48c61fff0dac2f70 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 24/40] cross-armv7l-linux-gnueabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..a7997d6db937 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 3a016fe8c5e0b77dd66ef629677d595aa21d4ed9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 25/40] cross-armv7l-linux-musleabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..aaa7040fbfef 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 8810caf0b3b976f836f5a251fbd96edac4e8d2f1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 26/40] cross-i686-pc-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..765cf675e95c 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From aa9f85d6524d87771f98097576edd38912de9c2f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 27/40] cross-mips-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-mips-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..26928ba9442d 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From da618b03583ea2ab52b2f2f0a6fe391d8daaac81 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 28/40] cross-mips-linux-muslhf: update to gcc 12.1.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..fe74faf15d55 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From b1a28851504dc4180a4178d5493a34fd47c86056 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 29/40] cross-mipsel-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..aa74d0b1acc7 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_musl_version=1.1.24
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 129bae7e434ce3282d6490a26d2b3cb5d8041106 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 30/40] cross-mipsel-linux-muslhf: update to gcc 12.1.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..83ab7f187085 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_musl_version=1.1.24
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 084a95334468abe95edb66be4d1875a342f1747e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 31/40] cross-powerpc-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..3ab1a4ea40fa 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 38aad107d8aabfa26310214455850843848d436a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 32/40] cross-powerpc-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..af5586cacc77 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 6daff02ae47d72da5da5dc8c8b0e58752940a45c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 33/40] cross-powerpc64-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..2604b268046b 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 1637acfad299da106c4fb50d520b975cf9d27b02 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 34/40] cross-powerpc64-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 1ebd0fb2048d..c7894721b900 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
@@ -19,12 +19,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 998bb95780712a50c62314871499953f121fb45f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 35/40] cross-powerpc64le-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 733f5851da5c..618235468970 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From e8251a12db61891b2fe8f7f6a18bd284325cd432 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 36/40] cross-powerpc64le-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index 76a70aa1d6db..7edf9605e60d 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
@@ -19,12 +19,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From cbeceaec40030afc7f6cf11b349b058ce97530c5 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 37/40] cross-powerpcle-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 347b8fcf4f55..cc10b7cbd88b 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 2aa7bfc5cfb71857976346c78918c51039051179 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 38/40] cross-powerpcle-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index ec9324ddaa99..1d38a3fa3559 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From e2c651aed0378002eb717613a82d988dda2b178b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 39/40] cross-x86_64-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 0078fbe7224b..9f740b00a80c 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 0a4417f722e9897116b4ca405340044b769d3f54 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 40/40] cross-x86_64-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..19e13f3818e9 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
@@ -17,12 +17,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.1.0
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (34 preceding siblings ...)
  2022-08-21 22:46 ` oreo639
@ 2022-08-23  3:27 ` oreo639
  2022-08-23  4:02 ` oreo639
                   ` (228 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-08-23  3:27 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 4145 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.1.0
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.1.0

This PR depends on: https://github.com/void-linux/void-packages/pull/32330

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

Also, keep in mind that the libgo musl patch here will need to be updated once musl is updated:
https://github.com/void-linux/void-packages/pull/34902/files#diff-1f42a95b93c9550178ff1fbccbef2f47a72711df15c24c9472e2550076978129R163-R176

This is the updated patch for reference:
https://github.com/alpinelinux/aports/blob/8acb21b8ee881e7ab1c812d9a66a17d2501b8730/main/gcc/0049-libgo-adjust-name-of-union-in-sigevent-struct.patch

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [ ] llvm https://github.com/void-linux/void-packages/pull/38694
- [ ] m4 https://github.com/void-linux/void-packages/pull/33730
- [ ] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [ ] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828

Known packages that needed to be fixed/updated for gcc12:
- [ ] linux5.18 (in this PR)
- [ ] openssh
- [ ] xf86-video-vmware
- [ ] doxygen
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/38817
- [ ] libproxy https://github.com/void-linux/void-packages/pull/38818
- [ ] exempi https://github.com/void-linux/void-packages/pull/38820
- [ ] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [ ] gpgme https://github.com/void-linux/void-packages/pull/38825

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 143271 bytes --]

From dda3b8a812a350176ff90821999538b11cba29ff Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 01/44] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 15 +++--
 3 files changed, 28 insertions(+), 113 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..4bdaee582d71 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkg-config"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -44,6 +45,12 @@ do_configure() {
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	case "$XBPS_TARGET_MACHINE" in
+		*-musl)
+			conf+=" --disable-gprofng"
+			;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"

From 26ae87a2d836f970df891409aa3f25377a9ecbcb Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 02/44] gcc: update to 12.1.0.

---
 common/shlibs                                 |  10 +-
 srcpkgs/gcc/files/gccgo-musl.patch            |  74 +++--------
 srcpkgs/gcc/files/libgnarl-musl.patch         |  18 +--
 srcpkgs/gcc/files/libssp-musl.patch           |  10 +-
 ...c21f3f5726823e19728fdd1571a14aae0fb3.patch | 105 ++++++++++++++++
 ...08065bdd36fb1a9b6aad9666b1edb5e06474.patch | 115 ++++++++++++++++++
 ...65517a59565758107c5b1a51a5fa382f8d1a.patch |  32 +++++
 srcpkgs/gcc/patches/libffi_gnulinux.patch     |  11 --
 .../gcc/patches/libgcc-ibm128-no-tag.patch    |  10 +-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |   3 +-
 .../sanitizer-fix-compat-glibc-2.36.patch     |  39 ++++++
 srcpkgs/gcc/template                          |  25 ++--
 12 files changed, 344 insertions(+), 108 deletions(-)
 create mode 100644 srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
 create mode 100644 srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
 create mode 100644 srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch
 create mode 100644 srcpkgs/gcc/patches/sanitizer-fix-compat-glibc-2.36.patch

diff --git a/common/shlibs b/common/shlibs
index f829ee12e80f..776f9b195309 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.1.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.34 perl-5.34.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -848,8 +848,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.1.0_1
+libgnat-12.so libada-12.1.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1700,8 +1700,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.1.0_1
+libasan.so.8 libsanitizer-12.1.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..632ef951097b 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,17 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ a/libgo/go/runtime/os_linux.go
+@@ -363,9 +363,9 @@
+ 
+ 	var timerid int32
+ 	var sevp _sigevent
+-	sevp.sigev_notify = _SIGEV_THREAD_ID
++	sevp.sigev_notify = 4
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.sigev_notify_function))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch b/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
new file mode 100644
index 000000000000..00929202a503
--- /dev/null
+++ b/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
@@ -0,0 +1,105 @@
+From 3b21c21f3f5726823e19728fdd1571a14aae0fb3 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <siarheit@google.com>
+Date: Mon, 27 Jun 2022 13:27:24 +0100
+Subject: [PATCH] c++: avoid <memory> poisoning on musl [PR106102]
+
+On musl <pthread.h> uses calloc() (via <sched.h>). <memory> includes
+it indirectly and exposes use of poisoned calloc() when module code
+is built:
+
+    /build/build/./prev-gcc/xg++ ... ../../gcc-13-20220626/gcc/cp/mapper-resolver.cc
+        In file included from /<<NIX>>/musl-1.2.3-dev/include/pthread.h:30,
+                 from /build/build/prev-x86_64-unknown-linux-musl/libstdc++-v3/include/x86_64-unknown-linux-musl/bits/gthr-default.h:35,
+                 ....
+                 from /build/build/prev-x86_64-unknown-linux-musl/libstdc++-v3/include/memory:77,
+                 from ../../gcc-13-20220626/gcc/../libcody/cody.hh:24,
+                 from ../../gcc-13-20220626/gcc/cp/../../c++tools/resolver.h:25,
+                 from ../../gcc-13-20220626/gcc/cp/../../c++tools/resolver.cc:23,
+                 from ../../gcc-13-20220626/gcc/cp/mapper-resolver.cc:32:
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:84:7: error: attempt to use poisoned "calloc"
+       84 | void *calloc(size_t, size_t);
+          |       ^
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:124:36: error: attempt to use poisoned "calloc"
+      124 | #define CPU_ALLOC(n) ((cpu_set_t *)calloc(1,CPU_ALLOC_SIZE(n)))
+          |                                    ^
+
+gcc/cp/
+
+	PR c++/106102
+	* mapper-client.cc: Include <memory> via "system.h".
+	* mapper-resolver.cc: Ditto.
+	* module.cc: Ditto.
+
+libcc1/
+
+	PR c++/106102
+	* libcc1plugin.cc: Include <memory> via "system.h".
+	* libcp1plugin.cc: Ditto.
+---
+ gcc/cp/mapper-client.cc   | 1 +
+ gcc/cp/mapper-resolver.cc | 1 +
+ gcc/cp/module.cc          | 1 +
+ libcc1/libcc1plugin.cc    | 1 +
+ libcc1/libcp1plugin.cc    | 1 +
+ 5 files changed, 5 insertions(+)
+
+diff --git a/gcc/cp/mapper-client.cc b/gcc/cp/mapper-client.cc
+index 8603a886a099..fe9544b5ba43 100644
+--- a/gcc/cp/mapper-client.cc
++++ b/gcc/cp/mapper-client.cc
+@@ -27,6 +27,7 @@ along with GCC; see the file COPYING3.  If not see
+ #define INCLUDE_STRING
+ #define INCLUDE_VECTOR
+ #define INCLUDE_MAP
++#define INCLUDE_MEMORY
+ #include "system.h"
+ 
+ #include "line-map.h"
+diff --git a/gcc/cp/mapper-resolver.cc b/gcc/cp/mapper-resolver.cc
+index e3d29fb5ada1..e70d1b4ae2ca 100644
+--- a/gcc/cp/mapper-resolver.cc
++++ b/gcc/cp/mapper-resolver.cc
+@@ -25,6 +25,7 @@ along with GCC; see the file COPYING3.  If not see
+ #define INCLUDE_VECTOR
+ #define INCLUDE_ALGORITHM
+ #define INCLUDE_MAP
++#define INCLUDE_MEMORY
+ #include "system.h"
+ 
+ // We don't want or need to be aware of networking
+diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc
+index 753963a4b246..8bb22c2b305a 100644
+--- a/gcc/cp/module.cc
++++ b/gcc/cp/module.cc
+@@ -206,6 +206,7 @@ Classes used:
+ 
+ #define _DEFAULT_SOURCE 1 /* To get TZ field of struct tm, if available.  */
+ #include "config.h"
++#define INCLUDE_MEMORY
+ #define INCLUDE_STRING
+ #define INCLUDE_VECTOR
+ #include "system.h"
+diff --git a/libcc1/libcc1plugin.cc b/libcc1/libcc1plugin.cc
+index 12ab5a57c8dd..bdd0bdabe77f 100644
+--- a/libcc1/libcc1plugin.cc
++++ b/libcc1/libcc1plugin.cc
+@@ -31,6 +31,7 @@
+ #undef PACKAGE_TARNAME
+ #undef PACKAGE_VERSION
+ 
++#define INCLUDE_MEMORY
+ #include "gcc-plugin.h"
+ #include "system.h"
+ #include "coretypes.h"
+diff --git a/libcc1/libcp1plugin.cc b/libcc1/libcp1plugin.cc
+index 83dab7f58b11..e2d5039a0a1f 100644
+--- a/libcc1/libcp1plugin.cc
++++ b/libcc1/libcp1plugin.cc
+@@ -32,6 +32,7 @@
+ #undef PACKAGE_TARNAME
+ #undef PACKAGE_VERSION
+ 
++#define INCLUDE_MEMORY
+ #include "gcc-plugin.h"
+ #include "system.h"
+ #include "coretypes.h"
diff --git a/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch b/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
new file mode 100644
index 000000000000..89bd053d6d04
--- /dev/null
+++ b/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
@@ -0,0 +1,115 @@
+From 49d508065bdd36fb1a9b6aad9666b1edb5e06474 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <siarheit@google.com>
+Date: Mon, 27 Jun 2022 23:42:44 +0100
+Subject: [PATCH] jit: avoid calloc() poisoning on musl [PR106102]
+
+On musl <pthread.h> uses calloc() (via <sched.h>). jit/ includes
+it directly and exposes use of poisoned calloc():
+
+    /build/build/./prev-gcc/xg++ ... ../../gcc-13-20220626/gcc/jit/jit-playback.cc
+    make[3]: *** [Makefile:1143: jit/libgccjit.o] Error 1
+    make[3]: *** Waiting for unfinished jobs....
+    In file included from /<<NIX>>/musl-1.2.3-dev/include/pthread.h:30,
+                     from ../../gcc-13-20220626/gcc/jit/jit-playback.cc:44:
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:84:7: error: attempt to use poisoned "calloc"
+       84 | void *calloc(size_t, size_t);
+          |       ^
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:124:36: error: attempt to use poisoned "calloc"
+      124 | #define CPU_ALLOC(n) ((cpu_set_t *)calloc(1,CPU_ALLOC_SIZE(n)))
+          |                                    ^
+
+The change moves <pthread.h> inclusion to "system.h" under new
+INCLUDE_PTHREAD_H guard and uses this mechanism in libgccjit.
+
+gcc/
+
+	PR c++/106102
+	* system.h: Introduce INCLUDE_PTHREAD_H macros to include <pthread.h>.
+
+gcc/jit/
+
+	PR c++/106102
+	* jit-playback.cc: Include <pthread.h> via "system.h" to avoid calloc()
+	poisoning.
+	* jit-recording.cc: Ditto.
+	* libgccjit.cc: Ditto.
+---
+ gcc/jit/jit-playback.cc  | 3 +--
+ gcc/jit/jit-recording.cc | 2 +-
+ gcc/jit/libgccjit.cc     | 2 +-
+ gcc/system.h             | 4 ++++
+ 4 files changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/gcc/jit/jit-playback.cc b/gcc/jit/jit-playback.cc
+index 6be6bdf8dea5..79714132b91a 100644
+--- a/gcc/jit/jit-playback.cc
++++ b/gcc/jit/jit-playback.cc
+@@ -19,6 +19,7 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "target.h"
+@@ -41,8 +42,6 @@ along with GCC; see the file COPYING3.  If not see
+ #include "diagnostic.h"
+ #include "stmt.h"
+ 
+-#include <pthread.h>
+-
+ #include "jit-playback.h"
+ #include "jit-result.h"
+ #include "jit-builtins.h"
+diff --git a/gcc/jit/jit-recording.cc b/gcc/jit/jit-recording.cc
+index 697dee66e733..f78daed2d71a 100644
+--- a/gcc/jit/jit-recording.cc
++++ b/gcc/jit/jit-recording.cc
+@@ -19,13 +19,13 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "tm.h"
+ #include "pretty-print.h"
+ #include "toplev.h"
+ 
+-#include <pthread.h>
+ 
+ #include "jit-builtins.h"
+ #include "jit-recording.h"
+diff --git a/gcc/jit/libgccjit.cc b/gcc/jit/libgccjit.cc
+index 0e76097b4bac..ca862662777e 100644
+--- a/gcc/jit/libgccjit.cc
++++ b/gcc/jit/libgccjit.cc
+@@ -19,12 +19,12 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "timevar.h"
+ #include "typed-splay-tree.h"
+ #include "cppbuiltin.h"
+-#include <pthread.h>
+ 
+ #include "libgccjit.h"
+ #include "jit-recording.h"
+diff --git a/gcc/system.h b/gcc/system.h
+index 67158b70c789..f8d42ff68150 100644
+--- a/gcc/system.h
++++ b/gcc/system.h
+@@ -753,6 +753,10 @@ extern int vsnprintf (char *, size_t, const char *, va_list);
+ #endif
+ #endif
+ 
++#ifdef INCLUDE_PTHREAD_H
++#include <pthread.h>
++#endif
++
+ #ifdef INCLUDE_ISL
+ #ifdef HAVE_isl
+ #include <isl/options.h>
diff --git a/srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch b/srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch
new file mode 100644
index 000000000000..044a4fc29514
--- /dev/null
+++ b/srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch
@@ -0,0 +1,32 @@
+From f35d65517a59565758107c5b1a51a5fa382f8d1a Mon Sep 17 00:00:00 2001
+From: Ian Lance Taylor <iant@golang.org>
+Date: Tue, 12 Jul 2022 19:42:43 -0700
+Subject: [PATCH] libgo: don't include <linux/fs.h> when building
+ gen-sysinfo.go
+
+Removing this doesn't change anything at least with glibc 2.33.
+The include was added in https://go.dev/cl/6100049 but it's not
+clear why.
+
+Fixes PR go/106266
+
+Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/417294
+---
+ gcc/go/gofrontend/MERGE | 2 +-
+ libgo/sysinfo.c         | 3 ---
+ 2 files changed, 1 insertion(+), 4 deletions(-)
+
+diff --git a/libgo/sysinfo.c b/libgo/sysinfo.c
+index a4259c02ded4..fc0210992faa 100644
+--- a/libgo/sysinfo.c
++++ b/libgo/sysinfo.c
+@@ -158,9 +158,6 @@
+ #if defined(HAVE_LINUX_ETHER_H)
+ #include <linux/ether.h>
+ #endif
+-#if defined(HAVE_LINUX_FS_H)
+-#include <linux/fs.h>
+-#endif
+ #if defined(HAVE_LINUX_REBOOT_H)
+ #include <linux/reboot.h>
+ #endif
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..78a2ce35875d 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,9 +3,10 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
  
  #  ifndef _ABIN32
+
diff --git a/srcpkgs/gcc/patches/sanitizer-fix-compat-glibc-2.36.patch b/srcpkgs/gcc/patches/sanitizer-fix-compat-glibc-2.36.patch
new file mode 100644
index 000000000000..851cde0e2077
--- /dev/null
+++ b/srcpkgs/gcc/patches/sanitizer-fix-compat-glibc-2.36.patch
@@ -0,0 +1,39 @@
+From 2701442d0cf6292f6624443c15813d6d1a3562fe Mon Sep 17 00:00:00 2001
+From: Martin Liska <mliska@suse.cz>
+Date: Mon, 11 Jul 2022 22:03:14 +0200
+Subject: [PATCH] libsanitizer: cherry-pick 9cf13067cb5088626ba7 from upstream
+
+9cf13067cb5088626ba7ee1ec4c42ec59c7995a0 [sanitizer] Remove #include <linux/fs.h> to resolve fsconfig_command/mount_attr conflict with glibc 2.36
+---
+ .../sanitizer_platform_limits_posix.cpp                | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
+index 8ed3e92d2704..97fd07acf9d4 100644
+--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -73,7 +73,9 @@
+ #include <sys/vt.h>
+ #include <linux/cdrom.h>
+ #include <linux/fd.h>
++#if SANITIZER_ANDROID
+ #include <linux/fs.h>
++#endif
+ #include <linux/hdreg.h>
+ #include <linux/input.h>
+ #include <linux/ioctl.h>
+@@ -869,10 +871,10 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
+   unsigned IOCTL_EVIOCGPROP = IOCTL_NOT_PRESENT;
+   unsigned IOCTL_EVIOCSKEYCODE_V2 = IOCTL_NOT_PRESENT;
+ #endif
+-  unsigned IOCTL_FS_IOC_GETFLAGS = FS_IOC_GETFLAGS;
+-  unsigned IOCTL_FS_IOC_GETVERSION = FS_IOC_GETVERSION;
+-  unsigned IOCTL_FS_IOC_SETFLAGS = FS_IOC_SETFLAGS;
+-  unsigned IOCTL_FS_IOC_SETVERSION = FS_IOC_SETVERSION;
++  unsigned IOCTL_FS_IOC_GETFLAGS = _IOR('f', 1, long);
++  unsigned IOCTL_FS_IOC_GETVERSION = _IOR('v', 1, long);
++  unsigned IOCTL_FS_IOC_SETFLAGS = _IOW('f', 2, long);
++  unsigned IOCTL_FS_IOC_SETVERSION = _IOW('v', 2, long);
+   unsigned IOCTL_GIO_CMAP = GIO_CMAP;
+   unsigned IOCTL_GIO_FONT = GIO_FONT;
+   unsigned IOCTL_GIO_UNIMAP = GIO_UNIMAP;
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..32ee79e32f0d 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,15 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
+version=12.1.0
+revision=1
 _patchver="${version%pre*}"
 _minorver="${_patchver%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 wrksrc=gcc-${version/pre/_pre}
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +19,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -396,7 +393,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}

From 486af38e9c930ddbf16ffabcdf8c86c5af048112 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 03/44] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      |  6 ++--
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..08e35d466a44 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From c7db824e32a7e6eee487cb6a357d2ed044cec310 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 04/44] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 1a4e1ca3d594..b04268908c2e 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="q66 <daniel@octaforge.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From ece27c5b43de5e0d89f09fcd6c266ae3ef977d9e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 05/44] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 3 files changed, 55 insertions(+), 353 deletions(-)
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index 776f9b195309..46c0680d55dd 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From 0e42c4946ca41d67109d0b041b1d228badc21d45 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 16:22:03 -0700
Subject: [PATCH 06/44] llvm12: fix build for glibc 2.36

---
 .../compiler-rt-sanitizer-glibc-2.36.patch    | 59 +++++++++++++++++++
 .../compiler-rt-sanitizer-glibc-2.36.patch    | 59 +++++++++++++++++++
 2 files changed, 118 insertions(+)
 create mode 100644 srcpkgs/llvm12/compiler-rt-sanitizer-glibc-2.36.patch
 create mode 100644 srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch

diff --git a/srcpkgs/llvm12/compiler-rt-sanitizer-glibc-2.36.patch b/srcpkgs/llvm12/compiler-rt-sanitizer-glibc-2.36.patch
new file mode 100644
index 000000000000..e5f24dab8935
--- /dev/null
+++ b/srcpkgs/llvm12/compiler-rt-sanitizer-glibc-2.36.patch
@@ -0,0 +1,59 @@
+From 9cf13067cb5088626ba7ee1ec4c42ec59c7995a0 Mon Sep 17 00:00:00 2001
+From: Fangrui Song <i@maskray.me>
+Date: Mon, 11 Jul 2022 12:53:34 -0700
+Subject: [PATCH] [sanitizer] Remove #include <linux/fs.h> to resolve
+ fsconfig_command/mount_attr conflict with glibc 2.36
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+It is generally not a good idea to mix usage of glibc headers and Linux UAPI
+headers (https://sourceware.org/glibc/wiki/Synchronizing_Headers). In glibc
+since 7eae6a91e9b1670330c9f15730082c91c0b1d570 (milestone: 2.36), sys/mount.h
+defines `fsconfig_command` which conflicts with linux/mount.h:
+
+    .../usr/include/linux/mount.h:95:6: error: redeclaration of ‘enum fsconfig_command’
+
+Remove #include <linux/fs.h> which pulls in linux/mount.h. Expand its 4 macros manually.
+Android sys/mount.h doesn't define BLKBSZGET and it still needs linux/fs.h.
+In the long term we should move Linux specific definitions to sanitizer_platform_limits_linux.cpp
+but this commit is easy to cherry pick into older compiler-rt releases.
+
+Fix https://github.com/llvm/llvm-project/issues/56421
+
+Reviewed By: #sanitizers, vitalybuka, zatrazz
+
+Differential Revision: https://reviews.llvm.org/D129471
+---
+ .../sanitizer_platform_limits_posix.cpp                | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+index 4bd425435d56d..3a94b260686f1 100644
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -73,7 +73,9 @@
+ #include <sys/vt.h>
+ #include <linux/cdrom.h>
+ #include <linux/fd.h>
++#if SANITIZER_ANDROID
+ #include <linux/fs.h>
++#endif
+ #include <linux/hdreg.h>
+ #include <linux/input.h>
+ #include <linux/ioctl.h>
+@@ -876,10 +878,10 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
+   unsigned IOCTL_EVIOCGPROP = IOCTL_NOT_PRESENT;
+   unsigned IOCTL_EVIOCSKEYCODE_V2 = IOCTL_NOT_PRESENT;
+ #endif
+-  unsigned IOCTL_FS_IOC_GETFLAGS = FS_IOC_GETFLAGS;
+-  unsigned IOCTL_FS_IOC_GETVERSION = FS_IOC_GETVERSION;
+-  unsigned IOCTL_FS_IOC_SETFLAGS = FS_IOC_SETFLAGS;
+-  unsigned IOCTL_FS_IOC_SETVERSION = FS_IOC_SETVERSION;
++  unsigned IOCTL_FS_IOC_GETFLAGS = _IOR('f', 1, long);
++  unsigned IOCTL_FS_IOC_GETVERSION = _IOR('v', 1, long);
++  unsigned IOCTL_FS_IOC_SETFLAGS = _IOW('f', 2, long);
++  unsigned IOCTL_FS_IOC_SETVERSION = _IOW('v', 2, long);
+   unsigned IOCTL_GIO_CMAP = GIO_CMAP;
+   unsigned IOCTL_GIO_FONT = GIO_FONT;
+   unsigned IOCTL_GIO_UNIMAP = GIO_UNIMAP;
diff --git a/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch b/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch
new file mode 100644
index 000000000000..e5f24dab8935
--- /dev/null
+++ b/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch
@@ -0,0 +1,59 @@
+From 9cf13067cb5088626ba7ee1ec4c42ec59c7995a0 Mon Sep 17 00:00:00 2001
+From: Fangrui Song <i@maskray.me>
+Date: Mon, 11 Jul 2022 12:53:34 -0700
+Subject: [PATCH] [sanitizer] Remove #include <linux/fs.h> to resolve
+ fsconfig_command/mount_attr conflict with glibc 2.36
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+It is generally not a good idea to mix usage of glibc headers and Linux UAPI
+headers (https://sourceware.org/glibc/wiki/Synchronizing_Headers). In glibc
+since 7eae6a91e9b1670330c9f15730082c91c0b1d570 (milestone: 2.36), sys/mount.h
+defines `fsconfig_command` which conflicts with linux/mount.h:
+
+    .../usr/include/linux/mount.h:95:6: error: redeclaration of ‘enum fsconfig_command’
+
+Remove #include <linux/fs.h> which pulls in linux/mount.h. Expand its 4 macros manually.
+Android sys/mount.h doesn't define BLKBSZGET and it still needs linux/fs.h.
+In the long term we should move Linux specific definitions to sanitizer_platform_limits_linux.cpp
+but this commit is easy to cherry pick into older compiler-rt releases.
+
+Fix https://github.com/llvm/llvm-project/issues/56421
+
+Reviewed By: #sanitizers, vitalybuka, zatrazz
+
+Differential Revision: https://reviews.llvm.org/D129471
+---
+ .../sanitizer_platform_limits_posix.cpp                | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+index 4bd425435d56d..3a94b260686f1 100644
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -73,7 +73,9 @@
+ #include <sys/vt.h>
+ #include <linux/cdrom.h>
+ #include <linux/fd.h>
++#if SANITIZER_ANDROID
+ #include <linux/fs.h>
++#endif
+ #include <linux/hdreg.h>
+ #include <linux/input.h>
+ #include <linux/ioctl.h>
+@@ -876,10 +878,10 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
+   unsigned IOCTL_EVIOCGPROP = IOCTL_NOT_PRESENT;
+   unsigned IOCTL_EVIOCSKEYCODE_V2 = IOCTL_NOT_PRESENT;
+ #endif
+-  unsigned IOCTL_FS_IOC_GETFLAGS = FS_IOC_GETFLAGS;
+-  unsigned IOCTL_FS_IOC_GETVERSION = FS_IOC_GETVERSION;
+-  unsigned IOCTL_FS_IOC_SETFLAGS = FS_IOC_SETFLAGS;
+-  unsigned IOCTL_FS_IOC_SETVERSION = FS_IOC_SETVERSION;
++  unsigned IOCTL_FS_IOC_GETFLAGS = _IOR('f', 1, long);
++  unsigned IOCTL_FS_IOC_GETVERSION = _IOR('v', 1, long);
++  unsigned IOCTL_FS_IOC_SETFLAGS = _IOW('f', 2, long);
++  unsigned IOCTL_FS_IOC_SETVERSION = _IOW('v', 2, long);
+   unsigned IOCTL_GIO_CMAP = GIO_CMAP;
+   unsigned IOCTL_GIO_FONT = GIO_FONT;
+   unsigned IOCTL_GIO_UNIMAP = GIO_UNIMAP;

From 8c3ea9f84b1fcaf00fc627aac5850af29dd783f7 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 17:21:40 -0700
Subject: [PATCH 07/44] m4: update to 1.4.19.

---
 srcpkgs/m4/patches/fix-glibc-2.27.patch | 167 ------------------------
 srcpkgs/m4/template                     |  12 +-
 2 files changed, 6 insertions(+), 173 deletions(-)
 delete mode 100644 srcpkgs/m4/patches/fix-glibc-2.27.patch

diff --git a/srcpkgs/m4/patches/fix-glibc-2.27.patch b/srcpkgs/m4/patches/fix-glibc-2.27.patch
deleted file mode 100644
index 59d33cff164d..000000000000
--- a/srcpkgs/m4/patches/fix-glibc-2.27.patch
+++ /dev/null
@@ -1,167 +0,0 @@
-From 4af4a4a71827c0bc5e0ec67af23edef4f15cee8e Mon Sep 17 00:00:00 2001
-From: Paul Eggert <eggert@cs.ucla.edu>
-Date: Mon, 5 Mar 2018 10:56:29 -0800
-Subject: [PATCH] fflush: adjust to glibc 2.28 libio.h removal
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Problem reported by Daniel P. Berrangé in:
-https://lists.gnu.org/r/bug-gnulib/2018-03/msg00000.html
-* lib/fbufmode.c (fbufmode):
-* lib/fflush.c (clear_ungetc_buffer_preserving_position)
-(disable_seek_optimization, rpl_fflush):
-* lib/fpending.c (__fpending):
-* lib/fpurge.c (fpurge):
-* lib/freadable.c (freadable):
-* lib/freadahead.c (freadahead):
-* lib/freading.c (freading):
-* lib/freadptr.c (freadptr):
-* lib/freadseek.c (freadptrinc):
-* lib/fseeko.c (fseeko):
-* lib/fseterr.c (fseterr):
-* lib/fwritable.c (fwritable):
-* lib/fwriting.c (fwriting):
-Check _IO_EOF_SEEN instead of _IO_ftrylockfile.
-* lib/stdio-impl.h (_IO_IN_BACKUP) [_IO_EOF_SEEN]:
-Define if not already defined.
-
-[yann.morin.1998@free.fr: partially backport from upstream gnulib]
-Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
-
----
- lib/fflush.c     |  6 +++---
- lib/fpending.c   |  2 +-
- lib/fpurge.c     |  2 +-
- lib/freadahead.c |  2 +-
- lib/freading.c   |  2 +-
- lib/fseeko.c     |  4 ++--
- lib/stdio-impl.h |  6 ++++++
- 7 files changed, 15 insertions(+), 9 deletions(-)
-
-diff --git a/lib/fflush.c b/build-aux/gnulib/lib/fflush.c
-index 983ade0ff..a6edfa105 100644
---- a/lib/fflush.c
-+++ b/lib/fflush.c
-@@ -33,7 +33,7 @@
- #undef fflush
- 
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- 
- /* Clear the stream's ungetc buffer, preserving the value of ftello (fp).  */
- static void
-@@ -72,7 +72,7 @@ clear_ungetc_buffer (FILE *fp)
- 
- #endif
- 
--#if ! (defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
-+#if ! (defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
- 
- # if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT
- /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
-@@ -148,7 +148,7 @@ rpl_fflush (FILE *stream)
-   if (stream == NULL || ! freading (stream))
-     return fflush (stream);
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- 
-   clear_ungetc_buffer_preserving_position (stream);
- 
-diff --git a/lib/fpending.c b/build-aux/gnulib/lib/fpending.c
-index c84e3a5b4..789f50e4e 100644
---- a/lib/fpending.c
-+++ b/lib/fpending.c
-@@ -32,7 +32,7 @@ __fpending (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   return fp->_IO_write_ptr - fp->_IO_write_base;
- #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
-   /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
-diff --git a/lib/fpurge.c b/build-aux/gnulib/lib/fpurge.c
-index b1d417c7a..3aedcc373 100644
---- a/lib/fpurge.c
-+++ b/lib/fpurge.c
-@@ -62,7 +62,7 @@ fpurge (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   fp->_IO_read_end = fp->_IO_read_ptr;
-   fp->_IO_write_ptr = fp->_IO_write_base;
-   /* Avoid memory leak when there is an active ungetc buffer.  */
-diff --git a/lib/freadahead.c b/build-aux/gnulib/lib/freadahead.c
-index c2ecb5b28..23ec76ee5 100644
---- a/lib/freadahead.c
-+++ b/lib/freadahead.c
-@@ -30,7 +30,7 @@ extern size_t __sreadahead (FILE *);
- size_t
- freadahead (FILE *fp)
- {
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   if (fp->_IO_write_ptr > fp->_IO_write_base)
-     return 0;
-   return (fp->_IO_read_end - fp->_IO_read_ptr)
-diff --git a/lib/freading.c b/build-aux/gnulib/lib/freading.c
-index 73c28acdd..c24d0c88a 100644
---- a/lib/freading.c
-+++ b/lib/freading.c
-@@ -31,7 +31,7 @@ freading (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   return ((fp->_flags & _IO_NO_WRITES) != 0
-           || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0
-               && fp->_IO_read_base != NULL));
-diff --git a/lib/fseeko.c b/build-aux/gnulib/lib/fseeko.c
-index 0101ab55f..193f4e8ce 100644
---- a/lib/fseeko.c
-+++ b/lib/fseeko.c
-@@ -47,7 +47,7 @@ fseeko (FILE *fp, off_t offset, int whence)
- #endif
- 
-   /* These tests are based on fpurge.c.  */
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   if (fp->_IO_read_end == fp->_IO_read_ptr
-       && fp->_IO_write_ptr == fp->_IO_write_base
-       && fp->_IO_save_base == NULL)
-@@ -123,7 +123,7 @@ fseeko (FILE *fp, off_t offset, int whence)
-           return -1;
-         }
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-       fp->_flags &= ~_IO_EOF_SEEN;
-       fp->_offset = pos;
- #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
-diff --git a/lib/stdio-impl.h b/build-aux/gnulib/lib/stdio-impl.h
-index 78d896e9f..05c5752a2 100644
---- a/lib/stdio-impl.h
-+++ b/lib/stdio-impl.h
-@@ -18,6 +18,12 @@
-    the same implementation of stdio extension API, except that some fields
-    have different naming conventions, or their access requires some casts.  */
- 
-+/* Glibc 2.28 made _IO_IN_BACKUP private.  For now, work around this
-+   problem by defining it ourselves.  FIXME: Do not rely on glibc
-+   internals.  */
-+#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN
-+# define _IO_IN_BACKUP 0x100
-+#endif
- 
- /* BSD stdio derived implementations.  */
- 
--- 
-2.14.1
-
-
diff --git a/srcpkgs/m4/template b/srcpkgs/m4/template
index 78f3dae6184a..762593d883bd 100644
--- a/srcpkgs/m4/template
+++ b/srcpkgs/m4/template
@@ -1,17 +1,17 @@
 # Template file for 'm4'
 pkgname=m4
-version=1.4.18
-revision=2
+version=1.4.19
+revision=1
 bootstrap=yes
-replaces="chroot-m4>=0"
 build_style=gnu-configure
 configure_args="--enable-changeword --enable-threads"
 short_desc="GNU version of UNIX m4 macro language processor"
-homepage="https://www.gnu.org/software/m4/"
-license="GPL-3.0-or-later"
 maintainer="Enno Boland <gottox@voidlinux.org>"
+license="GPL-3.0-or-later"
+homepage="https://www.gnu.org/software/m4/"
 distfiles="${GNU_SITE}/${pkgname}/${pkgname}-${version}.tar.xz"
-checksum=f2c1e86ca0a404ff281631bdc8377638992744b175afb806e25871a24a934e07
+checksum=63aede5c6d33b6d9b13511cd0be2cac046f2e70fd0a07aa9573a04a82783af96
+replaces="chroot-m4>=0"
 
 if [ "$XBPS_TARGET_LIBC" = musl ]; then
 	export ac_cv_lib_error_at_line=no

From 27290af1df19ab2278c56b23daff61c6c50124d6 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 22:57:59 -0700
Subject: [PATCH 08/44] btrfs-progs: update to 5.19.

---
 srcpkgs/btrfs-progs/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/btrfs-progs/template b/srcpkgs/btrfs-progs/template
index f6c53d8587e1..292d5110106b 100644
--- a/srcpkgs/btrfs-progs/template
+++ b/srcpkgs/btrfs-progs/template
@@ -1,6 +1,6 @@
 # Template file for 'btrfs-progs'
 pkgname=btrfs-progs
-version=5.18.1
+version=5.19
 revision=1
 wrksrc="${pkgname}-v${version}"
 build_style=gnu-configure
@@ -16,7 +16,7 @@ license="GPL-2.0-only, LGPL-2.1-or-later"
 homepage="https://btrfs.wiki.kernel.org/index.php/Main_Page"
 changelog="https://raw.githubusercontent.com/kdave/btrfs-progs/master/CHANGES"
 distfiles="${KERNEL_SITE}/kernel/people/kdave/${pkgname}/${pkgname}-v${version}.tar.xz"
-checksum=6e98a75ccff52e9354daa1ad284c614c490f844273a2fa524cbac9eb841c7255
+checksum=1fbcf06e4b2f80e7a127fd687ed4625a5b74fa674fe212c836ff70e0edfcccf9
 # Most of the tests depend on `mount` and `fallocate` commands, which are not
 # presented in chroot-util-linux
 make_check=no

From a47005ca2ae466a624a1186dc846900769118377 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 14 Aug 2022 19:29:36 -0700
Subject: [PATCH 09/44] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove nopie=yes. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh             |  1 +
 common/environment/build-style/void-cross.sh | 36 +++++++++++++++++++-
 2 files changed, 36 insertions(+), 1 deletion(-)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..c24013755704 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -132,6 +132,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
diff --git a/common/environment/build-style/void-cross.sh b/common/environment/build-style/void-cross.sh
index 62ce9eaa2e4a..4b77c90efc8b 100644
--- a/common/environment/build-style/void-cross.sh
+++ b/common/environment/build-style/void-cross.sh
@@ -1,6 +1,40 @@
 lib32disabled=yes
-nopie=yes
 create_wrksrc=yes
 
 nostrip_files+=" libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a libgmem.a"
+nopie_files+=" /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/go1
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/lto-wrapper
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/plugin/gengtype
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/cc1objplus
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/cc1obj
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/collect2
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/lto1
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/f951
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/cc1
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/gnat1
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/cc1plus
+ /usr/bin/${sourcepkg/cross-}-gcov-dump
+ /usr/bin/${sourcepkg/cross-}-gnatlink
+ /usr/bin/${sourcepkg/cross-}-gnatbind
+ /usr/bin/${sourcepkg/cross-}-gcc
+ /usr/bin/${sourcepkg/cross-}-cpp
+ /usr/bin/${sourcepkg/cross-}-gnatchop
+ /usr/bin/${sourcepkg/cross-}-gfortran
+ /usr/bin/${sourcepkg/cross-}-gccgo
+ /usr/bin/${sourcepkg/cross-}-c++
+ /usr/bin/${sourcepkg/cross-}-lto-dump
+ /usr/bin/${sourcepkg/cross-}-gnatname
+ /usr/bin/${sourcepkg/cross-}-gnatprep
+ /usr/bin/${sourcepkg/cross-}-g++
+ /usr/bin/${sourcepkg/cross-}-gnat
+ /usr/bin/${sourcepkg/cross-}-gcc-ranlib
+ /usr/bin/${sourcepkg/cross-}-gnatkr
+ /usr/bin/${sourcepkg/cross-}-gnatmake
+ /usr/bin/${sourcepkg/cross-}-gcc-${_gcc_version}
+ /usr/bin/${sourcepkg/cross-}-gcc-ar
+ /usr/bin/${sourcepkg/cross-}-gnatclean
+ /usr/bin/${sourcepkg/cross-}-gcov
+ /usr/bin/${sourcepkg/cross-}-gnatls
+ /usr/bin/${sourcepkg/cross-}-gcc-nm
+ /usr/bin/${sourcepkg/cross-}-gcov-tool"

From d1ff6c50bb59eeb466bb720aa96f2300e4886b78 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:08:52 -0700
Subject: [PATCH 10/44] openssh: suppress werror on gcc12

---
 srcpkgs/openssh/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/openssh/template b/srcpkgs/openssh/template
index 02a2dec35f42..6e8e343a9dca 100644
--- a/srcpkgs/openssh/template
+++ b/srcpkgs/openssh/template
@@ -40,7 +40,7 @@ if [ "$build_option_ldns" -a -z "$build_option_ssl" ]; then
 	broken="option 'ldns' requires option 'ssl'"
 fi
 
-CFLAGS="-Wno-format-truncation -Wno-stringop-truncation"
+CFLAGS="-Wno-format-truncation -Wno-stringop-truncation -Wno-error=maybe-uninitialized"
 
 case $XBPS_TARGET_MACHINE in
 	i686-musl)

From 8429d64fec6feb172f1f10727a4d27482449217e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:09:31 -0700
Subject: [PATCH 11/44] linux5.18: update dotconfigs for gcc12

---
 srcpkgs/linux5.18/files/x86_64-dotconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/linux5.18/files/x86_64-dotconfig b/srcpkgs/linux5.18/files/x86_64-dotconfig
index 4e73a3195d40..ea6204868e23 100644
--- a/srcpkgs/linux5.18/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.18/files/x86_64-dotconfig
@@ -512,6 +512,7 @@ CONFIG_RETHUNK=y
 CONFIG_CPU_UNRET_ENTRY=y
 CONFIG_CPU_IBPB_ENTRY=y
 CONFIG_CPU_IBRS_ENTRY=y
+CONFIG_SLS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10060,8 +10061,11 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
 # Memory initialization
 #
 CONFIG_INIT_STACK_NONE=y
+# CONFIG_INIT_STACK_ALL_PATTERN is not set
+# CONFIG_INIT_STACK_ALL_ZERO is not set
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
+# CONFIG_ZERO_CALL_USED_REGS is not set
 # end of Memory initialization
 # end of Kernel hardening options
 # end of Security options
@@ -10538,6 +10542,7 @@ CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
 # CONFIG_UBSAN is not set
 CONFIG_HAVE_ARCH_KCSAN=y
+# CONFIG_KCSAN is not set
 # end of Generic Kernel Debugging Instruments
 
 #

From af7e3566192c075caf26795e54d17d80a083cd10 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 18:00:42 -0700
Subject: [PATCH 12/44] xf86-video-vmware: fix build on gcc12

---
 ...183b3395333d5d4c73e25c2d011748f15eda.patch | 30 +++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch

diff --git a/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch b/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch
new file mode 100644
index 000000000000..ff839f16e628
--- /dev/null
+++ b/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch
@@ -0,0 +1,30 @@
+From 77b8183b3395333d5d4c73e25c2d011748f15eda Mon Sep 17 00:00:00 2001
+From: Rudi Heitbaum <rudi@heitbaum.com>
+Date: Sun, 8 May 2022 03:00:10 +0000
+Subject: [PATCH] vmwgfx: fix missing array notation
+
+ Fixes error identified by gcc-12.1.0 compiler
+
+make
+  CC       libvmwgfx_la-vmwgfx_tex_video.lo
+vmwgfx_tex_video.c: In function 'stop_video':
+vmwgfx_tex_video.c:240:20: error: the comparison will always evaluate as 'true' for the address of 'yuv' will never be NULL [-Werror=address]
+  240 |                if (priv->yuv[i]) {
+      |                    ^~~~
+---
+ vmwgfx/vmwgfx_tex_video.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/vmwgfx/vmwgfx_tex_video.c b/vmwgfx/vmwgfx_tex_video.c
+index acc2b56..480a5f1 100644
+--- a/vmwgfx/vmwgfx_tex_video.c
++++ b/vmwgfx/vmwgfx_tex_video.c
+@@ -237,7 +237,7 @@ stop_video(ScrnInfoPtr pScrn, pointer data, Bool shutdown)
+ 
+        for (i=0; i<3; ++i) {
+ 	   for (j=0; j<2; ++j) {
+-	       if (priv->yuv[i]) {
++	       if (priv->yuv[j][i]) {
+ 		   xa_surface_destroy(priv->yuv[j][i]);
+ 		   priv->yuv[j][i] = NULL;
+ 	       }

From ccfa45ae779abd699428f1da54746e6fad861028 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 18:24:37 -0700
Subject: [PATCH 13/44] doxygen: fix build for gcc 12

---
 srcpkgs/doxygen/patches/compat-gcc12.patch | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100644 srcpkgs/doxygen/patches/compat-gcc12.patch

diff --git a/srcpkgs/doxygen/patches/compat-gcc12.patch b/srcpkgs/doxygen/patches/compat-gcc12.patch
new file mode 100644
index 000000000000..666744a1dceb
--- /dev/null
+++ b/srcpkgs/doxygen/patches/compat-gcc12.patch
@@ -0,0 +1,22 @@
+From 5198966c8d5fec89116d025c74934ac03ea511fa Mon Sep 17 00:00:00 2001
+From: Dimitri van Heesch <doxygen@gmail.com>
+Date: Fri, 6 May 2022 09:55:16 +0200
+Subject: [PATCH] issue #9312: Build: cache.h:53:14: error: 'exchange' is not a
+ member of 'std'
+
+---
+ src/cache.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/cache.h b/src/cache.h
+index 0ff3092ed5..e218eb27d2 100644
+--- a/src/cache.h
++++ b/src/cache.h
+@@ -19,6 +19,7 @@
+ #include <list>
+ #include <unordered_map>
+ #include <mutex>
++#include <utility>
+ #include <ctype.h>
+ 
+ /*! Fixed size cache for value type V using keys of type K.

From f8fbe4f394968cf296670bebea83886505d41984 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 21 Aug 2022 15:12:00 -0700
Subject: [PATCH 14/44] libproxy: update to 0.4.18

---
 srcpkgs/libproxy/template | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/libproxy/template b/srcpkgs/libproxy/template
index d6103007032e..6599dfb69b98 100644
--- a/srcpkgs/libproxy/template
+++ b/srcpkgs/libproxy/template
@@ -1,18 +1,22 @@
 # Template file for 'libproxy'
 pkgname=libproxy
-version=0.4.15
+version=0.4.18
 revision=1
 build_style=cmake
 configure_args="-DWITH_GNOME=0 -DWITH_KDE4=0 -DWITH_MOZJS=0 -DWITH_NM=0
  -DWITH_PERL=0 -DWITH_PYTHON=1 -DWITH_WEBKIT=0"
 hostmakedepends="pkg-config python"
 makedepends="zlib-devel"
-short_desc="A library handling all the details of proxy configuration"
+short_desc="Library handling all the details of proxy configuration"
 maintainer="Orphaned <orphan@voidlinux.org>"
+license="LGPL-2.1-or-later"
 homepage="http://github.com/libproxy/libproxy"
-license="LGPL-2.1"
-distfiles="https://github.com/libproxy/libproxy/archive/${version}.tar.gz>${pkgname}-${version}.tar.gz"
-checksum=18f58b0a0043b6881774187427ead158d310127fc46a1c668ad6d207fb28b4e0
+distfiles="https://github.com/libproxy/libproxy/archive/${version}.tar.gz"
+checksum=0b4a9218d88f6cf9fa25996a3f38329a11f688a9d026141d9d0e966d8fa63837
+
+post_patch() {
+	vsed '/add_test(NAME url-test/d' -i libproxy/test/CMakeLists.txt
+}
 
 libproxy-devel_package() {
 	depends="libproxy>=${version}_${revision}"

From c2097882e451e252c9c2397947f9adaff6067eab Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 21 Aug 2022 17:05:39 -0700
Subject: [PATCH 15/44] exempi: update to 2.6.2

---
 ...f034705fd2d032c81383eee8208fd4eee0ac.patch | 43 -------------------
 srcpkgs/exempi/template                       |  4 +-
 2 files changed, 2 insertions(+), 45 deletions(-)
 delete mode 100644 srcpkgs/exempi/patches/8ed2f034705fd2d032c81383eee8208fd4eee0ac.patch

diff --git a/srcpkgs/exempi/patches/8ed2f034705fd2d032c81383eee8208fd4eee0ac.patch b/srcpkgs/exempi/patches/8ed2f034705fd2d032c81383eee8208fd4eee0ac.patch
deleted file mode 100644
index 2696793cec09..000000000000
--- a/srcpkgs/exempi/patches/8ed2f034705fd2d032c81383eee8208fd4eee0ac.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From 8ed2f034705fd2d032c81383eee8208fd4eee0ac Mon Sep 17 00:00:00 2001
-From: Victor Rodriguez <victor.rodriguez.bahena@intel.com>
-Date: Sat, 18 Aug 2018 13:54:55 +0000
-Subject: [PATCH] Issue #9 - Fix null-pointer-dereference (CVE-2018-12648)
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-The WEBP::GetLE32 function in
-XMPFiles/source/FormatSupport/WEBP_Support.hpp in Exempi 2.4.5 has a
-NULL pointer dereference.
-
-https://bugs.freedesktop.org/show_bug.cgi?id=106981
-https://gitlab.freedesktop.org/libopenraw/exempi/issues/9
-
-Signed-off-by: Victor Rodriguez <victor.rodriguez.bahena@intel.com>
-Signed-off-by: Hubert Figuière <hub@figuiere.net>
----
- XMPFiles/source/FormatSupport/WEBP_Support.cpp | 8 +++++---
- 1 file changed, 5 insertions(+), 3 deletions(-)
-
-diff --git a/XMPFiles/source/FormatSupport/WEBP_Support.cpp b/XMPFiles/source/FormatSupport/WEBP_Support.cpp
-index ffaf220..4fe705b 100644
---- a/XMPFiles/source/FormatSupport/WEBP_Support.cpp
-+++ b/XMPFiles/source/FormatSupport/WEBP_Support.cpp
-@@ -160,9 +160,11 @@ bool VP8XChunk::xmp()
- }
- void VP8XChunk::xmp(bool hasXMP)
- {
--    XMP_Uns32 flags = GetLE32(&this->data[0]);
--    flags ^= (-hasXMP ^ flags) & (1 << XMP_FLAG_BIT);
--    PutLE32(&this->data[0], flags);
-+    if (&this->data[0] != NULL) {
-+        XMP_Uns32 flags = GetLE32(&this->data[0]);
-+        flags ^= (-hasXMP ^ flags) & (1 << XMP_FLAG_BIT);
-+        PutLE32(&this->data[0], flags);
-+    }
- }
- 
- Container::Container(WEBP_MetaHandler* handler) : Chunk(NULL, handler)
--- 
-2.18.0
-
diff --git a/srcpkgs/exempi/template b/srcpkgs/exempi/template
index 14753617953a..d664f7dc4d80 100644
--- a/srcpkgs/exempi/template
+++ b/srcpkgs/exempi/template
@@ -1,6 +1,6 @@
 # Template file for 'exempi'
 pkgname=exempi
-version=2.5.0
+version=2.6.2
 revision=1
 build_style=gnu-configure
 configure_args="--with-boost=${XBPS_CROSS_BASE}/usr --disable-static --disable-unittest"
@@ -10,7 +10,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="BSD-3-Clause"
 homepage="https://libopenraw.freedesktop.org/wiki/Exempi"
 distfiles="https://libopenraw.freedesktop.org/download/exempi-${version}.tar.bz2"
-checksum=dc82fc24c0540a44a63fa4ad21775d24e00e63f1dedd3e2ae6f7aa27583b711b
+checksum=4d17d4c93df2a95da3e3172c45b7a5bf317dd31dafd1c7a340169728c7089d1d
 
 post_install() {
 	vlicense COPYING

From b1fcfd8cd407a511713e979a38c4fa5e5e73ef79 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 21 Aug 2022 21:36:03 -0700
Subject: [PATCH 16/44] plymouth: update to 22.02.122

---
 srcpkgs/plymouth/patches/fix-glibc-2.36.patch | 30 +++++++++++++++++++
 srcpkgs/plymouth/template                     |  4 +--
 2 files changed, 32 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/plymouth/patches/fix-glibc-2.36.patch

diff --git a/srcpkgs/plymouth/patches/fix-glibc-2.36.patch b/srcpkgs/plymouth/patches/fix-glibc-2.36.patch
new file mode 100644
index 000000000000..2f1e43875cfb
--- /dev/null
+++ b/srcpkgs/plymouth/patches/fix-glibc-2.36.patch
@@ -0,0 +1,30 @@
+From 5f1e43c00039a7fe1fff768b91a05a695fb4a53d Mon Sep 17 00:00:00 2001
+From: Ray Strode <rstrode@redhat.com>
+Date: Wed, 3 Aug 2022 15:23:33 -0400
+Subject: [PATCH] ply-utils: Drop linux/fs.h include
+
+It was needed long ago for a function we no longer even have.
+
+Now it's causing compile errors on Fedora 37 because it's conflicting
+with sys/mount.h.
+
+This commit drops it.
+---
+ src/libply/ply-utils.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/src/libply/ply-utils.c b/src/libply/ply-utils.c
+index c7b165e9..219e2e77 100644
+--- a/src/libply/ply-utils.c
++++ b/src/libply/ply-utils.c
+@@ -46,7 +46,6 @@
+ #include <sys/user.h>
+ #include <sys/wait.h>
+ #include <time.h>
+-#include <linux/fs.h>
+ #include <linux/vt.h>
+ 
+ #include <dlfcn.h>
+-- 
+GitLab
+
diff --git a/srcpkgs/plymouth/template b/srcpkgs/plymouth/template
index 17f801fc5315..442ab58a99cd 100644
--- a/srcpkgs/plymouth/template
+++ b/srcpkgs/plymouth/template
@@ -1,6 +1,6 @@
 # Template file for 'plymouth'
 pkgname=plymouth
-version=0.9.5
+version=22.02.122
 revision=1
 build_style=gnu-configure
 configure_args="--with-system-root-install=no \
@@ -18,7 +18,7 @@ maintainer="William OD <obirik2005@gmail.com>"
 license="GPL-2.0-or-later"
 homepage="https://www.freedesktop.org/wiki/Software/Plymouth/"
 distfiles="${FREEDESKTOP_SITE}/plymouth/releases/$pkgname-$version.tar.xz"
-checksum=ecae257f351d098340542a5bc06de029404c24dcee87e6ebb2abd5ef117fce86
+checksum=100551442221033ce868c447ad6c74d831d209c18ae232b98ae0207e34eadaeb
 
 build_options="gtk3 pango"
 build_options_default="gtk3 pango"

From 096bd8f8b8137493d908e36be1b4b648ff769e76 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 21 Aug 2022 21:37:00 -0700
Subject: [PATCH 17/44] openjdk7-bootstrap: fix build for gcc12

---
 .../files/dist_patches_glibc.txt              |  1 +
 .../files/dist_patches_musl.txt               |  1 +
 .../icedtea-pointer-comparison-gcc12.patch    | 31 +++++++++++++++++++
 3 files changed, 33 insertions(+)
 create mode 100644 srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch

diff --git a/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt b/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt
index c76c56855441..8061756dfc0c 100644
--- a/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt
+++ b/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt
@@ -6,3 +6,4 @@ icedtea-jdk-no-soname.patch
 icedtea-jdk-xattr.patch
 icedtea-jdk-sysctl_h.patch
 icedtea-cpio.patch
+icedtea-pointer-comparison-gcc12.patch
diff --git a/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt b/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt
index 21812517c7c2..8b35d9c46989 100644
--- a/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt
+++ b/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt
@@ -11,3 +11,4 @@ icedtea-jdk-musl.patch
 icedtea-jdk-no-soname.patch
 icedtea-jdk-xattr.patch
 icedtea-cpio.patch
+icedtea-pointer-comparison-gcc12.patch
diff --git a/srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch b/srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch
new file mode 100644
index 000000000000..c809553443e7
--- /dev/null
+++ b/srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch
@@ -0,0 +1,31 @@
+--- openjdk.orig/hotspot/src/share/vm/opto/lcm.cpp
++++ openjdk/hotspot/src/share/vm/opto/lcm.cpp
+@@ -60,7 +60,7 @@
+ // Check whether val is not-null-decoded compressed oop,
+ // i.e. will grab into the base of the heap if it represents NULL.
+ static bool accesses_heap_base_zone(Node *val) {
+-  if (Universe::narrow_oop_base() > 0) { // Implies UseCompressedOops.
++  if (Universe::narrow_oop_base() > (address)0) { // Implies UseCompressedOops.
+     if (val && val->is_Mach()) {
+       if (val->as_Mach()->ideal_Opcode() == Op_DecodeN) {
+         // This assumes all Decodes with TypePtr::NotNull are matched to nodes that
+--- openjdk.orig/hotspot/src/share/vm/runtime/virtualspace.cpp
++++ openjdk/hotspot/src/share/vm/runtime/virtualspace.cpp
+@@ -527,7 +527,7 @@ ReservedHeapSpace::ReservedHeapSpace(siz
+                 (UseCompressedOops && (Universe::narrow_oop_base() != NULL) &&
+                  Universe::narrow_oop_use_implicit_null_checks()) ?
+                   lcm(os::vm_page_size(), alignment) : 0) {
+-  if (base() > 0) {
++  if (base() > (char*)0) {
+     MemTracker::record_virtual_memory_type((address)base(), mtJavaHeap);
+   }
+ 
+@@ -546,7 +546,7 @@ ReservedHeapSpace::ReservedHeapSpace(con
+                 (UseCompressedOops && (Universe::narrow_oop_base() != NULL) &&
+                  Universe::narrow_oop_use_implicit_null_checks()) ?
+                   lcm(os::vm_page_size(), prefix_align) : 0) {
+-  if (base() > 0) {
++  if (base() > (char*)0) {
+     MemTracker::record_virtual_memory_type((address)base(), mtJavaHeap);
+   }
+ 

From 6048ebd223a774b9899ff9acbb082874f322ac67 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 14:45:28 -0700
Subject: [PATCH 18/44] libsasl: fix build for libtool 2.4.7

---
 srcpkgs/libsasl/template | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/libsasl/template b/srcpkgs/libsasl/template
index a8817042f843..a2993b39f4a1 100644
--- a/srcpkgs/libsasl/template
+++ b/srcpkgs/libsasl/template
@@ -19,6 +19,7 @@ distfiles="https://github.com/cyrusimap/cyrus-sasl/releases/download/cyrus-sasl-
 checksum=26866b1549b00ffd020f188a43c258017fa1c382b3ddadd8201536f72efb05d5
 
 pre_configure() {
+	rm -f m4/ltversion.m4
 	autoreconf -fi
 }
 

From 83b67d39f7c421d578cbb0a7e60d6689effe9dc7 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:08 -0700
Subject: [PATCH 19/44] subversion: fix build for libtool 2.4.7

---
 srcpkgs/subversion/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion/template b/srcpkgs/subversion/template
index 8ad178264942..3f1c9e254e61 100644
--- a/srcpkgs/subversion/template
+++ b/srcpkgs/subversion/template
@@ -57,7 +57,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From 9ef85fdaf04170677f5bbd69fed0a96dbc58757c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:38 -0700
Subject: [PATCH 20/44] subversion-kwallet-auth: fix build for libtool 2.4.7

---
 srcpkgs/subversion-kwallet-auth/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion-kwallet-auth/template b/srcpkgs/subversion-kwallet-auth/template
index 12210f250d51..b4d8621456ea 100644
--- a/srcpkgs/subversion-kwallet-auth/template
+++ b/srcpkgs/subversion-kwallet-auth/template
@@ -59,7 +59,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From 15741c7266a552d428e34dfbaa42d19148c29a47 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 20:07:32 -0700
Subject: [PATCH 21/44] gpgme: update to 1.18.0.

---
 common/shlibs          | 2 +-
 srcpkgs/gpgme/template | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 46c0680d55dd..3e3967f58a8c 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -723,7 +723,7 @@ libdconf.so.1 dconf-0.13.90_1
 libassuan.so.0 libassuan-2.0.1_1
 libgpgme.so.11 libgpgme-1.12.0_2
 libgpgmepp.so.6 gpgmepp-1.7.0_3
-libqgpgme.so.7 gpgmeqt-1.7.0_3
+libqgpgme.so.15 gpgmeqt-1.18.0_1
 libgarcon-1.so.0 garcon-0.1.12_1
 libgarcon-gtk2-1.so.0 garcon-0.4.0_1
 libgarcon-gtk3-1.so.0 garcon-0.6.1_1
diff --git a/srcpkgs/gpgme/template b/srcpkgs/gpgme/template
index 8633075a8404..b1cfd5f78657 100644
--- a/srcpkgs/gpgme/template
+++ b/srcpkgs/gpgme/template
@@ -1,7 +1,7 @@
 # Template file for 'gpgme'
 pkgname=gpgme
-version=1.15.1
-revision=2
+version=1.18.0
+revision=1
 build_style=gnu-configure
 configure_args="--enable-fd-passing
  --with-libgpg-error-prefix=$XBPS_CROSS_BASE/usr
@@ -14,7 +14,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.gnupg.org/software/gpgme/index.html"
 distfiles="https://www.gnupg.org/ftp/gcrypt/gpgme/gpgme-${version}.tar.bz2"
-checksum=eebc3c1b27f1c8979896ff361ba9bb4778b508b2496c2fc10e3775a40b1de1ad
+checksum=361d4eae47ce925dba0ea569af40e7b52c645c4ae2e65e5621bf1b6cdd8b0e9e
 
 if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
 	configure_args+=" ac_cv_sys_file_offset_bits=no"

From d1225fee9a7f27d9f6796f535a1e8c4faaa6f931 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:54 -0700
Subject: [PATCH 22/44] cross-aarch64-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..cb7ae97e7efe 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 1dede5fa62a31e83615b7c8fab5ace7c5a40e584 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:54 -0700
Subject: [PATCH 23/44] cross-aarch64-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..4fa950f334d4 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 4afe01a99dc4f52264d2753b321af84b96862972 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:54 -0700
Subject: [PATCH 24/44] cross-arm-linux-gnueabi: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..194c0ab774b7 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 6e30aaa597fe2c3874e7e974b1f53696c03415f5 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 25/44] cross-arm-linux-gnueabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..3f3242b85b07 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From d6c345c60f99d59de6d81e1f56355f59c8ec1301 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 26/44] cross-arm-linux-musleabi: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..b0cdade60a6d 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 92040360bbc5eaa75cac5f941bcad2172dd8ed21 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 27/44] cross-arm-linux-musleabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..1924be24d483 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 586f563f97f16f37535a03eadb5fb7c5ef125781 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 28/44] cross-armv7l-linux-gnueabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..a7997d6db937 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From a60af6da46692d4c3cd10d813fdc2423708510af Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 29/44] cross-armv7l-linux-musleabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..aaa7040fbfef 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From e8e3e39aefa30595fcd3778e14cc2f1bcbd2ebf6 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 30/44] cross-i686-pc-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..765cf675e95c 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 68e9d5308cfb73550d210c637494fe6a078f2eb0 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 31/44] cross-mips-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-mips-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..26928ba9442d 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 6908fbbd1943288fa1438ba3dd86fe73b7efb000 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 32/44] cross-mips-linux-muslhf: update to gcc 12.1.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..fe74faf15d55 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 8e335fb46eba00e57ab2de52311967e81e4a6ed2 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 33/44] cross-mipsel-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..aa74d0b1acc7 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_musl_version=1.1.24
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 0f66b9e8538cf7fb90da90f1bcb787a38fe38f06 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 34/44] cross-mipsel-linux-muslhf: update to gcc 12.1.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..83ab7f187085 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_musl_version=1.1.24
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 1a2f4ea5a254de89e7e0c22668b1f03b5a79b87a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 35/44] cross-powerpc-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..3ab1a4ea40fa 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From e446c6de87e0f4f9930247be205cee2d1843850b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 36/44] cross-powerpc-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..af5586cacc77 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From a8d7b54e661eb3694e7634834e94e36c806beb7b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 37/44] cross-powerpc64-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..2604b268046b 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 70a9d99f52fdb920dd2a7a7cfe237fefced23a1d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 38/44] cross-powerpc64-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 1ebd0fb2048d..c7894721b900 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
@@ -19,12 +19,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 17ac9449c4db648043c4ad8a5d979c5f9ef0e8e8 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 39/44] cross-powerpc64le-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 733f5851da5c..618235468970 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 2c391b31f6aea746791e95977f0c695e3b2814aa Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 40/44] cross-powerpc64le-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index 76a70aa1d6db..7edf9605e60d 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
@@ -19,12 +19,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From bee2514a4861750f8837b53d6f124b711e90efb5 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 41/44] cross-powerpcle-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 347b8fcf4f55..cc10b7cbd88b 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 4e061ea3a5d5197385a3e8fa7863a58812f93bbc Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 42/44] cross-powerpcle-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index ec9324ddaa99..1d38a3fa3559 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 7eb9ec47d127a392c109f92526acab3c81b2842a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 43/44] cross-x86_64-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 0078fbe7224b..9f740b00a80c 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 652f547f778f8a09b7db06052326afc9ef3be91c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 44/44] cross-x86_64-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..19e13f3818e9 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
@@ -17,12 +17,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.1.0
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (35 preceding siblings ...)
  2022-08-23  3:27 ` oreo639
@ 2022-08-23  4:02 ` oreo639
  2022-08-23  6:30 ` oreo639
                   ` (227 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-08-23  4:02 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 4145 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.1.0
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.1.0

This PR depends on: https://github.com/void-linux/void-packages/pull/32330

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

Also, keep in mind that the libgo musl patch here will need to be updated once musl is updated:
https://github.com/void-linux/void-packages/pull/34902/files#diff-1f42a95b93c9550178ff1fbccbef2f47a72711df15c24c9472e2550076978129R163-R176

This is the updated patch for reference:
https://github.com/alpinelinux/aports/blob/8acb21b8ee881e7ab1c812d9a66a17d2501b8730/main/gcc/0049-libgo-adjust-name-of-union-in-sigevent-struct.patch

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [ ] llvm https://github.com/void-linux/void-packages/pull/38694
- [ ] m4 https://github.com/void-linux/void-packages/pull/33730
- [ ] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [ ] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828

Known packages that needed to be fixed/updated for gcc12:
- [ ] linux5.18 (in this PR)
- [ ] openssh
- [ ] xf86-video-vmware
- [ ] doxygen
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/38817
- [ ] libproxy https://github.com/void-linux/void-packages/pull/38818
- [ ] exempi https://github.com/void-linux/void-packages/pull/38820
- [ ] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [ ] gpgme https://github.com/void-linux/void-packages/pull/38825

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 146901 bytes --]

From dda3b8a812a350176ff90821999538b11cba29ff Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 01/45] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 15 +++--
 3 files changed, 28 insertions(+), 113 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..4bdaee582d71 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkg-config"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -44,6 +45,12 @@ do_configure() {
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	case "$XBPS_TARGET_MACHINE" in
+		*-musl)
+			conf+=" --disable-gprofng"
+			;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"

From 795b73752f402b82fff753ec770fa467e34f857b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 02/45] gcc: update to 12.1.0.

---
 common/shlibs                                 |  10 +-
 srcpkgs/gcc/files/gccgo-musl.patch            |  74 +++--------
 srcpkgs/gcc/files/libgnarl-musl.patch         |  18 +--
 srcpkgs/gcc/files/libssp-musl.patch           |  10 +-
 ...c21f3f5726823e19728fdd1571a14aae0fb3.patch | 105 ++++++++++++++++
 ...08065bdd36fb1a9b6aad9666b1edb5e06474.patch | 115 ++++++++++++++++++
 ...65517a59565758107c5b1a51a5fa382f8d1a.patch |  32 +++++
 srcpkgs/gcc/patches/libffi_gnulinux.patch     |  11 --
 .../gcc/patches/libgcc-ibm128-no-tag.patch    |  10 +-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |   2 +-
 .../sanitizer-fix-compat-glibc-2.36.patch     |  39 ++++++
 srcpkgs/gcc/template                          |  25 ++--
 12 files changed, 343 insertions(+), 108 deletions(-)
 create mode 100644 srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
 create mode 100644 srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
 create mode 100644 srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch
 create mode 100644 srcpkgs/gcc/patches/sanitizer-fix-compat-glibc-2.36.patch

diff --git a/common/shlibs b/common/shlibs
index f829ee12e80f..776f9b195309 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.1.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.34 perl-5.34.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -848,8 +848,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.1.0_1
+libgnat-12.so libada-12.1.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1700,8 +1700,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.1.0_1
+libasan.so.8 libsanitizer-12.1.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..632ef951097b 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,17 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ a/libgo/go/runtime/os_linux.go
+@@ -363,9 +363,9 @@
+ 
+ 	var timerid int32
+ 	var sevp _sigevent
+-	sevp.sigev_notify = _SIGEV_THREAD_ID
++	sevp.sigev_notify = 4
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.sigev_notify_function))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch b/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
new file mode 100644
index 000000000000..00929202a503
--- /dev/null
+++ b/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
@@ -0,0 +1,105 @@
+From 3b21c21f3f5726823e19728fdd1571a14aae0fb3 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <siarheit@google.com>
+Date: Mon, 27 Jun 2022 13:27:24 +0100
+Subject: [PATCH] c++: avoid <memory> poisoning on musl [PR106102]
+
+On musl <pthread.h> uses calloc() (via <sched.h>). <memory> includes
+it indirectly and exposes use of poisoned calloc() when module code
+is built:
+
+    /build/build/./prev-gcc/xg++ ... ../../gcc-13-20220626/gcc/cp/mapper-resolver.cc
+        In file included from /<<NIX>>/musl-1.2.3-dev/include/pthread.h:30,
+                 from /build/build/prev-x86_64-unknown-linux-musl/libstdc++-v3/include/x86_64-unknown-linux-musl/bits/gthr-default.h:35,
+                 ....
+                 from /build/build/prev-x86_64-unknown-linux-musl/libstdc++-v3/include/memory:77,
+                 from ../../gcc-13-20220626/gcc/../libcody/cody.hh:24,
+                 from ../../gcc-13-20220626/gcc/cp/../../c++tools/resolver.h:25,
+                 from ../../gcc-13-20220626/gcc/cp/../../c++tools/resolver.cc:23,
+                 from ../../gcc-13-20220626/gcc/cp/mapper-resolver.cc:32:
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:84:7: error: attempt to use poisoned "calloc"
+       84 | void *calloc(size_t, size_t);
+          |       ^
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:124:36: error: attempt to use poisoned "calloc"
+      124 | #define CPU_ALLOC(n) ((cpu_set_t *)calloc(1,CPU_ALLOC_SIZE(n)))
+          |                                    ^
+
+gcc/cp/
+
+	PR c++/106102
+	* mapper-client.cc: Include <memory> via "system.h".
+	* mapper-resolver.cc: Ditto.
+	* module.cc: Ditto.
+
+libcc1/
+
+	PR c++/106102
+	* libcc1plugin.cc: Include <memory> via "system.h".
+	* libcp1plugin.cc: Ditto.
+---
+ gcc/cp/mapper-client.cc   | 1 +
+ gcc/cp/mapper-resolver.cc | 1 +
+ gcc/cp/module.cc          | 1 +
+ libcc1/libcc1plugin.cc    | 1 +
+ libcc1/libcp1plugin.cc    | 1 +
+ 5 files changed, 5 insertions(+)
+
+diff --git a/gcc/cp/mapper-client.cc b/gcc/cp/mapper-client.cc
+index 8603a886a099..fe9544b5ba43 100644
+--- a/gcc/cp/mapper-client.cc
++++ b/gcc/cp/mapper-client.cc
+@@ -27,6 +27,7 @@ along with GCC; see the file COPYING3.  If not see
+ #define INCLUDE_STRING
+ #define INCLUDE_VECTOR
+ #define INCLUDE_MAP
++#define INCLUDE_MEMORY
+ #include "system.h"
+ 
+ #include "line-map.h"
+diff --git a/gcc/cp/mapper-resolver.cc b/gcc/cp/mapper-resolver.cc
+index e3d29fb5ada1..e70d1b4ae2ca 100644
+--- a/gcc/cp/mapper-resolver.cc
++++ b/gcc/cp/mapper-resolver.cc
+@@ -25,6 +25,7 @@ along with GCC; see the file COPYING3.  If not see
+ #define INCLUDE_VECTOR
+ #define INCLUDE_ALGORITHM
+ #define INCLUDE_MAP
++#define INCLUDE_MEMORY
+ #include "system.h"
+ 
+ // We don't want or need to be aware of networking
+diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc
+index 753963a4b246..8bb22c2b305a 100644
+--- a/gcc/cp/module.cc
++++ b/gcc/cp/module.cc
+@@ -206,6 +206,7 @@ Classes used:
+ 
+ #define _DEFAULT_SOURCE 1 /* To get TZ field of struct tm, if available.  */
+ #include "config.h"
++#define INCLUDE_MEMORY
+ #define INCLUDE_STRING
+ #define INCLUDE_VECTOR
+ #include "system.h"
+diff --git a/libcc1/libcc1plugin.cc b/libcc1/libcc1plugin.cc
+index 12ab5a57c8dd..bdd0bdabe77f 100644
+--- a/libcc1/libcc1plugin.cc
++++ b/libcc1/libcc1plugin.cc
+@@ -31,6 +31,7 @@
+ #undef PACKAGE_TARNAME
+ #undef PACKAGE_VERSION
+ 
++#define INCLUDE_MEMORY
+ #include "gcc-plugin.h"
+ #include "system.h"
+ #include "coretypes.h"
+diff --git a/libcc1/libcp1plugin.cc b/libcc1/libcp1plugin.cc
+index 83dab7f58b11..e2d5039a0a1f 100644
+--- a/libcc1/libcp1plugin.cc
++++ b/libcc1/libcp1plugin.cc
+@@ -32,6 +32,7 @@
+ #undef PACKAGE_TARNAME
+ #undef PACKAGE_VERSION
+ 
++#define INCLUDE_MEMORY
+ #include "gcc-plugin.h"
+ #include "system.h"
+ #include "coretypes.h"
diff --git a/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch b/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
new file mode 100644
index 000000000000..89bd053d6d04
--- /dev/null
+++ b/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
@@ -0,0 +1,115 @@
+From 49d508065bdd36fb1a9b6aad9666b1edb5e06474 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <siarheit@google.com>
+Date: Mon, 27 Jun 2022 23:42:44 +0100
+Subject: [PATCH] jit: avoid calloc() poisoning on musl [PR106102]
+
+On musl <pthread.h> uses calloc() (via <sched.h>). jit/ includes
+it directly and exposes use of poisoned calloc():
+
+    /build/build/./prev-gcc/xg++ ... ../../gcc-13-20220626/gcc/jit/jit-playback.cc
+    make[3]: *** [Makefile:1143: jit/libgccjit.o] Error 1
+    make[3]: *** Waiting for unfinished jobs....
+    In file included from /<<NIX>>/musl-1.2.3-dev/include/pthread.h:30,
+                     from ../../gcc-13-20220626/gcc/jit/jit-playback.cc:44:
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:84:7: error: attempt to use poisoned "calloc"
+       84 | void *calloc(size_t, size_t);
+          |       ^
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:124:36: error: attempt to use poisoned "calloc"
+      124 | #define CPU_ALLOC(n) ((cpu_set_t *)calloc(1,CPU_ALLOC_SIZE(n)))
+          |                                    ^
+
+The change moves <pthread.h> inclusion to "system.h" under new
+INCLUDE_PTHREAD_H guard and uses this mechanism in libgccjit.
+
+gcc/
+
+	PR c++/106102
+	* system.h: Introduce INCLUDE_PTHREAD_H macros to include <pthread.h>.
+
+gcc/jit/
+
+	PR c++/106102
+	* jit-playback.cc: Include <pthread.h> via "system.h" to avoid calloc()
+	poisoning.
+	* jit-recording.cc: Ditto.
+	* libgccjit.cc: Ditto.
+---
+ gcc/jit/jit-playback.cc  | 3 +--
+ gcc/jit/jit-recording.cc | 2 +-
+ gcc/jit/libgccjit.cc     | 2 +-
+ gcc/system.h             | 4 ++++
+ 4 files changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/gcc/jit/jit-playback.cc b/gcc/jit/jit-playback.cc
+index 6be6bdf8dea5..79714132b91a 100644
+--- a/gcc/jit/jit-playback.cc
++++ b/gcc/jit/jit-playback.cc
+@@ -19,6 +19,7 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "target.h"
+@@ -41,8 +42,6 @@ along with GCC; see the file COPYING3.  If not see
+ #include "diagnostic.h"
+ #include "stmt.h"
+ 
+-#include <pthread.h>
+-
+ #include "jit-playback.h"
+ #include "jit-result.h"
+ #include "jit-builtins.h"
+diff --git a/gcc/jit/jit-recording.cc b/gcc/jit/jit-recording.cc
+index 697dee66e733..f78daed2d71a 100644
+--- a/gcc/jit/jit-recording.cc
++++ b/gcc/jit/jit-recording.cc
+@@ -19,13 +19,13 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "tm.h"
+ #include "pretty-print.h"
+ #include "toplev.h"
+ 
+-#include <pthread.h>
+ 
+ #include "jit-builtins.h"
+ #include "jit-recording.h"
+diff --git a/gcc/jit/libgccjit.cc b/gcc/jit/libgccjit.cc
+index 0e76097b4bac..ca862662777e 100644
+--- a/gcc/jit/libgccjit.cc
++++ b/gcc/jit/libgccjit.cc
+@@ -19,12 +19,12 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "timevar.h"
+ #include "typed-splay-tree.h"
+ #include "cppbuiltin.h"
+-#include <pthread.h>
+ 
+ #include "libgccjit.h"
+ #include "jit-recording.h"
+diff --git a/gcc/system.h b/gcc/system.h
+index 67158b70c789..f8d42ff68150 100644
+--- a/gcc/system.h
++++ b/gcc/system.h
+@@ -753,6 +753,10 @@ extern int vsnprintf (char *, size_t, const char *, va_list);
+ #endif
+ #endif
+ 
++#ifdef INCLUDE_PTHREAD_H
++#include <pthread.h>
++#endif
++
+ #ifdef INCLUDE_ISL
+ #ifdef HAVE_isl
+ #include <isl/options.h>
diff --git a/srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch b/srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch
new file mode 100644
index 000000000000..044a4fc29514
--- /dev/null
+++ b/srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch
@@ -0,0 +1,32 @@
+From f35d65517a59565758107c5b1a51a5fa382f8d1a Mon Sep 17 00:00:00 2001
+From: Ian Lance Taylor <iant@golang.org>
+Date: Tue, 12 Jul 2022 19:42:43 -0700
+Subject: [PATCH] libgo: don't include <linux/fs.h> when building
+ gen-sysinfo.go
+
+Removing this doesn't change anything at least with glibc 2.33.
+The include was added in https://go.dev/cl/6100049 but it's not
+clear why.
+
+Fixes PR go/106266
+
+Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/417294
+---
+ gcc/go/gofrontend/MERGE | 2 +-
+ libgo/sysinfo.c         | 3 ---
+ 2 files changed, 1 insertion(+), 4 deletions(-)
+
+diff --git a/libgo/sysinfo.c b/libgo/sysinfo.c
+index a4259c02ded4..fc0210992faa 100644
+--- a/libgo/sysinfo.c
++++ b/libgo/sysinfo.c
+@@ -158,9 +158,6 @@
+ #if defined(HAVE_LINUX_ETHER_H)
+ #include <linux/ether.h>
+ #endif
+-#if defined(HAVE_LINUX_FS_H)
+-#include <linux/fs.h>
+-#endif
+ #if defined(HAVE_LINUX_REBOOT_H)
+ #include <linux/reboot.h>
+ #endif
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/patches/sanitizer-fix-compat-glibc-2.36.patch b/srcpkgs/gcc/patches/sanitizer-fix-compat-glibc-2.36.patch
new file mode 100644
index 000000000000..851cde0e2077
--- /dev/null
+++ b/srcpkgs/gcc/patches/sanitizer-fix-compat-glibc-2.36.patch
@@ -0,0 +1,39 @@
+From 2701442d0cf6292f6624443c15813d6d1a3562fe Mon Sep 17 00:00:00 2001
+From: Martin Liska <mliska@suse.cz>
+Date: Mon, 11 Jul 2022 22:03:14 +0200
+Subject: [PATCH] libsanitizer: cherry-pick 9cf13067cb5088626ba7 from upstream
+
+9cf13067cb5088626ba7ee1ec4c42ec59c7995a0 [sanitizer] Remove #include <linux/fs.h> to resolve fsconfig_command/mount_attr conflict with glibc 2.36
+---
+ .../sanitizer_platform_limits_posix.cpp                | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
+index 8ed3e92d2704..97fd07acf9d4 100644
+--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -73,7 +73,9 @@
+ #include <sys/vt.h>
+ #include <linux/cdrom.h>
+ #include <linux/fd.h>
++#if SANITIZER_ANDROID
+ #include <linux/fs.h>
++#endif
+ #include <linux/hdreg.h>
+ #include <linux/input.h>
+ #include <linux/ioctl.h>
+@@ -869,10 +871,10 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
+   unsigned IOCTL_EVIOCGPROP = IOCTL_NOT_PRESENT;
+   unsigned IOCTL_EVIOCSKEYCODE_V2 = IOCTL_NOT_PRESENT;
+ #endif
+-  unsigned IOCTL_FS_IOC_GETFLAGS = FS_IOC_GETFLAGS;
+-  unsigned IOCTL_FS_IOC_GETVERSION = FS_IOC_GETVERSION;
+-  unsigned IOCTL_FS_IOC_SETFLAGS = FS_IOC_SETFLAGS;
+-  unsigned IOCTL_FS_IOC_SETVERSION = FS_IOC_SETVERSION;
++  unsigned IOCTL_FS_IOC_GETFLAGS = _IOR('f', 1, long);
++  unsigned IOCTL_FS_IOC_GETVERSION = _IOR('v', 1, long);
++  unsigned IOCTL_FS_IOC_SETFLAGS = _IOW('f', 2, long);
++  unsigned IOCTL_FS_IOC_SETVERSION = _IOW('v', 2, long);
+   unsigned IOCTL_GIO_CMAP = GIO_CMAP;
+   unsigned IOCTL_GIO_FONT = GIO_FONT;
+   unsigned IOCTL_GIO_UNIMAP = GIO_UNIMAP;
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..32ee79e32f0d 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,15 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
+version=12.1.0
+revision=1
 _patchver="${version%pre*}"
 _minorver="${_patchver%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 wrksrc=gcc-${version/pre/_pre}
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +19,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -396,7 +393,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}

From d195875f92651a8b06088dd13dc70ff7c8d58f47 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 03/45] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      |  6 ++--
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..08e35d466a44 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From c1ce82084255698b93d4237acac7697d4aafc05c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 04/45] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 1a4e1ca3d594..b04268908c2e 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="q66 <daniel@octaforge.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From 817c55ff7a63979fcedea952976d638bf463c655 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 05/45] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 3 files changed, 55 insertions(+), 353 deletions(-)
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index 776f9b195309..46c0680d55dd 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From 43f9c8bd8fbbaeeacbb5ccfede38ef28a23e3d63 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 21:01:43 -0700
Subject: [PATCH 06/45] gcc-multilib: update to 12.1.0.

---
 .../sanitizer-fix-compat-glibc-2.36.patch     | 39 +++++++++++++++++++
 srcpkgs/gcc-multilib/template                 |  8 ++--
 2 files changed, 43 insertions(+), 4 deletions(-)
 create mode 100644 srcpkgs/gcc-multilib/patches/sanitizer-fix-compat-glibc-2.36.patch

diff --git a/srcpkgs/gcc-multilib/patches/sanitizer-fix-compat-glibc-2.36.patch b/srcpkgs/gcc-multilib/patches/sanitizer-fix-compat-glibc-2.36.patch
new file mode 100644
index 000000000000..851cde0e2077
--- /dev/null
+++ b/srcpkgs/gcc-multilib/patches/sanitizer-fix-compat-glibc-2.36.patch
@@ -0,0 +1,39 @@
+From 2701442d0cf6292f6624443c15813d6d1a3562fe Mon Sep 17 00:00:00 2001
+From: Martin Liska <mliska@suse.cz>
+Date: Mon, 11 Jul 2022 22:03:14 +0200
+Subject: [PATCH] libsanitizer: cherry-pick 9cf13067cb5088626ba7 from upstream
+
+9cf13067cb5088626ba7ee1ec4c42ec59c7995a0 [sanitizer] Remove #include <linux/fs.h> to resolve fsconfig_command/mount_attr conflict with glibc 2.36
+---
+ .../sanitizer_platform_limits_posix.cpp                | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
+index 8ed3e92d2704..97fd07acf9d4 100644
+--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -73,7 +73,9 @@
+ #include <sys/vt.h>
+ #include <linux/cdrom.h>
+ #include <linux/fd.h>
++#if SANITIZER_ANDROID
+ #include <linux/fs.h>
++#endif
+ #include <linux/hdreg.h>
+ #include <linux/input.h>
+ #include <linux/ioctl.h>
+@@ -869,10 +871,10 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
+   unsigned IOCTL_EVIOCGPROP = IOCTL_NOT_PRESENT;
+   unsigned IOCTL_EVIOCSKEYCODE_V2 = IOCTL_NOT_PRESENT;
+ #endif
+-  unsigned IOCTL_FS_IOC_GETFLAGS = FS_IOC_GETFLAGS;
+-  unsigned IOCTL_FS_IOC_GETVERSION = FS_IOC_GETVERSION;
+-  unsigned IOCTL_FS_IOC_SETFLAGS = FS_IOC_SETFLAGS;
+-  unsigned IOCTL_FS_IOC_SETVERSION = FS_IOC_SETVERSION;
++  unsigned IOCTL_FS_IOC_GETFLAGS = _IOR('f', 1, long);
++  unsigned IOCTL_FS_IOC_GETVERSION = _IOR('v', 1, long);
++  unsigned IOCTL_FS_IOC_SETFLAGS = _IOW('f', 2, long);
++  unsigned IOCTL_FS_IOC_SETVERSION = _IOW('v', 2, long);
+   unsigned IOCTL_GIO_CMAP = GIO_CMAP;
+   unsigned IOCTL_GIO_FONT = GIO_FONT;
+   unsigned IOCTL_GIO_UNIMAP = GIO_UNIMAP;
diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index fcd25755aa75..573d323fe05e 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,16 +3,16 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.1.0
 revision=1
 _majorver="${version%.*}"
-wrksrc=gcc-${version/pre/_pre}
+wrksrc=gcc-${version}
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel

From c6785af852e0236b9db161fc35fd4fb781bc50e7 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 16:22:03 -0700
Subject: [PATCH 07/45] llvm12: fix build for glibc 2.36

---
 .../compiler-rt-sanitizer-glibc-2.36.patch    | 59 +++++++++++++++++++
 .../compiler-rt-sanitizer-glibc-2.36.patch    | 59 +++++++++++++++++++
 2 files changed, 118 insertions(+)
 create mode 100644 srcpkgs/llvm12/compiler-rt-sanitizer-glibc-2.36.patch
 create mode 100644 srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch

diff --git a/srcpkgs/llvm12/compiler-rt-sanitizer-glibc-2.36.patch b/srcpkgs/llvm12/compiler-rt-sanitizer-glibc-2.36.patch
new file mode 100644
index 000000000000..e5f24dab8935
--- /dev/null
+++ b/srcpkgs/llvm12/compiler-rt-sanitizer-glibc-2.36.patch
@@ -0,0 +1,59 @@
+From 9cf13067cb5088626ba7ee1ec4c42ec59c7995a0 Mon Sep 17 00:00:00 2001
+From: Fangrui Song <i@maskray.me>
+Date: Mon, 11 Jul 2022 12:53:34 -0700
+Subject: [PATCH] [sanitizer] Remove #include <linux/fs.h> to resolve
+ fsconfig_command/mount_attr conflict with glibc 2.36
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+It is generally not a good idea to mix usage of glibc headers and Linux UAPI
+headers (https://sourceware.org/glibc/wiki/Synchronizing_Headers). In glibc
+since 7eae6a91e9b1670330c9f15730082c91c0b1d570 (milestone: 2.36), sys/mount.h
+defines `fsconfig_command` which conflicts with linux/mount.h:
+
+    .../usr/include/linux/mount.h:95:6: error: redeclaration of ‘enum fsconfig_command’
+
+Remove #include <linux/fs.h> which pulls in linux/mount.h. Expand its 4 macros manually.
+Android sys/mount.h doesn't define BLKBSZGET and it still needs linux/fs.h.
+In the long term we should move Linux specific definitions to sanitizer_platform_limits_linux.cpp
+but this commit is easy to cherry pick into older compiler-rt releases.
+
+Fix https://github.com/llvm/llvm-project/issues/56421
+
+Reviewed By: #sanitizers, vitalybuka, zatrazz
+
+Differential Revision: https://reviews.llvm.org/D129471
+---
+ .../sanitizer_platform_limits_posix.cpp                | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+index 4bd425435d56d..3a94b260686f1 100644
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -73,7 +73,9 @@
+ #include <sys/vt.h>
+ #include <linux/cdrom.h>
+ #include <linux/fd.h>
++#if SANITIZER_ANDROID
+ #include <linux/fs.h>
++#endif
+ #include <linux/hdreg.h>
+ #include <linux/input.h>
+ #include <linux/ioctl.h>
+@@ -876,10 +878,10 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
+   unsigned IOCTL_EVIOCGPROP = IOCTL_NOT_PRESENT;
+   unsigned IOCTL_EVIOCSKEYCODE_V2 = IOCTL_NOT_PRESENT;
+ #endif
+-  unsigned IOCTL_FS_IOC_GETFLAGS = FS_IOC_GETFLAGS;
+-  unsigned IOCTL_FS_IOC_GETVERSION = FS_IOC_GETVERSION;
+-  unsigned IOCTL_FS_IOC_SETFLAGS = FS_IOC_SETFLAGS;
+-  unsigned IOCTL_FS_IOC_SETVERSION = FS_IOC_SETVERSION;
++  unsigned IOCTL_FS_IOC_GETFLAGS = _IOR('f', 1, long);
++  unsigned IOCTL_FS_IOC_GETVERSION = _IOR('v', 1, long);
++  unsigned IOCTL_FS_IOC_SETFLAGS = _IOW('f', 2, long);
++  unsigned IOCTL_FS_IOC_SETVERSION = _IOW('v', 2, long);
+   unsigned IOCTL_GIO_CMAP = GIO_CMAP;
+   unsigned IOCTL_GIO_FONT = GIO_FONT;
+   unsigned IOCTL_GIO_UNIMAP = GIO_UNIMAP;
diff --git a/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch b/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch
new file mode 100644
index 000000000000..e5f24dab8935
--- /dev/null
+++ b/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch
@@ -0,0 +1,59 @@
+From 9cf13067cb5088626ba7ee1ec4c42ec59c7995a0 Mon Sep 17 00:00:00 2001
+From: Fangrui Song <i@maskray.me>
+Date: Mon, 11 Jul 2022 12:53:34 -0700
+Subject: [PATCH] [sanitizer] Remove #include <linux/fs.h> to resolve
+ fsconfig_command/mount_attr conflict with glibc 2.36
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+It is generally not a good idea to mix usage of glibc headers and Linux UAPI
+headers (https://sourceware.org/glibc/wiki/Synchronizing_Headers). In glibc
+since 7eae6a91e9b1670330c9f15730082c91c0b1d570 (milestone: 2.36), sys/mount.h
+defines `fsconfig_command` which conflicts with linux/mount.h:
+
+    .../usr/include/linux/mount.h:95:6: error: redeclaration of ‘enum fsconfig_command’
+
+Remove #include <linux/fs.h> which pulls in linux/mount.h. Expand its 4 macros manually.
+Android sys/mount.h doesn't define BLKBSZGET and it still needs linux/fs.h.
+In the long term we should move Linux specific definitions to sanitizer_platform_limits_linux.cpp
+but this commit is easy to cherry pick into older compiler-rt releases.
+
+Fix https://github.com/llvm/llvm-project/issues/56421
+
+Reviewed By: #sanitizers, vitalybuka, zatrazz
+
+Differential Revision: https://reviews.llvm.org/D129471
+---
+ .../sanitizer_platform_limits_posix.cpp                | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+index 4bd425435d56d..3a94b260686f1 100644
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -73,7 +73,9 @@
+ #include <sys/vt.h>
+ #include <linux/cdrom.h>
+ #include <linux/fd.h>
++#if SANITIZER_ANDROID
+ #include <linux/fs.h>
++#endif
+ #include <linux/hdreg.h>
+ #include <linux/input.h>
+ #include <linux/ioctl.h>
+@@ -876,10 +878,10 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
+   unsigned IOCTL_EVIOCGPROP = IOCTL_NOT_PRESENT;
+   unsigned IOCTL_EVIOCSKEYCODE_V2 = IOCTL_NOT_PRESENT;
+ #endif
+-  unsigned IOCTL_FS_IOC_GETFLAGS = FS_IOC_GETFLAGS;
+-  unsigned IOCTL_FS_IOC_GETVERSION = FS_IOC_GETVERSION;
+-  unsigned IOCTL_FS_IOC_SETFLAGS = FS_IOC_SETFLAGS;
+-  unsigned IOCTL_FS_IOC_SETVERSION = FS_IOC_SETVERSION;
++  unsigned IOCTL_FS_IOC_GETFLAGS = _IOR('f', 1, long);
++  unsigned IOCTL_FS_IOC_GETVERSION = _IOR('v', 1, long);
++  unsigned IOCTL_FS_IOC_SETFLAGS = _IOW('f', 2, long);
++  unsigned IOCTL_FS_IOC_SETVERSION = _IOW('v', 2, long);
+   unsigned IOCTL_GIO_CMAP = GIO_CMAP;
+   unsigned IOCTL_GIO_FONT = GIO_FONT;
+   unsigned IOCTL_GIO_UNIMAP = GIO_UNIMAP;

From ee576cf7253762769809e1461966d353ac501bce Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 17:21:40 -0700
Subject: [PATCH 08/45] m4: update to 1.4.19.

---
 srcpkgs/m4/patches/fix-glibc-2.27.patch | 167 ------------------------
 srcpkgs/m4/template                     |  12 +-
 2 files changed, 6 insertions(+), 173 deletions(-)
 delete mode 100644 srcpkgs/m4/patches/fix-glibc-2.27.patch

diff --git a/srcpkgs/m4/patches/fix-glibc-2.27.patch b/srcpkgs/m4/patches/fix-glibc-2.27.patch
deleted file mode 100644
index 59d33cff164d..000000000000
--- a/srcpkgs/m4/patches/fix-glibc-2.27.patch
+++ /dev/null
@@ -1,167 +0,0 @@
-From 4af4a4a71827c0bc5e0ec67af23edef4f15cee8e Mon Sep 17 00:00:00 2001
-From: Paul Eggert <eggert@cs.ucla.edu>
-Date: Mon, 5 Mar 2018 10:56:29 -0800
-Subject: [PATCH] fflush: adjust to glibc 2.28 libio.h removal
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Problem reported by Daniel P. Berrangé in:
-https://lists.gnu.org/r/bug-gnulib/2018-03/msg00000.html
-* lib/fbufmode.c (fbufmode):
-* lib/fflush.c (clear_ungetc_buffer_preserving_position)
-(disable_seek_optimization, rpl_fflush):
-* lib/fpending.c (__fpending):
-* lib/fpurge.c (fpurge):
-* lib/freadable.c (freadable):
-* lib/freadahead.c (freadahead):
-* lib/freading.c (freading):
-* lib/freadptr.c (freadptr):
-* lib/freadseek.c (freadptrinc):
-* lib/fseeko.c (fseeko):
-* lib/fseterr.c (fseterr):
-* lib/fwritable.c (fwritable):
-* lib/fwriting.c (fwriting):
-Check _IO_EOF_SEEN instead of _IO_ftrylockfile.
-* lib/stdio-impl.h (_IO_IN_BACKUP) [_IO_EOF_SEEN]:
-Define if not already defined.
-
-[yann.morin.1998@free.fr: partially backport from upstream gnulib]
-Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
-
----
- lib/fflush.c     |  6 +++---
- lib/fpending.c   |  2 +-
- lib/fpurge.c     |  2 +-
- lib/freadahead.c |  2 +-
- lib/freading.c   |  2 +-
- lib/fseeko.c     |  4 ++--
- lib/stdio-impl.h |  6 ++++++
- 7 files changed, 15 insertions(+), 9 deletions(-)
-
-diff --git a/lib/fflush.c b/build-aux/gnulib/lib/fflush.c
-index 983ade0ff..a6edfa105 100644
---- a/lib/fflush.c
-+++ b/lib/fflush.c
-@@ -33,7 +33,7 @@
- #undef fflush
- 
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- 
- /* Clear the stream's ungetc buffer, preserving the value of ftello (fp).  */
- static void
-@@ -72,7 +72,7 @@ clear_ungetc_buffer (FILE *fp)
- 
- #endif
- 
--#if ! (defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
-+#if ! (defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
- 
- # if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT
- /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
-@@ -148,7 +148,7 @@ rpl_fflush (FILE *stream)
-   if (stream == NULL || ! freading (stream))
-     return fflush (stream);
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- 
-   clear_ungetc_buffer_preserving_position (stream);
- 
-diff --git a/lib/fpending.c b/build-aux/gnulib/lib/fpending.c
-index c84e3a5b4..789f50e4e 100644
---- a/lib/fpending.c
-+++ b/lib/fpending.c
-@@ -32,7 +32,7 @@ __fpending (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   return fp->_IO_write_ptr - fp->_IO_write_base;
- #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
-   /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
-diff --git a/lib/fpurge.c b/build-aux/gnulib/lib/fpurge.c
-index b1d417c7a..3aedcc373 100644
---- a/lib/fpurge.c
-+++ b/lib/fpurge.c
-@@ -62,7 +62,7 @@ fpurge (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   fp->_IO_read_end = fp->_IO_read_ptr;
-   fp->_IO_write_ptr = fp->_IO_write_base;
-   /* Avoid memory leak when there is an active ungetc buffer.  */
-diff --git a/lib/freadahead.c b/build-aux/gnulib/lib/freadahead.c
-index c2ecb5b28..23ec76ee5 100644
---- a/lib/freadahead.c
-+++ b/lib/freadahead.c
-@@ -30,7 +30,7 @@ extern size_t __sreadahead (FILE *);
- size_t
- freadahead (FILE *fp)
- {
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   if (fp->_IO_write_ptr > fp->_IO_write_base)
-     return 0;
-   return (fp->_IO_read_end - fp->_IO_read_ptr)
-diff --git a/lib/freading.c b/build-aux/gnulib/lib/freading.c
-index 73c28acdd..c24d0c88a 100644
---- a/lib/freading.c
-+++ b/lib/freading.c
-@@ -31,7 +31,7 @@ freading (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   return ((fp->_flags & _IO_NO_WRITES) != 0
-           || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0
-               && fp->_IO_read_base != NULL));
-diff --git a/lib/fseeko.c b/build-aux/gnulib/lib/fseeko.c
-index 0101ab55f..193f4e8ce 100644
---- a/lib/fseeko.c
-+++ b/lib/fseeko.c
-@@ -47,7 +47,7 @@ fseeko (FILE *fp, off_t offset, int whence)
- #endif
- 
-   /* These tests are based on fpurge.c.  */
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   if (fp->_IO_read_end == fp->_IO_read_ptr
-       && fp->_IO_write_ptr == fp->_IO_write_base
-       && fp->_IO_save_base == NULL)
-@@ -123,7 +123,7 @@ fseeko (FILE *fp, off_t offset, int whence)
-           return -1;
-         }
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-       fp->_flags &= ~_IO_EOF_SEEN;
-       fp->_offset = pos;
- #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
-diff --git a/lib/stdio-impl.h b/build-aux/gnulib/lib/stdio-impl.h
-index 78d896e9f..05c5752a2 100644
---- a/lib/stdio-impl.h
-+++ b/lib/stdio-impl.h
-@@ -18,6 +18,12 @@
-    the same implementation of stdio extension API, except that some fields
-    have different naming conventions, or their access requires some casts.  */
- 
-+/* Glibc 2.28 made _IO_IN_BACKUP private.  For now, work around this
-+   problem by defining it ourselves.  FIXME: Do not rely on glibc
-+   internals.  */
-+#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN
-+# define _IO_IN_BACKUP 0x100
-+#endif
- 
- /* BSD stdio derived implementations.  */
- 
--- 
-2.14.1
-
-
diff --git a/srcpkgs/m4/template b/srcpkgs/m4/template
index 78f3dae6184a..762593d883bd 100644
--- a/srcpkgs/m4/template
+++ b/srcpkgs/m4/template
@@ -1,17 +1,17 @@
 # Template file for 'm4'
 pkgname=m4
-version=1.4.18
-revision=2
+version=1.4.19
+revision=1
 bootstrap=yes
-replaces="chroot-m4>=0"
 build_style=gnu-configure
 configure_args="--enable-changeword --enable-threads"
 short_desc="GNU version of UNIX m4 macro language processor"
-homepage="https://www.gnu.org/software/m4/"
-license="GPL-3.0-or-later"
 maintainer="Enno Boland <gottox@voidlinux.org>"
+license="GPL-3.0-or-later"
+homepage="https://www.gnu.org/software/m4/"
 distfiles="${GNU_SITE}/${pkgname}/${pkgname}-${version}.tar.xz"
-checksum=f2c1e86ca0a404ff281631bdc8377638992744b175afb806e25871a24a934e07
+checksum=63aede5c6d33b6d9b13511cd0be2cac046f2e70fd0a07aa9573a04a82783af96
+replaces="chroot-m4>=0"
 
 if [ "$XBPS_TARGET_LIBC" = musl ]; then
 	export ac_cv_lib_error_at_line=no

From ea4af557b64d10052d78bc4cf9011698719c05be Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 22:57:59 -0700
Subject: [PATCH 09/45] btrfs-progs: update to 5.19.

---
 srcpkgs/btrfs-progs/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/btrfs-progs/template b/srcpkgs/btrfs-progs/template
index f6c53d8587e1..292d5110106b 100644
--- a/srcpkgs/btrfs-progs/template
+++ b/srcpkgs/btrfs-progs/template
@@ -1,6 +1,6 @@
 # Template file for 'btrfs-progs'
 pkgname=btrfs-progs
-version=5.18.1
+version=5.19
 revision=1
 wrksrc="${pkgname}-v${version}"
 build_style=gnu-configure
@@ -16,7 +16,7 @@ license="GPL-2.0-only, LGPL-2.1-or-later"
 homepage="https://btrfs.wiki.kernel.org/index.php/Main_Page"
 changelog="https://raw.githubusercontent.com/kdave/btrfs-progs/master/CHANGES"
 distfiles="${KERNEL_SITE}/kernel/people/kdave/${pkgname}/${pkgname}-v${version}.tar.xz"
-checksum=6e98a75ccff52e9354daa1ad284c614c490f844273a2fa524cbac9eb841c7255
+checksum=1fbcf06e4b2f80e7a127fd687ed4625a5b74fa674fe212c836ff70e0edfcccf9
 # Most of the tests depend on `mount` and `fallocate` commands, which are not
 # presented in chroot-util-linux
 make_check=no

From 666d2bc29f53a9ce6f003b22fe0adabf49160744 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 14 Aug 2022 19:29:36 -0700
Subject: [PATCH 10/45] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove nopie=yes. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh             |  1 +
 common/environment/build-style/void-cross.sh | 36 +++++++++++++++++++-
 2 files changed, 36 insertions(+), 1 deletion(-)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..c24013755704 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -132,6 +132,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
diff --git a/common/environment/build-style/void-cross.sh b/common/environment/build-style/void-cross.sh
index 62ce9eaa2e4a..4b77c90efc8b 100644
--- a/common/environment/build-style/void-cross.sh
+++ b/common/environment/build-style/void-cross.sh
@@ -1,6 +1,40 @@
 lib32disabled=yes
-nopie=yes
 create_wrksrc=yes
 
 nostrip_files+=" libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a libgmem.a"
+nopie_files+=" /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/go1
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/lto-wrapper
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/plugin/gengtype
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/cc1objplus
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/cc1obj
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/collect2
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/lto1
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/f951
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/cc1
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/gnat1
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/cc1plus
+ /usr/bin/${sourcepkg/cross-}-gcov-dump
+ /usr/bin/${sourcepkg/cross-}-gnatlink
+ /usr/bin/${sourcepkg/cross-}-gnatbind
+ /usr/bin/${sourcepkg/cross-}-gcc
+ /usr/bin/${sourcepkg/cross-}-cpp
+ /usr/bin/${sourcepkg/cross-}-gnatchop
+ /usr/bin/${sourcepkg/cross-}-gfortran
+ /usr/bin/${sourcepkg/cross-}-gccgo
+ /usr/bin/${sourcepkg/cross-}-c++
+ /usr/bin/${sourcepkg/cross-}-lto-dump
+ /usr/bin/${sourcepkg/cross-}-gnatname
+ /usr/bin/${sourcepkg/cross-}-gnatprep
+ /usr/bin/${sourcepkg/cross-}-g++
+ /usr/bin/${sourcepkg/cross-}-gnat
+ /usr/bin/${sourcepkg/cross-}-gcc-ranlib
+ /usr/bin/${sourcepkg/cross-}-gnatkr
+ /usr/bin/${sourcepkg/cross-}-gnatmake
+ /usr/bin/${sourcepkg/cross-}-gcc-${_gcc_version}
+ /usr/bin/${sourcepkg/cross-}-gcc-ar
+ /usr/bin/${sourcepkg/cross-}-gnatclean
+ /usr/bin/${sourcepkg/cross-}-gcov
+ /usr/bin/${sourcepkg/cross-}-gnatls
+ /usr/bin/${sourcepkg/cross-}-gcc-nm
+ /usr/bin/${sourcepkg/cross-}-gcov-tool"

From eae3715bfd43121bf9df25bf4a8263c1722fae08 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:08:52 -0700
Subject: [PATCH 11/45] openssh: suppress werror on gcc12

---
 srcpkgs/openssh/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/openssh/template b/srcpkgs/openssh/template
index 02a2dec35f42..6e8e343a9dca 100644
--- a/srcpkgs/openssh/template
+++ b/srcpkgs/openssh/template
@@ -40,7 +40,7 @@ if [ "$build_option_ldns" -a -z "$build_option_ssl" ]; then
 	broken="option 'ldns' requires option 'ssl'"
 fi
 
-CFLAGS="-Wno-format-truncation -Wno-stringop-truncation"
+CFLAGS="-Wno-format-truncation -Wno-stringop-truncation -Wno-error=maybe-uninitialized"
 
 case $XBPS_TARGET_MACHINE in
 	i686-musl)

From 8b6704c5d24a1db84648bae36c398ce87469974e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:09:31 -0700
Subject: [PATCH 12/45] linux5.18: update dotconfigs for gcc12

---
 srcpkgs/linux5.18/files/x86_64-dotconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/linux5.18/files/x86_64-dotconfig b/srcpkgs/linux5.18/files/x86_64-dotconfig
index 4e73a3195d40..ea6204868e23 100644
--- a/srcpkgs/linux5.18/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.18/files/x86_64-dotconfig
@@ -512,6 +512,7 @@ CONFIG_RETHUNK=y
 CONFIG_CPU_UNRET_ENTRY=y
 CONFIG_CPU_IBPB_ENTRY=y
 CONFIG_CPU_IBRS_ENTRY=y
+CONFIG_SLS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10060,8 +10061,11 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
 # Memory initialization
 #
 CONFIG_INIT_STACK_NONE=y
+# CONFIG_INIT_STACK_ALL_PATTERN is not set
+# CONFIG_INIT_STACK_ALL_ZERO is not set
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
+# CONFIG_ZERO_CALL_USED_REGS is not set
 # end of Memory initialization
 # end of Kernel hardening options
 # end of Security options
@@ -10538,6 +10542,7 @@ CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
 # CONFIG_UBSAN is not set
 CONFIG_HAVE_ARCH_KCSAN=y
+# CONFIG_KCSAN is not set
 # end of Generic Kernel Debugging Instruments
 
 #

From bdaecc8ce3c43c2c031a37dc4d2679ffa8f6f42c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 18:00:42 -0700
Subject: [PATCH 13/45] xf86-video-vmware: fix build on gcc12

---
 ...183b3395333d5d4c73e25c2d011748f15eda.patch | 30 +++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch

diff --git a/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch b/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch
new file mode 100644
index 000000000000..ff839f16e628
--- /dev/null
+++ b/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch
@@ -0,0 +1,30 @@
+From 77b8183b3395333d5d4c73e25c2d011748f15eda Mon Sep 17 00:00:00 2001
+From: Rudi Heitbaum <rudi@heitbaum.com>
+Date: Sun, 8 May 2022 03:00:10 +0000
+Subject: [PATCH] vmwgfx: fix missing array notation
+
+ Fixes error identified by gcc-12.1.0 compiler
+
+make
+  CC       libvmwgfx_la-vmwgfx_tex_video.lo
+vmwgfx_tex_video.c: In function 'stop_video':
+vmwgfx_tex_video.c:240:20: error: the comparison will always evaluate as 'true' for the address of 'yuv' will never be NULL [-Werror=address]
+  240 |                if (priv->yuv[i]) {
+      |                    ^~~~
+---
+ vmwgfx/vmwgfx_tex_video.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/vmwgfx/vmwgfx_tex_video.c b/vmwgfx/vmwgfx_tex_video.c
+index acc2b56..480a5f1 100644
+--- a/vmwgfx/vmwgfx_tex_video.c
++++ b/vmwgfx/vmwgfx_tex_video.c
+@@ -237,7 +237,7 @@ stop_video(ScrnInfoPtr pScrn, pointer data, Bool shutdown)
+ 
+        for (i=0; i<3; ++i) {
+ 	   for (j=0; j<2; ++j) {
+-	       if (priv->yuv[i]) {
++	       if (priv->yuv[j][i]) {
+ 		   xa_surface_destroy(priv->yuv[j][i]);
+ 		   priv->yuv[j][i] = NULL;
+ 	       }

From 17569e7e860162681a157a69b110c0c23c29ed3a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 18:24:37 -0700
Subject: [PATCH 14/45] doxygen: fix build for gcc 12

---
 srcpkgs/doxygen/patches/compat-gcc12.patch | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100644 srcpkgs/doxygen/patches/compat-gcc12.patch

diff --git a/srcpkgs/doxygen/patches/compat-gcc12.patch b/srcpkgs/doxygen/patches/compat-gcc12.patch
new file mode 100644
index 000000000000..666744a1dceb
--- /dev/null
+++ b/srcpkgs/doxygen/patches/compat-gcc12.patch
@@ -0,0 +1,22 @@
+From 5198966c8d5fec89116d025c74934ac03ea511fa Mon Sep 17 00:00:00 2001
+From: Dimitri van Heesch <doxygen@gmail.com>
+Date: Fri, 6 May 2022 09:55:16 +0200
+Subject: [PATCH] issue #9312: Build: cache.h:53:14: error: 'exchange' is not a
+ member of 'std'
+
+---
+ src/cache.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/cache.h b/src/cache.h
+index 0ff3092ed5..e218eb27d2 100644
+--- a/src/cache.h
++++ b/src/cache.h
+@@ -19,6 +19,7 @@
+ #include <list>
+ #include <unordered_map>
+ #include <mutex>
++#include <utility>
+ #include <ctype.h>
+ 
+ /*! Fixed size cache for value type V using keys of type K.

From f09dc7d85f25e4b67f4c9d6f26117e4d4a244594 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 21 Aug 2022 15:12:00 -0700
Subject: [PATCH 15/45] libproxy: update to 0.4.18

---
 srcpkgs/libproxy/template | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/libproxy/template b/srcpkgs/libproxy/template
index d6103007032e..6599dfb69b98 100644
--- a/srcpkgs/libproxy/template
+++ b/srcpkgs/libproxy/template
@@ -1,18 +1,22 @@
 # Template file for 'libproxy'
 pkgname=libproxy
-version=0.4.15
+version=0.4.18
 revision=1
 build_style=cmake
 configure_args="-DWITH_GNOME=0 -DWITH_KDE4=0 -DWITH_MOZJS=0 -DWITH_NM=0
  -DWITH_PERL=0 -DWITH_PYTHON=1 -DWITH_WEBKIT=0"
 hostmakedepends="pkg-config python"
 makedepends="zlib-devel"
-short_desc="A library handling all the details of proxy configuration"
+short_desc="Library handling all the details of proxy configuration"
 maintainer="Orphaned <orphan@voidlinux.org>"
+license="LGPL-2.1-or-later"
 homepage="http://github.com/libproxy/libproxy"
-license="LGPL-2.1"
-distfiles="https://github.com/libproxy/libproxy/archive/${version}.tar.gz>${pkgname}-${version}.tar.gz"
-checksum=18f58b0a0043b6881774187427ead158d310127fc46a1c668ad6d207fb28b4e0
+distfiles="https://github.com/libproxy/libproxy/archive/${version}.tar.gz"
+checksum=0b4a9218d88f6cf9fa25996a3f38329a11f688a9d026141d9d0e966d8fa63837
+
+post_patch() {
+	vsed '/add_test(NAME url-test/d' -i libproxy/test/CMakeLists.txt
+}
 
 libproxy-devel_package() {
 	depends="libproxy>=${version}_${revision}"

From a6e04f2de0b1314b2c48695bca810fe223527e62 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 21 Aug 2022 17:05:39 -0700
Subject: [PATCH 16/45] exempi: update to 2.6.2

---
 ...f034705fd2d032c81383eee8208fd4eee0ac.patch | 43 -------------------
 srcpkgs/exempi/template                       |  4 +-
 2 files changed, 2 insertions(+), 45 deletions(-)
 delete mode 100644 srcpkgs/exempi/patches/8ed2f034705fd2d032c81383eee8208fd4eee0ac.patch

diff --git a/srcpkgs/exempi/patches/8ed2f034705fd2d032c81383eee8208fd4eee0ac.patch b/srcpkgs/exempi/patches/8ed2f034705fd2d032c81383eee8208fd4eee0ac.patch
deleted file mode 100644
index 2696793cec09..000000000000
--- a/srcpkgs/exempi/patches/8ed2f034705fd2d032c81383eee8208fd4eee0ac.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From 8ed2f034705fd2d032c81383eee8208fd4eee0ac Mon Sep 17 00:00:00 2001
-From: Victor Rodriguez <victor.rodriguez.bahena@intel.com>
-Date: Sat, 18 Aug 2018 13:54:55 +0000
-Subject: [PATCH] Issue #9 - Fix null-pointer-dereference (CVE-2018-12648)
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-The WEBP::GetLE32 function in
-XMPFiles/source/FormatSupport/WEBP_Support.hpp in Exempi 2.4.5 has a
-NULL pointer dereference.
-
-https://bugs.freedesktop.org/show_bug.cgi?id=106981
-https://gitlab.freedesktop.org/libopenraw/exempi/issues/9
-
-Signed-off-by: Victor Rodriguez <victor.rodriguez.bahena@intel.com>
-Signed-off-by: Hubert Figuière <hub@figuiere.net>
----
- XMPFiles/source/FormatSupport/WEBP_Support.cpp | 8 +++++---
- 1 file changed, 5 insertions(+), 3 deletions(-)
-
-diff --git a/XMPFiles/source/FormatSupport/WEBP_Support.cpp b/XMPFiles/source/FormatSupport/WEBP_Support.cpp
-index ffaf220..4fe705b 100644
---- a/XMPFiles/source/FormatSupport/WEBP_Support.cpp
-+++ b/XMPFiles/source/FormatSupport/WEBP_Support.cpp
-@@ -160,9 +160,11 @@ bool VP8XChunk::xmp()
- }
- void VP8XChunk::xmp(bool hasXMP)
- {
--    XMP_Uns32 flags = GetLE32(&this->data[0]);
--    flags ^= (-hasXMP ^ flags) & (1 << XMP_FLAG_BIT);
--    PutLE32(&this->data[0], flags);
-+    if (&this->data[0] != NULL) {
-+        XMP_Uns32 flags = GetLE32(&this->data[0]);
-+        flags ^= (-hasXMP ^ flags) & (1 << XMP_FLAG_BIT);
-+        PutLE32(&this->data[0], flags);
-+    }
- }
- 
- Container::Container(WEBP_MetaHandler* handler) : Chunk(NULL, handler)
--- 
-2.18.0
-
diff --git a/srcpkgs/exempi/template b/srcpkgs/exempi/template
index 14753617953a..d664f7dc4d80 100644
--- a/srcpkgs/exempi/template
+++ b/srcpkgs/exempi/template
@@ -1,6 +1,6 @@
 # Template file for 'exempi'
 pkgname=exempi
-version=2.5.0
+version=2.6.2
 revision=1
 build_style=gnu-configure
 configure_args="--with-boost=${XBPS_CROSS_BASE}/usr --disable-static --disable-unittest"
@@ -10,7 +10,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="BSD-3-Clause"
 homepage="https://libopenraw.freedesktop.org/wiki/Exempi"
 distfiles="https://libopenraw.freedesktop.org/download/exempi-${version}.tar.bz2"
-checksum=dc82fc24c0540a44a63fa4ad21775d24e00e63f1dedd3e2ae6f7aa27583b711b
+checksum=4d17d4c93df2a95da3e3172c45b7a5bf317dd31dafd1c7a340169728c7089d1d
 
 post_install() {
 	vlicense COPYING

From 8a51e86f810ee9a2d1254840789eb15f94a783e1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 21 Aug 2022 21:36:03 -0700
Subject: [PATCH 17/45] plymouth: update to 22.02.122

---
 srcpkgs/plymouth/patches/fix-glibc-2.36.patch | 30 +++++++++++++++++++
 srcpkgs/plymouth/template                     |  4 +--
 2 files changed, 32 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/plymouth/patches/fix-glibc-2.36.patch

diff --git a/srcpkgs/plymouth/patches/fix-glibc-2.36.patch b/srcpkgs/plymouth/patches/fix-glibc-2.36.patch
new file mode 100644
index 000000000000..2f1e43875cfb
--- /dev/null
+++ b/srcpkgs/plymouth/patches/fix-glibc-2.36.patch
@@ -0,0 +1,30 @@
+From 5f1e43c00039a7fe1fff768b91a05a695fb4a53d Mon Sep 17 00:00:00 2001
+From: Ray Strode <rstrode@redhat.com>
+Date: Wed, 3 Aug 2022 15:23:33 -0400
+Subject: [PATCH] ply-utils: Drop linux/fs.h include
+
+It was needed long ago for a function we no longer even have.
+
+Now it's causing compile errors on Fedora 37 because it's conflicting
+with sys/mount.h.
+
+This commit drops it.
+---
+ src/libply/ply-utils.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/src/libply/ply-utils.c b/src/libply/ply-utils.c
+index c7b165e9..219e2e77 100644
+--- a/src/libply/ply-utils.c
++++ b/src/libply/ply-utils.c
+@@ -46,7 +46,6 @@
+ #include <sys/user.h>
+ #include <sys/wait.h>
+ #include <time.h>
+-#include <linux/fs.h>
+ #include <linux/vt.h>
+ 
+ #include <dlfcn.h>
+-- 
+GitLab
+
diff --git a/srcpkgs/plymouth/template b/srcpkgs/plymouth/template
index 17f801fc5315..442ab58a99cd 100644
--- a/srcpkgs/plymouth/template
+++ b/srcpkgs/plymouth/template
@@ -1,6 +1,6 @@
 # Template file for 'plymouth'
 pkgname=plymouth
-version=0.9.5
+version=22.02.122
 revision=1
 build_style=gnu-configure
 configure_args="--with-system-root-install=no \
@@ -18,7 +18,7 @@ maintainer="William OD <obirik2005@gmail.com>"
 license="GPL-2.0-or-later"
 homepage="https://www.freedesktop.org/wiki/Software/Plymouth/"
 distfiles="${FREEDESKTOP_SITE}/plymouth/releases/$pkgname-$version.tar.xz"
-checksum=ecae257f351d098340542a5bc06de029404c24dcee87e6ebb2abd5ef117fce86
+checksum=100551442221033ce868c447ad6c74d831d209c18ae232b98ae0207e34eadaeb
 
 build_options="gtk3 pango"
 build_options_default="gtk3 pango"

From bca13db8a34a502de915191fef9e1cbb92cba5c0 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 21 Aug 2022 21:37:00 -0700
Subject: [PATCH 18/45] openjdk7-bootstrap: fix build for gcc12

---
 .../files/dist_patches_glibc.txt              |  1 +
 .../files/dist_patches_musl.txt               |  1 +
 .../icedtea-pointer-comparison-gcc12.patch    | 31 +++++++++++++++++++
 3 files changed, 33 insertions(+)
 create mode 100644 srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch

diff --git a/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt b/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt
index c76c56855441..8061756dfc0c 100644
--- a/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt
+++ b/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt
@@ -6,3 +6,4 @@ icedtea-jdk-no-soname.patch
 icedtea-jdk-xattr.patch
 icedtea-jdk-sysctl_h.patch
 icedtea-cpio.patch
+icedtea-pointer-comparison-gcc12.patch
diff --git a/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt b/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt
index 21812517c7c2..8b35d9c46989 100644
--- a/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt
+++ b/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt
@@ -11,3 +11,4 @@ icedtea-jdk-musl.patch
 icedtea-jdk-no-soname.patch
 icedtea-jdk-xattr.patch
 icedtea-cpio.patch
+icedtea-pointer-comparison-gcc12.patch
diff --git a/srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch b/srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch
new file mode 100644
index 000000000000..c809553443e7
--- /dev/null
+++ b/srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch
@@ -0,0 +1,31 @@
+--- openjdk.orig/hotspot/src/share/vm/opto/lcm.cpp
++++ openjdk/hotspot/src/share/vm/opto/lcm.cpp
+@@ -60,7 +60,7 @@
+ // Check whether val is not-null-decoded compressed oop,
+ // i.e. will grab into the base of the heap if it represents NULL.
+ static bool accesses_heap_base_zone(Node *val) {
+-  if (Universe::narrow_oop_base() > 0) { // Implies UseCompressedOops.
++  if (Universe::narrow_oop_base() > (address)0) { // Implies UseCompressedOops.
+     if (val && val->is_Mach()) {
+       if (val->as_Mach()->ideal_Opcode() == Op_DecodeN) {
+         // This assumes all Decodes with TypePtr::NotNull are matched to nodes that
+--- openjdk.orig/hotspot/src/share/vm/runtime/virtualspace.cpp
++++ openjdk/hotspot/src/share/vm/runtime/virtualspace.cpp
+@@ -527,7 +527,7 @@ ReservedHeapSpace::ReservedHeapSpace(siz
+                 (UseCompressedOops && (Universe::narrow_oop_base() != NULL) &&
+                  Universe::narrow_oop_use_implicit_null_checks()) ?
+                   lcm(os::vm_page_size(), alignment) : 0) {
+-  if (base() > 0) {
++  if (base() > (char*)0) {
+     MemTracker::record_virtual_memory_type((address)base(), mtJavaHeap);
+   }
+ 
+@@ -546,7 +546,7 @@ ReservedHeapSpace::ReservedHeapSpace(con
+                 (UseCompressedOops && (Universe::narrow_oop_base() != NULL) &&
+                  Universe::narrow_oop_use_implicit_null_checks()) ?
+                   lcm(os::vm_page_size(), prefix_align) : 0) {
+-  if (base() > 0) {
++  if (base() > (char*)0) {
+     MemTracker::record_virtual_memory_type((address)base(), mtJavaHeap);
+   }
+ 

From 2cfec74ceee063eb4b448a1171eb567ace7bb46a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 14:45:28 -0700
Subject: [PATCH 19/45] libsasl: fix build for libtool 2.4.7

---
 srcpkgs/libsasl/template | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/libsasl/template b/srcpkgs/libsasl/template
index a8817042f843..a2993b39f4a1 100644
--- a/srcpkgs/libsasl/template
+++ b/srcpkgs/libsasl/template
@@ -19,6 +19,7 @@ distfiles="https://github.com/cyrusimap/cyrus-sasl/releases/download/cyrus-sasl-
 checksum=26866b1549b00ffd020f188a43c258017fa1c382b3ddadd8201536f72efb05d5
 
 pre_configure() {
+	rm -f m4/ltversion.m4
 	autoreconf -fi
 }
 

From f662f87b0acc23d0b832dcdf5a580ad84e4dd7bf Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:08 -0700
Subject: [PATCH 20/45] subversion: fix build for libtool 2.4.7

---
 srcpkgs/subversion/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion/template b/srcpkgs/subversion/template
index 8ad178264942..3f1c9e254e61 100644
--- a/srcpkgs/subversion/template
+++ b/srcpkgs/subversion/template
@@ -57,7 +57,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From f447f6e85fc9aec1160818b2d97c6b6eedfa0e71 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:38 -0700
Subject: [PATCH 21/45] subversion-kwallet-auth: fix build for libtool 2.4.7

---
 srcpkgs/subversion-kwallet-auth/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion-kwallet-auth/template b/srcpkgs/subversion-kwallet-auth/template
index 12210f250d51..b4d8621456ea 100644
--- a/srcpkgs/subversion-kwallet-auth/template
+++ b/srcpkgs/subversion-kwallet-auth/template
@@ -59,7 +59,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From dd1de8067c2de7d0f1f8a3a5b6d674ecd1f8516a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 20:07:32 -0700
Subject: [PATCH 22/45] gpgme: update to 1.18.0.

---
 common/shlibs          | 2 +-
 srcpkgs/gpgme/template | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 46c0680d55dd..3e3967f58a8c 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -723,7 +723,7 @@ libdconf.so.1 dconf-0.13.90_1
 libassuan.so.0 libassuan-2.0.1_1
 libgpgme.so.11 libgpgme-1.12.0_2
 libgpgmepp.so.6 gpgmepp-1.7.0_3
-libqgpgme.so.7 gpgmeqt-1.7.0_3
+libqgpgme.so.15 gpgmeqt-1.18.0_1
 libgarcon-1.so.0 garcon-0.1.12_1
 libgarcon-gtk2-1.so.0 garcon-0.4.0_1
 libgarcon-gtk3-1.so.0 garcon-0.6.1_1
diff --git a/srcpkgs/gpgme/template b/srcpkgs/gpgme/template
index 8633075a8404..b1cfd5f78657 100644
--- a/srcpkgs/gpgme/template
+++ b/srcpkgs/gpgme/template
@@ -1,7 +1,7 @@
 # Template file for 'gpgme'
 pkgname=gpgme
-version=1.15.1
-revision=2
+version=1.18.0
+revision=1
 build_style=gnu-configure
 configure_args="--enable-fd-passing
  --with-libgpg-error-prefix=$XBPS_CROSS_BASE/usr
@@ -14,7 +14,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.gnupg.org/software/gpgme/index.html"
 distfiles="https://www.gnupg.org/ftp/gcrypt/gpgme/gpgme-${version}.tar.bz2"
-checksum=eebc3c1b27f1c8979896ff361ba9bb4778b508b2496c2fc10e3775a40b1de1ad
+checksum=361d4eae47ce925dba0ea569af40e7b52c645c4ae2e65e5621bf1b6cdd8b0e9e
 
 if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
 	configure_args+=" ac_cv_sys_file_offset_bits=no"

From 218c3518f310c8d95e0a7d25152b9316efe57f03 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:54 -0700
Subject: [PATCH 23/45] cross-aarch64-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..cb7ae97e7efe 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From b79d665f52586ae78972488dae02de247309844a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:54 -0700
Subject: [PATCH 24/45] cross-aarch64-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..4fa950f334d4 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 101c24fa9303e4e3765c7084fb19bfa303edd48c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:54 -0700
Subject: [PATCH 25/45] cross-arm-linux-gnueabi: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..194c0ab774b7 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 7b059f6a97846a256c1716903dfc0b89394fb0a9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 26/45] cross-arm-linux-gnueabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..3f3242b85b07 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From f99f550d5ff2766964a26716c1af3b728374b1df Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 27/45] cross-arm-linux-musleabi: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..b0cdade60a6d 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From aba112e3825c0a3440267036403b3745d886b459 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 28/45] cross-arm-linux-musleabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..1924be24d483 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From c61f48b1f76471dfd8ce718a2906cf3e1fd4ef07 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 29/45] cross-armv7l-linux-gnueabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..a7997d6db937 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 7fc7e7987c0754b53d5517e7b53b5bd702517b04 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 30/45] cross-armv7l-linux-musleabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..aaa7040fbfef 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 32aa53dcbed57f4abaa8a11bae7ee69c150f6f59 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 31/45] cross-i686-pc-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..765cf675e95c 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 020172c47d431f362c30ffd1a6de05c38d742a70 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 32/45] cross-mips-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-mips-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..26928ba9442d 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From a4d58968a345b8f9ed9b6087dc7392c99b50b5cb Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 33/45] cross-mips-linux-muslhf: update to gcc 12.1.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..fe74faf15d55 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 71385bb33bb8f48918a4f423eda77dfd51de936d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 34/45] cross-mipsel-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..aa74d0b1acc7 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_musl_version=1.1.24
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From eb3c5026c4aab0319460ceee4398146948bce479 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 35/45] cross-mipsel-linux-muslhf: update to gcc 12.1.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..83ab7f187085 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_musl_version=1.1.24
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 5d7f3d65677be34a7b0261816818f9b160cdfddb Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 36/45] cross-powerpc-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..3ab1a4ea40fa 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From aa5b29c322faec999478fde6f921df18ab033271 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 37/45] cross-powerpc-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..af5586cacc77 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 627c47c42876bf676765c22bebdc828e211fd945 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 38/45] cross-powerpc64-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..2604b268046b 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From d0e47ac80dcb92f708b48b689de7a6a2f87e3658 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 39/45] cross-powerpc64-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 1ebd0fb2048d..c7894721b900 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
@@ -19,12 +19,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From ab3b7be385ba143fb1ea8c514049fe31663de10b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 40/45] cross-powerpc64le-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 733f5851da5c..618235468970 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 3e10b77671c9ff762ea983eb215a542618f6e2b0 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 41/45] cross-powerpc64le-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index 76a70aa1d6db..7edf9605e60d 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
@@ -19,12 +19,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From d78689b2ea2be50a6f56fabaac3267effb9614f0 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 42/45] cross-powerpcle-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 347b8fcf4f55..cc10b7cbd88b 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 23124aa45afd9e9bd2a500b70748155d3396cba0 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 43/45] cross-powerpcle-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index ec9324ddaa99..1d38a3fa3559 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 70e0088460692138d818ae99802549873964e05b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 44/45] cross-x86_64-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 0078fbe7224b..9f740b00a80c 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From cda73dd63b9e88f168e0d5919b020e6b7f067010 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 45/45] cross-x86_64-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..19e13f3818e9 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
@@ -17,12 +17,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.1.0
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (36 preceding siblings ...)
  2022-08-23  4:02 ` oreo639
@ 2022-08-23  6:30 ` oreo639
  2022-08-23 19:37 ` oreo639
                   ` (226 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-08-23  6:30 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 4693 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.1.0
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.1.0

This PR depends on: https://github.com/void-linux/void-packages/pull/32330

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

Also, keep in mind that the libgo musl patch here will need to be updated once musl is updated:
https://github.com/void-linux/void-packages/pull/34902/files#diff-1f42a95b93c9550178ff1fbccbef2f47a72711df15c24c9472e2550076978129R163-R176

This is the updated patch for reference:
https://github.com/alpinelinux/aports/blob/8acb21b8ee881e7ab1c812d9a66a17d2501b8730/main/gcc/0049-libgo-adjust-name-of-union-in-sigevent-struct.patch

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [ ] llvm https://github.com/void-linux/void-packages/pull/38694
- [ ] m4 https://github.com/void-linux/void-packages/pull/33730
- [ ] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [ ] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [ ] libvirt https://github.com/void-linux/void-packages/pull/38842

Known packages that needed to be fixed/updated for gcc12:
- [ ] linux5.18 (in this PR)
- [ ] openssh
- [ ] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [ ] doxygen https://github.com/void-linux/void-packages/pull/38846
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/38817
- [ ] libproxy https://github.com/void-linux/void-packages/pull/38818
- [ ] exempi https://github.com/void-linux/void-packages/pull/38820
- [ ] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [ ] gpgme https://github.com/void-linux/void-packages/pull/38825
- [ ] libunique1 https://github.com/void-linux/void-packages/pull/38848

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [ ] kde
- [ ] lxde
- [ ] lxqt

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 147770 bytes --]

From dda3b8a812a350176ff90821999538b11cba29ff Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 01/46] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 15 +++--
 3 files changed, 28 insertions(+), 113 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..4bdaee582d71 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkg-config"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -44,6 +45,12 @@ do_configure() {
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	case "$XBPS_TARGET_MACHINE" in
+		*-musl)
+			conf+=" --disable-gprofng"
+			;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"

From 795b73752f402b82fff753ec770fa467e34f857b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 02/46] gcc: update to 12.1.0.

---
 common/shlibs                                 |  10 +-
 srcpkgs/gcc/files/gccgo-musl.patch            |  74 +++--------
 srcpkgs/gcc/files/libgnarl-musl.patch         |  18 +--
 srcpkgs/gcc/files/libssp-musl.patch           |  10 +-
 ...c21f3f5726823e19728fdd1571a14aae0fb3.patch | 105 ++++++++++++++++
 ...08065bdd36fb1a9b6aad9666b1edb5e06474.patch | 115 ++++++++++++++++++
 ...65517a59565758107c5b1a51a5fa382f8d1a.patch |  32 +++++
 srcpkgs/gcc/patches/libffi_gnulinux.patch     |  11 --
 .../gcc/patches/libgcc-ibm128-no-tag.patch    |  10 +-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |   2 +-
 .../sanitizer-fix-compat-glibc-2.36.patch     |  39 ++++++
 srcpkgs/gcc/template                          |  25 ++--
 12 files changed, 343 insertions(+), 108 deletions(-)
 create mode 100644 srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
 create mode 100644 srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
 create mode 100644 srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch
 create mode 100644 srcpkgs/gcc/patches/sanitizer-fix-compat-glibc-2.36.patch

diff --git a/common/shlibs b/common/shlibs
index f829ee12e80f..776f9b195309 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.1.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.34 perl-5.34.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -848,8 +848,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.1.0_1
+libgnat-12.so libada-12.1.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1700,8 +1700,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.1.0_1
+libasan.so.8 libsanitizer-12.1.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..632ef951097b 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,17 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ a/libgo/go/runtime/os_linux.go
+@@ -363,9 +363,9 @@
+ 
+ 	var timerid int32
+ 	var sevp _sigevent
+-	sevp.sigev_notify = _SIGEV_THREAD_ID
++	sevp.sigev_notify = 4
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.sigev_notify_function))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch b/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
new file mode 100644
index 000000000000..00929202a503
--- /dev/null
+++ b/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
@@ -0,0 +1,105 @@
+From 3b21c21f3f5726823e19728fdd1571a14aae0fb3 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <siarheit@google.com>
+Date: Mon, 27 Jun 2022 13:27:24 +0100
+Subject: [PATCH] c++: avoid <memory> poisoning on musl [PR106102]
+
+On musl <pthread.h> uses calloc() (via <sched.h>). <memory> includes
+it indirectly and exposes use of poisoned calloc() when module code
+is built:
+
+    /build/build/./prev-gcc/xg++ ... ../../gcc-13-20220626/gcc/cp/mapper-resolver.cc
+        In file included from /<<NIX>>/musl-1.2.3-dev/include/pthread.h:30,
+                 from /build/build/prev-x86_64-unknown-linux-musl/libstdc++-v3/include/x86_64-unknown-linux-musl/bits/gthr-default.h:35,
+                 ....
+                 from /build/build/prev-x86_64-unknown-linux-musl/libstdc++-v3/include/memory:77,
+                 from ../../gcc-13-20220626/gcc/../libcody/cody.hh:24,
+                 from ../../gcc-13-20220626/gcc/cp/../../c++tools/resolver.h:25,
+                 from ../../gcc-13-20220626/gcc/cp/../../c++tools/resolver.cc:23,
+                 from ../../gcc-13-20220626/gcc/cp/mapper-resolver.cc:32:
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:84:7: error: attempt to use poisoned "calloc"
+       84 | void *calloc(size_t, size_t);
+          |       ^
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:124:36: error: attempt to use poisoned "calloc"
+      124 | #define CPU_ALLOC(n) ((cpu_set_t *)calloc(1,CPU_ALLOC_SIZE(n)))
+          |                                    ^
+
+gcc/cp/
+
+	PR c++/106102
+	* mapper-client.cc: Include <memory> via "system.h".
+	* mapper-resolver.cc: Ditto.
+	* module.cc: Ditto.
+
+libcc1/
+
+	PR c++/106102
+	* libcc1plugin.cc: Include <memory> via "system.h".
+	* libcp1plugin.cc: Ditto.
+---
+ gcc/cp/mapper-client.cc   | 1 +
+ gcc/cp/mapper-resolver.cc | 1 +
+ gcc/cp/module.cc          | 1 +
+ libcc1/libcc1plugin.cc    | 1 +
+ libcc1/libcp1plugin.cc    | 1 +
+ 5 files changed, 5 insertions(+)
+
+diff --git a/gcc/cp/mapper-client.cc b/gcc/cp/mapper-client.cc
+index 8603a886a099..fe9544b5ba43 100644
+--- a/gcc/cp/mapper-client.cc
++++ b/gcc/cp/mapper-client.cc
+@@ -27,6 +27,7 @@ along with GCC; see the file COPYING3.  If not see
+ #define INCLUDE_STRING
+ #define INCLUDE_VECTOR
+ #define INCLUDE_MAP
++#define INCLUDE_MEMORY
+ #include "system.h"
+ 
+ #include "line-map.h"
+diff --git a/gcc/cp/mapper-resolver.cc b/gcc/cp/mapper-resolver.cc
+index e3d29fb5ada1..e70d1b4ae2ca 100644
+--- a/gcc/cp/mapper-resolver.cc
++++ b/gcc/cp/mapper-resolver.cc
+@@ -25,6 +25,7 @@ along with GCC; see the file COPYING3.  If not see
+ #define INCLUDE_VECTOR
+ #define INCLUDE_ALGORITHM
+ #define INCLUDE_MAP
++#define INCLUDE_MEMORY
+ #include "system.h"
+ 
+ // We don't want or need to be aware of networking
+diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc
+index 753963a4b246..8bb22c2b305a 100644
+--- a/gcc/cp/module.cc
++++ b/gcc/cp/module.cc
+@@ -206,6 +206,7 @@ Classes used:
+ 
+ #define _DEFAULT_SOURCE 1 /* To get TZ field of struct tm, if available.  */
+ #include "config.h"
++#define INCLUDE_MEMORY
+ #define INCLUDE_STRING
+ #define INCLUDE_VECTOR
+ #include "system.h"
+diff --git a/libcc1/libcc1plugin.cc b/libcc1/libcc1plugin.cc
+index 12ab5a57c8dd..bdd0bdabe77f 100644
+--- a/libcc1/libcc1plugin.cc
++++ b/libcc1/libcc1plugin.cc
+@@ -31,6 +31,7 @@
+ #undef PACKAGE_TARNAME
+ #undef PACKAGE_VERSION
+ 
++#define INCLUDE_MEMORY
+ #include "gcc-plugin.h"
+ #include "system.h"
+ #include "coretypes.h"
+diff --git a/libcc1/libcp1plugin.cc b/libcc1/libcp1plugin.cc
+index 83dab7f58b11..e2d5039a0a1f 100644
+--- a/libcc1/libcp1plugin.cc
++++ b/libcc1/libcp1plugin.cc
+@@ -32,6 +32,7 @@
+ #undef PACKAGE_TARNAME
+ #undef PACKAGE_VERSION
+ 
++#define INCLUDE_MEMORY
+ #include "gcc-plugin.h"
+ #include "system.h"
+ #include "coretypes.h"
diff --git a/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch b/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
new file mode 100644
index 000000000000..89bd053d6d04
--- /dev/null
+++ b/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
@@ -0,0 +1,115 @@
+From 49d508065bdd36fb1a9b6aad9666b1edb5e06474 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <siarheit@google.com>
+Date: Mon, 27 Jun 2022 23:42:44 +0100
+Subject: [PATCH] jit: avoid calloc() poisoning on musl [PR106102]
+
+On musl <pthread.h> uses calloc() (via <sched.h>). jit/ includes
+it directly and exposes use of poisoned calloc():
+
+    /build/build/./prev-gcc/xg++ ... ../../gcc-13-20220626/gcc/jit/jit-playback.cc
+    make[3]: *** [Makefile:1143: jit/libgccjit.o] Error 1
+    make[3]: *** Waiting for unfinished jobs....
+    In file included from /<<NIX>>/musl-1.2.3-dev/include/pthread.h:30,
+                     from ../../gcc-13-20220626/gcc/jit/jit-playback.cc:44:
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:84:7: error: attempt to use poisoned "calloc"
+       84 | void *calloc(size_t, size_t);
+          |       ^
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:124:36: error: attempt to use poisoned "calloc"
+      124 | #define CPU_ALLOC(n) ((cpu_set_t *)calloc(1,CPU_ALLOC_SIZE(n)))
+          |                                    ^
+
+The change moves <pthread.h> inclusion to "system.h" under new
+INCLUDE_PTHREAD_H guard and uses this mechanism in libgccjit.
+
+gcc/
+
+	PR c++/106102
+	* system.h: Introduce INCLUDE_PTHREAD_H macros to include <pthread.h>.
+
+gcc/jit/
+
+	PR c++/106102
+	* jit-playback.cc: Include <pthread.h> via "system.h" to avoid calloc()
+	poisoning.
+	* jit-recording.cc: Ditto.
+	* libgccjit.cc: Ditto.
+---
+ gcc/jit/jit-playback.cc  | 3 +--
+ gcc/jit/jit-recording.cc | 2 +-
+ gcc/jit/libgccjit.cc     | 2 +-
+ gcc/system.h             | 4 ++++
+ 4 files changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/gcc/jit/jit-playback.cc b/gcc/jit/jit-playback.cc
+index 6be6bdf8dea5..79714132b91a 100644
+--- a/gcc/jit/jit-playback.cc
++++ b/gcc/jit/jit-playback.cc
+@@ -19,6 +19,7 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "target.h"
+@@ -41,8 +42,6 @@ along with GCC; see the file COPYING3.  If not see
+ #include "diagnostic.h"
+ #include "stmt.h"
+ 
+-#include <pthread.h>
+-
+ #include "jit-playback.h"
+ #include "jit-result.h"
+ #include "jit-builtins.h"
+diff --git a/gcc/jit/jit-recording.cc b/gcc/jit/jit-recording.cc
+index 697dee66e733..f78daed2d71a 100644
+--- a/gcc/jit/jit-recording.cc
++++ b/gcc/jit/jit-recording.cc
+@@ -19,13 +19,13 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "tm.h"
+ #include "pretty-print.h"
+ #include "toplev.h"
+ 
+-#include <pthread.h>
+ 
+ #include "jit-builtins.h"
+ #include "jit-recording.h"
+diff --git a/gcc/jit/libgccjit.cc b/gcc/jit/libgccjit.cc
+index 0e76097b4bac..ca862662777e 100644
+--- a/gcc/jit/libgccjit.cc
++++ b/gcc/jit/libgccjit.cc
+@@ -19,12 +19,12 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "timevar.h"
+ #include "typed-splay-tree.h"
+ #include "cppbuiltin.h"
+-#include <pthread.h>
+ 
+ #include "libgccjit.h"
+ #include "jit-recording.h"
+diff --git a/gcc/system.h b/gcc/system.h
+index 67158b70c789..f8d42ff68150 100644
+--- a/gcc/system.h
++++ b/gcc/system.h
+@@ -753,6 +753,10 @@ extern int vsnprintf (char *, size_t, const char *, va_list);
+ #endif
+ #endif
+ 
++#ifdef INCLUDE_PTHREAD_H
++#include <pthread.h>
++#endif
++
+ #ifdef INCLUDE_ISL
+ #ifdef HAVE_isl
+ #include <isl/options.h>
diff --git a/srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch b/srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch
new file mode 100644
index 000000000000..044a4fc29514
--- /dev/null
+++ b/srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch
@@ -0,0 +1,32 @@
+From f35d65517a59565758107c5b1a51a5fa382f8d1a Mon Sep 17 00:00:00 2001
+From: Ian Lance Taylor <iant@golang.org>
+Date: Tue, 12 Jul 2022 19:42:43 -0700
+Subject: [PATCH] libgo: don't include <linux/fs.h> when building
+ gen-sysinfo.go
+
+Removing this doesn't change anything at least with glibc 2.33.
+The include was added in https://go.dev/cl/6100049 but it's not
+clear why.
+
+Fixes PR go/106266
+
+Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/417294
+---
+ gcc/go/gofrontend/MERGE | 2 +-
+ libgo/sysinfo.c         | 3 ---
+ 2 files changed, 1 insertion(+), 4 deletions(-)
+
+diff --git a/libgo/sysinfo.c b/libgo/sysinfo.c
+index a4259c02ded4..fc0210992faa 100644
+--- a/libgo/sysinfo.c
++++ b/libgo/sysinfo.c
+@@ -158,9 +158,6 @@
+ #if defined(HAVE_LINUX_ETHER_H)
+ #include <linux/ether.h>
+ #endif
+-#if defined(HAVE_LINUX_FS_H)
+-#include <linux/fs.h>
+-#endif
+ #if defined(HAVE_LINUX_REBOOT_H)
+ #include <linux/reboot.h>
+ #endif
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/patches/sanitizer-fix-compat-glibc-2.36.patch b/srcpkgs/gcc/patches/sanitizer-fix-compat-glibc-2.36.patch
new file mode 100644
index 000000000000..851cde0e2077
--- /dev/null
+++ b/srcpkgs/gcc/patches/sanitizer-fix-compat-glibc-2.36.patch
@@ -0,0 +1,39 @@
+From 2701442d0cf6292f6624443c15813d6d1a3562fe Mon Sep 17 00:00:00 2001
+From: Martin Liska <mliska@suse.cz>
+Date: Mon, 11 Jul 2022 22:03:14 +0200
+Subject: [PATCH] libsanitizer: cherry-pick 9cf13067cb5088626ba7 from upstream
+
+9cf13067cb5088626ba7ee1ec4c42ec59c7995a0 [sanitizer] Remove #include <linux/fs.h> to resolve fsconfig_command/mount_attr conflict with glibc 2.36
+---
+ .../sanitizer_platform_limits_posix.cpp                | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
+index 8ed3e92d2704..97fd07acf9d4 100644
+--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -73,7 +73,9 @@
+ #include <sys/vt.h>
+ #include <linux/cdrom.h>
+ #include <linux/fd.h>
++#if SANITIZER_ANDROID
+ #include <linux/fs.h>
++#endif
+ #include <linux/hdreg.h>
+ #include <linux/input.h>
+ #include <linux/ioctl.h>
+@@ -869,10 +871,10 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
+   unsigned IOCTL_EVIOCGPROP = IOCTL_NOT_PRESENT;
+   unsigned IOCTL_EVIOCSKEYCODE_V2 = IOCTL_NOT_PRESENT;
+ #endif
+-  unsigned IOCTL_FS_IOC_GETFLAGS = FS_IOC_GETFLAGS;
+-  unsigned IOCTL_FS_IOC_GETVERSION = FS_IOC_GETVERSION;
+-  unsigned IOCTL_FS_IOC_SETFLAGS = FS_IOC_SETFLAGS;
+-  unsigned IOCTL_FS_IOC_SETVERSION = FS_IOC_SETVERSION;
++  unsigned IOCTL_FS_IOC_GETFLAGS = _IOR('f', 1, long);
++  unsigned IOCTL_FS_IOC_GETVERSION = _IOR('v', 1, long);
++  unsigned IOCTL_FS_IOC_SETFLAGS = _IOW('f', 2, long);
++  unsigned IOCTL_FS_IOC_SETVERSION = _IOW('v', 2, long);
+   unsigned IOCTL_GIO_CMAP = GIO_CMAP;
+   unsigned IOCTL_GIO_FONT = GIO_FONT;
+   unsigned IOCTL_GIO_UNIMAP = GIO_UNIMAP;
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..32ee79e32f0d 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,15 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
+version=12.1.0
+revision=1
 _patchver="${version%pre*}"
 _minorver="${_patchver%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 wrksrc=gcc-${version/pre/_pre}
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +19,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -396,7 +393,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}

From d195875f92651a8b06088dd13dc70ff7c8d58f47 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 03/46] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      |  6 ++--
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..08e35d466a44 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From c1ce82084255698b93d4237acac7697d4aafc05c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 04/46] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 1a4e1ca3d594..b04268908c2e 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="q66 <daniel@octaforge.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From 817c55ff7a63979fcedea952976d638bf463c655 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 05/46] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 3 files changed, 55 insertions(+), 353 deletions(-)
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index 776f9b195309..46c0680d55dd 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From 43f9c8bd8fbbaeeacbb5ccfede38ef28a23e3d63 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 21:01:43 -0700
Subject: [PATCH 06/46] gcc-multilib: update to 12.1.0.

---
 .../sanitizer-fix-compat-glibc-2.36.patch     | 39 +++++++++++++++++++
 srcpkgs/gcc-multilib/template                 |  8 ++--
 2 files changed, 43 insertions(+), 4 deletions(-)
 create mode 100644 srcpkgs/gcc-multilib/patches/sanitizer-fix-compat-glibc-2.36.patch

diff --git a/srcpkgs/gcc-multilib/patches/sanitizer-fix-compat-glibc-2.36.patch b/srcpkgs/gcc-multilib/patches/sanitizer-fix-compat-glibc-2.36.patch
new file mode 100644
index 000000000000..851cde0e2077
--- /dev/null
+++ b/srcpkgs/gcc-multilib/patches/sanitizer-fix-compat-glibc-2.36.patch
@@ -0,0 +1,39 @@
+From 2701442d0cf6292f6624443c15813d6d1a3562fe Mon Sep 17 00:00:00 2001
+From: Martin Liska <mliska@suse.cz>
+Date: Mon, 11 Jul 2022 22:03:14 +0200
+Subject: [PATCH] libsanitizer: cherry-pick 9cf13067cb5088626ba7 from upstream
+
+9cf13067cb5088626ba7ee1ec4c42ec59c7995a0 [sanitizer] Remove #include <linux/fs.h> to resolve fsconfig_command/mount_attr conflict with glibc 2.36
+---
+ .../sanitizer_platform_limits_posix.cpp                | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
+index 8ed3e92d2704..97fd07acf9d4 100644
+--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -73,7 +73,9 @@
+ #include <sys/vt.h>
+ #include <linux/cdrom.h>
+ #include <linux/fd.h>
++#if SANITIZER_ANDROID
+ #include <linux/fs.h>
++#endif
+ #include <linux/hdreg.h>
+ #include <linux/input.h>
+ #include <linux/ioctl.h>
+@@ -869,10 +871,10 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
+   unsigned IOCTL_EVIOCGPROP = IOCTL_NOT_PRESENT;
+   unsigned IOCTL_EVIOCSKEYCODE_V2 = IOCTL_NOT_PRESENT;
+ #endif
+-  unsigned IOCTL_FS_IOC_GETFLAGS = FS_IOC_GETFLAGS;
+-  unsigned IOCTL_FS_IOC_GETVERSION = FS_IOC_GETVERSION;
+-  unsigned IOCTL_FS_IOC_SETFLAGS = FS_IOC_SETFLAGS;
+-  unsigned IOCTL_FS_IOC_SETVERSION = FS_IOC_SETVERSION;
++  unsigned IOCTL_FS_IOC_GETFLAGS = _IOR('f', 1, long);
++  unsigned IOCTL_FS_IOC_GETVERSION = _IOR('v', 1, long);
++  unsigned IOCTL_FS_IOC_SETFLAGS = _IOW('f', 2, long);
++  unsigned IOCTL_FS_IOC_SETVERSION = _IOW('v', 2, long);
+   unsigned IOCTL_GIO_CMAP = GIO_CMAP;
+   unsigned IOCTL_GIO_FONT = GIO_FONT;
+   unsigned IOCTL_GIO_UNIMAP = GIO_UNIMAP;
diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index fcd25755aa75..573d323fe05e 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,16 +3,16 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.1.0
 revision=1
 _majorver="${version%.*}"
-wrksrc=gcc-${version/pre/_pre}
+wrksrc=gcc-${version}
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel

From c6785af852e0236b9db161fc35fd4fb781bc50e7 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 16:22:03 -0700
Subject: [PATCH 07/46] llvm12: fix build for glibc 2.36

---
 .../compiler-rt-sanitizer-glibc-2.36.patch    | 59 +++++++++++++++++++
 .../compiler-rt-sanitizer-glibc-2.36.patch    | 59 +++++++++++++++++++
 2 files changed, 118 insertions(+)
 create mode 100644 srcpkgs/llvm12/compiler-rt-sanitizer-glibc-2.36.patch
 create mode 100644 srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch

diff --git a/srcpkgs/llvm12/compiler-rt-sanitizer-glibc-2.36.patch b/srcpkgs/llvm12/compiler-rt-sanitizer-glibc-2.36.patch
new file mode 100644
index 000000000000..e5f24dab8935
--- /dev/null
+++ b/srcpkgs/llvm12/compiler-rt-sanitizer-glibc-2.36.patch
@@ -0,0 +1,59 @@
+From 9cf13067cb5088626ba7ee1ec4c42ec59c7995a0 Mon Sep 17 00:00:00 2001
+From: Fangrui Song <i@maskray.me>
+Date: Mon, 11 Jul 2022 12:53:34 -0700
+Subject: [PATCH] [sanitizer] Remove #include <linux/fs.h> to resolve
+ fsconfig_command/mount_attr conflict with glibc 2.36
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+It is generally not a good idea to mix usage of glibc headers and Linux UAPI
+headers (https://sourceware.org/glibc/wiki/Synchronizing_Headers). In glibc
+since 7eae6a91e9b1670330c9f15730082c91c0b1d570 (milestone: 2.36), sys/mount.h
+defines `fsconfig_command` which conflicts with linux/mount.h:
+
+    .../usr/include/linux/mount.h:95:6: error: redeclaration of ‘enum fsconfig_command’
+
+Remove #include <linux/fs.h> which pulls in linux/mount.h. Expand its 4 macros manually.
+Android sys/mount.h doesn't define BLKBSZGET and it still needs linux/fs.h.
+In the long term we should move Linux specific definitions to sanitizer_platform_limits_linux.cpp
+but this commit is easy to cherry pick into older compiler-rt releases.
+
+Fix https://github.com/llvm/llvm-project/issues/56421
+
+Reviewed By: #sanitizers, vitalybuka, zatrazz
+
+Differential Revision: https://reviews.llvm.org/D129471
+---
+ .../sanitizer_platform_limits_posix.cpp                | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+index 4bd425435d56d..3a94b260686f1 100644
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -73,7 +73,9 @@
+ #include <sys/vt.h>
+ #include <linux/cdrom.h>
+ #include <linux/fd.h>
++#if SANITIZER_ANDROID
+ #include <linux/fs.h>
++#endif
+ #include <linux/hdreg.h>
+ #include <linux/input.h>
+ #include <linux/ioctl.h>
+@@ -876,10 +878,10 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
+   unsigned IOCTL_EVIOCGPROP = IOCTL_NOT_PRESENT;
+   unsigned IOCTL_EVIOCSKEYCODE_V2 = IOCTL_NOT_PRESENT;
+ #endif
+-  unsigned IOCTL_FS_IOC_GETFLAGS = FS_IOC_GETFLAGS;
+-  unsigned IOCTL_FS_IOC_GETVERSION = FS_IOC_GETVERSION;
+-  unsigned IOCTL_FS_IOC_SETFLAGS = FS_IOC_SETFLAGS;
+-  unsigned IOCTL_FS_IOC_SETVERSION = FS_IOC_SETVERSION;
++  unsigned IOCTL_FS_IOC_GETFLAGS = _IOR('f', 1, long);
++  unsigned IOCTL_FS_IOC_GETVERSION = _IOR('v', 1, long);
++  unsigned IOCTL_FS_IOC_SETFLAGS = _IOW('f', 2, long);
++  unsigned IOCTL_FS_IOC_SETVERSION = _IOW('v', 2, long);
+   unsigned IOCTL_GIO_CMAP = GIO_CMAP;
+   unsigned IOCTL_GIO_FONT = GIO_FONT;
+   unsigned IOCTL_GIO_UNIMAP = GIO_UNIMAP;
diff --git a/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch b/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch
new file mode 100644
index 000000000000..e5f24dab8935
--- /dev/null
+++ b/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch
@@ -0,0 +1,59 @@
+From 9cf13067cb5088626ba7ee1ec4c42ec59c7995a0 Mon Sep 17 00:00:00 2001
+From: Fangrui Song <i@maskray.me>
+Date: Mon, 11 Jul 2022 12:53:34 -0700
+Subject: [PATCH] [sanitizer] Remove #include <linux/fs.h> to resolve
+ fsconfig_command/mount_attr conflict with glibc 2.36
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+It is generally not a good idea to mix usage of glibc headers and Linux UAPI
+headers (https://sourceware.org/glibc/wiki/Synchronizing_Headers). In glibc
+since 7eae6a91e9b1670330c9f15730082c91c0b1d570 (milestone: 2.36), sys/mount.h
+defines `fsconfig_command` which conflicts with linux/mount.h:
+
+    .../usr/include/linux/mount.h:95:6: error: redeclaration of ‘enum fsconfig_command’
+
+Remove #include <linux/fs.h> which pulls in linux/mount.h. Expand its 4 macros manually.
+Android sys/mount.h doesn't define BLKBSZGET and it still needs linux/fs.h.
+In the long term we should move Linux specific definitions to sanitizer_platform_limits_linux.cpp
+but this commit is easy to cherry pick into older compiler-rt releases.
+
+Fix https://github.com/llvm/llvm-project/issues/56421
+
+Reviewed By: #sanitizers, vitalybuka, zatrazz
+
+Differential Revision: https://reviews.llvm.org/D129471
+---
+ .../sanitizer_platform_limits_posix.cpp                | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+index 4bd425435d56d..3a94b260686f1 100644
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -73,7 +73,9 @@
+ #include <sys/vt.h>
+ #include <linux/cdrom.h>
+ #include <linux/fd.h>
++#if SANITIZER_ANDROID
+ #include <linux/fs.h>
++#endif
+ #include <linux/hdreg.h>
+ #include <linux/input.h>
+ #include <linux/ioctl.h>
+@@ -876,10 +878,10 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
+   unsigned IOCTL_EVIOCGPROP = IOCTL_NOT_PRESENT;
+   unsigned IOCTL_EVIOCSKEYCODE_V2 = IOCTL_NOT_PRESENT;
+ #endif
+-  unsigned IOCTL_FS_IOC_GETFLAGS = FS_IOC_GETFLAGS;
+-  unsigned IOCTL_FS_IOC_GETVERSION = FS_IOC_GETVERSION;
+-  unsigned IOCTL_FS_IOC_SETFLAGS = FS_IOC_SETFLAGS;
+-  unsigned IOCTL_FS_IOC_SETVERSION = FS_IOC_SETVERSION;
++  unsigned IOCTL_FS_IOC_GETFLAGS = _IOR('f', 1, long);
++  unsigned IOCTL_FS_IOC_GETVERSION = _IOR('v', 1, long);
++  unsigned IOCTL_FS_IOC_SETFLAGS = _IOW('f', 2, long);
++  unsigned IOCTL_FS_IOC_SETVERSION = _IOW('v', 2, long);
+   unsigned IOCTL_GIO_CMAP = GIO_CMAP;
+   unsigned IOCTL_GIO_FONT = GIO_FONT;
+   unsigned IOCTL_GIO_UNIMAP = GIO_UNIMAP;

From ee576cf7253762769809e1461966d353ac501bce Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 17:21:40 -0700
Subject: [PATCH 08/46] m4: update to 1.4.19.

---
 srcpkgs/m4/patches/fix-glibc-2.27.patch | 167 ------------------------
 srcpkgs/m4/template                     |  12 +-
 2 files changed, 6 insertions(+), 173 deletions(-)
 delete mode 100644 srcpkgs/m4/patches/fix-glibc-2.27.patch

diff --git a/srcpkgs/m4/patches/fix-glibc-2.27.patch b/srcpkgs/m4/patches/fix-glibc-2.27.patch
deleted file mode 100644
index 59d33cff164d..000000000000
--- a/srcpkgs/m4/patches/fix-glibc-2.27.patch
+++ /dev/null
@@ -1,167 +0,0 @@
-From 4af4a4a71827c0bc5e0ec67af23edef4f15cee8e Mon Sep 17 00:00:00 2001
-From: Paul Eggert <eggert@cs.ucla.edu>
-Date: Mon, 5 Mar 2018 10:56:29 -0800
-Subject: [PATCH] fflush: adjust to glibc 2.28 libio.h removal
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Problem reported by Daniel P. Berrangé in:
-https://lists.gnu.org/r/bug-gnulib/2018-03/msg00000.html
-* lib/fbufmode.c (fbufmode):
-* lib/fflush.c (clear_ungetc_buffer_preserving_position)
-(disable_seek_optimization, rpl_fflush):
-* lib/fpending.c (__fpending):
-* lib/fpurge.c (fpurge):
-* lib/freadable.c (freadable):
-* lib/freadahead.c (freadahead):
-* lib/freading.c (freading):
-* lib/freadptr.c (freadptr):
-* lib/freadseek.c (freadptrinc):
-* lib/fseeko.c (fseeko):
-* lib/fseterr.c (fseterr):
-* lib/fwritable.c (fwritable):
-* lib/fwriting.c (fwriting):
-Check _IO_EOF_SEEN instead of _IO_ftrylockfile.
-* lib/stdio-impl.h (_IO_IN_BACKUP) [_IO_EOF_SEEN]:
-Define if not already defined.
-
-[yann.morin.1998@free.fr: partially backport from upstream gnulib]
-Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
-
----
- lib/fflush.c     |  6 +++---
- lib/fpending.c   |  2 +-
- lib/fpurge.c     |  2 +-
- lib/freadahead.c |  2 +-
- lib/freading.c   |  2 +-
- lib/fseeko.c     |  4 ++--
- lib/stdio-impl.h |  6 ++++++
- 7 files changed, 15 insertions(+), 9 deletions(-)
-
-diff --git a/lib/fflush.c b/build-aux/gnulib/lib/fflush.c
-index 983ade0ff..a6edfa105 100644
---- a/lib/fflush.c
-+++ b/lib/fflush.c
-@@ -33,7 +33,7 @@
- #undef fflush
- 
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- 
- /* Clear the stream's ungetc buffer, preserving the value of ftello (fp).  */
- static void
-@@ -72,7 +72,7 @@ clear_ungetc_buffer (FILE *fp)
- 
- #endif
- 
--#if ! (defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
-+#if ! (defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
- 
- # if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT
- /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
-@@ -148,7 +148,7 @@ rpl_fflush (FILE *stream)
-   if (stream == NULL || ! freading (stream))
-     return fflush (stream);
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- 
-   clear_ungetc_buffer_preserving_position (stream);
- 
-diff --git a/lib/fpending.c b/build-aux/gnulib/lib/fpending.c
-index c84e3a5b4..789f50e4e 100644
---- a/lib/fpending.c
-+++ b/lib/fpending.c
-@@ -32,7 +32,7 @@ __fpending (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   return fp->_IO_write_ptr - fp->_IO_write_base;
- #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
-   /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
-diff --git a/lib/fpurge.c b/build-aux/gnulib/lib/fpurge.c
-index b1d417c7a..3aedcc373 100644
---- a/lib/fpurge.c
-+++ b/lib/fpurge.c
-@@ -62,7 +62,7 @@ fpurge (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   fp->_IO_read_end = fp->_IO_read_ptr;
-   fp->_IO_write_ptr = fp->_IO_write_base;
-   /* Avoid memory leak when there is an active ungetc buffer.  */
-diff --git a/lib/freadahead.c b/build-aux/gnulib/lib/freadahead.c
-index c2ecb5b28..23ec76ee5 100644
---- a/lib/freadahead.c
-+++ b/lib/freadahead.c
-@@ -30,7 +30,7 @@ extern size_t __sreadahead (FILE *);
- size_t
- freadahead (FILE *fp)
- {
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   if (fp->_IO_write_ptr > fp->_IO_write_base)
-     return 0;
-   return (fp->_IO_read_end - fp->_IO_read_ptr)
-diff --git a/lib/freading.c b/build-aux/gnulib/lib/freading.c
-index 73c28acdd..c24d0c88a 100644
---- a/lib/freading.c
-+++ b/lib/freading.c
-@@ -31,7 +31,7 @@ freading (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   return ((fp->_flags & _IO_NO_WRITES) != 0
-           || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0
-               && fp->_IO_read_base != NULL));
-diff --git a/lib/fseeko.c b/build-aux/gnulib/lib/fseeko.c
-index 0101ab55f..193f4e8ce 100644
---- a/lib/fseeko.c
-+++ b/lib/fseeko.c
-@@ -47,7 +47,7 @@ fseeko (FILE *fp, off_t offset, int whence)
- #endif
- 
-   /* These tests are based on fpurge.c.  */
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   if (fp->_IO_read_end == fp->_IO_read_ptr
-       && fp->_IO_write_ptr == fp->_IO_write_base
-       && fp->_IO_save_base == NULL)
-@@ -123,7 +123,7 @@ fseeko (FILE *fp, off_t offset, int whence)
-           return -1;
-         }
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-       fp->_flags &= ~_IO_EOF_SEEN;
-       fp->_offset = pos;
- #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
-diff --git a/lib/stdio-impl.h b/build-aux/gnulib/lib/stdio-impl.h
-index 78d896e9f..05c5752a2 100644
---- a/lib/stdio-impl.h
-+++ b/lib/stdio-impl.h
-@@ -18,6 +18,12 @@
-    the same implementation of stdio extension API, except that some fields
-    have different naming conventions, or their access requires some casts.  */
- 
-+/* Glibc 2.28 made _IO_IN_BACKUP private.  For now, work around this
-+   problem by defining it ourselves.  FIXME: Do not rely on glibc
-+   internals.  */
-+#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN
-+# define _IO_IN_BACKUP 0x100
-+#endif
- 
- /* BSD stdio derived implementations.  */
- 
--- 
-2.14.1
-
-
diff --git a/srcpkgs/m4/template b/srcpkgs/m4/template
index 78f3dae6184a..762593d883bd 100644
--- a/srcpkgs/m4/template
+++ b/srcpkgs/m4/template
@@ -1,17 +1,17 @@
 # Template file for 'm4'
 pkgname=m4
-version=1.4.18
-revision=2
+version=1.4.19
+revision=1
 bootstrap=yes
-replaces="chroot-m4>=0"
 build_style=gnu-configure
 configure_args="--enable-changeword --enable-threads"
 short_desc="GNU version of UNIX m4 macro language processor"
-homepage="https://www.gnu.org/software/m4/"
-license="GPL-3.0-or-later"
 maintainer="Enno Boland <gottox@voidlinux.org>"
+license="GPL-3.0-or-later"
+homepage="https://www.gnu.org/software/m4/"
 distfiles="${GNU_SITE}/${pkgname}/${pkgname}-${version}.tar.xz"
-checksum=f2c1e86ca0a404ff281631bdc8377638992744b175afb806e25871a24a934e07
+checksum=63aede5c6d33b6d9b13511cd0be2cac046f2e70fd0a07aa9573a04a82783af96
+replaces="chroot-m4>=0"
 
 if [ "$XBPS_TARGET_LIBC" = musl ]; then
 	export ac_cv_lib_error_at_line=no

From ea4af557b64d10052d78bc4cf9011698719c05be Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 22:57:59 -0700
Subject: [PATCH 09/46] btrfs-progs: update to 5.19.

---
 srcpkgs/btrfs-progs/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/btrfs-progs/template b/srcpkgs/btrfs-progs/template
index f6c53d8587e1..292d5110106b 100644
--- a/srcpkgs/btrfs-progs/template
+++ b/srcpkgs/btrfs-progs/template
@@ -1,6 +1,6 @@
 # Template file for 'btrfs-progs'
 pkgname=btrfs-progs
-version=5.18.1
+version=5.19
 revision=1
 wrksrc="${pkgname}-v${version}"
 build_style=gnu-configure
@@ -16,7 +16,7 @@ license="GPL-2.0-only, LGPL-2.1-or-later"
 homepage="https://btrfs.wiki.kernel.org/index.php/Main_Page"
 changelog="https://raw.githubusercontent.com/kdave/btrfs-progs/master/CHANGES"
 distfiles="${KERNEL_SITE}/kernel/people/kdave/${pkgname}/${pkgname}-v${version}.tar.xz"
-checksum=6e98a75ccff52e9354daa1ad284c614c490f844273a2fa524cbac9eb841c7255
+checksum=1fbcf06e4b2f80e7a127fd687ed4625a5b74fa674fe212c836ff70e0edfcccf9
 # Most of the tests depend on `mount` and `fallocate` commands, which are not
 # presented in chroot-util-linux
 make_check=no

From 666d2bc29f53a9ce6f003b22fe0adabf49160744 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 14 Aug 2022 19:29:36 -0700
Subject: [PATCH 10/46] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove nopie=yes. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh             |  1 +
 common/environment/build-style/void-cross.sh | 36 +++++++++++++++++++-
 2 files changed, 36 insertions(+), 1 deletion(-)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..c24013755704 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -132,6 +132,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
diff --git a/common/environment/build-style/void-cross.sh b/common/environment/build-style/void-cross.sh
index 62ce9eaa2e4a..4b77c90efc8b 100644
--- a/common/environment/build-style/void-cross.sh
+++ b/common/environment/build-style/void-cross.sh
@@ -1,6 +1,40 @@
 lib32disabled=yes
-nopie=yes
 create_wrksrc=yes
 
 nostrip_files+=" libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a libgmem.a"
+nopie_files+=" /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/go1
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/lto-wrapper
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/plugin/gengtype
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/cc1objplus
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/cc1obj
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/collect2
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/lto1
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/f951
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/cc1
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/gnat1
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/cc1plus
+ /usr/bin/${sourcepkg/cross-}-gcov-dump
+ /usr/bin/${sourcepkg/cross-}-gnatlink
+ /usr/bin/${sourcepkg/cross-}-gnatbind
+ /usr/bin/${sourcepkg/cross-}-gcc
+ /usr/bin/${sourcepkg/cross-}-cpp
+ /usr/bin/${sourcepkg/cross-}-gnatchop
+ /usr/bin/${sourcepkg/cross-}-gfortran
+ /usr/bin/${sourcepkg/cross-}-gccgo
+ /usr/bin/${sourcepkg/cross-}-c++
+ /usr/bin/${sourcepkg/cross-}-lto-dump
+ /usr/bin/${sourcepkg/cross-}-gnatname
+ /usr/bin/${sourcepkg/cross-}-gnatprep
+ /usr/bin/${sourcepkg/cross-}-g++
+ /usr/bin/${sourcepkg/cross-}-gnat
+ /usr/bin/${sourcepkg/cross-}-gcc-ranlib
+ /usr/bin/${sourcepkg/cross-}-gnatkr
+ /usr/bin/${sourcepkg/cross-}-gnatmake
+ /usr/bin/${sourcepkg/cross-}-gcc-${_gcc_version}
+ /usr/bin/${sourcepkg/cross-}-gcc-ar
+ /usr/bin/${sourcepkg/cross-}-gnatclean
+ /usr/bin/${sourcepkg/cross-}-gcov
+ /usr/bin/${sourcepkg/cross-}-gnatls
+ /usr/bin/${sourcepkg/cross-}-gcc-nm
+ /usr/bin/${sourcepkg/cross-}-gcov-tool"

From eae3715bfd43121bf9df25bf4a8263c1722fae08 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:08:52 -0700
Subject: [PATCH 11/46] openssh: suppress werror on gcc12

---
 srcpkgs/openssh/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/openssh/template b/srcpkgs/openssh/template
index 02a2dec35f42..6e8e343a9dca 100644
--- a/srcpkgs/openssh/template
+++ b/srcpkgs/openssh/template
@@ -40,7 +40,7 @@ if [ "$build_option_ldns" -a -z "$build_option_ssl" ]; then
 	broken="option 'ldns' requires option 'ssl'"
 fi
 
-CFLAGS="-Wno-format-truncation -Wno-stringop-truncation"
+CFLAGS="-Wno-format-truncation -Wno-stringop-truncation -Wno-error=maybe-uninitialized"
 
 case $XBPS_TARGET_MACHINE in
 	i686-musl)

From 8b6704c5d24a1db84648bae36c398ce87469974e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:09:31 -0700
Subject: [PATCH 12/46] linux5.18: update dotconfigs for gcc12

---
 srcpkgs/linux5.18/files/x86_64-dotconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/linux5.18/files/x86_64-dotconfig b/srcpkgs/linux5.18/files/x86_64-dotconfig
index 4e73a3195d40..ea6204868e23 100644
--- a/srcpkgs/linux5.18/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.18/files/x86_64-dotconfig
@@ -512,6 +512,7 @@ CONFIG_RETHUNK=y
 CONFIG_CPU_UNRET_ENTRY=y
 CONFIG_CPU_IBPB_ENTRY=y
 CONFIG_CPU_IBRS_ENTRY=y
+CONFIG_SLS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10060,8 +10061,11 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
 # Memory initialization
 #
 CONFIG_INIT_STACK_NONE=y
+# CONFIG_INIT_STACK_ALL_PATTERN is not set
+# CONFIG_INIT_STACK_ALL_ZERO is not set
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
+# CONFIG_ZERO_CALL_USED_REGS is not set
 # end of Memory initialization
 # end of Kernel hardening options
 # end of Security options
@@ -10538,6 +10542,7 @@ CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
 # CONFIG_UBSAN is not set
 CONFIG_HAVE_ARCH_KCSAN=y
+# CONFIG_KCSAN is not set
 # end of Generic Kernel Debugging Instruments
 
 #

From bdaecc8ce3c43c2c031a37dc4d2679ffa8f6f42c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 18:00:42 -0700
Subject: [PATCH 13/46] xf86-video-vmware: fix build on gcc12

---
 ...183b3395333d5d4c73e25c2d011748f15eda.patch | 30 +++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch

diff --git a/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch b/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch
new file mode 100644
index 000000000000..ff839f16e628
--- /dev/null
+++ b/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch
@@ -0,0 +1,30 @@
+From 77b8183b3395333d5d4c73e25c2d011748f15eda Mon Sep 17 00:00:00 2001
+From: Rudi Heitbaum <rudi@heitbaum.com>
+Date: Sun, 8 May 2022 03:00:10 +0000
+Subject: [PATCH] vmwgfx: fix missing array notation
+
+ Fixes error identified by gcc-12.1.0 compiler
+
+make
+  CC       libvmwgfx_la-vmwgfx_tex_video.lo
+vmwgfx_tex_video.c: In function 'stop_video':
+vmwgfx_tex_video.c:240:20: error: the comparison will always evaluate as 'true' for the address of 'yuv' will never be NULL [-Werror=address]
+  240 |                if (priv->yuv[i]) {
+      |                    ^~~~
+---
+ vmwgfx/vmwgfx_tex_video.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/vmwgfx/vmwgfx_tex_video.c b/vmwgfx/vmwgfx_tex_video.c
+index acc2b56..480a5f1 100644
+--- a/vmwgfx/vmwgfx_tex_video.c
++++ b/vmwgfx/vmwgfx_tex_video.c
+@@ -237,7 +237,7 @@ stop_video(ScrnInfoPtr pScrn, pointer data, Bool shutdown)
+ 
+        for (i=0; i<3; ++i) {
+ 	   for (j=0; j<2; ++j) {
+-	       if (priv->yuv[i]) {
++	       if (priv->yuv[j][i]) {
+ 		   xa_surface_destroy(priv->yuv[j][i]);
+ 		   priv->yuv[j][i] = NULL;
+ 	       }

From 17569e7e860162681a157a69b110c0c23c29ed3a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 18:24:37 -0700
Subject: [PATCH 14/46] doxygen: fix build for gcc 12

---
 srcpkgs/doxygen/patches/compat-gcc12.patch | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100644 srcpkgs/doxygen/patches/compat-gcc12.patch

diff --git a/srcpkgs/doxygen/patches/compat-gcc12.patch b/srcpkgs/doxygen/patches/compat-gcc12.patch
new file mode 100644
index 000000000000..666744a1dceb
--- /dev/null
+++ b/srcpkgs/doxygen/patches/compat-gcc12.patch
@@ -0,0 +1,22 @@
+From 5198966c8d5fec89116d025c74934ac03ea511fa Mon Sep 17 00:00:00 2001
+From: Dimitri van Heesch <doxygen@gmail.com>
+Date: Fri, 6 May 2022 09:55:16 +0200
+Subject: [PATCH] issue #9312: Build: cache.h:53:14: error: 'exchange' is not a
+ member of 'std'
+
+---
+ src/cache.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/cache.h b/src/cache.h
+index 0ff3092ed5..e218eb27d2 100644
+--- a/src/cache.h
++++ b/src/cache.h
+@@ -19,6 +19,7 @@
+ #include <list>
+ #include <unordered_map>
+ #include <mutex>
++#include <utility>
+ #include <ctype.h>
+ 
+ /*! Fixed size cache for value type V using keys of type K.

From f09dc7d85f25e4b67f4c9d6f26117e4d4a244594 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 21 Aug 2022 15:12:00 -0700
Subject: [PATCH 15/46] libproxy: update to 0.4.18

---
 srcpkgs/libproxy/template | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/libproxy/template b/srcpkgs/libproxy/template
index d6103007032e..6599dfb69b98 100644
--- a/srcpkgs/libproxy/template
+++ b/srcpkgs/libproxy/template
@@ -1,18 +1,22 @@
 # Template file for 'libproxy'
 pkgname=libproxy
-version=0.4.15
+version=0.4.18
 revision=1
 build_style=cmake
 configure_args="-DWITH_GNOME=0 -DWITH_KDE4=0 -DWITH_MOZJS=0 -DWITH_NM=0
  -DWITH_PERL=0 -DWITH_PYTHON=1 -DWITH_WEBKIT=0"
 hostmakedepends="pkg-config python"
 makedepends="zlib-devel"
-short_desc="A library handling all the details of proxy configuration"
+short_desc="Library handling all the details of proxy configuration"
 maintainer="Orphaned <orphan@voidlinux.org>"
+license="LGPL-2.1-or-later"
 homepage="http://github.com/libproxy/libproxy"
-license="LGPL-2.1"
-distfiles="https://github.com/libproxy/libproxy/archive/${version}.tar.gz>${pkgname}-${version}.tar.gz"
-checksum=18f58b0a0043b6881774187427ead158d310127fc46a1c668ad6d207fb28b4e0
+distfiles="https://github.com/libproxy/libproxy/archive/${version}.tar.gz"
+checksum=0b4a9218d88f6cf9fa25996a3f38329a11f688a9d026141d9d0e966d8fa63837
+
+post_patch() {
+	vsed '/add_test(NAME url-test/d' -i libproxy/test/CMakeLists.txt
+}
 
 libproxy-devel_package() {
 	depends="libproxy>=${version}_${revision}"

From a6e04f2de0b1314b2c48695bca810fe223527e62 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 21 Aug 2022 17:05:39 -0700
Subject: [PATCH 16/46] exempi: update to 2.6.2

---
 ...f034705fd2d032c81383eee8208fd4eee0ac.patch | 43 -------------------
 srcpkgs/exempi/template                       |  4 +-
 2 files changed, 2 insertions(+), 45 deletions(-)
 delete mode 100644 srcpkgs/exempi/patches/8ed2f034705fd2d032c81383eee8208fd4eee0ac.patch

diff --git a/srcpkgs/exempi/patches/8ed2f034705fd2d032c81383eee8208fd4eee0ac.patch b/srcpkgs/exempi/patches/8ed2f034705fd2d032c81383eee8208fd4eee0ac.patch
deleted file mode 100644
index 2696793cec09..000000000000
--- a/srcpkgs/exempi/patches/8ed2f034705fd2d032c81383eee8208fd4eee0ac.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From 8ed2f034705fd2d032c81383eee8208fd4eee0ac Mon Sep 17 00:00:00 2001
-From: Victor Rodriguez <victor.rodriguez.bahena@intel.com>
-Date: Sat, 18 Aug 2018 13:54:55 +0000
-Subject: [PATCH] Issue #9 - Fix null-pointer-dereference (CVE-2018-12648)
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-The WEBP::GetLE32 function in
-XMPFiles/source/FormatSupport/WEBP_Support.hpp in Exempi 2.4.5 has a
-NULL pointer dereference.
-
-https://bugs.freedesktop.org/show_bug.cgi?id=106981
-https://gitlab.freedesktop.org/libopenraw/exempi/issues/9
-
-Signed-off-by: Victor Rodriguez <victor.rodriguez.bahena@intel.com>
-Signed-off-by: Hubert Figuière <hub@figuiere.net>
----
- XMPFiles/source/FormatSupport/WEBP_Support.cpp | 8 +++++---
- 1 file changed, 5 insertions(+), 3 deletions(-)
-
-diff --git a/XMPFiles/source/FormatSupport/WEBP_Support.cpp b/XMPFiles/source/FormatSupport/WEBP_Support.cpp
-index ffaf220..4fe705b 100644
---- a/XMPFiles/source/FormatSupport/WEBP_Support.cpp
-+++ b/XMPFiles/source/FormatSupport/WEBP_Support.cpp
-@@ -160,9 +160,11 @@ bool VP8XChunk::xmp()
- }
- void VP8XChunk::xmp(bool hasXMP)
- {
--    XMP_Uns32 flags = GetLE32(&this->data[0]);
--    flags ^= (-hasXMP ^ flags) & (1 << XMP_FLAG_BIT);
--    PutLE32(&this->data[0], flags);
-+    if (&this->data[0] != NULL) {
-+        XMP_Uns32 flags = GetLE32(&this->data[0]);
-+        flags ^= (-hasXMP ^ flags) & (1 << XMP_FLAG_BIT);
-+        PutLE32(&this->data[0], flags);
-+    }
- }
- 
- Container::Container(WEBP_MetaHandler* handler) : Chunk(NULL, handler)
--- 
-2.18.0
-
diff --git a/srcpkgs/exempi/template b/srcpkgs/exempi/template
index 14753617953a..d664f7dc4d80 100644
--- a/srcpkgs/exempi/template
+++ b/srcpkgs/exempi/template
@@ -1,6 +1,6 @@
 # Template file for 'exempi'
 pkgname=exempi
-version=2.5.0
+version=2.6.2
 revision=1
 build_style=gnu-configure
 configure_args="--with-boost=${XBPS_CROSS_BASE}/usr --disable-static --disable-unittest"
@@ -10,7 +10,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="BSD-3-Clause"
 homepage="https://libopenraw.freedesktop.org/wiki/Exempi"
 distfiles="https://libopenraw.freedesktop.org/download/exempi-${version}.tar.bz2"
-checksum=dc82fc24c0540a44a63fa4ad21775d24e00e63f1dedd3e2ae6f7aa27583b711b
+checksum=4d17d4c93df2a95da3e3172c45b7a5bf317dd31dafd1c7a340169728c7089d1d
 
 post_install() {
 	vlicense COPYING

From 8a51e86f810ee9a2d1254840789eb15f94a783e1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 21 Aug 2022 21:36:03 -0700
Subject: [PATCH 17/46] plymouth: update to 22.02.122

---
 srcpkgs/plymouth/patches/fix-glibc-2.36.patch | 30 +++++++++++++++++++
 srcpkgs/plymouth/template                     |  4 +--
 2 files changed, 32 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/plymouth/patches/fix-glibc-2.36.patch

diff --git a/srcpkgs/plymouth/patches/fix-glibc-2.36.patch b/srcpkgs/plymouth/patches/fix-glibc-2.36.patch
new file mode 100644
index 000000000000..2f1e43875cfb
--- /dev/null
+++ b/srcpkgs/plymouth/patches/fix-glibc-2.36.patch
@@ -0,0 +1,30 @@
+From 5f1e43c00039a7fe1fff768b91a05a695fb4a53d Mon Sep 17 00:00:00 2001
+From: Ray Strode <rstrode@redhat.com>
+Date: Wed, 3 Aug 2022 15:23:33 -0400
+Subject: [PATCH] ply-utils: Drop linux/fs.h include
+
+It was needed long ago for a function we no longer even have.
+
+Now it's causing compile errors on Fedora 37 because it's conflicting
+with sys/mount.h.
+
+This commit drops it.
+---
+ src/libply/ply-utils.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/src/libply/ply-utils.c b/src/libply/ply-utils.c
+index c7b165e9..219e2e77 100644
+--- a/src/libply/ply-utils.c
++++ b/src/libply/ply-utils.c
+@@ -46,7 +46,6 @@
+ #include <sys/user.h>
+ #include <sys/wait.h>
+ #include <time.h>
+-#include <linux/fs.h>
+ #include <linux/vt.h>
+ 
+ #include <dlfcn.h>
+-- 
+GitLab
+
diff --git a/srcpkgs/plymouth/template b/srcpkgs/plymouth/template
index 17f801fc5315..442ab58a99cd 100644
--- a/srcpkgs/plymouth/template
+++ b/srcpkgs/plymouth/template
@@ -1,6 +1,6 @@
 # Template file for 'plymouth'
 pkgname=plymouth
-version=0.9.5
+version=22.02.122
 revision=1
 build_style=gnu-configure
 configure_args="--with-system-root-install=no \
@@ -18,7 +18,7 @@ maintainer="William OD <obirik2005@gmail.com>"
 license="GPL-2.0-or-later"
 homepage="https://www.freedesktop.org/wiki/Software/Plymouth/"
 distfiles="${FREEDESKTOP_SITE}/plymouth/releases/$pkgname-$version.tar.xz"
-checksum=ecae257f351d098340542a5bc06de029404c24dcee87e6ebb2abd5ef117fce86
+checksum=100551442221033ce868c447ad6c74d831d209c18ae232b98ae0207e34eadaeb
 
 build_options="gtk3 pango"
 build_options_default="gtk3 pango"

From bca13db8a34a502de915191fef9e1cbb92cba5c0 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 21 Aug 2022 21:37:00 -0700
Subject: [PATCH 18/46] openjdk7-bootstrap: fix build for gcc12

---
 .../files/dist_patches_glibc.txt              |  1 +
 .../files/dist_patches_musl.txt               |  1 +
 .../icedtea-pointer-comparison-gcc12.patch    | 31 +++++++++++++++++++
 3 files changed, 33 insertions(+)
 create mode 100644 srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch

diff --git a/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt b/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt
index c76c56855441..8061756dfc0c 100644
--- a/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt
+++ b/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt
@@ -6,3 +6,4 @@ icedtea-jdk-no-soname.patch
 icedtea-jdk-xattr.patch
 icedtea-jdk-sysctl_h.patch
 icedtea-cpio.patch
+icedtea-pointer-comparison-gcc12.patch
diff --git a/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt b/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt
index 21812517c7c2..8b35d9c46989 100644
--- a/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt
+++ b/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt
@@ -11,3 +11,4 @@ icedtea-jdk-musl.patch
 icedtea-jdk-no-soname.patch
 icedtea-jdk-xattr.patch
 icedtea-cpio.patch
+icedtea-pointer-comparison-gcc12.patch
diff --git a/srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch b/srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch
new file mode 100644
index 000000000000..c809553443e7
--- /dev/null
+++ b/srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch
@@ -0,0 +1,31 @@
+--- openjdk.orig/hotspot/src/share/vm/opto/lcm.cpp
++++ openjdk/hotspot/src/share/vm/opto/lcm.cpp
+@@ -60,7 +60,7 @@
+ // Check whether val is not-null-decoded compressed oop,
+ // i.e. will grab into the base of the heap if it represents NULL.
+ static bool accesses_heap_base_zone(Node *val) {
+-  if (Universe::narrow_oop_base() > 0) { // Implies UseCompressedOops.
++  if (Universe::narrow_oop_base() > (address)0) { // Implies UseCompressedOops.
+     if (val && val->is_Mach()) {
+       if (val->as_Mach()->ideal_Opcode() == Op_DecodeN) {
+         // This assumes all Decodes with TypePtr::NotNull are matched to nodes that
+--- openjdk.orig/hotspot/src/share/vm/runtime/virtualspace.cpp
++++ openjdk/hotspot/src/share/vm/runtime/virtualspace.cpp
+@@ -527,7 +527,7 @@ ReservedHeapSpace::ReservedHeapSpace(siz
+                 (UseCompressedOops && (Universe::narrow_oop_base() != NULL) &&
+                  Universe::narrow_oop_use_implicit_null_checks()) ?
+                   lcm(os::vm_page_size(), alignment) : 0) {
+-  if (base() > 0) {
++  if (base() > (char*)0) {
+     MemTracker::record_virtual_memory_type((address)base(), mtJavaHeap);
+   }
+ 
+@@ -546,7 +546,7 @@ ReservedHeapSpace::ReservedHeapSpace(con
+                 (UseCompressedOops && (Universe::narrow_oop_base() != NULL) &&
+                  Universe::narrow_oop_use_implicit_null_checks()) ?
+                   lcm(os::vm_page_size(), prefix_align) : 0) {
+-  if (base() > 0) {
++  if (base() > (char*)0) {
+     MemTracker::record_virtual_memory_type((address)base(), mtJavaHeap);
+   }
+ 

From e4854082bb75d2c8241294843857d3c44561f417 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 23:30:16 -0700
Subject: [PATCH 19/46] libunique1: relax warnings for gcc12

---
 srcpkgs/libunique1/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/libunique1/template b/srcpkgs/libunique1/template
index f73931b0c72b..c5a0f5c27860 100644
--- a/srcpkgs/libunique1/template
+++ b/srcpkgs/libunique1/template
@@ -15,7 +15,7 @@ homepage="https://wiki.gnome.org/Attic/LibUnique"
 distfiles="${GNOME_SITE}/libunique/1.1/libunique-${version}.tar.bz2"
 checksum=e5c8041cef8e33c55732f06a292381cb345db946cf792a4ae18aa5c66cdd4fbb
 
-CFLAGS="-Wno-deprecated-declarations"
+CFLAGS="-Wno-deprecated-declarations -Wno-incompatible-pointer-types"
 
 # Package build options
 build_options="gir"

From c34e10e32f00105d59bfe8aa24f9eae4bc2bf851 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 14:45:28 -0700
Subject: [PATCH 20/46] libsasl: fix build for libtool 2.4.7

---
 srcpkgs/libsasl/template | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/libsasl/template b/srcpkgs/libsasl/template
index a8817042f843..a2993b39f4a1 100644
--- a/srcpkgs/libsasl/template
+++ b/srcpkgs/libsasl/template
@@ -19,6 +19,7 @@ distfiles="https://github.com/cyrusimap/cyrus-sasl/releases/download/cyrus-sasl-
 checksum=26866b1549b00ffd020f188a43c258017fa1c382b3ddadd8201536f72efb05d5
 
 pre_configure() {
+	rm -f m4/ltversion.m4
 	autoreconf -fi
 }
 

From 059f7ddb274b1e0a12087cbd0f8cdefa940ec12d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:08 -0700
Subject: [PATCH 21/46] subversion: fix build for libtool 2.4.7

---
 srcpkgs/subversion/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion/template b/srcpkgs/subversion/template
index 8ad178264942..3f1c9e254e61 100644
--- a/srcpkgs/subversion/template
+++ b/srcpkgs/subversion/template
@@ -57,7 +57,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From d6aa69c287a4931b92b7f9a36be20e5fdbf222ac Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:38 -0700
Subject: [PATCH 22/46] subversion-kwallet-auth: fix build for libtool 2.4.7

---
 srcpkgs/subversion-kwallet-auth/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion-kwallet-auth/template b/srcpkgs/subversion-kwallet-auth/template
index 12210f250d51..b4d8621456ea 100644
--- a/srcpkgs/subversion-kwallet-auth/template
+++ b/srcpkgs/subversion-kwallet-auth/template
@@ -59,7 +59,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From b164bcf09f3dcca0eaeb40980109fe1b51589157 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 20:07:32 -0700
Subject: [PATCH 23/46] gpgme: update to 1.18.0.

---
 common/shlibs          | 2 +-
 srcpkgs/gpgme/template | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 46c0680d55dd..3e3967f58a8c 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -723,7 +723,7 @@ libdconf.so.1 dconf-0.13.90_1
 libassuan.so.0 libassuan-2.0.1_1
 libgpgme.so.11 libgpgme-1.12.0_2
 libgpgmepp.so.6 gpgmepp-1.7.0_3
-libqgpgme.so.7 gpgmeqt-1.7.0_3
+libqgpgme.so.15 gpgmeqt-1.18.0_1
 libgarcon-1.so.0 garcon-0.1.12_1
 libgarcon-gtk2-1.so.0 garcon-0.4.0_1
 libgarcon-gtk3-1.so.0 garcon-0.6.1_1
diff --git a/srcpkgs/gpgme/template b/srcpkgs/gpgme/template
index 8633075a8404..b1cfd5f78657 100644
--- a/srcpkgs/gpgme/template
+++ b/srcpkgs/gpgme/template
@@ -1,7 +1,7 @@
 # Template file for 'gpgme'
 pkgname=gpgme
-version=1.15.1
-revision=2
+version=1.18.0
+revision=1
 build_style=gnu-configure
 configure_args="--enable-fd-passing
  --with-libgpg-error-prefix=$XBPS_CROSS_BASE/usr
@@ -14,7 +14,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.gnupg.org/software/gpgme/index.html"
 distfiles="https://www.gnupg.org/ftp/gcrypt/gpgme/gpgme-${version}.tar.bz2"
-checksum=eebc3c1b27f1c8979896ff361ba9bb4778b508b2496c2fc10e3775a40b1de1ad
+checksum=361d4eae47ce925dba0ea569af40e7b52c645c4ae2e65e5621bf1b6cdd8b0e9e
 
 if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
 	configure_args+=" ac_cv_sys_file_offset_bits=no"

From e1cccf8a3b3155af1a386abcde00b509c3792563 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:54 -0700
Subject: [PATCH 24/46] cross-aarch64-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..cb7ae97e7efe 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From ffdb1c6edaf93588d97cf453b56926c2c0a97fe7 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:54 -0700
Subject: [PATCH 25/46] cross-aarch64-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..4fa950f334d4 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From bcfb61167bc28f981d5340d48cd31d1b67b843f9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:54 -0700
Subject: [PATCH 26/46] cross-arm-linux-gnueabi: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..194c0ab774b7 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 40c2e819e819fac125f30fac76fd693232ea8df6 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 27/46] cross-arm-linux-gnueabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..3f3242b85b07 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From c8a21b4c002d1d09826fdd18ebd28aeb56e292b1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 28/46] cross-arm-linux-musleabi: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..b0cdade60a6d 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From b8f41bcde71261a74e2100564edad12b887ba063 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 29/46] cross-arm-linux-musleabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..1924be24d483 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 0c2113aa3dc3854f3420116fa90afb986dee0d1a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 30/46] cross-armv7l-linux-gnueabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..a7997d6db937 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 589781b3ac5bf8ff5418a2162279610aa808f0b8 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 31/46] cross-armv7l-linux-musleabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..aaa7040fbfef 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 81a9e3edd0a2840d49269d6e45119f6370b4e889 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 32/46] cross-i686-pc-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..765cf675e95c 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From d1913c41f534bc9a13f3ba9f8246072e5ff1e6d7 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 33/46] cross-mips-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-mips-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..26928ba9442d 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 2b2c03f9ec2456aa91959acaf3141a5f28699ded Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 34/46] cross-mips-linux-muslhf: update to gcc 12.1.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..fe74faf15d55 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 62f3b2ad07dc9e5933149471ae93d47f61ff56ce Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 35/46] cross-mipsel-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..aa74d0b1acc7 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_musl_version=1.1.24
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 735eec713685d58c13b924dcccf49b86734ba29b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 36/46] cross-mipsel-linux-muslhf: update to gcc 12.1.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..83ab7f187085 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_musl_version=1.1.24
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 885e2ae95c39afba714342bd487d0a7879e1b13e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 37/46] cross-powerpc-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..3ab1a4ea40fa 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 0ec84787d7b41d8a2bf87f62320dc55fe1769167 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 38/46] cross-powerpc-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..af5586cacc77 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From d23a13c9ee7f25749157fb232a292f499c40b554 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 39/46] cross-powerpc64-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..2604b268046b 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 273b86a8613d7dd7f8dc7492bf6b3bfab5e0da9e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 40/46] cross-powerpc64-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 1ebd0fb2048d..c7894721b900 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
@@ -19,12 +19,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 1c919df48e3e191f6e7786daa23e44bf9ad5d51c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 41/46] cross-powerpc64le-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 733f5851da5c..618235468970 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 6b7c68e6bc7499052ea2311bc5abe50b7ad86d25 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 42/46] cross-powerpc64le-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index 76a70aa1d6db..7edf9605e60d 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
@@ -19,12 +19,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From e7395c8c0230a32e927b60940bbc8170f6a66645 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 43/46] cross-powerpcle-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 347b8fcf4f55..cc10b7cbd88b 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 07e61f937620535103f4c5fadf9639d476341685 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 44/46] cross-powerpcle-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index ec9324ddaa99..1d38a3fa3559 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 104ecc7077d45c2bcfefbc9857ecaf21925bdbd5 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 45/46] cross-x86_64-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 0078fbe7224b..9f740b00a80c 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 8e25a4e69c2c7d835970ab3b0b67876ce1ddb073 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 46/46] cross-x86_64-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..19e13f3818e9 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
@@ -17,12 +17,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.1.0
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (37 preceding siblings ...)
  2022-08-23  6:30 ` oreo639
@ 2022-08-23 19:37 ` oreo639
  2022-08-24  5:45 ` oreo639
                   ` (225 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-08-23 19:37 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 4969 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.1.0
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.1.0

This PR depends on: https://github.com/void-linux/void-packages/pull/32330

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

Also, keep in mind that the libgo musl patch here will need to be updated once musl is updated:
https://github.com/void-linux/void-packages/pull/34902/files#diff-1f42a95b93c9550178ff1fbccbef2f47a72711df15c24c9472e2550076978129R163-R176

This is the updated patch for reference:
https://github.com/alpinelinux/aports/blob/8acb21b8ee881e7ab1c812d9a66a17d2501b8730/main/gcc/0049-libgo-adjust-name-of-union-in-sigevent-struct.patch

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/38817
- [ ] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [ ] llvm https://github.com/void-linux/void-packages/pull/38694
- [ ] m4 https://github.com/void-linux/void-packages/pull/33730
- [ ] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [ ] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [ ] libvirt https://github.com/void-linux/void-packages/pull/38842

Known packages that needed to be fixed/updated for gcc12:
- [ ] linux5.18 (in this PR)
- [ ] openssh https://github.com/void-linux/void-packages/pull/38849
- [ ] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [ ] doxygen https://github.com/void-linux/void-packages/pull/38846
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/38817
- [ ] libproxy https://github.com/void-linux/void-packages/pull/38818
- [ ] exempi https://github.com/void-linux/void-packages/pull/38820
- [ ] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [ ] gpgme https://github.com/void-linux/void-packages/pull/38825
- [ ] libunique1 https://github.com/void-linux/void-packages/pull/38848

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [ ] kde
- [x] lxde
- [x] lxqt

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 144611 bytes --]

From 4ed50d31e8b455fcf2cd4509b6e6dd566acd8ae5 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 01/46] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 15 +++--
 3 files changed, 28 insertions(+), 113 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..4bdaee582d71 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkg-config"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -44,6 +45,12 @@ do_configure() {
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	case "$XBPS_TARGET_MACHINE" in
+		*-musl)
+			conf+=" --disable-gprofng"
+			;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"

From c8f91faecc69ee344f99cd58ae6b60411d463f54 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 02/46] gcc: update to 12.1.0.

---
 common/shlibs                                 |  10 +-
 srcpkgs/gcc/files/gccgo-musl.patch            |  74 +++--------
 srcpkgs/gcc/files/libgnarl-musl.patch         |  18 +--
 srcpkgs/gcc/files/libssp-musl.patch           |  10 +-
 ...c21f3f5726823e19728fdd1571a14aae0fb3.patch | 105 ++++++++++++++++
 ...08065bdd36fb1a9b6aad9666b1edb5e06474.patch | 115 ++++++++++++++++++
 ...65517a59565758107c5b1a51a5fa382f8d1a.patch |  32 +++++
 srcpkgs/gcc/patches/libffi_gnulinux.patch     |  11 --
 .../gcc/patches/libgcc-ibm128-no-tag.patch    |  10 +-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |   2 +-
 .../sanitizer-fix-compat-glibc-2.36.patch     |  39 ++++++
 srcpkgs/gcc/template                          |  25 ++--
 12 files changed, 343 insertions(+), 108 deletions(-)
 create mode 100644 srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
 create mode 100644 srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
 create mode 100644 srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch
 create mode 100644 srcpkgs/gcc/patches/sanitizer-fix-compat-glibc-2.36.patch

diff --git a/common/shlibs b/common/shlibs
index f829ee12e80f..776f9b195309 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.1.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.34 perl-5.34.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -848,8 +848,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.1.0_1
+libgnat-12.so libada-12.1.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1700,8 +1700,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.1.0_1
+libasan.so.8 libsanitizer-12.1.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..632ef951097b 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,17 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ a/libgo/go/runtime/os_linux.go
+@@ -363,9 +363,9 @@
+ 
+ 	var timerid int32
+ 	var sevp _sigevent
+-	sevp.sigev_notify = _SIGEV_THREAD_ID
++	sevp.sigev_notify = 4
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.sigev_notify_function))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch b/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
new file mode 100644
index 000000000000..00929202a503
--- /dev/null
+++ b/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
@@ -0,0 +1,105 @@
+From 3b21c21f3f5726823e19728fdd1571a14aae0fb3 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <siarheit@google.com>
+Date: Mon, 27 Jun 2022 13:27:24 +0100
+Subject: [PATCH] c++: avoid <memory> poisoning on musl [PR106102]
+
+On musl <pthread.h> uses calloc() (via <sched.h>). <memory> includes
+it indirectly and exposes use of poisoned calloc() when module code
+is built:
+
+    /build/build/./prev-gcc/xg++ ... ../../gcc-13-20220626/gcc/cp/mapper-resolver.cc
+        In file included from /<<NIX>>/musl-1.2.3-dev/include/pthread.h:30,
+                 from /build/build/prev-x86_64-unknown-linux-musl/libstdc++-v3/include/x86_64-unknown-linux-musl/bits/gthr-default.h:35,
+                 ....
+                 from /build/build/prev-x86_64-unknown-linux-musl/libstdc++-v3/include/memory:77,
+                 from ../../gcc-13-20220626/gcc/../libcody/cody.hh:24,
+                 from ../../gcc-13-20220626/gcc/cp/../../c++tools/resolver.h:25,
+                 from ../../gcc-13-20220626/gcc/cp/../../c++tools/resolver.cc:23,
+                 from ../../gcc-13-20220626/gcc/cp/mapper-resolver.cc:32:
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:84:7: error: attempt to use poisoned "calloc"
+       84 | void *calloc(size_t, size_t);
+          |       ^
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:124:36: error: attempt to use poisoned "calloc"
+      124 | #define CPU_ALLOC(n) ((cpu_set_t *)calloc(1,CPU_ALLOC_SIZE(n)))
+          |                                    ^
+
+gcc/cp/
+
+	PR c++/106102
+	* mapper-client.cc: Include <memory> via "system.h".
+	* mapper-resolver.cc: Ditto.
+	* module.cc: Ditto.
+
+libcc1/
+
+	PR c++/106102
+	* libcc1plugin.cc: Include <memory> via "system.h".
+	* libcp1plugin.cc: Ditto.
+---
+ gcc/cp/mapper-client.cc   | 1 +
+ gcc/cp/mapper-resolver.cc | 1 +
+ gcc/cp/module.cc          | 1 +
+ libcc1/libcc1plugin.cc    | 1 +
+ libcc1/libcp1plugin.cc    | 1 +
+ 5 files changed, 5 insertions(+)
+
+diff --git a/gcc/cp/mapper-client.cc b/gcc/cp/mapper-client.cc
+index 8603a886a099..fe9544b5ba43 100644
+--- a/gcc/cp/mapper-client.cc
++++ b/gcc/cp/mapper-client.cc
+@@ -27,6 +27,7 @@ along with GCC; see the file COPYING3.  If not see
+ #define INCLUDE_STRING
+ #define INCLUDE_VECTOR
+ #define INCLUDE_MAP
++#define INCLUDE_MEMORY
+ #include "system.h"
+ 
+ #include "line-map.h"
+diff --git a/gcc/cp/mapper-resolver.cc b/gcc/cp/mapper-resolver.cc
+index e3d29fb5ada1..e70d1b4ae2ca 100644
+--- a/gcc/cp/mapper-resolver.cc
++++ b/gcc/cp/mapper-resolver.cc
+@@ -25,6 +25,7 @@ along with GCC; see the file COPYING3.  If not see
+ #define INCLUDE_VECTOR
+ #define INCLUDE_ALGORITHM
+ #define INCLUDE_MAP
++#define INCLUDE_MEMORY
+ #include "system.h"
+ 
+ // We don't want or need to be aware of networking
+diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc
+index 753963a4b246..8bb22c2b305a 100644
+--- a/gcc/cp/module.cc
++++ b/gcc/cp/module.cc
+@@ -206,6 +206,7 @@ Classes used:
+ 
+ #define _DEFAULT_SOURCE 1 /* To get TZ field of struct tm, if available.  */
+ #include "config.h"
++#define INCLUDE_MEMORY
+ #define INCLUDE_STRING
+ #define INCLUDE_VECTOR
+ #include "system.h"
+diff --git a/libcc1/libcc1plugin.cc b/libcc1/libcc1plugin.cc
+index 12ab5a57c8dd..bdd0bdabe77f 100644
+--- a/libcc1/libcc1plugin.cc
++++ b/libcc1/libcc1plugin.cc
+@@ -31,6 +31,7 @@
+ #undef PACKAGE_TARNAME
+ #undef PACKAGE_VERSION
+ 
++#define INCLUDE_MEMORY
+ #include "gcc-plugin.h"
+ #include "system.h"
+ #include "coretypes.h"
+diff --git a/libcc1/libcp1plugin.cc b/libcc1/libcp1plugin.cc
+index 83dab7f58b11..e2d5039a0a1f 100644
+--- a/libcc1/libcp1plugin.cc
++++ b/libcc1/libcp1plugin.cc
+@@ -32,6 +32,7 @@
+ #undef PACKAGE_TARNAME
+ #undef PACKAGE_VERSION
+ 
++#define INCLUDE_MEMORY
+ #include "gcc-plugin.h"
+ #include "system.h"
+ #include "coretypes.h"
diff --git a/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch b/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
new file mode 100644
index 000000000000..89bd053d6d04
--- /dev/null
+++ b/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
@@ -0,0 +1,115 @@
+From 49d508065bdd36fb1a9b6aad9666b1edb5e06474 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <siarheit@google.com>
+Date: Mon, 27 Jun 2022 23:42:44 +0100
+Subject: [PATCH] jit: avoid calloc() poisoning on musl [PR106102]
+
+On musl <pthread.h> uses calloc() (via <sched.h>). jit/ includes
+it directly and exposes use of poisoned calloc():
+
+    /build/build/./prev-gcc/xg++ ... ../../gcc-13-20220626/gcc/jit/jit-playback.cc
+    make[3]: *** [Makefile:1143: jit/libgccjit.o] Error 1
+    make[3]: *** Waiting for unfinished jobs....
+    In file included from /<<NIX>>/musl-1.2.3-dev/include/pthread.h:30,
+                     from ../../gcc-13-20220626/gcc/jit/jit-playback.cc:44:
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:84:7: error: attempt to use poisoned "calloc"
+       84 | void *calloc(size_t, size_t);
+          |       ^
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:124:36: error: attempt to use poisoned "calloc"
+      124 | #define CPU_ALLOC(n) ((cpu_set_t *)calloc(1,CPU_ALLOC_SIZE(n)))
+          |                                    ^
+
+The change moves <pthread.h> inclusion to "system.h" under new
+INCLUDE_PTHREAD_H guard and uses this mechanism in libgccjit.
+
+gcc/
+
+	PR c++/106102
+	* system.h: Introduce INCLUDE_PTHREAD_H macros to include <pthread.h>.
+
+gcc/jit/
+
+	PR c++/106102
+	* jit-playback.cc: Include <pthread.h> via "system.h" to avoid calloc()
+	poisoning.
+	* jit-recording.cc: Ditto.
+	* libgccjit.cc: Ditto.
+---
+ gcc/jit/jit-playback.cc  | 3 +--
+ gcc/jit/jit-recording.cc | 2 +-
+ gcc/jit/libgccjit.cc     | 2 +-
+ gcc/system.h             | 4 ++++
+ 4 files changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/gcc/jit/jit-playback.cc b/gcc/jit/jit-playback.cc
+index 6be6bdf8dea5..79714132b91a 100644
+--- a/gcc/jit/jit-playback.cc
++++ b/gcc/jit/jit-playback.cc
+@@ -19,6 +19,7 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "target.h"
+@@ -41,8 +42,6 @@ along with GCC; see the file COPYING3.  If not see
+ #include "diagnostic.h"
+ #include "stmt.h"
+ 
+-#include <pthread.h>
+-
+ #include "jit-playback.h"
+ #include "jit-result.h"
+ #include "jit-builtins.h"
+diff --git a/gcc/jit/jit-recording.cc b/gcc/jit/jit-recording.cc
+index 697dee66e733..f78daed2d71a 100644
+--- a/gcc/jit/jit-recording.cc
++++ b/gcc/jit/jit-recording.cc
+@@ -19,13 +19,13 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "tm.h"
+ #include "pretty-print.h"
+ #include "toplev.h"
+ 
+-#include <pthread.h>
+ 
+ #include "jit-builtins.h"
+ #include "jit-recording.h"
+diff --git a/gcc/jit/libgccjit.cc b/gcc/jit/libgccjit.cc
+index 0e76097b4bac..ca862662777e 100644
+--- a/gcc/jit/libgccjit.cc
++++ b/gcc/jit/libgccjit.cc
+@@ -19,12 +19,12 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "timevar.h"
+ #include "typed-splay-tree.h"
+ #include "cppbuiltin.h"
+-#include <pthread.h>
+ 
+ #include "libgccjit.h"
+ #include "jit-recording.h"
+diff --git a/gcc/system.h b/gcc/system.h
+index 67158b70c789..f8d42ff68150 100644
+--- a/gcc/system.h
++++ b/gcc/system.h
+@@ -753,6 +753,10 @@ extern int vsnprintf (char *, size_t, const char *, va_list);
+ #endif
+ #endif
+ 
++#ifdef INCLUDE_PTHREAD_H
++#include <pthread.h>
++#endif
++
+ #ifdef INCLUDE_ISL
+ #ifdef HAVE_isl
+ #include <isl/options.h>
diff --git a/srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch b/srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch
new file mode 100644
index 000000000000..044a4fc29514
--- /dev/null
+++ b/srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch
@@ -0,0 +1,32 @@
+From f35d65517a59565758107c5b1a51a5fa382f8d1a Mon Sep 17 00:00:00 2001
+From: Ian Lance Taylor <iant@golang.org>
+Date: Tue, 12 Jul 2022 19:42:43 -0700
+Subject: [PATCH] libgo: don't include <linux/fs.h> when building
+ gen-sysinfo.go
+
+Removing this doesn't change anything at least with glibc 2.33.
+The include was added in https://go.dev/cl/6100049 but it's not
+clear why.
+
+Fixes PR go/106266
+
+Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/417294
+---
+ gcc/go/gofrontend/MERGE | 2 +-
+ libgo/sysinfo.c         | 3 ---
+ 2 files changed, 1 insertion(+), 4 deletions(-)
+
+diff --git a/libgo/sysinfo.c b/libgo/sysinfo.c
+index a4259c02ded4..fc0210992faa 100644
+--- a/libgo/sysinfo.c
++++ b/libgo/sysinfo.c
+@@ -158,9 +158,6 @@
+ #if defined(HAVE_LINUX_ETHER_H)
+ #include <linux/ether.h>
+ #endif
+-#if defined(HAVE_LINUX_FS_H)
+-#include <linux/fs.h>
+-#endif
+ #if defined(HAVE_LINUX_REBOOT_H)
+ #include <linux/reboot.h>
+ #endif
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/patches/sanitizer-fix-compat-glibc-2.36.patch b/srcpkgs/gcc/patches/sanitizer-fix-compat-glibc-2.36.patch
new file mode 100644
index 000000000000..851cde0e2077
--- /dev/null
+++ b/srcpkgs/gcc/patches/sanitizer-fix-compat-glibc-2.36.patch
@@ -0,0 +1,39 @@
+From 2701442d0cf6292f6624443c15813d6d1a3562fe Mon Sep 17 00:00:00 2001
+From: Martin Liska <mliska@suse.cz>
+Date: Mon, 11 Jul 2022 22:03:14 +0200
+Subject: [PATCH] libsanitizer: cherry-pick 9cf13067cb5088626ba7 from upstream
+
+9cf13067cb5088626ba7ee1ec4c42ec59c7995a0 [sanitizer] Remove #include <linux/fs.h> to resolve fsconfig_command/mount_attr conflict with glibc 2.36
+---
+ .../sanitizer_platform_limits_posix.cpp                | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
+index 8ed3e92d2704..97fd07acf9d4 100644
+--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -73,7 +73,9 @@
+ #include <sys/vt.h>
+ #include <linux/cdrom.h>
+ #include <linux/fd.h>
++#if SANITIZER_ANDROID
+ #include <linux/fs.h>
++#endif
+ #include <linux/hdreg.h>
+ #include <linux/input.h>
+ #include <linux/ioctl.h>
+@@ -869,10 +871,10 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
+   unsigned IOCTL_EVIOCGPROP = IOCTL_NOT_PRESENT;
+   unsigned IOCTL_EVIOCSKEYCODE_V2 = IOCTL_NOT_PRESENT;
+ #endif
+-  unsigned IOCTL_FS_IOC_GETFLAGS = FS_IOC_GETFLAGS;
+-  unsigned IOCTL_FS_IOC_GETVERSION = FS_IOC_GETVERSION;
+-  unsigned IOCTL_FS_IOC_SETFLAGS = FS_IOC_SETFLAGS;
+-  unsigned IOCTL_FS_IOC_SETVERSION = FS_IOC_SETVERSION;
++  unsigned IOCTL_FS_IOC_GETFLAGS = _IOR('f', 1, long);
++  unsigned IOCTL_FS_IOC_GETVERSION = _IOR('v', 1, long);
++  unsigned IOCTL_FS_IOC_SETFLAGS = _IOW('f', 2, long);
++  unsigned IOCTL_FS_IOC_SETVERSION = _IOW('v', 2, long);
+   unsigned IOCTL_GIO_CMAP = GIO_CMAP;
+   unsigned IOCTL_GIO_FONT = GIO_FONT;
+   unsigned IOCTL_GIO_UNIMAP = GIO_UNIMAP;
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..32ee79e32f0d 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,15 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
+version=12.1.0
+revision=1
 _patchver="${version%pre*}"
 _minorver="${_patchver%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 wrksrc=gcc-${version/pre/_pre}
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +19,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -396,7 +393,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}

From 58c05805f2ecd63ebe205e13bbae6a53dcef3196 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 03/46] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      |  6 ++--
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..08e35d466a44 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From 1a5fc618325769ba168a615515d2912b807b1698 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 04/46] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 1a4e1ca3d594..b04268908c2e 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="q66 <daniel@octaforge.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From 574dc9d1824e6ae7c46cb895c2d22a41c62b61e9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 05/46] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 3 files changed, 55 insertions(+), 353 deletions(-)
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index 776f9b195309..46c0680d55dd 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From 11327fee4049a02894ae22dcd9beb1a0cf9b072d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 21:01:43 -0700
Subject: [PATCH 06/46] gcc-multilib: update to 12.1.0.

---
 .../sanitizer-fix-compat-glibc-2.36.patch     | 39 +++++++++++++++++++
 srcpkgs/gcc-multilib/template                 |  8 ++--
 2 files changed, 43 insertions(+), 4 deletions(-)
 create mode 100644 srcpkgs/gcc-multilib/patches/sanitizer-fix-compat-glibc-2.36.patch

diff --git a/srcpkgs/gcc-multilib/patches/sanitizer-fix-compat-glibc-2.36.patch b/srcpkgs/gcc-multilib/patches/sanitizer-fix-compat-glibc-2.36.patch
new file mode 100644
index 000000000000..851cde0e2077
--- /dev/null
+++ b/srcpkgs/gcc-multilib/patches/sanitizer-fix-compat-glibc-2.36.patch
@@ -0,0 +1,39 @@
+From 2701442d0cf6292f6624443c15813d6d1a3562fe Mon Sep 17 00:00:00 2001
+From: Martin Liska <mliska@suse.cz>
+Date: Mon, 11 Jul 2022 22:03:14 +0200
+Subject: [PATCH] libsanitizer: cherry-pick 9cf13067cb5088626ba7 from upstream
+
+9cf13067cb5088626ba7ee1ec4c42ec59c7995a0 [sanitizer] Remove #include <linux/fs.h> to resolve fsconfig_command/mount_attr conflict with glibc 2.36
+---
+ .../sanitizer_platform_limits_posix.cpp                | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
+index 8ed3e92d2704..97fd07acf9d4 100644
+--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -73,7 +73,9 @@
+ #include <sys/vt.h>
+ #include <linux/cdrom.h>
+ #include <linux/fd.h>
++#if SANITIZER_ANDROID
+ #include <linux/fs.h>
++#endif
+ #include <linux/hdreg.h>
+ #include <linux/input.h>
+ #include <linux/ioctl.h>
+@@ -869,10 +871,10 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
+   unsigned IOCTL_EVIOCGPROP = IOCTL_NOT_PRESENT;
+   unsigned IOCTL_EVIOCSKEYCODE_V2 = IOCTL_NOT_PRESENT;
+ #endif
+-  unsigned IOCTL_FS_IOC_GETFLAGS = FS_IOC_GETFLAGS;
+-  unsigned IOCTL_FS_IOC_GETVERSION = FS_IOC_GETVERSION;
+-  unsigned IOCTL_FS_IOC_SETFLAGS = FS_IOC_SETFLAGS;
+-  unsigned IOCTL_FS_IOC_SETVERSION = FS_IOC_SETVERSION;
++  unsigned IOCTL_FS_IOC_GETFLAGS = _IOR('f', 1, long);
++  unsigned IOCTL_FS_IOC_GETVERSION = _IOR('v', 1, long);
++  unsigned IOCTL_FS_IOC_SETFLAGS = _IOW('f', 2, long);
++  unsigned IOCTL_FS_IOC_SETVERSION = _IOW('v', 2, long);
+   unsigned IOCTL_GIO_CMAP = GIO_CMAP;
+   unsigned IOCTL_GIO_FONT = GIO_FONT;
+   unsigned IOCTL_GIO_UNIMAP = GIO_UNIMAP;
diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index fcd25755aa75..573d323fe05e 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,16 +3,16 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.1.0
 revision=1
 _majorver="${version%.*}"
-wrksrc=gcc-${version/pre/_pre}
+wrksrc=gcc-${version}
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel

From b60cffafceb596197ffe125ce803bc1f463b6699 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 16:22:03 -0700
Subject: [PATCH 07/46] llvm12: fix build for glibc 2.36

---
 .../compiler-rt-sanitizer-glibc-2.36.patch    | 59 +++++++++++++++++++
 1 file changed, 59 insertions(+)
 create mode 100644 srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch

diff --git a/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch b/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch
new file mode 100644
index 000000000000..e5f24dab8935
--- /dev/null
+++ b/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch
@@ -0,0 +1,59 @@
+From 9cf13067cb5088626ba7ee1ec4c42ec59c7995a0 Mon Sep 17 00:00:00 2001
+From: Fangrui Song <i@maskray.me>
+Date: Mon, 11 Jul 2022 12:53:34 -0700
+Subject: [PATCH] [sanitizer] Remove #include <linux/fs.h> to resolve
+ fsconfig_command/mount_attr conflict with glibc 2.36
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+It is generally not a good idea to mix usage of glibc headers and Linux UAPI
+headers (https://sourceware.org/glibc/wiki/Synchronizing_Headers). In glibc
+since 7eae6a91e9b1670330c9f15730082c91c0b1d570 (milestone: 2.36), sys/mount.h
+defines `fsconfig_command` which conflicts with linux/mount.h:
+
+    .../usr/include/linux/mount.h:95:6: error: redeclaration of ‘enum fsconfig_command’
+
+Remove #include <linux/fs.h> which pulls in linux/mount.h. Expand its 4 macros manually.
+Android sys/mount.h doesn't define BLKBSZGET and it still needs linux/fs.h.
+In the long term we should move Linux specific definitions to sanitizer_platform_limits_linux.cpp
+but this commit is easy to cherry pick into older compiler-rt releases.
+
+Fix https://github.com/llvm/llvm-project/issues/56421
+
+Reviewed By: #sanitizers, vitalybuka, zatrazz
+
+Differential Revision: https://reviews.llvm.org/D129471
+---
+ .../sanitizer_platform_limits_posix.cpp                | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+index 4bd425435d56d..3a94b260686f1 100644
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -73,7 +73,9 @@
+ #include <sys/vt.h>
+ #include <linux/cdrom.h>
+ #include <linux/fd.h>
++#if SANITIZER_ANDROID
+ #include <linux/fs.h>
++#endif
+ #include <linux/hdreg.h>
+ #include <linux/input.h>
+ #include <linux/ioctl.h>
+@@ -876,10 +878,10 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
+   unsigned IOCTL_EVIOCGPROP = IOCTL_NOT_PRESENT;
+   unsigned IOCTL_EVIOCSKEYCODE_V2 = IOCTL_NOT_PRESENT;
+ #endif
+-  unsigned IOCTL_FS_IOC_GETFLAGS = FS_IOC_GETFLAGS;
+-  unsigned IOCTL_FS_IOC_GETVERSION = FS_IOC_GETVERSION;
+-  unsigned IOCTL_FS_IOC_SETFLAGS = FS_IOC_SETFLAGS;
+-  unsigned IOCTL_FS_IOC_SETVERSION = FS_IOC_SETVERSION;
++  unsigned IOCTL_FS_IOC_GETFLAGS = _IOR('f', 1, long);
++  unsigned IOCTL_FS_IOC_GETVERSION = _IOR('v', 1, long);
++  unsigned IOCTL_FS_IOC_SETFLAGS = _IOW('f', 2, long);
++  unsigned IOCTL_FS_IOC_SETVERSION = _IOW('v', 2, long);
+   unsigned IOCTL_GIO_CMAP = GIO_CMAP;
+   unsigned IOCTL_GIO_FONT = GIO_FONT;
+   unsigned IOCTL_GIO_UNIMAP = GIO_UNIMAP;

From ccf0c1ecc60a5f0d459a7707ffe43f842e2319ad Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 17:21:40 -0700
Subject: [PATCH 08/46] m4: update to 1.4.19.

---
 srcpkgs/m4/patches/fix-glibc-2.27.patch | 167 ------------------------
 srcpkgs/m4/template                     |  12 +-
 2 files changed, 6 insertions(+), 173 deletions(-)
 delete mode 100644 srcpkgs/m4/patches/fix-glibc-2.27.patch

diff --git a/srcpkgs/m4/patches/fix-glibc-2.27.patch b/srcpkgs/m4/patches/fix-glibc-2.27.patch
deleted file mode 100644
index 59d33cff164d..000000000000
--- a/srcpkgs/m4/patches/fix-glibc-2.27.patch
+++ /dev/null
@@ -1,167 +0,0 @@
-From 4af4a4a71827c0bc5e0ec67af23edef4f15cee8e Mon Sep 17 00:00:00 2001
-From: Paul Eggert <eggert@cs.ucla.edu>
-Date: Mon, 5 Mar 2018 10:56:29 -0800
-Subject: [PATCH] fflush: adjust to glibc 2.28 libio.h removal
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Problem reported by Daniel P. Berrangé in:
-https://lists.gnu.org/r/bug-gnulib/2018-03/msg00000.html
-* lib/fbufmode.c (fbufmode):
-* lib/fflush.c (clear_ungetc_buffer_preserving_position)
-(disable_seek_optimization, rpl_fflush):
-* lib/fpending.c (__fpending):
-* lib/fpurge.c (fpurge):
-* lib/freadable.c (freadable):
-* lib/freadahead.c (freadahead):
-* lib/freading.c (freading):
-* lib/freadptr.c (freadptr):
-* lib/freadseek.c (freadptrinc):
-* lib/fseeko.c (fseeko):
-* lib/fseterr.c (fseterr):
-* lib/fwritable.c (fwritable):
-* lib/fwriting.c (fwriting):
-Check _IO_EOF_SEEN instead of _IO_ftrylockfile.
-* lib/stdio-impl.h (_IO_IN_BACKUP) [_IO_EOF_SEEN]:
-Define if not already defined.
-
-[yann.morin.1998@free.fr: partially backport from upstream gnulib]
-Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
-
----
- lib/fflush.c     |  6 +++---
- lib/fpending.c   |  2 +-
- lib/fpurge.c     |  2 +-
- lib/freadahead.c |  2 +-
- lib/freading.c   |  2 +-
- lib/fseeko.c     |  4 ++--
- lib/stdio-impl.h |  6 ++++++
- 7 files changed, 15 insertions(+), 9 deletions(-)
-
-diff --git a/lib/fflush.c b/build-aux/gnulib/lib/fflush.c
-index 983ade0ff..a6edfa105 100644
---- a/lib/fflush.c
-+++ b/lib/fflush.c
-@@ -33,7 +33,7 @@
- #undef fflush
- 
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- 
- /* Clear the stream's ungetc buffer, preserving the value of ftello (fp).  */
- static void
-@@ -72,7 +72,7 @@ clear_ungetc_buffer (FILE *fp)
- 
- #endif
- 
--#if ! (defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
-+#if ! (defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
- 
- # if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT
- /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
-@@ -148,7 +148,7 @@ rpl_fflush (FILE *stream)
-   if (stream == NULL || ! freading (stream))
-     return fflush (stream);
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- 
-   clear_ungetc_buffer_preserving_position (stream);
- 
-diff --git a/lib/fpending.c b/build-aux/gnulib/lib/fpending.c
-index c84e3a5b4..789f50e4e 100644
---- a/lib/fpending.c
-+++ b/lib/fpending.c
-@@ -32,7 +32,7 @@ __fpending (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   return fp->_IO_write_ptr - fp->_IO_write_base;
- #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
-   /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
-diff --git a/lib/fpurge.c b/build-aux/gnulib/lib/fpurge.c
-index b1d417c7a..3aedcc373 100644
---- a/lib/fpurge.c
-+++ b/lib/fpurge.c
-@@ -62,7 +62,7 @@ fpurge (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   fp->_IO_read_end = fp->_IO_read_ptr;
-   fp->_IO_write_ptr = fp->_IO_write_base;
-   /* Avoid memory leak when there is an active ungetc buffer.  */
-diff --git a/lib/freadahead.c b/build-aux/gnulib/lib/freadahead.c
-index c2ecb5b28..23ec76ee5 100644
---- a/lib/freadahead.c
-+++ b/lib/freadahead.c
-@@ -30,7 +30,7 @@ extern size_t __sreadahead (FILE *);
- size_t
- freadahead (FILE *fp)
- {
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   if (fp->_IO_write_ptr > fp->_IO_write_base)
-     return 0;
-   return (fp->_IO_read_end - fp->_IO_read_ptr)
-diff --git a/lib/freading.c b/build-aux/gnulib/lib/freading.c
-index 73c28acdd..c24d0c88a 100644
---- a/lib/freading.c
-+++ b/lib/freading.c
-@@ -31,7 +31,7 @@ freading (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   return ((fp->_flags & _IO_NO_WRITES) != 0
-           || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0
-               && fp->_IO_read_base != NULL));
-diff --git a/lib/fseeko.c b/build-aux/gnulib/lib/fseeko.c
-index 0101ab55f..193f4e8ce 100644
---- a/lib/fseeko.c
-+++ b/lib/fseeko.c
-@@ -47,7 +47,7 @@ fseeko (FILE *fp, off_t offset, int whence)
- #endif
- 
-   /* These tests are based on fpurge.c.  */
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   if (fp->_IO_read_end == fp->_IO_read_ptr
-       && fp->_IO_write_ptr == fp->_IO_write_base
-       && fp->_IO_save_base == NULL)
-@@ -123,7 +123,7 @@ fseeko (FILE *fp, off_t offset, int whence)
-           return -1;
-         }
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-       fp->_flags &= ~_IO_EOF_SEEN;
-       fp->_offset = pos;
- #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
-diff --git a/lib/stdio-impl.h b/build-aux/gnulib/lib/stdio-impl.h
-index 78d896e9f..05c5752a2 100644
---- a/lib/stdio-impl.h
-+++ b/lib/stdio-impl.h
-@@ -18,6 +18,12 @@
-    the same implementation of stdio extension API, except that some fields
-    have different naming conventions, or their access requires some casts.  */
- 
-+/* Glibc 2.28 made _IO_IN_BACKUP private.  For now, work around this
-+   problem by defining it ourselves.  FIXME: Do not rely on glibc
-+   internals.  */
-+#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN
-+# define _IO_IN_BACKUP 0x100
-+#endif
- 
- /* BSD stdio derived implementations.  */
- 
--- 
-2.14.1
-
-
diff --git a/srcpkgs/m4/template b/srcpkgs/m4/template
index 78f3dae6184a..762593d883bd 100644
--- a/srcpkgs/m4/template
+++ b/srcpkgs/m4/template
@@ -1,17 +1,17 @@
 # Template file for 'm4'
 pkgname=m4
-version=1.4.18
-revision=2
+version=1.4.19
+revision=1
 bootstrap=yes
-replaces="chroot-m4>=0"
 build_style=gnu-configure
 configure_args="--enable-changeword --enable-threads"
 short_desc="GNU version of UNIX m4 macro language processor"
-homepage="https://www.gnu.org/software/m4/"
-license="GPL-3.0-or-later"
 maintainer="Enno Boland <gottox@voidlinux.org>"
+license="GPL-3.0-or-later"
+homepage="https://www.gnu.org/software/m4/"
 distfiles="${GNU_SITE}/${pkgname}/${pkgname}-${version}.tar.xz"
-checksum=f2c1e86ca0a404ff281631bdc8377638992744b175afb806e25871a24a934e07
+checksum=63aede5c6d33b6d9b13511cd0be2cac046f2e70fd0a07aa9573a04a82783af96
+replaces="chroot-m4>=0"
 
 if [ "$XBPS_TARGET_LIBC" = musl ]; then
 	export ac_cv_lib_error_at_line=no

From f4909d6ae58888fe5edd688743ff008dab0d8e07 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 22:57:59 -0700
Subject: [PATCH 09/46] btrfs-progs: update to 5.19.

---
 srcpkgs/btrfs-progs/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/btrfs-progs/template b/srcpkgs/btrfs-progs/template
index f6c53d8587e1..292d5110106b 100644
--- a/srcpkgs/btrfs-progs/template
+++ b/srcpkgs/btrfs-progs/template
@@ -1,6 +1,6 @@
 # Template file for 'btrfs-progs'
 pkgname=btrfs-progs
-version=5.18.1
+version=5.19
 revision=1
 wrksrc="${pkgname}-v${version}"
 build_style=gnu-configure
@@ -16,7 +16,7 @@ license="GPL-2.0-only, LGPL-2.1-or-later"
 homepage="https://btrfs.wiki.kernel.org/index.php/Main_Page"
 changelog="https://raw.githubusercontent.com/kdave/btrfs-progs/master/CHANGES"
 distfiles="${KERNEL_SITE}/kernel/people/kdave/${pkgname}/${pkgname}-v${version}.tar.xz"
-checksum=6e98a75ccff52e9354daa1ad284c614c490f844273a2fa524cbac9eb841c7255
+checksum=1fbcf06e4b2f80e7a127fd687ed4625a5b74fa674fe212c836ff70e0edfcccf9
 # Most of the tests depend on `mount` and `fallocate` commands, which are not
 # presented in chroot-util-linux
 make_check=no

From 57440c9c9936c3e2f3792fcbf0e19bbec74a1155 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 14 Aug 2022 19:29:36 -0700
Subject: [PATCH 10/46] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove nopie=yes. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh             |  1 +
 common/environment/build-style/void-cross.sh | 36 +++++++++++++++++++-
 2 files changed, 36 insertions(+), 1 deletion(-)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..c24013755704 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -132,6 +132,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
diff --git a/common/environment/build-style/void-cross.sh b/common/environment/build-style/void-cross.sh
index 62ce9eaa2e4a..4b77c90efc8b 100644
--- a/common/environment/build-style/void-cross.sh
+++ b/common/environment/build-style/void-cross.sh
@@ -1,6 +1,40 @@
 lib32disabled=yes
-nopie=yes
 create_wrksrc=yes
 
 nostrip_files+=" libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a libgmem.a"
+nopie_files+=" /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/go1
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/lto-wrapper
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/plugin/gengtype
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/cc1objplus
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/cc1obj
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/collect2
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/lto1
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/f951
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/cc1
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/gnat1
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/cc1plus
+ /usr/bin/${sourcepkg/cross-}-gcov-dump
+ /usr/bin/${sourcepkg/cross-}-gnatlink
+ /usr/bin/${sourcepkg/cross-}-gnatbind
+ /usr/bin/${sourcepkg/cross-}-gcc
+ /usr/bin/${sourcepkg/cross-}-cpp
+ /usr/bin/${sourcepkg/cross-}-gnatchop
+ /usr/bin/${sourcepkg/cross-}-gfortran
+ /usr/bin/${sourcepkg/cross-}-gccgo
+ /usr/bin/${sourcepkg/cross-}-c++
+ /usr/bin/${sourcepkg/cross-}-lto-dump
+ /usr/bin/${sourcepkg/cross-}-gnatname
+ /usr/bin/${sourcepkg/cross-}-gnatprep
+ /usr/bin/${sourcepkg/cross-}-g++
+ /usr/bin/${sourcepkg/cross-}-gnat
+ /usr/bin/${sourcepkg/cross-}-gcc-ranlib
+ /usr/bin/${sourcepkg/cross-}-gnatkr
+ /usr/bin/${sourcepkg/cross-}-gnatmake
+ /usr/bin/${sourcepkg/cross-}-gcc-${_gcc_version}
+ /usr/bin/${sourcepkg/cross-}-gcc-ar
+ /usr/bin/${sourcepkg/cross-}-gnatclean
+ /usr/bin/${sourcepkg/cross-}-gcov
+ /usr/bin/${sourcepkg/cross-}-gnatls
+ /usr/bin/${sourcepkg/cross-}-gcc-nm
+ /usr/bin/${sourcepkg/cross-}-gcov-tool"

From 4a83f8198efd72aadd193f7ab5d36067051349f9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:08:52 -0700
Subject: [PATCH 11/46] openssh: suppress werror on gcc12

---
 srcpkgs/openssh/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/openssh/template b/srcpkgs/openssh/template
index 02a2dec35f42..6e8e343a9dca 100644
--- a/srcpkgs/openssh/template
+++ b/srcpkgs/openssh/template
@@ -40,7 +40,7 @@ if [ "$build_option_ldns" -a -z "$build_option_ssl" ]; then
 	broken="option 'ldns' requires option 'ssl'"
 fi
 
-CFLAGS="-Wno-format-truncation -Wno-stringop-truncation"
+CFLAGS="-Wno-format-truncation -Wno-stringop-truncation -Wno-error=maybe-uninitialized"
 
 case $XBPS_TARGET_MACHINE in
 	i686-musl)

From b60a7ddc054cc1a900d7892f0a64362817102741 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:09:31 -0700
Subject: [PATCH 12/46] linux5.18: update dotconfigs for gcc12

---
 srcpkgs/linux5.18/files/x86_64-dotconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/linux5.18/files/x86_64-dotconfig b/srcpkgs/linux5.18/files/x86_64-dotconfig
index 4e73a3195d40..ea6204868e23 100644
--- a/srcpkgs/linux5.18/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.18/files/x86_64-dotconfig
@@ -512,6 +512,7 @@ CONFIG_RETHUNK=y
 CONFIG_CPU_UNRET_ENTRY=y
 CONFIG_CPU_IBPB_ENTRY=y
 CONFIG_CPU_IBRS_ENTRY=y
+CONFIG_SLS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10060,8 +10061,11 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
 # Memory initialization
 #
 CONFIG_INIT_STACK_NONE=y
+# CONFIG_INIT_STACK_ALL_PATTERN is not set
+# CONFIG_INIT_STACK_ALL_ZERO is not set
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
+# CONFIG_ZERO_CALL_USED_REGS is not set
 # end of Memory initialization
 # end of Kernel hardening options
 # end of Security options
@@ -10538,6 +10542,7 @@ CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
 # CONFIG_UBSAN is not set
 CONFIG_HAVE_ARCH_KCSAN=y
+# CONFIG_KCSAN is not set
 # end of Generic Kernel Debugging Instruments
 
 #

From 31d51432608ff3d29172d46dc4412b177726d11b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 18:00:42 -0700
Subject: [PATCH 13/46] xf86-video-vmware: fix build on gcc12

---
 ...183b3395333d5d4c73e25c2d011748f15eda.patch | 30 +++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch

diff --git a/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch b/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch
new file mode 100644
index 000000000000..ff839f16e628
--- /dev/null
+++ b/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch
@@ -0,0 +1,30 @@
+From 77b8183b3395333d5d4c73e25c2d011748f15eda Mon Sep 17 00:00:00 2001
+From: Rudi Heitbaum <rudi@heitbaum.com>
+Date: Sun, 8 May 2022 03:00:10 +0000
+Subject: [PATCH] vmwgfx: fix missing array notation
+
+ Fixes error identified by gcc-12.1.0 compiler
+
+make
+  CC       libvmwgfx_la-vmwgfx_tex_video.lo
+vmwgfx_tex_video.c: In function 'stop_video':
+vmwgfx_tex_video.c:240:20: error: the comparison will always evaluate as 'true' for the address of 'yuv' will never be NULL [-Werror=address]
+  240 |                if (priv->yuv[i]) {
+      |                    ^~~~
+---
+ vmwgfx/vmwgfx_tex_video.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/vmwgfx/vmwgfx_tex_video.c b/vmwgfx/vmwgfx_tex_video.c
+index acc2b56..480a5f1 100644
+--- a/vmwgfx/vmwgfx_tex_video.c
++++ b/vmwgfx/vmwgfx_tex_video.c
+@@ -237,7 +237,7 @@ stop_video(ScrnInfoPtr pScrn, pointer data, Bool shutdown)
+ 
+        for (i=0; i<3; ++i) {
+ 	   for (j=0; j<2; ++j) {
+-	       if (priv->yuv[i]) {
++	       if (priv->yuv[j][i]) {
+ 		   xa_surface_destroy(priv->yuv[j][i]);
+ 		   priv->yuv[j][i] = NULL;
+ 	       }

From 280da9d26a6f87b648f6dd9eb79693999ab7d824 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 18:24:37 -0700
Subject: [PATCH 14/46] doxygen: fix build for gcc 12

---
 srcpkgs/doxygen/patches/compat-gcc12.patch | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100644 srcpkgs/doxygen/patches/compat-gcc12.patch

diff --git a/srcpkgs/doxygen/patches/compat-gcc12.patch b/srcpkgs/doxygen/patches/compat-gcc12.patch
new file mode 100644
index 000000000000..666744a1dceb
--- /dev/null
+++ b/srcpkgs/doxygen/patches/compat-gcc12.patch
@@ -0,0 +1,22 @@
+From 5198966c8d5fec89116d025c74934ac03ea511fa Mon Sep 17 00:00:00 2001
+From: Dimitri van Heesch <doxygen@gmail.com>
+Date: Fri, 6 May 2022 09:55:16 +0200
+Subject: [PATCH] issue #9312: Build: cache.h:53:14: error: 'exchange' is not a
+ member of 'std'
+
+---
+ src/cache.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/cache.h b/src/cache.h
+index 0ff3092ed5..e218eb27d2 100644
+--- a/src/cache.h
++++ b/src/cache.h
+@@ -19,6 +19,7 @@
+ #include <list>
+ #include <unordered_map>
+ #include <mutex>
++#include <utility>
+ #include <ctype.h>
+ 
+ /*! Fixed size cache for value type V using keys of type K.

From 2642114327a6ea86673df43f3530a5e3430c296a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 21 Aug 2022 15:12:00 -0700
Subject: [PATCH 15/46] libproxy: update to 0.4.18

---
 srcpkgs/libproxy/template | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/libproxy/template b/srcpkgs/libproxy/template
index d6103007032e..6599dfb69b98 100644
--- a/srcpkgs/libproxy/template
+++ b/srcpkgs/libproxy/template
@@ -1,18 +1,22 @@
 # Template file for 'libproxy'
 pkgname=libproxy
-version=0.4.15
+version=0.4.18
 revision=1
 build_style=cmake
 configure_args="-DWITH_GNOME=0 -DWITH_KDE4=0 -DWITH_MOZJS=0 -DWITH_NM=0
  -DWITH_PERL=0 -DWITH_PYTHON=1 -DWITH_WEBKIT=0"
 hostmakedepends="pkg-config python"
 makedepends="zlib-devel"
-short_desc="A library handling all the details of proxy configuration"
+short_desc="Library handling all the details of proxy configuration"
 maintainer="Orphaned <orphan@voidlinux.org>"
+license="LGPL-2.1-or-later"
 homepage="http://github.com/libproxy/libproxy"
-license="LGPL-2.1"
-distfiles="https://github.com/libproxy/libproxy/archive/${version}.tar.gz>${pkgname}-${version}.tar.gz"
-checksum=18f58b0a0043b6881774187427ead158d310127fc46a1c668ad6d207fb28b4e0
+distfiles="https://github.com/libproxy/libproxy/archive/${version}.tar.gz"
+checksum=0b4a9218d88f6cf9fa25996a3f38329a11f688a9d026141d9d0e966d8fa63837
+
+post_patch() {
+	vsed '/add_test(NAME url-test/d' -i libproxy/test/CMakeLists.txt
+}
 
 libproxy-devel_package() {
 	depends="libproxy>=${version}_${revision}"

From 3ef2ba3381d00b0c50d134e05602f79e4c393431 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 21 Aug 2022 17:05:39 -0700
Subject: [PATCH 16/46] exempi: update to 2.6.2

---
 ...f034705fd2d032c81383eee8208fd4eee0ac.patch | 43 -------------------
 srcpkgs/exempi/template                       |  4 +-
 2 files changed, 2 insertions(+), 45 deletions(-)
 delete mode 100644 srcpkgs/exempi/patches/8ed2f034705fd2d032c81383eee8208fd4eee0ac.patch

diff --git a/srcpkgs/exempi/patches/8ed2f034705fd2d032c81383eee8208fd4eee0ac.patch b/srcpkgs/exempi/patches/8ed2f034705fd2d032c81383eee8208fd4eee0ac.patch
deleted file mode 100644
index 2696793cec09..000000000000
--- a/srcpkgs/exempi/patches/8ed2f034705fd2d032c81383eee8208fd4eee0ac.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From 8ed2f034705fd2d032c81383eee8208fd4eee0ac Mon Sep 17 00:00:00 2001
-From: Victor Rodriguez <victor.rodriguez.bahena@intel.com>
-Date: Sat, 18 Aug 2018 13:54:55 +0000
-Subject: [PATCH] Issue #9 - Fix null-pointer-dereference (CVE-2018-12648)
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-The WEBP::GetLE32 function in
-XMPFiles/source/FormatSupport/WEBP_Support.hpp in Exempi 2.4.5 has a
-NULL pointer dereference.
-
-https://bugs.freedesktop.org/show_bug.cgi?id=106981
-https://gitlab.freedesktop.org/libopenraw/exempi/issues/9
-
-Signed-off-by: Victor Rodriguez <victor.rodriguez.bahena@intel.com>
-Signed-off-by: Hubert Figuière <hub@figuiere.net>
----
- XMPFiles/source/FormatSupport/WEBP_Support.cpp | 8 +++++---
- 1 file changed, 5 insertions(+), 3 deletions(-)
-
-diff --git a/XMPFiles/source/FormatSupport/WEBP_Support.cpp b/XMPFiles/source/FormatSupport/WEBP_Support.cpp
-index ffaf220..4fe705b 100644
---- a/XMPFiles/source/FormatSupport/WEBP_Support.cpp
-+++ b/XMPFiles/source/FormatSupport/WEBP_Support.cpp
-@@ -160,9 +160,11 @@ bool VP8XChunk::xmp()
- }
- void VP8XChunk::xmp(bool hasXMP)
- {
--    XMP_Uns32 flags = GetLE32(&this->data[0]);
--    flags ^= (-hasXMP ^ flags) & (1 << XMP_FLAG_BIT);
--    PutLE32(&this->data[0], flags);
-+    if (&this->data[0] != NULL) {
-+        XMP_Uns32 flags = GetLE32(&this->data[0]);
-+        flags ^= (-hasXMP ^ flags) & (1 << XMP_FLAG_BIT);
-+        PutLE32(&this->data[0], flags);
-+    }
- }
- 
- Container::Container(WEBP_MetaHandler* handler) : Chunk(NULL, handler)
--- 
-2.18.0
-
diff --git a/srcpkgs/exempi/template b/srcpkgs/exempi/template
index 14753617953a..d664f7dc4d80 100644
--- a/srcpkgs/exempi/template
+++ b/srcpkgs/exempi/template
@@ -1,6 +1,6 @@
 # Template file for 'exempi'
 pkgname=exempi
-version=2.5.0
+version=2.6.2
 revision=1
 build_style=gnu-configure
 configure_args="--with-boost=${XBPS_CROSS_BASE}/usr --disable-static --disable-unittest"
@@ -10,7 +10,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="BSD-3-Clause"
 homepage="https://libopenraw.freedesktop.org/wiki/Exempi"
 distfiles="https://libopenraw.freedesktop.org/download/exempi-${version}.tar.bz2"
-checksum=dc82fc24c0540a44a63fa4ad21775d24e00e63f1dedd3e2ae6f7aa27583b711b
+checksum=4d17d4c93df2a95da3e3172c45b7a5bf317dd31dafd1c7a340169728c7089d1d
 
 post_install() {
 	vlicense COPYING

From f1cf1ce565e5a93cde274a83395db723518532a9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 21 Aug 2022 21:36:03 -0700
Subject: [PATCH 17/46] plymouth: update to 22.02.122

---
 srcpkgs/plymouth/patches/fix-glibc-2.36.patch | 30 +++++++++++++++++++
 srcpkgs/plymouth/template                     |  4 +--
 2 files changed, 32 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/plymouth/patches/fix-glibc-2.36.patch

diff --git a/srcpkgs/plymouth/patches/fix-glibc-2.36.patch b/srcpkgs/plymouth/patches/fix-glibc-2.36.patch
new file mode 100644
index 000000000000..2f1e43875cfb
--- /dev/null
+++ b/srcpkgs/plymouth/patches/fix-glibc-2.36.patch
@@ -0,0 +1,30 @@
+From 5f1e43c00039a7fe1fff768b91a05a695fb4a53d Mon Sep 17 00:00:00 2001
+From: Ray Strode <rstrode@redhat.com>
+Date: Wed, 3 Aug 2022 15:23:33 -0400
+Subject: [PATCH] ply-utils: Drop linux/fs.h include
+
+It was needed long ago for a function we no longer even have.
+
+Now it's causing compile errors on Fedora 37 because it's conflicting
+with sys/mount.h.
+
+This commit drops it.
+---
+ src/libply/ply-utils.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/src/libply/ply-utils.c b/src/libply/ply-utils.c
+index c7b165e9..219e2e77 100644
+--- a/src/libply/ply-utils.c
++++ b/src/libply/ply-utils.c
+@@ -46,7 +46,6 @@
+ #include <sys/user.h>
+ #include <sys/wait.h>
+ #include <time.h>
+-#include <linux/fs.h>
+ #include <linux/vt.h>
+ 
+ #include <dlfcn.h>
+-- 
+GitLab
+
diff --git a/srcpkgs/plymouth/template b/srcpkgs/plymouth/template
index 17f801fc5315..442ab58a99cd 100644
--- a/srcpkgs/plymouth/template
+++ b/srcpkgs/plymouth/template
@@ -1,6 +1,6 @@
 # Template file for 'plymouth'
 pkgname=plymouth
-version=0.9.5
+version=22.02.122
 revision=1
 build_style=gnu-configure
 configure_args="--with-system-root-install=no \
@@ -18,7 +18,7 @@ maintainer="William OD <obirik2005@gmail.com>"
 license="GPL-2.0-or-later"
 homepage="https://www.freedesktop.org/wiki/Software/Plymouth/"
 distfiles="${FREEDESKTOP_SITE}/plymouth/releases/$pkgname-$version.tar.xz"
-checksum=ecae257f351d098340542a5bc06de029404c24dcee87e6ebb2abd5ef117fce86
+checksum=100551442221033ce868c447ad6c74d831d209c18ae232b98ae0207e34eadaeb
 
 build_options="gtk3 pango"
 build_options_default="gtk3 pango"

From 4d1356c8a377a83c3c12b57a0821f3b0aad72d82 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 21 Aug 2022 21:37:00 -0700
Subject: [PATCH 18/46] openjdk7-bootstrap: fix build for gcc12

---
 .../files/dist_patches_glibc.txt              |  1 +
 .../files/dist_patches_musl.txt               |  1 +
 .../icedtea-pointer-comparison-gcc12.patch    | 31 +++++++++++++++++++
 3 files changed, 33 insertions(+)
 create mode 100644 srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch

diff --git a/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt b/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt
index c76c56855441..8061756dfc0c 100644
--- a/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt
+++ b/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt
@@ -6,3 +6,4 @@ icedtea-jdk-no-soname.patch
 icedtea-jdk-xattr.patch
 icedtea-jdk-sysctl_h.patch
 icedtea-cpio.patch
+icedtea-pointer-comparison-gcc12.patch
diff --git a/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt b/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt
index 21812517c7c2..8b35d9c46989 100644
--- a/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt
+++ b/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt
@@ -11,3 +11,4 @@ icedtea-jdk-musl.patch
 icedtea-jdk-no-soname.patch
 icedtea-jdk-xattr.patch
 icedtea-cpio.patch
+icedtea-pointer-comparison-gcc12.patch
diff --git a/srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch b/srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch
new file mode 100644
index 000000000000..c809553443e7
--- /dev/null
+++ b/srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch
@@ -0,0 +1,31 @@
+--- openjdk.orig/hotspot/src/share/vm/opto/lcm.cpp
++++ openjdk/hotspot/src/share/vm/opto/lcm.cpp
+@@ -60,7 +60,7 @@
+ // Check whether val is not-null-decoded compressed oop,
+ // i.e. will grab into the base of the heap if it represents NULL.
+ static bool accesses_heap_base_zone(Node *val) {
+-  if (Universe::narrow_oop_base() > 0) { // Implies UseCompressedOops.
++  if (Universe::narrow_oop_base() > (address)0) { // Implies UseCompressedOops.
+     if (val && val->is_Mach()) {
+       if (val->as_Mach()->ideal_Opcode() == Op_DecodeN) {
+         // This assumes all Decodes with TypePtr::NotNull are matched to nodes that
+--- openjdk.orig/hotspot/src/share/vm/runtime/virtualspace.cpp
++++ openjdk/hotspot/src/share/vm/runtime/virtualspace.cpp
+@@ -527,7 +527,7 @@ ReservedHeapSpace::ReservedHeapSpace(siz
+                 (UseCompressedOops && (Universe::narrow_oop_base() != NULL) &&
+                  Universe::narrow_oop_use_implicit_null_checks()) ?
+                   lcm(os::vm_page_size(), alignment) : 0) {
+-  if (base() > 0) {
++  if (base() > (char*)0) {
+     MemTracker::record_virtual_memory_type((address)base(), mtJavaHeap);
+   }
+ 
+@@ -546,7 +546,7 @@ ReservedHeapSpace::ReservedHeapSpace(con
+                 (UseCompressedOops && (Universe::narrow_oop_base() != NULL) &&
+                  Universe::narrow_oop_use_implicit_null_checks()) ?
+                   lcm(os::vm_page_size(), prefix_align) : 0) {
+-  if (base() > 0) {
++  if (base() > (char*)0) {
+     MemTracker::record_virtual_memory_type((address)base(), mtJavaHeap);
+   }
+ 

From 4ae22febfa411b2be970be06f5a3303e363d0314 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 23:30:16 -0700
Subject: [PATCH 19/46] libunique1: relax warnings for gcc12

---
 srcpkgs/libunique1/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/libunique1/template b/srcpkgs/libunique1/template
index f73931b0c72b..c5a0f5c27860 100644
--- a/srcpkgs/libunique1/template
+++ b/srcpkgs/libunique1/template
@@ -15,7 +15,7 @@ homepage="https://wiki.gnome.org/Attic/LibUnique"
 distfiles="${GNOME_SITE}/libunique/1.1/libunique-${version}.tar.bz2"
 checksum=e5c8041cef8e33c55732f06a292381cb345db946cf792a4ae18aa5c66cdd4fbb
 
-CFLAGS="-Wno-deprecated-declarations"
+CFLAGS="-Wno-deprecated-declarations -Wno-incompatible-pointer-types"
 
 # Package build options
 build_options="gir"

From a129ea8265b0f18b42e951817185de8786557206 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 14:45:28 -0700
Subject: [PATCH 20/46] libsasl: fix build for libtool 2.4.7

---
 srcpkgs/libsasl/template | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/libsasl/template b/srcpkgs/libsasl/template
index a8817042f843..a2993b39f4a1 100644
--- a/srcpkgs/libsasl/template
+++ b/srcpkgs/libsasl/template
@@ -19,6 +19,7 @@ distfiles="https://github.com/cyrusimap/cyrus-sasl/releases/download/cyrus-sasl-
 checksum=26866b1549b00ffd020f188a43c258017fa1c382b3ddadd8201536f72efb05d5
 
 pre_configure() {
+	rm -f m4/ltversion.m4
 	autoreconf -fi
 }
 

From 36014162d12e2f8c73c4a6c4a30f70b68a01b8bb Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:08 -0700
Subject: [PATCH 21/46] subversion: fix build for libtool 2.4.7

---
 srcpkgs/subversion/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion/template b/srcpkgs/subversion/template
index 8ad178264942..3f1c9e254e61 100644
--- a/srcpkgs/subversion/template
+++ b/srcpkgs/subversion/template
@@ -57,7 +57,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From 39fb689a5fd7179f1aad02544ccd5cf58bb7484f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:38 -0700
Subject: [PATCH 22/46] subversion-kwallet-auth: fix build for libtool 2.4.7

---
 srcpkgs/subversion-kwallet-auth/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion-kwallet-auth/template b/srcpkgs/subversion-kwallet-auth/template
index 12210f250d51..b4d8621456ea 100644
--- a/srcpkgs/subversion-kwallet-auth/template
+++ b/srcpkgs/subversion-kwallet-auth/template
@@ -59,7 +59,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From 72507d2de74fde75cb71242ac92ff91d240bfc3e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 20:07:32 -0700
Subject: [PATCH 23/46] gpgme: update to 1.18.0.

---
 common/shlibs          | 2 +-
 srcpkgs/gpgme/template | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 46c0680d55dd..3e3967f58a8c 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -723,7 +723,7 @@ libdconf.so.1 dconf-0.13.90_1
 libassuan.so.0 libassuan-2.0.1_1
 libgpgme.so.11 libgpgme-1.12.0_2
 libgpgmepp.so.6 gpgmepp-1.7.0_3
-libqgpgme.so.7 gpgmeqt-1.7.0_3
+libqgpgme.so.15 gpgmeqt-1.18.0_1
 libgarcon-1.so.0 garcon-0.1.12_1
 libgarcon-gtk2-1.so.0 garcon-0.4.0_1
 libgarcon-gtk3-1.so.0 garcon-0.6.1_1
diff --git a/srcpkgs/gpgme/template b/srcpkgs/gpgme/template
index 8633075a8404..b1cfd5f78657 100644
--- a/srcpkgs/gpgme/template
+++ b/srcpkgs/gpgme/template
@@ -1,7 +1,7 @@
 # Template file for 'gpgme'
 pkgname=gpgme
-version=1.15.1
-revision=2
+version=1.18.0
+revision=1
 build_style=gnu-configure
 configure_args="--enable-fd-passing
  --with-libgpg-error-prefix=$XBPS_CROSS_BASE/usr
@@ -14,7 +14,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.gnupg.org/software/gpgme/index.html"
 distfiles="https://www.gnupg.org/ftp/gcrypt/gpgme/gpgme-${version}.tar.bz2"
-checksum=eebc3c1b27f1c8979896ff361ba9bb4778b508b2496c2fc10e3775a40b1de1ad
+checksum=361d4eae47ce925dba0ea569af40e7b52c645c4ae2e65e5621bf1b6cdd8b0e9e
 
 if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
 	configure_args+=" ac_cv_sys_file_offset_bits=no"

From faf744f839ed8b12d71f03bc2a5a41e22895c8da Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:54 -0700
Subject: [PATCH 24/46] cross-aarch64-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..cb7ae97e7efe 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 43bbfffb3dcfd60c59f5168d2e1c9f2b3a93176d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:54 -0700
Subject: [PATCH 25/46] cross-aarch64-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..4fa950f334d4 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 9f3b46a83df82610d8e0b67eea005988f19d8d80 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:54 -0700
Subject: [PATCH 26/46] cross-arm-linux-gnueabi: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..194c0ab774b7 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 843d164c5869e68c45fc871cfc2c928be268d1ea Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 27/46] cross-arm-linux-gnueabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..3f3242b85b07 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 9835dab86fed18ac7c37a1d7f898fa4393d5a864 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 28/46] cross-arm-linux-musleabi: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..b0cdade60a6d 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 4e2db8e95c5b9a9fa64fbc79b6abbae69f6dedf6 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 29/46] cross-arm-linux-musleabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..1924be24d483 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From e5021e04512c26575be8f3455e9f26b526ddb1e1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 30/46] cross-armv7l-linux-gnueabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..a7997d6db937 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 4c008b8f11c041932cda8b732a9b9346fa9ba82c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 31/46] cross-armv7l-linux-musleabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..aaa7040fbfef 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From f950e3f712f5aefa604391c045742c42c304f260 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 32/46] cross-i686-pc-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..765cf675e95c 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 8038af03b7873768fd92013fe7601002c045599c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 33/46] cross-mips-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-mips-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..26928ba9442d 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From da429f61cc9d6d431e5c239278006060d5b17e93 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 34/46] cross-mips-linux-muslhf: update to gcc 12.1.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..fe74faf15d55 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 238f9c78a1f46738a1a988cbb84c217d71607cc8 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 35/46] cross-mipsel-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..aa74d0b1acc7 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_musl_version=1.1.24
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 6b53dfd6d6da7f86ed39d3a06da7abec2457df17 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 36/46] cross-mipsel-linux-muslhf: update to gcc 12.1.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..83ab7f187085 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_musl_version=1.1.24
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 96d638b13c4cbdc75b5028649bbeec4cf52671c8 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 37/46] cross-powerpc-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..3ab1a4ea40fa 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 96e3d56ce7a330121fd2dcd449e3105aa3c69a1d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 38/46] cross-powerpc-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..af5586cacc77 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 052fbcc3f81436e1c3e259a9ca05588ad58cbd33 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 39/46] cross-powerpc64-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..2604b268046b 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 01d96f778ad37b8940ac7656af5865f77eff99fc Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 40/46] cross-powerpc64-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 1ebd0fb2048d..c7894721b900 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
@@ -19,12 +19,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From ac3c20f3931eadd4363f464f38f686c4af4b4eb1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 41/46] cross-powerpc64le-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 733f5851da5c..618235468970 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 4a1aab2a8c0c68d6dc3341e80f5e592e5330a561 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 42/46] cross-powerpc64le-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index 76a70aa1d6db..7edf9605e60d 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
@@ -19,12 +19,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 3bd566ee88b703278e9510bd13bac14cc7c3f8a5 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 43/46] cross-powerpcle-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 347b8fcf4f55..cc10b7cbd88b 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 9f242ca12b3136fcdddcb934d17cbbd1e14bc0fc Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 44/46] cross-powerpcle-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index ec9324ddaa99..1d38a3fa3559 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From a1b94c259d920e81f582f2ddec1fabc0720a4de4 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 45/46] cross-x86_64-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 0078fbe7224b..9f740b00a80c 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From b7d33983672e3fb8c813b86e13765c9414267b38 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 46/46] cross-x86_64-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..19e13f3818e9 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
@@ -17,12 +17,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.1.0
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (38 preceding siblings ...)
  2022-08-23 19:37 ` oreo639
@ 2022-08-24  5:45 ` oreo639
  2022-08-24  8:04 ` oreo639
                   ` (224 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-08-24  5:45 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5420 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.1.0
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.1.0

This PR depends on: https://github.com/void-linux/void-packages/pull/32330

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

Also, keep in mind that the libgo musl patch here will need to be updated once musl is updated:
https://github.com/void-linux/void-packages/pull/34902/files#diff-1f42a95b93c9550178ff1fbccbef2f47a72711df15c24c9472e2550076978129R163-R176

This is the updated patch for reference:
https://github.com/alpinelinux/aports/blob/8acb21b8ee881e7ab1c812d9a66a17d2501b8730/main/gcc/0049-libgo-adjust-name-of-union-in-sigevent-struct.patch

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/38817
- [x] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [ ] llvm https://github.com/void-linux/void-packages/pull/38694
- [ ] m4 https://github.com/void-linux/void-packages/pull/33730
- [ ] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [ ] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [ ] libvirt https://github.com/void-linux/void-packages/pull/38842
- [ ] syslinux https://github.com/void-linux/void-packages/pull/38876
- [ ] efivar https://github.com/void-linux/void-packages/pull/38874

Known packages that needed to be fixed/updated for gcc12:
- [ ] linux5.18 (in this PR)
- [ ] openssh https://github.com/void-linux/void-packages/pull/38849
- [ ] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [ ] doxygen https://github.com/void-linux/void-packages/pull/38846
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/38817
- [ ] libproxy https://github.com/void-linux/void-packages/pull/38818
- [ ] exempi https://github.com/void-linux/void-packages/pull/38820
- [ ] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [ ] gpgme https://github.com/void-linux/void-packages/pull/38825
- [ ] libunique1 https://github.com/void-linux/void-packages/pull/38848 or https://github.com/void-linux/void-packages/pull/38873
- [ ] libwpd https://github.com/void-linux/void-packages/pull/38878

Needs to be fixed/updated for binutils:
- [ ] grub https://github.com/void-linux/void-packages/pull/38875
- [ ] linux-tools https://github.com/void-linux/void-packages/pull/38877

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [x] kde
- [x] lxde
- [x] lxqt

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 181137 bytes --]

From eb8d490fa2d8f1c8576191d6c76dd3fa4348e8a7 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 01/52] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 15 +++--
 3 files changed, 28 insertions(+), 113 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..4bdaee582d71 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkg-config"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -44,6 +45,12 @@ do_configure() {
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	case "$XBPS_TARGET_MACHINE" in
+		*-musl)
+			conf+=" --disable-gprofng"
+			;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"

From 0988348ffa8f86b3edcfa7f48b393c5362b99bff Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 02/52] gcc: update to 12.1.0.

---
 common/shlibs                                 |  10 +-
 srcpkgs/gcc/files/gccgo-musl.patch            |  74 +++--------
 srcpkgs/gcc/files/libgnarl-musl.patch         |  18 +--
 srcpkgs/gcc/files/libssp-musl.patch           |  10 +-
 ...c21f3f5726823e19728fdd1571a14aae0fb3.patch | 105 ++++++++++++++++
 ...08065bdd36fb1a9b6aad9666b1edb5e06474.patch | 115 ++++++++++++++++++
 ...65517a59565758107c5b1a51a5fa382f8d1a.patch |  32 +++++
 srcpkgs/gcc/patches/libffi_gnulinux.patch     |  11 --
 .../gcc/patches/libgcc-ibm128-no-tag.patch    |  10 +-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |   2 +-
 .../sanitizer-fix-compat-glibc-2.36.patch     |  39 ++++++
 srcpkgs/gcc/template                          |  25 ++--
 12 files changed, 343 insertions(+), 108 deletions(-)
 create mode 100644 srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
 create mode 100644 srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
 create mode 100644 srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch
 create mode 100644 srcpkgs/gcc/patches/sanitizer-fix-compat-glibc-2.36.patch

diff --git a/common/shlibs b/common/shlibs
index f829ee12e80f..776f9b195309 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.1.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.34 perl-5.34.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -848,8 +848,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.1.0_1
+libgnat-12.so libada-12.1.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1700,8 +1700,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.1.0_1
+libasan.so.8 libsanitizer-12.1.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..632ef951097b 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,17 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ a/libgo/go/runtime/os_linux.go
+@@ -363,9 +363,9 @@
+ 
+ 	var timerid int32
+ 	var sevp _sigevent
+-	sevp.sigev_notify = _SIGEV_THREAD_ID
++	sevp.sigev_notify = 4
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.sigev_notify_function))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch b/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
new file mode 100644
index 000000000000..00929202a503
--- /dev/null
+++ b/srcpkgs/gcc/patches/3b21c21f3f5726823e19728fdd1571a14aae0fb3.patch
@@ -0,0 +1,105 @@
+From 3b21c21f3f5726823e19728fdd1571a14aae0fb3 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <siarheit@google.com>
+Date: Mon, 27 Jun 2022 13:27:24 +0100
+Subject: [PATCH] c++: avoid <memory> poisoning on musl [PR106102]
+
+On musl <pthread.h> uses calloc() (via <sched.h>). <memory> includes
+it indirectly and exposes use of poisoned calloc() when module code
+is built:
+
+    /build/build/./prev-gcc/xg++ ... ../../gcc-13-20220626/gcc/cp/mapper-resolver.cc
+        In file included from /<<NIX>>/musl-1.2.3-dev/include/pthread.h:30,
+                 from /build/build/prev-x86_64-unknown-linux-musl/libstdc++-v3/include/x86_64-unknown-linux-musl/bits/gthr-default.h:35,
+                 ....
+                 from /build/build/prev-x86_64-unknown-linux-musl/libstdc++-v3/include/memory:77,
+                 from ../../gcc-13-20220626/gcc/../libcody/cody.hh:24,
+                 from ../../gcc-13-20220626/gcc/cp/../../c++tools/resolver.h:25,
+                 from ../../gcc-13-20220626/gcc/cp/../../c++tools/resolver.cc:23,
+                 from ../../gcc-13-20220626/gcc/cp/mapper-resolver.cc:32:
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:84:7: error: attempt to use poisoned "calloc"
+       84 | void *calloc(size_t, size_t);
+          |       ^
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:124:36: error: attempt to use poisoned "calloc"
+      124 | #define CPU_ALLOC(n) ((cpu_set_t *)calloc(1,CPU_ALLOC_SIZE(n)))
+          |                                    ^
+
+gcc/cp/
+
+	PR c++/106102
+	* mapper-client.cc: Include <memory> via "system.h".
+	* mapper-resolver.cc: Ditto.
+	* module.cc: Ditto.
+
+libcc1/
+
+	PR c++/106102
+	* libcc1plugin.cc: Include <memory> via "system.h".
+	* libcp1plugin.cc: Ditto.
+---
+ gcc/cp/mapper-client.cc   | 1 +
+ gcc/cp/mapper-resolver.cc | 1 +
+ gcc/cp/module.cc          | 1 +
+ libcc1/libcc1plugin.cc    | 1 +
+ libcc1/libcp1plugin.cc    | 1 +
+ 5 files changed, 5 insertions(+)
+
+diff --git a/gcc/cp/mapper-client.cc b/gcc/cp/mapper-client.cc
+index 8603a886a099..fe9544b5ba43 100644
+--- a/gcc/cp/mapper-client.cc
++++ b/gcc/cp/mapper-client.cc
+@@ -27,6 +27,7 @@ along with GCC; see the file COPYING3.  If not see
+ #define INCLUDE_STRING
+ #define INCLUDE_VECTOR
+ #define INCLUDE_MAP
++#define INCLUDE_MEMORY
+ #include "system.h"
+ 
+ #include "line-map.h"
+diff --git a/gcc/cp/mapper-resolver.cc b/gcc/cp/mapper-resolver.cc
+index e3d29fb5ada1..e70d1b4ae2ca 100644
+--- a/gcc/cp/mapper-resolver.cc
++++ b/gcc/cp/mapper-resolver.cc
+@@ -25,6 +25,7 @@ along with GCC; see the file COPYING3.  If not see
+ #define INCLUDE_VECTOR
+ #define INCLUDE_ALGORITHM
+ #define INCLUDE_MAP
++#define INCLUDE_MEMORY
+ #include "system.h"
+ 
+ // We don't want or need to be aware of networking
+diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc
+index 753963a4b246..8bb22c2b305a 100644
+--- a/gcc/cp/module.cc
++++ b/gcc/cp/module.cc
+@@ -206,6 +206,7 @@ Classes used:
+ 
+ #define _DEFAULT_SOURCE 1 /* To get TZ field of struct tm, if available.  */
+ #include "config.h"
++#define INCLUDE_MEMORY
+ #define INCLUDE_STRING
+ #define INCLUDE_VECTOR
+ #include "system.h"
+diff --git a/libcc1/libcc1plugin.cc b/libcc1/libcc1plugin.cc
+index 12ab5a57c8dd..bdd0bdabe77f 100644
+--- a/libcc1/libcc1plugin.cc
++++ b/libcc1/libcc1plugin.cc
+@@ -31,6 +31,7 @@
+ #undef PACKAGE_TARNAME
+ #undef PACKAGE_VERSION
+ 
++#define INCLUDE_MEMORY
+ #include "gcc-plugin.h"
+ #include "system.h"
+ #include "coretypes.h"
+diff --git a/libcc1/libcp1plugin.cc b/libcc1/libcp1plugin.cc
+index 83dab7f58b11..e2d5039a0a1f 100644
+--- a/libcc1/libcp1plugin.cc
++++ b/libcc1/libcp1plugin.cc
+@@ -32,6 +32,7 @@
+ #undef PACKAGE_TARNAME
+ #undef PACKAGE_VERSION
+ 
++#define INCLUDE_MEMORY
+ #include "gcc-plugin.h"
+ #include "system.h"
+ #include "coretypes.h"
diff --git a/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch b/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
new file mode 100644
index 000000000000..89bd053d6d04
--- /dev/null
+++ b/srcpkgs/gcc/patches/49d508065bdd36fb1a9b6aad9666b1edb5e06474.patch
@@ -0,0 +1,115 @@
+From 49d508065bdd36fb1a9b6aad9666b1edb5e06474 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <siarheit@google.com>
+Date: Mon, 27 Jun 2022 23:42:44 +0100
+Subject: [PATCH] jit: avoid calloc() poisoning on musl [PR106102]
+
+On musl <pthread.h> uses calloc() (via <sched.h>). jit/ includes
+it directly and exposes use of poisoned calloc():
+
+    /build/build/./prev-gcc/xg++ ... ../../gcc-13-20220626/gcc/jit/jit-playback.cc
+    make[3]: *** [Makefile:1143: jit/libgccjit.o] Error 1
+    make[3]: *** Waiting for unfinished jobs....
+    In file included from /<<NIX>>/musl-1.2.3-dev/include/pthread.h:30,
+                     from ../../gcc-13-20220626/gcc/jit/jit-playback.cc:44:
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:84:7: error: attempt to use poisoned "calloc"
+       84 | void *calloc(size_t, size_t);
+          |       ^
+    /<<NIX>>/musl-1.2.3-dev/include/sched.h:124:36: error: attempt to use poisoned "calloc"
+      124 | #define CPU_ALLOC(n) ((cpu_set_t *)calloc(1,CPU_ALLOC_SIZE(n)))
+          |                                    ^
+
+The change moves <pthread.h> inclusion to "system.h" under new
+INCLUDE_PTHREAD_H guard and uses this mechanism in libgccjit.
+
+gcc/
+
+	PR c++/106102
+	* system.h: Introduce INCLUDE_PTHREAD_H macros to include <pthread.h>.
+
+gcc/jit/
+
+	PR c++/106102
+	* jit-playback.cc: Include <pthread.h> via "system.h" to avoid calloc()
+	poisoning.
+	* jit-recording.cc: Ditto.
+	* libgccjit.cc: Ditto.
+---
+ gcc/jit/jit-playback.cc  | 3 +--
+ gcc/jit/jit-recording.cc | 2 +-
+ gcc/jit/libgccjit.cc     | 2 +-
+ gcc/system.h             | 4 ++++
+ 4 files changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/gcc/jit/jit-playback.cc b/gcc/jit/jit-playback.cc
+index 6be6bdf8dea5..79714132b91a 100644
+--- a/gcc/jit/jit-playback.cc
++++ b/gcc/jit/jit-playback.cc
+@@ -19,6 +19,7 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "target.h"
+@@ -41,8 +42,6 @@ along with GCC; see the file COPYING3.  If not see
+ #include "diagnostic.h"
+ #include "stmt.h"
+ 
+-#include <pthread.h>
+-
+ #include "jit-playback.h"
+ #include "jit-result.h"
+ #include "jit-builtins.h"
+diff --git a/gcc/jit/jit-recording.cc b/gcc/jit/jit-recording.cc
+index 697dee66e733..f78daed2d71a 100644
+--- a/gcc/jit/jit-recording.cc
++++ b/gcc/jit/jit-recording.cc
+@@ -19,13 +19,13 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "tm.h"
+ #include "pretty-print.h"
+ #include "toplev.h"
+ 
+-#include <pthread.h>
+ 
+ #include "jit-builtins.h"
+ #include "jit-recording.h"
+diff --git a/gcc/jit/libgccjit.cc b/gcc/jit/libgccjit.cc
+index 0e76097b4bac..ca862662777e 100644
+--- a/gcc/jit/libgccjit.cc
++++ b/gcc/jit/libgccjit.cc
+@@ -19,12 +19,12 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #include "config.h"
++#define INCLUDE_PTHREAD_H
+ #include "system.h"
+ #include "coretypes.h"
+ #include "timevar.h"
+ #include "typed-splay-tree.h"
+ #include "cppbuiltin.h"
+-#include <pthread.h>
+ 
+ #include "libgccjit.h"
+ #include "jit-recording.h"
+diff --git a/gcc/system.h b/gcc/system.h
+index 67158b70c789..f8d42ff68150 100644
+--- a/gcc/system.h
++++ b/gcc/system.h
+@@ -753,6 +753,10 @@ extern int vsnprintf (char *, size_t, const char *, va_list);
+ #endif
+ #endif
+ 
++#ifdef INCLUDE_PTHREAD_H
++#include <pthread.h>
++#endif
++
+ #ifdef INCLUDE_ISL
+ #ifdef HAVE_isl
+ #include <isl/options.h>
diff --git a/srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch b/srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch
new file mode 100644
index 000000000000..044a4fc29514
--- /dev/null
+++ b/srcpkgs/gcc/patches/f35d65517a59565758107c5b1a51a5fa382f8d1a.patch
@@ -0,0 +1,32 @@
+From f35d65517a59565758107c5b1a51a5fa382f8d1a Mon Sep 17 00:00:00 2001
+From: Ian Lance Taylor <iant@golang.org>
+Date: Tue, 12 Jul 2022 19:42:43 -0700
+Subject: [PATCH] libgo: don't include <linux/fs.h> when building
+ gen-sysinfo.go
+
+Removing this doesn't change anything at least with glibc 2.33.
+The include was added in https://go.dev/cl/6100049 but it's not
+clear why.
+
+Fixes PR go/106266
+
+Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/417294
+---
+ gcc/go/gofrontend/MERGE | 2 +-
+ libgo/sysinfo.c         | 3 ---
+ 2 files changed, 1 insertion(+), 4 deletions(-)
+
+diff --git a/libgo/sysinfo.c b/libgo/sysinfo.c
+index a4259c02ded4..fc0210992faa 100644
+--- a/libgo/sysinfo.c
++++ b/libgo/sysinfo.c
+@@ -158,9 +158,6 @@
+ #if defined(HAVE_LINUX_ETHER_H)
+ #include <linux/ether.h>
+ #endif
+-#if defined(HAVE_LINUX_FS_H)
+-#include <linux/fs.h>
+-#endif
+ #if defined(HAVE_LINUX_REBOOT_H)
+ #include <linux/reboot.h>
+ #endif
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/patches/sanitizer-fix-compat-glibc-2.36.patch b/srcpkgs/gcc/patches/sanitizer-fix-compat-glibc-2.36.patch
new file mode 100644
index 000000000000..851cde0e2077
--- /dev/null
+++ b/srcpkgs/gcc/patches/sanitizer-fix-compat-glibc-2.36.patch
@@ -0,0 +1,39 @@
+From 2701442d0cf6292f6624443c15813d6d1a3562fe Mon Sep 17 00:00:00 2001
+From: Martin Liska <mliska@suse.cz>
+Date: Mon, 11 Jul 2022 22:03:14 +0200
+Subject: [PATCH] libsanitizer: cherry-pick 9cf13067cb5088626ba7 from upstream
+
+9cf13067cb5088626ba7ee1ec4c42ec59c7995a0 [sanitizer] Remove #include <linux/fs.h> to resolve fsconfig_command/mount_attr conflict with glibc 2.36
+---
+ .../sanitizer_platform_limits_posix.cpp                | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
+index 8ed3e92d2704..97fd07acf9d4 100644
+--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -73,7 +73,9 @@
+ #include <sys/vt.h>
+ #include <linux/cdrom.h>
+ #include <linux/fd.h>
++#if SANITIZER_ANDROID
+ #include <linux/fs.h>
++#endif
+ #include <linux/hdreg.h>
+ #include <linux/input.h>
+ #include <linux/ioctl.h>
+@@ -869,10 +871,10 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
+   unsigned IOCTL_EVIOCGPROP = IOCTL_NOT_PRESENT;
+   unsigned IOCTL_EVIOCSKEYCODE_V2 = IOCTL_NOT_PRESENT;
+ #endif
+-  unsigned IOCTL_FS_IOC_GETFLAGS = FS_IOC_GETFLAGS;
+-  unsigned IOCTL_FS_IOC_GETVERSION = FS_IOC_GETVERSION;
+-  unsigned IOCTL_FS_IOC_SETFLAGS = FS_IOC_SETFLAGS;
+-  unsigned IOCTL_FS_IOC_SETVERSION = FS_IOC_SETVERSION;
++  unsigned IOCTL_FS_IOC_GETFLAGS = _IOR('f', 1, long);
++  unsigned IOCTL_FS_IOC_GETVERSION = _IOR('v', 1, long);
++  unsigned IOCTL_FS_IOC_SETFLAGS = _IOW('f', 2, long);
++  unsigned IOCTL_FS_IOC_SETVERSION = _IOW('v', 2, long);
+   unsigned IOCTL_GIO_CMAP = GIO_CMAP;
+   unsigned IOCTL_GIO_FONT = GIO_FONT;
+   unsigned IOCTL_GIO_UNIMAP = GIO_UNIMAP;
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..32ee79e32f0d 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,15 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
+version=12.1.0
+revision=1
 _patchver="${version%pre*}"
 _minorver="${_patchver%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 wrksrc=gcc-${version/pre/_pre}
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +19,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -396,7 +393,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}

From 21a6cf60cf701101bb469f39d71559fcbc2ea597 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 03/52] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      |  6 ++--
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..08e35d466a44 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From e7455ccb1f6065b7b9505fde0d0d2b71c751f694 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 04/52] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 1a4e1ca3d594..b04268908c2e 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="q66 <daniel@octaforge.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From 6d9d8ee26ab5a599569ac98d776b6047da2c892c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 05/52] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 3 files changed, 55 insertions(+), 353 deletions(-)
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index 776f9b195309..46c0680d55dd 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From 87cd73a1caec4cba78a3c2cdc4ac22235cfb5ef4 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 21:01:43 -0700
Subject: [PATCH 06/52] gcc-multilib: update to 12.1.0.

---
 .../sanitizer-fix-compat-glibc-2.36.patch     | 39 +++++++++++++++++++
 srcpkgs/gcc-multilib/template                 |  8 ++--
 2 files changed, 43 insertions(+), 4 deletions(-)
 create mode 100644 srcpkgs/gcc-multilib/patches/sanitizer-fix-compat-glibc-2.36.patch

diff --git a/srcpkgs/gcc-multilib/patches/sanitizer-fix-compat-glibc-2.36.patch b/srcpkgs/gcc-multilib/patches/sanitizer-fix-compat-glibc-2.36.patch
new file mode 100644
index 000000000000..851cde0e2077
--- /dev/null
+++ b/srcpkgs/gcc-multilib/patches/sanitizer-fix-compat-glibc-2.36.patch
@@ -0,0 +1,39 @@
+From 2701442d0cf6292f6624443c15813d6d1a3562fe Mon Sep 17 00:00:00 2001
+From: Martin Liska <mliska@suse.cz>
+Date: Mon, 11 Jul 2022 22:03:14 +0200
+Subject: [PATCH] libsanitizer: cherry-pick 9cf13067cb5088626ba7 from upstream
+
+9cf13067cb5088626ba7ee1ec4c42ec59c7995a0 [sanitizer] Remove #include <linux/fs.h> to resolve fsconfig_command/mount_attr conflict with glibc 2.36
+---
+ .../sanitizer_platform_limits_posix.cpp                | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
+index 8ed3e92d2704..97fd07acf9d4 100644
+--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -73,7 +73,9 @@
+ #include <sys/vt.h>
+ #include <linux/cdrom.h>
+ #include <linux/fd.h>
++#if SANITIZER_ANDROID
+ #include <linux/fs.h>
++#endif
+ #include <linux/hdreg.h>
+ #include <linux/input.h>
+ #include <linux/ioctl.h>
+@@ -869,10 +871,10 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
+   unsigned IOCTL_EVIOCGPROP = IOCTL_NOT_PRESENT;
+   unsigned IOCTL_EVIOCSKEYCODE_V2 = IOCTL_NOT_PRESENT;
+ #endif
+-  unsigned IOCTL_FS_IOC_GETFLAGS = FS_IOC_GETFLAGS;
+-  unsigned IOCTL_FS_IOC_GETVERSION = FS_IOC_GETVERSION;
+-  unsigned IOCTL_FS_IOC_SETFLAGS = FS_IOC_SETFLAGS;
+-  unsigned IOCTL_FS_IOC_SETVERSION = FS_IOC_SETVERSION;
++  unsigned IOCTL_FS_IOC_GETFLAGS = _IOR('f', 1, long);
++  unsigned IOCTL_FS_IOC_GETVERSION = _IOR('v', 1, long);
++  unsigned IOCTL_FS_IOC_SETFLAGS = _IOW('f', 2, long);
++  unsigned IOCTL_FS_IOC_SETVERSION = _IOW('v', 2, long);
+   unsigned IOCTL_GIO_CMAP = GIO_CMAP;
+   unsigned IOCTL_GIO_FONT = GIO_FONT;
+   unsigned IOCTL_GIO_UNIMAP = GIO_UNIMAP;
diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index fcd25755aa75..573d323fe05e 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,16 +3,16 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.1.0
 revision=1
 _majorver="${version%.*}"
-wrksrc=gcc-${version/pre/_pre}
+wrksrc=gcc-${version}
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel

From b215bc9d8abd08bca7d346e958dee1b119232b55 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 16:22:03 -0700
Subject: [PATCH 07/52] llvm12: fix build for glibc 2.36

---
 .../compiler-rt-sanitizer-glibc-2.36.patch    | 59 +++++++++++++++++++
 1 file changed, 59 insertions(+)
 create mode 100644 srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch

diff --git a/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch b/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch
new file mode 100644
index 000000000000..e5f24dab8935
--- /dev/null
+++ b/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch
@@ -0,0 +1,59 @@
+From 9cf13067cb5088626ba7ee1ec4c42ec59c7995a0 Mon Sep 17 00:00:00 2001
+From: Fangrui Song <i@maskray.me>
+Date: Mon, 11 Jul 2022 12:53:34 -0700
+Subject: [PATCH] [sanitizer] Remove #include <linux/fs.h> to resolve
+ fsconfig_command/mount_attr conflict with glibc 2.36
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+It is generally not a good idea to mix usage of glibc headers and Linux UAPI
+headers (https://sourceware.org/glibc/wiki/Synchronizing_Headers). In glibc
+since 7eae6a91e9b1670330c9f15730082c91c0b1d570 (milestone: 2.36), sys/mount.h
+defines `fsconfig_command` which conflicts with linux/mount.h:
+
+    .../usr/include/linux/mount.h:95:6: error: redeclaration of ‘enum fsconfig_command’
+
+Remove #include <linux/fs.h> which pulls in linux/mount.h. Expand its 4 macros manually.
+Android sys/mount.h doesn't define BLKBSZGET and it still needs linux/fs.h.
+In the long term we should move Linux specific definitions to sanitizer_platform_limits_linux.cpp
+but this commit is easy to cherry pick into older compiler-rt releases.
+
+Fix https://github.com/llvm/llvm-project/issues/56421
+
+Reviewed By: #sanitizers, vitalybuka, zatrazz
+
+Differential Revision: https://reviews.llvm.org/D129471
+---
+ .../sanitizer_platform_limits_posix.cpp                | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+index 4bd425435d56d..3a94b260686f1 100644
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -73,7 +73,9 @@
+ #include <sys/vt.h>
+ #include <linux/cdrom.h>
+ #include <linux/fd.h>
++#if SANITIZER_ANDROID
+ #include <linux/fs.h>
++#endif
+ #include <linux/hdreg.h>
+ #include <linux/input.h>
+ #include <linux/ioctl.h>
+@@ -876,10 +878,10 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
+   unsigned IOCTL_EVIOCGPROP = IOCTL_NOT_PRESENT;
+   unsigned IOCTL_EVIOCSKEYCODE_V2 = IOCTL_NOT_PRESENT;
+ #endif
+-  unsigned IOCTL_FS_IOC_GETFLAGS = FS_IOC_GETFLAGS;
+-  unsigned IOCTL_FS_IOC_GETVERSION = FS_IOC_GETVERSION;
+-  unsigned IOCTL_FS_IOC_SETFLAGS = FS_IOC_SETFLAGS;
+-  unsigned IOCTL_FS_IOC_SETVERSION = FS_IOC_SETVERSION;
++  unsigned IOCTL_FS_IOC_GETFLAGS = _IOR('f', 1, long);
++  unsigned IOCTL_FS_IOC_GETVERSION = _IOR('v', 1, long);
++  unsigned IOCTL_FS_IOC_SETFLAGS = _IOW('f', 2, long);
++  unsigned IOCTL_FS_IOC_SETVERSION = _IOW('v', 2, long);
+   unsigned IOCTL_GIO_CMAP = GIO_CMAP;
+   unsigned IOCTL_GIO_FONT = GIO_FONT;
+   unsigned IOCTL_GIO_UNIMAP = GIO_UNIMAP;

From b2af8b0d68230cf07b84094c6ca2efdae7aabe3e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 17:21:40 -0700
Subject: [PATCH 08/52] m4: update to 1.4.19.

---
 srcpkgs/m4/patches/fix-glibc-2.27.patch | 167 ------------------------
 srcpkgs/m4/template                     |  12 +-
 2 files changed, 6 insertions(+), 173 deletions(-)
 delete mode 100644 srcpkgs/m4/patches/fix-glibc-2.27.patch

diff --git a/srcpkgs/m4/patches/fix-glibc-2.27.patch b/srcpkgs/m4/patches/fix-glibc-2.27.patch
deleted file mode 100644
index 59d33cff164d..000000000000
--- a/srcpkgs/m4/patches/fix-glibc-2.27.patch
+++ /dev/null
@@ -1,167 +0,0 @@
-From 4af4a4a71827c0bc5e0ec67af23edef4f15cee8e Mon Sep 17 00:00:00 2001
-From: Paul Eggert <eggert@cs.ucla.edu>
-Date: Mon, 5 Mar 2018 10:56:29 -0800
-Subject: [PATCH] fflush: adjust to glibc 2.28 libio.h removal
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Problem reported by Daniel P. Berrangé in:
-https://lists.gnu.org/r/bug-gnulib/2018-03/msg00000.html
-* lib/fbufmode.c (fbufmode):
-* lib/fflush.c (clear_ungetc_buffer_preserving_position)
-(disable_seek_optimization, rpl_fflush):
-* lib/fpending.c (__fpending):
-* lib/fpurge.c (fpurge):
-* lib/freadable.c (freadable):
-* lib/freadahead.c (freadahead):
-* lib/freading.c (freading):
-* lib/freadptr.c (freadptr):
-* lib/freadseek.c (freadptrinc):
-* lib/fseeko.c (fseeko):
-* lib/fseterr.c (fseterr):
-* lib/fwritable.c (fwritable):
-* lib/fwriting.c (fwriting):
-Check _IO_EOF_SEEN instead of _IO_ftrylockfile.
-* lib/stdio-impl.h (_IO_IN_BACKUP) [_IO_EOF_SEEN]:
-Define if not already defined.
-
-[yann.morin.1998@free.fr: partially backport from upstream gnulib]
-Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
-
----
- lib/fflush.c     |  6 +++---
- lib/fpending.c   |  2 +-
- lib/fpurge.c     |  2 +-
- lib/freadahead.c |  2 +-
- lib/freading.c   |  2 +-
- lib/fseeko.c     |  4 ++--
- lib/stdio-impl.h |  6 ++++++
- 7 files changed, 15 insertions(+), 9 deletions(-)
-
-diff --git a/lib/fflush.c b/build-aux/gnulib/lib/fflush.c
-index 983ade0ff..a6edfa105 100644
---- a/lib/fflush.c
-+++ b/lib/fflush.c
-@@ -33,7 +33,7 @@
- #undef fflush
- 
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- 
- /* Clear the stream's ungetc buffer, preserving the value of ftello (fp).  */
- static void
-@@ -72,7 +72,7 @@ clear_ungetc_buffer (FILE *fp)
- 
- #endif
- 
--#if ! (defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
-+#if ! (defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
- 
- # if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT
- /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
-@@ -148,7 +148,7 @@ rpl_fflush (FILE *stream)
-   if (stream == NULL || ! freading (stream))
-     return fflush (stream);
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- 
-   clear_ungetc_buffer_preserving_position (stream);
- 
-diff --git a/lib/fpending.c b/build-aux/gnulib/lib/fpending.c
-index c84e3a5b4..789f50e4e 100644
---- a/lib/fpending.c
-+++ b/lib/fpending.c
-@@ -32,7 +32,7 @@ __fpending (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   return fp->_IO_write_ptr - fp->_IO_write_base;
- #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
-   /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
-diff --git a/lib/fpurge.c b/build-aux/gnulib/lib/fpurge.c
-index b1d417c7a..3aedcc373 100644
---- a/lib/fpurge.c
-+++ b/lib/fpurge.c
-@@ -62,7 +62,7 @@ fpurge (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   fp->_IO_read_end = fp->_IO_read_ptr;
-   fp->_IO_write_ptr = fp->_IO_write_base;
-   /* Avoid memory leak when there is an active ungetc buffer.  */
-diff --git a/lib/freadahead.c b/build-aux/gnulib/lib/freadahead.c
-index c2ecb5b28..23ec76ee5 100644
---- a/lib/freadahead.c
-+++ b/lib/freadahead.c
-@@ -30,7 +30,7 @@ extern size_t __sreadahead (FILE *);
- size_t
- freadahead (FILE *fp)
- {
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   if (fp->_IO_write_ptr > fp->_IO_write_base)
-     return 0;
-   return (fp->_IO_read_end - fp->_IO_read_ptr)
-diff --git a/lib/freading.c b/build-aux/gnulib/lib/freading.c
-index 73c28acdd..c24d0c88a 100644
---- a/lib/freading.c
-+++ b/lib/freading.c
-@@ -31,7 +31,7 @@ freading (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   return ((fp->_flags & _IO_NO_WRITES) != 0
-           || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0
-               && fp->_IO_read_base != NULL));
-diff --git a/lib/fseeko.c b/build-aux/gnulib/lib/fseeko.c
-index 0101ab55f..193f4e8ce 100644
---- a/lib/fseeko.c
-+++ b/lib/fseeko.c
-@@ -47,7 +47,7 @@ fseeko (FILE *fp, off_t offset, int whence)
- #endif
- 
-   /* These tests are based on fpurge.c.  */
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   if (fp->_IO_read_end == fp->_IO_read_ptr
-       && fp->_IO_write_ptr == fp->_IO_write_base
-       && fp->_IO_save_base == NULL)
-@@ -123,7 +123,7 @@ fseeko (FILE *fp, off_t offset, int whence)
-           return -1;
-         }
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-       fp->_flags &= ~_IO_EOF_SEEN;
-       fp->_offset = pos;
- #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
-diff --git a/lib/stdio-impl.h b/build-aux/gnulib/lib/stdio-impl.h
-index 78d896e9f..05c5752a2 100644
---- a/lib/stdio-impl.h
-+++ b/lib/stdio-impl.h
-@@ -18,6 +18,12 @@
-    the same implementation of stdio extension API, except that some fields
-    have different naming conventions, or their access requires some casts.  */
- 
-+/* Glibc 2.28 made _IO_IN_BACKUP private.  For now, work around this
-+   problem by defining it ourselves.  FIXME: Do not rely on glibc
-+   internals.  */
-+#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN
-+# define _IO_IN_BACKUP 0x100
-+#endif
- 
- /* BSD stdio derived implementations.  */
- 
--- 
-2.14.1
-
-
diff --git a/srcpkgs/m4/template b/srcpkgs/m4/template
index 78f3dae6184a..762593d883bd 100644
--- a/srcpkgs/m4/template
+++ b/srcpkgs/m4/template
@@ -1,17 +1,17 @@
 # Template file for 'm4'
 pkgname=m4
-version=1.4.18
-revision=2
+version=1.4.19
+revision=1
 bootstrap=yes
-replaces="chroot-m4>=0"
 build_style=gnu-configure
 configure_args="--enable-changeword --enable-threads"
 short_desc="GNU version of UNIX m4 macro language processor"
-homepage="https://www.gnu.org/software/m4/"
-license="GPL-3.0-or-later"
 maintainer="Enno Boland <gottox@voidlinux.org>"
+license="GPL-3.0-or-later"
+homepage="https://www.gnu.org/software/m4/"
 distfiles="${GNU_SITE}/${pkgname}/${pkgname}-${version}.tar.xz"
-checksum=f2c1e86ca0a404ff281631bdc8377638992744b175afb806e25871a24a934e07
+checksum=63aede5c6d33b6d9b13511cd0be2cac046f2e70fd0a07aa9573a04a82783af96
+replaces="chroot-m4>=0"
 
 if [ "$XBPS_TARGET_LIBC" = musl ]; then
 	export ac_cv_lib_error_at_line=no

From 557c15bbd55dea8e3b74d326e0f0dbff65924933 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 22:57:59 -0700
Subject: [PATCH 09/52] btrfs-progs: update to 5.19.

---
 srcpkgs/btrfs-progs/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/btrfs-progs/template b/srcpkgs/btrfs-progs/template
index f6c53d8587e1..292d5110106b 100644
--- a/srcpkgs/btrfs-progs/template
+++ b/srcpkgs/btrfs-progs/template
@@ -1,6 +1,6 @@
 # Template file for 'btrfs-progs'
 pkgname=btrfs-progs
-version=5.18.1
+version=5.19
 revision=1
 wrksrc="${pkgname}-v${version}"
 build_style=gnu-configure
@@ -16,7 +16,7 @@ license="GPL-2.0-only, LGPL-2.1-or-later"
 homepage="https://btrfs.wiki.kernel.org/index.php/Main_Page"
 changelog="https://raw.githubusercontent.com/kdave/btrfs-progs/master/CHANGES"
 distfiles="${KERNEL_SITE}/kernel/people/kdave/${pkgname}/${pkgname}-v${version}.tar.xz"
-checksum=6e98a75ccff52e9354daa1ad284c614c490f844273a2fa524cbac9eb841c7255
+checksum=1fbcf06e4b2f80e7a127fd687ed4625a5b74fa674fe212c836ff70e0edfcccf9
 # Most of the tests depend on `mount` and `fallocate` commands, which are not
 # presented in chroot-util-linux
 make_check=no

From 965fa28b6ff628974a088f713d4d60827c76a2d3 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 19:39:23 -0700
Subject: [PATCH 10/52] syslinux: fix build for glibc 2.36

---
 .../patches/fix-build-with-glibc-2.36.patch   | 30 +++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 srcpkgs/syslinux/patches/fix-build-with-glibc-2.36.patch

diff --git a/srcpkgs/syslinux/patches/fix-build-with-glibc-2.36.patch b/srcpkgs/syslinux/patches/fix-build-with-glibc-2.36.patch
new file mode 100644
index 000000000000..1303be56c127
--- /dev/null
+++ b/srcpkgs/syslinux/patches/fix-build-with-glibc-2.36.patch
@@ -0,0 +1,30 @@
+--- a/linux/syslinux.c
++++ b/linux/syslinux.c
+@@ -45,7 +45,6 @@
+ #include <sys/stat.h>
+ #include <sys/types.h>
+ #include <sys/wait.h>
+-#include <sys/mount.h>
+ 
+ #include "linuxioctl.h"
+ 
+--- a/libinstaller/syslxcom.c
++++ b/libinstaller/syslxcom.c
+@@ -28,7 +28,6 @@
+ #include <errno.h>
+ #include <sys/stat.h>
+ #include <sys/types.h>
+-#include <sys/mount.h>
+ #include <sys/vfs.h>
+ 
+ #include "linuxioctl.h"
+--- a/extlinux/main.c
++++ b/extlinux/main.c
+@@ -40,7 +40,6 @@
+ #include <sys/stat.h>
+ #include <sys/sysmacros.h>
+ #include <sys/types.h>
+-#include <sys/mount.h>
+ #include <sys/vfs.h>
+ 
+ #include "linuxioctl.h"

From c6407ebf50dd2766c452b6130dd06c5f155842dd Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 14 Aug 2022 19:29:36 -0700
Subject: [PATCH 11/52] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove nopie=yes. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh             |  1 +
 common/environment/build-style/void-cross.sh | 36 +++++++++++++++++++-
 2 files changed, 36 insertions(+), 1 deletion(-)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..c24013755704 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -132,6 +132,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
diff --git a/common/environment/build-style/void-cross.sh b/common/environment/build-style/void-cross.sh
index 62ce9eaa2e4a..4b77c90efc8b 100644
--- a/common/environment/build-style/void-cross.sh
+++ b/common/environment/build-style/void-cross.sh
@@ -1,6 +1,40 @@
 lib32disabled=yes
-nopie=yes
 create_wrksrc=yes
 
 nostrip_files+=" libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a libgmem.a"
+nopie_files+=" /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/go1
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/lto-wrapper
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/plugin/gengtype
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/cc1objplus
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/cc1obj
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/collect2
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/lto1
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/f951
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/cc1
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/gnat1
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/cc1plus
+ /usr/bin/${sourcepkg/cross-}-gcov-dump
+ /usr/bin/${sourcepkg/cross-}-gnatlink
+ /usr/bin/${sourcepkg/cross-}-gnatbind
+ /usr/bin/${sourcepkg/cross-}-gcc
+ /usr/bin/${sourcepkg/cross-}-cpp
+ /usr/bin/${sourcepkg/cross-}-gnatchop
+ /usr/bin/${sourcepkg/cross-}-gfortran
+ /usr/bin/${sourcepkg/cross-}-gccgo
+ /usr/bin/${sourcepkg/cross-}-c++
+ /usr/bin/${sourcepkg/cross-}-lto-dump
+ /usr/bin/${sourcepkg/cross-}-gnatname
+ /usr/bin/${sourcepkg/cross-}-gnatprep
+ /usr/bin/${sourcepkg/cross-}-g++
+ /usr/bin/${sourcepkg/cross-}-gnat
+ /usr/bin/${sourcepkg/cross-}-gcc-ranlib
+ /usr/bin/${sourcepkg/cross-}-gnatkr
+ /usr/bin/${sourcepkg/cross-}-gnatmake
+ /usr/bin/${sourcepkg/cross-}-gcc-${_gcc_version}
+ /usr/bin/${sourcepkg/cross-}-gcc-ar
+ /usr/bin/${sourcepkg/cross-}-gnatclean
+ /usr/bin/${sourcepkg/cross-}-gcov
+ /usr/bin/${sourcepkg/cross-}-gnatls
+ /usr/bin/${sourcepkg/cross-}-gcc-nm
+ /usr/bin/${sourcepkg/cross-}-gcov-tool"

From 86aff52eff9f0eb772ff005b20fce0020ae40e8e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:08:52 -0700
Subject: [PATCH 12/52] openssh: suppress werror on gcc12

---
 srcpkgs/openssh/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/openssh/template b/srcpkgs/openssh/template
index 02a2dec35f42..6e8e343a9dca 100644
--- a/srcpkgs/openssh/template
+++ b/srcpkgs/openssh/template
@@ -40,7 +40,7 @@ if [ "$build_option_ldns" -a -z "$build_option_ssl" ]; then
 	broken="option 'ldns' requires option 'ssl'"
 fi
 
-CFLAGS="-Wno-format-truncation -Wno-stringop-truncation"
+CFLAGS="-Wno-format-truncation -Wno-stringop-truncation -Wno-error=maybe-uninitialized"
 
 case $XBPS_TARGET_MACHINE in
 	i686-musl)

From 1a4ce9a1ba5806dbe6ff0575c06ac62fc4c8d9fd Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:09:31 -0700
Subject: [PATCH 13/52] linux5.18: update dotconfigs for gcc12

---
 srcpkgs/linux5.18/files/x86_64-dotconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/linux5.18/files/x86_64-dotconfig b/srcpkgs/linux5.18/files/x86_64-dotconfig
index 4e73a3195d40..ea6204868e23 100644
--- a/srcpkgs/linux5.18/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.18/files/x86_64-dotconfig
@@ -512,6 +512,7 @@ CONFIG_RETHUNK=y
 CONFIG_CPU_UNRET_ENTRY=y
 CONFIG_CPU_IBPB_ENTRY=y
 CONFIG_CPU_IBRS_ENTRY=y
+CONFIG_SLS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10060,8 +10061,11 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
 # Memory initialization
 #
 CONFIG_INIT_STACK_NONE=y
+# CONFIG_INIT_STACK_ALL_PATTERN is not set
+# CONFIG_INIT_STACK_ALL_ZERO is not set
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
+# CONFIG_ZERO_CALL_USED_REGS is not set
 # end of Memory initialization
 # end of Kernel hardening options
 # end of Security options
@@ -10538,6 +10542,7 @@ CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
 # CONFIG_UBSAN is not set
 CONFIG_HAVE_ARCH_KCSAN=y
+# CONFIG_KCSAN is not set
 # end of Generic Kernel Debugging Instruments
 
 #

From caf5cd38456fdc0be60e13a18ca353b63d09a7d0 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 18:00:42 -0700
Subject: [PATCH 14/52] xf86-video-vmware: fix build on gcc12

---
 ...183b3395333d5d4c73e25c2d011748f15eda.patch | 30 +++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch

diff --git a/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch b/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch
new file mode 100644
index 000000000000..ff839f16e628
--- /dev/null
+++ b/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch
@@ -0,0 +1,30 @@
+From 77b8183b3395333d5d4c73e25c2d011748f15eda Mon Sep 17 00:00:00 2001
+From: Rudi Heitbaum <rudi@heitbaum.com>
+Date: Sun, 8 May 2022 03:00:10 +0000
+Subject: [PATCH] vmwgfx: fix missing array notation
+
+ Fixes error identified by gcc-12.1.0 compiler
+
+make
+  CC       libvmwgfx_la-vmwgfx_tex_video.lo
+vmwgfx_tex_video.c: In function 'stop_video':
+vmwgfx_tex_video.c:240:20: error: the comparison will always evaluate as 'true' for the address of 'yuv' will never be NULL [-Werror=address]
+  240 |                if (priv->yuv[i]) {
+      |                    ^~~~
+---
+ vmwgfx/vmwgfx_tex_video.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/vmwgfx/vmwgfx_tex_video.c b/vmwgfx/vmwgfx_tex_video.c
+index acc2b56..480a5f1 100644
+--- a/vmwgfx/vmwgfx_tex_video.c
++++ b/vmwgfx/vmwgfx_tex_video.c
+@@ -237,7 +237,7 @@ stop_video(ScrnInfoPtr pScrn, pointer data, Bool shutdown)
+ 
+        for (i=0; i<3; ++i) {
+ 	   for (j=0; j<2; ++j) {
+-	       if (priv->yuv[i]) {
++	       if (priv->yuv[j][i]) {
+ 		   xa_surface_destroy(priv->yuv[j][i]);
+ 		   priv->yuv[j][i] = NULL;
+ 	       }

From 4a58e3444a3d12e9a4c01b0772525542875d1253 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 18:24:37 -0700
Subject: [PATCH 15/52] doxygen: fix build for gcc 12

---
 srcpkgs/doxygen/patches/compat-gcc12.patch | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100644 srcpkgs/doxygen/patches/compat-gcc12.patch

diff --git a/srcpkgs/doxygen/patches/compat-gcc12.patch b/srcpkgs/doxygen/patches/compat-gcc12.patch
new file mode 100644
index 000000000000..666744a1dceb
--- /dev/null
+++ b/srcpkgs/doxygen/patches/compat-gcc12.patch
@@ -0,0 +1,22 @@
+From 5198966c8d5fec89116d025c74934ac03ea511fa Mon Sep 17 00:00:00 2001
+From: Dimitri van Heesch <doxygen@gmail.com>
+Date: Fri, 6 May 2022 09:55:16 +0200
+Subject: [PATCH] issue #9312: Build: cache.h:53:14: error: 'exchange' is not a
+ member of 'std'
+
+---
+ src/cache.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/cache.h b/src/cache.h
+index 0ff3092ed5..e218eb27d2 100644
+--- a/src/cache.h
++++ b/src/cache.h
+@@ -19,6 +19,7 @@
+ #include <list>
+ #include <unordered_map>
+ #include <mutex>
++#include <utility>
+ #include <ctype.h>
+ 
+ /*! Fixed size cache for value type V using keys of type K.

From 66e350355bee846bb12f8480c648203eb9bc5b4c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 21 Aug 2022 15:12:00 -0700
Subject: [PATCH 16/52] libproxy: update to 0.4.18

---
 srcpkgs/libproxy/template | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/libproxy/template b/srcpkgs/libproxy/template
index d6103007032e..6599dfb69b98 100644
--- a/srcpkgs/libproxy/template
+++ b/srcpkgs/libproxy/template
@@ -1,18 +1,22 @@
 # Template file for 'libproxy'
 pkgname=libproxy
-version=0.4.15
+version=0.4.18
 revision=1
 build_style=cmake
 configure_args="-DWITH_GNOME=0 -DWITH_KDE4=0 -DWITH_MOZJS=0 -DWITH_NM=0
  -DWITH_PERL=0 -DWITH_PYTHON=1 -DWITH_WEBKIT=0"
 hostmakedepends="pkg-config python"
 makedepends="zlib-devel"
-short_desc="A library handling all the details of proxy configuration"
+short_desc="Library handling all the details of proxy configuration"
 maintainer="Orphaned <orphan@voidlinux.org>"
+license="LGPL-2.1-or-later"
 homepage="http://github.com/libproxy/libproxy"
-license="LGPL-2.1"
-distfiles="https://github.com/libproxy/libproxy/archive/${version}.tar.gz>${pkgname}-${version}.tar.gz"
-checksum=18f58b0a0043b6881774187427ead158d310127fc46a1c668ad6d207fb28b4e0
+distfiles="https://github.com/libproxy/libproxy/archive/${version}.tar.gz"
+checksum=0b4a9218d88f6cf9fa25996a3f38329a11f688a9d026141d9d0e966d8fa63837
+
+post_patch() {
+	vsed '/add_test(NAME url-test/d' -i libproxy/test/CMakeLists.txt
+}
 
 libproxy-devel_package() {
 	depends="libproxy>=${version}_${revision}"

From 641abdedd3cd0a8639e96250d37372fb470fc0d4 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 21 Aug 2022 17:05:39 -0700
Subject: [PATCH 17/52] exempi: update to 2.6.2

---
 ...f034705fd2d032c81383eee8208fd4eee0ac.patch | 43 -------------------
 srcpkgs/exempi/template                       |  4 +-
 2 files changed, 2 insertions(+), 45 deletions(-)
 delete mode 100644 srcpkgs/exempi/patches/8ed2f034705fd2d032c81383eee8208fd4eee0ac.patch

diff --git a/srcpkgs/exempi/patches/8ed2f034705fd2d032c81383eee8208fd4eee0ac.patch b/srcpkgs/exempi/patches/8ed2f034705fd2d032c81383eee8208fd4eee0ac.patch
deleted file mode 100644
index 2696793cec09..000000000000
--- a/srcpkgs/exempi/patches/8ed2f034705fd2d032c81383eee8208fd4eee0ac.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From 8ed2f034705fd2d032c81383eee8208fd4eee0ac Mon Sep 17 00:00:00 2001
-From: Victor Rodriguez <victor.rodriguez.bahena@intel.com>
-Date: Sat, 18 Aug 2018 13:54:55 +0000
-Subject: [PATCH] Issue #9 - Fix null-pointer-dereference (CVE-2018-12648)
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-The WEBP::GetLE32 function in
-XMPFiles/source/FormatSupport/WEBP_Support.hpp in Exempi 2.4.5 has a
-NULL pointer dereference.
-
-https://bugs.freedesktop.org/show_bug.cgi?id=106981
-https://gitlab.freedesktop.org/libopenraw/exempi/issues/9
-
-Signed-off-by: Victor Rodriguez <victor.rodriguez.bahena@intel.com>
-Signed-off-by: Hubert Figuière <hub@figuiere.net>
----
- XMPFiles/source/FormatSupport/WEBP_Support.cpp | 8 +++++---
- 1 file changed, 5 insertions(+), 3 deletions(-)
-
-diff --git a/XMPFiles/source/FormatSupport/WEBP_Support.cpp b/XMPFiles/source/FormatSupport/WEBP_Support.cpp
-index ffaf220..4fe705b 100644
---- a/XMPFiles/source/FormatSupport/WEBP_Support.cpp
-+++ b/XMPFiles/source/FormatSupport/WEBP_Support.cpp
-@@ -160,9 +160,11 @@ bool VP8XChunk::xmp()
- }
- void VP8XChunk::xmp(bool hasXMP)
- {
--    XMP_Uns32 flags = GetLE32(&this->data[0]);
--    flags ^= (-hasXMP ^ flags) & (1 << XMP_FLAG_BIT);
--    PutLE32(&this->data[0], flags);
-+    if (&this->data[0] != NULL) {
-+        XMP_Uns32 flags = GetLE32(&this->data[0]);
-+        flags ^= (-hasXMP ^ flags) & (1 << XMP_FLAG_BIT);
-+        PutLE32(&this->data[0], flags);
-+    }
- }
- 
- Container::Container(WEBP_MetaHandler* handler) : Chunk(NULL, handler)
--- 
-2.18.0
-
diff --git a/srcpkgs/exempi/template b/srcpkgs/exempi/template
index 14753617953a..d664f7dc4d80 100644
--- a/srcpkgs/exempi/template
+++ b/srcpkgs/exempi/template
@@ -1,6 +1,6 @@
 # Template file for 'exempi'
 pkgname=exempi
-version=2.5.0
+version=2.6.2
 revision=1
 build_style=gnu-configure
 configure_args="--with-boost=${XBPS_CROSS_BASE}/usr --disable-static --disable-unittest"
@@ -10,7 +10,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="BSD-3-Clause"
 homepage="https://libopenraw.freedesktop.org/wiki/Exempi"
 distfiles="https://libopenraw.freedesktop.org/download/exempi-${version}.tar.bz2"
-checksum=dc82fc24c0540a44a63fa4ad21775d24e00e63f1dedd3e2ae6f7aa27583b711b
+checksum=4d17d4c93df2a95da3e3172c45b7a5bf317dd31dafd1c7a340169728c7089d1d
 
 post_install() {
 	vlicense COPYING

From 2ce13d33344d3f13cb5b8631063098330a7d3ba9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 21 Aug 2022 21:36:03 -0700
Subject: [PATCH 18/52] plymouth: update to 22.02.122

---
 srcpkgs/plymouth/patches/fix-glibc-2.36.patch | 30 +++++++++++++++++++
 srcpkgs/plymouth/template                     |  4 +--
 2 files changed, 32 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/plymouth/patches/fix-glibc-2.36.patch

diff --git a/srcpkgs/plymouth/patches/fix-glibc-2.36.patch b/srcpkgs/plymouth/patches/fix-glibc-2.36.patch
new file mode 100644
index 000000000000..2f1e43875cfb
--- /dev/null
+++ b/srcpkgs/plymouth/patches/fix-glibc-2.36.patch
@@ -0,0 +1,30 @@
+From 5f1e43c00039a7fe1fff768b91a05a695fb4a53d Mon Sep 17 00:00:00 2001
+From: Ray Strode <rstrode@redhat.com>
+Date: Wed, 3 Aug 2022 15:23:33 -0400
+Subject: [PATCH] ply-utils: Drop linux/fs.h include
+
+It was needed long ago for a function we no longer even have.
+
+Now it's causing compile errors on Fedora 37 because it's conflicting
+with sys/mount.h.
+
+This commit drops it.
+---
+ src/libply/ply-utils.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/src/libply/ply-utils.c b/src/libply/ply-utils.c
+index c7b165e9..219e2e77 100644
+--- a/src/libply/ply-utils.c
++++ b/src/libply/ply-utils.c
+@@ -46,7 +46,6 @@
+ #include <sys/user.h>
+ #include <sys/wait.h>
+ #include <time.h>
+-#include <linux/fs.h>
+ #include <linux/vt.h>
+ 
+ #include <dlfcn.h>
+-- 
+GitLab
+
diff --git a/srcpkgs/plymouth/template b/srcpkgs/plymouth/template
index 17f801fc5315..442ab58a99cd 100644
--- a/srcpkgs/plymouth/template
+++ b/srcpkgs/plymouth/template
@@ -1,6 +1,6 @@
 # Template file for 'plymouth'
 pkgname=plymouth
-version=0.9.5
+version=22.02.122
 revision=1
 build_style=gnu-configure
 configure_args="--with-system-root-install=no \
@@ -18,7 +18,7 @@ maintainer="William OD <obirik2005@gmail.com>"
 license="GPL-2.0-or-later"
 homepage="https://www.freedesktop.org/wiki/Software/Plymouth/"
 distfiles="${FREEDESKTOP_SITE}/plymouth/releases/$pkgname-$version.tar.xz"
-checksum=ecae257f351d098340542a5bc06de029404c24dcee87e6ebb2abd5ef117fce86
+checksum=100551442221033ce868c447ad6c74d831d209c18ae232b98ae0207e34eadaeb
 
 build_options="gtk3 pango"
 build_options_default="gtk3 pango"

From 09cd6617c30798a4e98bdd3e742d8c992af22446 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 21 Aug 2022 21:37:00 -0700
Subject: [PATCH 19/52] openjdk7-bootstrap: fix build for gcc12

---
 .../files/dist_patches_glibc.txt              |  1 +
 .../files/dist_patches_musl.txt               |  1 +
 .../icedtea-pointer-comparison-gcc12.patch    | 31 +++++++++++++++++++
 3 files changed, 33 insertions(+)
 create mode 100644 srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch

diff --git a/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt b/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt
index c76c56855441..8061756dfc0c 100644
--- a/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt
+++ b/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt
@@ -6,3 +6,4 @@ icedtea-jdk-no-soname.patch
 icedtea-jdk-xattr.patch
 icedtea-jdk-sysctl_h.patch
 icedtea-cpio.patch
+icedtea-pointer-comparison-gcc12.patch
diff --git a/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt b/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt
index 21812517c7c2..8b35d9c46989 100644
--- a/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt
+++ b/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt
@@ -11,3 +11,4 @@ icedtea-jdk-musl.patch
 icedtea-jdk-no-soname.patch
 icedtea-jdk-xattr.patch
 icedtea-cpio.patch
+icedtea-pointer-comparison-gcc12.patch
diff --git a/srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch b/srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch
new file mode 100644
index 000000000000..c809553443e7
--- /dev/null
+++ b/srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch
@@ -0,0 +1,31 @@
+--- openjdk.orig/hotspot/src/share/vm/opto/lcm.cpp
++++ openjdk/hotspot/src/share/vm/opto/lcm.cpp
+@@ -60,7 +60,7 @@
+ // Check whether val is not-null-decoded compressed oop,
+ // i.e. will grab into the base of the heap if it represents NULL.
+ static bool accesses_heap_base_zone(Node *val) {
+-  if (Universe::narrow_oop_base() > 0) { // Implies UseCompressedOops.
++  if (Universe::narrow_oop_base() > (address)0) { // Implies UseCompressedOops.
+     if (val && val->is_Mach()) {
+       if (val->as_Mach()->ideal_Opcode() == Op_DecodeN) {
+         // This assumes all Decodes with TypePtr::NotNull are matched to nodes that
+--- openjdk.orig/hotspot/src/share/vm/runtime/virtualspace.cpp
++++ openjdk/hotspot/src/share/vm/runtime/virtualspace.cpp
+@@ -527,7 +527,7 @@ ReservedHeapSpace::ReservedHeapSpace(siz
+                 (UseCompressedOops && (Universe::narrow_oop_base() != NULL) &&
+                  Universe::narrow_oop_use_implicit_null_checks()) ?
+                   lcm(os::vm_page_size(), alignment) : 0) {
+-  if (base() > 0) {
++  if (base() > (char*)0) {
+     MemTracker::record_virtual_memory_type((address)base(), mtJavaHeap);
+   }
+ 
+@@ -546,7 +546,7 @@ ReservedHeapSpace::ReservedHeapSpace(con
+                 (UseCompressedOops && (Universe::narrow_oop_base() != NULL) &&
+                  Universe::narrow_oop_use_implicit_null_checks()) ?
+                   lcm(os::vm_page_size(), prefix_align) : 0) {
+-  if (base() > 0) {
++  if (base() > (char*)0) {
+     MemTracker::record_virtual_memory_type((address)base(), mtJavaHeap);
+   }
+ 

From 0660e49b636bad2788c37845c9dcd8c8d6f13fec Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 23:30:16 -0700
Subject: [PATCH 20/52] libunique1: relax warnings for gcc12

---
 srcpkgs/libunique1/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/libunique1/template b/srcpkgs/libunique1/template
index f73931b0c72b..c5a0f5c27860 100644
--- a/srcpkgs/libunique1/template
+++ b/srcpkgs/libunique1/template
@@ -15,7 +15,7 @@ homepage="https://wiki.gnome.org/Attic/LibUnique"
 distfiles="${GNOME_SITE}/libunique/1.1/libunique-${version}.tar.bz2"
 checksum=e5c8041cef8e33c55732f06a292381cb345db946cf792a4ae18aa5c66cdd4fbb
 
-CFLAGS="-Wno-deprecated-declarations"
+CFLAGS="-Wno-deprecated-declarations -Wno-incompatible-pointer-types"
 
 # Package build options
 build_options="gir"

From f2162de5cd4c38c3a9f75d4eeff5a1dce51c201b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:39:52 -0700
Subject: [PATCH 21/52] libvirt: fix build for glibc 2.36

---
 .../patches/lxc-fix-compat-glibc-2.36.patch   | 34 ++++++++++++++++
 .../virfile-fix-compat-glibc-2.36.patch       | 39 +++++++++++++++++++
 2 files changed, 73 insertions(+)
 create mode 100644 srcpkgs/libvirt/patches/lxc-fix-compat-glibc-2.36.patch
 create mode 100644 srcpkgs/libvirt/patches/virfile-fix-compat-glibc-2.36.patch

diff --git a/srcpkgs/libvirt/patches/lxc-fix-compat-glibc-2.36.patch b/srcpkgs/libvirt/patches/lxc-fix-compat-glibc-2.36.patch
new file mode 100644
index 000000000000..d85b57815010
--- /dev/null
+++ b/srcpkgs/libvirt/patches/lxc-fix-compat-glibc-2.36.patch
@@ -0,0 +1,34 @@
+From 9493c9b79dc541ec9e0fd73c6d87bdf8d30aaa90 Mon Sep 17 00:00:00 2001
+From: Cole Robinson <crobinso@redhat.com>
+Date: Mon, 1 Aug 2022 15:20:38 -0400
+Subject: [PATCH] lxc: containter: fix build with glibc 2.36
+
+With glibc 2.36, sys/mount.h and linux/mount.h conflict:
+https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
+
+lxc_container.c imports sys/mount.h and linux/fs.h, which pulls in
+linux/mount.h.
+
+linux/fs.h isn't required here though. glibc sys/mount.h has had
+MS_MOVE since 2.12 in 2010
+
+Reviewed-by: Erik Skultety <eskultet@redhat.com>
+Signed-off-by: Cole Robinson <crobinso@redhat.com>
+---
+ src/lxc/lxc_container.c | 3 ---
+ 1 file changed, 3 deletions(-)
+
+diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
+index b5278831da7..a5401c2186e 100644
+--- a/src/lxc/lxc_container.c
++++ b/src/lxc/lxc_container.c
+@@ -33,9 +33,6 @@
+ /* Yes, we want linux private one, for _syscall2() macro */
+ #include <linux/unistd.h>
+ 
+-/* For MS_MOVE */
+-#include <linux/fs.h>
+-
+ #if WITH_CAPNG
+ # include <cap-ng.h>
+ #endif
diff --git a/srcpkgs/libvirt/patches/virfile-fix-compat-glibc-2.36.patch b/srcpkgs/libvirt/patches/virfile-fix-compat-glibc-2.36.patch
new file mode 100644
index 000000000000..2ef227ea9b54
--- /dev/null
+++ b/srcpkgs/libvirt/patches/virfile-fix-compat-glibc-2.36.patch
@@ -0,0 +1,39 @@
+From c0d9adf220dc0d223330a7bac37b174132d330ba Mon Sep 17 00:00:00 2001
+From: Cole Robinson <crobinso@redhat.com>
+Date: Mon, 1 Aug 2022 15:24:01 -0400
+Subject: [PATCH] virfile: Fix build with glibc 2.36
+
+With glibc 2.36, sys/mount.h and linux/mount.h conflict:
+https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
+
+virfile.c imports sys/mount.h and linux/fs.h, which pulls in
+linux/mount.h.
+
+Manually define the constants we need from linux/fs.h, like was
+done in llvm:
+
+https://reviews.llvm.org/rGb379129c4beb3f26223288627a1291739f33af02
+
+Reviewed-by: Erik Skultety <eskultet@redhat.com>
+Signed-off-by: Cole Robinson <crobinso@redhat.com>
+---
+ src/util/virfile.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/src/util/virfile.c b/src/util/virfile.c
+index 99da058db3b..ce541b8946b 100644
+--- a/src/util/virfile.c
++++ b/src/util/virfile.c
+@@ -71,7 +71,11 @@
+ # endif
+ # include <sys/ioctl.h>
+ # include <linux/cdrom.h>
+-# include <linux/fs.h>
++/* These come from linux/fs.h, but that header conflicts with
++ * sys/mount.h on glibc 2.36+ */
++# define FS_IOC_GETFLAGS _IOR('f', 1, long)
++# define FS_IOC_SETFLAGS _IOW('f', 2, long)
++# define FS_NOCOW_FL 0x00800000
+ #endif
+ 
+ #if WITH_LIBATTR

From eb5a2ad1e369273e141e80f194f9c2053dc5ee7c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:41:50 -0700
Subject: [PATCH 22/52] efivar: fix build for glibc 2.36

---
 .../patches/fix-compat-glibc-2.36.patch       | 55 +++++++++++++++++++
 1 file changed, 55 insertions(+)
 create mode 100644 srcpkgs/efivar/patches/fix-compat-glibc-2.36.patch

diff --git a/srcpkgs/efivar/patches/fix-compat-glibc-2.36.patch b/srcpkgs/efivar/patches/fix-compat-glibc-2.36.patch
new file mode 100644
index 000000000000..fcc83aef20cf
--- /dev/null
+++ b/srcpkgs/efivar/patches/fix-compat-glibc-2.36.patch
@@ -0,0 +1,55 @@
+From bc65d63ebf8fe6ac8a099ff15ca200986dba1565 Mon Sep 17 00:00:00 2001
+From: Robbie Harwood <rharwood@redhat.com>
+Date: Thu, 28 Jul 2022 16:11:24 -0400
+Subject: [PATCH] Fix glibc 2.36 build (mount.h conflicts)
+
+glibc has decided that sys/mount.h and linux/mount.h are no longer
+usable at the same time.  This broke the build, since linux/fs.h itself
+includes linux/mount.h.  For now, fix the build by only including
+sys/mount.h where we need it.
+
+See-also: https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
+Resolves: #227
+Signed-off-by: Robbie Harwood <rharwood@redhat.com>
+---
+ src/gpt.c   | 1 +
+ src/linux.c | 1 +
+ src/util.h  | 1 -
+ 3 files changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/gpt.c b/src/gpt.c
+index 1eda0497..21413c3b 100644
+--- a/src/gpt.c
++++ b/src/gpt.c
+@@ -17,6 +17,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <sys/mount.h>
+ #include <sys/param.h>
+ #include <sys/stat.h>
+ #include <sys/utsname.h>
+diff --git a/src/linux.c b/src/linux.c
+index 47e45ae4..1780816f 100644
+--- a/src/linux.c
++++ b/src/linux.c
+@@ -20,6 +20,7 @@
+ #include <stdbool.h>
+ #include <stdio.h>
+ #include <sys/ioctl.h>
++#include <sys/mount.h>
+ #include <sys/socket.h>
+ #include <sys/sysmacros.h>
+ #include <sys/types.h>
+diff --git a/src/util.h b/src/util.h
+index 3300666f..1e67e447 100644
+--- a/src/util.h
++++ b/src/util.h
+@@ -23,7 +23,6 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <sys/ioctl.h>
+-#include <sys/mount.h>
+ #include <sys/stat.h>
+ #include <sys/types.h>
+ #include <tgmath.h>

From 9a75be7c1836de441be753f2ca83b9c50cde8bfe Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:43:24 -0700
Subject: [PATCH 23/52] libwpd: fix build for gcc12

---
 srcpkgs/libwpd/patches/fix-compat-gcc12.patch | 11 +++++++++++
 1 file changed, 11 insertions(+)
 create mode 100644 srcpkgs/libwpd/patches/fix-compat-gcc12.patch

diff --git a/srcpkgs/libwpd/patches/fix-compat-gcc12.patch b/srcpkgs/libwpd/patches/fix-compat-gcc12.patch
new file mode 100644
index 000000000000..6ebce2463d16
--- /dev/null
+++ b/srcpkgs/libwpd/patches/fix-compat-gcc12.patch
@@ -0,0 +1,11 @@
+diff -rup libwpd-0.10.3.orig/src/lib/WPXTable.h libwpd-0.10.3/src/lib/WPXTable.h
+--- libwpd-0.10.3.orig/src/lib/WPXTable.h	2022-08-23 22:32:45.332593795 -0700
++++ libwpd-0.10.3/src/lib/WPXTable.h	2022-08-23 22:32:59.500651211 -0700
+@@ -37,6 +37,7 @@
+ #define _WPXTABLE_H
+ 
+ #include <vector>
++#include <cstddef>
+ 
+ struct WPXTableCell
+ {

From d59327db44c8f93eae69408f79867e610810e5f5 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:44:07 -0700
Subject: [PATCH 24/52] grub: fix build for binutils 2.36

---
 .../patches/fix-compat-binutils-2.36.patch    | 96 +++++++++++++++++++
 srcpkgs/grub/template                         |  7 +-
 2 files changed, 102 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/grub/patches/fix-compat-binutils-2.36.patch

diff --git a/srcpkgs/grub/patches/fix-compat-binutils-2.36.patch b/srcpkgs/grub/patches/fix-compat-binutils-2.36.patch
new file mode 100644
index 000000000000..d92a91e3253e
--- /dev/null
+++ b/srcpkgs/grub/patches/fix-compat-binutils-2.36.patch
@@ -0,0 +1,96 @@
+From b98275138bf4fc250a1c362dfd2c8b1cf2421701 Mon Sep 17 00:00:00 2001
+From: Michael Chang <mchang@suse.com>
+Date: Tue, 28 Sep 2021 13:50:47 +0800
+Subject: build: Fix build error with binutils 2.36
+
+The following procedure to build xen/pvgrub is broken.
+
+  git clone https://git.savannah.gnu.org/git/grub.git
+  cd grub
+  ./bootstrap
+  mkdir build-xen
+  cd build-xen
+  ../configure --with-platform=xen
+  make
+
+It fails with the message:
+
+  /usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld:
+  section .note.gnu.property VMA [0000000000400158,0000000000400187]
+  overlaps section .bss VMA [000000000000f000,000000000041e1af]
+
+The most significant factor is that new assembler (GNU as) generates the
+.note.gnu.property section as default. This note section overlaps with
+.bss because it doesn't reposition with -Wl,-Ttext,0 with which the base
+address of .text section is set, rather the address of .note.gnu.property
+is calculated for some reason from 0x400000 where the ELF executable
+defaults to start.
+
+Using -Ttext-segment doesn't help either, though it is said to set the
+address of the first byte of the text segment according to "man ld".
+What it actually does is to override the default 0x400000, aka the image
+base address, to something else. The entire process can be observed in
+the default linker script used by gcc [1]. Therefore we can't expect it
+to achieve the same thing as -Ttext given that the first segment where
+.text resides is offset by SIZEOF_HEADERS plus some sections may be
+preceding it within the first segment. The end result is .text always
+has to start with non-zero address with -Wl,-Ttext-segment,0 if using
+default linker script.
+
+It is also worth mentioning that binutils upstream apparently doesn't
+seem to consider this as a bug [2] and proposed to use -Wl,-Ttext-segment,0
+which is not fruitful as what has been tested by Gentoo [3].
+
+As long as GRUB didn't use ISA information encoded in .note.gnu.property,
+we can safely drop it via -Wa,-mx86-used-note=no assembler option to
+fix the linker error above.
+
+This is considered a better approach than using custom linker script to
+drop the .note.gnu.property section because object file manipulation can
+also be hampered one way or the other in that linker script may not be
+helpful. See also this commit removing the section in the process of objcopy.
+
+  6643507ce build: Fix GRUB i386-pc build with Ubuntu gcc
+
+[1] In /usr/lib64/ldscripts/elf_x86_64.x or use 'gcc -Wl,--verbose ...'
+    PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x400000));
+    . = SEGMENT_START("text-segment", 0x400000) + SIZEOF_HEADERS;
+[2] https://sourceware.org/bugzilla/show_bug.cgi?id=27377
+[3] https://bugs.gentoo.org/787221
+
+Signed-off-by: Michael Chang <mchang@suse.com>
+Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
+---
+ configure.ac | 14 ++++++++++++++
+ 1 file changed, 14 insertions(+)
+
+(limited to 'configure.ac')
+
+diff --git a/configure.ac b/configure.ac
+index eeb5d22..8d1c81a 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -840,6 +840,20 @@ if ( test "x$target_cpu" = xi386 || test "x$target_cpu" = xx86_64 ) && test "x$p
+   TARGET_CFLAGS="$TARGET_CFLAGS -mno-mmx -mno-sse -mno-sse2 -mno-sse3 -mno-3dnow"
+ fi
+ 
++if ( test "x$target_cpu" = xi386 || test "x$target_cpu" = xx86_64 ); then
++  AC_CACHE_CHECK([whether -Wa,-mx86-used-note works], [grub_cv_cc_mx86_used_note], [
++    CFLAGS="$TARGET_CFLAGS -Wa,-mx86-used-note=no -Werror"
++    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
++	[grub_cv_cc_mx86_used_note=yes],
++	[grub_cv_cc_mx86_used_note=no])
++  ])
++
++  if test "x$grub_cv_cc_mx86_used_note" = xyes; then
++    TARGET_CFLAGS="$TARGET_CFLAGS -Wa,-mx86-used-note=no"
++    TARGET_CCASFLAGS="$TARGET_CCASFLAGS -Wa,-mx86-used-note=no"
++  fi
++fi
++
+ # GRUB doesn't use float or doubles at all. Yet some toolchains may decide
+ # that floats are a good fit to run instead of what's written in the code.
+ # Given that floating point unit is disabled (if present to begin with)
+-- 
+cgit v1.1
+
diff --git a/srcpkgs/grub/template b/srcpkgs/grub/template
index b1826c38a884..b4d3b07af620 100644
--- a/srcpkgs/grub/template
+++ b/srcpkgs/grub/template
@@ -2,7 +2,8 @@
 pkgname=grub
 version=2.06
 revision=2
-hostmakedepends="python3 pkg-config flex freetype-devel font-unifont-bdf help2man"
+hostmakedepends="python3 pkg-config flex freetype-devel font-unifont-bdf help2man
+ automake gettext-devel-tools"
 makedepends="libusb-compat-devel ncurses-devel freetype-devel
  liblzma-devel device-mapper-devel fuse-devel"
 depends="os-prober"
@@ -43,6 +44,10 @@ case "$XBPS_TARGET_MACHINE" in
 		;;
 esac
 
+pre_configure() {
+	autoreconf -fi
+}
+
 do_configure() {
 	# workaround for https://savannah.gnu.org/bugs/?60458
 	# some more info: https://www.linuxquestions.org/questions/showthread.php?p=6257712

From 30101029d5d9c2308989832942c7ca8ab8369cda Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:45:07 -0700
Subject: [PATCH 25/52] linux-toos: fix build for binutils 2.39

---
 .../patches/binutils-add-compat-check.patch   | 103 ++++++++++++
 .../patches/binutils-disasm-compat.patch      | 102 ++++++++++++
 .../bpf_jit_disasm-binutils-2.39.patch        | 104 ++++++++++++
 .../patches/bpftool-binutils-2.39.patch       | 149 ++++++++++++++++++
 .../patches/perf-binutils-2.39.patch          | 114 ++++++++++++++
 5 files changed, 572 insertions(+)
 create mode 100644 srcpkgs/linux-tools/patches/binutils-add-compat-check.patch
 create mode 100644 srcpkgs/linux-tools/patches/binutils-disasm-compat.patch
 create mode 100644 srcpkgs/linux-tools/patches/bpf_jit_disasm-binutils-2.39.patch
 create mode 100644 srcpkgs/linux-tools/patches/bpftool-binutils-2.39.patch
 create mode 100644 srcpkgs/linux-tools/patches/perf-binutils-2.39.patch

diff --git a/srcpkgs/linux-tools/patches/binutils-add-compat-check.patch b/srcpkgs/linux-tools/patches/binutils-add-compat-check.patch
new file mode 100644
index 000000000000..e4e7ece9635e
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/binutils-add-compat-check.patch
@@ -0,0 +1,103 @@
+From cfd59ca91467056bb2c36907b2fa67b8e1af9952 Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:27 -0700
+Subject: [PATCH] tools build: Add feature test for init_disassemble_info API
+ changes
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation failures for tools/{perf,bpf}, e.g. on debian unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+This commit adds a feature test to detect the new signature.  Subsequent
+commits will use it to fix the build failures.
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Quentin Monnet <quentin@isovalent.com>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-2-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/build/Makefile.feature                        |  1 +
+ tools/build/feature/Makefile                        |  4 ++++
+ tools/build/feature/test-all.c                      |  4 ++++
+ tools/build/feature/test-disassembler-init-styled.c | 13 +++++++++++++
+ 4 files changed, 22 insertions(+)
+ create mode 100644 tools/build/feature/test-disassembler-init-styled.c
+
+diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature
+index 888a0421d43b96..8f6578e4d3249e 100644
+--- a/tools/build/Makefile.feature
++++ b/tools/build/Makefile.feature
+@@ -70,6 +70,7 @@ FEATURE_TESTS_BASIC :=                  \
+         libaio				\
+         libzstd				\
+         disassembler-four-args		\
++        disassembler-init-styled	\
+         file-handle
+ 
+ # FEATURE_TESTS_BASIC + FEATURE_TESTS_EXTRA is the complete list
+diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile
+index 7c2a17e23c30ac..c3059739318a95 100644
+--- a/tools/build/feature/Makefile
++++ b/tools/build/feature/Makefile
+@@ -18,6 +18,7 @@ FILES=                                          \
+          test-libbfd.bin                        \
+          test-libbfd-buildid.bin		\
+          test-disassembler-four-args.bin        \
++         test-disassembler-init-styled.bin	\
+          test-reallocarray.bin			\
+          test-libbfd-liberty.bin                \
+          test-libbfd-liberty-z.bin              \
+@@ -248,6 +249,9 @@ $(OUTPUT)test-libbfd-buildid.bin:
+ $(OUTPUT)test-disassembler-four-args.bin:
+ 	$(BUILD) -DPACKAGE='"perf"' -lbfd -lopcodes
+ 
++$(OUTPUT)test-disassembler-init-styled.bin:
++	$(BUILD) -DPACKAGE='"perf"' -lbfd -lopcodes
++
+ $(OUTPUT)test-reallocarray.bin:
+ 	$(BUILD)
+ 
+diff --git a/tools/build/feature/test-all.c b/tools/build/feature/test-all.c
+index 5ffafb967b6e49..957c02c7b163b5 100644
+--- a/tools/build/feature/test-all.c
++++ b/tools/build/feature/test-all.c
+@@ -166,6 +166,10 @@
+ # include "test-disassembler-four-args.c"
+ #undef main
+ 
++#define main main_test_disassembler_init_styled
++# include "test-disassembler-init-styled.c"
++#undef main
++
+ #define main main_test_libzstd
+ # include "test-libzstd.c"
+ #undef main
+diff --git a/tools/build/feature/test-disassembler-init-styled.c b/tools/build/feature/test-disassembler-init-styled.c
+new file mode 100644
+index 00000000000000..f1ce0ec3bee9d3
+--- /dev/null
++++ b/tools/build/feature/test-disassembler-init-styled.c
+@@ -0,0 +1,13 @@
++// SPDX-License-Identifier: GPL-2.0
++#include <stdio.h>
++#include <dis-asm.h>
++
++int main(void)
++{
++	struct disassemble_info info;
++
++	init_disassemble_info(&info, stdout,
++			      NULL, NULL);
++
++	return 0;
++}
diff --git a/srcpkgs/linux-tools/patches/binutils-disasm-compat.patch b/srcpkgs/linux-tools/patches/binutils-disasm-compat.patch
new file mode 100644
index 000000000000..1a6cc0e6d97c
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/binutils-disasm-compat.patch
@@ -0,0 +1,102 @@
+From a45b3d6926231c3d024ea0de4f7bd967f83709ee Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:29 -0700
+Subject: tools include: add dis-asm-compat.h to handle version differences
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation failures for tools/{perf,bpf}, e.g. on debian unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+This commit introduces a wrapper for init_disassemble_info(), to avoid
+spreading #ifdef DISASM_INIT_STYLED to a bunch of places. Subsequent
+commits will use it to fix the build failures.
+
+It likely is worth adding a wrapper for disassember(), to avoid the already
+existing DISASM_FOUR_ARGS_SIGNATURE ifdefery.
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Signed-off-by: Ben Hutchings <benh@debian.org>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Quentin Monnet <quentin@isovalent.com>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-4-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/include/tools/dis-asm-compat.h | 55 ++++++++++++++++++++++++++++++++++++
+ 1 file changed, 55 insertions(+)
+ create mode 100644 tools/include/tools/dis-asm-compat.h
+
+(limited to 'tools/include/tools/dis-asm-compat.h')
+
+diff --git a/tools/include/tools/dis-asm-compat.h b/tools/include/tools/dis-asm-compat.h
+new file mode 100644
+index 0000000000000..70f331e23ed3d
+--- /dev/null
++++ b/tools/include/tools/dis-asm-compat.h
+@@ -0,0 +1,55 @@
++/* SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause */
++#ifndef _TOOLS_DIS_ASM_COMPAT_H
++#define _TOOLS_DIS_ASM_COMPAT_H
++
++#include <stdio.h>
++#include <dis-asm.h>
++
++/* define types for older binutils version, to centralize ifdef'ery a bit */
++#ifndef DISASM_INIT_STYLED
++enum disassembler_style {DISASSEMBLER_STYLE_NOT_EMPTY};
++typedef int (*fprintf_styled_ftype) (void *, enum disassembler_style, const char*, ...);
++#endif
++
++/*
++ * Trivial fprintf wrapper to be used as the fprintf_styled_func argument to
++ * init_disassemble_info_compat() when normal fprintf suffices.
++ */
++static inline int fprintf_styled(void *out,
++				 enum disassembler_style style,
++				 const char *fmt, ...)
++{
++	va_list args;
++	int r;
++
++	(void)style;
++
++	va_start(args, fmt);
++	r = vfprintf(out, fmt, args);
++	va_end(args);
++
++	return r;
++}
++
++/*
++ * Wrapper for init_disassemble_info() that hides version
++ * differences. Depending on binutils version and architecture either
++ * fprintf_func or fprintf_styled_func will be called.
++ */
++static inline void init_disassemble_info_compat(struct disassemble_info *info,
++						void *stream,
++						fprintf_ftype unstyled_func,
++						fprintf_styled_ftype styled_func)
++{
++#ifdef DISASM_INIT_STYLED
++	init_disassemble_info(info, stream,
++			      unstyled_func,
++			      styled_func);
++#else
++	(void)styled_func;
++	init_disassemble_info(info, stream,
++			      unstyled_func);
++#endif
++}
++
++#endif /* _TOOLS_DIS_ASM_COMPAT_H */
+-- 
+cgit 
+
diff --git a/srcpkgs/linux-tools/patches/bpf_jit_disasm-binutils-2.39.patch b/srcpkgs/linux-tools/patches/bpf_jit_disasm-binutils-2.39.patch
new file mode 100644
index 000000000000..01221fad3a4a
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/bpf_jit_disasm-binutils-2.39.patch
@@ -0,0 +1,104 @@
+From 96ed066054abf11c7d3e106e3011a51f3f1227a3 Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:31 -0700
+Subject: [PATCH] tools bpf_jit_disasm: Fix compilation error with new binutils
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation to fail for tools/bpf/bpf_jit_disasm.c, e.g. on debian
+unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+Wire up the feature test and switch to init_disassemble_info_compat(),
+which were introduced in prior commits, fixing the compilation failure.
+
+I verified that bpf_jit_disasm can still disassemble bpf programs, both
+with the old and new dis-asm.h API. With old binutils there's no change in
+output before/after this patch. When comparing the output from old
+binutils (2.35) to new bintuils with the patch (upstream snapshot) there
+are a few output differences, but they are unrelated to this patch. An
+example hunk is:
+
+     f4:	mov    %r14,%rsi
+     f7:	mov    %r15,%rdx
+     fa:	mov    $0x2a,%ecx
+  -  ff:	callq  0xffffffffea8c4988
+  +  ff:	call   0xffffffffea8c4988
+    104:	test   %rax,%rax
+    107:	jge    0x0000000000000110
+    109:	xor    %eax,%eax
+  - 10b:	jmpq   0x0000000000000073
+  + 10b:	jmp    0x0000000000000073
+    110:	cmp    $0x16,%rax
+
+However, I had to use an older kernel to generate the bpf_jit_enabled =
+2 output, as that has been broken since 5.18 / 1022a5498f6f745c ("bpf,
+x86_64: Use bpf_jit_binary_pack_alloc").
+
+  https://lore.kernel.org/20220703030210.pmjft7qc2eajzi6c@alap3.anarazel.de
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Daniel Borkmann <daniel@iogearbox.net>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Quentin Monnet <quentin@isovalent.com>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-6-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/bpf/Makefile         | 5 ++++-
+ tools/bpf/bpf_jit_disasm.c | 5 ++++-
+ 2 files changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/tools/bpf/Makefile b/tools/bpf/Makefile
+index b11cfc86a3d021..664601ab1705ab 100644
+--- a/tools/bpf/Makefile
++++ b/tools/bpf/Makefile
+@@ -34,7 +34,7 @@ else
+ endif
+ 
+ FEATURE_USER = .bpf
+-FEATURE_TESTS = libbfd disassembler-four-args
++FEATURE_TESTS = libbfd disassembler-four-args disassembler-init-styled
+ FEATURE_DISPLAY = libbfd disassembler-four-args
+ 
+ check_feat := 1
+@@ -56,6 +56,9 @@ endif
+ ifeq ($(feature-disassembler-four-args), 1)
+ CFLAGS += -DDISASM_FOUR_ARGS_SIGNATURE
+ endif
++ifeq ($(feature-disassembler-init-styled), 1)
++CFLAGS += -DDISASM_INIT_STYLED
++endif
+ 
+ $(OUTPUT)%.yacc.c: $(srctree)/tools/bpf/%.y
+ 	$(QUIET_BISON)$(YACC) -o $@ -d $<
+diff --git a/tools/bpf/bpf_jit_disasm.c b/tools/bpf/bpf_jit_disasm.c
+index c8ae9580472814..a90a5d110f9255 100644
+--- a/tools/bpf/bpf_jit_disasm.c
++++ b/tools/bpf/bpf_jit_disasm.c
+@@ -28,6 +28,7 @@
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <limits.h>
++#include <tools/dis-asm-compat.h>
+ 
+ #define CMD_ACTION_SIZE_BUFFER		10
+ #define CMD_ACTION_READ_ALL		3
+@@ -64,7 +65,9 @@ static void get_asm_insns(uint8_t *image, size_t len, int opcodes)
+ 	assert(bfdf);
+ 	assert(bfd_check_format(bfdf, bfd_object));
+ 
+-	init_disassemble_info(&info, stdout, (fprintf_ftype) fprintf);
++	init_disassemble_info_compat(&info, stdout,
++				     (fprintf_ftype) fprintf,
++				     fprintf_styled);
+ 	info.arch = bfd_get_arch(bfdf);
+ 	info.mach = bfd_get_mach(bfdf);
+ 	info.buffer = image;
diff --git a/srcpkgs/linux-tools/patches/bpftool-binutils-2.39.patch b/srcpkgs/linux-tools/patches/bpftool-binutils-2.39.patch
new file mode 100644
index 000000000000..1e55c40011be
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/bpftool-binutils-2.39.patch
@@ -0,0 +1,149 @@
+From 600b7b26c07a070d0153daa76b3806c1e52c9e00 Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:33 -0700
+Subject: [PATCH] tools bpftool: Fix compilation error with new binutils
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation to fail for tools/bpf/bpftool/jit_disasm.c, e.g. on debian
+unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+Wire up the feature test and switch to init_disassemble_info_compat(),
+which were introduced in prior commits, fixing the compilation failure.
+
+I verified that bpftool can still disassemble bpf programs, both with an
+old and new dis-asm.h API. There are no output changes for plain and json
+formats. When comparing the output from old binutils (2.35)
+to new bintuils with the patch (upstream snapshot) there are a few output
+differences, but they are unrelated to this patch. An example hunk is:
+
+     2f:	pop    %r14
+     31:	pop    %r13
+     33:	pop    %rbx
+  -  34:	leaveq
+  -  35:	retq
+  +  34:	leave
+  +  35:	ret
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Quentin Monnet <quentin@isovalent.com>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-8-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/bpf/bpftool/Makefile     |  5 +++-
+ tools/bpf/bpftool/jit_disasm.c | 42 +++++++++++++++++++++++++++-------
+ 2 files changed, 38 insertions(+), 9 deletions(-)
+
+diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile
+index c6d2c77d02524a..436e671b2657d4 100644
+--- a/tools/bpf/bpftool/Makefile
++++ b/tools/bpf/bpftool/Makefile
+@@ -62,7 +62,7 @@ CLANG ?= clang
+ LLVM_STRIP ?= llvm-strip
+ 
+ FEATURE_USER = .bpftool
+-FEATURE_TESTS = libbfd disassembler-four-args reallocarray zlib libcap \
++FEATURE_TESTS = libbfd disassembler-four-args disassembler-init-styled reallocarray zlib libcap \
+ 	clang-bpf-co-re
+ FEATURE_DISPLAY = libbfd disassembler-four-args zlib libcap \
+ 	clang-bpf-co-re
+@@ -117,6 +117,9 @@ endif
+ ifeq ($(feature-disassembler-four-args), 1)
+ CFLAGS += -DDISASM_FOUR_ARGS_SIGNATURE
+ endif
++ifeq ($(feature-disassembler-init-styled), 1)
++    CFLAGS += -DDISASM_INIT_STYLED
++endif
+ 
+ LIBS = $(LIBBPF) -lelf -lz
+ LIBS_BOOTSTRAP = $(LIBBPF_BOOTSTRAP) -lelf -lz
+diff --git a/tools/bpf/bpftool/jit_disasm.c b/tools/bpf/bpftool/jit_disasm.c
+index 24734f2249d6ec..aaf99a0168c90b 100644
+--- a/tools/bpf/bpftool/jit_disasm.c
++++ b/tools/bpf/bpftool/jit_disasm.c
+@@ -24,6 +24,7 @@
+ #include <sys/stat.h>
+ #include <limits.h>
+ #include <bpf/libbpf.h>
++#include <tools/dis-asm-compat.h>
+ 
+ #include "json_writer.h"
+ #include "main.h"
+@@ -39,15 +40,12 @@ static void get_exec_path(char *tpath, s
+ }
+ 
+ static int oper_count;
+-static int fprintf_json(void *out, const char *fmt, ...)
++static int printf_json(void *out, const char *fmt, va_list ap)
+ {
+-	va_list ap;
+ 	char *s;
+ 
+-	va_start(ap, fmt);
+ 	if (vasprintf(&s, fmt, ap) < 0)
+ 		return -1;
+-	va_end(ap);
+ 
+ 	if (!oper_count) {
+ 		int i;
+@@ -73,6 +71,32 @@ static int fprintf_json(void *out, const char *fmt, ...)
+ 	return 0;
+ }
+ 
++static int fprintf_json(void *out, const char *fmt, ...)
++{
++	va_list ap;
++	int r;
++
++	va_start(ap, fmt);
++	r = printf_json(out, fmt, ap);
++	va_end(ap);
++
++	return r;
++}
++
++static int fprintf_json_styled(void *out,
++			       enum disassembler_style style __maybe_unused,
++			       const char *fmt, ...)
++{
++	va_list ap;
++	int r;
++
++	va_start(ap, fmt);
++	r = printf_json(out, fmt, ap);
++	va_end(ap);
++
++	return r;
++}
++
+ void disasm_print_insn(unsigned char *image, ssize_t len, int opcodes,
+ 		       const char *arch, const char *disassembler_options,
+ 		       const struct btf *btf,
+@@ -99,11 +123,13 @@ void disasm_print_insn(unsigned char *image, ssize_t len, int opcodes,
+ 	assert(bfd_check_format(bfdf, bfd_object));
+ 
+ 	if (json_output)
+-		init_disassemble_info(&info, stdout,
+-				      (fprintf_ftype) fprintf_json);
++		init_disassemble_info_compat(&info, stdout,
++					     (fprintf_ftype) fprintf_json,
++					     fprintf_json_styled);
+ 	else
+-		init_disassemble_info(&info, stdout,
+-				      (fprintf_ftype) fprintf);
++		init_disassemble_info_compat(&info, stdout,
++					     (fprintf_ftype) fprintf,
++					     fprintf_styled);
+ 
+ 	/* Update architecture info for offload. */
+ 	if (arch) {
diff --git a/srcpkgs/linux-tools/patches/perf-binutils-2.39.patch b/srcpkgs/linux-tools/patches/perf-binutils-2.39.patch
new file mode 100644
index 000000000000..3484330f7286
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/perf-binutils-2.39.patch
@@ -0,0 +1,114 @@
+From 83aa0120487e8bc3f231e72c460add783f71f17c Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:30 -0700
+Subject: [PATCH] tools perf: Fix compilation error with new binutils
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation failures for tools/perf/util/annotate.c, e.g. on debian
+unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+Wire up the feature test and switch to init_disassemble_info_compat(),
+which were introduced in prior commits, fixing the compilation failure.
+
+I verified that perf can still disassemble bpf programs by using bpftrace
+under load, recording a perf trace, and then annotating the bpf "function"
+with and without the changes. With old binutils there's no change in output
+before/after this patch. When comparing the output from old binutils (2.35)
+to new bintuils with the patch (upstream snapshot) there are a few output
+differences, but they are unrelated to this patch. An example hunk is:
+
+       1.15 :   55:mov    %rbp,%rdx
+       0.00 :   58:add    $0xfffffffffffffff8,%rdx
+       0.00 :   5c:xor    %ecx,%ecx
+  -    1.03 :   5e:callq  0xffffffffe12aca3c
+  +    1.03 :   5e:call   0xffffffffe12aca3c
+       0.00 :   63:xor    %eax,%eax
+  -    2.18 :   65:leaveq
+  -    2.82 :   66:retq
+  +    2.18 :   65:leave
+  +    2.82 :   66:ret
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-5-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/perf/Makefile.config | 8 ++++++++
+ tools/perf/util/annotate.c | 7 ++++---
+ 2 files changed, 12 insertions(+), 3 deletions(-)
+
+diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
+index d3c254c0f5c611..23648ea54e8d3d 100644
+--- a/tools/perf/Makefile.config
++++ b/tools/perf/Makefile.config
+@@ -298,6 +298,7 @@ FEATURE_CHECK_LDFLAGS-libpython := $(PYTHON_EMBED_LDOPTS)
+ FEATURE_CHECK_LDFLAGS-libaio = -lrt
+ 
+ FEATURE_CHECK_LDFLAGS-disassembler-four-args = -lbfd -lopcodes -ldl
++FEATURE_CHECK_LDFLAGS-disassembler-init-styled = -lbfd -lopcodes -ldl
+ 
+ CORE_CFLAGS += -fno-omit-frame-pointer
+ CORE_CFLAGS += -ggdb3
+@@ -818,13 +819,16 @@ else
+   ifeq ($(feature-libbfd-liberty), 1)
+     EXTLIBS += -lbfd -lopcodes -liberty
+     FEATURE_CHECK_LDFLAGS-disassembler-four-args += -liberty -ldl
++    FEATURE_CHECK_LDFLAGS-disassembler-init-styled += -liberty -ldl
+   else
+     ifeq ($(feature-libbfd-liberty-z), 1)
+       EXTLIBS += -lbfd -lopcodes -liberty -lz
+       FEATURE_CHECK_LDFLAGS-disassembler-four-args += -liberty -lz -ldl
++      FEATURE_CHECK_LDFLAGS-disassembler-init-styled += -liberty -lz -ldl
+     endif
+   endif
+   $(call feature_check,disassembler-four-args)
++  $(call feature_check,disassembler-init-styled)
+ endif
+ 
+ ifeq ($(feature-libbfd-buildid), 1)
+@@ -1044,6 +1048,10 @@ ifeq ($(feature-disassembler-four-args), 1)
+     CFLAGS += -DDISASM_FOUR_ARGS_SIGNATURE
+ endif
+ 
++ifeq ($(feature-disassembler-init-styled), 1)
++    CFLAGS += -DDISASM_INIT_STYLED
++endif
++
+ ifeq (${IS_64_BIT}, 1)
+   ifndef NO_PERF_READ_VDSO32
+     $(call feature_check,compile-32)
+diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
+index 82cc396ef516c4..2c6a485c3de5d9 100644
+--- a/tools/perf/util/annotate.c
++++ b/tools/perf/util/annotate.c
+@@ -1676,6 +1676,7 @@ fallback:
+ #define PACKAGE "perf"
+ #include <bfd.h>
+ #include <dis-asm.h>
++#include <tools/dis-asm-compat.h>
+ 
+ static int symbol__disassemble_bpf(struct symbol *sym,
+ 				   struct annotate_args *args)
+@@ -1762,9 +1763,9 @@ static int symbol__disassemble_bpf(struct symbol *sym,
+ 		ret = errno;
+ 		goto out;
+ 	}
+-	init_disassemble_info(&info, s,
+-			      (fprintf_ftype) fprintf);
+-
++	init_disassemble_info_compat(&info, s,
++				     (fprintf_ftype) fprintf,
++				     fprintf_styled);
+ 	info.arch = bfd_get_arch(bfdf);
+ 	info.mach = bfd_get_mach(bfdf);
+ 

From 3a0e7697958098669709f8c3a0b455e0ff1129f1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 14:45:28 -0700
Subject: [PATCH 26/52] libsasl: fix build for libtool 2.4.7

---
 srcpkgs/libsasl/template | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/libsasl/template b/srcpkgs/libsasl/template
index a8817042f843..a2993b39f4a1 100644
--- a/srcpkgs/libsasl/template
+++ b/srcpkgs/libsasl/template
@@ -19,6 +19,7 @@ distfiles="https://github.com/cyrusimap/cyrus-sasl/releases/download/cyrus-sasl-
 checksum=26866b1549b00ffd020f188a43c258017fa1c382b3ddadd8201536f72efb05d5
 
 pre_configure() {
+	rm -f m4/ltversion.m4
 	autoreconf -fi
 }
 

From 711f5ca430c124fde08964e0d41c5983d57ac474 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:08 -0700
Subject: [PATCH 27/52] subversion: fix build for libtool 2.4.7

---
 srcpkgs/subversion/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion/template b/srcpkgs/subversion/template
index 8ad178264942..3f1c9e254e61 100644
--- a/srcpkgs/subversion/template
+++ b/srcpkgs/subversion/template
@@ -57,7 +57,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From 864537c0aab559e286d929feabea00860d167439 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:38 -0700
Subject: [PATCH 28/52] subversion-kwallet-auth: fix build for libtool 2.4.7

---
 srcpkgs/subversion-kwallet-auth/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion-kwallet-auth/template b/srcpkgs/subversion-kwallet-auth/template
index 12210f250d51..b4d8621456ea 100644
--- a/srcpkgs/subversion-kwallet-auth/template
+++ b/srcpkgs/subversion-kwallet-auth/template
@@ -59,7 +59,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From 32416d1320e7453983cd2d13ee54e924f8b70354 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 20:07:32 -0700
Subject: [PATCH 29/52] gpgme: update to 1.18.0.

---
 common/shlibs          | 2 +-
 srcpkgs/gpgme/template | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 46c0680d55dd..3e3967f58a8c 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -723,7 +723,7 @@ libdconf.so.1 dconf-0.13.90_1
 libassuan.so.0 libassuan-2.0.1_1
 libgpgme.so.11 libgpgme-1.12.0_2
 libgpgmepp.so.6 gpgmepp-1.7.0_3
-libqgpgme.so.7 gpgmeqt-1.7.0_3
+libqgpgme.so.15 gpgmeqt-1.18.0_1
 libgarcon-1.so.0 garcon-0.1.12_1
 libgarcon-gtk2-1.so.0 garcon-0.4.0_1
 libgarcon-gtk3-1.so.0 garcon-0.6.1_1
diff --git a/srcpkgs/gpgme/template b/srcpkgs/gpgme/template
index 8633075a8404..b1cfd5f78657 100644
--- a/srcpkgs/gpgme/template
+++ b/srcpkgs/gpgme/template
@@ -1,7 +1,7 @@
 # Template file for 'gpgme'
 pkgname=gpgme
-version=1.15.1
-revision=2
+version=1.18.0
+revision=1
 build_style=gnu-configure
 configure_args="--enable-fd-passing
  --with-libgpg-error-prefix=$XBPS_CROSS_BASE/usr
@@ -14,7 +14,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.gnupg.org/software/gpgme/index.html"
 distfiles="https://www.gnupg.org/ftp/gcrypt/gpgme/gpgme-${version}.tar.bz2"
-checksum=eebc3c1b27f1c8979896ff361ba9bb4778b508b2496c2fc10e3775a40b1de1ad
+checksum=361d4eae47ce925dba0ea569af40e7b52c645c4ae2e65e5621bf1b6cdd8b0e9e
 
 if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
 	configure_args+=" ac_cv_sys_file_offset_bits=no"

From 997f749960571f758290f18778938889f6c53e5c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:54 -0700
Subject: [PATCH 30/52] cross-aarch64-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..cb7ae97e7efe 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From af0f68b813948a034e84ce1d5189837ac6ca5dac Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:54 -0700
Subject: [PATCH 31/52] cross-aarch64-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..4fa950f334d4 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From d5bd1b1d24d68f7c2547db37c607e53d2f70733c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:54 -0700
Subject: [PATCH 32/52] cross-arm-linux-gnueabi: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..194c0ab774b7 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From ae1fbbb3747a2148838ac9557c516fa7893a0ef1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 33/52] cross-arm-linux-gnueabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..3f3242b85b07 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 30ce357a70b856127171ccc3ed317015fd928c54 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 34/52] cross-arm-linux-musleabi: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..b0cdade60a6d 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 2661ea42cfb730b12a9ad018495d1bdb6ee50ca9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 35/52] cross-arm-linux-musleabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..1924be24d483 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 696dd5802b2e515e4ff4e62e6ac3d38b459907e8 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 36/52] cross-armv7l-linux-gnueabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..a7997d6db937 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 449290b23f850acb62f7ca640f5684d846a3f835 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 37/52] cross-armv7l-linux-musleabihf: update to gcc 12.1.0.

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..aaa7040fbfef 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From f5e0fa4c9dd10b40f9572d5bdde02e3843cba72e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 38/52] cross-i686-pc-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..765cf675e95c 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From a1659b928685d827fc87a20d09c6debbaa5522cb Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 39/52] cross-mips-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-mips-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..26928ba9442d 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 48df827b26de4edfc30551128d10d69a09420afb Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 40/52] cross-mips-linux-muslhf: update to gcc 12.1.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..fe74faf15d55 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 658b3043ac3a44c41b9817193613f38cbda40112 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 41/52] cross-mipsel-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..aa74d0b1acc7 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_musl_version=1.1.24
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 74841b0a2729ed368acace4a12f15a8677a4ded4 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 42/52] cross-mipsel-linux-muslhf: update to gcc 12.1.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..83ab7f187085 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_musl_version=1.1.24
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 5254f7750af4d3df024dbb217a6f842548f61b73 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 43/52] cross-powerpc-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..3ab1a4ea40fa 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 664bf7479874ac2646d3a8e16f57d42f9272fcf1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 44/52] cross-powerpc-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..af5586cacc77 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From bb039a5778e4910e5ba6bbc668e32b0aaa0166b7 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 45/52] cross-powerpc64-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..2604b268046b 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 19042c046111739b29a03005e0ae9626402c6e65 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:55 -0700
Subject: [PATCH 46/52] cross-powerpc64-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 1ebd0fb2048d..c7894721b900 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
@@ -19,12 +19,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 8d53a46c449d95f76106f54aa4e495243e1fc467 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 47/52] cross-powerpc64le-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 733f5851da5c..618235468970 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From a83bb2b1886cbf74008b213c1482b0100a96f3e1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 48/52] cross-powerpc64le-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index 76a70aa1d6db..7edf9605e60d 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
@@ -19,12 +19,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From fa8748a5d0abe28cb599b189ee18f856d1fd4bda Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 49/52] cross-powerpcle-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 347b8fcf4f55..cc10b7cbd88b 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 6fe30f5877a6eb566060748c2678c8868e5dcd50 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 50/52] cross-powerpcle-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index ec9324ddaa99..1d38a3fa3559 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -18,11 +18,11 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From e49d2fbf9dffa85701addd05c15cffe31ad05d39 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 51/52] cross-x86_64-linux-gnu: update to gcc 12.1.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 0078fbe7224b..9f740b00a80c 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.1.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 48561743ed2a780915f05ec50ae3880c3ba5d2ef Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 01:13:56 -0700
Subject: [PATCH 52/52] cross-x86_64-linux-musl: update to gcc 12.1.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..19e13f3818e9 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.1.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
@@ -17,12 +17,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.1.0
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (39 preceding siblings ...)
  2022-08-24  5:45 ` oreo639
@ 2022-08-24  8:04 ` oreo639
  2022-08-24  8:05 ` oreo639
                   ` (223 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-08-24  8:04 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 394 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1225344519

Comment:
I built all of the glibc isos so most of the major breakages should be accounted for. I also provided isos fully compiled using gcc12 for testing purposes.
Feel free to test this PR on musl if you want to and let me know if there are any issues there.

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.1.0
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (40 preceding siblings ...)
  2022-08-24  8:04 ` oreo639
@ 2022-08-24  8:05 ` oreo639
  2022-08-24  8:06 ` oreo639
                   ` (222 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-08-24  8:05 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 398 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1225344519

Comment:
I built all of the glibc isos so hopefully most of the major breakages are accounted for, I also provided isos fully compiled using gcc12 for testing purposes.
Feel free to test this PR on musl if you want to and let me know if there are any issues there.

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.1.0
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (41 preceding siblings ...)
  2022-08-24  8:05 ` oreo639
@ 2022-08-24  8:06 ` oreo639
  2022-08-24 11:11 ` dkwo
                   ` (221 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-08-24  8:06 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 434 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1225344519

Comment:
I built all of the glibc isos so hopefully most of the major breakages are accounted for, I also provided isos fully compiled using gcc12 for testing purposes.
Feel free to test this PR on musl if you want to and let me know if there are any issues there.

Ofc any feedback is appreciated.

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.1.0
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (42 preceding siblings ...)
  2022-08-24  8:06 ` oreo639
@ 2022-08-24 11:11 ` dkwo
  2022-08-24 16:56 ` dkwo
                   ` (220 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: dkwo @ 2022-08-24 11:11 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 194 bytes --]

New comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1225575862

Comment:
Would it be possible to bump the minor version to 12.2?

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.1.0
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (43 preceding siblings ...)
  2022-08-24 11:11 ` dkwo
@ 2022-08-24 16:56 ` dkwo
  2022-08-24 19:44 ` [PR PATCH] [Updated] " oreo639
                   ` (219 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: dkwo @ 2022-08-24 16:56 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 705 bytes --]

New comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1225989490

Comment:
This is what I get for libtool on x86_64-musl:
```
ERROR: 137 tests were run,                                                                                                                                     
7 failed (5 expected failures).                                                                                                                                
32 tests were skipped. 

 69: shlibpath_overrides_runpath                     FAILED (shlibpath.at:69)
169: Run tests with low max_cmd_len                  FAILED (cmdline_wrap.at:48)
```

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.1.0
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (44 preceding siblings ...)
  2022-08-24 16:56 ` dkwo
@ 2022-08-24 19:44 ` oreo639
  2022-08-24 20:43 ` oreo639
                   ` (218 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-08-24 19:44 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5537 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.1.0
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.1.0

This PR depends on: https://github.com/void-linux/void-packages/pull/32330

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

Also, keep in mind that the libgo musl patch here will need to be updated once musl is updated:
https://github.com/void-linux/void-packages/pull/34902/files#diff-1f42a95b93c9550178ff1fbccbef2f47a72711df15c24c9472e2550076978129R163-R176

This is the updated patch for reference:
https://github.com/alpinelinux/aports/blob/8acb21b8ee881e7ab1c812d9a66a17d2501b8730/main/gcc/0049-libgo-adjust-name-of-union-in-sigevent-struct.patch

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/38817
- [x] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [ ] llvm https://github.com/void-linux/void-packages/pull/38694
- [ ] m4 https://github.com/void-linux/void-packages/pull/33730
- [ ] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [ ] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [ ] libvirt https://github.com/void-linux/void-packages/pull/38842
- [ ] syslinux https://github.com/void-linux/void-packages/pull/38876
- [ ] efivar https://github.com/void-linux/void-packages/pull/38874

Known packages that needed to be fixed/updated for gcc12:
- [ ] linux5.18 (in this PR)
- [ ] openssh https://github.com/void-linux/void-packages/pull/38849
- [ ] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [ ] doxygen https://github.com/void-linux/void-packages/pull/38846
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/38817
- [ ] libproxy https://github.com/void-linux/void-packages/pull/38818
- [ ] exempi https://github.com/void-linux/void-packages/pull/38820
- [ ] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [ ] gpgme https://github.com/void-linux/void-packages/pull/38825
- [ ] libunique1 https://github.com/void-linux/void-packages/pull/38848 or https://github.com/void-linux/void-packages/pull/38873
- [ ] libwpd https://github.com/void-linux/void-packages/pull/38878

Needs to be fixed/updated for binutils:
- [ ] grub https://github.com/void-linux/void-packages/pull/38875
- [ ] linux-tools https://github.com/void-linux/void-packages/pull/38877

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [x] kde
- [x] lxde
- [x] lxqt

You can test the ISOs here:
https://drive.google.com/drive/folders/1ix92CYSLUP-KWjLxltdgG4e8Nu2JCY5n?usp=sharing

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 169814 bytes --]

From 5d1d7d642915007814d3edc6fc11186f7b11f503 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 01/52] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 15 +++--
 3 files changed, 28 insertions(+), 113 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..4bdaee582d71 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkg-config"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -44,6 +45,12 @@ do_configure() {
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	case "$XBPS_TARGET_MACHINE" in
+		*-musl)
+			conf+=" --disable-gprofng"
+			;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"

From a43f0f616fc3596902c22b1c7096103cda580904 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 02/52] gcc: update to 12.2.0.

---
 common/shlibs                                 | 10 +--
 srcpkgs/gcc/files/gccgo-musl.patch            | 74 ++++---------------
 srcpkgs/gcc/files/libgnarl-musl.patch         | 18 ++---
 srcpkgs/gcc/files/libssp-musl.patch           | 10 +--
 srcpkgs/gcc/patches/libffi_gnulinux.patch     | 11 ---
 .../gcc/patches/libgcc-ibm128-no-tag.patch    | 10 ++-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |  2 +-
 srcpkgs/gcc/template                          | 25 +++----
 8 files changed, 52 insertions(+), 108 deletions(-)
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index f829ee12e80f..bde5320461ce 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.2.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.34 perl-5.34.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -848,8 +848,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.2.0_1
+libgnat-12.so libada-12.2.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1700,8 +1700,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.2.0_1
+libasan.so.8 libsanitizer-12.2.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..632ef951097b 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,17 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ a/libgo/go/runtime/os_linux.go
+@@ -363,9 +363,9 @@
+ 
+ 	var timerid int32
+ 	var sevp _sigevent
+-	sevp.sigev_notify = _SIGEV_THREAD_ID
++	sevp.sigev_notify = 4
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.sigev_notify_function))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..446741390d45 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,15 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
+version=12.2.0
+revision=1
 _patchver="${version%pre*}"
 _minorver="${_patchver%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 wrksrc=gcc-${version/pre/_pre}
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +19,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -396,7 +393,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}

From 2b42a92be88ca85118f1f35c1ee44f6193b1cffc Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 03/52] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      |  6 ++--
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..08e35d466a44 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From f5496ef3f6a5df2f392c8887930a985d95676bc3 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 04/52] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 1a4e1ca3d594..b04268908c2e 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="q66 <daniel@octaforge.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From ae3b15192702ae11094e7dbfde1fa97b62541b70 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 05/52] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 3 files changed, 55 insertions(+), 353 deletions(-)
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index bde5320461ce..52220e69706d 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From b5b5eef4e60708673c7d206d6849783e13693ae2 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 21:01:43 -0700
Subject: [PATCH 06/52] gcc-multilib: update to 12.2.0.

---
 srcpkgs/gcc-multilib/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index fcd25755aa75..1a26da26a991 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,16 +3,16 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _majorver="${version%.*}"
-wrksrc=gcc-${version/pre/_pre}
+wrksrc=gcc-${version}
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel

From 37b0d5431a0fc8a60c4e81e708eef84e23b19752 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 16:22:03 -0700
Subject: [PATCH 07/52] llvm12: fix build for glibc 2.36

---
 .../compiler-rt-sanitizer-glibc-2.36.patch    | 59 +++++++++++++++++++
 1 file changed, 59 insertions(+)
 create mode 100644 srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch

diff --git a/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch b/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch
new file mode 100644
index 000000000000..e5f24dab8935
--- /dev/null
+++ b/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch
@@ -0,0 +1,59 @@
+From 9cf13067cb5088626ba7ee1ec4c42ec59c7995a0 Mon Sep 17 00:00:00 2001
+From: Fangrui Song <i@maskray.me>
+Date: Mon, 11 Jul 2022 12:53:34 -0700
+Subject: [PATCH] [sanitizer] Remove #include <linux/fs.h> to resolve
+ fsconfig_command/mount_attr conflict with glibc 2.36
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+It is generally not a good idea to mix usage of glibc headers and Linux UAPI
+headers (https://sourceware.org/glibc/wiki/Synchronizing_Headers). In glibc
+since 7eae6a91e9b1670330c9f15730082c91c0b1d570 (milestone: 2.36), sys/mount.h
+defines `fsconfig_command` which conflicts with linux/mount.h:
+
+    .../usr/include/linux/mount.h:95:6: error: redeclaration of ‘enum fsconfig_command’
+
+Remove #include <linux/fs.h> which pulls in linux/mount.h. Expand its 4 macros manually.
+Android sys/mount.h doesn't define BLKBSZGET and it still needs linux/fs.h.
+In the long term we should move Linux specific definitions to sanitizer_platform_limits_linux.cpp
+but this commit is easy to cherry pick into older compiler-rt releases.
+
+Fix https://github.com/llvm/llvm-project/issues/56421
+
+Reviewed By: #sanitizers, vitalybuka, zatrazz
+
+Differential Revision: https://reviews.llvm.org/D129471
+---
+ .../sanitizer_platform_limits_posix.cpp                | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+index 4bd425435d56d..3a94b260686f1 100644
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -73,7 +73,9 @@
+ #include <sys/vt.h>
+ #include <linux/cdrom.h>
+ #include <linux/fd.h>
++#if SANITIZER_ANDROID
+ #include <linux/fs.h>
++#endif
+ #include <linux/hdreg.h>
+ #include <linux/input.h>
+ #include <linux/ioctl.h>
+@@ -876,10 +878,10 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
+   unsigned IOCTL_EVIOCGPROP = IOCTL_NOT_PRESENT;
+   unsigned IOCTL_EVIOCSKEYCODE_V2 = IOCTL_NOT_PRESENT;
+ #endif
+-  unsigned IOCTL_FS_IOC_GETFLAGS = FS_IOC_GETFLAGS;
+-  unsigned IOCTL_FS_IOC_GETVERSION = FS_IOC_GETVERSION;
+-  unsigned IOCTL_FS_IOC_SETFLAGS = FS_IOC_SETFLAGS;
+-  unsigned IOCTL_FS_IOC_SETVERSION = FS_IOC_SETVERSION;
++  unsigned IOCTL_FS_IOC_GETFLAGS = _IOR('f', 1, long);
++  unsigned IOCTL_FS_IOC_GETVERSION = _IOR('v', 1, long);
++  unsigned IOCTL_FS_IOC_SETFLAGS = _IOW('f', 2, long);
++  unsigned IOCTL_FS_IOC_SETVERSION = _IOW('v', 2, long);
+   unsigned IOCTL_GIO_CMAP = GIO_CMAP;
+   unsigned IOCTL_GIO_FONT = GIO_FONT;
+   unsigned IOCTL_GIO_UNIMAP = GIO_UNIMAP;

From bb2af425473a2ee1f71bbb830067b0843edbe7d2 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 17:21:40 -0700
Subject: [PATCH 08/52] m4: update to 1.4.19.

---
 srcpkgs/m4/patches/fix-glibc-2.27.patch | 167 ------------------------
 srcpkgs/m4/template                     |  12 +-
 2 files changed, 6 insertions(+), 173 deletions(-)
 delete mode 100644 srcpkgs/m4/patches/fix-glibc-2.27.patch

diff --git a/srcpkgs/m4/patches/fix-glibc-2.27.patch b/srcpkgs/m4/patches/fix-glibc-2.27.patch
deleted file mode 100644
index 59d33cff164d..000000000000
--- a/srcpkgs/m4/patches/fix-glibc-2.27.patch
+++ /dev/null
@@ -1,167 +0,0 @@
-From 4af4a4a71827c0bc5e0ec67af23edef4f15cee8e Mon Sep 17 00:00:00 2001
-From: Paul Eggert <eggert@cs.ucla.edu>
-Date: Mon, 5 Mar 2018 10:56:29 -0800
-Subject: [PATCH] fflush: adjust to glibc 2.28 libio.h removal
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Problem reported by Daniel P. Berrangé in:
-https://lists.gnu.org/r/bug-gnulib/2018-03/msg00000.html
-* lib/fbufmode.c (fbufmode):
-* lib/fflush.c (clear_ungetc_buffer_preserving_position)
-(disable_seek_optimization, rpl_fflush):
-* lib/fpending.c (__fpending):
-* lib/fpurge.c (fpurge):
-* lib/freadable.c (freadable):
-* lib/freadahead.c (freadahead):
-* lib/freading.c (freading):
-* lib/freadptr.c (freadptr):
-* lib/freadseek.c (freadptrinc):
-* lib/fseeko.c (fseeko):
-* lib/fseterr.c (fseterr):
-* lib/fwritable.c (fwritable):
-* lib/fwriting.c (fwriting):
-Check _IO_EOF_SEEN instead of _IO_ftrylockfile.
-* lib/stdio-impl.h (_IO_IN_BACKUP) [_IO_EOF_SEEN]:
-Define if not already defined.
-
-[yann.morin.1998@free.fr: partially backport from upstream gnulib]
-Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
-
----
- lib/fflush.c     |  6 +++---
- lib/fpending.c   |  2 +-
- lib/fpurge.c     |  2 +-
- lib/freadahead.c |  2 +-
- lib/freading.c   |  2 +-
- lib/fseeko.c     |  4 ++--
- lib/stdio-impl.h |  6 ++++++
- 7 files changed, 15 insertions(+), 9 deletions(-)
-
-diff --git a/lib/fflush.c b/build-aux/gnulib/lib/fflush.c
-index 983ade0ff..a6edfa105 100644
---- a/lib/fflush.c
-+++ b/lib/fflush.c
-@@ -33,7 +33,7 @@
- #undef fflush
- 
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- 
- /* Clear the stream's ungetc buffer, preserving the value of ftello (fp).  */
- static void
-@@ -72,7 +72,7 @@ clear_ungetc_buffer (FILE *fp)
- 
- #endif
- 
--#if ! (defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
-+#if ! (defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
- 
- # if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT
- /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
-@@ -148,7 +148,7 @@ rpl_fflush (FILE *stream)
-   if (stream == NULL || ! freading (stream))
-     return fflush (stream);
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- 
-   clear_ungetc_buffer_preserving_position (stream);
- 
-diff --git a/lib/fpending.c b/build-aux/gnulib/lib/fpending.c
-index c84e3a5b4..789f50e4e 100644
---- a/lib/fpending.c
-+++ b/lib/fpending.c
-@@ -32,7 +32,7 @@ __fpending (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   return fp->_IO_write_ptr - fp->_IO_write_base;
- #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
-   /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
-diff --git a/lib/fpurge.c b/build-aux/gnulib/lib/fpurge.c
-index b1d417c7a..3aedcc373 100644
---- a/lib/fpurge.c
-+++ b/lib/fpurge.c
-@@ -62,7 +62,7 @@ fpurge (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   fp->_IO_read_end = fp->_IO_read_ptr;
-   fp->_IO_write_ptr = fp->_IO_write_base;
-   /* Avoid memory leak when there is an active ungetc buffer.  */
-diff --git a/lib/freadahead.c b/build-aux/gnulib/lib/freadahead.c
-index c2ecb5b28..23ec76ee5 100644
---- a/lib/freadahead.c
-+++ b/lib/freadahead.c
-@@ -30,7 +30,7 @@ extern size_t __sreadahead (FILE *);
- size_t
- freadahead (FILE *fp)
- {
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   if (fp->_IO_write_ptr > fp->_IO_write_base)
-     return 0;
-   return (fp->_IO_read_end - fp->_IO_read_ptr)
-diff --git a/lib/freading.c b/build-aux/gnulib/lib/freading.c
-index 73c28acdd..c24d0c88a 100644
---- a/lib/freading.c
-+++ b/lib/freading.c
-@@ -31,7 +31,7 @@ freading (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   return ((fp->_flags & _IO_NO_WRITES) != 0
-           || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0
-               && fp->_IO_read_base != NULL));
-diff --git a/lib/fseeko.c b/build-aux/gnulib/lib/fseeko.c
-index 0101ab55f..193f4e8ce 100644
---- a/lib/fseeko.c
-+++ b/lib/fseeko.c
-@@ -47,7 +47,7 @@ fseeko (FILE *fp, off_t offset, int whence)
- #endif
- 
-   /* These tests are based on fpurge.c.  */
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   if (fp->_IO_read_end == fp->_IO_read_ptr
-       && fp->_IO_write_ptr == fp->_IO_write_base
-       && fp->_IO_save_base == NULL)
-@@ -123,7 +123,7 @@ fseeko (FILE *fp, off_t offset, int whence)
-           return -1;
-         }
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-       fp->_flags &= ~_IO_EOF_SEEN;
-       fp->_offset = pos;
- #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
-diff --git a/lib/stdio-impl.h b/build-aux/gnulib/lib/stdio-impl.h
-index 78d896e9f..05c5752a2 100644
---- a/lib/stdio-impl.h
-+++ b/lib/stdio-impl.h
-@@ -18,6 +18,12 @@
-    the same implementation of stdio extension API, except that some fields
-    have different naming conventions, or their access requires some casts.  */
- 
-+/* Glibc 2.28 made _IO_IN_BACKUP private.  For now, work around this
-+   problem by defining it ourselves.  FIXME: Do not rely on glibc
-+   internals.  */
-+#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN
-+# define _IO_IN_BACKUP 0x100
-+#endif
- 
- /* BSD stdio derived implementations.  */
- 
--- 
-2.14.1
-
-
diff --git a/srcpkgs/m4/template b/srcpkgs/m4/template
index 78f3dae6184a..762593d883bd 100644
--- a/srcpkgs/m4/template
+++ b/srcpkgs/m4/template
@@ -1,17 +1,17 @@
 # Template file for 'm4'
 pkgname=m4
-version=1.4.18
-revision=2
+version=1.4.19
+revision=1
 bootstrap=yes
-replaces="chroot-m4>=0"
 build_style=gnu-configure
 configure_args="--enable-changeword --enable-threads"
 short_desc="GNU version of UNIX m4 macro language processor"
-homepage="https://www.gnu.org/software/m4/"
-license="GPL-3.0-or-later"
 maintainer="Enno Boland <gottox@voidlinux.org>"
+license="GPL-3.0-or-later"
+homepage="https://www.gnu.org/software/m4/"
 distfiles="${GNU_SITE}/${pkgname}/${pkgname}-${version}.tar.xz"
-checksum=f2c1e86ca0a404ff281631bdc8377638992744b175afb806e25871a24a934e07
+checksum=63aede5c6d33b6d9b13511cd0be2cac046f2e70fd0a07aa9573a04a82783af96
+replaces="chroot-m4>=0"
 
 if [ "$XBPS_TARGET_LIBC" = musl ]; then
 	export ac_cv_lib_error_at_line=no

From 79f1b2200acc2dcfe8c33231f87a21739d0172dd Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 22:57:59 -0700
Subject: [PATCH 09/52] btrfs-progs: update to 5.19.

---
 srcpkgs/btrfs-progs/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/btrfs-progs/template b/srcpkgs/btrfs-progs/template
index f6c53d8587e1..292d5110106b 100644
--- a/srcpkgs/btrfs-progs/template
+++ b/srcpkgs/btrfs-progs/template
@@ -1,6 +1,6 @@
 # Template file for 'btrfs-progs'
 pkgname=btrfs-progs
-version=5.18.1
+version=5.19
 revision=1
 wrksrc="${pkgname}-v${version}"
 build_style=gnu-configure
@@ -16,7 +16,7 @@ license="GPL-2.0-only, LGPL-2.1-or-later"
 homepage="https://btrfs.wiki.kernel.org/index.php/Main_Page"
 changelog="https://raw.githubusercontent.com/kdave/btrfs-progs/master/CHANGES"
 distfiles="${KERNEL_SITE}/kernel/people/kdave/${pkgname}/${pkgname}-v${version}.tar.xz"
-checksum=6e98a75ccff52e9354daa1ad284c614c490f844273a2fa524cbac9eb841c7255
+checksum=1fbcf06e4b2f80e7a127fd687ed4625a5b74fa674fe212c836ff70e0edfcccf9
 # Most of the tests depend on `mount` and `fallocate` commands, which are not
 # presented in chroot-util-linux
 make_check=no

From 1c67d6258e918620ad76a2b5a2a8dd08e85e752f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 19:39:23 -0700
Subject: [PATCH 10/52] syslinux: fix build for glibc 2.36

---
 .../patches/fix-build-with-glibc-2.36.patch   | 30 +++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 srcpkgs/syslinux/patches/fix-build-with-glibc-2.36.patch

diff --git a/srcpkgs/syslinux/patches/fix-build-with-glibc-2.36.patch b/srcpkgs/syslinux/patches/fix-build-with-glibc-2.36.patch
new file mode 100644
index 000000000000..1303be56c127
--- /dev/null
+++ b/srcpkgs/syslinux/patches/fix-build-with-glibc-2.36.patch
@@ -0,0 +1,30 @@
+--- a/linux/syslinux.c
++++ b/linux/syslinux.c
+@@ -45,7 +45,6 @@
+ #include <sys/stat.h>
+ #include <sys/types.h>
+ #include <sys/wait.h>
+-#include <sys/mount.h>
+ 
+ #include "linuxioctl.h"
+ 
+--- a/libinstaller/syslxcom.c
++++ b/libinstaller/syslxcom.c
+@@ -28,7 +28,6 @@
+ #include <errno.h>
+ #include <sys/stat.h>
+ #include <sys/types.h>
+-#include <sys/mount.h>
+ #include <sys/vfs.h>
+ 
+ #include "linuxioctl.h"
+--- a/extlinux/main.c
++++ b/extlinux/main.c
+@@ -40,7 +40,6 @@
+ #include <sys/stat.h>
+ #include <sys/sysmacros.h>
+ #include <sys/types.h>
+-#include <sys/mount.h>
+ #include <sys/vfs.h>
+ 
+ #include "linuxioctl.h"

From 79b22db3ec04b5edd1970de1182acb8bddeaac68 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 14 Aug 2022 19:29:36 -0700
Subject: [PATCH 11/52] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove nopie=yes. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh             |  1 +
 common/environment/build-style/void-cross.sh | 36 +++++++++++++++++++-
 2 files changed, 36 insertions(+), 1 deletion(-)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..c24013755704 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -132,6 +132,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
diff --git a/common/environment/build-style/void-cross.sh b/common/environment/build-style/void-cross.sh
index 62ce9eaa2e4a..4b77c90efc8b 100644
--- a/common/environment/build-style/void-cross.sh
+++ b/common/environment/build-style/void-cross.sh
@@ -1,6 +1,40 @@
 lib32disabled=yes
-nopie=yes
 create_wrksrc=yes
 
 nostrip_files+=" libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a libgmem.a"
+nopie_files+=" /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/go1
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/lto-wrapper
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/plugin/gengtype
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/cc1objplus
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/cc1obj
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/collect2
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/lto1
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/f951
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/cc1
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/gnat1
+ /usr/lib/gcc/${sourcepkg/cross-}/${_gcc_version%.*}/cc1plus
+ /usr/bin/${sourcepkg/cross-}-gcov-dump
+ /usr/bin/${sourcepkg/cross-}-gnatlink
+ /usr/bin/${sourcepkg/cross-}-gnatbind
+ /usr/bin/${sourcepkg/cross-}-gcc
+ /usr/bin/${sourcepkg/cross-}-cpp
+ /usr/bin/${sourcepkg/cross-}-gnatchop
+ /usr/bin/${sourcepkg/cross-}-gfortran
+ /usr/bin/${sourcepkg/cross-}-gccgo
+ /usr/bin/${sourcepkg/cross-}-c++
+ /usr/bin/${sourcepkg/cross-}-lto-dump
+ /usr/bin/${sourcepkg/cross-}-gnatname
+ /usr/bin/${sourcepkg/cross-}-gnatprep
+ /usr/bin/${sourcepkg/cross-}-g++
+ /usr/bin/${sourcepkg/cross-}-gnat
+ /usr/bin/${sourcepkg/cross-}-gcc-ranlib
+ /usr/bin/${sourcepkg/cross-}-gnatkr
+ /usr/bin/${sourcepkg/cross-}-gnatmake
+ /usr/bin/${sourcepkg/cross-}-gcc-${_gcc_version}
+ /usr/bin/${sourcepkg/cross-}-gcc-ar
+ /usr/bin/${sourcepkg/cross-}-gnatclean
+ /usr/bin/${sourcepkg/cross-}-gcov
+ /usr/bin/${sourcepkg/cross-}-gnatls
+ /usr/bin/${sourcepkg/cross-}-gcc-nm
+ /usr/bin/${sourcepkg/cross-}-gcov-tool"

From be9ce5cb1c4eae5f9984a333e432f22a0bbdb274 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:08:52 -0700
Subject: [PATCH 12/52] openssh: suppress werror on gcc12

---
 srcpkgs/openssh/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/openssh/template b/srcpkgs/openssh/template
index 02a2dec35f42..6e8e343a9dca 100644
--- a/srcpkgs/openssh/template
+++ b/srcpkgs/openssh/template
@@ -40,7 +40,7 @@ if [ "$build_option_ldns" -a -z "$build_option_ssl" ]; then
 	broken="option 'ldns' requires option 'ssl'"
 fi
 
-CFLAGS="-Wno-format-truncation -Wno-stringop-truncation"
+CFLAGS="-Wno-format-truncation -Wno-stringop-truncation -Wno-error=maybe-uninitialized"
 
 case $XBPS_TARGET_MACHINE in
 	i686-musl)

From 9e66f17eddbf0a8be6a64494a14b52c64db434b6 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:09:31 -0700
Subject: [PATCH 13/52] linux5.18: update dotconfigs for gcc12

---
 srcpkgs/linux5.18/files/x86_64-dotconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/linux5.18/files/x86_64-dotconfig b/srcpkgs/linux5.18/files/x86_64-dotconfig
index 4e73a3195d40..ea6204868e23 100644
--- a/srcpkgs/linux5.18/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.18/files/x86_64-dotconfig
@@ -512,6 +512,7 @@ CONFIG_RETHUNK=y
 CONFIG_CPU_UNRET_ENTRY=y
 CONFIG_CPU_IBPB_ENTRY=y
 CONFIG_CPU_IBRS_ENTRY=y
+CONFIG_SLS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10060,8 +10061,11 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
 # Memory initialization
 #
 CONFIG_INIT_STACK_NONE=y
+# CONFIG_INIT_STACK_ALL_PATTERN is not set
+# CONFIG_INIT_STACK_ALL_ZERO is not set
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
+# CONFIG_ZERO_CALL_USED_REGS is not set
 # end of Memory initialization
 # end of Kernel hardening options
 # end of Security options
@@ -10538,6 +10542,7 @@ CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
 # CONFIG_UBSAN is not set
 CONFIG_HAVE_ARCH_KCSAN=y
+# CONFIG_KCSAN is not set
 # end of Generic Kernel Debugging Instruments
 
 #

From 716f79fd4ae6c5b1ffcd3a588215a1fd9425ae4d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 18:00:42 -0700
Subject: [PATCH 14/52] xf86-video-vmware: fix build on gcc12

---
 ...183b3395333d5d4c73e25c2d011748f15eda.patch | 30 +++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch

diff --git a/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch b/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch
new file mode 100644
index 000000000000..ff839f16e628
--- /dev/null
+++ b/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch
@@ -0,0 +1,30 @@
+From 77b8183b3395333d5d4c73e25c2d011748f15eda Mon Sep 17 00:00:00 2001
+From: Rudi Heitbaum <rudi@heitbaum.com>
+Date: Sun, 8 May 2022 03:00:10 +0000
+Subject: [PATCH] vmwgfx: fix missing array notation
+
+ Fixes error identified by gcc-12.1.0 compiler
+
+make
+  CC       libvmwgfx_la-vmwgfx_tex_video.lo
+vmwgfx_tex_video.c: In function 'stop_video':
+vmwgfx_tex_video.c:240:20: error: the comparison will always evaluate as 'true' for the address of 'yuv' will never be NULL [-Werror=address]
+  240 |                if (priv->yuv[i]) {
+      |                    ^~~~
+---
+ vmwgfx/vmwgfx_tex_video.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/vmwgfx/vmwgfx_tex_video.c b/vmwgfx/vmwgfx_tex_video.c
+index acc2b56..480a5f1 100644
+--- a/vmwgfx/vmwgfx_tex_video.c
++++ b/vmwgfx/vmwgfx_tex_video.c
+@@ -237,7 +237,7 @@ stop_video(ScrnInfoPtr pScrn, pointer data, Bool shutdown)
+ 
+        for (i=0; i<3; ++i) {
+ 	   for (j=0; j<2; ++j) {
+-	       if (priv->yuv[i]) {
++	       if (priv->yuv[j][i]) {
+ 		   xa_surface_destroy(priv->yuv[j][i]);
+ 		   priv->yuv[j][i] = NULL;
+ 	       }

From 0e53cfb1d031d667bd1221cb33940c17963cf014 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 18:24:37 -0700
Subject: [PATCH 15/52] doxygen: fix build for gcc 12

---
 srcpkgs/doxygen/patches/compat-gcc12.patch | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100644 srcpkgs/doxygen/patches/compat-gcc12.patch

diff --git a/srcpkgs/doxygen/patches/compat-gcc12.patch b/srcpkgs/doxygen/patches/compat-gcc12.patch
new file mode 100644
index 000000000000..666744a1dceb
--- /dev/null
+++ b/srcpkgs/doxygen/patches/compat-gcc12.patch
@@ -0,0 +1,22 @@
+From 5198966c8d5fec89116d025c74934ac03ea511fa Mon Sep 17 00:00:00 2001
+From: Dimitri van Heesch <doxygen@gmail.com>
+Date: Fri, 6 May 2022 09:55:16 +0200
+Subject: [PATCH] issue #9312: Build: cache.h:53:14: error: 'exchange' is not a
+ member of 'std'
+
+---
+ src/cache.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/cache.h b/src/cache.h
+index 0ff3092ed5..e218eb27d2 100644
+--- a/src/cache.h
++++ b/src/cache.h
+@@ -19,6 +19,7 @@
+ #include <list>
+ #include <unordered_map>
+ #include <mutex>
++#include <utility>
+ #include <ctype.h>
+ 
+ /*! Fixed size cache for value type V using keys of type K.

From 0ec5a59c661c2e4ad83aad609b6c93dd865d1977 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 21 Aug 2022 15:12:00 -0700
Subject: [PATCH 16/52] libproxy: update to 0.4.18

---
 srcpkgs/libproxy/template | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/libproxy/template b/srcpkgs/libproxy/template
index d6103007032e..6599dfb69b98 100644
--- a/srcpkgs/libproxy/template
+++ b/srcpkgs/libproxy/template
@@ -1,18 +1,22 @@
 # Template file for 'libproxy'
 pkgname=libproxy
-version=0.4.15
+version=0.4.18
 revision=1
 build_style=cmake
 configure_args="-DWITH_GNOME=0 -DWITH_KDE4=0 -DWITH_MOZJS=0 -DWITH_NM=0
  -DWITH_PERL=0 -DWITH_PYTHON=1 -DWITH_WEBKIT=0"
 hostmakedepends="pkg-config python"
 makedepends="zlib-devel"
-short_desc="A library handling all the details of proxy configuration"
+short_desc="Library handling all the details of proxy configuration"
 maintainer="Orphaned <orphan@voidlinux.org>"
+license="LGPL-2.1-or-later"
 homepage="http://github.com/libproxy/libproxy"
-license="LGPL-2.1"
-distfiles="https://github.com/libproxy/libproxy/archive/${version}.tar.gz>${pkgname}-${version}.tar.gz"
-checksum=18f58b0a0043b6881774187427ead158d310127fc46a1c668ad6d207fb28b4e0
+distfiles="https://github.com/libproxy/libproxy/archive/${version}.tar.gz"
+checksum=0b4a9218d88f6cf9fa25996a3f38329a11f688a9d026141d9d0e966d8fa63837
+
+post_patch() {
+	vsed '/add_test(NAME url-test/d' -i libproxy/test/CMakeLists.txt
+}
 
 libproxy-devel_package() {
 	depends="libproxy>=${version}_${revision}"

From 436a3d00073178426167e9aa38a11c34027438e4 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 21 Aug 2022 17:05:39 -0700
Subject: [PATCH 17/52] exempi: update to 2.6.2

---
 ...f034705fd2d032c81383eee8208fd4eee0ac.patch | 43 -------------------
 srcpkgs/exempi/template                       |  4 +-
 2 files changed, 2 insertions(+), 45 deletions(-)
 delete mode 100644 srcpkgs/exempi/patches/8ed2f034705fd2d032c81383eee8208fd4eee0ac.patch

diff --git a/srcpkgs/exempi/patches/8ed2f034705fd2d032c81383eee8208fd4eee0ac.patch b/srcpkgs/exempi/patches/8ed2f034705fd2d032c81383eee8208fd4eee0ac.patch
deleted file mode 100644
index 2696793cec09..000000000000
--- a/srcpkgs/exempi/patches/8ed2f034705fd2d032c81383eee8208fd4eee0ac.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From 8ed2f034705fd2d032c81383eee8208fd4eee0ac Mon Sep 17 00:00:00 2001
-From: Victor Rodriguez <victor.rodriguez.bahena@intel.com>
-Date: Sat, 18 Aug 2018 13:54:55 +0000
-Subject: [PATCH] Issue #9 - Fix null-pointer-dereference (CVE-2018-12648)
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-The WEBP::GetLE32 function in
-XMPFiles/source/FormatSupport/WEBP_Support.hpp in Exempi 2.4.5 has a
-NULL pointer dereference.
-
-https://bugs.freedesktop.org/show_bug.cgi?id=106981
-https://gitlab.freedesktop.org/libopenraw/exempi/issues/9
-
-Signed-off-by: Victor Rodriguez <victor.rodriguez.bahena@intel.com>
-Signed-off-by: Hubert Figuière <hub@figuiere.net>
----
- XMPFiles/source/FormatSupport/WEBP_Support.cpp | 8 +++++---
- 1 file changed, 5 insertions(+), 3 deletions(-)
-
-diff --git a/XMPFiles/source/FormatSupport/WEBP_Support.cpp b/XMPFiles/source/FormatSupport/WEBP_Support.cpp
-index ffaf220..4fe705b 100644
---- a/XMPFiles/source/FormatSupport/WEBP_Support.cpp
-+++ b/XMPFiles/source/FormatSupport/WEBP_Support.cpp
-@@ -160,9 +160,11 @@ bool VP8XChunk::xmp()
- }
- void VP8XChunk::xmp(bool hasXMP)
- {
--    XMP_Uns32 flags = GetLE32(&this->data[0]);
--    flags ^= (-hasXMP ^ flags) & (1 << XMP_FLAG_BIT);
--    PutLE32(&this->data[0], flags);
-+    if (&this->data[0] != NULL) {
-+        XMP_Uns32 flags = GetLE32(&this->data[0]);
-+        flags ^= (-hasXMP ^ flags) & (1 << XMP_FLAG_BIT);
-+        PutLE32(&this->data[0], flags);
-+    }
- }
- 
- Container::Container(WEBP_MetaHandler* handler) : Chunk(NULL, handler)
--- 
-2.18.0
-
diff --git a/srcpkgs/exempi/template b/srcpkgs/exempi/template
index 14753617953a..d664f7dc4d80 100644
--- a/srcpkgs/exempi/template
+++ b/srcpkgs/exempi/template
@@ -1,6 +1,6 @@
 # Template file for 'exempi'
 pkgname=exempi
-version=2.5.0
+version=2.6.2
 revision=1
 build_style=gnu-configure
 configure_args="--with-boost=${XBPS_CROSS_BASE}/usr --disable-static --disable-unittest"
@@ -10,7 +10,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="BSD-3-Clause"
 homepage="https://libopenraw.freedesktop.org/wiki/Exempi"
 distfiles="https://libopenraw.freedesktop.org/download/exempi-${version}.tar.bz2"
-checksum=dc82fc24c0540a44a63fa4ad21775d24e00e63f1dedd3e2ae6f7aa27583b711b
+checksum=4d17d4c93df2a95da3e3172c45b7a5bf317dd31dafd1c7a340169728c7089d1d
 
 post_install() {
 	vlicense COPYING

From c0ef049a104d0baaa2f368a24dbe4321f38a8c2f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 21 Aug 2022 21:36:03 -0700
Subject: [PATCH 18/52] plymouth: update to 22.02.122

---
 srcpkgs/plymouth/patches/fix-glibc-2.36.patch | 30 +++++++++++++++++++
 srcpkgs/plymouth/template                     |  4 +--
 2 files changed, 32 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/plymouth/patches/fix-glibc-2.36.patch

diff --git a/srcpkgs/plymouth/patches/fix-glibc-2.36.patch b/srcpkgs/plymouth/patches/fix-glibc-2.36.patch
new file mode 100644
index 000000000000..2f1e43875cfb
--- /dev/null
+++ b/srcpkgs/plymouth/patches/fix-glibc-2.36.patch
@@ -0,0 +1,30 @@
+From 5f1e43c00039a7fe1fff768b91a05a695fb4a53d Mon Sep 17 00:00:00 2001
+From: Ray Strode <rstrode@redhat.com>
+Date: Wed, 3 Aug 2022 15:23:33 -0400
+Subject: [PATCH] ply-utils: Drop linux/fs.h include
+
+It was needed long ago for a function we no longer even have.
+
+Now it's causing compile errors on Fedora 37 because it's conflicting
+with sys/mount.h.
+
+This commit drops it.
+---
+ src/libply/ply-utils.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/src/libply/ply-utils.c b/src/libply/ply-utils.c
+index c7b165e9..219e2e77 100644
+--- a/src/libply/ply-utils.c
++++ b/src/libply/ply-utils.c
+@@ -46,7 +46,6 @@
+ #include <sys/user.h>
+ #include <sys/wait.h>
+ #include <time.h>
+-#include <linux/fs.h>
+ #include <linux/vt.h>
+ 
+ #include <dlfcn.h>
+-- 
+GitLab
+
diff --git a/srcpkgs/plymouth/template b/srcpkgs/plymouth/template
index 17f801fc5315..442ab58a99cd 100644
--- a/srcpkgs/plymouth/template
+++ b/srcpkgs/plymouth/template
@@ -1,6 +1,6 @@
 # Template file for 'plymouth'
 pkgname=plymouth
-version=0.9.5
+version=22.02.122
 revision=1
 build_style=gnu-configure
 configure_args="--with-system-root-install=no \
@@ -18,7 +18,7 @@ maintainer="William OD <obirik2005@gmail.com>"
 license="GPL-2.0-or-later"
 homepage="https://www.freedesktop.org/wiki/Software/Plymouth/"
 distfiles="${FREEDESKTOP_SITE}/plymouth/releases/$pkgname-$version.tar.xz"
-checksum=ecae257f351d098340542a5bc06de029404c24dcee87e6ebb2abd5ef117fce86
+checksum=100551442221033ce868c447ad6c74d831d209c18ae232b98ae0207e34eadaeb
 
 build_options="gtk3 pango"
 build_options_default="gtk3 pango"

From 50193183a17432775fae3d1c47680d6eb36508c8 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 21 Aug 2022 21:37:00 -0700
Subject: [PATCH 19/52] openjdk7-bootstrap: fix build for gcc12

---
 .../files/dist_patches_glibc.txt              |  1 +
 .../files/dist_patches_musl.txt               |  1 +
 .../icedtea-pointer-comparison-gcc12.patch    | 31 +++++++++++++++++++
 3 files changed, 33 insertions(+)
 create mode 100644 srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch

diff --git a/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt b/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt
index c76c56855441..8061756dfc0c 100644
--- a/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt
+++ b/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt
@@ -6,3 +6,4 @@ icedtea-jdk-no-soname.patch
 icedtea-jdk-xattr.patch
 icedtea-jdk-sysctl_h.patch
 icedtea-cpio.patch
+icedtea-pointer-comparison-gcc12.patch
diff --git a/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt b/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt
index 21812517c7c2..8b35d9c46989 100644
--- a/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt
+++ b/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt
@@ -11,3 +11,4 @@ icedtea-jdk-musl.patch
 icedtea-jdk-no-soname.patch
 icedtea-jdk-xattr.patch
 icedtea-cpio.patch
+icedtea-pointer-comparison-gcc12.patch
diff --git a/srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch b/srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch
new file mode 100644
index 000000000000..c809553443e7
--- /dev/null
+++ b/srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch
@@ -0,0 +1,31 @@
+--- openjdk.orig/hotspot/src/share/vm/opto/lcm.cpp
++++ openjdk/hotspot/src/share/vm/opto/lcm.cpp
+@@ -60,7 +60,7 @@
+ // Check whether val is not-null-decoded compressed oop,
+ // i.e. will grab into the base of the heap if it represents NULL.
+ static bool accesses_heap_base_zone(Node *val) {
+-  if (Universe::narrow_oop_base() > 0) { // Implies UseCompressedOops.
++  if (Universe::narrow_oop_base() > (address)0) { // Implies UseCompressedOops.
+     if (val && val->is_Mach()) {
+       if (val->as_Mach()->ideal_Opcode() == Op_DecodeN) {
+         // This assumes all Decodes with TypePtr::NotNull are matched to nodes that
+--- openjdk.orig/hotspot/src/share/vm/runtime/virtualspace.cpp
++++ openjdk/hotspot/src/share/vm/runtime/virtualspace.cpp
+@@ -527,7 +527,7 @@ ReservedHeapSpace::ReservedHeapSpace(siz
+                 (UseCompressedOops && (Universe::narrow_oop_base() != NULL) &&
+                  Universe::narrow_oop_use_implicit_null_checks()) ?
+                   lcm(os::vm_page_size(), alignment) : 0) {
+-  if (base() > 0) {
++  if (base() > (char*)0) {
+     MemTracker::record_virtual_memory_type((address)base(), mtJavaHeap);
+   }
+ 
+@@ -546,7 +546,7 @@ ReservedHeapSpace::ReservedHeapSpace(con
+                 (UseCompressedOops && (Universe::narrow_oop_base() != NULL) &&
+                  Universe::narrow_oop_use_implicit_null_checks()) ?
+                   lcm(os::vm_page_size(), prefix_align) : 0) {
+-  if (base() > 0) {
++  if (base() > (char*)0) {
+     MemTracker::record_virtual_memory_type((address)base(), mtJavaHeap);
+   }
+ 

From 55f8202dfe18bb857012293a6919e44bbfaf1e70 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 23:30:16 -0700
Subject: [PATCH 20/52] libunique1: relax warnings for gcc12

---
 srcpkgs/libunique1/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/libunique1/template b/srcpkgs/libunique1/template
index f73931b0c72b..c5a0f5c27860 100644
--- a/srcpkgs/libunique1/template
+++ b/srcpkgs/libunique1/template
@@ -15,7 +15,7 @@ homepage="https://wiki.gnome.org/Attic/LibUnique"
 distfiles="${GNOME_SITE}/libunique/1.1/libunique-${version}.tar.bz2"
 checksum=e5c8041cef8e33c55732f06a292381cb345db946cf792a4ae18aa5c66cdd4fbb
 
-CFLAGS="-Wno-deprecated-declarations"
+CFLAGS="-Wno-deprecated-declarations -Wno-incompatible-pointer-types"
 
 # Package build options
 build_options="gir"

From 05fba311f98eaffa9d25ad90a2774ff8427b3af3 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:39:52 -0700
Subject: [PATCH 21/52] libvirt: fix build for glibc 2.36

---
 .../patches/lxc-fix-compat-glibc-2.36.patch   | 34 ++++++++++++++++
 .../virfile-fix-compat-glibc-2.36.patch       | 39 +++++++++++++++++++
 2 files changed, 73 insertions(+)
 create mode 100644 srcpkgs/libvirt/patches/lxc-fix-compat-glibc-2.36.patch
 create mode 100644 srcpkgs/libvirt/patches/virfile-fix-compat-glibc-2.36.patch

diff --git a/srcpkgs/libvirt/patches/lxc-fix-compat-glibc-2.36.patch b/srcpkgs/libvirt/patches/lxc-fix-compat-glibc-2.36.patch
new file mode 100644
index 000000000000..d85b57815010
--- /dev/null
+++ b/srcpkgs/libvirt/patches/lxc-fix-compat-glibc-2.36.patch
@@ -0,0 +1,34 @@
+From 9493c9b79dc541ec9e0fd73c6d87bdf8d30aaa90 Mon Sep 17 00:00:00 2001
+From: Cole Robinson <crobinso@redhat.com>
+Date: Mon, 1 Aug 2022 15:20:38 -0400
+Subject: [PATCH] lxc: containter: fix build with glibc 2.36
+
+With glibc 2.36, sys/mount.h and linux/mount.h conflict:
+https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
+
+lxc_container.c imports sys/mount.h and linux/fs.h, which pulls in
+linux/mount.h.
+
+linux/fs.h isn't required here though. glibc sys/mount.h has had
+MS_MOVE since 2.12 in 2010
+
+Reviewed-by: Erik Skultety <eskultet@redhat.com>
+Signed-off-by: Cole Robinson <crobinso@redhat.com>
+---
+ src/lxc/lxc_container.c | 3 ---
+ 1 file changed, 3 deletions(-)
+
+diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
+index b5278831da7..a5401c2186e 100644
+--- a/src/lxc/lxc_container.c
++++ b/src/lxc/lxc_container.c
+@@ -33,9 +33,6 @@
+ /* Yes, we want linux private one, for _syscall2() macro */
+ #include <linux/unistd.h>
+ 
+-/* For MS_MOVE */
+-#include <linux/fs.h>
+-
+ #if WITH_CAPNG
+ # include <cap-ng.h>
+ #endif
diff --git a/srcpkgs/libvirt/patches/virfile-fix-compat-glibc-2.36.patch b/srcpkgs/libvirt/patches/virfile-fix-compat-glibc-2.36.patch
new file mode 100644
index 000000000000..2ef227ea9b54
--- /dev/null
+++ b/srcpkgs/libvirt/patches/virfile-fix-compat-glibc-2.36.patch
@@ -0,0 +1,39 @@
+From c0d9adf220dc0d223330a7bac37b174132d330ba Mon Sep 17 00:00:00 2001
+From: Cole Robinson <crobinso@redhat.com>
+Date: Mon, 1 Aug 2022 15:24:01 -0400
+Subject: [PATCH] virfile: Fix build with glibc 2.36
+
+With glibc 2.36, sys/mount.h and linux/mount.h conflict:
+https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
+
+virfile.c imports sys/mount.h and linux/fs.h, which pulls in
+linux/mount.h.
+
+Manually define the constants we need from linux/fs.h, like was
+done in llvm:
+
+https://reviews.llvm.org/rGb379129c4beb3f26223288627a1291739f33af02
+
+Reviewed-by: Erik Skultety <eskultet@redhat.com>
+Signed-off-by: Cole Robinson <crobinso@redhat.com>
+---
+ src/util/virfile.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/src/util/virfile.c b/src/util/virfile.c
+index 99da058db3b..ce541b8946b 100644
+--- a/src/util/virfile.c
++++ b/src/util/virfile.c
+@@ -71,7 +71,11 @@
+ # endif
+ # include <sys/ioctl.h>
+ # include <linux/cdrom.h>
+-# include <linux/fs.h>
++/* These come from linux/fs.h, but that header conflicts with
++ * sys/mount.h on glibc 2.36+ */
++# define FS_IOC_GETFLAGS _IOR('f', 1, long)
++# define FS_IOC_SETFLAGS _IOW('f', 2, long)
++# define FS_NOCOW_FL 0x00800000
+ #endif
+ 
+ #if WITH_LIBATTR

From 089cc7ffa03b53034ce8cd41698278f03bd247ac Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:41:50 -0700
Subject: [PATCH 22/52] efivar: fix build for glibc 2.36

---
 .../patches/fix-compat-glibc-2.36.patch       | 55 +++++++++++++++++++
 1 file changed, 55 insertions(+)
 create mode 100644 srcpkgs/efivar/patches/fix-compat-glibc-2.36.patch

diff --git a/srcpkgs/efivar/patches/fix-compat-glibc-2.36.patch b/srcpkgs/efivar/patches/fix-compat-glibc-2.36.patch
new file mode 100644
index 000000000000..fcc83aef20cf
--- /dev/null
+++ b/srcpkgs/efivar/patches/fix-compat-glibc-2.36.patch
@@ -0,0 +1,55 @@
+From bc65d63ebf8fe6ac8a099ff15ca200986dba1565 Mon Sep 17 00:00:00 2001
+From: Robbie Harwood <rharwood@redhat.com>
+Date: Thu, 28 Jul 2022 16:11:24 -0400
+Subject: [PATCH] Fix glibc 2.36 build (mount.h conflicts)
+
+glibc has decided that sys/mount.h and linux/mount.h are no longer
+usable at the same time.  This broke the build, since linux/fs.h itself
+includes linux/mount.h.  For now, fix the build by only including
+sys/mount.h where we need it.
+
+See-also: https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
+Resolves: #227
+Signed-off-by: Robbie Harwood <rharwood@redhat.com>
+---
+ src/gpt.c   | 1 +
+ src/linux.c | 1 +
+ src/util.h  | 1 -
+ 3 files changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/gpt.c b/src/gpt.c
+index 1eda0497..21413c3b 100644
+--- a/src/gpt.c
++++ b/src/gpt.c
+@@ -17,6 +17,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <sys/mount.h>
+ #include <sys/param.h>
+ #include <sys/stat.h>
+ #include <sys/utsname.h>
+diff --git a/src/linux.c b/src/linux.c
+index 47e45ae4..1780816f 100644
+--- a/src/linux.c
++++ b/src/linux.c
+@@ -20,6 +20,7 @@
+ #include <stdbool.h>
+ #include <stdio.h>
+ #include <sys/ioctl.h>
++#include <sys/mount.h>
+ #include <sys/socket.h>
+ #include <sys/sysmacros.h>
+ #include <sys/types.h>
+diff --git a/src/util.h b/src/util.h
+index 3300666f..1e67e447 100644
+--- a/src/util.h
++++ b/src/util.h
+@@ -23,7 +23,6 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <sys/ioctl.h>
+-#include <sys/mount.h>
+ #include <sys/stat.h>
+ #include <sys/types.h>
+ #include <tgmath.h>

From 024afdb813e039426c992e3e1716eb171cb4a308 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:43:24 -0700
Subject: [PATCH 23/52] libwpd: fix build for gcc12

---
 srcpkgs/libwpd/patches/fix-compat-gcc12.patch | 11 +++++++++++
 1 file changed, 11 insertions(+)
 create mode 100644 srcpkgs/libwpd/patches/fix-compat-gcc12.patch

diff --git a/srcpkgs/libwpd/patches/fix-compat-gcc12.patch b/srcpkgs/libwpd/patches/fix-compat-gcc12.patch
new file mode 100644
index 000000000000..6ebce2463d16
--- /dev/null
+++ b/srcpkgs/libwpd/patches/fix-compat-gcc12.patch
@@ -0,0 +1,11 @@
+diff -rup libwpd-0.10.3.orig/src/lib/WPXTable.h libwpd-0.10.3/src/lib/WPXTable.h
+--- libwpd-0.10.3.orig/src/lib/WPXTable.h	2022-08-23 22:32:45.332593795 -0700
++++ libwpd-0.10.3/src/lib/WPXTable.h	2022-08-23 22:32:59.500651211 -0700
+@@ -37,6 +37,7 @@
+ #define _WPXTABLE_H
+ 
+ #include <vector>
++#include <cstddef>
+ 
+ struct WPXTableCell
+ {

From f4f0110c5c73d2abdd2a275878f87200bfcf770f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:44:07 -0700
Subject: [PATCH 24/52] grub: fix build for binutils 2.36

---
 .../patches/fix-compat-binutils-2.36.patch    | 96 +++++++++++++++++++
 srcpkgs/grub/template                         |  7 +-
 2 files changed, 102 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/grub/patches/fix-compat-binutils-2.36.patch

diff --git a/srcpkgs/grub/patches/fix-compat-binutils-2.36.patch b/srcpkgs/grub/patches/fix-compat-binutils-2.36.patch
new file mode 100644
index 000000000000..d92a91e3253e
--- /dev/null
+++ b/srcpkgs/grub/patches/fix-compat-binutils-2.36.patch
@@ -0,0 +1,96 @@
+From b98275138bf4fc250a1c362dfd2c8b1cf2421701 Mon Sep 17 00:00:00 2001
+From: Michael Chang <mchang@suse.com>
+Date: Tue, 28 Sep 2021 13:50:47 +0800
+Subject: build: Fix build error with binutils 2.36
+
+The following procedure to build xen/pvgrub is broken.
+
+  git clone https://git.savannah.gnu.org/git/grub.git
+  cd grub
+  ./bootstrap
+  mkdir build-xen
+  cd build-xen
+  ../configure --with-platform=xen
+  make
+
+It fails with the message:
+
+  /usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld:
+  section .note.gnu.property VMA [0000000000400158,0000000000400187]
+  overlaps section .bss VMA [000000000000f000,000000000041e1af]
+
+The most significant factor is that new assembler (GNU as) generates the
+.note.gnu.property section as default. This note section overlaps with
+.bss because it doesn't reposition with -Wl,-Ttext,0 with which the base
+address of .text section is set, rather the address of .note.gnu.property
+is calculated for some reason from 0x400000 where the ELF executable
+defaults to start.
+
+Using -Ttext-segment doesn't help either, though it is said to set the
+address of the first byte of the text segment according to "man ld".
+What it actually does is to override the default 0x400000, aka the image
+base address, to something else. The entire process can be observed in
+the default linker script used by gcc [1]. Therefore we can't expect it
+to achieve the same thing as -Ttext given that the first segment where
+.text resides is offset by SIZEOF_HEADERS plus some sections may be
+preceding it within the first segment. The end result is .text always
+has to start with non-zero address with -Wl,-Ttext-segment,0 if using
+default linker script.
+
+It is also worth mentioning that binutils upstream apparently doesn't
+seem to consider this as a bug [2] and proposed to use -Wl,-Ttext-segment,0
+which is not fruitful as what has been tested by Gentoo [3].
+
+As long as GRUB didn't use ISA information encoded in .note.gnu.property,
+we can safely drop it via -Wa,-mx86-used-note=no assembler option to
+fix the linker error above.
+
+This is considered a better approach than using custom linker script to
+drop the .note.gnu.property section because object file manipulation can
+also be hampered one way or the other in that linker script may not be
+helpful. See also this commit removing the section in the process of objcopy.
+
+  6643507ce build: Fix GRUB i386-pc build with Ubuntu gcc
+
+[1] In /usr/lib64/ldscripts/elf_x86_64.x or use 'gcc -Wl,--verbose ...'
+    PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x400000));
+    . = SEGMENT_START("text-segment", 0x400000) + SIZEOF_HEADERS;
+[2] https://sourceware.org/bugzilla/show_bug.cgi?id=27377
+[3] https://bugs.gentoo.org/787221
+
+Signed-off-by: Michael Chang <mchang@suse.com>
+Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
+---
+ configure.ac | 14 ++++++++++++++
+ 1 file changed, 14 insertions(+)
+
+(limited to 'configure.ac')
+
+diff --git a/configure.ac b/configure.ac
+index eeb5d22..8d1c81a 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -840,6 +840,20 @@ if ( test "x$target_cpu" = xi386 || test "x$target_cpu" = xx86_64 ) && test "x$p
+   TARGET_CFLAGS="$TARGET_CFLAGS -mno-mmx -mno-sse -mno-sse2 -mno-sse3 -mno-3dnow"
+ fi
+ 
++if ( test "x$target_cpu" = xi386 || test "x$target_cpu" = xx86_64 ); then
++  AC_CACHE_CHECK([whether -Wa,-mx86-used-note works], [grub_cv_cc_mx86_used_note], [
++    CFLAGS="$TARGET_CFLAGS -Wa,-mx86-used-note=no -Werror"
++    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
++	[grub_cv_cc_mx86_used_note=yes],
++	[grub_cv_cc_mx86_used_note=no])
++  ])
++
++  if test "x$grub_cv_cc_mx86_used_note" = xyes; then
++    TARGET_CFLAGS="$TARGET_CFLAGS -Wa,-mx86-used-note=no"
++    TARGET_CCASFLAGS="$TARGET_CCASFLAGS -Wa,-mx86-used-note=no"
++  fi
++fi
++
+ # GRUB doesn't use float or doubles at all. Yet some toolchains may decide
+ # that floats are a good fit to run instead of what's written in the code.
+ # Given that floating point unit is disabled (if present to begin with)
+-- 
+cgit v1.1
+
diff --git a/srcpkgs/grub/template b/srcpkgs/grub/template
index b1826c38a884..b4d3b07af620 100644
--- a/srcpkgs/grub/template
+++ b/srcpkgs/grub/template
@@ -2,7 +2,8 @@
 pkgname=grub
 version=2.06
 revision=2
-hostmakedepends="python3 pkg-config flex freetype-devel font-unifont-bdf help2man"
+hostmakedepends="python3 pkg-config flex freetype-devel font-unifont-bdf help2man
+ automake gettext-devel-tools"
 makedepends="libusb-compat-devel ncurses-devel freetype-devel
  liblzma-devel device-mapper-devel fuse-devel"
 depends="os-prober"
@@ -43,6 +44,10 @@ case "$XBPS_TARGET_MACHINE" in
 		;;
 esac
 
+pre_configure() {
+	autoreconf -fi
+}
+
 do_configure() {
 	# workaround for https://savannah.gnu.org/bugs/?60458
 	# some more info: https://www.linuxquestions.org/questions/showthread.php?p=6257712

From 94b7df2a59e4a7051d7554e1d052e18bd78ca9de Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:45:07 -0700
Subject: [PATCH 25/52] linux-toos: fix build for binutils 2.39

---
 .../patches/binutils-add-compat-check.patch   | 103 ++++++++++++
 .../patches/binutils-disasm-compat.patch      | 102 ++++++++++++
 .../bpf_jit_disasm-binutils-2.39.patch        | 104 ++++++++++++
 .../patches/bpftool-binutils-2.39.patch       | 149 ++++++++++++++++++
 .../patches/perf-binutils-2.39.patch          | 114 ++++++++++++++
 5 files changed, 572 insertions(+)
 create mode 100644 srcpkgs/linux-tools/patches/binutils-add-compat-check.patch
 create mode 100644 srcpkgs/linux-tools/patches/binutils-disasm-compat.patch
 create mode 100644 srcpkgs/linux-tools/patches/bpf_jit_disasm-binutils-2.39.patch
 create mode 100644 srcpkgs/linux-tools/patches/bpftool-binutils-2.39.patch
 create mode 100644 srcpkgs/linux-tools/patches/perf-binutils-2.39.patch

diff --git a/srcpkgs/linux-tools/patches/binutils-add-compat-check.patch b/srcpkgs/linux-tools/patches/binutils-add-compat-check.patch
new file mode 100644
index 000000000000..e4e7ece9635e
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/binutils-add-compat-check.patch
@@ -0,0 +1,103 @@
+From cfd59ca91467056bb2c36907b2fa67b8e1af9952 Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:27 -0700
+Subject: [PATCH] tools build: Add feature test for init_disassemble_info API
+ changes
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation failures for tools/{perf,bpf}, e.g. on debian unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+This commit adds a feature test to detect the new signature.  Subsequent
+commits will use it to fix the build failures.
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Quentin Monnet <quentin@isovalent.com>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-2-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/build/Makefile.feature                        |  1 +
+ tools/build/feature/Makefile                        |  4 ++++
+ tools/build/feature/test-all.c                      |  4 ++++
+ tools/build/feature/test-disassembler-init-styled.c | 13 +++++++++++++
+ 4 files changed, 22 insertions(+)
+ create mode 100644 tools/build/feature/test-disassembler-init-styled.c
+
+diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature
+index 888a0421d43b96..8f6578e4d3249e 100644
+--- a/tools/build/Makefile.feature
++++ b/tools/build/Makefile.feature
+@@ -70,6 +70,7 @@ FEATURE_TESTS_BASIC :=                  \
+         libaio				\
+         libzstd				\
+         disassembler-four-args		\
++        disassembler-init-styled	\
+         file-handle
+ 
+ # FEATURE_TESTS_BASIC + FEATURE_TESTS_EXTRA is the complete list
+diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile
+index 7c2a17e23c30ac..c3059739318a95 100644
+--- a/tools/build/feature/Makefile
++++ b/tools/build/feature/Makefile
+@@ -18,6 +18,7 @@ FILES=                                          \
+          test-libbfd.bin                        \
+          test-libbfd-buildid.bin		\
+          test-disassembler-four-args.bin        \
++         test-disassembler-init-styled.bin	\
+          test-reallocarray.bin			\
+          test-libbfd-liberty.bin                \
+          test-libbfd-liberty-z.bin              \
+@@ -248,6 +249,9 @@ $(OUTPUT)test-libbfd-buildid.bin:
+ $(OUTPUT)test-disassembler-four-args.bin:
+ 	$(BUILD) -DPACKAGE='"perf"' -lbfd -lopcodes
+ 
++$(OUTPUT)test-disassembler-init-styled.bin:
++	$(BUILD) -DPACKAGE='"perf"' -lbfd -lopcodes
++
+ $(OUTPUT)test-reallocarray.bin:
+ 	$(BUILD)
+ 
+diff --git a/tools/build/feature/test-all.c b/tools/build/feature/test-all.c
+index 5ffafb967b6e49..957c02c7b163b5 100644
+--- a/tools/build/feature/test-all.c
++++ b/tools/build/feature/test-all.c
+@@ -166,6 +166,10 @@
+ # include "test-disassembler-four-args.c"
+ #undef main
+ 
++#define main main_test_disassembler_init_styled
++# include "test-disassembler-init-styled.c"
++#undef main
++
+ #define main main_test_libzstd
+ # include "test-libzstd.c"
+ #undef main
+diff --git a/tools/build/feature/test-disassembler-init-styled.c b/tools/build/feature/test-disassembler-init-styled.c
+new file mode 100644
+index 00000000000000..f1ce0ec3bee9d3
+--- /dev/null
++++ b/tools/build/feature/test-disassembler-init-styled.c
+@@ -0,0 +1,13 @@
++// SPDX-License-Identifier: GPL-2.0
++#include <stdio.h>
++#include <dis-asm.h>
++
++int main(void)
++{
++	struct disassemble_info info;
++
++	init_disassemble_info(&info, stdout,
++			      NULL, NULL);
++
++	return 0;
++}
diff --git a/srcpkgs/linux-tools/patches/binutils-disasm-compat.patch b/srcpkgs/linux-tools/patches/binutils-disasm-compat.patch
new file mode 100644
index 000000000000..1a6cc0e6d97c
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/binutils-disasm-compat.patch
@@ -0,0 +1,102 @@
+From a45b3d6926231c3d024ea0de4f7bd967f83709ee Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:29 -0700
+Subject: tools include: add dis-asm-compat.h to handle version differences
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation failures for tools/{perf,bpf}, e.g. on debian unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+This commit introduces a wrapper for init_disassemble_info(), to avoid
+spreading #ifdef DISASM_INIT_STYLED to a bunch of places. Subsequent
+commits will use it to fix the build failures.
+
+It likely is worth adding a wrapper for disassember(), to avoid the already
+existing DISASM_FOUR_ARGS_SIGNATURE ifdefery.
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Signed-off-by: Ben Hutchings <benh@debian.org>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Quentin Monnet <quentin@isovalent.com>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-4-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/include/tools/dis-asm-compat.h | 55 ++++++++++++++++++++++++++++++++++++
+ 1 file changed, 55 insertions(+)
+ create mode 100644 tools/include/tools/dis-asm-compat.h
+
+(limited to 'tools/include/tools/dis-asm-compat.h')
+
+diff --git a/tools/include/tools/dis-asm-compat.h b/tools/include/tools/dis-asm-compat.h
+new file mode 100644
+index 0000000000000..70f331e23ed3d
+--- /dev/null
++++ b/tools/include/tools/dis-asm-compat.h
+@@ -0,0 +1,55 @@
++/* SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause */
++#ifndef _TOOLS_DIS_ASM_COMPAT_H
++#define _TOOLS_DIS_ASM_COMPAT_H
++
++#include <stdio.h>
++#include <dis-asm.h>
++
++/* define types for older binutils version, to centralize ifdef'ery a bit */
++#ifndef DISASM_INIT_STYLED
++enum disassembler_style {DISASSEMBLER_STYLE_NOT_EMPTY};
++typedef int (*fprintf_styled_ftype) (void *, enum disassembler_style, const char*, ...);
++#endif
++
++/*
++ * Trivial fprintf wrapper to be used as the fprintf_styled_func argument to
++ * init_disassemble_info_compat() when normal fprintf suffices.
++ */
++static inline int fprintf_styled(void *out,
++				 enum disassembler_style style,
++				 const char *fmt, ...)
++{
++	va_list args;
++	int r;
++
++	(void)style;
++
++	va_start(args, fmt);
++	r = vfprintf(out, fmt, args);
++	va_end(args);
++
++	return r;
++}
++
++/*
++ * Wrapper for init_disassemble_info() that hides version
++ * differences. Depending on binutils version and architecture either
++ * fprintf_func or fprintf_styled_func will be called.
++ */
++static inline void init_disassemble_info_compat(struct disassemble_info *info,
++						void *stream,
++						fprintf_ftype unstyled_func,
++						fprintf_styled_ftype styled_func)
++{
++#ifdef DISASM_INIT_STYLED
++	init_disassemble_info(info, stream,
++			      unstyled_func,
++			      styled_func);
++#else
++	(void)styled_func;
++	init_disassemble_info(info, stream,
++			      unstyled_func);
++#endif
++}
++
++#endif /* _TOOLS_DIS_ASM_COMPAT_H */
+-- 
+cgit 
+
diff --git a/srcpkgs/linux-tools/patches/bpf_jit_disasm-binutils-2.39.patch b/srcpkgs/linux-tools/patches/bpf_jit_disasm-binutils-2.39.patch
new file mode 100644
index 000000000000..01221fad3a4a
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/bpf_jit_disasm-binutils-2.39.patch
@@ -0,0 +1,104 @@
+From 96ed066054abf11c7d3e106e3011a51f3f1227a3 Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:31 -0700
+Subject: [PATCH] tools bpf_jit_disasm: Fix compilation error with new binutils
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation to fail for tools/bpf/bpf_jit_disasm.c, e.g. on debian
+unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+Wire up the feature test and switch to init_disassemble_info_compat(),
+which were introduced in prior commits, fixing the compilation failure.
+
+I verified that bpf_jit_disasm can still disassemble bpf programs, both
+with the old and new dis-asm.h API. With old binutils there's no change in
+output before/after this patch. When comparing the output from old
+binutils (2.35) to new bintuils with the patch (upstream snapshot) there
+are a few output differences, but they are unrelated to this patch. An
+example hunk is:
+
+     f4:	mov    %r14,%rsi
+     f7:	mov    %r15,%rdx
+     fa:	mov    $0x2a,%ecx
+  -  ff:	callq  0xffffffffea8c4988
+  +  ff:	call   0xffffffffea8c4988
+    104:	test   %rax,%rax
+    107:	jge    0x0000000000000110
+    109:	xor    %eax,%eax
+  - 10b:	jmpq   0x0000000000000073
+  + 10b:	jmp    0x0000000000000073
+    110:	cmp    $0x16,%rax
+
+However, I had to use an older kernel to generate the bpf_jit_enabled =
+2 output, as that has been broken since 5.18 / 1022a5498f6f745c ("bpf,
+x86_64: Use bpf_jit_binary_pack_alloc").
+
+  https://lore.kernel.org/20220703030210.pmjft7qc2eajzi6c@alap3.anarazel.de
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Daniel Borkmann <daniel@iogearbox.net>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Quentin Monnet <quentin@isovalent.com>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-6-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/bpf/Makefile         | 5 ++++-
+ tools/bpf/bpf_jit_disasm.c | 5 ++++-
+ 2 files changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/tools/bpf/Makefile b/tools/bpf/Makefile
+index b11cfc86a3d021..664601ab1705ab 100644
+--- a/tools/bpf/Makefile
++++ b/tools/bpf/Makefile
+@@ -34,7 +34,7 @@ else
+ endif
+ 
+ FEATURE_USER = .bpf
+-FEATURE_TESTS = libbfd disassembler-four-args
++FEATURE_TESTS = libbfd disassembler-four-args disassembler-init-styled
+ FEATURE_DISPLAY = libbfd disassembler-four-args
+ 
+ check_feat := 1
+@@ -56,6 +56,9 @@ endif
+ ifeq ($(feature-disassembler-four-args), 1)
+ CFLAGS += -DDISASM_FOUR_ARGS_SIGNATURE
+ endif
++ifeq ($(feature-disassembler-init-styled), 1)
++CFLAGS += -DDISASM_INIT_STYLED
++endif
+ 
+ $(OUTPUT)%.yacc.c: $(srctree)/tools/bpf/%.y
+ 	$(QUIET_BISON)$(YACC) -o $@ -d $<
+diff --git a/tools/bpf/bpf_jit_disasm.c b/tools/bpf/bpf_jit_disasm.c
+index c8ae9580472814..a90a5d110f9255 100644
+--- a/tools/bpf/bpf_jit_disasm.c
++++ b/tools/bpf/bpf_jit_disasm.c
+@@ -28,6 +28,7 @@
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <limits.h>
++#include <tools/dis-asm-compat.h>
+ 
+ #define CMD_ACTION_SIZE_BUFFER		10
+ #define CMD_ACTION_READ_ALL		3
+@@ -64,7 +65,9 @@ static void get_asm_insns(uint8_t *image, size_t len, int opcodes)
+ 	assert(bfdf);
+ 	assert(bfd_check_format(bfdf, bfd_object));
+ 
+-	init_disassemble_info(&info, stdout, (fprintf_ftype) fprintf);
++	init_disassemble_info_compat(&info, stdout,
++				     (fprintf_ftype) fprintf,
++				     fprintf_styled);
+ 	info.arch = bfd_get_arch(bfdf);
+ 	info.mach = bfd_get_mach(bfdf);
+ 	info.buffer = image;
diff --git a/srcpkgs/linux-tools/patches/bpftool-binutils-2.39.patch b/srcpkgs/linux-tools/patches/bpftool-binutils-2.39.patch
new file mode 100644
index 000000000000..1e55c40011be
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/bpftool-binutils-2.39.patch
@@ -0,0 +1,149 @@
+From 600b7b26c07a070d0153daa76b3806c1e52c9e00 Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:33 -0700
+Subject: [PATCH] tools bpftool: Fix compilation error with new binutils
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation to fail for tools/bpf/bpftool/jit_disasm.c, e.g. on debian
+unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+Wire up the feature test and switch to init_disassemble_info_compat(),
+which were introduced in prior commits, fixing the compilation failure.
+
+I verified that bpftool can still disassemble bpf programs, both with an
+old and new dis-asm.h API. There are no output changes for plain and json
+formats. When comparing the output from old binutils (2.35)
+to new bintuils with the patch (upstream snapshot) there are a few output
+differences, but they are unrelated to this patch. An example hunk is:
+
+     2f:	pop    %r14
+     31:	pop    %r13
+     33:	pop    %rbx
+  -  34:	leaveq
+  -  35:	retq
+  +  34:	leave
+  +  35:	ret
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Quentin Monnet <quentin@isovalent.com>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-8-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/bpf/bpftool/Makefile     |  5 +++-
+ tools/bpf/bpftool/jit_disasm.c | 42 +++++++++++++++++++++++++++-------
+ 2 files changed, 38 insertions(+), 9 deletions(-)
+
+diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile
+index c6d2c77d02524a..436e671b2657d4 100644
+--- a/tools/bpf/bpftool/Makefile
++++ b/tools/bpf/bpftool/Makefile
+@@ -62,7 +62,7 @@ CLANG ?= clang
+ LLVM_STRIP ?= llvm-strip
+ 
+ FEATURE_USER = .bpftool
+-FEATURE_TESTS = libbfd disassembler-four-args reallocarray zlib libcap \
++FEATURE_TESTS = libbfd disassembler-four-args disassembler-init-styled reallocarray zlib libcap \
+ 	clang-bpf-co-re
+ FEATURE_DISPLAY = libbfd disassembler-four-args zlib libcap \
+ 	clang-bpf-co-re
+@@ -117,6 +117,9 @@ endif
+ ifeq ($(feature-disassembler-four-args), 1)
+ CFLAGS += -DDISASM_FOUR_ARGS_SIGNATURE
+ endif
++ifeq ($(feature-disassembler-init-styled), 1)
++    CFLAGS += -DDISASM_INIT_STYLED
++endif
+ 
+ LIBS = $(LIBBPF) -lelf -lz
+ LIBS_BOOTSTRAP = $(LIBBPF_BOOTSTRAP) -lelf -lz
+diff --git a/tools/bpf/bpftool/jit_disasm.c b/tools/bpf/bpftool/jit_disasm.c
+index 24734f2249d6ec..aaf99a0168c90b 100644
+--- a/tools/bpf/bpftool/jit_disasm.c
++++ b/tools/bpf/bpftool/jit_disasm.c
+@@ -24,6 +24,7 @@
+ #include <sys/stat.h>
+ #include <limits.h>
+ #include <bpf/libbpf.h>
++#include <tools/dis-asm-compat.h>
+ 
+ #include "json_writer.h"
+ #include "main.h"
+@@ -39,15 +40,12 @@ static void get_exec_path(char *tpath, s
+ }
+ 
+ static int oper_count;
+-static int fprintf_json(void *out, const char *fmt, ...)
++static int printf_json(void *out, const char *fmt, va_list ap)
+ {
+-	va_list ap;
+ 	char *s;
+ 
+-	va_start(ap, fmt);
+ 	if (vasprintf(&s, fmt, ap) < 0)
+ 		return -1;
+-	va_end(ap);
+ 
+ 	if (!oper_count) {
+ 		int i;
+@@ -73,6 +71,32 @@ static int fprintf_json(void *out, const char *fmt, ...)
+ 	return 0;
+ }
+ 
++static int fprintf_json(void *out, const char *fmt, ...)
++{
++	va_list ap;
++	int r;
++
++	va_start(ap, fmt);
++	r = printf_json(out, fmt, ap);
++	va_end(ap);
++
++	return r;
++}
++
++static int fprintf_json_styled(void *out,
++			       enum disassembler_style style __maybe_unused,
++			       const char *fmt, ...)
++{
++	va_list ap;
++	int r;
++
++	va_start(ap, fmt);
++	r = printf_json(out, fmt, ap);
++	va_end(ap);
++
++	return r;
++}
++
+ void disasm_print_insn(unsigned char *image, ssize_t len, int opcodes,
+ 		       const char *arch, const char *disassembler_options,
+ 		       const struct btf *btf,
+@@ -99,11 +123,13 @@ void disasm_print_insn(unsigned char *image, ssize_t len, int opcodes,
+ 	assert(bfd_check_format(bfdf, bfd_object));
+ 
+ 	if (json_output)
+-		init_disassemble_info(&info, stdout,
+-				      (fprintf_ftype) fprintf_json);
++		init_disassemble_info_compat(&info, stdout,
++					     (fprintf_ftype) fprintf_json,
++					     fprintf_json_styled);
+ 	else
+-		init_disassemble_info(&info, stdout,
+-				      (fprintf_ftype) fprintf);
++		init_disassemble_info_compat(&info, stdout,
++					     (fprintf_ftype) fprintf,
++					     fprintf_styled);
+ 
+ 	/* Update architecture info for offload. */
+ 	if (arch) {
diff --git a/srcpkgs/linux-tools/patches/perf-binutils-2.39.patch b/srcpkgs/linux-tools/patches/perf-binutils-2.39.patch
new file mode 100644
index 000000000000..3484330f7286
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/perf-binutils-2.39.patch
@@ -0,0 +1,114 @@
+From 83aa0120487e8bc3f231e72c460add783f71f17c Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:30 -0700
+Subject: [PATCH] tools perf: Fix compilation error with new binutils
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation failures for tools/perf/util/annotate.c, e.g. on debian
+unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+Wire up the feature test and switch to init_disassemble_info_compat(),
+which were introduced in prior commits, fixing the compilation failure.
+
+I verified that perf can still disassemble bpf programs by using bpftrace
+under load, recording a perf trace, and then annotating the bpf "function"
+with and without the changes. With old binutils there's no change in output
+before/after this patch. When comparing the output from old binutils (2.35)
+to new bintuils with the patch (upstream snapshot) there are a few output
+differences, but they are unrelated to this patch. An example hunk is:
+
+       1.15 :   55:mov    %rbp,%rdx
+       0.00 :   58:add    $0xfffffffffffffff8,%rdx
+       0.00 :   5c:xor    %ecx,%ecx
+  -    1.03 :   5e:callq  0xffffffffe12aca3c
+  +    1.03 :   5e:call   0xffffffffe12aca3c
+       0.00 :   63:xor    %eax,%eax
+  -    2.18 :   65:leaveq
+  -    2.82 :   66:retq
+  +    2.18 :   65:leave
+  +    2.82 :   66:ret
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-5-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/perf/Makefile.config | 8 ++++++++
+ tools/perf/util/annotate.c | 7 ++++---
+ 2 files changed, 12 insertions(+), 3 deletions(-)
+
+diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
+index d3c254c0f5c611..23648ea54e8d3d 100644
+--- a/tools/perf/Makefile.config
++++ b/tools/perf/Makefile.config
+@@ -298,6 +298,7 @@ FEATURE_CHECK_LDFLAGS-libpython := $(PYTHON_EMBED_LDOPTS)
+ FEATURE_CHECK_LDFLAGS-libaio = -lrt
+ 
+ FEATURE_CHECK_LDFLAGS-disassembler-four-args = -lbfd -lopcodes -ldl
++FEATURE_CHECK_LDFLAGS-disassembler-init-styled = -lbfd -lopcodes -ldl
+ 
+ CORE_CFLAGS += -fno-omit-frame-pointer
+ CORE_CFLAGS += -ggdb3
+@@ -818,13 +819,16 @@ else
+   ifeq ($(feature-libbfd-liberty), 1)
+     EXTLIBS += -lbfd -lopcodes -liberty
+     FEATURE_CHECK_LDFLAGS-disassembler-four-args += -liberty -ldl
++    FEATURE_CHECK_LDFLAGS-disassembler-init-styled += -liberty -ldl
+   else
+     ifeq ($(feature-libbfd-liberty-z), 1)
+       EXTLIBS += -lbfd -lopcodes -liberty -lz
+       FEATURE_CHECK_LDFLAGS-disassembler-four-args += -liberty -lz -ldl
++      FEATURE_CHECK_LDFLAGS-disassembler-init-styled += -liberty -lz -ldl
+     endif
+   endif
+   $(call feature_check,disassembler-four-args)
++  $(call feature_check,disassembler-init-styled)
+ endif
+ 
+ ifeq ($(feature-libbfd-buildid), 1)
+@@ -1044,6 +1048,10 @@ ifeq ($(feature-disassembler-four-args), 1)
+     CFLAGS += -DDISASM_FOUR_ARGS_SIGNATURE
+ endif
+ 
++ifeq ($(feature-disassembler-init-styled), 1)
++    CFLAGS += -DDISASM_INIT_STYLED
++endif
++
+ ifeq (${IS_64_BIT}, 1)
+   ifndef NO_PERF_READ_VDSO32
+     $(call feature_check,compile-32)
+diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
+index 82cc396ef516c4..2c6a485c3de5d9 100644
+--- a/tools/perf/util/annotate.c
++++ b/tools/perf/util/annotate.c
+@@ -1676,6 +1676,7 @@ fallback:
+ #define PACKAGE "perf"
+ #include <bfd.h>
+ #include <dis-asm.h>
++#include <tools/dis-asm-compat.h>
+ 
+ static int symbol__disassemble_bpf(struct symbol *sym,
+ 				   struct annotate_args *args)
+@@ -1762,9 +1763,9 @@ static int symbol__disassemble_bpf(struct symbol *sym,
+ 		ret = errno;
+ 		goto out;
+ 	}
+-	init_disassemble_info(&info, s,
+-			      (fprintf_ftype) fprintf);
+-
++	init_disassemble_info_compat(&info, s,
++				     (fprintf_ftype) fprintf,
++				     fprintf_styled);
+ 	info.arch = bfd_get_arch(bfdf);
+ 	info.mach = bfd_get_mach(bfdf);
+ 

From 75acdae83aff851a0264eb8889f4dd7c1b4ed7b3 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 14:45:28 -0700
Subject: [PATCH 26/52] libsasl: fix build for libtool 2.4.7

---
 srcpkgs/libsasl/template | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/libsasl/template b/srcpkgs/libsasl/template
index a8817042f843..a2993b39f4a1 100644
--- a/srcpkgs/libsasl/template
+++ b/srcpkgs/libsasl/template
@@ -19,6 +19,7 @@ distfiles="https://github.com/cyrusimap/cyrus-sasl/releases/download/cyrus-sasl-
 checksum=26866b1549b00ffd020f188a43c258017fa1c382b3ddadd8201536f72efb05d5
 
 pre_configure() {
+	rm -f m4/ltversion.m4
 	autoreconf -fi
 }
 

From 6df59053363c8598d13ec3d371d3d73772be063e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:08 -0700
Subject: [PATCH 27/52] subversion: fix build for libtool 2.4.7

---
 srcpkgs/subversion/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion/template b/srcpkgs/subversion/template
index 8ad178264942..3f1c9e254e61 100644
--- a/srcpkgs/subversion/template
+++ b/srcpkgs/subversion/template
@@ -57,7 +57,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From 4c3ce55bc0da94b5919f2d9f7412ef86210a23c9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:38 -0700
Subject: [PATCH 28/52] subversion-kwallet-auth: fix build for libtool 2.4.7

---
 srcpkgs/subversion-kwallet-auth/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion-kwallet-auth/template b/srcpkgs/subversion-kwallet-auth/template
index 12210f250d51..b4d8621456ea 100644
--- a/srcpkgs/subversion-kwallet-auth/template
+++ b/srcpkgs/subversion-kwallet-auth/template
@@ -59,7 +59,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From 3563ed4f6e2ebb7ec68d8a03617bed95f5e95957 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 20:07:32 -0700
Subject: [PATCH 29/52] gpgme: update to 1.18.0.

---
 common/shlibs          | 2 +-
 srcpkgs/gpgme/template | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 52220e69706d..98017bdd5e3d 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -723,7 +723,7 @@ libdconf.so.1 dconf-0.13.90_1
 libassuan.so.0 libassuan-2.0.1_1
 libgpgme.so.11 libgpgme-1.12.0_2
 libgpgmepp.so.6 gpgmepp-1.7.0_3
-libqgpgme.so.7 gpgmeqt-1.7.0_3
+libqgpgme.so.15 gpgmeqt-1.18.0_1
 libgarcon-1.so.0 garcon-0.1.12_1
 libgarcon-gtk2-1.so.0 garcon-0.4.0_1
 libgarcon-gtk3-1.so.0 garcon-0.6.1_1
diff --git a/srcpkgs/gpgme/template b/srcpkgs/gpgme/template
index 8633075a8404..b1cfd5f78657 100644
--- a/srcpkgs/gpgme/template
+++ b/srcpkgs/gpgme/template
@@ -1,7 +1,7 @@
 # Template file for 'gpgme'
 pkgname=gpgme
-version=1.15.1
-revision=2
+version=1.18.0
+revision=1
 build_style=gnu-configure
 configure_args="--enable-fd-passing
  --with-libgpg-error-prefix=$XBPS_CROSS_BASE/usr
@@ -14,7 +14,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.gnupg.org/software/gpgme/index.html"
 distfiles="https://www.gnupg.org/ftp/gcrypt/gpgme/gpgme-${version}.tar.bz2"
-checksum=eebc3c1b27f1c8979896ff361ba9bb4778b508b2496c2fc10e3775a40b1de1ad
+checksum=361d4eae47ce925dba0ea569af40e7b52c645c4ae2e65e5621bf1b6cdd8b0e9e
 
 if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
 	configure_args+=" ac_cv_sys_file_offset_bits=no"

From 59c891de30660c1bf59d28d8d7060c6077f36628 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 30/52] cross-aarch64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..bd6b23f9fb6a 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 08f4a52a62cb1d4cfd371db82b6627803b9029b8 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 31/52] cross-aarch64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..427ad2c1e9cd 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From cf4a8bb0a9682879d86f7f5ef8b0badb331847b4 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 32/52] cross-arm-linux-gnueabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..2510ee26e789 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 638793666dc7184cb3776180612dc234412e00b6 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 33/52] cross-arm-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..bd8b16e1b4c1 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 0c3b0a82b22c01ce479c88f52d70535f755435ae Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 34/52] cross-arm-linux-musleabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..93145232d7cb 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 363937a1f21ddc64f308a7e68533e41c50041063 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 35/52] cross-arm-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..9ddd32a9f20d 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 34797536a36e7882ecf8430e9613cad56aeb0dc5 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 36/52] cross-armv7l-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..9fb00f18be3b 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 6896e2b8253b36604565ac457b649cab16f92607 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 37/52] cross-armv7l-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..2c72e75ddfe3 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 22a44f82d01433c6e194d8317418cddbacc765a6 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 38/52] cross-i686-pc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..4dc17df648b5 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 23b385f3f3bf96ce43b414bc4c00d6d5afbc76c0 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 39/52] cross-mips-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..6009e5c79eb2 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 9f1dbdbeb7013e63f577ec1d93b6da4007ce87e0 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 40/52] cross-mips-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..080164df193d 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="hipperson0 <hipperson0@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 2f17a2b77a4b59b567e748e01e6ccfcc9c102bb0 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 41/52] cross-mipsel-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..c8f90cfa43cc 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_musl_version=1.1.24
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From b2eba09939c035c86bfd67eaf797209580f8072d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 42/52] cross-mipsel-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..931345d2de15 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_musl_version=1.1.24
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From d6e2c3bd9b06b1fccdb2f6ce98fb1adb188cd82b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 43/52] cross-powerpc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..31e57b4e52b2 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 659a89632e233a1807e7def4827f204fde5f64c0 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 44/52] cross-powerpc-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..a2d1edcf1ffd 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From ec31f3fd8096dc2f43155af0d184f2176f20dec2 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 45/52] cross-powerpc64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..1a4cbed61e76 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 99cab939d5fa982d8b6e372776569623ee08b79e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 46/52] cross-powerpc64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 1ebd0fb2048d..ade42018af05 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From ececbd3f06ffa9d8535dc3ac5add36556968633d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 47/52] cross-powerpc64le-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 733f5851da5c..dd1ad383a21e 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 627c98d2085e1af3f5337152682c4b3a900ad381 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 48/52] cross-powerpc64le-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index 76a70aa1d6db..5887f845f932 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 88688f5f46abaca32f72e332a1495114f8794ffb Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 49/52] cross-powerpcle-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 347b8fcf4f55..06530e0d609b 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 27d30fb59973cbdd0112f1590314cb3caa1258e2 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:19 -0700
Subject: [PATCH 50/52] cross-powerpcle-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index ec9324ddaa99..e68c3962b49c 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From de072bb17201c9ad05ad66c0971c559036352767 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:19 -0700
Subject: [PATCH 51/52] cross-x86_64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 0078fbe7224b..7da85c14b62d 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 612c4f619f52060f1d52a48f950202b4739088f9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:19 -0700
Subject: [PATCH 52/52] cross-x86_64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..2811de0d3c2e 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.1.0
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (45 preceding siblings ...)
  2022-08-24 19:44 ` [PR PATCH] [Updated] " oreo639
@ 2022-08-24 20:43 ` oreo639
  2022-08-24 20:52 ` oreo639
                   ` (217 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-08-24 20:43 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5537 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.1.0
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.1.0

This PR depends on: https://github.com/void-linux/void-packages/pull/32330

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

Also, keep in mind that the libgo musl patch here will need to be updated once musl is updated:
https://github.com/void-linux/void-packages/pull/34902/files#diff-1f42a95b93c9550178ff1fbccbef2f47a72711df15c24c9472e2550076978129R163-R176

This is the updated patch for reference:
https://github.com/alpinelinux/aports/blob/8acb21b8ee881e7ab1c812d9a66a17d2501b8730/main/gcc/0049-libgo-adjust-name-of-union-in-sigevent-struct.patch

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/38817
- [x] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [ ] llvm https://github.com/void-linux/void-packages/pull/38694
- [ ] m4 https://github.com/void-linux/void-packages/pull/33730
- [ ] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [ ] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [ ] libvirt https://github.com/void-linux/void-packages/pull/38842
- [ ] syslinux https://github.com/void-linux/void-packages/pull/38876
- [ ] efivar https://github.com/void-linux/void-packages/pull/38874

Known packages that needed to be fixed/updated for gcc12:
- [ ] linux5.18 (in this PR)
- [ ] openssh https://github.com/void-linux/void-packages/pull/38849
- [ ] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [ ] doxygen https://github.com/void-linux/void-packages/pull/38846
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/38817
- [ ] libproxy https://github.com/void-linux/void-packages/pull/38818
- [ ] exempi https://github.com/void-linux/void-packages/pull/38820
- [ ] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [ ] gpgme https://github.com/void-linux/void-packages/pull/38825
- [ ] libunique1 https://github.com/void-linux/void-packages/pull/38848 or https://github.com/void-linux/void-packages/pull/38873
- [ ] libwpd https://github.com/void-linux/void-packages/pull/38878

Needs to be fixed/updated for binutils:
- [ ] grub https://github.com/void-linux/void-packages/pull/38875
- [ ] linux-tools https://github.com/void-linux/void-packages/pull/38877

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [x] kde
- [x] lxde
- [x] lxqt

You can test the ISOs here:
https://drive.google.com/drive/folders/1ix92CYSLUP-KWjLxltdgG4e8Nu2JCY5n?usp=sharing

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 168179 bytes --]

From 6ee5df42f68dd39de720e332049229c05238bf04 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 01/52] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 15 +++--
 3 files changed, 28 insertions(+), 113 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..4bdaee582d71 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkg-config"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -44,6 +45,12 @@ do_configure() {
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	case "$XBPS_TARGET_MACHINE" in
+		*-musl)
+			conf+=" --disable-gprofng"
+			;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"

From de492f622d1c9681b350358a203c0b9d5fc3d381 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 02/52] gcc: update to 12.2.0.

---
 common/shlibs                                 | 10 +--
 srcpkgs/gcc/files/gccgo-musl.patch            | 74 ++++---------------
 srcpkgs/gcc/files/libgnarl-musl.patch         | 18 ++---
 srcpkgs/gcc/files/libssp-musl.patch           | 10 +--
 srcpkgs/gcc/patches/libffi_gnulinux.patch     | 11 ---
 .../gcc/patches/libgcc-ibm128-no-tag.patch    | 10 ++-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |  2 +-
 srcpkgs/gcc/template                          | 25 +++----
 8 files changed, 52 insertions(+), 108 deletions(-)
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index f829ee12e80f..bde5320461ce 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.2.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.34 perl-5.34.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -848,8 +848,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.2.0_1
+libgnat-12.so libada-12.2.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1700,8 +1700,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.2.0_1
+libasan.so.8 libsanitizer-12.2.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..632ef951097b 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,17 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ a/libgo/go/runtime/os_linux.go
+@@ -363,9 +363,9 @@
+ 
+ 	var timerid int32
+ 	var sevp _sigevent
+-	sevp.sigev_notify = _SIGEV_THREAD_ID
++	sevp.sigev_notify = 4
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.sigev_notify_function))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..446741390d45 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,15 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
+version=12.2.0
+revision=1
 _patchver="${version%pre*}"
 _minorver="${_patchver%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 wrksrc=gcc-${version/pre/_pre}
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +19,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -396,7 +393,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}

From 86796b4ea69abe762b198571ad51500d6ddc3b25 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 03/52] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      |  6 ++--
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..08e35d466a44 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From 2ad1b5cfd4d996d62d663615c5c894dc539727b4 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 04/52] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 1a4e1ca3d594..b04268908c2e 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="q66 <daniel@octaforge.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From 5a29fe90555e559d5527a2510fdb39bb5e4f354c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 05/52] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 3 files changed, 55 insertions(+), 353 deletions(-)
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index bde5320461ce..52220e69706d 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From 22bb3ef108e466119251680b7ac00ae6ee1556d6 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 21:01:43 -0700
Subject: [PATCH 06/52] gcc-multilib: update to 12.2.0.

---
 srcpkgs/gcc-multilib/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index fcd25755aa75..1a26da26a991 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,16 +3,16 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _majorver="${version%.*}"
-wrksrc=gcc-${version/pre/_pre}
+wrksrc=gcc-${version}
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel

From 1e724a6afdea5116621bf20cd54ffc405f859ea5 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 16:22:03 -0700
Subject: [PATCH 07/52] llvm12: fix build for glibc 2.36

---
 .../compiler-rt-sanitizer-glibc-2.36.patch    | 59 +++++++++++++++++++
 1 file changed, 59 insertions(+)
 create mode 100644 srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch

diff --git a/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch b/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch
new file mode 100644
index 000000000000..e5f24dab8935
--- /dev/null
+++ b/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch
@@ -0,0 +1,59 @@
+From 9cf13067cb5088626ba7ee1ec4c42ec59c7995a0 Mon Sep 17 00:00:00 2001
+From: Fangrui Song <i@maskray.me>
+Date: Mon, 11 Jul 2022 12:53:34 -0700
+Subject: [PATCH] [sanitizer] Remove #include <linux/fs.h> to resolve
+ fsconfig_command/mount_attr conflict with glibc 2.36
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+It is generally not a good idea to mix usage of glibc headers and Linux UAPI
+headers (https://sourceware.org/glibc/wiki/Synchronizing_Headers). In glibc
+since 7eae6a91e9b1670330c9f15730082c91c0b1d570 (milestone: 2.36), sys/mount.h
+defines `fsconfig_command` which conflicts with linux/mount.h:
+
+    .../usr/include/linux/mount.h:95:6: error: redeclaration of ‘enum fsconfig_command’
+
+Remove #include <linux/fs.h> which pulls in linux/mount.h. Expand its 4 macros manually.
+Android sys/mount.h doesn't define BLKBSZGET and it still needs linux/fs.h.
+In the long term we should move Linux specific definitions to sanitizer_platform_limits_linux.cpp
+but this commit is easy to cherry pick into older compiler-rt releases.
+
+Fix https://github.com/llvm/llvm-project/issues/56421
+
+Reviewed By: #sanitizers, vitalybuka, zatrazz
+
+Differential Revision: https://reviews.llvm.org/D129471
+---
+ .../sanitizer_platform_limits_posix.cpp                | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+index 4bd425435d56d..3a94b260686f1 100644
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -73,7 +73,9 @@
+ #include <sys/vt.h>
+ #include <linux/cdrom.h>
+ #include <linux/fd.h>
++#if SANITIZER_ANDROID
+ #include <linux/fs.h>
++#endif
+ #include <linux/hdreg.h>
+ #include <linux/input.h>
+ #include <linux/ioctl.h>
+@@ -876,10 +878,10 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
+   unsigned IOCTL_EVIOCGPROP = IOCTL_NOT_PRESENT;
+   unsigned IOCTL_EVIOCSKEYCODE_V2 = IOCTL_NOT_PRESENT;
+ #endif
+-  unsigned IOCTL_FS_IOC_GETFLAGS = FS_IOC_GETFLAGS;
+-  unsigned IOCTL_FS_IOC_GETVERSION = FS_IOC_GETVERSION;
+-  unsigned IOCTL_FS_IOC_SETFLAGS = FS_IOC_SETFLAGS;
+-  unsigned IOCTL_FS_IOC_SETVERSION = FS_IOC_SETVERSION;
++  unsigned IOCTL_FS_IOC_GETFLAGS = _IOR('f', 1, long);
++  unsigned IOCTL_FS_IOC_GETVERSION = _IOR('v', 1, long);
++  unsigned IOCTL_FS_IOC_SETFLAGS = _IOW('f', 2, long);
++  unsigned IOCTL_FS_IOC_SETVERSION = _IOW('v', 2, long);
+   unsigned IOCTL_GIO_CMAP = GIO_CMAP;
+   unsigned IOCTL_GIO_FONT = GIO_FONT;
+   unsigned IOCTL_GIO_UNIMAP = GIO_UNIMAP;

From e6a8a2c53d73dbbec2ffc7a9a59337d3306f0041 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 17:21:40 -0700
Subject: [PATCH 08/52] m4: update to 1.4.19.

---
 srcpkgs/m4/patches/fix-glibc-2.27.patch | 167 ------------------------
 srcpkgs/m4/template                     |  12 +-
 2 files changed, 6 insertions(+), 173 deletions(-)
 delete mode 100644 srcpkgs/m4/patches/fix-glibc-2.27.patch

diff --git a/srcpkgs/m4/patches/fix-glibc-2.27.patch b/srcpkgs/m4/patches/fix-glibc-2.27.patch
deleted file mode 100644
index 59d33cff164d..000000000000
--- a/srcpkgs/m4/patches/fix-glibc-2.27.patch
+++ /dev/null
@@ -1,167 +0,0 @@
-From 4af4a4a71827c0bc5e0ec67af23edef4f15cee8e Mon Sep 17 00:00:00 2001
-From: Paul Eggert <eggert@cs.ucla.edu>
-Date: Mon, 5 Mar 2018 10:56:29 -0800
-Subject: [PATCH] fflush: adjust to glibc 2.28 libio.h removal
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Problem reported by Daniel P. Berrangé in:
-https://lists.gnu.org/r/bug-gnulib/2018-03/msg00000.html
-* lib/fbufmode.c (fbufmode):
-* lib/fflush.c (clear_ungetc_buffer_preserving_position)
-(disable_seek_optimization, rpl_fflush):
-* lib/fpending.c (__fpending):
-* lib/fpurge.c (fpurge):
-* lib/freadable.c (freadable):
-* lib/freadahead.c (freadahead):
-* lib/freading.c (freading):
-* lib/freadptr.c (freadptr):
-* lib/freadseek.c (freadptrinc):
-* lib/fseeko.c (fseeko):
-* lib/fseterr.c (fseterr):
-* lib/fwritable.c (fwritable):
-* lib/fwriting.c (fwriting):
-Check _IO_EOF_SEEN instead of _IO_ftrylockfile.
-* lib/stdio-impl.h (_IO_IN_BACKUP) [_IO_EOF_SEEN]:
-Define if not already defined.
-
-[yann.morin.1998@free.fr: partially backport from upstream gnulib]
-Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
-
----
- lib/fflush.c     |  6 +++---
- lib/fpending.c   |  2 +-
- lib/fpurge.c     |  2 +-
- lib/freadahead.c |  2 +-
- lib/freading.c   |  2 +-
- lib/fseeko.c     |  4 ++--
- lib/stdio-impl.h |  6 ++++++
- 7 files changed, 15 insertions(+), 9 deletions(-)
-
-diff --git a/lib/fflush.c b/build-aux/gnulib/lib/fflush.c
-index 983ade0ff..a6edfa105 100644
---- a/lib/fflush.c
-+++ b/lib/fflush.c
-@@ -33,7 +33,7 @@
- #undef fflush
- 
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- 
- /* Clear the stream's ungetc buffer, preserving the value of ftello (fp).  */
- static void
-@@ -72,7 +72,7 @@ clear_ungetc_buffer (FILE *fp)
- 
- #endif
- 
--#if ! (defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
-+#if ! (defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
- 
- # if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT
- /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
-@@ -148,7 +148,7 @@ rpl_fflush (FILE *stream)
-   if (stream == NULL || ! freading (stream))
-     return fflush (stream);
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- 
-   clear_ungetc_buffer_preserving_position (stream);
- 
-diff --git a/lib/fpending.c b/build-aux/gnulib/lib/fpending.c
-index c84e3a5b4..789f50e4e 100644
---- a/lib/fpending.c
-+++ b/lib/fpending.c
-@@ -32,7 +32,7 @@ __fpending (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   return fp->_IO_write_ptr - fp->_IO_write_base;
- #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
-   /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
-diff --git a/lib/fpurge.c b/build-aux/gnulib/lib/fpurge.c
-index b1d417c7a..3aedcc373 100644
---- a/lib/fpurge.c
-+++ b/lib/fpurge.c
-@@ -62,7 +62,7 @@ fpurge (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   fp->_IO_read_end = fp->_IO_read_ptr;
-   fp->_IO_write_ptr = fp->_IO_write_base;
-   /* Avoid memory leak when there is an active ungetc buffer.  */
-diff --git a/lib/freadahead.c b/build-aux/gnulib/lib/freadahead.c
-index c2ecb5b28..23ec76ee5 100644
---- a/lib/freadahead.c
-+++ b/lib/freadahead.c
-@@ -30,7 +30,7 @@ extern size_t __sreadahead (FILE *);
- size_t
- freadahead (FILE *fp)
- {
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   if (fp->_IO_write_ptr > fp->_IO_write_base)
-     return 0;
-   return (fp->_IO_read_end - fp->_IO_read_ptr)
-diff --git a/lib/freading.c b/build-aux/gnulib/lib/freading.c
-index 73c28acdd..c24d0c88a 100644
---- a/lib/freading.c
-+++ b/lib/freading.c
-@@ -31,7 +31,7 @@ freading (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   return ((fp->_flags & _IO_NO_WRITES) != 0
-           || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0
-               && fp->_IO_read_base != NULL));
-diff --git a/lib/fseeko.c b/build-aux/gnulib/lib/fseeko.c
-index 0101ab55f..193f4e8ce 100644
---- a/lib/fseeko.c
-+++ b/lib/fseeko.c
-@@ -47,7 +47,7 @@ fseeko (FILE *fp, off_t offset, int whence)
- #endif
- 
-   /* These tests are based on fpurge.c.  */
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   if (fp->_IO_read_end == fp->_IO_read_ptr
-       && fp->_IO_write_ptr == fp->_IO_write_base
-       && fp->_IO_save_base == NULL)
-@@ -123,7 +123,7 @@ fseeko (FILE *fp, off_t offset, int whence)
-           return -1;
-         }
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-       fp->_flags &= ~_IO_EOF_SEEN;
-       fp->_offset = pos;
- #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
-diff --git a/lib/stdio-impl.h b/build-aux/gnulib/lib/stdio-impl.h
-index 78d896e9f..05c5752a2 100644
---- a/lib/stdio-impl.h
-+++ b/lib/stdio-impl.h
-@@ -18,6 +18,12 @@
-    the same implementation of stdio extension API, except that some fields
-    have different naming conventions, or their access requires some casts.  */
- 
-+/* Glibc 2.28 made _IO_IN_BACKUP private.  For now, work around this
-+   problem by defining it ourselves.  FIXME: Do not rely on glibc
-+   internals.  */
-+#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN
-+# define _IO_IN_BACKUP 0x100
-+#endif
- 
- /* BSD stdio derived implementations.  */
- 
--- 
-2.14.1
-
-
diff --git a/srcpkgs/m4/template b/srcpkgs/m4/template
index 78f3dae6184a..762593d883bd 100644
--- a/srcpkgs/m4/template
+++ b/srcpkgs/m4/template
@@ -1,17 +1,17 @@
 # Template file for 'm4'
 pkgname=m4
-version=1.4.18
-revision=2
+version=1.4.19
+revision=1
 bootstrap=yes
-replaces="chroot-m4>=0"
 build_style=gnu-configure
 configure_args="--enable-changeword --enable-threads"
 short_desc="GNU version of UNIX m4 macro language processor"
-homepage="https://www.gnu.org/software/m4/"
-license="GPL-3.0-or-later"
 maintainer="Enno Boland <gottox@voidlinux.org>"
+license="GPL-3.0-or-later"
+homepage="https://www.gnu.org/software/m4/"
 distfiles="${GNU_SITE}/${pkgname}/${pkgname}-${version}.tar.xz"
-checksum=f2c1e86ca0a404ff281631bdc8377638992744b175afb806e25871a24a934e07
+checksum=63aede5c6d33b6d9b13511cd0be2cac046f2e70fd0a07aa9573a04a82783af96
+replaces="chroot-m4>=0"
 
 if [ "$XBPS_TARGET_LIBC" = musl ]; then
 	export ac_cv_lib_error_at_line=no

From a690c9b5c2fd4d12d1dd2f4a0ae989f4e1fa9ee1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 22:57:59 -0700
Subject: [PATCH 09/52] btrfs-progs: update to 5.19.

---
 srcpkgs/btrfs-progs/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/btrfs-progs/template b/srcpkgs/btrfs-progs/template
index f6c53d8587e1..292d5110106b 100644
--- a/srcpkgs/btrfs-progs/template
+++ b/srcpkgs/btrfs-progs/template
@@ -1,6 +1,6 @@
 # Template file for 'btrfs-progs'
 pkgname=btrfs-progs
-version=5.18.1
+version=5.19
 revision=1
 wrksrc="${pkgname}-v${version}"
 build_style=gnu-configure
@@ -16,7 +16,7 @@ license="GPL-2.0-only, LGPL-2.1-or-later"
 homepage="https://btrfs.wiki.kernel.org/index.php/Main_Page"
 changelog="https://raw.githubusercontent.com/kdave/btrfs-progs/master/CHANGES"
 distfiles="${KERNEL_SITE}/kernel/people/kdave/${pkgname}/${pkgname}-v${version}.tar.xz"
-checksum=6e98a75ccff52e9354daa1ad284c614c490f844273a2fa524cbac9eb841c7255
+checksum=1fbcf06e4b2f80e7a127fd687ed4625a5b74fa674fe212c836ff70e0edfcccf9
 # Most of the tests depend on `mount` and `fallocate` commands, which are not
 # presented in chroot-util-linux
 make_check=no

From 84b963eb70070c56f2d6f85a751206cba888f455 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 19:39:23 -0700
Subject: [PATCH 10/52] syslinux: fix build for glibc 2.36

---
 .../patches/fix-build-with-glibc-2.36.patch   | 30 +++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 srcpkgs/syslinux/patches/fix-build-with-glibc-2.36.patch

diff --git a/srcpkgs/syslinux/patches/fix-build-with-glibc-2.36.patch b/srcpkgs/syslinux/patches/fix-build-with-glibc-2.36.patch
new file mode 100644
index 000000000000..1303be56c127
--- /dev/null
+++ b/srcpkgs/syslinux/patches/fix-build-with-glibc-2.36.patch
@@ -0,0 +1,30 @@
+--- a/linux/syslinux.c
++++ b/linux/syslinux.c
+@@ -45,7 +45,6 @@
+ #include <sys/stat.h>
+ #include <sys/types.h>
+ #include <sys/wait.h>
+-#include <sys/mount.h>
+ 
+ #include "linuxioctl.h"
+ 
+--- a/libinstaller/syslxcom.c
++++ b/libinstaller/syslxcom.c
+@@ -28,7 +28,6 @@
+ #include <errno.h>
+ #include <sys/stat.h>
+ #include <sys/types.h>
+-#include <sys/mount.h>
+ #include <sys/vfs.h>
+ 
+ #include "linuxioctl.h"
+--- a/extlinux/main.c
++++ b/extlinux/main.c
+@@ -40,7 +40,6 @@
+ #include <sys/stat.h>
+ #include <sys/sysmacros.h>
+ #include <sys/types.h>
+-#include <sys/mount.h>
+ #include <sys/vfs.h>
+ 
+ #include "linuxioctl.h"

From 45223057a3e10fe4ab24975cd804802eeea6007b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 14 Aug 2022 19:29:36 -0700
Subject: [PATCH 11/52] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove -no-pie from build. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..3a88030f79e5 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -132,6 +132,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -460,6 +461,14 @@ do_build() {
 	local binutils_ver linux_ver gcc_ver libc_ver libucontext_ver
 	local tgt=${sourcepkg/cross-}
 
+	export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}"
+	export CXXFLAGS="${CXXFLAGS/-D_FORTIFY_SOURCE=2/}"
+
+	# Disable explicit -fno-PIE, gcc/binutils/libc will figure this out itself.
+	export CFLAGS="${CFLAGS//-fno-PIE/}"
+	export CXXFLAGS="${CXXFLAGS//-fno-PIE/}"
+	export LDFLAGS="${LDFLAGS//-no-pie/}"
+
 	_void_cross_test_ver binutils
 	_void_cross_test_ver linux
 	_void_cross_test_ver gcc

From 1a1f20fdb9f1dc6428e8009e453eeb4b9057ef48 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:08:52 -0700
Subject: [PATCH 12/52] openssh: suppress werror on gcc12

---
 srcpkgs/openssh/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/openssh/template b/srcpkgs/openssh/template
index 02a2dec35f42..6e8e343a9dca 100644
--- a/srcpkgs/openssh/template
+++ b/srcpkgs/openssh/template
@@ -40,7 +40,7 @@ if [ "$build_option_ldns" -a -z "$build_option_ssl" ]; then
 	broken="option 'ldns' requires option 'ssl'"
 fi
 
-CFLAGS="-Wno-format-truncation -Wno-stringop-truncation"
+CFLAGS="-Wno-format-truncation -Wno-stringop-truncation -Wno-error=maybe-uninitialized"
 
 case $XBPS_TARGET_MACHINE in
 	i686-musl)

From 72d7b0d8b24cecf748f67ebee222e8ca8b3112b1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:09:31 -0700
Subject: [PATCH 13/52] linux5.18: update dotconfigs for gcc12

---
 srcpkgs/linux5.18/files/x86_64-dotconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/linux5.18/files/x86_64-dotconfig b/srcpkgs/linux5.18/files/x86_64-dotconfig
index 4e73a3195d40..ea6204868e23 100644
--- a/srcpkgs/linux5.18/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.18/files/x86_64-dotconfig
@@ -512,6 +512,7 @@ CONFIG_RETHUNK=y
 CONFIG_CPU_UNRET_ENTRY=y
 CONFIG_CPU_IBPB_ENTRY=y
 CONFIG_CPU_IBRS_ENTRY=y
+CONFIG_SLS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10060,8 +10061,11 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
 # Memory initialization
 #
 CONFIG_INIT_STACK_NONE=y
+# CONFIG_INIT_STACK_ALL_PATTERN is not set
+# CONFIG_INIT_STACK_ALL_ZERO is not set
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
+# CONFIG_ZERO_CALL_USED_REGS is not set
 # end of Memory initialization
 # end of Kernel hardening options
 # end of Security options
@@ -10538,6 +10542,7 @@ CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
 # CONFIG_UBSAN is not set
 CONFIG_HAVE_ARCH_KCSAN=y
+# CONFIG_KCSAN is not set
 # end of Generic Kernel Debugging Instruments
 
 #

From cf904590197c413d439f2a5ed26b4ccf08212475 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 18:00:42 -0700
Subject: [PATCH 14/52] xf86-video-vmware: fix build on gcc12

---
 ...183b3395333d5d4c73e25c2d011748f15eda.patch | 30 +++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch

diff --git a/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch b/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch
new file mode 100644
index 000000000000..ff839f16e628
--- /dev/null
+++ b/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch
@@ -0,0 +1,30 @@
+From 77b8183b3395333d5d4c73e25c2d011748f15eda Mon Sep 17 00:00:00 2001
+From: Rudi Heitbaum <rudi@heitbaum.com>
+Date: Sun, 8 May 2022 03:00:10 +0000
+Subject: [PATCH] vmwgfx: fix missing array notation
+
+ Fixes error identified by gcc-12.1.0 compiler
+
+make
+  CC       libvmwgfx_la-vmwgfx_tex_video.lo
+vmwgfx_tex_video.c: In function 'stop_video':
+vmwgfx_tex_video.c:240:20: error: the comparison will always evaluate as 'true' for the address of 'yuv' will never be NULL [-Werror=address]
+  240 |                if (priv->yuv[i]) {
+      |                    ^~~~
+---
+ vmwgfx/vmwgfx_tex_video.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/vmwgfx/vmwgfx_tex_video.c b/vmwgfx/vmwgfx_tex_video.c
+index acc2b56..480a5f1 100644
+--- a/vmwgfx/vmwgfx_tex_video.c
++++ b/vmwgfx/vmwgfx_tex_video.c
+@@ -237,7 +237,7 @@ stop_video(ScrnInfoPtr pScrn, pointer data, Bool shutdown)
+ 
+        for (i=0; i<3; ++i) {
+ 	   for (j=0; j<2; ++j) {
+-	       if (priv->yuv[i]) {
++	       if (priv->yuv[j][i]) {
+ 		   xa_surface_destroy(priv->yuv[j][i]);
+ 		   priv->yuv[j][i] = NULL;
+ 	       }

From 9b257f28c4de05945c49efe77f742f6b571c1c6a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 18:24:37 -0700
Subject: [PATCH 15/52] doxygen: fix build for gcc 12

---
 srcpkgs/doxygen/patches/compat-gcc12.patch | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100644 srcpkgs/doxygen/patches/compat-gcc12.patch

diff --git a/srcpkgs/doxygen/patches/compat-gcc12.patch b/srcpkgs/doxygen/patches/compat-gcc12.patch
new file mode 100644
index 000000000000..666744a1dceb
--- /dev/null
+++ b/srcpkgs/doxygen/patches/compat-gcc12.patch
@@ -0,0 +1,22 @@
+From 5198966c8d5fec89116d025c74934ac03ea511fa Mon Sep 17 00:00:00 2001
+From: Dimitri van Heesch <doxygen@gmail.com>
+Date: Fri, 6 May 2022 09:55:16 +0200
+Subject: [PATCH] issue #9312: Build: cache.h:53:14: error: 'exchange' is not a
+ member of 'std'
+
+---
+ src/cache.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/cache.h b/src/cache.h
+index 0ff3092ed5..e218eb27d2 100644
+--- a/src/cache.h
++++ b/src/cache.h
+@@ -19,6 +19,7 @@
+ #include <list>
+ #include <unordered_map>
+ #include <mutex>
++#include <utility>
+ #include <ctype.h>
+ 
+ /*! Fixed size cache for value type V using keys of type K.

From bc74fd431f5422af04463f491d18813cff94359a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 21 Aug 2022 15:12:00 -0700
Subject: [PATCH 16/52] libproxy: update to 0.4.18

---
 srcpkgs/libproxy/template | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/libproxy/template b/srcpkgs/libproxy/template
index d6103007032e..6599dfb69b98 100644
--- a/srcpkgs/libproxy/template
+++ b/srcpkgs/libproxy/template
@@ -1,18 +1,22 @@
 # Template file for 'libproxy'
 pkgname=libproxy
-version=0.4.15
+version=0.4.18
 revision=1
 build_style=cmake
 configure_args="-DWITH_GNOME=0 -DWITH_KDE4=0 -DWITH_MOZJS=0 -DWITH_NM=0
  -DWITH_PERL=0 -DWITH_PYTHON=1 -DWITH_WEBKIT=0"
 hostmakedepends="pkg-config python"
 makedepends="zlib-devel"
-short_desc="A library handling all the details of proxy configuration"
+short_desc="Library handling all the details of proxy configuration"
 maintainer="Orphaned <orphan@voidlinux.org>"
+license="LGPL-2.1-or-later"
 homepage="http://github.com/libproxy/libproxy"
-license="LGPL-2.1"
-distfiles="https://github.com/libproxy/libproxy/archive/${version}.tar.gz>${pkgname}-${version}.tar.gz"
-checksum=18f58b0a0043b6881774187427ead158d310127fc46a1c668ad6d207fb28b4e0
+distfiles="https://github.com/libproxy/libproxy/archive/${version}.tar.gz"
+checksum=0b4a9218d88f6cf9fa25996a3f38329a11f688a9d026141d9d0e966d8fa63837
+
+post_patch() {
+	vsed '/add_test(NAME url-test/d' -i libproxy/test/CMakeLists.txt
+}
 
 libproxy-devel_package() {
 	depends="libproxy>=${version}_${revision}"

From fb75cb2fb420edab5bf56f240dc802ba61b50d8a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 21 Aug 2022 17:05:39 -0700
Subject: [PATCH 17/52] exempi: update to 2.6.2

---
 ...f034705fd2d032c81383eee8208fd4eee0ac.patch | 43 -------------------
 srcpkgs/exempi/template                       |  4 +-
 2 files changed, 2 insertions(+), 45 deletions(-)
 delete mode 100644 srcpkgs/exempi/patches/8ed2f034705fd2d032c81383eee8208fd4eee0ac.patch

diff --git a/srcpkgs/exempi/patches/8ed2f034705fd2d032c81383eee8208fd4eee0ac.patch b/srcpkgs/exempi/patches/8ed2f034705fd2d032c81383eee8208fd4eee0ac.patch
deleted file mode 100644
index 2696793cec09..000000000000
--- a/srcpkgs/exempi/patches/8ed2f034705fd2d032c81383eee8208fd4eee0ac.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From 8ed2f034705fd2d032c81383eee8208fd4eee0ac Mon Sep 17 00:00:00 2001
-From: Victor Rodriguez <victor.rodriguez.bahena@intel.com>
-Date: Sat, 18 Aug 2018 13:54:55 +0000
-Subject: [PATCH] Issue #9 - Fix null-pointer-dereference (CVE-2018-12648)
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-The WEBP::GetLE32 function in
-XMPFiles/source/FormatSupport/WEBP_Support.hpp in Exempi 2.4.5 has a
-NULL pointer dereference.
-
-https://bugs.freedesktop.org/show_bug.cgi?id=106981
-https://gitlab.freedesktop.org/libopenraw/exempi/issues/9
-
-Signed-off-by: Victor Rodriguez <victor.rodriguez.bahena@intel.com>
-Signed-off-by: Hubert Figuière <hub@figuiere.net>
----
- XMPFiles/source/FormatSupport/WEBP_Support.cpp | 8 +++++---
- 1 file changed, 5 insertions(+), 3 deletions(-)
-
-diff --git a/XMPFiles/source/FormatSupport/WEBP_Support.cpp b/XMPFiles/source/FormatSupport/WEBP_Support.cpp
-index ffaf220..4fe705b 100644
---- a/XMPFiles/source/FormatSupport/WEBP_Support.cpp
-+++ b/XMPFiles/source/FormatSupport/WEBP_Support.cpp
-@@ -160,9 +160,11 @@ bool VP8XChunk::xmp()
- }
- void VP8XChunk::xmp(bool hasXMP)
- {
--    XMP_Uns32 flags = GetLE32(&this->data[0]);
--    flags ^= (-hasXMP ^ flags) & (1 << XMP_FLAG_BIT);
--    PutLE32(&this->data[0], flags);
-+    if (&this->data[0] != NULL) {
-+        XMP_Uns32 flags = GetLE32(&this->data[0]);
-+        flags ^= (-hasXMP ^ flags) & (1 << XMP_FLAG_BIT);
-+        PutLE32(&this->data[0], flags);
-+    }
- }
- 
- Container::Container(WEBP_MetaHandler* handler) : Chunk(NULL, handler)
--- 
-2.18.0
-
diff --git a/srcpkgs/exempi/template b/srcpkgs/exempi/template
index 14753617953a..d664f7dc4d80 100644
--- a/srcpkgs/exempi/template
+++ b/srcpkgs/exempi/template
@@ -1,6 +1,6 @@
 # Template file for 'exempi'
 pkgname=exempi
-version=2.5.0
+version=2.6.2
 revision=1
 build_style=gnu-configure
 configure_args="--with-boost=${XBPS_CROSS_BASE}/usr --disable-static --disable-unittest"
@@ -10,7 +10,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="BSD-3-Clause"
 homepage="https://libopenraw.freedesktop.org/wiki/Exempi"
 distfiles="https://libopenraw.freedesktop.org/download/exempi-${version}.tar.bz2"
-checksum=dc82fc24c0540a44a63fa4ad21775d24e00e63f1dedd3e2ae6f7aa27583b711b
+checksum=4d17d4c93df2a95da3e3172c45b7a5bf317dd31dafd1c7a340169728c7089d1d
 
 post_install() {
 	vlicense COPYING

From d382c432a51abca691ab4bd07a125b46770842b5 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 21 Aug 2022 21:36:03 -0700
Subject: [PATCH 18/52] plymouth: update to 22.02.122

---
 srcpkgs/plymouth/patches/fix-glibc-2.36.patch | 30 +++++++++++++++++++
 srcpkgs/plymouth/template                     |  4 +--
 2 files changed, 32 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/plymouth/patches/fix-glibc-2.36.patch

diff --git a/srcpkgs/plymouth/patches/fix-glibc-2.36.patch b/srcpkgs/plymouth/patches/fix-glibc-2.36.patch
new file mode 100644
index 000000000000..2f1e43875cfb
--- /dev/null
+++ b/srcpkgs/plymouth/patches/fix-glibc-2.36.patch
@@ -0,0 +1,30 @@
+From 5f1e43c00039a7fe1fff768b91a05a695fb4a53d Mon Sep 17 00:00:00 2001
+From: Ray Strode <rstrode@redhat.com>
+Date: Wed, 3 Aug 2022 15:23:33 -0400
+Subject: [PATCH] ply-utils: Drop linux/fs.h include
+
+It was needed long ago for a function we no longer even have.
+
+Now it's causing compile errors on Fedora 37 because it's conflicting
+with sys/mount.h.
+
+This commit drops it.
+---
+ src/libply/ply-utils.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/src/libply/ply-utils.c b/src/libply/ply-utils.c
+index c7b165e9..219e2e77 100644
+--- a/src/libply/ply-utils.c
++++ b/src/libply/ply-utils.c
+@@ -46,7 +46,6 @@
+ #include <sys/user.h>
+ #include <sys/wait.h>
+ #include <time.h>
+-#include <linux/fs.h>
+ #include <linux/vt.h>
+ 
+ #include <dlfcn.h>
+-- 
+GitLab
+
diff --git a/srcpkgs/plymouth/template b/srcpkgs/plymouth/template
index 17f801fc5315..442ab58a99cd 100644
--- a/srcpkgs/plymouth/template
+++ b/srcpkgs/plymouth/template
@@ -1,6 +1,6 @@
 # Template file for 'plymouth'
 pkgname=plymouth
-version=0.9.5
+version=22.02.122
 revision=1
 build_style=gnu-configure
 configure_args="--with-system-root-install=no \
@@ -18,7 +18,7 @@ maintainer="William OD <obirik2005@gmail.com>"
 license="GPL-2.0-or-later"
 homepage="https://www.freedesktop.org/wiki/Software/Plymouth/"
 distfiles="${FREEDESKTOP_SITE}/plymouth/releases/$pkgname-$version.tar.xz"
-checksum=ecae257f351d098340542a5bc06de029404c24dcee87e6ebb2abd5ef117fce86
+checksum=100551442221033ce868c447ad6c74d831d209c18ae232b98ae0207e34eadaeb
 
 build_options="gtk3 pango"
 build_options_default="gtk3 pango"

From 1b9c75f25dc0e3962f9de2d04af5d489cc9e7961 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 21 Aug 2022 21:37:00 -0700
Subject: [PATCH 19/52] openjdk7-bootstrap: fix build for gcc12

---
 .../files/dist_patches_glibc.txt              |  1 +
 .../files/dist_patches_musl.txt               |  1 +
 .../icedtea-pointer-comparison-gcc12.patch    | 31 +++++++++++++++++++
 3 files changed, 33 insertions(+)
 create mode 100644 srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch

diff --git a/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt b/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt
index c76c56855441..8061756dfc0c 100644
--- a/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt
+++ b/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt
@@ -6,3 +6,4 @@ icedtea-jdk-no-soname.patch
 icedtea-jdk-xattr.patch
 icedtea-jdk-sysctl_h.patch
 icedtea-cpio.patch
+icedtea-pointer-comparison-gcc12.patch
diff --git a/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt b/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt
index 21812517c7c2..8b35d9c46989 100644
--- a/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt
+++ b/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt
@@ -11,3 +11,4 @@ icedtea-jdk-musl.patch
 icedtea-jdk-no-soname.patch
 icedtea-jdk-xattr.patch
 icedtea-cpio.patch
+icedtea-pointer-comparison-gcc12.patch
diff --git a/srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch b/srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch
new file mode 100644
index 000000000000..c809553443e7
--- /dev/null
+++ b/srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch
@@ -0,0 +1,31 @@
+--- openjdk.orig/hotspot/src/share/vm/opto/lcm.cpp
++++ openjdk/hotspot/src/share/vm/opto/lcm.cpp
+@@ -60,7 +60,7 @@
+ // Check whether val is not-null-decoded compressed oop,
+ // i.e. will grab into the base of the heap if it represents NULL.
+ static bool accesses_heap_base_zone(Node *val) {
+-  if (Universe::narrow_oop_base() > 0) { // Implies UseCompressedOops.
++  if (Universe::narrow_oop_base() > (address)0) { // Implies UseCompressedOops.
+     if (val && val->is_Mach()) {
+       if (val->as_Mach()->ideal_Opcode() == Op_DecodeN) {
+         // This assumes all Decodes with TypePtr::NotNull are matched to nodes that
+--- openjdk.orig/hotspot/src/share/vm/runtime/virtualspace.cpp
++++ openjdk/hotspot/src/share/vm/runtime/virtualspace.cpp
+@@ -527,7 +527,7 @@ ReservedHeapSpace::ReservedHeapSpace(siz
+                 (UseCompressedOops && (Universe::narrow_oop_base() != NULL) &&
+                  Universe::narrow_oop_use_implicit_null_checks()) ?
+                   lcm(os::vm_page_size(), alignment) : 0) {
+-  if (base() > 0) {
++  if (base() > (char*)0) {
+     MemTracker::record_virtual_memory_type((address)base(), mtJavaHeap);
+   }
+ 
+@@ -546,7 +546,7 @@ ReservedHeapSpace::ReservedHeapSpace(con
+                 (UseCompressedOops && (Universe::narrow_oop_base() != NULL) &&
+                  Universe::narrow_oop_use_implicit_null_checks()) ?
+                   lcm(os::vm_page_size(), prefix_align) : 0) {
+-  if (base() > 0) {
++  if (base() > (char*)0) {
+     MemTracker::record_virtual_memory_type((address)base(), mtJavaHeap);
+   }
+ 

From cbdf4478170c5046aa60490f84db07b25c0cf018 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 23:30:16 -0700
Subject: [PATCH 20/52] libunique1: relax warnings for gcc12

---
 srcpkgs/libunique1/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/libunique1/template b/srcpkgs/libunique1/template
index f73931b0c72b..c5a0f5c27860 100644
--- a/srcpkgs/libunique1/template
+++ b/srcpkgs/libunique1/template
@@ -15,7 +15,7 @@ homepage="https://wiki.gnome.org/Attic/LibUnique"
 distfiles="${GNOME_SITE}/libunique/1.1/libunique-${version}.tar.bz2"
 checksum=e5c8041cef8e33c55732f06a292381cb345db946cf792a4ae18aa5c66cdd4fbb
 
-CFLAGS="-Wno-deprecated-declarations"
+CFLAGS="-Wno-deprecated-declarations -Wno-incompatible-pointer-types"
 
 # Package build options
 build_options="gir"

From 912b3356adb5559a74d09299899d4fa11df65cc0 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:39:52 -0700
Subject: [PATCH 21/52] libvirt: fix build for glibc 2.36

---
 .../patches/lxc-fix-compat-glibc-2.36.patch   | 34 ++++++++++++++++
 .../virfile-fix-compat-glibc-2.36.patch       | 39 +++++++++++++++++++
 2 files changed, 73 insertions(+)
 create mode 100644 srcpkgs/libvirt/patches/lxc-fix-compat-glibc-2.36.patch
 create mode 100644 srcpkgs/libvirt/patches/virfile-fix-compat-glibc-2.36.patch

diff --git a/srcpkgs/libvirt/patches/lxc-fix-compat-glibc-2.36.patch b/srcpkgs/libvirt/patches/lxc-fix-compat-glibc-2.36.patch
new file mode 100644
index 000000000000..d85b57815010
--- /dev/null
+++ b/srcpkgs/libvirt/patches/lxc-fix-compat-glibc-2.36.patch
@@ -0,0 +1,34 @@
+From 9493c9b79dc541ec9e0fd73c6d87bdf8d30aaa90 Mon Sep 17 00:00:00 2001
+From: Cole Robinson <crobinso@redhat.com>
+Date: Mon, 1 Aug 2022 15:20:38 -0400
+Subject: [PATCH] lxc: containter: fix build with glibc 2.36
+
+With glibc 2.36, sys/mount.h and linux/mount.h conflict:
+https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
+
+lxc_container.c imports sys/mount.h and linux/fs.h, which pulls in
+linux/mount.h.
+
+linux/fs.h isn't required here though. glibc sys/mount.h has had
+MS_MOVE since 2.12 in 2010
+
+Reviewed-by: Erik Skultety <eskultet@redhat.com>
+Signed-off-by: Cole Robinson <crobinso@redhat.com>
+---
+ src/lxc/lxc_container.c | 3 ---
+ 1 file changed, 3 deletions(-)
+
+diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
+index b5278831da7..a5401c2186e 100644
+--- a/src/lxc/lxc_container.c
++++ b/src/lxc/lxc_container.c
+@@ -33,9 +33,6 @@
+ /* Yes, we want linux private one, for _syscall2() macro */
+ #include <linux/unistd.h>
+ 
+-/* For MS_MOVE */
+-#include <linux/fs.h>
+-
+ #if WITH_CAPNG
+ # include <cap-ng.h>
+ #endif
diff --git a/srcpkgs/libvirt/patches/virfile-fix-compat-glibc-2.36.patch b/srcpkgs/libvirt/patches/virfile-fix-compat-glibc-2.36.patch
new file mode 100644
index 000000000000..2ef227ea9b54
--- /dev/null
+++ b/srcpkgs/libvirt/patches/virfile-fix-compat-glibc-2.36.patch
@@ -0,0 +1,39 @@
+From c0d9adf220dc0d223330a7bac37b174132d330ba Mon Sep 17 00:00:00 2001
+From: Cole Robinson <crobinso@redhat.com>
+Date: Mon, 1 Aug 2022 15:24:01 -0400
+Subject: [PATCH] virfile: Fix build with glibc 2.36
+
+With glibc 2.36, sys/mount.h and linux/mount.h conflict:
+https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
+
+virfile.c imports sys/mount.h and linux/fs.h, which pulls in
+linux/mount.h.
+
+Manually define the constants we need from linux/fs.h, like was
+done in llvm:
+
+https://reviews.llvm.org/rGb379129c4beb3f26223288627a1291739f33af02
+
+Reviewed-by: Erik Skultety <eskultet@redhat.com>
+Signed-off-by: Cole Robinson <crobinso@redhat.com>
+---
+ src/util/virfile.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/src/util/virfile.c b/src/util/virfile.c
+index 99da058db3b..ce541b8946b 100644
+--- a/src/util/virfile.c
++++ b/src/util/virfile.c
+@@ -71,7 +71,11 @@
+ # endif
+ # include <sys/ioctl.h>
+ # include <linux/cdrom.h>
+-# include <linux/fs.h>
++/* These come from linux/fs.h, but that header conflicts with
++ * sys/mount.h on glibc 2.36+ */
++# define FS_IOC_GETFLAGS _IOR('f', 1, long)
++# define FS_IOC_SETFLAGS _IOW('f', 2, long)
++# define FS_NOCOW_FL 0x00800000
+ #endif
+ 
+ #if WITH_LIBATTR

From ec80e4fdf1e3a69c6b1e38bc3add91fd1119d948 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:41:50 -0700
Subject: [PATCH 22/52] efivar: fix build for glibc 2.36

---
 .../patches/fix-compat-glibc-2.36.patch       | 55 +++++++++++++++++++
 1 file changed, 55 insertions(+)
 create mode 100644 srcpkgs/efivar/patches/fix-compat-glibc-2.36.patch

diff --git a/srcpkgs/efivar/patches/fix-compat-glibc-2.36.patch b/srcpkgs/efivar/patches/fix-compat-glibc-2.36.patch
new file mode 100644
index 000000000000..fcc83aef20cf
--- /dev/null
+++ b/srcpkgs/efivar/patches/fix-compat-glibc-2.36.patch
@@ -0,0 +1,55 @@
+From bc65d63ebf8fe6ac8a099ff15ca200986dba1565 Mon Sep 17 00:00:00 2001
+From: Robbie Harwood <rharwood@redhat.com>
+Date: Thu, 28 Jul 2022 16:11:24 -0400
+Subject: [PATCH] Fix glibc 2.36 build (mount.h conflicts)
+
+glibc has decided that sys/mount.h and linux/mount.h are no longer
+usable at the same time.  This broke the build, since linux/fs.h itself
+includes linux/mount.h.  For now, fix the build by only including
+sys/mount.h where we need it.
+
+See-also: https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
+Resolves: #227
+Signed-off-by: Robbie Harwood <rharwood@redhat.com>
+---
+ src/gpt.c   | 1 +
+ src/linux.c | 1 +
+ src/util.h  | 1 -
+ 3 files changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/gpt.c b/src/gpt.c
+index 1eda0497..21413c3b 100644
+--- a/src/gpt.c
++++ b/src/gpt.c
+@@ -17,6 +17,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <sys/mount.h>
+ #include <sys/param.h>
+ #include <sys/stat.h>
+ #include <sys/utsname.h>
+diff --git a/src/linux.c b/src/linux.c
+index 47e45ae4..1780816f 100644
+--- a/src/linux.c
++++ b/src/linux.c
+@@ -20,6 +20,7 @@
+ #include <stdbool.h>
+ #include <stdio.h>
+ #include <sys/ioctl.h>
++#include <sys/mount.h>
+ #include <sys/socket.h>
+ #include <sys/sysmacros.h>
+ #include <sys/types.h>
+diff --git a/src/util.h b/src/util.h
+index 3300666f..1e67e447 100644
+--- a/src/util.h
++++ b/src/util.h
+@@ -23,7 +23,6 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <sys/ioctl.h>
+-#include <sys/mount.h>
+ #include <sys/stat.h>
+ #include <sys/types.h>
+ #include <tgmath.h>

From 441cb84732fe97b91d6bb70af786d1b9306b84c2 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:43:24 -0700
Subject: [PATCH 23/52] libwpd: fix build for gcc12

---
 srcpkgs/libwpd/patches/fix-compat-gcc12.patch | 11 +++++++++++
 1 file changed, 11 insertions(+)
 create mode 100644 srcpkgs/libwpd/patches/fix-compat-gcc12.patch

diff --git a/srcpkgs/libwpd/patches/fix-compat-gcc12.patch b/srcpkgs/libwpd/patches/fix-compat-gcc12.patch
new file mode 100644
index 000000000000..6ebce2463d16
--- /dev/null
+++ b/srcpkgs/libwpd/patches/fix-compat-gcc12.patch
@@ -0,0 +1,11 @@
+diff -rup libwpd-0.10.3.orig/src/lib/WPXTable.h libwpd-0.10.3/src/lib/WPXTable.h
+--- libwpd-0.10.3.orig/src/lib/WPXTable.h	2022-08-23 22:32:45.332593795 -0700
++++ libwpd-0.10.3/src/lib/WPXTable.h	2022-08-23 22:32:59.500651211 -0700
+@@ -37,6 +37,7 @@
+ #define _WPXTABLE_H
+ 
+ #include <vector>
++#include <cstddef>
+ 
+ struct WPXTableCell
+ {

From f4a373bab1995b91115f66d86abd5587ce8f601f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:44:07 -0700
Subject: [PATCH 24/52] grub: fix build for binutils 2.36

---
 .../patches/fix-compat-binutils-2.36.patch    | 96 +++++++++++++++++++
 srcpkgs/grub/template                         |  7 +-
 2 files changed, 102 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/grub/patches/fix-compat-binutils-2.36.patch

diff --git a/srcpkgs/grub/patches/fix-compat-binutils-2.36.patch b/srcpkgs/grub/patches/fix-compat-binutils-2.36.patch
new file mode 100644
index 000000000000..d92a91e3253e
--- /dev/null
+++ b/srcpkgs/grub/patches/fix-compat-binutils-2.36.patch
@@ -0,0 +1,96 @@
+From b98275138bf4fc250a1c362dfd2c8b1cf2421701 Mon Sep 17 00:00:00 2001
+From: Michael Chang <mchang@suse.com>
+Date: Tue, 28 Sep 2021 13:50:47 +0800
+Subject: build: Fix build error with binutils 2.36
+
+The following procedure to build xen/pvgrub is broken.
+
+  git clone https://git.savannah.gnu.org/git/grub.git
+  cd grub
+  ./bootstrap
+  mkdir build-xen
+  cd build-xen
+  ../configure --with-platform=xen
+  make
+
+It fails with the message:
+
+  /usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld:
+  section .note.gnu.property VMA [0000000000400158,0000000000400187]
+  overlaps section .bss VMA [000000000000f000,000000000041e1af]
+
+The most significant factor is that new assembler (GNU as) generates the
+.note.gnu.property section as default. This note section overlaps with
+.bss because it doesn't reposition with -Wl,-Ttext,0 with which the base
+address of .text section is set, rather the address of .note.gnu.property
+is calculated for some reason from 0x400000 where the ELF executable
+defaults to start.
+
+Using -Ttext-segment doesn't help either, though it is said to set the
+address of the first byte of the text segment according to "man ld".
+What it actually does is to override the default 0x400000, aka the image
+base address, to something else. The entire process can be observed in
+the default linker script used by gcc [1]. Therefore we can't expect it
+to achieve the same thing as -Ttext given that the first segment where
+.text resides is offset by SIZEOF_HEADERS plus some sections may be
+preceding it within the first segment. The end result is .text always
+has to start with non-zero address with -Wl,-Ttext-segment,0 if using
+default linker script.
+
+It is also worth mentioning that binutils upstream apparently doesn't
+seem to consider this as a bug [2] and proposed to use -Wl,-Ttext-segment,0
+which is not fruitful as what has been tested by Gentoo [3].
+
+As long as GRUB didn't use ISA information encoded in .note.gnu.property,
+we can safely drop it via -Wa,-mx86-used-note=no assembler option to
+fix the linker error above.
+
+This is considered a better approach than using custom linker script to
+drop the .note.gnu.property section because object file manipulation can
+also be hampered one way or the other in that linker script may not be
+helpful. See also this commit removing the section in the process of objcopy.
+
+  6643507ce build: Fix GRUB i386-pc build with Ubuntu gcc
+
+[1] In /usr/lib64/ldscripts/elf_x86_64.x or use 'gcc -Wl,--verbose ...'
+    PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x400000));
+    . = SEGMENT_START("text-segment", 0x400000) + SIZEOF_HEADERS;
+[2] https://sourceware.org/bugzilla/show_bug.cgi?id=27377
+[3] https://bugs.gentoo.org/787221
+
+Signed-off-by: Michael Chang <mchang@suse.com>
+Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
+---
+ configure.ac | 14 ++++++++++++++
+ 1 file changed, 14 insertions(+)
+
+(limited to 'configure.ac')
+
+diff --git a/configure.ac b/configure.ac
+index eeb5d22..8d1c81a 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -840,6 +840,20 @@ if ( test "x$target_cpu" = xi386 || test "x$target_cpu" = xx86_64 ) && test "x$p
+   TARGET_CFLAGS="$TARGET_CFLAGS -mno-mmx -mno-sse -mno-sse2 -mno-sse3 -mno-3dnow"
+ fi
+ 
++if ( test "x$target_cpu" = xi386 || test "x$target_cpu" = xx86_64 ); then
++  AC_CACHE_CHECK([whether -Wa,-mx86-used-note works], [grub_cv_cc_mx86_used_note], [
++    CFLAGS="$TARGET_CFLAGS -Wa,-mx86-used-note=no -Werror"
++    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
++	[grub_cv_cc_mx86_used_note=yes],
++	[grub_cv_cc_mx86_used_note=no])
++  ])
++
++  if test "x$grub_cv_cc_mx86_used_note" = xyes; then
++    TARGET_CFLAGS="$TARGET_CFLAGS -Wa,-mx86-used-note=no"
++    TARGET_CCASFLAGS="$TARGET_CCASFLAGS -Wa,-mx86-used-note=no"
++  fi
++fi
++
+ # GRUB doesn't use float or doubles at all. Yet some toolchains may decide
+ # that floats are a good fit to run instead of what's written in the code.
+ # Given that floating point unit is disabled (if present to begin with)
+-- 
+cgit v1.1
+
diff --git a/srcpkgs/grub/template b/srcpkgs/grub/template
index b1826c38a884..b4d3b07af620 100644
--- a/srcpkgs/grub/template
+++ b/srcpkgs/grub/template
@@ -2,7 +2,8 @@
 pkgname=grub
 version=2.06
 revision=2
-hostmakedepends="python3 pkg-config flex freetype-devel font-unifont-bdf help2man"
+hostmakedepends="python3 pkg-config flex freetype-devel font-unifont-bdf help2man
+ automake gettext-devel-tools"
 makedepends="libusb-compat-devel ncurses-devel freetype-devel
  liblzma-devel device-mapper-devel fuse-devel"
 depends="os-prober"
@@ -43,6 +44,10 @@ case "$XBPS_TARGET_MACHINE" in
 		;;
 esac
 
+pre_configure() {
+	autoreconf -fi
+}
+
 do_configure() {
 	# workaround for https://savannah.gnu.org/bugs/?60458
 	# some more info: https://www.linuxquestions.org/questions/showthread.php?p=6257712

From 08507ff4e4ea5a18b89ef90e397857046f4546b6 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:45:07 -0700
Subject: [PATCH 25/52] linux-toos: fix build for binutils 2.39

---
 .../patches/binutils-add-compat-check.patch   | 103 ++++++++++++
 .../patches/binutils-disasm-compat.patch      | 102 ++++++++++++
 .../bpf_jit_disasm-binutils-2.39.patch        | 104 ++++++++++++
 .../patches/bpftool-binutils-2.39.patch       | 149 ++++++++++++++++++
 .../patches/perf-binutils-2.39.patch          | 114 ++++++++++++++
 5 files changed, 572 insertions(+)
 create mode 100644 srcpkgs/linux-tools/patches/binutils-add-compat-check.patch
 create mode 100644 srcpkgs/linux-tools/patches/binutils-disasm-compat.patch
 create mode 100644 srcpkgs/linux-tools/patches/bpf_jit_disasm-binutils-2.39.patch
 create mode 100644 srcpkgs/linux-tools/patches/bpftool-binutils-2.39.patch
 create mode 100644 srcpkgs/linux-tools/patches/perf-binutils-2.39.patch

diff --git a/srcpkgs/linux-tools/patches/binutils-add-compat-check.patch b/srcpkgs/linux-tools/patches/binutils-add-compat-check.patch
new file mode 100644
index 000000000000..e4e7ece9635e
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/binutils-add-compat-check.patch
@@ -0,0 +1,103 @@
+From cfd59ca91467056bb2c36907b2fa67b8e1af9952 Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:27 -0700
+Subject: [PATCH] tools build: Add feature test for init_disassemble_info API
+ changes
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation failures for tools/{perf,bpf}, e.g. on debian unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+This commit adds a feature test to detect the new signature.  Subsequent
+commits will use it to fix the build failures.
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Quentin Monnet <quentin@isovalent.com>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-2-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/build/Makefile.feature                        |  1 +
+ tools/build/feature/Makefile                        |  4 ++++
+ tools/build/feature/test-all.c                      |  4 ++++
+ tools/build/feature/test-disassembler-init-styled.c | 13 +++++++++++++
+ 4 files changed, 22 insertions(+)
+ create mode 100644 tools/build/feature/test-disassembler-init-styled.c
+
+diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature
+index 888a0421d43b96..8f6578e4d3249e 100644
+--- a/tools/build/Makefile.feature
++++ b/tools/build/Makefile.feature
+@@ -70,6 +70,7 @@ FEATURE_TESTS_BASIC :=                  \
+         libaio				\
+         libzstd				\
+         disassembler-four-args		\
++        disassembler-init-styled	\
+         file-handle
+ 
+ # FEATURE_TESTS_BASIC + FEATURE_TESTS_EXTRA is the complete list
+diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile
+index 7c2a17e23c30ac..c3059739318a95 100644
+--- a/tools/build/feature/Makefile
++++ b/tools/build/feature/Makefile
+@@ -18,6 +18,7 @@ FILES=                                          \
+          test-libbfd.bin                        \
+          test-libbfd-buildid.bin		\
+          test-disassembler-four-args.bin        \
++         test-disassembler-init-styled.bin	\
+          test-reallocarray.bin			\
+          test-libbfd-liberty.bin                \
+          test-libbfd-liberty-z.bin              \
+@@ -248,6 +249,9 @@ $(OUTPUT)test-libbfd-buildid.bin:
+ $(OUTPUT)test-disassembler-four-args.bin:
+ 	$(BUILD) -DPACKAGE='"perf"' -lbfd -lopcodes
+ 
++$(OUTPUT)test-disassembler-init-styled.bin:
++	$(BUILD) -DPACKAGE='"perf"' -lbfd -lopcodes
++
+ $(OUTPUT)test-reallocarray.bin:
+ 	$(BUILD)
+ 
+diff --git a/tools/build/feature/test-all.c b/tools/build/feature/test-all.c
+index 5ffafb967b6e49..957c02c7b163b5 100644
+--- a/tools/build/feature/test-all.c
++++ b/tools/build/feature/test-all.c
+@@ -166,6 +166,10 @@
+ # include "test-disassembler-four-args.c"
+ #undef main
+ 
++#define main main_test_disassembler_init_styled
++# include "test-disassembler-init-styled.c"
++#undef main
++
+ #define main main_test_libzstd
+ # include "test-libzstd.c"
+ #undef main
+diff --git a/tools/build/feature/test-disassembler-init-styled.c b/tools/build/feature/test-disassembler-init-styled.c
+new file mode 100644
+index 00000000000000..f1ce0ec3bee9d3
+--- /dev/null
++++ b/tools/build/feature/test-disassembler-init-styled.c
+@@ -0,0 +1,13 @@
++// SPDX-License-Identifier: GPL-2.0
++#include <stdio.h>
++#include <dis-asm.h>
++
++int main(void)
++{
++	struct disassemble_info info;
++
++	init_disassemble_info(&info, stdout,
++			      NULL, NULL);
++
++	return 0;
++}
diff --git a/srcpkgs/linux-tools/patches/binutils-disasm-compat.patch b/srcpkgs/linux-tools/patches/binutils-disasm-compat.patch
new file mode 100644
index 000000000000..1a6cc0e6d97c
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/binutils-disasm-compat.patch
@@ -0,0 +1,102 @@
+From a45b3d6926231c3d024ea0de4f7bd967f83709ee Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:29 -0700
+Subject: tools include: add dis-asm-compat.h to handle version differences
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation failures for tools/{perf,bpf}, e.g. on debian unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+This commit introduces a wrapper for init_disassemble_info(), to avoid
+spreading #ifdef DISASM_INIT_STYLED to a bunch of places. Subsequent
+commits will use it to fix the build failures.
+
+It likely is worth adding a wrapper for disassember(), to avoid the already
+existing DISASM_FOUR_ARGS_SIGNATURE ifdefery.
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Signed-off-by: Ben Hutchings <benh@debian.org>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Quentin Monnet <quentin@isovalent.com>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-4-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/include/tools/dis-asm-compat.h | 55 ++++++++++++++++++++++++++++++++++++
+ 1 file changed, 55 insertions(+)
+ create mode 100644 tools/include/tools/dis-asm-compat.h
+
+(limited to 'tools/include/tools/dis-asm-compat.h')
+
+diff --git a/tools/include/tools/dis-asm-compat.h b/tools/include/tools/dis-asm-compat.h
+new file mode 100644
+index 0000000000000..70f331e23ed3d
+--- /dev/null
++++ b/tools/include/tools/dis-asm-compat.h
+@@ -0,0 +1,55 @@
++/* SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause */
++#ifndef _TOOLS_DIS_ASM_COMPAT_H
++#define _TOOLS_DIS_ASM_COMPAT_H
++
++#include <stdio.h>
++#include <dis-asm.h>
++
++/* define types for older binutils version, to centralize ifdef'ery a bit */
++#ifndef DISASM_INIT_STYLED
++enum disassembler_style {DISASSEMBLER_STYLE_NOT_EMPTY};
++typedef int (*fprintf_styled_ftype) (void *, enum disassembler_style, const char*, ...);
++#endif
++
++/*
++ * Trivial fprintf wrapper to be used as the fprintf_styled_func argument to
++ * init_disassemble_info_compat() when normal fprintf suffices.
++ */
++static inline int fprintf_styled(void *out,
++				 enum disassembler_style style,
++				 const char *fmt, ...)
++{
++	va_list args;
++	int r;
++
++	(void)style;
++
++	va_start(args, fmt);
++	r = vfprintf(out, fmt, args);
++	va_end(args);
++
++	return r;
++}
++
++/*
++ * Wrapper for init_disassemble_info() that hides version
++ * differences. Depending on binutils version and architecture either
++ * fprintf_func or fprintf_styled_func will be called.
++ */
++static inline void init_disassemble_info_compat(struct disassemble_info *info,
++						void *stream,
++						fprintf_ftype unstyled_func,
++						fprintf_styled_ftype styled_func)
++{
++#ifdef DISASM_INIT_STYLED
++	init_disassemble_info(info, stream,
++			      unstyled_func,
++			      styled_func);
++#else
++	(void)styled_func;
++	init_disassemble_info(info, stream,
++			      unstyled_func);
++#endif
++}
++
++#endif /* _TOOLS_DIS_ASM_COMPAT_H */
+-- 
+cgit 
+
diff --git a/srcpkgs/linux-tools/patches/bpf_jit_disasm-binutils-2.39.patch b/srcpkgs/linux-tools/patches/bpf_jit_disasm-binutils-2.39.patch
new file mode 100644
index 000000000000..01221fad3a4a
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/bpf_jit_disasm-binutils-2.39.patch
@@ -0,0 +1,104 @@
+From 96ed066054abf11c7d3e106e3011a51f3f1227a3 Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:31 -0700
+Subject: [PATCH] tools bpf_jit_disasm: Fix compilation error with new binutils
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation to fail for tools/bpf/bpf_jit_disasm.c, e.g. on debian
+unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+Wire up the feature test and switch to init_disassemble_info_compat(),
+which were introduced in prior commits, fixing the compilation failure.
+
+I verified that bpf_jit_disasm can still disassemble bpf programs, both
+with the old and new dis-asm.h API. With old binutils there's no change in
+output before/after this patch. When comparing the output from old
+binutils (2.35) to new bintuils with the patch (upstream snapshot) there
+are a few output differences, but they are unrelated to this patch. An
+example hunk is:
+
+     f4:	mov    %r14,%rsi
+     f7:	mov    %r15,%rdx
+     fa:	mov    $0x2a,%ecx
+  -  ff:	callq  0xffffffffea8c4988
+  +  ff:	call   0xffffffffea8c4988
+    104:	test   %rax,%rax
+    107:	jge    0x0000000000000110
+    109:	xor    %eax,%eax
+  - 10b:	jmpq   0x0000000000000073
+  + 10b:	jmp    0x0000000000000073
+    110:	cmp    $0x16,%rax
+
+However, I had to use an older kernel to generate the bpf_jit_enabled =
+2 output, as that has been broken since 5.18 / 1022a5498f6f745c ("bpf,
+x86_64: Use bpf_jit_binary_pack_alloc").
+
+  https://lore.kernel.org/20220703030210.pmjft7qc2eajzi6c@alap3.anarazel.de
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Daniel Borkmann <daniel@iogearbox.net>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Quentin Monnet <quentin@isovalent.com>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-6-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/bpf/Makefile         | 5 ++++-
+ tools/bpf/bpf_jit_disasm.c | 5 ++++-
+ 2 files changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/tools/bpf/Makefile b/tools/bpf/Makefile
+index b11cfc86a3d021..664601ab1705ab 100644
+--- a/tools/bpf/Makefile
++++ b/tools/bpf/Makefile
+@@ -34,7 +34,7 @@ else
+ endif
+ 
+ FEATURE_USER = .bpf
+-FEATURE_TESTS = libbfd disassembler-four-args
++FEATURE_TESTS = libbfd disassembler-four-args disassembler-init-styled
+ FEATURE_DISPLAY = libbfd disassembler-four-args
+ 
+ check_feat := 1
+@@ -56,6 +56,9 @@ endif
+ ifeq ($(feature-disassembler-four-args), 1)
+ CFLAGS += -DDISASM_FOUR_ARGS_SIGNATURE
+ endif
++ifeq ($(feature-disassembler-init-styled), 1)
++CFLAGS += -DDISASM_INIT_STYLED
++endif
+ 
+ $(OUTPUT)%.yacc.c: $(srctree)/tools/bpf/%.y
+ 	$(QUIET_BISON)$(YACC) -o $@ -d $<
+diff --git a/tools/bpf/bpf_jit_disasm.c b/tools/bpf/bpf_jit_disasm.c
+index c8ae9580472814..a90a5d110f9255 100644
+--- a/tools/bpf/bpf_jit_disasm.c
++++ b/tools/bpf/bpf_jit_disasm.c
+@@ -28,6 +28,7 @@
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <limits.h>
++#include <tools/dis-asm-compat.h>
+ 
+ #define CMD_ACTION_SIZE_BUFFER		10
+ #define CMD_ACTION_READ_ALL		3
+@@ -64,7 +65,9 @@ static void get_asm_insns(uint8_t *image, size_t len, int opcodes)
+ 	assert(bfdf);
+ 	assert(bfd_check_format(bfdf, bfd_object));
+ 
+-	init_disassemble_info(&info, stdout, (fprintf_ftype) fprintf);
++	init_disassemble_info_compat(&info, stdout,
++				     (fprintf_ftype) fprintf,
++				     fprintf_styled);
+ 	info.arch = bfd_get_arch(bfdf);
+ 	info.mach = bfd_get_mach(bfdf);
+ 	info.buffer = image;
diff --git a/srcpkgs/linux-tools/patches/bpftool-binutils-2.39.patch b/srcpkgs/linux-tools/patches/bpftool-binutils-2.39.patch
new file mode 100644
index 000000000000..1e55c40011be
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/bpftool-binutils-2.39.patch
@@ -0,0 +1,149 @@
+From 600b7b26c07a070d0153daa76b3806c1e52c9e00 Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:33 -0700
+Subject: [PATCH] tools bpftool: Fix compilation error with new binutils
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation to fail for tools/bpf/bpftool/jit_disasm.c, e.g. on debian
+unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+Wire up the feature test and switch to init_disassemble_info_compat(),
+which were introduced in prior commits, fixing the compilation failure.
+
+I verified that bpftool can still disassemble bpf programs, both with an
+old and new dis-asm.h API. There are no output changes for plain and json
+formats. When comparing the output from old binutils (2.35)
+to new bintuils with the patch (upstream snapshot) there are a few output
+differences, but they are unrelated to this patch. An example hunk is:
+
+     2f:	pop    %r14
+     31:	pop    %r13
+     33:	pop    %rbx
+  -  34:	leaveq
+  -  35:	retq
+  +  34:	leave
+  +  35:	ret
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Quentin Monnet <quentin@isovalent.com>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-8-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/bpf/bpftool/Makefile     |  5 +++-
+ tools/bpf/bpftool/jit_disasm.c | 42 +++++++++++++++++++++++++++-------
+ 2 files changed, 38 insertions(+), 9 deletions(-)
+
+diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile
+index c6d2c77d02524a..436e671b2657d4 100644
+--- a/tools/bpf/bpftool/Makefile
++++ b/tools/bpf/bpftool/Makefile
+@@ -62,7 +62,7 @@ CLANG ?= clang
+ LLVM_STRIP ?= llvm-strip
+ 
+ FEATURE_USER = .bpftool
+-FEATURE_TESTS = libbfd disassembler-four-args reallocarray zlib libcap \
++FEATURE_TESTS = libbfd disassembler-four-args disassembler-init-styled reallocarray zlib libcap \
+ 	clang-bpf-co-re
+ FEATURE_DISPLAY = libbfd disassembler-four-args zlib libcap \
+ 	clang-bpf-co-re
+@@ -117,6 +117,9 @@ endif
+ ifeq ($(feature-disassembler-four-args), 1)
+ CFLAGS += -DDISASM_FOUR_ARGS_SIGNATURE
+ endif
++ifeq ($(feature-disassembler-init-styled), 1)
++    CFLAGS += -DDISASM_INIT_STYLED
++endif
+ 
+ LIBS = $(LIBBPF) -lelf -lz
+ LIBS_BOOTSTRAP = $(LIBBPF_BOOTSTRAP) -lelf -lz
+diff --git a/tools/bpf/bpftool/jit_disasm.c b/tools/bpf/bpftool/jit_disasm.c
+index 24734f2249d6ec..aaf99a0168c90b 100644
+--- a/tools/bpf/bpftool/jit_disasm.c
++++ b/tools/bpf/bpftool/jit_disasm.c
+@@ -24,6 +24,7 @@
+ #include <sys/stat.h>
+ #include <limits.h>
+ #include <bpf/libbpf.h>
++#include <tools/dis-asm-compat.h>
+ 
+ #include "json_writer.h"
+ #include "main.h"
+@@ -39,15 +40,12 @@ static void get_exec_path(char *tpath, s
+ }
+ 
+ static int oper_count;
+-static int fprintf_json(void *out, const char *fmt, ...)
++static int printf_json(void *out, const char *fmt, va_list ap)
+ {
+-	va_list ap;
+ 	char *s;
+ 
+-	va_start(ap, fmt);
+ 	if (vasprintf(&s, fmt, ap) < 0)
+ 		return -1;
+-	va_end(ap);
+ 
+ 	if (!oper_count) {
+ 		int i;
+@@ -73,6 +71,32 @@ static int fprintf_json(void *out, const char *fmt, ...)
+ 	return 0;
+ }
+ 
++static int fprintf_json(void *out, const char *fmt, ...)
++{
++	va_list ap;
++	int r;
++
++	va_start(ap, fmt);
++	r = printf_json(out, fmt, ap);
++	va_end(ap);
++
++	return r;
++}
++
++static int fprintf_json_styled(void *out,
++			       enum disassembler_style style __maybe_unused,
++			       const char *fmt, ...)
++{
++	va_list ap;
++	int r;
++
++	va_start(ap, fmt);
++	r = printf_json(out, fmt, ap);
++	va_end(ap);
++
++	return r;
++}
++
+ void disasm_print_insn(unsigned char *image, ssize_t len, int opcodes,
+ 		       const char *arch, const char *disassembler_options,
+ 		       const struct btf *btf,
+@@ -99,11 +123,13 @@ void disasm_print_insn(unsigned char *image, ssize_t len, int opcodes,
+ 	assert(bfd_check_format(bfdf, bfd_object));
+ 
+ 	if (json_output)
+-		init_disassemble_info(&info, stdout,
+-				      (fprintf_ftype) fprintf_json);
++		init_disassemble_info_compat(&info, stdout,
++					     (fprintf_ftype) fprintf_json,
++					     fprintf_json_styled);
+ 	else
+-		init_disassemble_info(&info, stdout,
+-				      (fprintf_ftype) fprintf);
++		init_disassemble_info_compat(&info, stdout,
++					     (fprintf_ftype) fprintf,
++					     fprintf_styled);
+ 
+ 	/* Update architecture info for offload. */
+ 	if (arch) {
diff --git a/srcpkgs/linux-tools/patches/perf-binutils-2.39.patch b/srcpkgs/linux-tools/patches/perf-binutils-2.39.patch
new file mode 100644
index 000000000000..3484330f7286
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/perf-binutils-2.39.patch
@@ -0,0 +1,114 @@
+From 83aa0120487e8bc3f231e72c460add783f71f17c Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:30 -0700
+Subject: [PATCH] tools perf: Fix compilation error with new binutils
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation failures for tools/perf/util/annotate.c, e.g. on debian
+unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+Wire up the feature test and switch to init_disassemble_info_compat(),
+which were introduced in prior commits, fixing the compilation failure.
+
+I verified that perf can still disassemble bpf programs by using bpftrace
+under load, recording a perf trace, and then annotating the bpf "function"
+with and without the changes. With old binutils there's no change in output
+before/after this patch. When comparing the output from old binutils (2.35)
+to new bintuils with the patch (upstream snapshot) there are a few output
+differences, but they are unrelated to this patch. An example hunk is:
+
+       1.15 :   55:mov    %rbp,%rdx
+       0.00 :   58:add    $0xfffffffffffffff8,%rdx
+       0.00 :   5c:xor    %ecx,%ecx
+  -    1.03 :   5e:callq  0xffffffffe12aca3c
+  +    1.03 :   5e:call   0xffffffffe12aca3c
+       0.00 :   63:xor    %eax,%eax
+  -    2.18 :   65:leaveq
+  -    2.82 :   66:retq
+  +    2.18 :   65:leave
+  +    2.82 :   66:ret
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-5-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/perf/Makefile.config | 8 ++++++++
+ tools/perf/util/annotate.c | 7 ++++---
+ 2 files changed, 12 insertions(+), 3 deletions(-)
+
+diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
+index d3c254c0f5c611..23648ea54e8d3d 100644
+--- a/tools/perf/Makefile.config
++++ b/tools/perf/Makefile.config
+@@ -298,6 +298,7 @@ FEATURE_CHECK_LDFLAGS-libpython := $(PYTHON_EMBED_LDOPTS)
+ FEATURE_CHECK_LDFLAGS-libaio = -lrt
+ 
+ FEATURE_CHECK_LDFLAGS-disassembler-four-args = -lbfd -lopcodes -ldl
++FEATURE_CHECK_LDFLAGS-disassembler-init-styled = -lbfd -lopcodes -ldl
+ 
+ CORE_CFLAGS += -fno-omit-frame-pointer
+ CORE_CFLAGS += -ggdb3
+@@ -818,13 +819,16 @@ else
+   ifeq ($(feature-libbfd-liberty), 1)
+     EXTLIBS += -lbfd -lopcodes -liberty
+     FEATURE_CHECK_LDFLAGS-disassembler-four-args += -liberty -ldl
++    FEATURE_CHECK_LDFLAGS-disassembler-init-styled += -liberty -ldl
+   else
+     ifeq ($(feature-libbfd-liberty-z), 1)
+       EXTLIBS += -lbfd -lopcodes -liberty -lz
+       FEATURE_CHECK_LDFLAGS-disassembler-four-args += -liberty -lz -ldl
++      FEATURE_CHECK_LDFLAGS-disassembler-init-styled += -liberty -lz -ldl
+     endif
+   endif
+   $(call feature_check,disassembler-four-args)
++  $(call feature_check,disassembler-init-styled)
+ endif
+ 
+ ifeq ($(feature-libbfd-buildid), 1)
+@@ -1044,6 +1048,10 @@ ifeq ($(feature-disassembler-four-args), 1)
+     CFLAGS += -DDISASM_FOUR_ARGS_SIGNATURE
+ endif
+ 
++ifeq ($(feature-disassembler-init-styled), 1)
++    CFLAGS += -DDISASM_INIT_STYLED
++endif
++
+ ifeq (${IS_64_BIT}, 1)
+   ifndef NO_PERF_READ_VDSO32
+     $(call feature_check,compile-32)
+diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
+index 82cc396ef516c4..2c6a485c3de5d9 100644
+--- a/tools/perf/util/annotate.c
++++ b/tools/perf/util/annotate.c
+@@ -1676,6 +1676,7 @@ fallback:
+ #define PACKAGE "perf"
+ #include <bfd.h>
+ #include <dis-asm.h>
++#include <tools/dis-asm-compat.h>
+ 
+ static int symbol__disassemble_bpf(struct symbol *sym,
+ 				   struct annotate_args *args)
+@@ -1762,9 +1763,9 @@ static int symbol__disassemble_bpf(struct symbol *sym,
+ 		ret = errno;
+ 		goto out;
+ 	}
+-	init_disassemble_info(&info, s,
+-			      (fprintf_ftype) fprintf);
+-
++	init_disassemble_info_compat(&info, s,
++				     (fprintf_ftype) fprintf,
++				     fprintf_styled);
+ 	info.arch = bfd_get_arch(bfdf);
+ 	info.mach = bfd_get_mach(bfdf);
+ 

From 2829ba858f28b64beb6e8ff3c3cd7fa70fb00695 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 14:45:28 -0700
Subject: [PATCH 26/52] libsasl: fix build for libtool 2.4.7

---
 srcpkgs/libsasl/template | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/libsasl/template b/srcpkgs/libsasl/template
index a8817042f843..a2993b39f4a1 100644
--- a/srcpkgs/libsasl/template
+++ b/srcpkgs/libsasl/template
@@ -19,6 +19,7 @@ distfiles="https://github.com/cyrusimap/cyrus-sasl/releases/download/cyrus-sasl-
 checksum=26866b1549b00ffd020f188a43c258017fa1c382b3ddadd8201536f72efb05d5
 
 pre_configure() {
+	rm -f m4/ltversion.m4
 	autoreconf -fi
 }
 

From 69342224c4e1ff0e2b651e28d1068f08e3222632 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:08 -0700
Subject: [PATCH 27/52] subversion: fix build for libtool 2.4.7

---
 srcpkgs/subversion/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion/template b/srcpkgs/subversion/template
index 8ad178264942..3f1c9e254e61 100644
--- a/srcpkgs/subversion/template
+++ b/srcpkgs/subversion/template
@@ -57,7 +57,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From f48cd31424fc09faeb66656419f624dba1bcb220 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:38 -0700
Subject: [PATCH 28/52] subversion-kwallet-auth: fix build for libtool 2.4.7

---
 srcpkgs/subversion-kwallet-auth/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion-kwallet-auth/template b/srcpkgs/subversion-kwallet-auth/template
index 12210f250d51..b4d8621456ea 100644
--- a/srcpkgs/subversion-kwallet-auth/template
+++ b/srcpkgs/subversion-kwallet-auth/template
@@ -59,7 +59,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From 843f50cdd29234260e006ea3628ddac08f9e0798 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 20:07:32 -0700
Subject: [PATCH 29/52] gpgme: update to 1.18.0.

---
 common/shlibs          | 2 +-
 srcpkgs/gpgme/template | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 52220e69706d..98017bdd5e3d 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -723,7 +723,7 @@ libdconf.so.1 dconf-0.13.90_1
 libassuan.so.0 libassuan-2.0.1_1
 libgpgme.so.11 libgpgme-1.12.0_2
 libgpgmepp.so.6 gpgmepp-1.7.0_3
-libqgpgme.so.7 gpgmeqt-1.7.0_3
+libqgpgme.so.15 gpgmeqt-1.18.0_1
 libgarcon-1.so.0 garcon-0.1.12_1
 libgarcon-gtk2-1.so.0 garcon-0.4.0_1
 libgarcon-gtk3-1.so.0 garcon-0.6.1_1
diff --git a/srcpkgs/gpgme/template b/srcpkgs/gpgme/template
index 8633075a8404..b1cfd5f78657 100644
--- a/srcpkgs/gpgme/template
+++ b/srcpkgs/gpgme/template
@@ -1,7 +1,7 @@
 # Template file for 'gpgme'
 pkgname=gpgme
-version=1.15.1
-revision=2
+version=1.18.0
+revision=1
 build_style=gnu-configure
 configure_args="--enable-fd-passing
  --with-libgpg-error-prefix=$XBPS_CROSS_BASE/usr
@@ -14,7 +14,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.gnupg.org/software/gpgme/index.html"
 distfiles="https://www.gnupg.org/ftp/gcrypt/gpgme/gpgme-${version}.tar.bz2"
-checksum=eebc3c1b27f1c8979896ff361ba9bb4778b508b2496c2fc10e3775a40b1de1ad
+checksum=361d4eae47ce925dba0ea569af40e7b52c645c4ae2e65e5621bf1b6cdd8b0e9e
 
 if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
 	configure_args+=" ac_cv_sys_file_offset_bits=no"

From 0706fc100886e2692832ff4bd305de7a81a715d2 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 30/52] cross-aarch64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..bd6b23f9fb6a 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 2abe07b8f861ef96a00ca8abe85a65a522884db3 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 31/52] cross-aarch64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..427ad2c1e9cd 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From fc5e18e514783e9b0882a2a18d013ae550d57a5b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 32/52] cross-arm-linux-gnueabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..2510ee26e789 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 4444a5e3daff4a1b79bb03fc4a372c9d1ac0baa9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 33/52] cross-arm-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..bd8b16e1b4c1 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 9e170216b740fbcd2bbeef2116ea2bb0ea926737 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 34/52] cross-arm-linux-musleabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..93145232d7cb 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -18,12 +18,12 @@ homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 4c98d34d9918b7bd1101d5b00815fe4b9170d44f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 35/52] cross-arm-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..9ddd32a9f20d 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From bf0a3217d991afaefb1c577d17f88601db23a65e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 36/52] cross-armv7l-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..9fb00f18be3b 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From d69d0da745ec62c67c898ef13189658e0715f821 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 37/52] cross-armv7l-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..2c72e75ddfe3 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From d81884047826e93418827229244864bff707e89a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 38/52] cross-i686-pc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..4dc17df648b5 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 35c6ca6e9c89af6b3d39c4a0c76592cadf9bb2c9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 39/52] cross-mips-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..6009e5c79eb2 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 2bc02dccbfba172b8762590cbb6b88df60e42e6a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 40/52] cross-mips-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..080164df193d 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="hipperson0 <hipperson0@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 510e3522b40a5a785284854e92bb9cce5849b144 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 41/52] cross-mipsel-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..c8f90cfa43cc 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_musl_version=1.1.24
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 9171d7addf5b40bd5dac027dec622f6bee02acaa Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 42/52] cross-mipsel-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..931345d2de15 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_musl_version=1.1.24
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 614b38365e9c3abb2f24129e3c1032c2b365d897 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 43/52] cross-powerpc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..31e57b4e52b2 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 0e51a024246c41ad04b890ba1f89fe0c4cd2d999 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 44/52] cross-powerpc-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..a2d1edcf1ffd 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 62e6be3f459c3bb61026da1d32091914d75e0346 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 45/52] cross-powerpc64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..1a4cbed61e76 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From ca22928f3fb871fd126efbfee2e9702317fe81a3 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 46/52] cross-powerpc64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 1ebd0fb2048d..ade42018af05 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 384c5747f0b7b0abfc44e027b3cb1185417c9468 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 47/52] cross-powerpc64le-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 733f5851da5c..dd1ad383a21e 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 91d6a05ea20c5f871f89e49d329d27a4535d4f63 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 48/52] cross-powerpc64le-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index 76a70aa1d6db..5887f845f932 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 5bf9f6fb7974980bfeb20c530f097138858b7b5d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 49/52] cross-powerpcle-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 347b8fcf4f55..06530e0d609b 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 3a561a89f5c9259244d998927099fbaaeaed118b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:19 -0700
Subject: [PATCH 50/52] cross-powerpcle-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index ec9324ddaa99..e68c3962b49c 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 1a9f3f210249c3a9ced714564c53330261d58ee1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:19 -0700
Subject: [PATCH 51/52] cross-x86_64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 0078fbe7224b..7da85c14b62d 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From e869242fb43374f4c60aa3cef73e8256c8e0c0c4 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:19 -0700
Subject: [PATCH 52/52] cross-x86_64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..2811de0d3c2e 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.1.0
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (46 preceding siblings ...)
  2022-08-24 20:43 ` oreo639
@ 2022-08-24 20:52 ` oreo639
  2022-08-24 23:42 ` [PR PATCH] [Updated] gcc: update to 12.2.0 oreo639
                   ` (216 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-08-24 20:52 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5537 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.1.0
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.1.0

This PR depends on: https://github.com/void-linux/void-packages/pull/32330

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

Also, keep in mind that the libgo musl patch here will need to be updated once musl is updated:
https://github.com/void-linux/void-packages/pull/34902/files#diff-1f42a95b93c9550178ff1fbccbef2f47a72711df15c24c9472e2550076978129R163-R176

This is the updated patch for reference:
https://github.com/alpinelinux/aports/blob/8acb21b8ee881e7ab1c812d9a66a17d2501b8730/main/gcc/0049-libgo-adjust-name-of-union-in-sigevent-struct.patch

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/38817
- [x] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [ ] llvm https://github.com/void-linux/void-packages/pull/38694
- [ ] m4 https://github.com/void-linux/void-packages/pull/33730
- [ ] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [ ] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [ ] libvirt https://github.com/void-linux/void-packages/pull/38842
- [ ] syslinux https://github.com/void-linux/void-packages/pull/38876
- [ ] efivar https://github.com/void-linux/void-packages/pull/38874

Known packages that needed to be fixed/updated for gcc12:
- [ ] linux5.18 (in this PR)
- [ ] openssh https://github.com/void-linux/void-packages/pull/38849
- [ ] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [ ] doxygen https://github.com/void-linux/void-packages/pull/38846
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/38817
- [ ] libproxy https://github.com/void-linux/void-packages/pull/38818
- [ ] exempi https://github.com/void-linux/void-packages/pull/38820
- [ ] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [ ] gpgme https://github.com/void-linux/void-packages/pull/38825
- [ ] libunique1 https://github.com/void-linux/void-packages/pull/38848 or https://github.com/void-linux/void-packages/pull/38873
- [ ] libwpd https://github.com/void-linux/void-packages/pull/38878

Needs to be fixed/updated for binutils:
- [ ] grub https://github.com/void-linux/void-packages/pull/38875
- [ ] linux-tools https://github.com/void-linux/void-packages/pull/38877

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [x] kde
- [x] lxde
- [x] lxqt

You can test the ISOs here:
https://drive.google.com/drive/folders/1ix92CYSLUP-KWjLxltdgG4e8Nu2JCY5n?usp=sharing

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 168445 bytes --]

From 6ee5df42f68dd39de720e332049229c05238bf04 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 01/52] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 15 +++--
 3 files changed, 28 insertions(+), 113 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..4bdaee582d71 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkg-config"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -44,6 +45,12 @@ do_configure() {
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	case "$XBPS_TARGET_MACHINE" in
+		*-musl)
+			conf+=" --disable-gprofng"
+			;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"

From de492f622d1c9681b350358a203c0b9d5fc3d381 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 02/52] gcc: update to 12.2.0.

---
 common/shlibs                                 | 10 +--
 srcpkgs/gcc/files/gccgo-musl.patch            | 74 ++++---------------
 srcpkgs/gcc/files/libgnarl-musl.patch         | 18 ++---
 srcpkgs/gcc/files/libssp-musl.patch           | 10 +--
 srcpkgs/gcc/patches/libffi_gnulinux.patch     | 11 ---
 .../gcc/patches/libgcc-ibm128-no-tag.patch    | 10 ++-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |  2 +-
 srcpkgs/gcc/template                          | 25 +++----
 8 files changed, 52 insertions(+), 108 deletions(-)
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index f829ee12e80f..bde5320461ce 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.2.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.34 perl-5.34.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -848,8 +848,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.2.0_1
+libgnat-12.so libada-12.2.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1700,8 +1700,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.2.0_1
+libasan.so.8 libsanitizer-12.2.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..632ef951097b 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,17 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ a/libgo/go/runtime/os_linux.go
+@@ -363,9 +363,9 @@
+ 
+ 	var timerid int32
+ 	var sevp _sigevent
+-	sevp.sigev_notify = _SIGEV_THREAD_ID
++	sevp.sigev_notify = 4
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.sigev_notify_function))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..446741390d45 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,15 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
+version=12.2.0
+revision=1
 _patchver="${version%pre*}"
 _minorver="${_patchver%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 wrksrc=gcc-${version/pre/_pre}
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +19,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -396,7 +393,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}

From 86796b4ea69abe762b198571ad51500d6ddc3b25 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 03/52] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      |  6 ++--
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..08e35d466a44 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From 2ad1b5cfd4d996d62d663615c5c894dc539727b4 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 04/52] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 1a4e1ca3d594..b04268908c2e 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="q66 <daniel@octaforge.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From 5a29fe90555e559d5527a2510fdb39bb5e4f354c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 05/52] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 3 files changed, 55 insertions(+), 353 deletions(-)
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index bde5320461ce..52220e69706d 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From 22bb3ef108e466119251680b7ac00ae6ee1556d6 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 21:01:43 -0700
Subject: [PATCH 06/52] gcc-multilib: update to 12.2.0.

---
 srcpkgs/gcc-multilib/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index fcd25755aa75..1a26da26a991 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,16 +3,16 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _majorver="${version%.*}"
-wrksrc=gcc-${version/pre/_pre}
+wrksrc=gcc-${version}
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel

From 1e724a6afdea5116621bf20cd54ffc405f859ea5 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 16:22:03 -0700
Subject: [PATCH 07/52] llvm12: fix build for glibc 2.36

---
 .../compiler-rt-sanitizer-glibc-2.36.patch    | 59 +++++++++++++++++++
 1 file changed, 59 insertions(+)
 create mode 100644 srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch

diff --git a/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch b/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch
new file mode 100644
index 000000000000..e5f24dab8935
--- /dev/null
+++ b/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch
@@ -0,0 +1,59 @@
+From 9cf13067cb5088626ba7ee1ec4c42ec59c7995a0 Mon Sep 17 00:00:00 2001
+From: Fangrui Song <i@maskray.me>
+Date: Mon, 11 Jul 2022 12:53:34 -0700
+Subject: [PATCH] [sanitizer] Remove #include <linux/fs.h> to resolve
+ fsconfig_command/mount_attr conflict with glibc 2.36
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+It is generally not a good idea to mix usage of glibc headers and Linux UAPI
+headers (https://sourceware.org/glibc/wiki/Synchronizing_Headers). In glibc
+since 7eae6a91e9b1670330c9f15730082c91c0b1d570 (milestone: 2.36), sys/mount.h
+defines `fsconfig_command` which conflicts with linux/mount.h:
+
+    .../usr/include/linux/mount.h:95:6: error: redeclaration of ‘enum fsconfig_command’
+
+Remove #include <linux/fs.h> which pulls in linux/mount.h. Expand its 4 macros manually.
+Android sys/mount.h doesn't define BLKBSZGET and it still needs linux/fs.h.
+In the long term we should move Linux specific definitions to sanitizer_platform_limits_linux.cpp
+but this commit is easy to cherry pick into older compiler-rt releases.
+
+Fix https://github.com/llvm/llvm-project/issues/56421
+
+Reviewed By: #sanitizers, vitalybuka, zatrazz
+
+Differential Revision: https://reviews.llvm.org/D129471
+---
+ .../sanitizer_platform_limits_posix.cpp                | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+index 4bd425435d56d..3a94b260686f1 100644
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -73,7 +73,9 @@
+ #include <sys/vt.h>
+ #include <linux/cdrom.h>
+ #include <linux/fd.h>
++#if SANITIZER_ANDROID
+ #include <linux/fs.h>
++#endif
+ #include <linux/hdreg.h>
+ #include <linux/input.h>
+ #include <linux/ioctl.h>
+@@ -876,10 +878,10 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
+   unsigned IOCTL_EVIOCGPROP = IOCTL_NOT_PRESENT;
+   unsigned IOCTL_EVIOCSKEYCODE_V2 = IOCTL_NOT_PRESENT;
+ #endif
+-  unsigned IOCTL_FS_IOC_GETFLAGS = FS_IOC_GETFLAGS;
+-  unsigned IOCTL_FS_IOC_GETVERSION = FS_IOC_GETVERSION;
+-  unsigned IOCTL_FS_IOC_SETFLAGS = FS_IOC_SETFLAGS;
+-  unsigned IOCTL_FS_IOC_SETVERSION = FS_IOC_SETVERSION;
++  unsigned IOCTL_FS_IOC_GETFLAGS = _IOR('f', 1, long);
++  unsigned IOCTL_FS_IOC_GETVERSION = _IOR('v', 1, long);
++  unsigned IOCTL_FS_IOC_SETFLAGS = _IOW('f', 2, long);
++  unsigned IOCTL_FS_IOC_SETVERSION = _IOW('v', 2, long);
+   unsigned IOCTL_GIO_CMAP = GIO_CMAP;
+   unsigned IOCTL_GIO_FONT = GIO_FONT;
+   unsigned IOCTL_GIO_UNIMAP = GIO_UNIMAP;

From e6a8a2c53d73dbbec2ffc7a9a59337d3306f0041 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 17:21:40 -0700
Subject: [PATCH 08/52] m4: update to 1.4.19.

---
 srcpkgs/m4/patches/fix-glibc-2.27.patch | 167 ------------------------
 srcpkgs/m4/template                     |  12 +-
 2 files changed, 6 insertions(+), 173 deletions(-)
 delete mode 100644 srcpkgs/m4/patches/fix-glibc-2.27.patch

diff --git a/srcpkgs/m4/patches/fix-glibc-2.27.patch b/srcpkgs/m4/patches/fix-glibc-2.27.patch
deleted file mode 100644
index 59d33cff164d..000000000000
--- a/srcpkgs/m4/patches/fix-glibc-2.27.patch
+++ /dev/null
@@ -1,167 +0,0 @@
-From 4af4a4a71827c0bc5e0ec67af23edef4f15cee8e Mon Sep 17 00:00:00 2001
-From: Paul Eggert <eggert@cs.ucla.edu>
-Date: Mon, 5 Mar 2018 10:56:29 -0800
-Subject: [PATCH] fflush: adjust to glibc 2.28 libio.h removal
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Problem reported by Daniel P. Berrangé in:
-https://lists.gnu.org/r/bug-gnulib/2018-03/msg00000.html
-* lib/fbufmode.c (fbufmode):
-* lib/fflush.c (clear_ungetc_buffer_preserving_position)
-(disable_seek_optimization, rpl_fflush):
-* lib/fpending.c (__fpending):
-* lib/fpurge.c (fpurge):
-* lib/freadable.c (freadable):
-* lib/freadahead.c (freadahead):
-* lib/freading.c (freading):
-* lib/freadptr.c (freadptr):
-* lib/freadseek.c (freadptrinc):
-* lib/fseeko.c (fseeko):
-* lib/fseterr.c (fseterr):
-* lib/fwritable.c (fwritable):
-* lib/fwriting.c (fwriting):
-Check _IO_EOF_SEEN instead of _IO_ftrylockfile.
-* lib/stdio-impl.h (_IO_IN_BACKUP) [_IO_EOF_SEEN]:
-Define if not already defined.
-
-[yann.morin.1998@free.fr: partially backport from upstream gnulib]
-Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
-
----
- lib/fflush.c     |  6 +++---
- lib/fpending.c   |  2 +-
- lib/fpurge.c     |  2 +-
- lib/freadahead.c |  2 +-
- lib/freading.c   |  2 +-
- lib/fseeko.c     |  4 ++--
- lib/stdio-impl.h |  6 ++++++
- 7 files changed, 15 insertions(+), 9 deletions(-)
-
-diff --git a/lib/fflush.c b/build-aux/gnulib/lib/fflush.c
-index 983ade0ff..a6edfa105 100644
---- a/lib/fflush.c
-+++ b/lib/fflush.c
-@@ -33,7 +33,7 @@
- #undef fflush
- 
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- 
- /* Clear the stream's ungetc buffer, preserving the value of ftello (fp).  */
- static void
-@@ -72,7 +72,7 @@ clear_ungetc_buffer (FILE *fp)
- 
- #endif
- 
--#if ! (defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
-+#if ! (defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
- 
- # if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT
- /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
-@@ -148,7 +148,7 @@ rpl_fflush (FILE *stream)
-   if (stream == NULL || ! freading (stream))
-     return fflush (stream);
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- 
-   clear_ungetc_buffer_preserving_position (stream);
- 
-diff --git a/lib/fpending.c b/build-aux/gnulib/lib/fpending.c
-index c84e3a5b4..789f50e4e 100644
---- a/lib/fpending.c
-+++ b/lib/fpending.c
-@@ -32,7 +32,7 @@ __fpending (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   return fp->_IO_write_ptr - fp->_IO_write_base;
- #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
-   /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
-diff --git a/lib/fpurge.c b/build-aux/gnulib/lib/fpurge.c
-index b1d417c7a..3aedcc373 100644
---- a/lib/fpurge.c
-+++ b/lib/fpurge.c
-@@ -62,7 +62,7 @@ fpurge (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   fp->_IO_read_end = fp->_IO_read_ptr;
-   fp->_IO_write_ptr = fp->_IO_write_base;
-   /* Avoid memory leak when there is an active ungetc buffer.  */
-diff --git a/lib/freadahead.c b/build-aux/gnulib/lib/freadahead.c
-index c2ecb5b28..23ec76ee5 100644
---- a/lib/freadahead.c
-+++ b/lib/freadahead.c
-@@ -30,7 +30,7 @@ extern size_t __sreadahead (FILE *);
- size_t
- freadahead (FILE *fp)
- {
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   if (fp->_IO_write_ptr > fp->_IO_write_base)
-     return 0;
-   return (fp->_IO_read_end - fp->_IO_read_ptr)
-diff --git a/lib/freading.c b/build-aux/gnulib/lib/freading.c
-index 73c28acdd..c24d0c88a 100644
---- a/lib/freading.c
-+++ b/lib/freading.c
-@@ -31,7 +31,7 @@ freading (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   return ((fp->_flags & _IO_NO_WRITES) != 0
-           || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0
-               && fp->_IO_read_base != NULL));
-diff --git a/lib/fseeko.c b/build-aux/gnulib/lib/fseeko.c
-index 0101ab55f..193f4e8ce 100644
---- a/lib/fseeko.c
-+++ b/lib/fseeko.c
-@@ -47,7 +47,7 @@ fseeko (FILE *fp, off_t offset, int whence)
- #endif
- 
-   /* These tests are based on fpurge.c.  */
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   if (fp->_IO_read_end == fp->_IO_read_ptr
-       && fp->_IO_write_ptr == fp->_IO_write_base
-       && fp->_IO_save_base == NULL)
-@@ -123,7 +123,7 @@ fseeko (FILE *fp, off_t offset, int whence)
-           return -1;
-         }
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-       fp->_flags &= ~_IO_EOF_SEEN;
-       fp->_offset = pos;
- #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
-diff --git a/lib/stdio-impl.h b/build-aux/gnulib/lib/stdio-impl.h
-index 78d896e9f..05c5752a2 100644
---- a/lib/stdio-impl.h
-+++ b/lib/stdio-impl.h
-@@ -18,6 +18,12 @@
-    the same implementation of stdio extension API, except that some fields
-    have different naming conventions, or their access requires some casts.  */
- 
-+/* Glibc 2.28 made _IO_IN_BACKUP private.  For now, work around this
-+   problem by defining it ourselves.  FIXME: Do not rely on glibc
-+   internals.  */
-+#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN
-+# define _IO_IN_BACKUP 0x100
-+#endif
- 
- /* BSD stdio derived implementations.  */
- 
--- 
-2.14.1
-
-
diff --git a/srcpkgs/m4/template b/srcpkgs/m4/template
index 78f3dae6184a..762593d883bd 100644
--- a/srcpkgs/m4/template
+++ b/srcpkgs/m4/template
@@ -1,17 +1,17 @@
 # Template file for 'm4'
 pkgname=m4
-version=1.4.18
-revision=2
+version=1.4.19
+revision=1
 bootstrap=yes
-replaces="chroot-m4>=0"
 build_style=gnu-configure
 configure_args="--enable-changeword --enable-threads"
 short_desc="GNU version of UNIX m4 macro language processor"
-homepage="https://www.gnu.org/software/m4/"
-license="GPL-3.0-or-later"
 maintainer="Enno Boland <gottox@voidlinux.org>"
+license="GPL-3.0-or-later"
+homepage="https://www.gnu.org/software/m4/"
 distfiles="${GNU_SITE}/${pkgname}/${pkgname}-${version}.tar.xz"
-checksum=f2c1e86ca0a404ff281631bdc8377638992744b175afb806e25871a24a934e07
+checksum=63aede5c6d33b6d9b13511cd0be2cac046f2e70fd0a07aa9573a04a82783af96
+replaces="chroot-m4>=0"
 
 if [ "$XBPS_TARGET_LIBC" = musl ]; then
 	export ac_cv_lib_error_at_line=no

From a690c9b5c2fd4d12d1dd2f4a0ae989f4e1fa9ee1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 22:57:59 -0700
Subject: [PATCH 09/52] btrfs-progs: update to 5.19.

---
 srcpkgs/btrfs-progs/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/btrfs-progs/template b/srcpkgs/btrfs-progs/template
index f6c53d8587e1..292d5110106b 100644
--- a/srcpkgs/btrfs-progs/template
+++ b/srcpkgs/btrfs-progs/template
@@ -1,6 +1,6 @@
 # Template file for 'btrfs-progs'
 pkgname=btrfs-progs
-version=5.18.1
+version=5.19
 revision=1
 wrksrc="${pkgname}-v${version}"
 build_style=gnu-configure
@@ -16,7 +16,7 @@ license="GPL-2.0-only, LGPL-2.1-or-later"
 homepage="https://btrfs.wiki.kernel.org/index.php/Main_Page"
 changelog="https://raw.githubusercontent.com/kdave/btrfs-progs/master/CHANGES"
 distfiles="${KERNEL_SITE}/kernel/people/kdave/${pkgname}/${pkgname}-v${version}.tar.xz"
-checksum=6e98a75ccff52e9354daa1ad284c614c490f844273a2fa524cbac9eb841c7255
+checksum=1fbcf06e4b2f80e7a127fd687ed4625a5b74fa674fe212c836ff70e0edfcccf9
 # Most of the tests depend on `mount` and `fallocate` commands, which are not
 # presented in chroot-util-linux
 make_check=no

From 84b963eb70070c56f2d6f85a751206cba888f455 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 19:39:23 -0700
Subject: [PATCH 10/52] syslinux: fix build for glibc 2.36

---
 .../patches/fix-build-with-glibc-2.36.patch   | 30 +++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 srcpkgs/syslinux/patches/fix-build-with-glibc-2.36.patch

diff --git a/srcpkgs/syslinux/patches/fix-build-with-glibc-2.36.patch b/srcpkgs/syslinux/patches/fix-build-with-glibc-2.36.patch
new file mode 100644
index 000000000000..1303be56c127
--- /dev/null
+++ b/srcpkgs/syslinux/patches/fix-build-with-glibc-2.36.patch
@@ -0,0 +1,30 @@
+--- a/linux/syslinux.c
++++ b/linux/syslinux.c
+@@ -45,7 +45,6 @@
+ #include <sys/stat.h>
+ #include <sys/types.h>
+ #include <sys/wait.h>
+-#include <sys/mount.h>
+ 
+ #include "linuxioctl.h"
+ 
+--- a/libinstaller/syslxcom.c
++++ b/libinstaller/syslxcom.c
+@@ -28,7 +28,6 @@
+ #include <errno.h>
+ #include <sys/stat.h>
+ #include <sys/types.h>
+-#include <sys/mount.h>
+ #include <sys/vfs.h>
+ 
+ #include "linuxioctl.h"
+--- a/extlinux/main.c
++++ b/extlinux/main.c
+@@ -40,7 +40,6 @@
+ #include <sys/stat.h>
+ #include <sys/sysmacros.h>
+ #include <sys/types.h>
+-#include <sys/mount.h>
+ #include <sys/vfs.h>
+ 
+ #include "linuxioctl.h"

From 45223057a3e10fe4ab24975cd804802eeea6007b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 14 Aug 2022 19:29:36 -0700
Subject: [PATCH 11/52] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove -no-pie from build. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..3a88030f79e5 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -132,6 +132,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -460,6 +461,14 @@ do_build() {
 	local binutils_ver linux_ver gcc_ver libc_ver libucontext_ver
 	local tgt=${sourcepkg/cross-}
 
+	export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}"
+	export CXXFLAGS="${CXXFLAGS/-D_FORTIFY_SOURCE=2/}"
+
+	# Disable explicit -fno-PIE, gcc/binutils/libc will figure this out itself.
+	export CFLAGS="${CFLAGS//-fno-PIE/}"
+	export CXXFLAGS="${CXXFLAGS//-fno-PIE/}"
+	export LDFLAGS="${LDFLAGS//-no-pie/}"
+
 	_void_cross_test_ver binutils
 	_void_cross_test_ver linux
 	_void_cross_test_ver gcc

From 1a1f20fdb9f1dc6428e8009e453eeb4b9057ef48 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:08:52 -0700
Subject: [PATCH 12/52] openssh: suppress werror on gcc12

---
 srcpkgs/openssh/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/openssh/template b/srcpkgs/openssh/template
index 02a2dec35f42..6e8e343a9dca 100644
--- a/srcpkgs/openssh/template
+++ b/srcpkgs/openssh/template
@@ -40,7 +40,7 @@ if [ "$build_option_ldns" -a -z "$build_option_ssl" ]; then
 	broken="option 'ldns' requires option 'ssl'"
 fi
 
-CFLAGS="-Wno-format-truncation -Wno-stringop-truncation"
+CFLAGS="-Wno-format-truncation -Wno-stringop-truncation -Wno-error=maybe-uninitialized"
 
 case $XBPS_TARGET_MACHINE in
 	i686-musl)

From 72d7b0d8b24cecf748f67ebee222e8ca8b3112b1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:09:31 -0700
Subject: [PATCH 13/52] linux5.18: update dotconfigs for gcc12

---
 srcpkgs/linux5.18/files/x86_64-dotconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/linux5.18/files/x86_64-dotconfig b/srcpkgs/linux5.18/files/x86_64-dotconfig
index 4e73a3195d40..ea6204868e23 100644
--- a/srcpkgs/linux5.18/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.18/files/x86_64-dotconfig
@@ -512,6 +512,7 @@ CONFIG_RETHUNK=y
 CONFIG_CPU_UNRET_ENTRY=y
 CONFIG_CPU_IBPB_ENTRY=y
 CONFIG_CPU_IBRS_ENTRY=y
+CONFIG_SLS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10060,8 +10061,11 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
 # Memory initialization
 #
 CONFIG_INIT_STACK_NONE=y
+# CONFIG_INIT_STACK_ALL_PATTERN is not set
+# CONFIG_INIT_STACK_ALL_ZERO is not set
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
+# CONFIG_ZERO_CALL_USED_REGS is not set
 # end of Memory initialization
 # end of Kernel hardening options
 # end of Security options
@@ -10538,6 +10542,7 @@ CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
 # CONFIG_UBSAN is not set
 CONFIG_HAVE_ARCH_KCSAN=y
+# CONFIG_KCSAN is not set
 # end of Generic Kernel Debugging Instruments
 
 #

From cf904590197c413d439f2a5ed26b4ccf08212475 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 18:00:42 -0700
Subject: [PATCH 14/52] xf86-video-vmware: fix build on gcc12

---
 ...183b3395333d5d4c73e25c2d011748f15eda.patch | 30 +++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch

diff --git a/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch b/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch
new file mode 100644
index 000000000000..ff839f16e628
--- /dev/null
+++ b/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch
@@ -0,0 +1,30 @@
+From 77b8183b3395333d5d4c73e25c2d011748f15eda Mon Sep 17 00:00:00 2001
+From: Rudi Heitbaum <rudi@heitbaum.com>
+Date: Sun, 8 May 2022 03:00:10 +0000
+Subject: [PATCH] vmwgfx: fix missing array notation
+
+ Fixes error identified by gcc-12.1.0 compiler
+
+make
+  CC       libvmwgfx_la-vmwgfx_tex_video.lo
+vmwgfx_tex_video.c: In function 'stop_video':
+vmwgfx_tex_video.c:240:20: error: the comparison will always evaluate as 'true' for the address of 'yuv' will never be NULL [-Werror=address]
+  240 |                if (priv->yuv[i]) {
+      |                    ^~~~
+---
+ vmwgfx/vmwgfx_tex_video.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/vmwgfx/vmwgfx_tex_video.c b/vmwgfx/vmwgfx_tex_video.c
+index acc2b56..480a5f1 100644
+--- a/vmwgfx/vmwgfx_tex_video.c
++++ b/vmwgfx/vmwgfx_tex_video.c
+@@ -237,7 +237,7 @@ stop_video(ScrnInfoPtr pScrn, pointer data, Bool shutdown)
+ 
+        for (i=0; i<3; ++i) {
+ 	   for (j=0; j<2; ++j) {
+-	       if (priv->yuv[i]) {
++	       if (priv->yuv[j][i]) {
+ 		   xa_surface_destroy(priv->yuv[j][i]);
+ 		   priv->yuv[j][i] = NULL;
+ 	       }

From 9b257f28c4de05945c49efe77f742f6b571c1c6a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 18:24:37 -0700
Subject: [PATCH 15/52] doxygen: fix build for gcc 12

---
 srcpkgs/doxygen/patches/compat-gcc12.patch | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100644 srcpkgs/doxygen/patches/compat-gcc12.patch

diff --git a/srcpkgs/doxygen/patches/compat-gcc12.patch b/srcpkgs/doxygen/patches/compat-gcc12.patch
new file mode 100644
index 000000000000..666744a1dceb
--- /dev/null
+++ b/srcpkgs/doxygen/patches/compat-gcc12.patch
@@ -0,0 +1,22 @@
+From 5198966c8d5fec89116d025c74934ac03ea511fa Mon Sep 17 00:00:00 2001
+From: Dimitri van Heesch <doxygen@gmail.com>
+Date: Fri, 6 May 2022 09:55:16 +0200
+Subject: [PATCH] issue #9312: Build: cache.h:53:14: error: 'exchange' is not a
+ member of 'std'
+
+---
+ src/cache.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/cache.h b/src/cache.h
+index 0ff3092ed5..e218eb27d2 100644
+--- a/src/cache.h
++++ b/src/cache.h
+@@ -19,6 +19,7 @@
+ #include <list>
+ #include <unordered_map>
+ #include <mutex>
++#include <utility>
+ #include <ctype.h>
+ 
+ /*! Fixed size cache for value type V using keys of type K.

From bc74fd431f5422af04463f491d18813cff94359a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 21 Aug 2022 15:12:00 -0700
Subject: [PATCH 16/52] libproxy: update to 0.4.18

---
 srcpkgs/libproxy/template | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/libproxy/template b/srcpkgs/libproxy/template
index d6103007032e..6599dfb69b98 100644
--- a/srcpkgs/libproxy/template
+++ b/srcpkgs/libproxy/template
@@ -1,18 +1,22 @@
 # Template file for 'libproxy'
 pkgname=libproxy
-version=0.4.15
+version=0.4.18
 revision=1
 build_style=cmake
 configure_args="-DWITH_GNOME=0 -DWITH_KDE4=0 -DWITH_MOZJS=0 -DWITH_NM=0
  -DWITH_PERL=0 -DWITH_PYTHON=1 -DWITH_WEBKIT=0"
 hostmakedepends="pkg-config python"
 makedepends="zlib-devel"
-short_desc="A library handling all the details of proxy configuration"
+short_desc="Library handling all the details of proxy configuration"
 maintainer="Orphaned <orphan@voidlinux.org>"
+license="LGPL-2.1-or-later"
 homepage="http://github.com/libproxy/libproxy"
-license="LGPL-2.1"
-distfiles="https://github.com/libproxy/libproxy/archive/${version}.tar.gz>${pkgname}-${version}.tar.gz"
-checksum=18f58b0a0043b6881774187427ead158d310127fc46a1c668ad6d207fb28b4e0
+distfiles="https://github.com/libproxy/libproxy/archive/${version}.tar.gz"
+checksum=0b4a9218d88f6cf9fa25996a3f38329a11f688a9d026141d9d0e966d8fa63837
+
+post_patch() {
+	vsed '/add_test(NAME url-test/d' -i libproxy/test/CMakeLists.txt
+}
 
 libproxy-devel_package() {
 	depends="libproxy>=${version}_${revision}"

From fb75cb2fb420edab5bf56f240dc802ba61b50d8a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 21 Aug 2022 17:05:39 -0700
Subject: [PATCH 17/52] exempi: update to 2.6.2

---
 ...f034705fd2d032c81383eee8208fd4eee0ac.patch | 43 -------------------
 srcpkgs/exempi/template                       |  4 +-
 2 files changed, 2 insertions(+), 45 deletions(-)
 delete mode 100644 srcpkgs/exempi/patches/8ed2f034705fd2d032c81383eee8208fd4eee0ac.patch

diff --git a/srcpkgs/exempi/patches/8ed2f034705fd2d032c81383eee8208fd4eee0ac.patch b/srcpkgs/exempi/patches/8ed2f034705fd2d032c81383eee8208fd4eee0ac.patch
deleted file mode 100644
index 2696793cec09..000000000000
--- a/srcpkgs/exempi/patches/8ed2f034705fd2d032c81383eee8208fd4eee0ac.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From 8ed2f034705fd2d032c81383eee8208fd4eee0ac Mon Sep 17 00:00:00 2001
-From: Victor Rodriguez <victor.rodriguez.bahena@intel.com>
-Date: Sat, 18 Aug 2018 13:54:55 +0000
-Subject: [PATCH] Issue #9 - Fix null-pointer-dereference (CVE-2018-12648)
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-The WEBP::GetLE32 function in
-XMPFiles/source/FormatSupport/WEBP_Support.hpp in Exempi 2.4.5 has a
-NULL pointer dereference.
-
-https://bugs.freedesktop.org/show_bug.cgi?id=106981
-https://gitlab.freedesktop.org/libopenraw/exempi/issues/9
-
-Signed-off-by: Victor Rodriguez <victor.rodriguez.bahena@intel.com>
-Signed-off-by: Hubert Figuière <hub@figuiere.net>
----
- XMPFiles/source/FormatSupport/WEBP_Support.cpp | 8 +++++---
- 1 file changed, 5 insertions(+), 3 deletions(-)
-
-diff --git a/XMPFiles/source/FormatSupport/WEBP_Support.cpp b/XMPFiles/source/FormatSupport/WEBP_Support.cpp
-index ffaf220..4fe705b 100644
---- a/XMPFiles/source/FormatSupport/WEBP_Support.cpp
-+++ b/XMPFiles/source/FormatSupport/WEBP_Support.cpp
-@@ -160,9 +160,11 @@ bool VP8XChunk::xmp()
- }
- void VP8XChunk::xmp(bool hasXMP)
- {
--    XMP_Uns32 flags = GetLE32(&this->data[0]);
--    flags ^= (-hasXMP ^ flags) & (1 << XMP_FLAG_BIT);
--    PutLE32(&this->data[0], flags);
-+    if (&this->data[0] != NULL) {
-+        XMP_Uns32 flags = GetLE32(&this->data[0]);
-+        flags ^= (-hasXMP ^ flags) & (1 << XMP_FLAG_BIT);
-+        PutLE32(&this->data[0], flags);
-+    }
- }
- 
- Container::Container(WEBP_MetaHandler* handler) : Chunk(NULL, handler)
--- 
-2.18.0
-
diff --git a/srcpkgs/exempi/template b/srcpkgs/exempi/template
index 14753617953a..d664f7dc4d80 100644
--- a/srcpkgs/exempi/template
+++ b/srcpkgs/exempi/template
@@ -1,6 +1,6 @@
 # Template file for 'exempi'
 pkgname=exempi
-version=2.5.0
+version=2.6.2
 revision=1
 build_style=gnu-configure
 configure_args="--with-boost=${XBPS_CROSS_BASE}/usr --disable-static --disable-unittest"
@@ -10,7 +10,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="BSD-3-Clause"
 homepage="https://libopenraw.freedesktop.org/wiki/Exempi"
 distfiles="https://libopenraw.freedesktop.org/download/exempi-${version}.tar.bz2"
-checksum=dc82fc24c0540a44a63fa4ad21775d24e00e63f1dedd3e2ae6f7aa27583b711b
+checksum=4d17d4c93df2a95da3e3172c45b7a5bf317dd31dafd1c7a340169728c7089d1d
 
 post_install() {
 	vlicense COPYING

From d382c432a51abca691ab4bd07a125b46770842b5 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 21 Aug 2022 21:36:03 -0700
Subject: [PATCH 18/52] plymouth: update to 22.02.122

---
 srcpkgs/plymouth/patches/fix-glibc-2.36.patch | 30 +++++++++++++++++++
 srcpkgs/plymouth/template                     |  4 +--
 2 files changed, 32 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/plymouth/patches/fix-glibc-2.36.patch

diff --git a/srcpkgs/plymouth/patches/fix-glibc-2.36.patch b/srcpkgs/plymouth/patches/fix-glibc-2.36.patch
new file mode 100644
index 000000000000..2f1e43875cfb
--- /dev/null
+++ b/srcpkgs/plymouth/patches/fix-glibc-2.36.patch
@@ -0,0 +1,30 @@
+From 5f1e43c00039a7fe1fff768b91a05a695fb4a53d Mon Sep 17 00:00:00 2001
+From: Ray Strode <rstrode@redhat.com>
+Date: Wed, 3 Aug 2022 15:23:33 -0400
+Subject: [PATCH] ply-utils: Drop linux/fs.h include
+
+It was needed long ago for a function we no longer even have.
+
+Now it's causing compile errors on Fedora 37 because it's conflicting
+with sys/mount.h.
+
+This commit drops it.
+---
+ src/libply/ply-utils.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/src/libply/ply-utils.c b/src/libply/ply-utils.c
+index c7b165e9..219e2e77 100644
+--- a/src/libply/ply-utils.c
++++ b/src/libply/ply-utils.c
+@@ -46,7 +46,6 @@
+ #include <sys/user.h>
+ #include <sys/wait.h>
+ #include <time.h>
+-#include <linux/fs.h>
+ #include <linux/vt.h>
+ 
+ #include <dlfcn.h>
+-- 
+GitLab
+
diff --git a/srcpkgs/plymouth/template b/srcpkgs/plymouth/template
index 17f801fc5315..442ab58a99cd 100644
--- a/srcpkgs/plymouth/template
+++ b/srcpkgs/plymouth/template
@@ -1,6 +1,6 @@
 # Template file for 'plymouth'
 pkgname=plymouth
-version=0.9.5
+version=22.02.122
 revision=1
 build_style=gnu-configure
 configure_args="--with-system-root-install=no \
@@ -18,7 +18,7 @@ maintainer="William OD <obirik2005@gmail.com>"
 license="GPL-2.0-or-later"
 homepage="https://www.freedesktop.org/wiki/Software/Plymouth/"
 distfiles="${FREEDESKTOP_SITE}/plymouth/releases/$pkgname-$version.tar.xz"
-checksum=ecae257f351d098340542a5bc06de029404c24dcee87e6ebb2abd5ef117fce86
+checksum=100551442221033ce868c447ad6c74d831d209c18ae232b98ae0207e34eadaeb
 
 build_options="gtk3 pango"
 build_options_default="gtk3 pango"

From 1b9c75f25dc0e3962f9de2d04af5d489cc9e7961 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 21 Aug 2022 21:37:00 -0700
Subject: [PATCH 19/52] openjdk7-bootstrap: fix build for gcc12

---
 .../files/dist_patches_glibc.txt              |  1 +
 .../files/dist_patches_musl.txt               |  1 +
 .../icedtea-pointer-comparison-gcc12.patch    | 31 +++++++++++++++++++
 3 files changed, 33 insertions(+)
 create mode 100644 srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch

diff --git a/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt b/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt
index c76c56855441..8061756dfc0c 100644
--- a/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt
+++ b/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt
@@ -6,3 +6,4 @@ icedtea-jdk-no-soname.patch
 icedtea-jdk-xattr.patch
 icedtea-jdk-sysctl_h.patch
 icedtea-cpio.patch
+icedtea-pointer-comparison-gcc12.patch
diff --git a/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt b/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt
index 21812517c7c2..8b35d9c46989 100644
--- a/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt
+++ b/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt
@@ -11,3 +11,4 @@ icedtea-jdk-musl.patch
 icedtea-jdk-no-soname.patch
 icedtea-jdk-xattr.patch
 icedtea-cpio.patch
+icedtea-pointer-comparison-gcc12.patch
diff --git a/srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch b/srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch
new file mode 100644
index 000000000000..c809553443e7
--- /dev/null
+++ b/srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch
@@ -0,0 +1,31 @@
+--- openjdk.orig/hotspot/src/share/vm/opto/lcm.cpp
++++ openjdk/hotspot/src/share/vm/opto/lcm.cpp
+@@ -60,7 +60,7 @@
+ // Check whether val is not-null-decoded compressed oop,
+ // i.e. will grab into the base of the heap if it represents NULL.
+ static bool accesses_heap_base_zone(Node *val) {
+-  if (Universe::narrow_oop_base() > 0) { // Implies UseCompressedOops.
++  if (Universe::narrow_oop_base() > (address)0) { // Implies UseCompressedOops.
+     if (val && val->is_Mach()) {
+       if (val->as_Mach()->ideal_Opcode() == Op_DecodeN) {
+         // This assumes all Decodes with TypePtr::NotNull are matched to nodes that
+--- openjdk.orig/hotspot/src/share/vm/runtime/virtualspace.cpp
++++ openjdk/hotspot/src/share/vm/runtime/virtualspace.cpp
+@@ -527,7 +527,7 @@ ReservedHeapSpace::ReservedHeapSpace(siz
+                 (UseCompressedOops && (Universe::narrow_oop_base() != NULL) &&
+                  Universe::narrow_oop_use_implicit_null_checks()) ?
+                   lcm(os::vm_page_size(), alignment) : 0) {
+-  if (base() > 0) {
++  if (base() > (char*)0) {
+     MemTracker::record_virtual_memory_type((address)base(), mtJavaHeap);
+   }
+ 
+@@ -546,7 +546,7 @@ ReservedHeapSpace::ReservedHeapSpace(con
+                 (UseCompressedOops && (Universe::narrow_oop_base() != NULL) &&
+                  Universe::narrow_oop_use_implicit_null_checks()) ?
+                   lcm(os::vm_page_size(), prefix_align) : 0) {
+-  if (base() > 0) {
++  if (base() > (char*)0) {
+     MemTracker::record_virtual_memory_type((address)base(), mtJavaHeap);
+   }
+ 

From cbdf4478170c5046aa60490f84db07b25c0cf018 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 23:30:16 -0700
Subject: [PATCH 20/52] libunique1: relax warnings for gcc12

---
 srcpkgs/libunique1/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/libunique1/template b/srcpkgs/libunique1/template
index f73931b0c72b..c5a0f5c27860 100644
--- a/srcpkgs/libunique1/template
+++ b/srcpkgs/libunique1/template
@@ -15,7 +15,7 @@ homepage="https://wiki.gnome.org/Attic/LibUnique"
 distfiles="${GNOME_SITE}/libunique/1.1/libunique-${version}.tar.bz2"
 checksum=e5c8041cef8e33c55732f06a292381cb345db946cf792a4ae18aa5c66cdd4fbb
 
-CFLAGS="-Wno-deprecated-declarations"
+CFLAGS="-Wno-deprecated-declarations -Wno-incompatible-pointer-types"
 
 # Package build options
 build_options="gir"

From 912b3356adb5559a74d09299899d4fa11df65cc0 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:39:52 -0700
Subject: [PATCH 21/52] libvirt: fix build for glibc 2.36

---
 .../patches/lxc-fix-compat-glibc-2.36.patch   | 34 ++++++++++++++++
 .../virfile-fix-compat-glibc-2.36.patch       | 39 +++++++++++++++++++
 2 files changed, 73 insertions(+)
 create mode 100644 srcpkgs/libvirt/patches/lxc-fix-compat-glibc-2.36.patch
 create mode 100644 srcpkgs/libvirt/patches/virfile-fix-compat-glibc-2.36.patch

diff --git a/srcpkgs/libvirt/patches/lxc-fix-compat-glibc-2.36.patch b/srcpkgs/libvirt/patches/lxc-fix-compat-glibc-2.36.patch
new file mode 100644
index 000000000000..d85b57815010
--- /dev/null
+++ b/srcpkgs/libvirt/patches/lxc-fix-compat-glibc-2.36.patch
@@ -0,0 +1,34 @@
+From 9493c9b79dc541ec9e0fd73c6d87bdf8d30aaa90 Mon Sep 17 00:00:00 2001
+From: Cole Robinson <crobinso@redhat.com>
+Date: Mon, 1 Aug 2022 15:20:38 -0400
+Subject: [PATCH] lxc: containter: fix build with glibc 2.36
+
+With glibc 2.36, sys/mount.h and linux/mount.h conflict:
+https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
+
+lxc_container.c imports sys/mount.h and linux/fs.h, which pulls in
+linux/mount.h.
+
+linux/fs.h isn't required here though. glibc sys/mount.h has had
+MS_MOVE since 2.12 in 2010
+
+Reviewed-by: Erik Skultety <eskultet@redhat.com>
+Signed-off-by: Cole Robinson <crobinso@redhat.com>
+---
+ src/lxc/lxc_container.c | 3 ---
+ 1 file changed, 3 deletions(-)
+
+diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
+index b5278831da7..a5401c2186e 100644
+--- a/src/lxc/lxc_container.c
++++ b/src/lxc/lxc_container.c
+@@ -33,9 +33,6 @@
+ /* Yes, we want linux private one, for _syscall2() macro */
+ #include <linux/unistd.h>
+ 
+-/* For MS_MOVE */
+-#include <linux/fs.h>
+-
+ #if WITH_CAPNG
+ # include <cap-ng.h>
+ #endif
diff --git a/srcpkgs/libvirt/patches/virfile-fix-compat-glibc-2.36.patch b/srcpkgs/libvirt/patches/virfile-fix-compat-glibc-2.36.patch
new file mode 100644
index 000000000000..2ef227ea9b54
--- /dev/null
+++ b/srcpkgs/libvirt/patches/virfile-fix-compat-glibc-2.36.patch
@@ -0,0 +1,39 @@
+From c0d9adf220dc0d223330a7bac37b174132d330ba Mon Sep 17 00:00:00 2001
+From: Cole Robinson <crobinso@redhat.com>
+Date: Mon, 1 Aug 2022 15:24:01 -0400
+Subject: [PATCH] virfile: Fix build with glibc 2.36
+
+With glibc 2.36, sys/mount.h and linux/mount.h conflict:
+https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
+
+virfile.c imports sys/mount.h and linux/fs.h, which pulls in
+linux/mount.h.
+
+Manually define the constants we need from linux/fs.h, like was
+done in llvm:
+
+https://reviews.llvm.org/rGb379129c4beb3f26223288627a1291739f33af02
+
+Reviewed-by: Erik Skultety <eskultet@redhat.com>
+Signed-off-by: Cole Robinson <crobinso@redhat.com>
+---
+ src/util/virfile.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/src/util/virfile.c b/src/util/virfile.c
+index 99da058db3b..ce541b8946b 100644
+--- a/src/util/virfile.c
++++ b/src/util/virfile.c
+@@ -71,7 +71,11 @@
+ # endif
+ # include <sys/ioctl.h>
+ # include <linux/cdrom.h>
+-# include <linux/fs.h>
++/* These come from linux/fs.h, but that header conflicts with
++ * sys/mount.h on glibc 2.36+ */
++# define FS_IOC_GETFLAGS _IOR('f', 1, long)
++# define FS_IOC_SETFLAGS _IOW('f', 2, long)
++# define FS_NOCOW_FL 0x00800000
+ #endif
+ 
+ #if WITH_LIBATTR

From ec80e4fdf1e3a69c6b1e38bc3add91fd1119d948 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:41:50 -0700
Subject: [PATCH 22/52] efivar: fix build for glibc 2.36

---
 .../patches/fix-compat-glibc-2.36.patch       | 55 +++++++++++++++++++
 1 file changed, 55 insertions(+)
 create mode 100644 srcpkgs/efivar/patches/fix-compat-glibc-2.36.patch

diff --git a/srcpkgs/efivar/patches/fix-compat-glibc-2.36.patch b/srcpkgs/efivar/patches/fix-compat-glibc-2.36.patch
new file mode 100644
index 000000000000..fcc83aef20cf
--- /dev/null
+++ b/srcpkgs/efivar/patches/fix-compat-glibc-2.36.patch
@@ -0,0 +1,55 @@
+From bc65d63ebf8fe6ac8a099ff15ca200986dba1565 Mon Sep 17 00:00:00 2001
+From: Robbie Harwood <rharwood@redhat.com>
+Date: Thu, 28 Jul 2022 16:11:24 -0400
+Subject: [PATCH] Fix glibc 2.36 build (mount.h conflicts)
+
+glibc has decided that sys/mount.h and linux/mount.h are no longer
+usable at the same time.  This broke the build, since linux/fs.h itself
+includes linux/mount.h.  For now, fix the build by only including
+sys/mount.h where we need it.
+
+See-also: https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
+Resolves: #227
+Signed-off-by: Robbie Harwood <rharwood@redhat.com>
+---
+ src/gpt.c   | 1 +
+ src/linux.c | 1 +
+ src/util.h  | 1 -
+ 3 files changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/gpt.c b/src/gpt.c
+index 1eda0497..21413c3b 100644
+--- a/src/gpt.c
++++ b/src/gpt.c
+@@ -17,6 +17,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <sys/mount.h>
+ #include <sys/param.h>
+ #include <sys/stat.h>
+ #include <sys/utsname.h>
+diff --git a/src/linux.c b/src/linux.c
+index 47e45ae4..1780816f 100644
+--- a/src/linux.c
++++ b/src/linux.c
+@@ -20,6 +20,7 @@
+ #include <stdbool.h>
+ #include <stdio.h>
+ #include <sys/ioctl.h>
++#include <sys/mount.h>
+ #include <sys/socket.h>
+ #include <sys/sysmacros.h>
+ #include <sys/types.h>
+diff --git a/src/util.h b/src/util.h
+index 3300666f..1e67e447 100644
+--- a/src/util.h
++++ b/src/util.h
+@@ -23,7 +23,6 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <sys/ioctl.h>
+-#include <sys/mount.h>
+ #include <sys/stat.h>
+ #include <sys/types.h>
+ #include <tgmath.h>

From 441cb84732fe97b91d6bb70af786d1b9306b84c2 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:43:24 -0700
Subject: [PATCH 23/52] libwpd: fix build for gcc12

---
 srcpkgs/libwpd/patches/fix-compat-gcc12.patch | 11 +++++++++++
 1 file changed, 11 insertions(+)
 create mode 100644 srcpkgs/libwpd/patches/fix-compat-gcc12.patch

diff --git a/srcpkgs/libwpd/patches/fix-compat-gcc12.patch b/srcpkgs/libwpd/patches/fix-compat-gcc12.patch
new file mode 100644
index 000000000000..6ebce2463d16
--- /dev/null
+++ b/srcpkgs/libwpd/patches/fix-compat-gcc12.patch
@@ -0,0 +1,11 @@
+diff -rup libwpd-0.10.3.orig/src/lib/WPXTable.h libwpd-0.10.3/src/lib/WPXTable.h
+--- libwpd-0.10.3.orig/src/lib/WPXTable.h	2022-08-23 22:32:45.332593795 -0700
++++ libwpd-0.10.3/src/lib/WPXTable.h	2022-08-23 22:32:59.500651211 -0700
+@@ -37,6 +37,7 @@
+ #define _WPXTABLE_H
+ 
+ #include <vector>
++#include <cstddef>
+ 
+ struct WPXTableCell
+ {

From f4a373bab1995b91115f66d86abd5587ce8f601f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:44:07 -0700
Subject: [PATCH 24/52] grub: fix build for binutils 2.36

---
 .../patches/fix-compat-binutils-2.36.patch    | 96 +++++++++++++++++++
 srcpkgs/grub/template                         |  7 +-
 2 files changed, 102 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/grub/patches/fix-compat-binutils-2.36.patch

diff --git a/srcpkgs/grub/patches/fix-compat-binutils-2.36.patch b/srcpkgs/grub/patches/fix-compat-binutils-2.36.patch
new file mode 100644
index 000000000000..d92a91e3253e
--- /dev/null
+++ b/srcpkgs/grub/patches/fix-compat-binutils-2.36.patch
@@ -0,0 +1,96 @@
+From b98275138bf4fc250a1c362dfd2c8b1cf2421701 Mon Sep 17 00:00:00 2001
+From: Michael Chang <mchang@suse.com>
+Date: Tue, 28 Sep 2021 13:50:47 +0800
+Subject: build: Fix build error with binutils 2.36
+
+The following procedure to build xen/pvgrub is broken.
+
+  git clone https://git.savannah.gnu.org/git/grub.git
+  cd grub
+  ./bootstrap
+  mkdir build-xen
+  cd build-xen
+  ../configure --with-platform=xen
+  make
+
+It fails with the message:
+
+  /usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld:
+  section .note.gnu.property VMA [0000000000400158,0000000000400187]
+  overlaps section .bss VMA [000000000000f000,000000000041e1af]
+
+The most significant factor is that new assembler (GNU as) generates the
+.note.gnu.property section as default. This note section overlaps with
+.bss because it doesn't reposition with -Wl,-Ttext,0 with which the base
+address of .text section is set, rather the address of .note.gnu.property
+is calculated for some reason from 0x400000 where the ELF executable
+defaults to start.
+
+Using -Ttext-segment doesn't help either, though it is said to set the
+address of the first byte of the text segment according to "man ld".
+What it actually does is to override the default 0x400000, aka the image
+base address, to something else. The entire process can be observed in
+the default linker script used by gcc [1]. Therefore we can't expect it
+to achieve the same thing as -Ttext given that the first segment where
+.text resides is offset by SIZEOF_HEADERS plus some sections may be
+preceding it within the first segment. The end result is .text always
+has to start with non-zero address with -Wl,-Ttext-segment,0 if using
+default linker script.
+
+It is also worth mentioning that binutils upstream apparently doesn't
+seem to consider this as a bug [2] and proposed to use -Wl,-Ttext-segment,0
+which is not fruitful as what has been tested by Gentoo [3].
+
+As long as GRUB didn't use ISA information encoded in .note.gnu.property,
+we can safely drop it via -Wa,-mx86-used-note=no assembler option to
+fix the linker error above.
+
+This is considered a better approach than using custom linker script to
+drop the .note.gnu.property section because object file manipulation can
+also be hampered one way or the other in that linker script may not be
+helpful. See also this commit removing the section in the process of objcopy.
+
+  6643507ce build: Fix GRUB i386-pc build with Ubuntu gcc
+
+[1] In /usr/lib64/ldscripts/elf_x86_64.x or use 'gcc -Wl,--verbose ...'
+    PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x400000));
+    . = SEGMENT_START("text-segment", 0x400000) + SIZEOF_HEADERS;
+[2] https://sourceware.org/bugzilla/show_bug.cgi?id=27377
+[3] https://bugs.gentoo.org/787221
+
+Signed-off-by: Michael Chang <mchang@suse.com>
+Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
+---
+ configure.ac | 14 ++++++++++++++
+ 1 file changed, 14 insertions(+)
+
+(limited to 'configure.ac')
+
+diff --git a/configure.ac b/configure.ac
+index eeb5d22..8d1c81a 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -840,6 +840,20 @@ if ( test "x$target_cpu" = xi386 || test "x$target_cpu" = xx86_64 ) && test "x$p
+   TARGET_CFLAGS="$TARGET_CFLAGS -mno-mmx -mno-sse -mno-sse2 -mno-sse3 -mno-3dnow"
+ fi
+ 
++if ( test "x$target_cpu" = xi386 || test "x$target_cpu" = xx86_64 ); then
++  AC_CACHE_CHECK([whether -Wa,-mx86-used-note works], [grub_cv_cc_mx86_used_note], [
++    CFLAGS="$TARGET_CFLAGS -Wa,-mx86-used-note=no -Werror"
++    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
++	[grub_cv_cc_mx86_used_note=yes],
++	[grub_cv_cc_mx86_used_note=no])
++  ])
++
++  if test "x$grub_cv_cc_mx86_used_note" = xyes; then
++    TARGET_CFLAGS="$TARGET_CFLAGS -Wa,-mx86-used-note=no"
++    TARGET_CCASFLAGS="$TARGET_CCASFLAGS -Wa,-mx86-used-note=no"
++  fi
++fi
++
+ # GRUB doesn't use float or doubles at all. Yet some toolchains may decide
+ # that floats are a good fit to run instead of what's written in the code.
+ # Given that floating point unit is disabled (if present to begin with)
+-- 
+cgit v1.1
+
diff --git a/srcpkgs/grub/template b/srcpkgs/grub/template
index b1826c38a884..b4d3b07af620 100644
--- a/srcpkgs/grub/template
+++ b/srcpkgs/grub/template
@@ -2,7 +2,8 @@
 pkgname=grub
 version=2.06
 revision=2
-hostmakedepends="python3 pkg-config flex freetype-devel font-unifont-bdf help2man"
+hostmakedepends="python3 pkg-config flex freetype-devel font-unifont-bdf help2man
+ automake gettext-devel-tools"
 makedepends="libusb-compat-devel ncurses-devel freetype-devel
  liblzma-devel device-mapper-devel fuse-devel"
 depends="os-prober"
@@ -43,6 +44,10 @@ case "$XBPS_TARGET_MACHINE" in
 		;;
 esac
 
+pre_configure() {
+	autoreconf -fi
+}
+
 do_configure() {
 	# workaround for https://savannah.gnu.org/bugs/?60458
 	# some more info: https://www.linuxquestions.org/questions/showthread.php?p=6257712

From 08507ff4e4ea5a18b89ef90e397857046f4546b6 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:45:07 -0700
Subject: [PATCH 25/52] linux-toos: fix build for binutils 2.39

---
 .../patches/binutils-add-compat-check.patch   | 103 ++++++++++++
 .../patches/binutils-disasm-compat.patch      | 102 ++++++++++++
 .../bpf_jit_disasm-binutils-2.39.patch        | 104 ++++++++++++
 .../patches/bpftool-binutils-2.39.patch       | 149 ++++++++++++++++++
 .../patches/perf-binutils-2.39.patch          | 114 ++++++++++++++
 5 files changed, 572 insertions(+)
 create mode 100644 srcpkgs/linux-tools/patches/binutils-add-compat-check.patch
 create mode 100644 srcpkgs/linux-tools/patches/binutils-disasm-compat.patch
 create mode 100644 srcpkgs/linux-tools/patches/bpf_jit_disasm-binutils-2.39.patch
 create mode 100644 srcpkgs/linux-tools/patches/bpftool-binutils-2.39.patch
 create mode 100644 srcpkgs/linux-tools/patches/perf-binutils-2.39.patch

diff --git a/srcpkgs/linux-tools/patches/binutils-add-compat-check.patch b/srcpkgs/linux-tools/patches/binutils-add-compat-check.patch
new file mode 100644
index 000000000000..e4e7ece9635e
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/binutils-add-compat-check.patch
@@ -0,0 +1,103 @@
+From cfd59ca91467056bb2c36907b2fa67b8e1af9952 Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:27 -0700
+Subject: [PATCH] tools build: Add feature test for init_disassemble_info API
+ changes
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation failures for tools/{perf,bpf}, e.g. on debian unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+This commit adds a feature test to detect the new signature.  Subsequent
+commits will use it to fix the build failures.
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Quentin Monnet <quentin@isovalent.com>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-2-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/build/Makefile.feature                        |  1 +
+ tools/build/feature/Makefile                        |  4 ++++
+ tools/build/feature/test-all.c                      |  4 ++++
+ tools/build/feature/test-disassembler-init-styled.c | 13 +++++++++++++
+ 4 files changed, 22 insertions(+)
+ create mode 100644 tools/build/feature/test-disassembler-init-styled.c
+
+diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature
+index 888a0421d43b96..8f6578e4d3249e 100644
+--- a/tools/build/Makefile.feature
++++ b/tools/build/Makefile.feature
+@@ -70,6 +70,7 @@ FEATURE_TESTS_BASIC :=                  \
+         libaio				\
+         libzstd				\
+         disassembler-four-args		\
++        disassembler-init-styled	\
+         file-handle
+ 
+ # FEATURE_TESTS_BASIC + FEATURE_TESTS_EXTRA is the complete list
+diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile
+index 7c2a17e23c30ac..c3059739318a95 100644
+--- a/tools/build/feature/Makefile
++++ b/tools/build/feature/Makefile
+@@ -18,6 +18,7 @@ FILES=                                          \
+          test-libbfd.bin                        \
+          test-libbfd-buildid.bin		\
+          test-disassembler-four-args.bin        \
++         test-disassembler-init-styled.bin	\
+          test-reallocarray.bin			\
+          test-libbfd-liberty.bin                \
+          test-libbfd-liberty-z.bin              \
+@@ -248,6 +249,9 @@ $(OUTPUT)test-libbfd-buildid.bin:
+ $(OUTPUT)test-disassembler-four-args.bin:
+ 	$(BUILD) -DPACKAGE='"perf"' -lbfd -lopcodes
+ 
++$(OUTPUT)test-disassembler-init-styled.bin:
++	$(BUILD) -DPACKAGE='"perf"' -lbfd -lopcodes
++
+ $(OUTPUT)test-reallocarray.bin:
+ 	$(BUILD)
+ 
+diff --git a/tools/build/feature/test-all.c b/tools/build/feature/test-all.c
+index 5ffafb967b6e49..957c02c7b163b5 100644
+--- a/tools/build/feature/test-all.c
++++ b/tools/build/feature/test-all.c
+@@ -166,6 +166,10 @@
+ # include "test-disassembler-four-args.c"
+ #undef main
+ 
++#define main main_test_disassembler_init_styled
++# include "test-disassembler-init-styled.c"
++#undef main
++
+ #define main main_test_libzstd
+ # include "test-libzstd.c"
+ #undef main
+diff --git a/tools/build/feature/test-disassembler-init-styled.c b/tools/build/feature/test-disassembler-init-styled.c
+new file mode 100644
+index 00000000000000..f1ce0ec3bee9d3
+--- /dev/null
++++ b/tools/build/feature/test-disassembler-init-styled.c
+@@ -0,0 +1,13 @@
++// SPDX-License-Identifier: GPL-2.0
++#include <stdio.h>
++#include <dis-asm.h>
++
++int main(void)
++{
++	struct disassemble_info info;
++
++	init_disassemble_info(&info, stdout,
++			      NULL, NULL);
++
++	return 0;
++}
diff --git a/srcpkgs/linux-tools/patches/binutils-disasm-compat.patch b/srcpkgs/linux-tools/patches/binutils-disasm-compat.patch
new file mode 100644
index 000000000000..1a6cc0e6d97c
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/binutils-disasm-compat.patch
@@ -0,0 +1,102 @@
+From a45b3d6926231c3d024ea0de4f7bd967f83709ee Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:29 -0700
+Subject: tools include: add dis-asm-compat.h to handle version differences
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation failures for tools/{perf,bpf}, e.g. on debian unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+This commit introduces a wrapper for init_disassemble_info(), to avoid
+spreading #ifdef DISASM_INIT_STYLED to a bunch of places. Subsequent
+commits will use it to fix the build failures.
+
+It likely is worth adding a wrapper for disassember(), to avoid the already
+existing DISASM_FOUR_ARGS_SIGNATURE ifdefery.
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Signed-off-by: Ben Hutchings <benh@debian.org>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Quentin Monnet <quentin@isovalent.com>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-4-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/include/tools/dis-asm-compat.h | 55 ++++++++++++++++++++++++++++++++++++
+ 1 file changed, 55 insertions(+)
+ create mode 100644 tools/include/tools/dis-asm-compat.h
+
+(limited to 'tools/include/tools/dis-asm-compat.h')
+
+diff --git a/tools/include/tools/dis-asm-compat.h b/tools/include/tools/dis-asm-compat.h
+new file mode 100644
+index 0000000000000..70f331e23ed3d
+--- /dev/null
++++ b/tools/include/tools/dis-asm-compat.h
+@@ -0,0 +1,55 @@
++/* SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause */
++#ifndef _TOOLS_DIS_ASM_COMPAT_H
++#define _TOOLS_DIS_ASM_COMPAT_H
++
++#include <stdio.h>
++#include <dis-asm.h>
++
++/* define types for older binutils version, to centralize ifdef'ery a bit */
++#ifndef DISASM_INIT_STYLED
++enum disassembler_style {DISASSEMBLER_STYLE_NOT_EMPTY};
++typedef int (*fprintf_styled_ftype) (void *, enum disassembler_style, const char*, ...);
++#endif
++
++/*
++ * Trivial fprintf wrapper to be used as the fprintf_styled_func argument to
++ * init_disassemble_info_compat() when normal fprintf suffices.
++ */
++static inline int fprintf_styled(void *out,
++				 enum disassembler_style style,
++				 const char *fmt, ...)
++{
++	va_list args;
++	int r;
++
++	(void)style;
++
++	va_start(args, fmt);
++	r = vfprintf(out, fmt, args);
++	va_end(args);
++
++	return r;
++}
++
++/*
++ * Wrapper for init_disassemble_info() that hides version
++ * differences. Depending on binutils version and architecture either
++ * fprintf_func or fprintf_styled_func will be called.
++ */
++static inline void init_disassemble_info_compat(struct disassemble_info *info,
++						void *stream,
++						fprintf_ftype unstyled_func,
++						fprintf_styled_ftype styled_func)
++{
++#ifdef DISASM_INIT_STYLED
++	init_disassemble_info(info, stream,
++			      unstyled_func,
++			      styled_func);
++#else
++	(void)styled_func;
++	init_disassemble_info(info, stream,
++			      unstyled_func);
++#endif
++}
++
++#endif /* _TOOLS_DIS_ASM_COMPAT_H */
+-- 
+cgit 
+
diff --git a/srcpkgs/linux-tools/patches/bpf_jit_disasm-binutils-2.39.patch b/srcpkgs/linux-tools/patches/bpf_jit_disasm-binutils-2.39.patch
new file mode 100644
index 000000000000..01221fad3a4a
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/bpf_jit_disasm-binutils-2.39.patch
@@ -0,0 +1,104 @@
+From 96ed066054abf11c7d3e106e3011a51f3f1227a3 Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:31 -0700
+Subject: [PATCH] tools bpf_jit_disasm: Fix compilation error with new binutils
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation to fail for tools/bpf/bpf_jit_disasm.c, e.g. on debian
+unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+Wire up the feature test and switch to init_disassemble_info_compat(),
+which were introduced in prior commits, fixing the compilation failure.
+
+I verified that bpf_jit_disasm can still disassemble bpf programs, both
+with the old and new dis-asm.h API. With old binutils there's no change in
+output before/after this patch. When comparing the output from old
+binutils (2.35) to new bintuils with the patch (upstream snapshot) there
+are a few output differences, but they are unrelated to this patch. An
+example hunk is:
+
+     f4:	mov    %r14,%rsi
+     f7:	mov    %r15,%rdx
+     fa:	mov    $0x2a,%ecx
+  -  ff:	callq  0xffffffffea8c4988
+  +  ff:	call   0xffffffffea8c4988
+    104:	test   %rax,%rax
+    107:	jge    0x0000000000000110
+    109:	xor    %eax,%eax
+  - 10b:	jmpq   0x0000000000000073
+  + 10b:	jmp    0x0000000000000073
+    110:	cmp    $0x16,%rax
+
+However, I had to use an older kernel to generate the bpf_jit_enabled =
+2 output, as that has been broken since 5.18 / 1022a5498f6f745c ("bpf,
+x86_64: Use bpf_jit_binary_pack_alloc").
+
+  https://lore.kernel.org/20220703030210.pmjft7qc2eajzi6c@alap3.anarazel.de
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Daniel Borkmann <daniel@iogearbox.net>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Quentin Monnet <quentin@isovalent.com>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-6-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/bpf/Makefile         | 5 ++++-
+ tools/bpf/bpf_jit_disasm.c | 5 ++++-
+ 2 files changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/tools/bpf/Makefile b/tools/bpf/Makefile
+index b11cfc86a3d021..664601ab1705ab 100644
+--- a/tools/bpf/Makefile
++++ b/tools/bpf/Makefile
+@@ -34,7 +34,7 @@ else
+ endif
+ 
+ FEATURE_USER = .bpf
+-FEATURE_TESTS = libbfd disassembler-four-args
++FEATURE_TESTS = libbfd disassembler-four-args disassembler-init-styled
+ FEATURE_DISPLAY = libbfd disassembler-four-args
+ 
+ check_feat := 1
+@@ -56,6 +56,9 @@ endif
+ ifeq ($(feature-disassembler-four-args), 1)
+ CFLAGS += -DDISASM_FOUR_ARGS_SIGNATURE
+ endif
++ifeq ($(feature-disassembler-init-styled), 1)
++CFLAGS += -DDISASM_INIT_STYLED
++endif
+ 
+ $(OUTPUT)%.yacc.c: $(srctree)/tools/bpf/%.y
+ 	$(QUIET_BISON)$(YACC) -o $@ -d $<
+diff --git a/tools/bpf/bpf_jit_disasm.c b/tools/bpf/bpf_jit_disasm.c
+index c8ae9580472814..a90a5d110f9255 100644
+--- a/tools/bpf/bpf_jit_disasm.c
++++ b/tools/bpf/bpf_jit_disasm.c
+@@ -28,6 +28,7 @@
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <limits.h>
++#include <tools/dis-asm-compat.h>
+ 
+ #define CMD_ACTION_SIZE_BUFFER		10
+ #define CMD_ACTION_READ_ALL		3
+@@ -64,7 +65,9 @@ static void get_asm_insns(uint8_t *image, size_t len, int opcodes)
+ 	assert(bfdf);
+ 	assert(bfd_check_format(bfdf, bfd_object));
+ 
+-	init_disassemble_info(&info, stdout, (fprintf_ftype) fprintf);
++	init_disassemble_info_compat(&info, stdout,
++				     (fprintf_ftype) fprintf,
++				     fprintf_styled);
+ 	info.arch = bfd_get_arch(bfdf);
+ 	info.mach = bfd_get_mach(bfdf);
+ 	info.buffer = image;
diff --git a/srcpkgs/linux-tools/patches/bpftool-binutils-2.39.patch b/srcpkgs/linux-tools/patches/bpftool-binutils-2.39.patch
new file mode 100644
index 000000000000..1e55c40011be
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/bpftool-binutils-2.39.patch
@@ -0,0 +1,149 @@
+From 600b7b26c07a070d0153daa76b3806c1e52c9e00 Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:33 -0700
+Subject: [PATCH] tools bpftool: Fix compilation error with new binutils
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation to fail for tools/bpf/bpftool/jit_disasm.c, e.g. on debian
+unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+Wire up the feature test and switch to init_disassemble_info_compat(),
+which were introduced in prior commits, fixing the compilation failure.
+
+I verified that bpftool can still disassemble bpf programs, both with an
+old and new dis-asm.h API. There are no output changes for plain and json
+formats. When comparing the output from old binutils (2.35)
+to new bintuils with the patch (upstream snapshot) there are a few output
+differences, but they are unrelated to this patch. An example hunk is:
+
+     2f:	pop    %r14
+     31:	pop    %r13
+     33:	pop    %rbx
+  -  34:	leaveq
+  -  35:	retq
+  +  34:	leave
+  +  35:	ret
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Quentin Monnet <quentin@isovalent.com>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-8-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/bpf/bpftool/Makefile     |  5 +++-
+ tools/bpf/bpftool/jit_disasm.c | 42 +++++++++++++++++++++++++++-------
+ 2 files changed, 38 insertions(+), 9 deletions(-)
+
+diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile
+index c6d2c77d02524a..436e671b2657d4 100644
+--- a/tools/bpf/bpftool/Makefile
++++ b/tools/bpf/bpftool/Makefile
+@@ -62,7 +62,7 @@ CLANG ?= clang
+ LLVM_STRIP ?= llvm-strip
+ 
+ FEATURE_USER = .bpftool
+-FEATURE_TESTS = libbfd disassembler-four-args reallocarray zlib libcap \
++FEATURE_TESTS = libbfd disassembler-four-args disassembler-init-styled reallocarray zlib libcap \
+ 	clang-bpf-co-re
+ FEATURE_DISPLAY = libbfd disassembler-four-args zlib libcap \
+ 	clang-bpf-co-re
+@@ -117,6 +117,9 @@ endif
+ ifeq ($(feature-disassembler-four-args), 1)
+ CFLAGS += -DDISASM_FOUR_ARGS_SIGNATURE
+ endif
++ifeq ($(feature-disassembler-init-styled), 1)
++    CFLAGS += -DDISASM_INIT_STYLED
++endif
+ 
+ LIBS = $(LIBBPF) -lelf -lz
+ LIBS_BOOTSTRAP = $(LIBBPF_BOOTSTRAP) -lelf -lz
+diff --git a/tools/bpf/bpftool/jit_disasm.c b/tools/bpf/bpftool/jit_disasm.c
+index 24734f2249d6ec..aaf99a0168c90b 100644
+--- a/tools/bpf/bpftool/jit_disasm.c
++++ b/tools/bpf/bpftool/jit_disasm.c
+@@ -24,6 +24,7 @@
+ #include <sys/stat.h>
+ #include <limits.h>
+ #include <bpf/libbpf.h>
++#include <tools/dis-asm-compat.h>
+ 
+ #include "json_writer.h"
+ #include "main.h"
+@@ -39,15 +40,12 @@ static void get_exec_path(char *tpath, s
+ }
+ 
+ static int oper_count;
+-static int fprintf_json(void *out, const char *fmt, ...)
++static int printf_json(void *out, const char *fmt, va_list ap)
+ {
+-	va_list ap;
+ 	char *s;
+ 
+-	va_start(ap, fmt);
+ 	if (vasprintf(&s, fmt, ap) < 0)
+ 		return -1;
+-	va_end(ap);
+ 
+ 	if (!oper_count) {
+ 		int i;
+@@ -73,6 +71,32 @@ static int fprintf_json(void *out, const char *fmt, ...)
+ 	return 0;
+ }
+ 
++static int fprintf_json(void *out, const char *fmt, ...)
++{
++	va_list ap;
++	int r;
++
++	va_start(ap, fmt);
++	r = printf_json(out, fmt, ap);
++	va_end(ap);
++
++	return r;
++}
++
++static int fprintf_json_styled(void *out,
++			       enum disassembler_style style __maybe_unused,
++			       const char *fmt, ...)
++{
++	va_list ap;
++	int r;
++
++	va_start(ap, fmt);
++	r = printf_json(out, fmt, ap);
++	va_end(ap);
++
++	return r;
++}
++
+ void disasm_print_insn(unsigned char *image, ssize_t len, int opcodes,
+ 		       const char *arch, const char *disassembler_options,
+ 		       const struct btf *btf,
+@@ -99,11 +123,13 @@ void disasm_print_insn(unsigned char *image, ssize_t len, int opcodes,
+ 	assert(bfd_check_format(bfdf, bfd_object));
+ 
+ 	if (json_output)
+-		init_disassemble_info(&info, stdout,
+-				      (fprintf_ftype) fprintf_json);
++		init_disassemble_info_compat(&info, stdout,
++					     (fprintf_ftype) fprintf_json,
++					     fprintf_json_styled);
+ 	else
+-		init_disassemble_info(&info, stdout,
+-				      (fprintf_ftype) fprintf);
++		init_disassemble_info_compat(&info, stdout,
++					     (fprintf_ftype) fprintf,
++					     fprintf_styled);
+ 
+ 	/* Update architecture info for offload. */
+ 	if (arch) {
diff --git a/srcpkgs/linux-tools/patches/perf-binutils-2.39.patch b/srcpkgs/linux-tools/patches/perf-binutils-2.39.patch
new file mode 100644
index 000000000000..3484330f7286
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/perf-binutils-2.39.patch
@@ -0,0 +1,114 @@
+From 83aa0120487e8bc3f231e72c460add783f71f17c Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:30 -0700
+Subject: [PATCH] tools perf: Fix compilation error with new binutils
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation failures for tools/perf/util/annotate.c, e.g. on debian
+unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+Wire up the feature test and switch to init_disassemble_info_compat(),
+which were introduced in prior commits, fixing the compilation failure.
+
+I verified that perf can still disassemble bpf programs by using bpftrace
+under load, recording a perf trace, and then annotating the bpf "function"
+with and without the changes. With old binutils there's no change in output
+before/after this patch. When comparing the output from old binutils (2.35)
+to new bintuils with the patch (upstream snapshot) there are a few output
+differences, but they are unrelated to this patch. An example hunk is:
+
+       1.15 :   55:mov    %rbp,%rdx
+       0.00 :   58:add    $0xfffffffffffffff8,%rdx
+       0.00 :   5c:xor    %ecx,%ecx
+  -    1.03 :   5e:callq  0xffffffffe12aca3c
+  +    1.03 :   5e:call   0xffffffffe12aca3c
+       0.00 :   63:xor    %eax,%eax
+  -    2.18 :   65:leaveq
+  -    2.82 :   66:retq
+  +    2.18 :   65:leave
+  +    2.82 :   66:ret
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-5-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/perf/Makefile.config | 8 ++++++++
+ tools/perf/util/annotate.c | 7 ++++---
+ 2 files changed, 12 insertions(+), 3 deletions(-)
+
+diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
+index d3c254c0f5c611..23648ea54e8d3d 100644
+--- a/tools/perf/Makefile.config
++++ b/tools/perf/Makefile.config
+@@ -298,6 +298,7 @@ FEATURE_CHECK_LDFLAGS-libpython := $(PYTHON_EMBED_LDOPTS)
+ FEATURE_CHECK_LDFLAGS-libaio = -lrt
+ 
+ FEATURE_CHECK_LDFLAGS-disassembler-four-args = -lbfd -lopcodes -ldl
++FEATURE_CHECK_LDFLAGS-disassembler-init-styled = -lbfd -lopcodes -ldl
+ 
+ CORE_CFLAGS += -fno-omit-frame-pointer
+ CORE_CFLAGS += -ggdb3
+@@ -818,13 +819,16 @@ else
+   ifeq ($(feature-libbfd-liberty), 1)
+     EXTLIBS += -lbfd -lopcodes -liberty
+     FEATURE_CHECK_LDFLAGS-disassembler-four-args += -liberty -ldl
++    FEATURE_CHECK_LDFLAGS-disassembler-init-styled += -liberty -ldl
+   else
+     ifeq ($(feature-libbfd-liberty-z), 1)
+       EXTLIBS += -lbfd -lopcodes -liberty -lz
+       FEATURE_CHECK_LDFLAGS-disassembler-four-args += -liberty -lz -ldl
++      FEATURE_CHECK_LDFLAGS-disassembler-init-styled += -liberty -lz -ldl
+     endif
+   endif
+   $(call feature_check,disassembler-four-args)
++  $(call feature_check,disassembler-init-styled)
+ endif
+ 
+ ifeq ($(feature-libbfd-buildid), 1)
+@@ -1044,6 +1048,10 @@ ifeq ($(feature-disassembler-four-args), 1)
+     CFLAGS += -DDISASM_FOUR_ARGS_SIGNATURE
+ endif
+ 
++ifeq ($(feature-disassembler-init-styled), 1)
++    CFLAGS += -DDISASM_INIT_STYLED
++endif
++
+ ifeq (${IS_64_BIT}, 1)
+   ifndef NO_PERF_READ_VDSO32
+     $(call feature_check,compile-32)
+diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
+index 82cc396ef516c4..2c6a485c3de5d9 100644
+--- a/tools/perf/util/annotate.c
++++ b/tools/perf/util/annotate.c
+@@ -1676,6 +1676,7 @@ fallback:
+ #define PACKAGE "perf"
+ #include <bfd.h>
+ #include <dis-asm.h>
++#include <tools/dis-asm-compat.h>
+ 
+ static int symbol__disassemble_bpf(struct symbol *sym,
+ 				   struct annotate_args *args)
+@@ -1762,9 +1763,9 @@ static int symbol__disassemble_bpf(struct symbol *sym,
+ 		ret = errno;
+ 		goto out;
+ 	}
+-	init_disassemble_info(&info, s,
+-			      (fprintf_ftype) fprintf);
+-
++	init_disassemble_info_compat(&info, s,
++				     (fprintf_ftype) fprintf,
++				     fprintf_styled);
+ 	info.arch = bfd_get_arch(bfdf);
+ 	info.mach = bfd_get_mach(bfdf);
+ 

From 2829ba858f28b64beb6e8ff3c3cd7fa70fb00695 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 14:45:28 -0700
Subject: [PATCH 26/52] libsasl: fix build for libtool 2.4.7

---
 srcpkgs/libsasl/template | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/libsasl/template b/srcpkgs/libsasl/template
index a8817042f843..a2993b39f4a1 100644
--- a/srcpkgs/libsasl/template
+++ b/srcpkgs/libsasl/template
@@ -19,6 +19,7 @@ distfiles="https://github.com/cyrusimap/cyrus-sasl/releases/download/cyrus-sasl-
 checksum=26866b1549b00ffd020f188a43c258017fa1c382b3ddadd8201536f72efb05d5
 
 pre_configure() {
+	rm -f m4/ltversion.m4
 	autoreconf -fi
 }
 

From 69342224c4e1ff0e2b651e28d1068f08e3222632 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:08 -0700
Subject: [PATCH 27/52] subversion: fix build for libtool 2.4.7

---
 srcpkgs/subversion/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion/template b/srcpkgs/subversion/template
index 8ad178264942..3f1c9e254e61 100644
--- a/srcpkgs/subversion/template
+++ b/srcpkgs/subversion/template
@@ -57,7 +57,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From f48cd31424fc09faeb66656419f624dba1bcb220 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:38 -0700
Subject: [PATCH 28/52] subversion-kwallet-auth: fix build for libtool 2.4.7

---
 srcpkgs/subversion-kwallet-auth/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion-kwallet-auth/template b/srcpkgs/subversion-kwallet-auth/template
index 12210f250d51..b4d8621456ea 100644
--- a/srcpkgs/subversion-kwallet-auth/template
+++ b/srcpkgs/subversion-kwallet-auth/template
@@ -59,7 +59,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From 843f50cdd29234260e006ea3628ddac08f9e0798 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 20:07:32 -0700
Subject: [PATCH 29/52] gpgme: update to 1.18.0.

---
 common/shlibs          | 2 +-
 srcpkgs/gpgme/template | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 52220e69706d..98017bdd5e3d 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -723,7 +723,7 @@ libdconf.so.1 dconf-0.13.90_1
 libassuan.so.0 libassuan-2.0.1_1
 libgpgme.so.11 libgpgme-1.12.0_2
 libgpgmepp.so.6 gpgmepp-1.7.0_3
-libqgpgme.so.7 gpgmeqt-1.7.0_3
+libqgpgme.so.15 gpgmeqt-1.18.0_1
 libgarcon-1.so.0 garcon-0.1.12_1
 libgarcon-gtk2-1.so.0 garcon-0.4.0_1
 libgarcon-gtk3-1.so.0 garcon-0.6.1_1
diff --git a/srcpkgs/gpgme/template b/srcpkgs/gpgme/template
index 8633075a8404..b1cfd5f78657 100644
--- a/srcpkgs/gpgme/template
+++ b/srcpkgs/gpgme/template
@@ -1,7 +1,7 @@
 # Template file for 'gpgme'
 pkgname=gpgme
-version=1.15.1
-revision=2
+version=1.18.0
+revision=1
 build_style=gnu-configure
 configure_args="--enable-fd-passing
  --with-libgpg-error-prefix=$XBPS_CROSS_BASE/usr
@@ -14,7 +14,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.gnupg.org/software/gpgme/index.html"
 distfiles="https://www.gnupg.org/ftp/gcrypt/gpgme/gpgme-${version}.tar.bz2"
-checksum=eebc3c1b27f1c8979896ff361ba9bb4778b508b2496c2fc10e3775a40b1de1ad
+checksum=361d4eae47ce925dba0ea569af40e7b52c645c4ae2e65e5621bf1b6cdd8b0e9e
 
 if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
 	configure_args+=" ac_cv_sys_file_offset_bits=no"

From 0706fc100886e2692832ff4bd305de7a81a715d2 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 30/52] cross-aarch64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..bd6b23f9fb6a 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 2abe07b8f861ef96a00ca8abe85a65a522884db3 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 31/52] cross-aarch64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..427ad2c1e9cd 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From fc5e18e514783e9b0882a2a18d013ae550d57a5b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 32/52] cross-arm-linux-gnueabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..2510ee26e789 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 4444a5e3daff4a1b79bb03fc4a372c9d1ac0baa9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 33/52] cross-arm-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..bd8b16e1b4c1 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 7dbd925727e710230d93a0f1b71ee0e4e4fa11a8 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 34/52] cross-arm-linux-musleabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..dacfd2655216 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From b97c12769848da6de8c63a53c855edeed79f2938 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 35/52] cross-arm-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..9ddd32a9f20d 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From dbbb927f9a1296abb82e052e01a56833cf5d3fe6 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 36/52] cross-armv7l-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..9fb00f18be3b 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 34c92104fa4572f92386562e97a1c51931c18f29 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 37/52] cross-armv7l-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..2c72e75ddfe3 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From c3952b666792b231064f8e4c22162046040862d0 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 38/52] cross-i686-pc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..4dc17df648b5 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From c447d2ab4cb7710739b00e80cbd0b5440e7847e7 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 39/52] cross-mips-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..6009e5c79eb2 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 53fd38de46a0b24fdb1cde34b1452f0722239a44 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 40/52] cross-mips-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..080164df193d 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="hipperson0 <hipperson0@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From eb403bdf7ec815d96c486f4f1330c0be9877a3af Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 41/52] cross-mipsel-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..c8f90cfa43cc 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_musl_version=1.1.24
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 7d4aab28862cec694b97294f51580606c259e562 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 42/52] cross-mipsel-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..931345d2de15 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_musl_version=1.1.24
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From f2f351685f3b3239a738a2234a0e4fe792caaa38 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 43/52] cross-powerpc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..31e57b4e52b2 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From ac7c5d95dbd513c69a9694e1bfd623e4001078b2 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 44/52] cross-powerpc-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..a2d1edcf1ffd 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 4970f111fe20964c31d24e82b73d12f730aff4ee Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 45/52] cross-powerpc64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..1a4cbed61e76 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From e0c284be1d4c8b31e05d0d9748e1d5c746fe6735 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 46/52] cross-powerpc64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 1ebd0fb2048d..ade42018af05 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 818f7439e5ab6002f56ad2b9365e1a2009633ef9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 47/52] cross-powerpc64le-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 733f5851da5c..dd1ad383a21e 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 7b550c15e40b9d3d0b5c2322da75baf4fc1b3816 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 48/52] cross-powerpc64le-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index 76a70aa1d6db..5887f845f932 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 7db66e66285bc2f67ecf4a58fb85e63757036c2e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 49/52] cross-powerpcle-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 347b8fcf4f55..06530e0d609b 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From d605f7439f01af188a0b04cdb37086d9f8c6912b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:19 -0700
Subject: [PATCH 50/52] cross-powerpcle-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index ec9324ddaa99..e68c3962b49c 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 6901b69baf1b4dcbcc8979729f80503220b82503 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:19 -0700
Subject: [PATCH 51/52] cross-x86_64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 0078fbe7224b..7da85c14b62d 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From d4559b2452201c3fc17057b0b2ed76c373abb403 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:19 -0700
Subject: [PATCH 52/52] cross-x86_64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..2811de0d3c2e 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (47 preceding siblings ...)
  2022-08-24 20:52 ` oreo639
@ 2022-08-24 23:42 ` oreo639
  2022-08-24 23:58 ` oreo639
                   ` (215 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-08-24 23:42 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5538 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.2.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.2.0

This PR depends on: https://github.com/void-linux/void-packages/pull/32330

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

Also, keep in mind that the libgo musl patch here will need to be updated once musl is updated:
https://github.com/void-linux/void-packages/pull/34902/files#diff-1f42a95b93c9550178ff1fbccbef2f47a72711df15c24c9472e2550076978129R163-R176

This is the updated patch for reference:
https://github.com/alpinelinux/aports/blob/8acb21b8ee881e7ab1c812d9a66a17d2501b8730/main/gcc/0049-libgo-adjust-name-of-union-in-sigevent-struct.patch

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/38817
- [x] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [ ] llvm https://github.com/void-linux/void-packages/pull/38694
- [ ] m4 https://github.com/void-linux/void-packages/pull/33730
- [ ] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [ ] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [ ] libvirt https://github.com/void-linux/void-packages/pull/38842
- [ ] syslinux https://github.com/void-linux/void-packages/pull/38876
- [ ] efivar https://github.com/void-linux/void-packages/pull/38874

Known packages that needed to be fixed/updated for gcc12:
- [ ] linux5.18 (in this PR)
- [ ] openssh https://github.com/void-linux/void-packages/pull/38849
- [ ] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [ ] doxygen https://github.com/void-linux/void-packages/pull/38846
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/38817
- [ ] libproxy https://github.com/void-linux/void-packages/pull/38818
- [ ] exempi https://github.com/void-linux/void-packages/pull/38820
- [ ] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [ ] gpgme https://github.com/void-linux/void-packages/pull/38825
- [ ] libunique1 https://github.com/void-linux/void-packages/pull/38848 or https://github.com/void-linux/void-packages/pull/38873
- [ ] libwpd https://github.com/void-linux/void-packages/pull/38878

Needs to be fixed/updated for binutils:
- [ ] grub https://github.com/void-linux/void-packages/pull/38875
- [ ] linux-tools https://github.com/void-linux/void-packages/pull/38877

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [x] kde
- [x] lxde
- [x] lxqt

You can test the ISOs here:
https://drive.google.com/drive/folders/1ix92CYSLUP-KWjLxltdgG4e8Nu2JCY5n?usp=sharing

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 168750 bytes --]

From 2a99716dd0120c4f8705664efa992a5a5ba314e9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 01/52] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 15 +++--
 3 files changed, 28 insertions(+), 113 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..8207cc1d6774 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkg-config"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -44,6 +45,12 @@ do_configure() {
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	# gprofng currently only supports x86_64 and aarch64 glibc.
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64|aarch64) conf+=" --enable-gprofng" ;;
+		*) conf+=" --disable-gprofng" ;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"

From 1f1a73e0fce806409f60b6f7c9a3eb230f01f8de Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 02/52] gcc: update to 12.2.0.

---
 common/shlibs                                 | 10 +--
 srcpkgs/gcc/files/gccgo-musl.patch            | 74 ++++---------------
 srcpkgs/gcc/files/libgnarl-musl.patch         | 18 ++---
 srcpkgs/gcc/files/libssp-musl.patch           | 10 +--
 srcpkgs/gcc/patches/libffi_gnulinux.patch     | 11 ---
 .../gcc/patches/libgcc-ibm128-no-tag.patch    | 10 ++-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |  2 +-
 srcpkgs/gcc/template                          | 25 +++----
 8 files changed, 52 insertions(+), 108 deletions(-)
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index f829ee12e80f..bde5320461ce 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.2.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.34 perl-5.34.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -848,8 +848,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.2.0_1
+libgnat-12.so libada-12.2.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1700,8 +1700,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.2.0_1
+libasan.so.8 libsanitizer-12.2.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..632ef951097b 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,17 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ a/libgo/go/runtime/os_linux.go
+@@ -363,9 +363,9 @@
+ 
+ 	var timerid int32
+ 	var sevp _sigevent
+-	sevp.sigev_notify = _SIGEV_THREAD_ID
++	sevp.sigev_notify = 4
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.sigev_notify_function))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..446741390d45 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,15 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
+version=12.2.0
+revision=1
 _patchver="${version%pre*}"
 _minorver="${_patchver%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 wrksrc=gcc-${version/pre/_pre}
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +19,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -396,7 +393,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}

From 88160e9f9c4c3b593cc5a7fe17b0cea533f96c13 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 03/52] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      |  6 ++--
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..08e35d466a44 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From aa3afb6f93e419850cbb98714a4f27590a40e2e2 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 04/52] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 1a4e1ca3d594..b04268908c2e 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="q66 <daniel@octaforge.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From c5bbb551e87df6ae035e8cad534913f19a8f03d7 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 05/52] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 3 files changed, 55 insertions(+), 353 deletions(-)
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index bde5320461ce..52220e69706d 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From 77ce619e1f317b2a1e7390b3e678171cb06b9ceb Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 21:01:43 -0700
Subject: [PATCH 06/52] gcc-multilib: update to 12.2.0.

---
 srcpkgs/gcc-multilib/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index fcd25755aa75..1a26da26a991 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,16 +3,16 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _majorver="${version%.*}"
-wrksrc=gcc-${version/pre/_pre}
+wrksrc=gcc-${version}
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel

From d84adae6b71ab82cf3f61015286344b5c42dd96d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 16:22:03 -0700
Subject: [PATCH 07/52] llvm12: fix build for glibc 2.36

---
 .../compiler-rt-sanitizer-glibc-2.36.patch    | 59 +++++++++++++++++++
 1 file changed, 59 insertions(+)
 create mode 100644 srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch

diff --git a/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch b/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch
new file mode 100644
index 000000000000..e5f24dab8935
--- /dev/null
+++ b/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch
@@ -0,0 +1,59 @@
+From 9cf13067cb5088626ba7ee1ec4c42ec59c7995a0 Mon Sep 17 00:00:00 2001
+From: Fangrui Song <i@maskray.me>
+Date: Mon, 11 Jul 2022 12:53:34 -0700
+Subject: [PATCH] [sanitizer] Remove #include <linux/fs.h> to resolve
+ fsconfig_command/mount_attr conflict with glibc 2.36
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+It is generally not a good idea to mix usage of glibc headers and Linux UAPI
+headers (https://sourceware.org/glibc/wiki/Synchronizing_Headers). In glibc
+since 7eae6a91e9b1670330c9f15730082c91c0b1d570 (milestone: 2.36), sys/mount.h
+defines `fsconfig_command` which conflicts with linux/mount.h:
+
+    .../usr/include/linux/mount.h:95:6: error: redeclaration of ‘enum fsconfig_command’
+
+Remove #include <linux/fs.h> which pulls in linux/mount.h. Expand its 4 macros manually.
+Android sys/mount.h doesn't define BLKBSZGET and it still needs linux/fs.h.
+In the long term we should move Linux specific definitions to sanitizer_platform_limits_linux.cpp
+but this commit is easy to cherry pick into older compiler-rt releases.
+
+Fix https://github.com/llvm/llvm-project/issues/56421
+
+Reviewed By: #sanitizers, vitalybuka, zatrazz
+
+Differential Revision: https://reviews.llvm.org/D129471
+---
+ .../sanitizer_platform_limits_posix.cpp                | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+index 4bd425435d56d..3a94b260686f1 100644
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -73,7 +73,9 @@
+ #include <sys/vt.h>
+ #include <linux/cdrom.h>
+ #include <linux/fd.h>
++#if SANITIZER_ANDROID
+ #include <linux/fs.h>
++#endif
+ #include <linux/hdreg.h>
+ #include <linux/input.h>
+ #include <linux/ioctl.h>
+@@ -876,10 +878,10 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
+   unsigned IOCTL_EVIOCGPROP = IOCTL_NOT_PRESENT;
+   unsigned IOCTL_EVIOCSKEYCODE_V2 = IOCTL_NOT_PRESENT;
+ #endif
+-  unsigned IOCTL_FS_IOC_GETFLAGS = FS_IOC_GETFLAGS;
+-  unsigned IOCTL_FS_IOC_GETVERSION = FS_IOC_GETVERSION;
+-  unsigned IOCTL_FS_IOC_SETFLAGS = FS_IOC_SETFLAGS;
+-  unsigned IOCTL_FS_IOC_SETVERSION = FS_IOC_SETVERSION;
++  unsigned IOCTL_FS_IOC_GETFLAGS = _IOR('f', 1, long);
++  unsigned IOCTL_FS_IOC_GETVERSION = _IOR('v', 1, long);
++  unsigned IOCTL_FS_IOC_SETFLAGS = _IOW('f', 2, long);
++  unsigned IOCTL_FS_IOC_SETVERSION = _IOW('v', 2, long);
+   unsigned IOCTL_GIO_CMAP = GIO_CMAP;
+   unsigned IOCTL_GIO_FONT = GIO_FONT;
+   unsigned IOCTL_GIO_UNIMAP = GIO_UNIMAP;

From bfc65b09863d38f1f4b0ce966c0cd139b34d66d1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 17:21:40 -0700
Subject: [PATCH 08/52] m4: update to 1.4.19.

---
 srcpkgs/m4/patches/fix-glibc-2.27.patch | 167 ------------------------
 srcpkgs/m4/template                     |  12 +-
 2 files changed, 6 insertions(+), 173 deletions(-)
 delete mode 100644 srcpkgs/m4/patches/fix-glibc-2.27.patch

diff --git a/srcpkgs/m4/patches/fix-glibc-2.27.patch b/srcpkgs/m4/patches/fix-glibc-2.27.patch
deleted file mode 100644
index 59d33cff164d..000000000000
--- a/srcpkgs/m4/patches/fix-glibc-2.27.patch
+++ /dev/null
@@ -1,167 +0,0 @@
-From 4af4a4a71827c0bc5e0ec67af23edef4f15cee8e Mon Sep 17 00:00:00 2001
-From: Paul Eggert <eggert@cs.ucla.edu>
-Date: Mon, 5 Mar 2018 10:56:29 -0800
-Subject: [PATCH] fflush: adjust to glibc 2.28 libio.h removal
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Problem reported by Daniel P. Berrangé in:
-https://lists.gnu.org/r/bug-gnulib/2018-03/msg00000.html
-* lib/fbufmode.c (fbufmode):
-* lib/fflush.c (clear_ungetc_buffer_preserving_position)
-(disable_seek_optimization, rpl_fflush):
-* lib/fpending.c (__fpending):
-* lib/fpurge.c (fpurge):
-* lib/freadable.c (freadable):
-* lib/freadahead.c (freadahead):
-* lib/freading.c (freading):
-* lib/freadptr.c (freadptr):
-* lib/freadseek.c (freadptrinc):
-* lib/fseeko.c (fseeko):
-* lib/fseterr.c (fseterr):
-* lib/fwritable.c (fwritable):
-* lib/fwriting.c (fwriting):
-Check _IO_EOF_SEEN instead of _IO_ftrylockfile.
-* lib/stdio-impl.h (_IO_IN_BACKUP) [_IO_EOF_SEEN]:
-Define if not already defined.
-
-[yann.morin.1998@free.fr: partially backport from upstream gnulib]
-Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
-
----
- lib/fflush.c     |  6 +++---
- lib/fpending.c   |  2 +-
- lib/fpurge.c     |  2 +-
- lib/freadahead.c |  2 +-
- lib/freading.c   |  2 +-
- lib/fseeko.c     |  4 ++--
- lib/stdio-impl.h |  6 ++++++
- 7 files changed, 15 insertions(+), 9 deletions(-)
-
-diff --git a/lib/fflush.c b/build-aux/gnulib/lib/fflush.c
-index 983ade0ff..a6edfa105 100644
---- a/lib/fflush.c
-+++ b/lib/fflush.c
-@@ -33,7 +33,7 @@
- #undef fflush
- 
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- 
- /* Clear the stream's ungetc buffer, preserving the value of ftello (fp).  */
- static void
-@@ -72,7 +72,7 @@ clear_ungetc_buffer (FILE *fp)
- 
- #endif
- 
--#if ! (defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
-+#if ! (defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
- 
- # if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT
- /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
-@@ -148,7 +148,7 @@ rpl_fflush (FILE *stream)
-   if (stream == NULL || ! freading (stream))
-     return fflush (stream);
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- 
-   clear_ungetc_buffer_preserving_position (stream);
- 
-diff --git a/lib/fpending.c b/build-aux/gnulib/lib/fpending.c
-index c84e3a5b4..789f50e4e 100644
---- a/lib/fpending.c
-+++ b/lib/fpending.c
-@@ -32,7 +32,7 @@ __fpending (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   return fp->_IO_write_ptr - fp->_IO_write_base;
- #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
-   /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
-diff --git a/lib/fpurge.c b/build-aux/gnulib/lib/fpurge.c
-index b1d417c7a..3aedcc373 100644
---- a/lib/fpurge.c
-+++ b/lib/fpurge.c
-@@ -62,7 +62,7 @@ fpurge (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   fp->_IO_read_end = fp->_IO_read_ptr;
-   fp->_IO_write_ptr = fp->_IO_write_base;
-   /* Avoid memory leak when there is an active ungetc buffer.  */
-diff --git a/lib/freadahead.c b/build-aux/gnulib/lib/freadahead.c
-index c2ecb5b28..23ec76ee5 100644
---- a/lib/freadahead.c
-+++ b/lib/freadahead.c
-@@ -30,7 +30,7 @@ extern size_t __sreadahead (FILE *);
- size_t
- freadahead (FILE *fp)
- {
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   if (fp->_IO_write_ptr > fp->_IO_write_base)
-     return 0;
-   return (fp->_IO_read_end - fp->_IO_read_ptr)
-diff --git a/lib/freading.c b/build-aux/gnulib/lib/freading.c
-index 73c28acdd..c24d0c88a 100644
---- a/lib/freading.c
-+++ b/lib/freading.c
-@@ -31,7 +31,7 @@ freading (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   return ((fp->_flags & _IO_NO_WRITES) != 0
-           || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0
-               && fp->_IO_read_base != NULL));
-diff --git a/lib/fseeko.c b/build-aux/gnulib/lib/fseeko.c
-index 0101ab55f..193f4e8ce 100644
---- a/lib/fseeko.c
-+++ b/lib/fseeko.c
-@@ -47,7 +47,7 @@ fseeko (FILE *fp, off_t offset, int whence)
- #endif
- 
-   /* These tests are based on fpurge.c.  */
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   if (fp->_IO_read_end == fp->_IO_read_ptr
-       && fp->_IO_write_ptr == fp->_IO_write_base
-       && fp->_IO_save_base == NULL)
-@@ -123,7 +123,7 @@ fseeko (FILE *fp, off_t offset, int whence)
-           return -1;
-         }
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-       fp->_flags &= ~_IO_EOF_SEEN;
-       fp->_offset = pos;
- #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
-diff --git a/lib/stdio-impl.h b/build-aux/gnulib/lib/stdio-impl.h
-index 78d896e9f..05c5752a2 100644
---- a/lib/stdio-impl.h
-+++ b/lib/stdio-impl.h
-@@ -18,6 +18,12 @@
-    the same implementation of stdio extension API, except that some fields
-    have different naming conventions, or their access requires some casts.  */
- 
-+/* Glibc 2.28 made _IO_IN_BACKUP private.  For now, work around this
-+   problem by defining it ourselves.  FIXME: Do not rely on glibc
-+   internals.  */
-+#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN
-+# define _IO_IN_BACKUP 0x100
-+#endif
- 
- /* BSD stdio derived implementations.  */
- 
--- 
-2.14.1
-
-
diff --git a/srcpkgs/m4/template b/srcpkgs/m4/template
index 78f3dae6184a..762593d883bd 100644
--- a/srcpkgs/m4/template
+++ b/srcpkgs/m4/template
@@ -1,17 +1,17 @@
 # Template file for 'm4'
 pkgname=m4
-version=1.4.18
-revision=2
+version=1.4.19
+revision=1
 bootstrap=yes
-replaces="chroot-m4>=0"
 build_style=gnu-configure
 configure_args="--enable-changeword --enable-threads"
 short_desc="GNU version of UNIX m4 macro language processor"
-homepage="https://www.gnu.org/software/m4/"
-license="GPL-3.0-or-later"
 maintainer="Enno Boland <gottox@voidlinux.org>"
+license="GPL-3.0-or-later"
+homepage="https://www.gnu.org/software/m4/"
 distfiles="${GNU_SITE}/${pkgname}/${pkgname}-${version}.tar.xz"
-checksum=f2c1e86ca0a404ff281631bdc8377638992744b175afb806e25871a24a934e07
+checksum=63aede5c6d33b6d9b13511cd0be2cac046f2e70fd0a07aa9573a04a82783af96
+replaces="chroot-m4>=0"
 
 if [ "$XBPS_TARGET_LIBC" = musl ]; then
 	export ac_cv_lib_error_at_line=no

From d2b22031a08f4c7ff1e03abcc199ebe24d21eeca Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 22:57:59 -0700
Subject: [PATCH 09/52] btrfs-progs: update to 5.19.

---
 srcpkgs/btrfs-progs/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/btrfs-progs/template b/srcpkgs/btrfs-progs/template
index f6c53d8587e1..292d5110106b 100644
--- a/srcpkgs/btrfs-progs/template
+++ b/srcpkgs/btrfs-progs/template
@@ -1,6 +1,6 @@
 # Template file for 'btrfs-progs'
 pkgname=btrfs-progs
-version=5.18.1
+version=5.19
 revision=1
 wrksrc="${pkgname}-v${version}"
 build_style=gnu-configure
@@ -16,7 +16,7 @@ license="GPL-2.0-only, LGPL-2.1-or-later"
 homepage="https://btrfs.wiki.kernel.org/index.php/Main_Page"
 changelog="https://raw.githubusercontent.com/kdave/btrfs-progs/master/CHANGES"
 distfiles="${KERNEL_SITE}/kernel/people/kdave/${pkgname}/${pkgname}-v${version}.tar.xz"
-checksum=6e98a75ccff52e9354daa1ad284c614c490f844273a2fa524cbac9eb841c7255
+checksum=1fbcf06e4b2f80e7a127fd687ed4625a5b74fa674fe212c836ff70e0edfcccf9
 # Most of the tests depend on `mount` and `fallocate` commands, which are not
 # presented in chroot-util-linux
 make_check=no

From 20f7794ee59243cb67a2f97a26e6d5bedcd9e950 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 19:39:23 -0700
Subject: [PATCH 10/52] syslinux: fix build for glibc 2.36

---
 .../patches/fix-build-with-glibc-2.36.patch   | 30 +++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 srcpkgs/syslinux/patches/fix-build-with-glibc-2.36.patch

diff --git a/srcpkgs/syslinux/patches/fix-build-with-glibc-2.36.patch b/srcpkgs/syslinux/patches/fix-build-with-glibc-2.36.patch
new file mode 100644
index 000000000000..1303be56c127
--- /dev/null
+++ b/srcpkgs/syslinux/patches/fix-build-with-glibc-2.36.patch
@@ -0,0 +1,30 @@
+--- a/linux/syslinux.c
++++ b/linux/syslinux.c
+@@ -45,7 +45,6 @@
+ #include <sys/stat.h>
+ #include <sys/types.h>
+ #include <sys/wait.h>
+-#include <sys/mount.h>
+ 
+ #include "linuxioctl.h"
+ 
+--- a/libinstaller/syslxcom.c
++++ b/libinstaller/syslxcom.c
+@@ -28,7 +28,6 @@
+ #include <errno.h>
+ #include <sys/stat.h>
+ #include <sys/types.h>
+-#include <sys/mount.h>
+ #include <sys/vfs.h>
+ 
+ #include "linuxioctl.h"
+--- a/extlinux/main.c
++++ b/extlinux/main.c
+@@ -40,7 +40,6 @@
+ #include <sys/stat.h>
+ #include <sys/sysmacros.h>
+ #include <sys/types.h>
+-#include <sys/mount.h>
+ #include <sys/vfs.h>
+ 
+ #include "linuxioctl.h"

From 844d62ad79127635e40a10adecefd876eb35e2cf Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 14 Aug 2022 19:29:36 -0700
Subject: [PATCH 11/52] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove -no-pie from build. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..0994617fac96 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -60,6 +60,7 @@ _void_cross_build_binutils() {
 		--disable-multilib \
 		--disable-werror \
 		--disable-gold \
+		--disable-gprofng \
 		--enable-relro \
 		--enable-plugins \
 		--enable-64-bit-bfd \
@@ -132,6 +133,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -460,6 +462,14 @@ do_build() {
 	local binutils_ver linux_ver gcc_ver libc_ver libucontext_ver
 	local tgt=${sourcepkg/cross-}
 
+	export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}"
+	export CXXFLAGS="${CXXFLAGS/-D_FORTIFY_SOURCE=2/}"
+
+	# Disable explicit -fno-PIE, gcc/binutils/libc will figure this out itself.
+	export CFLAGS="${CFLAGS//-fno-PIE/}"
+	export CXXFLAGS="${CXXFLAGS//-fno-PIE/}"
+	export LDFLAGS="${LDFLAGS//-no-pie/}"
+
 	_void_cross_test_ver binutils
 	_void_cross_test_ver linux
 	_void_cross_test_ver gcc

From 548160cfa264b298e25ebde0a1d7e1610080e441 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:08:52 -0700
Subject: [PATCH 12/52] openssh: suppress werror on gcc12

---
 srcpkgs/openssh/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/openssh/template b/srcpkgs/openssh/template
index 02a2dec35f42..6e8e343a9dca 100644
--- a/srcpkgs/openssh/template
+++ b/srcpkgs/openssh/template
@@ -40,7 +40,7 @@ if [ "$build_option_ldns" -a -z "$build_option_ssl" ]; then
 	broken="option 'ldns' requires option 'ssl'"
 fi
 
-CFLAGS="-Wno-format-truncation -Wno-stringop-truncation"
+CFLAGS="-Wno-format-truncation -Wno-stringop-truncation -Wno-error=maybe-uninitialized"
 
 case $XBPS_TARGET_MACHINE in
 	i686-musl)

From 47aa943eaf22fcc07ec3123efedf384498d377ca Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:09:31 -0700
Subject: [PATCH 13/52] linux5.18: update dotconfigs for gcc12

---
 srcpkgs/linux5.18/files/x86_64-dotconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/linux5.18/files/x86_64-dotconfig b/srcpkgs/linux5.18/files/x86_64-dotconfig
index 4e73a3195d40..ea6204868e23 100644
--- a/srcpkgs/linux5.18/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.18/files/x86_64-dotconfig
@@ -512,6 +512,7 @@ CONFIG_RETHUNK=y
 CONFIG_CPU_UNRET_ENTRY=y
 CONFIG_CPU_IBPB_ENTRY=y
 CONFIG_CPU_IBRS_ENTRY=y
+CONFIG_SLS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10060,8 +10061,11 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
 # Memory initialization
 #
 CONFIG_INIT_STACK_NONE=y
+# CONFIG_INIT_STACK_ALL_PATTERN is not set
+# CONFIG_INIT_STACK_ALL_ZERO is not set
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
+# CONFIG_ZERO_CALL_USED_REGS is not set
 # end of Memory initialization
 # end of Kernel hardening options
 # end of Security options
@@ -10538,6 +10542,7 @@ CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
 # CONFIG_UBSAN is not set
 CONFIG_HAVE_ARCH_KCSAN=y
+# CONFIG_KCSAN is not set
 # end of Generic Kernel Debugging Instruments
 
 #

From b1cffe291efb02585dc54fac2cecb02c658658f0 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 18:00:42 -0700
Subject: [PATCH 14/52] xf86-video-vmware: fix build on gcc12

---
 ...183b3395333d5d4c73e25c2d011748f15eda.patch | 30 +++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch

diff --git a/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch b/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch
new file mode 100644
index 000000000000..ff839f16e628
--- /dev/null
+++ b/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch
@@ -0,0 +1,30 @@
+From 77b8183b3395333d5d4c73e25c2d011748f15eda Mon Sep 17 00:00:00 2001
+From: Rudi Heitbaum <rudi@heitbaum.com>
+Date: Sun, 8 May 2022 03:00:10 +0000
+Subject: [PATCH] vmwgfx: fix missing array notation
+
+ Fixes error identified by gcc-12.1.0 compiler
+
+make
+  CC       libvmwgfx_la-vmwgfx_tex_video.lo
+vmwgfx_tex_video.c: In function 'stop_video':
+vmwgfx_tex_video.c:240:20: error: the comparison will always evaluate as 'true' for the address of 'yuv' will never be NULL [-Werror=address]
+  240 |                if (priv->yuv[i]) {
+      |                    ^~~~
+---
+ vmwgfx/vmwgfx_tex_video.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/vmwgfx/vmwgfx_tex_video.c b/vmwgfx/vmwgfx_tex_video.c
+index acc2b56..480a5f1 100644
+--- a/vmwgfx/vmwgfx_tex_video.c
++++ b/vmwgfx/vmwgfx_tex_video.c
+@@ -237,7 +237,7 @@ stop_video(ScrnInfoPtr pScrn, pointer data, Bool shutdown)
+ 
+        for (i=0; i<3; ++i) {
+ 	   for (j=0; j<2; ++j) {
+-	       if (priv->yuv[i]) {
++	       if (priv->yuv[j][i]) {
+ 		   xa_surface_destroy(priv->yuv[j][i]);
+ 		   priv->yuv[j][i] = NULL;
+ 	       }

From b2f81fb6a8bc97c4a4f9ea89ff8724a4366e4b91 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 18:24:37 -0700
Subject: [PATCH 15/52] doxygen: fix build for gcc 12

---
 srcpkgs/doxygen/patches/compat-gcc12.patch | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100644 srcpkgs/doxygen/patches/compat-gcc12.patch

diff --git a/srcpkgs/doxygen/patches/compat-gcc12.patch b/srcpkgs/doxygen/patches/compat-gcc12.patch
new file mode 100644
index 000000000000..666744a1dceb
--- /dev/null
+++ b/srcpkgs/doxygen/patches/compat-gcc12.patch
@@ -0,0 +1,22 @@
+From 5198966c8d5fec89116d025c74934ac03ea511fa Mon Sep 17 00:00:00 2001
+From: Dimitri van Heesch <doxygen@gmail.com>
+Date: Fri, 6 May 2022 09:55:16 +0200
+Subject: [PATCH] issue #9312: Build: cache.h:53:14: error: 'exchange' is not a
+ member of 'std'
+
+---
+ src/cache.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/cache.h b/src/cache.h
+index 0ff3092ed5..e218eb27d2 100644
+--- a/src/cache.h
++++ b/src/cache.h
+@@ -19,6 +19,7 @@
+ #include <list>
+ #include <unordered_map>
+ #include <mutex>
++#include <utility>
+ #include <ctype.h>
+ 
+ /*! Fixed size cache for value type V using keys of type K.

From 697eddba191e0d9cb580ea6034e817300126a180 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 21 Aug 2022 15:12:00 -0700
Subject: [PATCH 16/52] libproxy: update to 0.4.18

---
 srcpkgs/libproxy/template | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/libproxy/template b/srcpkgs/libproxy/template
index d6103007032e..6599dfb69b98 100644
--- a/srcpkgs/libproxy/template
+++ b/srcpkgs/libproxy/template
@@ -1,18 +1,22 @@
 # Template file for 'libproxy'
 pkgname=libproxy
-version=0.4.15
+version=0.4.18
 revision=1
 build_style=cmake
 configure_args="-DWITH_GNOME=0 -DWITH_KDE4=0 -DWITH_MOZJS=0 -DWITH_NM=0
  -DWITH_PERL=0 -DWITH_PYTHON=1 -DWITH_WEBKIT=0"
 hostmakedepends="pkg-config python"
 makedepends="zlib-devel"
-short_desc="A library handling all the details of proxy configuration"
+short_desc="Library handling all the details of proxy configuration"
 maintainer="Orphaned <orphan@voidlinux.org>"
+license="LGPL-2.1-or-later"
 homepage="http://github.com/libproxy/libproxy"
-license="LGPL-2.1"
-distfiles="https://github.com/libproxy/libproxy/archive/${version}.tar.gz>${pkgname}-${version}.tar.gz"
-checksum=18f58b0a0043b6881774187427ead158d310127fc46a1c668ad6d207fb28b4e0
+distfiles="https://github.com/libproxy/libproxy/archive/${version}.tar.gz"
+checksum=0b4a9218d88f6cf9fa25996a3f38329a11f688a9d026141d9d0e966d8fa63837
+
+post_patch() {
+	vsed '/add_test(NAME url-test/d' -i libproxy/test/CMakeLists.txt
+}
 
 libproxy-devel_package() {
 	depends="libproxy>=${version}_${revision}"

From 0971bc4fa614f9a9f75c91f73f782b76e338232d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 21 Aug 2022 17:05:39 -0700
Subject: [PATCH 17/52] exempi: update to 2.6.2

---
 ...f034705fd2d032c81383eee8208fd4eee0ac.patch | 43 -------------------
 srcpkgs/exempi/template                       |  4 +-
 2 files changed, 2 insertions(+), 45 deletions(-)
 delete mode 100644 srcpkgs/exempi/patches/8ed2f034705fd2d032c81383eee8208fd4eee0ac.patch

diff --git a/srcpkgs/exempi/patches/8ed2f034705fd2d032c81383eee8208fd4eee0ac.patch b/srcpkgs/exempi/patches/8ed2f034705fd2d032c81383eee8208fd4eee0ac.patch
deleted file mode 100644
index 2696793cec09..000000000000
--- a/srcpkgs/exempi/patches/8ed2f034705fd2d032c81383eee8208fd4eee0ac.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From 8ed2f034705fd2d032c81383eee8208fd4eee0ac Mon Sep 17 00:00:00 2001
-From: Victor Rodriguez <victor.rodriguez.bahena@intel.com>
-Date: Sat, 18 Aug 2018 13:54:55 +0000
-Subject: [PATCH] Issue #9 - Fix null-pointer-dereference (CVE-2018-12648)
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-The WEBP::GetLE32 function in
-XMPFiles/source/FormatSupport/WEBP_Support.hpp in Exempi 2.4.5 has a
-NULL pointer dereference.
-
-https://bugs.freedesktop.org/show_bug.cgi?id=106981
-https://gitlab.freedesktop.org/libopenraw/exempi/issues/9
-
-Signed-off-by: Victor Rodriguez <victor.rodriguez.bahena@intel.com>
-Signed-off-by: Hubert Figuière <hub@figuiere.net>
----
- XMPFiles/source/FormatSupport/WEBP_Support.cpp | 8 +++++---
- 1 file changed, 5 insertions(+), 3 deletions(-)
-
-diff --git a/XMPFiles/source/FormatSupport/WEBP_Support.cpp b/XMPFiles/source/FormatSupport/WEBP_Support.cpp
-index ffaf220..4fe705b 100644
---- a/XMPFiles/source/FormatSupport/WEBP_Support.cpp
-+++ b/XMPFiles/source/FormatSupport/WEBP_Support.cpp
-@@ -160,9 +160,11 @@ bool VP8XChunk::xmp()
- }
- void VP8XChunk::xmp(bool hasXMP)
- {
--    XMP_Uns32 flags = GetLE32(&this->data[0]);
--    flags ^= (-hasXMP ^ flags) & (1 << XMP_FLAG_BIT);
--    PutLE32(&this->data[0], flags);
-+    if (&this->data[0] != NULL) {
-+        XMP_Uns32 flags = GetLE32(&this->data[0]);
-+        flags ^= (-hasXMP ^ flags) & (1 << XMP_FLAG_BIT);
-+        PutLE32(&this->data[0], flags);
-+    }
- }
- 
- Container::Container(WEBP_MetaHandler* handler) : Chunk(NULL, handler)
--- 
-2.18.0
-
diff --git a/srcpkgs/exempi/template b/srcpkgs/exempi/template
index 14753617953a..d664f7dc4d80 100644
--- a/srcpkgs/exempi/template
+++ b/srcpkgs/exempi/template
@@ -1,6 +1,6 @@
 # Template file for 'exempi'
 pkgname=exempi
-version=2.5.0
+version=2.6.2
 revision=1
 build_style=gnu-configure
 configure_args="--with-boost=${XBPS_CROSS_BASE}/usr --disable-static --disable-unittest"
@@ -10,7 +10,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="BSD-3-Clause"
 homepage="https://libopenraw.freedesktop.org/wiki/Exempi"
 distfiles="https://libopenraw.freedesktop.org/download/exempi-${version}.tar.bz2"
-checksum=dc82fc24c0540a44a63fa4ad21775d24e00e63f1dedd3e2ae6f7aa27583b711b
+checksum=4d17d4c93df2a95da3e3172c45b7a5bf317dd31dafd1c7a340169728c7089d1d
 
 post_install() {
 	vlicense COPYING

From ed6cca8ca063c77e807873eb866227c008f7076b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 21 Aug 2022 21:36:03 -0700
Subject: [PATCH 18/52] plymouth: update to 22.02.122

---
 srcpkgs/plymouth/patches/fix-glibc-2.36.patch | 30 +++++++++++++++++++
 srcpkgs/plymouth/template                     |  4 +--
 2 files changed, 32 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/plymouth/patches/fix-glibc-2.36.patch

diff --git a/srcpkgs/plymouth/patches/fix-glibc-2.36.patch b/srcpkgs/plymouth/patches/fix-glibc-2.36.patch
new file mode 100644
index 000000000000..2f1e43875cfb
--- /dev/null
+++ b/srcpkgs/plymouth/patches/fix-glibc-2.36.patch
@@ -0,0 +1,30 @@
+From 5f1e43c00039a7fe1fff768b91a05a695fb4a53d Mon Sep 17 00:00:00 2001
+From: Ray Strode <rstrode@redhat.com>
+Date: Wed, 3 Aug 2022 15:23:33 -0400
+Subject: [PATCH] ply-utils: Drop linux/fs.h include
+
+It was needed long ago for a function we no longer even have.
+
+Now it's causing compile errors on Fedora 37 because it's conflicting
+with sys/mount.h.
+
+This commit drops it.
+---
+ src/libply/ply-utils.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/src/libply/ply-utils.c b/src/libply/ply-utils.c
+index c7b165e9..219e2e77 100644
+--- a/src/libply/ply-utils.c
++++ b/src/libply/ply-utils.c
+@@ -46,7 +46,6 @@
+ #include <sys/user.h>
+ #include <sys/wait.h>
+ #include <time.h>
+-#include <linux/fs.h>
+ #include <linux/vt.h>
+ 
+ #include <dlfcn.h>
+-- 
+GitLab
+
diff --git a/srcpkgs/plymouth/template b/srcpkgs/plymouth/template
index 17f801fc5315..442ab58a99cd 100644
--- a/srcpkgs/plymouth/template
+++ b/srcpkgs/plymouth/template
@@ -1,6 +1,6 @@
 # Template file for 'plymouth'
 pkgname=plymouth
-version=0.9.5
+version=22.02.122
 revision=1
 build_style=gnu-configure
 configure_args="--with-system-root-install=no \
@@ -18,7 +18,7 @@ maintainer="William OD <obirik2005@gmail.com>"
 license="GPL-2.0-or-later"
 homepage="https://www.freedesktop.org/wiki/Software/Plymouth/"
 distfiles="${FREEDESKTOP_SITE}/plymouth/releases/$pkgname-$version.tar.xz"
-checksum=ecae257f351d098340542a5bc06de029404c24dcee87e6ebb2abd5ef117fce86
+checksum=100551442221033ce868c447ad6c74d831d209c18ae232b98ae0207e34eadaeb
 
 build_options="gtk3 pango"
 build_options_default="gtk3 pango"

From f431721a32dcc60e618e74d4cc00cb686431ec33 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 21 Aug 2022 21:37:00 -0700
Subject: [PATCH 19/52] openjdk7-bootstrap: fix build for gcc12

---
 .../files/dist_patches_glibc.txt              |  1 +
 .../files/dist_patches_musl.txt               |  1 +
 .../icedtea-pointer-comparison-gcc12.patch    | 31 +++++++++++++++++++
 3 files changed, 33 insertions(+)
 create mode 100644 srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch

diff --git a/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt b/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt
index c76c56855441..8061756dfc0c 100644
--- a/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt
+++ b/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt
@@ -6,3 +6,4 @@ icedtea-jdk-no-soname.patch
 icedtea-jdk-xattr.patch
 icedtea-jdk-sysctl_h.patch
 icedtea-cpio.patch
+icedtea-pointer-comparison-gcc12.patch
diff --git a/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt b/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt
index 21812517c7c2..8b35d9c46989 100644
--- a/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt
+++ b/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt
@@ -11,3 +11,4 @@ icedtea-jdk-musl.patch
 icedtea-jdk-no-soname.patch
 icedtea-jdk-xattr.patch
 icedtea-cpio.patch
+icedtea-pointer-comparison-gcc12.patch
diff --git a/srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch b/srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch
new file mode 100644
index 000000000000..c809553443e7
--- /dev/null
+++ b/srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch
@@ -0,0 +1,31 @@
+--- openjdk.orig/hotspot/src/share/vm/opto/lcm.cpp
++++ openjdk/hotspot/src/share/vm/opto/lcm.cpp
+@@ -60,7 +60,7 @@
+ // Check whether val is not-null-decoded compressed oop,
+ // i.e. will grab into the base of the heap if it represents NULL.
+ static bool accesses_heap_base_zone(Node *val) {
+-  if (Universe::narrow_oop_base() > 0) { // Implies UseCompressedOops.
++  if (Universe::narrow_oop_base() > (address)0) { // Implies UseCompressedOops.
+     if (val && val->is_Mach()) {
+       if (val->as_Mach()->ideal_Opcode() == Op_DecodeN) {
+         // This assumes all Decodes with TypePtr::NotNull are matched to nodes that
+--- openjdk.orig/hotspot/src/share/vm/runtime/virtualspace.cpp
++++ openjdk/hotspot/src/share/vm/runtime/virtualspace.cpp
+@@ -527,7 +527,7 @@ ReservedHeapSpace::ReservedHeapSpace(siz
+                 (UseCompressedOops && (Universe::narrow_oop_base() != NULL) &&
+                  Universe::narrow_oop_use_implicit_null_checks()) ?
+                   lcm(os::vm_page_size(), alignment) : 0) {
+-  if (base() > 0) {
++  if (base() > (char*)0) {
+     MemTracker::record_virtual_memory_type((address)base(), mtJavaHeap);
+   }
+ 
+@@ -546,7 +546,7 @@ ReservedHeapSpace::ReservedHeapSpace(con
+                 (UseCompressedOops && (Universe::narrow_oop_base() != NULL) &&
+                  Universe::narrow_oop_use_implicit_null_checks()) ?
+                   lcm(os::vm_page_size(), prefix_align) : 0) {
+-  if (base() > 0) {
++  if (base() > (char*)0) {
+     MemTracker::record_virtual_memory_type((address)base(), mtJavaHeap);
+   }
+ 

From fc7e83b42ccc31daf28b11733aff7b9ce93e2948 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 23:30:16 -0700
Subject: [PATCH 20/52] libunique1: relax warnings for gcc12

---
 srcpkgs/libunique1/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/libunique1/template b/srcpkgs/libunique1/template
index f73931b0c72b..c5a0f5c27860 100644
--- a/srcpkgs/libunique1/template
+++ b/srcpkgs/libunique1/template
@@ -15,7 +15,7 @@ homepage="https://wiki.gnome.org/Attic/LibUnique"
 distfiles="${GNOME_SITE}/libunique/1.1/libunique-${version}.tar.bz2"
 checksum=e5c8041cef8e33c55732f06a292381cb345db946cf792a4ae18aa5c66cdd4fbb
 
-CFLAGS="-Wno-deprecated-declarations"
+CFLAGS="-Wno-deprecated-declarations -Wno-incompatible-pointer-types"
 
 # Package build options
 build_options="gir"

From 7e3eaf854236a9057d93a3be4b43386ba607ab31 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:39:52 -0700
Subject: [PATCH 21/52] libvirt: fix build for glibc 2.36

---
 .../patches/lxc-fix-compat-glibc-2.36.patch   | 34 ++++++++++++++++
 .../virfile-fix-compat-glibc-2.36.patch       | 39 +++++++++++++++++++
 2 files changed, 73 insertions(+)
 create mode 100644 srcpkgs/libvirt/patches/lxc-fix-compat-glibc-2.36.patch
 create mode 100644 srcpkgs/libvirt/patches/virfile-fix-compat-glibc-2.36.patch

diff --git a/srcpkgs/libvirt/patches/lxc-fix-compat-glibc-2.36.patch b/srcpkgs/libvirt/patches/lxc-fix-compat-glibc-2.36.patch
new file mode 100644
index 000000000000..d85b57815010
--- /dev/null
+++ b/srcpkgs/libvirt/patches/lxc-fix-compat-glibc-2.36.patch
@@ -0,0 +1,34 @@
+From 9493c9b79dc541ec9e0fd73c6d87bdf8d30aaa90 Mon Sep 17 00:00:00 2001
+From: Cole Robinson <crobinso@redhat.com>
+Date: Mon, 1 Aug 2022 15:20:38 -0400
+Subject: [PATCH] lxc: containter: fix build with glibc 2.36
+
+With glibc 2.36, sys/mount.h and linux/mount.h conflict:
+https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
+
+lxc_container.c imports sys/mount.h and linux/fs.h, which pulls in
+linux/mount.h.
+
+linux/fs.h isn't required here though. glibc sys/mount.h has had
+MS_MOVE since 2.12 in 2010
+
+Reviewed-by: Erik Skultety <eskultet@redhat.com>
+Signed-off-by: Cole Robinson <crobinso@redhat.com>
+---
+ src/lxc/lxc_container.c | 3 ---
+ 1 file changed, 3 deletions(-)
+
+diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
+index b5278831da7..a5401c2186e 100644
+--- a/src/lxc/lxc_container.c
++++ b/src/lxc/lxc_container.c
+@@ -33,9 +33,6 @@
+ /* Yes, we want linux private one, for _syscall2() macro */
+ #include <linux/unistd.h>
+ 
+-/* For MS_MOVE */
+-#include <linux/fs.h>
+-
+ #if WITH_CAPNG
+ # include <cap-ng.h>
+ #endif
diff --git a/srcpkgs/libvirt/patches/virfile-fix-compat-glibc-2.36.patch b/srcpkgs/libvirt/patches/virfile-fix-compat-glibc-2.36.patch
new file mode 100644
index 000000000000..2ef227ea9b54
--- /dev/null
+++ b/srcpkgs/libvirt/patches/virfile-fix-compat-glibc-2.36.patch
@@ -0,0 +1,39 @@
+From c0d9adf220dc0d223330a7bac37b174132d330ba Mon Sep 17 00:00:00 2001
+From: Cole Robinson <crobinso@redhat.com>
+Date: Mon, 1 Aug 2022 15:24:01 -0400
+Subject: [PATCH] virfile: Fix build with glibc 2.36
+
+With glibc 2.36, sys/mount.h and linux/mount.h conflict:
+https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
+
+virfile.c imports sys/mount.h and linux/fs.h, which pulls in
+linux/mount.h.
+
+Manually define the constants we need from linux/fs.h, like was
+done in llvm:
+
+https://reviews.llvm.org/rGb379129c4beb3f26223288627a1291739f33af02
+
+Reviewed-by: Erik Skultety <eskultet@redhat.com>
+Signed-off-by: Cole Robinson <crobinso@redhat.com>
+---
+ src/util/virfile.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/src/util/virfile.c b/src/util/virfile.c
+index 99da058db3b..ce541b8946b 100644
+--- a/src/util/virfile.c
++++ b/src/util/virfile.c
+@@ -71,7 +71,11 @@
+ # endif
+ # include <sys/ioctl.h>
+ # include <linux/cdrom.h>
+-# include <linux/fs.h>
++/* These come from linux/fs.h, but that header conflicts with
++ * sys/mount.h on glibc 2.36+ */
++# define FS_IOC_GETFLAGS _IOR('f', 1, long)
++# define FS_IOC_SETFLAGS _IOW('f', 2, long)
++# define FS_NOCOW_FL 0x00800000
+ #endif
+ 
+ #if WITH_LIBATTR

From c145b15f0fd977da91d923e2d7199d6f993b4203 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:41:50 -0700
Subject: [PATCH 22/52] efivar: fix build for glibc 2.36

---
 .../patches/fix-compat-glibc-2.36.patch       | 55 +++++++++++++++++++
 1 file changed, 55 insertions(+)
 create mode 100644 srcpkgs/efivar/patches/fix-compat-glibc-2.36.patch

diff --git a/srcpkgs/efivar/patches/fix-compat-glibc-2.36.patch b/srcpkgs/efivar/patches/fix-compat-glibc-2.36.patch
new file mode 100644
index 000000000000..fcc83aef20cf
--- /dev/null
+++ b/srcpkgs/efivar/patches/fix-compat-glibc-2.36.patch
@@ -0,0 +1,55 @@
+From bc65d63ebf8fe6ac8a099ff15ca200986dba1565 Mon Sep 17 00:00:00 2001
+From: Robbie Harwood <rharwood@redhat.com>
+Date: Thu, 28 Jul 2022 16:11:24 -0400
+Subject: [PATCH] Fix glibc 2.36 build (mount.h conflicts)
+
+glibc has decided that sys/mount.h and linux/mount.h are no longer
+usable at the same time.  This broke the build, since linux/fs.h itself
+includes linux/mount.h.  For now, fix the build by only including
+sys/mount.h where we need it.
+
+See-also: https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
+Resolves: #227
+Signed-off-by: Robbie Harwood <rharwood@redhat.com>
+---
+ src/gpt.c   | 1 +
+ src/linux.c | 1 +
+ src/util.h  | 1 -
+ 3 files changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/gpt.c b/src/gpt.c
+index 1eda0497..21413c3b 100644
+--- a/src/gpt.c
++++ b/src/gpt.c
+@@ -17,6 +17,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <sys/mount.h>
+ #include <sys/param.h>
+ #include <sys/stat.h>
+ #include <sys/utsname.h>
+diff --git a/src/linux.c b/src/linux.c
+index 47e45ae4..1780816f 100644
+--- a/src/linux.c
++++ b/src/linux.c
+@@ -20,6 +20,7 @@
+ #include <stdbool.h>
+ #include <stdio.h>
+ #include <sys/ioctl.h>
++#include <sys/mount.h>
+ #include <sys/socket.h>
+ #include <sys/sysmacros.h>
+ #include <sys/types.h>
+diff --git a/src/util.h b/src/util.h
+index 3300666f..1e67e447 100644
+--- a/src/util.h
++++ b/src/util.h
+@@ -23,7 +23,6 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <sys/ioctl.h>
+-#include <sys/mount.h>
+ #include <sys/stat.h>
+ #include <sys/types.h>
+ #include <tgmath.h>

From 04f7a0e56fa18c4dc783c86466169affb8c56e3c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:43:24 -0700
Subject: [PATCH 23/52] libwpd: fix build for gcc12

---
 srcpkgs/libwpd/patches/fix-compat-gcc12.patch | 11 +++++++++++
 1 file changed, 11 insertions(+)
 create mode 100644 srcpkgs/libwpd/patches/fix-compat-gcc12.patch

diff --git a/srcpkgs/libwpd/patches/fix-compat-gcc12.patch b/srcpkgs/libwpd/patches/fix-compat-gcc12.patch
new file mode 100644
index 000000000000..6ebce2463d16
--- /dev/null
+++ b/srcpkgs/libwpd/patches/fix-compat-gcc12.patch
@@ -0,0 +1,11 @@
+diff -rup libwpd-0.10.3.orig/src/lib/WPXTable.h libwpd-0.10.3/src/lib/WPXTable.h
+--- libwpd-0.10.3.orig/src/lib/WPXTable.h	2022-08-23 22:32:45.332593795 -0700
++++ libwpd-0.10.3/src/lib/WPXTable.h	2022-08-23 22:32:59.500651211 -0700
+@@ -37,6 +37,7 @@
+ #define _WPXTABLE_H
+ 
+ #include <vector>
++#include <cstddef>
+ 
+ struct WPXTableCell
+ {

From f00d1e079c60db5865c80321ad3280481ece2dd9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:44:07 -0700
Subject: [PATCH 24/52] grub: fix build for binutils 2.36

---
 .../patches/fix-compat-binutils-2.36.patch    | 96 +++++++++++++++++++
 srcpkgs/grub/template                         |  7 +-
 2 files changed, 102 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/grub/patches/fix-compat-binutils-2.36.patch

diff --git a/srcpkgs/grub/patches/fix-compat-binutils-2.36.patch b/srcpkgs/grub/patches/fix-compat-binutils-2.36.patch
new file mode 100644
index 000000000000..d92a91e3253e
--- /dev/null
+++ b/srcpkgs/grub/patches/fix-compat-binutils-2.36.patch
@@ -0,0 +1,96 @@
+From b98275138bf4fc250a1c362dfd2c8b1cf2421701 Mon Sep 17 00:00:00 2001
+From: Michael Chang <mchang@suse.com>
+Date: Tue, 28 Sep 2021 13:50:47 +0800
+Subject: build: Fix build error with binutils 2.36
+
+The following procedure to build xen/pvgrub is broken.
+
+  git clone https://git.savannah.gnu.org/git/grub.git
+  cd grub
+  ./bootstrap
+  mkdir build-xen
+  cd build-xen
+  ../configure --with-platform=xen
+  make
+
+It fails with the message:
+
+  /usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld:
+  section .note.gnu.property VMA [0000000000400158,0000000000400187]
+  overlaps section .bss VMA [000000000000f000,000000000041e1af]
+
+The most significant factor is that new assembler (GNU as) generates the
+.note.gnu.property section as default. This note section overlaps with
+.bss because it doesn't reposition with -Wl,-Ttext,0 with which the base
+address of .text section is set, rather the address of .note.gnu.property
+is calculated for some reason from 0x400000 where the ELF executable
+defaults to start.
+
+Using -Ttext-segment doesn't help either, though it is said to set the
+address of the first byte of the text segment according to "man ld".
+What it actually does is to override the default 0x400000, aka the image
+base address, to something else. The entire process can be observed in
+the default linker script used by gcc [1]. Therefore we can't expect it
+to achieve the same thing as -Ttext given that the first segment where
+.text resides is offset by SIZEOF_HEADERS plus some sections may be
+preceding it within the first segment. The end result is .text always
+has to start with non-zero address with -Wl,-Ttext-segment,0 if using
+default linker script.
+
+It is also worth mentioning that binutils upstream apparently doesn't
+seem to consider this as a bug [2] and proposed to use -Wl,-Ttext-segment,0
+which is not fruitful as what has been tested by Gentoo [3].
+
+As long as GRUB didn't use ISA information encoded in .note.gnu.property,
+we can safely drop it via -Wa,-mx86-used-note=no assembler option to
+fix the linker error above.
+
+This is considered a better approach than using custom linker script to
+drop the .note.gnu.property section because object file manipulation can
+also be hampered one way or the other in that linker script may not be
+helpful. See also this commit removing the section in the process of objcopy.
+
+  6643507ce build: Fix GRUB i386-pc build with Ubuntu gcc
+
+[1] In /usr/lib64/ldscripts/elf_x86_64.x or use 'gcc -Wl,--verbose ...'
+    PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x400000));
+    . = SEGMENT_START("text-segment", 0x400000) + SIZEOF_HEADERS;
+[2] https://sourceware.org/bugzilla/show_bug.cgi?id=27377
+[3] https://bugs.gentoo.org/787221
+
+Signed-off-by: Michael Chang <mchang@suse.com>
+Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
+---
+ configure.ac | 14 ++++++++++++++
+ 1 file changed, 14 insertions(+)
+
+(limited to 'configure.ac')
+
+diff --git a/configure.ac b/configure.ac
+index eeb5d22..8d1c81a 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -840,6 +840,20 @@ if ( test "x$target_cpu" = xi386 || test "x$target_cpu" = xx86_64 ) && test "x$p
+   TARGET_CFLAGS="$TARGET_CFLAGS -mno-mmx -mno-sse -mno-sse2 -mno-sse3 -mno-3dnow"
+ fi
+ 
++if ( test "x$target_cpu" = xi386 || test "x$target_cpu" = xx86_64 ); then
++  AC_CACHE_CHECK([whether -Wa,-mx86-used-note works], [grub_cv_cc_mx86_used_note], [
++    CFLAGS="$TARGET_CFLAGS -Wa,-mx86-used-note=no -Werror"
++    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
++	[grub_cv_cc_mx86_used_note=yes],
++	[grub_cv_cc_mx86_used_note=no])
++  ])
++
++  if test "x$grub_cv_cc_mx86_used_note" = xyes; then
++    TARGET_CFLAGS="$TARGET_CFLAGS -Wa,-mx86-used-note=no"
++    TARGET_CCASFLAGS="$TARGET_CCASFLAGS -Wa,-mx86-used-note=no"
++  fi
++fi
++
+ # GRUB doesn't use float or doubles at all. Yet some toolchains may decide
+ # that floats are a good fit to run instead of what's written in the code.
+ # Given that floating point unit is disabled (if present to begin with)
+-- 
+cgit v1.1
+
diff --git a/srcpkgs/grub/template b/srcpkgs/grub/template
index b1826c38a884..b4d3b07af620 100644
--- a/srcpkgs/grub/template
+++ b/srcpkgs/grub/template
@@ -2,7 +2,8 @@
 pkgname=grub
 version=2.06
 revision=2
-hostmakedepends="python3 pkg-config flex freetype-devel font-unifont-bdf help2man"
+hostmakedepends="python3 pkg-config flex freetype-devel font-unifont-bdf help2man
+ automake gettext-devel-tools"
 makedepends="libusb-compat-devel ncurses-devel freetype-devel
  liblzma-devel device-mapper-devel fuse-devel"
 depends="os-prober"
@@ -43,6 +44,10 @@ case "$XBPS_TARGET_MACHINE" in
 		;;
 esac
 
+pre_configure() {
+	autoreconf -fi
+}
+
 do_configure() {
 	# workaround for https://savannah.gnu.org/bugs/?60458
 	# some more info: https://www.linuxquestions.org/questions/showthread.php?p=6257712

From 29c50cca35746ac57a8d8901259ff36f80953d50 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:45:07 -0700
Subject: [PATCH 25/52] linux-toos: fix build for binutils 2.39

---
 .../patches/binutils-add-compat-check.patch   | 103 ++++++++++++
 .../patches/binutils-disasm-compat.patch      | 102 ++++++++++++
 .../bpf_jit_disasm-binutils-2.39.patch        | 104 ++++++++++++
 .../patches/bpftool-binutils-2.39.patch       | 149 ++++++++++++++++++
 .../patches/perf-binutils-2.39.patch          | 114 ++++++++++++++
 5 files changed, 572 insertions(+)
 create mode 100644 srcpkgs/linux-tools/patches/binutils-add-compat-check.patch
 create mode 100644 srcpkgs/linux-tools/patches/binutils-disasm-compat.patch
 create mode 100644 srcpkgs/linux-tools/patches/bpf_jit_disasm-binutils-2.39.patch
 create mode 100644 srcpkgs/linux-tools/patches/bpftool-binutils-2.39.patch
 create mode 100644 srcpkgs/linux-tools/patches/perf-binutils-2.39.patch

diff --git a/srcpkgs/linux-tools/patches/binutils-add-compat-check.patch b/srcpkgs/linux-tools/patches/binutils-add-compat-check.patch
new file mode 100644
index 000000000000..e4e7ece9635e
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/binutils-add-compat-check.patch
@@ -0,0 +1,103 @@
+From cfd59ca91467056bb2c36907b2fa67b8e1af9952 Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:27 -0700
+Subject: [PATCH] tools build: Add feature test for init_disassemble_info API
+ changes
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation failures for tools/{perf,bpf}, e.g. on debian unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+This commit adds a feature test to detect the new signature.  Subsequent
+commits will use it to fix the build failures.
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Quentin Monnet <quentin@isovalent.com>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-2-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/build/Makefile.feature                        |  1 +
+ tools/build/feature/Makefile                        |  4 ++++
+ tools/build/feature/test-all.c                      |  4 ++++
+ tools/build/feature/test-disassembler-init-styled.c | 13 +++++++++++++
+ 4 files changed, 22 insertions(+)
+ create mode 100644 tools/build/feature/test-disassembler-init-styled.c
+
+diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature
+index 888a0421d43b96..8f6578e4d3249e 100644
+--- a/tools/build/Makefile.feature
++++ b/tools/build/Makefile.feature
+@@ -70,6 +70,7 @@ FEATURE_TESTS_BASIC :=                  \
+         libaio				\
+         libzstd				\
+         disassembler-four-args		\
++        disassembler-init-styled	\
+         file-handle
+ 
+ # FEATURE_TESTS_BASIC + FEATURE_TESTS_EXTRA is the complete list
+diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile
+index 7c2a17e23c30ac..c3059739318a95 100644
+--- a/tools/build/feature/Makefile
++++ b/tools/build/feature/Makefile
+@@ -18,6 +18,7 @@ FILES=                                          \
+          test-libbfd.bin                        \
+          test-libbfd-buildid.bin		\
+          test-disassembler-four-args.bin        \
++         test-disassembler-init-styled.bin	\
+          test-reallocarray.bin			\
+          test-libbfd-liberty.bin                \
+          test-libbfd-liberty-z.bin              \
+@@ -248,6 +249,9 @@ $(OUTPUT)test-libbfd-buildid.bin:
+ $(OUTPUT)test-disassembler-four-args.bin:
+ 	$(BUILD) -DPACKAGE='"perf"' -lbfd -lopcodes
+ 
++$(OUTPUT)test-disassembler-init-styled.bin:
++	$(BUILD) -DPACKAGE='"perf"' -lbfd -lopcodes
++
+ $(OUTPUT)test-reallocarray.bin:
+ 	$(BUILD)
+ 
+diff --git a/tools/build/feature/test-all.c b/tools/build/feature/test-all.c
+index 5ffafb967b6e49..957c02c7b163b5 100644
+--- a/tools/build/feature/test-all.c
++++ b/tools/build/feature/test-all.c
+@@ -166,6 +166,10 @@
+ # include "test-disassembler-four-args.c"
+ #undef main
+ 
++#define main main_test_disassembler_init_styled
++# include "test-disassembler-init-styled.c"
++#undef main
++
+ #define main main_test_libzstd
+ # include "test-libzstd.c"
+ #undef main
+diff --git a/tools/build/feature/test-disassembler-init-styled.c b/tools/build/feature/test-disassembler-init-styled.c
+new file mode 100644
+index 00000000000000..f1ce0ec3bee9d3
+--- /dev/null
++++ b/tools/build/feature/test-disassembler-init-styled.c
+@@ -0,0 +1,13 @@
++// SPDX-License-Identifier: GPL-2.0
++#include <stdio.h>
++#include <dis-asm.h>
++
++int main(void)
++{
++	struct disassemble_info info;
++
++	init_disassemble_info(&info, stdout,
++			      NULL, NULL);
++
++	return 0;
++}
diff --git a/srcpkgs/linux-tools/patches/binutils-disasm-compat.patch b/srcpkgs/linux-tools/patches/binutils-disasm-compat.patch
new file mode 100644
index 000000000000..1a6cc0e6d97c
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/binutils-disasm-compat.patch
@@ -0,0 +1,102 @@
+From a45b3d6926231c3d024ea0de4f7bd967f83709ee Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:29 -0700
+Subject: tools include: add dis-asm-compat.h to handle version differences
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation failures for tools/{perf,bpf}, e.g. on debian unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+This commit introduces a wrapper for init_disassemble_info(), to avoid
+spreading #ifdef DISASM_INIT_STYLED to a bunch of places. Subsequent
+commits will use it to fix the build failures.
+
+It likely is worth adding a wrapper for disassember(), to avoid the already
+existing DISASM_FOUR_ARGS_SIGNATURE ifdefery.
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Signed-off-by: Ben Hutchings <benh@debian.org>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Quentin Monnet <quentin@isovalent.com>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-4-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/include/tools/dis-asm-compat.h | 55 ++++++++++++++++++++++++++++++++++++
+ 1 file changed, 55 insertions(+)
+ create mode 100644 tools/include/tools/dis-asm-compat.h
+
+(limited to 'tools/include/tools/dis-asm-compat.h')
+
+diff --git a/tools/include/tools/dis-asm-compat.h b/tools/include/tools/dis-asm-compat.h
+new file mode 100644
+index 0000000000000..70f331e23ed3d
+--- /dev/null
++++ b/tools/include/tools/dis-asm-compat.h
+@@ -0,0 +1,55 @@
++/* SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause */
++#ifndef _TOOLS_DIS_ASM_COMPAT_H
++#define _TOOLS_DIS_ASM_COMPAT_H
++
++#include <stdio.h>
++#include <dis-asm.h>
++
++/* define types for older binutils version, to centralize ifdef'ery a bit */
++#ifndef DISASM_INIT_STYLED
++enum disassembler_style {DISASSEMBLER_STYLE_NOT_EMPTY};
++typedef int (*fprintf_styled_ftype) (void *, enum disassembler_style, const char*, ...);
++#endif
++
++/*
++ * Trivial fprintf wrapper to be used as the fprintf_styled_func argument to
++ * init_disassemble_info_compat() when normal fprintf suffices.
++ */
++static inline int fprintf_styled(void *out,
++				 enum disassembler_style style,
++				 const char *fmt, ...)
++{
++	va_list args;
++	int r;
++
++	(void)style;
++
++	va_start(args, fmt);
++	r = vfprintf(out, fmt, args);
++	va_end(args);
++
++	return r;
++}
++
++/*
++ * Wrapper for init_disassemble_info() that hides version
++ * differences. Depending on binutils version and architecture either
++ * fprintf_func or fprintf_styled_func will be called.
++ */
++static inline void init_disassemble_info_compat(struct disassemble_info *info,
++						void *stream,
++						fprintf_ftype unstyled_func,
++						fprintf_styled_ftype styled_func)
++{
++#ifdef DISASM_INIT_STYLED
++	init_disassemble_info(info, stream,
++			      unstyled_func,
++			      styled_func);
++#else
++	(void)styled_func;
++	init_disassemble_info(info, stream,
++			      unstyled_func);
++#endif
++}
++
++#endif /* _TOOLS_DIS_ASM_COMPAT_H */
+-- 
+cgit 
+
diff --git a/srcpkgs/linux-tools/patches/bpf_jit_disasm-binutils-2.39.patch b/srcpkgs/linux-tools/patches/bpf_jit_disasm-binutils-2.39.patch
new file mode 100644
index 000000000000..01221fad3a4a
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/bpf_jit_disasm-binutils-2.39.patch
@@ -0,0 +1,104 @@
+From 96ed066054abf11c7d3e106e3011a51f3f1227a3 Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:31 -0700
+Subject: [PATCH] tools bpf_jit_disasm: Fix compilation error with new binutils
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation to fail for tools/bpf/bpf_jit_disasm.c, e.g. on debian
+unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+Wire up the feature test and switch to init_disassemble_info_compat(),
+which were introduced in prior commits, fixing the compilation failure.
+
+I verified that bpf_jit_disasm can still disassemble bpf programs, both
+with the old and new dis-asm.h API. With old binutils there's no change in
+output before/after this patch. When comparing the output from old
+binutils (2.35) to new bintuils with the patch (upstream snapshot) there
+are a few output differences, but they are unrelated to this patch. An
+example hunk is:
+
+     f4:	mov    %r14,%rsi
+     f7:	mov    %r15,%rdx
+     fa:	mov    $0x2a,%ecx
+  -  ff:	callq  0xffffffffea8c4988
+  +  ff:	call   0xffffffffea8c4988
+    104:	test   %rax,%rax
+    107:	jge    0x0000000000000110
+    109:	xor    %eax,%eax
+  - 10b:	jmpq   0x0000000000000073
+  + 10b:	jmp    0x0000000000000073
+    110:	cmp    $0x16,%rax
+
+However, I had to use an older kernel to generate the bpf_jit_enabled =
+2 output, as that has been broken since 5.18 / 1022a5498f6f745c ("bpf,
+x86_64: Use bpf_jit_binary_pack_alloc").
+
+  https://lore.kernel.org/20220703030210.pmjft7qc2eajzi6c@alap3.anarazel.de
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Daniel Borkmann <daniel@iogearbox.net>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Quentin Monnet <quentin@isovalent.com>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-6-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/bpf/Makefile         | 5 ++++-
+ tools/bpf/bpf_jit_disasm.c | 5 ++++-
+ 2 files changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/tools/bpf/Makefile b/tools/bpf/Makefile
+index b11cfc86a3d021..664601ab1705ab 100644
+--- a/tools/bpf/Makefile
++++ b/tools/bpf/Makefile
+@@ -34,7 +34,7 @@ else
+ endif
+ 
+ FEATURE_USER = .bpf
+-FEATURE_TESTS = libbfd disassembler-four-args
++FEATURE_TESTS = libbfd disassembler-four-args disassembler-init-styled
+ FEATURE_DISPLAY = libbfd disassembler-four-args
+ 
+ check_feat := 1
+@@ -56,6 +56,9 @@ endif
+ ifeq ($(feature-disassembler-four-args), 1)
+ CFLAGS += -DDISASM_FOUR_ARGS_SIGNATURE
+ endif
++ifeq ($(feature-disassembler-init-styled), 1)
++CFLAGS += -DDISASM_INIT_STYLED
++endif
+ 
+ $(OUTPUT)%.yacc.c: $(srctree)/tools/bpf/%.y
+ 	$(QUIET_BISON)$(YACC) -o $@ -d $<
+diff --git a/tools/bpf/bpf_jit_disasm.c b/tools/bpf/bpf_jit_disasm.c
+index c8ae9580472814..a90a5d110f9255 100644
+--- a/tools/bpf/bpf_jit_disasm.c
++++ b/tools/bpf/bpf_jit_disasm.c
+@@ -28,6 +28,7 @@
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <limits.h>
++#include <tools/dis-asm-compat.h>
+ 
+ #define CMD_ACTION_SIZE_BUFFER		10
+ #define CMD_ACTION_READ_ALL		3
+@@ -64,7 +65,9 @@ static void get_asm_insns(uint8_t *image, size_t len, int opcodes)
+ 	assert(bfdf);
+ 	assert(bfd_check_format(bfdf, bfd_object));
+ 
+-	init_disassemble_info(&info, stdout, (fprintf_ftype) fprintf);
++	init_disassemble_info_compat(&info, stdout,
++				     (fprintf_ftype) fprintf,
++				     fprintf_styled);
+ 	info.arch = bfd_get_arch(bfdf);
+ 	info.mach = bfd_get_mach(bfdf);
+ 	info.buffer = image;
diff --git a/srcpkgs/linux-tools/patches/bpftool-binutils-2.39.patch b/srcpkgs/linux-tools/patches/bpftool-binutils-2.39.patch
new file mode 100644
index 000000000000..1e55c40011be
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/bpftool-binutils-2.39.patch
@@ -0,0 +1,149 @@
+From 600b7b26c07a070d0153daa76b3806c1e52c9e00 Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:33 -0700
+Subject: [PATCH] tools bpftool: Fix compilation error with new binutils
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation to fail for tools/bpf/bpftool/jit_disasm.c, e.g. on debian
+unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+Wire up the feature test and switch to init_disassemble_info_compat(),
+which were introduced in prior commits, fixing the compilation failure.
+
+I verified that bpftool can still disassemble bpf programs, both with an
+old and new dis-asm.h API. There are no output changes for plain and json
+formats. When comparing the output from old binutils (2.35)
+to new bintuils with the patch (upstream snapshot) there are a few output
+differences, but they are unrelated to this patch. An example hunk is:
+
+     2f:	pop    %r14
+     31:	pop    %r13
+     33:	pop    %rbx
+  -  34:	leaveq
+  -  35:	retq
+  +  34:	leave
+  +  35:	ret
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Quentin Monnet <quentin@isovalent.com>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-8-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/bpf/bpftool/Makefile     |  5 +++-
+ tools/bpf/bpftool/jit_disasm.c | 42 +++++++++++++++++++++++++++-------
+ 2 files changed, 38 insertions(+), 9 deletions(-)
+
+diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile
+index c6d2c77d02524a..436e671b2657d4 100644
+--- a/tools/bpf/bpftool/Makefile
++++ b/tools/bpf/bpftool/Makefile
+@@ -62,7 +62,7 @@ CLANG ?= clang
+ LLVM_STRIP ?= llvm-strip
+ 
+ FEATURE_USER = .bpftool
+-FEATURE_TESTS = libbfd disassembler-four-args reallocarray zlib libcap \
++FEATURE_TESTS = libbfd disassembler-four-args disassembler-init-styled reallocarray zlib libcap \
+ 	clang-bpf-co-re
+ FEATURE_DISPLAY = libbfd disassembler-four-args zlib libcap \
+ 	clang-bpf-co-re
+@@ -117,6 +117,9 @@ endif
+ ifeq ($(feature-disassembler-four-args), 1)
+ CFLAGS += -DDISASM_FOUR_ARGS_SIGNATURE
+ endif
++ifeq ($(feature-disassembler-init-styled), 1)
++    CFLAGS += -DDISASM_INIT_STYLED
++endif
+ 
+ LIBS = $(LIBBPF) -lelf -lz
+ LIBS_BOOTSTRAP = $(LIBBPF_BOOTSTRAP) -lelf -lz
+diff --git a/tools/bpf/bpftool/jit_disasm.c b/tools/bpf/bpftool/jit_disasm.c
+index 24734f2249d6ec..aaf99a0168c90b 100644
+--- a/tools/bpf/bpftool/jit_disasm.c
++++ b/tools/bpf/bpftool/jit_disasm.c
+@@ -24,6 +24,7 @@
+ #include <sys/stat.h>
+ #include <limits.h>
+ #include <bpf/libbpf.h>
++#include <tools/dis-asm-compat.h>
+ 
+ #include "json_writer.h"
+ #include "main.h"
+@@ -39,15 +40,12 @@ static void get_exec_path(char *tpath, s
+ }
+ 
+ static int oper_count;
+-static int fprintf_json(void *out, const char *fmt, ...)
++static int printf_json(void *out, const char *fmt, va_list ap)
+ {
+-	va_list ap;
+ 	char *s;
+ 
+-	va_start(ap, fmt);
+ 	if (vasprintf(&s, fmt, ap) < 0)
+ 		return -1;
+-	va_end(ap);
+ 
+ 	if (!oper_count) {
+ 		int i;
+@@ -73,6 +71,32 @@ static int fprintf_json(void *out, const char *fmt, ...)
+ 	return 0;
+ }
+ 
++static int fprintf_json(void *out, const char *fmt, ...)
++{
++	va_list ap;
++	int r;
++
++	va_start(ap, fmt);
++	r = printf_json(out, fmt, ap);
++	va_end(ap);
++
++	return r;
++}
++
++static int fprintf_json_styled(void *out,
++			       enum disassembler_style style __maybe_unused,
++			       const char *fmt, ...)
++{
++	va_list ap;
++	int r;
++
++	va_start(ap, fmt);
++	r = printf_json(out, fmt, ap);
++	va_end(ap);
++
++	return r;
++}
++
+ void disasm_print_insn(unsigned char *image, ssize_t len, int opcodes,
+ 		       const char *arch, const char *disassembler_options,
+ 		       const struct btf *btf,
+@@ -99,11 +123,13 @@ void disasm_print_insn(unsigned char *image, ssize_t len, int opcodes,
+ 	assert(bfd_check_format(bfdf, bfd_object));
+ 
+ 	if (json_output)
+-		init_disassemble_info(&info, stdout,
+-				      (fprintf_ftype) fprintf_json);
++		init_disassemble_info_compat(&info, stdout,
++					     (fprintf_ftype) fprintf_json,
++					     fprintf_json_styled);
+ 	else
+-		init_disassemble_info(&info, stdout,
+-				      (fprintf_ftype) fprintf);
++		init_disassemble_info_compat(&info, stdout,
++					     (fprintf_ftype) fprintf,
++					     fprintf_styled);
+ 
+ 	/* Update architecture info for offload. */
+ 	if (arch) {
diff --git a/srcpkgs/linux-tools/patches/perf-binutils-2.39.patch b/srcpkgs/linux-tools/patches/perf-binutils-2.39.patch
new file mode 100644
index 000000000000..3484330f7286
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/perf-binutils-2.39.patch
@@ -0,0 +1,114 @@
+From 83aa0120487e8bc3f231e72c460add783f71f17c Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:30 -0700
+Subject: [PATCH] tools perf: Fix compilation error with new binutils
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation failures for tools/perf/util/annotate.c, e.g. on debian
+unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+Wire up the feature test and switch to init_disassemble_info_compat(),
+which were introduced in prior commits, fixing the compilation failure.
+
+I verified that perf can still disassemble bpf programs by using bpftrace
+under load, recording a perf trace, and then annotating the bpf "function"
+with and without the changes. With old binutils there's no change in output
+before/after this patch. When comparing the output from old binutils (2.35)
+to new bintuils with the patch (upstream snapshot) there are a few output
+differences, but they are unrelated to this patch. An example hunk is:
+
+       1.15 :   55:mov    %rbp,%rdx
+       0.00 :   58:add    $0xfffffffffffffff8,%rdx
+       0.00 :   5c:xor    %ecx,%ecx
+  -    1.03 :   5e:callq  0xffffffffe12aca3c
+  +    1.03 :   5e:call   0xffffffffe12aca3c
+       0.00 :   63:xor    %eax,%eax
+  -    2.18 :   65:leaveq
+  -    2.82 :   66:retq
+  +    2.18 :   65:leave
+  +    2.82 :   66:ret
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-5-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/perf/Makefile.config | 8 ++++++++
+ tools/perf/util/annotate.c | 7 ++++---
+ 2 files changed, 12 insertions(+), 3 deletions(-)
+
+diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
+index d3c254c0f5c611..23648ea54e8d3d 100644
+--- a/tools/perf/Makefile.config
++++ b/tools/perf/Makefile.config
+@@ -298,6 +298,7 @@ FEATURE_CHECK_LDFLAGS-libpython := $(PYTHON_EMBED_LDOPTS)
+ FEATURE_CHECK_LDFLAGS-libaio = -lrt
+ 
+ FEATURE_CHECK_LDFLAGS-disassembler-four-args = -lbfd -lopcodes -ldl
++FEATURE_CHECK_LDFLAGS-disassembler-init-styled = -lbfd -lopcodes -ldl
+ 
+ CORE_CFLAGS += -fno-omit-frame-pointer
+ CORE_CFLAGS += -ggdb3
+@@ -818,13 +819,16 @@ else
+   ifeq ($(feature-libbfd-liberty), 1)
+     EXTLIBS += -lbfd -lopcodes -liberty
+     FEATURE_CHECK_LDFLAGS-disassembler-four-args += -liberty -ldl
++    FEATURE_CHECK_LDFLAGS-disassembler-init-styled += -liberty -ldl
+   else
+     ifeq ($(feature-libbfd-liberty-z), 1)
+       EXTLIBS += -lbfd -lopcodes -liberty -lz
+       FEATURE_CHECK_LDFLAGS-disassembler-four-args += -liberty -lz -ldl
++      FEATURE_CHECK_LDFLAGS-disassembler-init-styled += -liberty -lz -ldl
+     endif
+   endif
+   $(call feature_check,disassembler-four-args)
++  $(call feature_check,disassembler-init-styled)
+ endif
+ 
+ ifeq ($(feature-libbfd-buildid), 1)
+@@ -1044,6 +1048,10 @@ ifeq ($(feature-disassembler-four-args), 1)
+     CFLAGS += -DDISASM_FOUR_ARGS_SIGNATURE
+ endif
+ 
++ifeq ($(feature-disassembler-init-styled), 1)
++    CFLAGS += -DDISASM_INIT_STYLED
++endif
++
+ ifeq (${IS_64_BIT}, 1)
+   ifndef NO_PERF_READ_VDSO32
+     $(call feature_check,compile-32)
+diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
+index 82cc396ef516c4..2c6a485c3de5d9 100644
+--- a/tools/perf/util/annotate.c
++++ b/tools/perf/util/annotate.c
+@@ -1676,6 +1676,7 @@ fallback:
+ #define PACKAGE "perf"
+ #include <bfd.h>
+ #include <dis-asm.h>
++#include <tools/dis-asm-compat.h>
+ 
+ static int symbol__disassemble_bpf(struct symbol *sym,
+ 				   struct annotate_args *args)
+@@ -1762,9 +1763,9 @@ static int symbol__disassemble_bpf(struct symbol *sym,
+ 		ret = errno;
+ 		goto out;
+ 	}
+-	init_disassemble_info(&info, s,
+-			      (fprintf_ftype) fprintf);
+-
++	init_disassemble_info_compat(&info, s,
++				     (fprintf_ftype) fprintf,
++				     fprintf_styled);
+ 	info.arch = bfd_get_arch(bfdf);
+ 	info.mach = bfd_get_mach(bfdf);
+ 

From fd7deff44c0d3bb70eb9eac993fea202f54cf688 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 14:45:28 -0700
Subject: [PATCH 26/52] libsasl: fix build for libtool 2.4.7

---
 srcpkgs/libsasl/template | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/libsasl/template b/srcpkgs/libsasl/template
index a8817042f843..a2993b39f4a1 100644
--- a/srcpkgs/libsasl/template
+++ b/srcpkgs/libsasl/template
@@ -19,6 +19,7 @@ distfiles="https://github.com/cyrusimap/cyrus-sasl/releases/download/cyrus-sasl-
 checksum=26866b1549b00ffd020f188a43c258017fa1c382b3ddadd8201536f72efb05d5
 
 pre_configure() {
+	rm -f m4/ltversion.m4
 	autoreconf -fi
 }
 

From 4e9fe2db1fb45bb66fa363d3b48399b57d44fa52 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:08 -0700
Subject: [PATCH 27/52] subversion: fix build for libtool 2.4.7

---
 srcpkgs/subversion/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion/template b/srcpkgs/subversion/template
index 8ad178264942..3f1c9e254e61 100644
--- a/srcpkgs/subversion/template
+++ b/srcpkgs/subversion/template
@@ -57,7 +57,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From 9aaafee24d787451f155d5f7bbf140155c028398 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:38 -0700
Subject: [PATCH 28/52] subversion-kwallet-auth: fix build for libtool 2.4.7

---
 srcpkgs/subversion-kwallet-auth/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion-kwallet-auth/template b/srcpkgs/subversion-kwallet-auth/template
index 12210f250d51..b4d8621456ea 100644
--- a/srcpkgs/subversion-kwallet-auth/template
+++ b/srcpkgs/subversion-kwallet-auth/template
@@ -59,7 +59,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From 1762b4b22a95a0ab6e3ae4eecc9db606919e422f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 20:07:32 -0700
Subject: [PATCH 29/52] gpgme: update to 1.18.0.

---
 common/shlibs          | 2 +-
 srcpkgs/gpgme/template | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 52220e69706d..98017bdd5e3d 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -723,7 +723,7 @@ libdconf.so.1 dconf-0.13.90_1
 libassuan.so.0 libassuan-2.0.1_1
 libgpgme.so.11 libgpgme-1.12.0_2
 libgpgmepp.so.6 gpgmepp-1.7.0_3
-libqgpgme.so.7 gpgmeqt-1.7.0_3
+libqgpgme.so.15 gpgmeqt-1.18.0_1
 libgarcon-1.so.0 garcon-0.1.12_1
 libgarcon-gtk2-1.so.0 garcon-0.4.0_1
 libgarcon-gtk3-1.so.0 garcon-0.6.1_1
diff --git a/srcpkgs/gpgme/template b/srcpkgs/gpgme/template
index 8633075a8404..b1cfd5f78657 100644
--- a/srcpkgs/gpgme/template
+++ b/srcpkgs/gpgme/template
@@ -1,7 +1,7 @@
 # Template file for 'gpgme'
 pkgname=gpgme
-version=1.15.1
-revision=2
+version=1.18.0
+revision=1
 build_style=gnu-configure
 configure_args="--enable-fd-passing
  --with-libgpg-error-prefix=$XBPS_CROSS_BASE/usr
@@ -14,7 +14,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.gnupg.org/software/gpgme/index.html"
 distfiles="https://www.gnupg.org/ftp/gcrypt/gpgme/gpgme-${version}.tar.bz2"
-checksum=eebc3c1b27f1c8979896ff361ba9bb4778b508b2496c2fc10e3775a40b1de1ad
+checksum=361d4eae47ce925dba0ea569af40e7b52c645c4ae2e65e5621bf1b6cdd8b0e9e
 
 if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
 	configure_args+=" ac_cv_sys_file_offset_bits=no"

From 5655bf925ccb8e5e583f75d4ee0c105a90caf8cb Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 30/52] cross-aarch64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..bd6b23f9fb6a 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 354fc6a1e59a56c51932ae1b4fc93c551e71cada Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 31/52] cross-aarch64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..427ad2c1e9cd 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From a59cc25484d7e4d5d9d824c6c576e6fb2605060f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 32/52] cross-arm-linux-gnueabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..2510ee26e789 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 8f58445c0a17f92d49b8df6b5f913a9fa4a0c99b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 33/52] cross-arm-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..bd8b16e1b4c1 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 354230f7616366e1f94196b0d66b4a6505af0939 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 34/52] cross-arm-linux-musleabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..dacfd2655216 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 2a2663f98c3a8f8485ed96c6b83d320f5bea3afd Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 35/52] cross-arm-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..9ddd32a9f20d 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From f5b8c6b767c2f49735ec984999402a919e90a378 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 36/52] cross-armv7l-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..9fb00f18be3b 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 173c3d5a44945fdfa898e236898c09f68d04bf5c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 37/52] cross-armv7l-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..2c72e75ddfe3 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 3701ba75f9a34299a5f3a1311fabb04cd869957b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 38/52] cross-i686-pc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..4dc17df648b5 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 93921d22a5450c9d86804ddfc5e9e6c2d41a0cb1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 39/52] cross-mips-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..6009e5c79eb2 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 00af28a8ebb863aeb5773d46755ec51698514841 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 40/52] cross-mips-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..080164df193d 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="hipperson0 <hipperson0@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 3fcea05544657f65660bcd220c094d90c3a8de44 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 41/52] cross-mipsel-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..c8f90cfa43cc 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_musl_version=1.1.24
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From dd8593175d194a9b6f1a3723e605ab34cc87f119 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 42/52] cross-mipsel-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..931345d2de15 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_musl_version=1.1.24
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 67f33c6bd53908d2bfe49e293366cbed7381ac1c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 43/52] cross-powerpc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..31e57b4e52b2 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 9662d5a80acd081c77c366c6a33fe6970aec3688 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 44/52] cross-powerpc-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..a2d1edcf1ffd 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From e5f1768b6f012e0bc5d3d4ab3f5699b9ca120b4f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 45/52] cross-powerpc64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..1a4cbed61e76 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From b1ff19a8c2768aeb3b080080e89ade404c27d428 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 46/52] cross-powerpc64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 1ebd0fb2048d..ade42018af05 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From e75c4a44f00f2c266b808a81dcb5c02d23142075 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 47/52] cross-powerpc64le-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 733f5851da5c..dd1ad383a21e 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 973f738ae13cacb7838094ff2428773af0b4aaa8 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 48/52] cross-powerpc64le-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index 76a70aa1d6db..5887f845f932 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 4dff1a1d6adda81c37340eeb532616d2da70c34c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 49/52] cross-powerpcle-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 347b8fcf4f55..06530e0d609b 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From fc0b6c910cb0cb1fbaaf32a390f6cbce1f28b1b3 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:19 -0700
Subject: [PATCH 50/52] cross-powerpcle-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index ec9324ddaa99..e68c3962b49c 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 58706bba9134feff35dd57d5528485a2eed2574e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:19 -0700
Subject: [PATCH 51/52] cross-x86_64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 0078fbe7224b..7da85c14b62d 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 91806684ad576ddee0021e55a60bb937cdaa5fee Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:19 -0700
Subject: [PATCH 52/52] cross-x86_64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..2811de0d3c2e 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (48 preceding siblings ...)
  2022-08-24 23:42 ` [PR PATCH] [Updated] gcc: update to 12.2.0 oreo639
@ 2022-08-24 23:58 ` oreo639
  2022-08-25  0:00 ` oreo639
                   ` (214 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-08-24 23:58 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5538 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.2.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.2.0

This PR depends on: https://github.com/void-linux/void-packages/pull/32330

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

Also, keep in mind that the libgo musl patch here will need to be updated once musl is updated:
https://github.com/void-linux/void-packages/pull/34902/files#diff-1f42a95b93c9550178ff1fbccbef2f47a72711df15c24c9472e2550076978129R163-R176

This is the updated patch for reference:
https://github.com/alpinelinux/aports/blob/8acb21b8ee881e7ab1c812d9a66a17d2501b8730/main/gcc/0049-libgo-adjust-name-of-union-in-sigevent-struct.patch

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/38817
- [x] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [ ] llvm https://github.com/void-linux/void-packages/pull/38694
- [ ] m4 https://github.com/void-linux/void-packages/pull/33730
- [ ] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [ ] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [ ] libvirt https://github.com/void-linux/void-packages/pull/38842
- [ ] syslinux https://github.com/void-linux/void-packages/pull/38876
- [ ] efivar https://github.com/void-linux/void-packages/pull/38874

Known packages that needed to be fixed/updated for gcc12:
- [ ] linux5.18 (in this PR)
- [ ] openssh https://github.com/void-linux/void-packages/pull/38849
- [ ] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [ ] doxygen https://github.com/void-linux/void-packages/pull/38846
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/38817
- [ ] libproxy https://github.com/void-linux/void-packages/pull/38818
- [ ] exempi https://github.com/void-linux/void-packages/pull/38820
- [ ] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [ ] gpgme https://github.com/void-linux/void-packages/pull/38825
- [ ] libunique1 https://github.com/void-linux/void-packages/pull/38848 or https://github.com/void-linux/void-packages/pull/38873
- [ ] libwpd https://github.com/void-linux/void-packages/pull/38878

Needs to be fixed/updated for binutils:
- [ ] grub https://github.com/void-linux/void-packages/pull/38875
- [ ] linux-tools https://github.com/void-linux/void-packages/pull/38877

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [x] kde
- [x] lxde
- [x] lxqt

You can test the ISOs here:
https://drive.google.com/drive/folders/1ix92CYSLUP-KWjLxltdgG4e8Nu2JCY5n?usp=sharing

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 168755 bytes --]

From 8e9bdcbfa4505fc92378c41f70b46d28d4dfc81f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 01/52] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 15 +++--
 3 files changed, 28 insertions(+), 113 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..ec87789dc960 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkg-config"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -44,6 +45,12 @@ do_configure() {
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	# gprofng currently only supports x86_64 and aarch64 glibc.
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64|i386|aarch64) conf+=" --enable-gprofng" ;;
+		*) conf+=" --disable-gprofng" ;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"

From 9cb8461144ea97938a1919c8284cb033620a604b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 02/52] gcc: update to 12.2.0.

---
 common/shlibs                                 | 10 +--
 srcpkgs/gcc/files/gccgo-musl.patch            | 74 ++++---------------
 srcpkgs/gcc/files/libgnarl-musl.patch         | 18 ++---
 srcpkgs/gcc/files/libssp-musl.patch           | 10 +--
 srcpkgs/gcc/patches/libffi_gnulinux.patch     | 11 ---
 .../gcc/patches/libgcc-ibm128-no-tag.patch    | 10 ++-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |  2 +-
 srcpkgs/gcc/template                          | 25 +++----
 8 files changed, 52 insertions(+), 108 deletions(-)
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index f829ee12e80f..bde5320461ce 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.2.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.34 perl-5.34.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -848,8 +848,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.2.0_1
+libgnat-12.so libada-12.2.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1700,8 +1700,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.2.0_1
+libasan.so.8 libsanitizer-12.2.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..632ef951097b 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,17 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ a/libgo/go/runtime/os_linux.go
+@@ -363,9 +363,9 @@
+ 
+ 	var timerid int32
+ 	var sevp _sigevent
+-	sevp.sigev_notify = _SIGEV_THREAD_ID
++	sevp.sigev_notify = 4
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.sigev_notify_function))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..446741390d45 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,15 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
+version=12.2.0
+revision=1
 _patchver="${version%pre*}"
 _minorver="${_patchver%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 wrksrc=gcc-${version/pre/_pre}
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +19,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -396,7 +393,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}

From e5a26cd9b13483c348a76732f7f8eef9de16b43e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 03/52] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      |  6 ++--
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..08e35d466a44 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From 17ba38edd7120acfdf1d95558e3cb6938fe51536 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 04/52] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 1a4e1ca3d594..b04268908c2e 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="q66 <daniel@octaforge.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From 9bbc96711d53e885e334318139833e7bafec1a22 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 05/52] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 3 files changed, 55 insertions(+), 353 deletions(-)
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index bde5320461ce..52220e69706d 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From 59da5123aa462a46b8ca8e697d97c1c4d4bcf14d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 21:01:43 -0700
Subject: [PATCH 06/52] gcc-multilib: update to 12.2.0.

---
 srcpkgs/gcc-multilib/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index fcd25755aa75..1a26da26a991 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,16 +3,16 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _majorver="${version%.*}"
-wrksrc=gcc-${version/pre/_pre}
+wrksrc=gcc-${version}
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel

From e930d6fff68fbb0d9720bb5786c686c4cd6f11b9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 16:22:03 -0700
Subject: [PATCH 07/52] llvm12: fix build for glibc 2.36

---
 .../compiler-rt-sanitizer-glibc-2.36.patch    | 59 +++++++++++++++++++
 1 file changed, 59 insertions(+)
 create mode 100644 srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch

diff --git a/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch b/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch
new file mode 100644
index 000000000000..e5f24dab8935
--- /dev/null
+++ b/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch
@@ -0,0 +1,59 @@
+From 9cf13067cb5088626ba7ee1ec4c42ec59c7995a0 Mon Sep 17 00:00:00 2001
+From: Fangrui Song <i@maskray.me>
+Date: Mon, 11 Jul 2022 12:53:34 -0700
+Subject: [PATCH] [sanitizer] Remove #include <linux/fs.h> to resolve
+ fsconfig_command/mount_attr conflict with glibc 2.36
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+It is generally not a good idea to mix usage of glibc headers and Linux UAPI
+headers (https://sourceware.org/glibc/wiki/Synchronizing_Headers). In glibc
+since 7eae6a91e9b1670330c9f15730082c91c0b1d570 (milestone: 2.36), sys/mount.h
+defines `fsconfig_command` which conflicts with linux/mount.h:
+
+    .../usr/include/linux/mount.h:95:6: error: redeclaration of ‘enum fsconfig_command’
+
+Remove #include <linux/fs.h> which pulls in linux/mount.h. Expand its 4 macros manually.
+Android sys/mount.h doesn't define BLKBSZGET and it still needs linux/fs.h.
+In the long term we should move Linux specific definitions to sanitizer_platform_limits_linux.cpp
+but this commit is easy to cherry pick into older compiler-rt releases.
+
+Fix https://github.com/llvm/llvm-project/issues/56421
+
+Reviewed By: #sanitizers, vitalybuka, zatrazz
+
+Differential Revision: https://reviews.llvm.org/D129471
+---
+ .../sanitizer_platform_limits_posix.cpp                | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+index 4bd425435d56d..3a94b260686f1 100644
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -73,7 +73,9 @@
+ #include <sys/vt.h>
+ #include <linux/cdrom.h>
+ #include <linux/fd.h>
++#if SANITIZER_ANDROID
+ #include <linux/fs.h>
++#endif
+ #include <linux/hdreg.h>
+ #include <linux/input.h>
+ #include <linux/ioctl.h>
+@@ -876,10 +878,10 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
+   unsigned IOCTL_EVIOCGPROP = IOCTL_NOT_PRESENT;
+   unsigned IOCTL_EVIOCSKEYCODE_V2 = IOCTL_NOT_PRESENT;
+ #endif
+-  unsigned IOCTL_FS_IOC_GETFLAGS = FS_IOC_GETFLAGS;
+-  unsigned IOCTL_FS_IOC_GETVERSION = FS_IOC_GETVERSION;
+-  unsigned IOCTL_FS_IOC_SETFLAGS = FS_IOC_SETFLAGS;
+-  unsigned IOCTL_FS_IOC_SETVERSION = FS_IOC_SETVERSION;
++  unsigned IOCTL_FS_IOC_GETFLAGS = _IOR('f', 1, long);
++  unsigned IOCTL_FS_IOC_GETVERSION = _IOR('v', 1, long);
++  unsigned IOCTL_FS_IOC_SETFLAGS = _IOW('f', 2, long);
++  unsigned IOCTL_FS_IOC_SETVERSION = _IOW('v', 2, long);
+   unsigned IOCTL_GIO_CMAP = GIO_CMAP;
+   unsigned IOCTL_GIO_FONT = GIO_FONT;
+   unsigned IOCTL_GIO_UNIMAP = GIO_UNIMAP;

From 6695733d81c8ab7635afe47fee69e1f5f08196d2 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 17:21:40 -0700
Subject: [PATCH 08/52] m4: update to 1.4.19.

---
 srcpkgs/m4/patches/fix-glibc-2.27.patch | 167 ------------------------
 srcpkgs/m4/template                     |  12 +-
 2 files changed, 6 insertions(+), 173 deletions(-)
 delete mode 100644 srcpkgs/m4/patches/fix-glibc-2.27.patch

diff --git a/srcpkgs/m4/patches/fix-glibc-2.27.patch b/srcpkgs/m4/patches/fix-glibc-2.27.patch
deleted file mode 100644
index 59d33cff164d..000000000000
--- a/srcpkgs/m4/patches/fix-glibc-2.27.patch
+++ /dev/null
@@ -1,167 +0,0 @@
-From 4af4a4a71827c0bc5e0ec67af23edef4f15cee8e Mon Sep 17 00:00:00 2001
-From: Paul Eggert <eggert@cs.ucla.edu>
-Date: Mon, 5 Mar 2018 10:56:29 -0800
-Subject: [PATCH] fflush: adjust to glibc 2.28 libio.h removal
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Problem reported by Daniel P. Berrangé in:
-https://lists.gnu.org/r/bug-gnulib/2018-03/msg00000.html
-* lib/fbufmode.c (fbufmode):
-* lib/fflush.c (clear_ungetc_buffer_preserving_position)
-(disable_seek_optimization, rpl_fflush):
-* lib/fpending.c (__fpending):
-* lib/fpurge.c (fpurge):
-* lib/freadable.c (freadable):
-* lib/freadahead.c (freadahead):
-* lib/freading.c (freading):
-* lib/freadptr.c (freadptr):
-* lib/freadseek.c (freadptrinc):
-* lib/fseeko.c (fseeko):
-* lib/fseterr.c (fseterr):
-* lib/fwritable.c (fwritable):
-* lib/fwriting.c (fwriting):
-Check _IO_EOF_SEEN instead of _IO_ftrylockfile.
-* lib/stdio-impl.h (_IO_IN_BACKUP) [_IO_EOF_SEEN]:
-Define if not already defined.
-
-[yann.morin.1998@free.fr: partially backport from upstream gnulib]
-Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
-
----
- lib/fflush.c     |  6 +++---
- lib/fpending.c   |  2 +-
- lib/fpurge.c     |  2 +-
- lib/freadahead.c |  2 +-
- lib/freading.c   |  2 +-
- lib/fseeko.c     |  4 ++--
- lib/stdio-impl.h |  6 ++++++
- 7 files changed, 15 insertions(+), 9 deletions(-)
-
-diff --git a/lib/fflush.c b/build-aux/gnulib/lib/fflush.c
-index 983ade0ff..a6edfa105 100644
---- a/lib/fflush.c
-+++ b/lib/fflush.c
-@@ -33,7 +33,7 @@
- #undef fflush
- 
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- 
- /* Clear the stream's ungetc buffer, preserving the value of ftello (fp).  */
- static void
-@@ -72,7 +72,7 @@ clear_ungetc_buffer (FILE *fp)
- 
- #endif
- 
--#if ! (defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
-+#if ! (defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
- 
- # if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT
- /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
-@@ -148,7 +148,7 @@ rpl_fflush (FILE *stream)
-   if (stream == NULL || ! freading (stream))
-     return fflush (stream);
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- 
-   clear_ungetc_buffer_preserving_position (stream);
- 
-diff --git a/lib/fpending.c b/build-aux/gnulib/lib/fpending.c
-index c84e3a5b4..789f50e4e 100644
---- a/lib/fpending.c
-+++ b/lib/fpending.c
-@@ -32,7 +32,7 @@ __fpending (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   return fp->_IO_write_ptr - fp->_IO_write_base;
- #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
-   /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
-diff --git a/lib/fpurge.c b/build-aux/gnulib/lib/fpurge.c
-index b1d417c7a..3aedcc373 100644
---- a/lib/fpurge.c
-+++ b/lib/fpurge.c
-@@ -62,7 +62,7 @@ fpurge (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   fp->_IO_read_end = fp->_IO_read_ptr;
-   fp->_IO_write_ptr = fp->_IO_write_base;
-   /* Avoid memory leak when there is an active ungetc buffer.  */
-diff --git a/lib/freadahead.c b/build-aux/gnulib/lib/freadahead.c
-index c2ecb5b28..23ec76ee5 100644
---- a/lib/freadahead.c
-+++ b/lib/freadahead.c
-@@ -30,7 +30,7 @@ extern size_t __sreadahead (FILE *);
- size_t
- freadahead (FILE *fp)
- {
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   if (fp->_IO_write_ptr > fp->_IO_write_base)
-     return 0;
-   return (fp->_IO_read_end - fp->_IO_read_ptr)
-diff --git a/lib/freading.c b/build-aux/gnulib/lib/freading.c
-index 73c28acdd..c24d0c88a 100644
---- a/lib/freading.c
-+++ b/lib/freading.c
-@@ -31,7 +31,7 @@ freading (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   return ((fp->_flags & _IO_NO_WRITES) != 0
-           || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0
-               && fp->_IO_read_base != NULL));
-diff --git a/lib/fseeko.c b/build-aux/gnulib/lib/fseeko.c
-index 0101ab55f..193f4e8ce 100644
---- a/lib/fseeko.c
-+++ b/lib/fseeko.c
-@@ -47,7 +47,7 @@ fseeko (FILE *fp, off_t offset, int whence)
- #endif
- 
-   /* These tests are based on fpurge.c.  */
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   if (fp->_IO_read_end == fp->_IO_read_ptr
-       && fp->_IO_write_ptr == fp->_IO_write_base
-       && fp->_IO_save_base == NULL)
-@@ -123,7 +123,7 @@ fseeko (FILE *fp, off_t offset, int whence)
-           return -1;
-         }
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-       fp->_flags &= ~_IO_EOF_SEEN;
-       fp->_offset = pos;
- #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
-diff --git a/lib/stdio-impl.h b/build-aux/gnulib/lib/stdio-impl.h
-index 78d896e9f..05c5752a2 100644
---- a/lib/stdio-impl.h
-+++ b/lib/stdio-impl.h
-@@ -18,6 +18,12 @@
-    the same implementation of stdio extension API, except that some fields
-    have different naming conventions, or their access requires some casts.  */
- 
-+/* Glibc 2.28 made _IO_IN_BACKUP private.  For now, work around this
-+   problem by defining it ourselves.  FIXME: Do not rely on glibc
-+   internals.  */
-+#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN
-+# define _IO_IN_BACKUP 0x100
-+#endif
- 
- /* BSD stdio derived implementations.  */
- 
--- 
-2.14.1
-
-
diff --git a/srcpkgs/m4/template b/srcpkgs/m4/template
index 78f3dae6184a..762593d883bd 100644
--- a/srcpkgs/m4/template
+++ b/srcpkgs/m4/template
@@ -1,17 +1,17 @@
 # Template file for 'm4'
 pkgname=m4
-version=1.4.18
-revision=2
+version=1.4.19
+revision=1
 bootstrap=yes
-replaces="chroot-m4>=0"
 build_style=gnu-configure
 configure_args="--enable-changeword --enable-threads"
 short_desc="GNU version of UNIX m4 macro language processor"
-homepage="https://www.gnu.org/software/m4/"
-license="GPL-3.0-or-later"
 maintainer="Enno Boland <gottox@voidlinux.org>"
+license="GPL-3.0-or-later"
+homepage="https://www.gnu.org/software/m4/"
 distfiles="${GNU_SITE}/${pkgname}/${pkgname}-${version}.tar.xz"
-checksum=f2c1e86ca0a404ff281631bdc8377638992744b175afb806e25871a24a934e07
+checksum=63aede5c6d33b6d9b13511cd0be2cac046f2e70fd0a07aa9573a04a82783af96
+replaces="chroot-m4>=0"
 
 if [ "$XBPS_TARGET_LIBC" = musl ]; then
 	export ac_cv_lib_error_at_line=no

From 07f82a6e3e93d9a9d5d3dbff81ed550d0e29d27e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 22:57:59 -0700
Subject: [PATCH 09/52] btrfs-progs: update to 5.19.

---
 srcpkgs/btrfs-progs/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/btrfs-progs/template b/srcpkgs/btrfs-progs/template
index f6c53d8587e1..292d5110106b 100644
--- a/srcpkgs/btrfs-progs/template
+++ b/srcpkgs/btrfs-progs/template
@@ -1,6 +1,6 @@
 # Template file for 'btrfs-progs'
 pkgname=btrfs-progs
-version=5.18.1
+version=5.19
 revision=1
 wrksrc="${pkgname}-v${version}"
 build_style=gnu-configure
@@ -16,7 +16,7 @@ license="GPL-2.0-only, LGPL-2.1-or-later"
 homepage="https://btrfs.wiki.kernel.org/index.php/Main_Page"
 changelog="https://raw.githubusercontent.com/kdave/btrfs-progs/master/CHANGES"
 distfiles="${KERNEL_SITE}/kernel/people/kdave/${pkgname}/${pkgname}-v${version}.tar.xz"
-checksum=6e98a75ccff52e9354daa1ad284c614c490f844273a2fa524cbac9eb841c7255
+checksum=1fbcf06e4b2f80e7a127fd687ed4625a5b74fa674fe212c836ff70e0edfcccf9
 # Most of the tests depend on `mount` and `fallocate` commands, which are not
 # presented in chroot-util-linux
 make_check=no

From af8003771f26549c2adc6678eb41a96452a6e8d5 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 19:39:23 -0700
Subject: [PATCH 10/52] syslinux: fix build for glibc 2.36

---
 .../patches/fix-build-with-glibc-2.36.patch   | 30 +++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 srcpkgs/syslinux/patches/fix-build-with-glibc-2.36.patch

diff --git a/srcpkgs/syslinux/patches/fix-build-with-glibc-2.36.patch b/srcpkgs/syslinux/patches/fix-build-with-glibc-2.36.patch
new file mode 100644
index 000000000000..1303be56c127
--- /dev/null
+++ b/srcpkgs/syslinux/patches/fix-build-with-glibc-2.36.patch
@@ -0,0 +1,30 @@
+--- a/linux/syslinux.c
++++ b/linux/syslinux.c
+@@ -45,7 +45,6 @@
+ #include <sys/stat.h>
+ #include <sys/types.h>
+ #include <sys/wait.h>
+-#include <sys/mount.h>
+ 
+ #include "linuxioctl.h"
+ 
+--- a/libinstaller/syslxcom.c
++++ b/libinstaller/syslxcom.c
+@@ -28,7 +28,6 @@
+ #include <errno.h>
+ #include <sys/stat.h>
+ #include <sys/types.h>
+-#include <sys/mount.h>
+ #include <sys/vfs.h>
+ 
+ #include "linuxioctl.h"
+--- a/extlinux/main.c
++++ b/extlinux/main.c
+@@ -40,7 +40,6 @@
+ #include <sys/stat.h>
+ #include <sys/sysmacros.h>
+ #include <sys/types.h>
+-#include <sys/mount.h>
+ #include <sys/vfs.h>
+ 
+ #include "linuxioctl.h"

From 656699832783c3f186e7961934c40f6faa9bca93 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 14 Aug 2022 19:29:36 -0700
Subject: [PATCH 11/52] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove -no-pie from build. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..0994617fac96 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -60,6 +60,7 @@ _void_cross_build_binutils() {
 		--disable-multilib \
 		--disable-werror \
 		--disable-gold \
+		--disable-gprofng \
 		--enable-relro \
 		--enable-plugins \
 		--enable-64-bit-bfd \
@@ -132,6 +133,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -460,6 +462,14 @@ do_build() {
 	local binutils_ver linux_ver gcc_ver libc_ver libucontext_ver
 	local tgt=${sourcepkg/cross-}
 
+	export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}"
+	export CXXFLAGS="${CXXFLAGS/-D_FORTIFY_SOURCE=2/}"
+
+	# Disable explicit -fno-PIE, gcc/binutils/libc will figure this out itself.
+	export CFLAGS="${CFLAGS//-fno-PIE/}"
+	export CXXFLAGS="${CXXFLAGS//-fno-PIE/}"
+	export LDFLAGS="${LDFLAGS//-no-pie/}"
+
 	_void_cross_test_ver binutils
 	_void_cross_test_ver linux
 	_void_cross_test_ver gcc

From c0b6dfe1b9d79c0c144d2486d8f7a53517b760d9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:08:52 -0700
Subject: [PATCH 12/52] openssh: suppress werror on gcc12

---
 srcpkgs/openssh/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/openssh/template b/srcpkgs/openssh/template
index 02a2dec35f42..6e8e343a9dca 100644
--- a/srcpkgs/openssh/template
+++ b/srcpkgs/openssh/template
@@ -40,7 +40,7 @@ if [ "$build_option_ldns" -a -z "$build_option_ssl" ]; then
 	broken="option 'ldns' requires option 'ssl'"
 fi
 
-CFLAGS="-Wno-format-truncation -Wno-stringop-truncation"
+CFLAGS="-Wno-format-truncation -Wno-stringop-truncation -Wno-error=maybe-uninitialized"
 
 case $XBPS_TARGET_MACHINE in
 	i686-musl)

From 685a9f6f71ec740afbc7c813cc78d13a44651484 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:09:31 -0700
Subject: [PATCH 13/52] linux5.18: update dotconfigs for gcc12

---
 srcpkgs/linux5.18/files/x86_64-dotconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/linux5.18/files/x86_64-dotconfig b/srcpkgs/linux5.18/files/x86_64-dotconfig
index 4e73a3195d40..ea6204868e23 100644
--- a/srcpkgs/linux5.18/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.18/files/x86_64-dotconfig
@@ -512,6 +512,7 @@ CONFIG_RETHUNK=y
 CONFIG_CPU_UNRET_ENTRY=y
 CONFIG_CPU_IBPB_ENTRY=y
 CONFIG_CPU_IBRS_ENTRY=y
+CONFIG_SLS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10060,8 +10061,11 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
 # Memory initialization
 #
 CONFIG_INIT_STACK_NONE=y
+# CONFIG_INIT_STACK_ALL_PATTERN is not set
+# CONFIG_INIT_STACK_ALL_ZERO is not set
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
+# CONFIG_ZERO_CALL_USED_REGS is not set
 # end of Memory initialization
 # end of Kernel hardening options
 # end of Security options
@@ -10538,6 +10542,7 @@ CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
 # CONFIG_UBSAN is not set
 CONFIG_HAVE_ARCH_KCSAN=y
+# CONFIG_KCSAN is not set
 # end of Generic Kernel Debugging Instruments
 
 #

From d80489406b4d569509c0ad1fa8362b1265e44a35 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 18:00:42 -0700
Subject: [PATCH 14/52] xf86-video-vmware: fix build on gcc12

---
 ...183b3395333d5d4c73e25c2d011748f15eda.patch | 30 +++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch

diff --git a/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch b/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch
new file mode 100644
index 000000000000..ff839f16e628
--- /dev/null
+++ b/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch
@@ -0,0 +1,30 @@
+From 77b8183b3395333d5d4c73e25c2d011748f15eda Mon Sep 17 00:00:00 2001
+From: Rudi Heitbaum <rudi@heitbaum.com>
+Date: Sun, 8 May 2022 03:00:10 +0000
+Subject: [PATCH] vmwgfx: fix missing array notation
+
+ Fixes error identified by gcc-12.1.0 compiler
+
+make
+  CC       libvmwgfx_la-vmwgfx_tex_video.lo
+vmwgfx_tex_video.c: In function 'stop_video':
+vmwgfx_tex_video.c:240:20: error: the comparison will always evaluate as 'true' for the address of 'yuv' will never be NULL [-Werror=address]
+  240 |                if (priv->yuv[i]) {
+      |                    ^~~~
+---
+ vmwgfx/vmwgfx_tex_video.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/vmwgfx/vmwgfx_tex_video.c b/vmwgfx/vmwgfx_tex_video.c
+index acc2b56..480a5f1 100644
+--- a/vmwgfx/vmwgfx_tex_video.c
++++ b/vmwgfx/vmwgfx_tex_video.c
+@@ -237,7 +237,7 @@ stop_video(ScrnInfoPtr pScrn, pointer data, Bool shutdown)
+ 
+        for (i=0; i<3; ++i) {
+ 	   for (j=0; j<2; ++j) {
+-	       if (priv->yuv[i]) {
++	       if (priv->yuv[j][i]) {
+ 		   xa_surface_destroy(priv->yuv[j][i]);
+ 		   priv->yuv[j][i] = NULL;
+ 	       }

From c4dae33e141487f370bae14d78537dce833f1f9f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 18:24:37 -0700
Subject: [PATCH 15/52] doxygen: fix build for gcc 12

---
 srcpkgs/doxygen/patches/compat-gcc12.patch | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100644 srcpkgs/doxygen/patches/compat-gcc12.patch

diff --git a/srcpkgs/doxygen/patches/compat-gcc12.patch b/srcpkgs/doxygen/patches/compat-gcc12.patch
new file mode 100644
index 000000000000..666744a1dceb
--- /dev/null
+++ b/srcpkgs/doxygen/patches/compat-gcc12.patch
@@ -0,0 +1,22 @@
+From 5198966c8d5fec89116d025c74934ac03ea511fa Mon Sep 17 00:00:00 2001
+From: Dimitri van Heesch <doxygen@gmail.com>
+Date: Fri, 6 May 2022 09:55:16 +0200
+Subject: [PATCH] issue #9312: Build: cache.h:53:14: error: 'exchange' is not a
+ member of 'std'
+
+---
+ src/cache.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/cache.h b/src/cache.h
+index 0ff3092ed5..e218eb27d2 100644
+--- a/src/cache.h
++++ b/src/cache.h
+@@ -19,6 +19,7 @@
+ #include <list>
+ #include <unordered_map>
+ #include <mutex>
++#include <utility>
+ #include <ctype.h>
+ 
+ /*! Fixed size cache for value type V using keys of type K.

From e60d6a583699c21d97647091edc7107218e2e57c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 21 Aug 2022 15:12:00 -0700
Subject: [PATCH 16/52] libproxy: update to 0.4.18

---
 srcpkgs/libproxy/template | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/libproxy/template b/srcpkgs/libproxy/template
index d6103007032e..6599dfb69b98 100644
--- a/srcpkgs/libproxy/template
+++ b/srcpkgs/libproxy/template
@@ -1,18 +1,22 @@
 # Template file for 'libproxy'
 pkgname=libproxy
-version=0.4.15
+version=0.4.18
 revision=1
 build_style=cmake
 configure_args="-DWITH_GNOME=0 -DWITH_KDE4=0 -DWITH_MOZJS=0 -DWITH_NM=0
  -DWITH_PERL=0 -DWITH_PYTHON=1 -DWITH_WEBKIT=0"
 hostmakedepends="pkg-config python"
 makedepends="zlib-devel"
-short_desc="A library handling all the details of proxy configuration"
+short_desc="Library handling all the details of proxy configuration"
 maintainer="Orphaned <orphan@voidlinux.org>"
+license="LGPL-2.1-or-later"
 homepage="http://github.com/libproxy/libproxy"
-license="LGPL-2.1"
-distfiles="https://github.com/libproxy/libproxy/archive/${version}.tar.gz>${pkgname}-${version}.tar.gz"
-checksum=18f58b0a0043b6881774187427ead158d310127fc46a1c668ad6d207fb28b4e0
+distfiles="https://github.com/libproxy/libproxy/archive/${version}.tar.gz"
+checksum=0b4a9218d88f6cf9fa25996a3f38329a11f688a9d026141d9d0e966d8fa63837
+
+post_patch() {
+	vsed '/add_test(NAME url-test/d' -i libproxy/test/CMakeLists.txt
+}
 
 libproxy-devel_package() {
 	depends="libproxy>=${version}_${revision}"

From 8280ba53d1e7c3e55b7fc6b13d48eb40f5049692 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 21 Aug 2022 17:05:39 -0700
Subject: [PATCH 17/52] exempi: update to 2.6.2

---
 ...f034705fd2d032c81383eee8208fd4eee0ac.patch | 43 -------------------
 srcpkgs/exempi/template                       |  4 +-
 2 files changed, 2 insertions(+), 45 deletions(-)
 delete mode 100644 srcpkgs/exempi/patches/8ed2f034705fd2d032c81383eee8208fd4eee0ac.patch

diff --git a/srcpkgs/exempi/patches/8ed2f034705fd2d032c81383eee8208fd4eee0ac.patch b/srcpkgs/exempi/patches/8ed2f034705fd2d032c81383eee8208fd4eee0ac.patch
deleted file mode 100644
index 2696793cec09..000000000000
--- a/srcpkgs/exempi/patches/8ed2f034705fd2d032c81383eee8208fd4eee0ac.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From 8ed2f034705fd2d032c81383eee8208fd4eee0ac Mon Sep 17 00:00:00 2001
-From: Victor Rodriguez <victor.rodriguez.bahena@intel.com>
-Date: Sat, 18 Aug 2018 13:54:55 +0000
-Subject: [PATCH] Issue #9 - Fix null-pointer-dereference (CVE-2018-12648)
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-The WEBP::GetLE32 function in
-XMPFiles/source/FormatSupport/WEBP_Support.hpp in Exempi 2.4.5 has a
-NULL pointer dereference.
-
-https://bugs.freedesktop.org/show_bug.cgi?id=106981
-https://gitlab.freedesktop.org/libopenraw/exempi/issues/9
-
-Signed-off-by: Victor Rodriguez <victor.rodriguez.bahena@intel.com>
-Signed-off-by: Hubert Figuière <hub@figuiere.net>
----
- XMPFiles/source/FormatSupport/WEBP_Support.cpp | 8 +++++---
- 1 file changed, 5 insertions(+), 3 deletions(-)
-
-diff --git a/XMPFiles/source/FormatSupport/WEBP_Support.cpp b/XMPFiles/source/FormatSupport/WEBP_Support.cpp
-index ffaf220..4fe705b 100644
---- a/XMPFiles/source/FormatSupport/WEBP_Support.cpp
-+++ b/XMPFiles/source/FormatSupport/WEBP_Support.cpp
-@@ -160,9 +160,11 @@ bool VP8XChunk::xmp()
- }
- void VP8XChunk::xmp(bool hasXMP)
- {
--    XMP_Uns32 flags = GetLE32(&this->data[0]);
--    flags ^= (-hasXMP ^ flags) & (1 << XMP_FLAG_BIT);
--    PutLE32(&this->data[0], flags);
-+    if (&this->data[0] != NULL) {
-+        XMP_Uns32 flags = GetLE32(&this->data[0]);
-+        flags ^= (-hasXMP ^ flags) & (1 << XMP_FLAG_BIT);
-+        PutLE32(&this->data[0], flags);
-+    }
- }
- 
- Container::Container(WEBP_MetaHandler* handler) : Chunk(NULL, handler)
--- 
-2.18.0
-
diff --git a/srcpkgs/exempi/template b/srcpkgs/exempi/template
index 14753617953a..d664f7dc4d80 100644
--- a/srcpkgs/exempi/template
+++ b/srcpkgs/exempi/template
@@ -1,6 +1,6 @@
 # Template file for 'exempi'
 pkgname=exempi
-version=2.5.0
+version=2.6.2
 revision=1
 build_style=gnu-configure
 configure_args="--with-boost=${XBPS_CROSS_BASE}/usr --disable-static --disable-unittest"
@@ -10,7 +10,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="BSD-3-Clause"
 homepage="https://libopenraw.freedesktop.org/wiki/Exempi"
 distfiles="https://libopenraw.freedesktop.org/download/exempi-${version}.tar.bz2"
-checksum=dc82fc24c0540a44a63fa4ad21775d24e00e63f1dedd3e2ae6f7aa27583b711b
+checksum=4d17d4c93df2a95da3e3172c45b7a5bf317dd31dafd1c7a340169728c7089d1d
 
 post_install() {
 	vlicense COPYING

From 13d86d63e354896589dd7edb6564b62e056cbff5 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 21 Aug 2022 21:36:03 -0700
Subject: [PATCH 18/52] plymouth: update to 22.02.122

---
 srcpkgs/plymouth/patches/fix-glibc-2.36.patch | 30 +++++++++++++++++++
 srcpkgs/plymouth/template                     |  4 +--
 2 files changed, 32 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/plymouth/patches/fix-glibc-2.36.patch

diff --git a/srcpkgs/plymouth/patches/fix-glibc-2.36.patch b/srcpkgs/plymouth/patches/fix-glibc-2.36.patch
new file mode 100644
index 000000000000..2f1e43875cfb
--- /dev/null
+++ b/srcpkgs/plymouth/patches/fix-glibc-2.36.patch
@@ -0,0 +1,30 @@
+From 5f1e43c00039a7fe1fff768b91a05a695fb4a53d Mon Sep 17 00:00:00 2001
+From: Ray Strode <rstrode@redhat.com>
+Date: Wed, 3 Aug 2022 15:23:33 -0400
+Subject: [PATCH] ply-utils: Drop linux/fs.h include
+
+It was needed long ago for a function we no longer even have.
+
+Now it's causing compile errors on Fedora 37 because it's conflicting
+with sys/mount.h.
+
+This commit drops it.
+---
+ src/libply/ply-utils.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/src/libply/ply-utils.c b/src/libply/ply-utils.c
+index c7b165e9..219e2e77 100644
+--- a/src/libply/ply-utils.c
++++ b/src/libply/ply-utils.c
+@@ -46,7 +46,6 @@
+ #include <sys/user.h>
+ #include <sys/wait.h>
+ #include <time.h>
+-#include <linux/fs.h>
+ #include <linux/vt.h>
+ 
+ #include <dlfcn.h>
+-- 
+GitLab
+
diff --git a/srcpkgs/plymouth/template b/srcpkgs/plymouth/template
index 17f801fc5315..442ab58a99cd 100644
--- a/srcpkgs/plymouth/template
+++ b/srcpkgs/plymouth/template
@@ -1,6 +1,6 @@
 # Template file for 'plymouth'
 pkgname=plymouth
-version=0.9.5
+version=22.02.122
 revision=1
 build_style=gnu-configure
 configure_args="--with-system-root-install=no \
@@ -18,7 +18,7 @@ maintainer="William OD <obirik2005@gmail.com>"
 license="GPL-2.0-or-later"
 homepage="https://www.freedesktop.org/wiki/Software/Plymouth/"
 distfiles="${FREEDESKTOP_SITE}/plymouth/releases/$pkgname-$version.tar.xz"
-checksum=ecae257f351d098340542a5bc06de029404c24dcee87e6ebb2abd5ef117fce86
+checksum=100551442221033ce868c447ad6c74d831d209c18ae232b98ae0207e34eadaeb
 
 build_options="gtk3 pango"
 build_options_default="gtk3 pango"

From e05ef17cb80c4882ed685c73b4e003296835d268 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 21 Aug 2022 21:37:00 -0700
Subject: [PATCH 19/52] openjdk7-bootstrap: fix build for gcc12

---
 .../files/dist_patches_glibc.txt              |  1 +
 .../files/dist_patches_musl.txt               |  1 +
 .../icedtea-pointer-comparison-gcc12.patch    | 31 +++++++++++++++++++
 3 files changed, 33 insertions(+)
 create mode 100644 srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch

diff --git a/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt b/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt
index c76c56855441..8061756dfc0c 100644
--- a/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt
+++ b/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt
@@ -6,3 +6,4 @@ icedtea-jdk-no-soname.patch
 icedtea-jdk-xattr.patch
 icedtea-jdk-sysctl_h.patch
 icedtea-cpio.patch
+icedtea-pointer-comparison-gcc12.patch
diff --git a/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt b/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt
index 21812517c7c2..8b35d9c46989 100644
--- a/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt
+++ b/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt
@@ -11,3 +11,4 @@ icedtea-jdk-musl.patch
 icedtea-jdk-no-soname.patch
 icedtea-jdk-xattr.patch
 icedtea-cpio.patch
+icedtea-pointer-comparison-gcc12.patch
diff --git a/srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch b/srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch
new file mode 100644
index 000000000000..c809553443e7
--- /dev/null
+++ b/srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch
@@ -0,0 +1,31 @@
+--- openjdk.orig/hotspot/src/share/vm/opto/lcm.cpp
++++ openjdk/hotspot/src/share/vm/opto/lcm.cpp
+@@ -60,7 +60,7 @@
+ // Check whether val is not-null-decoded compressed oop,
+ // i.e. will grab into the base of the heap if it represents NULL.
+ static bool accesses_heap_base_zone(Node *val) {
+-  if (Universe::narrow_oop_base() > 0) { // Implies UseCompressedOops.
++  if (Universe::narrow_oop_base() > (address)0) { // Implies UseCompressedOops.
+     if (val && val->is_Mach()) {
+       if (val->as_Mach()->ideal_Opcode() == Op_DecodeN) {
+         // This assumes all Decodes with TypePtr::NotNull are matched to nodes that
+--- openjdk.orig/hotspot/src/share/vm/runtime/virtualspace.cpp
++++ openjdk/hotspot/src/share/vm/runtime/virtualspace.cpp
+@@ -527,7 +527,7 @@ ReservedHeapSpace::ReservedHeapSpace(siz
+                 (UseCompressedOops && (Universe::narrow_oop_base() != NULL) &&
+                  Universe::narrow_oop_use_implicit_null_checks()) ?
+                   lcm(os::vm_page_size(), alignment) : 0) {
+-  if (base() > 0) {
++  if (base() > (char*)0) {
+     MemTracker::record_virtual_memory_type((address)base(), mtJavaHeap);
+   }
+ 
+@@ -546,7 +546,7 @@ ReservedHeapSpace::ReservedHeapSpace(con
+                 (UseCompressedOops && (Universe::narrow_oop_base() != NULL) &&
+                  Universe::narrow_oop_use_implicit_null_checks()) ?
+                   lcm(os::vm_page_size(), prefix_align) : 0) {
+-  if (base() > 0) {
++  if (base() > (char*)0) {
+     MemTracker::record_virtual_memory_type((address)base(), mtJavaHeap);
+   }
+ 

From 475ab1528b262bf580b93e287810793c680a60e1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 23:30:16 -0700
Subject: [PATCH 20/52] libunique1: relax warnings for gcc12

---
 srcpkgs/libunique1/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/libunique1/template b/srcpkgs/libunique1/template
index f73931b0c72b..c5a0f5c27860 100644
--- a/srcpkgs/libunique1/template
+++ b/srcpkgs/libunique1/template
@@ -15,7 +15,7 @@ homepage="https://wiki.gnome.org/Attic/LibUnique"
 distfiles="${GNOME_SITE}/libunique/1.1/libunique-${version}.tar.bz2"
 checksum=e5c8041cef8e33c55732f06a292381cb345db946cf792a4ae18aa5c66cdd4fbb
 
-CFLAGS="-Wno-deprecated-declarations"
+CFLAGS="-Wno-deprecated-declarations -Wno-incompatible-pointer-types"
 
 # Package build options
 build_options="gir"

From eaefb19766281d2d471c9efaf0fb16548790a1bf Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:39:52 -0700
Subject: [PATCH 21/52] libvirt: fix build for glibc 2.36

---
 .../patches/lxc-fix-compat-glibc-2.36.patch   | 34 ++++++++++++++++
 .../virfile-fix-compat-glibc-2.36.patch       | 39 +++++++++++++++++++
 2 files changed, 73 insertions(+)
 create mode 100644 srcpkgs/libvirt/patches/lxc-fix-compat-glibc-2.36.patch
 create mode 100644 srcpkgs/libvirt/patches/virfile-fix-compat-glibc-2.36.patch

diff --git a/srcpkgs/libvirt/patches/lxc-fix-compat-glibc-2.36.patch b/srcpkgs/libvirt/patches/lxc-fix-compat-glibc-2.36.patch
new file mode 100644
index 000000000000..d85b57815010
--- /dev/null
+++ b/srcpkgs/libvirt/patches/lxc-fix-compat-glibc-2.36.patch
@@ -0,0 +1,34 @@
+From 9493c9b79dc541ec9e0fd73c6d87bdf8d30aaa90 Mon Sep 17 00:00:00 2001
+From: Cole Robinson <crobinso@redhat.com>
+Date: Mon, 1 Aug 2022 15:20:38 -0400
+Subject: [PATCH] lxc: containter: fix build with glibc 2.36
+
+With glibc 2.36, sys/mount.h and linux/mount.h conflict:
+https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
+
+lxc_container.c imports sys/mount.h and linux/fs.h, which pulls in
+linux/mount.h.
+
+linux/fs.h isn't required here though. glibc sys/mount.h has had
+MS_MOVE since 2.12 in 2010
+
+Reviewed-by: Erik Skultety <eskultet@redhat.com>
+Signed-off-by: Cole Robinson <crobinso@redhat.com>
+---
+ src/lxc/lxc_container.c | 3 ---
+ 1 file changed, 3 deletions(-)
+
+diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
+index b5278831da7..a5401c2186e 100644
+--- a/src/lxc/lxc_container.c
++++ b/src/lxc/lxc_container.c
+@@ -33,9 +33,6 @@
+ /* Yes, we want linux private one, for _syscall2() macro */
+ #include <linux/unistd.h>
+ 
+-/* For MS_MOVE */
+-#include <linux/fs.h>
+-
+ #if WITH_CAPNG
+ # include <cap-ng.h>
+ #endif
diff --git a/srcpkgs/libvirt/patches/virfile-fix-compat-glibc-2.36.patch b/srcpkgs/libvirt/patches/virfile-fix-compat-glibc-2.36.patch
new file mode 100644
index 000000000000..2ef227ea9b54
--- /dev/null
+++ b/srcpkgs/libvirt/patches/virfile-fix-compat-glibc-2.36.patch
@@ -0,0 +1,39 @@
+From c0d9adf220dc0d223330a7bac37b174132d330ba Mon Sep 17 00:00:00 2001
+From: Cole Robinson <crobinso@redhat.com>
+Date: Mon, 1 Aug 2022 15:24:01 -0400
+Subject: [PATCH] virfile: Fix build with glibc 2.36
+
+With glibc 2.36, sys/mount.h and linux/mount.h conflict:
+https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
+
+virfile.c imports sys/mount.h and linux/fs.h, which pulls in
+linux/mount.h.
+
+Manually define the constants we need from linux/fs.h, like was
+done in llvm:
+
+https://reviews.llvm.org/rGb379129c4beb3f26223288627a1291739f33af02
+
+Reviewed-by: Erik Skultety <eskultet@redhat.com>
+Signed-off-by: Cole Robinson <crobinso@redhat.com>
+---
+ src/util/virfile.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/src/util/virfile.c b/src/util/virfile.c
+index 99da058db3b..ce541b8946b 100644
+--- a/src/util/virfile.c
++++ b/src/util/virfile.c
+@@ -71,7 +71,11 @@
+ # endif
+ # include <sys/ioctl.h>
+ # include <linux/cdrom.h>
+-# include <linux/fs.h>
++/* These come from linux/fs.h, but that header conflicts with
++ * sys/mount.h on glibc 2.36+ */
++# define FS_IOC_GETFLAGS _IOR('f', 1, long)
++# define FS_IOC_SETFLAGS _IOW('f', 2, long)
++# define FS_NOCOW_FL 0x00800000
+ #endif
+ 
+ #if WITH_LIBATTR

From 957a390f5e0dd1453dfd049e58d0884ae77fc135 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:41:50 -0700
Subject: [PATCH 22/52] efivar: fix build for glibc 2.36

---
 .../patches/fix-compat-glibc-2.36.patch       | 55 +++++++++++++++++++
 1 file changed, 55 insertions(+)
 create mode 100644 srcpkgs/efivar/patches/fix-compat-glibc-2.36.patch

diff --git a/srcpkgs/efivar/patches/fix-compat-glibc-2.36.patch b/srcpkgs/efivar/patches/fix-compat-glibc-2.36.patch
new file mode 100644
index 000000000000..fcc83aef20cf
--- /dev/null
+++ b/srcpkgs/efivar/patches/fix-compat-glibc-2.36.patch
@@ -0,0 +1,55 @@
+From bc65d63ebf8fe6ac8a099ff15ca200986dba1565 Mon Sep 17 00:00:00 2001
+From: Robbie Harwood <rharwood@redhat.com>
+Date: Thu, 28 Jul 2022 16:11:24 -0400
+Subject: [PATCH] Fix glibc 2.36 build (mount.h conflicts)
+
+glibc has decided that sys/mount.h and linux/mount.h are no longer
+usable at the same time.  This broke the build, since linux/fs.h itself
+includes linux/mount.h.  For now, fix the build by only including
+sys/mount.h where we need it.
+
+See-also: https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
+Resolves: #227
+Signed-off-by: Robbie Harwood <rharwood@redhat.com>
+---
+ src/gpt.c   | 1 +
+ src/linux.c | 1 +
+ src/util.h  | 1 -
+ 3 files changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/gpt.c b/src/gpt.c
+index 1eda0497..21413c3b 100644
+--- a/src/gpt.c
++++ b/src/gpt.c
+@@ -17,6 +17,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <sys/mount.h>
+ #include <sys/param.h>
+ #include <sys/stat.h>
+ #include <sys/utsname.h>
+diff --git a/src/linux.c b/src/linux.c
+index 47e45ae4..1780816f 100644
+--- a/src/linux.c
++++ b/src/linux.c
+@@ -20,6 +20,7 @@
+ #include <stdbool.h>
+ #include <stdio.h>
+ #include <sys/ioctl.h>
++#include <sys/mount.h>
+ #include <sys/socket.h>
+ #include <sys/sysmacros.h>
+ #include <sys/types.h>
+diff --git a/src/util.h b/src/util.h
+index 3300666f..1e67e447 100644
+--- a/src/util.h
++++ b/src/util.h
+@@ -23,7 +23,6 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <sys/ioctl.h>
+-#include <sys/mount.h>
+ #include <sys/stat.h>
+ #include <sys/types.h>
+ #include <tgmath.h>

From 494ccce078e139277a6a9330966dd0ac8036ff59 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:43:24 -0700
Subject: [PATCH 23/52] libwpd: fix build for gcc12

---
 srcpkgs/libwpd/patches/fix-compat-gcc12.patch | 11 +++++++++++
 1 file changed, 11 insertions(+)
 create mode 100644 srcpkgs/libwpd/patches/fix-compat-gcc12.patch

diff --git a/srcpkgs/libwpd/patches/fix-compat-gcc12.patch b/srcpkgs/libwpd/patches/fix-compat-gcc12.patch
new file mode 100644
index 000000000000..6ebce2463d16
--- /dev/null
+++ b/srcpkgs/libwpd/patches/fix-compat-gcc12.patch
@@ -0,0 +1,11 @@
+diff -rup libwpd-0.10.3.orig/src/lib/WPXTable.h libwpd-0.10.3/src/lib/WPXTable.h
+--- libwpd-0.10.3.orig/src/lib/WPXTable.h	2022-08-23 22:32:45.332593795 -0700
++++ libwpd-0.10.3/src/lib/WPXTable.h	2022-08-23 22:32:59.500651211 -0700
+@@ -37,6 +37,7 @@
+ #define _WPXTABLE_H
+ 
+ #include <vector>
++#include <cstddef>
+ 
+ struct WPXTableCell
+ {

From e710f4997ed296c3b80c91a9e3a7e76c4e838d8d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:44:07 -0700
Subject: [PATCH 24/52] grub: fix build for binutils 2.36

---
 .../patches/fix-compat-binutils-2.36.patch    | 96 +++++++++++++++++++
 srcpkgs/grub/template                         |  7 +-
 2 files changed, 102 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/grub/patches/fix-compat-binutils-2.36.patch

diff --git a/srcpkgs/grub/patches/fix-compat-binutils-2.36.patch b/srcpkgs/grub/patches/fix-compat-binutils-2.36.patch
new file mode 100644
index 000000000000..d92a91e3253e
--- /dev/null
+++ b/srcpkgs/grub/patches/fix-compat-binutils-2.36.patch
@@ -0,0 +1,96 @@
+From b98275138bf4fc250a1c362dfd2c8b1cf2421701 Mon Sep 17 00:00:00 2001
+From: Michael Chang <mchang@suse.com>
+Date: Tue, 28 Sep 2021 13:50:47 +0800
+Subject: build: Fix build error with binutils 2.36
+
+The following procedure to build xen/pvgrub is broken.
+
+  git clone https://git.savannah.gnu.org/git/grub.git
+  cd grub
+  ./bootstrap
+  mkdir build-xen
+  cd build-xen
+  ../configure --with-platform=xen
+  make
+
+It fails with the message:
+
+  /usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld:
+  section .note.gnu.property VMA [0000000000400158,0000000000400187]
+  overlaps section .bss VMA [000000000000f000,000000000041e1af]
+
+The most significant factor is that new assembler (GNU as) generates the
+.note.gnu.property section as default. This note section overlaps with
+.bss because it doesn't reposition with -Wl,-Ttext,0 with which the base
+address of .text section is set, rather the address of .note.gnu.property
+is calculated for some reason from 0x400000 where the ELF executable
+defaults to start.
+
+Using -Ttext-segment doesn't help either, though it is said to set the
+address of the first byte of the text segment according to "man ld".
+What it actually does is to override the default 0x400000, aka the image
+base address, to something else. The entire process can be observed in
+the default linker script used by gcc [1]. Therefore we can't expect it
+to achieve the same thing as -Ttext given that the first segment where
+.text resides is offset by SIZEOF_HEADERS plus some sections may be
+preceding it within the first segment. The end result is .text always
+has to start with non-zero address with -Wl,-Ttext-segment,0 if using
+default linker script.
+
+It is also worth mentioning that binutils upstream apparently doesn't
+seem to consider this as a bug [2] and proposed to use -Wl,-Ttext-segment,0
+which is not fruitful as what has been tested by Gentoo [3].
+
+As long as GRUB didn't use ISA information encoded in .note.gnu.property,
+we can safely drop it via -Wa,-mx86-used-note=no assembler option to
+fix the linker error above.
+
+This is considered a better approach than using custom linker script to
+drop the .note.gnu.property section because object file manipulation can
+also be hampered one way or the other in that linker script may not be
+helpful. See also this commit removing the section in the process of objcopy.
+
+  6643507ce build: Fix GRUB i386-pc build with Ubuntu gcc
+
+[1] In /usr/lib64/ldscripts/elf_x86_64.x or use 'gcc -Wl,--verbose ...'
+    PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x400000));
+    . = SEGMENT_START("text-segment", 0x400000) + SIZEOF_HEADERS;
+[2] https://sourceware.org/bugzilla/show_bug.cgi?id=27377
+[3] https://bugs.gentoo.org/787221
+
+Signed-off-by: Michael Chang <mchang@suse.com>
+Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
+---
+ configure.ac | 14 ++++++++++++++
+ 1 file changed, 14 insertions(+)
+
+(limited to 'configure.ac')
+
+diff --git a/configure.ac b/configure.ac
+index eeb5d22..8d1c81a 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -840,6 +840,20 @@ if ( test "x$target_cpu" = xi386 || test "x$target_cpu" = xx86_64 ) && test "x$p
+   TARGET_CFLAGS="$TARGET_CFLAGS -mno-mmx -mno-sse -mno-sse2 -mno-sse3 -mno-3dnow"
+ fi
+ 
++if ( test "x$target_cpu" = xi386 || test "x$target_cpu" = xx86_64 ); then
++  AC_CACHE_CHECK([whether -Wa,-mx86-used-note works], [grub_cv_cc_mx86_used_note], [
++    CFLAGS="$TARGET_CFLAGS -Wa,-mx86-used-note=no -Werror"
++    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
++	[grub_cv_cc_mx86_used_note=yes],
++	[grub_cv_cc_mx86_used_note=no])
++  ])
++
++  if test "x$grub_cv_cc_mx86_used_note" = xyes; then
++    TARGET_CFLAGS="$TARGET_CFLAGS -Wa,-mx86-used-note=no"
++    TARGET_CCASFLAGS="$TARGET_CCASFLAGS -Wa,-mx86-used-note=no"
++  fi
++fi
++
+ # GRUB doesn't use float or doubles at all. Yet some toolchains may decide
+ # that floats are a good fit to run instead of what's written in the code.
+ # Given that floating point unit is disabled (if present to begin with)
+-- 
+cgit v1.1
+
diff --git a/srcpkgs/grub/template b/srcpkgs/grub/template
index b1826c38a884..b4d3b07af620 100644
--- a/srcpkgs/grub/template
+++ b/srcpkgs/grub/template
@@ -2,7 +2,8 @@
 pkgname=grub
 version=2.06
 revision=2
-hostmakedepends="python3 pkg-config flex freetype-devel font-unifont-bdf help2man"
+hostmakedepends="python3 pkg-config flex freetype-devel font-unifont-bdf help2man
+ automake gettext-devel-tools"
 makedepends="libusb-compat-devel ncurses-devel freetype-devel
  liblzma-devel device-mapper-devel fuse-devel"
 depends="os-prober"
@@ -43,6 +44,10 @@ case "$XBPS_TARGET_MACHINE" in
 		;;
 esac
 
+pre_configure() {
+	autoreconf -fi
+}
+
 do_configure() {
 	# workaround for https://savannah.gnu.org/bugs/?60458
 	# some more info: https://www.linuxquestions.org/questions/showthread.php?p=6257712

From 4614cc19d8943b9c4e96be24606dc28f3ba32aae Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:45:07 -0700
Subject: [PATCH 25/52] linux-toos: fix build for binutils 2.39

---
 .../patches/binutils-add-compat-check.patch   | 103 ++++++++++++
 .../patches/binutils-disasm-compat.patch      | 102 ++++++++++++
 .../bpf_jit_disasm-binutils-2.39.patch        | 104 ++++++++++++
 .../patches/bpftool-binutils-2.39.patch       | 149 ++++++++++++++++++
 .../patches/perf-binutils-2.39.patch          | 114 ++++++++++++++
 5 files changed, 572 insertions(+)
 create mode 100644 srcpkgs/linux-tools/patches/binutils-add-compat-check.patch
 create mode 100644 srcpkgs/linux-tools/patches/binutils-disasm-compat.patch
 create mode 100644 srcpkgs/linux-tools/patches/bpf_jit_disasm-binutils-2.39.patch
 create mode 100644 srcpkgs/linux-tools/patches/bpftool-binutils-2.39.patch
 create mode 100644 srcpkgs/linux-tools/patches/perf-binutils-2.39.patch

diff --git a/srcpkgs/linux-tools/patches/binutils-add-compat-check.patch b/srcpkgs/linux-tools/patches/binutils-add-compat-check.patch
new file mode 100644
index 000000000000..e4e7ece9635e
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/binutils-add-compat-check.patch
@@ -0,0 +1,103 @@
+From cfd59ca91467056bb2c36907b2fa67b8e1af9952 Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:27 -0700
+Subject: [PATCH] tools build: Add feature test for init_disassemble_info API
+ changes
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation failures for tools/{perf,bpf}, e.g. on debian unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+This commit adds a feature test to detect the new signature.  Subsequent
+commits will use it to fix the build failures.
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Quentin Monnet <quentin@isovalent.com>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-2-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/build/Makefile.feature                        |  1 +
+ tools/build/feature/Makefile                        |  4 ++++
+ tools/build/feature/test-all.c                      |  4 ++++
+ tools/build/feature/test-disassembler-init-styled.c | 13 +++++++++++++
+ 4 files changed, 22 insertions(+)
+ create mode 100644 tools/build/feature/test-disassembler-init-styled.c
+
+diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature
+index 888a0421d43b96..8f6578e4d3249e 100644
+--- a/tools/build/Makefile.feature
++++ b/tools/build/Makefile.feature
+@@ -70,6 +70,7 @@ FEATURE_TESTS_BASIC :=                  \
+         libaio				\
+         libzstd				\
+         disassembler-four-args		\
++        disassembler-init-styled	\
+         file-handle
+ 
+ # FEATURE_TESTS_BASIC + FEATURE_TESTS_EXTRA is the complete list
+diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile
+index 7c2a17e23c30ac..c3059739318a95 100644
+--- a/tools/build/feature/Makefile
++++ b/tools/build/feature/Makefile
+@@ -18,6 +18,7 @@ FILES=                                          \
+          test-libbfd.bin                        \
+          test-libbfd-buildid.bin		\
+          test-disassembler-four-args.bin        \
++         test-disassembler-init-styled.bin	\
+          test-reallocarray.bin			\
+          test-libbfd-liberty.bin                \
+          test-libbfd-liberty-z.bin              \
+@@ -248,6 +249,9 @@ $(OUTPUT)test-libbfd-buildid.bin:
+ $(OUTPUT)test-disassembler-four-args.bin:
+ 	$(BUILD) -DPACKAGE='"perf"' -lbfd -lopcodes
+ 
++$(OUTPUT)test-disassembler-init-styled.bin:
++	$(BUILD) -DPACKAGE='"perf"' -lbfd -lopcodes
++
+ $(OUTPUT)test-reallocarray.bin:
+ 	$(BUILD)
+ 
+diff --git a/tools/build/feature/test-all.c b/tools/build/feature/test-all.c
+index 5ffafb967b6e49..957c02c7b163b5 100644
+--- a/tools/build/feature/test-all.c
++++ b/tools/build/feature/test-all.c
+@@ -166,6 +166,10 @@
+ # include "test-disassembler-four-args.c"
+ #undef main
+ 
++#define main main_test_disassembler_init_styled
++# include "test-disassembler-init-styled.c"
++#undef main
++
+ #define main main_test_libzstd
+ # include "test-libzstd.c"
+ #undef main
+diff --git a/tools/build/feature/test-disassembler-init-styled.c b/tools/build/feature/test-disassembler-init-styled.c
+new file mode 100644
+index 00000000000000..f1ce0ec3bee9d3
+--- /dev/null
++++ b/tools/build/feature/test-disassembler-init-styled.c
+@@ -0,0 +1,13 @@
++// SPDX-License-Identifier: GPL-2.0
++#include <stdio.h>
++#include <dis-asm.h>
++
++int main(void)
++{
++	struct disassemble_info info;
++
++	init_disassemble_info(&info, stdout,
++			      NULL, NULL);
++
++	return 0;
++}
diff --git a/srcpkgs/linux-tools/patches/binutils-disasm-compat.patch b/srcpkgs/linux-tools/patches/binutils-disasm-compat.patch
new file mode 100644
index 000000000000..1a6cc0e6d97c
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/binutils-disasm-compat.patch
@@ -0,0 +1,102 @@
+From a45b3d6926231c3d024ea0de4f7bd967f83709ee Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:29 -0700
+Subject: tools include: add dis-asm-compat.h to handle version differences
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation failures for tools/{perf,bpf}, e.g. on debian unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+This commit introduces a wrapper for init_disassemble_info(), to avoid
+spreading #ifdef DISASM_INIT_STYLED to a bunch of places. Subsequent
+commits will use it to fix the build failures.
+
+It likely is worth adding a wrapper for disassember(), to avoid the already
+existing DISASM_FOUR_ARGS_SIGNATURE ifdefery.
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Signed-off-by: Ben Hutchings <benh@debian.org>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Quentin Monnet <quentin@isovalent.com>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-4-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/include/tools/dis-asm-compat.h | 55 ++++++++++++++++++++++++++++++++++++
+ 1 file changed, 55 insertions(+)
+ create mode 100644 tools/include/tools/dis-asm-compat.h
+
+(limited to 'tools/include/tools/dis-asm-compat.h')
+
+diff --git a/tools/include/tools/dis-asm-compat.h b/tools/include/tools/dis-asm-compat.h
+new file mode 100644
+index 0000000000000..70f331e23ed3d
+--- /dev/null
++++ b/tools/include/tools/dis-asm-compat.h
+@@ -0,0 +1,55 @@
++/* SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause */
++#ifndef _TOOLS_DIS_ASM_COMPAT_H
++#define _TOOLS_DIS_ASM_COMPAT_H
++
++#include <stdio.h>
++#include <dis-asm.h>
++
++/* define types for older binutils version, to centralize ifdef'ery a bit */
++#ifndef DISASM_INIT_STYLED
++enum disassembler_style {DISASSEMBLER_STYLE_NOT_EMPTY};
++typedef int (*fprintf_styled_ftype) (void *, enum disassembler_style, const char*, ...);
++#endif
++
++/*
++ * Trivial fprintf wrapper to be used as the fprintf_styled_func argument to
++ * init_disassemble_info_compat() when normal fprintf suffices.
++ */
++static inline int fprintf_styled(void *out,
++				 enum disassembler_style style,
++				 const char *fmt, ...)
++{
++	va_list args;
++	int r;
++
++	(void)style;
++
++	va_start(args, fmt);
++	r = vfprintf(out, fmt, args);
++	va_end(args);
++
++	return r;
++}
++
++/*
++ * Wrapper for init_disassemble_info() that hides version
++ * differences. Depending on binutils version and architecture either
++ * fprintf_func or fprintf_styled_func will be called.
++ */
++static inline void init_disassemble_info_compat(struct disassemble_info *info,
++						void *stream,
++						fprintf_ftype unstyled_func,
++						fprintf_styled_ftype styled_func)
++{
++#ifdef DISASM_INIT_STYLED
++	init_disassemble_info(info, stream,
++			      unstyled_func,
++			      styled_func);
++#else
++	(void)styled_func;
++	init_disassemble_info(info, stream,
++			      unstyled_func);
++#endif
++}
++
++#endif /* _TOOLS_DIS_ASM_COMPAT_H */
+-- 
+cgit 
+
diff --git a/srcpkgs/linux-tools/patches/bpf_jit_disasm-binutils-2.39.patch b/srcpkgs/linux-tools/patches/bpf_jit_disasm-binutils-2.39.patch
new file mode 100644
index 000000000000..01221fad3a4a
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/bpf_jit_disasm-binutils-2.39.patch
@@ -0,0 +1,104 @@
+From 96ed066054abf11c7d3e106e3011a51f3f1227a3 Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:31 -0700
+Subject: [PATCH] tools bpf_jit_disasm: Fix compilation error with new binutils
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation to fail for tools/bpf/bpf_jit_disasm.c, e.g. on debian
+unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+Wire up the feature test and switch to init_disassemble_info_compat(),
+which were introduced in prior commits, fixing the compilation failure.
+
+I verified that bpf_jit_disasm can still disassemble bpf programs, both
+with the old and new dis-asm.h API. With old binutils there's no change in
+output before/after this patch. When comparing the output from old
+binutils (2.35) to new bintuils with the patch (upstream snapshot) there
+are a few output differences, but they are unrelated to this patch. An
+example hunk is:
+
+     f4:	mov    %r14,%rsi
+     f7:	mov    %r15,%rdx
+     fa:	mov    $0x2a,%ecx
+  -  ff:	callq  0xffffffffea8c4988
+  +  ff:	call   0xffffffffea8c4988
+    104:	test   %rax,%rax
+    107:	jge    0x0000000000000110
+    109:	xor    %eax,%eax
+  - 10b:	jmpq   0x0000000000000073
+  + 10b:	jmp    0x0000000000000073
+    110:	cmp    $0x16,%rax
+
+However, I had to use an older kernel to generate the bpf_jit_enabled =
+2 output, as that has been broken since 5.18 / 1022a5498f6f745c ("bpf,
+x86_64: Use bpf_jit_binary_pack_alloc").
+
+  https://lore.kernel.org/20220703030210.pmjft7qc2eajzi6c@alap3.anarazel.de
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Daniel Borkmann <daniel@iogearbox.net>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Quentin Monnet <quentin@isovalent.com>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-6-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/bpf/Makefile         | 5 ++++-
+ tools/bpf/bpf_jit_disasm.c | 5 ++++-
+ 2 files changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/tools/bpf/Makefile b/tools/bpf/Makefile
+index b11cfc86a3d021..664601ab1705ab 100644
+--- a/tools/bpf/Makefile
++++ b/tools/bpf/Makefile
+@@ -34,7 +34,7 @@ else
+ endif
+ 
+ FEATURE_USER = .bpf
+-FEATURE_TESTS = libbfd disassembler-four-args
++FEATURE_TESTS = libbfd disassembler-four-args disassembler-init-styled
+ FEATURE_DISPLAY = libbfd disassembler-four-args
+ 
+ check_feat := 1
+@@ -56,6 +56,9 @@ endif
+ ifeq ($(feature-disassembler-four-args), 1)
+ CFLAGS += -DDISASM_FOUR_ARGS_SIGNATURE
+ endif
++ifeq ($(feature-disassembler-init-styled), 1)
++CFLAGS += -DDISASM_INIT_STYLED
++endif
+ 
+ $(OUTPUT)%.yacc.c: $(srctree)/tools/bpf/%.y
+ 	$(QUIET_BISON)$(YACC) -o $@ -d $<
+diff --git a/tools/bpf/bpf_jit_disasm.c b/tools/bpf/bpf_jit_disasm.c
+index c8ae9580472814..a90a5d110f9255 100644
+--- a/tools/bpf/bpf_jit_disasm.c
++++ b/tools/bpf/bpf_jit_disasm.c
+@@ -28,6 +28,7 @@
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <limits.h>
++#include <tools/dis-asm-compat.h>
+ 
+ #define CMD_ACTION_SIZE_BUFFER		10
+ #define CMD_ACTION_READ_ALL		3
+@@ -64,7 +65,9 @@ static void get_asm_insns(uint8_t *image, size_t len, int opcodes)
+ 	assert(bfdf);
+ 	assert(bfd_check_format(bfdf, bfd_object));
+ 
+-	init_disassemble_info(&info, stdout, (fprintf_ftype) fprintf);
++	init_disassemble_info_compat(&info, stdout,
++				     (fprintf_ftype) fprintf,
++				     fprintf_styled);
+ 	info.arch = bfd_get_arch(bfdf);
+ 	info.mach = bfd_get_mach(bfdf);
+ 	info.buffer = image;
diff --git a/srcpkgs/linux-tools/patches/bpftool-binutils-2.39.patch b/srcpkgs/linux-tools/patches/bpftool-binutils-2.39.patch
new file mode 100644
index 000000000000..1e55c40011be
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/bpftool-binutils-2.39.patch
@@ -0,0 +1,149 @@
+From 600b7b26c07a070d0153daa76b3806c1e52c9e00 Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:33 -0700
+Subject: [PATCH] tools bpftool: Fix compilation error with new binutils
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation to fail for tools/bpf/bpftool/jit_disasm.c, e.g. on debian
+unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+Wire up the feature test and switch to init_disassemble_info_compat(),
+which were introduced in prior commits, fixing the compilation failure.
+
+I verified that bpftool can still disassemble bpf programs, both with an
+old and new dis-asm.h API. There are no output changes for plain and json
+formats. When comparing the output from old binutils (2.35)
+to new bintuils with the patch (upstream snapshot) there are a few output
+differences, but they are unrelated to this patch. An example hunk is:
+
+     2f:	pop    %r14
+     31:	pop    %r13
+     33:	pop    %rbx
+  -  34:	leaveq
+  -  35:	retq
+  +  34:	leave
+  +  35:	ret
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Quentin Monnet <quentin@isovalent.com>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-8-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/bpf/bpftool/Makefile     |  5 +++-
+ tools/bpf/bpftool/jit_disasm.c | 42 +++++++++++++++++++++++++++-------
+ 2 files changed, 38 insertions(+), 9 deletions(-)
+
+diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile
+index c6d2c77d02524a..436e671b2657d4 100644
+--- a/tools/bpf/bpftool/Makefile
++++ b/tools/bpf/bpftool/Makefile
+@@ -62,7 +62,7 @@ CLANG ?= clang
+ LLVM_STRIP ?= llvm-strip
+ 
+ FEATURE_USER = .bpftool
+-FEATURE_TESTS = libbfd disassembler-four-args reallocarray zlib libcap \
++FEATURE_TESTS = libbfd disassembler-four-args disassembler-init-styled reallocarray zlib libcap \
+ 	clang-bpf-co-re
+ FEATURE_DISPLAY = libbfd disassembler-four-args zlib libcap \
+ 	clang-bpf-co-re
+@@ -117,6 +117,9 @@ endif
+ ifeq ($(feature-disassembler-four-args), 1)
+ CFLAGS += -DDISASM_FOUR_ARGS_SIGNATURE
+ endif
++ifeq ($(feature-disassembler-init-styled), 1)
++    CFLAGS += -DDISASM_INIT_STYLED
++endif
+ 
+ LIBS = $(LIBBPF) -lelf -lz
+ LIBS_BOOTSTRAP = $(LIBBPF_BOOTSTRAP) -lelf -lz
+diff --git a/tools/bpf/bpftool/jit_disasm.c b/tools/bpf/bpftool/jit_disasm.c
+index 24734f2249d6ec..aaf99a0168c90b 100644
+--- a/tools/bpf/bpftool/jit_disasm.c
++++ b/tools/bpf/bpftool/jit_disasm.c
+@@ -24,6 +24,7 @@
+ #include <sys/stat.h>
+ #include <limits.h>
+ #include <bpf/libbpf.h>
++#include <tools/dis-asm-compat.h>
+ 
+ #include "json_writer.h"
+ #include "main.h"
+@@ -39,15 +40,12 @@ static void get_exec_path(char *tpath, s
+ }
+ 
+ static int oper_count;
+-static int fprintf_json(void *out, const char *fmt, ...)
++static int printf_json(void *out, const char *fmt, va_list ap)
+ {
+-	va_list ap;
+ 	char *s;
+ 
+-	va_start(ap, fmt);
+ 	if (vasprintf(&s, fmt, ap) < 0)
+ 		return -1;
+-	va_end(ap);
+ 
+ 	if (!oper_count) {
+ 		int i;
+@@ -73,6 +71,32 @@ static int fprintf_json(void *out, const char *fmt, ...)
+ 	return 0;
+ }
+ 
++static int fprintf_json(void *out, const char *fmt, ...)
++{
++	va_list ap;
++	int r;
++
++	va_start(ap, fmt);
++	r = printf_json(out, fmt, ap);
++	va_end(ap);
++
++	return r;
++}
++
++static int fprintf_json_styled(void *out,
++			       enum disassembler_style style __maybe_unused,
++			       const char *fmt, ...)
++{
++	va_list ap;
++	int r;
++
++	va_start(ap, fmt);
++	r = printf_json(out, fmt, ap);
++	va_end(ap);
++
++	return r;
++}
++
+ void disasm_print_insn(unsigned char *image, ssize_t len, int opcodes,
+ 		       const char *arch, const char *disassembler_options,
+ 		       const struct btf *btf,
+@@ -99,11 +123,13 @@ void disasm_print_insn(unsigned char *image, ssize_t len, int opcodes,
+ 	assert(bfd_check_format(bfdf, bfd_object));
+ 
+ 	if (json_output)
+-		init_disassemble_info(&info, stdout,
+-				      (fprintf_ftype) fprintf_json);
++		init_disassemble_info_compat(&info, stdout,
++					     (fprintf_ftype) fprintf_json,
++					     fprintf_json_styled);
+ 	else
+-		init_disassemble_info(&info, stdout,
+-				      (fprintf_ftype) fprintf);
++		init_disassemble_info_compat(&info, stdout,
++					     (fprintf_ftype) fprintf,
++					     fprintf_styled);
+ 
+ 	/* Update architecture info for offload. */
+ 	if (arch) {
diff --git a/srcpkgs/linux-tools/patches/perf-binutils-2.39.patch b/srcpkgs/linux-tools/patches/perf-binutils-2.39.patch
new file mode 100644
index 000000000000..3484330f7286
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/perf-binutils-2.39.patch
@@ -0,0 +1,114 @@
+From 83aa0120487e8bc3f231e72c460add783f71f17c Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:30 -0700
+Subject: [PATCH] tools perf: Fix compilation error with new binutils
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation failures for tools/perf/util/annotate.c, e.g. on debian
+unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+Wire up the feature test and switch to init_disassemble_info_compat(),
+which were introduced in prior commits, fixing the compilation failure.
+
+I verified that perf can still disassemble bpf programs by using bpftrace
+under load, recording a perf trace, and then annotating the bpf "function"
+with and without the changes. With old binutils there's no change in output
+before/after this patch. When comparing the output from old binutils (2.35)
+to new bintuils with the patch (upstream snapshot) there are a few output
+differences, but they are unrelated to this patch. An example hunk is:
+
+       1.15 :   55:mov    %rbp,%rdx
+       0.00 :   58:add    $0xfffffffffffffff8,%rdx
+       0.00 :   5c:xor    %ecx,%ecx
+  -    1.03 :   5e:callq  0xffffffffe12aca3c
+  +    1.03 :   5e:call   0xffffffffe12aca3c
+       0.00 :   63:xor    %eax,%eax
+  -    2.18 :   65:leaveq
+  -    2.82 :   66:retq
+  +    2.18 :   65:leave
+  +    2.82 :   66:ret
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-5-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/perf/Makefile.config | 8 ++++++++
+ tools/perf/util/annotate.c | 7 ++++---
+ 2 files changed, 12 insertions(+), 3 deletions(-)
+
+diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
+index d3c254c0f5c611..23648ea54e8d3d 100644
+--- a/tools/perf/Makefile.config
++++ b/tools/perf/Makefile.config
+@@ -298,6 +298,7 @@ FEATURE_CHECK_LDFLAGS-libpython := $(PYTHON_EMBED_LDOPTS)
+ FEATURE_CHECK_LDFLAGS-libaio = -lrt
+ 
+ FEATURE_CHECK_LDFLAGS-disassembler-four-args = -lbfd -lopcodes -ldl
++FEATURE_CHECK_LDFLAGS-disassembler-init-styled = -lbfd -lopcodes -ldl
+ 
+ CORE_CFLAGS += -fno-omit-frame-pointer
+ CORE_CFLAGS += -ggdb3
+@@ -818,13 +819,16 @@ else
+   ifeq ($(feature-libbfd-liberty), 1)
+     EXTLIBS += -lbfd -lopcodes -liberty
+     FEATURE_CHECK_LDFLAGS-disassembler-four-args += -liberty -ldl
++    FEATURE_CHECK_LDFLAGS-disassembler-init-styled += -liberty -ldl
+   else
+     ifeq ($(feature-libbfd-liberty-z), 1)
+       EXTLIBS += -lbfd -lopcodes -liberty -lz
+       FEATURE_CHECK_LDFLAGS-disassembler-four-args += -liberty -lz -ldl
++      FEATURE_CHECK_LDFLAGS-disassembler-init-styled += -liberty -lz -ldl
+     endif
+   endif
+   $(call feature_check,disassembler-four-args)
++  $(call feature_check,disassembler-init-styled)
+ endif
+ 
+ ifeq ($(feature-libbfd-buildid), 1)
+@@ -1044,6 +1048,10 @@ ifeq ($(feature-disassembler-four-args), 1)
+     CFLAGS += -DDISASM_FOUR_ARGS_SIGNATURE
+ endif
+ 
++ifeq ($(feature-disassembler-init-styled), 1)
++    CFLAGS += -DDISASM_INIT_STYLED
++endif
++
+ ifeq (${IS_64_BIT}, 1)
+   ifndef NO_PERF_READ_VDSO32
+     $(call feature_check,compile-32)
+diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
+index 82cc396ef516c4..2c6a485c3de5d9 100644
+--- a/tools/perf/util/annotate.c
++++ b/tools/perf/util/annotate.c
+@@ -1676,6 +1676,7 @@ fallback:
+ #define PACKAGE "perf"
+ #include <bfd.h>
+ #include <dis-asm.h>
++#include <tools/dis-asm-compat.h>
+ 
+ static int symbol__disassemble_bpf(struct symbol *sym,
+ 				   struct annotate_args *args)
+@@ -1762,9 +1763,9 @@ static int symbol__disassemble_bpf(struct symbol *sym,
+ 		ret = errno;
+ 		goto out;
+ 	}
+-	init_disassemble_info(&info, s,
+-			      (fprintf_ftype) fprintf);
+-
++	init_disassemble_info_compat(&info, s,
++				     (fprintf_ftype) fprintf,
++				     fprintf_styled);
+ 	info.arch = bfd_get_arch(bfdf);
+ 	info.mach = bfd_get_mach(bfdf);
+ 

From ef5ba54653e2ed5ba595ccd344a83a4ecceb44da Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 14:45:28 -0700
Subject: [PATCH 26/52] libsasl: fix build for libtool 2.4.7

---
 srcpkgs/libsasl/template | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/libsasl/template b/srcpkgs/libsasl/template
index a8817042f843..a2993b39f4a1 100644
--- a/srcpkgs/libsasl/template
+++ b/srcpkgs/libsasl/template
@@ -19,6 +19,7 @@ distfiles="https://github.com/cyrusimap/cyrus-sasl/releases/download/cyrus-sasl-
 checksum=26866b1549b00ffd020f188a43c258017fa1c382b3ddadd8201536f72efb05d5
 
 pre_configure() {
+	rm -f m4/ltversion.m4
 	autoreconf -fi
 }
 

From db096c43f8f2b4fbd8293492625be596871dfa28 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:08 -0700
Subject: [PATCH 27/52] subversion: fix build for libtool 2.4.7

---
 srcpkgs/subversion/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion/template b/srcpkgs/subversion/template
index 8ad178264942..3f1c9e254e61 100644
--- a/srcpkgs/subversion/template
+++ b/srcpkgs/subversion/template
@@ -57,7 +57,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From fddca38206e941a73be407d662e0bb4bd8573a02 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:38 -0700
Subject: [PATCH 28/52] subversion-kwallet-auth: fix build for libtool 2.4.7

---
 srcpkgs/subversion-kwallet-auth/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion-kwallet-auth/template b/srcpkgs/subversion-kwallet-auth/template
index 12210f250d51..b4d8621456ea 100644
--- a/srcpkgs/subversion-kwallet-auth/template
+++ b/srcpkgs/subversion-kwallet-auth/template
@@ -59,7 +59,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From 7f8b8ddf9df024b4785d5e784eab728090b8d8a6 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 20:07:32 -0700
Subject: [PATCH 29/52] gpgme: update to 1.18.0.

---
 common/shlibs          | 2 +-
 srcpkgs/gpgme/template | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 52220e69706d..98017bdd5e3d 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -723,7 +723,7 @@ libdconf.so.1 dconf-0.13.90_1
 libassuan.so.0 libassuan-2.0.1_1
 libgpgme.so.11 libgpgme-1.12.0_2
 libgpgmepp.so.6 gpgmepp-1.7.0_3
-libqgpgme.so.7 gpgmeqt-1.7.0_3
+libqgpgme.so.15 gpgmeqt-1.18.0_1
 libgarcon-1.so.0 garcon-0.1.12_1
 libgarcon-gtk2-1.so.0 garcon-0.4.0_1
 libgarcon-gtk3-1.so.0 garcon-0.6.1_1
diff --git a/srcpkgs/gpgme/template b/srcpkgs/gpgme/template
index 8633075a8404..b1cfd5f78657 100644
--- a/srcpkgs/gpgme/template
+++ b/srcpkgs/gpgme/template
@@ -1,7 +1,7 @@
 # Template file for 'gpgme'
 pkgname=gpgme
-version=1.15.1
-revision=2
+version=1.18.0
+revision=1
 build_style=gnu-configure
 configure_args="--enable-fd-passing
  --with-libgpg-error-prefix=$XBPS_CROSS_BASE/usr
@@ -14,7 +14,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.gnupg.org/software/gpgme/index.html"
 distfiles="https://www.gnupg.org/ftp/gcrypt/gpgme/gpgme-${version}.tar.bz2"
-checksum=eebc3c1b27f1c8979896ff361ba9bb4778b508b2496c2fc10e3775a40b1de1ad
+checksum=361d4eae47ce925dba0ea569af40e7b52c645c4ae2e65e5621bf1b6cdd8b0e9e
 
 if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
 	configure_args+=" ac_cv_sys_file_offset_bits=no"

From 9a7b76181575c364d2b845d814878746960f7121 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 30/52] cross-aarch64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..bd6b23f9fb6a 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From bd6c2e1803597da91496b12296c9f0d294f9c395 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 31/52] cross-aarch64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..427ad2c1e9cd 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 1e2a0e6e199ac75aacd2cd1cc6f9ce7874e38ae8 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 32/52] cross-arm-linux-gnueabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..2510ee26e789 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From f1bb6a045fbf2da8a3ff323d2cd17482843b50fb Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 33/52] cross-arm-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..bd8b16e1b4c1 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 1fd6532d38d2b7e4ab5fa891674c5d38c2f373c6 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 34/52] cross-arm-linux-musleabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..dacfd2655216 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 59d98e7e8c784f2061aa9df9ae3f9f07b641befb Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 35/52] cross-arm-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..9ddd32a9f20d 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 5f57ba09604533b331f11305aa83090d51cdc239 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 36/52] cross-armv7l-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..9fb00f18be3b 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From eb70a434285446abb8982f1d42fb227754f0ef04 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 37/52] cross-armv7l-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..2c72e75ddfe3 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From bcd291d7b5d4d9f4e1e05cfb0a3852b022e707cf Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 38/52] cross-i686-pc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..4dc17df648b5 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From bbe76acaba48dfc41977f679db20b354bec5f739 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 39/52] cross-mips-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..6009e5c79eb2 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 520ada615396ad6bd9bd7ef266f9f70ca132c58a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 40/52] cross-mips-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..080164df193d 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="hipperson0 <hipperson0@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From b2eafdb071a02d6d570e1902fe4f92a082e05144 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 41/52] cross-mipsel-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..c8f90cfa43cc 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_musl_version=1.1.24
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 6c6def86794d0a26af6afc8d35b23a9cdafbb7c3 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 42/52] cross-mipsel-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..931345d2de15 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_musl_version=1.1.24
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 7bad228e5f345401f62423a6dd3f6600b8c881e8 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 43/52] cross-powerpc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..31e57b4e52b2 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 701d1ea655431e4345b73edbaa202bb212484ff3 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 44/52] cross-powerpc-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..a2d1edcf1ffd 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 24664448cc073bc36f45f6082cb7f1d74bd8e4f9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 45/52] cross-powerpc64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..1a4cbed61e76 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 4e5eda817177fdd07e0d02503f3f04bae49f7479 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 46/52] cross-powerpc64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 1ebd0fb2048d..ade42018af05 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From e8e04bd85fd48280179b5678205484ba7bf8f8e5 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 47/52] cross-powerpc64le-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 733f5851da5c..dd1ad383a21e 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 76cb0343b7e2d0eecdc8c0eaaaee9823d58ead2f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 48/52] cross-powerpc64le-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index 76a70aa1d6db..5887f845f932 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 1c188db24edb406bc1b78cae67e6b297111d7251 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 49/52] cross-powerpcle-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 347b8fcf4f55..06530e0d609b 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From c8035959d283e40eb877034ed00273b430af8748 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:19 -0700
Subject: [PATCH 50/52] cross-powerpcle-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index ec9324ddaa99..e68c3962b49c 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 7368bdc2bcd4c664dbafa2a7f6cdb2f962b958fd Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:19 -0700
Subject: [PATCH 51/52] cross-x86_64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 0078fbe7224b..7da85c14b62d 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From daf0610c3c34aa6e5658040bb247482b2ef07293 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:19 -0700
Subject: [PATCH 52/52] cross-x86_64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..2811de0d3c2e 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (49 preceding siblings ...)
  2022-08-24 23:58 ` oreo639
@ 2022-08-25  0:00 ` oreo639
  2022-08-25  2:33 ` oreo639
                   ` (213 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-08-25  0:00 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5538 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.2.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.2.0

This PR depends on: https://github.com/void-linux/void-packages/pull/32330

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

Also, keep in mind that the libgo musl patch here will need to be updated once musl is updated:
https://github.com/void-linux/void-packages/pull/34902/files#diff-1f42a95b93c9550178ff1fbccbef2f47a72711df15c24c9472e2550076978129R163-R176

This is the updated patch for reference:
https://github.com/alpinelinux/aports/blob/8acb21b8ee881e7ab1c812d9a66a17d2501b8730/main/gcc/0049-libgo-adjust-name-of-union-in-sigevent-struct.patch

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/38817
- [x] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [ ] llvm https://github.com/void-linux/void-packages/pull/38694
- [ ] m4 https://github.com/void-linux/void-packages/pull/33730
- [ ] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [ ] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [ ] libvirt https://github.com/void-linux/void-packages/pull/38842
- [ ] syslinux https://github.com/void-linux/void-packages/pull/38876
- [ ] efivar https://github.com/void-linux/void-packages/pull/38874

Known packages that needed to be fixed/updated for gcc12:
- [ ] linux5.18 (in this PR)
- [ ] openssh https://github.com/void-linux/void-packages/pull/38849
- [ ] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [ ] doxygen https://github.com/void-linux/void-packages/pull/38846
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/38817
- [ ] libproxy https://github.com/void-linux/void-packages/pull/38818
- [ ] exempi https://github.com/void-linux/void-packages/pull/38820
- [ ] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [ ] gpgme https://github.com/void-linux/void-packages/pull/38825
- [ ] libunique1 https://github.com/void-linux/void-packages/pull/38848 or https://github.com/void-linux/void-packages/pull/38873
- [ ] libwpd https://github.com/void-linux/void-packages/pull/38878

Needs to be fixed/updated for binutils:
- [ ] grub https://github.com/void-linux/void-packages/pull/38875
- [ ] linux-tools https://github.com/void-linux/void-packages/pull/38877

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [x] kde
- [x] lxde
- [x] lxqt

You can test the ISOs here:
https://drive.google.com/drive/folders/1ix92CYSLUP-KWjLxltdgG4e8Nu2JCY5n?usp=sharing

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 168752 bytes --]

From aa03fc3f96e66515966dba22223482d31e84ba9a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 01/52] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 15 +++--
 3 files changed, 28 insertions(+), 113 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..0578665c1a30 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkg-config"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -44,6 +45,12 @@ do_configure() {
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	# gprofng currently only supports x86 and aarch64 glibc.
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64|i386|aarch64) conf+=" --enable-gprofng" ;;
+		*) conf+=" --disable-gprofng" ;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"

From accc2d8e9f3b2e2e0739c3d006916684f41757f3 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 02/52] gcc: update to 12.2.0.

---
 common/shlibs                                 | 10 +--
 srcpkgs/gcc/files/gccgo-musl.patch            | 74 ++++---------------
 srcpkgs/gcc/files/libgnarl-musl.patch         | 18 ++---
 srcpkgs/gcc/files/libssp-musl.patch           | 10 +--
 srcpkgs/gcc/patches/libffi_gnulinux.patch     | 11 ---
 .../gcc/patches/libgcc-ibm128-no-tag.patch    | 10 ++-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |  2 +-
 srcpkgs/gcc/template                          | 25 +++----
 8 files changed, 52 insertions(+), 108 deletions(-)
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index f829ee12e80f..bde5320461ce 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.2.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.34 perl-5.34.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -848,8 +848,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.2.0_1
+libgnat-12.so libada-12.2.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1700,8 +1700,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.2.0_1
+libasan.so.8 libsanitizer-12.2.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..632ef951097b 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,17 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ a/libgo/go/runtime/os_linux.go
+@@ -363,9 +363,9 @@
+ 
+ 	var timerid int32
+ 	var sevp _sigevent
+-	sevp.sigev_notify = _SIGEV_THREAD_ID
++	sevp.sigev_notify = 4
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.sigev_notify_function))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..446741390d45 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,15 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
+version=12.2.0
+revision=1
 _patchver="${version%pre*}"
 _minorver="${_patchver%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 wrksrc=gcc-${version/pre/_pre}
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +19,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -396,7 +393,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}

From 7f05bdc9b4c258904b9ce48d6a361cafab566e82 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 03/52] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      |  6 ++--
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..08e35d466a44 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From abf41dbca75c8ff9253413e7dc851766ed3ab8e9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 04/52] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 1a4e1ca3d594..b04268908c2e 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="q66 <daniel@octaforge.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From 4269155fd1cffd1eaf1c356089bc49796f00c17a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 05/52] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 3 files changed, 55 insertions(+), 353 deletions(-)
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index bde5320461ce..52220e69706d 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From d2b9379a6ab9f82a3db1b7d4a1bd878e376c9d3f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 21:01:43 -0700
Subject: [PATCH 06/52] gcc-multilib: update to 12.2.0.

---
 srcpkgs/gcc-multilib/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index fcd25755aa75..1a26da26a991 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,16 +3,16 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _majorver="${version%.*}"
-wrksrc=gcc-${version/pre/_pre}
+wrksrc=gcc-${version}
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel

From 5b515e621ef841f3553765fb0c2831d673466833 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 16:22:03 -0700
Subject: [PATCH 07/52] llvm12: fix build for glibc 2.36

---
 .../compiler-rt-sanitizer-glibc-2.36.patch    | 59 +++++++++++++++++++
 1 file changed, 59 insertions(+)
 create mode 100644 srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch

diff --git a/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch b/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch
new file mode 100644
index 000000000000..e5f24dab8935
--- /dev/null
+++ b/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch
@@ -0,0 +1,59 @@
+From 9cf13067cb5088626ba7ee1ec4c42ec59c7995a0 Mon Sep 17 00:00:00 2001
+From: Fangrui Song <i@maskray.me>
+Date: Mon, 11 Jul 2022 12:53:34 -0700
+Subject: [PATCH] [sanitizer] Remove #include <linux/fs.h> to resolve
+ fsconfig_command/mount_attr conflict with glibc 2.36
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+It is generally not a good idea to mix usage of glibc headers and Linux UAPI
+headers (https://sourceware.org/glibc/wiki/Synchronizing_Headers). In glibc
+since 7eae6a91e9b1670330c9f15730082c91c0b1d570 (milestone: 2.36), sys/mount.h
+defines `fsconfig_command` which conflicts with linux/mount.h:
+
+    .../usr/include/linux/mount.h:95:6: error: redeclaration of ‘enum fsconfig_command’
+
+Remove #include <linux/fs.h> which pulls in linux/mount.h. Expand its 4 macros manually.
+Android sys/mount.h doesn't define BLKBSZGET and it still needs linux/fs.h.
+In the long term we should move Linux specific definitions to sanitizer_platform_limits_linux.cpp
+but this commit is easy to cherry pick into older compiler-rt releases.
+
+Fix https://github.com/llvm/llvm-project/issues/56421
+
+Reviewed By: #sanitizers, vitalybuka, zatrazz
+
+Differential Revision: https://reviews.llvm.org/D129471
+---
+ .../sanitizer_platform_limits_posix.cpp                | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+index 4bd425435d56d..3a94b260686f1 100644
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -73,7 +73,9 @@
+ #include <sys/vt.h>
+ #include <linux/cdrom.h>
+ #include <linux/fd.h>
++#if SANITIZER_ANDROID
+ #include <linux/fs.h>
++#endif
+ #include <linux/hdreg.h>
+ #include <linux/input.h>
+ #include <linux/ioctl.h>
+@@ -876,10 +878,10 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
+   unsigned IOCTL_EVIOCGPROP = IOCTL_NOT_PRESENT;
+   unsigned IOCTL_EVIOCSKEYCODE_V2 = IOCTL_NOT_PRESENT;
+ #endif
+-  unsigned IOCTL_FS_IOC_GETFLAGS = FS_IOC_GETFLAGS;
+-  unsigned IOCTL_FS_IOC_GETVERSION = FS_IOC_GETVERSION;
+-  unsigned IOCTL_FS_IOC_SETFLAGS = FS_IOC_SETFLAGS;
+-  unsigned IOCTL_FS_IOC_SETVERSION = FS_IOC_SETVERSION;
++  unsigned IOCTL_FS_IOC_GETFLAGS = _IOR('f', 1, long);
++  unsigned IOCTL_FS_IOC_GETVERSION = _IOR('v', 1, long);
++  unsigned IOCTL_FS_IOC_SETFLAGS = _IOW('f', 2, long);
++  unsigned IOCTL_FS_IOC_SETVERSION = _IOW('v', 2, long);
+   unsigned IOCTL_GIO_CMAP = GIO_CMAP;
+   unsigned IOCTL_GIO_FONT = GIO_FONT;
+   unsigned IOCTL_GIO_UNIMAP = GIO_UNIMAP;

From 7022b0e6bf053cac07a0e436fda5c964d3b47883 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 17:21:40 -0700
Subject: [PATCH 08/52] m4: update to 1.4.19.

---
 srcpkgs/m4/patches/fix-glibc-2.27.patch | 167 ------------------------
 srcpkgs/m4/template                     |  12 +-
 2 files changed, 6 insertions(+), 173 deletions(-)
 delete mode 100644 srcpkgs/m4/patches/fix-glibc-2.27.patch

diff --git a/srcpkgs/m4/patches/fix-glibc-2.27.patch b/srcpkgs/m4/patches/fix-glibc-2.27.patch
deleted file mode 100644
index 59d33cff164d..000000000000
--- a/srcpkgs/m4/patches/fix-glibc-2.27.patch
+++ /dev/null
@@ -1,167 +0,0 @@
-From 4af4a4a71827c0bc5e0ec67af23edef4f15cee8e Mon Sep 17 00:00:00 2001
-From: Paul Eggert <eggert@cs.ucla.edu>
-Date: Mon, 5 Mar 2018 10:56:29 -0800
-Subject: [PATCH] fflush: adjust to glibc 2.28 libio.h removal
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Problem reported by Daniel P. Berrangé in:
-https://lists.gnu.org/r/bug-gnulib/2018-03/msg00000.html
-* lib/fbufmode.c (fbufmode):
-* lib/fflush.c (clear_ungetc_buffer_preserving_position)
-(disable_seek_optimization, rpl_fflush):
-* lib/fpending.c (__fpending):
-* lib/fpurge.c (fpurge):
-* lib/freadable.c (freadable):
-* lib/freadahead.c (freadahead):
-* lib/freading.c (freading):
-* lib/freadptr.c (freadptr):
-* lib/freadseek.c (freadptrinc):
-* lib/fseeko.c (fseeko):
-* lib/fseterr.c (fseterr):
-* lib/fwritable.c (fwritable):
-* lib/fwriting.c (fwriting):
-Check _IO_EOF_SEEN instead of _IO_ftrylockfile.
-* lib/stdio-impl.h (_IO_IN_BACKUP) [_IO_EOF_SEEN]:
-Define if not already defined.
-
-[yann.morin.1998@free.fr: partially backport from upstream gnulib]
-Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
-
----
- lib/fflush.c     |  6 +++---
- lib/fpending.c   |  2 +-
- lib/fpurge.c     |  2 +-
- lib/freadahead.c |  2 +-
- lib/freading.c   |  2 +-
- lib/fseeko.c     |  4 ++--
- lib/stdio-impl.h |  6 ++++++
- 7 files changed, 15 insertions(+), 9 deletions(-)
-
-diff --git a/lib/fflush.c b/build-aux/gnulib/lib/fflush.c
-index 983ade0ff..a6edfa105 100644
---- a/lib/fflush.c
-+++ b/lib/fflush.c
-@@ -33,7 +33,7 @@
- #undef fflush
- 
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- 
- /* Clear the stream's ungetc buffer, preserving the value of ftello (fp).  */
- static void
-@@ -72,7 +72,7 @@ clear_ungetc_buffer (FILE *fp)
- 
- #endif
- 
--#if ! (defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
-+#if ! (defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
- 
- # if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT
- /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
-@@ -148,7 +148,7 @@ rpl_fflush (FILE *stream)
-   if (stream == NULL || ! freading (stream))
-     return fflush (stream);
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- 
-   clear_ungetc_buffer_preserving_position (stream);
- 
-diff --git a/lib/fpending.c b/build-aux/gnulib/lib/fpending.c
-index c84e3a5b4..789f50e4e 100644
---- a/lib/fpending.c
-+++ b/lib/fpending.c
-@@ -32,7 +32,7 @@ __fpending (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   return fp->_IO_write_ptr - fp->_IO_write_base;
- #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
-   /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
-diff --git a/lib/fpurge.c b/build-aux/gnulib/lib/fpurge.c
-index b1d417c7a..3aedcc373 100644
---- a/lib/fpurge.c
-+++ b/lib/fpurge.c
-@@ -62,7 +62,7 @@ fpurge (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   fp->_IO_read_end = fp->_IO_read_ptr;
-   fp->_IO_write_ptr = fp->_IO_write_base;
-   /* Avoid memory leak when there is an active ungetc buffer.  */
-diff --git a/lib/freadahead.c b/build-aux/gnulib/lib/freadahead.c
-index c2ecb5b28..23ec76ee5 100644
---- a/lib/freadahead.c
-+++ b/lib/freadahead.c
-@@ -30,7 +30,7 @@ extern size_t __sreadahead (FILE *);
- size_t
- freadahead (FILE *fp)
- {
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   if (fp->_IO_write_ptr > fp->_IO_write_base)
-     return 0;
-   return (fp->_IO_read_end - fp->_IO_read_ptr)
-diff --git a/lib/freading.c b/build-aux/gnulib/lib/freading.c
-index 73c28acdd..c24d0c88a 100644
---- a/lib/freading.c
-+++ b/lib/freading.c
-@@ -31,7 +31,7 @@ freading (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   return ((fp->_flags & _IO_NO_WRITES) != 0
-           || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0
-               && fp->_IO_read_base != NULL));
-diff --git a/lib/fseeko.c b/build-aux/gnulib/lib/fseeko.c
-index 0101ab55f..193f4e8ce 100644
---- a/lib/fseeko.c
-+++ b/lib/fseeko.c
-@@ -47,7 +47,7 @@ fseeko (FILE *fp, off_t offset, int whence)
- #endif
- 
-   /* These tests are based on fpurge.c.  */
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   if (fp->_IO_read_end == fp->_IO_read_ptr
-       && fp->_IO_write_ptr == fp->_IO_write_base
-       && fp->_IO_save_base == NULL)
-@@ -123,7 +123,7 @@ fseeko (FILE *fp, off_t offset, int whence)
-           return -1;
-         }
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-       fp->_flags &= ~_IO_EOF_SEEN;
-       fp->_offset = pos;
- #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
-diff --git a/lib/stdio-impl.h b/build-aux/gnulib/lib/stdio-impl.h
-index 78d896e9f..05c5752a2 100644
---- a/lib/stdio-impl.h
-+++ b/lib/stdio-impl.h
-@@ -18,6 +18,12 @@
-    the same implementation of stdio extension API, except that some fields
-    have different naming conventions, or their access requires some casts.  */
- 
-+/* Glibc 2.28 made _IO_IN_BACKUP private.  For now, work around this
-+   problem by defining it ourselves.  FIXME: Do not rely on glibc
-+   internals.  */
-+#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN
-+# define _IO_IN_BACKUP 0x100
-+#endif
- 
- /* BSD stdio derived implementations.  */
- 
--- 
-2.14.1
-
-
diff --git a/srcpkgs/m4/template b/srcpkgs/m4/template
index 78f3dae6184a..762593d883bd 100644
--- a/srcpkgs/m4/template
+++ b/srcpkgs/m4/template
@@ -1,17 +1,17 @@
 # Template file for 'm4'
 pkgname=m4
-version=1.4.18
-revision=2
+version=1.4.19
+revision=1
 bootstrap=yes
-replaces="chroot-m4>=0"
 build_style=gnu-configure
 configure_args="--enable-changeword --enable-threads"
 short_desc="GNU version of UNIX m4 macro language processor"
-homepage="https://www.gnu.org/software/m4/"
-license="GPL-3.0-or-later"
 maintainer="Enno Boland <gottox@voidlinux.org>"
+license="GPL-3.0-or-later"
+homepage="https://www.gnu.org/software/m4/"
 distfiles="${GNU_SITE}/${pkgname}/${pkgname}-${version}.tar.xz"
-checksum=f2c1e86ca0a404ff281631bdc8377638992744b175afb806e25871a24a934e07
+checksum=63aede5c6d33b6d9b13511cd0be2cac046f2e70fd0a07aa9573a04a82783af96
+replaces="chroot-m4>=0"
 
 if [ "$XBPS_TARGET_LIBC" = musl ]; then
 	export ac_cv_lib_error_at_line=no

From 15e9bae306d4ac87561f856f2ca81d01bbd61d90 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 22:57:59 -0700
Subject: [PATCH 09/52] btrfs-progs: update to 5.19.

---
 srcpkgs/btrfs-progs/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/btrfs-progs/template b/srcpkgs/btrfs-progs/template
index f6c53d8587e1..292d5110106b 100644
--- a/srcpkgs/btrfs-progs/template
+++ b/srcpkgs/btrfs-progs/template
@@ -1,6 +1,6 @@
 # Template file for 'btrfs-progs'
 pkgname=btrfs-progs
-version=5.18.1
+version=5.19
 revision=1
 wrksrc="${pkgname}-v${version}"
 build_style=gnu-configure
@@ -16,7 +16,7 @@ license="GPL-2.0-only, LGPL-2.1-or-later"
 homepage="https://btrfs.wiki.kernel.org/index.php/Main_Page"
 changelog="https://raw.githubusercontent.com/kdave/btrfs-progs/master/CHANGES"
 distfiles="${KERNEL_SITE}/kernel/people/kdave/${pkgname}/${pkgname}-v${version}.tar.xz"
-checksum=6e98a75ccff52e9354daa1ad284c614c490f844273a2fa524cbac9eb841c7255
+checksum=1fbcf06e4b2f80e7a127fd687ed4625a5b74fa674fe212c836ff70e0edfcccf9
 # Most of the tests depend on `mount` and `fallocate` commands, which are not
 # presented in chroot-util-linux
 make_check=no

From 82b9e00c2f7ef97e43c915abd13b5417647c3d1e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 19:39:23 -0700
Subject: [PATCH 10/52] syslinux: fix build for glibc 2.36

---
 .../patches/fix-build-with-glibc-2.36.patch   | 30 +++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 srcpkgs/syslinux/patches/fix-build-with-glibc-2.36.patch

diff --git a/srcpkgs/syslinux/patches/fix-build-with-glibc-2.36.patch b/srcpkgs/syslinux/patches/fix-build-with-glibc-2.36.patch
new file mode 100644
index 000000000000..1303be56c127
--- /dev/null
+++ b/srcpkgs/syslinux/patches/fix-build-with-glibc-2.36.patch
@@ -0,0 +1,30 @@
+--- a/linux/syslinux.c
++++ b/linux/syslinux.c
+@@ -45,7 +45,6 @@
+ #include <sys/stat.h>
+ #include <sys/types.h>
+ #include <sys/wait.h>
+-#include <sys/mount.h>
+ 
+ #include "linuxioctl.h"
+ 
+--- a/libinstaller/syslxcom.c
++++ b/libinstaller/syslxcom.c
+@@ -28,7 +28,6 @@
+ #include <errno.h>
+ #include <sys/stat.h>
+ #include <sys/types.h>
+-#include <sys/mount.h>
+ #include <sys/vfs.h>
+ 
+ #include "linuxioctl.h"
+--- a/extlinux/main.c
++++ b/extlinux/main.c
+@@ -40,7 +40,6 @@
+ #include <sys/stat.h>
+ #include <sys/sysmacros.h>
+ #include <sys/types.h>
+-#include <sys/mount.h>
+ #include <sys/vfs.h>
+ 
+ #include "linuxioctl.h"

From 8f87d283549cb0a60a677f828178519867b295d0 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 14 Aug 2022 19:29:36 -0700
Subject: [PATCH 11/52] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove -no-pie from build. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..0994617fac96 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -60,6 +60,7 @@ _void_cross_build_binutils() {
 		--disable-multilib \
 		--disable-werror \
 		--disable-gold \
+		--disable-gprofng \
 		--enable-relro \
 		--enable-plugins \
 		--enable-64-bit-bfd \
@@ -132,6 +133,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -460,6 +462,14 @@ do_build() {
 	local binutils_ver linux_ver gcc_ver libc_ver libucontext_ver
 	local tgt=${sourcepkg/cross-}
 
+	export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}"
+	export CXXFLAGS="${CXXFLAGS/-D_FORTIFY_SOURCE=2/}"
+
+	# Disable explicit -fno-PIE, gcc/binutils/libc will figure this out itself.
+	export CFLAGS="${CFLAGS//-fno-PIE/}"
+	export CXXFLAGS="${CXXFLAGS//-fno-PIE/}"
+	export LDFLAGS="${LDFLAGS//-no-pie/}"
+
 	_void_cross_test_ver binutils
 	_void_cross_test_ver linux
 	_void_cross_test_ver gcc

From 591cce11c2fb3862f057664b33000140e8a5043b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:08:52 -0700
Subject: [PATCH 12/52] openssh: suppress werror on gcc12

---
 srcpkgs/openssh/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/openssh/template b/srcpkgs/openssh/template
index 02a2dec35f42..6e8e343a9dca 100644
--- a/srcpkgs/openssh/template
+++ b/srcpkgs/openssh/template
@@ -40,7 +40,7 @@ if [ "$build_option_ldns" -a -z "$build_option_ssl" ]; then
 	broken="option 'ldns' requires option 'ssl'"
 fi
 
-CFLAGS="-Wno-format-truncation -Wno-stringop-truncation"
+CFLAGS="-Wno-format-truncation -Wno-stringop-truncation -Wno-error=maybe-uninitialized"
 
 case $XBPS_TARGET_MACHINE in
 	i686-musl)

From ff36755d6dc7ac723df226cc382f73bd4bfab24f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:09:31 -0700
Subject: [PATCH 13/52] linux5.18: update dotconfigs for gcc12

---
 srcpkgs/linux5.18/files/x86_64-dotconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/linux5.18/files/x86_64-dotconfig b/srcpkgs/linux5.18/files/x86_64-dotconfig
index 4e73a3195d40..ea6204868e23 100644
--- a/srcpkgs/linux5.18/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.18/files/x86_64-dotconfig
@@ -512,6 +512,7 @@ CONFIG_RETHUNK=y
 CONFIG_CPU_UNRET_ENTRY=y
 CONFIG_CPU_IBPB_ENTRY=y
 CONFIG_CPU_IBRS_ENTRY=y
+CONFIG_SLS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10060,8 +10061,11 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
 # Memory initialization
 #
 CONFIG_INIT_STACK_NONE=y
+# CONFIG_INIT_STACK_ALL_PATTERN is not set
+# CONFIG_INIT_STACK_ALL_ZERO is not set
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
+# CONFIG_ZERO_CALL_USED_REGS is not set
 # end of Memory initialization
 # end of Kernel hardening options
 # end of Security options
@@ -10538,6 +10542,7 @@ CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
 # CONFIG_UBSAN is not set
 CONFIG_HAVE_ARCH_KCSAN=y
+# CONFIG_KCSAN is not set
 # end of Generic Kernel Debugging Instruments
 
 #

From b16b8692cd0f02865cd454117b837c29f594c665 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 18:00:42 -0700
Subject: [PATCH 14/52] xf86-video-vmware: fix build on gcc12

---
 ...183b3395333d5d4c73e25c2d011748f15eda.patch | 30 +++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch

diff --git a/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch b/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch
new file mode 100644
index 000000000000..ff839f16e628
--- /dev/null
+++ b/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch
@@ -0,0 +1,30 @@
+From 77b8183b3395333d5d4c73e25c2d011748f15eda Mon Sep 17 00:00:00 2001
+From: Rudi Heitbaum <rudi@heitbaum.com>
+Date: Sun, 8 May 2022 03:00:10 +0000
+Subject: [PATCH] vmwgfx: fix missing array notation
+
+ Fixes error identified by gcc-12.1.0 compiler
+
+make
+  CC       libvmwgfx_la-vmwgfx_tex_video.lo
+vmwgfx_tex_video.c: In function 'stop_video':
+vmwgfx_tex_video.c:240:20: error: the comparison will always evaluate as 'true' for the address of 'yuv' will never be NULL [-Werror=address]
+  240 |                if (priv->yuv[i]) {
+      |                    ^~~~
+---
+ vmwgfx/vmwgfx_tex_video.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/vmwgfx/vmwgfx_tex_video.c b/vmwgfx/vmwgfx_tex_video.c
+index acc2b56..480a5f1 100644
+--- a/vmwgfx/vmwgfx_tex_video.c
++++ b/vmwgfx/vmwgfx_tex_video.c
+@@ -237,7 +237,7 @@ stop_video(ScrnInfoPtr pScrn, pointer data, Bool shutdown)
+ 
+        for (i=0; i<3; ++i) {
+ 	   for (j=0; j<2; ++j) {
+-	       if (priv->yuv[i]) {
++	       if (priv->yuv[j][i]) {
+ 		   xa_surface_destroy(priv->yuv[j][i]);
+ 		   priv->yuv[j][i] = NULL;
+ 	       }

From 499219e2fa5b82e2515d66badeeaeb99ee477e8f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 18:24:37 -0700
Subject: [PATCH 15/52] doxygen: fix build for gcc 12

---
 srcpkgs/doxygen/patches/compat-gcc12.patch | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100644 srcpkgs/doxygen/patches/compat-gcc12.patch

diff --git a/srcpkgs/doxygen/patches/compat-gcc12.patch b/srcpkgs/doxygen/patches/compat-gcc12.patch
new file mode 100644
index 000000000000..666744a1dceb
--- /dev/null
+++ b/srcpkgs/doxygen/patches/compat-gcc12.patch
@@ -0,0 +1,22 @@
+From 5198966c8d5fec89116d025c74934ac03ea511fa Mon Sep 17 00:00:00 2001
+From: Dimitri van Heesch <doxygen@gmail.com>
+Date: Fri, 6 May 2022 09:55:16 +0200
+Subject: [PATCH] issue #9312: Build: cache.h:53:14: error: 'exchange' is not a
+ member of 'std'
+
+---
+ src/cache.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/cache.h b/src/cache.h
+index 0ff3092ed5..e218eb27d2 100644
+--- a/src/cache.h
++++ b/src/cache.h
+@@ -19,6 +19,7 @@
+ #include <list>
+ #include <unordered_map>
+ #include <mutex>
++#include <utility>
+ #include <ctype.h>
+ 
+ /*! Fixed size cache for value type V using keys of type K.

From 61f95854c0ea213b8d927a06ff7e37628eb2039d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 21 Aug 2022 15:12:00 -0700
Subject: [PATCH 16/52] libproxy: update to 0.4.18

---
 srcpkgs/libproxy/template | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/libproxy/template b/srcpkgs/libproxy/template
index d6103007032e..6599dfb69b98 100644
--- a/srcpkgs/libproxy/template
+++ b/srcpkgs/libproxy/template
@@ -1,18 +1,22 @@
 # Template file for 'libproxy'
 pkgname=libproxy
-version=0.4.15
+version=0.4.18
 revision=1
 build_style=cmake
 configure_args="-DWITH_GNOME=0 -DWITH_KDE4=0 -DWITH_MOZJS=0 -DWITH_NM=0
  -DWITH_PERL=0 -DWITH_PYTHON=1 -DWITH_WEBKIT=0"
 hostmakedepends="pkg-config python"
 makedepends="zlib-devel"
-short_desc="A library handling all the details of proxy configuration"
+short_desc="Library handling all the details of proxy configuration"
 maintainer="Orphaned <orphan@voidlinux.org>"
+license="LGPL-2.1-or-later"
 homepage="http://github.com/libproxy/libproxy"
-license="LGPL-2.1"
-distfiles="https://github.com/libproxy/libproxy/archive/${version}.tar.gz>${pkgname}-${version}.tar.gz"
-checksum=18f58b0a0043b6881774187427ead158d310127fc46a1c668ad6d207fb28b4e0
+distfiles="https://github.com/libproxy/libproxy/archive/${version}.tar.gz"
+checksum=0b4a9218d88f6cf9fa25996a3f38329a11f688a9d026141d9d0e966d8fa63837
+
+post_patch() {
+	vsed '/add_test(NAME url-test/d' -i libproxy/test/CMakeLists.txt
+}
 
 libproxy-devel_package() {
 	depends="libproxy>=${version}_${revision}"

From a57260f5e079a9d88f6ea8975bd82bc82e31d905 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 21 Aug 2022 17:05:39 -0700
Subject: [PATCH 17/52] exempi: update to 2.6.2

---
 ...f034705fd2d032c81383eee8208fd4eee0ac.patch | 43 -------------------
 srcpkgs/exempi/template                       |  4 +-
 2 files changed, 2 insertions(+), 45 deletions(-)
 delete mode 100644 srcpkgs/exempi/patches/8ed2f034705fd2d032c81383eee8208fd4eee0ac.patch

diff --git a/srcpkgs/exempi/patches/8ed2f034705fd2d032c81383eee8208fd4eee0ac.patch b/srcpkgs/exempi/patches/8ed2f034705fd2d032c81383eee8208fd4eee0ac.patch
deleted file mode 100644
index 2696793cec09..000000000000
--- a/srcpkgs/exempi/patches/8ed2f034705fd2d032c81383eee8208fd4eee0ac.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From 8ed2f034705fd2d032c81383eee8208fd4eee0ac Mon Sep 17 00:00:00 2001
-From: Victor Rodriguez <victor.rodriguez.bahena@intel.com>
-Date: Sat, 18 Aug 2018 13:54:55 +0000
-Subject: [PATCH] Issue #9 - Fix null-pointer-dereference (CVE-2018-12648)
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-The WEBP::GetLE32 function in
-XMPFiles/source/FormatSupport/WEBP_Support.hpp in Exempi 2.4.5 has a
-NULL pointer dereference.
-
-https://bugs.freedesktop.org/show_bug.cgi?id=106981
-https://gitlab.freedesktop.org/libopenraw/exempi/issues/9
-
-Signed-off-by: Victor Rodriguez <victor.rodriguez.bahena@intel.com>
-Signed-off-by: Hubert Figuière <hub@figuiere.net>
----
- XMPFiles/source/FormatSupport/WEBP_Support.cpp | 8 +++++---
- 1 file changed, 5 insertions(+), 3 deletions(-)
-
-diff --git a/XMPFiles/source/FormatSupport/WEBP_Support.cpp b/XMPFiles/source/FormatSupport/WEBP_Support.cpp
-index ffaf220..4fe705b 100644
---- a/XMPFiles/source/FormatSupport/WEBP_Support.cpp
-+++ b/XMPFiles/source/FormatSupport/WEBP_Support.cpp
-@@ -160,9 +160,11 @@ bool VP8XChunk::xmp()
- }
- void VP8XChunk::xmp(bool hasXMP)
- {
--    XMP_Uns32 flags = GetLE32(&this->data[0]);
--    flags ^= (-hasXMP ^ flags) & (1 << XMP_FLAG_BIT);
--    PutLE32(&this->data[0], flags);
-+    if (&this->data[0] != NULL) {
-+        XMP_Uns32 flags = GetLE32(&this->data[0]);
-+        flags ^= (-hasXMP ^ flags) & (1 << XMP_FLAG_BIT);
-+        PutLE32(&this->data[0], flags);
-+    }
- }
- 
- Container::Container(WEBP_MetaHandler* handler) : Chunk(NULL, handler)
--- 
-2.18.0
-
diff --git a/srcpkgs/exempi/template b/srcpkgs/exempi/template
index 14753617953a..d664f7dc4d80 100644
--- a/srcpkgs/exempi/template
+++ b/srcpkgs/exempi/template
@@ -1,6 +1,6 @@
 # Template file for 'exempi'
 pkgname=exempi
-version=2.5.0
+version=2.6.2
 revision=1
 build_style=gnu-configure
 configure_args="--with-boost=${XBPS_CROSS_BASE}/usr --disable-static --disable-unittest"
@@ -10,7 +10,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="BSD-3-Clause"
 homepage="https://libopenraw.freedesktop.org/wiki/Exempi"
 distfiles="https://libopenraw.freedesktop.org/download/exempi-${version}.tar.bz2"
-checksum=dc82fc24c0540a44a63fa4ad21775d24e00e63f1dedd3e2ae6f7aa27583b711b
+checksum=4d17d4c93df2a95da3e3172c45b7a5bf317dd31dafd1c7a340169728c7089d1d
 
 post_install() {
 	vlicense COPYING

From 228451cd8bd478e5069e7af17b48cd19b770b234 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 21 Aug 2022 21:36:03 -0700
Subject: [PATCH 18/52] plymouth: update to 22.02.122

---
 srcpkgs/plymouth/patches/fix-glibc-2.36.patch | 30 +++++++++++++++++++
 srcpkgs/plymouth/template                     |  4 +--
 2 files changed, 32 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/plymouth/patches/fix-glibc-2.36.patch

diff --git a/srcpkgs/plymouth/patches/fix-glibc-2.36.patch b/srcpkgs/plymouth/patches/fix-glibc-2.36.patch
new file mode 100644
index 000000000000..2f1e43875cfb
--- /dev/null
+++ b/srcpkgs/plymouth/patches/fix-glibc-2.36.patch
@@ -0,0 +1,30 @@
+From 5f1e43c00039a7fe1fff768b91a05a695fb4a53d Mon Sep 17 00:00:00 2001
+From: Ray Strode <rstrode@redhat.com>
+Date: Wed, 3 Aug 2022 15:23:33 -0400
+Subject: [PATCH] ply-utils: Drop linux/fs.h include
+
+It was needed long ago for a function we no longer even have.
+
+Now it's causing compile errors on Fedora 37 because it's conflicting
+with sys/mount.h.
+
+This commit drops it.
+---
+ src/libply/ply-utils.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/src/libply/ply-utils.c b/src/libply/ply-utils.c
+index c7b165e9..219e2e77 100644
+--- a/src/libply/ply-utils.c
++++ b/src/libply/ply-utils.c
+@@ -46,7 +46,6 @@
+ #include <sys/user.h>
+ #include <sys/wait.h>
+ #include <time.h>
+-#include <linux/fs.h>
+ #include <linux/vt.h>
+ 
+ #include <dlfcn.h>
+-- 
+GitLab
+
diff --git a/srcpkgs/plymouth/template b/srcpkgs/plymouth/template
index 17f801fc5315..442ab58a99cd 100644
--- a/srcpkgs/plymouth/template
+++ b/srcpkgs/plymouth/template
@@ -1,6 +1,6 @@
 # Template file for 'plymouth'
 pkgname=plymouth
-version=0.9.5
+version=22.02.122
 revision=1
 build_style=gnu-configure
 configure_args="--with-system-root-install=no \
@@ -18,7 +18,7 @@ maintainer="William OD <obirik2005@gmail.com>"
 license="GPL-2.0-or-later"
 homepage="https://www.freedesktop.org/wiki/Software/Plymouth/"
 distfiles="${FREEDESKTOP_SITE}/plymouth/releases/$pkgname-$version.tar.xz"
-checksum=ecae257f351d098340542a5bc06de029404c24dcee87e6ebb2abd5ef117fce86
+checksum=100551442221033ce868c447ad6c74d831d209c18ae232b98ae0207e34eadaeb
 
 build_options="gtk3 pango"
 build_options_default="gtk3 pango"

From ccb28f077b9ad4669db777c8b8b78fc549e7803d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 21 Aug 2022 21:37:00 -0700
Subject: [PATCH 19/52] openjdk7-bootstrap: fix build for gcc12

---
 .../files/dist_patches_glibc.txt              |  1 +
 .../files/dist_patches_musl.txt               |  1 +
 .../icedtea-pointer-comparison-gcc12.patch    | 31 +++++++++++++++++++
 3 files changed, 33 insertions(+)
 create mode 100644 srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch

diff --git a/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt b/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt
index c76c56855441..8061756dfc0c 100644
--- a/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt
+++ b/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt
@@ -6,3 +6,4 @@ icedtea-jdk-no-soname.patch
 icedtea-jdk-xattr.patch
 icedtea-jdk-sysctl_h.patch
 icedtea-cpio.patch
+icedtea-pointer-comparison-gcc12.patch
diff --git a/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt b/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt
index 21812517c7c2..8b35d9c46989 100644
--- a/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt
+++ b/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt
@@ -11,3 +11,4 @@ icedtea-jdk-musl.patch
 icedtea-jdk-no-soname.patch
 icedtea-jdk-xattr.patch
 icedtea-cpio.patch
+icedtea-pointer-comparison-gcc12.patch
diff --git a/srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch b/srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch
new file mode 100644
index 000000000000..c809553443e7
--- /dev/null
+++ b/srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch
@@ -0,0 +1,31 @@
+--- openjdk.orig/hotspot/src/share/vm/opto/lcm.cpp
++++ openjdk/hotspot/src/share/vm/opto/lcm.cpp
+@@ -60,7 +60,7 @@
+ // Check whether val is not-null-decoded compressed oop,
+ // i.e. will grab into the base of the heap if it represents NULL.
+ static bool accesses_heap_base_zone(Node *val) {
+-  if (Universe::narrow_oop_base() > 0) { // Implies UseCompressedOops.
++  if (Universe::narrow_oop_base() > (address)0) { // Implies UseCompressedOops.
+     if (val && val->is_Mach()) {
+       if (val->as_Mach()->ideal_Opcode() == Op_DecodeN) {
+         // This assumes all Decodes with TypePtr::NotNull are matched to nodes that
+--- openjdk.orig/hotspot/src/share/vm/runtime/virtualspace.cpp
++++ openjdk/hotspot/src/share/vm/runtime/virtualspace.cpp
+@@ -527,7 +527,7 @@ ReservedHeapSpace::ReservedHeapSpace(siz
+                 (UseCompressedOops && (Universe::narrow_oop_base() != NULL) &&
+                  Universe::narrow_oop_use_implicit_null_checks()) ?
+                   lcm(os::vm_page_size(), alignment) : 0) {
+-  if (base() > 0) {
++  if (base() > (char*)0) {
+     MemTracker::record_virtual_memory_type((address)base(), mtJavaHeap);
+   }
+ 
+@@ -546,7 +546,7 @@ ReservedHeapSpace::ReservedHeapSpace(con
+                 (UseCompressedOops && (Universe::narrow_oop_base() != NULL) &&
+                  Universe::narrow_oop_use_implicit_null_checks()) ?
+                   lcm(os::vm_page_size(), prefix_align) : 0) {
+-  if (base() > 0) {
++  if (base() > (char*)0) {
+     MemTracker::record_virtual_memory_type((address)base(), mtJavaHeap);
+   }
+ 

From 45f434e7dfb1eea998d2a5f5606d7c697149aa83 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 23:30:16 -0700
Subject: [PATCH 20/52] libunique1: relax warnings for gcc12

---
 srcpkgs/libunique1/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/libunique1/template b/srcpkgs/libunique1/template
index f73931b0c72b..c5a0f5c27860 100644
--- a/srcpkgs/libunique1/template
+++ b/srcpkgs/libunique1/template
@@ -15,7 +15,7 @@ homepage="https://wiki.gnome.org/Attic/LibUnique"
 distfiles="${GNOME_SITE}/libunique/1.1/libunique-${version}.tar.bz2"
 checksum=e5c8041cef8e33c55732f06a292381cb345db946cf792a4ae18aa5c66cdd4fbb
 
-CFLAGS="-Wno-deprecated-declarations"
+CFLAGS="-Wno-deprecated-declarations -Wno-incompatible-pointer-types"
 
 # Package build options
 build_options="gir"

From 300607c22b0b19787c07beebd2f231d401a92d50 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:39:52 -0700
Subject: [PATCH 21/52] libvirt: fix build for glibc 2.36

---
 .../patches/lxc-fix-compat-glibc-2.36.patch   | 34 ++++++++++++++++
 .../virfile-fix-compat-glibc-2.36.patch       | 39 +++++++++++++++++++
 2 files changed, 73 insertions(+)
 create mode 100644 srcpkgs/libvirt/patches/lxc-fix-compat-glibc-2.36.patch
 create mode 100644 srcpkgs/libvirt/patches/virfile-fix-compat-glibc-2.36.patch

diff --git a/srcpkgs/libvirt/patches/lxc-fix-compat-glibc-2.36.patch b/srcpkgs/libvirt/patches/lxc-fix-compat-glibc-2.36.patch
new file mode 100644
index 000000000000..d85b57815010
--- /dev/null
+++ b/srcpkgs/libvirt/patches/lxc-fix-compat-glibc-2.36.patch
@@ -0,0 +1,34 @@
+From 9493c9b79dc541ec9e0fd73c6d87bdf8d30aaa90 Mon Sep 17 00:00:00 2001
+From: Cole Robinson <crobinso@redhat.com>
+Date: Mon, 1 Aug 2022 15:20:38 -0400
+Subject: [PATCH] lxc: containter: fix build with glibc 2.36
+
+With glibc 2.36, sys/mount.h and linux/mount.h conflict:
+https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
+
+lxc_container.c imports sys/mount.h and linux/fs.h, which pulls in
+linux/mount.h.
+
+linux/fs.h isn't required here though. glibc sys/mount.h has had
+MS_MOVE since 2.12 in 2010
+
+Reviewed-by: Erik Skultety <eskultet@redhat.com>
+Signed-off-by: Cole Robinson <crobinso@redhat.com>
+---
+ src/lxc/lxc_container.c | 3 ---
+ 1 file changed, 3 deletions(-)
+
+diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
+index b5278831da7..a5401c2186e 100644
+--- a/src/lxc/lxc_container.c
++++ b/src/lxc/lxc_container.c
+@@ -33,9 +33,6 @@
+ /* Yes, we want linux private one, for _syscall2() macro */
+ #include <linux/unistd.h>
+ 
+-/* For MS_MOVE */
+-#include <linux/fs.h>
+-
+ #if WITH_CAPNG
+ # include <cap-ng.h>
+ #endif
diff --git a/srcpkgs/libvirt/patches/virfile-fix-compat-glibc-2.36.patch b/srcpkgs/libvirt/patches/virfile-fix-compat-glibc-2.36.patch
new file mode 100644
index 000000000000..2ef227ea9b54
--- /dev/null
+++ b/srcpkgs/libvirt/patches/virfile-fix-compat-glibc-2.36.patch
@@ -0,0 +1,39 @@
+From c0d9adf220dc0d223330a7bac37b174132d330ba Mon Sep 17 00:00:00 2001
+From: Cole Robinson <crobinso@redhat.com>
+Date: Mon, 1 Aug 2022 15:24:01 -0400
+Subject: [PATCH] virfile: Fix build with glibc 2.36
+
+With glibc 2.36, sys/mount.h and linux/mount.h conflict:
+https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
+
+virfile.c imports sys/mount.h and linux/fs.h, which pulls in
+linux/mount.h.
+
+Manually define the constants we need from linux/fs.h, like was
+done in llvm:
+
+https://reviews.llvm.org/rGb379129c4beb3f26223288627a1291739f33af02
+
+Reviewed-by: Erik Skultety <eskultet@redhat.com>
+Signed-off-by: Cole Robinson <crobinso@redhat.com>
+---
+ src/util/virfile.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/src/util/virfile.c b/src/util/virfile.c
+index 99da058db3b..ce541b8946b 100644
+--- a/src/util/virfile.c
++++ b/src/util/virfile.c
+@@ -71,7 +71,11 @@
+ # endif
+ # include <sys/ioctl.h>
+ # include <linux/cdrom.h>
+-# include <linux/fs.h>
++/* These come from linux/fs.h, but that header conflicts with
++ * sys/mount.h on glibc 2.36+ */
++# define FS_IOC_GETFLAGS _IOR('f', 1, long)
++# define FS_IOC_SETFLAGS _IOW('f', 2, long)
++# define FS_NOCOW_FL 0x00800000
+ #endif
+ 
+ #if WITH_LIBATTR

From 7a8d8f7060c13f6a04e382b6fb60125566049950 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:41:50 -0700
Subject: [PATCH 22/52] efivar: fix build for glibc 2.36

---
 .../patches/fix-compat-glibc-2.36.patch       | 55 +++++++++++++++++++
 1 file changed, 55 insertions(+)
 create mode 100644 srcpkgs/efivar/patches/fix-compat-glibc-2.36.patch

diff --git a/srcpkgs/efivar/patches/fix-compat-glibc-2.36.patch b/srcpkgs/efivar/patches/fix-compat-glibc-2.36.patch
new file mode 100644
index 000000000000..fcc83aef20cf
--- /dev/null
+++ b/srcpkgs/efivar/patches/fix-compat-glibc-2.36.patch
@@ -0,0 +1,55 @@
+From bc65d63ebf8fe6ac8a099ff15ca200986dba1565 Mon Sep 17 00:00:00 2001
+From: Robbie Harwood <rharwood@redhat.com>
+Date: Thu, 28 Jul 2022 16:11:24 -0400
+Subject: [PATCH] Fix glibc 2.36 build (mount.h conflicts)
+
+glibc has decided that sys/mount.h and linux/mount.h are no longer
+usable at the same time.  This broke the build, since linux/fs.h itself
+includes linux/mount.h.  For now, fix the build by only including
+sys/mount.h where we need it.
+
+See-also: https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
+Resolves: #227
+Signed-off-by: Robbie Harwood <rharwood@redhat.com>
+---
+ src/gpt.c   | 1 +
+ src/linux.c | 1 +
+ src/util.h  | 1 -
+ 3 files changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/gpt.c b/src/gpt.c
+index 1eda0497..21413c3b 100644
+--- a/src/gpt.c
++++ b/src/gpt.c
+@@ -17,6 +17,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <sys/mount.h>
+ #include <sys/param.h>
+ #include <sys/stat.h>
+ #include <sys/utsname.h>
+diff --git a/src/linux.c b/src/linux.c
+index 47e45ae4..1780816f 100644
+--- a/src/linux.c
++++ b/src/linux.c
+@@ -20,6 +20,7 @@
+ #include <stdbool.h>
+ #include <stdio.h>
+ #include <sys/ioctl.h>
++#include <sys/mount.h>
+ #include <sys/socket.h>
+ #include <sys/sysmacros.h>
+ #include <sys/types.h>
+diff --git a/src/util.h b/src/util.h
+index 3300666f..1e67e447 100644
+--- a/src/util.h
++++ b/src/util.h
+@@ -23,7 +23,6 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <sys/ioctl.h>
+-#include <sys/mount.h>
+ #include <sys/stat.h>
+ #include <sys/types.h>
+ #include <tgmath.h>

From 031c601d617e587a7819b71b03f9a80ea51feba3 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:43:24 -0700
Subject: [PATCH 23/52] libwpd: fix build for gcc12

---
 srcpkgs/libwpd/patches/fix-compat-gcc12.patch | 11 +++++++++++
 1 file changed, 11 insertions(+)
 create mode 100644 srcpkgs/libwpd/patches/fix-compat-gcc12.patch

diff --git a/srcpkgs/libwpd/patches/fix-compat-gcc12.patch b/srcpkgs/libwpd/patches/fix-compat-gcc12.patch
new file mode 100644
index 000000000000..6ebce2463d16
--- /dev/null
+++ b/srcpkgs/libwpd/patches/fix-compat-gcc12.patch
@@ -0,0 +1,11 @@
+diff -rup libwpd-0.10.3.orig/src/lib/WPXTable.h libwpd-0.10.3/src/lib/WPXTable.h
+--- libwpd-0.10.3.orig/src/lib/WPXTable.h	2022-08-23 22:32:45.332593795 -0700
++++ libwpd-0.10.3/src/lib/WPXTable.h	2022-08-23 22:32:59.500651211 -0700
+@@ -37,6 +37,7 @@
+ #define _WPXTABLE_H
+ 
+ #include <vector>
++#include <cstddef>
+ 
+ struct WPXTableCell
+ {

From df612a825fb5fba038dbaee0e95c29260b8a18aa Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:44:07 -0700
Subject: [PATCH 24/52] grub: fix build for binutils 2.36

---
 .../patches/fix-compat-binutils-2.36.patch    | 96 +++++++++++++++++++
 srcpkgs/grub/template                         |  7 +-
 2 files changed, 102 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/grub/patches/fix-compat-binutils-2.36.patch

diff --git a/srcpkgs/grub/patches/fix-compat-binutils-2.36.patch b/srcpkgs/grub/patches/fix-compat-binutils-2.36.patch
new file mode 100644
index 000000000000..d92a91e3253e
--- /dev/null
+++ b/srcpkgs/grub/patches/fix-compat-binutils-2.36.patch
@@ -0,0 +1,96 @@
+From b98275138bf4fc250a1c362dfd2c8b1cf2421701 Mon Sep 17 00:00:00 2001
+From: Michael Chang <mchang@suse.com>
+Date: Tue, 28 Sep 2021 13:50:47 +0800
+Subject: build: Fix build error with binutils 2.36
+
+The following procedure to build xen/pvgrub is broken.
+
+  git clone https://git.savannah.gnu.org/git/grub.git
+  cd grub
+  ./bootstrap
+  mkdir build-xen
+  cd build-xen
+  ../configure --with-platform=xen
+  make
+
+It fails with the message:
+
+  /usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld:
+  section .note.gnu.property VMA [0000000000400158,0000000000400187]
+  overlaps section .bss VMA [000000000000f000,000000000041e1af]
+
+The most significant factor is that new assembler (GNU as) generates the
+.note.gnu.property section as default. This note section overlaps with
+.bss because it doesn't reposition with -Wl,-Ttext,0 with which the base
+address of .text section is set, rather the address of .note.gnu.property
+is calculated for some reason from 0x400000 where the ELF executable
+defaults to start.
+
+Using -Ttext-segment doesn't help either, though it is said to set the
+address of the first byte of the text segment according to "man ld".
+What it actually does is to override the default 0x400000, aka the image
+base address, to something else. The entire process can be observed in
+the default linker script used by gcc [1]. Therefore we can't expect it
+to achieve the same thing as -Ttext given that the first segment where
+.text resides is offset by SIZEOF_HEADERS plus some sections may be
+preceding it within the first segment. The end result is .text always
+has to start with non-zero address with -Wl,-Ttext-segment,0 if using
+default linker script.
+
+It is also worth mentioning that binutils upstream apparently doesn't
+seem to consider this as a bug [2] and proposed to use -Wl,-Ttext-segment,0
+which is not fruitful as what has been tested by Gentoo [3].
+
+As long as GRUB didn't use ISA information encoded in .note.gnu.property,
+we can safely drop it via -Wa,-mx86-used-note=no assembler option to
+fix the linker error above.
+
+This is considered a better approach than using custom linker script to
+drop the .note.gnu.property section because object file manipulation can
+also be hampered one way or the other in that linker script may not be
+helpful. See also this commit removing the section in the process of objcopy.
+
+  6643507ce build: Fix GRUB i386-pc build with Ubuntu gcc
+
+[1] In /usr/lib64/ldscripts/elf_x86_64.x or use 'gcc -Wl,--verbose ...'
+    PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x400000));
+    . = SEGMENT_START("text-segment", 0x400000) + SIZEOF_HEADERS;
+[2] https://sourceware.org/bugzilla/show_bug.cgi?id=27377
+[3] https://bugs.gentoo.org/787221
+
+Signed-off-by: Michael Chang <mchang@suse.com>
+Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
+---
+ configure.ac | 14 ++++++++++++++
+ 1 file changed, 14 insertions(+)
+
+(limited to 'configure.ac')
+
+diff --git a/configure.ac b/configure.ac
+index eeb5d22..8d1c81a 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -840,6 +840,20 @@ if ( test "x$target_cpu" = xi386 || test "x$target_cpu" = xx86_64 ) && test "x$p
+   TARGET_CFLAGS="$TARGET_CFLAGS -mno-mmx -mno-sse -mno-sse2 -mno-sse3 -mno-3dnow"
+ fi
+ 
++if ( test "x$target_cpu" = xi386 || test "x$target_cpu" = xx86_64 ); then
++  AC_CACHE_CHECK([whether -Wa,-mx86-used-note works], [grub_cv_cc_mx86_used_note], [
++    CFLAGS="$TARGET_CFLAGS -Wa,-mx86-used-note=no -Werror"
++    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
++	[grub_cv_cc_mx86_used_note=yes],
++	[grub_cv_cc_mx86_used_note=no])
++  ])
++
++  if test "x$grub_cv_cc_mx86_used_note" = xyes; then
++    TARGET_CFLAGS="$TARGET_CFLAGS -Wa,-mx86-used-note=no"
++    TARGET_CCASFLAGS="$TARGET_CCASFLAGS -Wa,-mx86-used-note=no"
++  fi
++fi
++
+ # GRUB doesn't use float or doubles at all. Yet some toolchains may decide
+ # that floats are a good fit to run instead of what's written in the code.
+ # Given that floating point unit is disabled (if present to begin with)
+-- 
+cgit v1.1
+
diff --git a/srcpkgs/grub/template b/srcpkgs/grub/template
index b1826c38a884..b4d3b07af620 100644
--- a/srcpkgs/grub/template
+++ b/srcpkgs/grub/template
@@ -2,7 +2,8 @@
 pkgname=grub
 version=2.06
 revision=2
-hostmakedepends="python3 pkg-config flex freetype-devel font-unifont-bdf help2man"
+hostmakedepends="python3 pkg-config flex freetype-devel font-unifont-bdf help2man
+ automake gettext-devel-tools"
 makedepends="libusb-compat-devel ncurses-devel freetype-devel
  liblzma-devel device-mapper-devel fuse-devel"
 depends="os-prober"
@@ -43,6 +44,10 @@ case "$XBPS_TARGET_MACHINE" in
 		;;
 esac
 
+pre_configure() {
+	autoreconf -fi
+}
+
 do_configure() {
 	# workaround for https://savannah.gnu.org/bugs/?60458
 	# some more info: https://www.linuxquestions.org/questions/showthread.php?p=6257712

From c5643c26431695e27217606c00ab29376485fec7 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:45:07 -0700
Subject: [PATCH 25/52] linux-toos: fix build for binutils 2.39

---
 .../patches/binutils-add-compat-check.patch   | 103 ++++++++++++
 .../patches/binutils-disasm-compat.patch      | 102 ++++++++++++
 .../bpf_jit_disasm-binutils-2.39.patch        | 104 ++++++++++++
 .../patches/bpftool-binutils-2.39.patch       | 149 ++++++++++++++++++
 .../patches/perf-binutils-2.39.patch          | 114 ++++++++++++++
 5 files changed, 572 insertions(+)
 create mode 100644 srcpkgs/linux-tools/patches/binutils-add-compat-check.patch
 create mode 100644 srcpkgs/linux-tools/patches/binutils-disasm-compat.patch
 create mode 100644 srcpkgs/linux-tools/patches/bpf_jit_disasm-binutils-2.39.patch
 create mode 100644 srcpkgs/linux-tools/patches/bpftool-binutils-2.39.patch
 create mode 100644 srcpkgs/linux-tools/patches/perf-binutils-2.39.patch

diff --git a/srcpkgs/linux-tools/patches/binutils-add-compat-check.patch b/srcpkgs/linux-tools/patches/binutils-add-compat-check.patch
new file mode 100644
index 000000000000..e4e7ece9635e
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/binutils-add-compat-check.patch
@@ -0,0 +1,103 @@
+From cfd59ca91467056bb2c36907b2fa67b8e1af9952 Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:27 -0700
+Subject: [PATCH] tools build: Add feature test for init_disassemble_info API
+ changes
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation failures for tools/{perf,bpf}, e.g. on debian unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+This commit adds a feature test to detect the new signature.  Subsequent
+commits will use it to fix the build failures.
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Quentin Monnet <quentin@isovalent.com>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-2-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/build/Makefile.feature                        |  1 +
+ tools/build/feature/Makefile                        |  4 ++++
+ tools/build/feature/test-all.c                      |  4 ++++
+ tools/build/feature/test-disassembler-init-styled.c | 13 +++++++++++++
+ 4 files changed, 22 insertions(+)
+ create mode 100644 tools/build/feature/test-disassembler-init-styled.c
+
+diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature
+index 888a0421d43b96..8f6578e4d3249e 100644
+--- a/tools/build/Makefile.feature
++++ b/tools/build/Makefile.feature
+@@ -70,6 +70,7 @@ FEATURE_TESTS_BASIC :=                  \
+         libaio				\
+         libzstd				\
+         disassembler-four-args		\
++        disassembler-init-styled	\
+         file-handle
+ 
+ # FEATURE_TESTS_BASIC + FEATURE_TESTS_EXTRA is the complete list
+diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile
+index 7c2a17e23c30ac..c3059739318a95 100644
+--- a/tools/build/feature/Makefile
++++ b/tools/build/feature/Makefile
+@@ -18,6 +18,7 @@ FILES=                                          \
+          test-libbfd.bin                        \
+          test-libbfd-buildid.bin		\
+          test-disassembler-four-args.bin        \
++         test-disassembler-init-styled.bin	\
+          test-reallocarray.bin			\
+          test-libbfd-liberty.bin                \
+          test-libbfd-liberty-z.bin              \
+@@ -248,6 +249,9 @@ $(OUTPUT)test-libbfd-buildid.bin:
+ $(OUTPUT)test-disassembler-four-args.bin:
+ 	$(BUILD) -DPACKAGE='"perf"' -lbfd -lopcodes
+ 
++$(OUTPUT)test-disassembler-init-styled.bin:
++	$(BUILD) -DPACKAGE='"perf"' -lbfd -lopcodes
++
+ $(OUTPUT)test-reallocarray.bin:
+ 	$(BUILD)
+ 
+diff --git a/tools/build/feature/test-all.c b/tools/build/feature/test-all.c
+index 5ffafb967b6e49..957c02c7b163b5 100644
+--- a/tools/build/feature/test-all.c
++++ b/tools/build/feature/test-all.c
+@@ -166,6 +166,10 @@
+ # include "test-disassembler-four-args.c"
+ #undef main
+ 
++#define main main_test_disassembler_init_styled
++# include "test-disassembler-init-styled.c"
++#undef main
++
+ #define main main_test_libzstd
+ # include "test-libzstd.c"
+ #undef main
+diff --git a/tools/build/feature/test-disassembler-init-styled.c b/tools/build/feature/test-disassembler-init-styled.c
+new file mode 100644
+index 00000000000000..f1ce0ec3bee9d3
+--- /dev/null
++++ b/tools/build/feature/test-disassembler-init-styled.c
+@@ -0,0 +1,13 @@
++// SPDX-License-Identifier: GPL-2.0
++#include <stdio.h>
++#include <dis-asm.h>
++
++int main(void)
++{
++	struct disassemble_info info;
++
++	init_disassemble_info(&info, stdout,
++			      NULL, NULL);
++
++	return 0;
++}
diff --git a/srcpkgs/linux-tools/patches/binutils-disasm-compat.patch b/srcpkgs/linux-tools/patches/binutils-disasm-compat.patch
new file mode 100644
index 000000000000..1a6cc0e6d97c
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/binutils-disasm-compat.patch
@@ -0,0 +1,102 @@
+From a45b3d6926231c3d024ea0de4f7bd967f83709ee Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:29 -0700
+Subject: tools include: add dis-asm-compat.h to handle version differences
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation failures for tools/{perf,bpf}, e.g. on debian unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+This commit introduces a wrapper for init_disassemble_info(), to avoid
+spreading #ifdef DISASM_INIT_STYLED to a bunch of places. Subsequent
+commits will use it to fix the build failures.
+
+It likely is worth adding a wrapper for disassember(), to avoid the already
+existing DISASM_FOUR_ARGS_SIGNATURE ifdefery.
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Signed-off-by: Ben Hutchings <benh@debian.org>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Quentin Monnet <quentin@isovalent.com>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-4-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/include/tools/dis-asm-compat.h | 55 ++++++++++++++++++++++++++++++++++++
+ 1 file changed, 55 insertions(+)
+ create mode 100644 tools/include/tools/dis-asm-compat.h
+
+(limited to 'tools/include/tools/dis-asm-compat.h')
+
+diff --git a/tools/include/tools/dis-asm-compat.h b/tools/include/tools/dis-asm-compat.h
+new file mode 100644
+index 0000000000000..70f331e23ed3d
+--- /dev/null
++++ b/tools/include/tools/dis-asm-compat.h
+@@ -0,0 +1,55 @@
++/* SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause */
++#ifndef _TOOLS_DIS_ASM_COMPAT_H
++#define _TOOLS_DIS_ASM_COMPAT_H
++
++#include <stdio.h>
++#include <dis-asm.h>
++
++/* define types for older binutils version, to centralize ifdef'ery a bit */
++#ifndef DISASM_INIT_STYLED
++enum disassembler_style {DISASSEMBLER_STYLE_NOT_EMPTY};
++typedef int (*fprintf_styled_ftype) (void *, enum disassembler_style, const char*, ...);
++#endif
++
++/*
++ * Trivial fprintf wrapper to be used as the fprintf_styled_func argument to
++ * init_disassemble_info_compat() when normal fprintf suffices.
++ */
++static inline int fprintf_styled(void *out,
++				 enum disassembler_style style,
++				 const char *fmt, ...)
++{
++	va_list args;
++	int r;
++
++	(void)style;
++
++	va_start(args, fmt);
++	r = vfprintf(out, fmt, args);
++	va_end(args);
++
++	return r;
++}
++
++/*
++ * Wrapper for init_disassemble_info() that hides version
++ * differences. Depending on binutils version and architecture either
++ * fprintf_func or fprintf_styled_func will be called.
++ */
++static inline void init_disassemble_info_compat(struct disassemble_info *info,
++						void *stream,
++						fprintf_ftype unstyled_func,
++						fprintf_styled_ftype styled_func)
++{
++#ifdef DISASM_INIT_STYLED
++	init_disassemble_info(info, stream,
++			      unstyled_func,
++			      styled_func);
++#else
++	(void)styled_func;
++	init_disassemble_info(info, stream,
++			      unstyled_func);
++#endif
++}
++
++#endif /* _TOOLS_DIS_ASM_COMPAT_H */
+-- 
+cgit 
+
diff --git a/srcpkgs/linux-tools/patches/bpf_jit_disasm-binutils-2.39.patch b/srcpkgs/linux-tools/patches/bpf_jit_disasm-binutils-2.39.patch
new file mode 100644
index 000000000000..01221fad3a4a
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/bpf_jit_disasm-binutils-2.39.patch
@@ -0,0 +1,104 @@
+From 96ed066054abf11c7d3e106e3011a51f3f1227a3 Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:31 -0700
+Subject: [PATCH] tools bpf_jit_disasm: Fix compilation error with new binutils
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation to fail for tools/bpf/bpf_jit_disasm.c, e.g. on debian
+unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+Wire up the feature test and switch to init_disassemble_info_compat(),
+which were introduced in prior commits, fixing the compilation failure.
+
+I verified that bpf_jit_disasm can still disassemble bpf programs, both
+with the old and new dis-asm.h API. With old binutils there's no change in
+output before/after this patch. When comparing the output from old
+binutils (2.35) to new bintuils with the patch (upstream snapshot) there
+are a few output differences, but they are unrelated to this patch. An
+example hunk is:
+
+     f4:	mov    %r14,%rsi
+     f7:	mov    %r15,%rdx
+     fa:	mov    $0x2a,%ecx
+  -  ff:	callq  0xffffffffea8c4988
+  +  ff:	call   0xffffffffea8c4988
+    104:	test   %rax,%rax
+    107:	jge    0x0000000000000110
+    109:	xor    %eax,%eax
+  - 10b:	jmpq   0x0000000000000073
+  + 10b:	jmp    0x0000000000000073
+    110:	cmp    $0x16,%rax
+
+However, I had to use an older kernel to generate the bpf_jit_enabled =
+2 output, as that has been broken since 5.18 / 1022a5498f6f745c ("bpf,
+x86_64: Use bpf_jit_binary_pack_alloc").
+
+  https://lore.kernel.org/20220703030210.pmjft7qc2eajzi6c@alap3.anarazel.de
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Daniel Borkmann <daniel@iogearbox.net>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Quentin Monnet <quentin@isovalent.com>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-6-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/bpf/Makefile         | 5 ++++-
+ tools/bpf/bpf_jit_disasm.c | 5 ++++-
+ 2 files changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/tools/bpf/Makefile b/tools/bpf/Makefile
+index b11cfc86a3d021..664601ab1705ab 100644
+--- a/tools/bpf/Makefile
++++ b/tools/bpf/Makefile
+@@ -34,7 +34,7 @@ else
+ endif
+ 
+ FEATURE_USER = .bpf
+-FEATURE_TESTS = libbfd disassembler-four-args
++FEATURE_TESTS = libbfd disassembler-four-args disassembler-init-styled
+ FEATURE_DISPLAY = libbfd disassembler-four-args
+ 
+ check_feat := 1
+@@ -56,6 +56,9 @@ endif
+ ifeq ($(feature-disassembler-four-args), 1)
+ CFLAGS += -DDISASM_FOUR_ARGS_SIGNATURE
+ endif
++ifeq ($(feature-disassembler-init-styled), 1)
++CFLAGS += -DDISASM_INIT_STYLED
++endif
+ 
+ $(OUTPUT)%.yacc.c: $(srctree)/tools/bpf/%.y
+ 	$(QUIET_BISON)$(YACC) -o $@ -d $<
+diff --git a/tools/bpf/bpf_jit_disasm.c b/tools/bpf/bpf_jit_disasm.c
+index c8ae9580472814..a90a5d110f9255 100644
+--- a/tools/bpf/bpf_jit_disasm.c
++++ b/tools/bpf/bpf_jit_disasm.c
+@@ -28,6 +28,7 @@
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <limits.h>
++#include <tools/dis-asm-compat.h>
+ 
+ #define CMD_ACTION_SIZE_BUFFER		10
+ #define CMD_ACTION_READ_ALL		3
+@@ -64,7 +65,9 @@ static void get_asm_insns(uint8_t *image, size_t len, int opcodes)
+ 	assert(bfdf);
+ 	assert(bfd_check_format(bfdf, bfd_object));
+ 
+-	init_disassemble_info(&info, stdout, (fprintf_ftype) fprintf);
++	init_disassemble_info_compat(&info, stdout,
++				     (fprintf_ftype) fprintf,
++				     fprintf_styled);
+ 	info.arch = bfd_get_arch(bfdf);
+ 	info.mach = bfd_get_mach(bfdf);
+ 	info.buffer = image;
diff --git a/srcpkgs/linux-tools/patches/bpftool-binutils-2.39.patch b/srcpkgs/linux-tools/patches/bpftool-binutils-2.39.patch
new file mode 100644
index 000000000000..1e55c40011be
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/bpftool-binutils-2.39.patch
@@ -0,0 +1,149 @@
+From 600b7b26c07a070d0153daa76b3806c1e52c9e00 Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:33 -0700
+Subject: [PATCH] tools bpftool: Fix compilation error with new binutils
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation to fail for tools/bpf/bpftool/jit_disasm.c, e.g. on debian
+unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+Wire up the feature test and switch to init_disassemble_info_compat(),
+which were introduced in prior commits, fixing the compilation failure.
+
+I verified that bpftool can still disassemble bpf programs, both with an
+old and new dis-asm.h API. There are no output changes for plain and json
+formats. When comparing the output from old binutils (2.35)
+to new bintuils with the patch (upstream snapshot) there are a few output
+differences, but they are unrelated to this patch. An example hunk is:
+
+     2f:	pop    %r14
+     31:	pop    %r13
+     33:	pop    %rbx
+  -  34:	leaveq
+  -  35:	retq
+  +  34:	leave
+  +  35:	ret
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Quentin Monnet <quentin@isovalent.com>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-8-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/bpf/bpftool/Makefile     |  5 +++-
+ tools/bpf/bpftool/jit_disasm.c | 42 +++++++++++++++++++++++++++-------
+ 2 files changed, 38 insertions(+), 9 deletions(-)
+
+diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile
+index c6d2c77d02524a..436e671b2657d4 100644
+--- a/tools/bpf/bpftool/Makefile
++++ b/tools/bpf/bpftool/Makefile
+@@ -62,7 +62,7 @@ CLANG ?= clang
+ LLVM_STRIP ?= llvm-strip
+ 
+ FEATURE_USER = .bpftool
+-FEATURE_TESTS = libbfd disassembler-four-args reallocarray zlib libcap \
++FEATURE_TESTS = libbfd disassembler-four-args disassembler-init-styled reallocarray zlib libcap \
+ 	clang-bpf-co-re
+ FEATURE_DISPLAY = libbfd disassembler-four-args zlib libcap \
+ 	clang-bpf-co-re
+@@ -117,6 +117,9 @@ endif
+ ifeq ($(feature-disassembler-four-args), 1)
+ CFLAGS += -DDISASM_FOUR_ARGS_SIGNATURE
+ endif
++ifeq ($(feature-disassembler-init-styled), 1)
++    CFLAGS += -DDISASM_INIT_STYLED
++endif
+ 
+ LIBS = $(LIBBPF) -lelf -lz
+ LIBS_BOOTSTRAP = $(LIBBPF_BOOTSTRAP) -lelf -lz
+diff --git a/tools/bpf/bpftool/jit_disasm.c b/tools/bpf/bpftool/jit_disasm.c
+index 24734f2249d6ec..aaf99a0168c90b 100644
+--- a/tools/bpf/bpftool/jit_disasm.c
++++ b/tools/bpf/bpftool/jit_disasm.c
+@@ -24,6 +24,7 @@
+ #include <sys/stat.h>
+ #include <limits.h>
+ #include <bpf/libbpf.h>
++#include <tools/dis-asm-compat.h>
+ 
+ #include "json_writer.h"
+ #include "main.h"
+@@ -39,15 +40,12 @@ static void get_exec_path(char *tpath, s
+ }
+ 
+ static int oper_count;
+-static int fprintf_json(void *out, const char *fmt, ...)
++static int printf_json(void *out, const char *fmt, va_list ap)
+ {
+-	va_list ap;
+ 	char *s;
+ 
+-	va_start(ap, fmt);
+ 	if (vasprintf(&s, fmt, ap) < 0)
+ 		return -1;
+-	va_end(ap);
+ 
+ 	if (!oper_count) {
+ 		int i;
+@@ -73,6 +71,32 @@ static int fprintf_json(void *out, const char *fmt, ...)
+ 	return 0;
+ }
+ 
++static int fprintf_json(void *out, const char *fmt, ...)
++{
++	va_list ap;
++	int r;
++
++	va_start(ap, fmt);
++	r = printf_json(out, fmt, ap);
++	va_end(ap);
++
++	return r;
++}
++
++static int fprintf_json_styled(void *out,
++			       enum disassembler_style style __maybe_unused,
++			       const char *fmt, ...)
++{
++	va_list ap;
++	int r;
++
++	va_start(ap, fmt);
++	r = printf_json(out, fmt, ap);
++	va_end(ap);
++
++	return r;
++}
++
+ void disasm_print_insn(unsigned char *image, ssize_t len, int opcodes,
+ 		       const char *arch, const char *disassembler_options,
+ 		       const struct btf *btf,
+@@ -99,11 +123,13 @@ void disasm_print_insn(unsigned char *image, ssize_t len, int opcodes,
+ 	assert(bfd_check_format(bfdf, bfd_object));
+ 
+ 	if (json_output)
+-		init_disassemble_info(&info, stdout,
+-				      (fprintf_ftype) fprintf_json);
++		init_disassemble_info_compat(&info, stdout,
++					     (fprintf_ftype) fprintf_json,
++					     fprintf_json_styled);
+ 	else
+-		init_disassemble_info(&info, stdout,
+-				      (fprintf_ftype) fprintf);
++		init_disassemble_info_compat(&info, stdout,
++					     (fprintf_ftype) fprintf,
++					     fprintf_styled);
+ 
+ 	/* Update architecture info for offload. */
+ 	if (arch) {
diff --git a/srcpkgs/linux-tools/patches/perf-binutils-2.39.patch b/srcpkgs/linux-tools/patches/perf-binutils-2.39.patch
new file mode 100644
index 000000000000..3484330f7286
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/perf-binutils-2.39.patch
@@ -0,0 +1,114 @@
+From 83aa0120487e8bc3f231e72c460add783f71f17c Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:30 -0700
+Subject: [PATCH] tools perf: Fix compilation error with new binutils
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation failures for tools/perf/util/annotate.c, e.g. on debian
+unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+Wire up the feature test and switch to init_disassemble_info_compat(),
+which were introduced in prior commits, fixing the compilation failure.
+
+I verified that perf can still disassemble bpf programs by using bpftrace
+under load, recording a perf trace, and then annotating the bpf "function"
+with and without the changes. With old binutils there's no change in output
+before/after this patch. When comparing the output from old binutils (2.35)
+to new bintuils with the patch (upstream snapshot) there are a few output
+differences, but they are unrelated to this patch. An example hunk is:
+
+       1.15 :   55:mov    %rbp,%rdx
+       0.00 :   58:add    $0xfffffffffffffff8,%rdx
+       0.00 :   5c:xor    %ecx,%ecx
+  -    1.03 :   5e:callq  0xffffffffe12aca3c
+  +    1.03 :   5e:call   0xffffffffe12aca3c
+       0.00 :   63:xor    %eax,%eax
+  -    2.18 :   65:leaveq
+  -    2.82 :   66:retq
+  +    2.18 :   65:leave
+  +    2.82 :   66:ret
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-5-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/perf/Makefile.config | 8 ++++++++
+ tools/perf/util/annotate.c | 7 ++++---
+ 2 files changed, 12 insertions(+), 3 deletions(-)
+
+diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
+index d3c254c0f5c611..23648ea54e8d3d 100644
+--- a/tools/perf/Makefile.config
++++ b/tools/perf/Makefile.config
+@@ -298,6 +298,7 @@ FEATURE_CHECK_LDFLAGS-libpython := $(PYTHON_EMBED_LDOPTS)
+ FEATURE_CHECK_LDFLAGS-libaio = -lrt
+ 
+ FEATURE_CHECK_LDFLAGS-disassembler-four-args = -lbfd -lopcodes -ldl
++FEATURE_CHECK_LDFLAGS-disassembler-init-styled = -lbfd -lopcodes -ldl
+ 
+ CORE_CFLAGS += -fno-omit-frame-pointer
+ CORE_CFLAGS += -ggdb3
+@@ -818,13 +819,16 @@ else
+   ifeq ($(feature-libbfd-liberty), 1)
+     EXTLIBS += -lbfd -lopcodes -liberty
+     FEATURE_CHECK_LDFLAGS-disassembler-four-args += -liberty -ldl
++    FEATURE_CHECK_LDFLAGS-disassembler-init-styled += -liberty -ldl
+   else
+     ifeq ($(feature-libbfd-liberty-z), 1)
+       EXTLIBS += -lbfd -lopcodes -liberty -lz
+       FEATURE_CHECK_LDFLAGS-disassembler-four-args += -liberty -lz -ldl
++      FEATURE_CHECK_LDFLAGS-disassembler-init-styled += -liberty -lz -ldl
+     endif
+   endif
+   $(call feature_check,disassembler-four-args)
++  $(call feature_check,disassembler-init-styled)
+ endif
+ 
+ ifeq ($(feature-libbfd-buildid), 1)
+@@ -1044,6 +1048,10 @@ ifeq ($(feature-disassembler-four-args), 1)
+     CFLAGS += -DDISASM_FOUR_ARGS_SIGNATURE
+ endif
+ 
++ifeq ($(feature-disassembler-init-styled), 1)
++    CFLAGS += -DDISASM_INIT_STYLED
++endif
++
+ ifeq (${IS_64_BIT}, 1)
+   ifndef NO_PERF_READ_VDSO32
+     $(call feature_check,compile-32)
+diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
+index 82cc396ef516c4..2c6a485c3de5d9 100644
+--- a/tools/perf/util/annotate.c
++++ b/tools/perf/util/annotate.c
+@@ -1676,6 +1676,7 @@ fallback:
+ #define PACKAGE "perf"
+ #include <bfd.h>
+ #include <dis-asm.h>
++#include <tools/dis-asm-compat.h>
+ 
+ static int symbol__disassemble_bpf(struct symbol *sym,
+ 				   struct annotate_args *args)
+@@ -1762,9 +1763,9 @@ static int symbol__disassemble_bpf(struct symbol *sym,
+ 		ret = errno;
+ 		goto out;
+ 	}
+-	init_disassemble_info(&info, s,
+-			      (fprintf_ftype) fprintf);
+-
++	init_disassemble_info_compat(&info, s,
++				     (fprintf_ftype) fprintf,
++				     fprintf_styled);
+ 	info.arch = bfd_get_arch(bfdf);
+ 	info.mach = bfd_get_mach(bfdf);
+ 

From bc483235b5166ce9a4b94273189e4ba8233bcbbf Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 14:45:28 -0700
Subject: [PATCH 26/52] libsasl: fix build for libtool 2.4.7

---
 srcpkgs/libsasl/template | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/libsasl/template b/srcpkgs/libsasl/template
index a8817042f843..a2993b39f4a1 100644
--- a/srcpkgs/libsasl/template
+++ b/srcpkgs/libsasl/template
@@ -19,6 +19,7 @@ distfiles="https://github.com/cyrusimap/cyrus-sasl/releases/download/cyrus-sasl-
 checksum=26866b1549b00ffd020f188a43c258017fa1c382b3ddadd8201536f72efb05d5
 
 pre_configure() {
+	rm -f m4/ltversion.m4
 	autoreconf -fi
 }
 

From 179d59e569cbb2e6e8db49b9aa93f8ab3802847f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:08 -0700
Subject: [PATCH 27/52] subversion: fix build for libtool 2.4.7

---
 srcpkgs/subversion/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion/template b/srcpkgs/subversion/template
index 8ad178264942..3f1c9e254e61 100644
--- a/srcpkgs/subversion/template
+++ b/srcpkgs/subversion/template
@@ -57,7 +57,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From ace84058e822f8a80035d1e9af42ca236ad000fa Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:38 -0700
Subject: [PATCH 28/52] subversion-kwallet-auth: fix build for libtool 2.4.7

---
 srcpkgs/subversion-kwallet-auth/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion-kwallet-auth/template b/srcpkgs/subversion-kwallet-auth/template
index 12210f250d51..b4d8621456ea 100644
--- a/srcpkgs/subversion-kwallet-auth/template
+++ b/srcpkgs/subversion-kwallet-auth/template
@@ -59,7 +59,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From 4115afc318b6e805e9ec799f73e0f1c77ed59897 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 20:07:32 -0700
Subject: [PATCH 29/52] gpgme: update to 1.18.0.

---
 common/shlibs          | 2 +-
 srcpkgs/gpgme/template | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 52220e69706d..98017bdd5e3d 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -723,7 +723,7 @@ libdconf.so.1 dconf-0.13.90_1
 libassuan.so.0 libassuan-2.0.1_1
 libgpgme.so.11 libgpgme-1.12.0_2
 libgpgmepp.so.6 gpgmepp-1.7.0_3
-libqgpgme.so.7 gpgmeqt-1.7.0_3
+libqgpgme.so.15 gpgmeqt-1.18.0_1
 libgarcon-1.so.0 garcon-0.1.12_1
 libgarcon-gtk2-1.so.0 garcon-0.4.0_1
 libgarcon-gtk3-1.so.0 garcon-0.6.1_1
diff --git a/srcpkgs/gpgme/template b/srcpkgs/gpgme/template
index 8633075a8404..b1cfd5f78657 100644
--- a/srcpkgs/gpgme/template
+++ b/srcpkgs/gpgme/template
@@ -1,7 +1,7 @@
 # Template file for 'gpgme'
 pkgname=gpgme
-version=1.15.1
-revision=2
+version=1.18.0
+revision=1
 build_style=gnu-configure
 configure_args="--enable-fd-passing
  --with-libgpg-error-prefix=$XBPS_CROSS_BASE/usr
@@ -14,7 +14,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.gnupg.org/software/gpgme/index.html"
 distfiles="https://www.gnupg.org/ftp/gcrypt/gpgme/gpgme-${version}.tar.bz2"
-checksum=eebc3c1b27f1c8979896ff361ba9bb4778b508b2496c2fc10e3775a40b1de1ad
+checksum=361d4eae47ce925dba0ea569af40e7b52c645c4ae2e65e5621bf1b6cdd8b0e9e
 
 if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
 	configure_args+=" ac_cv_sys_file_offset_bits=no"

From c15c5ec29b14d696e479e9c10c7f0c9e03dff8ce Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 30/52] cross-aarch64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..bd6b23f9fb6a 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 127e10d5cbcde11a9151042c59f7cbabee99fa55 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 31/52] cross-aarch64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..427ad2c1e9cd 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 9d6b23994169c623f632a42ae85808bb8abb4508 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 32/52] cross-arm-linux-gnueabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..2510ee26e789 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From bf2e12c55e90401f42220212b9f626d81d5f4deb Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 33/52] cross-arm-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..bd8b16e1b4c1 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 7896be113e4406f904af59819684b7f6364091da Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 34/52] cross-arm-linux-musleabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..dacfd2655216 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 8e537ed7e8f7daec06c4d7f45282e84f74a84aa2 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 35/52] cross-arm-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..9ddd32a9f20d 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 506312756257f33b7c19ac69dc41415de5ec9152 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 36/52] cross-armv7l-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..9fb00f18be3b 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From a23abeebf5a4395f0e1c6fb3e435e2c0f42736dd Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 37/52] cross-armv7l-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..2c72e75ddfe3 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 85e4c373ce8f057e66cdc83ff0dc5d961f6f5be7 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 38/52] cross-i686-pc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..4dc17df648b5 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 4d043d8545adf84db49039e824639aeca0bb4d9d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 39/52] cross-mips-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..6009e5c79eb2 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From b8ee30b096275d807bfc20cde707c5063bd6075c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 40/52] cross-mips-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..080164df193d 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="hipperson0 <hipperson0@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 8c52985e6c3f738b1ea463836b9e2555fa7411f7 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 41/52] cross-mipsel-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..c8f90cfa43cc 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_musl_version=1.1.24
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 3db91503456c9809f36ed900917ee2f68ab897fb Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 42/52] cross-mipsel-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..931345d2de15 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_musl_version=1.1.24
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 41a11fd11c7bfec1b0d1a50478d441c2ec3d2843 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 43/52] cross-powerpc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..31e57b4e52b2 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From aa7df72f5d261369ab2c741a67ab6de481a63f1b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 44/52] cross-powerpc-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..a2d1edcf1ffd 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 9994db9860e92cd8e16a504b180aa041263a522d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 45/52] cross-powerpc64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..1a4cbed61e76 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From e537bd38c4b1e3e995512d0bf9319169db0667c4 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 46/52] cross-powerpc64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 1ebd0fb2048d..ade42018af05 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 56eab57291af3d04b252bb52c1be7f8e98c216ee Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 47/52] cross-powerpc64le-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 733f5851da5c..dd1ad383a21e 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From a5909338ce77b3252ce794ed148adeae002b723f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 48/52] cross-powerpc64le-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index 76a70aa1d6db..5887f845f932 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 8229c3f348cf04daba7a974e277549667f91372e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 49/52] cross-powerpcle-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 347b8fcf4f55..06530e0d609b 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 3c0275979fce3f1c998f00efb740886ff4dd47d0 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:19 -0700
Subject: [PATCH 50/52] cross-powerpcle-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index ec9324ddaa99..e68c3962b49c 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From b1500b9f8bb037fbf66b1f22f1dae65be5ef964e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:19 -0700
Subject: [PATCH 51/52] cross-x86_64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 0078fbe7224b..7da85c14b62d 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 973893128547b51a47c73fb345ae98e6a2409233 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:19 -0700
Subject: [PATCH 52/52] cross-x86_64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..2811de0d3c2e 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (50 preceding siblings ...)
  2022-08-25  0:00 ` oreo639
@ 2022-08-25  2:33 ` oreo639
  2022-08-25  4:02 ` oreo639
                   ` (212 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-08-25  2:33 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5538 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.2.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.2.0

This PR depends on: https://github.com/void-linux/void-packages/pull/32330

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

Also, keep in mind that the libgo musl patch here will need to be updated once musl is updated:
https://github.com/void-linux/void-packages/pull/34902/files#diff-1f42a95b93c9550178ff1fbccbef2f47a72711df15c24c9472e2550076978129R163-R176

This is the updated patch for reference:
https://github.com/alpinelinux/aports/blob/8acb21b8ee881e7ab1c812d9a66a17d2501b8730/main/gcc/0049-libgo-adjust-name-of-union-in-sigevent-struct.patch

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/38817
- [x] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [ ] llvm https://github.com/void-linux/void-packages/pull/38694
- [ ] m4 https://github.com/void-linux/void-packages/pull/33730
- [ ] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [ ] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [ ] libvirt https://github.com/void-linux/void-packages/pull/38842
- [ ] syslinux https://github.com/void-linux/void-packages/pull/38876
- [ ] efivar https://github.com/void-linux/void-packages/pull/38874

Known packages that needed to be fixed/updated for gcc12:
- [ ] linux5.18 (in this PR)
- [ ] openssh https://github.com/void-linux/void-packages/pull/38849
- [ ] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [ ] doxygen https://github.com/void-linux/void-packages/pull/38846
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/38817
- [ ] libproxy https://github.com/void-linux/void-packages/pull/38818
- [ ] exempi https://github.com/void-linux/void-packages/pull/38820
- [ ] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [ ] gpgme https://github.com/void-linux/void-packages/pull/38825
- [ ] libunique1 https://github.com/void-linux/void-packages/pull/38848 or https://github.com/void-linux/void-packages/pull/38873
- [ ] libwpd https://github.com/void-linux/void-packages/pull/38878

Needs to be fixed/updated for binutils:
- [ ] grub https://github.com/void-linux/void-packages/pull/38875
- [ ] linux-tools https://github.com/void-linux/void-packages/pull/38877

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [x] kde
- [x] lxde
- [x] lxqt

You can test the ISOs here:
https://drive.google.com/drive/folders/1ix92CYSLUP-KWjLxltdgG4e8Nu2JCY5n?usp=sharing

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 169128 bytes --]

From aa03fc3f96e66515966dba22223482d31e84ba9a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 01/52] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 15 +++--
 3 files changed, 28 insertions(+), 113 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..0578665c1a30 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkg-config"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -44,6 +45,12 @@ do_configure() {
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	# gprofng currently only supports x86 and aarch64 glibc.
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64|i386|aarch64) conf+=" --enable-gprofng" ;;
+		*) conf+=" --disable-gprofng" ;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"

From accc2d8e9f3b2e2e0739c3d006916684f41757f3 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 02/52] gcc: update to 12.2.0.

---
 common/shlibs                                 | 10 +--
 srcpkgs/gcc/files/gccgo-musl.patch            | 74 ++++---------------
 srcpkgs/gcc/files/libgnarl-musl.patch         | 18 ++---
 srcpkgs/gcc/files/libssp-musl.patch           | 10 +--
 srcpkgs/gcc/patches/libffi_gnulinux.patch     | 11 ---
 .../gcc/patches/libgcc-ibm128-no-tag.patch    | 10 ++-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |  2 +-
 srcpkgs/gcc/template                          | 25 +++----
 8 files changed, 52 insertions(+), 108 deletions(-)
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index f829ee12e80f..bde5320461ce 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.2.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.34 perl-5.34.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -848,8 +848,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.2.0_1
+libgnat-12.so libada-12.2.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1700,8 +1700,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.2.0_1
+libasan.so.8 libsanitizer-12.2.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..632ef951097b 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,17 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ a/libgo/go/runtime/os_linux.go
+@@ -363,9 +363,9 @@
+ 
+ 	var timerid int32
+ 	var sevp _sigevent
+-	sevp.sigev_notify = _SIGEV_THREAD_ID
++	sevp.sigev_notify = 4
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.sigev_notify_function))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..446741390d45 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,15 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
+version=12.2.0
+revision=1
 _patchver="${version%pre*}"
 _minorver="${_patchver%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 wrksrc=gcc-${version/pre/_pre}
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +19,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -396,7 +393,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}

From 7f05bdc9b4c258904b9ce48d6a361cafab566e82 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 03/52] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      |  6 ++--
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..08e35d466a44 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From abf41dbca75c8ff9253413e7dc851766ed3ab8e9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 04/52] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 1a4e1ca3d594..b04268908c2e 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="q66 <daniel@octaforge.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From 4269155fd1cffd1eaf1c356089bc49796f00c17a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 05/52] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 3 files changed, 55 insertions(+), 353 deletions(-)
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index bde5320461ce..52220e69706d 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From d2b9379a6ab9f82a3db1b7d4a1bd878e376c9d3f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 21:01:43 -0700
Subject: [PATCH 06/52] gcc-multilib: update to 12.2.0.

---
 srcpkgs/gcc-multilib/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index fcd25755aa75..1a26da26a991 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,16 +3,16 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _majorver="${version%.*}"
-wrksrc=gcc-${version/pre/_pre}
+wrksrc=gcc-${version}
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel

From 5b515e621ef841f3553765fb0c2831d673466833 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 16:22:03 -0700
Subject: [PATCH 07/52] llvm12: fix build for glibc 2.36

---
 .../compiler-rt-sanitizer-glibc-2.36.patch    | 59 +++++++++++++++++++
 1 file changed, 59 insertions(+)
 create mode 100644 srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch

diff --git a/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch b/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch
new file mode 100644
index 000000000000..e5f24dab8935
--- /dev/null
+++ b/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch
@@ -0,0 +1,59 @@
+From 9cf13067cb5088626ba7ee1ec4c42ec59c7995a0 Mon Sep 17 00:00:00 2001
+From: Fangrui Song <i@maskray.me>
+Date: Mon, 11 Jul 2022 12:53:34 -0700
+Subject: [PATCH] [sanitizer] Remove #include <linux/fs.h> to resolve
+ fsconfig_command/mount_attr conflict with glibc 2.36
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+It is generally not a good idea to mix usage of glibc headers and Linux UAPI
+headers (https://sourceware.org/glibc/wiki/Synchronizing_Headers). In glibc
+since 7eae6a91e9b1670330c9f15730082c91c0b1d570 (milestone: 2.36), sys/mount.h
+defines `fsconfig_command` which conflicts with linux/mount.h:
+
+    .../usr/include/linux/mount.h:95:6: error: redeclaration of ‘enum fsconfig_command’
+
+Remove #include <linux/fs.h> which pulls in linux/mount.h. Expand its 4 macros manually.
+Android sys/mount.h doesn't define BLKBSZGET and it still needs linux/fs.h.
+In the long term we should move Linux specific definitions to sanitizer_platform_limits_linux.cpp
+but this commit is easy to cherry pick into older compiler-rt releases.
+
+Fix https://github.com/llvm/llvm-project/issues/56421
+
+Reviewed By: #sanitizers, vitalybuka, zatrazz
+
+Differential Revision: https://reviews.llvm.org/D129471
+---
+ .../sanitizer_platform_limits_posix.cpp                | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+index 4bd425435d56d..3a94b260686f1 100644
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -73,7 +73,9 @@
+ #include <sys/vt.h>
+ #include <linux/cdrom.h>
+ #include <linux/fd.h>
++#if SANITIZER_ANDROID
+ #include <linux/fs.h>
++#endif
+ #include <linux/hdreg.h>
+ #include <linux/input.h>
+ #include <linux/ioctl.h>
+@@ -876,10 +878,10 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
+   unsigned IOCTL_EVIOCGPROP = IOCTL_NOT_PRESENT;
+   unsigned IOCTL_EVIOCSKEYCODE_V2 = IOCTL_NOT_PRESENT;
+ #endif
+-  unsigned IOCTL_FS_IOC_GETFLAGS = FS_IOC_GETFLAGS;
+-  unsigned IOCTL_FS_IOC_GETVERSION = FS_IOC_GETVERSION;
+-  unsigned IOCTL_FS_IOC_SETFLAGS = FS_IOC_SETFLAGS;
+-  unsigned IOCTL_FS_IOC_SETVERSION = FS_IOC_SETVERSION;
++  unsigned IOCTL_FS_IOC_GETFLAGS = _IOR('f', 1, long);
++  unsigned IOCTL_FS_IOC_GETVERSION = _IOR('v', 1, long);
++  unsigned IOCTL_FS_IOC_SETFLAGS = _IOW('f', 2, long);
++  unsigned IOCTL_FS_IOC_SETVERSION = _IOW('v', 2, long);
+   unsigned IOCTL_GIO_CMAP = GIO_CMAP;
+   unsigned IOCTL_GIO_FONT = GIO_FONT;
+   unsigned IOCTL_GIO_UNIMAP = GIO_UNIMAP;

From 7022b0e6bf053cac07a0e436fda5c964d3b47883 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 17:21:40 -0700
Subject: [PATCH 08/52] m4: update to 1.4.19.

---
 srcpkgs/m4/patches/fix-glibc-2.27.patch | 167 ------------------------
 srcpkgs/m4/template                     |  12 +-
 2 files changed, 6 insertions(+), 173 deletions(-)
 delete mode 100644 srcpkgs/m4/patches/fix-glibc-2.27.patch

diff --git a/srcpkgs/m4/patches/fix-glibc-2.27.patch b/srcpkgs/m4/patches/fix-glibc-2.27.patch
deleted file mode 100644
index 59d33cff164d..000000000000
--- a/srcpkgs/m4/patches/fix-glibc-2.27.patch
+++ /dev/null
@@ -1,167 +0,0 @@
-From 4af4a4a71827c0bc5e0ec67af23edef4f15cee8e Mon Sep 17 00:00:00 2001
-From: Paul Eggert <eggert@cs.ucla.edu>
-Date: Mon, 5 Mar 2018 10:56:29 -0800
-Subject: [PATCH] fflush: adjust to glibc 2.28 libio.h removal
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Problem reported by Daniel P. Berrangé in:
-https://lists.gnu.org/r/bug-gnulib/2018-03/msg00000.html
-* lib/fbufmode.c (fbufmode):
-* lib/fflush.c (clear_ungetc_buffer_preserving_position)
-(disable_seek_optimization, rpl_fflush):
-* lib/fpending.c (__fpending):
-* lib/fpurge.c (fpurge):
-* lib/freadable.c (freadable):
-* lib/freadahead.c (freadahead):
-* lib/freading.c (freading):
-* lib/freadptr.c (freadptr):
-* lib/freadseek.c (freadptrinc):
-* lib/fseeko.c (fseeko):
-* lib/fseterr.c (fseterr):
-* lib/fwritable.c (fwritable):
-* lib/fwriting.c (fwriting):
-Check _IO_EOF_SEEN instead of _IO_ftrylockfile.
-* lib/stdio-impl.h (_IO_IN_BACKUP) [_IO_EOF_SEEN]:
-Define if not already defined.
-
-[yann.morin.1998@free.fr: partially backport from upstream gnulib]
-Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
-
----
- lib/fflush.c     |  6 +++---
- lib/fpending.c   |  2 +-
- lib/fpurge.c     |  2 +-
- lib/freadahead.c |  2 +-
- lib/freading.c   |  2 +-
- lib/fseeko.c     |  4 ++--
- lib/stdio-impl.h |  6 ++++++
- 7 files changed, 15 insertions(+), 9 deletions(-)
-
-diff --git a/lib/fflush.c b/build-aux/gnulib/lib/fflush.c
-index 983ade0ff..a6edfa105 100644
---- a/lib/fflush.c
-+++ b/lib/fflush.c
-@@ -33,7 +33,7 @@
- #undef fflush
- 
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- 
- /* Clear the stream's ungetc buffer, preserving the value of ftello (fp).  */
- static void
-@@ -72,7 +72,7 @@ clear_ungetc_buffer (FILE *fp)
- 
- #endif
- 
--#if ! (defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
-+#if ! (defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
- 
- # if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT
- /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
-@@ -148,7 +148,7 @@ rpl_fflush (FILE *stream)
-   if (stream == NULL || ! freading (stream))
-     return fflush (stream);
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- 
-   clear_ungetc_buffer_preserving_position (stream);
- 
-diff --git a/lib/fpending.c b/build-aux/gnulib/lib/fpending.c
-index c84e3a5b4..789f50e4e 100644
---- a/lib/fpending.c
-+++ b/lib/fpending.c
-@@ -32,7 +32,7 @@ __fpending (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   return fp->_IO_write_ptr - fp->_IO_write_base;
- #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
-   /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
-diff --git a/lib/fpurge.c b/build-aux/gnulib/lib/fpurge.c
-index b1d417c7a..3aedcc373 100644
---- a/lib/fpurge.c
-+++ b/lib/fpurge.c
-@@ -62,7 +62,7 @@ fpurge (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   fp->_IO_read_end = fp->_IO_read_ptr;
-   fp->_IO_write_ptr = fp->_IO_write_base;
-   /* Avoid memory leak when there is an active ungetc buffer.  */
-diff --git a/lib/freadahead.c b/build-aux/gnulib/lib/freadahead.c
-index c2ecb5b28..23ec76ee5 100644
---- a/lib/freadahead.c
-+++ b/lib/freadahead.c
-@@ -30,7 +30,7 @@ extern size_t __sreadahead (FILE *);
- size_t
- freadahead (FILE *fp)
- {
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   if (fp->_IO_write_ptr > fp->_IO_write_base)
-     return 0;
-   return (fp->_IO_read_end - fp->_IO_read_ptr)
-diff --git a/lib/freading.c b/build-aux/gnulib/lib/freading.c
-index 73c28acdd..c24d0c88a 100644
---- a/lib/freading.c
-+++ b/lib/freading.c
-@@ -31,7 +31,7 @@ freading (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   return ((fp->_flags & _IO_NO_WRITES) != 0
-           || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0
-               && fp->_IO_read_base != NULL));
-diff --git a/lib/fseeko.c b/build-aux/gnulib/lib/fseeko.c
-index 0101ab55f..193f4e8ce 100644
---- a/lib/fseeko.c
-+++ b/lib/fseeko.c
-@@ -47,7 +47,7 @@ fseeko (FILE *fp, off_t offset, int whence)
- #endif
- 
-   /* These tests are based on fpurge.c.  */
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   if (fp->_IO_read_end == fp->_IO_read_ptr
-       && fp->_IO_write_ptr == fp->_IO_write_base
-       && fp->_IO_save_base == NULL)
-@@ -123,7 +123,7 @@ fseeko (FILE *fp, off_t offset, int whence)
-           return -1;
-         }
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-       fp->_flags &= ~_IO_EOF_SEEN;
-       fp->_offset = pos;
- #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
-diff --git a/lib/stdio-impl.h b/build-aux/gnulib/lib/stdio-impl.h
-index 78d896e9f..05c5752a2 100644
---- a/lib/stdio-impl.h
-+++ b/lib/stdio-impl.h
-@@ -18,6 +18,12 @@
-    the same implementation of stdio extension API, except that some fields
-    have different naming conventions, or their access requires some casts.  */
- 
-+/* Glibc 2.28 made _IO_IN_BACKUP private.  For now, work around this
-+   problem by defining it ourselves.  FIXME: Do not rely on glibc
-+   internals.  */
-+#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN
-+# define _IO_IN_BACKUP 0x100
-+#endif
- 
- /* BSD stdio derived implementations.  */
- 
--- 
-2.14.1
-
-
diff --git a/srcpkgs/m4/template b/srcpkgs/m4/template
index 78f3dae6184a..762593d883bd 100644
--- a/srcpkgs/m4/template
+++ b/srcpkgs/m4/template
@@ -1,17 +1,17 @@
 # Template file for 'm4'
 pkgname=m4
-version=1.4.18
-revision=2
+version=1.4.19
+revision=1
 bootstrap=yes
-replaces="chroot-m4>=0"
 build_style=gnu-configure
 configure_args="--enable-changeword --enable-threads"
 short_desc="GNU version of UNIX m4 macro language processor"
-homepage="https://www.gnu.org/software/m4/"
-license="GPL-3.0-or-later"
 maintainer="Enno Boland <gottox@voidlinux.org>"
+license="GPL-3.0-or-later"
+homepage="https://www.gnu.org/software/m4/"
 distfiles="${GNU_SITE}/${pkgname}/${pkgname}-${version}.tar.xz"
-checksum=f2c1e86ca0a404ff281631bdc8377638992744b175afb806e25871a24a934e07
+checksum=63aede5c6d33b6d9b13511cd0be2cac046f2e70fd0a07aa9573a04a82783af96
+replaces="chroot-m4>=0"
 
 if [ "$XBPS_TARGET_LIBC" = musl ]; then
 	export ac_cv_lib_error_at_line=no

From 15e9bae306d4ac87561f856f2ca81d01bbd61d90 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 22:57:59 -0700
Subject: [PATCH 09/52] btrfs-progs: update to 5.19.

---
 srcpkgs/btrfs-progs/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/btrfs-progs/template b/srcpkgs/btrfs-progs/template
index f6c53d8587e1..292d5110106b 100644
--- a/srcpkgs/btrfs-progs/template
+++ b/srcpkgs/btrfs-progs/template
@@ -1,6 +1,6 @@
 # Template file for 'btrfs-progs'
 pkgname=btrfs-progs
-version=5.18.1
+version=5.19
 revision=1
 wrksrc="${pkgname}-v${version}"
 build_style=gnu-configure
@@ -16,7 +16,7 @@ license="GPL-2.0-only, LGPL-2.1-or-later"
 homepage="https://btrfs.wiki.kernel.org/index.php/Main_Page"
 changelog="https://raw.githubusercontent.com/kdave/btrfs-progs/master/CHANGES"
 distfiles="${KERNEL_SITE}/kernel/people/kdave/${pkgname}/${pkgname}-v${version}.tar.xz"
-checksum=6e98a75ccff52e9354daa1ad284c614c490f844273a2fa524cbac9eb841c7255
+checksum=1fbcf06e4b2f80e7a127fd687ed4625a5b74fa674fe212c836ff70e0edfcccf9
 # Most of the tests depend on `mount` and `fallocate` commands, which are not
 # presented in chroot-util-linux
 make_check=no

From 82b9e00c2f7ef97e43c915abd13b5417647c3d1e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 19:39:23 -0700
Subject: [PATCH 10/52] syslinux: fix build for glibc 2.36

---
 .../patches/fix-build-with-glibc-2.36.patch   | 30 +++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 srcpkgs/syslinux/patches/fix-build-with-glibc-2.36.patch

diff --git a/srcpkgs/syslinux/patches/fix-build-with-glibc-2.36.patch b/srcpkgs/syslinux/patches/fix-build-with-glibc-2.36.patch
new file mode 100644
index 000000000000..1303be56c127
--- /dev/null
+++ b/srcpkgs/syslinux/patches/fix-build-with-glibc-2.36.patch
@@ -0,0 +1,30 @@
+--- a/linux/syslinux.c
++++ b/linux/syslinux.c
+@@ -45,7 +45,6 @@
+ #include <sys/stat.h>
+ #include <sys/types.h>
+ #include <sys/wait.h>
+-#include <sys/mount.h>
+ 
+ #include "linuxioctl.h"
+ 
+--- a/libinstaller/syslxcom.c
++++ b/libinstaller/syslxcom.c
+@@ -28,7 +28,6 @@
+ #include <errno.h>
+ #include <sys/stat.h>
+ #include <sys/types.h>
+-#include <sys/mount.h>
+ #include <sys/vfs.h>
+ 
+ #include "linuxioctl.h"
+--- a/extlinux/main.c
++++ b/extlinux/main.c
+@@ -40,7 +40,6 @@
+ #include <sys/stat.h>
+ #include <sys/sysmacros.h>
+ #include <sys/types.h>
+-#include <sys/mount.h>
+ #include <sys/vfs.h>
+ 
+ #include "linuxioctl.h"

From 027ea9a13e48fbf15a41bc0a1aacb7bb1bc7920a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 14 Aug 2022 19:29:36 -0700
Subject: [PATCH 11/52] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove -no-pie from build. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..adb777feb9ea 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -60,6 +60,7 @@ _void_cross_build_binutils() {
 		--disable-multilib \
 		--disable-werror \
 		--disable-gold \
+		--disable-gprofng \
 		--enable-relro \
 		--enable-plugins \
 		--enable-64-bit-bfd \
@@ -132,6 +133,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -460,6 +462,14 @@ do_build() {
 	local binutils_ver linux_ver gcc_ver libc_ver libucontext_ver
 	local tgt=${sourcepkg/cross-}
 
+	export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}"
+	export CXXFLAGS="${CXXFLAGS/-D_FORTIFY_SOURCE=2/}"
+
+	# Disable explicit -fno-PIE, gcc/binutils/libc will figure this out itself.
+	export CFLAGS="${CFLAGS//-fno-PIE/}"
+	export CXXFLAGS="${CXXFLAGS//-fno-PIE/}"
+	export LDFLAGS="${LDFLAGS//-no-pie/}"
+
 	_void_cross_test_ver binutils
 	_void_cross_test_ver linux
 	_void_cross_test_ver gcc
@@ -625,6 +635,9 @@ do_install() {
 	# then remove it because it conflicts with libquadmath package
 	rm -rf ${DESTDIR}/${sysroot}/usr/lib/libquadmath.*
 
+	# Remove libdep linker plugin because it conflicts with system binutils
+	rm -f ${DESTDIR}/bfd-plugins/libdep*
+
 	# Remove leftover symlinks
 	rm -f ${DESTDIR}/usr/lib${XBPS_TARGET_WORDSIZE}
 	rm -f ${DESTDIR}/lib*

From 8b18980b3381e90460c604509814e2766d87ba2f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:08:52 -0700
Subject: [PATCH 12/52] openssh: suppress werror on gcc12

---
 srcpkgs/openssh/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/openssh/template b/srcpkgs/openssh/template
index 02a2dec35f42..6e8e343a9dca 100644
--- a/srcpkgs/openssh/template
+++ b/srcpkgs/openssh/template
@@ -40,7 +40,7 @@ if [ "$build_option_ldns" -a -z "$build_option_ssl" ]; then
 	broken="option 'ldns' requires option 'ssl'"
 fi
 
-CFLAGS="-Wno-format-truncation -Wno-stringop-truncation"
+CFLAGS="-Wno-format-truncation -Wno-stringop-truncation -Wno-error=maybe-uninitialized"
 
 case $XBPS_TARGET_MACHINE in
 	i686-musl)

From 0ef24bed29c9f9b06a6917b4cd9c50d294c00dc8 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:09:31 -0700
Subject: [PATCH 13/52] linux5.18: update dotconfigs for gcc12

---
 srcpkgs/linux5.18/files/x86_64-dotconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/linux5.18/files/x86_64-dotconfig b/srcpkgs/linux5.18/files/x86_64-dotconfig
index 4e73a3195d40..ea6204868e23 100644
--- a/srcpkgs/linux5.18/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.18/files/x86_64-dotconfig
@@ -512,6 +512,7 @@ CONFIG_RETHUNK=y
 CONFIG_CPU_UNRET_ENTRY=y
 CONFIG_CPU_IBPB_ENTRY=y
 CONFIG_CPU_IBRS_ENTRY=y
+CONFIG_SLS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10060,8 +10061,11 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
 # Memory initialization
 #
 CONFIG_INIT_STACK_NONE=y
+# CONFIG_INIT_STACK_ALL_PATTERN is not set
+# CONFIG_INIT_STACK_ALL_ZERO is not set
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
+# CONFIG_ZERO_CALL_USED_REGS is not set
 # end of Memory initialization
 # end of Kernel hardening options
 # end of Security options
@@ -10538,6 +10542,7 @@ CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
 # CONFIG_UBSAN is not set
 CONFIG_HAVE_ARCH_KCSAN=y
+# CONFIG_KCSAN is not set
 # end of Generic Kernel Debugging Instruments
 
 #

From d7a53c5c9f87bfee590bec5672f13f5bf463c616 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 18:00:42 -0700
Subject: [PATCH 14/52] xf86-video-vmware: fix build on gcc12

---
 ...183b3395333d5d4c73e25c2d011748f15eda.patch | 30 +++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch

diff --git a/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch b/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch
new file mode 100644
index 000000000000..ff839f16e628
--- /dev/null
+++ b/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch
@@ -0,0 +1,30 @@
+From 77b8183b3395333d5d4c73e25c2d011748f15eda Mon Sep 17 00:00:00 2001
+From: Rudi Heitbaum <rudi@heitbaum.com>
+Date: Sun, 8 May 2022 03:00:10 +0000
+Subject: [PATCH] vmwgfx: fix missing array notation
+
+ Fixes error identified by gcc-12.1.0 compiler
+
+make
+  CC       libvmwgfx_la-vmwgfx_tex_video.lo
+vmwgfx_tex_video.c: In function 'stop_video':
+vmwgfx_tex_video.c:240:20: error: the comparison will always evaluate as 'true' for the address of 'yuv' will never be NULL [-Werror=address]
+  240 |                if (priv->yuv[i]) {
+      |                    ^~~~
+---
+ vmwgfx/vmwgfx_tex_video.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/vmwgfx/vmwgfx_tex_video.c b/vmwgfx/vmwgfx_tex_video.c
+index acc2b56..480a5f1 100644
+--- a/vmwgfx/vmwgfx_tex_video.c
++++ b/vmwgfx/vmwgfx_tex_video.c
+@@ -237,7 +237,7 @@ stop_video(ScrnInfoPtr pScrn, pointer data, Bool shutdown)
+ 
+        for (i=0; i<3; ++i) {
+ 	   for (j=0; j<2; ++j) {
+-	       if (priv->yuv[i]) {
++	       if (priv->yuv[j][i]) {
+ 		   xa_surface_destroy(priv->yuv[j][i]);
+ 		   priv->yuv[j][i] = NULL;
+ 	       }

From 89051423c1bd381542352ec44c621fd662e06776 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 18:24:37 -0700
Subject: [PATCH 15/52] doxygen: fix build for gcc 12

---
 srcpkgs/doxygen/patches/compat-gcc12.patch | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100644 srcpkgs/doxygen/patches/compat-gcc12.patch

diff --git a/srcpkgs/doxygen/patches/compat-gcc12.patch b/srcpkgs/doxygen/patches/compat-gcc12.patch
new file mode 100644
index 000000000000..666744a1dceb
--- /dev/null
+++ b/srcpkgs/doxygen/patches/compat-gcc12.patch
@@ -0,0 +1,22 @@
+From 5198966c8d5fec89116d025c74934ac03ea511fa Mon Sep 17 00:00:00 2001
+From: Dimitri van Heesch <doxygen@gmail.com>
+Date: Fri, 6 May 2022 09:55:16 +0200
+Subject: [PATCH] issue #9312: Build: cache.h:53:14: error: 'exchange' is not a
+ member of 'std'
+
+---
+ src/cache.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/cache.h b/src/cache.h
+index 0ff3092ed5..e218eb27d2 100644
+--- a/src/cache.h
++++ b/src/cache.h
+@@ -19,6 +19,7 @@
+ #include <list>
+ #include <unordered_map>
+ #include <mutex>
++#include <utility>
+ #include <ctype.h>
+ 
+ /*! Fixed size cache for value type V using keys of type K.

From 1a347230e8477be82ca94f73d373ebcf85523bdd Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 21 Aug 2022 15:12:00 -0700
Subject: [PATCH 16/52] libproxy: update to 0.4.18

---
 srcpkgs/libproxy/template | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/libproxy/template b/srcpkgs/libproxy/template
index d6103007032e..6599dfb69b98 100644
--- a/srcpkgs/libproxy/template
+++ b/srcpkgs/libproxy/template
@@ -1,18 +1,22 @@
 # Template file for 'libproxy'
 pkgname=libproxy
-version=0.4.15
+version=0.4.18
 revision=1
 build_style=cmake
 configure_args="-DWITH_GNOME=0 -DWITH_KDE4=0 -DWITH_MOZJS=0 -DWITH_NM=0
  -DWITH_PERL=0 -DWITH_PYTHON=1 -DWITH_WEBKIT=0"
 hostmakedepends="pkg-config python"
 makedepends="zlib-devel"
-short_desc="A library handling all the details of proxy configuration"
+short_desc="Library handling all the details of proxy configuration"
 maintainer="Orphaned <orphan@voidlinux.org>"
+license="LGPL-2.1-or-later"
 homepage="http://github.com/libproxy/libproxy"
-license="LGPL-2.1"
-distfiles="https://github.com/libproxy/libproxy/archive/${version}.tar.gz>${pkgname}-${version}.tar.gz"
-checksum=18f58b0a0043b6881774187427ead158d310127fc46a1c668ad6d207fb28b4e0
+distfiles="https://github.com/libproxy/libproxy/archive/${version}.tar.gz"
+checksum=0b4a9218d88f6cf9fa25996a3f38329a11f688a9d026141d9d0e966d8fa63837
+
+post_patch() {
+	vsed '/add_test(NAME url-test/d' -i libproxy/test/CMakeLists.txt
+}
 
 libproxy-devel_package() {
 	depends="libproxy>=${version}_${revision}"

From 6ae35e96818f70aa3c2bacd0537241cb861b4317 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 21 Aug 2022 17:05:39 -0700
Subject: [PATCH 17/52] exempi: update to 2.6.2

---
 ...f034705fd2d032c81383eee8208fd4eee0ac.patch | 43 -------------------
 srcpkgs/exempi/template                       |  4 +-
 2 files changed, 2 insertions(+), 45 deletions(-)
 delete mode 100644 srcpkgs/exempi/patches/8ed2f034705fd2d032c81383eee8208fd4eee0ac.patch

diff --git a/srcpkgs/exempi/patches/8ed2f034705fd2d032c81383eee8208fd4eee0ac.patch b/srcpkgs/exempi/patches/8ed2f034705fd2d032c81383eee8208fd4eee0ac.patch
deleted file mode 100644
index 2696793cec09..000000000000
--- a/srcpkgs/exempi/patches/8ed2f034705fd2d032c81383eee8208fd4eee0ac.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From 8ed2f034705fd2d032c81383eee8208fd4eee0ac Mon Sep 17 00:00:00 2001
-From: Victor Rodriguez <victor.rodriguez.bahena@intel.com>
-Date: Sat, 18 Aug 2018 13:54:55 +0000
-Subject: [PATCH] Issue #9 - Fix null-pointer-dereference (CVE-2018-12648)
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-The WEBP::GetLE32 function in
-XMPFiles/source/FormatSupport/WEBP_Support.hpp in Exempi 2.4.5 has a
-NULL pointer dereference.
-
-https://bugs.freedesktop.org/show_bug.cgi?id=106981
-https://gitlab.freedesktop.org/libopenraw/exempi/issues/9
-
-Signed-off-by: Victor Rodriguez <victor.rodriguez.bahena@intel.com>
-Signed-off-by: Hubert Figuière <hub@figuiere.net>
----
- XMPFiles/source/FormatSupport/WEBP_Support.cpp | 8 +++++---
- 1 file changed, 5 insertions(+), 3 deletions(-)
-
-diff --git a/XMPFiles/source/FormatSupport/WEBP_Support.cpp b/XMPFiles/source/FormatSupport/WEBP_Support.cpp
-index ffaf220..4fe705b 100644
---- a/XMPFiles/source/FormatSupport/WEBP_Support.cpp
-+++ b/XMPFiles/source/FormatSupport/WEBP_Support.cpp
-@@ -160,9 +160,11 @@ bool VP8XChunk::xmp()
- }
- void VP8XChunk::xmp(bool hasXMP)
- {
--    XMP_Uns32 flags = GetLE32(&this->data[0]);
--    flags ^= (-hasXMP ^ flags) & (1 << XMP_FLAG_BIT);
--    PutLE32(&this->data[0], flags);
-+    if (&this->data[0] != NULL) {
-+        XMP_Uns32 flags = GetLE32(&this->data[0]);
-+        flags ^= (-hasXMP ^ flags) & (1 << XMP_FLAG_BIT);
-+        PutLE32(&this->data[0], flags);
-+    }
- }
- 
- Container::Container(WEBP_MetaHandler* handler) : Chunk(NULL, handler)
--- 
-2.18.0
-
diff --git a/srcpkgs/exempi/template b/srcpkgs/exempi/template
index 14753617953a..d664f7dc4d80 100644
--- a/srcpkgs/exempi/template
+++ b/srcpkgs/exempi/template
@@ -1,6 +1,6 @@
 # Template file for 'exempi'
 pkgname=exempi
-version=2.5.0
+version=2.6.2
 revision=1
 build_style=gnu-configure
 configure_args="--with-boost=${XBPS_CROSS_BASE}/usr --disable-static --disable-unittest"
@@ -10,7 +10,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="BSD-3-Clause"
 homepage="https://libopenraw.freedesktop.org/wiki/Exempi"
 distfiles="https://libopenraw.freedesktop.org/download/exempi-${version}.tar.bz2"
-checksum=dc82fc24c0540a44a63fa4ad21775d24e00e63f1dedd3e2ae6f7aa27583b711b
+checksum=4d17d4c93df2a95da3e3172c45b7a5bf317dd31dafd1c7a340169728c7089d1d
 
 post_install() {
 	vlicense COPYING

From b3d09337f14bad993bdca3e79abc92ad17d49482 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 21 Aug 2022 21:36:03 -0700
Subject: [PATCH 18/52] plymouth: update to 22.02.122

---
 srcpkgs/plymouth/patches/fix-glibc-2.36.patch | 30 +++++++++++++++++++
 srcpkgs/plymouth/template                     |  4 +--
 2 files changed, 32 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/plymouth/patches/fix-glibc-2.36.patch

diff --git a/srcpkgs/plymouth/patches/fix-glibc-2.36.patch b/srcpkgs/plymouth/patches/fix-glibc-2.36.patch
new file mode 100644
index 000000000000..2f1e43875cfb
--- /dev/null
+++ b/srcpkgs/plymouth/patches/fix-glibc-2.36.patch
@@ -0,0 +1,30 @@
+From 5f1e43c00039a7fe1fff768b91a05a695fb4a53d Mon Sep 17 00:00:00 2001
+From: Ray Strode <rstrode@redhat.com>
+Date: Wed, 3 Aug 2022 15:23:33 -0400
+Subject: [PATCH] ply-utils: Drop linux/fs.h include
+
+It was needed long ago for a function we no longer even have.
+
+Now it's causing compile errors on Fedora 37 because it's conflicting
+with sys/mount.h.
+
+This commit drops it.
+---
+ src/libply/ply-utils.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/src/libply/ply-utils.c b/src/libply/ply-utils.c
+index c7b165e9..219e2e77 100644
+--- a/src/libply/ply-utils.c
++++ b/src/libply/ply-utils.c
+@@ -46,7 +46,6 @@
+ #include <sys/user.h>
+ #include <sys/wait.h>
+ #include <time.h>
+-#include <linux/fs.h>
+ #include <linux/vt.h>
+ 
+ #include <dlfcn.h>
+-- 
+GitLab
+
diff --git a/srcpkgs/plymouth/template b/srcpkgs/plymouth/template
index 17f801fc5315..442ab58a99cd 100644
--- a/srcpkgs/plymouth/template
+++ b/srcpkgs/plymouth/template
@@ -1,6 +1,6 @@
 # Template file for 'plymouth'
 pkgname=plymouth
-version=0.9.5
+version=22.02.122
 revision=1
 build_style=gnu-configure
 configure_args="--with-system-root-install=no \
@@ -18,7 +18,7 @@ maintainer="William OD <obirik2005@gmail.com>"
 license="GPL-2.0-or-later"
 homepage="https://www.freedesktop.org/wiki/Software/Plymouth/"
 distfiles="${FREEDESKTOP_SITE}/plymouth/releases/$pkgname-$version.tar.xz"
-checksum=ecae257f351d098340542a5bc06de029404c24dcee87e6ebb2abd5ef117fce86
+checksum=100551442221033ce868c447ad6c74d831d209c18ae232b98ae0207e34eadaeb
 
 build_options="gtk3 pango"
 build_options_default="gtk3 pango"

From 406f32d2ee2063686711d015d55410ef17b459b1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 21 Aug 2022 21:37:00 -0700
Subject: [PATCH 19/52] openjdk7-bootstrap: fix build for gcc12

---
 .../files/dist_patches_glibc.txt              |  1 +
 .../files/dist_patches_musl.txt               |  1 +
 .../icedtea-pointer-comparison-gcc12.patch    | 31 +++++++++++++++++++
 3 files changed, 33 insertions(+)
 create mode 100644 srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch

diff --git a/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt b/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt
index c76c56855441..8061756dfc0c 100644
--- a/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt
+++ b/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt
@@ -6,3 +6,4 @@ icedtea-jdk-no-soname.patch
 icedtea-jdk-xattr.patch
 icedtea-jdk-sysctl_h.patch
 icedtea-cpio.patch
+icedtea-pointer-comparison-gcc12.patch
diff --git a/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt b/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt
index 21812517c7c2..8b35d9c46989 100644
--- a/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt
+++ b/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt
@@ -11,3 +11,4 @@ icedtea-jdk-musl.patch
 icedtea-jdk-no-soname.patch
 icedtea-jdk-xattr.patch
 icedtea-cpio.patch
+icedtea-pointer-comparison-gcc12.patch
diff --git a/srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch b/srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch
new file mode 100644
index 000000000000..c809553443e7
--- /dev/null
+++ b/srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch
@@ -0,0 +1,31 @@
+--- openjdk.orig/hotspot/src/share/vm/opto/lcm.cpp
++++ openjdk/hotspot/src/share/vm/opto/lcm.cpp
+@@ -60,7 +60,7 @@
+ // Check whether val is not-null-decoded compressed oop,
+ // i.e. will grab into the base of the heap if it represents NULL.
+ static bool accesses_heap_base_zone(Node *val) {
+-  if (Universe::narrow_oop_base() > 0) { // Implies UseCompressedOops.
++  if (Universe::narrow_oop_base() > (address)0) { // Implies UseCompressedOops.
+     if (val && val->is_Mach()) {
+       if (val->as_Mach()->ideal_Opcode() == Op_DecodeN) {
+         // This assumes all Decodes with TypePtr::NotNull are matched to nodes that
+--- openjdk.orig/hotspot/src/share/vm/runtime/virtualspace.cpp
++++ openjdk/hotspot/src/share/vm/runtime/virtualspace.cpp
+@@ -527,7 +527,7 @@ ReservedHeapSpace::ReservedHeapSpace(siz
+                 (UseCompressedOops && (Universe::narrow_oop_base() != NULL) &&
+                  Universe::narrow_oop_use_implicit_null_checks()) ?
+                   lcm(os::vm_page_size(), alignment) : 0) {
+-  if (base() > 0) {
++  if (base() > (char*)0) {
+     MemTracker::record_virtual_memory_type((address)base(), mtJavaHeap);
+   }
+ 
+@@ -546,7 +546,7 @@ ReservedHeapSpace::ReservedHeapSpace(con
+                 (UseCompressedOops && (Universe::narrow_oop_base() != NULL) &&
+                  Universe::narrow_oop_use_implicit_null_checks()) ?
+                   lcm(os::vm_page_size(), prefix_align) : 0) {
+-  if (base() > 0) {
++  if (base() > (char*)0) {
+     MemTracker::record_virtual_memory_type((address)base(), mtJavaHeap);
+   }
+ 

From e8ad64269233f2c8b435b581316c5fea68fe11e4 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 23:30:16 -0700
Subject: [PATCH 20/52] libunique1: relax warnings for gcc12

---
 srcpkgs/libunique1/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/libunique1/template b/srcpkgs/libunique1/template
index f73931b0c72b..c5a0f5c27860 100644
--- a/srcpkgs/libunique1/template
+++ b/srcpkgs/libunique1/template
@@ -15,7 +15,7 @@ homepage="https://wiki.gnome.org/Attic/LibUnique"
 distfiles="${GNOME_SITE}/libunique/1.1/libunique-${version}.tar.bz2"
 checksum=e5c8041cef8e33c55732f06a292381cb345db946cf792a4ae18aa5c66cdd4fbb
 
-CFLAGS="-Wno-deprecated-declarations"
+CFLAGS="-Wno-deprecated-declarations -Wno-incompatible-pointer-types"
 
 # Package build options
 build_options="gir"

From 8bfae80588ee59043ac916eac634c792f245a87a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:39:52 -0700
Subject: [PATCH 21/52] libvirt: fix build for glibc 2.36

---
 .../patches/lxc-fix-compat-glibc-2.36.patch   | 34 ++++++++++++++++
 .../virfile-fix-compat-glibc-2.36.patch       | 39 +++++++++++++++++++
 2 files changed, 73 insertions(+)
 create mode 100644 srcpkgs/libvirt/patches/lxc-fix-compat-glibc-2.36.patch
 create mode 100644 srcpkgs/libvirt/patches/virfile-fix-compat-glibc-2.36.patch

diff --git a/srcpkgs/libvirt/patches/lxc-fix-compat-glibc-2.36.patch b/srcpkgs/libvirt/patches/lxc-fix-compat-glibc-2.36.patch
new file mode 100644
index 000000000000..d85b57815010
--- /dev/null
+++ b/srcpkgs/libvirt/patches/lxc-fix-compat-glibc-2.36.patch
@@ -0,0 +1,34 @@
+From 9493c9b79dc541ec9e0fd73c6d87bdf8d30aaa90 Mon Sep 17 00:00:00 2001
+From: Cole Robinson <crobinso@redhat.com>
+Date: Mon, 1 Aug 2022 15:20:38 -0400
+Subject: [PATCH] lxc: containter: fix build with glibc 2.36
+
+With glibc 2.36, sys/mount.h and linux/mount.h conflict:
+https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
+
+lxc_container.c imports sys/mount.h and linux/fs.h, which pulls in
+linux/mount.h.
+
+linux/fs.h isn't required here though. glibc sys/mount.h has had
+MS_MOVE since 2.12 in 2010
+
+Reviewed-by: Erik Skultety <eskultet@redhat.com>
+Signed-off-by: Cole Robinson <crobinso@redhat.com>
+---
+ src/lxc/lxc_container.c | 3 ---
+ 1 file changed, 3 deletions(-)
+
+diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
+index b5278831da7..a5401c2186e 100644
+--- a/src/lxc/lxc_container.c
++++ b/src/lxc/lxc_container.c
+@@ -33,9 +33,6 @@
+ /* Yes, we want linux private one, for _syscall2() macro */
+ #include <linux/unistd.h>
+ 
+-/* For MS_MOVE */
+-#include <linux/fs.h>
+-
+ #if WITH_CAPNG
+ # include <cap-ng.h>
+ #endif
diff --git a/srcpkgs/libvirt/patches/virfile-fix-compat-glibc-2.36.patch b/srcpkgs/libvirt/patches/virfile-fix-compat-glibc-2.36.patch
new file mode 100644
index 000000000000..2ef227ea9b54
--- /dev/null
+++ b/srcpkgs/libvirt/patches/virfile-fix-compat-glibc-2.36.patch
@@ -0,0 +1,39 @@
+From c0d9adf220dc0d223330a7bac37b174132d330ba Mon Sep 17 00:00:00 2001
+From: Cole Robinson <crobinso@redhat.com>
+Date: Mon, 1 Aug 2022 15:24:01 -0400
+Subject: [PATCH] virfile: Fix build with glibc 2.36
+
+With glibc 2.36, sys/mount.h and linux/mount.h conflict:
+https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
+
+virfile.c imports sys/mount.h and linux/fs.h, which pulls in
+linux/mount.h.
+
+Manually define the constants we need from linux/fs.h, like was
+done in llvm:
+
+https://reviews.llvm.org/rGb379129c4beb3f26223288627a1291739f33af02
+
+Reviewed-by: Erik Skultety <eskultet@redhat.com>
+Signed-off-by: Cole Robinson <crobinso@redhat.com>
+---
+ src/util/virfile.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/src/util/virfile.c b/src/util/virfile.c
+index 99da058db3b..ce541b8946b 100644
+--- a/src/util/virfile.c
++++ b/src/util/virfile.c
+@@ -71,7 +71,11 @@
+ # endif
+ # include <sys/ioctl.h>
+ # include <linux/cdrom.h>
+-# include <linux/fs.h>
++/* These come from linux/fs.h, but that header conflicts with
++ * sys/mount.h on glibc 2.36+ */
++# define FS_IOC_GETFLAGS _IOR('f', 1, long)
++# define FS_IOC_SETFLAGS _IOW('f', 2, long)
++# define FS_NOCOW_FL 0x00800000
+ #endif
+ 
+ #if WITH_LIBATTR

From cfb187484bb12efa252c6cda6489dae63ba6face Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:41:50 -0700
Subject: [PATCH 22/52] efivar: fix build for glibc 2.36

---
 .../patches/fix-compat-glibc-2.36.patch       | 55 +++++++++++++++++++
 1 file changed, 55 insertions(+)
 create mode 100644 srcpkgs/efivar/patches/fix-compat-glibc-2.36.patch

diff --git a/srcpkgs/efivar/patches/fix-compat-glibc-2.36.patch b/srcpkgs/efivar/patches/fix-compat-glibc-2.36.patch
new file mode 100644
index 000000000000..fcc83aef20cf
--- /dev/null
+++ b/srcpkgs/efivar/patches/fix-compat-glibc-2.36.patch
@@ -0,0 +1,55 @@
+From bc65d63ebf8fe6ac8a099ff15ca200986dba1565 Mon Sep 17 00:00:00 2001
+From: Robbie Harwood <rharwood@redhat.com>
+Date: Thu, 28 Jul 2022 16:11:24 -0400
+Subject: [PATCH] Fix glibc 2.36 build (mount.h conflicts)
+
+glibc has decided that sys/mount.h and linux/mount.h are no longer
+usable at the same time.  This broke the build, since linux/fs.h itself
+includes linux/mount.h.  For now, fix the build by only including
+sys/mount.h where we need it.
+
+See-also: https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
+Resolves: #227
+Signed-off-by: Robbie Harwood <rharwood@redhat.com>
+---
+ src/gpt.c   | 1 +
+ src/linux.c | 1 +
+ src/util.h  | 1 -
+ 3 files changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/gpt.c b/src/gpt.c
+index 1eda0497..21413c3b 100644
+--- a/src/gpt.c
++++ b/src/gpt.c
+@@ -17,6 +17,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <sys/mount.h>
+ #include <sys/param.h>
+ #include <sys/stat.h>
+ #include <sys/utsname.h>
+diff --git a/src/linux.c b/src/linux.c
+index 47e45ae4..1780816f 100644
+--- a/src/linux.c
++++ b/src/linux.c
+@@ -20,6 +20,7 @@
+ #include <stdbool.h>
+ #include <stdio.h>
+ #include <sys/ioctl.h>
++#include <sys/mount.h>
+ #include <sys/socket.h>
+ #include <sys/sysmacros.h>
+ #include <sys/types.h>
+diff --git a/src/util.h b/src/util.h
+index 3300666f..1e67e447 100644
+--- a/src/util.h
++++ b/src/util.h
+@@ -23,7 +23,6 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <sys/ioctl.h>
+-#include <sys/mount.h>
+ #include <sys/stat.h>
+ #include <sys/types.h>
+ #include <tgmath.h>

From c4243e60f0345ae36649b5b30ffb4fd675ffdb2f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:43:24 -0700
Subject: [PATCH 23/52] libwpd: fix build for gcc12

---
 srcpkgs/libwpd/patches/fix-compat-gcc12.patch | 11 +++++++++++
 1 file changed, 11 insertions(+)
 create mode 100644 srcpkgs/libwpd/patches/fix-compat-gcc12.patch

diff --git a/srcpkgs/libwpd/patches/fix-compat-gcc12.patch b/srcpkgs/libwpd/patches/fix-compat-gcc12.patch
new file mode 100644
index 000000000000..6ebce2463d16
--- /dev/null
+++ b/srcpkgs/libwpd/patches/fix-compat-gcc12.patch
@@ -0,0 +1,11 @@
+diff -rup libwpd-0.10.3.orig/src/lib/WPXTable.h libwpd-0.10.3/src/lib/WPXTable.h
+--- libwpd-0.10.3.orig/src/lib/WPXTable.h	2022-08-23 22:32:45.332593795 -0700
++++ libwpd-0.10.3/src/lib/WPXTable.h	2022-08-23 22:32:59.500651211 -0700
+@@ -37,6 +37,7 @@
+ #define _WPXTABLE_H
+ 
+ #include <vector>
++#include <cstddef>
+ 
+ struct WPXTableCell
+ {

From 26eb24210e3134ad8f1ad33a5132477f2aaefaf6 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:44:07 -0700
Subject: [PATCH 24/52] grub: fix build for binutils 2.36

---
 .../patches/fix-compat-binutils-2.36.patch    | 96 +++++++++++++++++++
 srcpkgs/grub/template                         |  7 +-
 2 files changed, 102 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/grub/patches/fix-compat-binutils-2.36.patch

diff --git a/srcpkgs/grub/patches/fix-compat-binutils-2.36.patch b/srcpkgs/grub/patches/fix-compat-binutils-2.36.patch
new file mode 100644
index 000000000000..d92a91e3253e
--- /dev/null
+++ b/srcpkgs/grub/patches/fix-compat-binutils-2.36.patch
@@ -0,0 +1,96 @@
+From b98275138bf4fc250a1c362dfd2c8b1cf2421701 Mon Sep 17 00:00:00 2001
+From: Michael Chang <mchang@suse.com>
+Date: Tue, 28 Sep 2021 13:50:47 +0800
+Subject: build: Fix build error with binutils 2.36
+
+The following procedure to build xen/pvgrub is broken.
+
+  git clone https://git.savannah.gnu.org/git/grub.git
+  cd grub
+  ./bootstrap
+  mkdir build-xen
+  cd build-xen
+  ../configure --with-platform=xen
+  make
+
+It fails with the message:
+
+  /usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld:
+  section .note.gnu.property VMA [0000000000400158,0000000000400187]
+  overlaps section .bss VMA [000000000000f000,000000000041e1af]
+
+The most significant factor is that new assembler (GNU as) generates the
+.note.gnu.property section as default. This note section overlaps with
+.bss because it doesn't reposition with -Wl,-Ttext,0 with which the base
+address of .text section is set, rather the address of .note.gnu.property
+is calculated for some reason from 0x400000 where the ELF executable
+defaults to start.
+
+Using -Ttext-segment doesn't help either, though it is said to set the
+address of the first byte of the text segment according to "man ld".
+What it actually does is to override the default 0x400000, aka the image
+base address, to something else. The entire process can be observed in
+the default linker script used by gcc [1]. Therefore we can't expect it
+to achieve the same thing as -Ttext given that the first segment where
+.text resides is offset by SIZEOF_HEADERS plus some sections may be
+preceding it within the first segment. The end result is .text always
+has to start with non-zero address with -Wl,-Ttext-segment,0 if using
+default linker script.
+
+It is also worth mentioning that binutils upstream apparently doesn't
+seem to consider this as a bug [2] and proposed to use -Wl,-Ttext-segment,0
+which is not fruitful as what has been tested by Gentoo [3].
+
+As long as GRUB didn't use ISA information encoded in .note.gnu.property,
+we can safely drop it via -Wa,-mx86-used-note=no assembler option to
+fix the linker error above.
+
+This is considered a better approach than using custom linker script to
+drop the .note.gnu.property section because object file manipulation can
+also be hampered one way or the other in that linker script may not be
+helpful. See also this commit removing the section in the process of objcopy.
+
+  6643507ce build: Fix GRUB i386-pc build with Ubuntu gcc
+
+[1] In /usr/lib64/ldscripts/elf_x86_64.x or use 'gcc -Wl,--verbose ...'
+    PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x400000));
+    . = SEGMENT_START("text-segment", 0x400000) + SIZEOF_HEADERS;
+[2] https://sourceware.org/bugzilla/show_bug.cgi?id=27377
+[3] https://bugs.gentoo.org/787221
+
+Signed-off-by: Michael Chang <mchang@suse.com>
+Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
+---
+ configure.ac | 14 ++++++++++++++
+ 1 file changed, 14 insertions(+)
+
+(limited to 'configure.ac')
+
+diff --git a/configure.ac b/configure.ac
+index eeb5d22..8d1c81a 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -840,6 +840,20 @@ if ( test "x$target_cpu" = xi386 || test "x$target_cpu" = xx86_64 ) && test "x$p
+   TARGET_CFLAGS="$TARGET_CFLAGS -mno-mmx -mno-sse -mno-sse2 -mno-sse3 -mno-3dnow"
+ fi
+ 
++if ( test "x$target_cpu" = xi386 || test "x$target_cpu" = xx86_64 ); then
++  AC_CACHE_CHECK([whether -Wa,-mx86-used-note works], [grub_cv_cc_mx86_used_note], [
++    CFLAGS="$TARGET_CFLAGS -Wa,-mx86-used-note=no -Werror"
++    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
++	[grub_cv_cc_mx86_used_note=yes],
++	[grub_cv_cc_mx86_used_note=no])
++  ])
++
++  if test "x$grub_cv_cc_mx86_used_note" = xyes; then
++    TARGET_CFLAGS="$TARGET_CFLAGS -Wa,-mx86-used-note=no"
++    TARGET_CCASFLAGS="$TARGET_CCASFLAGS -Wa,-mx86-used-note=no"
++  fi
++fi
++
+ # GRUB doesn't use float or doubles at all. Yet some toolchains may decide
+ # that floats are a good fit to run instead of what's written in the code.
+ # Given that floating point unit is disabled (if present to begin with)
+-- 
+cgit v1.1
+
diff --git a/srcpkgs/grub/template b/srcpkgs/grub/template
index b1826c38a884..b4d3b07af620 100644
--- a/srcpkgs/grub/template
+++ b/srcpkgs/grub/template
@@ -2,7 +2,8 @@
 pkgname=grub
 version=2.06
 revision=2
-hostmakedepends="python3 pkg-config flex freetype-devel font-unifont-bdf help2man"
+hostmakedepends="python3 pkg-config flex freetype-devel font-unifont-bdf help2man
+ automake gettext-devel-tools"
 makedepends="libusb-compat-devel ncurses-devel freetype-devel
  liblzma-devel device-mapper-devel fuse-devel"
 depends="os-prober"
@@ -43,6 +44,10 @@ case "$XBPS_TARGET_MACHINE" in
 		;;
 esac
 
+pre_configure() {
+	autoreconf -fi
+}
+
 do_configure() {
 	# workaround for https://savannah.gnu.org/bugs/?60458
 	# some more info: https://www.linuxquestions.org/questions/showthread.php?p=6257712

From eddf400c4f2df7773c483d483d0639a5aeab3ffa Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:45:07 -0700
Subject: [PATCH 25/52] linux-toos: fix build for binutils 2.39

---
 .../patches/binutils-add-compat-check.patch   | 103 ++++++++++++
 .../patches/binutils-disasm-compat.patch      | 102 ++++++++++++
 .../bpf_jit_disasm-binutils-2.39.patch        | 104 ++++++++++++
 .../patches/bpftool-binutils-2.39.patch       | 149 ++++++++++++++++++
 .../patches/perf-binutils-2.39.patch          | 114 ++++++++++++++
 5 files changed, 572 insertions(+)
 create mode 100644 srcpkgs/linux-tools/patches/binutils-add-compat-check.patch
 create mode 100644 srcpkgs/linux-tools/patches/binutils-disasm-compat.patch
 create mode 100644 srcpkgs/linux-tools/patches/bpf_jit_disasm-binutils-2.39.patch
 create mode 100644 srcpkgs/linux-tools/patches/bpftool-binutils-2.39.patch
 create mode 100644 srcpkgs/linux-tools/patches/perf-binutils-2.39.patch

diff --git a/srcpkgs/linux-tools/patches/binutils-add-compat-check.patch b/srcpkgs/linux-tools/patches/binutils-add-compat-check.patch
new file mode 100644
index 000000000000..e4e7ece9635e
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/binutils-add-compat-check.patch
@@ -0,0 +1,103 @@
+From cfd59ca91467056bb2c36907b2fa67b8e1af9952 Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:27 -0700
+Subject: [PATCH] tools build: Add feature test for init_disassemble_info API
+ changes
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation failures for tools/{perf,bpf}, e.g. on debian unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+This commit adds a feature test to detect the new signature.  Subsequent
+commits will use it to fix the build failures.
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Quentin Monnet <quentin@isovalent.com>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-2-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/build/Makefile.feature                        |  1 +
+ tools/build/feature/Makefile                        |  4 ++++
+ tools/build/feature/test-all.c                      |  4 ++++
+ tools/build/feature/test-disassembler-init-styled.c | 13 +++++++++++++
+ 4 files changed, 22 insertions(+)
+ create mode 100644 tools/build/feature/test-disassembler-init-styled.c
+
+diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature
+index 888a0421d43b96..8f6578e4d3249e 100644
+--- a/tools/build/Makefile.feature
++++ b/tools/build/Makefile.feature
+@@ -70,6 +70,7 @@ FEATURE_TESTS_BASIC :=                  \
+         libaio				\
+         libzstd				\
+         disassembler-four-args		\
++        disassembler-init-styled	\
+         file-handle
+ 
+ # FEATURE_TESTS_BASIC + FEATURE_TESTS_EXTRA is the complete list
+diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile
+index 7c2a17e23c30ac..c3059739318a95 100644
+--- a/tools/build/feature/Makefile
++++ b/tools/build/feature/Makefile
+@@ -18,6 +18,7 @@ FILES=                                          \
+          test-libbfd.bin                        \
+          test-libbfd-buildid.bin		\
+          test-disassembler-four-args.bin        \
++         test-disassembler-init-styled.bin	\
+          test-reallocarray.bin			\
+          test-libbfd-liberty.bin                \
+          test-libbfd-liberty-z.bin              \
+@@ -248,6 +249,9 @@ $(OUTPUT)test-libbfd-buildid.bin:
+ $(OUTPUT)test-disassembler-four-args.bin:
+ 	$(BUILD) -DPACKAGE='"perf"' -lbfd -lopcodes
+ 
++$(OUTPUT)test-disassembler-init-styled.bin:
++	$(BUILD) -DPACKAGE='"perf"' -lbfd -lopcodes
++
+ $(OUTPUT)test-reallocarray.bin:
+ 	$(BUILD)
+ 
+diff --git a/tools/build/feature/test-all.c b/tools/build/feature/test-all.c
+index 5ffafb967b6e49..957c02c7b163b5 100644
+--- a/tools/build/feature/test-all.c
++++ b/tools/build/feature/test-all.c
+@@ -166,6 +166,10 @@
+ # include "test-disassembler-four-args.c"
+ #undef main
+ 
++#define main main_test_disassembler_init_styled
++# include "test-disassembler-init-styled.c"
++#undef main
++
+ #define main main_test_libzstd
+ # include "test-libzstd.c"
+ #undef main
+diff --git a/tools/build/feature/test-disassembler-init-styled.c b/tools/build/feature/test-disassembler-init-styled.c
+new file mode 100644
+index 00000000000000..f1ce0ec3bee9d3
+--- /dev/null
++++ b/tools/build/feature/test-disassembler-init-styled.c
+@@ -0,0 +1,13 @@
++// SPDX-License-Identifier: GPL-2.0
++#include <stdio.h>
++#include <dis-asm.h>
++
++int main(void)
++{
++	struct disassemble_info info;
++
++	init_disassemble_info(&info, stdout,
++			      NULL, NULL);
++
++	return 0;
++}
diff --git a/srcpkgs/linux-tools/patches/binutils-disasm-compat.patch b/srcpkgs/linux-tools/patches/binutils-disasm-compat.patch
new file mode 100644
index 000000000000..1a6cc0e6d97c
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/binutils-disasm-compat.patch
@@ -0,0 +1,102 @@
+From a45b3d6926231c3d024ea0de4f7bd967f83709ee Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:29 -0700
+Subject: tools include: add dis-asm-compat.h to handle version differences
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation failures for tools/{perf,bpf}, e.g. on debian unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+This commit introduces a wrapper for init_disassemble_info(), to avoid
+spreading #ifdef DISASM_INIT_STYLED to a bunch of places. Subsequent
+commits will use it to fix the build failures.
+
+It likely is worth adding a wrapper for disassember(), to avoid the already
+existing DISASM_FOUR_ARGS_SIGNATURE ifdefery.
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Signed-off-by: Ben Hutchings <benh@debian.org>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Quentin Monnet <quentin@isovalent.com>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-4-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/include/tools/dis-asm-compat.h | 55 ++++++++++++++++++++++++++++++++++++
+ 1 file changed, 55 insertions(+)
+ create mode 100644 tools/include/tools/dis-asm-compat.h
+
+(limited to 'tools/include/tools/dis-asm-compat.h')
+
+diff --git a/tools/include/tools/dis-asm-compat.h b/tools/include/tools/dis-asm-compat.h
+new file mode 100644
+index 0000000000000..70f331e23ed3d
+--- /dev/null
++++ b/tools/include/tools/dis-asm-compat.h
+@@ -0,0 +1,55 @@
++/* SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause */
++#ifndef _TOOLS_DIS_ASM_COMPAT_H
++#define _TOOLS_DIS_ASM_COMPAT_H
++
++#include <stdio.h>
++#include <dis-asm.h>
++
++/* define types for older binutils version, to centralize ifdef'ery a bit */
++#ifndef DISASM_INIT_STYLED
++enum disassembler_style {DISASSEMBLER_STYLE_NOT_EMPTY};
++typedef int (*fprintf_styled_ftype) (void *, enum disassembler_style, const char*, ...);
++#endif
++
++/*
++ * Trivial fprintf wrapper to be used as the fprintf_styled_func argument to
++ * init_disassemble_info_compat() when normal fprintf suffices.
++ */
++static inline int fprintf_styled(void *out,
++				 enum disassembler_style style,
++				 const char *fmt, ...)
++{
++	va_list args;
++	int r;
++
++	(void)style;
++
++	va_start(args, fmt);
++	r = vfprintf(out, fmt, args);
++	va_end(args);
++
++	return r;
++}
++
++/*
++ * Wrapper for init_disassemble_info() that hides version
++ * differences. Depending on binutils version and architecture either
++ * fprintf_func or fprintf_styled_func will be called.
++ */
++static inline void init_disassemble_info_compat(struct disassemble_info *info,
++						void *stream,
++						fprintf_ftype unstyled_func,
++						fprintf_styled_ftype styled_func)
++{
++#ifdef DISASM_INIT_STYLED
++	init_disassemble_info(info, stream,
++			      unstyled_func,
++			      styled_func);
++#else
++	(void)styled_func;
++	init_disassemble_info(info, stream,
++			      unstyled_func);
++#endif
++}
++
++#endif /* _TOOLS_DIS_ASM_COMPAT_H */
+-- 
+cgit 
+
diff --git a/srcpkgs/linux-tools/patches/bpf_jit_disasm-binutils-2.39.patch b/srcpkgs/linux-tools/patches/bpf_jit_disasm-binutils-2.39.patch
new file mode 100644
index 000000000000..01221fad3a4a
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/bpf_jit_disasm-binutils-2.39.patch
@@ -0,0 +1,104 @@
+From 96ed066054abf11c7d3e106e3011a51f3f1227a3 Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:31 -0700
+Subject: [PATCH] tools bpf_jit_disasm: Fix compilation error with new binutils
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation to fail for tools/bpf/bpf_jit_disasm.c, e.g. on debian
+unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+Wire up the feature test and switch to init_disassemble_info_compat(),
+which were introduced in prior commits, fixing the compilation failure.
+
+I verified that bpf_jit_disasm can still disassemble bpf programs, both
+with the old and new dis-asm.h API. With old binutils there's no change in
+output before/after this patch. When comparing the output from old
+binutils (2.35) to new bintuils with the patch (upstream snapshot) there
+are a few output differences, but they are unrelated to this patch. An
+example hunk is:
+
+     f4:	mov    %r14,%rsi
+     f7:	mov    %r15,%rdx
+     fa:	mov    $0x2a,%ecx
+  -  ff:	callq  0xffffffffea8c4988
+  +  ff:	call   0xffffffffea8c4988
+    104:	test   %rax,%rax
+    107:	jge    0x0000000000000110
+    109:	xor    %eax,%eax
+  - 10b:	jmpq   0x0000000000000073
+  + 10b:	jmp    0x0000000000000073
+    110:	cmp    $0x16,%rax
+
+However, I had to use an older kernel to generate the bpf_jit_enabled =
+2 output, as that has been broken since 5.18 / 1022a5498f6f745c ("bpf,
+x86_64: Use bpf_jit_binary_pack_alloc").
+
+  https://lore.kernel.org/20220703030210.pmjft7qc2eajzi6c@alap3.anarazel.de
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Daniel Borkmann <daniel@iogearbox.net>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Quentin Monnet <quentin@isovalent.com>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-6-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/bpf/Makefile         | 5 ++++-
+ tools/bpf/bpf_jit_disasm.c | 5 ++++-
+ 2 files changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/tools/bpf/Makefile b/tools/bpf/Makefile
+index b11cfc86a3d021..664601ab1705ab 100644
+--- a/tools/bpf/Makefile
++++ b/tools/bpf/Makefile
+@@ -34,7 +34,7 @@ else
+ endif
+ 
+ FEATURE_USER = .bpf
+-FEATURE_TESTS = libbfd disassembler-four-args
++FEATURE_TESTS = libbfd disassembler-four-args disassembler-init-styled
+ FEATURE_DISPLAY = libbfd disassembler-four-args
+ 
+ check_feat := 1
+@@ -56,6 +56,9 @@ endif
+ ifeq ($(feature-disassembler-four-args), 1)
+ CFLAGS += -DDISASM_FOUR_ARGS_SIGNATURE
+ endif
++ifeq ($(feature-disassembler-init-styled), 1)
++CFLAGS += -DDISASM_INIT_STYLED
++endif
+ 
+ $(OUTPUT)%.yacc.c: $(srctree)/tools/bpf/%.y
+ 	$(QUIET_BISON)$(YACC) -o $@ -d $<
+diff --git a/tools/bpf/bpf_jit_disasm.c b/tools/bpf/bpf_jit_disasm.c
+index c8ae9580472814..a90a5d110f9255 100644
+--- a/tools/bpf/bpf_jit_disasm.c
++++ b/tools/bpf/bpf_jit_disasm.c
+@@ -28,6 +28,7 @@
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <limits.h>
++#include <tools/dis-asm-compat.h>
+ 
+ #define CMD_ACTION_SIZE_BUFFER		10
+ #define CMD_ACTION_READ_ALL		3
+@@ -64,7 +65,9 @@ static void get_asm_insns(uint8_t *image, size_t len, int opcodes)
+ 	assert(bfdf);
+ 	assert(bfd_check_format(bfdf, bfd_object));
+ 
+-	init_disassemble_info(&info, stdout, (fprintf_ftype) fprintf);
++	init_disassemble_info_compat(&info, stdout,
++				     (fprintf_ftype) fprintf,
++				     fprintf_styled);
+ 	info.arch = bfd_get_arch(bfdf);
+ 	info.mach = bfd_get_mach(bfdf);
+ 	info.buffer = image;
diff --git a/srcpkgs/linux-tools/patches/bpftool-binutils-2.39.patch b/srcpkgs/linux-tools/patches/bpftool-binutils-2.39.patch
new file mode 100644
index 000000000000..1e55c40011be
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/bpftool-binutils-2.39.patch
@@ -0,0 +1,149 @@
+From 600b7b26c07a070d0153daa76b3806c1e52c9e00 Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:33 -0700
+Subject: [PATCH] tools bpftool: Fix compilation error with new binutils
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation to fail for tools/bpf/bpftool/jit_disasm.c, e.g. on debian
+unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+Wire up the feature test and switch to init_disassemble_info_compat(),
+which were introduced in prior commits, fixing the compilation failure.
+
+I verified that bpftool can still disassemble bpf programs, both with an
+old and new dis-asm.h API. There are no output changes for plain and json
+formats. When comparing the output from old binutils (2.35)
+to new bintuils with the patch (upstream snapshot) there are a few output
+differences, but they are unrelated to this patch. An example hunk is:
+
+     2f:	pop    %r14
+     31:	pop    %r13
+     33:	pop    %rbx
+  -  34:	leaveq
+  -  35:	retq
+  +  34:	leave
+  +  35:	ret
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Quentin Monnet <quentin@isovalent.com>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-8-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/bpf/bpftool/Makefile     |  5 +++-
+ tools/bpf/bpftool/jit_disasm.c | 42 +++++++++++++++++++++++++++-------
+ 2 files changed, 38 insertions(+), 9 deletions(-)
+
+diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile
+index c6d2c77d02524a..436e671b2657d4 100644
+--- a/tools/bpf/bpftool/Makefile
++++ b/tools/bpf/bpftool/Makefile
+@@ -62,7 +62,7 @@ CLANG ?= clang
+ LLVM_STRIP ?= llvm-strip
+ 
+ FEATURE_USER = .bpftool
+-FEATURE_TESTS = libbfd disassembler-four-args reallocarray zlib libcap \
++FEATURE_TESTS = libbfd disassembler-four-args disassembler-init-styled reallocarray zlib libcap \
+ 	clang-bpf-co-re
+ FEATURE_DISPLAY = libbfd disassembler-four-args zlib libcap \
+ 	clang-bpf-co-re
+@@ -117,6 +117,9 @@ endif
+ ifeq ($(feature-disassembler-four-args), 1)
+ CFLAGS += -DDISASM_FOUR_ARGS_SIGNATURE
+ endif
++ifeq ($(feature-disassembler-init-styled), 1)
++    CFLAGS += -DDISASM_INIT_STYLED
++endif
+ 
+ LIBS = $(LIBBPF) -lelf -lz
+ LIBS_BOOTSTRAP = $(LIBBPF_BOOTSTRAP) -lelf -lz
+diff --git a/tools/bpf/bpftool/jit_disasm.c b/tools/bpf/bpftool/jit_disasm.c
+index 24734f2249d6ec..aaf99a0168c90b 100644
+--- a/tools/bpf/bpftool/jit_disasm.c
++++ b/tools/bpf/bpftool/jit_disasm.c
+@@ -24,6 +24,7 @@
+ #include <sys/stat.h>
+ #include <limits.h>
+ #include <bpf/libbpf.h>
++#include <tools/dis-asm-compat.h>
+ 
+ #include "json_writer.h"
+ #include "main.h"
+@@ -39,15 +40,12 @@ static void get_exec_path(char *tpath, s
+ }
+ 
+ static int oper_count;
+-static int fprintf_json(void *out, const char *fmt, ...)
++static int printf_json(void *out, const char *fmt, va_list ap)
+ {
+-	va_list ap;
+ 	char *s;
+ 
+-	va_start(ap, fmt);
+ 	if (vasprintf(&s, fmt, ap) < 0)
+ 		return -1;
+-	va_end(ap);
+ 
+ 	if (!oper_count) {
+ 		int i;
+@@ -73,6 +71,32 @@ static int fprintf_json(void *out, const char *fmt, ...)
+ 	return 0;
+ }
+ 
++static int fprintf_json(void *out, const char *fmt, ...)
++{
++	va_list ap;
++	int r;
++
++	va_start(ap, fmt);
++	r = printf_json(out, fmt, ap);
++	va_end(ap);
++
++	return r;
++}
++
++static int fprintf_json_styled(void *out,
++			       enum disassembler_style style __maybe_unused,
++			       const char *fmt, ...)
++{
++	va_list ap;
++	int r;
++
++	va_start(ap, fmt);
++	r = printf_json(out, fmt, ap);
++	va_end(ap);
++
++	return r;
++}
++
+ void disasm_print_insn(unsigned char *image, ssize_t len, int opcodes,
+ 		       const char *arch, const char *disassembler_options,
+ 		       const struct btf *btf,
+@@ -99,11 +123,13 @@ void disasm_print_insn(unsigned char *image, ssize_t len, int opcodes,
+ 	assert(bfd_check_format(bfdf, bfd_object));
+ 
+ 	if (json_output)
+-		init_disassemble_info(&info, stdout,
+-				      (fprintf_ftype) fprintf_json);
++		init_disassemble_info_compat(&info, stdout,
++					     (fprintf_ftype) fprintf_json,
++					     fprintf_json_styled);
+ 	else
+-		init_disassemble_info(&info, stdout,
+-				      (fprintf_ftype) fprintf);
++		init_disassemble_info_compat(&info, stdout,
++					     (fprintf_ftype) fprintf,
++					     fprintf_styled);
+ 
+ 	/* Update architecture info for offload. */
+ 	if (arch) {
diff --git a/srcpkgs/linux-tools/patches/perf-binutils-2.39.patch b/srcpkgs/linux-tools/patches/perf-binutils-2.39.patch
new file mode 100644
index 000000000000..3484330f7286
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/perf-binutils-2.39.patch
@@ -0,0 +1,114 @@
+From 83aa0120487e8bc3f231e72c460add783f71f17c Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:30 -0700
+Subject: [PATCH] tools perf: Fix compilation error with new binutils
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation failures for tools/perf/util/annotate.c, e.g. on debian
+unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+Wire up the feature test and switch to init_disassemble_info_compat(),
+which were introduced in prior commits, fixing the compilation failure.
+
+I verified that perf can still disassemble bpf programs by using bpftrace
+under load, recording a perf trace, and then annotating the bpf "function"
+with and without the changes. With old binutils there's no change in output
+before/after this patch. When comparing the output from old binutils (2.35)
+to new bintuils with the patch (upstream snapshot) there are a few output
+differences, but they are unrelated to this patch. An example hunk is:
+
+       1.15 :   55:mov    %rbp,%rdx
+       0.00 :   58:add    $0xfffffffffffffff8,%rdx
+       0.00 :   5c:xor    %ecx,%ecx
+  -    1.03 :   5e:callq  0xffffffffe12aca3c
+  +    1.03 :   5e:call   0xffffffffe12aca3c
+       0.00 :   63:xor    %eax,%eax
+  -    2.18 :   65:leaveq
+  -    2.82 :   66:retq
+  +    2.18 :   65:leave
+  +    2.82 :   66:ret
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-5-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/perf/Makefile.config | 8 ++++++++
+ tools/perf/util/annotate.c | 7 ++++---
+ 2 files changed, 12 insertions(+), 3 deletions(-)
+
+diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
+index d3c254c0f5c611..23648ea54e8d3d 100644
+--- a/tools/perf/Makefile.config
++++ b/tools/perf/Makefile.config
+@@ -298,6 +298,7 @@ FEATURE_CHECK_LDFLAGS-libpython := $(PYTHON_EMBED_LDOPTS)
+ FEATURE_CHECK_LDFLAGS-libaio = -lrt
+ 
+ FEATURE_CHECK_LDFLAGS-disassembler-four-args = -lbfd -lopcodes -ldl
++FEATURE_CHECK_LDFLAGS-disassembler-init-styled = -lbfd -lopcodes -ldl
+ 
+ CORE_CFLAGS += -fno-omit-frame-pointer
+ CORE_CFLAGS += -ggdb3
+@@ -818,13 +819,16 @@ else
+   ifeq ($(feature-libbfd-liberty), 1)
+     EXTLIBS += -lbfd -lopcodes -liberty
+     FEATURE_CHECK_LDFLAGS-disassembler-four-args += -liberty -ldl
++    FEATURE_CHECK_LDFLAGS-disassembler-init-styled += -liberty -ldl
+   else
+     ifeq ($(feature-libbfd-liberty-z), 1)
+       EXTLIBS += -lbfd -lopcodes -liberty -lz
+       FEATURE_CHECK_LDFLAGS-disassembler-four-args += -liberty -lz -ldl
++      FEATURE_CHECK_LDFLAGS-disassembler-init-styled += -liberty -lz -ldl
+     endif
+   endif
+   $(call feature_check,disassembler-four-args)
++  $(call feature_check,disassembler-init-styled)
+ endif
+ 
+ ifeq ($(feature-libbfd-buildid), 1)
+@@ -1044,6 +1048,10 @@ ifeq ($(feature-disassembler-four-args), 1)
+     CFLAGS += -DDISASM_FOUR_ARGS_SIGNATURE
+ endif
+ 
++ifeq ($(feature-disassembler-init-styled), 1)
++    CFLAGS += -DDISASM_INIT_STYLED
++endif
++
+ ifeq (${IS_64_BIT}, 1)
+   ifndef NO_PERF_READ_VDSO32
+     $(call feature_check,compile-32)
+diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
+index 82cc396ef516c4..2c6a485c3de5d9 100644
+--- a/tools/perf/util/annotate.c
++++ b/tools/perf/util/annotate.c
+@@ -1676,6 +1676,7 @@ fallback:
+ #define PACKAGE "perf"
+ #include <bfd.h>
+ #include <dis-asm.h>
++#include <tools/dis-asm-compat.h>
+ 
+ static int symbol__disassemble_bpf(struct symbol *sym,
+ 				   struct annotate_args *args)
+@@ -1762,9 +1763,9 @@ static int symbol__disassemble_bpf(struct symbol *sym,
+ 		ret = errno;
+ 		goto out;
+ 	}
+-	init_disassemble_info(&info, s,
+-			      (fprintf_ftype) fprintf);
+-
++	init_disassemble_info_compat(&info, s,
++				     (fprintf_ftype) fprintf,
++				     fprintf_styled);
+ 	info.arch = bfd_get_arch(bfdf);
+ 	info.mach = bfd_get_mach(bfdf);
+ 

From 722c3fd4d9baa15cace878876b3887e67bceabed Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 14:45:28 -0700
Subject: [PATCH 26/52] libsasl: fix build for libtool 2.4.7

---
 srcpkgs/libsasl/template | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/libsasl/template b/srcpkgs/libsasl/template
index a8817042f843..a2993b39f4a1 100644
--- a/srcpkgs/libsasl/template
+++ b/srcpkgs/libsasl/template
@@ -19,6 +19,7 @@ distfiles="https://github.com/cyrusimap/cyrus-sasl/releases/download/cyrus-sasl-
 checksum=26866b1549b00ffd020f188a43c258017fa1c382b3ddadd8201536f72efb05d5
 
 pre_configure() {
+	rm -f m4/ltversion.m4
 	autoreconf -fi
 }
 

From f48a1c4ea5b0822e2af3f00ae05e490892f60c7b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:08 -0700
Subject: [PATCH 27/52] subversion: fix build for libtool 2.4.7

---
 srcpkgs/subversion/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion/template b/srcpkgs/subversion/template
index 8ad178264942..3f1c9e254e61 100644
--- a/srcpkgs/subversion/template
+++ b/srcpkgs/subversion/template
@@ -57,7 +57,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From 10f945eb921c9f92a8188162b9a5aceca3a6e9c5 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:38 -0700
Subject: [PATCH 28/52] subversion-kwallet-auth: fix build for libtool 2.4.7

---
 srcpkgs/subversion-kwallet-auth/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion-kwallet-auth/template b/srcpkgs/subversion-kwallet-auth/template
index 12210f250d51..b4d8621456ea 100644
--- a/srcpkgs/subversion-kwallet-auth/template
+++ b/srcpkgs/subversion-kwallet-auth/template
@@ -59,7 +59,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From 302a4516283a687a3e31966e0707ba1ac8a6e353 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 20:07:32 -0700
Subject: [PATCH 29/52] gpgme: update to 1.18.0.

---
 common/shlibs          | 2 +-
 srcpkgs/gpgme/template | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 52220e69706d..98017bdd5e3d 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -723,7 +723,7 @@ libdconf.so.1 dconf-0.13.90_1
 libassuan.so.0 libassuan-2.0.1_1
 libgpgme.so.11 libgpgme-1.12.0_2
 libgpgmepp.so.6 gpgmepp-1.7.0_3
-libqgpgme.so.7 gpgmeqt-1.7.0_3
+libqgpgme.so.15 gpgmeqt-1.18.0_1
 libgarcon-1.so.0 garcon-0.1.12_1
 libgarcon-gtk2-1.so.0 garcon-0.4.0_1
 libgarcon-gtk3-1.so.0 garcon-0.6.1_1
diff --git a/srcpkgs/gpgme/template b/srcpkgs/gpgme/template
index 8633075a8404..b1cfd5f78657 100644
--- a/srcpkgs/gpgme/template
+++ b/srcpkgs/gpgme/template
@@ -1,7 +1,7 @@
 # Template file for 'gpgme'
 pkgname=gpgme
-version=1.15.1
-revision=2
+version=1.18.0
+revision=1
 build_style=gnu-configure
 configure_args="--enable-fd-passing
  --with-libgpg-error-prefix=$XBPS_CROSS_BASE/usr
@@ -14,7 +14,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.gnupg.org/software/gpgme/index.html"
 distfiles="https://www.gnupg.org/ftp/gcrypt/gpgme/gpgme-${version}.tar.bz2"
-checksum=eebc3c1b27f1c8979896ff361ba9bb4778b508b2496c2fc10e3775a40b1de1ad
+checksum=361d4eae47ce925dba0ea569af40e7b52c645c4ae2e65e5621bf1b6cdd8b0e9e
 
 if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
 	configure_args+=" ac_cv_sys_file_offset_bits=no"

From a35a08762e4d2d0cb010da811e2295da607e133e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 30/52] cross-aarch64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..bd6b23f9fb6a 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 229175a208a450fa4deab0a43d1040b2afd46079 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 31/52] cross-aarch64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..427ad2c1e9cd 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From bcd4e20d8d80f4d13a6a566a49e7c199db425401 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 32/52] cross-arm-linux-gnueabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..2510ee26e789 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From e4e13b824f1b8812ccbd6b6fa365ede50e044d56 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 33/52] cross-arm-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..bd8b16e1b4c1 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 38375c33256e1e3b3de98444b60f94b5df9f9553 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 34/52] cross-arm-linux-musleabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..dacfd2655216 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 8b0281440111f48f450fe2c261154a1211b7eae2 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 35/52] cross-arm-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..9ddd32a9f20d 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 458f3fe5c6f3d83cfdfc2033faec1c73effb3b7f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 36/52] cross-armv7l-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..9fb00f18be3b 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 7bcdd8894620d64a5b060d5eede73ce66aacc966 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 37/52] cross-armv7l-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..2c72e75ddfe3 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 56f5fca36b5f584fe06dc10f3ee007fcb5cf8a16 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 38/52] cross-i686-pc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..4dc17df648b5 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From d84095b899479b90360f911cdfe05b766b1b7aa0 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 39/52] cross-mips-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..6009e5c79eb2 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 84bfc750f0578828a70deaca3a7ed39b56ded40e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 40/52] cross-mips-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..080164df193d 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="hipperson0 <hipperson0@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From e46c8d4138e1e9dd419fbb94889c676b81e85552 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 41/52] cross-mipsel-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..c8f90cfa43cc 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_musl_version=1.1.24
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 8b0d0e446e5f2af45fe31e45340ebc8e62e38c03 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 42/52] cross-mipsel-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..931345d2de15 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_musl_version=1.1.24
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 2da20927c9f97db25adb858d21e19925c2774e07 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 43/52] cross-powerpc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..31e57b4e52b2 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From c27b9287db7f65e6732af57aa309a1776dede175 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 44/52] cross-powerpc-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..a2d1edcf1ffd 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From a216f9843c2acb715d2a95c313707e11e779c394 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 45/52] cross-powerpc64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..1a4cbed61e76 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 99cf68c14d773c43b9ad9684aabd35172a075aa8 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 46/52] cross-powerpc64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 1ebd0fb2048d..ade42018af05 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 2e5b0a1e33c72e8b65915effe0a81207a4096933 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 47/52] cross-powerpc64le-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 733f5851da5c..dd1ad383a21e 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 6cef80d25264b86553e7b478fa158062d587c1a5 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 48/52] cross-powerpc64le-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index 76a70aa1d6db..5887f845f932 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 80aff917621e0aa959b13d515f9a2bdb8cf511bc Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 49/52] cross-powerpcle-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 347b8fcf4f55..06530e0d609b 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 01cfe4760752322a0737f51b04c05585728725d7 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:19 -0700
Subject: [PATCH 50/52] cross-powerpcle-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index ec9324ddaa99..e68c3962b49c 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 74af19675fbe5dd0527d3b34a25fa74a0dbd170e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:19 -0700
Subject: [PATCH 51/52] cross-x86_64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 0078fbe7224b..7da85c14b62d 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 0309408c96c8d7eac2aefae8fd9f69b892fda933 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:19 -0700
Subject: [PATCH 52/52] cross-x86_64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..2811de0d3c2e 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (51 preceding siblings ...)
  2022-08-25  2:33 ` oreo639
@ 2022-08-25  4:02 ` oreo639
  2022-08-25  9:01 ` oreo639
                   ` (211 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-08-25  4:02 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5538 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.2.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.2.0

This PR depends on: https://github.com/void-linux/void-packages/pull/32330

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

Also, keep in mind that the libgo musl patch here will need to be updated once musl is updated:
https://github.com/void-linux/void-packages/pull/34902/files#diff-1f42a95b93c9550178ff1fbccbef2f47a72711df15c24c9472e2550076978129R163-R176

This is the updated patch for reference:
https://github.com/alpinelinux/aports/blob/8acb21b8ee881e7ab1c812d9a66a17d2501b8730/main/gcc/0049-libgo-adjust-name-of-union-in-sigevent-struct.patch

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/38817
- [x] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [ ] llvm https://github.com/void-linux/void-packages/pull/38694
- [ ] m4 https://github.com/void-linux/void-packages/pull/33730
- [ ] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [ ] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [ ] libvirt https://github.com/void-linux/void-packages/pull/38842
- [ ] syslinux https://github.com/void-linux/void-packages/pull/38876
- [ ] efivar https://github.com/void-linux/void-packages/pull/38874

Known packages that needed to be fixed/updated for gcc12:
- [ ] linux5.18 (in this PR)
- [ ] openssh https://github.com/void-linux/void-packages/pull/38849
- [ ] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [ ] doxygen https://github.com/void-linux/void-packages/pull/38846
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/38817
- [ ] libproxy https://github.com/void-linux/void-packages/pull/38818
- [ ] exempi https://github.com/void-linux/void-packages/pull/38820
- [ ] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [ ] gpgme https://github.com/void-linux/void-packages/pull/38825
- [ ] libunique1 https://github.com/void-linux/void-packages/pull/38848 or https://github.com/void-linux/void-packages/pull/38873
- [ ] libwpd https://github.com/void-linux/void-packages/pull/38878

Needs to be fixed/updated for binutils:
- [ ] grub https://github.com/void-linux/void-packages/pull/38875
- [ ] linux-tools https://github.com/void-linux/void-packages/pull/38877

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [x] kde
- [x] lxde
- [x] lxqt

You can test the ISOs here:
https://drive.google.com/drive/folders/1ix92CYSLUP-KWjLxltdgG4e8Nu2JCY5n?usp=sharing

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 169136 bytes --]

From aa03fc3f96e66515966dba22223482d31e84ba9a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 01/52] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 15 +++--
 3 files changed, 28 insertions(+), 113 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..0578665c1a30 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkg-config"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -44,6 +45,12 @@ do_configure() {
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	# gprofng currently only supports x86 and aarch64 glibc.
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64|i386|aarch64) conf+=" --enable-gprofng" ;;
+		*) conf+=" --disable-gprofng" ;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"

From accc2d8e9f3b2e2e0739c3d006916684f41757f3 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 02/52] gcc: update to 12.2.0.

---
 common/shlibs                                 | 10 +--
 srcpkgs/gcc/files/gccgo-musl.patch            | 74 ++++---------------
 srcpkgs/gcc/files/libgnarl-musl.patch         | 18 ++---
 srcpkgs/gcc/files/libssp-musl.patch           | 10 +--
 srcpkgs/gcc/patches/libffi_gnulinux.patch     | 11 ---
 .../gcc/patches/libgcc-ibm128-no-tag.patch    | 10 ++-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |  2 +-
 srcpkgs/gcc/template                          | 25 +++----
 8 files changed, 52 insertions(+), 108 deletions(-)
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index f829ee12e80f..bde5320461ce 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.2.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.34 perl-5.34.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -848,8 +848,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.2.0_1
+libgnat-12.so libada-12.2.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1700,8 +1700,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.2.0_1
+libasan.so.8 libsanitizer-12.2.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..632ef951097b 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,17 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ a/libgo/go/runtime/os_linux.go
+@@ -363,9 +363,9 @@
+ 
+ 	var timerid int32
+ 	var sevp _sigevent
+-	sevp.sigev_notify = _SIGEV_THREAD_ID
++	sevp.sigev_notify = 4
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.sigev_notify_function))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..446741390d45 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,15 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
+version=12.2.0
+revision=1
 _patchver="${version%pre*}"
 _minorver="${_patchver%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 wrksrc=gcc-${version/pre/_pre}
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +19,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -396,7 +393,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}

From 7f05bdc9b4c258904b9ce48d6a361cafab566e82 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 03/52] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      |  6 ++--
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..08e35d466a44 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From abf41dbca75c8ff9253413e7dc851766ed3ab8e9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 04/52] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 1a4e1ca3d594..b04268908c2e 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="q66 <daniel@octaforge.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From 4269155fd1cffd1eaf1c356089bc49796f00c17a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 05/52] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 3 files changed, 55 insertions(+), 353 deletions(-)
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index bde5320461ce..52220e69706d 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From d2b9379a6ab9f82a3db1b7d4a1bd878e376c9d3f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 21:01:43 -0700
Subject: [PATCH 06/52] gcc-multilib: update to 12.2.0.

---
 srcpkgs/gcc-multilib/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index fcd25755aa75..1a26da26a991 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,16 +3,16 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _majorver="${version%.*}"
-wrksrc=gcc-${version/pre/_pre}
+wrksrc=gcc-${version}
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel

From 5b515e621ef841f3553765fb0c2831d673466833 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 16:22:03 -0700
Subject: [PATCH 07/52] llvm12: fix build for glibc 2.36

---
 .../compiler-rt-sanitizer-glibc-2.36.patch    | 59 +++++++++++++++++++
 1 file changed, 59 insertions(+)
 create mode 100644 srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch

diff --git a/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch b/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch
new file mode 100644
index 000000000000..e5f24dab8935
--- /dev/null
+++ b/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch
@@ -0,0 +1,59 @@
+From 9cf13067cb5088626ba7ee1ec4c42ec59c7995a0 Mon Sep 17 00:00:00 2001
+From: Fangrui Song <i@maskray.me>
+Date: Mon, 11 Jul 2022 12:53:34 -0700
+Subject: [PATCH] [sanitizer] Remove #include <linux/fs.h> to resolve
+ fsconfig_command/mount_attr conflict with glibc 2.36
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+It is generally not a good idea to mix usage of glibc headers and Linux UAPI
+headers (https://sourceware.org/glibc/wiki/Synchronizing_Headers). In glibc
+since 7eae6a91e9b1670330c9f15730082c91c0b1d570 (milestone: 2.36), sys/mount.h
+defines `fsconfig_command` which conflicts with linux/mount.h:
+
+    .../usr/include/linux/mount.h:95:6: error: redeclaration of ‘enum fsconfig_command’
+
+Remove #include <linux/fs.h> which pulls in linux/mount.h. Expand its 4 macros manually.
+Android sys/mount.h doesn't define BLKBSZGET and it still needs linux/fs.h.
+In the long term we should move Linux specific definitions to sanitizer_platform_limits_linux.cpp
+but this commit is easy to cherry pick into older compiler-rt releases.
+
+Fix https://github.com/llvm/llvm-project/issues/56421
+
+Reviewed By: #sanitizers, vitalybuka, zatrazz
+
+Differential Revision: https://reviews.llvm.org/D129471
+---
+ .../sanitizer_platform_limits_posix.cpp                | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+index 4bd425435d56d..3a94b260686f1 100644
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -73,7 +73,9 @@
+ #include <sys/vt.h>
+ #include <linux/cdrom.h>
+ #include <linux/fd.h>
++#if SANITIZER_ANDROID
+ #include <linux/fs.h>
++#endif
+ #include <linux/hdreg.h>
+ #include <linux/input.h>
+ #include <linux/ioctl.h>
+@@ -876,10 +878,10 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
+   unsigned IOCTL_EVIOCGPROP = IOCTL_NOT_PRESENT;
+   unsigned IOCTL_EVIOCSKEYCODE_V2 = IOCTL_NOT_PRESENT;
+ #endif
+-  unsigned IOCTL_FS_IOC_GETFLAGS = FS_IOC_GETFLAGS;
+-  unsigned IOCTL_FS_IOC_GETVERSION = FS_IOC_GETVERSION;
+-  unsigned IOCTL_FS_IOC_SETFLAGS = FS_IOC_SETFLAGS;
+-  unsigned IOCTL_FS_IOC_SETVERSION = FS_IOC_SETVERSION;
++  unsigned IOCTL_FS_IOC_GETFLAGS = _IOR('f', 1, long);
++  unsigned IOCTL_FS_IOC_GETVERSION = _IOR('v', 1, long);
++  unsigned IOCTL_FS_IOC_SETFLAGS = _IOW('f', 2, long);
++  unsigned IOCTL_FS_IOC_SETVERSION = _IOW('v', 2, long);
+   unsigned IOCTL_GIO_CMAP = GIO_CMAP;
+   unsigned IOCTL_GIO_FONT = GIO_FONT;
+   unsigned IOCTL_GIO_UNIMAP = GIO_UNIMAP;

From 7022b0e6bf053cac07a0e436fda5c964d3b47883 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 17:21:40 -0700
Subject: [PATCH 08/52] m4: update to 1.4.19.

---
 srcpkgs/m4/patches/fix-glibc-2.27.patch | 167 ------------------------
 srcpkgs/m4/template                     |  12 +-
 2 files changed, 6 insertions(+), 173 deletions(-)
 delete mode 100644 srcpkgs/m4/patches/fix-glibc-2.27.patch

diff --git a/srcpkgs/m4/patches/fix-glibc-2.27.patch b/srcpkgs/m4/patches/fix-glibc-2.27.patch
deleted file mode 100644
index 59d33cff164d..000000000000
--- a/srcpkgs/m4/patches/fix-glibc-2.27.patch
+++ /dev/null
@@ -1,167 +0,0 @@
-From 4af4a4a71827c0bc5e0ec67af23edef4f15cee8e Mon Sep 17 00:00:00 2001
-From: Paul Eggert <eggert@cs.ucla.edu>
-Date: Mon, 5 Mar 2018 10:56:29 -0800
-Subject: [PATCH] fflush: adjust to glibc 2.28 libio.h removal
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Problem reported by Daniel P. Berrangé in:
-https://lists.gnu.org/r/bug-gnulib/2018-03/msg00000.html
-* lib/fbufmode.c (fbufmode):
-* lib/fflush.c (clear_ungetc_buffer_preserving_position)
-(disable_seek_optimization, rpl_fflush):
-* lib/fpending.c (__fpending):
-* lib/fpurge.c (fpurge):
-* lib/freadable.c (freadable):
-* lib/freadahead.c (freadahead):
-* lib/freading.c (freading):
-* lib/freadptr.c (freadptr):
-* lib/freadseek.c (freadptrinc):
-* lib/fseeko.c (fseeko):
-* lib/fseterr.c (fseterr):
-* lib/fwritable.c (fwritable):
-* lib/fwriting.c (fwriting):
-Check _IO_EOF_SEEN instead of _IO_ftrylockfile.
-* lib/stdio-impl.h (_IO_IN_BACKUP) [_IO_EOF_SEEN]:
-Define if not already defined.
-
-[yann.morin.1998@free.fr: partially backport from upstream gnulib]
-Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
-
----
- lib/fflush.c     |  6 +++---
- lib/fpending.c   |  2 +-
- lib/fpurge.c     |  2 +-
- lib/freadahead.c |  2 +-
- lib/freading.c   |  2 +-
- lib/fseeko.c     |  4 ++--
- lib/stdio-impl.h |  6 ++++++
- 7 files changed, 15 insertions(+), 9 deletions(-)
-
-diff --git a/lib/fflush.c b/build-aux/gnulib/lib/fflush.c
-index 983ade0ff..a6edfa105 100644
---- a/lib/fflush.c
-+++ b/lib/fflush.c
-@@ -33,7 +33,7 @@
- #undef fflush
- 
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- 
- /* Clear the stream's ungetc buffer, preserving the value of ftello (fp).  */
- static void
-@@ -72,7 +72,7 @@ clear_ungetc_buffer (FILE *fp)
- 
- #endif
- 
--#if ! (defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
-+#if ! (defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
- 
- # if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT
- /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
-@@ -148,7 +148,7 @@ rpl_fflush (FILE *stream)
-   if (stream == NULL || ! freading (stream))
-     return fflush (stream);
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- 
-   clear_ungetc_buffer_preserving_position (stream);
- 
-diff --git a/lib/fpending.c b/build-aux/gnulib/lib/fpending.c
-index c84e3a5b4..789f50e4e 100644
---- a/lib/fpending.c
-+++ b/lib/fpending.c
-@@ -32,7 +32,7 @@ __fpending (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   return fp->_IO_write_ptr - fp->_IO_write_base;
- #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
-   /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
-diff --git a/lib/fpurge.c b/build-aux/gnulib/lib/fpurge.c
-index b1d417c7a..3aedcc373 100644
---- a/lib/fpurge.c
-+++ b/lib/fpurge.c
-@@ -62,7 +62,7 @@ fpurge (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   fp->_IO_read_end = fp->_IO_read_ptr;
-   fp->_IO_write_ptr = fp->_IO_write_base;
-   /* Avoid memory leak when there is an active ungetc buffer.  */
-diff --git a/lib/freadahead.c b/build-aux/gnulib/lib/freadahead.c
-index c2ecb5b28..23ec76ee5 100644
---- a/lib/freadahead.c
-+++ b/lib/freadahead.c
-@@ -30,7 +30,7 @@ extern size_t __sreadahead (FILE *);
- size_t
- freadahead (FILE *fp)
- {
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   if (fp->_IO_write_ptr > fp->_IO_write_base)
-     return 0;
-   return (fp->_IO_read_end - fp->_IO_read_ptr)
-diff --git a/lib/freading.c b/build-aux/gnulib/lib/freading.c
-index 73c28acdd..c24d0c88a 100644
---- a/lib/freading.c
-+++ b/lib/freading.c
-@@ -31,7 +31,7 @@ freading (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   return ((fp->_flags & _IO_NO_WRITES) != 0
-           || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0
-               && fp->_IO_read_base != NULL));
-diff --git a/lib/fseeko.c b/build-aux/gnulib/lib/fseeko.c
-index 0101ab55f..193f4e8ce 100644
---- a/lib/fseeko.c
-+++ b/lib/fseeko.c
-@@ -47,7 +47,7 @@ fseeko (FILE *fp, off_t offset, int whence)
- #endif
- 
-   /* These tests are based on fpurge.c.  */
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   if (fp->_IO_read_end == fp->_IO_read_ptr
-       && fp->_IO_write_ptr == fp->_IO_write_base
-       && fp->_IO_save_base == NULL)
-@@ -123,7 +123,7 @@ fseeko (FILE *fp, off_t offset, int whence)
-           return -1;
-         }
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-       fp->_flags &= ~_IO_EOF_SEEN;
-       fp->_offset = pos;
- #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
-diff --git a/lib/stdio-impl.h b/build-aux/gnulib/lib/stdio-impl.h
-index 78d896e9f..05c5752a2 100644
---- a/lib/stdio-impl.h
-+++ b/lib/stdio-impl.h
-@@ -18,6 +18,12 @@
-    the same implementation of stdio extension API, except that some fields
-    have different naming conventions, or their access requires some casts.  */
- 
-+/* Glibc 2.28 made _IO_IN_BACKUP private.  For now, work around this
-+   problem by defining it ourselves.  FIXME: Do not rely on glibc
-+   internals.  */
-+#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN
-+# define _IO_IN_BACKUP 0x100
-+#endif
- 
- /* BSD stdio derived implementations.  */
- 
--- 
-2.14.1
-
-
diff --git a/srcpkgs/m4/template b/srcpkgs/m4/template
index 78f3dae6184a..762593d883bd 100644
--- a/srcpkgs/m4/template
+++ b/srcpkgs/m4/template
@@ -1,17 +1,17 @@
 # Template file for 'm4'
 pkgname=m4
-version=1.4.18
-revision=2
+version=1.4.19
+revision=1
 bootstrap=yes
-replaces="chroot-m4>=0"
 build_style=gnu-configure
 configure_args="--enable-changeword --enable-threads"
 short_desc="GNU version of UNIX m4 macro language processor"
-homepage="https://www.gnu.org/software/m4/"
-license="GPL-3.0-or-later"
 maintainer="Enno Boland <gottox@voidlinux.org>"
+license="GPL-3.0-or-later"
+homepage="https://www.gnu.org/software/m4/"
 distfiles="${GNU_SITE}/${pkgname}/${pkgname}-${version}.tar.xz"
-checksum=f2c1e86ca0a404ff281631bdc8377638992744b175afb806e25871a24a934e07
+checksum=63aede5c6d33b6d9b13511cd0be2cac046f2e70fd0a07aa9573a04a82783af96
+replaces="chroot-m4>=0"
 
 if [ "$XBPS_TARGET_LIBC" = musl ]; then
 	export ac_cv_lib_error_at_line=no

From 15e9bae306d4ac87561f856f2ca81d01bbd61d90 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 22:57:59 -0700
Subject: [PATCH 09/52] btrfs-progs: update to 5.19.

---
 srcpkgs/btrfs-progs/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/btrfs-progs/template b/srcpkgs/btrfs-progs/template
index f6c53d8587e1..292d5110106b 100644
--- a/srcpkgs/btrfs-progs/template
+++ b/srcpkgs/btrfs-progs/template
@@ -1,6 +1,6 @@
 # Template file for 'btrfs-progs'
 pkgname=btrfs-progs
-version=5.18.1
+version=5.19
 revision=1
 wrksrc="${pkgname}-v${version}"
 build_style=gnu-configure
@@ -16,7 +16,7 @@ license="GPL-2.0-only, LGPL-2.1-or-later"
 homepage="https://btrfs.wiki.kernel.org/index.php/Main_Page"
 changelog="https://raw.githubusercontent.com/kdave/btrfs-progs/master/CHANGES"
 distfiles="${KERNEL_SITE}/kernel/people/kdave/${pkgname}/${pkgname}-v${version}.tar.xz"
-checksum=6e98a75ccff52e9354daa1ad284c614c490f844273a2fa524cbac9eb841c7255
+checksum=1fbcf06e4b2f80e7a127fd687ed4625a5b74fa674fe212c836ff70e0edfcccf9
 # Most of the tests depend on `mount` and `fallocate` commands, which are not
 # presented in chroot-util-linux
 make_check=no

From 82b9e00c2f7ef97e43c915abd13b5417647c3d1e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 19:39:23 -0700
Subject: [PATCH 10/52] syslinux: fix build for glibc 2.36

---
 .../patches/fix-build-with-glibc-2.36.patch   | 30 +++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 srcpkgs/syslinux/patches/fix-build-with-glibc-2.36.patch

diff --git a/srcpkgs/syslinux/patches/fix-build-with-glibc-2.36.patch b/srcpkgs/syslinux/patches/fix-build-with-glibc-2.36.patch
new file mode 100644
index 000000000000..1303be56c127
--- /dev/null
+++ b/srcpkgs/syslinux/patches/fix-build-with-glibc-2.36.patch
@@ -0,0 +1,30 @@
+--- a/linux/syslinux.c
++++ b/linux/syslinux.c
+@@ -45,7 +45,6 @@
+ #include <sys/stat.h>
+ #include <sys/types.h>
+ #include <sys/wait.h>
+-#include <sys/mount.h>
+ 
+ #include "linuxioctl.h"
+ 
+--- a/libinstaller/syslxcom.c
++++ b/libinstaller/syslxcom.c
+@@ -28,7 +28,6 @@
+ #include <errno.h>
+ #include <sys/stat.h>
+ #include <sys/types.h>
+-#include <sys/mount.h>
+ #include <sys/vfs.h>
+ 
+ #include "linuxioctl.h"
+--- a/extlinux/main.c
++++ b/extlinux/main.c
+@@ -40,7 +40,6 @@
+ #include <sys/stat.h>
+ #include <sys/sysmacros.h>
+ #include <sys/types.h>
+-#include <sys/mount.h>
+ #include <sys/vfs.h>
+ 
+ #include "linuxioctl.h"

From 18c370abc4e3e0b0f1c9387bc29ef05b63615cec Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 14 Aug 2022 19:29:36 -0700
Subject: [PATCH 11/52] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove -no-pie from build. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..58d94f8dacba 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -60,6 +60,7 @@ _void_cross_build_binutils() {
 		--disable-multilib \
 		--disable-werror \
 		--disable-gold \
+		--disable-gprofng \
 		--enable-relro \
 		--enable-plugins \
 		--enable-64-bit-bfd \
@@ -132,6 +133,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -460,6 +462,14 @@ do_build() {
 	local binutils_ver linux_ver gcc_ver libc_ver libucontext_ver
 	local tgt=${sourcepkg/cross-}
 
+	export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}"
+	export CXXFLAGS="${CXXFLAGS/-D_FORTIFY_SOURCE=2/}"
+
+	# Disable explicit -fno-PIE, gcc/binutils/libc will figure this out itself.
+	export CFLAGS="${CFLAGS//-fno-PIE/}"
+	export CXXFLAGS="${CXXFLAGS//-fno-PIE/}"
+	export LDFLAGS="${LDFLAGS//-no-pie/}"
+
 	_void_cross_test_ver binutils
 	_void_cross_test_ver linux
 	_void_cross_test_ver gcc
@@ -625,6 +635,9 @@ do_install() {
 	# then remove it because it conflicts with libquadmath package
 	rm -rf ${DESTDIR}/${sysroot}/usr/lib/libquadmath.*
 
+	# Remove libdep linker plugin because it conflicts with system binutils
+	rm -f ${DESTDIR}/usr/lib/bfd-plugins/libdep*
+
 	# Remove leftover symlinks
 	rm -f ${DESTDIR}/usr/lib${XBPS_TARGET_WORDSIZE}
 	rm -f ${DESTDIR}/lib*

From 30eea245e8b7ca997231808bac71f651705f342a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:08:52 -0700
Subject: [PATCH 12/52] openssh: suppress werror on gcc12

---
 srcpkgs/openssh/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/openssh/template b/srcpkgs/openssh/template
index 02a2dec35f42..6e8e343a9dca 100644
--- a/srcpkgs/openssh/template
+++ b/srcpkgs/openssh/template
@@ -40,7 +40,7 @@ if [ "$build_option_ldns" -a -z "$build_option_ssl" ]; then
 	broken="option 'ldns' requires option 'ssl'"
 fi
 
-CFLAGS="-Wno-format-truncation -Wno-stringop-truncation"
+CFLAGS="-Wno-format-truncation -Wno-stringop-truncation -Wno-error=maybe-uninitialized"
 
 case $XBPS_TARGET_MACHINE in
 	i686-musl)

From 5bee92f122c4ff8a39f4037034f07d3361aab546 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:09:31 -0700
Subject: [PATCH 13/52] linux5.18: update dotconfigs for gcc12

---
 srcpkgs/linux5.18/files/x86_64-dotconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/linux5.18/files/x86_64-dotconfig b/srcpkgs/linux5.18/files/x86_64-dotconfig
index 4e73a3195d40..ea6204868e23 100644
--- a/srcpkgs/linux5.18/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.18/files/x86_64-dotconfig
@@ -512,6 +512,7 @@ CONFIG_RETHUNK=y
 CONFIG_CPU_UNRET_ENTRY=y
 CONFIG_CPU_IBPB_ENTRY=y
 CONFIG_CPU_IBRS_ENTRY=y
+CONFIG_SLS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10060,8 +10061,11 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
 # Memory initialization
 #
 CONFIG_INIT_STACK_NONE=y
+# CONFIG_INIT_STACK_ALL_PATTERN is not set
+# CONFIG_INIT_STACK_ALL_ZERO is not set
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
+# CONFIG_ZERO_CALL_USED_REGS is not set
 # end of Memory initialization
 # end of Kernel hardening options
 # end of Security options
@@ -10538,6 +10542,7 @@ CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
 # CONFIG_UBSAN is not set
 CONFIG_HAVE_ARCH_KCSAN=y
+# CONFIG_KCSAN is not set
 # end of Generic Kernel Debugging Instruments
 
 #

From 7b097433575071a91350be33cc5ef464dd6b8587 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 18:00:42 -0700
Subject: [PATCH 14/52] xf86-video-vmware: fix build on gcc12

---
 ...183b3395333d5d4c73e25c2d011748f15eda.patch | 30 +++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch

diff --git a/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch b/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch
new file mode 100644
index 000000000000..ff839f16e628
--- /dev/null
+++ b/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch
@@ -0,0 +1,30 @@
+From 77b8183b3395333d5d4c73e25c2d011748f15eda Mon Sep 17 00:00:00 2001
+From: Rudi Heitbaum <rudi@heitbaum.com>
+Date: Sun, 8 May 2022 03:00:10 +0000
+Subject: [PATCH] vmwgfx: fix missing array notation
+
+ Fixes error identified by gcc-12.1.0 compiler
+
+make
+  CC       libvmwgfx_la-vmwgfx_tex_video.lo
+vmwgfx_tex_video.c: In function 'stop_video':
+vmwgfx_tex_video.c:240:20: error: the comparison will always evaluate as 'true' for the address of 'yuv' will never be NULL [-Werror=address]
+  240 |                if (priv->yuv[i]) {
+      |                    ^~~~
+---
+ vmwgfx/vmwgfx_tex_video.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/vmwgfx/vmwgfx_tex_video.c b/vmwgfx/vmwgfx_tex_video.c
+index acc2b56..480a5f1 100644
+--- a/vmwgfx/vmwgfx_tex_video.c
++++ b/vmwgfx/vmwgfx_tex_video.c
+@@ -237,7 +237,7 @@ stop_video(ScrnInfoPtr pScrn, pointer data, Bool shutdown)
+ 
+        for (i=0; i<3; ++i) {
+ 	   for (j=0; j<2; ++j) {
+-	       if (priv->yuv[i]) {
++	       if (priv->yuv[j][i]) {
+ 		   xa_surface_destroy(priv->yuv[j][i]);
+ 		   priv->yuv[j][i] = NULL;
+ 	       }

From c63a3e53402a581ada12ee64ba54495ac6f0fb42 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 18:24:37 -0700
Subject: [PATCH 15/52] doxygen: fix build for gcc 12

---
 srcpkgs/doxygen/patches/compat-gcc12.patch | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100644 srcpkgs/doxygen/patches/compat-gcc12.patch

diff --git a/srcpkgs/doxygen/patches/compat-gcc12.patch b/srcpkgs/doxygen/patches/compat-gcc12.patch
new file mode 100644
index 000000000000..666744a1dceb
--- /dev/null
+++ b/srcpkgs/doxygen/patches/compat-gcc12.patch
@@ -0,0 +1,22 @@
+From 5198966c8d5fec89116d025c74934ac03ea511fa Mon Sep 17 00:00:00 2001
+From: Dimitri van Heesch <doxygen@gmail.com>
+Date: Fri, 6 May 2022 09:55:16 +0200
+Subject: [PATCH] issue #9312: Build: cache.h:53:14: error: 'exchange' is not a
+ member of 'std'
+
+---
+ src/cache.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/cache.h b/src/cache.h
+index 0ff3092ed5..e218eb27d2 100644
+--- a/src/cache.h
++++ b/src/cache.h
+@@ -19,6 +19,7 @@
+ #include <list>
+ #include <unordered_map>
+ #include <mutex>
++#include <utility>
+ #include <ctype.h>
+ 
+ /*! Fixed size cache for value type V using keys of type K.

From 69ae334d00f66572fe889ccc7def8ce63efa3967 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 21 Aug 2022 15:12:00 -0700
Subject: [PATCH 16/52] libproxy: update to 0.4.18

---
 srcpkgs/libproxy/template | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/libproxy/template b/srcpkgs/libproxy/template
index d6103007032e..6599dfb69b98 100644
--- a/srcpkgs/libproxy/template
+++ b/srcpkgs/libproxy/template
@@ -1,18 +1,22 @@
 # Template file for 'libproxy'
 pkgname=libproxy
-version=0.4.15
+version=0.4.18
 revision=1
 build_style=cmake
 configure_args="-DWITH_GNOME=0 -DWITH_KDE4=0 -DWITH_MOZJS=0 -DWITH_NM=0
  -DWITH_PERL=0 -DWITH_PYTHON=1 -DWITH_WEBKIT=0"
 hostmakedepends="pkg-config python"
 makedepends="zlib-devel"
-short_desc="A library handling all the details of proxy configuration"
+short_desc="Library handling all the details of proxy configuration"
 maintainer="Orphaned <orphan@voidlinux.org>"
+license="LGPL-2.1-or-later"
 homepage="http://github.com/libproxy/libproxy"
-license="LGPL-2.1"
-distfiles="https://github.com/libproxy/libproxy/archive/${version}.tar.gz>${pkgname}-${version}.tar.gz"
-checksum=18f58b0a0043b6881774187427ead158d310127fc46a1c668ad6d207fb28b4e0
+distfiles="https://github.com/libproxy/libproxy/archive/${version}.tar.gz"
+checksum=0b4a9218d88f6cf9fa25996a3f38329a11f688a9d026141d9d0e966d8fa63837
+
+post_patch() {
+	vsed '/add_test(NAME url-test/d' -i libproxy/test/CMakeLists.txt
+}
 
 libproxy-devel_package() {
 	depends="libproxy>=${version}_${revision}"

From 86dc2ea7671e0437a53da1f0ce8fbc564214716b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 21 Aug 2022 17:05:39 -0700
Subject: [PATCH 17/52] exempi: update to 2.6.2

---
 ...f034705fd2d032c81383eee8208fd4eee0ac.patch | 43 -------------------
 srcpkgs/exempi/template                       |  4 +-
 2 files changed, 2 insertions(+), 45 deletions(-)
 delete mode 100644 srcpkgs/exempi/patches/8ed2f034705fd2d032c81383eee8208fd4eee0ac.patch

diff --git a/srcpkgs/exempi/patches/8ed2f034705fd2d032c81383eee8208fd4eee0ac.patch b/srcpkgs/exempi/patches/8ed2f034705fd2d032c81383eee8208fd4eee0ac.patch
deleted file mode 100644
index 2696793cec09..000000000000
--- a/srcpkgs/exempi/patches/8ed2f034705fd2d032c81383eee8208fd4eee0ac.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From 8ed2f034705fd2d032c81383eee8208fd4eee0ac Mon Sep 17 00:00:00 2001
-From: Victor Rodriguez <victor.rodriguez.bahena@intel.com>
-Date: Sat, 18 Aug 2018 13:54:55 +0000
-Subject: [PATCH] Issue #9 - Fix null-pointer-dereference (CVE-2018-12648)
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-The WEBP::GetLE32 function in
-XMPFiles/source/FormatSupport/WEBP_Support.hpp in Exempi 2.4.5 has a
-NULL pointer dereference.
-
-https://bugs.freedesktop.org/show_bug.cgi?id=106981
-https://gitlab.freedesktop.org/libopenraw/exempi/issues/9
-
-Signed-off-by: Victor Rodriguez <victor.rodriguez.bahena@intel.com>
-Signed-off-by: Hubert Figuière <hub@figuiere.net>
----
- XMPFiles/source/FormatSupport/WEBP_Support.cpp | 8 +++++---
- 1 file changed, 5 insertions(+), 3 deletions(-)
-
-diff --git a/XMPFiles/source/FormatSupport/WEBP_Support.cpp b/XMPFiles/source/FormatSupport/WEBP_Support.cpp
-index ffaf220..4fe705b 100644
---- a/XMPFiles/source/FormatSupport/WEBP_Support.cpp
-+++ b/XMPFiles/source/FormatSupport/WEBP_Support.cpp
-@@ -160,9 +160,11 @@ bool VP8XChunk::xmp()
- }
- void VP8XChunk::xmp(bool hasXMP)
- {
--    XMP_Uns32 flags = GetLE32(&this->data[0]);
--    flags ^= (-hasXMP ^ flags) & (1 << XMP_FLAG_BIT);
--    PutLE32(&this->data[0], flags);
-+    if (&this->data[0] != NULL) {
-+        XMP_Uns32 flags = GetLE32(&this->data[0]);
-+        flags ^= (-hasXMP ^ flags) & (1 << XMP_FLAG_BIT);
-+        PutLE32(&this->data[0], flags);
-+    }
- }
- 
- Container::Container(WEBP_MetaHandler* handler) : Chunk(NULL, handler)
--- 
-2.18.0
-
diff --git a/srcpkgs/exempi/template b/srcpkgs/exempi/template
index 14753617953a..d664f7dc4d80 100644
--- a/srcpkgs/exempi/template
+++ b/srcpkgs/exempi/template
@@ -1,6 +1,6 @@
 # Template file for 'exempi'
 pkgname=exempi
-version=2.5.0
+version=2.6.2
 revision=1
 build_style=gnu-configure
 configure_args="--with-boost=${XBPS_CROSS_BASE}/usr --disable-static --disable-unittest"
@@ -10,7 +10,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="BSD-3-Clause"
 homepage="https://libopenraw.freedesktop.org/wiki/Exempi"
 distfiles="https://libopenraw.freedesktop.org/download/exempi-${version}.tar.bz2"
-checksum=dc82fc24c0540a44a63fa4ad21775d24e00e63f1dedd3e2ae6f7aa27583b711b
+checksum=4d17d4c93df2a95da3e3172c45b7a5bf317dd31dafd1c7a340169728c7089d1d
 
 post_install() {
 	vlicense COPYING

From 9e17f4598425274706a91e0edb8a45adc5d149ab Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 21 Aug 2022 21:36:03 -0700
Subject: [PATCH 18/52] plymouth: update to 22.02.122

---
 srcpkgs/plymouth/patches/fix-glibc-2.36.patch | 30 +++++++++++++++++++
 srcpkgs/plymouth/template                     |  4 +--
 2 files changed, 32 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/plymouth/patches/fix-glibc-2.36.patch

diff --git a/srcpkgs/plymouth/patches/fix-glibc-2.36.patch b/srcpkgs/plymouth/patches/fix-glibc-2.36.patch
new file mode 100644
index 000000000000..2f1e43875cfb
--- /dev/null
+++ b/srcpkgs/plymouth/patches/fix-glibc-2.36.patch
@@ -0,0 +1,30 @@
+From 5f1e43c00039a7fe1fff768b91a05a695fb4a53d Mon Sep 17 00:00:00 2001
+From: Ray Strode <rstrode@redhat.com>
+Date: Wed, 3 Aug 2022 15:23:33 -0400
+Subject: [PATCH] ply-utils: Drop linux/fs.h include
+
+It was needed long ago for a function we no longer even have.
+
+Now it's causing compile errors on Fedora 37 because it's conflicting
+with sys/mount.h.
+
+This commit drops it.
+---
+ src/libply/ply-utils.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/src/libply/ply-utils.c b/src/libply/ply-utils.c
+index c7b165e9..219e2e77 100644
+--- a/src/libply/ply-utils.c
++++ b/src/libply/ply-utils.c
+@@ -46,7 +46,6 @@
+ #include <sys/user.h>
+ #include <sys/wait.h>
+ #include <time.h>
+-#include <linux/fs.h>
+ #include <linux/vt.h>
+ 
+ #include <dlfcn.h>
+-- 
+GitLab
+
diff --git a/srcpkgs/plymouth/template b/srcpkgs/plymouth/template
index 17f801fc5315..442ab58a99cd 100644
--- a/srcpkgs/plymouth/template
+++ b/srcpkgs/plymouth/template
@@ -1,6 +1,6 @@
 # Template file for 'plymouth'
 pkgname=plymouth
-version=0.9.5
+version=22.02.122
 revision=1
 build_style=gnu-configure
 configure_args="--with-system-root-install=no \
@@ -18,7 +18,7 @@ maintainer="William OD <obirik2005@gmail.com>"
 license="GPL-2.0-or-later"
 homepage="https://www.freedesktop.org/wiki/Software/Plymouth/"
 distfiles="${FREEDESKTOP_SITE}/plymouth/releases/$pkgname-$version.tar.xz"
-checksum=ecae257f351d098340542a5bc06de029404c24dcee87e6ebb2abd5ef117fce86
+checksum=100551442221033ce868c447ad6c74d831d209c18ae232b98ae0207e34eadaeb
 
 build_options="gtk3 pango"
 build_options_default="gtk3 pango"

From 02cf05cfb7a1c0e34e72db23dc2ddc32a2a625fd Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 21 Aug 2022 21:37:00 -0700
Subject: [PATCH 19/52] openjdk7-bootstrap: fix build for gcc12

---
 .../files/dist_patches_glibc.txt              |  1 +
 .../files/dist_patches_musl.txt               |  1 +
 .../icedtea-pointer-comparison-gcc12.patch    | 31 +++++++++++++++++++
 3 files changed, 33 insertions(+)
 create mode 100644 srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch

diff --git a/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt b/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt
index c76c56855441..8061756dfc0c 100644
--- a/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt
+++ b/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt
@@ -6,3 +6,4 @@ icedtea-jdk-no-soname.patch
 icedtea-jdk-xattr.patch
 icedtea-jdk-sysctl_h.patch
 icedtea-cpio.patch
+icedtea-pointer-comparison-gcc12.patch
diff --git a/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt b/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt
index 21812517c7c2..8b35d9c46989 100644
--- a/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt
+++ b/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt
@@ -11,3 +11,4 @@ icedtea-jdk-musl.patch
 icedtea-jdk-no-soname.patch
 icedtea-jdk-xattr.patch
 icedtea-cpio.patch
+icedtea-pointer-comparison-gcc12.patch
diff --git a/srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch b/srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch
new file mode 100644
index 000000000000..c809553443e7
--- /dev/null
+++ b/srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch
@@ -0,0 +1,31 @@
+--- openjdk.orig/hotspot/src/share/vm/opto/lcm.cpp
++++ openjdk/hotspot/src/share/vm/opto/lcm.cpp
+@@ -60,7 +60,7 @@
+ // Check whether val is not-null-decoded compressed oop,
+ // i.e. will grab into the base of the heap if it represents NULL.
+ static bool accesses_heap_base_zone(Node *val) {
+-  if (Universe::narrow_oop_base() > 0) { // Implies UseCompressedOops.
++  if (Universe::narrow_oop_base() > (address)0) { // Implies UseCompressedOops.
+     if (val && val->is_Mach()) {
+       if (val->as_Mach()->ideal_Opcode() == Op_DecodeN) {
+         // This assumes all Decodes with TypePtr::NotNull are matched to nodes that
+--- openjdk.orig/hotspot/src/share/vm/runtime/virtualspace.cpp
++++ openjdk/hotspot/src/share/vm/runtime/virtualspace.cpp
+@@ -527,7 +527,7 @@ ReservedHeapSpace::ReservedHeapSpace(siz
+                 (UseCompressedOops && (Universe::narrow_oop_base() != NULL) &&
+                  Universe::narrow_oop_use_implicit_null_checks()) ?
+                   lcm(os::vm_page_size(), alignment) : 0) {
+-  if (base() > 0) {
++  if (base() > (char*)0) {
+     MemTracker::record_virtual_memory_type((address)base(), mtJavaHeap);
+   }
+ 
+@@ -546,7 +546,7 @@ ReservedHeapSpace::ReservedHeapSpace(con
+                 (UseCompressedOops && (Universe::narrow_oop_base() != NULL) &&
+                  Universe::narrow_oop_use_implicit_null_checks()) ?
+                   lcm(os::vm_page_size(), prefix_align) : 0) {
+-  if (base() > 0) {
++  if (base() > (char*)0) {
+     MemTracker::record_virtual_memory_type((address)base(), mtJavaHeap);
+   }
+ 

From 3ca13fce0fe85789026b84d3d98a232aadec1559 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 23:30:16 -0700
Subject: [PATCH 20/52] libunique1: relax warnings for gcc12

---
 srcpkgs/libunique1/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/libunique1/template b/srcpkgs/libunique1/template
index f73931b0c72b..c5a0f5c27860 100644
--- a/srcpkgs/libunique1/template
+++ b/srcpkgs/libunique1/template
@@ -15,7 +15,7 @@ homepage="https://wiki.gnome.org/Attic/LibUnique"
 distfiles="${GNOME_SITE}/libunique/1.1/libunique-${version}.tar.bz2"
 checksum=e5c8041cef8e33c55732f06a292381cb345db946cf792a4ae18aa5c66cdd4fbb
 
-CFLAGS="-Wno-deprecated-declarations"
+CFLAGS="-Wno-deprecated-declarations -Wno-incompatible-pointer-types"
 
 # Package build options
 build_options="gir"

From da1a65835213e57058944d822aa4c3a34b34e984 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:39:52 -0700
Subject: [PATCH 21/52] libvirt: fix build for glibc 2.36

---
 .../patches/lxc-fix-compat-glibc-2.36.patch   | 34 ++++++++++++++++
 .../virfile-fix-compat-glibc-2.36.patch       | 39 +++++++++++++++++++
 2 files changed, 73 insertions(+)
 create mode 100644 srcpkgs/libvirt/patches/lxc-fix-compat-glibc-2.36.patch
 create mode 100644 srcpkgs/libvirt/patches/virfile-fix-compat-glibc-2.36.patch

diff --git a/srcpkgs/libvirt/patches/lxc-fix-compat-glibc-2.36.patch b/srcpkgs/libvirt/patches/lxc-fix-compat-glibc-2.36.patch
new file mode 100644
index 000000000000..d85b57815010
--- /dev/null
+++ b/srcpkgs/libvirt/patches/lxc-fix-compat-glibc-2.36.patch
@@ -0,0 +1,34 @@
+From 9493c9b79dc541ec9e0fd73c6d87bdf8d30aaa90 Mon Sep 17 00:00:00 2001
+From: Cole Robinson <crobinso@redhat.com>
+Date: Mon, 1 Aug 2022 15:20:38 -0400
+Subject: [PATCH] lxc: containter: fix build with glibc 2.36
+
+With glibc 2.36, sys/mount.h and linux/mount.h conflict:
+https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
+
+lxc_container.c imports sys/mount.h and linux/fs.h, which pulls in
+linux/mount.h.
+
+linux/fs.h isn't required here though. glibc sys/mount.h has had
+MS_MOVE since 2.12 in 2010
+
+Reviewed-by: Erik Skultety <eskultet@redhat.com>
+Signed-off-by: Cole Robinson <crobinso@redhat.com>
+---
+ src/lxc/lxc_container.c | 3 ---
+ 1 file changed, 3 deletions(-)
+
+diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
+index b5278831da7..a5401c2186e 100644
+--- a/src/lxc/lxc_container.c
++++ b/src/lxc/lxc_container.c
+@@ -33,9 +33,6 @@
+ /* Yes, we want linux private one, for _syscall2() macro */
+ #include <linux/unistd.h>
+ 
+-/* For MS_MOVE */
+-#include <linux/fs.h>
+-
+ #if WITH_CAPNG
+ # include <cap-ng.h>
+ #endif
diff --git a/srcpkgs/libvirt/patches/virfile-fix-compat-glibc-2.36.patch b/srcpkgs/libvirt/patches/virfile-fix-compat-glibc-2.36.patch
new file mode 100644
index 000000000000..2ef227ea9b54
--- /dev/null
+++ b/srcpkgs/libvirt/patches/virfile-fix-compat-glibc-2.36.patch
@@ -0,0 +1,39 @@
+From c0d9adf220dc0d223330a7bac37b174132d330ba Mon Sep 17 00:00:00 2001
+From: Cole Robinson <crobinso@redhat.com>
+Date: Mon, 1 Aug 2022 15:24:01 -0400
+Subject: [PATCH] virfile: Fix build with glibc 2.36
+
+With glibc 2.36, sys/mount.h and linux/mount.h conflict:
+https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
+
+virfile.c imports sys/mount.h and linux/fs.h, which pulls in
+linux/mount.h.
+
+Manually define the constants we need from linux/fs.h, like was
+done in llvm:
+
+https://reviews.llvm.org/rGb379129c4beb3f26223288627a1291739f33af02
+
+Reviewed-by: Erik Skultety <eskultet@redhat.com>
+Signed-off-by: Cole Robinson <crobinso@redhat.com>
+---
+ src/util/virfile.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/src/util/virfile.c b/src/util/virfile.c
+index 99da058db3b..ce541b8946b 100644
+--- a/src/util/virfile.c
++++ b/src/util/virfile.c
+@@ -71,7 +71,11 @@
+ # endif
+ # include <sys/ioctl.h>
+ # include <linux/cdrom.h>
+-# include <linux/fs.h>
++/* These come from linux/fs.h, but that header conflicts with
++ * sys/mount.h on glibc 2.36+ */
++# define FS_IOC_GETFLAGS _IOR('f', 1, long)
++# define FS_IOC_SETFLAGS _IOW('f', 2, long)
++# define FS_NOCOW_FL 0x00800000
+ #endif
+ 
+ #if WITH_LIBATTR

From d751ab62e98a2db2b72af443b47aefa252686d1e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:41:50 -0700
Subject: [PATCH 22/52] efivar: fix build for glibc 2.36

---
 .../patches/fix-compat-glibc-2.36.patch       | 55 +++++++++++++++++++
 1 file changed, 55 insertions(+)
 create mode 100644 srcpkgs/efivar/patches/fix-compat-glibc-2.36.patch

diff --git a/srcpkgs/efivar/patches/fix-compat-glibc-2.36.patch b/srcpkgs/efivar/patches/fix-compat-glibc-2.36.patch
new file mode 100644
index 000000000000..fcc83aef20cf
--- /dev/null
+++ b/srcpkgs/efivar/patches/fix-compat-glibc-2.36.patch
@@ -0,0 +1,55 @@
+From bc65d63ebf8fe6ac8a099ff15ca200986dba1565 Mon Sep 17 00:00:00 2001
+From: Robbie Harwood <rharwood@redhat.com>
+Date: Thu, 28 Jul 2022 16:11:24 -0400
+Subject: [PATCH] Fix glibc 2.36 build (mount.h conflicts)
+
+glibc has decided that sys/mount.h and linux/mount.h are no longer
+usable at the same time.  This broke the build, since linux/fs.h itself
+includes linux/mount.h.  For now, fix the build by only including
+sys/mount.h where we need it.
+
+See-also: https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
+Resolves: #227
+Signed-off-by: Robbie Harwood <rharwood@redhat.com>
+---
+ src/gpt.c   | 1 +
+ src/linux.c | 1 +
+ src/util.h  | 1 -
+ 3 files changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/gpt.c b/src/gpt.c
+index 1eda0497..21413c3b 100644
+--- a/src/gpt.c
++++ b/src/gpt.c
+@@ -17,6 +17,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <sys/mount.h>
+ #include <sys/param.h>
+ #include <sys/stat.h>
+ #include <sys/utsname.h>
+diff --git a/src/linux.c b/src/linux.c
+index 47e45ae4..1780816f 100644
+--- a/src/linux.c
++++ b/src/linux.c
+@@ -20,6 +20,7 @@
+ #include <stdbool.h>
+ #include <stdio.h>
+ #include <sys/ioctl.h>
++#include <sys/mount.h>
+ #include <sys/socket.h>
+ #include <sys/sysmacros.h>
+ #include <sys/types.h>
+diff --git a/src/util.h b/src/util.h
+index 3300666f..1e67e447 100644
+--- a/src/util.h
++++ b/src/util.h
+@@ -23,7 +23,6 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <sys/ioctl.h>
+-#include <sys/mount.h>
+ #include <sys/stat.h>
+ #include <sys/types.h>
+ #include <tgmath.h>

From 23fa1f41807fcd3dbb3da7ce779b848d9d4a3aae Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:43:24 -0700
Subject: [PATCH 23/52] libwpd: fix build for gcc12

---
 srcpkgs/libwpd/patches/fix-compat-gcc12.patch | 11 +++++++++++
 1 file changed, 11 insertions(+)
 create mode 100644 srcpkgs/libwpd/patches/fix-compat-gcc12.patch

diff --git a/srcpkgs/libwpd/patches/fix-compat-gcc12.patch b/srcpkgs/libwpd/patches/fix-compat-gcc12.patch
new file mode 100644
index 000000000000..6ebce2463d16
--- /dev/null
+++ b/srcpkgs/libwpd/patches/fix-compat-gcc12.patch
@@ -0,0 +1,11 @@
+diff -rup libwpd-0.10.3.orig/src/lib/WPXTable.h libwpd-0.10.3/src/lib/WPXTable.h
+--- libwpd-0.10.3.orig/src/lib/WPXTable.h	2022-08-23 22:32:45.332593795 -0700
++++ libwpd-0.10.3/src/lib/WPXTable.h	2022-08-23 22:32:59.500651211 -0700
+@@ -37,6 +37,7 @@
+ #define _WPXTABLE_H
+ 
+ #include <vector>
++#include <cstddef>
+ 
+ struct WPXTableCell
+ {

From c73dbffd0ad2fcf7ae9ac438f8ea420eaf09621d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:44:07 -0700
Subject: [PATCH 24/52] grub: fix build for binutils 2.36

---
 .../patches/fix-compat-binutils-2.36.patch    | 96 +++++++++++++++++++
 srcpkgs/grub/template                         |  7 +-
 2 files changed, 102 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/grub/patches/fix-compat-binutils-2.36.patch

diff --git a/srcpkgs/grub/patches/fix-compat-binutils-2.36.patch b/srcpkgs/grub/patches/fix-compat-binutils-2.36.patch
new file mode 100644
index 000000000000..d92a91e3253e
--- /dev/null
+++ b/srcpkgs/grub/patches/fix-compat-binutils-2.36.patch
@@ -0,0 +1,96 @@
+From b98275138bf4fc250a1c362dfd2c8b1cf2421701 Mon Sep 17 00:00:00 2001
+From: Michael Chang <mchang@suse.com>
+Date: Tue, 28 Sep 2021 13:50:47 +0800
+Subject: build: Fix build error with binutils 2.36
+
+The following procedure to build xen/pvgrub is broken.
+
+  git clone https://git.savannah.gnu.org/git/grub.git
+  cd grub
+  ./bootstrap
+  mkdir build-xen
+  cd build-xen
+  ../configure --with-platform=xen
+  make
+
+It fails with the message:
+
+  /usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld:
+  section .note.gnu.property VMA [0000000000400158,0000000000400187]
+  overlaps section .bss VMA [000000000000f000,000000000041e1af]
+
+The most significant factor is that new assembler (GNU as) generates the
+.note.gnu.property section as default. This note section overlaps with
+.bss because it doesn't reposition with -Wl,-Ttext,0 with which the base
+address of .text section is set, rather the address of .note.gnu.property
+is calculated for some reason from 0x400000 where the ELF executable
+defaults to start.
+
+Using -Ttext-segment doesn't help either, though it is said to set the
+address of the first byte of the text segment according to "man ld".
+What it actually does is to override the default 0x400000, aka the image
+base address, to something else. The entire process can be observed in
+the default linker script used by gcc [1]. Therefore we can't expect it
+to achieve the same thing as -Ttext given that the first segment where
+.text resides is offset by SIZEOF_HEADERS plus some sections may be
+preceding it within the first segment. The end result is .text always
+has to start with non-zero address with -Wl,-Ttext-segment,0 if using
+default linker script.
+
+It is also worth mentioning that binutils upstream apparently doesn't
+seem to consider this as a bug [2] and proposed to use -Wl,-Ttext-segment,0
+which is not fruitful as what has been tested by Gentoo [3].
+
+As long as GRUB didn't use ISA information encoded in .note.gnu.property,
+we can safely drop it via -Wa,-mx86-used-note=no assembler option to
+fix the linker error above.
+
+This is considered a better approach than using custom linker script to
+drop the .note.gnu.property section because object file manipulation can
+also be hampered one way or the other in that linker script may not be
+helpful. See also this commit removing the section in the process of objcopy.
+
+  6643507ce build: Fix GRUB i386-pc build with Ubuntu gcc
+
+[1] In /usr/lib64/ldscripts/elf_x86_64.x or use 'gcc -Wl,--verbose ...'
+    PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x400000));
+    . = SEGMENT_START("text-segment", 0x400000) + SIZEOF_HEADERS;
+[2] https://sourceware.org/bugzilla/show_bug.cgi?id=27377
+[3] https://bugs.gentoo.org/787221
+
+Signed-off-by: Michael Chang <mchang@suse.com>
+Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
+---
+ configure.ac | 14 ++++++++++++++
+ 1 file changed, 14 insertions(+)
+
+(limited to 'configure.ac')
+
+diff --git a/configure.ac b/configure.ac
+index eeb5d22..8d1c81a 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -840,6 +840,20 @@ if ( test "x$target_cpu" = xi386 || test "x$target_cpu" = xx86_64 ) && test "x$p
+   TARGET_CFLAGS="$TARGET_CFLAGS -mno-mmx -mno-sse -mno-sse2 -mno-sse3 -mno-3dnow"
+ fi
+ 
++if ( test "x$target_cpu" = xi386 || test "x$target_cpu" = xx86_64 ); then
++  AC_CACHE_CHECK([whether -Wa,-mx86-used-note works], [grub_cv_cc_mx86_used_note], [
++    CFLAGS="$TARGET_CFLAGS -Wa,-mx86-used-note=no -Werror"
++    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
++	[grub_cv_cc_mx86_used_note=yes],
++	[grub_cv_cc_mx86_used_note=no])
++  ])
++
++  if test "x$grub_cv_cc_mx86_used_note" = xyes; then
++    TARGET_CFLAGS="$TARGET_CFLAGS -Wa,-mx86-used-note=no"
++    TARGET_CCASFLAGS="$TARGET_CCASFLAGS -Wa,-mx86-used-note=no"
++  fi
++fi
++
+ # GRUB doesn't use float or doubles at all. Yet some toolchains may decide
+ # that floats are a good fit to run instead of what's written in the code.
+ # Given that floating point unit is disabled (if present to begin with)
+-- 
+cgit v1.1
+
diff --git a/srcpkgs/grub/template b/srcpkgs/grub/template
index b1826c38a884..b4d3b07af620 100644
--- a/srcpkgs/grub/template
+++ b/srcpkgs/grub/template
@@ -2,7 +2,8 @@
 pkgname=grub
 version=2.06
 revision=2
-hostmakedepends="python3 pkg-config flex freetype-devel font-unifont-bdf help2man"
+hostmakedepends="python3 pkg-config flex freetype-devel font-unifont-bdf help2man
+ automake gettext-devel-tools"
 makedepends="libusb-compat-devel ncurses-devel freetype-devel
  liblzma-devel device-mapper-devel fuse-devel"
 depends="os-prober"
@@ -43,6 +44,10 @@ case "$XBPS_TARGET_MACHINE" in
 		;;
 esac
 
+pre_configure() {
+	autoreconf -fi
+}
+
 do_configure() {
 	# workaround for https://savannah.gnu.org/bugs/?60458
 	# some more info: https://www.linuxquestions.org/questions/showthread.php?p=6257712

From 0215a38ba1f1653267df78500939e7ab2a24ea66 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:45:07 -0700
Subject: [PATCH 25/52] linux-toos: fix build for binutils 2.39

---
 .../patches/binutils-add-compat-check.patch   | 103 ++++++++++++
 .../patches/binutils-disasm-compat.patch      | 102 ++++++++++++
 .../bpf_jit_disasm-binutils-2.39.patch        | 104 ++++++++++++
 .../patches/bpftool-binutils-2.39.patch       | 149 ++++++++++++++++++
 .../patches/perf-binutils-2.39.patch          | 114 ++++++++++++++
 5 files changed, 572 insertions(+)
 create mode 100644 srcpkgs/linux-tools/patches/binutils-add-compat-check.patch
 create mode 100644 srcpkgs/linux-tools/patches/binutils-disasm-compat.patch
 create mode 100644 srcpkgs/linux-tools/patches/bpf_jit_disasm-binutils-2.39.patch
 create mode 100644 srcpkgs/linux-tools/patches/bpftool-binutils-2.39.patch
 create mode 100644 srcpkgs/linux-tools/patches/perf-binutils-2.39.patch

diff --git a/srcpkgs/linux-tools/patches/binutils-add-compat-check.patch b/srcpkgs/linux-tools/patches/binutils-add-compat-check.patch
new file mode 100644
index 000000000000..e4e7ece9635e
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/binutils-add-compat-check.patch
@@ -0,0 +1,103 @@
+From cfd59ca91467056bb2c36907b2fa67b8e1af9952 Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:27 -0700
+Subject: [PATCH] tools build: Add feature test for init_disassemble_info API
+ changes
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation failures for tools/{perf,bpf}, e.g. on debian unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+This commit adds a feature test to detect the new signature.  Subsequent
+commits will use it to fix the build failures.
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Quentin Monnet <quentin@isovalent.com>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-2-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/build/Makefile.feature                        |  1 +
+ tools/build/feature/Makefile                        |  4 ++++
+ tools/build/feature/test-all.c                      |  4 ++++
+ tools/build/feature/test-disassembler-init-styled.c | 13 +++++++++++++
+ 4 files changed, 22 insertions(+)
+ create mode 100644 tools/build/feature/test-disassembler-init-styled.c
+
+diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature
+index 888a0421d43b96..8f6578e4d3249e 100644
+--- a/tools/build/Makefile.feature
++++ b/tools/build/Makefile.feature
+@@ -70,6 +70,7 @@ FEATURE_TESTS_BASIC :=                  \
+         libaio				\
+         libzstd				\
+         disassembler-four-args		\
++        disassembler-init-styled	\
+         file-handle
+ 
+ # FEATURE_TESTS_BASIC + FEATURE_TESTS_EXTRA is the complete list
+diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile
+index 7c2a17e23c30ac..c3059739318a95 100644
+--- a/tools/build/feature/Makefile
++++ b/tools/build/feature/Makefile
+@@ -18,6 +18,7 @@ FILES=                                          \
+          test-libbfd.bin                        \
+          test-libbfd-buildid.bin		\
+          test-disassembler-four-args.bin        \
++         test-disassembler-init-styled.bin	\
+          test-reallocarray.bin			\
+          test-libbfd-liberty.bin                \
+          test-libbfd-liberty-z.bin              \
+@@ -248,6 +249,9 @@ $(OUTPUT)test-libbfd-buildid.bin:
+ $(OUTPUT)test-disassembler-four-args.bin:
+ 	$(BUILD) -DPACKAGE='"perf"' -lbfd -lopcodes
+ 
++$(OUTPUT)test-disassembler-init-styled.bin:
++	$(BUILD) -DPACKAGE='"perf"' -lbfd -lopcodes
++
+ $(OUTPUT)test-reallocarray.bin:
+ 	$(BUILD)
+ 
+diff --git a/tools/build/feature/test-all.c b/tools/build/feature/test-all.c
+index 5ffafb967b6e49..957c02c7b163b5 100644
+--- a/tools/build/feature/test-all.c
++++ b/tools/build/feature/test-all.c
+@@ -166,6 +166,10 @@
+ # include "test-disassembler-four-args.c"
+ #undef main
+ 
++#define main main_test_disassembler_init_styled
++# include "test-disassembler-init-styled.c"
++#undef main
++
+ #define main main_test_libzstd
+ # include "test-libzstd.c"
+ #undef main
+diff --git a/tools/build/feature/test-disassembler-init-styled.c b/tools/build/feature/test-disassembler-init-styled.c
+new file mode 100644
+index 00000000000000..f1ce0ec3bee9d3
+--- /dev/null
++++ b/tools/build/feature/test-disassembler-init-styled.c
+@@ -0,0 +1,13 @@
++// SPDX-License-Identifier: GPL-2.0
++#include <stdio.h>
++#include <dis-asm.h>
++
++int main(void)
++{
++	struct disassemble_info info;
++
++	init_disassemble_info(&info, stdout,
++			      NULL, NULL);
++
++	return 0;
++}
diff --git a/srcpkgs/linux-tools/patches/binutils-disasm-compat.patch b/srcpkgs/linux-tools/patches/binutils-disasm-compat.patch
new file mode 100644
index 000000000000..1a6cc0e6d97c
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/binutils-disasm-compat.patch
@@ -0,0 +1,102 @@
+From a45b3d6926231c3d024ea0de4f7bd967f83709ee Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:29 -0700
+Subject: tools include: add dis-asm-compat.h to handle version differences
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation failures for tools/{perf,bpf}, e.g. on debian unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+This commit introduces a wrapper for init_disassemble_info(), to avoid
+spreading #ifdef DISASM_INIT_STYLED to a bunch of places. Subsequent
+commits will use it to fix the build failures.
+
+It likely is worth adding a wrapper for disassember(), to avoid the already
+existing DISASM_FOUR_ARGS_SIGNATURE ifdefery.
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Signed-off-by: Ben Hutchings <benh@debian.org>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Quentin Monnet <quentin@isovalent.com>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-4-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/include/tools/dis-asm-compat.h | 55 ++++++++++++++++++++++++++++++++++++
+ 1 file changed, 55 insertions(+)
+ create mode 100644 tools/include/tools/dis-asm-compat.h
+
+(limited to 'tools/include/tools/dis-asm-compat.h')
+
+diff --git a/tools/include/tools/dis-asm-compat.h b/tools/include/tools/dis-asm-compat.h
+new file mode 100644
+index 0000000000000..70f331e23ed3d
+--- /dev/null
++++ b/tools/include/tools/dis-asm-compat.h
+@@ -0,0 +1,55 @@
++/* SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause */
++#ifndef _TOOLS_DIS_ASM_COMPAT_H
++#define _TOOLS_DIS_ASM_COMPAT_H
++
++#include <stdio.h>
++#include <dis-asm.h>
++
++/* define types for older binutils version, to centralize ifdef'ery a bit */
++#ifndef DISASM_INIT_STYLED
++enum disassembler_style {DISASSEMBLER_STYLE_NOT_EMPTY};
++typedef int (*fprintf_styled_ftype) (void *, enum disassembler_style, const char*, ...);
++#endif
++
++/*
++ * Trivial fprintf wrapper to be used as the fprintf_styled_func argument to
++ * init_disassemble_info_compat() when normal fprintf suffices.
++ */
++static inline int fprintf_styled(void *out,
++				 enum disassembler_style style,
++				 const char *fmt, ...)
++{
++	va_list args;
++	int r;
++
++	(void)style;
++
++	va_start(args, fmt);
++	r = vfprintf(out, fmt, args);
++	va_end(args);
++
++	return r;
++}
++
++/*
++ * Wrapper for init_disassemble_info() that hides version
++ * differences. Depending on binutils version and architecture either
++ * fprintf_func or fprintf_styled_func will be called.
++ */
++static inline void init_disassemble_info_compat(struct disassemble_info *info,
++						void *stream,
++						fprintf_ftype unstyled_func,
++						fprintf_styled_ftype styled_func)
++{
++#ifdef DISASM_INIT_STYLED
++	init_disassemble_info(info, stream,
++			      unstyled_func,
++			      styled_func);
++#else
++	(void)styled_func;
++	init_disassemble_info(info, stream,
++			      unstyled_func);
++#endif
++}
++
++#endif /* _TOOLS_DIS_ASM_COMPAT_H */
+-- 
+cgit 
+
diff --git a/srcpkgs/linux-tools/patches/bpf_jit_disasm-binutils-2.39.patch b/srcpkgs/linux-tools/patches/bpf_jit_disasm-binutils-2.39.patch
new file mode 100644
index 000000000000..01221fad3a4a
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/bpf_jit_disasm-binutils-2.39.patch
@@ -0,0 +1,104 @@
+From 96ed066054abf11c7d3e106e3011a51f3f1227a3 Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:31 -0700
+Subject: [PATCH] tools bpf_jit_disasm: Fix compilation error with new binutils
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation to fail for tools/bpf/bpf_jit_disasm.c, e.g. on debian
+unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+Wire up the feature test and switch to init_disassemble_info_compat(),
+which were introduced in prior commits, fixing the compilation failure.
+
+I verified that bpf_jit_disasm can still disassemble bpf programs, both
+with the old and new dis-asm.h API. With old binutils there's no change in
+output before/after this patch. When comparing the output from old
+binutils (2.35) to new bintuils with the patch (upstream snapshot) there
+are a few output differences, but they are unrelated to this patch. An
+example hunk is:
+
+     f4:	mov    %r14,%rsi
+     f7:	mov    %r15,%rdx
+     fa:	mov    $0x2a,%ecx
+  -  ff:	callq  0xffffffffea8c4988
+  +  ff:	call   0xffffffffea8c4988
+    104:	test   %rax,%rax
+    107:	jge    0x0000000000000110
+    109:	xor    %eax,%eax
+  - 10b:	jmpq   0x0000000000000073
+  + 10b:	jmp    0x0000000000000073
+    110:	cmp    $0x16,%rax
+
+However, I had to use an older kernel to generate the bpf_jit_enabled =
+2 output, as that has been broken since 5.18 / 1022a5498f6f745c ("bpf,
+x86_64: Use bpf_jit_binary_pack_alloc").
+
+  https://lore.kernel.org/20220703030210.pmjft7qc2eajzi6c@alap3.anarazel.de
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Daniel Borkmann <daniel@iogearbox.net>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Quentin Monnet <quentin@isovalent.com>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-6-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/bpf/Makefile         | 5 ++++-
+ tools/bpf/bpf_jit_disasm.c | 5 ++++-
+ 2 files changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/tools/bpf/Makefile b/tools/bpf/Makefile
+index b11cfc86a3d021..664601ab1705ab 100644
+--- a/tools/bpf/Makefile
++++ b/tools/bpf/Makefile
+@@ -34,7 +34,7 @@ else
+ endif
+ 
+ FEATURE_USER = .bpf
+-FEATURE_TESTS = libbfd disassembler-four-args
++FEATURE_TESTS = libbfd disassembler-four-args disassembler-init-styled
+ FEATURE_DISPLAY = libbfd disassembler-four-args
+ 
+ check_feat := 1
+@@ -56,6 +56,9 @@ endif
+ ifeq ($(feature-disassembler-four-args), 1)
+ CFLAGS += -DDISASM_FOUR_ARGS_SIGNATURE
+ endif
++ifeq ($(feature-disassembler-init-styled), 1)
++CFLAGS += -DDISASM_INIT_STYLED
++endif
+ 
+ $(OUTPUT)%.yacc.c: $(srctree)/tools/bpf/%.y
+ 	$(QUIET_BISON)$(YACC) -o $@ -d $<
+diff --git a/tools/bpf/bpf_jit_disasm.c b/tools/bpf/bpf_jit_disasm.c
+index c8ae9580472814..a90a5d110f9255 100644
+--- a/tools/bpf/bpf_jit_disasm.c
++++ b/tools/bpf/bpf_jit_disasm.c
+@@ -28,6 +28,7 @@
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <limits.h>
++#include <tools/dis-asm-compat.h>
+ 
+ #define CMD_ACTION_SIZE_BUFFER		10
+ #define CMD_ACTION_READ_ALL		3
+@@ -64,7 +65,9 @@ static void get_asm_insns(uint8_t *image, size_t len, int opcodes)
+ 	assert(bfdf);
+ 	assert(bfd_check_format(bfdf, bfd_object));
+ 
+-	init_disassemble_info(&info, stdout, (fprintf_ftype) fprintf);
++	init_disassemble_info_compat(&info, stdout,
++				     (fprintf_ftype) fprintf,
++				     fprintf_styled);
+ 	info.arch = bfd_get_arch(bfdf);
+ 	info.mach = bfd_get_mach(bfdf);
+ 	info.buffer = image;
diff --git a/srcpkgs/linux-tools/patches/bpftool-binutils-2.39.patch b/srcpkgs/linux-tools/patches/bpftool-binutils-2.39.patch
new file mode 100644
index 000000000000..1e55c40011be
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/bpftool-binutils-2.39.patch
@@ -0,0 +1,149 @@
+From 600b7b26c07a070d0153daa76b3806c1e52c9e00 Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:33 -0700
+Subject: [PATCH] tools bpftool: Fix compilation error with new binutils
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation to fail for tools/bpf/bpftool/jit_disasm.c, e.g. on debian
+unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+Wire up the feature test and switch to init_disassemble_info_compat(),
+which were introduced in prior commits, fixing the compilation failure.
+
+I verified that bpftool can still disassemble bpf programs, both with an
+old and new dis-asm.h API. There are no output changes for plain and json
+formats. When comparing the output from old binutils (2.35)
+to new bintuils with the patch (upstream snapshot) there are a few output
+differences, but they are unrelated to this patch. An example hunk is:
+
+     2f:	pop    %r14
+     31:	pop    %r13
+     33:	pop    %rbx
+  -  34:	leaveq
+  -  35:	retq
+  +  34:	leave
+  +  35:	ret
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Quentin Monnet <quentin@isovalent.com>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-8-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/bpf/bpftool/Makefile     |  5 +++-
+ tools/bpf/bpftool/jit_disasm.c | 42 +++++++++++++++++++++++++++-------
+ 2 files changed, 38 insertions(+), 9 deletions(-)
+
+diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile
+index c6d2c77d02524a..436e671b2657d4 100644
+--- a/tools/bpf/bpftool/Makefile
++++ b/tools/bpf/bpftool/Makefile
+@@ -62,7 +62,7 @@ CLANG ?= clang
+ LLVM_STRIP ?= llvm-strip
+ 
+ FEATURE_USER = .bpftool
+-FEATURE_TESTS = libbfd disassembler-four-args reallocarray zlib libcap \
++FEATURE_TESTS = libbfd disassembler-four-args disassembler-init-styled reallocarray zlib libcap \
+ 	clang-bpf-co-re
+ FEATURE_DISPLAY = libbfd disassembler-four-args zlib libcap \
+ 	clang-bpf-co-re
+@@ -117,6 +117,9 @@ endif
+ ifeq ($(feature-disassembler-four-args), 1)
+ CFLAGS += -DDISASM_FOUR_ARGS_SIGNATURE
+ endif
++ifeq ($(feature-disassembler-init-styled), 1)
++    CFLAGS += -DDISASM_INIT_STYLED
++endif
+ 
+ LIBS = $(LIBBPF) -lelf -lz
+ LIBS_BOOTSTRAP = $(LIBBPF_BOOTSTRAP) -lelf -lz
+diff --git a/tools/bpf/bpftool/jit_disasm.c b/tools/bpf/bpftool/jit_disasm.c
+index 24734f2249d6ec..aaf99a0168c90b 100644
+--- a/tools/bpf/bpftool/jit_disasm.c
++++ b/tools/bpf/bpftool/jit_disasm.c
+@@ -24,6 +24,7 @@
+ #include <sys/stat.h>
+ #include <limits.h>
+ #include <bpf/libbpf.h>
++#include <tools/dis-asm-compat.h>
+ 
+ #include "json_writer.h"
+ #include "main.h"
+@@ -39,15 +40,12 @@ static void get_exec_path(char *tpath, s
+ }
+ 
+ static int oper_count;
+-static int fprintf_json(void *out, const char *fmt, ...)
++static int printf_json(void *out, const char *fmt, va_list ap)
+ {
+-	va_list ap;
+ 	char *s;
+ 
+-	va_start(ap, fmt);
+ 	if (vasprintf(&s, fmt, ap) < 0)
+ 		return -1;
+-	va_end(ap);
+ 
+ 	if (!oper_count) {
+ 		int i;
+@@ -73,6 +71,32 @@ static int fprintf_json(void *out, const char *fmt, ...)
+ 	return 0;
+ }
+ 
++static int fprintf_json(void *out, const char *fmt, ...)
++{
++	va_list ap;
++	int r;
++
++	va_start(ap, fmt);
++	r = printf_json(out, fmt, ap);
++	va_end(ap);
++
++	return r;
++}
++
++static int fprintf_json_styled(void *out,
++			       enum disassembler_style style __maybe_unused,
++			       const char *fmt, ...)
++{
++	va_list ap;
++	int r;
++
++	va_start(ap, fmt);
++	r = printf_json(out, fmt, ap);
++	va_end(ap);
++
++	return r;
++}
++
+ void disasm_print_insn(unsigned char *image, ssize_t len, int opcodes,
+ 		       const char *arch, const char *disassembler_options,
+ 		       const struct btf *btf,
+@@ -99,11 +123,13 @@ void disasm_print_insn(unsigned char *image, ssize_t len, int opcodes,
+ 	assert(bfd_check_format(bfdf, bfd_object));
+ 
+ 	if (json_output)
+-		init_disassemble_info(&info, stdout,
+-				      (fprintf_ftype) fprintf_json);
++		init_disassemble_info_compat(&info, stdout,
++					     (fprintf_ftype) fprintf_json,
++					     fprintf_json_styled);
+ 	else
+-		init_disassemble_info(&info, stdout,
+-				      (fprintf_ftype) fprintf);
++		init_disassemble_info_compat(&info, stdout,
++					     (fprintf_ftype) fprintf,
++					     fprintf_styled);
+ 
+ 	/* Update architecture info for offload. */
+ 	if (arch) {
diff --git a/srcpkgs/linux-tools/patches/perf-binutils-2.39.patch b/srcpkgs/linux-tools/patches/perf-binutils-2.39.patch
new file mode 100644
index 000000000000..3484330f7286
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/perf-binutils-2.39.patch
@@ -0,0 +1,114 @@
+From 83aa0120487e8bc3f231e72c460add783f71f17c Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:30 -0700
+Subject: [PATCH] tools perf: Fix compilation error with new binutils
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation failures for tools/perf/util/annotate.c, e.g. on debian
+unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+Wire up the feature test and switch to init_disassemble_info_compat(),
+which were introduced in prior commits, fixing the compilation failure.
+
+I verified that perf can still disassemble bpf programs by using bpftrace
+under load, recording a perf trace, and then annotating the bpf "function"
+with and without the changes. With old binutils there's no change in output
+before/after this patch. When comparing the output from old binutils (2.35)
+to new bintuils with the patch (upstream snapshot) there are a few output
+differences, but they are unrelated to this patch. An example hunk is:
+
+       1.15 :   55:mov    %rbp,%rdx
+       0.00 :   58:add    $0xfffffffffffffff8,%rdx
+       0.00 :   5c:xor    %ecx,%ecx
+  -    1.03 :   5e:callq  0xffffffffe12aca3c
+  +    1.03 :   5e:call   0xffffffffe12aca3c
+       0.00 :   63:xor    %eax,%eax
+  -    2.18 :   65:leaveq
+  -    2.82 :   66:retq
+  +    2.18 :   65:leave
+  +    2.82 :   66:ret
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-5-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/perf/Makefile.config | 8 ++++++++
+ tools/perf/util/annotate.c | 7 ++++---
+ 2 files changed, 12 insertions(+), 3 deletions(-)
+
+diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
+index d3c254c0f5c611..23648ea54e8d3d 100644
+--- a/tools/perf/Makefile.config
++++ b/tools/perf/Makefile.config
+@@ -298,6 +298,7 @@ FEATURE_CHECK_LDFLAGS-libpython := $(PYTHON_EMBED_LDOPTS)
+ FEATURE_CHECK_LDFLAGS-libaio = -lrt
+ 
+ FEATURE_CHECK_LDFLAGS-disassembler-four-args = -lbfd -lopcodes -ldl
++FEATURE_CHECK_LDFLAGS-disassembler-init-styled = -lbfd -lopcodes -ldl
+ 
+ CORE_CFLAGS += -fno-omit-frame-pointer
+ CORE_CFLAGS += -ggdb3
+@@ -818,13 +819,16 @@ else
+   ifeq ($(feature-libbfd-liberty), 1)
+     EXTLIBS += -lbfd -lopcodes -liberty
+     FEATURE_CHECK_LDFLAGS-disassembler-four-args += -liberty -ldl
++    FEATURE_CHECK_LDFLAGS-disassembler-init-styled += -liberty -ldl
+   else
+     ifeq ($(feature-libbfd-liberty-z), 1)
+       EXTLIBS += -lbfd -lopcodes -liberty -lz
+       FEATURE_CHECK_LDFLAGS-disassembler-four-args += -liberty -lz -ldl
++      FEATURE_CHECK_LDFLAGS-disassembler-init-styled += -liberty -lz -ldl
+     endif
+   endif
+   $(call feature_check,disassembler-four-args)
++  $(call feature_check,disassembler-init-styled)
+ endif
+ 
+ ifeq ($(feature-libbfd-buildid), 1)
+@@ -1044,6 +1048,10 @@ ifeq ($(feature-disassembler-four-args), 1)
+     CFLAGS += -DDISASM_FOUR_ARGS_SIGNATURE
+ endif
+ 
++ifeq ($(feature-disassembler-init-styled), 1)
++    CFLAGS += -DDISASM_INIT_STYLED
++endif
++
+ ifeq (${IS_64_BIT}, 1)
+   ifndef NO_PERF_READ_VDSO32
+     $(call feature_check,compile-32)
+diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
+index 82cc396ef516c4..2c6a485c3de5d9 100644
+--- a/tools/perf/util/annotate.c
++++ b/tools/perf/util/annotate.c
+@@ -1676,6 +1676,7 @@ fallback:
+ #define PACKAGE "perf"
+ #include <bfd.h>
+ #include <dis-asm.h>
++#include <tools/dis-asm-compat.h>
+ 
+ static int symbol__disassemble_bpf(struct symbol *sym,
+ 				   struct annotate_args *args)
+@@ -1762,9 +1763,9 @@ static int symbol__disassemble_bpf(struct symbol *sym,
+ 		ret = errno;
+ 		goto out;
+ 	}
+-	init_disassemble_info(&info, s,
+-			      (fprintf_ftype) fprintf);
+-
++	init_disassemble_info_compat(&info, s,
++				     (fprintf_ftype) fprintf,
++				     fprintf_styled);
+ 	info.arch = bfd_get_arch(bfdf);
+ 	info.mach = bfd_get_mach(bfdf);
+ 

From 512806ad436144a28f38f061f918e78fd82a2508 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 14:45:28 -0700
Subject: [PATCH 26/52] libsasl: fix build for libtool 2.4.7

---
 srcpkgs/libsasl/template | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/libsasl/template b/srcpkgs/libsasl/template
index a8817042f843..a2993b39f4a1 100644
--- a/srcpkgs/libsasl/template
+++ b/srcpkgs/libsasl/template
@@ -19,6 +19,7 @@ distfiles="https://github.com/cyrusimap/cyrus-sasl/releases/download/cyrus-sasl-
 checksum=26866b1549b00ffd020f188a43c258017fa1c382b3ddadd8201536f72efb05d5
 
 pre_configure() {
+	rm -f m4/ltversion.m4
 	autoreconf -fi
 }
 

From 227d01433fc30b891b1ca97a7fb6ca51b0b40852 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:08 -0700
Subject: [PATCH 27/52] subversion: fix build for libtool 2.4.7

---
 srcpkgs/subversion/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion/template b/srcpkgs/subversion/template
index 8ad178264942..3f1c9e254e61 100644
--- a/srcpkgs/subversion/template
+++ b/srcpkgs/subversion/template
@@ -57,7 +57,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From 3a2fb3f2eafc076250eb721e35eaec1c1b727835 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:38 -0700
Subject: [PATCH 28/52] subversion-kwallet-auth: fix build for libtool 2.4.7

---
 srcpkgs/subversion-kwallet-auth/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion-kwallet-auth/template b/srcpkgs/subversion-kwallet-auth/template
index 12210f250d51..b4d8621456ea 100644
--- a/srcpkgs/subversion-kwallet-auth/template
+++ b/srcpkgs/subversion-kwallet-auth/template
@@ -59,7 +59,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From 6a4383e0d7aaaf6fe6e96d6ba4aff15168489746 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 20:07:32 -0700
Subject: [PATCH 29/52] gpgme: update to 1.18.0.

---
 common/shlibs          | 2 +-
 srcpkgs/gpgme/template | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 52220e69706d..98017bdd5e3d 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -723,7 +723,7 @@ libdconf.so.1 dconf-0.13.90_1
 libassuan.so.0 libassuan-2.0.1_1
 libgpgme.so.11 libgpgme-1.12.0_2
 libgpgmepp.so.6 gpgmepp-1.7.0_3
-libqgpgme.so.7 gpgmeqt-1.7.0_3
+libqgpgme.so.15 gpgmeqt-1.18.0_1
 libgarcon-1.so.0 garcon-0.1.12_1
 libgarcon-gtk2-1.so.0 garcon-0.4.0_1
 libgarcon-gtk3-1.so.0 garcon-0.6.1_1
diff --git a/srcpkgs/gpgme/template b/srcpkgs/gpgme/template
index 8633075a8404..b1cfd5f78657 100644
--- a/srcpkgs/gpgme/template
+++ b/srcpkgs/gpgme/template
@@ -1,7 +1,7 @@
 # Template file for 'gpgme'
 pkgname=gpgme
-version=1.15.1
-revision=2
+version=1.18.0
+revision=1
 build_style=gnu-configure
 configure_args="--enable-fd-passing
  --with-libgpg-error-prefix=$XBPS_CROSS_BASE/usr
@@ -14,7 +14,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.gnupg.org/software/gpgme/index.html"
 distfiles="https://www.gnupg.org/ftp/gcrypt/gpgme/gpgme-${version}.tar.bz2"
-checksum=eebc3c1b27f1c8979896ff361ba9bb4778b508b2496c2fc10e3775a40b1de1ad
+checksum=361d4eae47ce925dba0ea569af40e7b52c645c4ae2e65e5621bf1b6cdd8b0e9e
 
 if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
 	configure_args+=" ac_cv_sys_file_offset_bits=no"

From 717323ba80f71eab74b7b88a80ca007a03ab7f97 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 30/52] cross-aarch64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..bd6b23f9fb6a 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 80d3a7d7062fef12b113d97ec7b228eb45416223 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 31/52] cross-aarch64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..427ad2c1e9cd 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 442dd194213039c70d8ee858ebebee91e3cbeede Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 32/52] cross-arm-linux-gnueabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..2510ee26e789 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From f419091a0bce09cb208a66e8c01f7f8e566c1e4a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 33/52] cross-arm-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..bd8b16e1b4c1 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 20f2678bfd5ae2ef430f9e0e6cfa7bba3feec81d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 34/52] cross-arm-linux-musleabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..dacfd2655216 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From b1d78e246ff6a32690606eb5ede2925713746ac2 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 35/52] cross-arm-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..9ddd32a9f20d 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From db58db4a6d191df6cafde7eb4d3abe6262075335 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 36/52] cross-armv7l-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..9fb00f18be3b 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From fe42a0e222fdcc3fcd5bb34ac4f1bb8c9a14d58e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 37/52] cross-armv7l-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..2c72e75ddfe3 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 312e0ebe60b825d117d3524aee388b1f1a4a9541 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 38/52] cross-i686-pc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..4dc17df648b5 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 9f820c5764cfa6a6095386232cb2f9a29c554298 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 39/52] cross-mips-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..6009e5c79eb2 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 5f9fcdc9abd5c75aaf92cd6353d6274e7024b815 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 40/52] cross-mips-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..080164df193d 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="hipperson0 <hipperson0@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 326a04be8d7c6c513b41cae97c0660cc3b7cfba9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 41/52] cross-mipsel-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..c8f90cfa43cc 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_musl_version=1.1.24
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 836a03862dfb81dd19a2d0a2d6ba9346127e68d9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 42/52] cross-mipsel-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..931345d2de15 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_musl_version=1.1.24
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From eb38e8258a14f23937938ae63bc99a388c5258bc Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 43/52] cross-powerpc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..31e57b4e52b2 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 7b8290fd4b97b7797af70945f741715a178a4886 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 44/52] cross-powerpc-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..a2d1edcf1ffd 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 1c30655ab228c2417e4da3b020ceb0ba7f5edc1e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 45/52] cross-powerpc64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..1a4cbed61e76 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From b769afc59de38d96c866219592fe0790bd78d95b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 46/52] cross-powerpc64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 1ebd0fb2048d..ade42018af05 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 4d2386569d84e7bf90bb9ba8aece97f32b63f80c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 47/52] cross-powerpc64le-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 733f5851da5c..dd1ad383a21e 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From bb867b0b0a27ecee57171c0dc5d05ec4046851ad Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 48/52] cross-powerpc64le-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index 76a70aa1d6db..5887f845f932 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 3d180afc22859b0b88e8c797143511dde07df1fc Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 49/52] cross-powerpcle-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 347b8fcf4f55..06530e0d609b 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From fb02376c08b6229c8472c7eb858c181d30403ac9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:19 -0700
Subject: [PATCH 50/52] cross-powerpcle-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index ec9324ddaa99..e68c3962b49c 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From b6db3f0e1dadb31a3d93560a2ffc93fad6e93d02 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:19 -0700
Subject: [PATCH 51/52] cross-x86_64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 0078fbe7224b..7da85c14b62d 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 7203e4ee09ecc2b7389f9bdecd979b06b8cf7e6c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:19 -0700
Subject: [PATCH 52/52] cross-x86_64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..2811de0d3c2e 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (52 preceding siblings ...)
  2022-08-25  4:02 ` oreo639
@ 2022-08-25  9:01 ` oreo639
  2022-08-25  9:03 ` oreo639
                   ` (210 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-08-25  9:01 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 421 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1226982761

Comment:
@dkwo 
> This is what I get for libtool on x86_64-musl:

Those failures occur without this PR, but thank you for pointing that out since afaict that is an issue.
(it has to do with whether or not LD_LIBRARY_PATH overrides RPATH, which on glibc it doesn't but on musl it does)

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (53 preceding siblings ...)
  2022-08-25  9:01 ` oreo639
@ 2022-08-25  9:03 ` oreo639
  2022-08-25  9:04 ` oreo639
                   ` (209 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-08-25  9:03 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 422 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1226982761

Comment:
@dkwo 
> This is what I get for libtool on x86_64-musl:

Those failures existed before this PR, but thank you for pointing that out since afaict that is an issue.
(it has to do with whether or not LD_LIBRARY_PATH overrides RPATH, which on glibc it doesn't but on musl it does)

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (54 preceding siblings ...)
  2022-08-25  9:03 ` oreo639
@ 2022-08-25  9:04 ` oreo639
  2022-08-25  9:04 ` oreo639
                   ` (208 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-08-25  9:04 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 523 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1226982761

Comment:
@dkwo 
> This is what I get for libtool on x86_64-musl:

Those failures existed before this PR, but thank you for pointing that out since afaict that is an issue.
(it has to do with whether or not LD_LIBRARY_PATH overrides RPATH, which on glibc it doesn't but on musl it does, libtool has a flag for that but it is still set to `no` on musl, not sure if that is correct or not)

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (55 preceding siblings ...)
  2022-08-25  9:04 ` oreo639
@ 2022-08-25  9:04 ` oreo639
  2022-08-25  9:05 ` oreo639
                   ` (207 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-08-25  9:04 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 551 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1226982761

Comment:
@dkwo 
> This is what I get for libtool on x86_64-musl:

Those failures existed before this PR, but thank you for pointing that out since afaict that is an issue.
(it has to do with whether or not LD_LIBRARY_PATH overrides RPATH, which on glibc it doesn't but on musl it does, libtool has a flag for that but it is still set to `shlibpath_overrides_runpath=no` on musl, not sure if that is correct or not)

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (56 preceding siblings ...)
  2022-08-25  9:04 ` oreo639
@ 2022-08-25  9:05 ` oreo639
  2022-08-25  9:48 ` dkwo
                   ` (206 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-08-25  9:05 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 520 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1226982761

Comment:
@dkwo 
> This is what I get for libtool on x86_64-musl:

Those failures existed before this PR, but thank you for pointing that out.
It has to do with whether or not LD_LIBRARY_PATH overrides RPATH, which on glibc it doesn't but on musl it does, libtool has a flag for that but it is still set to `shlibpath_overrides_runpath=no` on musl, not sure if that is correct or not.

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (57 preceding siblings ...)
  2022-08-25  9:05 ` oreo639
@ 2022-08-25  9:48 ` dkwo
  2022-08-25 21:42 ` [PR PATCH] [Updated] " oreo639
                   ` (205 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: dkwo @ 2022-08-25  9:48 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 374 bytes --]

New comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1227035975

Comment:
I see, thanks for pointig out.
Indeed, also Alpine has
```
check() {
	# Test 69 shlibpath_overrides_runpath fails
	# Test 169 repeats the entire test suite with shorter max_cmd_len
	make check TESTSUITEFLAGS="1-68 70-168"
}
```

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (58 preceding siblings ...)
  2022-08-25  9:48 ` dkwo
@ 2022-08-25 21:42 ` oreo639
  2022-08-25 23:49 ` oreo639
                   ` (204 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-08-25 21:42 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5538 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.2.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.2.0

This PR depends on: https://github.com/void-linux/void-packages/pull/32330

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

Also, keep in mind that the libgo musl patch here will need to be updated once musl is updated:
https://github.com/void-linux/void-packages/pull/34902/files#diff-1f42a95b93c9550178ff1fbccbef2f47a72711df15c24c9472e2550076978129R163-R176

This is the updated patch for reference:
https://github.com/alpinelinux/aports/blob/8acb21b8ee881e7ab1c812d9a66a17d2501b8730/main/gcc/0049-libgo-adjust-name-of-union-in-sigevent-struct.patch

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/38817
- [x] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [ ] llvm https://github.com/void-linux/void-packages/pull/38694
- [ ] m4 https://github.com/void-linux/void-packages/pull/33730
- [ ] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [ ] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [ ] libvirt https://github.com/void-linux/void-packages/pull/38842
- [ ] syslinux https://github.com/void-linux/void-packages/pull/38876
- [ ] efivar https://github.com/void-linux/void-packages/pull/38874

Known packages that needed to be fixed/updated for gcc12:
- [ ] linux5.18 (in this PR)
- [ ] openssh https://github.com/void-linux/void-packages/pull/38849
- [ ] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [ ] doxygen https://github.com/void-linux/void-packages/pull/38846
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/38817
- [ ] libproxy https://github.com/void-linux/void-packages/pull/38818
- [ ] exempi https://github.com/void-linux/void-packages/pull/38820
- [ ] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [ ] gpgme https://github.com/void-linux/void-packages/pull/38825
- [x] libunique1 https://github.com/void-linux/void-packages/pull/38848 or https://github.com/void-linux/void-packages/pull/38873
- [ ] libwpd https://github.com/void-linux/void-packages/pull/38878

Needs to be fixed/updated for binutils:
- [ ] grub https://github.com/void-linux/void-packages/pull/38875
- [ ] linux-tools https://github.com/void-linux/void-packages/pull/38877

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [x] kde
- [x] lxde
- [x] lxqt

You can test the ISOs here:
https://drive.google.com/drive/folders/1ix92CYSLUP-KWjLxltdgG4e8Nu2JCY5n?usp=sharing

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 168267 bytes --]

From b5ee06e9872245686913fb6777f3980d7900dca6 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 01/51] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 15 +++--
 3 files changed, 28 insertions(+), 113 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..0578665c1a30 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkg-config"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -44,6 +45,12 @@ do_configure() {
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	# gprofng currently only supports x86 and aarch64 glibc.
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64|i386|aarch64) conf+=" --enable-gprofng" ;;
+		*) conf+=" --disable-gprofng" ;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"

From fd610c6cccd45f53e92cbc1d1530e1bc15dad8b6 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 02/51] gcc: update to 12.2.0.

---
 common/shlibs                                 | 10 +--
 srcpkgs/gcc/files/gccgo-musl.patch            | 74 ++++---------------
 srcpkgs/gcc/files/libgnarl-musl.patch         | 18 ++---
 srcpkgs/gcc/files/libssp-musl.patch           | 10 +--
 srcpkgs/gcc/patches/libffi_gnulinux.patch     | 11 ---
 .../gcc/patches/libgcc-ibm128-no-tag.patch    | 10 ++-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |  2 +-
 srcpkgs/gcc/template                          | 25 +++----
 8 files changed, 52 insertions(+), 108 deletions(-)
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index 8c257ed2bcd5..ee6ff38ac810 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.2.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.34 perl-5.34.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -848,8 +848,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.2.0_1
+libgnat-12.so libada-12.2.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1700,8 +1700,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.2.0_1
+libasan.so.8 libsanitizer-12.2.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..632ef951097b 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,17 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ a/libgo/go/runtime/os_linux.go
+@@ -363,9 +363,9 @@
+ 
+ 	var timerid int32
+ 	var sevp _sigevent
+-	sevp.sigev_notify = _SIGEV_THREAD_ID
++	sevp.sigev_notify = 4
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.sigev_notify_function))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..446741390d45 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,15 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
+version=12.2.0
+revision=1
 _patchver="${version%pre*}"
 _minorver="${_patchver%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 wrksrc=gcc-${version/pre/_pre}
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +19,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -396,7 +393,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}

From acdd4fd7fa6037b22ba69c8e77bedd2b800b7b3f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 03/51] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      |  6 ++--
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..08e35d466a44 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From f95037a848e774024faab172a59e6a3a98ff774f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 04/51] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 1a4e1ca3d594..b04268908c2e 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="q66 <daniel@octaforge.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From 79915f78aa6d0886ce76e410dbf6d6e4e44c5c06 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 05/51] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 3 files changed, 55 insertions(+), 353 deletions(-)
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index ee6ff38ac810..99b1dfc089b9 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From 4118d41df5a2c4fee2d5f7293b0f217342a175e0 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 21:01:43 -0700
Subject: [PATCH 06/51] gcc-multilib: update to 12.2.0.

---
 srcpkgs/gcc-multilib/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index fcd25755aa75..1a26da26a991 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,16 +3,16 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _majorver="${version%.*}"
-wrksrc=gcc-${version/pre/_pre}
+wrksrc=gcc-${version}
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel

From 392821918bac100d8d8873fe6f58a403a23c7ee6 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 16:22:03 -0700
Subject: [PATCH 07/51] llvm12: fix build for glibc 2.36

---
 .../compiler-rt-sanitizer-glibc-2.36.patch    | 59 +++++++++++++++++++
 1 file changed, 59 insertions(+)
 create mode 100644 srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch

diff --git a/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch b/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch
new file mode 100644
index 000000000000..e5f24dab8935
--- /dev/null
+++ b/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch
@@ -0,0 +1,59 @@
+From 9cf13067cb5088626ba7ee1ec4c42ec59c7995a0 Mon Sep 17 00:00:00 2001
+From: Fangrui Song <i@maskray.me>
+Date: Mon, 11 Jul 2022 12:53:34 -0700
+Subject: [PATCH] [sanitizer] Remove #include <linux/fs.h> to resolve
+ fsconfig_command/mount_attr conflict with glibc 2.36
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+It is generally not a good idea to mix usage of glibc headers and Linux UAPI
+headers (https://sourceware.org/glibc/wiki/Synchronizing_Headers). In glibc
+since 7eae6a91e9b1670330c9f15730082c91c0b1d570 (milestone: 2.36), sys/mount.h
+defines `fsconfig_command` which conflicts with linux/mount.h:
+
+    .../usr/include/linux/mount.h:95:6: error: redeclaration of ‘enum fsconfig_command’
+
+Remove #include <linux/fs.h> which pulls in linux/mount.h. Expand its 4 macros manually.
+Android sys/mount.h doesn't define BLKBSZGET and it still needs linux/fs.h.
+In the long term we should move Linux specific definitions to sanitizer_platform_limits_linux.cpp
+but this commit is easy to cherry pick into older compiler-rt releases.
+
+Fix https://github.com/llvm/llvm-project/issues/56421
+
+Reviewed By: #sanitizers, vitalybuka, zatrazz
+
+Differential Revision: https://reviews.llvm.org/D129471
+---
+ .../sanitizer_platform_limits_posix.cpp                | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+index 4bd425435d56d..3a94b260686f1 100644
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -73,7 +73,9 @@
+ #include <sys/vt.h>
+ #include <linux/cdrom.h>
+ #include <linux/fd.h>
++#if SANITIZER_ANDROID
+ #include <linux/fs.h>
++#endif
+ #include <linux/hdreg.h>
+ #include <linux/input.h>
+ #include <linux/ioctl.h>
+@@ -876,10 +878,10 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
+   unsigned IOCTL_EVIOCGPROP = IOCTL_NOT_PRESENT;
+   unsigned IOCTL_EVIOCSKEYCODE_V2 = IOCTL_NOT_PRESENT;
+ #endif
+-  unsigned IOCTL_FS_IOC_GETFLAGS = FS_IOC_GETFLAGS;
+-  unsigned IOCTL_FS_IOC_GETVERSION = FS_IOC_GETVERSION;
+-  unsigned IOCTL_FS_IOC_SETFLAGS = FS_IOC_SETFLAGS;
+-  unsigned IOCTL_FS_IOC_SETVERSION = FS_IOC_SETVERSION;
++  unsigned IOCTL_FS_IOC_GETFLAGS = _IOR('f', 1, long);
++  unsigned IOCTL_FS_IOC_GETVERSION = _IOR('v', 1, long);
++  unsigned IOCTL_FS_IOC_SETFLAGS = _IOW('f', 2, long);
++  unsigned IOCTL_FS_IOC_SETVERSION = _IOW('v', 2, long);
+   unsigned IOCTL_GIO_CMAP = GIO_CMAP;
+   unsigned IOCTL_GIO_FONT = GIO_FONT;
+   unsigned IOCTL_GIO_UNIMAP = GIO_UNIMAP;

From dfcc58812c6cd2481335951acf602614f8da2004 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 17:21:40 -0700
Subject: [PATCH 08/51] m4: update to 1.4.19.

---
 srcpkgs/m4/patches/fix-glibc-2.27.patch | 167 ------------------------
 srcpkgs/m4/template                     |  12 +-
 2 files changed, 6 insertions(+), 173 deletions(-)
 delete mode 100644 srcpkgs/m4/patches/fix-glibc-2.27.patch

diff --git a/srcpkgs/m4/patches/fix-glibc-2.27.patch b/srcpkgs/m4/patches/fix-glibc-2.27.patch
deleted file mode 100644
index 59d33cff164d..000000000000
--- a/srcpkgs/m4/patches/fix-glibc-2.27.patch
+++ /dev/null
@@ -1,167 +0,0 @@
-From 4af4a4a71827c0bc5e0ec67af23edef4f15cee8e Mon Sep 17 00:00:00 2001
-From: Paul Eggert <eggert@cs.ucla.edu>
-Date: Mon, 5 Mar 2018 10:56:29 -0800
-Subject: [PATCH] fflush: adjust to glibc 2.28 libio.h removal
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Problem reported by Daniel P. Berrangé in:
-https://lists.gnu.org/r/bug-gnulib/2018-03/msg00000.html
-* lib/fbufmode.c (fbufmode):
-* lib/fflush.c (clear_ungetc_buffer_preserving_position)
-(disable_seek_optimization, rpl_fflush):
-* lib/fpending.c (__fpending):
-* lib/fpurge.c (fpurge):
-* lib/freadable.c (freadable):
-* lib/freadahead.c (freadahead):
-* lib/freading.c (freading):
-* lib/freadptr.c (freadptr):
-* lib/freadseek.c (freadptrinc):
-* lib/fseeko.c (fseeko):
-* lib/fseterr.c (fseterr):
-* lib/fwritable.c (fwritable):
-* lib/fwriting.c (fwriting):
-Check _IO_EOF_SEEN instead of _IO_ftrylockfile.
-* lib/stdio-impl.h (_IO_IN_BACKUP) [_IO_EOF_SEEN]:
-Define if not already defined.
-
-[yann.morin.1998@free.fr: partially backport from upstream gnulib]
-Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
-
----
- lib/fflush.c     |  6 +++---
- lib/fpending.c   |  2 +-
- lib/fpurge.c     |  2 +-
- lib/freadahead.c |  2 +-
- lib/freading.c   |  2 +-
- lib/fseeko.c     |  4 ++--
- lib/stdio-impl.h |  6 ++++++
- 7 files changed, 15 insertions(+), 9 deletions(-)
-
-diff --git a/lib/fflush.c b/build-aux/gnulib/lib/fflush.c
-index 983ade0ff..a6edfa105 100644
---- a/lib/fflush.c
-+++ b/lib/fflush.c
-@@ -33,7 +33,7 @@
- #undef fflush
- 
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- 
- /* Clear the stream's ungetc buffer, preserving the value of ftello (fp).  */
- static void
-@@ -72,7 +72,7 @@ clear_ungetc_buffer (FILE *fp)
- 
- #endif
- 
--#if ! (defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
-+#if ! (defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
- 
- # if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT
- /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
-@@ -148,7 +148,7 @@ rpl_fflush (FILE *stream)
-   if (stream == NULL || ! freading (stream))
-     return fflush (stream);
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- 
-   clear_ungetc_buffer_preserving_position (stream);
- 
-diff --git a/lib/fpending.c b/build-aux/gnulib/lib/fpending.c
-index c84e3a5b4..789f50e4e 100644
---- a/lib/fpending.c
-+++ b/lib/fpending.c
-@@ -32,7 +32,7 @@ __fpending (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   return fp->_IO_write_ptr - fp->_IO_write_base;
- #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
-   /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
-diff --git a/lib/fpurge.c b/build-aux/gnulib/lib/fpurge.c
-index b1d417c7a..3aedcc373 100644
---- a/lib/fpurge.c
-+++ b/lib/fpurge.c
-@@ -62,7 +62,7 @@ fpurge (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   fp->_IO_read_end = fp->_IO_read_ptr;
-   fp->_IO_write_ptr = fp->_IO_write_base;
-   /* Avoid memory leak when there is an active ungetc buffer.  */
-diff --git a/lib/freadahead.c b/build-aux/gnulib/lib/freadahead.c
-index c2ecb5b28..23ec76ee5 100644
---- a/lib/freadahead.c
-+++ b/lib/freadahead.c
-@@ -30,7 +30,7 @@ extern size_t __sreadahead (FILE *);
- size_t
- freadahead (FILE *fp)
- {
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   if (fp->_IO_write_ptr > fp->_IO_write_base)
-     return 0;
-   return (fp->_IO_read_end - fp->_IO_read_ptr)
-diff --git a/lib/freading.c b/build-aux/gnulib/lib/freading.c
-index 73c28acdd..c24d0c88a 100644
---- a/lib/freading.c
-+++ b/lib/freading.c
-@@ -31,7 +31,7 @@ freading (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   return ((fp->_flags & _IO_NO_WRITES) != 0
-           || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0
-               && fp->_IO_read_base != NULL));
-diff --git a/lib/fseeko.c b/build-aux/gnulib/lib/fseeko.c
-index 0101ab55f..193f4e8ce 100644
---- a/lib/fseeko.c
-+++ b/lib/fseeko.c
-@@ -47,7 +47,7 @@ fseeko (FILE *fp, off_t offset, int whence)
- #endif
- 
-   /* These tests are based on fpurge.c.  */
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   if (fp->_IO_read_end == fp->_IO_read_ptr
-       && fp->_IO_write_ptr == fp->_IO_write_base
-       && fp->_IO_save_base == NULL)
-@@ -123,7 +123,7 @@ fseeko (FILE *fp, off_t offset, int whence)
-           return -1;
-         }
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-       fp->_flags &= ~_IO_EOF_SEEN;
-       fp->_offset = pos;
- #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
-diff --git a/lib/stdio-impl.h b/build-aux/gnulib/lib/stdio-impl.h
-index 78d896e9f..05c5752a2 100644
---- a/lib/stdio-impl.h
-+++ b/lib/stdio-impl.h
-@@ -18,6 +18,12 @@
-    the same implementation of stdio extension API, except that some fields
-    have different naming conventions, or their access requires some casts.  */
- 
-+/* Glibc 2.28 made _IO_IN_BACKUP private.  For now, work around this
-+   problem by defining it ourselves.  FIXME: Do not rely on glibc
-+   internals.  */
-+#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN
-+# define _IO_IN_BACKUP 0x100
-+#endif
- 
- /* BSD stdio derived implementations.  */
- 
--- 
-2.14.1
-
-
diff --git a/srcpkgs/m4/template b/srcpkgs/m4/template
index 78f3dae6184a..762593d883bd 100644
--- a/srcpkgs/m4/template
+++ b/srcpkgs/m4/template
@@ -1,17 +1,17 @@
 # Template file for 'm4'
 pkgname=m4
-version=1.4.18
-revision=2
+version=1.4.19
+revision=1
 bootstrap=yes
-replaces="chroot-m4>=0"
 build_style=gnu-configure
 configure_args="--enable-changeword --enable-threads"
 short_desc="GNU version of UNIX m4 macro language processor"
-homepage="https://www.gnu.org/software/m4/"
-license="GPL-3.0-or-later"
 maintainer="Enno Boland <gottox@voidlinux.org>"
+license="GPL-3.0-or-later"
+homepage="https://www.gnu.org/software/m4/"
 distfiles="${GNU_SITE}/${pkgname}/${pkgname}-${version}.tar.xz"
-checksum=f2c1e86ca0a404ff281631bdc8377638992744b175afb806e25871a24a934e07
+checksum=63aede5c6d33b6d9b13511cd0be2cac046f2e70fd0a07aa9573a04a82783af96
+replaces="chroot-m4>=0"
 
 if [ "$XBPS_TARGET_LIBC" = musl ]; then
 	export ac_cv_lib_error_at_line=no

From 6db10586ebdb33dc5c181f990536f5ebd3d81aa5 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 22:57:59 -0700
Subject: [PATCH 09/51] btrfs-progs: update to 5.19.

---
 srcpkgs/btrfs-progs/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/btrfs-progs/template b/srcpkgs/btrfs-progs/template
index f6c53d8587e1..292d5110106b 100644
--- a/srcpkgs/btrfs-progs/template
+++ b/srcpkgs/btrfs-progs/template
@@ -1,6 +1,6 @@
 # Template file for 'btrfs-progs'
 pkgname=btrfs-progs
-version=5.18.1
+version=5.19
 revision=1
 wrksrc="${pkgname}-v${version}"
 build_style=gnu-configure
@@ -16,7 +16,7 @@ license="GPL-2.0-only, LGPL-2.1-or-later"
 homepage="https://btrfs.wiki.kernel.org/index.php/Main_Page"
 changelog="https://raw.githubusercontent.com/kdave/btrfs-progs/master/CHANGES"
 distfiles="${KERNEL_SITE}/kernel/people/kdave/${pkgname}/${pkgname}-v${version}.tar.xz"
-checksum=6e98a75ccff52e9354daa1ad284c614c490f844273a2fa524cbac9eb841c7255
+checksum=1fbcf06e4b2f80e7a127fd687ed4625a5b74fa674fe212c836ff70e0edfcccf9
 # Most of the tests depend on `mount` and `fallocate` commands, which are not
 # presented in chroot-util-linux
 make_check=no

From f18fb405764c537a6ba9bde07b0a090ad291aaff Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 19:39:23 -0700
Subject: [PATCH 10/51] syslinux: fix build for glibc 2.36

---
 .../patches/fix-build-with-glibc-2.36.patch   | 30 +++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 srcpkgs/syslinux/patches/fix-build-with-glibc-2.36.patch

diff --git a/srcpkgs/syslinux/patches/fix-build-with-glibc-2.36.patch b/srcpkgs/syslinux/patches/fix-build-with-glibc-2.36.patch
new file mode 100644
index 000000000000..1303be56c127
--- /dev/null
+++ b/srcpkgs/syslinux/patches/fix-build-with-glibc-2.36.patch
@@ -0,0 +1,30 @@
+--- a/linux/syslinux.c
++++ b/linux/syslinux.c
+@@ -45,7 +45,6 @@
+ #include <sys/stat.h>
+ #include <sys/types.h>
+ #include <sys/wait.h>
+-#include <sys/mount.h>
+ 
+ #include "linuxioctl.h"
+ 
+--- a/libinstaller/syslxcom.c
++++ b/libinstaller/syslxcom.c
+@@ -28,7 +28,6 @@
+ #include <errno.h>
+ #include <sys/stat.h>
+ #include <sys/types.h>
+-#include <sys/mount.h>
+ #include <sys/vfs.h>
+ 
+ #include "linuxioctl.h"
+--- a/extlinux/main.c
++++ b/extlinux/main.c
+@@ -40,7 +40,6 @@
+ #include <sys/stat.h>
+ #include <sys/sysmacros.h>
+ #include <sys/types.h>
+-#include <sys/mount.h>
+ #include <sys/vfs.h>
+ 
+ #include "linuxioctl.h"

From 1c4f132f84efd8b2350bb742edb25cdd6b5f7af4 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 14 Aug 2022 19:29:36 -0700
Subject: [PATCH 11/51] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove -no-pie from build. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..58d94f8dacba 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -60,6 +60,7 @@ _void_cross_build_binutils() {
 		--disable-multilib \
 		--disable-werror \
 		--disable-gold \
+		--disable-gprofng \
 		--enable-relro \
 		--enable-plugins \
 		--enable-64-bit-bfd \
@@ -132,6 +133,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -460,6 +462,14 @@ do_build() {
 	local binutils_ver linux_ver gcc_ver libc_ver libucontext_ver
 	local tgt=${sourcepkg/cross-}
 
+	export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}"
+	export CXXFLAGS="${CXXFLAGS/-D_FORTIFY_SOURCE=2/}"
+
+	# Disable explicit -fno-PIE, gcc/binutils/libc will figure this out itself.
+	export CFLAGS="${CFLAGS//-fno-PIE/}"
+	export CXXFLAGS="${CXXFLAGS//-fno-PIE/}"
+	export LDFLAGS="${LDFLAGS//-no-pie/}"
+
 	_void_cross_test_ver binutils
 	_void_cross_test_ver linux
 	_void_cross_test_ver gcc
@@ -625,6 +635,9 @@ do_install() {
 	# then remove it because it conflicts with libquadmath package
 	rm -rf ${DESTDIR}/${sysroot}/usr/lib/libquadmath.*
 
+	# Remove libdep linker plugin because it conflicts with system binutils
+	rm -f ${DESTDIR}/usr/lib/bfd-plugins/libdep*
+
 	# Remove leftover symlinks
 	rm -f ${DESTDIR}/usr/lib${XBPS_TARGET_WORDSIZE}
 	rm -f ${DESTDIR}/lib*

From 4dfa83c0f0094bd93d81c7979f2ec99a98d473ec Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:08:52 -0700
Subject: [PATCH 12/51] openssh: suppress werror on gcc12

---
 srcpkgs/openssh/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/openssh/template b/srcpkgs/openssh/template
index 02a2dec35f42..6e8e343a9dca 100644
--- a/srcpkgs/openssh/template
+++ b/srcpkgs/openssh/template
@@ -40,7 +40,7 @@ if [ "$build_option_ldns" -a -z "$build_option_ssl" ]; then
 	broken="option 'ldns' requires option 'ssl'"
 fi
 
-CFLAGS="-Wno-format-truncation -Wno-stringop-truncation"
+CFLAGS="-Wno-format-truncation -Wno-stringop-truncation -Wno-error=maybe-uninitialized"
 
 case $XBPS_TARGET_MACHINE in
 	i686-musl)

From 1cc0311d311ff838bb7f95e3aa11971870c5dffe Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:09:31 -0700
Subject: [PATCH 13/51] linux5.18: update dotconfigs for gcc12

---
 srcpkgs/linux5.18/files/x86_64-dotconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/linux5.18/files/x86_64-dotconfig b/srcpkgs/linux5.18/files/x86_64-dotconfig
index 4e73a3195d40..ea6204868e23 100644
--- a/srcpkgs/linux5.18/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.18/files/x86_64-dotconfig
@@ -512,6 +512,7 @@ CONFIG_RETHUNK=y
 CONFIG_CPU_UNRET_ENTRY=y
 CONFIG_CPU_IBPB_ENTRY=y
 CONFIG_CPU_IBRS_ENTRY=y
+CONFIG_SLS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10060,8 +10061,11 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
 # Memory initialization
 #
 CONFIG_INIT_STACK_NONE=y
+# CONFIG_INIT_STACK_ALL_PATTERN is not set
+# CONFIG_INIT_STACK_ALL_ZERO is not set
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
+# CONFIG_ZERO_CALL_USED_REGS is not set
 # end of Memory initialization
 # end of Kernel hardening options
 # end of Security options
@@ -10538,6 +10542,7 @@ CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
 # CONFIG_UBSAN is not set
 CONFIG_HAVE_ARCH_KCSAN=y
+# CONFIG_KCSAN is not set
 # end of Generic Kernel Debugging Instruments
 
 #

From ee4c718052c47b6ed81968080840aa958142407d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 18:00:42 -0700
Subject: [PATCH 14/51] xf86-video-vmware: fix build on gcc12

---
 ...183b3395333d5d4c73e25c2d011748f15eda.patch | 30 +++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch

diff --git a/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch b/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch
new file mode 100644
index 000000000000..ff839f16e628
--- /dev/null
+++ b/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch
@@ -0,0 +1,30 @@
+From 77b8183b3395333d5d4c73e25c2d011748f15eda Mon Sep 17 00:00:00 2001
+From: Rudi Heitbaum <rudi@heitbaum.com>
+Date: Sun, 8 May 2022 03:00:10 +0000
+Subject: [PATCH] vmwgfx: fix missing array notation
+
+ Fixes error identified by gcc-12.1.0 compiler
+
+make
+  CC       libvmwgfx_la-vmwgfx_tex_video.lo
+vmwgfx_tex_video.c: In function 'stop_video':
+vmwgfx_tex_video.c:240:20: error: the comparison will always evaluate as 'true' for the address of 'yuv' will never be NULL [-Werror=address]
+  240 |                if (priv->yuv[i]) {
+      |                    ^~~~
+---
+ vmwgfx/vmwgfx_tex_video.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/vmwgfx/vmwgfx_tex_video.c b/vmwgfx/vmwgfx_tex_video.c
+index acc2b56..480a5f1 100644
+--- a/vmwgfx/vmwgfx_tex_video.c
++++ b/vmwgfx/vmwgfx_tex_video.c
+@@ -237,7 +237,7 @@ stop_video(ScrnInfoPtr pScrn, pointer data, Bool shutdown)
+ 
+        for (i=0; i<3; ++i) {
+ 	   for (j=0; j<2; ++j) {
+-	       if (priv->yuv[i]) {
++	       if (priv->yuv[j][i]) {
+ 		   xa_surface_destroy(priv->yuv[j][i]);
+ 		   priv->yuv[j][i] = NULL;
+ 	       }

From e59a43b7f1d5d7c48a1a81df14094359e0e8fc74 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 18:24:37 -0700
Subject: [PATCH 15/51] doxygen: fix build for gcc 12

---
 srcpkgs/doxygen/patches/compat-gcc12.patch | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100644 srcpkgs/doxygen/patches/compat-gcc12.patch

diff --git a/srcpkgs/doxygen/patches/compat-gcc12.patch b/srcpkgs/doxygen/patches/compat-gcc12.patch
new file mode 100644
index 000000000000..666744a1dceb
--- /dev/null
+++ b/srcpkgs/doxygen/patches/compat-gcc12.patch
@@ -0,0 +1,22 @@
+From 5198966c8d5fec89116d025c74934ac03ea511fa Mon Sep 17 00:00:00 2001
+From: Dimitri van Heesch <doxygen@gmail.com>
+Date: Fri, 6 May 2022 09:55:16 +0200
+Subject: [PATCH] issue #9312: Build: cache.h:53:14: error: 'exchange' is not a
+ member of 'std'
+
+---
+ src/cache.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/cache.h b/src/cache.h
+index 0ff3092ed5..e218eb27d2 100644
+--- a/src/cache.h
++++ b/src/cache.h
+@@ -19,6 +19,7 @@
+ #include <list>
+ #include <unordered_map>
+ #include <mutex>
++#include <utility>
+ #include <ctype.h>
+ 
+ /*! Fixed size cache for value type V using keys of type K.

From 44aff5b8ca8935b57a3ed4f22f2ff22af3388d88 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 21 Aug 2022 15:12:00 -0700
Subject: [PATCH 16/51] libproxy: update to 0.4.18

---
 srcpkgs/libproxy/template | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/libproxy/template b/srcpkgs/libproxy/template
index d6103007032e..6599dfb69b98 100644
--- a/srcpkgs/libproxy/template
+++ b/srcpkgs/libproxy/template
@@ -1,18 +1,22 @@
 # Template file for 'libproxy'
 pkgname=libproxy
-version=0.4.15
+version=0.4.18
 revision=1
 build_style=cmake
 configure_args="-DWITH_GNOME=0 -DWITH_KDE4=0 -DWITH_MOZJS=0 -DWITH_NM=0
  -DWITH_PERL=0 -DWITH_PYTHON=1 -DWITH_WEBKIT=0"
 hostmakedepends="pkg-config python"
 makedepends="zlib-devel"
-short_desc="A library handling all the details of proxy configuration"
+short_desc="Library handling all the details of proxy configuration"
 maintainer="Orphaned <orphan@voidlinux.org>"
+license="LGPL-2.1-or-later"
 homepage="http://github.com/libproxy/libproxy"
-license="LGPL-2.1"
-distfiles="https://github.com/libproxy/libproxy/archive/${version}.tar.gz>${pkgname}-${version}.tar.gz"
-checksum=18f58b0a0043b6881774187427ead158d310127fc46a1c668ad6d207fb28b4e0
+distfiles="https://github.com/libproxy/libproxy/archive/${version}.tar.gz"
+checksum=0b4a9218d88f6cf9fa25996a3f38329a11f688a9d026141d9d0e966d8fa63837
+
+post_patch() {
+	vsed '/add_test(NAME url-test/d' -i libproxy/test/CMakeLists.txt
+}
 
 libproxy-devel_package() {
 	depends="libproxy>=${version}_${revision}"

From 7db8e87b593d41c2898bc8a3cd6b780f9b03c30d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 21 Aug 2022 17:05:39 -0700
Subject: [PATCH 17/51] exempi: update to 2.6.2

---
 ...f034705fd2d032c81383eee8208fd4eee0ac.patch | 43 -------------------
 srcpkgs/exempi/template                       |  4 +-
 2 files changed, 2 insertions(+), 45 deletions(-)
 delete mode 100644 srcpkgs/exempi/patches/8ed2f034705fd2d032c81383eee8208fd4eee0ac.patch

diff --git a/srcpkgs/exempi/patches/8ed2f034705fd2d032c81383eee8208fd4eee0ac.patch b/srcpkgs/exempi/patches/8ed2f034705fd2d032c81383eee8208fd4eee0ac.patch
deleted file mode 100644
index 2696793cec09..000000000000
--- a/srcpkgs/exempi/patches/8ed2f034705fd2d032c81383eee8208fd4eee0ac.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From 8ed2f034705fd2d032c81383eee8208fd4eee0ac Mon Sep 17 00:00:00 2001
-From: Victor Rodriguez <victor.rodriguez.bahena@intel.com>
-Date: Sat, 18 Aug 2018 13:54:55 +0000
-Subject: [PATCH] Issue #9 - Fix null-pointer-dereference (CVE-2018-12648)
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-The WEBP::GetLE32 function in
-XMPFiles/source/FormatSupport/WEBP_Support.hpp in Exempi 2.4.5 has a
-NULL pointer dereference.
-
-https://bugs.freedesktop.org/show_bug.cgi?id=106981
-https://gitlab.freedesktop.org/libopenraw/exempi/issues/9
-
-Signed-off-by: Victor Rodriguez <victor.rodriguez.bahena@intel.com>
-Signed-off-by: Hubert Figuière <hub@figuiere.net>
----
- XMPFiles/source/FormatSupport/WEBP_Support.cpp | 8 +++++---
- 1 file changed, 5 insertions(+), 3 deletions(-)
-
-diff --git a/XMPFiles/source/FormatSupport/WEBP_Support.cpp b/XMPFiles/source/FormatSupport/WEBP_Support.cpp
-index ffaf220..4fe705b 100644
---- a/XMPFiles/source/FormatSupport/WEBP_Support.cpp
-+++ b/XMPFiles/source/FormatSupport/WEBP_Support.cpp
-@@ -160,9 +160,11 @@ bool VP8XChunk::xmp()
- }
- void VP8XChunk::xmp(bool hasXMP)
- {
--    XMP_Uns32 flags = GetLE32(&this->data[0]);
--    flags ^= (-hasXMP ^ flags) & (1 << XMP_FLAG_BIT);
--    PutLE32(&this->data[0], flags);
-+    if (&this->data[0] != NULL) {
-+        XMP_Uns32 flags = GetLE32(&this->data[0]);
-+        flags ^= (-hasXMP ^ flags) & (1 << XMP_FLAG_BIT);
-+        PutLE32(&this->data[0], flags);
-+    }
- }
- 
- Container::Container(WEBP_MetaHandler* handler) : Chunk(NULL, handler)
--- 
-2.18.0
-
diff --git a/srcpkgs/exempi/template b/srcpkgs/exempi/template
index 14753617953a..d664f7dc4d80 100644
--- a/srcpkgs/exempi/template
+++ b/srcpkgs/exempi/template
@@ -1,6 +1,6 @@
 # Template file for 'exempi'
 pkgname=exempi
-version=2.5.0
+version=2.6.2
 revision=1
 build_style=gnu-configure
 configure_args="--with-boost=${XBPS_CROSS_BASE}/usr --disable-static --disable-unittest"
@@ -10,7 +10,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="BSD-3-Clause"
 homepage="https://libopenraw.freedesktop.org/wiki/Exempi"
 distfiles="https://libopenraw.freedesktop.org/download/exempi-${version}.tar.bz2"
-checksum=dc82fc24c0540a44a63fa4ad21775d24e00e63f1dedd3e2ae6f7aa27583b711b
+checksum=4d17d4c93df2a95da3e3172c45b7a5bf317dd31dafd1c7a340169728c7089d1d
 
 post_install() {
 	vlicense COPYING

From 492d3edf553e9e245fd5000c9465893f19f83eb2 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 21 Aug 2022 21:36:03 -0700
Subject: [PATCH 18/51] plymouth: update to 22.02.122

---
 srcpkgs/plymouth/patches/fix-glibc-2.36.patch | 30 +++++++++++++++++++
 srcpkgs/plymouth/template                     |  4 +--
 2 files changed, 32 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/plymouth/patches/fix-glibc-2.36.patch

diff --git a/srcpkgs/plymouth/patches/fix-glibc-2.36.patch b/srcpkgs/plymouth/patches/fix-glibc-2.36.patch
new file mode 100644
index 000000000000..2f1e43875cfb
--- /dev/null
+++ b/srcpkgs/plymouth/patches/fix-glibc-2.36.patch
@@ -0,0 +1,30 @@
+From 5f1e43c00039a7fe1fff768b91a05a695fb4a53d Mon Sep 17 00:00:00 2001
+From: Ray Strode <rstrode@redhat.com>
+Date: Wed, 3 Aug 2022 15:23:33 -0400
+Subject: [PATCH] ply-utils: Drop linux/fs.h include
+
+It was needed long ago for a function we no longer even have.
+
+Now it's causing compile errors on Fedora 37 because it's conflicting
+with sys/mount.h.
+
+This commit drops it.
+---
+ src/libply/ply-utils.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/src/libply/ply-utils.c b/src/libply/ply-utils.c
+index c7b165e9..219e2e77 100644
+--- a/src/libply/ply-utils.c
++++ b/src/libply/ply-utils.c
+@@ -46,7 +46,6 @@
+ #include <sys/user.h>
+ #include <sys/wait.h>
+ #include <time.h>
+-#include <linux/fs.h>
+ #include <linux/vt.h>
+ 
+ #include <dlfcn.h>
+-- 
+GitLab
+
diff --git a/srcpkgs/plymouth/template b/srcpkgs/plymouth/template
index 17f801fc5315..442ab58a99cd 100644
--- a/srcpkgs/plymouth/template
+++ b/srcpkgs/plymouth/template
@@ -1,6 +1,6 @@
 # Template file for 'plymouth'
 pkgname=plymouth
-version=0.9.5
+version=22.02.122
 revision=1
 build_style=gnu-configure
 configure_args="--with-system-root-install=no \
@@ -18,7 +18,7 @@ maintainer="William OD <obirik2005@gmail.com>"
 license="GPL-2.0-or-later"
 homepage="https://www.freedesktop.org/wiki/Software/Plymouth/"
 distfiles="${FREEDESKTOP_SITE}/plymouth/releases/$pkgname-$version.tar.xz"
-checksum=ecae257f351d098340542a5bc06de029404c24dcee87e6ebb2abd5ef117fce86
+checksum=100551442221033ce868c447ad6c74d831d209c18ae232b98ae0207e34eadaeb
 
 build_options="gtk3 pango"
 build_options_default="gtk3 pango"

From 42961ecde8a18a88c2285238b310255ea3846bb3 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 21 Aug 2022 21:37:00 -0700
Subject: [PATCH 19/51] openjdk7-bootstrap: fix build for gcc12

---
 .../files/dist_patches_glibc.txt              |  1 +
 .../files/dist_patches_musl.txt               |  1 +
 .../icedtea-pointer-comparison-gcc12.patch    | 31 +++++++++++++++++++
 3 files changed, 33 insertions(+)
 create mode 100644 srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch

diff --git a/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt b/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt
index c76c56855441..8061756dfc0c 100644
--- a/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt
+++ b/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt
@@ -6,3 +6,4 @@ icedtea-jdk-no-soname.patch
 icedtea-jdk-xattr.patch
 icedtea-jdk-sysctl_h.patch
 icedtea-cpio.patch
+icedtea-pointer-comparison-gcc12.patch
diff --git a/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt b/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt
index 21812517c7c2..8b35d9c46989 100644
--- a/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt
+++ b/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt
@@ -11,3 +11,4 @@ icedtea-jdk-musl.patch
 icedtea-jdk-no-soname.patch
 icedtea-jdk-xattr.patch
 icedtea-cpio.patch
+icedtea-pointer-comparison-gcc12.patch
diff --git a/srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch b/srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch
new file mode 100644
index 000000000000..c809553443e7
--- /dev/null
+++ b/srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch
@@ -0,0 +1,31 @@
+--- openjdk.orig/hotspot/src/share/vm/opto/lcm.cpp
++++ openjdk/hotspot/src/share/vm/opto/lcm.cpp
+@@ -60,7 +60,7 @@
+ // Check whether val is not-null-decoded compressed oop,
+ // i.e. will grab into the base of the heap if it represents NULL.
+ static bool accesses_heap_base_zone(Node *val) {
+-  if (Universe::narrow_oop_base() > 0) { // Implies UseCompressedOops.
++  if (Universe::narrow_oop_base() > (address)0) { // Implies UseCompressedOops.
+     if (val && val->is_Mach()) {
+       if (val->as_Mach()->ideal_Opcode() == Op_DecodeN) {
+         // This assumes all Decodes with TypePtr::NotNull are matched to nodes that
+--- openjdk.orig/hotspot/src/share/vm/runtime/virtualspace.cpp
++++ openjdk/hotspot/src/share/vm/runtime/virtualspace.cpp
+@@ -527,7 +527,7 @@ ReservedHeapSpace::ReservedHeapSpace(siz
+                 (UseCompressedOops && (Universe::narrow_oop_base() != NULL) &&
+                  Universe::narrow_oop_use_implicit_null_checks()) ?
+                   lcm(os::vm_page_size(), alignment) : 0) {
+-  if (base() > 0) {
++  if (base() > (char*)0) {
+     MemTracker::record_virtual_memory_type((address)base(), mtJavaHeap);
+   }
+ 
+@@ -546,7 +546,7 @@ ReservedHeapSpace::ReservedHeapSpace(con
+                 (UseCompressedOops && (Universe::narrow_oop_base() != NULL) &&
+                  Universe::narrow_oop_use_implicit_null_checks()) ?
+                   lcm(os::vm_page_size(), prefix_align) : 0) {
+-  if (base() > 0) {
++  if (base() > (char*)0) {
+     MemTracker::record_virtual_memory_type((address)base(), mtJavaHeap);
+   }
+ 

From 1fee6117610fa446e127440b5fdec513af7334c2 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:39:52 -0700
Subject: [PATCH 20/51] libvirt: fix build for glibc 2.36

---
 .../patches/lxc-fix-compat-glibc-2.36.patch   | 34 ++++++++++++++++
 .../virfile-fix-compat-glibc-2.36.patch       | 39 +++++++++++++++++++
 2 files changed, 73 insertions(+)
 create mode 100644 srcpkgs/libvirt/patches/lxc-fix-compat-glibc-2.36.patch
 create mode 100644 srcpkgs/libvirt/patches/virfile-fix-compat-glibc-2.36.patch

diff --git a/srcpkgs/libvirt/patches/lxc-fix-compat-glibc-2.36.patch b/srcpkgs/libvirt/patches/lxc-fix-compat-glibc-2.36.patch
new file mode 100644
index 000000000000..d85b57815010
--- /dev/null
+++ b/srcpkgs/libvirt/patches/lxc-fix-compat-glibc-2.36.patch
@@ -0,0 +1,34 @@
+From 9493c9b79dc541ec9e0fd73c6d87bdf8d30aaa90 Mon Sep 17 00:00:00 2001
+From: Cole Robinson <crobinso@redhat.com>
+Date: Mon, 1 Aug 2022 15:20:38 -0400
+Subject: [PATCH] lxc: containter: fix build with glibc 2.36
+
+With glibc 2.36, sys/mount.h and linux/mount.h conflict:
+https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
+
+lxc_container.c imports sys/mount.h and linux/fs.h, which pulls in
+linux/mount.h.
+
+linux/fs.h isn't required here though. glibc sys/mount.h has had
+MS_MOVE since 2.12 in 2010
+
+Reviewed-by: Erik Skultety <eskultet@redhat.com>
+Signed-off-by: Cole Robinson <crobinso@redhat.com>
+---
+ src/lxc/lxc_container.c | 3 ---
+ 1 file changed, 3 deletions(-)
+
+diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
+index b5278831da7..a5401c2186e 100644
+--- a/src/lxc/lxc_container.c
++++ b/src/lxc/lxc_container.c
+@@ -33,9 +33,6 @@
+ /* Yes, we want linux private one, for _syscall2() macro */
+ #include <linux/unistd.h>
+ 
+-/* For MS_MOVE */
+-#include <linux/fs.h>
+-
+ #if WITH_CAPNG
+ # include <cap-ng.h>
+ #endif
diff --git a/srcpkgs/libvirt/patches/virfile-fix-compat-glibc-2.36.patch b/srcpkgs/libvirt/patches/virfile-fix-compat-glibc-2.36.patch
new file mode 100644
index 000000000000..2ef227ea9b54
--- /dev/null
+++ b/srcpkgs/libvirt/patches/virfile-fix-compat-glibc-2.36.patch
@@ -0,0 +1,39 @@
+From c0d9adf220dc0d223330a7bac37b174132d330ba Mon Sep 17 00:00:00 2001
+From: Cole Robinson <crobinso@redhat.com>
+Date: Mon, 1 Aug 2022 15:24:01 -0400
+Subject: [PATCH] virfile: Fix build with glibc 2.36
+
+With glibc 2.36, sys/mount.h and linux/mount.h conflict:
+https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
+
+virfile.c imports sys/mount.h and linux/fs.h, which pulls in
+linux/mount.h.
+
+Manually define the constants we need from linux/fs.h, like was
+done in llvm:
+
+https://reviews.llvm.org/rGb379129c4beb3f26223288627a1291739f33af02
+
+Reviewed-by: Erik Skultety <eskultet@redhat.com>
+Signed-off-by: Cole Robinson <crobinso@redhat.com>
+---
+ src/util/virfile.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/src/util/virfile.c b/src/util/virfile.c
+index 99da058db3b..ce541b8946b 100644
+--- a/src/util/virfile.c
++++ b/src/util/virfile.c
+@@ -71,7 +71,11 @@
+ # endif
+ # include <sys/ioctl.h>
+ # include <linux/cdrom.h>
+-# include <linux/fs.h>
++/* These come from linux/fs.h, but that header conflicts with
++ * sys/mount.h on glibc 2.36+ */
++# define FS_IOC_GETFLAGS _IOR('f', 1, long)
++# define FS_IOC_SETFLAGS _IOW('f', 2, long)
++# define FS_NOCOW_FL 0x00800000
+ #endif
+ 
+ #if WITH_LIBATTR

From b995a18e37c6242464a893708521add362dfa836 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:41:50 -0700
Subject: [PATCH 21/51] efivar: fix build for glibc 2.36

---
 .../patches/fix-compat-glibc-2.36.patch       | 55 +++++++++++++++++++
 1 file changed, 55 insertions(+)
 create mode 100644 srcpkgs/efivar/patches/fix-compat-glibc-2.36.patch

diff --git a/srcpkgs/efivar/patches/fix-compat-glibc-2.36.patch b/srcpkgs/efivar/patches/fix-compat-glibc-2.36.patch
new file mode 100644
index 000000000000..fcc83aef20cf
--- /dev/null
+++ b/srcpkgs/efivar/patches/fix-compat-glibc-2.36.patch
@@ -0,0 +1,55 @@
+From bc65d63ebf8fe6ac8a099ff15ca200986dba1565 Mon Sep 17 00:00:00 2001
+From: Robbie Harwood <rharwood@redhat.com>
+Date: Thu, 28 Jul 2022 16:11:24 -0400
+Subject: [PATCH] Fix glibc 2.36 build (mount.h conflicts)
+
+glibc has decided that sys/mount.h and linux/mount.h are no longer
+usable at the same time.  This broke the build, since linux/fs.h itself
+includes linux/mount.h.  For now, fix the build by only including
+sys/mount.h where we need it.
+
+See-also: https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
+Resolves: #227
+Signed-off-by: Robbie Harwood <rharwood@redhat.com>
+---
+ src/gpt.c   | 1 +
+ src/linux.c | 1 +
+ src/util.h  | 1 -
+ 3 files changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/gpt.c b/src/gpt.c
+index 1eda0497..21413c3b 100644
+--- a/src/gpt.c
++++ b/src/gpt.c
+@@ -17,6 +17,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <sys/mount.h>
+ #include <sys/param.h>
+ #include <sys/stat.h>
+ #include <sys/utsname.h>
+diff --git a/src/linux.c b/src/linux.c
+index 47e45ae4..1780816f 100644
+--- a/src/linux.c
++++ b/src/linux.c
+@@ -20,6 +20,7 @@
+ #include <stdbool.h>
+ #include <stdio.h>
+ #include <sys/ioctl.h>
++#include <sys/mount.h>
+ #include <sys/socket.h>
+ #include <sys/sysmacros.h>
+ #include <sys/types.h>
+diff --git a/src/util.h b/src/util.h
+index 3300666f..1e67e447 100644
+--- a/src/util.h
++++ b/src/util.h
+@@ -23,7 +23,6 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <sys/ioctl.h>
+-#include <sys/mount.h>
+ #include <sys/stat.h>
+ #include <sys/types.h>
+ #include <tgmath.h>

From dc53f841815ddaa82dac384ce66b18120e48231c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:43:24 -0700
Subject: [PATCH 22/51] libwpd: fix build for gcc12

---
 srcpkgs/libwpd/patches/fix-compat-gcc12.patch | 11 +++++++++++
 1 file changed, 11 insertions(+)
 create mode 100644 srcpkgs/libwpd/patches/fix-compat-gcc12.patch

diff --git a/srcpkgs/libwpd/patches/fix-compat-gcc12.patch b/srcpkgs/libwpd/patches/fix-compat-gcc12.patch
new file mode 100644
index 000000000000..6ebce2463d16
--- /dev/null
+++ b/srcpkgs/libwpd/patches/fix-compat-gcc12.patch
@@ -0,0 +1,11 @@
+diff -rup libwpd-0.10.3.orig/src/lib/WPXTable.h libwpd-0.10.3/src/lib/WPXTable.h
+--- libwpd-0.10.3.orig/src/lib/WPXTable.h	2022-08-23 22:32:45.332593795 -0700
++++ libwpd-0.10.3/src/lib/WPXTable.h	2022-08-23 22:32:59.500651211 -0700
+@@ -37,6 +37,7 @@
+ #define _WPXTABLE_H
+ 
+ #include <vector>
++#include <cstddef>
+ 
+ struct WPXTableCell
+ {

From c4ea1a6e4a6e705361dd1747318436d3980949bf Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:44:07 -0700
Subject: [PATCH 23/51] grub: fix build for binutils 2.36

---
 .../patches/fix-compat-binutils-2.36.patch    | 96 +++++++++++++++++++
 srcpkgs/grub/template                         |  7 +-
 2 files changed, 102 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/grub/patches/fix-compat-binutils-2.36.patch

diff --git a/srcpkgs/grub/patches/fix-compat-binutils-2.36.patch b/srcpkgs/grub/patches/fix-compat-binutils-2.36.patch
new file mode 100644
index 000000000000..d92a91e3253e
--- /dev/null
+++ b/srcpkgs/grub/patches/fix-compat-binutils-2.36.patch
@@ -0,0 +1,96 @@
+From b98275138bf4fc250a1c362dfd2c8b1cf2421701 Mon Sep 17 00:00:00 2001
+From: Michael Chang <mchang@suse.com>
+Date: Tue, 28 Sep 2021 13:50:47 +0800
+Subject: build: Fix build error with binutils 2.36
+
+The following procedure to build xen/pvgrub is broken.
+
+  git clone https://git.savannah.gnu.org/git/grub.git
+  cd grub
+  ./bootstrap
+  mkdir build-xen
+  cd build-xen
+  ../configure --with-platform=xen
+  make
+
+It fails with the message:
+
+  /usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld:
+  section .note.gnu.property VMA [0000000000400158,0000000000400187]
+  overlaps section .bss VMA [000000000000f000,000000000041e1af]
+
+The most significant factor is that new assembler (GNU as) generates the
+.note.gnu.property section as default. This note section overlaps with
+.bss because it doesn't reposition with -Wl,-Ttext,0 with which the base
+address of .text section is set, rather the address of .note.gnu.property
+is calculated for some reason from 0x400000 where the ELF executable
+defaults to start.
+
+Using -Ttext-segment doesn't help either, though it is said to set the
+address of the first byte of the text segment according to "man ld".
+What it actually does is to override the default 0x400000, aka the image
+base address, to something else. The entire process can be observed in
+the default linker script used by gcc [1]. Therefore we can't expect it
+to achieve the same thing as -Ttext given that the first segment where
+.text resides is offset by SIZEOF_HEADERS plus some sections may be
+preceding it within the first segment. The end result is .text always
+has to start with non-zero address with -Wl,-Ttext-segment,0 if using
+default linker script.
+
+It is also worth mentioning that binutils upstream apparently doesn't
+seem to consider this as a bug [2] and proposed to use -Wl,-Ttext-segment,0
+which is not fruitful as what has been tested by Gentoo [3].
+
+As long as GRUB didn't use ISA information encoded in .note.gnu.property,
+we can safely drop it via -Wa,-mx86-used-note=no assembler option to
+fix the linker error above.
+
+This is considered a better approach than using custom linker script to
+drop the .note.gnu.property section because object file manipulation can
+also be hampered one way or the other in that linker script may not be
+helpful. See also this commit removing the section in the process of objcopy.
+
+  6643507ce build: Fix GRUB i386-pc build with Ubuntu gcc
+
+[1] In /usr/lib64/ldscripts/elf_x86_64.x or use 'gcc -Wl,--verbose ...'
+    PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x400000));
+    . = SEGMENT_START("text-segment", 0x400000) + SIZEOF_HEADERS;
+[2] https://sourceware.org/bugzilla/show_bug.cgi?id=27377
+[3] https://bugs.gentoo.org/787221
+
+Signed-off-by: Michael Chang <mchang@suse.com>
+Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
+---
+ configure.ac | 14 ++++++++++++++
+ 1 file changed, 14 insertions(+)
+
+(limited to 'configure.ac')
+
+diff --git a/configure.ac b/configure.ac
+index eeb5d22..8d1c81a 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -840,6 +840,20 @@ if ( test "x$target_cpu" = xi386 || test "x$target_cpu" = xx86_64 ) && test "x$p
+   TARGET_CFLAGS="$TARGET_CFLAGS -mno-mmx -mno-sse -mno-sse2 -mno-sse3 -mno-3dnow"
+ fi
+ 
++if ( test "x$target_cpu" = xi386 || test "x$target_cpu" = xx86_64 ); then
++  AC_CACHE_CHECK([whether -Wa,-mx86-used-note works], [grub_cv_cc_mx86_used_note], [
++    CFLAGS="$TARGET_CFLAGS -Wa,-mx86-used-note=no -Werror"
++    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
++	[grub_cv_cc_mx86_used_note=yes],
++	[grub_cv_cc_mx86_used_note=no])
++  ])
++
++  if test "x$grub_cv_cc_mx86_used_note" = xyes; then
++    TARGET_CFLAGS="$TARGET_CFLAGS -Wa,-mx86-used-note=no"
++    TARGET_CCASFLAGS="$TARGET_CCASFLAGS -Wa,-mx86-used-note=no"
++  fi
++fi
++
+ # GRUB doesn't use float or doubles at all. Yet some toolchains may decide
+ # that floats are a good fit to run instead of what's written in the code.
+ # Given that floating point unit is disabled (if present to begin with)
+-- 
+cgit v1.1
+
diff --git a/srcpkgs/grub/template b/srcpkgs/grub/template
index b1826c38a884..b4d3b07af620 100644
--- a/srcpkgs/grub/template
+++ b/srcpkgs/grub/template
@@ -2,7 +2,8 @@
 pkgname=grub
 version=2.06
 revision=2
-hostmakedepends="python3 pkg-config flex freetype-devel font-unifont-bdf help2man"
+hostmakedepends="python3 pkg-config flex freetype-devel font-unifont-bdf help2man
+ automake gettext-devel-tools"
 makedepends="libusb-compat-devel ncurses-devel freetype-devel
  liblzma-devel device-mapper-devel fuse-devel"
 depends="os-prober"
@@ -43,6 +44,10 @@ case "$XBPS_TARGET_MACHINE" in
 		;;
 esac
 
+pre_configure() {
+	autoreconf -fi
+}
+
 do_configure() {
 	# workaround for https://savannah.gnu.org/bugs/?60458
 	# some more info: https://www.linuxquestions.org/questions/showthread.php?p=6257712

From 8daa5d64f33d7937782f534e0c07d6d11e55f7da Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:45:07 -0700
Subject: [PATCH 24/51] linux-toos: fix build for binutils 2.39

---
 .../patches/binutils-add-compat-check.patch   | 103 ++++++++++++
 .../patches/binutils-disasm-compat.patch      | 102 ++++++++++++
 .../bpf_jit_disasm-binutils-2.39.patch        | 104 ++++++++++++
 .../patches/bpftool-binutils-2.39.patch       | 149 ++++++++++++++++++
 .../patches/perf-binutils-2.39.patch          | 114 ++++++++++++++
 5 files changed, 572 insertions(+)
 create mode 100644 srcpkgs/linux-tools/patches/binutils-add-compat-check.patch
 create mode 100644 srcpkgs/linux-tools/patches/binutils-disasm-compat.patch
 create mode 100644 srcpkgs/linux-tools/patches/bpf_jit_disasm-binutils-2.39.patch
 create mode 100644 srcpkgs/linux-tools/patches/bpftool-binutils-2.39.patch
 create mode 100644 srcpkgs/linux-tools/patches/perf-binutils-2.39.patch

diff --git a/srcpkgs/linux-tools/patches/binutils-add-compat-check.patch b/srcpkgs/linux-tools/patches/binutils-add-compat-check.patch
new file mode 100644
index 000000000000..e4e7ece9635e
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/binutils-add-compat-check.patch
@@ -0,0 +1,103 @@
+From cfd59ca91467056bb2c36907b2fa67b8e1af9952 Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:27 -0700
+Subject: [PATCH] tools build: Add feature test for init_disassemble_info API
+ changes
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation failures for tools/{perf,bpf}, e.g. on debian unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+This commit adds a feature test to detect the new signature.  Subsequent
+commits will use it to fix the build failures.
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Quentin Monnet <quentin@isovalent.com>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-2-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/build/Makefile.feature                        |  1 +
+ tools/build/feature/Makefile                        |  4 ++++
+ tools/build/feature/test-all.c                      |  4 ++++
+ tools/build/feature/test-disassembler-init-styled.c | 13 +++++++++++++
+ 4 files changed, 22 insertions(+)
+ create mode 100644 tools/build/feature/test-disassembler-init-styled.c
+
+diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature
+index 888a0421d43b96..8f6578e4d3249e 100644
+--- a/tools/build/Makefile.feature
++++ b/tools/build/Makefile.feature
+@@ -70,6 +70,7 @@ FEATURE_TESTS_BASIC :=                  \
+         libaio				\
+         libzstd				\
+         disassembler-four-args		\
++        disassembler-init-styled	\
+         file-handle
+ 
+ # FEATURE_TESTS_BASIC + FEATURE_TESTS_EXTRA is the complete list
+diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile
+index 7c2a17e23c30ac..c3059739318a95 100644
+--- a/tools/build/feature/Makefile
++++ b/tools/build/feature/Makefile
+@@ -18,6 +18,7 @@ FILES=                                          \
+          test-libbfd.bin                        \
+          test-libbfd-buildid.bin		\
+          test-disassembler-four-args.bin        \
++         test-disassembler-init-styled.bin	\
+          test-reallocarray.bin			\
+          test-libbfd-liberty.bin                \
+          test-libbfd-liberty-z.bin              \
+@@ -248,6 +249,9 @@ $(OUTPUT)test-libbfd-buildid.bin:
+ $(OUTPUT)test-disassembler-four-args.bin:
+ 	$(BUILD) -DPACKAGE='"perf"' -lbfd -lopcodes
+ 
++$(OUTPUT)test-disassembler-init-styled.bin:
++	$(BUILD) -DPACKAGE='"perf"' -lbfd -lopcodes
++
+ $(OUTPUT)test-reallocarray.bin:
+ 	$(BUILD)
+ 
+diff --git a/tools/build/feature/test-all.c b/tools/build/feature/test-all.c
+index 5ffafb967b6e49..957c02c7b163b5 100644
+--- a/tools/build/feature/test-all.c
++++ b/tools/build/feature/test-all.c
+@@ -166,6 +166,10 @@
+ # include "test-disassembler-four-args.c"
+ #undef main
+ 
++#define main main_test_disassembler_init_styled
++# include "test-disassembler-init-styled.c"
++#undef main
++
+ #define main main_test_libzstd
+ # include "test-libzstd.c"
+ #undef main
+diff --git a/tools/build/feature/test-disassembler-init-styled.c b/tools/build/feature/test-disassembler-init-styled.c
+new file mode 100644
+index 00000000000000..f1ce0ec3bee9d3
+--- /dev/null
++++ b/tools/build/feature/test-disassembler-init-styled.c
+@@ -0,0 +1,13 @@
++// SPDX-License-Identifier: GPL-2.0
++#include <stdio.h>
++#include <dis-asm.h>
++
++int main(void)
++{
++	struct disassemble_info info;
++
++	init_disassemble_info(&info, stdout,
++			      NULL, NULL);
++
++	return 0;
++}
diff --git a/srcpkgs/linux-tools/patches/binutils-disasm-compat.patch b/srcpkgs/linux-tools/patches/binutils-disasm-compat.patch
new file mode 100644
index 000000000000..1a6cc0e6d97c
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/binutils-disasm-compat.patch
@@ -0,0 +1,102 @@
+From a45b3d6926231c3d024ea0de4f7bd967f83709ee Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:29 -0700
+Subject: tools include: add dis-asm-compat.h to handle version differences
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation failures for tools/{perf,bpf}, e.g. on debian unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+This commit introduces a wrapper for init_disassemble_info(), to avoid
+spreading #ifdef DISASM_INIT_STYLED to a bunch of places. Subsequent
+commits will use it to fix the build failures.
+
+It likely is worth adding a wrapper for disassember(), to avoid the already
+existing DISASM_FOUR_ARGS_SIGNATURE ifdefery.
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Signed-off-by: Ben Hutchings <benh@debian.org>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Quentin Monnet <quentin@isovalent.com>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-4-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/include/tools/dis-asm-compat.h | 55 ++++++++++++++++++++++++++++++++++++
+ 1 file changed, 55 insertions(+)
+ create mode 100644 tools/include/tools/dis-asm-compat.h
+
+(limited to 'tools/include/tools/dis-asm-compat.h')
+
+diff --git a/tools/include/tools/dis-asm-compat.h b/tools/include/tools/dis-asm-compat.h
+new file mode 100644
+index 0000000000000..70f331e23ed3d
+--- /dev/null
++++ b/tools/include/tools/dis-asm-compat.h
+@@ -0,0 +1,55 @@
++/* SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause */
++#ifndef _TOOLS_DIS_ASM_COMPAT_H
++#define _TOOLS_DIS_ASM_COMPAT_H
++
++#include <stdio.h>
++#include <dis-asm.h>
++
++/* define types for older binutils version, to centralize ifdef'ery a bit */
++#ifndef DISASM_INIT_STYLED
++enum disassembler_style {DISASSEMBLER_STYLE_NOT_EMPTY};
++typedef int (*fprintf_styled_ftype) (void *, enum disassembler_style, const char*, ...);
++#endif
++
++/*
++ * Trivial fprintf wrapper to be used as the fprintf_styled_func argument to
++ * init_disassemble_info_compat() when normal fprintf suffices.
++ */
++static inline int fprintf_styled(void *out,
++				 enum disassembler_style style,
++				 const char *fmt, ...)
++{
++	va_list args;
++	int r;
++
++	(void)style;
++
++	va_start(args, fmt);
++	r = vfprintf(out, fmt, args);
++	va_end(args);
++
++	return r;
++}
++
++/*
++ * Wrapper for init_disassemble_info() that hides version
++ * differences. Depending on binutils version and architecture either
++ * fprintf_func or fprintf_styled_func will be called.
++ */
++static inline void init_disassemble_info_compat(struct disassemble_info *info,
++						void *stream,
++						fprintf_ftype unstyled_func,
++						fprintf_styled_ftype styled_func)
++{
++#ifdef DISASM_INIT_STYLED
++	init_disassemble_info(info, stream,
++			      unstyled_func,
++			      styled_func);
++#else
++	(void)styled_func;
++	init_disassemble_info(info, stream,
++			      unstyled_func);
++#endif
++}
++
++#endif /* _TOOLS_DIS_ASM_COMPAT_H */
+-- 
+cgit 
+
diff --git a/srcpkgs/linux-tools/patches/bpf_jit_disasm-binutils-2.39.patch b/srcpkgs/linux-tools/patches/bpf_jit_disasm-binutils-2.39.patch
new file mode 100644
index 000000000000..01221fad3a4a
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/bpf_jit_disasm-binutils-2.39.patch
@@ -0,0 +1,104 @@
+From 96ed066054abf11c7d3e106e3011a51f3f1227a3 Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:31 -0700
+Subject: [PATCH] tools bpf_jit_disasm: Fix compilation error with new binutils
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation to fail for tools/bpf/bpf_jit_disasm.c, e.g. on debian
+unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+Wire up the feature test and switch to init_disassemble_info_compat(),
+which were introduced in prior commits, fixing the compilation failure.
+
+I verified that bpf_jit_disasm can still disassemble bpf programs, both
+with the old and new dis-asm.h API. With old binutils there's no change in
+output before/after this patch. When comparing the output from old
+binutils (2.35) to new bintuils with the patch (upstream snapshot) there
+are a few output differences, but they are unrelated to this patch. An
+example hunk is:
+
+     f4:	mov    %r14,%rsi
+     f7:	mov    %r15,%rdx
+     fa:	mov    $0x2a,%ecx
+  -  ff:	callq  0xffffffffea8c4988
+  +  ff:	call   0xffffffffea8c4988
+    104:	test   %rax,%rax
+    107:	jge    0x0000000000000110
+    109:	xor    %eax,%eax
+  - 10b:	jmpq   0x0000000000000073
+  + 10b:	jmp    0x0000000000000073
+    110:	cmp    $0x16,%rax
+
+However, I had to use an older kernel to generate the bpf_jit_enabled =
+2 output, as that has been broken since 5.18 / 1022a5498f6f745c ("bpf,
+x86_64: Use bpf_jit_binary_pack_alloc").
+
+  https://lore.kernel.org/20220703030210.pmjft7qc2eajzi6c@alap3.anarazel.de
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Daniel Borkmann <daniel@iogearbox.net>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Quentin Monnet <quentin@isovalent.com>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-6-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/bpf/Makefile         | 5 ++++-
+ tools/bpf/bpf_jit_disasm.c | 5 ++++-
+ 2 files changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/tools/bpf/Makefile b/tools/bpf/Makefile
+index b11cfc86a3d021..664601ab1705ab 100644
+--- a/tools/bpf/Makefile
++++ b/tools/bpf/Makefile
+@@ -34,7 +34,7 @@ else
+ endif
+ 
+ FEATURE_USER = .bpf
+-FEATURE_TESTS = libbfd disassembler-four-args
++FEATURE_TESTS = libbfd disassembler-four-args disassembler-init-styled
+ FEATURE_DISPLAY = libbfd disassembler-four-args
+ 
+ check_feat := 1
+@@ -56,6 +56,9 @@ endif
+ ifeq ($(feature-disassembler-four-args), 1)
+ CFLAGS += -DDISASM_FOUR_ARGS_SIGNATURE
+ endif
++ifeq ($(feature-disassembler-init-styled), 1)
++CFLAGS += -DDISASM_INIT_STYLED
++endif
+ 
+ $(OUTPUT)%.yacc.c: $(srctree)/tools/bpf/%.y
+ 	$(QUIET_BISON)$(YACC) -o $@ -d $<
+diff --git a/tools/bpf/bpf_jit_disasm.c b/tools/bpf/bpf_jit_disasm.c
+index c8ae9580472814..a90a5d110f9255 100644
+--- a/tools/bpf/bpf_jit_disasm.c
++++ b/tools/bpf/bpf_jit_disasm.c
+@@ -28,6 +28,7 @@
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <limits.h>
++#include <tools/dis-asm-compat.h>
+ 
+ #define CMD_ACTION_SIZE_BUFFER		10
+ #define CMD_ACTION_READ_ALL		3
+@@ -64,7 +65,9 @@ static void get_asm_insns(uint8_t *image, size_t len, int opcodes)
+ 	assert(bfdf);
+ 	assert(bfd_check_format(bfdf, bfd_object));
+ 
+-	init_disassemble_info(&info, stdout, (fprintf_ftype) fprintf);
++	init_disassemble_info_compat(&info, stdout,
++				     (fprintf_ftype) fprintf,
++				     fprintf_styled);
+ 	info.arch = bfd_get_arch(bfdf);
+ 	info.mach = bfd_get_mach(bfdf);
+ 	info.buffer = image;
diff --git a/srcpkgs/linux-tools/patches/bpftool-binutils-2.39.patch b/srcpkgs/linux-tools/patches/bpftool-binutils-2.39.patch
new file mode 100644
index 000000000000..1e55c40011be
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/bpftool-binutils-2.39.patch
@@ -0,0 +1,149 @@
+From 600b7b26c07a070d0153daa76b3806c1e52c9e00 Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:33 -0700
+Subject: [PATCH] tools bpftool: Fix compilation error with new binutils
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation to fail for tools/bpf/bpftool/jit_disasm.c, e.g. on debian
+unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+Wire up the feature test and switch to init_disassemble_info_compat(),
+which were introduced in prior commits, fixing the compilation failure.
+
+I verified that bpftool can still disassemble bpf programs, both with an
+old and new dis-asm.h API. There are no output changes for plain and json
+formats. When comparing the output from old binutils (2.35)
+to new bintuils with the patch (upstream snapshot) there are a few output
+differences, but they are unrelated to this patch. An example hunk is:
+
+     2f:	pop    %r14
+     31:	pop    %r13
+     33:	pop    %rbx
+  -  34:	leaveq
+  -  35:	retq
+  +  34:	leave
+  +  35:	ret
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Quentin Monnet <quentin@isovalent.com>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-8-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/bpf/bpftool/Makefile     |  5 +++-
+ tools/bpf/bpftool/jit_disasm.c | 42 +++++++++++++++++++++++++++-------
+ 2 files changed, 38 insertions(+), 9 deletions(-)
+
+diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile
+index c6d2c77d02524a..436e671b2657d4 100644
+--- a/tools/bpf/bpftool/Makefile
++++ b/tools/bpf/bpftool/Makefile
+@@ -62,7 +62,7 @@ CLANG ?= clang
+ LLVM_STRIP ?= llvm-strip
+ 
+ FEATURE_USER = .bpftool
+-FEATURE_TESTS = libbfd disassembler-four-args reallocarray zlib libcap \
++FEATURE_TESTS = libbfd disassembler-four-args disassembler-init-styled reallocarray zlib libcap \
+ 	clang-bpf-co-re
+ FEATURE_DISPLAY = libbfd disassembler-four-args zlib libcap \
+ 	clang-bpf-co-re
+@@ -117,6 +117,9 @@ endif
+ ifeq ($(feature-disassembler-four-args), 1)
+ CFLAGS += -DDISASM_FOUR_ARGS_SIGNATURE
+ endif
++ifeq ($(feature-disassembler-init-styled), 1)
++    CFLAGS += -DDISASM_INIT_STYLED
++endif
+ 
+ LIBS = $(LIBBPF) -lelf -lz
+ LIBS_BOOTSTRAP = $(LIBBPF_BOOTSTRAP) -lelf -lz
+diff --git a/tools/bpf/bpftool/jit_disasm.c b/tools/bpf/bpftool/jit_disasm.c
+index 24734f2249d6ec..aaf99a0168c90b 100644
+--- a/tools/bpf/bpftool/jit_disasm.c
++++ b/tools/bpf/bpftool/jit_disasm.c
+@@ -24,6 +24,7 @@
+ #include <sys/stat.h>
+ #include <limits.h>
+ #include <bpf/libbpf.h>
++#include <tools/dis-asm-compat.h>
+ 
+ #include "json_writer.h"
+ #include "main.h"
+@@ -39,15 +40,12 @@ static void get_exec_path(char *tpath, s
+ }
+ 
+ static int oper_count;
+-static int fprintf_json(void *out, const char *fmt, ...)
++static int printf_json(void *out, const char *fmt, va_list ap)
+ {
+-	va_list ap;
+ 	char *s;
+ 
+-	va_start(ap, fmt);
+ 	if (vasprintf(&s, fmt, ap) < 0)
+ 		return -1;
+-	va_end(ap);
+ 
+ 	if (!oper_count) {
+ 		int i;
+@@ -73,6 +71,32 @@ static int fprintf_json(void *out, const char *fmt, ...)
+ 	return 0;
+ }
+ 
++static int fprintf_json(void *out, const char *fmt, ...)
++{
++	va_list ap;
++	int r;
++
++	va_start(ap, fmt);
++	r = printf_json(out, fmt, ap);
++	va_end(ap);
++
++	return r;
++}
++
++static int fprintf_json_styled(void *out,
++			       enum disassembler_style style __maybe_unused,
++			       const char *fmt, ...)
++{
++	va_list ap;
++	int r;
++
++	va_start(ap, fmt);
++	r = printf_json(out, fmt, ap);
++	va_end(ap);
++
++	return r;
++}
++
+ void disasm_print_insn(unsigned char *image, ssize_t len, int opcodes,
+ 		       const char *arch, const char *disassembler_options,
+ 		       const struct btf *btf,
+@@ -99,11 +123,13 @@ void disasm_print_insn(unsigned char *image, ssize_t len, int opcodes,
+ 	assert(bfd_check_format(bfdf, bfd_object));
+ 
+ 	if (json_output)
+-		init_disassemble_info(&info, stdout,
+-				      (fprintf_ftype) fprintf_json);
++		init_disassemble_info_compat(&info, stdout,
++					     (fprintf_ftype) fprintf_json,
++					     fprintf_json_styled);
+ 	else
+-		init_disassemble_info(&info, stdout,
+-				      (fprintf_ftype) fprintf);
++		init_disassemble_info_compat(&info, stdout,
++					     (fprintf_ftype) fprintf,
++					     fprintf_styled);
+ 
+ 	/* Update architecture info for offload. */
+ 	if (arch) {
diff --git a/srcpkgs/linux-tools/patches/perf-binutils-2.39.patch b/srcpkgs/linux-tools/patches/perf-binutils-2.39.patch
new file mode 100644
index 000000000000..3484330f7286
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/perf-binutils-2.39.patch
@@ -0,0 +1,114 @@
+From 83aa0120487e8bc3f231e72c460add783f71f17c Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:30 -0700
+Subject: [PATCH] tools perf: Fix compilation error with new binutils
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation failures for tools/perf/util/annotate.c, e.g. on debian
+unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+Wire up the feature test and switch to init_disassemble_info_compat(),
+which were introduced in prior commits, fixing the compilation failure.
+
+I verified that perf can still disassemble bpf programs by using bpftrace
+under load, recording a perf trace, and then annotating the bpf "function"
+with and without the changes. With old binutils there's no change in output
+before/after this patch. When comparing the output from old binutils (2.35)
+to new bintuils with the patch (upstream snapshot) there are a few output
+differences, but they are unrelated to this patch. An example hunk is:
+
+       1.15 :   55:mov    %rbp,%rdx
+       0.00 :   58:add    $0xfffffffffffffff8,%rdx
+       0.00 :   5c:xor    %ecx,%ecx
+  -    1.03 :   5e:callq  0xffffffffe12aca3c
+  +    1.03 :   5e:call   0xffffffffe12aca3c
+       0.00 :   63:xor    %eax,%eax
+  -    2.18 :   65:leaveq
+  -    2.82 :   66:retq
+  +    2.18 :   65:leave
+  +    2.82 :   66:ret
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-5-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/perf/Makefile.config | 8 ++++++++
+ tools/perf/util/annotate.c | 7 ++++---
+ 2 files changed, 12 insertions(+), 3 deletions(-)
+
+diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
+index d3c254c0f5c611..23648ea54e8d3d 100644
+--- a/tools/perf/Makefile.config
++++ b/tools/perf/Makefile.config
+@@ -298,6 +298,7 @@ FEATURE_CHECK_LDFLAGS-libpython := $(PYTHON_EMBED_LDOPTS)
+ FEATURE_CHECK_LDFLAGS-libaio = -lrt
+ 
+ FEATURE_CHECK_LDFLAGS-disassembler-four-args = -lbfd -lopcodes -ldl
++FEATURE_CHECK_LDFLAGS-disassembler-init-styled = -lbfd -lopcodes -ldl
+ 
+ CORE_CFLAGS += -fno-omit-frame-pointer
+ CORE_CFLAGS += -ggdb3
+@@ -818,13 +819,16 @@ else
+   ifeq ($(feature-libbfd-liberty), 1)
+     EXTLIBS += -lbfd -lopcodes -liberty
+     FEATURE_CHECK_LDFLAGS-disassembler-four-args += -liberty -ldl
++    FEATURE_CHECK_LDFLAGS-disassembler-init-styled += -liberty -ldl
+   else
+     ifeq ($(feature-libbfd-liberty-z), 1)
+       EXTLIBS += -lbfd -lopcodes -liberty -lz
+       FEATURE_CHECK_LDFLAGS-disassembler-four-args += -liberty -lz -ldl
++      FEATURE_CHECK_LDFLAGS-disassembler-init-styled += -liberty -lz -ldl
+     endif
+   endif
+   $(call feature_check,disassembler-four-args)
++  $(call feature_check,disassembler-init-styled)
+ endif
+ 
+ ifeq ($(feature-libbfd-buildid), 1)
+@@ -1044,6 +1048,10 @@ ifeq ($(feature-disassembler-four-args), 1)
+     CFLAGS += -DDISASM_FOUR_ARGS_SIGNATURE
+ endif
+ 
++ifeq ($(feature-disassembler-init-styled), 1)
++    CFLAGS += -DDISASM_INIT_STYLED
++endif
++
+ ifeq (${IS_64_BIT}, 1)
+   ifndef NO_PERF_READ_VDSO32
+     $(call feature_check,compile-32)
+diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
+index 82cc396ef516c4..2c6a485c3de5d9 100644
+--- a/tools/perf/util/annotate.c
++++ b/tools/perf/util/annotate.c
+@@ -1676,6 +1676,7 @@ fallback:
+ #define PACKAGE "perf"
+ #include <bfd.h>
+ #include <dis-asm.h>
++#include <tools/dis-asm-compat.h>
+ 
+ static int symbol__disassemble_bpf(struct symbol *sym,
+ 				   struct annotate_args *args)
+@@ -1762,9 +1763,9 @@ static int symbol__disassemble_bpf(struct symbol *sym,
+ 		ret = errno;
+ 		goto out;
+ 	}
+-	init_disassemble_info(&info, s,
+-			      (fprintf_ftype) fprintf);
+-
++	init_disassemble_info_compat(&info, s,
++				     (fprintf_ftype) fprintf,
++				     fprintf_styled);
+ 	info.arch = bfd_get_arch(bfdf);
+ 	info.mach = bfd_get_mach(bfdf);
+ 

From fd726a6bf2248ff65021d65f04b5596633100e20 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 14:45:28 -0700
Subject: [PATCH 25/51] libsasl: fix build for libtool 2.4.7

---
 srcpkgs/libsasl/template | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/libsasl/template b/srcpkgs/libsasl/template
index a8817042f843..a2993b39f4a1 100644
--- a/srcpkgs/libsasl/template
+++ b/srcpkgs/libsasl/template
@@ -19,6 +19,7 @@ distfiles="https://github.com/cyrusimap/cyrus-sasl/releases/download/cyrus-sasl-
 checksum=26866b1549b00ffd020f188a43c258017fa1c382b3ddadd8201536f72efb05d5
 
 pre_configure() {
+	rm -f m4/ltversion.m4
 	autoreconf -fi
 }
 

From f8eb3e2542da54dc9e2698fe1e1f6913d91c2d54 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:08 -0700
Subject: [PATCH 26/51] subversion: fix build for libtool 2.4.7

---
 srcpkgs/subversion/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion/template b/srcpkgs/subversion/template
index 8ad178264942..3f1c9e254e61 100644
--- a/srcpkgs/subversion/template
+++ b/srcpkgs/subversion/template
@@ -57,7 +57,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From f838891ab61d11d38ea60a31353942a649279025 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:38 -0700
Subject: [PATCH 27/51] subversion-kwallet-auth: fix build for libtool 2.4.7

---
 srcpkgs/subversion-kwallet-auth/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion-kwallet-auth/template b/srcpkgs/subversion-kwallet-auth/template
index 12210f250d51..b4d8621456ea 100644
--- a/srcpkgs/subversion-kwallet-auth/template
+++ b/srcpkgs/subversion-kwallet-auth/template
@@ -59,7 +59,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From f491943d8f1e42a825674a71729c05e4e460a1ea Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 20:07:32 -0700
Subject: [PATCH 28/51] gpgme: update to 1.18.0.

---
 common/shlibs          | 2 +-
 srcpkgs/gpgme/template | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 99b1dfc089b9..4eaee728723b 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -723,7 +723,7 @@ libdconf.so.1 dconf-0.13.90_1
 libassuan.so.0 libassuan-2.0.1_1
 libgpgme.so.11 libgpgme-1.12.0_2
 libgpgmepp.so.6 gpgmepp-1.7.0_3
-libqgpgme.so.7 gpgmeqt-1.7.0_3
+libqgpgme.so.15 gpgmeqt-1.18.0_1
 libgarcon-1.so.0 garcon-0.1.12_1
 libgarcon-gtk2-1.so.0 garcon-0.4.0_1
 libgarcon-gtk3-1.so.0 garcon-0.6.1_1
diff --git a/srcpkgs/gpgme/template b/srcpkgs/gpgme/template
index 8633075a8404..b1cfd5f78657 100644
--- a/srcpkgs/gpgme/template
+++ b/srcpkgs/gpgme/template
@@ -1,7 +1,7 @@
 # Template file for 'gpgme'
 pkgname=gpgme
-version=1.15.1
-revision=2
+version=1.18.0
+revision=1
 build_style=gnu-configure
 configure_args="--enable-fd-passing
  --with-libgpg-error-prefix=$XBPS_CROSS_BASE/usr
@@ -14,7 +14,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.gnupg.org/software/gpgme/index.html"
 distfiles="https://www.gnupg.org/ftp/gcrypt/gpgme/gpgme-${version}.tar.bz2"
-checksum=eebc3c1b27f1c8979896ff361ba9bb4778b508b2496c2fc10e3775a40b1de1ad
+checksum=361d4eae47ce925dba0ea569af40e7b52c645c4ae2e65e5621bf1b6cdd8b0e9e
 
 if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
 	configure_args+=" ac_cv_sys_file_offset_bits=no"

From 90ee3bb42299ed810f9db123452fde77f34843c9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 29/51] cross-aarch64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..bd6b23f9fb6a 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 36c6e67895add30dfb697a8083b9696de171e5c3 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 30/51] cross-aarch64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..427ad2c1e9cd 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 08be2f960f4a2c993448bf6d3155ae29f15ed15e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 31/51] cross-arm-linux-gnueabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..2510ee26e789 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From c3a9d2ae621fcaae3634cc333f9899c99e294fab Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 32/51] cross-arm-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..bd8b16e1b4c1 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From de1d1464e5776eaa58f4f3678fbf51f1ada8d95f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 33/51] cross-arm-linux-musleabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..dacfd2655216 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 982836e45220cf537c2f38ab919cea16b1f76648 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 34/51] cross-arm-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..9ddd32a9f20d 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From a36a22b616ba5fee11160a9b2da4e27f0e9c6a9b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 35/51] cross-armv7l-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..9fb00f18be3b 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 4797ef1d96b79d31bb62db98e3c9c0930745dd64 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 36/51] cross-armv7l-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..2c72e75ddfe3 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From e7a51e39703c4fbde606a92b1c180a0406ec3a0c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 37/51] cross-i686-pc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..4dc17df648b5 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From a79fcd9937e5aca9c9a6e2c03d03e467c7172bab Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 38/51] cross-mips-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..6009e5c79eb2 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 46bf56e3a526f6bd0b3d4c535a602b0dda28609d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 39/51] cross-mips-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..080164df193d 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="hipperson0 <hipperson0@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 66f529adf25c6d74d17a60d9e69519a1500fd5c7 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 40/51] cross-mipsel-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..c8f90cfa43cc 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_musl_version=1.1.24
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 27e9cbb5ff6ce465ad8dc38a22b74766d8583ebe Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 41/51] cross-mipsel-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..931345d2de15 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_musl_version=1.1.24
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 9e081d728b0bbcac9028e117dd519726b30a5c42 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 42/51] cross-powerpc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..31e57b4e52b2 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From a868778e3b00ee8ac5cdde5ad95a1b645c2ce14e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 43/51] cross-powerpc-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..a2d1edcf1ffd 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 0c379f92521d662e2dc989884917e6ca331a46cf Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 44/51] cross-powerpc64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..1a4cbed61e76 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From ab2aa7bed52b8e2674d5ae411392491224b431a5 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 45/51] cross-powerpc64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 1ebd0fb2048d..ade42018af05 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From e583f399ca6ed104e872fe475c95fafdebad9141 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 46/51] cross-powerpc64le-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 733f5851da5c..dd1ad383a21e 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 48fb9751cba8559cef4cd0a669839d3d2b5b8e7c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 47/51] cross-powerpc64le-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index 76a70aa1d6db..5887f845f932 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 7079a14db5c800f15e21c3fad1ebb9d56c9b57f5 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 48/51] cross-powerpcle-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 347b8fcf4f55..06530e0d609b 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 9734dde720e8e64909e4803ad17fd82589fc0b9f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:19 -0700
Subject: [PATCH 49/51] cross-powerpcle-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index ec9324ddaa99..e68c3962b49c 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 52a02c87f71c480e8e23cf0c885169afb1f34e0c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:19 -0700
Subject: [PATCH 50/51] cross-x86_64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 0078fbe7224b..7da85c14b62d 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From c376b293db3a9ec5bc2a35c2fefa116ed3c36925 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:19 -0700
Subject: [PATCH 51/51] cross-x86_64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..2811de0d3c2e 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (59 preceding siblings ...)
  2022-08-25 21:42 ` [PR PATCH] [Updated] " oreo639
@ 2022-08-25 23:49 ` oreo639
  2022-08-25 23:52 ` oreo639
                   ` (203 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-08-25 23:49 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5538 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.2.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.2.0

This PR depends on: https://github.com/void-linux/void-packages/pull/32330

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

Also, keep in mind that the libgo musl patch here will need to be updated once musl is updated:
https://github.com/void-linux/void-packages/pull/34902/files#diff-1f42a95b93c9550178ff1fbccbef2f47a72711df15c24c9472e2550076978129R163-R176

This is the updated patch for reference:
https://github.com/alpinelinux/aports/blob/8acb21b8ee881e7ab1c812d9a66a17d2501b8730/main/gcc/0049-libgo-adjust-name-of-union-in-sigevent-struct.patch

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/38817
- [x] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [ ] llvm https://github.com/void-linux/void-packages/pull/38694
- [ ] m4 https://github.com/void-linux/void-packages/pull/33730
- [ ] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [ ] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [ ] libvirt https://github.com/void-linux/void-packages/pull/38842
- [ ] syslinux https://github.com/void-linux/void-packages/pull/38876
- [ ] efivar https://github.com/void-linux/void-packages/pull/38874

Known packages that needed to be fixed/updated for gcc12:
- [ ] linux5.18 (in this PR)
- [ ] openssh https://github.com/void-linux/void-packages/pull/38849
- [ ] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [ ] doxygen https://github.com/void-linux/void-packages/pull/38846
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/38817
- [ ] libproxy https://github.com/void-linux/void-packages/pull/38818
- [ ] exempi https://github.com/void-linux/void-packages/pull/38820
- [ ] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [ ] gpgme https://github.com/void-linux/void-packages/pull/38825
- [x] libunique1 https://github.com/void-linux/void-packages/pull/38848 or https://github.com/void-linux/void-packages/pull/38873
- [ ] libwpd https://github.com/void-linux/void-packages/pull/38878

Needs to be fixed/updated for binutils:
- [ ] grub https://github.com/void-linux/void-packages/pull/38875
- [ ] linux-tools https://github.com/void-linux/void-packages/pull/38877

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [x] kde
- [x] lxde
- [x] lxqt

You can test the ISOs here:
https://drive.google.com/drive/folders/1ix92CYSLUP-KWjLxltdgG4e8Nu2JCY5n?usp=sharing

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 168423 bytes --]

From b5ee06e9872245686913fb6777f3980d7900dca6 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 01/51] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 15 +++--
 3 files changed, 28 insertions(+), 113 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..0578665c1a30 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkg-config"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -44,6 +45,12 @@ do_configure() {
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	# gprofng currently only supports x86 and aarch64 glibc.
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64|i386|aarch64) conf+=" --enable-gprofng" ;;
+		*) conf+=" --disable-gprofng" ;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"

From fd610c6cccd45f53e92cbc1d1530e1bc15dad8b6 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 02/51] gcc: update to 12.2.0.

---
 common/shlibs                                 | 10 +--
 srcpkgs/gcc/files/gccgo-musl.patch            | 74 ++++---------------
 srcpkgs/gcc/files/libgnarl-musl.patch         | 18 ++---
 srcpkgs/gcc/files/libssp-musl.patch           | 10 +--
 srcpkgs/gcc/patches/libffi_gnulinux.patch     | 11 ---
 .../gcc/patches/libgcc-ibm128-no-tag.patch    | 10 ++-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |  2 +-
 srcpkgs/gcc/template                          | 25 +++----
 8 files changed, 52 insertions(+), 108 deletions(-)
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index 8c257ed2bcd5..ee6ff38ac810 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.2.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.34 perl-5.34.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -848,8 +848,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.2.0_1
+libgnat-12.so libada-12.2.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1700,8 +1700,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.2.0_1
+libasan.so.8 libsanitizer-12.2.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..632ef951097b 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,17 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ a/libgo/go/runtime/os_linux.go
+@@ -363,9 +363,9 @@
+ 
+ 	var timerid int32
+ 	var sevp _sigevent
+-	sevp.sigev_notify = _SIGEV_THREAD_ID
++	sevp.sigev_notify = 4
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.sigev_notify_function))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..446741390d45 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,15 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
+version=12.2.0
+revision=1
 _patchver="${version%pre*}"
 _minorver="${_patchver%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 wrksrc=gcc-${version/pre/_pre}
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +19,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -396,7 +393,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}

From 9e9df87b8f0d3fe2e8ec5bb81c9cef2af4fd022c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 03/51] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      | 11 ++++--
 2 files changed, 25 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..e3ab2faacfb3 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,12 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
+
+if [ "$XBPS_LIBC" == "musl" ]; then
+# Musl always searches LD_LIBRARY_PATH before RPATH
+make_build_args="lt_cv_shlibpath_overrides_runpath=yes"
+fi
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From c7a4b186f19c698b46e34cbcaf04c8d135c68207 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 04/51] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 1a4e1ca3d594..b04268908c2e 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="q66 <daniel@octaforge.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From 774a7a84e8765bcc3f654d68050cf6c7cd4bb5a7 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 05/51] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 3 files changed, 55 insertions(+), 353 deletions(-)
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index ee6ff38ac810..99b1dfc089b9 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From 707591976d2fe5591bd35a2da29bc7c1c11d54e5 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 21:01:43 -0700
Subject: [PATCH 06/51] gcc-multilib: update to 12.2.0.

---
 srcpkgs/gcc-multilib/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index fcd25755aa75..1a26da26a991 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,16 +3,16 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _majorver="${version%.*}"
-wrksrc=gcc-${version/pre/_pre}
+wrksrc=gcc-${version}
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel

From 02cac23eb1f93b0a8cb5a7415b4011fdf2c8c828 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 16:22:03 -0700
Subject: [PATCH 07/51] llvm12: fix build for glibc 2.36

---
 .../compiler-rt-sanitizer-glibc-2.36.patch    | 59 +++++++++++++++++++
 1 file changed, 59 insertions(+)
 create mode 100644 srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch

diff --git a/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch b/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch
new file mode 100644
index 000000000000..e5f24dab8935
--- /dev/null
+++ b/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch
@@ -0,0 +1,59 @@
+From 9cf13067cb5088626ba7ee1ec4c42ec59c7995a0 Mon Sep 17 00:00:00 2001
+From: Fangrui Song <i@maskray.me>
+Date: Mon, 11 Jul 2022 12:53:34 -0700
+Subject: [PATCH] [sanitizer] Remove #include <linux/fs.h> to resolve
+ fsconfig_command/mount_attr conflict with glibc 2.36
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+It is generally not a good idea to mix usage of glibc headers and Linux UAPI
+headers (https://sourceware.org/glibc/wiki/Synchronizing_Headers). In glibc
+since 7eae6a91e9b1670330c9f15730082c91c0b1d570 (milestone: 2.36), sys/mount.h
+defines `fsconfig_command` which conflicts with linux/mount.h:
+
+    .../usr/include/linux/mount.h:95:6: error: redeclaration of ‘enum fsconfig_command’
+
+Remove #include <linux/fs.h> which pulls in linux/mount.h. Expand its 4 macros manually.
+Android sys/mount.h doesn't define BLKBSZGET and it still needs linux/fs.h.
+In the long term we should move Linux specific definitions to sanitizer_platform_limits_linux.cpp
+but this commit is easy to cherry pick into older compiler-rt releases.
+
+Fix https://github.com/llvm/llvm-project/issues/56421
+
+Reviewed By: #sanitizers, vitalybuka, zatrazz
+
+Differential Revision: https://reviews.llvm.org/D129471
+---
+ .../sanitizer_platform_limits_posix.cpp                | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+index 4bd425435d56d..3a94b260686f1 100644
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -73,7 +73,9 @@
+ #include <sys/vt.h>
+ #include <linux/cdrom.h>
+ #include <linux/fd.h>
++#if SANITIZER_ANDROID
+ #include <linux/fs.h>
++#endif
+ #include <linux/hdreg.h>
+ #include <linux/input.h>
+ #include <linux/ioctl.h>
+@@ -876,10 +878,10 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
+   unsigned IOCTL_EVIOCGPROP = IOCTL_NOT_PRESENT;
+   unsigned IOCTL_EVIOCSKEYCODE_V2 = IOCTL_NOT_PRESENT;
+ #endif
+-  unsigned IOCTL_FS_IOC_GETFLAGS = FS_IOC_GETFLAGS;
+-  unsigned IOCTL_FS_IOC_GETVERSION = FS_IOC_GETVERSION;
+-  unsigned IOCTL_FS_IOC_SETFLAGS = FS_IOC_SETFLAGS;
+-  unsigned IOCTL_FS_IOC_SETVERSION = FS_IOC_SETVERSION;
++  unsigned IOCTL_FS_IOC_GETFLAGS = _IOR('f', 1, long);
++  unsigned IOCTL_FS_IOC_GETVERSION = _IOR('v', 1, long);
++  unsigned IOCTL_FS_IOC_SETFLAGS = _IOW('f', 2, long);
++  unsigned IOCTL_FS_IOC_SETVERSION = _IOW('v', 2, long);
+   unsigned IOCTL_GIO_CMAP = GIO_CMAP;
+   unsigned IOCTL_GIO_FONT = GIO_FONT;
+   unsigned IOCTL_GIO_UNIMAP = GIO_UNIMAP;

From c6b9481cce4b1e622b12a052564b826a50721a03 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 17:21:40 -0700
Subject: [PATCH 08/51] m4: update to 1.4.19.

---
 srcpkgs/m4/patches/fix-glibc-2.27.patch | 167 ------------------------
 srcpkgs/m4/template                     |  12 +-
 2 files changed, 6 insertions(+), 173 deletions(-)
 delete mode 100644 srcpkgs/m4/patches/fix-glibc-2.27.patch

diff --git a/srcpkgs/m4/patches/fix-glibc-2.27.patch b/srcpkgs/m4/patches/fix-glibc-2.27.patch
deleted file mode 100644
index 59d33cff164d..000000000000
--- a/srcpkgs/m4/patches/fix-glibc-2.27.patch
+++ /dev/null
@@ -1,167 +0,0 @@
-From 4af4a4a71827c0bc5e0ec67af23edef4f15cee8e Mon Sep 17 00:00:00 2001
-From: Paul Eggert <eggert@cs.ucla.edu>
-Date: Mon, 5 Mar 2018 10:56:29 -0800
-Subject: [PATCH] fflush: adjust to glibc 2.28 libio.h removal
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Problem reported by Daniel P. Berrangé in:
-https://lists.gnu.org/r/bug-gnulib/2018-03/msg00000.html
-* lib/fbufmode.c (fbufmode):
-* lib/fflush.c (clear_ungetc_buffer_preserving_position)
-(disable_seek_optimization, rpl_fflush):
-* lib/fpending.c (__fpending):
-* lib/fpurge.c (fpurge):
-* lib/freadable.c (freadable):
-* lib/freadahead.c (freadahead):
-* lib/freading.c (freading):
-* lib/freadptr.c (freadptr):
-* lib/freadseek.c (freadptrinc):
-* lib/fseeko.c (fseeko):
-* lib/fseterr.c (fseterr):
-* lib/fwritable.c (fwritable):
-* lib/fwriting.c (fwriting):
-Check _IO_EOF_SEEN instead of _IO_ftrylockfile.
-* lib/stdio-impl.h (_IO_IN_BACKUP) [_IO_EOF_SEEN]:
-Define if not already defined.
-
-[yann.morin.1998@free.fr: partially backport from upstream gnulib]
-Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
-
----
- lib/fflush.c     |  6 +++---
- lib/fpending.c   |  2 +-
- lib/fpurge.c     |  2 +-
- lib/freadahead.c |  2 +-
- lib/freading.c   |  2 +-
- lib/fseeko.c     |  4 ++--
- lib/stdio-impl.h |  6 ++++++
- 7 files changed, 15 insertions(+), 9 deletions(-)
-
-diff --git a/lib/fflush.c b/build-aux/gnulib/lib/fflush.c
-index 983ade0ff..a6edfa105 100644
---- a/lib/fflush.c
-+++ b/lib/fflush.c
-@@ -33,7 +33,7 @@
- #undef fflush
- 
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- 
- /* Clear the stream's ungetc buffer, preserving the value of ftello (fp).  */
- static void
-@@ -72,7 +72,7 @@ clear_ungetc_buffer (FILE *fp)
- 
- #endif
- 
--#if ! (defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
-+#if ! (defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
- 
- # if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT
- /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
-@@ -148,7 +148,7 @@ rpl_fflush (FILE *stream)
-   if (stream == NULL || ! freading (stream))
-     return fflush (stream);
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- 
-   clear_ungetc_buffer_preserving_position (stream);
- 
-diff --git a/lib/fpending.c b/build-aux/gnulib/lib/fpending.c
-index c84e3a5b4..789f50e4e 100644
---- a/lib/fpending.c
-+++ b/lib/fpending.c
-@@ -32,7 +32,7 @@ __fpending (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   return fp->_IO_write_ptr - fp->_IO_write_base;
- #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
-   /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
-diff --git a/lib/fpurge.c b/build-aux/gnulib/lib/fpurge.c
-index b1d417c7a..3aedcc373 100644
---- a/lib/fpurge.c
-+++ b/lib/fpurge.c
-@@ -62,7 +62,7 @@ fpurge (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   fp->_IO_read_end = fp->_IO_read_ptr;
-   fp->_IO_write_ptr = fp->_IO_write_base;
-   /* Avoid memory leak when there is an active ungetc buffer.  */
-diff --git a/lib/freadahead.c b/build-aux/gnulib/lib/freadahead.c
-index c2ecb5b28..23ec76ee5 100644
---- a/lib/freadahead.c
-+++ b/lib/freadahead.c
-@@ -30,7 +30,7 @@ extern size_t __sreadahead (FILE *);
- size_t
- freadahead (FILE *fp)
- {
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   if (fp->_IO_write_ptr > fp->_IO_write_base)
-     return 0;
-   return (fp->_IO_read_end - fp->_IO_read_ptr)
-diff --git a/lib/freading.c b/build-aux/gnulib/lib/freading.c
-index 73c28acdd..c24d0c88a 100644
---- a/lib/freading.c
-+++ b/lib/freading.c
-@@ -31,7 +31,7 @@ freading (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   return ((fp->_flags & _IO_NO_WRITES) != 0
-           || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0
-               && fp->_IO_read_base != NULL));
-diff --git a/lib/fseeko.c b/build-aux/gnulib/lib/fseeko.c
-index 0101ab55f..193f4e8ce 100644
---- a/lib/fseeko.c
-+++ b/lib/fseeko.c
-@@ -47,7 +47,7 @@ fseeko (FILE *fp, off_t offset, int whence)
- #endif
- 
-   /* These tests are based on fpurge.c.  */
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   if (fp->_IO_read_end == fp->_IO_read_ptr
-       && fp->_IO_write_ptr == fp->_IO_write_base
-       && fp->_IO_save_base == NULL)
-@@ -123,7 +123,7 @@ fseeko (FILE *fp, off_t offset, int whence)
-           return -1;
-         }
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-       fp->_flags &= ~_IO_EOF_SEEN;
-       fp->_offset = pos;
- #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
-diff --git a/lib/stdio-impl.h b/build-aux/gnulib/lib/stdio-impl.h
-index 78d896e9f..05c5752a2 100644
---- a/lib/stdio-impl.h
-+++ b/lib/stdio-impl.h
-@@ -18,6 +18,12 @@
-    the same implementation of stdio extension API, except that some fields
-    have different naming conventions, or their access requires some casts.  */
- 
-+/* Glibc 2.28 made _IO_IN_BACKUP private.  For now, work around this
-+   problem by defining it ourselves.  FIXME: Do not rely on glibc
-+   internals.  */
-+#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN
-+# define _IO_IN_BACKUP 0x100
-+#endif
- 
- /* BSD stdio derived implementations.  */
- 
--- 
-2.14.1
-
-
diff --git a/srcpkgs/m4/template b/srcpkgs/m4/template
index 78f3dae6184a..762593d883bd 100644
--- a/srcpkgs/m4/template
+++ b/srcpkgs/m4/template
@@ -1,17 +1,17 @@
 # Template file for 'm4'
 pkgname=m4
-version=1.4.18
-revision=2
+version=1.4.19
+revision=1
 bootstrap=yes
-replaces="chroot-m4>=0"
 build_style=gnu-configure
 configure_args="--enable-changeword --enable-threads"
 short_desc="GNU version of UNIX m4 macro language processor"
-homepage="https://www.gnu.org/software/m4/"
-license="GPL-3.0-or-later"
 maintainer="Enno Boland <gottox@voidlinux.org>"
+license="GPL-3.0-or-later"
+homepage="https://www.gnu.org/software/m4/"
 distfiles="${GNU_SITE}/${pkgname}/${pkgname}-${version}.tar.xz"
-checksum=f2c1e86ca0a404ff281631bdc8377638992744b175afb806e25871a24a934e07
+checksum=63aede5c6d33b6d9b13511cd0be2cac046f2e70fd0a07aa9573a04a82783af96
+replaces="chroot-m4>=0"
 
 if [ "$XBPS_TARGET_LIBC" = musl ]; then
 	export ac_cv_lib_error_at_line=no

From d1f87855cf68fc9bb23cb93f3bf2d24df9454dff Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 22:57:59 -0700
Subject: [PATCH 09/51] btrfs-progs: update to 5.19.

---
 srcpkgs/btrfs-progs/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/btrfs-progs/template b/srcpkgs/btrfs-progs/template
index f6c53d8587e1..292d5110106b 100644
--- a/srcpkgs/btrfs-progs/template
+++ b/srcpkgs/btrfs-progs/template
@@ -1,6 +1,6 @@
 # Template file for 'btrfs-progs'
 pkgname=btrfs-progs
-version=5.18.1
+version=5.19
 revision=1
 wrksrc="${pkgname}-v${version}"
 build_style=gnu-configure
@@ -16,7 +16,7 @@ license="GPL-2.0-only, LGPL-2.1-or-later"
 homepage="https://btrfs.wiki.kernel.org/index.php/Main_Page"
 changelog="https://raw.githubusercontent.com/kdave/btrfs-progs/master/CHANGES"
 distfiles="${KERNEL_SITE}/kernel/people/kdave/${pkgname}/${pkgname}-v${version}.tar.xz"
-checksum=6e98a75ccff52e9354daa1ad284c614c490f844273a2fa524cbac9eb841c7255
+checksum=1fbcf06e4b2f80e7a127fd687ed4625a5b74fa674fe212c836ff70e0edfcccf9
 # Most of the tests depend on `mount` and `fallocate` commands, which are not
 # presented in chroot-util-linux
 make_check=no

From 715bbf0cb67fea7482df96160c0106dab73f1e66 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 19:39:23 -0700
Subject: [PATCH 10/51] syslinux: fix build for glibc 2.36

---
 .../patches/fix-build-with-glibc-2.36.patch   | 30 +++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 srcpkgs/syslinux/patches/fix-build-with-glibc-2.36.patch

diff --git a/srcpkgs/syslinux/patches/fix-build-with-glibc-2.36.patch b/srcpkgs/syslinux/patches/fix-build-with-glibc-2.36.patch
new file mode 100644
index 000000000000..1303be56c127
--- /dev/null
+++ b/srcpkgs/syslinux/patches/fix-build-with-glibc-2.36.patch
@@ -0,0 +1,30 @@
+--- a/linux/syslinux.c
++++ b/linux/syslinux.c
+@@ -45,7 +45,6 @@
+ #include <sys/stat.h>
+ #include <sys/types.h>
+ #include <sys/wait.h>
+-#include <sys/mount.h>
+ 
+ #include "linuxioctl.h"
+ 
+--- a/libinstaller/syslxcom.c
++++ b/libinstaller/syslxcom.c
+@@ -28,7 +28,6 @@
+ #include <errno.h>
+ #include <sys/stat.h>
+ #include <sys/types.h>
+-#include <sys/mount.h>
+ #include <sys/vfs.h>
+ 
+ #include "linuxioctl.h"
+--- a/extlinux/main.c
++++ b/extlinux/main.c
+@@ -40,7 +40,6 @@
+ #include <sys/stat.h>
+ #include <sys/sysmacros.h>
+ #include <sys/types.h>
+-#include <sys/mount.h>
+ #include <sys/vfs.h>
+ 
+ #include "linuxioctl.h"

From 458b9bc826cf2f686a393fc939843d99ef1b92cf Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 14 Aug 2022 19:29:36 -0700
Subject: [PATCH 11/51] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove -no-pie from build. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..58d94f8dacba 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -60,6 +60,7 @@ _void_cross_build_binutils() {
 		--disable-multilib \
 		--disable-werror \
 		--disable-gold \
+		--disable-gprofng \
 		--enable-relro \
 		--enable-plugins \
 		--enable-64-bit-bfd \
@@ -132,6 +133,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -460,6 +462,14 @@ do_build() {
 	local binutils_ver linux_ver gcc_ver libc_ver libucontext_ver
 	local tgt=${sourcepkg/cross-}
 
+	export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}"
+	export CXXFLAGS="${CXXFLAGS/-D_FORTIFY_SOURCE=2/}"
+
+	# Disable explicit -fno-PIE, gcc/binutils/libc will figure this out itself.
+	export CFLAGS="${CFLAGS//-fno-PIE/}"
+	export CXXFLAGS="${CXXFLAGS//-fno-PIE/}"
+	export LDFLAGS="${LDFLAGS//-no-pie/}"
+
 	_void_cross_test_ver binutils
 	_void_cross_test_ver linux
 	_void_cross_test_ver gcc
@@ -625,6 +635,9 @@ do_install() {
 	# then remove it because it conflicts with libquadmath package
 	rm -rf ${DESTDIR}/${sysroot}/usr/lib/libquadmath.*
 
+	# Remove libdep linker plugin because it conflicts with system binutils
+	rm -f ${DESTDIR}/usr/lib/bfd-plugins/libdep*
+
 	# Remove leftover symlinks
 	rm -f ${DESTDIR}/usr/lib${XBPS_TARGET_WORDSIZE}
 	rm -f ${DESTDIR}/lib*

From 6e1e7d8eda33928df22ad4f3a0d144cb7cfd74a7 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:08:52 -0700
Subject: [PATCH 12/51] openssh: suppress werror on gcc12

---
 srcpkgs/openssh/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/openssh/template b/srcpkgs/openssh/template
index 02a2dec35f42..6e8e343a9dca 100644
--- a/srcpkgs/openssh/template
+++ b/srcpkgs/openssh/template
@@ -40,7 +40,7 @@ if [ "$build_option_ldns" -a -z "$build_option_ssl" ]; then
 	broken="option 'ldns' requires option 'ssl'"
 fi
 
-CFLAGS="-Wno-format-truncation -Wno-stringop-truncation"
+CFLAGS="-Wno-format-truncation -Wno-stringop-truncation -Wno-error=maybe-uninitialized"
 
 case $XBPS_TARGET_MACHINE in
 	i686-musl)

From da6ad56fe46194effef0df85a677a4d8ad645f54 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:09:31 -0700
Subject: [PATCH 13/51] linux5.18: update dotconfigs for gcc12

---
 srcpkgs/linux5.18/files/x86_64-dotconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/linux5.18/files/x86_64-dotconfig b/srcpkgs/linux5.18/files/x86_64-dotconfig
index 4e73a3195d40..ea6204868e23 100644
--- a/srcpkgs/linux5.18/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.18/files/x86_64-dotconfig
@@ -512,6 +512,7 @@ CONFIG_RETHUNK=y
 CONFIG_CPU_UNRET_ENTRY=y
 CONFIG_CPU_IBPB_ENTRY=y
 CONFIG_CPU_IBRS_ENTRY=y
+CONFIG_SLS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10060,8 +10061,11 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
 # Memory initialization
 #
 CONFIG_INIT_STACK_NONE=y
+# CONFIG_INIT_STACK_ALL_PATTERN is not set
+# CONFIG_INIT_STACK_ALL_ZERO is not set
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
+# CONFIG_ZERO_CALL_USED_REGS is not set
 # end of Memory initialization
 # end of Kernel hardening options
 # end of Security options
@@ -10538,6 +10542,7 @@ CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
 # CONFIG_UBSAN is not set
 CONFIG_HAVE_ARCH_KCSAN=y
+# CONFIG_KCSAN is not set
 # end of Generic Kernel Debugging Instruments
 
 #

From 305c316f62410a90da046babaef289077a33e9a1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 18:00:42 -0700
Subject: [PATCH 14/51] xf86-video-vmware: fix build on gcc12

---
 ...183b3395333d5d4c73e25c2d011748f15eda.patch | 30 +++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch

diff --git a/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch b/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch
new file mode 100644
index 000000000000..ff839f16e628
--- /dev/null
+++ b/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch
@@ -0,0 +1,30 @@
+From 77b8183b3395333d5d4c73e25c2d011748f15eda Mon Sep 17 00:00:00 2001
+From: Rudi Heitbaum <rudi@heitbaum.com>
+Date: Sun, 8 May 2022 03:00:10 +0000
+Subject: [PATCH] vmwgfx: fix missing array notation
+
+ Fixes error identified by gcc-12.1.0 compiler
+
+make
+  CC       libvmwgfx_la-vmwgfx_tex_video.lo
+vmwgfx_tex_video.c: In function 'stop_video':
+vmwgfx_tex_video.c:240:20: error: the comparison will always evaluate as 'true' for the address of 'yuv' will never be NULL [-Werror=address]
+  240 |                if (priv->yuv[i]) {
+      |                    ^~~~
+---
+ vmwgfx/vmwgfx_tex_video.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/vmwgfx/vmwgfx_tex_video.c b/vmwgfx/vmwgfx_tex_video.c
+index acc2b56..480a5f1 100644
+--- a/vmwgfx/vmwgfx_tex_video.c
++++ b/vmwgfx/vmwgfx_tex_video.c
+@@ -237,7 +237,7 @@ stop_video(ScrnInfoPtr pScrn, pointer data, Bool shutdown)
+ 
+        for (i=0; i<3; ++i) {
+ 	   for (j=0; j<2; ++j) {
+-	       if (priv->yuv[i]) {
++	       if (priv->yuv[j][i]) {
+ 		   xa_surface_destroy(priv->yuv[j][i]);
+ 		   priv->yuv[j][i] = NULL;
+ 	       }

From 8f4f31cafdb7c2366aac03e363b19e7127d2f1b0 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 18:24:37 -0700
Subject: [PATCH 15/51] doxygen: fix build for gcc 12

---
 srcpkgs/doxygen/patches/compat-gcc12.patch | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100644 srcpkgs/doxygen/patches/compat-gcc12.patch

diff --git a/srcpkgs/doxygen/patches/compat-gcc12.patch b/srcpkgs/doxygen/patches/compat-gcc12.patch
new file mode 100644
index 000000000000..666744a1dceb
--- /dev/null
+++ b/srcpkgs/doxygen/patches/compat-gcc12.patch
@@ -0,0 +1,22 @@
+From 5198966c8d5fec89116d025c74934ac03ea511fa Mon Sep 17 00:00:00 2001
+From: Dimitri van Heesch <doxygen@gmail.com>
+Date: Fri, 6 May 2022 09:55:16 +0200
+Subject: [PATCH] issue #9312: Build: cache.h:53:14: error: 'exchange' is not a
+ member of 'std'
+
+---
+ src/cache.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/cache.h b/src/cache.h
+index 0ff3092ed5..e218eb27d2 100644
+--- a/src/cache.h
++++ b/src/cache.h
+@@ -19,6 +19,7 @@
+ #include <list>
+ #include <unordered_map>
+ #include <mutex>
++#include <utility>
+ #include <ctype.h>
+ 
+ /*! Fixed size cache for value type V using keys of type K.

From f5c8dfb37429ab88854203dd5053785e6b4d7ac4 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 21 Aug 2022 15:12:00 -0700
Subject: [PATCH 16/51] libproxy: update to 0.4.18

---
 srcpkgs/libproxy/template | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/libproxy/template b/srcpkgs/libproxy/template
index d6103007032e..6599dfb69b98 100644
--- a/srcpkgs/libproxy/template
+++ b/srcpkgs/libproxy/template
@@ -1,18 +1,22 @@
 # Template file for 'libproxy'
 pkgname=libproxy
-version=0.4.15
+version=0.4.18
 revision=1
 build_style=cmake
 configure_args="-DWITH_GNOME=0 -DWITH_KDE4=0 -DWITH_MOZJS=0 -DWITH_NM=0
  -DWITH_PERL=0 -DWITH_PYTHON=1 -DWITH_WEBKIT=0"
 hostmakedepends="pkg-config python"
 makedepends="zlib-devel"
-short_desc="A library handling all the details of proxy configuration"
+short_desc="Library handling all the details of proxy configuration"
 maintainer="Orphaned <orphan@voidlinux.org>"
+license="LGPL-2.1-or-later"
 homepage="http://github.com/libproxy/libproxy"
-license="LGPL-2.1"
-distfiles="https://github.com/libproxy/libproxy/archive/${version}.tar.gz>${pkgname}-${version}.tar.gz"
-checksum=18f58b0a0043b6881774187427ead158d310127fc46a1c668ad6d207fb28b4e0
+distfiles="https://github.com/libproxy/libproxy/archive/${version}.tar.gz"
+checksum=0b4a9218d88f6cf9fa25996a3f38329a11f688a9d026141d9d0e966d8fa63837
+
+post_patch() {
+	vsed '/add_test(NAME url-test/d' -i libproxy/test/CMakeLists.txt
+}
 
 libproxy-devel_package() {
 	depends="libproxy>=${version}_${revision}"

From 780545c94810a211ddd899a1a2090e5ac7fd4f71 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 21 Aug 2022 17:05:39 -0700
Subject: [PATCH 17/51] exempi: update to 2.6.2

---
 ...f034705fd2d032c81383eee8208fd4eee0ac.patch | 43 -------------------
 srcpkgs/exempi/template                       |  4 +-
 2 files changed, 2 insertions(+), 45 deletions(-)
 delete mode 100644 srcpkgs/exempi/patches/8ed2f034705fd2d032c81383eee8208fd4eee0ac.patch

diff --git a/srcpkgs/exempi/patches/8ed2f034705fd2d032c81383eee8208fd4eee0ac.patch b/srcpkgs/exempi/patches/8ed2f034705fd2d032c81383eee8208fd4eee0ac.patch
deleted file mode 100644
index 2696793cec09..000000000000
--- a/srcpkgs/exempi/patches/8ed2f034705fd2d032c81383eee8208fd4eee0ac.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From 8ed2f034705fd2d032c81383eee8208fd4eee0ac Mon Sep 17 00:00:00 2001
-From: Victor Rodriguez <victor.rodriguez.bahena@intel.com>
-Date: Sat, 18 Aug 2018 13:54:55 +0000
-Subject: [PATCH] Issue #9 - Fix null-pointer-dereference (CVE-2018-12648)
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-The WEBP::GetLE32 function in
-XMPFiles/source/FormatSupport/WEBP_Support.hpp in Exempi 2.4.5 has a
-NULL pointer dereference.
-
-https://bugs.freedesktop.org/show_bug.cgi?id=106981
-https://gitlab.freedesktop.org/libopenraw/exempi/issues/9
-
-Signed-off-by: Victor Rodriguez <victor.rodriguez.bahena@intel.com>
-Signed-off-by: Hubert Figuière <hub@figuiere.net>
----
- XMPFiles/source/FormatSupport/WEBP_Support.cpp | 8 +++++---
- 1 file changed, 5 insertions(+), 3 deletions(-)
-
-diff --git a/XMPFiles/source/FormatSupport/WEBP_Support.cpp b/XMPFiles/source/FormatSupport/WEBP_Support.cpp
-index ffaf220..4fe705b 100644
---- a/XMPFiles/source/FormatSupport/WEBP_Support.cpp
-+++ b/XMPFiles/source/FormatSupport/WEBP_Support.cpp
-@@ -160,9 +160,11 @@ bool VP8XChunk::xmp()
- }
- void VP8XChunk::xmp(bool hasXMP)
- {
--    XMP_Uns32 flags = GetLE32(&this->data[0]);
--    flags ^= (-hasXMP ^ flags) & (1 << XMP_FLAG_BIT);
--    PutLE32(&this->data[0], flags);
-+    if (&this->data[0] != NULL) {
-+        XMP_Uns32 flags = GetLE32(&this->data[0]);
-+        flags ^= (-hasXMP ^ flags) & (1 << XMP_FLAG_BIT);
-+        PutLE32(&this->data[0], flags);
-+    }
- }
- 
- Container::Container(WEBP_MetaHandler* handler) : Chunk(NULL, handler)
--- 
-2.18.0
-
diff --git a/srcpkgs/exempi/template b/srcpkgs/exempi/template
index 14753617953a..d664f7dc4d80 100644
--- a/srcpkgs/exempi/template
+++ b/srcpkgs/exempi/template
@@ -1,6 +1,6 @@
 # Template file for 'exempi'
 pkgname=exempi
-version=2.5.0
+version=2.6.2
 revision=1
 build_style=gnu-configure
 configure_args="--with-boost=${XBPS_CROSS_BASE}/usr --disable-static --disable-unittest"
@@ -10,7 +10,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="BSD-3-Clause"
 homepage="https://libopenraw.freedesktop.org/wiki/Exempi"
 distfiles="https://libopenraw.freedesktop.org/download/exempi-${version}.tar.bz2"
-checksum=dc82fc24c0540a44a63fa4ad21775d24e00e63f1dedd3e2ae6f7aa27583b711b
+checksum=4d17d4c93df2a95da3e3172c45b7a5bf317dd31dafd1c7a340169728c7089d1d
 
 post_install() {
 	vlicense COPYING

From 4301dec6c01b43337565f60efa3e49778cae5692 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 21 Aug 2022 21:36:03 -0700
Subject: [PATCH 18/51] plymouth: update to 22.02.122

---
 srcpkgs/plymouth/patches/fix-glibc-2.36.patch | 30 +++++++++++++++++++
 srcpkgs/plymouth/template                     |  4 +--
 2 files changed, 32 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/plymouth/patches/fix-glibc-2.36.patch

diff --git a/srcpkgs/plymouth/patches/fix-glibc-2.36.patch b/srcpkgs/plymouth/patches/fix-glibc-2.36.patch
new file mode 100644
index 000000000000..2f1e43875cfb
--- /dev/null
+++ b/srcpkgs/plymouth/patches/fix-glibc-2.36.patch
@@ -0,0 +1,30 @@
+From 5f1e43c00039a7fe1fff768b91a05a695fb4a53d Mon Sep 17 00:00:00 2001
+From: Ray Strode <rstrode@redhat.com>
+Date: Wed, 3 Aug 2022 15:23:33 -0400
+Subject: [PATCH] ply-utils: Drop linux/fs.h include
+
+It was needed long ago for a function we no longer even have.
+
+Now it's causing compile errors on Fedora 37 because it's conflicting
+with sys/mount.h.
+
+This commit drops it.
+---
+ src/libply/ply-utils.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/src/libply/ply-utils.c b/src/libply/ply-utils.c
+index c7b165e9..219e2e77 100644
+--- a/src/libply/ply-utils.c
++++ b/src/libply/ply-utils.c
+@@ -46,7 +46,6 @@
+ #include <sys/user.h>
+ #include <sys/wait.h>
+ #include <time.h>
+-#include <linux/fs.h>
+ #include <linux/vt.h>
+ 
+ #include <dlfcn.h>
+-- 
+GitLab
+
diff --git a/srcpkgs/plymouth/template b/srcpkgs/plymouth/template
index 17f801fc5315..442ab58a99cd 100644
--- a/srcpkgs/plymouth/template
+++ b/srcpkgs/plymouth/template
@@ -1,6 +1,6 @@
 # Template file for 'plymouth'
 pkgname=plymouth
-version=0.9.5
+version=22.02.122
 revision=1
 build_style=gnu-configure
 configure_args="--with-system-root-install=no \
@@ -18,7 +18,7 @@ maintainer="William OD <obirik2005@gmail.com>"
 license="GPL-2.0-or-later"
 homepage="https://www.freedesktop.org/wiki/Software/Plymouth/"
 distfiles="${FREEDESKTOP_SITE}/plymouth/releases/$pkgname-$version.tar.xz"
-checksum=ecae257f351d098340542a5bc06de029404c24dcee87e6ebb2abd5ef117fce86
+checksum=100551442221033ce868c447ad6c74d831d209c18ae232b98ae0207e34eadaeb
 
 build_options="gtk3 pango"
 build_options_default="gtk3 pango"

From da9115f2906e11387e6068b29e210c53478efb23 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 21 Aug 2022 21:37:00 -0700
Subject: [PATCH 19/51] openjdk7-bootstrap: fix build for gcc12

---
 .../files/dist_patches_glibc.txt              |  1 +
 .../files/dist_patches_musl.txt               |  1 +
 .../icedtea-pointer-comparison-gcc12.patch    | 31 +++++++++++++++++++
 3 files changed, 33 insertions(+)
 create mode 100644 srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch

diff --git a/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt b/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt
index c76c56855441..8061756dfc0c 100644
--- a/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt
+++ b/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt
@@ -6,3 +6,4 @@ icedtea-jdk-no-soname.patch
 icedtea-jdk-xattr.patch
 icedtea-jdk-sysctl_h.patch
 icedtea-cpio.patch
+icedtea-pointer-comparison-gcc12.patch
diff --git a/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt b/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt
index 21812517c7c2..8b35d9c46989 100644
--- a/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt
+++ b/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt
@@ -11,3 +11,4 @@ icedtea-jdk-musl.patch
 icedtea-jdk-no-soname.patch
 icedtea-jdk-xattr.patch
 icedtea-cpio.patch
+icedtea-pointer-comparison-gcc12.patch
diff --git a/srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch b/srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch
new file mode 100644
index 000000000000..c809553443e7
--- /dev/null
+++ b/srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch
@@ -0,0 +1,31 @@
+--- openjdk.orig/hotspot/src/share/vm/opto/lcm.cpp
++++ openjdk/hotspot/src/share/vm/opto/lcm.cpp
+@@ -60,7 +60,7 @@
+ // Check whether val is not-null-decoded compressed oop,
+ // i.e. will grab into the base of the heap if it represents NULL.
+ static bool accesses_heap_base_zone(Node *val) {
+-  if (Universe::narrow_oop_base() > 0) { // Implies UseCompressedOops.
++  if (Universe::narrow_oop_base() > (address)0) { // Implies UseCompressedOops.
+     if (val && val->is_Mach()) {
+       if (val->as_Mach()->ideal_Opcode() == Op_DecodeN) {
+         // This assumes all Decodes with TypePtr::NotNull are matched to nodes that
+--- openjdk.orig/hotspot/src/share/vm/runtime/virtualspace.cpp
++++ openjdk/hotspot/src/share/vm/runtime/virtualspace.cpp
+@@ -527,7 +527,7 @@ ReservedHeapSpace::ReservedHeapSpace(siz
+                 (UseCompressedOops && (Universe::narrow_oop_base() != NULL) &&
+                  Universe::narrow_oop_use_implicit_null_checks()) ?
+                   lcm(os::vm_page_size(), alignment) : 0) {
+-  if (base() > 0) {
++  if (base() > (char*)0) {
+     MemTracker::record_virtual_memory_type((address)base(), mtJavaHeap);
+   }
+ 
+@@ -546,7 +546,7 @@ ReservedHeapSpace::ReservedHeapSpace(con
+                 (UseCompressedOops && (Universe::narrow_oop_base() != NULL) &&
+                  Universe::narrow_oop_use_implicit_null_checks()) ?
+                   lcm(os::vm_page_size(), prefix_align) : 0) {
+-  if (base() > 0) {
++  if (base() > (char*)0) {
+     MemTracker::record_virtual_memory_type((address)base(), mtJavaHeap);
+   }
+ 

From aa19900b0b47c594f2cb413058ab65a1ada838fd Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:39:52 -0700
Subject: [PATCH 20/51] libvirt: fix build for glibc 2.36

---
 .../patches/lxc-fix-compat-glibc-2.36.patch   | 34 ++++++++++++++++
 .../virfile-fix-compat-glibc-2.36.patch       | 39 +++++++++++++++++++
 2 files changed, 73 insertions(+)
 create mode 100644 srcpkgs/libvirt/patches/lxc-fix-compat-glibc-2.36.patch
 create mode 100644 srcpkgs/libvirt/patches/virfile-fix-compat-glibc-2.36.patch

diff --git a/srcpkgs/libvirt/patches/lxc-fix-compat-glibc-2.36.patch b/srcpkgs/libvirt/patches/lxc-fix-compat-glibc-2.36.patch
new file mode 100644
index 000000000000..d85b57815010
--- /dev/null
+++ b/srcpkgs/libvirt/patches/lxc-fix-compat-glibc-2.36.patch
@@ -0,0 +1,34 @@
+From 9493c9b79dc541ec9e0fd73c6d87bdf8d30aaa90 Mon Sep 17 00:00:00 2001
+From: Cole Robinson <crobinso@redhat.com>
+Date: Mon, 1 Aug 2022 15:20:38 -0400
+Subject: [PATCH] lxc: containter: fix build with glibc 2.36
+
+With glibc 2.36, sys/mount.h and linux/mount.h conflict:
+https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
+
+lxc_container.c imports sys/mount.h and linux/fs.h, which pulls in
+linux/mount.h.
+
+linux/fs.h isn't required here though. glibc sys/mount.h has had
+MS_MOVE since 2.12 in 2010
+
+Reviewed-by: Erik Skultety <eskultet@redhat.com>
+Signed-off-by: Cole Robinson <crobinso@redhat.com>
+---
+ src/lxc/lxc_container.c | 3 ---
+ 1 file changed, 3 deletions(-)
+
+diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
+index b5278831da7..a5401c2186e 100644
+--- a/src/lxc/lxc_container.c
++++ b/src/lxc/lxc_container.c
+@@ -33,9 +33,6 @@
+ /* Yes, we want linux private one, for _syscall2() macro */
+ #include <linux/unistd.h>
+ 
+-/* For MS_MOVE */
+-#include <linux/fs.h>
+-
+ #if WITH_CAPNG
+ # include <cap-ng.h>
+ #endif
diff --git a/srcpkgs/libvirt/patches/virfile-fix-compat-glibc-2.36.patch b/srcpkgs/libvirt/patches/virfile-fix-compat-glibc-2.36.patch
new file mode 100644
index 000000000000..2ef227ea9b54
--- /dev/null
+++ b/srcpkgs/libvirt/patches/virfile-fix-compat-glibc-2.36.patch
@@ -0,0 +1,39 @@
+From c0d9adf220dc0d223330a7bac37b174132d330ba Mon Sep 17 00:00:00 2001
+From: Cole Robinson <crobinso@redhat.com>
+Date: Mon, 1 Aug 2022 15:24:01 -0400
+Subject: [PATCH] virfile: Fix build with glibc 2.36
+
+With glibc 2.36, sys/mount.h and linux/mount.h conflict:
+https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
+
+virfile.c imports sys/mount.h and linux/fs.h, which pulls in
+linux/mount.h.
+
+Manually define the constants we need from linux/fs.h, like was
+done in llvm:
+
+https://reviews.llvm.org/rGb379129c4beb3f26223288627a1291739f33af02
+
+Reviewed-by: Erik Skultety <eskultet@redhat.com>
+Signed-off-by: Cole Robinson <crobinso@redhat.com>
+---
+ src/util/virfile.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/src/util/virfile.c b/src/util/virfile.c
+index 99da058db3b..ce541b8946b 100644
+--- a/src/util/virfile.c
++++ b/src/util/virfile.c
+@@ -71,7 +71,11 @@
+ # endif
+ # include <sys/ioctl.h>
+ # include <linux/cdrom.h>
+-# include <linux/fs.h>
++/* These come from linux/fs.h, but that header conflicts with
++ * sys/mount.h on glibc 2.36+ */
++# define FS_IOC_GETFLAGS _IOR('f', 1, long)
++# define FS_IOC_SETFLAGS _IOW('f', 2, long)
++# define FS_NOCOW_FL 0x00800000
+ #endif
+ 
+ #if WITH_LIBATTR

From 8320e83e9098a06738f8cfaf89e18070bf308676 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:41:50 -0700
Subject: [PATCH 21/51] efivar: fix build for glibc 2.36

---
 .../patches/fix-compat-glibc-2.36.patch       | 55 +++++++++++++++++++
 1 file changed, 55 insertions(+)
 create mode 100644 srcpkgs/efivar/patches/fix-compat-glibc-2.36.patch

diff --git a/srcpkgs/efivar/patches/fix-compat-glibc-2.36.patch b/srcpkgs/efivar/patches/fix-compat-glibc-2.36.patch
new file mode 100644
index 000000000000..fcc83aef20cf
--- /dev/null
+++ b/srcpkgs/efivar/patches/fix-compat-glibc-2.36.patch
@@ -0,0 +1,55 @@
+From bc65d63ebf8fe6ac8a099ff15ca200986dba1565 Mon Sep 17 00:00:00 2001
+From: Robbie Harwood <rharwood@redhat.com>
+Date: Thu, 28 Jul 2022 16:11:24 -0400
+Subject: [PATCH] Fix glibc 2.36 build (mount.h conflicts)
+
+glibc has decided that sys/mount.h and linux/mount.h are no longer
+usable at the same time.  This broke the build, since linux/fs.h itself
+includes linux/mount.h.  For now, fix the build by only including
+sys/mount.h where we need it.
+
+See-also: https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
+Resolves: #227
+Signed-off-by: Robbie Harwood <rharwood@redhat.com>
+---
+ src/gpt.c   | 1 +
+ src/linux.c | 1 +
+ src/util.h  | 1 -
+ 3 files changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/gpt.c b/src/gpt.c
+index 1eda0497..21413c3b 100644
+--- a/src/gpt.c
++++ b/src/gpt.c
+@@ -17,6 +17,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <sys/mount.h>
+ #include <sys/param.h>
+ #include <sys/stat.h>
+ #include <sys/utsname.h>
+diff --git a/src/linux.c b/src/linux.c
+index 47e45ae4..1780816f 100644
+--- a/src/linux.c
++++ b/src/linux.c
+@@ -20,6 +20,7 @@
+ #include <stdbool.h>
+ #include <stdio.h>
+ #include <sys/ioctl.h>
++#include <sys/mount.h>
+ #include <sys/socket.h>
+ #include <sys/sysmacros.h>
+ #include <sys/types.h>
+diff --git a/src/util.h b/src/util.h
+index 3300666f..1e67e447 100644
+--- a/src/util.h
++++ b/src/util.h
+@@ -23,7 +23,6 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <sys/ioctl.h>
+-#include <sys/mount.h>
+ #include <sys/stat.h>
+ #include <sys/types.h>
+ #include <tgmath.h>

From 66038146ad01f902392ef03e63bc7e28223d2734 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:43:24 -0700
Subject: [PATCH 22/51] libwpd: fix build for gcc12

---
 srcpkgs/libwpd/patches/fix-compat-gcc12.patch | 11 +++++++++++
 1 file changed, 11 insertions(+)
 create mode 100644 srcpkgs/libwpd/patches/fix-compat-gcc12.patch

diff --git a/srcpkgs/libwpd/patches/fix-compat-gcc12.patch b/srcpkgs/libwpd/patches/fix-compat-gcc12.patch
new file mode 100644
index 000000000000..6ebce2463d16
--- /dev/null
+++ b/srcpkgs/libwpd/patches/fix-compat-gcc12.patch
@@ -0,0 +1,11 @@
+diff -rup libwpd-0.10.3.orig/src/lib/WPXTable.h libwpd-0.10.3/src/lib/WPXTable.h
+--- libwpd-0.10.3.orig/src/lib/WPXTable.h	2022-08-23 22:32:45.332593795 -0700
++++ libwpd-0.10.3/src/lib/WPXTable.h	2022-08-23 22:32:59.500651211 -0700
+@@ -37,6 +37,7 @@
+ #define _WPXTABLE_H
+ 
+ #include <vector>
++#include <cstddef>
+ 
+ struct WPXTableCell
+ {

From 325133723b374cd38de0bae5b86f3f630ca7c53f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:44:07 -0700
Subject: [PATCH 23/51] grub: fix build for binutils 2.36

---
 .../patches/fix-compat-binutils-2.36.patch    | 96 +++++++++++++++++++
 srcpkgs/grub/template                         |  7 +-
 2 files changed, 102 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/grub/patches/fix-compat-binutils-2.36.patch

diff --git a/srcpkgs/grub/patches/fix-compat-binutils-2.36.patch b/srcpkgs/grub/patches/fix-compat-binutils-2.36.patch
new file mode 100644
index 000000000000..d92a91e3253e
--- /dev/null
+++ b/srcpkgs/grub/patches/fix-compat-binutils-2.36.patch
@@ -0,0 +1,96 @@
+From b98275138bf4fc250a1c362dfd2c8b1cf2421701 Mon Sep 17 00:00:00 2001
+From: Michael Chang <mchang@suse.com>
+Date: Tue, 28 Sep 2021 13:50:47 +0800
+Subject: build: Fix build error with binutils 2.36
+
+The following procedure to build xen/pvgrub is broken.
+
+  git clone https://git.savannah.gnu.org/git/grub.git
+  cd grub
+  ./bootstrap
+  mkdir build-xen
+  cd build-xen
+  ../configure --with-platform=xen
+  make
+
+It fails with the message:
+
+  /usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld:
+  section .note.gnu.property VMA [0000000000400158,0000000000400187]
+  overlaps section .bss VMA [000000000000f000,000000000041e1af]
+
+The most significant factor is that new assembler (GNU as) generates the
+.note.gnu.property section as default. This note section overlaps with
+.bss because it doesn't reposition with -Wl,-Ttext,0 with which the base
+address of .text section is set, rather the address of .note.gnu.property
+is calculated for some reason from 0x400000 where the ELF executable
+defaults to start.
+
+Using -Ttext-segment doesn't help either, though it is said to set the
+address of the first byte of the text segment according to "man ld".
+What it actually does is to override the default 0x400000, aka the image
+base address, to something else. The entire process can be observed in
+the default linker script used by gcc [1]. Therefore we can't expect it
+to achieve the same thing as -Ttext given that the first segment where
+.text resides is offset by SIZEOF_HEADERS plus some sections may be
+preceding it within the first segment. The end result is .text always
+has to start with non-zero address with -Wl,-Ttext-segment,0 if using
+default linker script.
+
+It is also worth mentioning that binutils upstream apparently doesn't
+seem to consider this as a bug [2] and proposed to use -Wl,-Ttext-segment,0
+which is not fruitful as what has been tested by Gentoo [3].
+
+As long as GRUB didn't use ISA information encoded in .note.gnu.property,
+we can safely drop it via -Wa,-mx86-used-note=no assembler option to
+fix the linker error above.
+
+This is considered a better approach than using custom linker script to
+drop the .note.gnu.property section because object file manipulation can
+also be hampered one way or the other in that linker script may not be
+helpful. See also this commit removing the section in the process of objcopy.
+
+  6643507ce build: Fix GRUB i386-pc build with Ubuntu gcc
+
+[1] In /usr/lib64/ldscripts/elf_x86_64.x or use 'gcc -Wl,--verbose ...'
+    PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x400000));
+    . = SEGMENT_START("text-segment", 0x400000) + SIZEOF_HEADERS;
+[2] https://sourceware.org/bugzilla/show_bug.cgi?id=27377
+[3] https://bugs.gentoo.org/787221
+
+Signed-off-by: Michael Chang <mchang@suse.com>
+Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
+---
+ configure.ac | 14 ++++++++++++++
+ 1 file changed, 14 insertions(+)
+
+(limited to 'configure.ac')
+
+diff --git a/configure.ac b/configure.ac
+index eeb5d22..8d1c81a 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -840,6 +840,20 @@ if ( test "x$target_cpu" = xi386 || test "x$target_cpu" = xx86_64 ) && test "x$p
+   TARGET_CFLAGS="$TARGET_CFLAGS -mno-mmx -mno-sse -mno-sse2 -mno-sse3 -mno-3dnow"
+ fi
+ 
++if ( test "x$target_cpu" = xi386 || test "x$target_cpu" = xx86_64 ); then
++  AC_CACHE_CHECK([whether -Wa,-mx86-used-note works], [grub_cv_cc_mx86_used_note], [
++    CFLAGS="$TARGET_CFLAGS -Wa,-mx86-used-note=no -Werror"
++    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
++	[grub_cv_cc_mx86_used_note=yes],
++	[grub_cv_cc_mx86_used_note=no])
++  ])
++
++  if test "x$grub_cv_cc_mx86_used_note" = xyes; then
++    TARGET_CFLAGS="$TARGET_CFLAGS -Wa,-mx86-used-note=no"
++    TARGET_CCASFLAGS="$TARGET_CCASFLAGS -Wa,-mx86-used-note=no"
++  fi
++fi
++
+ # GRUB doesn't use float or doubles at all. Yet some toolchains may decide
+ # that floats are a good fit to run instead of what's written in the code.
+ # Given that floating point unit is disabled (if present to begin with)
+-- 
+cgit v1.1
+
diff --git a/srcpkgs/grub/template b/srcpkgs/grub/template
index b1826c38a884..b4d3b07af620 100644
--- a/srcpkgs/grub/template
+++ b/srcpkgs/grub/template
@@ -2,7 +2,8 @@
 pkgname=grub
 version=2.06
 revision=2
-hostmakedepends="python3 pkg-config flex freetype-devel font-unifont-bdf help2man"
+hostmakedepends="python3 pkg-config flex freetype-devel font-unifont-bdf help2man
+ automake gettext-devel-tools"
 makedepends="libusb-compat-devel ncurses-devel freetype-devel
  liblzma-devel device-mapper-devel fuse-devel"
 depends="os-prober"
@@ -43,6 +44,10 @@ case "$XBPS_TARGET_MACHINE" in
 		;;
 esac
 
+pre_configure() {
+	autoreconf -fi
+}
+
 do_configure() {
 	# workaround for https://savannah.gnu.org/bugs/?60458
 	# some more info: https://www.linuxquestions.org/questions/showthread.php?p=6257712

From a82c23fd004b31548a3d075c67cff546b414aadc Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:45:07 -0700
Subject: [PATCH 24/51] linux-toos: fix build for binutils 2.39

---
 .../patches/binutils-add-compat-check.patch   | 103 ++++++++++++
 .../patches/binutils-disasm-compat.patch      | 102 ++++++++++++
 .../bpf_jit_disasm-binutils-2.39.patch        | 104 ++++++++++++
 .../patches/bpftool-binutils-2.39.patch       | 149 ++++++++++++++++++
 .../patches/perf-binutils-2.39.patch          | 114 ++++++++++++++
 5 files changed, 572 insertions(+)
 create mode 100644 srcpkgs/linux-tools/patches/binutils-add-compat-check.patch
 create mode 100644 srcpkgs/linux-tools/patches/binutils-disasm-compat.patch
 create mode 100644 srcpkgs/linux-tools/patches/bpf_jit_disasm-binutils-2.39.patch
 create mode 100644 srcpkgs/linux-tools/patches/bpftool-binutils-2.39.patch
 create mode 100644 srcpkgs/linux-tools/patches/perf-binutils-2.39.patch

diff --git a/srcpkgs/linux-tools/patches/binutils-add-compat-check.patch b/srcpkgs/linux-tools/patches/binutils-add-compat-check.patch
new file mode 100644
index 000000000000..e4e7ece9635e
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/binutils-add-compat-check.patch
@@ -0,0 +1,103 @@
+From cfd59ca91467056bb2c36907b2fa67b8e1af9952 Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:27 -0700
+Subject: [PATCH] tools build: Add feature test for init_disassemble_info API
+ changes
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation failures for tools/{perf,bpf}, e.g. on debian unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+This commit adds a feature test to detect the new signature.  Subsequent
+commits will use it to fix the build failures.
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Quentin Monnet <quentin@isovalent.com>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-2-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/build/Makefile.feature                        |  1 +
+ tools/build/feature/Makefile                        |  4 ++++
+ tools/build/feature/test-all.c                      |  4 ++++
+ tools/build/feature/test-disassembler-init-styled.c | 13 +++++++++++++
+ 4 files changed, 22 insertions(+)
+ create mode 100644 tools/build/feature/test-disassembler-init-styled.c
+
+diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature
+index 888a0421d43b96..8f6578e4d3249e 100644
+--- a/tools/build/Makefile.feature
++++ b/tools/build/Makefile.feature
+@@ -70,6 +70,7 @@ FEATURE_TESTS_BASIC :=                  \
+         libaio				\
+         libzstd				\
+         disassembler-four-args		\
++        disassembler-init-styled	\
+         file-handle
+ 
+ # FEATURE_TESTS_BASIC + FEATURE_TESTS_EXTRA is the complete list
+diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile
+index 7c2a17e23c30ac..c3059739318a95 100644
+--- a/tools/build/feature/Makefile
++++ b/tools/build/feature/Makefile
+@@ -18,6 +18,7 @@ FILES=                                          \
+          test-libbfd.bin                        \
+          test-libbfd-buildid.bin		\
+          test-disassembler-four-args.bin        \
++         test-disassembler-init-styled.bin	\
+          test-reallocarray.bin			\
+          test-libbfd-liberty.bin                \
+          test-libbfd-liberty-z.bin              \
+@@ -248,6 +249,9 @@ $(OUTPUT)test-libbfd-buildid.bin:
+ $(OUTPUT)test-disassembler-four-args.bin:
+ 	$(BUILD) -DPACKAGE='"perf"' -lbfd -lopcodes
+ 
++$(OUTPUT)test-disassembler-init-styled.bin:
++	$(BUILD) -DPACKAGE='"perf"' -lbfd -lopcodes
++
+ $(OUTPUT)test-reallocarray.bin:
+ 	$(BUILD)
+ 
+diff --git a/tools/build/feature/test-all.c b/tools/build/feature/test-all.c
+index 5ffafb967b6e49..957c02c7b163b5 100644
+--- a/tools/build/feature/test-all.c
++++ b/tools/build/feature/test-all.c
+@@ -166,6 +166,10 @@
+ # include "test-disassembler-four-args.c"
+ #undef main
+ 
++#define main main_test_disassembler_init_styled
++# include "test-disassembler-init-styled.c"
++#undef main
++
+ #define main main_test_libzstd
+ # include "test-libzstd.c"
+ #undef main
+diff --git a/tools/build/feature/test-disassembler-init-styled.c b/tools/build/feature/test-disassembler-init-styled.c
+new file mode 100644
+index 00000000000000..f1ce0ec3bee9d3
+--- /dev/null
++++ b/tools/build/feature/test-disassembler-init-styled.c
+@@ -0,0 +1,13 @@
++// SPDX-License-Identifier: GPL-2.0
++#include <stdio.h>
++#include <dis-asm.h>
++
++int main(void)
++{
++	struct disassemble_info info;
++
++	init_disassemble_info(&info, stdout,
++			      NULL, NULL);
++
++	return 0;
++}
diff --git a/srcpkgs/linux-tools/patches/binutils-disasm-compat.patch b/srcpkgs/linux-tools/patches/binutils-disasm-compat.patch
new file mode 100644
index 000000000000..1a6cc0e6d97c
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/binutils-disasm-compat.patch
@@ -0,0 +1,102 @@
+From a45b3d6926231c3d024ea0de4f7bd967f83709ee Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:29 -0700
+Subject: tools include: add dis-asm-compat.h to handle version differences
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation failures for tools/{perf,bpf}, e.g. on debian unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+This commit introduces a wrapper for init_disassemble_info(), to avoid
+spreading #ifdef DISASM_INIT_STYLED to a bunch of places. Subsequent
+commits will use it to fix the build failures.
+
+It likely is worth adding a wrapper for disassember(), to avoid the already
+existing DISASM_FOUR_ARGS_SIGNATURE ifdefery.
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Signed-off-by: Ben Hutchings <benh@debian.org>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Quentin Monnet <quentin@isovalent.com>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-4-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/include/tools/dis-asm-compat.h | 55 ++++++++++++++++++++++++++++++++++++
+ 1 file changed, 55 insertions(+)
+ create mode 100644 tools/include/tools/dis-asm-compat.h
+
+(limited to 'tools/include/tools/dis-asm-compat.h')
+
+diff --git a/tools/include/tools/dis-asm-compat.h b/tools/include/tools/dis-asm-compat.h
+new file mode 100644
+index 0000000000000..70f331e23ed3d
+--- /dev/null
++++ b/tools/include/tools/dis-asm-compat.h
+@@ -0,0 +1,55 @@
++/* SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause */
++#ifndef _TOOLS_DIS_ASM_COMPAT_H
++#define _TOOLS_DIS_ASM_COMPAT_H
++
++#include <stdio.h>
++#include <dis-asm.h>
++
++/* define types for older binutils version, to centralize ifdef'ery a bit */
++#ifndef DISASM_INIT_STYLED
++enum disassembler_style {DISASSEMBLER_STYLE_NOT_EMPTY};
++typedef int (*fprintf_styled_ftype) (void *, enum disassembler_style, const char*, ...);
++#endif
++
++/*
++ * Trivial fprintf wrapper to be used as the fprintf_styled_func argument to
++ * init_disassemble_info_compat() when normal fprintf suffices.
++ */
++static inline int fprintf_styled(void *out,
++				 enum disassembler_style style,
++				 const char *fmt, ...)
++{
++	va_list args;
++	int r;
++
++	(void)style;
++
++	va_start(args, fmt);
++	r = vfprintf(out, fmt, args);
++	va_end(args);
++
++	return r;
++}
++
++/*
++ * Wrapper for init_disassemble_info() that hides version
++ * differences. Depending on binutils version and architecture either
++ * fprintf_func or fprintf_styled_func will be called.
++ */
++static inline void init_disassemble_info_compat(struct disassemble_info *info,
++						void *stream,
++						fprintf_ftype unstyled_func,
++						fprintf_styled_ftype styled_func)
++{
++#ifdef DISASM_INIT_STYLED
++	init_disassemble_info(info, stream,
++			      unstyled_func,
++			      styled_func);
++#else
++	(void)styled_func;
++	init_disassemble_info(info, stream,
++			      unstyled_func);
++#endif
++}
++
++#endif /* _TOOLS_DIS_ASM_COMPAT_H */
+-- 
+cgit 
+
diff --git a/srcpkgs/linux-tools/patches/bpf_jit_disasm-binutils-2.39.patch b/srcpkgs/linux-tools/patches/bpf_jit_disasm-binutils-2.39.patch
new file mode 100644
index 000000000000..01221fad3a4a
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/bpf_jit_disasm-binutils-2.39.patch
@@ -0,0 +1,104 @@
+From 96ed066054abf11c7d3e106e3011a51f3f1227a3 Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:31 -0700
+Subject: [PATCH] tools bpf_jit_disasm: Fix compilation error with new binutils
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation to fail for tools/bpf/bpf_jit_disasm.c, e.g. on debian
+unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+Wire up the feature test and switch to init_disassemble_info_compat(),
+which were introduced in prior commits, fixing the compilation failure.
+
+I verified that bpf_jit_disasm can still disassemble bpf programs, both
+with the old and new dis-asm.h API. With old binutils there's no change in
+output before/after this patch. When comparing the output from old
+binutils (2.35) to new bintuils with the patch (upstream snapshot) there
+are a few output differences, but they are unrelated to this patch. An
+example hunk is:
+
+     f4:	mov    %r14,%rsi
+     f7:	mov    %r15,%rdx
+     fa:	mov    $0x2a,%ecx
+  -  ff:	callq  0xffffffffea8c4988
+  +  ff:	call   0xffffffffea8c4988
+    104:	test   %rax,%rax
+    107:	jge    0x0000000000000110
+    109:	xor    %eax,%eax
+  - 10b:	jmpq   0x0000000000000073
+  + 10b:	jmp    0x0000000000000073
+    110:	cmp    $0x16,%rax
+
+However, I had to use an older kernel to generate the bpf_jit_enabled =
+2 output, as that has been broken since 5.18 / 1022a5498f6f745c ("bpf,
+x86_64: Use bpf_jit_binary_pack_alloc").
+
+  https://lore.kernel.org/20220703030210.pmjft7qc2eajzi6c@alap3.anarazel.de
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Daniel Borkmann <daniel@iogearbox.net>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Quentin Monnet <quentin@isovalent.com>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-6-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/bpf/Makefile         | 5 ++++-
+ tools/bpf/bpf_jit_disasm.c | 5 ++++-
+ 2 files changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/tools/bpf/Makefile b/tools/bpf/Makefile
+index b11cfc86a3d021..664601ab1705ab 100644
+--- a/tools/bpf/Makefile
++++ b/tools/bpf/Makefile
+@@ -34,7 +34,7 @@ else
+ endif
+ 
+ FEATURE_USER = .bpf
+-FEATURE_TESTS = libbfd disassembler-four-args
++FEATURE_TESTS = libbfd disassembler-four-args disassembler-init-styled
+ FEATURE_DISPLAY = libbfd disassembler-four-args
+ 
+ check_feat := 1
+@@ -56,6 +56,9 @@ endif
+ ifeq ($(feature-disassembler-four-args), 1)
+ CFLAGS += -DDISASM_FOUR_ARGS_SIGNATURE
+ endif
++ifeq ($(feature-disassembler-init-styled), 1)
++CFLAGS += -DDISASM_INIT_STYLED
++endif
+ 
+ $(OUTPUT)%.yacc.c: $(srctree)/tools/bpf/%.y
+ 	$(QUIET_BISON)$(YACC) -o $@ -d $<
+diff --git a/tools/bpf/bpf_jit_disasm.c b/tools/bpf/bpf_jit_disasm.c
+index c8ae9580472814..a90a5d110f9255 100644
+--- a/tools/bpf/bpf_jit_disasm.c
++++ b/tools/bpf/bpf_jit_disasm.c
+@@ -28,6 +28,7 @@
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <limits.h>
++#include <tools/dis-asm-compat.h>
+ 
+ #define CMD_ACTION_SIZE_BUFFER		10
+ #define CMD_ACTION_READ_ALL		3
+@@ -64,7 +65,9 @@ static void get_asm_insns(uint8_t *image, size_t len, int opcodes)
+ 	assert(bfdf);
+ 	assert(bfd_check_format(bfdf, bfd_object));
+ 
+-	init_disassemble_info(&info, stdout, (fprintf_ftype) fprintf);
++	init_disassemble_info_compat(&info, stdout,
++				     (fprintf_ftype) fprintf,
++				     fprintf_styled);
+ 	info.arch = bfd_get_arch(bfdf);
+ 	info.mach = bfd_get_mach(bfdf);
+ 	info.buffer = image;
diff --git a/srcpkgs/linux-tools/patches/bpftool-binutils-2.39.patch b/srcpkgs/linux-tools/patches/bpftool-binutils-2.39.patch
new file mode 100644
index 000000000000..1e55c40011be
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/bpftool-binutils-2.39.patch
@@ -0,0 +1,149 @@
+From 600b7b26c07a070d0153daa76b3806c1e52c9e00 Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:33 -0700
+Subject: [PATCH] tools bpftool: Fix compilation error with new binutils
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation to fail for tools/bpf/bpftool/jit_disasm.c, e.g. on debian
+unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+Wire up the feature test and switch to init_disassemble_info_compat(),
+which were introduced in prior commits, fixing the compilation failure.
+
+I verified that bpftool can still disassemble bpf programs, both with an
+old and new dis-asm.h API. There are no output changes for plain and json
+formats. When comparing the output from old binutils (2.35)
+to new bintuils with the patch (upstream snapshot) there are a few output
+differences, but they are unrelated to this patch. An example hunk is:
+
+     2f:	pop    %r14
+     31:	pop    %r13
+     33:	pop    %rbx
+  -  34:	leaveq
+  -  35:	retq
+  +  34:	leave
+  +  35:	ret
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Quentin Monnet <quentin@isovalent.com>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-8-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/bpf/bpftool/Makefile     |  5 +++-
+ tools/bpf/bpftool/jit_disasm.c | 42 +++++++++++++++++++++++++++-------
+ 2 files changed, 38 insertions(+), 9 deletions(-)
+
+diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile
+index c6d2c77d02524a..436e671b2657d4 100644
+--- a/tools/bpf/bpftool/Makefile
++++ b/tools/bpf/bpftool/Makefile
+@@ -62,7 +62,7 @@ CLANG ?= clang
+ LLVM_STRIP ?= llvm-strip
+ 
+ FEATURE_USER = .bpftool
+-FEATURE_TESTS = libbfd disassembler-four-args reallocarray zlib libcap \
++FEATURE_TESTS = libbfd disassembler-four-args disassembler-init-styled reallocarray zlib libcap \
+ 	clang-bpf-co-re
+ FEATURE_DISPLAY = libbfd disassembler-four-args zlib libcap \
+ 	clang-bpf-co-re
+@@ -117,6 +117,9 @@ endif
+ ifeq ($(feature-disassembler-four-args), 1)
+ CFLAGS += -DDISASM_FOUR_ARGS_SIGNATURE
+ endif
++ifeq ($(feature-disassembler-init-styled), 1)
++    CFLAGS += -DDISASM_INIT_STYLED
++endif
+ 
+ LIBS = $(LIBBPF) -lelf -lz
+ LIBS_BOOTSTRAP = $(LIBBPF_BOOTSTRAP) -lelf -lz
+diff --git a/tools/bpf/bpftool/jit_disasm.c b/tools/bpf/bpftool/jit_disasm.c
+index 24734f2249d6ec..aaf99a0168c90b 100644
+--- a/tools/bpf/bpftool/jit_disasm.c
++++ b/tools/bpf/bpftool/jit_disasm.c
+@@ -24,6 +24,7 @@
+ #include <sys/stat.h>
+ #include <limits.h>
+ #include <bpf/libbpf.h>
++#include <tools/dis-asm-compat.h>
+ 
+ #include "json_writer.h"
+ #include "main.h"
+@@ -39,15 +40,12 @@ static void get_exec_path(char *tpath, s
+ }
+ 
+ static int oper_count;
+-static int fprintf_json(void *out, const char *fmt, ...)
++static int printf_json(void *out, const char *fmt, va_list ap)
+ {
+-	va_list ap;
+ 	char *s;
+ 
+-	va_start(ap, fmt);
+ 	if (vasprintf(&s, fmt, ap) < 0)
+ 		return -1;
+-	va_end(ap);
+ 
+ 	if (!oper_count) {
+ 		int i;
+@@ -73,6 +71,32 @@ static int fprintf_json(void *out, const char *fmt, ...)
+ 	return 0;
+ }
+ 
++static int fprintf_json(void *out, const char *fmt, ...)
++{
++	va_list ap;
++	int r;
++
++	va_start(ap, fmt);
++	r = printf_json(out, fmt, ap);
++	va_end(ap);
++
++	return r;
++}
++
++static int fprintf_json_styled(void *out,
++			       enum disassembler_style style __maybe_unused,
++			       const char *fmt, ...)
++{
++	va_list ap;
++	int r;
++
++	va_start(ap, fmt);
++	r = printf_json(out, fmt, ap);
++	va_end(ap);
++
++	return r;
++}
++
+ void disasm_print_insn(unsigned char *image, ssize_t len, int opcodes,
+ 		       const char *arch, const char *disassembler_options,
+ 		       const struct btf *btf,
+@@ -99,11 +123,13 @@ void disasm_print_insn(unsigned char *image, ssize_t len, int opcodes,
+ 	assert(bfd_check_format(bfdf, bfd_object));
+ 
+ 	if (json_output)
+-		init_disassemble_info(&info, stdout,
+-				      (fprintf_ftype) fprintf_json);
++		init_disassemble_info_compat(&info, stdout,
++					     (fprintf_ftype) fprintf_json,
++					     fprintf_json_styled);
+ 	else
+-		init_disassemble_info(&info, stdout,
+-				      (fprintf_ftype) fprintf);
++		init_disassemble_info_compat(&info, stdout,
++					     (fprintf_ftype) fprintf,
++					     fprintf_styled);
+ 
+ 	/* Update architecture info for offload. */
+ 	if (arch) {
diff --git a/srcpkgs/linux-tools/patches/perf-binutils-2.39.patch b/srcpkgs/linux-tools/patches/perf-binutils-2.39.patch
new file mode 100644
index 000000000000..3484330f7286
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/perf-binutils-2.39.patch
@@ -0,0 +1,114 @@
+From 83aa0120487e8bc3f231e72c460add783f71f17c Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:30 -0700
+Subject: [PATCH] tools perf: Fix compilation error with new binutils
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation failures for tools/perf/util/annotate.c, e.g. on debian
+unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+Wire up the feature test and switch to init_disassemble_info_compat(),
+which were introduced in prior commits, fixing the compilation failure.
+
+I verified that perf can still disassemble bpf programs by using bpftrace
+under load, recording a perf trace, and then annotating the bpf "function"
+with and without the changes. With old binutils there's no change in output
+before/after this patch. When comparing the output from old binutils (2.35)
+to new bintuils with the patch (upstream snapshot) there are a few output
+differences, but they are unrelated to this patch. An example hunk is:
+
+       1.15 :   55:mov    %rbp,%rdx
+       0.00 :   58:add    $0xfffffffffffffff8,%rdx
+       0.00 :   5c:xor    %ecx,%ecx
+  -    1.03 :   5e:callq  0xffffffffe12aca3c
+  +    1.03 :   5e:call   0xffffffffe12aca3c
+       0.00 :   63:xor    %eax,%eax
+  -    2.18 :   65:leaveq
+  -    2.82 :   66:retq
+  +    2.18 :   65:leave
+  +    2.82 :   66:ret
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-5-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/perf/Makefile.config | 8 ++++++++
+ tools/perf/util/annotate.c | 7 ++++---
+ 2 files changed, 12 insertions(+), 3 deletions(-)
+
+diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
+index d3c254c0f5c611..23648ea54e8d3d 100644
+--- a/tools/perf/Makefile.config
++++ b/tools/perf/Makefile.config
+@@ -298,6 +298,7 @@ FEATURE_CHECK_LDFLAGS-libpython := $(PYTHON_EMBED_LDOPTS)
+ FEATURE_CHECK_LDFLAGS-libaio = -lrt
+ 
+ FEATURE_CHECK_LDFLAGS-disassembler-four-args = -lbfd -lopcodes -ldl
++FEATURE_CHECK_LDFLAGS-disassembler-init-styled = -lbfd -lopcodes -ldl
+ 
+ CORE_CFLAGS += -fno-omit-frame-pointer
+ CORE_CFLAGS += -ggdb3
+@@ -818,13 +819,16 @@ else
+   ifeq ($(feature-libbfd-liberty), 1)
+     EXTLIBS += -lbfd -lopcodes -liberty
+     FEATURE_CHECK_LDFLAGS-disassembler-four-args += -liberty -ldl
++    FEATURE_CHECK_LDFLAGS-disassembler-init-styled += -liberty -ldl
+   else
+     ifeq ($(feature-libbfd-liberty-z), 1)
+       EXTLIBS += -lbfd -lopcodes -liberty -lz
+       FEATURE_CHECK_LDFLAGS-disassembler-four-args += -liberty -lz -ldl
++      FEATURE_CHECK_LDFLAGS-disassembler-init-styled += -liberty -lz -ldl
+     endif
+   endif
+   $(call feature_check,disassembler-four-args)
++  $(call feature_check,disassembler-init-styled)
+ endif
+ 
+ ifeq ($(feature-libbfd-buildid), 1)
+@@ -1044,6 +1048,10 @@ ifeq ($(feature-disassembler-four-args), 1)
+     CFLAGS += -DDISASM_FOUR_ARGS_SIGNATURE
+ endif
+ 
++ifeq ($(feature-disassembler-init-styled), 1)
++    CFLAGS += -DDISASM_INIT_STYLED
++endif
++
+ ifeq (${IS_64_BIT}, 1)
+   ifndef NO_PERF_READ_VDSO32
+     $(call feature_check,compile-32)
+diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
+index 82cc396ef516c4..2c6a485c3de5d9 100644
+--- a/tools/perf/util/annotate.c
++++ b/tools/perf/util/annotate.c
+@@ -1676,6 +1676,7 @@ fallback:
+ #define PACKAGE "perf"
+ #include <bfd.h>
+ #include <dis-asm.h>
++#include <tools/dis-asm-compat.h>
+ 
+ static int symbol__disassemble_bpf(struct symbol *sym,
+ 				   struct annotate_args *args)
+@@ -1762,9 +1763,9 @@ static int symbol__disassemble_bpf(struct symbol *sym,
+ 		ret = errno;
+ 		goto out;
+ 	}
+-	init_disassemble_info(&info, s,
+-			      (fprintf_ftype) fprintf);
+-
++	init_disassemble_info_compat(&info, s,
++				     (fprintf_ftype) fprintf,
++				     fprintf_styled);
+ 	info.arch = bfd_get_arch(bfdf);
+ 	info.mach = bfd_get_mach(bfdf);
+ 

From 4c7865524e0a6f3cbf53e0f4e0a4ad1392273e3a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 14:45:28 -0700
Subject: [PATCH 25/51] libsasl: fix build for libtool 2.4.7

---
 srcpkgs/libsasl/template | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/libsasl/template b/srcpkgs/libsasl/template
index a8817042f843..a2993b39f4a1 100644
--- a/srcpkgs/libsasl/template
+++ b/srcpkgs/libsasl/template
@@ -19,6 +19,7 @@ distfiles="https://github.com/cyrusimap/cyrus-sasl/releases/download/cyrus-sasl-
 checksum=26866b1549b00ffd020f188a43c258017fa1c382b3ddadd8201536f72efb05d5
 
 pre_configure() {
+	rm -f m4/ltversion.m4
 	autoreconf -fi
 }
 

From 55a91426c5aac10499967efce213fc2dbdaa84ac Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:08 -0700
Subject: [PATCH 26/51] subversion: fix build for libtool 2.4.7

---
 srcpkgs/subversion/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion/template b/srcpkgs/subversion/template
index 8ad178264942..3f1c9e254e61 100644
--- a/srcpkgs/subversion/template
+++ b/srcpkgs/subversion/template
@@ -57,7 +57,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From 2ca5538230f6ffb21026ec67b89d0186e2420df0 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:38 -0700
Subject: [PATCH 27/51] subversion-kwallet-auth: fix build for libtool 2.4.7

---
 srcpkgs/subversion-kwallet-auth/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion-kwallet-auth/template b/srcpkgs/subversion-kwallet-auth/template
index 12210f250d51..b4d8621456ea 100644
--- a/srcpkgs/subversion-kwallet-auth/template
+++ b/srcpkgs/subversion-kwallet-auth/template
@@ -59,7 +59,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From 8cdd5e097a9a2f9868e72f8d6e4107f2d70f3abe Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 20:07:32 -0700
Subject: [PATCH 28/51] gpgme: update to 1.18.0.

---
 common/shlibs          | 2 +-
 srcpkgs/gpgme/template | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 99b1dfc089b9..4eaee728723b 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -723,7 +723,7 @@ libdconf.so.1 dconf-0.13.90_1
 libassuan.so.0 libassuan-2.0.1_1
 libgpgme.so.11 libgpgme-1.12.0_2
 libgpgmepp.so.6 gpgmepp-1.7.0_3
-libqgpgme.so.7 gpgmeqt-1.7.0_3
+libqgpgme.so.15 gpgmeqt-1.18.0_1
 libgarcon-1.so.0 garcon-0.1.12_1
 libgarcon-gtk2-1.so.0 garcon-0.4.0_1
 libgarcon-gtk3-1.so.0 garcon-0.6.1_1
diff --git a/srcpkgs/gpgme/template b/srcpkgs/gpgme/template
index 8633075a8404..b1cfd5f78657 100644
--- a/srcpkgs/gpgme/template
+++ b/srcpkgs/gpgme/template
@@ -1,7 +1,7 @@
 # Template file for 'gpgme'
 pkgname=gpgme
-version=1.15.1
-revision=2
+version=1.18.0
+revision=1
 build_style=gnu-configure
 configure_args="--enable-fd-passing
  --with-libgpg-error-prefix=$XBPS_CROSS_BASE/usr
@@ -14,7 +14,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.gnupg.org/software/gpgme/index.html"
 distfiles="https://www.gnupg.org/ftp/gcrypt/gpgme/gpgme-${version}.tar.bz2"
-checksum=eebc3c1b27f1c8979896ff361ba9bb4778b508b2496c2fc10e3775a40b1de1ad
+checksum=361d4eae47ce925dba0ea569af40e7b52c645c4ae2e65e5621bf1b6cdd8b0e9e
 
 if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
 	configure_args+=" ac_cv_sys_file_offset_bits=no"

From e04dbb404d1e55ec4d9a95c651292d3b7a190681 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 29/51] cross-aarch64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..bd6b23f9fb6a 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From ef4ffdd50f04c3f14a9d25532b5a7e3346674f21 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 30/51] cross-aarch64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..427ad2c1e9cd 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From d627e23d3d3acb2cd59d11d64d6c4bb4c12de46e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 31/51] cross-arm-linux-gnueabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..2510ee26e789 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From f5a599db53f1a6f8cc5c58d58a11ba8136f810f7 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 32/51] cross-arm-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..bd8b16e1b4c1 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 988da326567ee705617d672eaed57ca1e33cb689 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 33/51] cross-arm-linux-musleabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..dacfd2655216 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 1d3bbd5dddbd66719173444e62b5c175f6db0eef Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 34/51] cross-arm-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..9ddd32a9f20d 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 7482045612a9f085c58f4dc06e6454df5912b427 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 35/51] cross-armv7l-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..9fb00f18be3b 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 510c8d5cecde18d749c7fe4161e09f2fb16af71c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 36/51] cross-armv7l-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..2c72e75ddfe3 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From b1f7d0ffe3fab4d2acdce0d06572b8d4d3cfed13 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 37/51] cross-i686-pc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..4dc17df648b5 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 94b6d25c94cf4e11e12981c472971b5af6423db1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 38/51] cross-mips-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..6009e5c79eb2 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 557668c342008b026654c0854cbc115b7f105c6a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 39/51] cross-mips-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..080164df193d 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="hipperson0 <hipperson0@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From d4974d67af3e2d5e6e386b63df69fb88f40625d1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 40/51] cross-mipsel-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..c8f90cfa43cc 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_musl_version=1.1.24
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 65b458c29f28aaae5077f9867abfd9b3e1d7df88 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 41/51] cross-mipsel-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..931345d2de15 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_musl_version=1.1.24
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From f152fd59fd089f0f431feb6f14a16f09b076e9c4 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 42/51] cross-powerpc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..31e57b4e52b2 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From e31580a71ed7007da8bc5390695b4a6b469eaf62 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 43/51] cross-powerpc-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..a2d1edcf1ffd 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From ccbe3fc27af4deedb7626cf6ec2516f8d153c3c3 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 44/51] cross-powerpc64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..1a4cbed61e76 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 154784025a62f1b5229a1971a52dfa8077b64cb1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 45/51] cross-powerpc64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 1ebd0fb2048d..ade42018af05 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 98e7929569b44484dd18f5d206dff8290da921c6 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 46/51] cross-powerpc64le-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 733f5851da5c..dd1ad383a21e 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From af894ade1957599a467416cc71e3733a8bdbd7c7 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 47/51] cross-powerpc64le-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index 76a70aa1d6db..5887f845f932 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From c81c1b9a4b9206a16339c8655e7c829cca3972a6 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 48/51] cross-powerpcle-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 347b8fcf4f55..06530e0d609b 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 4097a0e0635a57e80c90bb41e754c343aa272422 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:19 -0700
Subject: [PATCH 49/51] cross-powerpcle-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index ec9324ddaa99..e68c3962b49c 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From c05fe601b6f40f3524047adba6db52d4b193a093 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:19 -0700
Subject: [PATCH 50/51] cross-x86_64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 0078fbe7224b..7da85c14b62d 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 9776bf4873a39a7de921fbf4b513b5dcf67ca2c3 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:19 -0700
Subject: [PATCH 51/51] cross-x86_64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..2811de0d3c2e 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (60 preceding siblings ...)
  2022-08-25 23:49 ` oreo639
@ 2022-08-25 23:52 ` oreo639
  2022-08-25 23:58 ` [PR PATCH] [Updated] " oreo639
                   ` (202 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-08-25 23:52 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 243 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1227865082

Comment:
> Indeed, also Alpine has

It should be fixed with `lt_cv_shlibpath_overrides_runpath=yes`. Thanks.

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (61 preceding siblings ...)
  2022-08-25 23:52 ` oreo639
@ 2022-08-25 23:58 ` oreo639
  2022-08-26 10:54 ` leahneukirchen
                   ` (201 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-08-25 23:58 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5538 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.2.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.2.0

This PR depends on: https://github.com/void-linux/void-packages/pull/32330

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

Also, keep in mind that the libgo musl patch here will need to be updated once musl is updated:
https://github.com/void-linux/void-packages/pull/34902/files#diff-1f42a95b93c9550178ff1fbccbef2f47a72711df15c24c9472e2550076978129R163-R176

This is the updated patch for reference:
https://github.com/alpinelinux/aports/blob/8acb21b8ee881e7ab1c812d9a66a17d2501b8730/main/gcc/0049-libgo-adjust-name-of-union-in-sigevent-struct.patch

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/38817
- [x] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [ ] llvm https://github.com/void-linux/void-packages/pull/38694
- [ ] m4 https://github.com/void-linux/void-packages/pull/33730
- [ ] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [ ] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [ ] libvirt https://github.com/void-linux/void-packages/pull/38842
- [ ] syslinux https://github.com/void-linux/void-packages/pull/38876
- [ ] efivar https://github.com/void-linux/void-packages/pull/38874

Known packages that needed to be fixed/updated for gcc12:
- [ ] linux5.18 (in this PR)
- [ ] openssh https://github.com/void-linux/void-packages/pull/38849
- [ ] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [ ] doxygen https://github.com/void-linux/void-packages/pull/38846
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/38817
- [ ] libproxy https://github.com/void-linux/void-packages/pull/38818
- [ ] exempi https://github.com/void-linux/void-packages/pull/38820
- [ ] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [ ] gpgme https://github.com/void-linux/void-packages/pull/38825
- [x] libunique1 https://github.com/void-linux/void-packages/pull/38848 or https://github.com/void-linux/void-packages/pull/38873
- [ ] libwpd https://github.com/void-linux/void-packages/pull/38878

Needs to be fixed/updated for binutils:
- [ ] grub https://github.com/void-linux/void-packages/pull/38875
- [ ] linux-tools https://github.com/void-linux/void-packages/pull/38877

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [x] kde
- [x] lxde
- [x] lxqt

You can test the ISOs here:
https://drive.google.com/drive/folders/1ix92CYSLUP-KWjLxltdgG4e8Nu2JCY5n?usp=sharing

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 168435 bytes --]

From b5ee06e9872245686913fb6777f3980d7900dca6 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 01/51] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 15 +++--
 3 files changed, 28 insertions(+), 113 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..0578665c1a30 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkg-config"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -44,6 +45,12 @@ do_configure() {
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	# gprofng currently only supports x86 and aarch64 glibc.
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64|i386|aarch64) conf+=" --enable-gprofng" ;;
+		*) conf+=" --disable-gprofng" ;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"

From fd610c6cccd45f53e92cbc1d1530e1bc15dad8b6 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 02/51] gcc: update to 12.2.0.

---
 common/shlibs                                 | 10 +--
 srcpkgs/gcc/files/gccgo-musl.patch            | 74 ++++---------------
 srcpkgs/gcc/files/libgnarl-musl.patch         | 18 ++---
 srcpkgs/gcc/files/libssp-musl.patch           | 10 +--
 srcpkgs/gcc/patches/libffi_gnulinux.patch     | 11 ---
 .../gcc/patches/libgcc-ibm128-no-tag.patch    | 10 ++-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |  2 +-
 srcpkgs/gcc/template                          | 25 +++----
 8 files changed, 52 insertions(+), 108 deletions(-)
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index 8c257ed2bcd5..ee6ff38ac810 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.2.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.34 perl-5.34.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -848,8 +848,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.2.0_1
+libgnat-12.so libada-12.2.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1700,8 +1700,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.2.0_1
+libasan.so.8 libsanitizer-12.2.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..632ef951097b 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,17 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ a/libgo/go/runtime/os_linux.go
+@@ -363,9 +363,9 @@
+ 
+ 	var timerid int32
+ 	var sevp _sigevent
+-	sevp.sigev_notify = _SIGEV_THREAD_ID
++	sevp.sigev_notify = 4
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.sigev_notify_function))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..446741390d45 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,15 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
+version=12.2.0
+revision=1
 _patchver="${version%pre*}"
 _minorver="${_patchver%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 wrksrc=gcc-${version/pre/_pre}
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +19,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -396,7 +393,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}

From bc75d5b662928aa4643dd117a46ebd0bc3cabc60 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 03/51] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      | 11 ++++--
 2 files changed, 25 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..70c4aa533e66 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,12 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
+
+if [ "$XBPS_LIBC" == "musl" ]; then
+# Musl always searches LD_LIBRARY_PATH before RPATH and RUNPATH
+make_build_args="lt_cv_shlibpath_overrides_runpath=yes"
+fi
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From ecca3920fdaee547df07cfd0f346a7aa42dcc1b1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 04/51] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 1a4e1ca3d594..b04268908c2e 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="q66 <daniel@octaforge.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From e236f0c1d29dcbd2cc847f2a3c398427d3c38382 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 05/51] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 3 files changed, 55 insertions(+), 353 deletions(-)
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index ee6ff38ac810..99b1dfc089b9 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From 4c6fbad5c974fdc291532d3936a5b9fb5c4ff06f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 21:01:43 -0700
Subject: [PATCH 06/51] gcc-multilib: update to 12.2.0.

---
 srcpkgs/gcc-multilib/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index fcd25755aa75..1a26da26a991 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,16 +3,16 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _majorver="${version%.*}"
-wrksrc=gcc-${version/pre/_pre}
+wrksrc=gcc-${version}
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel

From 404cf9e547e16226ed570a940fdfae897ec69abd Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 16:22:03 -0700
Subject: [PATCH 07/51] llvm12: fix build for glibc 2.36

---
 .../compiler-rt-sanitizer-glibc-2.36.patch    | 59 +++++++++++++++++++
 1 file changed, 59 insertions(+)
 create mode 100644 srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch

diff --git a/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch b/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch
new file mode 100644
index 000000000000..e5f24dab8935
--- /dev/null
+++ b/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch
@@ -0,0 +1,59 @@
+From 9cf13067cb5088626ba7ee1ec4c42ec59c7995a0 Mon Sep 17 00:00:00 2001
+From: Fangrui Song <i@maskray.me>
+Date: Mon, 11 Jul 2022 12:53:34 -0700
+Subject: [PATCH] [sanitizer] Remove #include <linux/fs.h> to resolve
+ fsconfig_command/mount_attr conflict with glibc 2.36
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+It is generally not a good idea to mix usage of glibc headers and Linux UAPI
+headers (https://sourceware.org/glibc/wiki/Synchronizing_Headers). In glibc
+since 7eae6a91e9b1670330c9f15730082c91c0b1d570 (milestone: 2.36), sys/mount.h
+defines `fsconfig_command` which conflicts with linux/mount.h:
+
+    .../usr/include/linux/mount.h:95:6: error: redeclaration of ‘enum fsconfig_command’
+
+Remove #include <linux/fs.h> which pulls in linux/mount.h. Expand its 4 macros manually.
+Android sys/mount.h doesn't define BLKBSZGET and it still needs linux/fs.h.
+In the long term we should move Linux specific definitions to sanitizer_platform_limits_linux.cpp
+but this commit is easy to cherry pick into older compiler-rt releases.
+
+Fix https://github.com/llvm/llvm-project/issues/56421
+
+Reviewed By: #sanitizers, vitalybuka, zatrazz
+
+Differential Revision: https://reviews.llvm.org/D129471
+---
+ .../sanitizer_platform_limits_posix.cpp                | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+index 4bd425435d56d..3a94b260686f1 100644
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -73,7 +73,9 @@
+ #include <sys/vt.h>
+ #include <linux/cdrom.h>
+ #include <linux/fd.h>
++#if SANITIZER_ANDROID
+ #include <linux/fs.h>
++#endif
+ #include <linux/hdreg.h>
+ #include <linux/input.h>
+ #include <linux/ioctl.h>
+@@ -876,10 +878,10 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
+   unsigned IOCTL_EVIOCGPROP = IOCTL_NOT_PRESENT;
+   unsigned IOCTL_EVIOCSKEYCODE_V2 = IOCTL_NOT_PRESENT;
+ #endif
+-  unsigned IOCTL_FS_IOC_GETFLAGS = FS_IOC_GETFLAGS;
+-  unsigned IOCTL_FS_IOC_GETVERSION = FS_IOC_GETVERSION;
+-  unsigned IOCTL_FS_IOC_SETFLAGS = FS_IOC_SETFLAGS;
+-  unsigned IOCTL_FS_IOC_SETVERSION = FS_IOC_SETVERSION;
++  unsigned IOCTL_FS_IOC_GETFLAGS = _IOR('f', 1, long);
++  unsigned IOCTL_FS_IOC_GETVERSION = _IOR('v', 1, long);
++  unsigned IOCTL_FS_IOC_SETFLAGS = _IOW('f', 2, long);
++  unsigned IOCTL_FS_IOC_SETVERSION = _IOW('v', 2, long);
+   unsigned IOCTL_GIO_CMAP = GIO_CMAP;
+   unsigned IOCTL_GIO_FONT = GIO_FONT;
+   unsigned IOCTL_GIO_UNIMAP = GIO_UNIMAP;

From 82a8f964e33025b7c1ed61af615403f03ea8f33a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 17:21:40 -0700
Subject: [PATCH 08/51] m4: update to 1.4.19.

---
 srcpkgs/m4/patches/fix-glibc-2.27.patch | 167 ------------------------
 srcpkgs/m4/template                     |  12 +-
 2 files changed, 6 insertions(+), 173 deletions(-)
 delete mode 100644 srcpkgs/m4/patches/fix-glibc-2.27.patch

diff --git a/srcpkgs/m4/patches/fix-glibc-2.27.patch b/srcpkgs/m4/patches/fix-glibc-2.27.patch
deleted file mode 100644
index 59d33cff164d..000000000000
--- a/srcpkgs/m4/patches/fix-glibc-2.27.patch
+++ /dev/null
@@ -1,167 +0,0 @@
-From 4af4a4a71827c0bc5e0ec67af23edef4f15cee8e Mon Sep 17 00:00:00 2001
-From: Paul Eggert <eggert@cs.ucla.edu>
-Date: Mon, 5 Mar 2018 10:56:29 -0800
-Subject: [PATCH] fflush: adjust to glibc 2.28 libio.h removal
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Problem reported by Daniel P. Berrangé in:
-https://lists.gnu.org/r/bug-gnulib/2018-03/msg00000.html
-* lib/fbufmode.c (fbufmode):
-* lib/fflush.c (clear_ungetc_buffer_preserving_position)
-(disable_seek_optimization, rpl_fflush):
-* lib/fpending.c (__fpending):
-* lib/fpurge.c (fpurge):
-* lib/freadable.c (freadable):
-* lib/freadahead.c (freadahead):
-* lib/freading.c (freading):
-* lib/freadptr.c (freadptr):
-* lib/freadseek.c (freadptrinc):
-* lib/fseeko.c (fseeko):
-* lib/fseterr.c (fseterr):
-* lib/fwritable.c (fwritable):
-* lib/fwriting.c (fwriting):
-Check _IO_EOF_SEEN instead of _IO_ftrylockfile.
-* lib/stdio-impl.h (_IO_IN_BACKUP) [_IO_EOF_SEEN]:
-Define if not already defined.
-
-[yann.morin.1998@free.fr: partially backport from upstream gnulib]
-Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
-
----
- lib/fflush.c     |  6 +++---
- lib/fpending.c   |  2 +-
- lib/fpurge.c     |  2 +-
- lib/freadahead.c |  2 +-
- lib/freading.c   |  2 +-
- lib/fseeko.c     |  4 ++--
- lib/stdio-impl.h |  6 ++++++
- 7 files changed, 15 insertions(+), 9 deletions(-)
-
-diff --git a/lib/fflush.c b/build-aux/gnulib/lib/fflush.c
-index 983ade0ff..a6edfa105 100644
---- a/lib/fflush.c
-+++ b/lib/fflush.c
-@@ -33,7 +33,7 @@
- #undef fflush
- 
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- 
- /* Clear the stream's ungetc buffer, preserving the value of ftello (fp).  */
- static void
-@@ -72,7 +72,7 @@ clear_ungetc_buffer (FILE *fp)
- 
- #endif
- 
--#if ! (defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
-+#if ! (defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
- 
- # if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT
- /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
-@@ -148,7 +148,7 @@ rpl_fflush (FILE *stream)
-   if (stream == NULL || ! freading (stream))
-     return fflush (stream);
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- 
-   clear_ungetc_buffer_preserving_position (stream);
- 
-diff --git a/lib/fpending.c b/build-aux/gnulib/lib/fpending.c
-index c84e3a5b4..789f50e4e 100644
---- a/lib/fpending.c
-+++ b/lib/fpending.c
-@@ -32,7 +32,7 @@ __fpending (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   return fp->_IO_write_ptr - fp->_IO_write_base;
- #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
-   /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
-diff --git a/lib/fpurge.c b/build-aux/gnulib/lib/fpurge.c
-index b1d417c7a..3aedcc373 100644
---- a/lib/fpurge.c
-+++ b/lib/fpurge.c
-@@ -62,7 +62,7 @@ fpurge (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   fp->_IO_read_end = fp->_IO_read_ptr;
-   fp->_IO_write_ptr = fp->_IO_write_base;
-   /* Avoid memory leak when there is an active ungetc buffer.  */
-diff --git a/lib/freadahead.c b/build-aux/gnulib/lib/freadahead.c
-index c2ecb5b28..23ec76ee5 100644
---- a/lib/freadahead.c
-+++ b/lib/freadahead.c
-@@ -30,7 +30,7 @@ extern size_t __sreadahead (FILE *);
- size_t
- freadahead (FILE *fp)
- {
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   if (fp->_IO_write_ptr > fp->_IO_write_base)
-     return 0;
-   return (fp->_IO_read_end - fp->_IO_read_ptr)
-diff --git a/lib/freading.c b/build-aux/gnulib/lib/freading.c
-index 73c28acdd..c24d0c88a 100644
---- a/lib/freading.c
-+++ b/lib/freading.c
-@@ -31,7 +31,7 @@ freading (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   return ((fp->_flags & _IO_NO_WRITES) != 0
-           || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0
-               && fp->_IO_read_base != NULL));
-diff --git a/lib/fseeko.c b/build-aux/gnulib/lib/fseeko.c
-index 0101ab55f..193f4e8ce 100644
---- a/lib/fseeko.c
-+++ b/lib/fseeko.c
-@@ -47,7 +47,7 @@ fseeko (FILE *fp, off_t offset, int whence)
- #endif
- 
-   /* These tests are based on fpurge.c.  */
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   if (fp->_IO_read_end == fp->_IO_read_ptr
-       && fp->_IO_write_ptr == fp->_IO_write_base
-       && fp->_IO_save_base == NULL)
-@@ -123,7 +123,7 @@ fseeko (FILE *fp, off_t offset, int whence)
-           return -1;
-         }
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-       fp->_flags &= ~_IO_EOF_SEEN;
-       fp->_offset = pos;
- #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
-diff --git a/lib/stdio-impl.h b/build-aux/gnulib/lib/stdio-impl.h
-index 78d896e9f..05c5752a2 100644
---- a/lib/stdio-impl.h
-+++ b/lib/stdio-impl.h
-@@ -18,6 +18,12 @@
-    the same implementation of stdio extension API, except that some fields
-    have different naming conventions, or their access requires some casts.  */
- 
-+/* Glibc 2.28 made _IO_IN_BACKUP private.  For now, work around this
-+   problem by defining it ourselves.  FIXME: Do not rely on glibc
-+   internals.  */
-+#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN
-+# define _IO_IN_BACKUP 0x100
-+#endif
- 
- /* BSD stdio derived implementations.  */
- 
--- 
-2.14.1
-
-
diff --git a/srcpkgs/m4/template b/srcpkgs/m4/template
index 78f3dae6184a..762593d883bd 100644
--- a/srcpkgs/m4/template
+++ b/srcpkgs/m4/template
@@ -1,17 +1,17 @@
 # Template file for 'm4'
 pkgname=m4
-version=1.4.18
-revision=2
+version=1.4.19
+revision=1
 bootstrap=yes
-replaces="chroot-m4>=0"
 build_style=gnu-configure
 configure_args="--enable-changeword --enable-threads"
 short_desc="GNU version of UNIX m4 macro language processor"
-homepage="https://www.gnu.org/software/m4/"
-license="GPL-3.0-or-later"
 maintainer="Enno Boland <gottox@voidlinux.org>"
+license="GPL-3.0-or-later"
+homepage="https://www.gnu.org/software/m4/"
 distfiles="${GNU_SITE}/${pkgname}/${pkgname}-${version}.tar.xz"
-checksum=f2c1e86ca0a404ff281631bdc8377638992744b175afb806e25871a24a934e07
+checksum=63aede5c6d33b6d9b13511cd0be2cac046f2e70fd0a07aa9573a04a82783af96
+replaces="chroot-m4>=0"
 
 if [ "$XBPS_TARGET_LIBC" = musl ]; then
 	export ac_cv_lib_error_at_line=no

From 3ab53b2c5b9f2cc3aecb914c6a86b8ea989a8685 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 22:57:59 -0700
Subject: [PATCH 09/51] btrfs-progs: update to 5.19.

---
 srcpkgs/btrfs-progs/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/btrfs-progs/template b/srcpkgs/btrfs-progs/template
index f6c53d8587e1..292d5110106b 100644
--- a/srcpkgs/btrfs-progs/template
+++ b/srcpkgs/btrfs-progs/template
@@ -1,6 +1,6 @@
 # Template file for 'btrfs-progs'
 pkgname=btrfs-progs
-version=5.18.1
+version=5.19
 revision=1
 wrksrc="${pkgname}-v${version}"
 build_style=gnu-configure
@@ -16,7 +16,7 @@ license="GPL-2.0-only, LGPL-2.1-or-later"
 homepage="https://btrfs.wiki.kernel.org/index.php/Main_Page"
 changelog="https://raw.githubusercontent.com/kdave/btrfs-progs/master/CHANGES"
 distfiles="${KERNEL_SITE}/kernel/people/kdave/${pkgname}/${pkgname}-v${version}.tar.xz"
-checksum=6e98a75ccff52e9354daa1ad284c614c490f844273a2fa524cbac9eb841c7255
+checksum=1fbcf06e4b2f80e7a127fd687ed4625a5b74fa674fe212c836ff70e0edfcccf9
 # Most of the tests depend on `mount` and `fallocate` commands, which are not
 # presented in chroot-util-linux
 make_check=no

From 0b31f69343654d13b2c6841eb1a7bc8b2c25dbd4 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 19:39:23 -0700
Subject: [PATCH 10/51] syslinux: fix build for glibc 2.36

---
 .../patches/fix-build-with-glibc-2.36.patch   | 30 +++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 srcpkgs/syslinux/patches/fix-build-with-glibc-2.36.patch

diff --git a/srcpkgs/syslinux/patches/fix-build-with-glibc-2.36.patch b/srcpkgs/syslinux/patches/fix-build-with-glibc-2.36.patch
new file mode 100644
index 000000000000..1303be56c127
--- /dev/null
+++ b/srcpkgs/syslinux/patches/fix-build-with-glibc-2.36.patch
@@ -0,0 +1,30 @@
+--- a/linux/syslinux.c
++++ b/linux/syslinux.c
+@@ -45,7 +45,6 @@
+ #include <sys/stat.h>
+ #include <sys/types.h>
+ #include <sys/wait.h>
+-#include <sys/mount.h>
+ 
+ #include "linuxioctl.h"
+ 
+--- a/libinstaller/syslxcom.c
++++ b/libinstaller/syslxcom.c
+@@ -28,7 +28,6 @@
+ #include <errno.h>
+ #include <sys/stat.h>
+ #include <sys/types.h>
+-#include <sys/mount.h>
+ #include <sys/vfs.h>
+ 
+ #include "linuxioctl.h"
+--- a/extlinux/main.c
++++ b/extlinux/main.c
+@@ -40,7 +40,6 @@
+ #include <sys/stat.h>
+ #include <sys/sysmacros.h>
+ #include <sys/types.h>
+-#include <sys/mount.h>
+ #include <sys/vfs.h>
+ 
+ #include "linuxioctl.h"

From b24663f13d6037435527e82173760a824b71fd10 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 14 Aug 2022 19:29:36 -0700
Subject: [PATCH 11/51] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove -no-pie from build. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..58d94f8dacba 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -60,6 +60,7 @@ _void_cross_build_binutils() {
 		--disable-multilib \
 		--disable-werror \
 		--disable-gold \
+		--disable-gprofng \
 		--enable-relro \
 		--enable-plugins \
 		--enable-64-bit-bfd \
@@ -132,6 +133,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -460,6 +462,14 @@ do_build() {
 	local binutils_ver linux_ver gcc_ver libc_ver libucontext_ver
 	local tgt=${sourcepkg/cross-}
 
+	export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}"
+	export CXXFLAGS="${CXXFLAGS/-D_FORTIFY_SOURCE=2/}"
+
+	# Disable explicit -fno-PIE, gcc/binutils/libc will figure this out itself.
+	export CFLAGS="${CFLAGS//-fno-PIE/}"
+	export CXXFLAGS="${CXXFLAGS//-fno-PIE/}"
+	export LDFLAGS="${LDFLAGS//-no-pie/}"
+
 	_void_cross_test_ver binutils
 	_void_cross_test_ver linux
 	_void_cross_test_ver gcc
@@ -625,6 +635,9 @@ do_install() {
 	# then remove it because it conflicts with libquadmath package
 	rm -rf ${DESTDIR}/${sysroot}/usr/lib/libquadmath.*
 
+	# Remove libdep linker plugin because it conflicts with system binutils
+	rm -f ${DESTDIR}/usr/lib/bfd-plugins/libdep*
+
 	# Remove leftover symlinks
 	rm -f ${DESTDIR}/usr/lib${XBPS_TARGET_WORDSIZE}
 	rm -f ${DESTDIR}/lib*

From 8b80879450e2029f4b9918ced0c55c465ac9535c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:08:52 -0700
Subject: [PATCH 12/51] openssh: suppress werror on gcc12

---
 srcpkgs/openssh/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/openssh/template b/srcpkgs/openssh/template
index 02a2dec35f42..6e8e343a9dca 100644
--- a/srcpkgs/openssh/template
+++ b/srcpkgs/openssh/template
@@ -40,7 +40,7 @@ if [ "$build_option_ldns" -a -z "$build_option_ssl" ]; then
 	broken="option 'ldns' requires option 'ssl'"
 fi
 
-CFLAGS="-Wno-format-truncation -Wno-stringop-truncation"
+CFLAGS="-Wno-format-truncation -Wno-stringop-truncation -Wno-error=maybe-uninitialized"
 
 case $XBPS_TARGET_MACHINE in
 	i686-musl)

From fed76e038312aecf69b383bfa537f9b2d6135bd2 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:09:31 -0700
Subject: [PATCH 13/51] linux5.18: update dotconfigs for gcc12

---
 srcpkgs/linux5.18/files/x86_64-dotconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/linux5.18/files/x86_64-dotconfig b/srcpkgs/linux5.18/files/x86_64-dotconfig
index 4e73a3195d40..ea6204868e23 100644
--- a/srcpkgs/linux5.18/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.18/files/x86_64-dotconfig
@@ -512,6 +512,7 @@ CONFIG_RETHUNK=y
 CONFIG_CPU_UNRET_ENTRY=y
 CONFIG_CPU_IBPB_ENTRY=y
 CONFIG_CPU_IBRS_ENTRY=y
+CONFIG_SLS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10060,8 +10061,11 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
 # Memory initialization
 #
 CONFIG_INIT_STACK_NONE=y
+# CONFIG_INIT_STACK_ALL_PATTERN is not set
+# CONFIG_INIT_STACK_ALL_ZERO is not set
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
+# CONFIG_ZERO_CALL_USED_REGS is not set
 # end of Memory initialization
 # end of Kernel hardening options
 # end of Security options
@@ -10538,6 +10542,7 @@ CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
 # CONFIG_UBSAN is not set
 CONFIG_HAVE_ARCH_KCSAN=y
+# CONFIG_KCSAN is not set
 # end of Generic Kernel Debugging Instruments
 
 #

From fc8183df399c4c36982b612232a9cefb62341669 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 18:00:42 -0700
Subject: [PATCH 14/51] xf86-video-vmware: fix build on gcc12

---
 ...183b3395333d5d4c73e25c2d011748f15eda.patch | 30 +++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch

diff --git a/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch b/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch
new file mode 100644
index 000000000000..ff839f16e628
--- /dev/null
+++ b/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch
@@ -0,0 +1,30 @@
+From 77b8183b3395333d5d4c73e25c2d011748f15eda Mon Sep 17 00:00:00 2001
+From: Rudi Heitbaum <rudi@heitbaum.com>
+Date: Sun, 8 May 2022 03:00:10 +0000
+Subject: [PATCH] vmwgfx: fix missing array notation
+
+ Fixes error identified by gcc-12.1.0 compiler
+
+make
+  CC       libvmwgfx_la-vmwgfx_tex_video.lo
+vmwgfx_tex_video.c: In function 'stop_video':
+vmwgfx_tex_video.c:240:20: error: the comparison will always evaluate as 'true' for the address of 'yuv' will never be NULL [-Werror=address]
+  240 |                if (priv->yuv[i]) {
+      |                    ^~~~
+---
+ vmwgfx/vmwgfx_tex_video.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/vmwgfx/vmwgfx_tex_video.c b/vmwgfx/vmwgfx_tex_video.c
+index acc2b56..480a5f1 100644
+--- a/vmwgfx/vmwgfx_tex_video.c
++++ b/vmwgfx/vmwgfx_tex_video.c
+@@ -237,7 +237,7 @@ stop_video(ScrnInfoPtr pScrn, pointer data, Bool shutdown)
+ 
+        for (i=0; i<3; ++i) {
+ 	   for (j=0; j<2; ++j) {
+-	       if (priv->yuv[i]) {
++	       if (priv->yuv[j][i]) {
+ 		   xa_surface_destroy(priv->yuv[j][i]);
+ 		   priv->yuv[j][i] = NULL;
+ 	       }

From 4bee6a00b80789ba8d842b99930d5d4413d414e9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 18:24:37 -0700
Subject: [PATCH 15/51] doxygen: fix build for gcc 12

---
 srcpkgs/doxygen/patches/compat-gcc12.patch | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100644 srcpkgs/doxygen/patches/compat-gcc12.patch

diff --git a/srcpkgs/doxygen/patches/compat-gcc12.patch b/srcpkgs/doxygen/patches/compat-gcc12.patch
new file mode 100644
index 000000000000..666744a1dceb
--- /dev/null
+++ b/srcpkgs/doxygen/patches/compat-gcc12.patch
@@ -0,0 +1,22 @@
+From 5198966c8d5fec89116d025c74934ac03ea511fa Mon Sep 17 00:00:00 2001
+From: Dimitri van Heesch <doxygen@gmail.com>
+Date: Fri, 6 May 2022 09:55:16 +0200
+Subject: [PATCH] issue #9312: Build: cache.h:53:14: error: 'exchange' is not a
+ member of 'std'
+
+---
+ src/cache.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/cache.h b/src/cache.h
+index 0ff3092ed5..e218eb27d2 100644
+--- a/src/cache.h
++++ b/src/cache.h
+@@ -19,6 +19,7 @@
+ #include <list>
+ #include <unordered_map>
+ #include <mutex>
++#include <utility>
+ #include <ctype.h>
+ 
+ /*! Fixed size cache for value type V using keys of type K.

From dcb2c5ae5db0b9bd7d8bbe53fb831d0fa8e9126d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 21 Aug 2022 15:12:00 -0700
Subject: [PATCH 16/51] libproxy: update to 0.4.18

---
 srcpkgs/libproxy/template | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/libproxy/template b/srcpkgs/libproxy/template
index d6103007032e..6599dfb69b98 100644
--- a/srcpkgs/libproxy/template
+++ b/srcpkgs/libproxy/template
@@ -1,18 +1,22 @@
 # Template file for 'libproxy'
 pkgname=libproxy
-version=0.4.15
+version=0.4.18
 revision=1
 build_style=cmake
 configure_args="-DWITH_GNOME=0 -DWITH_KDE4=0 -DWITH_MOZJS=0 -DWITH_NM=0
  -DWITH_PERL=0 -DWITH_PYTHON=1 -DWITH_WEBKIT=0"
 hostmakedepends="pkg-config python"
 makedepends="zlib-devel"
-short_desc="A library handling all the details of proxy configuration"
+short_desc="Library handling all the details of proxy configuration"
 maintainer="Orphaned <orphan@voidlinux.org>"
+license="LGPL-2.1-or-later"
 homepage="http://github.com/libproxy/libproxy"
-license="LGPL-2.1"
-distfiles="https://github.com/libproxy/libproxy/archive/${version}.tar.gz>${pkgname}-${version}.tar.gz"
-checksum=18f58b0a0043b6881774187427ead158d310127fc46a1c668ad6d207fb28b4e0
+distfiles="https://github.com/libproxy/libproxy/archive/${version}.tar.gz"
+checksum=0b4a9218d88f6cf9fa25996a3f38329a11f688a9d026141d9d0e966d8fa63837
+
+post_patch() {
+	vsed '/add_test(NAME url-test/d' -i libproxy/test/CMakeLists.txt
+}
 
 libproxy-devel_package() {
 	depends="libproxy>=${version}_${revision}"

From cb9d67039d82ced75ff8ca5af0a8a0891213ec66 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 21 Aug 2022 17:05:39 -0700
Subject: [PATCH 17/51] exempi: update to 2.6.2

---
 ...f034705fd2d032c81383eee8208fd4eee0ac.patch | 43 -------------------
 srcpkgs/exempi/template                       |  4 +-
 2 files changed, 2 insertions(+), 45 deletions(-)
 delete mode 100644 srcpkgs/exempi/patches/8ed2f034705fd2d032c81383eee8208fd4eee0ac.patch

diff --git a/srcpkgs/exempi/patches/8ed2f034705fd2d032c81383eee8208fd4eee0ac.patch b/srcpkgs/exempi/patches/8ed2f034705fd2d032c81383eee8208fd4eee0ac.patch
deleted file mode 100644
index 2696793cec09..000000000000
--- a/srcpkgs/exempi/patches/8ed2f034705fd2d032c81383eee8208fd4eee0ac.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From 8ed2f034705fd2d032c81383eee8208fd4eee0ac Mon Sep 17 00:00:00 2001
-From: Victor Rodriguez <victor.rodriguez.bahena@intel.com>
-Date: Sat, 18 Aug 2018 13:54:55 +0000
-Subject: [PATCH] Issue #9 - Fix null-pointer-dereference (CVE-2018-12648)
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-The WEBP::GetLE32 function in
-XMPFiles/source/FormatSupport/WEBP_Support.hpp in Exempi 2.4.5 has a
-NULL pointer dereference.
-
-https://bugs.freedesktop.org/show_bug.cgi?id=106981
-https://gitlab.freedesktop.org/libopenraw/exempi/issues/9
-
-Signed-off-by: Victor Rodriguez <victor.rodriguez.bahena@intel.com>
-Signed-off-by: Hubert Figuière <hub@figuiere.net>
----
- XMPFiles/source/FormatSupport/WEBP_Support.cpp | 8 +++++---
- 1 file changed, 5 insertions(+), 3 deletions(-)
-
-diff --git a/XMPFiles/source/FormatSupport/WEBP_Support.cpp b/XMPFiles/source/FormatSupport/WEBP_Support.cpp
-index ffaf220..4fe705b 100644
---- a/XMPFiles/source/FormatSupport/WEBP_Support.cpp
-+++ b/XMPFiles/source/FormatSupport/WEBP_Support.cpp
-@@ -160,9 +160,11 @@ bool VP8XChunk::xmp()
- }
- void VP8XChunk::xmp(bool hasXMP)
- {
--    XMP_Uns32 flags = GetLE32(&this->data[0]);
--    flags ^= (-hasXMP ^ flags) & (1 << XMP_FLAG_BIT);
--    PutLE32(&this->data[0], flags);
-+    if (&this->data[0] != NULL) {
-+        XMP_Uns32 flags = GetLE32(&this->data[0]);
-+        flags ^= (-hasXMP ^ flags) & (1 << XMP_FLAG_BIT);
-+        PutLE32(&this->data[0], flags);
-+    }
- }
- 
- Container::Container(WEBP_MetaHandler* handler) : Chunk(NULL, handler)
--- 
-2.18.0
-
diff --git a/srcpkgs/exempi/template b/srcpkgs/exempi/template
index 14753617953a..d664f7dc4d80 100644
--- a/srcpkgs/exempi/template
+++ b/srcpkgs/exempi/template
@@ -1,6 +1,6 @@
 # Template file for 'exempi'
 pkgname=exempi
-version=2.5.0
+version=2.6.2
 revision=1
 build_style=gnu-configure
 configure_args="--with-boost=${XBPS_CROSS_BASE}/usr --disable-static --disable-unittest"
@@ -10,7 +10,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="BSD-3-Clause"
 homepage="https://libopenraw.freedesktop.org/wiki/Exempi"
 distfiles="https://libopenraw.freedesktop.org/download/exempi-${version}.tar.bz2"
-checksum=dc82fc24c0540a44a63fa4ad21775d24e00e63f1dedd3e2ae6f7aa27583b711b
+checksum=4d17d4c93df2a95da3e3172c45b7a5bf317dd31dafd1c7a340169728c7089d1d
 
 post_install() {
 	vlicense COPYING

From 6d7fb11cddb954ba9f9239f47e19b5706aa04747 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 21 Aug 2022 21:36:03 -0700
Subject: [PATCH 18/51] plymouth: update to 22.02.122

---
 srcpkgs/plymouth/patches/fix-glibc-2.36.patch | 30 +++++++++++++++++++
 srcpkgs/plymouth/template                     |  4 +--
 2 files changed, 32 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/plymouth/patches/fix-glibc-2.36.patch

diff --git a/srcpkgs/plymouth/patches/fix-glibc-2.36.patch b/srcpkgs/plymouth/patches/fix-glibc-2.36.patch
new file mode 100644
index 000000000000..2f1e43875cfb
--- /dev/null
+++ b/srcpkgs/plymouth/patches/fix-glibc-2.36.patch
@@ -0,0 +1,30 @@
+From 5f1e43c00039a7fe1fff768b91a05a695fb4a53d Mon Sep 17 00:00:00 2001
+From: Ray Strode <rstrode@redhat.com>
+Date: Wed, 3 Aug 2022 15:23:33 -0400
+Subject: [PATCH] ply-utils: Drop linux/fs.h include
+
+It was needed long ago for a function we no longer even have.
+
+Now it's causing compile errors on Fedora 37 because it's conflicting
+with sys/mount.h.
+
+This commit drops it.
+---
+ src/libply/ply-utils.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/src/libply/ply-utils.c b/src/libply/ply-utils.c
+index c7b165e9..219e2e77 100644
+--- a/src/libply/ply-utils.c
++++ b/src/libply/ply-utils.c
+@@ -46,7 +46,6 @@
+ #include <sys/user.h>
+ #include <sys/wait.h>
+ #include <time.h>
+-#include <linux/fs.h>
+ #include <linux/vt.h>
+ 
+ #include <dlfcn.h>
+-- 
+GitLab
+
diff --git a/srcpkgs/plymouth/template b/srcpkgs/plymouth/template
index 17f801fc5315..442ab58a99cd 100644
--- a/srcpkgs/plymouth/template
+++ b/srcpkgs/plymouth/template
@@ -1,6 +1,6 @@
 # Template file for 'plymouth'
 pkgname=plymouth
-version=0.9.5
+version=22.02.122
 revision=1
 build_style=gnu-configure
 configure_args="--with-system-root-install=no \
@@ -18,7 +18,7 @@ maintainer="William OD <obirik2005@gmail.com>"
 license="GPL-2.0-or-later"
 homepage="https://www.freedesktop.org/wiki/Software/Plymouth/"
 distfiles="${FREEDESKTOP_SITE}/plymouth/releases/$pkgname-$version.tar.xz"
-checksum=ecae257f351d098340542a5bc06de029404c24dcee87e6ebb2abd5ef117fce86
+checksum=100551442221033ce868c447ad6c74d831d209c18ae232b98ae0207e34eadaeb
 
 build_options="gtk3 pango"
 build_options_default="gtk3 pango"

From 406daf3ad20a00a9effd228dceec7165b1516f39 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 21 Aug 2022 21:37:00 -0700
Subject: [PATCH 19/51] openjdk7-bootstrap: fix build for gcc12

---
 .../files/dist_patches_glibc.txt              |  1 +
 .../files/dist_patches_musl.txt               |  1 +
 .../icedtea-pointer-comparison-gcc12.patch    | 31 +++++++++++++++++++
 3 files changed, 33 insertions(+)
 create mode 100644 srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch

diff --git a/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt b/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt
index c76c56855441..8061756dfc0c 100644
--- a/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt
+++ b/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt
@@ -6,3 +6,4 @@ icedtea-jdk-no-soname.patch
 icedtea-jdk-xattr.patch
 icedtea-jdk-sysctl_h.patch
 icedtea-cpio.patch
+icedtea-pointer-comparison-gcc12.patch
diff --git a/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt b/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt
index 21812517c7c2..8b35d9c46989 100644
--- a/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt
+++ b/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt
@@ -11,3 +11,4 @@ icedtea-jdk-musl.patch
 icedtea-jdk-no-soname.patch
 icedtea-jdk-xattr.patch
 icedtea-cpio.patch
+icedtea-pointer-comparison-gcc12.patch
diff --git a/srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch b/srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch
new file mode 100644
index 000000000000..c809553443e7
--- /dev/null
+++ b/srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch
@@ -0,0 +1,31 @@
+--- openjdk.orig/hotspot/src/share/vm/opto/lcm.cpp
++++ openjdk/hotspot/src/share/vm/opto/lcm.cpp
+@@ -60,7 +60,7 @@
+ // Check whether val is not-null-decoded compressed oop,
+ // i.e. will grab into the base of the heap if it represents NULL.
+ static bool accesses_heap_base_zone(Node *val) {
+-  if (Universe::narrow_oop_base() > 0) { // Implies UseCompressedOops.
++  if (Universe::narrow_oop_base() > (address)0) { // Implies UseCompressedOops.
+     if (val && val->is_Mach()) {
+       if (val->as_Mach()->ideal_Opcode() == Op_DecodeN) {
+         // This assumes all Decodes with TypePtr::NotNull are matched to nodes that
+--- openjdk.orig/hotspot/src/share/vm/runtime/virtualspace.cpp
++++ openjdk/hotspot/src/share/vm/runtime/virtualspace.cpp
+@@ -527,7 +527,7 @@ ReservedHeapSpace::ReservedHeapSpace(siz
+                 (UseCompressedOops && (Universe::narrow_oop_base() != NULL) &&
+                  Universe::narrow_oop_use_implicit_null_checks()) ?
+                   lcm(os::vm_page_size(), alignment) : 0) {
+-  if (base() > 0) {
++  if (base() > (char*)0) {
+     MemTracker::record_virtual_memory_type((address)base(), mtJavaHeap);
+   }
+ 
+@@ -546,7 +546,7 @@ ReservedHeapSpace::ReservedHeapSpace(con
+                 (UseCompressedOops && (Universe::narrow_oop_base() != NULL) &&
+                  Universe::narrow_oop_use_implicit_null_checks()) ?
+                   lcm(os::vm_page_size(), prefix_align) : 0) {
+-  if (base() > 0) {
++  if (base() > (char*)0) {
+     MemTracker::record_virtual_memory_type((address)base(), mtJavaHeap);
+   }
+ 

From fcb1ebb9fe78ef3e6cdf7167b12a720c57bfb8c1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:39:52 -0700
Subject: [PATCH 20/51] libvirt: fix build for glibc 2.36

---
 .../patches/lxc-fix-compat-glibc-2.36.patch   | 34 ++++++++++++++++
 .../virfile-fix-compat-glibc-2.36.patch       | 39 +++++++++++++++++++
 2 files changed, 73 insertions(+)
 create mode 100644 srcpkgs/libvirt/patches/lxc-fix-compat-glibc-2.36.patch
 create mode 100644 srcpkgs/libvirt/patches/virfile-fix-compat-glibc-2.36.patch

diff --git a/srcpkgs/libvirt/patches/lxc-fix-compat-glibc-2.36.patch b/srcpkgs/libvirt/patches/lxc-fix-compat-glibc-2.36.patch
new file mode 100644
index 000000000000..d85b57815010
--- /dev/null
+++ b/srcpkgs/libvirt/patches/lxc-fix-compat-glibc-2.36.patch
@@ -0,0 +1,34 @@
+From 9493c9b79dc541ec9e0fd73c6d87bdf8d30aaa90 Mon Sep 17 00:00:00 2001
+From: Cole Robinson <crobinso@redhat.com>
+Date: Mon, 1 Aug 2022 15:20:38 -0400
+Subject: [PATCH] lxc: containter: fix build with glibc 2.36
+
+With glibc 2.36, sys/mount.h and linux/mount.h conflict:
+https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
+
+lxc_container.c imports sys/mount.h and linux/fs.h, which pulls in
+linux/mount.h.
+
+linux/fs.h isn't required here though. glibc sys/mount.h has had
+MS_MOVE since 2.12 in 2010
+
+Reviewed-by: Erik Skultety <eskultet@redhat.com>
+Signed-off-by: Cole Robinson <crobinso@redhat.com>
+---
+ src/lxc/lxc_container.c | 3 ---
+ 1 file changed, 3 deletions(-)
+
+diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
+index b5278831da7..a5401c2186e 100644
+--- a/src/lxc/lxc_container.c
++++ b/src/lxc/lxc_container.c
+@@ -33,9 +33,6 @@
+ /* Yes, we want linux private one, for _syscall2() macro */
+ #include <linux/unistd.h>
+ 
+-/* For MS_MOVE */
+-#include <linux/fs.h>
+-
+ #if WITH_CAPNG
+ # include <cap-ng.h>
+ #endif
diff --git a/srcpkgs/libvirt/patches/virfile-fix-compat-glibc-2.36.patch b/srcpkgs/libvirt/patches/virfile-fix-compat-glibc-2.36.patch
new file mode 100644
index 000000000000..2ef227ea9b54
--- /dev/null
+++ b/srcpkgs/libvirt/patches/virfile-fix-compat-glibc-2.36.patch
@@ -0,0 +1,39 @@
+From c0d9adf220dc0d223330a7bac37b174132d330ba Mon Sep 17 00:00:00 2001
+From: Cole Robinson <crobinso@redhat.com>
+Date: Mon, 1 Aug 2022 15:24:01 -0400
+Subject: [PATCH] virfile: Fix build with glibc 2.36
+
+With glibc 2.36, sys/mount.h and linux/mount.h conflict:
+https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
+
+virfile.c imports sys/mount.h and linux/fs.h, which pulls in
+linux/mount.h.
+
+Manually define the constants we need from linux/fs.h, like was
+done in llvm:
+
+https://reviews.llvm.org/rGb379129c4beb3f26223288627a1291739f33af02
+
+Reviewed-by: Erik Skultety <eskultet@redhat.com>
+Signed-off-by: Cole Robinson <crobinso@redhat.com>
+---
+ src/util/virfile.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/src/util/virfile.c b/src/util/virfile.c
+index 99da058db3b..ce541b8946b 100644
+--- a/src/util/virfile.c
++++ b/src/util/virfile.c
+@@ -71,7 +71,11 @@
+ # endif
+ # include <sys/ioctl.h>
+ # include <linux/cdrom.h>
+-# include <linux/fs.h>
++/* These come from linux/fs.h, but that header conflicts with
++ * sys/mount.h on glibc 2.36+ */
++# define FS_IOC_GETFLAGS _IOR('f', 1, long)
++# define FS_IOC_SETFLAGS _IOW('f', 2, long)
++# define FS_NOCOW_FL 0x00800000
+ #endif
+ 
+ #if WITH_LIBATTR

From fa67d8df6eba1a590a09ab2abc3e5a7f19de59a7 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:41:50 -0700
Subject: [PATCH 21/51] efivar: fix build for glibc 2.36

---
 .../patches/fix-compat-glibc-2.36.patch       | 55 +++++++++++++++++++
 1 file changed, 55 insertions(+)
 create mode 100644 srcpkgs/efivar/patches/fix-compat-glibc-2.36.patch

diff --git a/srcpkgs/efivar/patches/fix-compat-glibc-2.36.patch b/srcpkgs/efivar/patches/fix-compat-glibc-2.36.patch
new file mode 100644
index 000000000000..fcc83aef20cf
--- /dev/null
+++ b/srcpkgs/efivar/patches/fix-compat-glibc-2.36.patch
@@ -0,0 +1,55 @@
+From bc65d63ebf8fe6ac8a099ff15ca200986dba1565 Mon Sep 17 00:00:00 2001
+From: Robbie Harwood <rharwood@redhat.com>
+Date: Thu, 28 Jul 2022 16:11:24 -0400
+Subject: [PATCH] Fix glibc 2.36 build (mount.h conflicts)
+
+glibc has decided that sys/mount.h and linux/mount.h are no longer
+usable at the same time.  This broke the build, since linux/fs.h itself
+includes linux/mount.h.  For now, fix the build by only including
+sys/mount.h where we need it.
+
+See-also: https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
+Resolves: #227
+Signed-off-by: Robbie Harwood <rharwood@redhat.com>
+---
+ src/gpt.c   | 1 +
+ src/linux.c | 1 +
+ src/util.h  | 1 -
+ 3 files changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/gpt.c b/src/gpt.c
+index 1eda0497..21413c3b 100644
+--- a/src/gpt.c
++++ b/src/gpt.c
+@@ -17,6 +17,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <sys/mount.h>
+ #include <sys/param.h>
+ #include <sys/stat.h>
+ #include <sys/utsname.h>
+diff --git a/src/linux.c b/src/linux.c
+index 47e45ae4..1780816f 100644
+--- a/src/linux.c
++++ b/src/linux.c
+@@ -20,6 +20,7 @@
+ #include <stdbool.h>
+ #include <stdio.h>
+ #include <sys/ioctl.h>
++#include <sys/mount.h>
+ #include <sys/socket.h>
+ #include <sys/sysmacros.h>
+ #include <sys/types.h>
+diff --git a/src/util.h b/src/util.h
+index 3300666f..1e67e447 100644
+--- a/src/util.h
++++ b/src/util.h
+@@ -23,7 +23,6 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <sys/ioctl.h>
+-#include <sys/mount.h>
+ #include <sys/stat.h>
+ #include <sys/types.h>
+ #include <tgmath.h>

From 7751b7b98455cf698483120995fc3d5f698929bf Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:43:24 -0700
Subject: [PATCH 22/51] libwpd: fix build for gcc12

---
 srcpkgs/libwpd/patches/fix-compat-gcc12.patch | 11 +++++++++++
 1 file changed, 11 insertions(+)
 create mode 100644 srcpkgs/libwpd/patches/fix-compat-gcc12.patch

diff --git a/srcpkgs/libwpd/patches/fix-compat-gcc12.patch b/srcpkgs/libwpd/patches/fix-compat-gcc12.patch
new file mode 100644
index 000000000000..6ebce2463d16
--- /dev/null
+++ b/srcpkgs/libwpd/patches/fix-compat-gcc12.patch
@@ -0,0 +1,11 @@
+diff -rup libwpd-0.10.3.orig/src/lib/WPXTable.h libwpd-0.10.3/src/lib/WPXTable.h
+--- libwpd-0.10.3.orig/src/lib/WPXTable.h	2022-08-23 22:32:45.332593795 -0700
++++ libwpd-0.10.3/src/lib/WPXTable.h	2022-08-23 22:32:59.500651211 -0700
+@@ -37,6 +37,7 @@
+ #define _WPXTABLE_H
+ 
+ #include <vector>
++#include <cstddef>
+ 
+ struct WPXTableCell
+ {

From 0308ad6074d8fd4a7be8c248216dd61ac05f142e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:44:07 -0700
Subject: [PATCH 23/51] grub: fix build for binutils 2.36

---
 .../patches/fix-compat-binutils-2.36.patch    | 96 +++++++++++++++++++
 srcpkgs/grub/template                         |  7 +-
 2 files changed, 102 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/grub/patches/fix-compat-binutils-2.36.patch

diff --git a/srcpkgs/grub/patches/fix-compat-binutils-2.36.patch b/srcpkgs/grub/patches/fix-compat-binutils-2.36.patch
new file mode 100644
index 000000000000..d92a91e3253e
--- /dev/null
+++ b/srcpkgs/grub/patches/fix-compat-binutils-2.36.patch
@@ -0,0 +1,96 @@
+From b98275138bf4fc250a1c362dfd2c8b1cf2421701 Mon Sep 17 00:00:00 2001
+From: Michael Chang <mchang@suse.com>
+Date: Tue, 28 Sep 2021 13:50:47 +0800
+Subject: build: Fix build error with binutils 2.36
+
+The following procedure to build xen/pvgrub is broken.
+
+  git clone https://git.savannah.gnu.org/git/grub.git
+  cd grub
+  ./bootstrap
+  mkdir build-xen
+  cd build-xen
+  ../configure --with-platform=xen
+  make
+
+It fails with the message:
+
+  /usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld:
+  section .note.gnu.property VMA [0000000000400158,0000000000400187]
+  overlaps section .bss VMA [000000000000f000,000000000041e1af]
+
+The most significant factor is that new assembler (GNU as) generates the
+.note.gnu.property section as default. This note section overlaps with
+.bss because it doesn't reposition with -Wl,-Ttext,0 with which the base
+address of .text section is set, rather the address of .note.gnu.property
+is calculated for some reason from 0x400000 where the ELF executable
+defaults to start.
+
+Using -Ttext-segment doesn't help either, though it is said to set the
+address of the first byte of the text segment according to "man ld".
+What it actually does is to override the default 0x400000, aka the image
+base address, to something else. The entire process can be observed in
+the default linker script used by gcc [1]. Therefore we can't expect it
+to achieve the same thing as -Ttext given that the first segment where
+.text resides is offset by SIZEOF_HEADERS plus some sections may be
+preceding it within the first segment. The end result is .text always
+has to start with non-zero address with -Wl,-Ttext-segment,0 if using
+default linker script.
+
+It is also worth mentioning that binutils upstream apparently doesn't
+seem to consider this as a bug [2] and proposed to use -Wl,-Ttext-segment,0
+which is not fruitful as what has been tested by Gentoo [3].
+
+As long as GRUB didn't use ISA information encoded in .note.gnu.property,
+we can safely drop it via -Wa,-mx86-used-note=no assembler option to
+fix the linker error above.
+
+This is considered a better approach than using custom linker script to
+drop the .note.gnu.property section because object file manipulation can
+also be hampered one way or the other in that linker script may not be
+helpful. See also this commit removing the section in the process of objcopy.
+
+  6643507ce build: Fix GRUB i386-pc build with Ubuntu gcc
+
+[1] In /usr/lib64/ldscripts/elf_x86_64.x or use 'gcc -Wl,--verbose ...'
+    PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x400000));
+    . = SEGMENT_START("text-segment", 0x400000) + SIZEOF_HEADERS;
+[2] https://sourceware.org/bugzilla/show_bug.cgi?id=27377
+[3] https://bugs.gentoo.org/787221
+
+Signed-off-by: Michael Chang <mchang@suse.com>
+Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
+---
+ configure.ac | 14 ++++++++++++++
+ 1 file changed, 14 insertions(+)
+
+(limited to 'configure.ac')
+
+diff --git a/configure.ac b/configure.ac
+index eeb5d22..8d1c81a 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -840,6 +840,20 @@ if ( test "x$target_cpu" = xi386 || test "x$target_cpu" = xx86_64 ) && test "x$p
+   TARGET_CFLAGS="$TARGET_CFLAGS -mno-mmx -mno-sse -mno-sse2 -mno-sse3 -mno-3dnow"
+ fi
+ 
++if ( test "x$target_cpu" = xi386 || test "x$target_cpu" = xx86_64 ); then
++  AC_CACHE_CHECK([whether -Wa,-mx86-used-note works], [grub_cv_cc_mx86_used_note], [
++    CFLAGS="$TARGET_CFLAGS -Wa,-mx86-used-note=no -Werror"
++    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
++	[grub_cv_cc_mx86_used_note=yes],
++	[grub_cv_cc_mx86_used_note=no])
++  ])
++
++  if test "x$grub_cv_cc_mx86_used_note" = xyes; then
++    TARGET_CFLAGS="$TARGET_CFLAGS -Wa,-mx86-used-note=no"
++    TARGET_CCASFLAGS="$TARGET_CCASFLAGS -Wa,-mx86-used-note=no"
++  fi
++fi
++
+ # GRUB doesn't use float or doubles at all. Yet some toolchains may decide
+ # that floats are a good fit to run instead of what's written in the code.
+ # Given that floating point unit is disabled (if present to begin with)
+-- 
+cgit v1.1
+
diff --git a/srcpkgs/grub/template b/srcpkgs/grub/template
index b1826c38a884..b4d3b07af620 100644
--- a/srcpkgs/grub/template
+++ b/srcpkgs/grub/template
@@ -2,7 +2,8 @@
 pkgname=grub
 version=2.06
 revision=2
-hostmakedepends="python3 pkg-config flex freetype-devel font-unifont-bdf help2man"
+hostmakedepends="python3 pkg-config flex freetype-devel font-unifont-bdf help2man
+ automake gettext-devel-tools"
 makedepends="libusb-compat-devel ncurses-devel freetype-devel
  liblzma-devel device-mapper-devel fuse-devel"
 depends="os-prober"
@@ -43,6 +44,10 @@ case "$XBPS_TARGET_MACHINE" in
 		;;
 esac
 
+pre_configure() {
+	autoreconf -fi
+}
+
 do_configure() {
 	# workaround for https://savannah.gnu.org/bugs/?60458
 	# some more info: https://www.linuxquestions.org/questions/showthread.php?p=6257712

From 261ed7a1995a79102c82a795bf26640493a6fdd6 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:45:07 -0700
Subject: [PATCH 24/51] linux-toos: fix build for binutils 2.39

---
 .../patches/binutils-add-compat-check.patch   | 103 ++++++++++++
 .../patches/binutils-disasm-compat.patch      | 102 ++++++++++++
 .../bpf_jit_disasm-binutils-2.39.patch        | 104 ++++++++++++
 .../patches/bpftool-binutils-2.39.patch       | 149 ++++++++++++++++++
 .../patches/perf-binutils-2.39.patch          | 114 ++++++++++++++
 5 files changed, 572 insertions(+)
 create mode 100644 srcpkgs/linux-tools/patches/binutils-add-compat-check.patch
 create mode 100644 srcpkgs/linux-tools/patches/binutils-disasm-compat.patch
 create mode 100644 srcpkgs/linux-tools/patches/bpf_jit_disasm-binutils-2.39.patch
 create mode 100644 srcpkgs/linux-tools/patches/bpftool-binutils-2.39.patch
 create mode 100644 srcpkgs/linux-tools/patches/perf-binutils-2.39.patch

diff --git a/srcpkgs/linux-tools/patches/binutils-add-compat-check.patch b/srcpkgs/linux-tools/patches/binutils-add-compat-check.patch
new file mode 100644
index 000000000000..e4e7ece9635e
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/binutils-add-compat-check.patch
@@ -0,0 +1,103 @@
+From cfd59ca91467056bb2c36907b2fa67b8e1af9952 Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:27 -0700
+Subject: [PATCH] tools build: Add feature test for init_disassemble_info API
+ changes
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation failures for tools/{perf,bpf}, e.g. on debian unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+This commit adds a feature test to detect the new signature.  Subsequent
+commits will use it to fix the build failures.
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Quentin Monnet <quentin@isovalent.com>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-2-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/build/Makefile.feature                        |  1 +
+ tools/build/feature/Makefile                        |  4 ++++
+ tools/build/feature/test-all.c                      |  4 ++++
+ tools/build/feature/test-disassembler-init-styled.c | 13 +++++++++++++
+ 4 files changed, 22 insertions(+)
+ create mode 100644 tools/build/feature/test-disassembler-init-styled.c
+
+diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature
+index 888a0421d43b96..8f6578e4d3249e 100644
+--- a/tools/build/Makefile.feature
++++ b/tools/build/Makefile.feature
+@@ -70,6 +70,7 @@ FEATURE_TESTS_BASIC :=                  \
+         libaio				\
+         libzstd				\
+         disassembler-four-args		\
++        disassembler-init-styled	\
+         file-handle
+ 
+ # FEATURE_TESTS_BASIC + FEATURE_TESTS_EXTRA is the complete list
+diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile
+index 7c2a17e23c30ac..c3059739318a95 100644
+--- a/tools/build/feature/Makefile
++++ b/tools/build/feature/Makefile
+@@ -18,6 +18,7 @@ FILES=                                          \
+          test-libbfd.bin                        \
+          test-libbfd-buildid.bin		\
+          test-disassembler-four-args.bin        \
++         test-disassembler-init-styled.bin	\
+          test-reallocarray.bin			\
+          test-libbfd-liberty.bin                \
+          test-libbfd-liberty-z.bin              \
+@@ -248,6 +249,9 @@ $(OUTPUT)test-libbfd-buildid.bin:
+ $(OUTPUT)test-disassembler-four-args.bin:
+ 	$(BUILD) -DPACKAGE='"perf"' -lbfd -lopcodes
+ 
++$(OUTPUT)test-disassembler-init-styled.bin:
++	$(BUILD) -DPACKAGE='"perf"' -lbfd -lopcodes
++
+ $(OUTPUT)test-reallocarray.bin:
+ 	$(BUILD)
+ 
+diff --git a/tools/build/feature/test-all.c b/tools/build/feature/test-all.c
+index 5ffafb967b6e49..957c02c7b163b5 100644
+--- a/tools/build/feature/test-all.c
++++ b/tools/build/feature/test-all.c
+@@ -166,6 +166,10 @@
+ # include "test-disassembler-four-args.c"
+ #undef main
+ 
++#define main main_test_disassembler_init_styled
++# include "test-disassembler-init-styled.c"
++#undef main
++
+ #define main main_test_libzstd
+ # include "test-libzstd.c"
+ #undef main
+diff --git a/tools/build/feature/test-disassembler-init-styled.c b/tools/build/feature/test-disassembler-init-styled.c
+new file mode 100644
+index 00000000000000..f1ce0ec3bee9d3
+--- /dev/null
++++ b/tools/build/feature/test-disassembler-init-styled.c
+@@ -0,0 +1,13 @@
++// SPDX-License-Identifier: GPL-2.0
++#include <stdio.h>
++#include <dis-asm.h>
++
++int main(void)
++{
++	struct disassemble_info info;
++
++	init_disassemble_info(&info, stdout,
++			      NULL, NULL);
++
++	return 0;
++}
diff --git a/srcpkgs/linux-tools/patches/binutils-disasm-compat.patch b/srcpkgs/linux-tools/patches/binutils-disasm-compat.patch
new file mode 100644
index 000000000000..1a6cc0e6d97c
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/binutils-disasm-compat.patch
@@ -0,0 +1,102 @@
+From a45b3d6926231c3d024ea0de4f7bd967f83709ee Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:29 -0700
+Subject: tools include: add dis-asm-compat.h to handle version differences
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation failures for tools/{perf,bpf}, e.g. on debian unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+This commit introduces a wrapper for init_disassemble_info(), to avoid
+spreading #ifdef DISASM_INIT_STYLED to a bunch of places. Subsequent
+commits will use it to fix the build failures.
+
+It likely is worth adding a wrapper for disassember(), to avoid the already
+existing DISASM_FOUR_ARGS_SIGNATURE ifdefery.
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Signed-off-by: Ben Hutchings <benh@debian.org>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Quentin Monnet <quentin@isovalent.com>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-4-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/include/tools/dis-asm-compat.h | 55 ++++++++++++++++++++++++++++++++++++
+ 1 file changed, 55 insertions(+)
+ create mode 100644 tools/include/tools/dis-asm-compat.h
+
+(limited to 'tools/include/tools/dis-asm-compat.h')
+
+diff --git a/tools/include/tools/dis-asm-compat.h b/tools/include/tools/dis-asm-compat.h
+new file mode 100644
+index 0000000000000..70f331e23ed3d
+--- /dev/null
++++ b/tools/include/tools/dis-asm-compat.h
+@@ -0,0 +1,55 @@
++/* SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause */
++#ifndef _TOOLS_DIS_ASM_COMPAT_H
++#define _TOOLS_DIS_ASM_COMPAT_H
++
++#include <stdio.h>
++#include <dis-asm.h>
++
++/* define types for older binutils version, to centralize ifdef'ery a bit */
++#ifndef DISASM_INIT_STYLED
++enum disassembler_style {DISASSEMBLER_STYLE_NOT_EMPTY};
++typedef int (*fprintf_styled_ftype) (void *, enum disassembler_style, const char*, ...);
++#endif
++
++/*
++ * Trivial fprintf wrapper to be used as the fprintf_styled_func argument to
++ * init_disassemble_info_compat() when normal fprintf suffices.
++ */
++static inline int fprintf_styled(void *out,
++				 enum disassembler_style style,
++				 const char *fmt, ...)
++{
++	va_list args;
++	int r;
++
++	(void)style;
++
++	va_start(args, fmt);
++	r = vfprintf(out, fmt, args);
++	va_end(args);
++
++	return r;
++}
++
++/*
++ * Wrapper for init_disassemble_info() that hides version
++ * differences. Depending on binutils version and architecture either
++ * fprintf_func or fprintf_styled_func will be called.
++ */
++static inline void init_disassemble_info_compat(struct disassemble_info *info,
++						void *stream,
++						fprintf_ftype unstyled_func,
++						fprintf_styled_ftype styled_func)
++{
++#ifdef DISASM_INIT_STYLED
++	init_disassemble_info(info, stream,
++			      unstyled_func,
++			      styled_func);
++#else
++	(void)styled_func;
++	init_disassemble_info(info, stream,
++			      unstyled_func);
++#endif
++}
++
++#endif /* _TOOLS_DIS_ASM_COMPAT_H */
+-- 
+cgit 
+
diff --git a/srcpkgs/linux-tools/patches/bpf_jit_disasm-binutils-2.39.patch b/srcpkgs/linux-tools/patches/bpf_jit_disasm-binutils-2.39.patch
new file mode 100644
index 000000000000..01221fad3a4a
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/bpf_jit_disasm-binutils-2.39.patch
@@ -0,0 +1,104 @@
+From 96ed066054abf11c7d3e106e3011a51f3f1227a3 Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:31 -0700
+Subject: [PATCH] tools bpf_jit_disasm: Fix compilation error with new binutils
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation to fail for tools/bpf/bpf_jit_disasm.c, e.g. on debian
+unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+Wire up the feature test and switch to init_disassemble_info_compat(),
+which were introduced in prior commits, fixing the compilation failure.
+
+I verified that bpf_jit_disasm can still disassemble bpf programs, both
+with the old and new dis-asm.h API. With old binutils there's no change in
+output before/after this patch. When comparing the output from old
+binutils (2.35) to new bintuils with the patch (upstream snapshot) there
+are a few output differences, but they are unrelated to this patch. An
+example hunk is:
+
+     f4:	mov    %r14,%rsi
+     f7:	mov    %r15,%rdx
+     fa:	mov    $0x2a,%ecx
+  -  ff:	callq  0xffffffffea8c4988
+  +  ff:	call   0xffffffffea8c4988
+    104:	test   %rax,%rax
+    107:	jge    0x0000000000000110
+    109:	xor    %eax,%eax
+  - 10b:	jmpq   0x0000000000000073
+  + 10b:	jmp    0x0000000000000073
+    110:	cmp    $0x16,%rax
+
+However, I had to use an older kernel to generate the bpf_jit_enabled =
+2 output, as that has been broken since 5.18 / 1022a5498f6f745c ("bpf,
+x86_64: Use bpf_jit_binary_pack_alloc").
+
+  https://lore.kernel.org/20220703030210.pmjft7qc2eajzi6c@alap3.anarazel.de
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Daniel Borkmann <daniel@iogearbox.net>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Quentin Monnet <quentin@isovalent.com>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-6-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/bpf/Makefile         | 5 ++++-
+ tools/bpf/bpf_jit_disasm.c | 5 ++++-
+ 2 files changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/tools/bpf/Makefile b/tools/bpf/Makefile
+index b11cfc86a3d021..664601ab1705ab 100644
+--- a/tools/bpf/Makefile
++++ b/tools/bpf/Makefile
+@@ -34,7 +34,7 @@ else
+ endif
+ 
+ FEATURE_USER = .bpf
+-FEATURE_TESTS = libbfd disassembler-four-args
++FEATURE_TESTS = libbfd disassembler-four-args disassembler-init-styled
+ FEATURE_DISPLAY = libbfd disassembler-four-args
+ 
+ check_feat := 1
+@@ -56,6 +56,9 @@ endif
+ ifeq ($(feature-disassembler-four-args), 1)
+ CFLAGS += -DDISASM_FOUR_ARGS_SIGNATURE
+ endif
++ifeq ($(feature-disassembler-init-styled), 1)
++CFLAGS += -DDISASM_INIT_STYLED
++endif
+ 
+ $(OUTPUT)%.yacc.c: $(srctree)/tools/bpf/%.y
+ 	$(QUIET_BISON)$(YACC) -o $@ -d $<
+diff --git a/tools/bpf/bpf_jit_disasm.c b/tools/bpf/bpf_jit_disasm.c
+index c8ae9580472814..a90a5d110f9255 100644
+--- a/tools/bpf/bpf_jit_disasm.c
++++ b/tools/bpf/bpf_jit_disasm.c
+@@ -28,6 +28,7 @@
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <limits.h>
++#include <tools/dis-asm-compat.h>
+ 
+ #define CMD_ACTION_SIZE_BUFFER		10
+ #define CMD_ACTION_READ_ALL		3
+@@ -64,7 +65,9 @@ static void get_asm_insns(uint8_t *image, size_t len, int opcodes)
+ 	assert(bfdf);
+ 	assert(bfd_check_format(bfdf, bfd_object));
+ 
+-	init_disassemble_info(&info, stdout, (fprintf_ftype) fprintf);
++	init_disassemble_info_compat(&info, stdout,
++				     (fprintf_ftype) fprintf,
++				     fprintf_styled);
+ 	info.arch = bfd_get_arch(bfdf);
+ 	info.mach = bfd_get_mach(bfdf);
+ 	info.buffer = image;
diff --git a/srcpkgs/linux-tools/patches/bpftool-binutils-2.39.patch b/srcpkgs/linux-tools/patches/bpftool-binutils-2.39.patch
new file mode 100644
index 000000000000..1e55c40011be
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/bpftool-binutils-2.39.patch
@@ -0,0 +1,149 @@
+From 600b7b26c07a070d0153daa76b3806c1e52c9e00 Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:33 -0700
+Subject: [PATCH] tools bpftool: Fix compilation error with new binutils
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation to fail for tools/bpf/bpftool/jit_disasm.c, e.g. on debian
+unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+Wire up the feature test and switch to init_disassemble_info_compat(),
+which were introduced in prior commits, fixing the compilation failure.
+
+I verified that bpftool can still disassemble bpf programs, both with an
+old and new dis-asm.h API. There are no output changes for plain and json
+formats. When comparing the output from old binutils (2.35)
+to new bintuils with the patch (upstream snapshot) there are a few output
+differences, but they are unrelated to this patch. An example hunk is:
+
+     2f:	pop    %r14
+     31:	pop    %r13
+     33:	pop    %rbx
+  -  34:	leaveq
+  -  35:	retq
+  +  34:	leave
+  +  35:	ret
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Quentin Monnet <quentin@isovalent.com>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-8-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/bpf/bpftool/Makefile     |  5 +++-
+ tools/bpf/bpftool/jit_disasm.c | 42 +++++++++++++++++++++++++++-------
+ 2 files changed, 38 insertions(+), 9 deletions(-)
+
+diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile
+index c6d2c77d02524a..436e671b2657d4 100644
+--- a/tools/bpf/bpftool/Makefile
++++ b/tools/bpf/bpftool/Makefile
+@@ -62,7 +62,7 @@ CLANG ?= clang
+ LLVM_STRIP ?= llvm-strip
+ 
+ FEATURE_USER = .bpftool
+-FEATURE_TESTS = libbfd disassembler-four-args reallocarray zlib libcap \
++FEATURE_TESTS = libbfd disassembler-four-args disassembler-init-styled reallocarray zlib libcap \
+ 	clang-bpf-co-re
+ FEATURE_DISPLAY = libbfd disassembler-four-args zlib libcap \
+ 	clang-bpf-co-re
+@@ -117,6 +117,9 @@ endif
+ ifeq ($(feature-disassembler-four-args), 1)
+ CFLAGS += -DDISASM_FOUR_ARGS_SIGNATURE
+ endif
++ifeq ($(feature-disassembler-init-styled), 1)
++    CFLAGS += -DDISASM_INIT_STYLED
++endif
+ 
+ LIBS = $(LIBBPF) -lelf -lz
+ LIBS_BOOTSTRAP = $(LIBBPF_BOOTSTRAP) -lelf -lz
+diff --git a/tools/bpf/bpftool/jit_disasm.c b/tools/bpf/bpftool/jit_disasm.c
+index 24734f2249d6ec..aaf99a0168c90b 100644
+--- a/tools/bpf/bpftool/jit_disasm.c
++++ b/tools/bpf/bpftool/jit_disasm.c
+@@ -24,6 +24,7 @@
+ #include <sys/stat.h>
+ #include <limits.h>
+ #include <bpf/libbpf.h>
++#include <tools/dis-asm-compat.h>
+ 
+ #include "json_writer.h"
+ #include "main.h"
+@@ -39,15 +40,12 @@ static void get_exec_path(char *tpath, s
+ }
+ 
+ static int oper_count;
+-static int fprintf_json(void *out, const char *fmt, ...)
++static int printf_json(void *out, const char *fmt, va_list ap)
+ {
+-	va_list ap;
+ 	char *s;
+ 
+-	va_start(ap, fmt);
+ 	if (vasprintf(&s, fmt, ap) < 0)
+ 		return -1;
+-	va_end(ap);
+ 
+ 	if (!oper_count) {
+ 		int i;
+@@ -73,6 +71,32 @@ static int fprintf_json(void *out, const char *fmt, ...)
+ 	return 0;
+ }
+ 
++static int fprintf_json(void *out, const char *fmt, ...)
++{
++	va_list ap;
++	int r;
++
++	va_start(ap, fmt);
++	r = printf_json(out, fmt, ap);
++	va_end(ap);
++
++	return r;
++}
++
++static int fprintf_json_styled(void *out,
++			       enum disassembler_style style __maybe_unused,
++			       const char *fmt, ...)
++{
++	va_list ap;
++	int r;
++
++	va_start(ap, fmt);
++	r = printf_json(out, fmt, ap);
++	va_end(ap);
++
++	return r;
++}
++
+ void disasm_print_insn(unsigned char *image, ssize_t len, int opcodes,
+ 		       const char *arch, const char *disassembler_options,
+ 		       const struct btf *btf,
+@@ -99,11 +123,13 @@ void disasm_print_insn(unsigned char *image, ssize_t len, int opcodes,
+ 	assert(bfd_check_format(bfdf, bfd_object));
+ 
+ 	if (json_output)
+-		init_disassemble_info(&info, stdout,
+-				      (fprintf_ftype) fprintf_json);
++		init_disassemble_info_compat(&info, stdout,
++					     (fprintf_ftype) fprintf_json,
++					     fprintf_json_styled);
+ 	else
+-		init_disassemble_info(&info, stdout,
+-				      (fprintf_ftype) fprintf);
++		init_disassemble_info_compat(&info, stdout,
++					     (fprintf_ftype) fprintf,
++					     fprintf_styled);
+ 
+ 	/* Update architecture info for offload. */
+ 	if (arch) {
diff --git a/srcpkgs/linux-tools/patches/perf-binutils-2.39.patch b/srcpkgs/linux-tools/patches/perf-binutils-2.39.patch
new file mode 100644
index 000000000000..3484330f7286
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/perf-binutils-2.39.patch
@@ -0,0 +1,114 @@
+From 83aa0120487e8bc3f231e72c460add783f71f17c Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:30 -0700
+Subject: [PATCH] tools perf: Fix compilation error with new binutils
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation failures for tools/perf/util/annotate.c, e.g. on debian
+unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+Wire up the feature test and switch to init_disassemble_info_compat(),
+which were introduced in prior commits, fixing the compilation failure.
+
+I verified that perf can still disassemble bpf programs by using bpftrace
+under load, recording a perf trace, and then annotating the bpf "function"
+with and without the changes. With old binutils there's no change in output
+before/after this patch. When comparing the output from old binutils (2.35)
+to new bintuils with the patch (upstream snapshot) there are a few output
+differences, but they are unrelated to this patch. An example hunk is:
+
+       1.15 :   55:mov    %rbp,%rdx
+       0.00 :   58:add    $0xfffffffffffffff8,%rdx
+       0.00 :   5c:xor    %ecx,%ecx
+  -    1.03 :   5e:callq  0xffffffffe12aca3c
+  +    1.03 :   5e:call   0xffffffffe12aca3c
+       0.00 :   63:xor    %eax,%eax
+  -    2.18 :   65:leaveq
+  -    2.82 :   66:retq
+  +    2.18 :   65:leave
+  +    2.82 :   66:ret
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-5-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/perf/Makefile.config | 8 ++++++++
+ tools/perf/util/annotate.c | 7 ++++---
+ 2 files changed, 12 insertions(+), 3 deletions(-)
+
+diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
+index d3c254c0f5c611..23648ea54e8d3d 100644
+--- a/tools/perf/Makefile.config
++++ b/tools/perf/Makefile.config
+@@ -298,6 +298,7 @@ FEATURE_CHECK_LDFLAGS-libpython := $(PYTHON_EMBED_LDOPTS)
+ FEATURE_CHECK_LDFLAGS-libaio = -lrt
+ 
+ FEATURE_CHECK_LDFLAGS-disassembler-four-args = -lbfd -lopcodes -ldl
++FEATURE_CHECK_LDFLAGS-disassembler-init-styled = -lbfd -lopcodes -ldl
+ 
+ CORE_CFLAGS += -fno-omit-frame-pointer
+ CORE_CFLAGS += -ggdb3
+@@ -818,13 +819,16 @@ else
+   ifeq ($(feature-libbfd-liberty), 1)
+     EXTLIBS += -lbfd -lopcodes -liberty
+     FEATURE_CHECK_LDFLAGS-disassembler-four-args += -liberty -ldl
++    FEATURE_CHECK_LDFLAGS-disassembler-init-styled += -liberty -ldl
+   else
+     ifeq ($(feature-libbfd-liberty-z), 1)
+       EXTLIBS += -lbfd -lopcodes -liberty -lz
+       FEATURE_CHECK_LDFLAGS-disassembler-four-args += -liberty -lz -ldl
++      FEATURE_CHECK_LDFLAGS-disassembler-init-styled += -liberty -lz -ldl
+     endif
+   endif
+   $(call feature_check,disassembler-four-args)
++  $(call feature_check,disassembler-init-styled)
+ endif
+ 
+ ifeq ($(feature-libbfd-buildid), 1)
+@@ -1044,6 +1048,10 @@ ifeq ($(feature-disassembler-four-args), 1)
+     CFLAGS += -DDISASM_FOUR_ARGS_SIGNATURE
+ endif
+ 
++ifeq ($(feature-disassembler-init-styled), 1)
++    CFLAGS += -DDISASM_INIT_STYLED
++endif
++
+ ifeq (${IS_64_BIT}, 1)
+   ifndef NO_PERF_READ_VDSO32
+     $(call feature_check,compile-32)
+diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
+index 82cc396ef516c4..2c6a485c3de5d9 100644
+--- a/tools/perf/util/annotate.c
++++ b/tools/perf/util/annotate.c
+@@ -1676,6 +1676,7 @@ fallback:
+ #define PACKAGE "perf"
+ #include <bfd.h>
+ #include <dis-asm.h>
++#include <tools/dis-asm-compat.h>
+ 
+ static int symbol__disassemble_bpf(struct symbol *sym,
+ 				   struct annotate_args *args)
+@@ -1762,9 +1763,9 @@ static int symbol__disassemble_bpf(struct symbol *sym,
+ 		ret = errno;
+ 		goto out;
+ 	}
+-	init_disassemble_info(&info, s,
+-			      (fprintf_ftype) fprintf);
+-
++	init_disassemble_info_compat(&info, s,
++				     (fprintf_ftype) fprintf,
++				     fprintf_styled);
+ 	info.arch = bfd_get_arch(bfdf);
+ 	info.mach = bfd_get_mach(bfdf);
+ 

From ae1509d1ba6bdd432b1baef881676cc70688cd14 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 14:45:28 -0700
Subject: [PATCH 25/51] libsasl: fix build for libtool 2.4.7

---
 srcpkgs/libsasl/template | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/libsasl/template b/srcpkgs/libsasl/template
index a8817042f843..a2993b39f4a1 100644
--- a/srcpkgs/libsasl/template
+++ b/srcpkgs/libsasl/template
@@ -19,6 +19,7 @@ distfiles="https://github.com/cyrusimap/cyrus-sasl/releases/download/cyrus-sasl-
 checksum=26866b1549b00ffd020f188a43c258017fa1c382b3ddadd8201536f72efb05d5
 
 pre_configure() {
+	rm -f m4/ltversion.m4
 	autoreconf -fi
 }
 

From 2d6c4afbfcc0ed0feaa642cbbe9ac8758f12a480 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:08 -0700
Subject: [PATCH 26/51] subversion: fix build for libtool 2.4.7

---
 srcpkgs/subversion/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion/template b/srcpkgs/subversion/template
index 8ad178264942..3f1c9e254e61 100644
--- a/srcpkgs/subversion/template
+++ b/srcpkgs/subversion/template
@@ -57,7 +57,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From 358ba0d581724156ced4f37dffde23601617fa9c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:38 -0700
Subject: [PATCH 27/51] subversion-kwallet-auth: fix build for libtool 2.4.7

---
 srcpkgs/subversion-kwallet-auth/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion-kwallet-auth/template b/srcpkgs/subversion-kwallet-auth/template
index 12210f250d51..b4d8621456ea 100644
--- a/srcpkgs/subversion-kwallet-auth/template
+++ b/srcpkgs/subversion-kwallet-auth/template
@@ -59,7 +59,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From ad3e0537d87156fd948f49bf59b27407c7d58414 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 20:07:32 -0700
Subject: [PATCH 28/51] gpgme: update to 1.18.0.

---
 common/shlibs          | 2 +-
 srcpkgs/gpgme/template | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 99b1dfc089b9..4eaee728723b 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -723,7 +723,7 @@ libdconf.so.1 dconf-0.13.90_1
 libassuan.so.0 libassuan-2.0.1_1
 libgpgme.so.11 libgpgme-1.12.0_2
 libgpgmepp.so.6 gpgmepp-1.7.0_3
-libqgpgme.so.7 gpgmeqt-1.7.0_3
+libqgpgme.so.15 gpgmeqt-1.18.0_1
 libgarcon-1.so.0 garcon-0.1.12_1
 libgarcon-gtk2-1.so.0 garcon-0.4.0_1
 libgarcon-gtk3-1.so.0 garcon-0.6.1_1
diff --git a/srcpkgs/gpgme/template b/srcpkgs/gpgme/template
index 8633075a8404..b1cfd5f78657 100644
--- a/srcpkgs/gpgme/template
+++ b/srcpkgs/gpgme/template
@@ -1,7 +1,7 @@
 # Template file for 'gpgme'
 pkgname=gpgme
-version=1.15.1
-revision=2
+version=1.18.0
+revision=1
 build_style=gnu-configure
 configure_args="--enable-fd-passing
  --with-libgpg-error-prefix=$XBPS_CROSS_BASE/usr
@@ -14,7 +14,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.gnupg.org/software/gpgme/index.html"
 distfiles="https://www.gnupg.org/ftp/gcrypt/gpgme/gpgme-${version}.tar.bz2"
-checksum=eebc3c1b27f1c8979896ff361ba9bb4778b508b2496c2fc10e3775a40b1de1ad
+checksum=361d4eae47ce925dba0ea569af40e7b52c645c4ae2e65e5621bf1b6cdd8b0e9e
 
 if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
 	configure_args+=" ac_cv_sys_file_offset_bits=no"

From 1ec8fa41e3974e5d1a025056e607ee5a168020a9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 29/51] cross-aarch64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..bd6b23f9fb6a 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 367a3d68323aaec8e4f67e41614e1d4316f4e564 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 30/51] cross-aarch64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..427ad2c1e9cd 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 0b13300eee29c52b890543c5337e2a715f0459ee Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 31/51] cross-arm-linux-gnueabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..2510ee26e789 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From dc0771cafdfd2903ccc590ee301ae7ee60eee6dd Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 32/51] cross-arm-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..bd8b16e1b4c1 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From bd33551f522758187b4509acf3ada3818a458410 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 33/51] cross-arm-linux-musleabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..dacfd2655216 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 1dae3813bd2cdc3cec57a9760c5f5bbe7e4148d7 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 34/51] cross-arm-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..9ddd32a9f20d 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From bd35d5401bcbf1d5a2ac5509bd3b959851347577 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:17 -0700
Subject: [PATCH 35/51] cross-armv7l-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..9fb00f18be3b 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 78ae225385d2e7a46018704b1a41816975519772 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 36/51] cross-armv7l-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..2c72e75ddfe3 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 7c332fd7809c563ab6d7b352a83ed216c5d4d071 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 37/51] cross-i686-pc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..4dc17df648b5 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From c6d8a5aaf921fd27d2b419847ad57f71451a7310 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 38/51] cross-mips-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..6009e5c79eb2 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 11598949deb7fc5cfa822aa05c97029e8241d54c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 39/51] cross-mips-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..080164df193d 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="hipperson0 <hipperson0@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From b56e69f823ba5b7b07d195f5d8de01ec9ef67349 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 40/51] cross-mipsel-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..c8f90cfa43cc 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_musl_version=1.1.24
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 78ad624004f518cc859dc010cb03ecc8c8d755ea Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 41/51] cross-mipsel-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..931345d2de15 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_musl_version=1.1.24
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 0bc3e23ffdbb2a604a512148fd95568376067e3f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 42/51] cross-powerpc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..31e57b4e52b2 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 8e9f4160a8f5de3305d8d2547bd4f9ad7955249f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 43/51] cross-powerpc-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..a2d1edcf1ffd 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From d94357214b7839d2108211361dc45ca647d3af3a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 44/51] cross-powerpc64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..1a4cbed61e76 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From d03f04c0f7c84564c07e66926158efae627c9ad5 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 45/51] cross-powerpc64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 1ebd0fb2048d..ade42018af05 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 019cacab71b36ba6f798eec4cb67ad91cc3625b8 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 46/51] cross-powerpc64le-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 733f5851da5c..dd1ad383a21e 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 15900151e72a4212f160f2db4da9bce538468760 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 47/51] cross-powerpc64le-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index 76a70aa1d6db..5887f845f932 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 28040aec2f4a6e7ffddcfc5942cf9cab252b580f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:18 -0700
Subject: [PATCH 48/51] cross-powerpcle-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 347b8fcf4f55..06530e0d609b 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 6a08c323f249834b8692dfef20c0aaffacfdaca0 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:19 -0700
Subject: [PATCH 49/51] cross-powerpcle-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index ec9324ddaa99..e68c3962b49c 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 418f075ed6c55deab44b0a839b91037a8a4587ad Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:19 -0700
Subject: [PATCH 50/51] cross-x86_64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 0078fbe7224b..7da85c14b62d 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From df830f105268fbb63a5ebd0cdeb3f0ddb89748d4 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Wed, 24 Aug 2022 12:40:19 -0700
Subject: [PATCH 51/51] cross-x86_64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..2811de0d3c2e 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (62 preceding siblings ...)
  2022-08-25 23:58 ` [PR PATCH] [Updated] " oreo639
@ 2022-08-26 10:54 ` leahneukirchen
  2022-08-26 20:31 ` [PR PATCH] [Updated] " oreo639
                   ` (200 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: leahneukirchen @ 2022-08-26 10:54 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 225 bytes --]

New comment by leahneukirchen on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1228351081

Comment:
The musl cross compilers use glibc now, something is wrong in your patchset.

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (63 preceding siblings ...)
  2022-08-26 10:54 ` leahneukirchen
@ 2022-08-26 20:31 ` oreo639
  2022-08-28 22:23 ` oreo639
                   ` (199 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-08-26 20:31 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5538 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.2.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.2.0

This PR depends on: https://github.com/void-linux/void-packages/pull/32330

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

Also, keep in mind that the libgo musl patch here will need to be updated once musl is updated:
https://github.com/void-linux/void-packages/pull/34902/files#diff-1f42a95b93c9550178ff1fbccbef2f47a72711df15c24c9472e2550076978129R163-R176

This is the updated patch for reference:
https://github.com/alpinelinux/aports/blob/8acb21b8ee881e7ab1c812d9a66a17d2501b8730/main/gcc/0049-libgo-adjust-name-of-union-in-sigevent-struct.patch

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/38817
- [x] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [ ] llvm https://github.com/void-linux/void-packages/pull/38694
- [ ] m4 https://github.com/void-linux/void-packages/pull/33730
- [ ] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [ ] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [ ] libvirt https://github.com/void-linux/void-packages/pull/38842
- [ ] syslinux https://github.com/void-linux/void-packages/pull/38876
- [ ] efivar https://github.com/void-linux/void-packages/pull/38874

Known packages that needed to be fixed/updated for gcc12:
- [ ] linux5.18 (in this PR)
- [ ] openssh https://github.com/void-linux/void-packages/pull/38849
- [ ] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [ ] doxygen https://github.com/void-linux/void-packages/pull/38846
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/38817
- [ ] libproxy https://github.com/void-linux/void-packages/pull/38818
- [ ] exempi https://github.com/void-linux/void-packages/pull/38820
- [ ] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [ ] gpgme https://github.com/void-linux/void-packages/pull/38825
- [x] libunique1 https://github.com/void-linux/void-packages/pull/38848 or https://github.com/void-linux/void-packages/pull/38873
- [ ] libwpd https://github.com/void-linux/void-packages/pull/38878

Needs to be fixed/updated for binutils:
- [ ] grub https://github.com/void-linux/void-packages/pull/38875
- [ ] linux-tools https://github.com/void-linux/void-packages/pull/38877

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [x] kde
- [x] lxde
- [x] lxqt

You can test the ISOs here:
https://drive.google.com/drive/folders/1ix92CYSLUP-KWjLxltdgG4e8Nu2JCY5n?usp=sharing

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 168200 bytes --]

From 72e5c23d50a6cdd722a41a586be14e65139cdf2c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 01/51] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 15 +++--
 3 files changed, 28 insertions(+), 113 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..0578665c1a30 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkg-config"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -44,6 +45,12 @@ do_configure() {
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	# gprofng currently only supports x86 and aarch64 glibc.
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64|i386|aarch64) conf+=" --enable-gprofng" ;;
+		*) conf+=" --disable-gprofng" ;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"

From 303ef2c67b184a906319640db98f6f72371e7d4e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 02/51] gcc: update to 12.2.0.

---
 common/shlibs                                 | 10 +--
 srcpkgs/gcc/files/gccgo-musl.patch            | 74 ++++---------------
 srcpkgs/gcc/files/libgnarl-musl.patch         | 18 ++---
 srcpkgs/gcc/files/libssp-musl.patch           | 10 +--
 srcpkgs/gcc/patches/libffi_gnulinux.patch     | 11 ---
 .../gcc/patches/libgcc-ibm128-no-tag.patch    | 10 ++-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |  2 +-
 srcpkgs/gcc/template                          | 25 +++----
 8 files changed, 52 insertions(+), 108 deletions(-)
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index e7a52cffc36c..40bb02639978 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.2.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.34 perl-5.34.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -847,8 +847,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.2.0_1
+libgnat-12.so libada-12.2.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1698,8 +1698,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.2.0_1
+libasan.so.8 libsanitizer-12.2.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..632ef951097b 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,17 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ a/libgo/go/runtime/os_linux.go
+@@ -363,9 +363,9 @@
+ 
+ 	var timerid int32
+ 	var sevp _sigevent
+-	sevp.sigev_notify = _SIGEV_THREAD_ID
++	sevp.sigev_notify = 4
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.sigev_notify_function))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..446741390d45 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,15 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
+version=12.2.0
+revision=1
 _patchver="${version%pre*}"
 _minorver="${_patchver%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 wrksrc=gcc-${version/pre/_pre}
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +19,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -396,7 +393,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}

From 8689b50a48be32b9f4d39447e472717b39d39799 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 03/51] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      | 11 ++++--
 2 files changed, 25 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..70c4aa533e66 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,12 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
+
+if [ "$XBPS_LIBC" == "musl" ]; then
+# Musl always searches LD_LIBRARY_PATH before RPATH and RUNPATH
+make_build_args="lt_cv_shlibpath_overrides_runpath=yes"
+fi
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From 0cef71363e95e2755e2f4998933158a3fa2caa13 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 04/51] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 1a4e1ca3d594..b04268908c2e 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="q66 <daniel@octaforge.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From 4767c713b316611267237a562434106697121a8b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 05/51] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 3 files changed, 55 insertions(+), 353 deletions(-)
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index 40bb02639978..e00070c014f3 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From 4664dc25d8f2aed813ca6a1a0be38d1feae84229 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 21:01:43 -0700
Subject: [PATCH 06/51] gcc-multilib: update to 12.2.0.

---
 srcpkgs/gcc-multilib/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index fcd25755aa75..1a26da26a991 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,16 +3,16 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _majorver="${version%.*}"
-wrksrc=gcc-${version/pre/_pre}
+wrksrc=gcc-${version}
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel

From 852746895612d06013803613cf3605dee857d0d4 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 16:22:03 -0700
Subject: [PATCH 07/51] llvm12: fix build for glibc 2.36

---
 .../compiler-rt-sanitizer-glibc-2.36.patch    | 59 +++++++++++++++++++
 1 file changed, 59 insertions(+)
 create mode 100644 srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch

diff --git a/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch b/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch
new file mode 100644
index 000000000000..e5f24dab8935
--- /dev/null
+++ b/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch
@@ -0,0 +1,59 @@
+From 9cf13067cb5088626ba7ee1ec4c42ec59c7995a0 Mon Sep 17 00:00:00 2001
+From: Fangrui Song <i@maskray.me>
+Date: Mon, 11 Jul 2022 12:53:34 -0700
+Subject: [PATCH] [sanitizer] Remove #include <linux/fs.h> to resolve
+ fsconfig_command/mount_attr conflict with glibc 2.36
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+It is generally not a good idea to mix usage of glibc headers and Linux UAPI
+headers (https://sourceware.org/glibc/wiki/Synchronizing_Headers). In glibc
+since 7eae6a91e9b1670330c9f15730082c91c0b1d570 (milestone: 2.36), sys/mount.h
+defines `fsconfig_command` which conflicts with linux/mount.h:
+
+    .../usr/include/linux/mount.h:95:6: error: redeclaration of ‘enum fsconfig_command’
+
+Remove #include <linux/fs.h> which pulls in linux/mount.h. Expand its 4 macros manually.
+Android sys/mount.h doesn't define BLKBSZGET and it still needs linux/fs.h.
+In the long term we should move Linux specific definitions to sanitizer_platform_limits_linux.cpp
+but this commit is easy to cherry pick into older compiler-rt releases.
+
+Fix https://github.com/llvm/llvm-project/issues/56421
+
+Reviewed By: #sanitizers, vitalybuka, zatrazz
+
+Differential Revision: https://reviews.llvm.org/D129471
+---
+ .../sanitizer_platform_limits_posix.cpp                | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+index 4bd425435d56d..3a94b260686f1 100644
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -73,7 +73,9 @@
+ #include <sys/vt.h>
+ #include <linux/cdrom.h>
+ #include <linux/fd.h>
++#if SANITIZER_ANDROID
+ #include <linux/fs.h>
++#endif
+ #include <linux/hdreg.h>
+ #include <linux/input.h>
+ #include <linux/ioctl.h>
+@@ -876,10 +878,10 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
+   unsigned IOCTL_EVIOCGPROP = IOCTL_NOT_PRESENT;
+   unsigned IOCTL_EVIOCSKEYCODE_V2 = IOCTL_NOT_PRESENT;
+ #endif
+-  unsigned IOCTL_FS_IOC_GETFLAGS = FS_IOC_GETFLAGS;
+-  unsigned IOCTL_FS_IOC_GETVERSION = FS_IOC_GETVERSION;
+-  unsigned IOCTL_FS_IOC_SETFLAGS = FS_IOC_SETFLAGS;
+-  unsigned IOCTL_FS_IOC_SETVERSION = FS_IOC_SETVERSION;
++  unsigned IOCTL_FS_IOC_GETFLAGS = _IOR('f', 1, long);
++  unsigned IOCTL_FS_IOC_GETVERSION = _IOR('v', 1, long);
++  unsigned IOCTL_FS_IOC_SETFLAGS = _IOW('f', 2, long);
++  unsigned IOCTL_FS_IOC_SETVERSION = _IOW('v', 2, long);
+   unsigned IOCTL_GIO_CMAP = GIO_CMAP;
+   unsigned IOCTL_GIO_FONT = GIO_FONT;
+   unsigned IOCTL_GIO_UNIMAP = GIO_UNIMAP;

From e666da32a72385ee62442e39b0405bda398ebaf2 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 17:21:40 -0700
Subject: [PATCH 08/51] m4: update to 1.4.19.

---
 srcpkgs/m4/patches/fix-glibc-2.27.patch | 167 ------------------------
 srcpkgs/m4/template                     |  12 +-
 2 files changed, 6 insertions(+), 173 deletions(-)
 delete mode 100644 srcpkgs/m4/patches/fix-glibc-2.27.patch

diff --git a/srcpkgs/m4/patches/fix-glibc-2.27.patch b/srcpkgs/m4/patches/fix-glibc-2.27.patch
deleted file mode 100644
index 59d33cff164d..000000000000
--- a/srcpkgs/m4/patches/fix-glibc-2.27.patch
+++ /dev/null
@@ -1,167 +0,0 @@
-From 4af4a4a71827c0bc5e0ec67af23edef4f15cee8e Mon Sep 17 00:00:00 2001
-From: Paul Eggert <eggert@cs.ucla.edu>
-Date: Mon, 5 Mar 2018 10:56:29 -0800
-Subject: [PATCH] fflush: adjust to glibc 2.28 libio.h removal
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Problem reported by Daniel P. Berrangé in:
-https://lists.gnu.org/r/bug-gnulib/2018-03/msg00000.html
-* lib/fbufmode.c (fbufmode):
-* lib/fflush.c (clear_ungetc_buffer_preserving_position)
-(disable_seek_optimization, rpl_fflush):
-* lib/fpending.c (__fpending):
-* lib/fpurge.c (fpurge):
-* lib/freadable.c (freadable):
-* lib/freadahead.c (freadahead):
-* lib/freading.c (freading):
-* lib/freadptr.c (freadptr):
-* lib/freadseek.c (freadptrinc):
-* lib/fseeko.c (fseeko):
-* lib/fseterr.c (fseterr):
-* lib/fwritable.c (fwritable):
-* lib/fwriting.c (fwriting):
-Check _IO_EOF_SEEN instead of _IO_ftrylockfile.
-* lib/stdio-impl.h (_IO_IN_BACKUP) [_IO_EOF_SEEN]:
-Define if not already defined.
-
-[yann.morin.1998@free.fr: partially backport from upstream gnulib]
-Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
-
----
- lib/fflush.c     |  6 +++---
- lib/fpending.c   |  2 +-
- lib/fpurge.c     |  2 +-
- lib/freadahead.c |  2 +-
- lib/freading.c   |  2 +-
- lib/fseeko.c     |  4 ++--
- lib/stdio-impl.h |  6 ++++++
- 7 files changed, 15 insertions(+), 9 deletions(-)
-
-diff --git a/lib/fflush.c b/build-aux/gnulib/lib/fflush.c
-index 983ade0ff..a6edfa105 100644
---- a/lib/fflush.c
-+++ b/lib/fflush.c
-@@ -33,7 +33,7 @@
- #undef fflush
- 
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- 
- /* Clear the stream's ungetc buffer, preserving the value of ftello (fp).  */
- static void
-@@ -72,7 +72,7 @@ clear_ungetc_buffer (FILE *fp)
- 
- #endif
- 
--#if ! (defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
-+#if ! (defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
- 
- # if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT
- /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
-@@ -148,7 +148,7 @@ rpl_fflush (FILE *stream)
-   if (stream == NULL || ! freading (stream))
-     return fflush (stream);
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- 
-   clear_ungetc_buffer_preserving_position (stream);
- 
-diff --git a/lib/fpending.c b/build-aux/gnulib/lib/fpending.c
-index c84e3a5b4..789f50e4e 100644
---- a/lib/fpending.c
-+++ b/lib/fpending.c
-@@ -32,7 +32,7 @@ __fpending (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   return fp->_IO_write_ptr - fp->_IO_write_base;
- #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
-   /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
-diff --git a/lib/fpurge.c b/build-aux/gnulib/lib/fpurge.c
-index b1d417c7a..3aedcc373 100644
---- a/lib/fpurge.c
-+++ b/lib/fpurge.c
-@@ -62,7 +62,7 @@ fpurge (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   fp->_IO_read_end = fp->_IO_read_ptr;
-   fp->_IO_write_ptr = fp->_IO_write_base;
-   /* Avoid memory leak when there is an active ungetc buffer.  */
-diff --git a/lib/freadahead.c b/build-aux/gnulib/lib/freadahead.c
-index c2ecb5b28..23ec76ee5 100644
---- a/lib/freadahead.c
-+++ b/lib/freadahead.c
-@@ -30,7 +30,7 @@ extern size_t __sreadahead (FILE *);
- size_t
- freadahead (FILE *fp)
- {
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   if (fp->_IO_write_ptr > fp->_IO_write_base)
-     return 0;
-   return (fp->_IO_read_end - fp->_IO_read_ptr)
-diff --git a/lib/freading.c b/build-aux/gnulib/lib/freading.c
-index 73c28acdd..c24d0c88a 100644
---- a/lib/freading.c
-+++ b/lib/freading.c
-@@ -31,7 +31,7 @@ freading (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   return ((fp->_flags & _IO_NO_WRITES) != 0
-           || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0
-               && fp->_IO_read_base != NULL));
-diff --git a/lib/fseeko.c b/build-aux/gnulib/lib/fseeko.c
-index 0101ab55f..193f4e8ce 100644
---- a/lib/fseeko.c
-+++ b/lib/fseeko.c
-@@ -47,7 +47,7 @@ fseeko (FILE *fp, off_t offset, int whence)
- #endif
- 
-   /* These tests are based on fpurge.c.  */
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   if (fp->_IO_read_end == fp->_IO_read_ptr
-       && fp->_IO_write_ptr == fp->_IO_write_base
-       && fp->_IO_save_base == NULL)
-@@ -123,7 +123,7 @@ fseeko (FILE *fp, off_t offset, int whence)
-           return -1;
-         }
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-       fp->_flags &= ~_IO_EOF_SEEN;
-       fp->_offset = pos;
- #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
-diff --git a/lib/stdio-impl.h b/build-aux/gnulib/lib/stdio-impl.h
-index 78d896e9f..05c5752a2 100644
---- a/lib/stdio-impl.h
-+++ b/lib/stdio-impl.h
-@@ -18,6 +18,12 @@
-    the same implementation of stdio extension API, except that some fields
-    have different naming conventions, or their access requires some casts.  */
- 
-+/* Glibc 2.28 made _IO_IN_BACKUP private.  For now, work around this
-+   problem by defining it ourselves.  FIXME: Do not rely on glibc
-+   internals.  */
-+#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN
-+# define _IO_IN_BACKUP 0x100
-+#endif
- 
- /* BSD stdio derived implementations.  */
- 
--- 
-2.14.1
-
-
diff --git a/srcpkgs/m4/template b/srcpkgs/m4/template
index 78f3dae6184a..762593d883bd 100644
--- a/srcpkgs/m4/template
+++ b/srcpkgs/m4/template
@@ -1,17 +1,17 @@
 # Template file for 'm4'
 pkgname=m4
-version=1.4.18
-revision=2
+version=1.4.19
+revision=1
 bootstrap=yes
-replaces="chroot-m4>=0"
 build_style=gnu-configure
 configure_args="--enable-changeword --enable-threads"
 short_desc="GNU version of UNIX m4 macro language processor"
-homepage="https://www.gnu.org/software/m4/"
-license="GPL-3.0-or-later"
 maintainer="Enno Boland <gottox@voidlinux.org>"
+license="GPL-3.0-or-later"
+homepage="https://www.gnu.org/software/m4/"
 distfiles="${GNU_SITE}/${pkgname}/${pkgname}-${version}.tar.xz"
-checksum=f2c1e86ca0a404ff281631bdc8377638992744b175afb806e25871a24a934e07
+checksum=63aede5c6d33b6d9b13511cd0be2cac046f2e70fd0a07aa9573a04a82783af96
+replaces="chroot-m4>=0"
 
 if [ "$XBPS_TARGET_LIBC" = musl ]; then
 	export ac_cv_lib_error_at_line=no

From 2df3272c5e8e42dd71a7621607f4d9ac9267f44f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 22:57:59 -0700
Subject: [PATCH 09/51] btrfs-progs: update to 5.19.

---
 srcpkgs/btrfs-progs/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/btrfs-progs/template b/srcpkgs/btrfs-progs/template
index f6c53d8587e1..292d5110106b 100644
--- a/srcpkgs/btrfs-progs/template
+++ b/srcpkgs/btrfs-progs/template
@@ -1,6 +1,6 @@
 # Template file for 'btrfs-progs'
 pkgname=btrfs-progs
-version=5.18.1
+version=5.19
 revision=1
 wrksrc="${pkgname}-v${version}"
 build_style=gnu-configure
@@ -16,7 +16,7 @@ license="GPL-2.0-only, LGPL-2.1-or-later"
 homepage="https://btrfs.wiki.kernel.org/index.php/Main_Page"
 changelog="https://raw.githubusercontent.com/kdave/btrfs-progs/master/CHANGES"
 distfiles="${KERNEL_SITE}/kernel/people/kdave/${pkgname}/${pkgname}-v${version}.tar.xz"
-checksum=6e98a75ccff52e9354daa1ad284c614c490f844273a2fa524cbac9eb841c7255
+checksum=1fbcf06e4b2f80e7a127fd687ed4625a5b74fa674fe212c836ff70e0edfcccf9
 # Most of the tests depend on `mount` and `fallocate` commands, which are not
 # presented in chroot-util-linux
 make_check=no

From 494f55acf474fb65abe243f0c4a5635b52988315 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 19:39:23 -0700
Subject: [PATCH 10/51] syslinux: fix build for glibc 2.36

---
 .../patches/fix-build-with-glibc-2.36.patch   | 30 +++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 srcpkgs/syslinux/patches/fix-build-with-glibc-2.36.patch

diff --git a/srcpkgs/syslinux/patches/fix-build-with-glibc-2.36.patch b/srcpkgs/syslinux/patches/fix-build-with-glibc-2.36.patch
new file mode 100644
index 000000000000..1303be56c127
--- /dev/null
+++ b/srcpkgs/syslinux/patches/fix-build-with-glibc-2.36.patch
@@ -0,0 +1,30 @@
+--- a/linux/syslinux.c
++++ b/linux/syslinux.c
+@@ -45,7 +45,6 @@
+ #include <sys/stat.h>
+ #include <sys/types.h>
+ #include <sys/wait.h>
+-#include <sys/mount.h>
+ 
+ #include "linuxioctl.h"
+ 
+--- a/libinstaller/syslxcom.c
++++ b/libinstaller/syslxcom.c
+@@ -28,7 +28,6 @@
+ #include <errno.h>
+ #include <sys/stat.h>
+ #include <sys/types.h>
+-#include <sys/mount.h>
+ #include <sys/vfs.h>
+ 
+ #include "linuxioctl.h"
+--- a/extlinux/main.c
++++ b/extlinux/main.c
+@@ -40,7 +40,6 @@
+ #include <sys/stat.h>
+ #include <sys/sysmacros.h>
+ #include <sys/types.h>
+-#include <sys/mount.h>
+ #include <sys/vfs.h>
+ 
+ #include "linuxioctl.h"

From 2a498a4fe76d42d0378ec72315a44e6e295c479d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 14 Aug 2022 19:29:36 -0700
Subject: [PATCH 11/51] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove -no-pie from build. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..58d94f8dacba 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -60,6 +60,7 @@ _void_cross_build_binutils() {
 		--disable-multilib \
 		--disable-werror \
 		--disable-gold \
+		--disable-gprofng \
 		--enable-relro \
 		--enable-plugins \
 		--enable-64-bit-bfd \
@@ -132,6 +133,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -460,6 +462,14 @@ do_build() {
 	local binutils_ver linux_ver gcc_ver libc_ver libucontext_ver
 	local tgt=${sourcepkg/cross-}
 
+	export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}"
+	export CXXFLAGS="${CXXFLAGS/-D_FORTIFY_SOURCE=2/}"
+
+	# Disable explicit -fno-PIE, gcc/binutils/libc will figure this out itself.
+	export CFLAGS="${CFLAGS//-fno-PIE/}"
+	export CXXFLAGS="${CXXFLAGS//-fno-PIE/}"
+	export LDFLAGS="${LDFLAGS//-no-pie/}"
+
 	_void_cross_test_ver binutils
 	_void_cross_test_ver linux
 	_void_cross_test_ver gcc
@@ -625,6 +635,9 @@ do_install() {
 	# then remove it because it conflicts with libquadmath package
 	rm -rf ${DESTDIR}/${sysroot}/usr/lib/libquadmath.*
 
+	# Remove libdep linker plugin because it conflicts with system binutils
+	rm -f ${DESTDIR}/usr/lib/bfd-plugins/libdep*
+
 	# Remove leftover symlinks
 	rm -f ${DESTDIR}/usr/lib${XBPS_TARGET_WORDSIZE}
 	rm -f ${DESTDIR}/lib*

From 2693959b85a876425e29e21f41795effccf5e42a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:08:52 -0700
Subject: [PATCH 12/51] openssh: suppress werror on gcc12

---
 srcpkgs/openssh/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/openssh/template b/srcpkgs/openssh/template
index 02a2dec35f42..6e8e343a9dca 100644
--- a/srcpkgs/openssh/template
+++ b/srcpkgs/openssh/template
@@ -40,7 +40,7 @@ if [ "$build_option_ldns" -a -z "$build_option_ssl" ]; then
 	broken="option 'ldns' requires option 'ssl'"
 fi
 
-CFLAGS="-Wno-format-truncation -Wno-stringop-truncation"
+CFLAGS="-Wno-format-truncation -Wno-stringop-truncation -Wno-error=maybe-uninitialized"
 
 case $XBPS_TARGET_MACHINE in
 	i686-musl)

From eeb4c11e8b7de7a4c4657a5600ef30e6b22976b9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:09:31 -0700
Subject: [PATCH 13/51] linux5.18: update dotconfigs for gcc12

---
 srcpkgs/linux5.18/files/x86_64-dotconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/linux5.18/files/x86_64-dotconfig b/srcpkgs/linux5.18/files/x86_64-dotconfig
index 4e73a3195d40..ea6204868e23 100644
--- a/srcpkgs/linux5.18/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.18/files/x86_64-dotconfig
@@ -512,6 +512,7 @@ CONFIG_RETHUNK=y
 CONFIG_CPU_UNRET_ENTRY=y
 CONFIG_CPU_IBPB_ENTRY=y
 CONFIG_CPU_IBRS_ENTRY=y
+CONFIG_SLS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10060,8 +10061,11 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
 # Memory initialization
 #
 CONFIG_INIT_STACK_NONE=y
+# CONFIG_INIT_STACK_ALL_PATTERN is not set
+# CONFIG_INIT_STACK_ALL_ZERO is not set
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
+# CONFIG_ZERO_CALL_USED_REGS is not set
 # end of Memory initialization
 # end of Kernel hardening options
 # end of Security options
@@ -10538,6 +10542,7 @@ CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
 # CONFIG_UBSAN is not set
 CONFIG_HAVE_ARCH_KCSAN=y
+# CONFIG_KCSAN is not set
 # end of Generic Kernel Debugging Instruments
 
 #

From ce1925b6fab82c5f333de7fe6f2d58f5a129015c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 18:00:42 -0700
Subject: [PATCH 14/51] xf86-video-vmware: fix build on gcc12

---
 ...183b3395333d5d4c73e25c2d011748f15eda.patch | 30 +++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch

diff --git a/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch b/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch
new file mode 100644
index 000000000000..ff839f16e628
--- /dev/null
+++ b/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch
@@ -0,0 +1,30 @@
+From 77b8183b3395333d5d4c73e25c2d011748f15eda Mon Sep 17 00:00:00 2001
+From: Rudi Heitbaum <rudi@heitbaum.com>
+Date: Sun, 8 May 2022 03:00:10 +0000
+Subject: [PATCH] vmwgfx: fix missing array notation
+
+ Fixes error identified by gcc-12.1.0 compiler
+
+make
+  CC       libvmwgfx_la-vmwgfx_tex_video.lo
+vmwgfx_tex_video.c: In function 'stop_video':
+vmwgfx_tex_video.c:240:20: error: the comparison will always evaluate as 'true' for the address of 'yuv' will never be NULL [-Werror=address]
+  240 |                if (priv->yuv[i]) {
+      |                    ^~~~
+---
+ vmwgfx/vmwgfx_tex_video.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/vmwgfx/vmwgfx_tex_video.c b/vmwgfx/vmwgfx_tex_video.c
+index acc2b56..480a5f1 100644
+--- a/vmwgfx/vmwgfx_tex_video.c
++++ b/vmwgfx/vmwgfx_tex_video.c
+@@ -237,7 +237,7 @@ stop_video(ScrnInfoPtr pScrn, pointer data, Bool shutdown)
+ 
+        for (i=0; i<3; ++i) {
+ 	   for (j=0; j<2; ++j) {
+-	       if (priv->yuv[i]) {
++	       if (priv->yuv[j][i]) {
+ 		   xa_surface_destroy(priv->yuv[j][i]);
+ 		   priv->yuv[j][i] = NULL;
+ 	       }

From aeee72a73c9d74a9cd9ffbd4eb106654d5a3d15d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 18:24:37 -0700
Subject: [PATCH 15/51] doxygen: fix build for gcc 12

---
 srcpkgs/doxygen/patches/compat-gcc12.patch | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100644 srcpkgs/doxygen/patches/compat-gcc12.patch

diff --git a/srcpkgs/doxygen/patches/compat-gcc12.patch b/srcpkgs/doxygen/patches/compat-gcc12.patch
new file mode 100644
index 000000000000..666744a1dceb
--- /dev/null
+++ b/srcpkgs/doxygen/patches/compat-gcc12.patch
@@ -0,0 +1,22 @@
+From 5198966c8d5fec89116d025c74934ac03ea511fa Mon Sep 17 00:00:00 2001
+From: Dimitri van Heesch <doxygen@gmail.com>
+Date: Fri, 6 May 2022 09:55:16 +0200
+Subject: [PATCH] issue #9312: Build: cache.h:53:14: error: 'exchange' is not a
+ member of 'std'
+
+---
+ src/cache.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/cache.h b/src/cache.h
+index 0ff3092ed5..e218eb27d2 100644
+--- a/src/cache.h
++++ b/src/cache.h
+@@ -19,6 +19,7 @@
+ #include <list>
+ #include <unordered_map>
+ #include <mutex>
++#include <utility>
+ #include <ctype.h>
+ 
+ /*! Fixed size cache for value type V using keys of type K.

From a313fa4e9977cffc8b2f27d635849885036ad04c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 21 Aug 2022 15:12:00 -0700
Subject: [PATCH 16/51] libproxy: update to 0.4.18

---
 srcpkgs/libproxy/template | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/libproxy/template b/srcpkgs/libproxy/template
index d6103007032e..6599dfb69b98 100644
--- a/srcpkgs/libproxy/template
+++ b/srcpkgs/libproxy/template
@@ -1,18 +1,22 @@
 # Template file for 'libproxy'
 pkgname=libproxy
-version=0.4.15
+version=0.4.18
 revision=1
 build_style=cmake
 configure_args="-DWITH_GNOME=0 -DWITH_KDE4=0 -DWITH_MOZJS=0 -DWITH_NM=0
  -DWITH_PERL=0 -DWITH_PYTHON=1 -DWITH_WEBKIT=0"
 hostmakedepends="pkg-config python"
 makedepends="zlib-devel"
-short_desc="A library handling all the details of proxy configuration"
+short_desc="Library handling all the details of proxy configuration"
 maintainer="Orphaned <orphan@voidlinux.org>"
+license="LGPL-2.1-or-later"
 homepage="http://github.com/libproxy/libproxy"
-license="LGPL-2.1"
-distfiles="https://github.com/libproxy/libproxy/archive/${version}.tar.gz>${pkgname}-${version}.tar.gz"
-checksum=18f58b0a0043b6881774187427ead158d310127fc46a1c668ad6d207fb28b4e0
+distfiles="https://github.com/libproxy/libproxy/archive/${version}.tar.gz"
+checksum=0b4a9218d88f6cf9fa25996a3f38329a11f688a9d026141d9d0e966d8fa63837
+
+post_patch() {
+	vsed '/add_test(NAME url-test/d' -i libproxy/test/CMakeLists.txt
+}
 
 libproxy-devel_package() {
 	depends="libproxy>=${version}_${revision}"

From d02bb6266474d210c8dfb8233766c64ad217a21e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 21 Aug 2022 17:05:39 -0700
Subject: [PATCH 17/51] exempi: update to 2.6.2

---
 ...f034705fd2d032c81383eee8208fd4eee0ac.patch | 43 -------------------
 srcpkgs/exempi/template                       |  4 +-
 2 files changed, 2 insertions(+), 45 deletions(-)
 delete mode 100644 srcpkgs/exempi/patches/8ed2f034705fd2d032c81383eee8208fd4eee0ac.patch

diff --git a/srcpkgs/exempi/patches/8ed2f034705fd2d032c81383eee8208fd4eee0ac.patch b/srcpkgs/exempi/patches/8ed2f034705fd2d032c81383eee8208fd4eee0ac.patch
deleted file mode 100644
index 2696793cec09..000000000000
--- a/srcpkgs/exempi/patches/8ed2f034705fd2d032c81383eee8208fd4eee0ac.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From 8ed2f034705fd2d032c81383eee8208fd4eee0ac Mon Sep 17 00:00:00 2001
-From: Victor Rodriguez <victor.rodriguez.bahena@intel.com>
-Date: Sat, 18 Aug 2018 13:54:55 +0000
-Subject: [PATCH] Issue #9 - Fix null-pointer-dereference (CVE-2018-12648)
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-The WEBP::GetLE32 function in
-XMPFiles/source/FormatSupport/WEBP_Support.hpp in Exempi 2.4.5 has a
-NULL pointer dereference.
-
-https://bugs.freedesktop.org/show_bug.cgi?id=106981
-https://gitlab.freedesktop.org/libopenraw/exempi/issues/9
-
-Signed-off-by: Victor Rodriguez <victor.rodriguez.bahena@intel.com>
-Signed-off-by: Hubert Figuière <hub@figuiere.net>
----
- XMPFiles/source/FormatSupport/WEBP_Support.cpp | 8 +++++---
- 1 file changed, 5 insertions(+), 3 deletions(-)
-
-diff --git a/XMPFiles/source/FormatSupport/WEBP_Support.cpp b/XMPFiles/source/FormatSupport/WEBP_Support.cpp
-index ffaf220..4fe705b 100644
---- a/XMPFiles/source/FormatSupport/WEBP_Support.cpp
-+++ b/XMPFiles/source/FormatSupport/WEBP_Support.cpp
-@@ -160,9 +160,11 @@ bool VP8XChunk::xmp()
- }
- void VP8XChunk::xmp(bool hasXMP)
- {
--    XMP_Uns32 flags = GetLE32(&this->data[0]);
--    flags ^= (-hasXMP ^ flags) & (1 << XMP_FLAG_BIT);
--    PutLE32(&this->data[0], flags);
-+    if (&this->data[0] != NULL) {
-+        XMP_Uns32 flags = GetLE32(&this->data[0]);
-+        flags ^= (-hasXMP ^ flags) & (1 << XMP_FLAG_BIT);
-+        PutLE32(&this->data[0], flags);
-+    }
- }
- 
- Container::Container(WEBP_MetaHandler* handler) : Chunk(NULL, handler)
--- 
-2.18.0
-
diff --git a/srcpkgs/exempi/template b/srcpkgs/exempi/template
index 14753617953a..d664f7dc4d80 100644
--- a/srcpkgs/exempi/template
+++ b/srcpkgs/exempi/template
@@ -1,6 +1,6 @@
 # Template file for 'exempi'
 pkgname=exempi
-version=2.5.0
+version=2.6.2
 revision=1
 build_style=gnu-configure
 configure_args="--with-boost=${XBPS_CROSS_BASE}/usr --disable-static --disable-unittest"
@@ -10,7 +10,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="BSD-3-Clause"
 homepage="https://libopenraw.freedesktop.org/wiki/Exempi"
 distfiles="https://libopenraw.freedesktop.org/download/exempi-${version}.tar.bz2"
-checksum=dc82fc24c0540a44a63fa4ad21775d24e00e63f1dedd3e2ae6f7aa27583b711b
+checksum=4d17d4c93df2a95da3e3172c45b7a5bf317dd31dafd1c7a340169728c7089d1d
 
 post_install() {
 	vlicense COPYING

From 4409f58548b0db5c24cfeb8536da2b491690d49d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 21 Aug 2022 21:36:03 -0700
Subject: [PATCH 18/51] plymouth: update to 22.02.122

---
 srcpkgs/plymouth/patches/fix-glibc-2.36.patch | 30 +++++++++++++++++++
 srcpkgs/plymouth/template                     |  4 +--
 2 files changed, 32 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/plymouth/patches/fix-glibc-2.36.patch

diff --git a/srcpkgs/plymouth/patches/fix-glibc-2.36.patch b/srcpkgs/plymouth/patches/fix-glibc-2.36.patch
new file mode 100644
index 000000000000..2f1e43875cfb
--- /dev/null
+++ b/srcpkgs/plymouth/patches/fix-glibc-2.36.patch
@@ -0,0 +1,30 @@
+From 5f1e43c00039a7fe1fff768b91a05a695fb4a53d Mon Sep 17 00:00:00 2001
+From: Ray Strode <rstrode@redhat.com>
+Date: Wed, 3 Aug 2022 15:23:33 -0400
+Subject: [PATCH] ply-utils: Drop linux/fs.h include
+
+It was needed long ago for a function we no longer even have.
+
+Now it's causing compile errors on Fedora 37 because it's conflicting
+with sys/mount.h.
+
+This commit drops it.
+---
+ src/libply/ply-utils.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/src/libply/ply-utils.c b/src/libply/ply-utils.c
+index c7b165e9..219e2e77 100644
+--- a/src/libply/ply-utils.c
++++ b/src/libply/ply-utils.c
+@@ -46,7 +46,6 @@
+ #include <sys/user.h>
+ #include <sys/wait.h>
+ #include <time.h>
+-#include <linux/fs.h>
+ #include <linux/vt.h>
+ 
+ #include <dlfcn.h>
+-- 
+GitLab
+
diff --git a/srcpkgs/plymouth/template b/srcpkgs/plymouth/template
index 17f801fc5315..442ab58a99cd 100644
--- a/srcpkgs/plymouth/template
+++ b/srcpkgs/plymouth/template
@@ -1,6 +1,6 @@
 # Template file for 'plymouth'
 pkgname=plymouth
-version=0.9.5
+version=22.02.122
 revision=1
 build_style=gnu-configure
 configure_args="--with-system-root-install=no \
@@ -18,7 +18,7 @@ maintainer="William OD <obirik2005@gmail.com>"
 license="GPL-2.0-or-later"
 homepage="https://www.freedesktop.org/wiki/Software/Plymouth/"
 distfiles="${FREEDESKTOP_SITE}/plymouth/releases/$pkgname-$version.tar.xz"
-checksum=ecae257f351d098340542a5bc06de029404c24dcee87e6ebb2abd5ef117fce86
+checksum=100551442221033ce868c447ad6c74d831d209c18ae232b98ae0207e34eadaeb
 
 build_options="gtk3 pango"
 build_options_default="gtk3 pango"

From 63ad06c02aacf1b8500f9e96c95b96922244b3a3 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 21 Aug 2022 21:37:00 -0700
Subject: [PATCH 19/51] openjdk7-bootstrap: fix build for gcc12

---
 .../files/dist_patches_glibc.txt              |  1 +
 .../files/dist_patches_musl.txt               |  1 +
 .../icedtea-pointer-comparison-gcc12.patch    | 31 +++++++++++++++++++
 3 files changed, 33 insertions(+)
 create mode 100644 srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch

diff --git a/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt b/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt
index c76c56855441..8061756dfc0c 100644
--- a/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt
+++ b/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt
@@ -6,3 +6,4 @@ icedtea-jdk-no-soname.patch
 icedtea-jdk-xattr.patch
 icedtea-jdk-sysctl_h.patch
 icedtea-cpio.patch
+icedtea-pointer-comparison-gcc12.patch
diff --git a/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt b/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt
index 21812517c7c2..8b35d9c46989 100644
--- a/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt
+++ b/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt
@@ -11,3 +11,4 @@ icedtea-jdk-musl.patch
 icedtea-jdk-no-soname.patch
 icedtea-jdk-xattr.patch
 icedtea-cpio.patch
+icedtea-pointer-comparison-gcc12.patch
diff --git a/srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch b/srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch
new file mode 100644
index 000000000000..c809553443e7
--- /dev/null
+++ b/srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch
@@ -0,0 +1,31 @@
+--- openjdk.orig/hotspot/src/share/vm/opto/lcm.cpp
++++ openjdk/hotspot/src/share/vm/opto/lcm.cpp
+@@ -60,7 +60,7 @@
+ // Check whether val is not-null-decoded compressed oop,
+ // i.e. will grab into the base of the heap if it represents NULL.
+ static bool accesses_heap_base_zone(Node *val) {
+-  if (Universe::narrow_oop_base() > 0) { // Implies UseCompressedOops.
++  if (Universe::narrow_oop_base() > (address)0) { // Implies UseCompressedOops.
+     if (val && val->is_Mach()) {
+       if (val->as_Mach()->ideal_Opcode() == Op_DecodeN) {
+         // This assumes all Decodes with TypePtr::NotNull are matched to nodes that
+--- openjdk.orig/hotspot/src/share/vm/runtime/virtualspace.cpp
++++ openjdk/hotspot/src/share/vm/runtime/virtualspace.cpp
+@@ -527,7 +527,7 @@ ReservedHeapSpace::ReservedHeapSpace(siz
+                 (UseCompressedOops && (Universe::narrow_oop_base() != NULL) &&
+                  Universe::narrow_oop_use_implicit_null_checks()) ?
+                   lcm(os::vm_page_size(), alignment) : 0) {
+-  if (base() > 0) {
++  if (base() > (char*)0) {
+     MemTracker::record_virtual_memory_type((address)base(), mtJavaHeap);
+   }
+ 
+@@ -546,7 +546,7 @@ ReservedHeapSpace::ReservedHeapSpace(con
+                 (UseCompressedOops && (Universe::narrow_oop_base() != NULL) &&
+                  Universe::narrow_oop_use_implicit_null_checks()) ?
+                   lcm(os::vm_page_size(), prefix_align) : 0) {
+-  if (base() > 0) {
++  if (base() > (char*)0) {
+     MemTracker::record_virtual_memory_type((address)base(), mtJavaHeap);
+   }
+ 

From c52ec1b0bb0bf7ffbd9eed359691ca027c454789 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:39:52 -0700
Subject: [PATCH 20/51] libvirt: fix build for glibc 2.36

---
 .../patches/lxc-fix-compat-glibc-2.36.patch   | 34 ++++++++++++++++
 .../virfile-fix-compat-glibc-2.36.patch       | 39 +++++++++++++++++++
 2 files changed, 73 insertions(+)
 create mode 100644 srcpkgs/libvirt/patches/lxc-fix-compat-glibc-2.36.patch
 create mode 100644 srcpkgs/libvirt/patches/virfile-fix-compat-glibc-2.36.patch

diff --git a/srcpkgs/libvirt/patches/lxc-fix-compat-glibc-2.36.patch b/srcpkgs/libvirt/patches/lxc-fix-compat-glibc-2.36.patch
new file mode 100644
index 000000000000..d85b57815010
--- /dev/null
+++ b/srcpkgs/libvirt/patches/lxc-fix-compat-glibc-2.36.patch
@@ -0,0 +1,34 @@
+From 9493c9b79dc541ec9e0fd73c6d87bdf8d30aaa90 Mon Sep 17 00:00:00 2001
+From: Cole Robinson <crobinso@redhat.com>
+Date: Mon, 1 Aug 2022 15:20:38 -0400
+Subject: [PATCH] lxc: containter: fix build with glibc 2.36
+
+With glibc 2.36, sys/mount.h and linux/mount.h conflict:
+https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
+
+lxc_container.c imports sys/mount.h and linux/fs.h, which pulls in
+linux/mount.h.
+
+linux/fs.h isn't required here though. glibc sys/mount.h has had
+MS_MOVE since 2.12 in 2010
+
+Reviewed-by: Erik Skultety <eskultet@redhat.com>
+Signed-off-by: Cole Robinson <crobinso@redhat.com>
+---
+ src/lxc/lxc_container.c | 3 ---
+ 1 file changed, 3 deletions(-)
+
+diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
+index b5278831da7..a5401c2186e 100644
+--- a/src/lxc/lxc_container.c
++++ b/src/lxc/lxc_container.c
+@@ -33,9 +33,6 @@
+ /* Yes, we want linux private one, for _syscall2() macro */
+ #include <linux/unistd.h>
+ 
+-/* For MS_MOVE */
+-#include <linux/fs.h>
+-
+ #if WITH_CAPNG
+ # include <cap-ng.h>
+ #endif
diff --git a/srcpkgs/libvirt/patches/virfile-fix-compat-glibc-2.36.patch b/srcpkgs/libvirt/patches/virfile-fix-compat-glibc-2.36.patch
new file mode 100644
index 000000000000..2ef227ea9b54
--- /dev/null
+++ b/srcpkgs/libvirt/patches/virfile-fix-compat-glibc-2.36.patch
@@ -0,0 +1,39 @@
+From c0d9adf220dc0d223330a7bac37b174132d330ba Mon Sep 17 00:00:00 2001
+From: Cole Robinson <crobinso@redhat.com>
+Date: Mon, 1 Aug 2022 15:24:01 -0400
+Subject: [PATCH] virfile: Fix build with glibc 2.36
+
+With glibc 2.36, sys/mount.h and linux/mount.h conflict:
+https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
+
+virfile.c imports sys/mount.h and linux/fs.h, which pulls in
+linux/mount.h.
+
+Manually define the constants we need from linux/fs.h, like was
+done in llvm:
+
+https://reviews.llvm.org/rGb379129c4beb3f26223288627a1291739f33af02
+
+Reviewed-by: Erik Skultety <eskultet@redhat.com>
+Signed-off-by: Cole Robinson <crobinso@redhat.com>
+---
+ src/util/virfile.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/src/util/virfile.c b/src/util/virfile.c
+index 99da058db3b..ce541b8946b 100644
+--- a/src/util/virfile.c
++++ b/src/util/virfile.c
+@@ -71,7 +71,11 @@
+ # endif
+ # include <sys/ioctl.h>
+ # include <linux/cdrom.h>
+-# include <linux/fs.h>
++/* These come from linux/fs.h, but that header conflicts with
++ * sys/mount.h on glibc 2.36+ */
++# define FS_IOC_GETFLAGS _IOR('f', 1, long)
++# define FS_IOC_SETFLAGS _IOW('f', 2, long)
++# define FS_NOCOW_FL 0x00800000
+ #endif
+ 
+ #if WITH_LIBATTR

From 4e78bccb26b534a7cc72645117f188048297671e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:41:50 -0700
Subject: [PATCH 21/51] efivar: fix build for glibc 2.36

---
 .../patches/fix-compat-glibc-2.36.patch       | 55 +++++++++++++++++++
 1 file changed, 55 insertions(+)
 create mode 100644 srcpkgs/efivar/patches/fix-compat-glibc-2.36.patch

diff --git a/srcpkgs/efivar/patches/fix-compat-glibc-2.36.patch b/srcpkgs/efivar/patches/fix-compat-glibc-2.36.patch
new file mode 100644
index 000000000000..fcc83aef20cf
--- /dev/null
+++ b/srcpkgs/efivar/patches/fix-compat-glibc-2.36.patch
@@ -0,0 +1,55 @@
+From bc65d63ebf8fe6ac8a099ff15ca200986dba1565 Mon Sep 17 00:00:00 2001
+From: Robbie Harwood <rharwood@redhat.com>
+Date: Thu, 28 Jul 2022 16:11:24 -0400
+Subject: [PATCH] Fix glibc 2.36 build (mount.h conflicts)
+
+glibc has decided that sys/mount.h and linux/mount.h are no longer
+usable at the same time.  This broke the build, since linux/fs.h itself
+includes linux/mount.h.  For now, fix the build by only including
+sys/mount.h where we need it.
+
+See-also: https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
+Resolves: #227
+Signed-off-by: Robbie Harwood <rharwood@redhat.com>
+---
+ src/gpt.c   | 1 +
+ src/linux.c | 1 +
+ src/util.h  | 1 -
+ 3 files changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/gpt.c b/src/gpt.c
+index 1eda0497..21413c3b 100644
+--- a/src/gpt.c
++++ b/src/gpt.c
+@@ -17,6 +17,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <sys/mount.h>
+ #include <sys/param.h>
+ #include <sys/stat.h>
+ #include <sys/utsname.h>
+diff --git a/src/linux.c b/src/linux.c
+index 47e45ae4..1780816f 100644
+--- a/src/linux.c
++++ b/src/linux.c
+@@ -20,6 +20,7 @@
+ #include <stdbool.h>
+ #include <stdio.h>
+ #include <sys/ioctl.h>
++#include <sys/mount.h>
+ #include <sys/socket.h>
+ #include <sys/sysmacros.h>
+ #include <sys/types.h>
+diff --git a/src/util.h b/src/util.h
+index 3300666f..1e67e447 100644
+--- a/src/util.h
++++ b/src/util.h
+@@ -23,7 +23,6 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <sys/ioctl.h>
+-#include <sys/mount.h>
+ #include <sys/stat.h>
+ #include <sys/types.h>
+ #include <tgmath.h>

From e3b415cb0e2d6637f75e6d82091477b74a955808 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:43:24 -0700
Subject: [PATCH 22/51] libwpd: fix build for gcc12

---
 srcpkgs/libwpd/patches/fix-compat-gcc12.patch | 11 +++++++++++
 1 file changed, 11 insertions(+)
 create mode 100644 srcpkgs/libwpd/patches/fix-compat-gcc12.patch

diff --git a/srcpkgs/libwpd/patches/fix-compat-gcc12.patch b/srcpkgs/libwpd/patches/fix-compat-gcc12.patch
new file mode 100644
index 000000000000..6ebce2463d16
--- /dev/null
+++ b/srcpkgs/libwpd/patches/fix-compat-gcc12.patch
@@ -0,0 +1,11 @@
+diff -rup libwpd-0.10.3.orig/src/lib/WPXTable.h libwpd-0.10.3/src/lib/WPXTable.h
+--- libwpd-0.10.3.orig/src/lib/WPXTable.h	2022-08-23 22:32:45.332593795 -0700
++++ libwpd-0.10.3/src/lib/WPXTable.h	2022-08-23 22:32:59.500651211 -0700
+@@ -37,6 +37,7 @@
+ #define _WPXTABLE_H
+ 
+ #include <vector>
++#include <cstddef>
+ 
+ struct WPXTableCell
+ {

From a582ff0c6b30b066e4afef81fe4abe9343fd4a16 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:44:07 -0700
Subject: [PATCH 23/51] grub: fix build for binutils 2.36

---
 .../patches/fix-compat-binutils-2.36.patch    | 96 +++++++++++++++++++
 srcpkgs/grub/template                         |  7 +-
 2 files changed, 102 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/grub/patches/fix-compat-binutils-2.36.patch

diff --git a/srcpkgs/grub/patches/fix-compat-binutils-2.36.patch b/srcpkgs/grub/patches/fix-compat-binutils-2.36.patch
new file mode 100644
index 000000000000..d92a91e3253e
--- /dev/null
+++ b/srcpkgs/grub/patches/fix-compat-binutils-2.36.patch
@@ -0,0 +1,96 @@
+From b98275138bf4fc250a1c362dfd2c8b1cf2421701 Mon Sep 17 00:00:00 2001
+From: Michael Chang <mchang@suse.com>
+Date: Tue, 28 Sep 2021 13:50:47 +0800
+Subject: build: Fix build error with binutils 2.36
+
+The following procedure to build xen/pvgrub is broken.
+
+  git clone https://git.savannah.gnu.org/git/grub.git
+  cd grub
+  ./bootstrap
+  mkdir build-xen
+  cd build-xen
+  ../configure --with-platform=xen
+  make
+
+It fails with the message:
+
+  /usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld:
+  section .note.gnu.property VMA [0000000000400158,0000000000400187]
+  overlaps section .bss VMA [000000000000f000,000000000041e1af]
+
+The most significant factor is that new assembler (GNU as) generates the
+.note.gnu.property section as default. This note section overlaps with
+.bss because it doesn't reposition with -Wl,-Ttext,0 with which the base
+address of .text section is set, rather the address of .note.gnu.property
+is calculated for some reason from 0x400000 where the ELF executable
+defaults to start.
+
+Using -Ttext-segment doesn't help either, though it is said to set the
+address of the first byte of the text segment according to "man ld".
+What it actually does is to override the default 0x400000, aka the image
+base address, to something else. The entire process can be observed in
+the default linker script used by gcc [1]. Therefore we can't expect it
+to achieve the same thing as -Ttext given that the first segment where
+.text resides is offset by SIZEOF_HEADERS plus some sections may be
+preceding it within the first segment. The end result is .text always
+has to start with non-zero address with -Wl,-Ttext-segment,0 if using
+default linker script.
+
+It is also worth mentioning that binutils upstream apparently doesn't
+seem to consider this as a bug [2] and proposed to use -Wl,-Ttext-segment,0
+which is not fruitful as what has been tested by Gentoo [3].
+
+As long as GRUB didn't use ISA information encoded in .note.gnu.property,
+we can safely drop it via -Wa,-mx86-used-note=no assembler option to
+fix the linker error above.
+
+This is considered a better approach than using custom linker script to
+drop the .note.gnu.property section because object file manipulation can
+also be hampered one way or the other in that linker script may not be
+helpful. See also this commit removing the section in the process of objcopy.
+
+  6643507ce build: Fix GRUB i386-pc build with Ubuntu gcc
+
+[1] In /usr/lib64/ldscripts/elf_x86_64.x or use 'gcc -Wl,--verbose ...'
+    PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x400000));
+    . = SEGMENT_START("text-segment", 0x400000) + SIZEOF_HEADERS;
+[2] https://sourceware.org/bugzilla/show_bug.cgi?id=27377
+[3] https://bugs.gentoo.org/787221
+
+Signed-off-by: Michael Chang <mchang@suse.com>
+Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
+---
+ configure.ac | 14 ++++++++++++++
+ 1 file changed, 14 insertions(+)
+
+(limited to 'configure.ac')
+
+diff --git a/configure.ac b/configure.ac
+index eeb5d22..8d1c81a 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -840,6 +840,20 @@ if ( test "x$target_cpu" = xi386 || test "x$target_cpu" = xx86_64 ) && test "x$p
+   TARGET_CFLAGS="$TARGET_CFLAGS -mno-mmx -mno-sse -mno-sse2 -mno-sse3 -mno-3dnow"
+ fi
+ 
++if ( test "x$target_cpu" = xi386 || test "x$target_cpu" = xx86_64 ); then
++  AC_CACHE_CHECK([whether -Wa,-mx86-used-note works], [grub_cv_cc_mx86_used_note], [
++    CFLAGS="$TARGET_CFLAGS -Wa,-mx86-used-note=no -Werror"
++    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
++	[grub_cv_cc_mx86_used_note=yes],
++	[grub_cv_cc_mx86_used_note=no])
++  ])
++
++  if test "x$grub_cv_cc_mx86_used_note" = xyes; then
++    TARGET_CFLAGS="$TARGET_CFLAGS -Wa,-mx86-used-note=no"
++    TARGET_CCASFLAGS="$TARGET_CCASFLAGS -Wa,-mx86-used-note=no"
++  fi
++fi
++
+ # GRUB doesn't use float or doubles at all. Yet some toolchains may decide
+ # that floats are a good fit to run instead of what's written in the code.
+ # Given that floating point unit is disabled (if present to begin with)
+-- 
+cgit v1.1
+
diff --git a/srcpkgs/grub/template b/srcpkgs/grub/template
index b1826c38a884..b4d3b07af620 100644
--- a/srcpkgs/grub/template
+++ b/srcpkgs/grub/template
@@ -2,7 +2,8 @@
 pkgname=grub
 version=2.06
 revision=2
-hostmakedepends="python3 pkg-config flex freetype-devel font-unifont-bdf help2man"
+hostmakedepends="python3 pkg-config flex freetype-devel font-unifont-bdf help2man
+ automake gettext-devel-tools"
 makedepends="libusb-compat-devel ncurses-devel freetype-devel
  liblzma-devel device-mapper-devel fuse-devel"
 depends="os-prober"
@@ -43,6 +44,10 @@ case "$XBPS_TARGET_MACHINE" in
 		;;
 esac
 
+pre_configure() {
+	autoreconf -fi
+}
+
 do_configure() {
 	# workaround for https://savannah.gnu.org/bugs/?60458
 	# some more info: https://www.linuxquestions.org/questions/showthread.php?p=6257712

From 221bee81f9729db5c0d89bdddbd2d1b889a45dbc Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:45:07 -0700
Subject: [PATCH 24/51] linux-toos: fix build for binutils 2.39

---
 .../patches/binutils-add-compat-check.patch   | 103 ++++++++++++
 .../patches/binutils-disasm-compat.patch      | 102 ++++++++++++
 .../bpf_jit_disasm-binutils-2.39.patch        | 104 ++++++++++++
 .../patches/bpftool-binutils-2.39.patch       | 149 ++++++++++++++++++
 .../patches/perf-binutils-2.39.patch          | 114 ++++++++++++++
 5 files changed, 572 insertions(+)
 create mode 100644 srcpkgs/linux-tools/patches/binutils-add-compat-check.patch
 create mode 100644 srcpkgs/linux-tools/patches/binutils-disasm-compat.patch
 create mode 100644 srcpkgs/linux-tools/patches/bpf_jit_disasm-binutils-2.39.patch
 create mode 100644 srcpkgs/linux-tools/patches/bpftool-binutils-2.39.patch
 create mode 100644 srcpkgs/linux-tools/patches/perf-binutils-2.39.patch

diff --git a/srcpkgs/linux-tools/patches/binutils-add-compat-check.patch b/srcpkgs/linux-tools/patches/binutils-add-compat-check.patch
new file mode 100644
index 000000000000..e4e7ece9635e
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/binutils-add-compat-check.patch
@@ -0,0 +1,103 @@
+From cfd59ca91467056bb2c36907b2fa67b8e1af9952 Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:27 -0700
+Subject: [PATCH] tools build: Add feature test for init_disassemble_info API
+ changes
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation failures for tools/{perf,bpf}, e.g. on debian unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+This commit adds a feature test to detect the new signature.  Subsequent
+commits will use it to fix the build failures.
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Quentin Monnet <quentin@isovalent.com>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-2-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/build/Makefile.feature                        |  1 +
+ tools/build/feature/Makefile                        |  4 ++++
+ tools/build/feature/test-all.c                      |  4 ++++
+ tools/build/feature/test-disassembler-init-styled.c | 13 +++++++++++++
+ 4 files changed, 22 insertions(+)
+ create mode 100644 tools/build/feature/test-disassembler-init-styled.c
+
+diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature
+index 888a0421d43b96..8f6578e4d3249e 100644
+--- a/tools/build/Makefile.feature
++++ b/tools/build/Makefile.feature
+@@ -70,6 +70,7 @@ FEATURE_TESTS_BASIC :=                  \
+         libaio				\
+         libzstd				\
+         disassembler-four-args		\
++        disassembler-init-styled	\
+         file-handle
+ 
+ # FEATURE_TESTS_BASIC + FEATURE_TESTS_EXTRA is the complete list
+diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile
+index 7c2a17e23c30ac..c3059739318a95 100644
+--- a/tools/build/feature/Makefile
++++ b/tools/build/feature/Makefile
+@@ -18,6 +18,7 @@ FILES=                                          \
+          test-libbfd.bin                        \
+          test-libbfd-buildid.bin		\
+          test-disassembler-four-args.bin        \
++         test-disassembler-init-styled.bin	\
+          test-reallocarray.bin			\
+          test-libbfd-liberty.bin                \
+          test-libbfd-liberty-z.bin              \
+@@ -248,6 +249,9 @@ $(OUTPUT)test-libbfd-buildid.bin:
+ $(OUTPUT)test-disassembler-four-args.bin:
+ 	$(BUILD) -DPACKAGE='"perf"' -lbfd -lopcodes
+ 
++$(OUTPUT)test-disassembler-init-styled.bin:
++	$(BUILD) -DPACKAGE='"perf"' -lbfd -lopcodes
++
+ $(OUTPUT)test-reallocarray.bin:
+ 	$(BUILD)
+ 
+diff --git a/tools/build/feature/test-all.c b/tools/build/feature/test-all.c
+index 5ffafb967b6e49..957c02c7b163b5 100644
+--- a/tools/build/feature/test-all.c
++++ b/tools/build/feature/test-all.c
+@@ -166,6 +166,10 @@
+ # include "test-disassembler-four-args.c"
+ #undef main
+ 
++#define main main_test_disassembler_init_styled
++# include "test-disassembler-init-styled.c"
++#undef main
++
+ #define main main_test_libzstd
+ # include "test-libzstd.c"
+ #undef main
+diff --git a/tools/build/feature/test-disassembler-init-styled.c b/tools/build/feature/test-disassembler-init-styled.c
+new file mode 100644
+index 00000000000000..f1ce0ec3bee9d3
+--- /dev/null
++++ b/tools/build/feature/test-disassembler-init-styled.c
+@@ -0,0 +1,13 @@
++// SPDX-License-Identifier: GPL-2.0
++#include <stdio.h>
++#include <dis-asm.h>
++
++int main(void)
++{
++	struct disassemble_info info;
++
++	init_disassemble_info(&info, stdout,
++			      NULL, NULL);
++
++	return 0;
++}
diff --git a/srcpkgs/linux-tools/patches/binutils-disasm-compat.patch b/srcpkgs/linux-tools/patches/binutils-disasm-compat.patch
new file mode 100644
index 000000000000..1a6cc0e6d97c
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/binutils-disasm-compat.patch
@@ -0,0 +1,102 @@
+From a45b3d6926231c3d024ea0de4f7bd967f83709ee Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:29 -0700
+Subject: tools include: add dis-asm-compat.h to handle version differences
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation failures for tools/{perf,bpf}, e.g. on debian unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+This commit introduces a wrapper for init_disassemble_info(), to avoid
+spreading #ifdef DISASM_INIT_STYLED to a bunch of places. Subsequent
+commits will use it to fix the build failures.
+
+It likely is worth adding a wrapper for disassember(), to avoid the already
+existing DISASM_FOUR_ARGS_SIGNATURE ifdefery.
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Signed-off-by: Ben Hutchings <benh@debian.org>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Quentin Monnet <quentin@isovalent.com>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-4-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/include/tools/dis-asm-compat.h | 55 ++++++++++++++++++++++++++++++++++++
+ 1 file changed, 55 insertions(+)
+ create mode 100644 tools/include/tools/dis-asm-compat.h
+
+(limited to 'tools/include/tools/dis-asm-compat.h')
+
+diff --git a/tools/include/tools/dis-asm-compat.h b/tools/include/tools/dis-asm-compat.h
+new file mode 100644
+index 0000000000000..70f331e23ed3d
+--- /dev/null
++++ b/tools/include/tools/dis-asm-compat.h
+@@ -0,0 +1,55 @@
++/* SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause */
++#ifndef _TOOLS_DIS_ASM_COMPAT_H
++#define _TOOLS_DIS_ASM_COMPAT_H
++
++#include <stdio.h>
++#include <dis-asm.h>
++
++/* define types for older binutils version, to centralize ifdef'ery a bit */
++#ifndef DISASM_INIT_STYLED
++enum disassembler_style {DISASSEMBLER_STYLE_NOT_EMPTY};
++typedef int (*fprintf_styled_ftype) (void *, enum disassembler_style, const char*, ...);
++#endif
++
++/*
++ * Trivial fprintf wrapper to be used as the fprintf_styled_func argument to
++ * init_disassemble_info_compat() when normal fprintf suffices.
++ */
++static inline int fprintf_styled(void *out,
++				 enum disassembler_style style,
++				 const char *fmt, ...)
++{
++	va_list args;
++	int r;
++
++	(void)style;
++
++	va_start(args, fmt);
++	r = vfprintf(out, fmt, args);
++	va_end(args);
++
++	return r;
++}
++
++/*
++ * Wrapper for init_disassemble_info() that hides version
++ * differences. Depending on binutils version and architecture either
++ * fprintf_func or fprintf_styled_func will be called.
++ */
++static inline void init_disassemble_info_compat(struct disassemble_info *info,
++						void *stream,
++						fprintf_ftype unstyled_func,
++						fprintf_styled_ftype styled_func)
++{
++#ifdef DISASM_INIT_STYLED
++	init_disassemble_info(info, stream,
++			      unstyled_func,
++			      styled_func);
++#else
++	(void)styled_func;
++	init_disassemble_info(info, stream,
++			      unstyled_func);
++#endif
++}
++
++#endif /* _TOOLS_DIS_ASM_COMPAT_H */
+-- 
+cgit 
+
diff --git a/srcpkgs/linux-tools/patches/bpf_jit_disasm-binutils-2.39.patch b/srcpkgs/linux-tools/patches/bpf_jit_disasm-binutils-2.39.patch
new file mode 100644
index 000000000000..01221fad3a4a
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/bpf_jit_disasm-binutils-2.39.patch
@@ -0,0 +1,104 @@
+From 96ed066054abf11c7d3e106e3011a51f3f1227a3 Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:31 -0700
+Subject: [PATCH] tools bpf_jit_disasm: Fix compilation error with new binutils
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation to fail for tools/bpf/bpf_jit_disasm.c, e.g. on debian
+unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+Wire up the feature test and switch to init_disassemble_info_compat(),
+which were introduced in prior commits, fixing the compilation failure.
+
+I verified that bpf_jit_disasm can still disassemble bpf programs, both
+with the old and new dis-asm.h API. With old binutils there's no change in
+output before/after this patch. When comparing the output from old
+binutils (2.35) to new bintuils with the patch (upstream snapshot) there
+are a few output differences, but they are unrelated to this patch. An
+example hunk is:
+
+     f4:	mov    %r14,%rsi
+     f7:	mov    %r15,%rdx
+     fa:	mov    $0x2a,%ecx
+  -  ff:	callq  0xffffffffea8c4988
+  +  ff:	call   0xffffffffea8c4988
+    104:	test   %rax,%rax
+    107:	jge    0x0000000000000110
+    109:	xor    %eax,%eax
+  - 10b:	jmpq   0x0000000000000073
+  + 10b:	jmp    0x0000000000000073
+    110:	cmp    $0x16,%rax
+
+However, I had to use an older kernel to generate the bpf_jit_enabled =
+2 output, as that has been broken since 5.18 / 1022a5498f6f745c ("bpf,
+x86_64: Use bpf_jit_binary_pack_alloc").
+
+  https://lore.kernel.org/20220703030210.pmjft7qc2eajzi6c@alap3.anarazel.de
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Daniel Borkmann <daniel@iogearbox.net>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Quentin Monnet <quentin@isovalent.com>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-6-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/bpf/Makefile         | 5 ++++-
+ tools/bpf/bpf_jit_disasm.c | 5 ++++-
+ 2 files changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/tools/bpf/Makefile b/tools/bpf/Makefile
+index b11cfc86a3d021..664601ab1705ab 100644
+--- a/tools/bpf/Makefile
++++ b/tools/bpf/Makefile
+@@ -34,7 +34,7 @@ else
+ endif
+ 
+ FEATURE_USER = .bpf
+-FEATURE_TESTS = libbfd disassembler-four-args
++FEATURE_TESTS = libbfd disassembler-four-args disassembler-init-styled
+ FEATURE_DISPLAY = libbfd disassembler-four-args
+ 
+ check_feat := 1
+@@ -56,6 +56,9 @@ endif
+ ifeq ($(feature-disassembler-four-args), 1)
+ CFLAGS += -DDISASM_FOUR_ARGS_SIGNATURE
+ endif
++ifeq ($(feature-disassembler-init-styled), 1)
++CFLAGS += -DDISASM_INIT_STYLED
++endif
+ 
+ $(OUTPUT)%.yacc.c: $(srctree)/tools/bpf/%.y
+ 	$(QUIET_BISON)$(YACC) -o $@ -d $<
+diff --git a/tools/bpf/bpf_jit_disasm.c b/tools/bpf/bpf_jit_disasm.c
+index c8ae9580472814..a90a5d110f9255 100644
+--- a/tools/bpf/bpf_jit_disasm.c
++++ b/tools/bpf/bpf_jit_disasm.c
+@@ -28,6 +28,7 @@
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <limits.h>
++#include <tools/dis-asm-compat.h>
+ 
+ #define CMD_ACTION_SIZE_BUFFER		10
+ #define CMD_ACTION_READ_ALL		3
+@@ -64,7 +65,9 @@ static void get_asm_insns(uint8_t *image, size_t len, int opcodes)
+ 	assert(bfdf);
+ 	assert(bfd_check_format(bfdf, bfd_object));
+ 
+-	init_disassemble_info(&info, stdout, (fprintf_ftype) fprintf);
++	init_disassemble_info_compat(&info, stdout,
++				     (fprintf_ftype) fprintf,
++				     fprintf_styled);
+ 	info.arch = bfd_get_arch(bfdf);
+ 	info.mach = bfd_get_mach(bfdf);
+ 	info.buffer = image;
diff --git a/srcpkgs/linux-tools/patches/bpftool-binutils-2.39.patch b/srcpkgs/linux-tools/patches/bpftool-binutils-2.39.patch
new file mode 100644
index 000000000000..1e55c40011be
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/bpftool-binutils-2.39.patch
@@ -0,0 +1,149 @@
+From 600b7b26c07a070d0153daa76b3806c1e52c9e00 Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:33 -0700
+Subject: [PATCH] tools bpftool: Fix compilation error with new binutils
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation to fail for tools/bpf/bpftool/jit_disasm.c, e.g. on debian
+unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+Wire up the feature test and switch to init_disassemble_info_compat(),
+which were introduced in prior commits, fixing the compilation failure.
+
+I verified that bpftool can still disassemble bpf programs, both with an
+old and new dis-asm.h API. There are no output changes for plain and json
+formats. When comparing the output from old binutils (2.35)
+to new bintuils with the patch (upstream snapshot) there are a few output
+differences, but they are unrelated to this patch. An example hunk is:
+
+     2f:	pop    %r14
+     31:	pop    %r13
+     33:	pop    %rbx
+  -  34:	leaveq
+  -  35:	retq
+  +  34:	leave
+  +  35:	ret
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Quentin Monnet <quentin@isovalent.com>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-8-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/bpf/bpftool/Makefile     |  5 +++-
+ tools/bpf/bpftool/jit_disasm.c | 42 +++++++++++++++++++++++++++-------
+ 2 files changed, 38 insertions(+), 9 deletions(-)
+
+diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile
+index c6d2c77d02524a..436e671b2657d4 100644
+--- a/tools/bpf/bpftool/Makefile
++++ b/tools/bpf/bpftool/Makefile
+@@ -62,7 +62,7 @@ CLANG ?= clang
+ LLVM_STRIP ?= llvm-strip
+ 
+ FEATURE_USER = .bpftool
+-FEATURE_TESTS = libbfd disassembler-four-args reallocarray zlib libcap \
++FEATURE_TESTS = libbfd disassembler-four-args disassembler-init-styled reallocarray zlib libcap \
+ 	clang-bpf-co-re
+ FEATURE_DISPLAY = libbfd disassembler-four-args zlib libcap \
+ 	clang-bpf-co-re
+@@ -117,6 +117,9 @@ endif
+ ifeq ($(feature-disassembler-four-args), 1)
+ CFLAGS += -DDISASM_FOUR_ARGS_SIGNATURE
+ endif
++ifeq ($(feature-disassembler-init-styled), 1)
++    CFLAGS += -DDISASM_INIT_STYLED
++endif
+ 
+ LIBS = $(LIBBPF) -lelf -lz
+ LIBS_BOOTSTRAP = $(LIBBPF_BOOTSTRAP) -lelf -lz
+diff --git a/tools/bpf/bpftool/jit_disasm.c b/tools/bpf/bpftool/jit_disasm.c
+index 24734f2249d6ec..aaf99a0168c90b 100644
+--- a/tools/bpf/bpftool/jit_disasm.c
++++ b/tools/bpf/bpftool/jit_disasm.c
+@@ -24,6 +24,7 @@
+ #include <sys/stat.h>
+ #include <limits.h>
+ #include <bpf/libbpf.h>
++#include <tools/dis-asm-compat.h>
+ 
+ #include "json_writer.h"
+ #include "main.h"
+@@ -39,15 +40,12 @@ static void get_exec_path(char *tpath, s
+ }
+ 
+ static int oper_count;
+-static int fprintf_json(void *out, const char *fmt, ...)
++static int printf_json(void *out, const char *fmt, va_list ap)
+ {
+-	va_list ap;
+ 	char *s;
+ 
+-	va_start(ap, fmt);
+ 	if (vasprintf(&s, fmt, ap) < 0)
+ 		return -1;
+-	va_end(ap);
+ 
+ 	if (!oper_count) {
+ 		int i;
+@@ -73,6 +71,32 @@ static int fprintf_json(void *out, const char *fmt, ...)
+ 	return 0;
+ }
+ 
++static int fprintf_json(void *out, const char *fmt, ...)
++{
++	va_list ap;
++	int r;
++
++	va_start(ap, fmt);
++	r = printf_json(out, fmt, ap);
++	va_end(ap);
++
++	return r;
++}
++
++static int fprintf_json_styled(void *out,
++			       enum disassembler_style style __maybe_unused,
++			       const char *fmt, ...)
++{
++	va_list ap;
++	int r;
++
++	va_start(ap, fmt);
++	r = printf_json(out, fmt, ap);
++	va_end(ap);
++
++	return r;
++}
++
+ void disasm_print_insn(unsigned char *image, ssize_t len, int opcodes,
+ 		       const char *arch, const char *disassembler_options,
+ 		       const struct btf *btf,
+@@ -99,11 +123,13 @@ void disasm_print_insn(unsigned char *image, ssize_t len, int opcodes,
+ 	assert(bfd_check_format(bfdf, bfd_object));
+ 
+ 	if (json_output)
+-		init_disassemble_info(&info, stdout,
+-				      (fprintf_ftype) fprintf_json);
++		init_disassemble_info_compat(&info, stdout,
++					     (fprintf_ftype) fprintf_json,
++					     fprintf_json_styled);
+ 	else
+-		init_disassemble_info(&info, stdout,
+-				      (fprintf_ftype) fprintf);
++		init_disassemble_info_compat(&info, stdout,
++					     (fprintf_ftype) fprintf,
++					     fprintf_styled);
+ 
+ 	/* Update architecture info for offload. */
+ 	if (arch) {
diff --git a/srcpkgs/linux-tools/patches/perf-binutils-2.39.patch b/srcpkgs/linux-tools/patches/perf-binutils-2.39.patch
new file mode 100644
index 000000000000..3484330f7286
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/perf-binutils-2.39.patch
@@ -0,0 +1,114 @@
+From 83aa0120487e8bc3f231e72c460add783f71f17c Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:30 -0700
+Subject: [PATCH] tools perf: Fix compilation error with new binutils
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation failures for tools/perf/util/annotate.c, e.g. on debian
+unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+Wire up the feature test and switch to init_disassemble_info_compat(),
+which were introduced in prior commits, fixing the compilation failure.
+
+I verified that perf can still disassemble bpf programs by using bpftrace
+under load, recording a perf trace, and then annotating the bpf "function"
+with and without the changes. With old binutils there's no change in output
+before/after this patch. When comparing the output from old binutils (2.35)
+to new bintuils with the patch (upstream snapshot) there are a few output
+differences, but they are unrelated to this patch. An example hunk is:
+
+       1.15 :   55:mov    %rbp,%rdx
+       0.00 :   58:add    $0xfffffffffffffff8,%rdx
+       0.00 :   5c:xor    %ecx,%ecx
+  -    1.03 :   5e:callq  0xffffffffe12aca3c
+  +    1.03 :   5e:call   0xffffffffe12aca3c
+       0.00 :   63:xor    %eax,%eax
+  -    2.18 :   65:leaveq
+  -    2.82 :   66:retq
+  +    2.18 :   65:leave
+  +    2.82 :   66:ret
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-5-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/perf/Makefile.config | 8 ++++++++
+ tools/perf/util/annotate.c | 7 ++++---
+ 2 files changed, 12 insertions(+), 3 deletions(-)
+
+diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
+index d3c254c0f5c611..23648ea54e8d3d 100644
+--- a/tools/perf/Makefile.config
++++ b/tools/perf/Makefile.config
+@@ -298,6 +298,7 @@ FEATURE_CHECK_LDFLAGS-libpython := $(PYTHON_EMBED_LDOPTS)
+ FEATURE_CHECK_LDFLAGS-libaio = -lrt
+ 
+ FEATURE_CHECK_LDFLAGS-disassembler-four-args = -lbfd -lopcodes -ldl
++FEATURE_CHECK_LDFLAGS-disassembler-init-styled = -lbfd -lopcodes -ldl
+ 
+ CORE_CFLAGS += -fno-omit-frame-pointer
+ CORE_CFLAGS += -ggdb3
+@@ -818,13 +819,16 @@ else
+   ifeq ($(feature-libbfd-liberty), 1)
+     EXTLIBS += -lbfd -lopcodes -liberty
+     FEATURE_CHECK_LDFLAGS-disassembler-four-args += -liberty -ldl
++    FEATURE_CHECK_LDFLAGS-disassembler-init-styled += -liberty -ldl
+   else
+     ifeq ($(feature-libbfd-liberty-z), 1)
+       EXTLIBS += -lbfd -lopcodes -liberty -lz
+       FEATURE_CHECK_LDFLAGS-disassembler-four-args += -liberty -lz -ldl
++      FEATURE_CHECK_LDFLAGS-disassembler-init-styled += -liberty -lz -ldl
+     endif
+   endif
+   $(call feature_check,disassembler-four-args)
++  $(call feature_check,disassembler-init-styled)
+ endif
+ 
+ ifeq ($(feature-libbfd-buildid), 1)
+@@ -1044,6 +1048,10 @@ ifeq ($(feature-disassembler-four-args), 1)
+     CFLAGS += -DDISASM_FOUR_ARGS_SIGNATURE
+ endif
+ 
++ifeq ($(feature-disassembler-init-styled), 1)
++    CFLAGS += -DDISASM_INIT_STYLED
++endif
++
+ ifeq (${IS_64_BIT}, 1)
+   ifndef NO_PERF_READ_VDSO32
+     $(call feature_check,compile-32)
+diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
+index 82cc396ef516c4..2c6a485c3de5d9 100644
+--- a/tools/perf/util/annotate.c
++++ b/tools/perf/util/annotate.c
+@@ -1676,6 +1676,7 @@ fallback:
+ #define PACKAGE "perf"
+ #include <bfd.h>
+ #include <dis-asm.h>
++#include <tools/dis-asm-compat.h>
+ 
+ static int symbol__disassemble_bpf(struct symbol *sym,
+ 				   struct annotate_args *args)
+@@ -1762,9 +1763,9 @@ static int symbol__disassemble_bpf(struct symbol *sym,
+ 		ret = errno;
+ 		goto out;
+ 	}
+-	init_disassemble_info(&info, s,
+-			      (fprintf_ftype) fprintf);
+-
++	init_disassemble_info_compat(&info, s,
++				     (fprintf_ftype) fprintf,
++				     fprintf_styled);
+ 	info.arch = bfd_get_arch(bfdf);
+ 	info.mach = bfd_get_mach(bfdf);
+ 

From a59f4a952366e4466d5201df1d3a46839af6466a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 14:45:28 -0700
Subject: [PATCH 25/51] libsasl: fix build for libtool 2.4.7

---
 srcpkgs/libsasl/template | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/libsasl/template b/srcpkgs/libsasl/template
index a8817042f843..a2993b39f4a1 100644
--- a/srcpkgs/libsasl/template
+++ b/srcpkgs/libsasl/template
@@ -19,6 +19,7 @@ distfiles="https://github.com/cyrusimap/cyrus-sasl/releases/download/cyrus-sasl-
 checksum=26866b1549b00ffd020f188a43c258017fa1c382b3ddadd8201536f72efb05d5
 
 pre_configure() {
+	rm -f m4/ltversion.m4
 	autoreconf -fi
 }
 

From b143513c85737213d9804f6f626e76350ab669e2 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:08 -0700
Subject: [PATCH 26/51] subversion: fix build for libtool 2.4.7

---
 srcpkgs/subversion/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion/template b/srcpkgs/subversion/template
index 8ad178264942..3f1c9e254e61 100644
--- a/srcpkgs/subversion/template
+++ b/srcpkgs/subversion/template
@@ -57,7 +57,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From 07a173ca2d94fd26423f1cf13fceb6ce6a39ead9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:38 -0700
Subject: [PATCH 27/51] subversion-kwallet-auth: fix build for libtool 2.4.7

---
 srcpkgs/subversion-kwallet-auth/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion-kwallet-auth/template b/srcpkgs/subversion-kwallet-auth/template
index 12210f250d51..b4d8621456ea 100644
--- a/srcpkgs/subversion-kwallet-auth/template
+++ b/srcpkgs/subversion-kwallet-auth/template
@@ -59,7 +59,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From eb153abe9085c58a7c5b28aeb6f74c8c0a75ed8d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 20:07:32 -0700
Subject: [PATCH 28/51] gpgme: update to 1.18.0.

---
 common/shlibs          | 2 +-
 srcpkgs/gpgme/template | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index e00070c014f3..755044345fd2 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -722,7 +722,7 @@ libdconf.so.1 dconf-0.13.90_1
 libassuan.so.0 libassuan-2.0.1_1
 libgpgme.so.11 libgpgme-1.12.0_2
 libgpgmepp.so.6 gpgmepp-1.7.0_3
-libqgpgme.so.7 gpgmeqt-1.7.0_3
+libqgpgme.so.15 gpgmeqt-1.18.0_1
 libgarcon-1.so.0 garcon-0.1.12_1
 libgarcon-gtk2-1.so.0 garcon-0.4.0_1
 libgarcon-gtk3-1.so.0 garcon-0.6.1_1
diff --git a/srcpkgs/gpgme/template b/srcpkgs/gpgme/template
index 8633075a8404..b1cfd5f78657 100644
--- a/srcpkgs/gpgme/template
+++ b/srcpkgs/gpgme/template
@@ -1,7 +1,7 @@
 # Template file for 'gpgme'
 pkgname=gpgme
-version=1.15.1
-revision=2
+version=1.18.0
+revision=1
 build_style=gnu-configure
 configure_args="--enable-fd-passing
  --with-libgpg-error-prefix=$XBPS_CROSS_BASE/usr
@@ -14,7 +14,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.gnupg.org/software/gpgme/index.html"
 distfiles="https://www.gnupg.org/ftp/gcrypt/gpgme/gpgme-${version}.tar.bz2"
-checksum=eebc3c1b27f1c8979896ff361ba9bb4778b508b2496c2fc10e3775a40b1de1ad
+checksum=361d4eae47ce925dba0ea569af40e7b52c645c4ae2e65e5621bf1b6cdd8b0e9e
 
 if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
 	configure_args+=" ac_cv_sys_file_offset_bits=no"

From d94b2ca395b0234f0b3420c1775aaa128864fe51 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 29/51] cross-aarch64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..bd6b23f9fb6a 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 9dc273453362ea7981aa0ff0e4e817a79ce4ffce Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 30/51] cross-aarch64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..427ad2c1e9cd 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From b80725d540a5f097cad205b1d8579b5eb2bce583 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 31/51] cross-arm-linux-gnueabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..2510ee26e789 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 0156282f8d35bd99a11b8bebb6225f6d2200668d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 32/51] cross-arm-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..bd8b16e1b4c1 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From f1563ec85f54803ed0ebc634fb80943a374d0086 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 33/51] cross-arm-linux-musleabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..dacfd2655216 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 55fc7990cbb5a72ec32df463f20f92acaa831896 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 34/51] cross-arm-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..9ddd32a9f20d 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From e9af21312331343bf8a5b95cfac49207e0302e7f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 35/51] cross-armv7l-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..9fb00f18be3b 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 9d792c52003bc41a2a9c936044a314b4dab9523a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 36/51] cross-armv7l-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..2c72e75ddfe3 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 0de5ba223b14370ff501e68096086a7dc739c917 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 37/51] cross-i686-pc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..4dc17df648b5 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 610026fcd8caa4cfc689ce84f50cf9ebfc99d41f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 38/51] cross-mips-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..6009e5c79eb2 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From c6cd679c24251eed30d50f0e7d919e53fe2c3c9e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 39/51] cross-mips-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..080164df193d 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="hipperson0 <hipperson0@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From a0da8440eac7c9c81eb0200b518667fb95459860 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 40/51] cross-mipsel-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..f9fd4b8a04ef 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 9ad755cb66da0f2ea0c9d4cdb3b4b9d0d30ac17e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 41/51] cross-mipsel-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..7418a984474b 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From ea845e6ffbcfd9f486c89298dd4c10f8763a310d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 42/51] cross-powerpc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..31e57b4e52b2 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From ea83508d5046fc928b454dc2856defeb6f2f66a9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 43/51] cross-powerpc-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..a2d1edcf1ffd 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From c157e0651269f96d53ff408c5f73ae3919d0d103 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 44/51] cross-powerpc64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..1a4cbed61e76 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 58012a35daf172d39ed1830209feabc688100f0c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 45/51] cross-powerpc64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 1ebd0fb2048d..ade42018af05 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 6c18eeaa297b9768940c8667347b306aebe5737b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 46/51] cross-powerpc64le-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 733f5851da5c..03054239001e 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From a9313b27fc50f773e928bfae4fe2d29d92a1a00d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 47/51] cross-powerpc64le-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index 76a70aa1d6db..5887f845f932 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From cdd2437bc57cb003be031a76582b29cec116ac11 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 48/51] cross-powerpcle-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 347b8fcf4f55..06530e0d609b 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From aa3335d9fa0f3a2c9e158c24f1e2bf46a5e56e53 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 49/51] cross-powerpcle-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index ec9324ddaa99..e68c3962b49c 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 5d84ab08044b1b58ce3ecb23cd13332716af362f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 50/51] cross-x86_64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 0078fbe7224b..7da85c14b62d 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 0d166b549da882c63a4ce5c7958539f3ded5ae8e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 51/51] cross-x86_64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..2811de0d3c2e 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (64 preceding siblings ...)
  2022-08-26 20:31 ` [PR PATCH] [Updated] " oreo639
@ 2022-08-28 22:23 ` oreo639
  2022-09-03  4:18 ` oreo639
                   ` (198 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-08-28 22:23 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5538 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.2.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.2.0

This PR depends on: https://github.com/void-linux/void-packages/pull/32330

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

Also, keep in mind that the libgo musl patch here will need to be updated once musl is updated:
https://github.com/void-linux/void-packages/pull/34902/files#diff-1f42a95b93c9550178ff1fbccbef2f47a72711df15c24c9472e2550076978129R163-R176

This is the updated patch for reference:
https://github.com/alpinelinux/aports/blob/8acb21b8ee881e7ab1c812d9a66a17d2501b8730/main/gcc/0049-libgo-adjust-name-of-union-in-sigevent-struct.patch

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/38817
- [x] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [ ] llvm https://github.com/void-linux/void-packages/pull/38694
- [ ] m4 https://github.com/void-linux/void-packages/pull/33730
- [ ] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [ ] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [ ] libvirt https://github.com/void-linux/void-packages/pull/38842
- [ ] syslinux https://github.com/void-linux/void-packages/pull/38876
- [ ] efivar https://github.com/void-linux/void-packages/pull/38874

Known packages that needed to be fixed/updated for gcc12:
- [ ] linux5.18 (in this PR)
- [ ] openssh https://github.com/void-linux/void-packages/pull/38849
- [ ] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [ ] doxygen https://github.com/void-linux/void-packages/pull/38846
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/38817
- [ ] libproxy https://github.com/void-linux/void-packages/pull/38818
- [ ] exempi https://github.com/void-linux/void-packages/pull/38820
- [ ] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [ ] gpgme https://github.com/void-linux/void-packages/pull/38825
- [x] libunique1 https://github.com/void-linux/void-packages/pull/38848 or https://github.com/void-linux/void-packages/pull/38873
- [ ] libwpd https://github.com/void-linux/void-packages/pull/38878

Needs to be fixed/updated for binutils:
- [ ] grub https://github.com/void-linux/void-packages/pull/38875
- [ ] linux-tools https://github.com/void-linux/void-packages/pull/38877

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [x] kde
- [x] lxde
- [x] lxqt

You can test the ISOs here:
https://drive.google.com/drive/folders/1ix92CYSLUP-KWjLxltdgG4e8Nu2JCY5n?usp=sharing

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 161098 bytes --]

From 1c87f3bdf04b3ac7289028508c13b359cb4fcfaa Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 01/48] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 15 +++--
 3 files changed, 28 insertions(+), 113 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..0578665c1a30 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkg-config"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -44,6 +45,12 @@ do_configure() {
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	# gprofng currently only supports x86 and aarch64 glibc.
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64|i386|aarch64) conf+=" --enable-gprofng" ;;
+		*) conf+=" --disable-gprofng" ;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"

From 44789753a9a43bbaf0cfda067f695e45a0f0b791 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 02/48] gcc: update to 12.2.0.

---
 common/shlibs                                 | 10 +--
 srcpkgs/gcc/files/gccgo-musl.patch            | 74 ++++---------------
 srcpkgs/gcc/files/libgnarl-musl.patch         | 18 ++---
 srcpkgs/gcc/files/libssp-musl.patch           | 10 +--
 srcpkgs/gcc/patches/libffi_gnulinux.patch     | 11 ---
 .../gcc/patches/libgcc-ibm128-no-tag.patch    | 10 ++-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |  2 +-
 srcpkgs/gcc/template                          | 25 +++----
 8 files changed, 52 insertions(+), 108 deletions(-)
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index 48c63f2d0735..cd5ddcbf7d94 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.2.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.34 perl-5.34.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -847,8 +847,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.2.0_1
+libgnat-12.so libada-12.2.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1698,8 +1698,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.2.0_1
+libasan.so.8 libsanitizer-12.2.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..632ef951097b 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,17 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ a/libgo/go/runtime/os_linux.go
+@@ -363,9 +363,9 @@
+ 
+ 	var timerid int32
+ 	var sevp _sigevent
+-	sevp.sigev_notify = _SIGEV_THREAD_ID
++	sevp.sigev_notify = 4
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.sigev_notify_function))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..446741390d45 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,15 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
+version=12.2.0
+revision=1
 _patchver="${version%pre*}"
 _minorver="${_patchver%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 wrksrc=gcc-${version/pre/_pre}
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +19,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -396,7 +393,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}

From 10dff2151e8d115a001d2ab82630c5181c67d181 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 03/48] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      | 11 ++++--
 2 files changed, 25 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..70c4aa533e66 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,12 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
+
+if [ "$XBPS_LIBC" == "musl" ]; then
+# Musl always searches LD_LIBRARY_PATH before RPATH and RUNPATH
+make_build_args="lt_cv_shlibpath_overrides_runpath=yes"
+fi
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From e7932680f0197515d520809b2fa85cb638ff1340 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 04/48] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 1a4e1ca3d594..b04268908c2e 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="q66 <daniel@octaforge.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From 5c73ee7df7d651faa638e33658a36cfbf8672c1e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 05/48] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 3 files changed, 55 insertions(+), 353 deletions(-)
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index cd5ddcbf7d94..89e363c4de54 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From e655873d4a33df3c2427ce31b2f4ce540de103ef Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 21:01:43 -0700
Subject: [PATCH 06/48] gcc-multilib: update to 12.2.0.

---
 srcpkgs/gcc-multilib/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index fcd25755aa75..1a26da26a991 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,16 +3,16 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _majorver="${version%.*}"
-wrksrc=gcc-${version/pre/_pre}
+wrksrc=gcc-${version}
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel

From 487cff85b3eefdfd6ac7cd06a1c2bd1a8ad721ef Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 16:22:03 -0700
Subject: [PATCH 07/48] llvm12: fix build for glibc 2.36

---
 .../compiler-rt-sanitizer-glibc-2.36.patch    | 59 +++++++++++++++++++
 1 file changed, 59 insertions(+)
 create mode 100644 srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch

diff --git a/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch b/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch
new file mode 100644
index 000000000000..e5f24dab8935
--- /dev/null
+++ b/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch
@@ -0,0 +1,59 @@
+From 9cf13067cb5088626ba7ee1ec4c42ec59c7995a0 Mon Sep 17 00:00:00 2001
+From: Fangrui Song <i@maskray.me>
+Date: Mon, 11 Jul 2022 12:53:34 -0700
+Subject: [PATCH] [sanitizer] Remove #include <linux/fs.h> to resolve
+ fsconfig_command/mount_attr conflict with glibc 2.36
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+It is generally not a good idea to mix usage of glibc headers and Linux UAPI
+headers (https://sourceware.org/glibc/wiki/Synchronizing_Headers). In glibc
+since 7eae6a91e9b1670330c9f15730082c91c0b1d570 (milestone: 2.36), sys/mount.h
+defines `fsconfig_command` which conflicts with linux/mount.h:
+
+    .../usr/include/linux/mount.h:95:6: error: redeclaration of ‘enum fsconfig_command’
+
+Remove #include <linux/fs.h> which pulls in linux/mount.h. Expand its 4 macros manually.
+Android sys/mount.h doesn't define BLKBSZGET and it still needs linux/fs.h.
+In the long term we should move Linux specific definitions to sanitizer_platform_limits_linux.cpp
+but this commit is easy to cherry pick into older compiler-rt releases.
+
+Fix https://github.com/llvm/llvm-project/issues/56421
+
+Reviewed By: #sanitizers, vitalybuka, zatrazz
+
+Differential Revision: https://reviews.llvm.org/D129471
+---
+ .../sanitizer_platform_limits_posix.cpp                | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+index 4bd425435d56d..3a94b260686f1 100644
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -73,7 +73,9 @@
+ #include <sys/vt.h>
+ #include <linux/cdrom.h>
+ #include <linux/fd.h>
++#if SANITIZER_ANDROID
+ #include <linux/fs.h>
++#endif
+ #include <linux/hdreg.h>
+ #include <linux/input.h>
+ #include <linux/ioctl.h>
+@@ -876,10 +878,10 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
+   unsigned IOCTL_EVIOCGPROP = IOCTL_NOT_PRESENT;
+   unsigned IOCTL_EVIOCSKEYCODE_V2 = IOCTL_NOT_PRESENT;
+ #endif
+-  unsigned IOCTL_FS_IOC_GETFLAGS = FS_IOC_GETFLAGS;
+-  unsigned IOCTL_FS_IOC_GETVERSION = FS_IOC_GETVERSION;
+-  unsigned IOCTL_FS_IOC_SETFLAGS = FS_IOC_SETFLAGS;
+-  unsigned IOCTL_FS_IOC_SETVERSION = FS_IOC_SETVERSION;
++  unsigned IOCTL_FS_IOC_GETFLAGS = _IOR('f', 1, long);
++  unsigned IOCTL_FS_IOC_GETVERSION = _IOR('v', 1, long);
++  unsigned IOCTL_FS_IOC_SETFLAGS = _IOW('f', 2, long);
++  unsigned IOCTL_FS_IOC_SETVERSION = _IOW('v', 2, long);
+   unsigned IOCTL_GIO_CMAP = GIO_CMAP;
+   unsigned IOCTL_GIO_FONT = GIO_FONT;
+   unsigned IOCTL_GIO_UNIMAP = GIO_UNIMAP;

From 50361b97e4f6e4dc59481d2e3b28fb27bd7937c0 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 17:21:40 -0700
Subject: [PATCH 08/48] m4: update to 1.4.19.

---
 srcpkgs/m4/patches/fix-glibc-2.27.patch | 167 ------------------------
 srcpkgs/m4/template                     |  12 +-
 2 files changed, 6 insertions(+), 173 deletions(-)
 delete mode 100644 srcpkgs/m4/patches/fix-glibc-2.27.patch

diff --git a/srcpkgs/m4/patches/fix-glibc-2.27.patch b/srcpkgs/m4/patches/fix-glibc-2.27.patch
deleted file mode 100644
index 59d33cff164d..000000000000
--- a/srcpkgs/m4/patches/fix-glibc-2.27.patch
+++ /dev/null
@@ -1,167 +0,0 @@
-From 4af4a4a71827c0bc5e0ec67af23edef4f15cee8e Mon Sep 17 00:00:00 2001
-From: Paul Eggert <eggert@cs.ucla.edu>
-Date: Mon, 5 Mar 2018 10:56:29 -0800
-Subject: [PATCH] fflush: adjust to glibc 2.28 libio.h removal
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Problem reported by Daniel P. Berrangé in:
-https://lists.gnu.org/r/bug-gnulib/2018-03/msg00000.html
-* lib/fbufmode.c (fbufmode):
-* lib/fflush.c (clear_ungetc_buffer_preserving_position)
-(disable_seek_optimization, rpl_fflush):
-* lib/fpending.c (__fpending):
-* lib/fpurge.c (fpurge):
-* lib/freadable.c (freadable):
-* lib/freadahead.c (freadahead):
-* lib/freading.c (freading):
-* lib/freadptr.c (freadptr):
-* lib/freadseek.c (freadptrinc):
-* lib/fseeko.c (fseeko):
-* lib/fseterr.c (fseterr):
-* lib/fwritable.c (fwritable):
-* lib/fwriting.c (fwriting):
-Check _IO_EOF_SEEN instead of _IO_ftrylockfile.
-* lib/stdio-impl.h (_IO_IN_BACKUP) [_IO_EOF_SEEN]:
-Define if not already defined.
-
-[yann.morin.1998@free.fr: partially backport from upstream gnulib]
-Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
-
----
- lib/fflush.c     |  6 +++---
- lib/fpending.c   |  2 +-
- lib/fpurge.c     |  2 +-
- lib/freadahead.c |  2 +-
- lib/freading.c   |  2 +-
- lib/fseeko.c     |  4 ++--
- lib/stdio-impl.h |  6 ++++++
- 7 files changed, 15 insertions(+), 9 deletions(-)
-
-diff --git a/lib/fflush.c b/build-aux/gnulib/lib/fflush.c
-index 983ade0ff..a6edfa105 100644
---- a/lib/fflush.c
-+++ b/lib/fflush.c
-@@ -33,7 +33,7 @@
- #undef fflush
- 
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- 
- /* Clear the stream's ungetc buffer, preserving the value of ftello (fp).  */
- static void
-@@ -72,7 +72,7 @@ clear_ungetc_buffer (FILE *fp)
- 
- #endif
- 
--#if ! (defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
-+#if ! (defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
- 
- # if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT
- /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
-@@ -148,7 +148,7 @@ rpl_fflush (FILE *stream)
-   if (stream == NULL || ! freading (stream))
-     return fflush (stream);
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- 
-   clear_ungetc_buffer_preserving_position (stream);
- 
-diff --git a/lib/fpending.c b/build-aux/gnulib/lib/fpending.c
-index c84e3a5b4..789f50e4e 100644
---- a/lib/fpending.c
-+++ b/lib/fpending.c
-@@ -32,7 +32,7 @@ __fpending (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   return fp->_IO_write_ptr - fp->_IO_write_base;
- #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
-   /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
-diff --git a/lib/fpurge.c b/build-aux/gnulib/lib/fpurge.c
-index b1d417c7a..3aedcc373 100644
---- a/lib/fpurge.c
-+++ b/lib/fpurge.c
-@@ -62,7 +62,7 @@ fpurge (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   fp->_IO_read_end = fp->_IO_read_ptr;
-   fp->_IO_write_ptr = fp->_IO_write_base;
-   /* Avoid memory leak when there is an active ungetc buffer.  */
-diff --git a/lib/freadahead.c b/build-aux/gnulib/lib/freadahead.c
-index c2ecb5b28..23ec76ee5 100644
---- a/lib/freadahead.c
-+++ b/lib/freadahead.c
-@@ -30,7 +30,7 @@ extern size_t __sreadahead (FILE *);
- size_t
- freadahead (FILE *fp)
- {
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   if (fp->_IO_write_ptr > fp->_IO_write_base)
-     return 0;
-   return (fp->_IO_read_end - fp->_IO_read_ptr)
-diff --git a/lib/freading.c b/build-aux/gnulib/lib/freading.c
-index 73c28acdd..c24d0c88a 100644
---- a/lib/freading.c
-+++ b/lib/freading.c
-@@ -31,7 +31,7 @@ freading (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   return ((fp->_flags & _IO_NO_WRITES) != 0
-           || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0
-               && fp->_IO_read_base != NULL));
-diff --git a/lib/fseeko.c b/build-aux/gnulib/lib/fseeko.c
-index 0101ab55f..193f4e8ce 100644
---- a/lib/fseeko.c
-+++ b/lib/fseeko.c
-@@ -47,7 +47,7 @@ fseeko (FILE *fp, off_t offset, int whence)
- #endif
- 
-   /* These tests are based on fpurge.c.  */
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   if (fp->_IO_read_end == fp->_IO_read_ptr
-       && fp->_IO_write_ptr == fp->_IO_write_base
-       && fp->_IO_save_base == NULL)
-@@ -123,7 +123,7 @@ fseeko (FILE *fp, off_t offset, int whence)
-           return -1;
-         }
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-       fp->_flags &= ~_IO_EOF_SEEN;
-       fp->_offset = pos;
- #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
-diff --git a/lib/stdio-impl.h b/build-aux/gnulib/lib/stdio-impl.h
-index 78d896e9f..05c5752a2 100644
---- a/lib/stdio-impl.h
-+++ b/lib/stdio-impl.h
-@@ -18,6 +18,12 @@
-    the same implementation of stdio extension API, except that some fields
-    have different naming conventions, or their access requires some casts.  */
- 
-+/* Glibc 2.28 made _IO_IN_BACKUP private.  For now, work around this
-+   problem by defining it ourselves.  FIXME: Do not rely on glibc
-+   internals.  */
-+#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN
-+# define _IO_IN_BACKUP 0x100
-+#endif
- 
- /* BSD stdio derived implementations.  */
- 
--- 
-2.14.1
-
-
diff --git a/srcpkgs/m4/template b/srcpkgs/m4/template
index 78f3dae6184a..762593d883bd 100644
--- a/srcpkgs/m4/template
+++ b/srcpkgs/m4/template
@@ -1,17 +1,17 @@
 # Template file for 'm4'
 pkgname=m4
-version=1.4.18
-revision=2
+version=1.4.19
+revision=1
 bootstrap=yes
-replaces="chroot-m4>=0"
 build_style=gnu-configure
 configure_args="--enable-changeword --enable-threads"
 short_desc="GNU version of UNIX m4 macro language processor"
-homepage="https://www.gnu.org/software/m4/"
-license="GPL-3.0-or-later"
 maintainer="Enno Boland <gottox@voidlinux.org>"
+license="GPL-3.0-or-later"
+homepage="https://www.gnu.org/software/m4/"
 distfiles="${GNU_SITE}/${pkgname}/${pkgname}-${version}.tar.xz"
-checksum=f2c1e86ca0a404ff281631bdc8377638992744b175afb806e25871a24a934e07
+checksum=63aede5c6d33b6d9b13511cd0be2cac046f2e70fd0a07aa9573a04a82783af96
+replaces="chroot-m4>=0"
 
 if [ "$XBPS_TARGET_LIBC" = musl ]; then
 	export ac_cv_lib_error_at_line=no

From c3f21e541468e0f76cb316bfd6789e72811067de Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 22:57:59 -0700
Subject: [PATCH 09/48] btrfs-progs: update to 5.19.

---
 srcpkgs/btrfs-progs/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/btrfs-progs/template b/srcpkgs/btrfs-progs/template
index f6c53d8587e1..292d5110106b 100644
--- a/srcpkgs/btrfs-progs/template
+++ b/srcpkgs/btrfs-progs/template
@@ -1,6 +1,6 @@
 # Template file for 'btrfs-progs'
 pkgname=btrfs-progs
-version=5.18.1
+version=5.19
 revision=1
 wrksrc="${pkgname}-v${version}"
 build_style=gnu-configure
@@ -16,7 +16,7 @@ license="GPL-2.0-only, LGPL-2.1-or-later"
 homepage="https://btrfs.wiki.kernel.org/index.php/Main_Page"
 changelog="https://raw.githubusercontent.com/kdave/btrfs-progs/master/CHANGES"
 distfiles="${KERNEL_SITE}/kernel/people/kdave/${pkgname}/${pkgname}-v${version}.tar.xz"
-checksum=6e98a75ccff52e9354daa1ad284c614c490f844273a2fa524cbac9eb841c7255
+checksum=1fbcf06e4b2f80e7a127fd687ed4625a5b74fa674fe212c836ff70e0edfcccf9
 # Most of the tests depend on `mount` and `fallocate` commands, which are not
 # presented in chroot-util-linux
 make_check=no

From d29add98f6d34bf92681dc1d462b399551eb478d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 19:39:23 -0700
Subject: [PATCH 10/48] syslinux: fix build for glibc 2.36

---
 .../patches/fix-build-with-glibc-2.36.patch   | 30 +++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 srcpkgs/syslinux/patches/fix-build-with-glibc-2.36.patch

diff --git a/srcpkgs/syslinux/patches/fix-build-with-glibc-2.36.patch b/srcpkgs/syslinux/patches/fix-build-with-glibc-2.36.patch
new file mode 100644
index 000000000000..1303be56c127
--- /dev/null
+++ b/srcpkgs/syslinux/patches/fix-build-with-glibc-2.36.patch
@@ -0,0 +1,30 @@
+--- a/linux/syslinux.c
++++ b/linux/syslinux.c
+@@ -45,7 +45,6 @@
+ #include <sys/stat.h>
+ #include <sys/types.h>
+ #include <sys/wait.h>
+-#include <sys/mount.h>
+ 
+ #include "linuxioctl.h"
+ 
+--- a/libinstaller/syslxcom.c
++++ b/libinstaller/syslxcom.c
+@@ -28,7 +28,6 @@
+ #include <errno.h>
+ #include <sys/stat.h>
+ #include <sys/types.h>
+-#include <sys/mount.h>
+ #include <sys/vfs.h>
+ 
+ #include "linuxioctl.h"
+--- a/extlinux/main.c
++++ b/extlinux/main.c
+@@ -40,7 +40,6 @@
+ #include <sys/stat.h>
+ #include <sys/sysmacros.h>
+ #include <sys/types.h>
+-#include <sys/mount.h>
+ #include <sys/vfs.h>
+ 
+ #include "linuxioctl.h"

From b861fe9b37c89c89dab369d8631f095f93a8b139 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 14 Aug 2022 19:29:36 -0700
Subject: [PATCH 11/48] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove -no-pie from build. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..58d94f8dacba 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -60,6 +60,7 @@ _void_cross_build_binutils() {
 		--disable-multilib \
 		--disable-werror \
 		--disable-gold \
+		--disable-gprofng \
 		--enable-relro \
 		--enable-plugins \
 		--enable-64-bit-bfd \
@@ -132,6 +133,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -460,6 +462,14 @@ do_build() {
 	local binutils_ver linux_ver gcc_ver libc_ver libucontext_ver
 	local tgt=${sourcepkg/cross-}
 
+	export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}"
+	export CXXFLAGS="${CXXFLAGS/-D_FORTIFY_SOURCE=2/}"
+
+	# Disable explicit -fno-PIE, gcc/binutils/libc will figure this out itself.
+	export CFLAGS="${CFLAGS//-fno-PIE/}"
+	export CXXFLAGS="${CXXFLAGS//-fno-PIE/}"
+	export LDFLAGS="${LDFLAGS//-no-pie/}"
+
 	_void_cross_test_ver binutils
 	_void_cross_test_ver linux
 	_void_cross_test_ver gcc
@@ -625,6 +635,9 @@ do_install() {
 	# then remove it because it conflicts with libquadmath package
 	rm -rf ${DESTDIR}/${sysroot}/usr/lib/libquadmath.*
 
+	# Remove libdep linker plugin because it conflicts with system binutils
+	rm -f ${DESTDIR}/usr/lib/bfd-plugins/libdep*
+
 	# Remove leftover symlinks
 	rm -f ${DESTDIR}/usr/lib${XBPS_TARGET_WORDSIZE}
 	rm -f ${DESTDIR}/lib*

From fb4dd8f003148b83a99aaa552e6e960b67cfcb9b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:08:52 -0700
Subject: [PATCH 12/48] openssh: suppress werror on gcc12

---
 srcpkgs/openssh/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/openssh/template b/srcpkgs/openssh/template
index 02a2dec35f42..6e8e343a9dca 100644
--- a/srcpkgs/openssh/template
+++ b/srcpkgs/openssh/template
@@ -40,7 +40,7 @@ if [ "$build_option_ldns" -a -z "$build_option_ssl" ]; then
 	broken="option 'ldns' requires option 'ssl'"
 fi
 
-CFLAGS="-Wno-format-truncation -Wno-stringop-truncation"
+CFLAGS="-Wno-format-truncation -Wno-stringop-truncation -Wno-error=maybe-uninitialized"
 
 case $XBPS_TARGET_MACHINE in
 	i686-musl)

From 06fb192b1cda00df7825b5ef11dcda8a5800a931 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:09:31 -0700
Subject: [PATCH 13/48] linux5.18: update dotconfigs for gcc12

---
 srcpkgs/linux5.18/files/x86_64-dotconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/linux5.18/files/x86_64-dotconfig b/srcpkgs/linux5.18/files/x86_64-dotconfig
index 4e73a3195d40..ea6204868e23 100644
--- a/srcpkgs/linux5.18/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.18/files/x86_64-dotconfig
@@ -512,6 +512,7 @@ CONFIG_RETHUNK=y
 CONFIG_CPU_UNRET_ENTRY=y
 CONFIG_CPU_IBPB_ENTRY=y
 CONFIG_CPU_IBRS_ENTRY=y
+CONFIG_SLS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10060,8 +10061,11 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
 # Memory initialization
 #
 CONFIG_INIT_STACK_NONE=y
+# CONFIG_INIT_STACK_ALL_PATTERN is not set
+# CONFIG_INIT_STACK_ALL_ZERO is not set
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
+# CONFIG_ZERO_CALL_USED_REGS is not set
 # end of Memory initialization
 # end of Kernel hardening options
 # end of Security options
@@ -10538,6 +10542,7 @@ CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
 # CONFIG_UBSAN is not set
 CONFIG_HAVE_ARCH_KCSAN=y
+# CONFIG_KCSAN is not set
 # end of Generic Kernel Debugging Instruments
 
 #

From a9d7521402fde98b7be51867372ce768ffbe687d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 18:00:42 -0700
Subject: [PATCH 14/48] xf86-video-vmware: fix build on gcc12

---
 ...183b3395333d5d4c73e25c2d011748f15eda.patch | 30 +++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch

diff --git a/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch b/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch
new file mode 100644
index 000000000000..ff839f16e628
--- /dev/null
+++ b/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch
@@ -0,0 +1,30 @@
+From 77b8183b3395333d5d4c73e25c2d011748f15eda Mon Sep 17 00:00:00 2001
+From: Rudi Heitbaum <rudi@heitbaum.com>
+Date: Sun, 8 May 2022 03:00:10 +0000
+Subject: [PATCH] vmwgfx: fix missing array notation
+
+ Fixes error identified by gcc-12.1.0 compiler
+
+make
+  CC       libvmwgfx_la-vmwgfx_tex_video.lo
+vmwgfx_tex_video.c: In function 'stop_video':
+vmwgfx_tex_video.c:240:20: error: the comparison will always evaluate as 'true' for the address of 'yuv' will never be NULL [-Werror=address]
+  240 |                if (priv->yuv[i]) {
+      |                    ^~~~
+---
+ vmwgfx/vmwgfx_tex_video.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/vmwgfx/vmwgfx_tex_video.c b/vmwgfx/vmwgfx_tex_video.c
+index acc2b56..480a5f1 100644
+--- a/vmwgfx/vmwgfx_tex_video.c
++++ b/vmwgfx/vmwgfx_tex_video.c
+@@ -237,7 +237,7 @@ stop_video(ScrnInfoPtr pScrn, pointer data, Bool shutdown)
+ 
+        for (i=0; i<3; ++i) {
+ 	   for (j=0; j<2; ++j) {
+-	       if (priv->yuv[i]) {
++	       if (priv->yuv[j][i]) {
+ 		   xa_surface_destroy(priv->yuv[j][i]);
+ 		   priv->yuv[j][i] = NULL;
+ 	       }

From 4fac4b9475f54904c98860dd3b5bf128f0a0bd81 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 18:24:37 -0700
Subject: [PATCH 15/48] doxygen: fix build for gcc 12

---
 srcpkgs/doxygen/patches/compat-gcc12.patch | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100644 srcpkgs/doxygen/patches/compat-gcc12.patch

diff --git a/srcpkgs/doxygen/patches/compat-gcc12.patch b/srcpkgs/doxygen/patches/compat-gcc12.patch
new file mode 100644
index 000000000000..666744a1dceb
--- /dev/null
+++ b/srcpkgs/doxygen/patches/compat-gcc12.patch
@@ -0,0 +1,22 @@
+From 5198966c8d5fec89116d025c74934ac03ea511fa Mon Sep 17 00:00:00 2001
+From: Dimitri van Heesch <doxygen@gmail.com>
+Date: Fri, 6 May 2022 09:55:16 +0200
+Subject: [PATCH] issue #9312: Build: cache.h:53:14: error: 'exchange' is not a
+ member of 'std'
+
+---
+ src/cache.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/cache.h b/src/cache.h
+index 0ff3092ed5..e218eb27d2 100644
+--- a/src/cache.h
++++ b/src/cache.h
+@@ -19,6 +19,7 @@
+ #include <list>
+ #include <unordered_map>
+ #include <mutex>
++#include <utility>
+ #include <ctype.h>
+ 
+ /*! Fixed size cache for value type V using keys of type K.

From fd6dab87e8e53d21fbe030b36df03f949d056abc Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 21 Aug 2022 21:37:00 -0700
Subject: [PATCH 16/48] openjdk7-bootstrap: fix build for gcc12

---
 .../files/dist_patches_glibc.txt              |  1 +
 .../files/dist_patches_musl.txt               |  1 +
 .../icedtea-pointer-comparison-gcc12.patch    | 31 +++++++++++++++++++
 3 files changed, 33 insertions(+)
 create mode 100644 srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch

diff --git a/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt b/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt
index c76c56855441..8061756dfc0c 100644
--- a/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt
+++ b/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt
@@ -6,3 +6,4 @@ icedtea-jdk-no-soname.patch
 icedtea-jdk-xattr.patch
 icedtea-jdk-sysctl_h.patch
 icedtea-cpio.patch
+icedtea-pointer-comparison-gcc12.patch
diff --git a/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt b/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt
index 21812517c7c2..8b35d9c46989 100644
--- a/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt
+++ b/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt
@@ -11,3 +11,4 @@ icedtea-jdk-musl.patch
 icedtea-jdk-no-soname.patch
 icedtea-jdk-xattr.patch
 icedtea-cpio.patch
+icedtea-pointer-comparison-gcc12.patch
diff --git a/srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch b/srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch
new file mode 100644
index 000000000000..c809553443e7
--- /dev/null
+++ b/srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch
@@ -0,0 +1,31 @@
+--- openjdk.orig/hotspot/src/share/vm/opto/lcm.cpp
++++ openjdk/hotspot/src/share/vm/opto/lcm.cpp
+@@ -60,7 +60,7 @@
+ // Check whether val is not-null-decoded compressed oop,
+ // i.e. will grab into the base of the heap if it represents NULL.
+ static bool accesses_heap_base_zone(Node *val) {
+-  if (Universe::narrow_oop_base() > 0) { // Implies UseCompressedOops.
++  if (Universe::narrow_oop_base() > (address)0) { // Implies UseCompressedOops.
+     if (val && val->is_Mach()) {
+       if (val->as_Mach()->ideal_Opcode() == Op_DecodeN) {
+         // This assumes all Decodes with TypePtr::NotNull are matched to nodes that
+--- openjdk.orig/hotspot/src/share/vm/runtime/virtualspace.cpp
++++ openjdk/hotspot/src/share/vm/runtime/virtualspace.cpp
+@@ -527,7 +527,7 @@ ReservedHeapSpace::ReservedHeapSpace(siz
+                 (UseCompressedOops && (Universe::narrow_oop_base() != NULL) &&
+                  Universe::narrow_oop_use_implicit_null_checks()) ?
+                   lcm(os::vm_page_size(), alignment) : 0) {
+-  if (base() > 0) {
++  if (base() > (char*)0) {
+     MemTracker::record_virtual_memory_type((address)base(), mtJavaHeap);
+   }
+ 
+@@ -546,7 +546,7 @@ ReservedHeapSpace::ReservedHeapSpace(con
+                 (UseCompressedOops && (Universe::narrow_oop_base() != NULL) &&
+                  Universe::narrow_oop_use_implicit_null_checks()) ?
+                   lcm(os::vm_page_size(), prefix_align) : 0) {
+-  if (base() > 0) {
++  if (base() > (char*)0) {
+     MemTracker::record_virtual_memory_type((address)base(), mtJavaHeap);
+   }
+ 

From 0244dc5c1b4d3c1624f4c4919d7508feed7f77b8 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:39:52 -0700
Subject: [PATCH 17/48] libvirt: fix build for glibc 2.36

---
 .../patches/lxc-fix-compat-glibc-2.36.patch   | 34 ++++++++++++++++
 .../virfile-fix-compat-glibc-2.36.patch       | 39 +++++++++++++++++++
 2 files changed, 73 insertions(+)
 create mode 100644 srcpkgs/libvirt/patches/lxc-fix-compat-glibc-2.36.patch
 create mode 100644 srcpkgs/libvirt/patches/virfile-fix-compat-glibc-2.36.patch

diff --git a/srcpkgs/libvirt/patches/lxc-fix-compat-glibc-2.36.patch b/srcpkgs/libvirt/patches/lxc-fix-compat-glibc-2.36.patch
new file mode 100644
index 000000000000..d85b57815010
--- /dev/null
+++ b/srcpkgs/libvirt/patches/lxc-fix-compat-glibc-2.36.patch
@@ -0,0 +1,34 @@
+From 9493c9b79dc541ec9e0fd73c6d87bdf8d30aaa90 Mon Sep 17 00:00:00 2001
+From: Cole Robinson <crobinso@redhat.com>
+Date: Mon, 1 Aug 2022 15:20:38 -0400
+Subject: [PATCH] lxc: containter: fix build with glibc 2.36
+
+With glibc 2.36, sys/mount.h and linux/mount.h conflict:
+https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
+
+lxc_container.c imports sys/mount.h and linux/fs.h, which pulls in
+linux/mount.h.
+
+linux/fs.h isn't required here though. glibc sys/mount.h has had
+MS_MOVE since 2.12 in 2010
+
+Reviewed-by: Erik Skultety <eskultet@redhat.com>
+Signed-off-by: Cole Robinson <crobinso@redhat.com>
+---
+ src/lxc/lxc_container.c | 3 ---
+ 1 file changed, 3 deletions(-)
+
+diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
+index b5278831da7..a5401c2186e 100644
+--- a/src/lxc/lxc_container.c
++++ b/src/lxc/lxc_container.c
+@@ -33,9 +33,6 @@
+ /* Yes, we want linux private one, for _syscall2() macro */
+ #include <linux/unistd.h>
+ 
+-/* For MS_MOVE */
+-#include <linux/fs.h>
+-
+ #if WITH_CAPNG
+ # include <cap-ng.h>
+ #endif
diff --git a/srcpkgs/libvirt/patches/virfile-fix-compat-glibc-2.36.patch b/srcpkgs/libvirt/patches/virfile-fix-compat-glibc-2.36.patch
new file mode 100644
index 000000000000..2ef227ea9b54
--- /dev/null
+++ b/srcpkgs/libvirt/patches/virfile-fix-compat-glibc-2.36.patch
@@ -0,0 +1,39 @@
+From c0d9adf220dc0d223330a7bac37b174132d330ba Mon Sep 17 00:00:00 2001
+From: Cole Robinson <crobinso@redhat.com>
+Date: Mon, 1 Aug 2022 15:24:01 -0400
+Subject: [PATCH] virfile: Fix build with glibc 2.36
+
+With glibc 2.36, sys/mount.h and linux/mount.h conflict:
+https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
+
+virfile.c imports sys/mount.h and linux/fs.h, which pulls in
+linux/mount.h.
+
+Manually define the constants we need from linux/fs.h, like was
+done in llvm:
+
+https://reviews.llvm.org/rGb379129c4beb3f26223288627a1291739f33af02
+
+Reviewed-by: Erik Skultety <eskultet@redhat.com>
+Signed-off-by: Cole Robinson <crobinso@redhat.com>
+---
+ src/util/virfile.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/src/util/virfile.c b/src/util/virfile.c
+index 99da058db3b..ce541b8946b 100644
+--- a/src/util/virfile.c
++++ b/src/util/virfile.c
+@@ -71,7 +71,11 @@
+ # endif
+ # include <sys/ioctl.h>
+ # include <linux/cdrom.h>
+-# include <linux/fs.h>
++/* These come from linux/fs.h, but that header conflicts with
++ * sys/mount.h on glibc 2.36+ */
++# define FS_IOC_GETFLAGS _IOR('f', 1, long)
++# define FS_IOC_SETFLAGS _IOW('f', 2, long)
++# define FS_NOCOW_FL 0x00800000
+ #endif
+ 
+ #if WITH_LIBATTR

From a40ef6364aee484cb7e55569bafee830f531c5c1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:41:50 -0700
Subject: [PATCH 18/48] efivar: fix build for glibc 2.36

---
 .../patches/fix-compat-glibc-2.36.patch       | 55 +++++++++++++++++++
 1 file changed, 55 insertions(+)
 create mode 100644 srcpkgs/efivar/patches/fix-compat-glibc-2.36.patch

diff --git a/srcpkgs/efivar/patches/fix-compat-glibc-2.36.patch b/srcpkgs/efivar/patches/fix-compat-glibc-2.36.patch
new file mode 100644
index 000000000000..fcc83aef20cf
--- /dev/null
+++ b/srcpkgs/efivar/patches/fix-compat-glibc-2.36.patch
@@ -0,0 +1,55 @@
+From bc65d63ebf8fe6ac8a099ff15ca200986dba1565 Mon Sep 17 00:00:00 2001
+From: Robbie Harwood <rharwood@redhat.com>
+Date: Thu, 28 Jul 2022 16:11:24 -0400
+Subject: [PATCH] Fix glibc 2.36 build (mount.h conflicts)
+
+glibc has decided that sys/mount.h and linux/mount.h are no longer
+usable at the same time.  This broke the build, since linux/fs.h itself
+includes linux/mount.h.  For now, fix the build by only including
+sys/mount.h where we need it.
+
+See-also: https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
+Resolves: #227
+Signed-off-by: Robbie Harwood <rharwood@redhat.com>
+---
+ src/gpt.c   | 1 +
+ src/linux.c | 1 +
+ src/util.h  | 1 -
+ 3 files changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/gpt.c b/src/gpt.c
+index 1eda0497..21413c3b 100644
+--- a/src/gpt.c
++++ b/src/gpt.c
+@@ -17,6 +17,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <sys/mount.h>
+ #include <sys/param.h>
+ #include <sys/stat.h>
+ #include <sys/utsname.h>
+diff --git a/src/linux.c b/src/linux.c
+index 47e45ae4..1780816f 100644
+--- a/src/linux.c
++++ b/src/linux.c
+@@ -20,6 +20,7 @@
+ #include <stdbool.h>
+ #include <stdio.h>
+ #include <sys/ioctl.h>
++#include <sys/mount.h>
+ #include <sys/socket.h>
+ #include <sys/sysmacros.h>
+ #include <sys/types.h>
+diff --git a/src/util.h b/src/util.h
+index 3300666f..1e67e447 100644
+--- a/src/util.h
++++ b/src/util.h
+@@ -23,7 +23,6 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <sys/ioctl.h>
+-#include <sys/mount.h>
+ #include <sys/stat.h>
+ #include <sys/types.h>
+ #include <tgmath.h>

From 56791bad76bbf609912c04dba3d4dfd7074545fe Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:43:24 -0700
Subject: [PATCH 19/48] libwpd: fix build for gcc12

---
 srcpkgs/libwpd/patches/fix-compat-gcc12.patch | 11 +++++++++++
 1 file changed, 11 insertions(+)
 create mode 100644 srcpkgs/libwpd/patches/fix-compat-gcc12.patch

diff --git a/srcpkgs/libwpd/patches/fix-compat-gcc12.patch b/srcpkgs/libwpd/patches/fix-compat-gcc12.patch
new file mode 100644
index 000000000000..6ebce2463d16
--- /dev/null
+++ b/srcpkgs/libwpd/patches/fix-compat-gcc12.patch
@@ -0,0 +1,11 @@
+diff -rup libwpd-0.10.3.orig/src/lib/WPXTable.h libwpd-0.10.3/src/lib/WPXTable.h
+--- libwpd-0.10.3.orig/src/lib/WPXTable.h	2022-08-23 22:32:45.332593795 -0700
++++ libwpd-0.10.3/src/lib/WPXTable.h	2022-08-23 22:32:59.500651211 -0700
+@@ -37,6 +37,7 @@
+ #define _WPXTABLE_H
+ 
+ #include <vector>
++#include <cstddef>
+ 
+ struct WPXTableCell
+ {

From 32d54ef1a39216352934ef555f522dcc1f5e537b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:44:07 -0700
Subject: [PATCH 20/48] grub: fix build for binutils 2.36

---
 .../patches/fix-compat-binutils-2.36.patch    | 96 +++++++++++++++++++
 srcpkgs/grub/template                         |  7 +-
 2 files changed, 102 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/grub/patches/fix-compat-binutils-2.36.patch

diff --git a/srcpkgs/grub/patches/fix-compat-binutils-2.36.patch b/srcpkgs/grub/patches/fix-compat-binutils-2.36.patch
new file mode 100644
index 000000000000..d92a91e3253e
--- /dev/null
+++ b/srcpkgs/grub/patches/fix-compat-binutils-2.36.patch
@@ -0,0 +1,96 @@
+From b98275138bf4fc250a1c362dfd2c8b1cf2421701 Mon Sep 17 00:00:00 2001
+From: Michael Chang <mchang@suse.com>
+Date: Tue, 28 Sep 2021 13:50:47 +0800
+Subject: build: Fix build error with binutils 2.36
+
+The following procedure to build xen/pvgrub is broken.
+
+  git clone https://git.savannah.gnu.org/git/grub.git
+  cd grub
+  ./bootstrap
+  mkdir build-xen
+  cd build-xen
+  ../configure --with-platform=xen
+  make
+
+It fails with the message:
+
+  /usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld:
+  section .note.gnu.property VMA [0000000000400158,0000000000400187]
+  overlaps section .bss VMA [000000000000f000,000000000041e1af]
+
+The most significant factor is that new assembler (GNU as) generates the
+.note.gnu.property section as default. This note section overlaps with
+.bss because it doesn't reposition with -Wl,-Ttext,0 with which the base
+address of .text section is set, rather the address of .note.gnu.property
+is calculated for some reason from 0x400000 where the ELF executable
+defaults to start.
+
+Using -Ttext-segment doesn't help either, though it is said to set the
+address of the first byte of the text segment according to "man ld".
+What it actually does is to override the default 0x400000, aka the image
+base address, to something else. The entire process can be observed in
+the default linker script used by gcc [1]. Therefore we can't expect it
+to achieve the same thing as -Ttext given that the first segment where
+.text resides is offset by SIZEOF_HEADERS plus some sections may be
+preceding it within the first segment. The end result is .text always
+has to start with non-zero address with -Wl,-Ttext-segment,0 if using
+default linker script.
+
+It is also worth mentioning that binutils upstream apparently doesn't
+seem to consider this as a bug [2] and proposed to use -Wl,-Ttext-segment,0
+which is not fruitful as what has been tested by Gentoo [3].
+
+As long as GRUB didn't use ISA information encoded in .note.gnu.property,
+we can safely drop it via -Wa,-mx86-used-note=no assembler option to
+fix the linker error above.
+
+This is considered a better approach than using custom linker script to
+drop the .note.gnu.property section because object file manipulation can
+also be hampered one way or the other in that linker script may not be
+helpful. See also this commit removing the section in the process of objcopy.
+
+  6643507ce build: Fix GRUB i386-pc build with Ubuntu gcc
+
+[1] In /usr/lib64/ldscripts/elf_x86_64.x or use 'gcc -Wl,--verbose ...'
+    PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x400000));
+    . = SEGMENT_START("text-segment", 0x400000) + SIZEOF_HEADERS;
+[2] https://sourceware.org/bugzilla/show_bug.cgi?id=27377
+[3] https://bugs.gentoo.org/787221
+
+Signed-off-by: Michael Chang <mchang@suse.com>
+Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
+---
+ configure.ac | 14 ++++++++++++++
+ 1 file changed, 14 insertions(+)
+
+(limited to 'configure.ac')
+
+diff --git a/configure.ac b/configure.ac
+index eeb5d22..8d1c81a 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -840,6 +840,20 @@ if ( test "x$target_cpu" = xi386 || test "x$target_cpu" = xx86_64 ) && test "x$p
+   TARGET_CFLAGS="$TARGET_CFLAGS -mno-mmx -mno-sse -mno-sse2 -mno-sse3 -mno-3dnow"
+ fi
+ 
++if ( test "x$target_cpu" = xi386 || test "x$target_cpu" = xx86_64 ); then
++  AC_CACHE_CHECK([whether -Wa,-mx86-used-note works], [grub_cv_cc_mx86_used_note], [
++    CFLAGS="$TARGET_CFLAGS -Wa,-mx86-used-note=no -Werror"
++    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
++	[grub_cv_cc_mx86_used_note=yes],
++	[grub_cv_cc_mx86_used_note=no])
++  ])
++
++  if test "x$grub_cv_cc_mx86_used_note" = xyes; then
++    TARGET_CFLAGS="$TARGET_CFLAGS -Wa,-mx86-used-note=no"
++    TARGET_CCASFLAGS="$TARGET_CCASFLAGS -Wa,-mx86-used-note=no"
++  fi
++fi
++
+ # GRUB doesn't use float or doubles at all. Yet some toolchains may decide
+ # that floats are a good fit to run instead of what's written in the code.
+ # Given that floating point unit is disabled (if present to begin with)
+-- 
+cgit v1.1
+
diff --git a/srcpkgs/grub/template b/srcpkgs/grub/template
index b1826c38a884..b4d3b07af620 100644
--- a/srcpkgs/grub/template
+++ b/srcpkgs/grub/template
@@ -2,7 +2,8 @@
 pkgname=grub
 version=2.06
 revision=2
-hostmakedepends="python3 pkg-config flex freetype-devel font-unifont-bdf help2man"
+hostmakedepends="python3 pkg-config flex freetype-devel font-unifont-bdf help2man
+ automake gettext-devel-tools"
 makedepends="libusb-compat-devel ncurses-devel freetype-devel
  liblzma-devel device-mapper-devel fuse-devel"
 depends="os-prober"
@@ -43,6 +44,10 @@ case "$XBPS_TARGET_MACHINE" in
 		;;
 esac
 
+pre_configure() {
+	autoreconf -fi
+}
+
 do_configure() {
 	# workaround for https://savannah.gnu.org/bugs/?60458
 	# some more info: https://www.linuxquestions.org/questions/showthread.php?p=6257712

From 4c80778aa06f26a4c1af8277d96d6901a44da279 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:45:07 -0700
Subject: [PATCH 21/48] linux-toos: fix build for binutils 2.39

---
 .../patches/binutils-add-compat-check.patch   | 103 ++++++++++++
 .../patches/binutils-disasm-compat.patch      | 102 ++++++++++++
 .../bpf_jit_disasm-binutils-2.39.patch        | 104 ++++++++++++
 .../patches/bpftool-binutils-2.39.patch       | 149 ++++++++++++++++++
 .../patches/perf-binutils-2.39.patch          | 114 ++++++++++++++
 5 files changed, 572 insertions(+)
 create mode 100644 srcpkgs/linux-tools/patches/binutils-add-compat-check.patch
 create mode 100644 srcpkgs/linux-tools/patches/binutils-disasm-compat.patch
 create mode 100644 srcpkgs/linux-tools/patches/bpf_jit_disasm-binutils-2.39.patch
 create mode 100644 srcpkgs/linux-tools/patches/bpftool-binutils-2.39.patch
 create mode 100644 srcpkgs/linux-tools/patches/perf-binutils-2.39.patch

diff --git a/srcpkgs/linux-tools/patches/binutils-add-compat-check.patch b/srcpkgs/linux-tools/patches/binutils-add-compat-check.patch
new file mode 100644
index 000000000000..e4e7ece9635e
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/binutils-add-compat-check.patch
@@ -0,0 +1,103 @@
+From cfd59ca91467056bb2c36907b2fa67b8e1af9952 Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:27 -0700
+Subject: [PATCH] tools build: Add feature test for init_disassemble_info API
+ changes
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation failures for tools/{perf,bpf}, e.g. on debian unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+This commit adds a feature test to detect the new signature.  Subsequent
+commits will use it to fix the build failures.
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Quentin Monnet <quentin@isovalent.com>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-2-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/build/Makefile.feature                        |  1 +
+ tools/build/feature/Makefile                        |  4 ++++
+ tools/build/feature/test-all.c                      |  4 ++++
+ tools/build/feature/test-disassembler-init-styled.c | 13 +++++++++++++
+ 4 files changed, 22 insertions(+)
+ create mode 100644 tools/build/feature/test-disassembler-init-styled.c
+
+diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature
+index 888a0421d43b96..8f6578e4d3249e 100644
+--- a/tools/build/Makefile.feature
++++ b/tools/build/Makefile.feature
+@@ -70,6 +70,7 @@ FEATURE_TESTS_BASIC :=                  \
+         libaio				\
+         libzstd				\
+         disassembler-four-args		\
++        disassembler-init-styled	\
+         file-handle
+ 
+ # FEATURE_TESTS_BASIC + FEATURE_TESTS_EXTRA is the complete list
+diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile
+index 7c2a17e23c30ac..c3059739318a95 100644
+--- a/tools/build/feature/Makefile
++++ b/tools/build/feature/Makefile
+@@ -18,6 +18,7 @@ FILES=                                          \
+          test-libbfd.bin                        \
+          test-libbfd-buildid.bin		\
+          test-disassembler-four-args.bin        \
++         test-disassembler-init-styled.bin	\
+          test-reallocarray.bin			\
+          test-libbfd-liberty.bin                \
+          test-libbfd-liberty-z.bin              \
+@@ -248,6 +249,9 @@ $(OUTPUT)test-libbfd-buildid.bin:
+ $(OUTPUT)test-disassembler-four-args.bin:
+ 	$(BUILD) -DPACKAGE='"perf"' -lbfd -lopcodes
+ 
++$(OUTPUT)test-disassembler-init-styled.bin:
++	$(BUILD) -DPACKAGE='"perf"' -lbfd -lopcodes
++
+ $(OUTPUT)test-reallocarray.bin:
+ 	$(BUILD)
+ 
+diff --git a/tools/build/feature/test-all.c b/tools/build/feature/test-all.c
+index 5ffafb967b6e49..957c02c7b163b5 100644
+--- a/tools/build/feature/test-all.c
++++ b/tools/build/feature/test-all.c
+@@ -166,6 +166,10 @@
+ # include "test-disassembler-four-args.c"
+ #undef main
+ 
++#define main main_test_disassembler_init_styled
++# include "test-disassembler-init-styled.c"
++#undef main
++
+ #define main main_test_libzstd
+ # include "test-libzstd.c"
+ #undef main
+diff --git a/tools/build/feature/test-disassembler-init-styled.c b/tools/build/feature/test-disassembler-init-styled.c
+new file mode 100644
+index 00000000000000..f1ce0ec3bee9d3
+--- /dev/null
++++ b/tools/build/feature/test-disassembler-init-styled.c
+@@ -0,0 +1,13 @@
++// SPDX-License-Identifier: GPL-2.0
++#include <stdio.h>
++#include <dis-asm.h>
++
++int main(void)
++{
++	struct disassemble_info info;
++
++	init_disassemble_info(&info, stdout,
++			      NULL, NULL);
++
++	return 0;
++}
diff --git a/srcpkgs/linux-tools/patches/binutils-disasm-compat.patch b/srcpkgs/linux-tools/patches/binutils-disasm-compat.patch
new file mode 100644
index 000000000000..1a6cc0e6d97c
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/binutils-disasm-compat.patch
@@ -0,0 +1,102 @@
+From a45b3d6926231c3d024ea0de4f7bd967f83709ee Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:29 -0700
+Subject: tools include: add dis-asm-compat.h to handle version differences
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation failures for tools/{perf,bpf}, e.g. on debian unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+This commit introduces a wrapper for init_disassemble_info(), to avoid
+spreading #ifdef DISASM_INIT_STYLED to a bunch of places. Subsequent
+commits will use it to fix the build failures.
+
+It likely is worth adding a wrapper for disassember(), to avoid the already
+existing DISASM_FOUR_ARGS_SIGNATURE ifdefery.
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Signed-off-by: Ben Hutchings <benh@debian.org>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Quentin Monnet <quentin@isovalent.com>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-4-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/include/tools/dis-asm-compat.h | 55 ++++++++++++++++++++++++++++++++++++
+ 1 file changed, 55 insertions(+)
+ create mode 100644 tools/include/tools/dis-asm-compat.h
+
+(limited to 'tools/include/tools/dis-asm-compat.h')
+
+diff --git a/tools/include/tools/dis-asm-compat.h b/tools/include/tools/dis-asm-compat.h
+new file mode 100644
+index 0000000000000..70f331e23ed3d
+--- /dev/null
++++ b/tools/include/tools/dis-asm-compat.h
+@@ -0,0 +1,55 @@
++/* SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause */
++#ifndef _TOOLS_DIS_ASM_COMPAT_H
++#define _TOOLS_DIS_ASM_COMPAT_H
++
++#include <stdio.h>
++#include <dis-asm.h>
++
++/* define types for older binutils version, to centralize ifdef'ery a bit */
++#ifndef DISASM_INIT_STYLED
++enum disassembler_style {DISASSEMBLER_STYLE_NOT_EMPTY};
++typedef int (*fprintf_styled_ftype) (void *, enum disassembler_style, const char*, ...);
++#endif
++
++/*
++ * Trivial fprintf wrapper to be used as the fprintf_styled_func argument to
++ * init_disassemble_info_compat() when normal fprintf suffices.
++ */
++static inline int fprintf_styled(void *out,
++				 enum disassembler_style style,
++				 const char *fmt, ...)
++{
++	va_list args;
++	int r;
++
++	(void)style;
++
++	va_start(args, fmt);
++	r = vfprintf(out, fmt, args);
++	va_end(args);
++
++	return r;
++}
++
++/*
++ * Wrapper for init_disassemble_info() that hides version
++ * differences. Depending on binutils version and architecture either
++ * fprintf_func or fprintf_styled_func will be called.
++ */
++static inline void init_disassemble_info_compat(struct disassemble_info *info,
++						void *stream,
++						fprintf_ftype unstyled_func,
++						fprintf_styled_ftype styled_func)
++{
++#ifdef DISASM_INIT_STYLED
++	init_disassemble_info(info, stream,
++			      unstyled_func,
++			      styled_func);
++#else
++	(void)styled_func;
++	init_disassemble_info(info, stream,
++			      unstyled_func);
++#endif
++}
++
++#endif /* _TOOLS_DIS_ASM_COMPAT_H */
+-- 
+cgit 
+
diff --git a/srcpkgs/linux-tools/patches/bpf_jit_disasm-binutils-2.39.patch b/srcpkgs/linux-tools/patches/bpf_jit_disasm-binutils-2.39.patch
new file mode 100644
index 000000000000..01221fad3a4a
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/bpf_jit_disasm-binutils-2.39.patch
@@ -0,0 +1,104 @@
+From 96ed066054abf11c7d3e106e3011a51f3f1227a3 Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:31 -0700
+Subject: [PATCH] tools bpf_jit_disasm: Fix compilation error with new binutils
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation to fail for tools/bpf/bpf_jit_disasm.c, e.g. on debian
+unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+Wire up the feature test and switch to init_disassemble_info_compat(),
+which were introduced in prior commits, fixing the compilation failure.
+
+I verified that bpf_jit_disasm can still disassemble bpf programs, both
+with the old and new dis-asm.h API. With old binutils there's no change in
+output before/after this patch. When comparing the output from old
+binutils (2.35) to new bintuils with the patch (upstream snapshot) there
+are a few output differences, but they are unrelated to this patch. An
+example hunk is:
+
+     f4:	mov    %r14,%rsi
+     f7:	mov    %r15,%rdx
+     fa:	mov    $0x2a,%ecx
+  -  ff:	callq  0xffffffffea8c4988
+  +  ff:	call   0xffffffffea8c4988
+    104:	test   %rax,%rax
+    107:	jge    0x0000000000000110
+    109:	xor    %eax,%eax
+  - 10b:	jmpq   0x0000000000000073
+  + 10b:	jmp    0x0000000000000073
+    110:	cmp    $0x16,%rax
+
+However, I had to use an older kernel to generate the bpf_jit_enabled =
+2 output, as that has been broken since 5.18 / 1022a5498f6f745c ("bpf,
+x86_64: Use bpf_jit_binary_pack_alloc").
+
+  https://lore.kernel.org/20220703030210.pmjft7qc2eajzi6c@alap3.anarazel.de
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Daniel Borkmann <daniel@iogearbox.net>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Quentin Monnet <quentin@isovalent.com>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-6-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/bpf/Makefile         | 5 ++++-
+ tools/bpf/bpf_jit_disasm.c | 5 ++++-
+ 2 files changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/tools/bpf/Makefile b/tools/bpf/Makefile
+index b11cfc86a3d021..664601ab1705ab 100644
+--- a/tools/bpf/Makefile
++++ b/tools/bpf/Makefile
+@@ -34,7 +34,7 @@ else
+ endif
+ 
+ FEATURE_USER = .bpf
+-FEATURE_TESTS = libbfd disassembler-four-args
++FEATURE_TESTS = libbfd disassembler-four-args disassembler-init-styled
+ FEATURE_DISPLAY = libbfd disassembler-four-args
+ 
+ check_feat := 1
+@@ -56,6 +56,9 @@ endif
+ ifeq ($(feature-disassembler-four-args), 1)
+ CFLAGS += -DDISASM_FOUR_ARGS_SIGNATURE
+ endif
++ifeq ($(feature-disassembler-init-styled), 1)
++CFLAGS += -DDISASM_INIT_STYLED
++endif
+ 
+ $(OUTPUT)%.yacc.c: $(srctree)/tools/bpf/%.y
+ 	$(QUIET_BISON)$(YACC) -o $@ -d $<
+diff --git a/tools/bpf/bpf_jit_disasm.c b/tools/bpf/bpf_jit_disasm.c
+index c8ae9580472814..a90a5d110f9255 100644
+--- a/tools/bpf/bpf_jit_disasm.c
++++ b/tools/bpf/bpf_jit_disasm.c
+@@ -28,6 +28,7 @@
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <limits.h>
++#include <tools/dis-asm-compat.h>
+ 
+ #define CMD_ACTION_SIZE_BUFFER		10
+ #define CMD_ACTION_READ_ALL		3
+@@ -64,7 +65,9 @@ static void get_asm_insns(uint8_t *image, size_t len, int opcodes)
+ 	assert(bfdf);
+ 	assert(bfd_check_format(bfdf, bfd_object));
+ 
+-	init_disassemble_info(&info, stdout, (fprintf_ftype) fprintf);
++	init_disassemble_info_compat(&info, stdout,
++				     (fprintf_ftype) fprintf,
++				     fprintf_styled);
+ 	info.arch = bfd_get_arch(bfdf);
+ 	info.mach = bfd_get_mach(bfdf);
+ 	info.buffer = image;
diff --git a/srcpkgs/linux-tools/patches/bpftool-binutils-2.39.patch b/srcpkgs/linux-tools/patches/bpftool-binutils-2.39.patch
new file mode 100644
index 000000000000..1e55c40011be
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/bpftool-binutils-2.39.patch
@@ -0,0 +1,149 @@
+From 600b7b26c07a070d0153daa76b3806c1e52c9e00 Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:33 -0700
+Subject: [PATCH] tools bpftool: Fix compilation error with new binutils
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation to fail for tools/bpf/bpftool/jit_disasm.c, e.g. on debian
+unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+Wire up the feature test and switch to init_disassemble_info_compat(),
+which were introduced in prior commits, fixing the compilation failure.
+
+I verified that bpftool can still disassemble bpf programs, both with an
+old and new dis-asm.h API. There are no output changes for plain and json
+formats. When comparing the output from old binutils (2.35)
+to new bintuils with the patch (upstream snapshot) there are a few output
+differences, but they are unrelated to this patch. An example hunk is:
+
+     2f:	pop    %r14
+     31:	pop    %r13
+     33:	pop    %rbx
+  -  34:	leaveq
+  -  35:	retq
+  +  34:	leave
+  +  35:	ret
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Quentin Monnet <quentin@isovalent.com>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-8-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/bpf/bpftool/Makefile     |  5 +++-
+ tools/bpf/bpftool/jit_disasm.c | 42 +++++++++++++++++++++++++++-------
+ 2 files changed, 38 insertions(+), 9 deletions(-)
+
+diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile
+index c6d2c77d02524a..436e671b2657d4 100644
+--- a/tools/bpf/bpftool/Makefile
++++ b/tools/bpf/bpftool/Makefile
+@@ -62,7 +62,7 @@ CLANG ?= clang
+ LLVM_STRIP ?= llvm-strip
+ 
+ FEATURE_USER = .bpftool
+-FEATURE_TESTS = libbfd disassembler-four-args reallocarray zlib libcap \
++FEATURE_TESTS = libbfd disassembler-four-args disassembler-init-styled reallocarray zlib libcap \
+ 	clang-bpf-co-re
+ FEATURE_DISPLAY = libbfd disassembler-four-args zlib libcap \
+ 	clang-bpf-co-re
+@@ -117,6 +117,9 @@ endif
+ ifeq ($(feature-disassembler-four-args), 1)
+ CFLAGS += -DDISASM_FOUR_ARGS_SIGNATURE
+ endif
++ifeq ($(feature-disassembler-init-styled), 1)
++    CFLAGS += -DDISASM_INIT_STYLED
++endif
+ 
+ LIBS = $(LIBBPF) -lelf -lz
+ LIBS_BOOTSTRAP = $(LIBBPF_BOOTSTRAP) -lelf -lz
+diff --git a/tools/bpf/bpftool/jit_disasm.c b/tools/bpf/bpftool/jit_disasm.c
+index 24734f2249d6ec..aaf99a0168c90b 100644
+--- a/tools/bpf/bpftool/jit_disasm.c
++++ b/tools/bpf/bpftool/jit_disasm.c
+@@ -24,6 +24,7 @@
+ #include <sys/stat.h>
+ #include <limits.h>
+ #include <bpf/libbpf.h>
++#include <tools/dis-asm-compat.h>
+ 
+ #include "json_writer.h"
+ #include "main.h"
+@@ -39,15 +40,12 @@ static void get_exec_path(char *tpath, s
+ }
+ 
+ static int oper_count;
+-static int fprintf_json(void *out, const char *fmt, ...)
++static int printf_json(void *out, const char *fmt, va_list ap)
+ {
+-	va_list ap;
+ 	char *s;
+ 
+-	va_start(ap, fmt);
+ 	if (vasprintf(&s, fmt, ap) < 0)
+ 		return -1;
+-	va_end(ap);
+ 
+ 	if (!oper_count) {
+ 		int i;
+@@ -73,6 +71,32 @@ static int fprintf_json(void *out, const char *fmt, ...)
+ 	return 0;
+ }
+ 
++static int fprintf_json(void *out, const char *fmt, ...)
++{
++	va_list ap;
++	int r;
++
++	va_start(ap, fmt);
++	r = printf_json(out, fmt, ap);
++	va_end(ap);
++
++	return r;
++}
++
++static int fprintf_json_styled(void *out,
++			       enum disassembler_style style __maybe_unused,
++			       const char *fmt, ...)
++{
++	va_list ap;
++	int r;
++
++	va_start(ap, fmt);
++	r = printf_json(out, fmt, ap);
++	va_end(ap);
++
++	return r;
++}
++
+ void disasm_print_insn(unsigned char *image, ssize_t len, int opcodes,
+ 		       const char *arch, const char *disassembler_options,
+ 		       const struct btf *btf,
+@@ -99,11 +123,13 @@ void disasm_print_insn(unsigned char *image, ssize_t len, int opcodes,
+ 	assert(bfd_check_format(bfdf, bfd_object));
+ 
+ 	if (json_output)
+-		init_disassemble_info(&info, stdout,
+-				      (fprintf_ftype) fprintf_json);
++		init_disassemble_info_compat(&info, stdout,
++					     (fprintf_ftype) fprintf_json,
++					     fprintf_json_styled);
+ 	else
+-		init_disassemble_info(&info, stdout,
+-				      (fprintf_ftype) fprintf);
++		init_disassemble_info_compat(&info, stdout,
++					     (fprintf_ftype) fprintf,
++					     fprintf_styled);
+ 
+ 	/* Update architecture info for offload. */
+ 	if (arch) {
diff --git a/srcpkgs/linux-tools/patches/perf-binutils-2.39.patch b/srcpkgs/linux-tools/patches/perf-binutils-2.39.patch
new file mode 100644
index 000000000000..3484330f7286
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/perf-binutils-2.39.patch
@@ -0,0 +1,114 @@
+From 83aa0120487e8bc3f231e72c460add783f71f17c Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:30 -0700
+Subject: [PATCH] tools perf: Fix compilation error with new binutils
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation failures for tools/perf/util/annotate.c, e.g. on debian
+unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+Wire up the feature test and switch to init_disassemble_info_compat(),
+which were introduced in prior commits, fixing the compilation failure.
+
+I verified that perf can still disassemble bpf programs by using bpftrace
+under load, recording a perf trace, and then annotating the bpf "function"
+with and without the changes. With old binutils there's no change in output
+before/after this patch. When comparing the output from old binutils (2.35)
+to new bintuils with the patch (upstream snapshot) there are a few output
+differences, but they are unrelated to this patch. An example hunk is:
+
+       1.15 :   55:mov    %rbp,%rdx
+       0.00 :   58:add    $0xfffffffffffffff8,%rdx
+       0.00 :   5c:xor    %ecx,%ecx
+  -    1.03 :   5e:callq  0xffffffffe12aca3c
+  +    1.03 :   5e:call   0xffffffffe12aca3c
+       0.00 :   63:xor    %eax,%eax
+  -    2.18 :   65:leaveq
+  -    2.82 :   66:retq
+  +    2.18 :   65:leave
+  +    2.82 :   66:ret
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-5-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/perf/Makefile.config | 8 ++++++++
+ tools/perf/util/annotate.c | 7 ++++---
+ 2 files changed, 12 insertions(+), 3 deletions(-)
+
+diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
+index d3c254c0f5c611..23648ea54e8d3d 100644
+--- a/tools/perf/Makefile.config
++++ b/tools/perf/Makefile.config
+@@ -298,6 +298,7 @@ FEATURE_CHECK_LDFLAGS-libpython := $(PYTHON_EMBED_LDOPTS)
+ FEATURE_CHECK_LDFLAGS-libaio = -lrt
+ 
+ FEATURE_CHECK_LDFLAGS-disassembler-four-args = -lbfd -lopcodes -ldl
++FEATURE_CHECK_LDFLAGS-disassembler-init-styled = -lbfd -lopcodes -ldl
+ 
+ CORE_CFLAGS += -fno-omit-frame-pointer
+ CORE_CFLAGS += -ggdb3
+@@ -818,13 +819,16 @@ else
+   ifeq ($(feature-libbfd-liberty), 1)
+     EXTLIBS += -lbfd -lopcodes -liberty
+     FEATURE_CHECK_LDFLAGS-disassembler-four-args += -liberty -ldl
++    FEATURE_CHECK_LDFLAGS-disassembler-init-styled += -liberty -ldl
+   else
+     ifeq ($(feature-libbfd-liberty-z), 1)
+       EXTLIBS += -lbfd -lopcodes -liberty -lz
+       FEATURE_CHECK_LDFLAGS-disassembler-four-args += -liberty -lz -ldl
++      FEATURE_CHECK_LDFLAGS-disassembler-init-styled += -liberty -lz -ldl
+     endif
+   endif
+   $(call feature_check,disassembler-four-args)
++  $(call feature_check,disassembler-init-styled)
+ endif
+ 
+ ifeq ($(feature-libbfd-buildid), 1)
+@@ -1044,6 +1048,10 @@ ifeq ($(feature-disassembler-four-args), 1)
+     CFLAGS += -DDISASM_FOUR_ARGS_SIGNATURE
+ endif
+ 
++ifeq ($(feature-disassembler-init-styled), 1)
++    CFLAGS += -DDISASM_INIT_STYLED
++endif
++
+ ifeq (${IS_64_BIT}, 1)
+   ifndef NO_PERF_READ_VDSO32
+     $(call feature_check,compile-32)
+diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
+index 82cc396ef516c4..2c6a485c3de5d9 100644
+--- a/tools/perf/util/annotate.c
++++ b/tools/perf/util/annotate.c
+@@ -1676,6 +1676,7 @@ fallback:
+ #define PACKAGE "perf"
+ #include <bfd.h>
+ #include <dis-asm.h>
++#include <tools/dis-asm-compat.h>
+ 
+ static int symbol__disassemble_bpf(struct symbol *sym,
+ 				   struct annotate_args *args)
+@@ -1762,9 +1763,9 @@ static int symbol__disassemble_bpf(struct symbol *sym,
+ 		ret = errno;
+ 		goto out;
+ 	}
+-	init_disassemble_info(&info, s,
+-			      (fprintf_ftype) fprintf);
+-
++	init_disassemble_info_compat(&info, s,
++				     (fprintf_ftype) fprintf,
++				     fprintf_styled);
+ 	info.arch = bfd_get_arch(bfdf);
+ 	info.mach = bfd_get_mach(bfdf);
+ 

From 6ee944a4a8bbe3dd242db4add1a2e8c3289fa4f8 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 14:45:28 -0700
Subject: [PATCH 22/48] libsasl: fix build for libtool 2.4.7

---
 srcpkgs/libsasl/template | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/libsasl/template b/srcpkgs/libsasl/template
index a8817042f843..a2993b39f4a1 100644
--- a/srcpkgs/libsasl/template
+++ b/srcpkgs/libsasl/template
@@ -19,6 +19,7 @@ distfiles="https://github.com/cyrusimap/cyrus-sasl/releases/download/cyrus-sasl-
 checksum=26866b1549b00ffd020f188a43c258017fa1c382b3ddadd8201536f72efb05d5
 
 pre_configure() {
+	rm -f m4/ltversion.m4
 	autoreconf -fi
 }
 

From 1c48610969e3e0361d6bc600ff647baa72029fd3 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:08 -0700
Subject: [PATCH 23/48] subversion: fix build for libtool 2.4.7

---
 srcpkgs/subversion/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion/template b/srcpkgs/subversion/template
index 8ad178264942..3f1c9e254e61 100644
--- a/srcpkgs/subversion/template
+++ b/srcpkgs/subversion/template
@@ -57,7 +57,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From ac52bb8b04088bc730ba53ba56c54fc827e9e2da Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:38 -0700
Subject: [PATCH 24/48] subversion-kwallet-auth: fix build for libtool 2.4.7

---
 srcpkgs/subversion-kwallet-auth/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion-kwallet-auth/template b/srcpkgs/subversion-kwallet-auth/template
index 12210f250d51..b4d8621456ea 100644
--- a/srcpkgs/subversion-kwallet-auth/template
+++ b/srcpkgs/subversion-kwallet-auth/template
@@ -59,7 +59,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From 95a72e7c394bbfc3896cd1ecdf330aa0df1f634d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 20:07:32 -0700
Subject: [PATCH 25/48] gpgme: update to 1.18.0.

---
 common/shlibs          | 2 +-
 srcpkgs/gpgme/template | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 89e363c4de54..aec97f01f213 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -722,7 +722,7 @@ libdconf.so.1 dconf-0.13.90_1
 libassuan.so.0 libassuan-2.0.1_1
 libgpgme.so.11 libgpgme-1.12.0_2
 libgpgmepp.so.6 gpgmepp-1.7.0_3
-libqgpgme.so.7 gpgmeqt-1.7.0_3
+libqgpgme.so.15 gpgmeqt-1.18.0_1
 libgarcon-1.so.0 garcon-0.1.12_1
 libgarcon-gtk2-1.so.0 garcon-0.4.0_1
 libgarcon-gtk3-1.so.0 garcon-0.6.1_1
diff --git a/srcpkgs/gpgme/template b/srcpkgs/gpgme/template
index 8633075a8404..b1cfd5f78657 100644
--- a/srcpkgs/gpgme/template
+++ b/srcpkgs/gpgme/template
@@ -1,7 +1,7 @@
 # Template file for 'gpgme'
 pkgname=gpgme
-version=1.15.1
-revision=2
+version=1.18.0
+revision=1
 build_style=gnu-configure
 configure_args="--enable-fd-passing
  --with-libgpg-error-prefix=$XBPS_CROSS_BASE/usr
@@ -14,7 +14,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.gnupg.org/software/gpgme/index.html"
 distfiles="https://www.gnupg.org/ftp/gcrypt/gpgme/gpgme-${version}.tar.bz2"
-checksum=eebc3c1b27f1c8979896ff361ba9bb4778b508b2496c2fc10e3775a40b1de1ad
+checksum=361d4eae47ce925dba0ea569af40e7b52c645c4ae2e65e5621bf1b6cdd8b0e9e
 
 if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
 	configure_args+=" ac_cv_sys_file_offset_bits=no"

From cd9fd53066dd77016bbc78f3f434cffab2673df6 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 26/48] cross-aarch64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..bd6b23f9fb6a 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From aa09024c6483fea1606595e79ea302a3829c2ba7 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 27/48] cross-aarch64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..427ad2c1e9cd 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 9d0d92bd74bc9641e6e24b93b252346d81540946 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 28/48] cross-arm-linux-gnueabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..2510ee26e789 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From cc6b4c815a9c25dac974e443a2990974121ef4a3 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 29/48] cross-arm-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..bd8b16e1b4c1 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 0e2c5f6eee83617bb6feaebe2e1efa55e43fef60 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 30/48] cross-arm-linux-musleabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..dacfd2655216 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From d480fb776de130202117ded87eceba396d22cfc7 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 31/48] cross-arm-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..9ddd32a9f20d 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 2ef58f74a1b8814419cd40614126297cdf715c86 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 32/48] cross-armv7l-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..9fb00f18be3b 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 0399ed8d8bed869288d28a1aeafd712799840fad Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 33/48] cross-armv7l-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..2c72e75ddfe3 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From cd9af822ef22e502844b12e03e4d8d8655291df8 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 34/48] cross-i686-pc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..4dc17df648b5 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 9bac4bfba54eb8792c2869e529168e4bcb51cbbc Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 35/48] cross-mips-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..6009e5c79eb2 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 03b1e8afdac4c2d13c0ebf61630f60c905371a60 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 36/48] cross-mips-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..080164df193d 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="hipperson0 <hipperson0@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 06bbf462bf1327316bb5196430b2ea2c6f46ca90 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 37/48] cross-mipsel-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..f9fd4b8a04ef 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 97478c58521cdd618e354579e9169e77bda9b931 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 38/48] cross-mipsel-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..7418a984474b 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 25bdb388bbb3eb452a7160e36d2a43597758d83d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 39/48] cross-powerpc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..31e57b4e52b2 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 2e2d88adb5e5a1a9292151f3b02a52e0dd5b0774 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 40/48] cross-powerpc-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..a2d1edcf1ffd 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From de8eff8bcabbd7474ede7ecdeda24a488c713054 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 41/48] cross-powerpc64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..1a4cbed61e76 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 882f6f66f111548d5bc9d9b68e37ad0555aeb904 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 42/48] cross-powerpc64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 1ebd0fb2048d..ade42018af05 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From ace259908e93e0470ff2763b14e4eb51377505de Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 43/48] cross-powerpc64le-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 733f5851da5c..03054239001e 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 1a332abde072fa4878974d445bb84e3aa691da2b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 44/48] cross-powerpc64le-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index 76a70aa1d6db..5887f845f932 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 0917440b1f96b9a5e9d087dd89d4b15aa02513d4 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 45/48] cross-powerpcle-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 347b8fcf4f55..06530e0d609b 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 4a335235ff8c5bf7c6dc0e53451c12e9f8cb48e1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 46/48] cross-powerpcle-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index ec9324ddaa99..e68c3962b49c 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 78813f60a5a972d772af23cd978323730148b6b6 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 47/48] cross-x86_64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 0078fbe7224b..7da85c14b62d 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 736a04c44cec7bfd5adfe3e053ef7cefb005bb39 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 48/48] cross-x86_64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..2811de0d3c2e 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (65 preceding siblings ...)
  2022-08-28 22:23 ` oreo639
@ 2022-09-03  4:18 ` oreo639
  2022-09-03  5:51 ` oreo639
                   ` (197 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-09-03  4:18 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5538 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.2.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.2.0

This PR depends on: https://github.com/void-linux/void-packages/pull/32330

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

Also, keep in mind that the libgo musl patch here will need to be updated once musl is updated:
https://github.com/void-linux/void-packages/pull/34902/files#diff-1f42a95b93c9550178ff1fbccbef2f47a72711df15c24c9472e2550076978129R163-R176

This is the updated patch for reference:
https://github.com/alpinelinux/aports/blob/8acb21b8ee881e7ab1c812d9a66a17d2501b8730/main/gcc/0049-libgo-adjust-name-of-union-in-sigevent-struct.patch

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/38817
- [x] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [ ] llvm https://github.com/void-linux/void-packages/pull/38694
- [ ] m4 https://github.com/void-linux/void-packages/pull/33730
- [ ] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [x] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [ ] libvirt https://github.com/void-linux/void-packages/pull/38842
- [ ] syslinux https://github.com/void-linux/void-packages/pull/38876
- [ ] efivar https://github.com/void-linux/void-packages/pull/38874

Known packages that needed to be fixed/updated for gcc12:
- [ ] linux5.18 (in this PR)
- [ ] openssh https://github.com/void-linux/void-packages/pull/38849
- [ ] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [ ] doxygen https://github.com/void-linux/void-packages/pull/38846
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/38817
- [x] libproxy https://github.com/void-linux/void-packages/pull/38818
- [x] exempi https://github.com/void-linux/void-packages/pull/38820
- [ ] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [ ] gpgme https://github.com/void-linux/void-packages/pull/38825
- [x] libunique1 https://github.com/void-linux/void-packages/pull/38848 or https://github.com/void-linux/void-packages/pull/38873
- [ ] libwpd https://github.com/void-linux/void-packages/pull/38878

Needs to be fixed/updated for binutils:
- [ ] grub https://github.com/void-linux/void-packages/pull/38875
- [ ] linux-tools https://github.com/void-linux/void-packages/pull/38877

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [x] kde
- [x] lxde
- [x] lxqt

You can test the ISOs here:
https://drive.google.com/drive/folders/1ix92CYSLUP-KWjLxltdgG4e8Nu2JCY5n?usp=sharing

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 163576 bytes --]

From 3fae3e4707de003ef225593461865e7239b084fe Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 01/48] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../fix-libcollector-without-java.patch       | 53 +++++++++++++++
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 15 +++--
 4 files changed, 81 insertions(+), 113 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
 create mode 100644 srcpkgs/binutils/patches/fix-libcollector-without-java.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/fix-libcollector-without-java.patch b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
new file mode 100644
index 000000000000..54384875f358
--- /dev/null
+++ b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
@@ -0,0 +1,53 @@
+From 49ddd814ac1071af7c4f45d5f8398b91862f2c7f Mon Sep 17 00:00:00 2001
+From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
+Date: Wed, 17 Aug 2022 19:55:23 -0700
+Subject: [PATCH] gprofng: fix bug 29479 Collection fails when built without
+ java support
+
+gprofng/ChangeLog
+2022-08-17  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>
+
+	PR gprofng/29479
+	* libcollector/collector.c: Add #if defined(GPROFNG_JAVA_PROFILING) for
+	java specific code.
+	* libcollector/unwind.c: Likewise.
+---
+ gprofng/libcollector/collector.c | 2 ++
+ gprofng/libcollector/unwind.c    | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/gprofng/libcollector/collector.c b/gprofng/libcollector/collector.c
+index 93c9d3330de5..ceff2c1caccb 100644
+--- a/gprofng/libcollector/collector.c
++++ b/gprofng/libcollector/collector.c
+@@ -913,8 +913,10 @@ __collector_open_experiment (const char *exp, const char *params, sp_origin_t or
+   __collector_ext_unwind_key_init (1, NULL);
+ 
+   /* start java attach if suitable */
++#if defined(GPROFNG_JAVA_PROFILING)
+   if (exp_origin == SP_ORIGIN_DBX_ATTACH)
+     __collector_jprofile_start_attach ();
++#endif
+   start_sec_time = CALL_UTIL (time)(NULL);
+   __collector_start_time = collector_interface.getHiResTime ();
+   TprintfT (DBG_LT0, "\t__collector_open_experiment; resetting start_time\n");
+diff --git a/gprofng/libcollector/unwind.c b/gprofng/libcollector/unwind.c
+index 119243788020..f8e11823c81e 100644
+--- a/gprofng/libcollector/unwind.c
++++ b/gprofng/libcollector/unwind.c
+@@ -557,6 +557,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+   int size = max_frame_size;
+ 
+ #define MIN(a,b) ((a)<(b)?(a):(b))
++#if defined(GPROFNG_JAVA_PROFILING)
+   /* get Java info */
+   if (__collector_java_mode && __collector_java_asyncgetcalltrace_loaded && context && !pseudo_context)
+     {
+@@ -569,6 +570,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+ 	  size -= sz;
+ 	}
+     }
++#endif
+ 
+   /* get native stack */
+   if (context)
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..0578665c1a30 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkg-config"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -44,6 +45,12 @@ do_configure() {
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	# gprofng currently only supports x86 and aarch64 glibc.
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64|i386|aarch64) conf+=" --enable-gprofng" ;;
+		*) conf+=" --disable-gprofng" ;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"

From b4bf84091dc6c855790d3d751c6a1fd0f2d3b95c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 02/48] gcc: update to 12.2.0.

---
 common/shlibs                                 | 10 +--
 srcpkgs/gcc/files/gccgo-musl.patch            | 74 ++++---------------
 srcpkgs/gcc/files/libgnarl-musl.patch         | 18 ++---
 srcpkgs/gcc/files/libssp-musl.patch           | 10 +--
 srcpkgs/gcc/patches/libffi_gnulinux.patch     | 11 ---
 .../gcc/patches/libgcc-ibm128-no-tag.patch    | 10 ++-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |  2 +-
 srcpkgs/gcc/template                          | 25 +++----
 8 files changed, 52 insertions(+), 108 deletions(-)
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index 5fe37e3d0b62..8b8be0eafe00 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.2.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.34 perl-5.34.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -845,8 +845,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.2.0_1
+libgnat-12.so libada-12.2.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1695,8 +1695,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.2.0_1
+libasan.so.8 libsanitizer-12.2.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..632ef951097b 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,17 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ a/libgo/go/runtime/os_linux.go
+@@ -363,9 +363,9 @@
+ 
+ 	var timerid int32
+ 	var sevp _sigevent
+-	sevp.sigev_notify = _SIGEV_THREAD_ID
++	sevp.sigev_notify = 4
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.sigev_notify_function))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..446741390d45 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,15 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
+version=12.2.0
+revision=1
 _patchver="${version%pre*}"
 _minorver="${_patchver%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 wrksrc=gcc-${version/pre/_pre}
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +19,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -396,7 +393,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}

From 6b09f9841c1ef53109af4e3630e4581932bdf2f5 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 03/48] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      | 11 ++++--
 2 files changed, 25 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..70c4aa533e66 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,12 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
+
+if [ "$XBPS_LIBC" == "musl" ]; then
+# Musl always searches LD_LIBRARY_PATH before RPATH and RUNPATH
+make_build_args="lt_cv_shlibpath_overrides_runpath=yes"
+fi
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From 57247ba5a5e7d59be7db858d76817390332ea6e6 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 04/48] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 1a4e1ca3d594..b04268908c2e 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="q66 <daniel@octaforge.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From 843603002ce2f50162358b97838af08f9263ba37 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 05/48] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 3 files changed, 55 insertions(+), 353 deletions(-)
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index 8b8be0eafe00..8b31fec0557c 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From 359e4f5dc25ee7209952ea3f4e9589d765667962 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 21:01:43 -0700
Subject: [PATCH 06/48] gcc-multilib: update to 12.2.0.

---
 srcpkgs/gcc-multilib/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index fcd25755aa75..1a26da26a991 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,16 +3,16 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _majorver="${version%.*}"
-wrksrc=gcc-${version/pre/_pre}
+wrksrc=gcc-${version}
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel

From dca9e82aeebbd7b4f11cd6a0d9fc1fa6833dd445 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 16:22:03 -0700
Subject: [PATCH 07/48] llvm12: fix build for glibc 2.36

---
 .../compiler-rt-sanitizer-glibc-2.36.patch    | 59 +++++++++++++++++++
 1 file changed, 59 insertions(+)
 create mode 100644 srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch

diff --git a/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch b/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch
new file mode 100644
index 000000000000..e5f24dab8935
--- /dev/null
+++ b/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch
@@ -0,0 +1,59 @@
+From 9cf13067cb5088626ba7ee1ec4c42ec59c7995a0 Mon Sep 17 00:00:00 2001
+From: Fangrui Song <i@maskray.me>
+Date: Mon, 11 Jul 2022 12:53:34 -0700
+Subject: [PATCH] [sanitizer] Remove #include <linux/fs.h> to resolve
+ fsconfig_command/mount_attr conflict with glibc 2.36
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+It is generally not a good idea to mix usage of glibc headers and Linux UAPI
+headers (https://sourceware.org/glibc/wiki/Synchronizing_Headers). In glibc
+since 7eae6a91e9b1670330c9f15730082c91c0b1d570 (milestone: 2.36), sys/mount.h
+defines `fsconfig_command` which conflicts with linux/mount.h:
+
+    .../usr/include/linux/mount.h:95:6: error: redeclaration of ‘enum fsconfig_command’
+
+Remove #include <linux/fs.h> which pulls in linux/mount.h. Expand its 4 macros manually.
+Android sys/mount.h doesn't define BLKBSZGET and it still needs linux/fs.h.
+In the long term we should move Linux specific definitions to sanitizer_platform_limits_linux.cpp
+but this commit is easy to cherry pick into older compiler-rt releases.
+
+Fix https://github.com/llvm/llvm-project/issues/56421
+
+Reviewed By: #sanitizers, vitalybuka, zatrazz
+
+Differential Revision: https://reviews.llvm.org/D129471
+---
+ .../sanitizer_platform_limits_posix.cpp                | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+index 4bd425435d56d..3a94b260686f1 100644
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -73,7 +73,9 @@
+ #include <sys/vt.h>
+ #include <linux/cdrom.h>
+ #include <linux/fd.h>
++#if SANITIZER_ANDROID
+ #include <linux/fs.h>
++#endif
+ #include <linux/hdreg.h>
+ #include <linux/input.h>
+ #include <linux/ioctl.h>
+@@ -876,10 +878,10 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
+   unsigned IOCTL_EVIOCGPROP = IOCTL_NOT_PRESENT;
+   unsigned IOCTL_EVIOCSKEYCODE_V2 = IOCTL_NOT_PRESENT;
+ #endif
+-  unsigned IOCTL_FS_IOC_GETFLAGS = FS_IOC_GETFLAGS;
+-  unsigned IOCTL_FS_IOC_GETVERSION = FS_IOC_GETVERSION;
+-  unsigned IOCTL_FS_IOC_SETFLAGS = FS_IOC_SETFLAGS;
+-  unsigned IOCTL_FS_IOC_SETVERSION = FS_IOC_SETVERSION;
++  unsigned IOCTL_FS_IOC_GETFLAGS = _IOR('f', 1, long);
++  unsigned IOCTL_FS_IOC_GETVERSION = _IOR('v', 1, long);
++  unsigned IOCTL_FS_IOC_SETFLAGS = _IOW('f', 2, long);
++  unsigned IOCTL_FS_IOC_SETVERSION = _IOW('v', 2, long);
+   unsigned IOCTL_GIO_CMAP = GIO_CMAP;
+   unsigned IOCTL_GIO_FONT = GIO_FONT;
+   unsigned IOCTL_GIO_UNIMAP = GIO_UNIMAP;

From b5077f505fbb6b1c4dac7cb6452004003dd65a5c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 17:21:40 -0700
Subject: [PATCH 08/48] m4: update to 1.4.19.

---
 srcpkgs/m4/patches/fix-glibc-2.27.patch | 167 ------------------------
 srcpkgs/m4/template                     |  12 +-
 2 files changed, 6 insertions(+), 173 deletions(-)
 delete mode 100644 srcpkgs/m4/patches/fix-glibc-2.27.patch

diff --git a/srcpkgs/m4/patches/fix-glibc-2.27.patch b/srcpkgs/m4/patches/fix-glibc-2.27.patch
deleted file mode 100644
index 59d33cff164d..000000000000
--- a/srcpkgs/m4/patches/fix-glibc-2.27.patch
+++ /dev/null
@@ -1,167 +0,0 @@
-From 4af4a4a71827c0bc5e0ec67af23edef4f15cee8e Mon Sep 17 00:00:00 2001
-From: Paul Eggert <eggert@cs.ucla.edu>
-Date: Mon, 5 Mar 2018 10:56:29 -0800
-Subject: [PATCH] fflush: adjust to glibc 2.28 libio.h removal
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Problem reported by Daniel P. Berrangé in:
-https://lists.gnu.org/r/bug-gnulib/2018-03/msg00000.html
-* lib/fbufmode.c (fbufmode):
-* lib/fflush.c (clear_ungetc_buffer_preserving_position)
-(disable_seek_optimization, rpl_fflush):
-* lib/fpending.c (__fpending):
-* lib/fpurge.c (fpurge):
-* lib/freadable.c (freadable):
-* lib/freadahead.c (freadahead):
-* lib/freading.c (freading):
-* lib/freadptr.c (freadptr):
-* lib/freadseek.c (freadptrinc):
-* lib/fseeko.c (fseeko):
-* lib/fseterr.c (fseterr):
-* lib/fwritable.c (fwritable):
-* lib/fwriting.c (fwriting):
-Check _IO_EOF_SEEN instead of _IO_ftrylockfile.
-* lib/stdio-impl.h (_IO_IN_BACKUP) [_IO_EOF_SEEN]:
-Define if not already defined.
-
-[yann.morin.1998@free.fr: partially backport from upstream gnulib]
-Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
-
----
- lib/fflush.c     |  6 +++---
- lib/fpending.c   |  2 +-
- lib/fpurge.c     |  2 +-
- lib/freadahead.c |  2 +-
- lib/freading.c   |  2 +-
- lib/fseeko.c     |  4 ++--
- lib/stdio-impl.h |  6 ++++++
- 7 files changed, 15 insertions(+), 9 deletions(-)
-
-diff --git a/lib/fflush.c b/build-aux/gnulib/lib/fflush.c
-index 983ade0ff..a6edfa105 100644
---- a/lib/fflush.c
-+++ b/lib/fflush.c
-@@ -33,7 +33,7 @@
- #undef fflush
- 
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- 
- /* Clear the stream's ungetc buffer, preserving the value of ftello (fp).  */
- static void
-@@ -72,7 +72,7 @@ clear_ungetc_buffer (FILE *fp)
- 
- #endif
- 
--#if ! (defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
-+#if ! (defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
- 
- # if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT
- /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
-@@ -148,7 +148,7 @@ rpl_fflush (FILE *stream)
-   if (stream == NULL || ! freading (stream))
-     return fflush (stream);
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- 
-   clear_ungetc_buffer_preserving_position (stream);
- 
-diff --git a/lib/fpending.c b/build-aux/gnulib/lib/fpending.c
-index c84e3a5b4..789f50e4e 100644
---- a/lib/fpending.c
-+++ b/lib/fpending.c
-@@ -32,7 +32,7 @@ __fpending (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   return fp->_IO_write_ptr - fp->_IO_write_base;
- #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
-   /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
-diff --git a/lib/fpurge.c b/build-aux/gnulib/lib/fpurge.c
-index b1d417c7a..3aedcc373 100644
---- a/lib/fpurge.c
-+++ b/lib/fpurge.c
-@@ -62,7 +62,7 @@ fpurge (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   fp->_IO_read_end = fp->_IO_read_ptr;
-   fp->_IO_write_ptr = fp->_IO_write_base;
-   /* Avoid memory leak when there is an active ungetc buffer.  */
-diff --git a/lib/freadahead.c b/build-aux/gnulib/lib/freadahead.c
-index c2ecb5b28..23ec76ee5 100644
---- a/lib/freadahead.c
-+++ b/lib/freadahead.c
-@@ -30,7 +30,7 @@ extern size_t __sreadahead (FILE *);
- size_t
- freadahead (FILE *fp)
- {
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   if (fp->_IO_write_ptr > fp->_IO_write_base)
-     return 0;
-   return (fp->_IO_read_end - fp->_IO_read_ptr)
-diff --git a/lib/freading.c b/build-aux/gnulib/lib/freading.c
-index 73c28acdd..c24d0c88a 100644
---- a/lib/freading.c
-+++ b/lib/freading.c
-@@ -31,7 +31,7 @@ freading (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   return ((fp->_flags & _IO_NO_WRITES) != 0
-           || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0
-               && fp->_IO_read_base != NULL));
-diff --git a/lib/fseeko.c b/build-aux/gnulib/lib/fseeko.c
-index 0101ab55f..193f4e8ce 100644
---- a/lib/fseeko.c
-+++ b/lib/fseeko.c
-@@ -47,7 +47,7 @@ fseeko (FILE *fp, off_t offset, int whence)
- #endif
- 
-   /* These tests are based on fpurge.c.  */
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   if (fp->_IO_read_end == fp->_IO_read_ptr
-       && fp->_IO_write_ptr == fp->_IO_write_base
-       && fp->_IO_save_base == NULL)
-@@ -123,7 +123,7 @@ fseeko (FILE *fp, off_t offset, int whence)
-           return -1;
-         }
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-       fp->_flags &= ~_IO_EOF_SEEN;
-       fp->_offset = pos;
- #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
-diff --git a/lib/stdio-impl.h b/build-aux/gnulib/lib/stdio-impl.h
-index 78d896e9f..05c5752a2 100644
---- a/lib/stdio-impl.h
-+++ b/lib/stdio-impl.h
-@@ -18,6 +18,12 @@
-    the same implementation of stdio extension API, except that some fields
-    have different naming conventions, or their access requires some casts.  */
- 
-+/* Glibc 2.28 made _IO_IN_BACKUP private.  For now, work around this
-+   problem by defining it ourselves.  FIXME: Do not rely on glibc
-+   internals.  */
-+#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN
-+# define _IO_IN_BACKUP 0x100
-+#endif
- 
- /* BSD stdio derived implementations.  */
- 
--- 
-2.14.1
-
-
diff --git a/srcpkgs/m4/template b/srcpkgs/m4/template
index 78f3dae6184a..762593d883bd 100644
--- a/srcpkgs/m4/template
+++ b/srcpkgs/m4/template
@@ -1,17 +1,17 @@
 # Template file for 'm4'
 pkgname=m4
-version=1.4.18
-revision=2
+version=1.4.19
+revision=1
 bootstrap=yes
-replaces="chroot-m4>=0"
 build_style=gnu-configure
 configure_args="--enable-changeword --enable-threads"
 short_desc="GNU version of UNIX m4 macro language processor"
-homepage="https://www.gnu.org/software/m4/"
-license="GPL-3.0-or-later"
 maintainer="Enno Boland <gottox@voidlinux.org>"
+license="GPL-3.0-or-later"
+homepage="https://www.gnu.org/software/m4/"
 distfiles="${GNU_SITE}/${pkgname}/${pkgname}-${version}.tar.xz"
-checksum=f2c1e86ca0a404ff281631bdc8377638992744b175afb806e25871a24a934e07
+checksum=63aede5c6d33b6d9b13511cd0be2cac046f2e70fd0a07aa9573a04a82783af96
+replaces="chroot-m4>=0"
 
 if [ "$XBPS_TARGET_LIBC" = musl ]; then
 	export ac_cv_lib_error_at_line=no

From 61386a7022284b6a1cdd262dec23f658bed14f78 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 22:57:59 -0700
Subject: [PATCH 09/48] btrfs-progs: update to 5.19.

---
 srcpkgs/btrfs-progs/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/btrfs-progs/template b/srcpkgs/btrfs-progs/template
index f6c53d8587e1..292d5110106b 100644
--- a/srcpkgs/btrfs-progs/template
+++ b/srcpkgs/btrfs-progs/template
@@ -1,6 +1,6 @@
 # Template file for 'btrfs-progs'
 pkgname=btrfs-progs
-version=5.18.1
+version=5.19
 revision=1
 wrksrc="${pkgname}-v${version}"
 build_style=gnu-configure
@@ -16,7 +16,7 @@ license="GPL-2.0-only, LGPL-2.1-or-later"
 homepage="https://btrfs.wiki.kernel.org/index.php/Main_Page"
 changelog="https://raw.githubusercontent.com/kdave/btrfs-progs/master/CHANGES"
 distfiles="${KERNEL_SITE}/kernel/people/kdave/${pkgname}/${pkgname}-v${version}.tar.xz"
-checksum=6e98a75ccff52e9354daa1ad284c614c490f844273a2fa524cbac9eb841c7255
+checksum=1fbcf06e4b2f80e7a127fd687ed4625a5b74fa674fe212c836ff70e0edfcccf9
 # Most of the tests depend on `mount` and `fallocate` commands, which are not
 # presented in chroot-util-linux
 make_check=no

From 50b67dd8a285554e593a378863ddb70a0b4a60b8 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 19:39:23 -0700
Subject: [PATCH 10/48] syslinux: fix build for glibc 2.36

---
 .../patches/fix-build-with-glibc-2.36.patch   | 30 +++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 srcpkgs/syslinux/patches/fix-build-with-glibc-2.36.patch

diff --git a/srcpkgs/syslinux/patches/fix-build-with-glibc-2.36.patch b/srcpkgs/syslinux/patches/fix-build-with-glibc-2.36.patch
new file mode 100644
index 000000000000..1303be56c127
--- /dev/null
+++ b/srcpkgs/syslinux/patches/fix-build-with-glibc-2.36.patch
@@ -0,0 +1,30 @@
+--- a/linux/syslinux.c
++++ b/linux/syslinux.c
+@@ -45,7 +45,6 @@
+ #include <sys/stat.h>
+ #include <sys/types.h>
+ #include <sys/wait.h>
+-#include <sys/mount.h>
+ 
+ #include "linuxioctl.h"
+ 
+--- a/libinstaller/syslxcom.c
++++ b/libinstaller/syslxcom.c
+@@ -28,7 +28,6 @@
+ #include <errno.h>
+ #include <sys/stat.h>
+ #include <sys/types.h>
+-#include <sys/mount.h>
+ #include <sys/vfs.h>
+ 
+ #include "linuxioctl.h"
+--- a/extlinux/main.c
++++ b/extlinux/main.c
+@@ -40,7 +40,6 @@
+ #include <sys/stat.h>
+ #include <sys/sysmacros.h>
+ #include <sys/types.h>
+-#include <sys/mount.h>
+ #include <sys/vfs.h>
+ 
+ #include "linuxioctl.h"

From 51fc2769e9892adb4ebc08c7c2d470be25b942f5 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 14 Aug 2022 19:29:36 -0700
Subject: [PATCH 11/48] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove -no-pie from build. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..58d94f8dacba 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -60,6 +60,7 @@ _void_cross_build_binutils() {
 		--disable-multilib \
 		--disable-werror \
 		--disable-gold \
+		--disable-gprofng \
 		--enable-relro \
 		--enable-plugins \
 		--enable-64-bit-bfd \
@@ -132,6 +133,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -460,6 +462,14 @@ do_build() {
 	local binutils_ver linux_ver gcc_ver libc_ver libucontext_ver
 	local tgt=${sourcepkg/cross-}
 
+	export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}"
+	export CXXFLAGS="${CXXFLAGS/-D_FORTIFY_SOURCE=2/}"
+
+	# Disable explicit -fno-PIE, gcc/binutils/libc will figure this out itself.
+	export CFLAGS="${CFLAGS//-fno-PIE/}"
+	export CXXFLAGS="${CXXFLAGS//-fno-PIE/}"
+	export LDFLAGS="${LDFLAGS//-no-pie/}"
+
 	_void_cross_test_ver binutils
 	_void_cross_test_ver linux
 	_void_cross_test_ver gcc
@@ -625,6 +635,9 @@ do_install() {
 	# then remove it because it conflicts with libquadmath package
 	rm -rf ${DESTDIR}/${sysroot}/usr/lib/libquadmath.*
 
+	# Remove libdep linker plugin because it conflicts with system binutils
+	rm -f ${DESTDIR}/usr/lib/bfd-plugins/libdep*
+
 	# Remove leftover symlinks
 	rm -f ${DESTDIR}/usr/lib${XBPS_TARGET_WORDSIZE}
 	rm -f ${DESTDIR}/lib*

From 5ca7785d2120b86e01eb40e14d5f1bf0cf9026e1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:08:52 -0700
Subject: [PATCH 12/48] openssh: suppress werror on gcc12

---
 srcpkgs/openssh/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/openssh/template b/srcpkgs/openssh/template
index 02a2dec35f42..6e8e343a9dca 100644
--- a/srcpkgs/openssh/template
+++ b/srcpkgs/openssh/template
@@ -40,7 +40,7 @@ if [ "$build_option_ldns" -a -z "$build_option_ssl" ]; then
 	broken="option 'ldns' requires option 'ssl'"
 fi
 
-CFLAGS="-Wno-format-truncation -Wno-stringop-truncation"
+CFLAGS="-Wno-format-truncation -Wno-stringop-truncation -Wno-error=maybe-uninitialized"
 
 case $XBPS_TARGET_MACHINE in
 	i686-musl)

From a9427faead85c60f7d9432e7bf6a71e4ab15a7bb Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:09:31 -0700
Subject: [PATCH 13/48] linux5.18: update dotconfigs for gcc12

---
 srcpkgs/linux5.18/files/x86_64-dotconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/linux5.18/files/x86_64-dotconfig b/srcpkgs/linux5.18/files/x86_64-dotconfig
index 4e73a3195d40..ea6204868e23 100644
--- a/srcpkgs/linux5.18/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.18/files/x86_64-dotconfig
@@ -512,6 +512,7 @@ CONFIG_RETHUNK=y
 CONFIG_CPU_UNRET_ENTRY=y
 CONFIG_CPU_IBPB_ENTRY=y
 CONFIG_CPU_IBRS_ENTRY=y
+CONFIG_SLS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10060,8 +10061,11 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
 # Memory initialization
 #
 CONFIG_INIT_STACK_NONE=y
+# CONFIG_INIT_STACK_ALL_PATTERN is not set
+# CONFIG_INIT_STACK_ALL_ZERO is not set
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
+# CONFIG_ZERO_CALL_USED_REGS is not set
 # end of Memory initialization
 # end of Kernel hardening options
 # end of Security options
@@ -10538,6 +10542,7 @@ CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
 # CONFIG_UBSAN is not set
 CONFIG_HAVE_ARCH_KCSAN=y
+# CONFIG_KCSAN is not set
 # end of Generic Kernel Debugging Instruments
 
 #

From 09ed0d51dad004ce6f300765d219ed2bfa369242 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 18:00:42 -0700
Subject: [PATCH 14/48] xf86-video-vmware: fix build on gcc12

---
 ...183b3395333d5d4c73e25c2d011748f15eda.patch | 30 +++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch

diff --git a/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch b/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch
new file mode 100644
index 000000000000..ff839f16e628
--- /dev/null
+++ b/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch
@@ -0,0 +1,30 @@
+From 77b8183b3395333d5d4c73e25c2d011748f15eda Mon Sep 17 00:00:00 2001
+From: Rudi Heitbaum <rudi@heitbaum.com>
+Date: Sun, 8 May 2022 03:00:10 +0000
+Subject: [PATCH] vmwgfx: fix missing array notation
+
+ Fixes error identified by gcc-12.1.0 compiler
+
+make
+  CC       libvmwgfx_la-vmwgfx_tex_video.lo
+vmwgfx_tex_video.c: In function 'stop_video':
+vmwgfx_tex_video.c:240:20: error: the comparison will always evaluate as 'true' for the address of 'yuv' will never be NULL [-Werror=address]
+  240 |                if (priv->yuv[i]) {
+      |                    ^~~~
+---
+ vmwgfx/vmwgfx_tex_video.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/vmwgfx/vmwgfx_tex_video.c b/vmwgfx/vmwgfx_tex_video.c
+index acc2b56..480a5f1 100644
+--- a/vmwgfx/vmwgfx_tex_video.c
++++ b/vmwgfx/vmwgfx_tex_video.c
+@@ -237,7 +237,7 @@ stop_video(ScrnInfoPtr pScrn, pointer data, Bool shutdown)
+ 
+        for (i=0; i<3; ++i) {
+ 	   for (j=0; j<2; ++j) {
+-	       if (priv->yuv[i]) {
++	       if (priv->yuv[j][i]) {
+ 		   xa_surface_destroy(priv->yuv[j][i]);
+ 		   priv->yuv[j][i] = NULL;
+ 	       }

From 7e2ac25f2ba59463dd0041f7bf6df6b77f95892f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 18:24:37 -0700
Subject: [PATCH 15/48] doxygen: fix build for gcc 12

---
 srcpkgs/doxygen/patches/compat-gcc12.patch | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100644 srcpkgs/doxygen/patches/compat-gcc12.patch

diff --git a/srcpkgs/doxygen/patches/compat-gcc12.patch b/srcpkgs/doxygen/patches/compat-gcc12.patch
new file mode 100644
index 000000000000..666744a1dceb
--- /dev/null
+++ b/srcpkgs/doxygen/patches/compat-gcc12.patch
@@ -0,0 +1,22 @@
+From 5198966c8d5fec89116d025c74934ac03ea511fa Mon Sep 17 00:00:00 2001
+From: Dimitri van Heesch <doxygen@gmail.com>
+Date: Fri, 6 May 2022 09:55:16 +0200
+Subject: [PATCH] issue #9312: Build: cache.h:53:14: error: 'exchange' is not a
+ member of 'std'
+
+---
+ src/cache.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/cache.h b/src/cache.h
+index 0ff3092ed5..e218eb27d2 100644
+--- a/src/cache.h
++++ b/src/cache.h
+@@ -19,6 +19,7 @@
+ #include <list>
+ #include <unordered_map>
+ #include <mutex>
++#include <utility>
+ #include <ctype.h>
+ 
+ /*! Fixed size cache for value type V using keys of type K.

From be2ca39f7108e0f9fab82285ab7526a7b97f11ac Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 21 Aug 2022 21:37:00 -0700
Subject: [PATCH 16/48] openjdk7-bootstrap: fix build for gcc12

---
 .../files/dist_patches_glibc.txt              |  1 +
 .../files/dist_patches_musl.txt               |  1 +
 .../icedtea-pointer-comparison-gcc12.patch    | 31 +++++++++++++++++++
 3 files changed, 33 insertions(+)
 create mode 100644 srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch

diff --git a/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt b/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt
index c76c56855441..8061756dfc0c 100644
--- a/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt
+++ b/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt
@@ -6,3 +6,4 @@ icedtea-jdk-no-soname.patch
 icedtea-jdk-xattr.patch
 icedtea-jdk-sysctl_h.patch
 icedtea-cpio.patch
+icedtea-pointer-comparison-gcc12.patch
diff --git a/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt b/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt
index 21812517c7c2..8b35d9c46989 100644
--- a/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt
+++ b/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt
@@ -11,3 +11,4 @@ icedtea-jdk-musl.patch
 icedtea-jdk-no-soname.patch
 icedtea-jdk-xattr.patch
 icedtea-cpio.patch
+icedtea-pointer-comparison-gcc12.patch
diff --git a/srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch b/srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch
new file mode 100644
index 000000000000..c809553443e7
--- /dev/null
+++ b/srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch
@@ -0,0 +1,31 @@
+--- openjdk.orig/hotspot/src/share/vm/opto/lcm.cpp
++++ openjdk/hotspot/src/share/vm/opto/lcm.cpp
+@@ -60,7 +60,7 @@
+ // Check whether val is not-null-decoded compressed oop,
+ // i.e. will grab into the base of the heap if it represents NULL.
+ static bool accesses_heap_base_zone(Node *val) {
+-  if (Universe::narrow_oop_base() > 0) { // Implies UseCompressedOops.
++  if (Universe::narrow_oop_base() > (address)0) { // Implies UseCompressedOops.
+     if (val && val->is_Mach()) {
+       if (val->as_Mach()->ideal_Opcode() == Op_DecodeN) {
+         // This assumes all Decodes with TypePtr::NotNull are matched to nodes that
+--- openjdk.orig/hotspot/src/share/vm/runtime/virtualspace.cpp
++++ openjdk/hotspot/src/share/vm/runtime/virtualspace.cpp
+@@ -527,7 +527,7 @@ ReservedHeapSpace::ReservedHeapSpace(siz
+                 (UseCompressedOops && (Universe::narrow_oop_base() != NULL) &&
+                  Universe::narrow_oop_use_implicit_null_checks()) ?
+                   lcm(os::vm_page_size(), alignment) : 0) {
+-  if (base() > 0) {
++  if (base() > (char*)0) {
+     MemTracker::record_virtual_memory_type((address)base(), mtJavaHeap);
+   }
+ 
+@@ -546,7 +546,7 @@ ReservedHeapSpace::ReservedHeapSpace(con
+                 (UseCompressedOops && (Universe::narrow_oop_base() != NULL) &&
+                  Universe::narrow_oop_use_implicit_null_checks()) ?
+                   lcm(os::vm_page_size(), prefix_align) : 0) {
+-  if (base() > 0) {
++  if (base() > (char*)0) {
+     MemTracker::record_virtual_memory_type((address)base(), mtJavaHeap);
+   }
+ 

From 630b280b78bad824bb82e17712da3c31d5b8724b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:39:52 -0700
Subject: [PATCH 17/48] libvirt: fix build for glibc 2.36

---
 .../patches/lxc-fix-compat-glibc-2.36.patch   | 34 ++++++++++++++++
 .../virfile-fix-compat-glibc-2.36.patch       | 39 +++++++++++++++++++
 2 files changed, 73 insertions(+)
 create mode 100644 srcpkgs/libvirt/patches/lxc-fix-compat-glibc-2.36.patch
 create mode 100644 srcpkgs/libvirt/patches/virfile-fix-compat-glibc-2.36.patch

diff --git a/srcpkgs/libvirt/patches/lxc-fix-compat-glibc-2.36.patch b/srcpkgs/libvirt/patches/lxc-fix-compat-glibc-2.36.patch
new file mode 100644
index 000000000000..d85b57815010
--- /dev/null
+++ b/srcpkgs/libvirt/patches/lxc-fix-compat-glibc-2.36.patch
@@ -0,0 +1,34 @@
+From 9493c9b79dc541ec9e0fd73c6d87bdf8d30aaa90 Mon Sep 17 00:00:00 2001
+From: Cole Robinson <crobinso@redhat.com>
+Date: Mon, 1 Aug 2022 15:20:38 -0400
+Subject: [PATCH] lxc: containter: fix build with glibc 2.36
+
+With glibc 2.36, sys/mount.h and linux/mount.h conflict:
+https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
+
+lxc_container.c imports sys/mount.h and linux/fs.h, which pulls in
+linux/mount.h.
+
+linux/fs.h isn't required here though. glibc sys/mount.h has had
+MS_MOVE since 2.12 in 2010
+
+Reviewed-by: Erik Skultety <eskultet@redhat.com>
+Signed-off-by: Cole Robinson <crobinso@redhat.com>
+---
+ src/lxc/lxc_container.c | 3 ---
+ 1 file changed, 3 deletions(-)
+
+diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
+index b5278831da7..a5401c2186e 100644
+--- a/src/lxc/lxc_container.c
++++ b/src/lxc/lxc_container.c
+@@ -33,9 +33,6 @@
+ /* Yes, we want linux private one, for _syscall2() macro */
+ #include <linux/unistd.h>
+ 
+-/* For MS_MOVE */
+-#include <linux/fs.h>
+-
+ #if WITH_CAPNG
+ # include <cap-ng.h>
+ #endif
diff --git a/srcpkgs/libvirt/patches/virfile-fix-compat-glibc-2.36.patch b/srcpkgs/libvirt/patches/virfile-fix-compat-glibc-2.36.patch
new file mode 100644
index 000000000000..2ef227ea9b54
--- /dev/null
+++ b/srcpkgs/libvirt/patches/virfile-fix-compat-glibc-2.36.patch
@@ -0,0 +1,39 @@
+From c0d9adf220dc0d223330a7bac37b174132d330ba Mon Sep 17 00:00:00 2001
+From: Cole Robinson <crobinso@redhat.com>
+Date: Mon, 1 Aug 2022 15:24:01 -0400
+Subject: [PATCH] virfile: Fix build with glibc 2.36
+
+With glibc 2.36, sys/mount.h and linux/mount.h conflict:
+https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
+
+virfile.c imports sys/mount.h and linux/fs.h, which pulls in
+linux/mount.h.
+
+Manually define the constants we need from linux/fs.h, like was
+done in llvm:
+
+https://reviews.llvm.org/rGb379129c4beb3f26223288627a1291739f33af02
+
+Reviewed-by: Erik Skultety <eskultet@redhat.com>
+Signed-off-by: Cole Robinson <crobinso@redhat.com>
+---
+ src/util/virfile.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/src/util/virfile.c b/src/util/virfile.c
+index 99da058db3b..ce541b8946b 100644
+--- a/src/util/virfile.c
++++ b/src/util/virfile.c
+@@ -71,7 +71,11 @@
+ # endif
+ # include <sys/ioctl.h>
+ # include <linux/cdrom.h>
+-# include <linux/fs.h>
++/* These come from linux/fs.h, but that header conflicts with
++ * sys/mount.h on glibc 2.36+ */
++# define FS_IOC_GETFLAGS _IOR('f', 1, long)
++# define FS_IOC_SETFLAGS _IOW('f', 2, long)
++# define FS_NOCOW_FL 0x00800000
+ #endif
+ 
+ #if WITH_LIBATTR

From 5ede4ece33cde734bfff18f0e57e40d32ca0d15f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:41:50 -0700
Subject: [PATCH 18/48] efivar: fix build for glibc 2.36

---
 .../patches/fix-compat-glibc-2.36.patch       | 55 +++++++++++++++++++
 1 file changed, 55 insertions(+)
 create mode 100644 srcpkgs/efivar/patches/fix-compat-glibc-2.36.patch

diff --git a/srcpkgs/efivar/patches/fix-compat-glibc-2.36.patch b/srcpkgs/efivar/patches/fix-compat-glibc-2.36.patch
new file mode 100644
index 000000000000..fcc83aef20cf
--- /dev/null
+++ b/srcpkgs/efivar/patches/fix-compat-glibc-2.36.patch
@@ -0,0 +1,55 @@
+From bc65d63ebf8fe6ac8a099ff15ca200986dba1565 Mon Sep 17 00:00:00 2001
+From: Robbie Harwood <rharwood@redhat.com>
+Date: Thu, 28 Jul 2022 16:11:24 -0400
+Subject: [PATCH] Fix glibc 2.36 build (mount.h conflicts)
+
+glibc has decided that sys/mount.h and linux/mount.h are no longer
+usable at the same time.  This broke the build, since linux/fs.h itself
+includes linux/mount.h.  For now, fix the build by only including
+sys/mount.h where we need it.
+
+See-also: https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
+Resolves: #227
+Signed-off-by: Robbie Harwood <rharwood@redhat.com>
+---
+ src/gpt.c   | 1 +
+ src/linux.c | 1 +
+ src/util.h  | 1 -
+ 3 files changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/gpt.c b/src/gpt.c
+index 1eda0497..21413c3b 100644
+--- a/src/gpt.c
++++ b/src/gpt.c
+@@ -17,6 +17,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <sys/mount.h>
+ #include <sys/param.h>
+ #include <sys/stat.h>
+ #include <sys/utsname.h>
+diff --git a/src/linux.c b/src/linux.c
+index 47e45ae4..1780816f 100644
+--- a/src/linux.c
++++ b/src/linux.c
+@@ -20,6 +20,7 @@
+ #include <stdbool.h>
+ #include <stdio.h>
+ #include <sys/ioctl.h>
++#include <sys/mount.h>
+ #include <sys/socket.h>
+ #include <sys/sysmacros.h>
+ #include <sys/types.h>
+diff --git a/src/util.h b/src/util.h
+index 3300666f..1e67e447 100644
+--- a/src/util.h
++++ b/src/util.h
+@@ -23,7 +23,6 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <sys/ioctl.h>
+-#include <sys/mount.h>
+ #include <sys/stat.h>
+ #include <sys/types.h>
+ #include <tgmath.h>

From 8727cc90a33fbd4f3b446bc0c338a629c8d97fd9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:43:24 -0700
Subject: [PATCH 19/48] libwpd: fix build for gcc12

---
 srcpkgs/libwpd/patches/fix-compat-gcc12.patch | 11 +++++++++++
 1 file changed, 11 insertions(+)
 create mode 100644 srcpkgs/libwpd/patches/fix-compat-gcc12.patch

diff --git a/srcpkgs/libwpd/patches/fix-compat-gcc12.patch b/srcpkgs/libwpd/patches/fix-compat-gcc12.patch
new file mode 100644
index 000000000000..6ebce2463d16
--- /dev/null
+++ b/srcpkgs/libwpd/patches/fix-compat-gcc12.patch
@@ -0,0 +1,11 @@
+diff -rup libwpd-0.10.3.orig/src/lib/WPXTable.h libwpd-0.10.3/src/lib/WPXTable.h
+--- libwpd-0.10.3.orig/src/lib/WPXTable.h	2022-08-23 22:32:45.332593795 -0700
++++ libwpd-0.10.3/src/lib/WPXTable.h	2022-08-23 22:32:59.500651211 -0700
+@@ -37,6 +37,7 @@
+ #define _WPXTABLE_H
+ 
+ #include <vector>
++#include <cstddef>
+ 
+ struct WPXTableCell
+ {

From a8c8f9f72550fd592aa8deaec7771f51aa20772f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:44:07 -0700
Subject: [PATCH 20/48] grub: fix build for binutils 2.36

---
 .../patches/fix-compat-binutils-2.36.patch    | 96 +++++++++++++++++++
 srcpkgs/grub/template                         |  7 +-
 2 files changed, 102 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/grub/patches/fix-compat-binutils-2.36.patch

diff --git a/srcpkgs/grub/patches/fix-compat-binutils-2.36.patch b/srcpkgs/grub/patches/fix-compat-binutils-2.36.patch
new file mode 100644
index 000000000000..d92a91e3253e
--- /dev/null
+++ b/srcpkgs/grub/patches/fix-compat-binutils-2.36.patch
@@ -0,0 +1,96 @@
+From b98275138bf4fc250a1c362dfd2c8b1cf2421701 Mon Sep 17 00:00:00 2001
+From: Michael Chang <mchang@suse.com>
+Date: Tue, 28 Sep 2021 13:50:47 +0800
+Subject: build: Fix build error with binutils 2.36
+
+The following procedure to build xen/pvgrub is broken.
+
+  git clone https://git.savannah.gnu.org/git/grub.git
+  cd grub
+  ./bootstrap
+  mkdir build-xen
+  cd build-xen
+  ../configure --with-platform=xen
+  make
+
+It fails with the message:
+
+  /usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld:
+  section .note.gnu.property VMA [0000000000400158,0000000000400187]
+  overlaps section .bss VMA [000000000000f000,000000000041e1af]
+
+The most significant factor is that new assembler (GNU as) generates the
+.note.gnu.property section as default. This note section overlaps with
+.bss because it doesn't reposition with -Wl,-Ttext,0 with which the base
+address of .text section is set, rather the address of .note.gnu.property
+is calculated for some reason from 0x400000 where the ELF executable
+defaults to start.
+
+Using -Ttext-segment doesn't help either, though it is said to set the
+address of the first byte of the text segment according to "man ld".
+What it actually does is to override the default 0x400000, aka the image
+base address, to something else. The entire process can be observed in
+the default linker script used by gcc [1]. Therefore we can't expect it
+to achieve the same thing as -Ttext given that the first segment where
+.text resides is offset by SIZEOF_HEADERS plus some sections may be
+preceding it within the first segment. The end result is .text always
+has to start with non-zero address with -Wl,-Ttext-segment,0 if using
+default linker script.
+
+It is also worth mentioning that binutils upstream apparently doesn't
+seem to consider this as a bug [2] and proposed to use -Wl,-Ttext-segment,0
+which is not fruitful as what has been tested by Gentoo [3].
+
+As long as GRUB didn't use ISA information encoded in .note.gnu.property,
+we can safely drop it via -Wa,-mx86-used-note=no assembler option to
+fix the linker error above.
+
+This is considered a better approach than using custom linker script to
+drop the .note.gnu.property section because object file manipulation can
+also be hampered one way or the other in that linker script may not be
+helpful. See also this commit removing the section in the process of objcopy.
+
+  6643507ce build: Fix GRUB i386-pc build with Ubuntu gcc
+
+[1] In /usr/lib64/ldscripts/elf_x86_64.x or use 'gcc -Wl,--verbose ...'
+    PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x400000));
+    . = SEGMENT_START("text-segment", 0x400000) + SIZEOF_HEADERS;
+[2] https://sourceware.org/bugzilla/show_bug.cgi?id=27377
+[3] https://bugs.gentoo.org/787221
+
+Signed-off-by: Michael Chang <mchang@suse.com>
+Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
+---
+ configure.ac | 14 ++++++++++++++
+ 1 file changed, 14 insertions(+)
+
+(limited to 'configure.ac')
+
+diff --git a/configure.ac b/configure.ac
+index eeb5d22..8d1c81a 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -840,6 +840,20 @@ if ( test "x$target_cpu" = xi386 || test "x$target_cpu" = xx86_64 ) && test "x$p
+   TARGET_CFLAGS="$TARGET_CFLAGS -mno-mmx -mno-sse -mno-sse2 -mno-sse3 -mno-3dnow"
+ fi
+ 
++if ( test "x$target_cpu" = xi386 || test "x$target_cpu" = xx86_64 ); then
++  AC_CACHE_CHECK([whether -Wa,-mx86-used-note works], [grub_cv_cc_mx86_used_note], [
++    CFLAGS="$TARGET_CFLAGS -Wa,-mx86-used-note=no -Werror"
++    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
++	[grub_cv_cc_mx86_used_note=yes],
++	[grub_cv_cc_mx86_used_note=no])
++  ])
++
++  if test "x$grub_cv_cc_mx86_used_note" = xyes; then
++    TARGET_CFLAGS="$TARGET_CFLAGS -Wa,-mx86-used-note=no"
++    TARGET_CCASFLAGS="$TARGET_CCASFLAGS -Wa,-mx86-used-note=no"
++  fi
++fi
++
+ # GRUB doesn't use float or doubles at all. Yet some toolchains may decide
+ # that floats are a good fit to run instead of what's written in the code.
+ # Given that floating point unit is disabled (if present to begin with)
+-- 
+cgit v1.1
+
diff --git a/srcpkgs/grub/template b/srcpkgs/grub/template
index b1826c38a884..b4d3b07af620 100644
--- a/srcpkgs/grub/template
+++ b/srcpkgs/grub/template
@@ -2,7 +2,8 @@
 pkgname=grub
 version=2.06
 revision=2
-hostmakedepends="python3 pkg-config flex freetype-devel font-unifont-bdf help2man"
+hostmakedepends="python3 pkg-config flex freetype-devel font-unifont-bdf help2man
+ automake gettext-devel-tools"
 makedepends="libusb-compat-devel ncurses-devel freetype-devel
  liblzma-devel device-mapper-devel fuse-devel"
 depends="os-prober"
@@ -43,6 +44,10 @@ case "$XBPS_TARGET_MACHINE" in
 		;;
 esac
 
+pre_configure() {
+	autoreconf -fi
+}
+
 do_configure() {
 	# workaround for https://savannah.gnu.org/bugs/?60458
 	# some more info: https://www.linuxquestions.org/questions/showthread.php?p=6257712

From f506026f4fc93a5b5f342ff7cb10592deb399e41 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:45:07 -0700
Subject: [PATCH 21/48] linux-toos: fix build for binutils 2.39

---
 .../patches/binutils-add-compat-check.patch   | 103 ++++++++++++
 .../patches/binutils-disasm-compat.patch      | 102 ++++++++++++
 .../bpf_jit_disasm-binutils-2.39.patch        | 104 ++++++++++++
 .../patches/bpftool-binutils-2.39.patch       | 149 ++++++++++++++++++
 .../patches/perf-binutils-2.39.patch          | 114 ++++++++++++++
 5 files changed, 572 insertions(+)
 create mode 100644 srcpkgs/linux-tools/patches/binutils-add-compat-check.patch
 create mode 100644 srcpkgs/linux-tools/patches/binutils-disasm-compat.patch
 create mode 100644 srcpkgs/linux-tools/patches/bpf_jit_disasm-binutils-2.39.patch
 create mode 100644 srcpkgs/linux-tools/patches/bpftool-binutils-2.39.patch
 create mode 100644 srcpkgs/linux-tools/patches/perf-binutils-2.39.patch

diff --git a/srcpkgs/linux-tools/patches/binutils-add-compat-check.patch b/srcpkgs/linux-tools/patches/binutils-add-compat-check.patch
new file mode 100644
index 000000000000..e4e7ece9635e
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/binutils-add-compat-check.patch
@@ -0,0 +1,103 @@
+From cfd59ca91467056bb2c36907b2fa67b8e1af9952 Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:27 -0700
+Subject: [PATCH] tools build: Add feature test for init_disassemble_info API
+ changes
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation failures for tools/{perf,bpf}, e.g. on debian unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+This commit adds a feature test to detect the new signature.  Subsequent
+commits will use it to fix the build failures.
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Quentin Monnet <quentin@isovalent.com>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-2-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/build/Makefile.feature                        |  1 +
+ tools/build/feature/Makefile                        |  4 ++++
+ tools/build/feature/test-all.c                      |  4 ++++
+ tools/build/feature/test-disassembler-init-styled.c | 13 +++++++++++++
+ 4 files changed, 22 insertions(+)
+ create mode 100644 tools/build/feature/test-disassembler-init-styled.c
+
+diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature
+index 888a0421d43b96..8f6578e4d3249e 100644
+--- a/tools/build/Makefile.feature
++++ b/tools/build/Makefile.feature
+@@ -70,6 +70,7 @@ FEATURE_TESTS_BASIC :=                  \
+         libaio				\
+         libzstd				\
+         disassembler-four-args		\
++        disassembler-init-styled	\
+         file-handle
+ 
+ # FEATURE_TESTS_BASIC + FEATURE_TESTS_EXTRA is the complete list
+diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile
+index 7c2a17e23c30ac..c3059739318a95 100644
+--- a/tools/build/feature/Makefile
++++ b/tools/build/feature/Makefile
+@@ -18,6 +18,7 @@ FILES=                                          \
+          test-libbfd.bin                        \
+          test-libbfd-buildid.bin		\
+          test-disassembler-four-args.bin        \
++         test-disassembler-init-styled.bin	\
+          test-reallocarray.bin			\
+          test-libbfd-liberty.bin                \
+          test-libbfd-liberty-z.bin              \
+@@ -248,6 +249,9 @@ $(OUTPUT)test-libbfd-buildid.bin:
+ $(OUTPUT)test-disassembler-four-args.bin:
+ 	$(BUILD) -DPACKAGE='"perf"' -lbfd -lopcodes
+ 
++$(OUTPUT)test-disassembler-init-styled.bin:
++	$(BUILD) -DPACKAGE='"perf"' -lbfd -lopcodes
++
+ $(OUTPUT)test-reallocarray.bin:
+ 	$(BUILD)
+ 
+diff --git a/tools/build/feature/test-all.c b/tools/build/feature/test-all.c
+index 5ffafb967b6e49..957c02c7b163b5 100644
+--- a/tools/build/feature/test-all.c
++++ b/tools/build/feature/test-all.c
+@@ -166,6 +166,10 @@
+ # include "test-disassembler-four-args.c"
+ #undef main
+ 
++#define main main_test_disassembler_init_styled
++# include "test-disassembler-init-styled.c"
++#undef main
++
+ #define main main_test_libzstd
+ # include "test-libzstd.c"
+ #undef main
+diff --git a/tools/build/feature/test-disassembler-init-styled.c b/tools/build/feature/test-disassembler-init-styled.c
+new file mode 100644
+index 00000000000000..f1ce0ec3bee9d3
+--- /dev/null
++++ b/tools/build/feature/test-disassembler-init-styled.c
+@@ -0,0 +1,13 @@
++// SPDX-License-Identifier: GPL-2.0
++#include <stdio.h>
++#include <dis-asm.h>
++
++int main(void)
++{
++	struct disassemble_info info;
++
++	init_disassemble_info(&info, stdout,
++			      NULL, NULL);
++
++	return 0;
++}
diff --git a/srcpkgs/linux-tools/patches/binutils-disasm-compat.patch b/srcpkgs/linux-tools/patches/binutils-disasm-compat.patch
new file mode 100644
index 000000000000..1a6cc0e6d97c
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/binutils-disasm-compat.patch
@@ -0,0 +1,102 @@
+From a45b3d6926231c3d024ea0de4f7bd967f83709ee Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:29 -0700
+Subject: tools include: add dis-asm-compat.h to handle version differences
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation failures for tools/{perf,bpf}, e.g. on debian unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+This commit introduces a wrapper for init_disassemble_info(), to avoid
+spreading #ifdef DISASM_INIT_STYLED to a bunch of places. Subsequent
+commits will use it to fix the build failures.
+
+It likely is worth adding a wrapper for disassember(), to avoid the already
+existing DISASM_FOUR_ARGS_SIGNATURE ifdefery.
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Signed-off-by: Ben Hutchings <benh@debian.org>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Quentin Monnet <quentin@isovalent.com>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-4-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/include/tools/dis-asm-compat.h | 55 ++++++++++++++++++++++++++++++++++++
+ 1 file changed, 55 insertions(+)
+ create mode 100644 tools/include/tools/dis-asm-compat.h
+
+(limited to 'tools/include/tools/dis-asm-compat.h')
+
+diff --git a/tools/include/tools/dis-asm-compat.h b/tools/include/tools/dis-asm-compat.h
+new file mode 100644
+index 0000000000000..70f331e23ed3d
+--- /dev/null
++++ b/tools/include/tools/dis-asm-compat.h
+@@ -0,0 +1,55 @@
++/* SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause */
++#ifndef _TOOLS_DIS_ASM_COMPAT_H
++#define _TOOLS_DIS_ASM_COMPAT_H
++
++#include <stdio.h>
++#include <dis-asm.h>
++
++/* define types for older binutils version, to centralize ifdef'ery a bit */
++#ifndef DISASM_INIT_STYLED
++enum disassembler_style {DISASSEMBLER_STYLE_NOT_EMPTY};
++typedef int (*fprintf_styled_ftype) (void *, enum disassembler_style, const char*, ...);
++#endif
++
++/*
++ * Trivial fprintf wrapper to be used as the fprintf_styled_func argument to
++ * init_disassemble_info_compat() when normal fprintf suffices.
++ */
++static inline int fprintf_styled(void *out,
++				 enum disassembler_style style,
++				 const char *fmt, ...)
++{
++	va_list args;
++	int r;
++
++	(void)style;
++
++	va_start(args, fmt);
++	r = vfprintf(out, fmt, args);
++	va_end(args);
++
++	return r;
++}
++
++/*
++ * Wrapper for init_disassemble_info() that hides version
++ * differences. Depending on binutils version and architecture either
++ * fprintf_func or fprintf_styled_func will be called.
++ */
++static inline void init_disassemble_info_compat(struct disassemble_info *info,
++						void *stream,
++						fprintf_ftype unstyled_func,
++						fprintf_styled_ftype styled_func)
++{
++#ifdef DISASM_INIT_STYLED
++	init_disassemble_info(info, stream,
++			      unstyled_func,
++			      styled_func);
++#else
++	(void)styled_func;
++	init_disassemble_info(info, stream,
++			      unstyled_func);
++#endif
++}
++
++#endif /* _TOOLS_DIS_ASM_COMPAT_H */
+-- 
+cgit 
+
diff --git a/srcpkgs/linux-tools/patches/bpf_jit_disasm-binutils-2.39.patch b/srcpkgs/linux-tools/patches/bpf_jit_disasm-binutils-2.39.patch
new file mode 100644
index 000000000000..01221fad3a4a
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/bpf_jit_disasm-binutils-2.39.patch
@@ -0,0 +1,104 @@
+From 96ed066054abf11c7d3e106e3011a51f3f1227a3 Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:31 -0700
+Subject: [PATCH] tools bpf_jit_disasm: Fix compilation error with new binutils
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation to fail for tools/bpf/bpf_jit_disasm.c, e.g. on debian
+unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+Wire up the feature test and switch to init_disassemble_info_compat(),
+which were introduced in prior commits, fixing the compilation failure.
+
+I verified that bpf_jit_disasm can still disassemble bpf programs, both
+with the old and new dis-asm.h API. With old binutils there's no change in
+output before/after this patch. When comparing the output from old
+binutils (2.35) to new bintuils with the patch (upstream snapshot) there
+are a few output differences, but they are unrelated to this patch. An
+example hunk is:
+
+     f4:	mov    %r14,%rsi
+     f7:	mov    %r15,%rdx
+     fa:	mov    $0x2a,%ecx
+  -  ff:	callq  0xffffffffea8c4988
+  +  ff:	call   0xffffffffea8c4988
+    104:	test   %rax,%rax
+    107:	jge    0x0000000000000110
+    109:	xor    %eax,%eax
+  - 10b:	jmpq   0x0000000000000073
+  + 10b:	jmp    0x0000000000000073
+    110:	cmp    $0x16,%rax
+
+However, I had to use an older kernel to generate the bpf_jit_enabled =
+2 output, as that has been broken since 5.18 / 1022a5498f6f745c ("bpf,
+x86_64: Use bpf_jit_binary_pack_alloc").
+
+  https://lore.kernel.org/20220703030210.pmjft7qc2eajzi6c@alap3.anarazel.de
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Daniel Borkmann <daniel@iogearbox.net>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Quentin Monnet <quentin@isovalent.com>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-6-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/bpf/Makefile         | 5 ++++-
+ tools/bpf/bpf_jit_disasm.c | 5 ++++-
+ 2 files changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/tools/bpf/Makefile b/tools/bpf/Makefile
+index b11cfc86a3d021..664601ab1705ab 100644
+--- a/tools/bpf/Makefile
++++ b/tools/bpf/Makefile
+@@ -34,7 +34,7 @@ else
+ endif
+ 
+ FEATURE_USER = .bpf
+-FEATURE_TESTS = libbfd disassembler-four-args
++FEATURE_TESTS = libbfd disassembler-four-args disassembler-init-styled
+ FEATURE_DISPLAY = libbfd disassembler-four-args
+ 
+ check_feat := 1
+@@ -56,6 +56,9 @@ endif
+ ifeq ($(feature-disassembler-four-args), 1)
+ CFLAGS += -DDISASM_FOUR_ARGS_SIGNATURE
+ endif
++ifeq ($(feature-disassembler-init-styled), 1)
++CFLAGS += -DDISASM_INIT_STYLED
++endif
+ 
+ $(OUTPUT)%.yacc.c: $(srctree)/tools/bpf/%.y
+ 	$(QUIET_BISON)$(YACC) -o $@ -d $<
+diff --git a/tools/bpf/bpf_jit_disasm.c b/tools/bpf/bpf_jit_disasm.c
+index c8ae9580472814..a90a5d110f9255 100644
+--- a/tools/bpf/bpf_jit_disasm.c
++++ b/tools/bpf/bpf_jit_disasm.c
+@@ -28,6 +28,7 @@
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <limits.h>
++#include <tools/dis-asm-compat.h>
+ 
+ #define CMD_ACTION_SIZE_BUFFER		10
+ #define CMD_ACTION_READ_ALL		3
+@@ -64,7 +65,9 @@ static void get_asm_insns(uint8_t *image, size_t len, int opcodes)
+ 	assert(bfdf);
+ 	assert(bfd_check_format(bfdf, bfd_object));
+ 
+-	init_disassemble_info(&info, stdout, (fprintf_ftype) fprintf);
++	init_disassemble_info_compat(&info, stdout,
++				     (fprintf_ftype) fprintf,
++				     fprintf_styled);
+ 	info.arch = bfd_get_arch(bfdf);
+ 	info.mach = bfd_get_mach(bfdf);
+ 	info.buffer = image;
diff --git a/srcpkgs/linux-tools/patches/bpftool-binutils-2.39.patch b/srcpkgs/linux-tools/patches/bpftool-binutils-2.39.patch
new file mode 100644
index 000000000000..1e55c40011be
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/bpftool-binutils-2.39.patch
@@ -0,0 +1,149 @@
+From 600b7b26c07a070d0153daa76b3806c1e52c9e00 Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:33 -0700
+Subject: [PATCH] tools bpftool: Fix compilation error with new binutils
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation to fail for tools/bpf/bpftool/jit_disasm.c, e.g. on debian
+unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+Wire up the feature test and switch to init_disassemble_info_compat(),
+which were introduced in prior commits, fixing the compilation failure.
+
+I verified that bpftool can still disassemble bpf programs, both with an
+old and new dis-asm.h API. There are no output changes for plain and json
+formats. When comparing the output from old binutils (2.35)
+to new bintuils with the patch (upstream snapshot) there are a few output
+differences, but they are unrelated to this patch. An example hunk is:
+
+     2f:	pop    %r14
+     31:	pop    %r13
+     33:	pop    %rbx
+  -  34:	leaveq
+  -  35:	retq
+  +  34:	leave
+  +  35:	ret
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Quentin Monnet <quentin@isovalent.com>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-8-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/bpf/bpftool/Makefile     |  5 +++-
+ tools/bpf/bpftool/jit_disasm.c | 42 +++++++++++++++++++++++++++-------
+ 2 files changed, 38 insertions(+), 9 deletions(-)
+
+diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile
+index c6d2c77d02524a..436e671b2657d4 100644
+--- a/tools/bpf/bpftool/Makefile
++++ b/tools/bpf/bpftool/Makefile
+@@ -62,7 +62,7 @@ CLANG ?= clang
+ LLVM_STRIP ?= llvm-strip
+ 
+ FEATURE_USER = .bpftool
+-FEATURE_TESTS = libbfd disassembler-four-args reallocarray zlib libcap \
++FEATURE_TESTS = libbfd disassembler-four-args disassembler-init-styled reallocarray zlib libcap \
+ 	clang-bpf-co-re
+ FEATURE_DISPLAY = libbfd disassembler-four-args zlib libcap \
+ 	clang-bpf-co-re
+@@ -117,6 +117,9 @@ endif
+ ifeq ($(feature-disassembler-four-args), 1)
+ CFLAGS += -DDISASM_FOUR_ARGS_SIGNATURE
+ endif
++ifeq ($(feature-disassembler-init-styled), 1)
++    CFLAGS += -DDISASM_INIT_STYLED
++endif
+ 
+ LIBS = $(LIBBPF) -lelf -lz
+ LIBS_BOOTSTRAP = $(LIBBPF_BOOTSTRAP) -lelf -lz
+diff --git a/tools/bpf/bpftool/jit_disasm.c b/tools/bpf/bpftool/jit_disasm.c
+index 24734f2249d6ec..aaf99a0168c90b 100644
+--- a/tools/bpf/bpftool/jit_disasm.c
++++ b/tools/bpf/bpftool/jit_disasm.c
+@@ -24,6 +24,7 @@
+ #include <sys/stat.h>
+ #include <limits.h>
+ #include <bpf/libbpf.h>
++#include <tools/dis-asm-compat.h>
+ 
+ #include "json_writer.h"
+ #include "main.h"
+@@ -39,15 +40,12 @@ static void get_exec_path(char *tpath, s
+ }
+ 
+ static int oper_count;
+-static int fprintf_json(void *out, const char *fmt, ...)
++static int printf_json(void *out, const char *fmt, va_list ap)
+ {
+-	va_list ap;
+ 	char *s;
+ 
+-	va_start(ap, fmt);
+ 	if (vasprintf(&s, fmt, ap) < 0)
+ 		return -1;
+-	va_end(ap);
+ 
+ 	if (!oper_count) {
+ 		int i;
+@@ -73,6 +71,32 @@ static int fprintf_json(void *out, const char *fmt, ...)
+ 	return 0;
+ }
+ 
++static int fprintf_json(void *out, const char *fmt, ...)
++{
++	va_list ap;
++	int r;
++
++	va_start(ap, fmt);
++	r = printf_json(out, fmt, ap);
++	va_end(ap);
++
++	return r;
++}
++
++static int fprintf_json_styled(void *out,
++			       enum disassembler_style style __maybe_unused,
++			       const char *fmt, ...)
++{
++	va_list ap;
++	int r;
++
++	va_start(ap, fmt);
++	r = printf_json(out, fmt, ap);
++	va_end(ap);
++
++	return r;
++}
++
+ void disasm_print_insn(unsigned char *image, ssize_t len, int opcodes,
+ 		       const char *arch, const char *disassembler_options,
+ 		       const struct btf *btf,
+@@ -99,11 +123,13 @@ void disasm_print_insn(unsigned char *image, ssize_t len, int opcodes,
+ 	assert(bfd_check_format(bfdf, bfd_object));
+ 
+ 	if (json_output)
+-		init_disassemble_info(&info, stdout,
+-				      (fprintf_ftype) fprintf_json);
++		init_disassemble_info_compat(&info, stdout,
++					     (fprintf_ftype) fprintf_json,
++					     fprintf_json_styled);
+ 	else
+-		init_disassemble_info(&info, stdout,
+-				      (fprintf_ftype) fprintf);
++		init_disassemble_info_compat(&info, stdout,
++					     (fprintf_ftype) fprintf,
++					     fprintf_styled);
+ 
+ 	/* Update architecture info for offload. */
+ 	if (arch) {
diff --git a/srcpkgs/linux-tools/patches/perf-binutils-2.39.patch b/srcpkgs/linux-tools/patches/perf-binutils-2.39.patch
new file mode 100644
index 000000000000..3484330f7286
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/perf-binutils-2.39.patch
@@ -0,0 +1,114 @@
+From 83aa0120487e8bc3f231e72c460add783f71f17c Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:30 -0700
+Subject: [PATCH] tools perf: Fix compilation error with new binutils
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation failures for tools/perf/util/annotate.c, e.g. on debian
+unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+Wire up the feature test and switch to init_disassemble_info_compat(),
+which were introduced in prior commits, fixing the compilation failure.
+
+I verified that perf can still disassemble bpf programs by using bpftrace
+under load, recording a perf trace, and then annotating the bpf "function"
+with and without the changes. With old binutils there's no change in output
+before/after this patch. When comparing the output from old binutils (2.35)
+to new bintuils with the patch (upstream snapshot) there are a few output
+differences, but they are unrelated to this patch. An example hunk is:
+
+       1.15 :   55:mov    %rbp,%rdx
+       0.00 :   58:add    $0xfffffffffffffff8,%rdx
+       0.00 :   5c:xor    %ecx,%ecx
+  -    1.03 :   5e:callq  0xffffffffe12aca3c
+  +    1.03 :   5e:call   0xffffffffe12aca3c
+       0.00 :   63:xor    %eax,%eax
+  -    2.18 :   65:leaveq
+  -    2.82 :   66:retq
+  +    2.18 :   65:leave
+  +    2.82 :   66:ret
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-5-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/perf/Makefile.config | 8 ++++++++
+ tools/perf/util/annotate.c | 7 ++++---
+ 2 files changed, 12 insertions(+), 3 deletions(-)
+
+diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
+index d3c254c0f5c611..23648ea54e8d3d 100644
+--- a/tools/perf/Makefile.config
++++ b/tools/perf/Makefile.config
+@@ -298,6 +298,7 @@ FEATURE_CHECK_LDFLAGS-libpython := $(PYTHON_EMBED_LDOPTS)
+ FEATURE_CHECK_LDFLAGS-libaio = -lrt
+ 
+ FEATURE_CHECK_LDFLAGS-disassembler-four-args = -lbfd -lopcodes -ldl
++FEATURE_CHECK_LDFLAGS-disassembler-init-styled = -lbfd -lopcodes -ldl
+ 
+ CORE_CFLAGS += -fno-omit-frame-pointer
+ CORE_CFLAGS += -ggdb3
+@@ -818,13 +819,16 @@ else
+   ifeq ($(feature-libbfd-liberty), 1)
+     EXTLIBS += -lbfd -lopcodes -liberty
+     FEATURE_CHECK_LDFLAGS-disassembler-four-args += -liberty -ldl
++    FEATURE_CHECK_LDFLAGS-disassembler-init-styled += -liberty -ldl
+   else
+     ifeq ($(feature-libbfd-liberty-z), 1)
+       EXTLIBS += -lbfd -lopcodes -liberty -lz
+       FEATURE_CHECK_LDFLAGS-disassembler-four-args += -liberty -lz -ldl
++      FEATURE_CHECK_LDFLAGS-disassembler-init-styled += -liberty -lz -ldl
+     endif
+   endif
+   $(call feature_check,disassembler-four-args)
++  $(call feature_check,disassembler-init-styled)
+ endif
+ 
+ ifeq ($(feature-libbfd-buildid), 1)
+@@ -1044,6 +1048,10 @@ ifeq ($(feature-disassembler-four-args), 1)
+     CFLAGS += -DDISASM_FOUR_ARGS_SIGNATURE
+ endif
+ 
++ifeq ($(feature-disassembler-init-styled), 1)
++    CFLAGS += -DDISASM_INIT_STYLED
++endif
++
+ ifeq (${IS_64_BIT}, 1)
+   ifndef NO_PERF_READ_VDSO32
+     $(call feature_check,compile-32)
+diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
+index 82cc396ef516c4..2c6a485c3de5d9 100644
+--- a/tools/perf/util/annotate.c
++++ b/tools/perf/util/annotate.c
+@@ -1676,6 +1676,7 @@ fallback:
+ #define PACKAGE "perf"
+ #include <bfd.h>
+ #include <dis-asm.h>
++#include <tools/dis-asm-compat.h>
+ 
+ static int symbol__disassemble_bpf(struct symbol *sym,
+ 				   struct annotate_args *args)
+@@ -1762,9 +1763,9 @@ static int symbol__disassemble_bpf(struct symbol *sym,
+ 		ret = errno;
+ 		goto out;
+ 	}
+-	init_disassemble_info(&info, s,
+-			      (fprintf_ftype) fprintf);
+-
++	init_disassemble_info_compat(&info, s,
++				     (fprintf_ftype) fprintf,
++				     fprintf_styled);
+ 	info.arch = bfd_get_arch(bfdf);
+ 	info.mach = bfd_get_mach(bfdf);
+ 

From 92dd71ef0476da97d51dc0cac48690679782ed38 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 14:45:28 -0700
Subject: [PATCH 22/48] libsasl: fix build for libtool 2.4.7

---
 srcpkgs/libsasl/template | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/libsasl/template b/srcpkgs/libsasl/template
index a8817042f843..a2993b39f4a1 100644
--- a/srcpkgs/libsasl/template
+++ b/srcpkgs/libsasl/template
@@ -19,6 +19,7 @@ distfiles="https://github.com/cyrusimap/cyrus-sasl/releases/download/cyrus-sasl-
 checksum=26866b1549b00ffd020f188a43c258017fa1c382b3ddadd8201536f72efb05d5
 
 pre_configure() {
+	rm -f m4/ltversion.m4
 	autoreconf -fi
 }
 

From a4ffd2b364881e040dba6c6aa4a4d985593502b0 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:08 -0700
Subject: [PATCH 23/48] subversion: fix build for libtool 2.4.7

---
 srcpkgs/subversion/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion/template b/srcpkgs/subversion/template
index 8ad178264942..3f1c9e254e61 100644
--- a/srcpkgs/subversion/template
+++ b/srcpkgs/subversion/template
@@ -57,7 +57,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From 770bb457fb39a4bff3937c6269b2e5bafb259e77 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:38 -0700
Subject: [PATCH 24/48] subversion-kwallet-auth: fix build for libtool 2.4.7

---
 srcpkgs/subversion-kwallet-auth/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion-kwallet-auth/template b/srcpkgs/subversion-kwallet-auth/template
index 12210f250d51..b4d8621456ea 100644
--- a/srcpkgs/subversion-kwallet-auth/template
+++ b/srcpkgs/subversion-kwallet-auth/template
@@ -59,7 +59,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From 26e56e6eb6184f99b83071494bedfe617343dcea Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 20:07:32 -0700
Subject: [PATCH 25/48] gpgme: update to 1.18.0.

---
 common/shlibs          | 2 +-
 srcpkgs/gpgme/template | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 8b31fec0557c..3cde524d66bc 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -720,7 +720,7 @@ libdconf.so.1 dconf-0.13.90_1
 libassuan.so.0 libassuan-2.0.1_1
 libgpgme.so.11 libgpgme-1.12.0_2
 libgpgmepp.so.6 gpgmepp-1.7.0_3
-libqgpgme.so.7 gpgmeqt-1.7.0_3
+libqgpgme.so.15 gpgmeqt-1.18.0_1
 libgarcon-1.so.0 garcon-0.1.12_1
 libgarcon-gtk2-1.so.0 garcon-0.4.0_1
 libgarcon-gtk3-1.so.0 garcon-0.6.1_1
diff --git a/srcpkgs/gpgme/template b/srcpkgs/gpgme/template
index 8633075a8404..b1cfd5f78657 100644
--- a/srcpkgs/gpgme/template
+++ b/srcpkgs/gpgme/template
@@ -1,7 +1,7 @@
 # Template file for 'gpgme'
 pkgname=gpgme
-version=1.15.1
-revision=2
+version=1.18.0
+revision=1
 build_style=gnu-configure
 configure_args="--enable-fd-passing
  --with-libgpg-error-prefix=$XBPS_CROSS_BASE/usr
@@ -14,7 +14,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.gnupg.org/software/gpgme/index.html"
 distfiles="https://www.gnupg.org/ftp/gcrypt/gpgme/gpgme-${version}.tar.bz2"
-checksum=eebc3c1b27f1c8979896ff361ba9bb4778b508b2496c2fc10e3775a40b1de1ad
+checksum=361d4eae47ce925dba0ea569af40e7b52c645c4ae2e65e5621bf1b6cdd8b0e9e
 
 if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
 	configure_args+=" ac_cv_sys_file_offset_bits=no"

From e9b0e2e3ceb6d4d6a87f4da9bc7f594df13c4813 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 26/48] cross-aarch64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..bd6b23f9fb6a 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 67232ef6ae1310b0d53f5ab2c6bef42d429f8ee7 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 27/48] cross-aarch64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..427ad2c1e9cd 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 29f05873d66d4c2362c67eed028be4ac4c7e328a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 28/48] cross-arm-linux-gnueabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..2510ee26e789 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From a41d9d8133239b61637ea830f601fa3133757e8d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 29/48] cross-arm-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..bd8b16e1b4c1 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 827ffb461282a6207a30b452500c14f72795f1bb Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 30/48] cross-arm-linux-musleabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..dacfd2655216 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From a033827a57a5d1b42b52fc4c337a00a156e20c24 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 31/48] cross-arm-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..9ddd32a9f20d 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From cf54f9819da3687608a934a758d57bd2661f1369 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 32/48] cross-armv7l-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..9fb00f18be3b 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 55d7fbb6a641056ab93728bfc3edc4b5fe4f778d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 33/48] cross-armv7l-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..2c72e75ddfe3 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 09c967876549b6e4a60a024910c891de953a4164 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 34/48] cross-i686-pc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..4dc17df648b5 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From a31c35c407859b32fea80acbd55b83cd26150e11 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 35/48] cross-mips-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..6009e5c79eb2 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 9d837a0821de256df7a1fe8742d4b6ebfc242641 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 36/48] cross-mips-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..080164df193d 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="hipperson0 <hipperson0@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 4b6ab3c8bd554f5865d763f3417225339d9e5062 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 37/48] cross-mipsel-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..f9fd4b8a04ef 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 8506ba1f5891ab4683e6b6425137f287bb6d365f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 38/48] cross-mipsel-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..7418a984474b 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From d2661dec44d5af5622a12ebe2850eb2690344953 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 39/48] cross-powerpc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..31e57b4e52b2 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 2ca4fca8918d73c4d433ffd1fd500a51bbe63171 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 40/48] cross-powerpc-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..a2d1edcf1ffd 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 55f4de635701a04f8f668e1f9dc680f47f96d362 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 41/48] cross-powerpc64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..1a4cbed61e76 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 0f04b41a553c7c941e5cec1abf48688a66e78896 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 42/48] cross-powerpc64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 1ebd0fb2048d..ade42018af05 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From ce585078fb7de85a060af8f6da4c5b2168a366af Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 43/48] cross-powerpc64le-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 733f5851da5c..03054239001e 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 5105b0613a79cd16df51be4d61a287195c14e4c5 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 44/48] cross-powerpc64le-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index 76a70aa1d6db..5887f845f932 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 546125954aa2fb35a91d0885200080c6cdae33e8 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 45/48] cross-powerpcle-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 347b8fcf4f55..06530e0d609b 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 73da27f0ebacb73348e30fc7e023ab7be119fbe8 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 46/48] cross-powerpcle-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index ec9324ddaa99..e68c3962b49c 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From b0ab9d28088c7fad7c18f7e8ecec571ecd20fc57 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 47/48] cross-x86_64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 0078fbe7224b..7da85c14b62d 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 4cf31305d5c2b94e42801e1766a5c292ead7d81f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 48/48] cross-x86_64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..2811de0d3c2e 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (66 preceding siblings ...)
  2022-09-03  4:18 ` oreo639
@ 2022-09-03  5:51 ` oreo639
  2022-09-03  5:53 ` oreo639
                   ` (196 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-09-03  5:51 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5538 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.2.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.2.0

This PR depends on: https://github.com/void-linux/void-packages/pull/32330

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

Also, keep in mind that the libgo musl patch here will need to be updated once musl is updated:
https://github.com/void-linux/void-packages/pull/34902/files#diff-1f42a95b93c9550178ff1fbccbef2f47a72711df15c24c9472e2550076978129R163-R176

This is the updated patch for reference:
https://github.com/alpinelinux/aports/blob/8acb21b8ee881e7ab1c812d9a66a17d2501b8730/main/gcc/0049-libgo-adjust-name-of-union-in-sigevent-struct.patch

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/38817
- [x] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [ ] llvm https://github.com/void-linux/void-packages/pull/38694
- [ ] m4 https://github.com/void-linux/void-packages/pull/33730
- [ ] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [x] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [ ] libvirt https://github.com/void-linux/void-packages/pull/38842
- [ ] syslinux https://github.com/void-linux/void-packages/pull/38876
- [ ] efivar https://github.com/void-linux/void-packages/pull/38874

Known packages that needed to be fixed/updated for gcc12:
- [ ] linux5.18 (in this PR)
- [ ] openssh https://github.com/void-linux/void-packages/pull/38849
- [ ] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [ ] doxygen https://github.com/void-linux/void-packages/pull/38846
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/38817
- [x] libproxy https://github.com/void-linux/void-packages/pull/38818
- [x] exempi https://github.com/void-linux/void-packages/pull/38820
- [ ] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [ ] gpgme https://github.com/void-linux/void-packages/pull/38825
- [x] libunique1 https://github.com/void-linux/void-packages/pull/38848 or https://github.com/void-linux/void-packages/pull/38873
- [ ] libwpd https://github.com/void-linux/void-packages/pull/38878

Needs to be fixed/updated for binutils:
- [ ] grub https://github.com/void-linux/void-packages/pull/38875
- [ ] linux-tools https://github.com/void-linux/void-packages/pull/38877

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [x] kde
- [x] lxde
- [x] lxqt

You can test the ISOs here:
https://drive.google.com/drive/folders/1ix92CYSLUP-KWjLxltdgG4e8Nu2JCY5n?usp=sharing

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 163780 bytes --]

From 08bb662e8443edf8fd6ecee3c99af0f85c40f294 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 01/48] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../fix-libcollector-without-java.patch       | 53 +++++++++++++++
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 16 +++--
 4 files changed, 82 insertions(+), 113 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
 create mode 100644 srcpkgs/binutils/patches/fix-libcollector-without-java.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/fix-libcollector-without-java.patch b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
new file mode 100644
index 000000000000..54384875f358
--- /dev/null
+++ b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
@@ -0,0 +1,53 @@
+From 49ddd814ac1071af7c4f45d5f8398b91862f2c7f Mon Sep 17 00:00:00 2001
+From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
+Date: Wed, 17 Aug 2022 19:55:23 -0700
+Subject: [PATCH] gprofng: fix bug 29479 Collection fails when built without
+ java support
+
+gprofng/ChangeLog
+2022-08-17  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>
+
+	PR gprofng/29479
+	* libcollector/collector.c: Add #if defined(GPROFNG_JAVA_PROFILING) for
+	java specific code.
+	* libcollector/unwind.c: Likewise.
+---
+ gprofng/libcollector/collector.c | 2 ++
+ gprofng/libcollector/unwind.c    | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/gprofng/libcollector/collector.c b/gprofng/libcollector/collector.c
+index 93c9d3330de5..ceff2c1caccb 100644
+--- a/gprofng/libcollector/collector.c
++++ b/gprofng/libcollector/collector.c
+@@ -913,8 +913,10 @@ __collector_open_experiment (const char *exp, const char *params, sp_origin_t or
+   __collector_ext_unwind_key_init (1, NULL);
+ 
+   /* start java attach if suitable */
++#if defined(GPROFNG_JAVA_PROFILING)
+   if (exp_origin == SP_ORIGIN_DBX_ATTACH)
+     __collector_jprofile_start_attach ();
++#endif
+   start_sec_time = CALL_UTIL (time)(NULL);
+   __collector_start_time = collector_interface.getHiResTime ();
+   TprintfT (DBG_LT0, "\t__collector_open_experiment; resetting start_time\n");
+diff --git a/gprofng/libcollector/unwind.c b/gprofng/libcollector/unwind.c
+index 119243788020..f8e11823c81e 100644
+--- a/gprofng/libcollector/unwind.c
++++ b/gprofng/libcollector/unwind.c
+@@ -557,6 +557,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+   int size = max_frame_size;
+ 
+ #define MIN(a,b) ((a)<(b)?(a):(b))
++#if defined(GPROFNG_JAVA_PROFILING)
+   /* get Java info */
+   if (__collector_java_mode && __collector_java_asyncgetcalltrace_loaded && context && !pseudo_context)
+     {
+@@ -569,6 +570,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+ 	  size -= sz;
+ 	}
+     }
++#endif
+ 
+   /* get native stack */
+   if (context)
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..0abcfcfe4f9b 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkg-config"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -44,6 +45,12 @@ do_configure() {
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	# gprofng currently only supports x86 and aarch64 glibc.
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64|i386|aarch64) conf+=" --enable-gprofng" ;;
+		*) conf+=" --disable-gprofng" ;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"
@@ -76,6 +83,7 @@ do_configure() {
 		--libdir=/usr/lib \
 		--mandir=/usr/share/man \
 		--infodir=/usr/share/info \
+		--sysconfdir=/etc \
 		--disable-werror \
 		--disable-shared \
 		--disable-nls \

From 989c4804f52c6346cc8c633f2baacea1474846a9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 02/48] gcc: update to 12.2.0.

---
 common/shlibs                                 | 10 +--
 srcpkgs/gcc/files/gccgo-musl.patch            | 74 ++++---------------
 srcpkgs/gcc/files/libgnarl-musl.patch         | 18 ++---
 srcpkgs/gcc/files/libssp-musl.patch           | 10 +--
 srcpkgs/gcc/patches/libffi_gnulinux.patch     | 11 ---
 .../gcc/patches/libgcc-ibm128-no-tag.patch    | 10 ++-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |  2 +-
 srcpkgs/gcc/template                          | 25 +++----
 8 files changed, 52 insertions(+), 108 deletions(-)
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index 5fe37e3d0b62..8b8be0eafe00 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.2.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.34 perl-5.34.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -845,8 +845,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.2.0_1
+libgnat-12.so libada-12.2.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1695,8 +1695,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.2.0_1
+libasan.so.8 libsanitizer-12.2.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..632ef951097b 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,17 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ a/libgo/go/runtime/os_linux.go
+@@ -363,9 +363,9 @@
+ 
+ 	var timerid int32
+ 	var sevp _sigevent
+-	sevp.sigev_notify = _SIGEV_THREAD_ID
++	sevp.sigev_notify = 4
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.sigev_notify_function))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..446741390d45 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,15 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
+version=12.2.0
+revision=1
 _patchver="${version%pre*}"
 _minorver="${_patchver%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 wrksrc=gcc-${version/pre/_pre}
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +19,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -396,7 +393,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}

From 7c84c84ae51af46de1603d74d96b91e8c7fd3865 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 03/48] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      | 11 ++++--
 2 files changed, 25 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..70c4aa533e66 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,12 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
+
+if [ "$XBPS_LIBC" == "musl" ]; then
+# Musl always searches LD_LIBRARY_PATH before RPATH and RUNPATH
+make_build_args="lt_cv_shlibpath_overrides_runpath=yes"
+fi
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From e95b700a481a564026d94675d4daceed3d647ced Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 04/48] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 1a4e1ca3d594..b04268908c2e 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="q66 <daniel@octaforge.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From 1205cc328263eb92ac4190106c1cfd51148720c2 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 05/48] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 3 files changed, 55 insertions(+), 353 deletions(-)
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index 8b8be0eafe00..8b31fec0557c 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From 73e68ae6657cb1a57fbf10ece312bd2a6f5f4fba Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 21:01:43 -0700
Subject: [PATCH 06/48] gcc-multilib: update to 12.2.0.

---
 srcpkgs/gcc-multilib/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index fcd25755aa75..1a26da26a991 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,16 +3,16 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _majorver="${version%.*}"
-wrksrc=gcc-${version/pre/_pre}
+wrksrc=gcc-${version}
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel

From d06e773351c22e5971855316312d7c642956ebb1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 16:22:03 -0700
Subject: [PATCH 07/48] llvm12: fix build for glibc 2.36

---
 .../compiler-rt-sanitizer-glibc-2.36.patch    | 59 +++++++++++++++++++
 1 file changed, 59 insertions(+)
 create mode 100644 srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch

diff --git a/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch b/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch
new file mode 100644
index 000000000000..e5f24dab8935
--- /dev/null
+++ b/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch
@@ -0,0 +1,59 @@
+From 9cf13067cb5088626ba7ee1ec4c42ec59c7995a0 Mon Sep 17 00:00:00 2001
+From: Fangrui Song <i@maskray.me>
+Date: Mon, 11 Jul 2022 12:53:34 -0700
+Subject: [PATCH] [sanitizer] Remove #include <linux/fs.h> to resolve
+ fsconfig_command/mount_attr conflict with glibc 2.36
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+It is generally not a good idea to mix usage of glibc headers and Linux UAPI
+headers (https://sourceware.org/glibc/wiki/Synchronizing_Headers). In glibc
+since 7eae6a91e9b1670330c9f15730082c91c0b1d570 (milestone: 2.36), sys/mount.h
+defines `fsconfig_command` which conflicts with linux/mount.h:
+
+    .../usr/include/linux/mount.h:95:6: error: redeclaration of ‘enum fsconfig_command’
+
+Remove #include <linux/fs.h> which pulls in linux/mount.h. Expand its 4 macros manually.
+Android sys/mount.h doesn't define BLKBSZGET and it still needs linux/fs.h.
+In the long term we should move Linux specific definitions to sanitizer_platform_limits_linux.cpp
+but this commit is easy to cherry pick into older compiler-rt releases.
+
+Fix https://github.com/llvm/llvm-project/issues/56421
+
+Reviewed By: #sanitizers, vitalybuka, zatrazz
+
+Differential Revision: https://reviews.llvm.org/D129471
+---
+ .../sanitizer_platform_limits_posix.cpp                | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+index 4bd425435d56d..3a94b260686f1 100644
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -73,7 +73,9 @@
+ #include <sys/vt.h>
+ #include <linux/cdrom.h>
+ #include <linux/fd.h>
++#if SANITIZER_ANDROID
+ #include <linux/fs.h>
++#endif
+ #include <linux/hdreg.h>
+ #include <linux/input.h>
+ #include <linux/ioctl.h>
+@@ -876,10 +878,10 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
+   unsigned IOCTL_EVIOCGPROP = IOCTL_NOT_PRESENT;
+   unsigned IOCTL_EVIOCSKEYCODE_V2 = IOCTL_NOT_PRESENT;
+ #endif
+-  unsigned IOCTL_FS_IOC_GETFLAGS = FS_IOC_GETFLAGS;
+-  unsigned IOCTL_FS_IOC_GETVERSION = FS_IOC_GETVERSION;
+-  unsigned IOCTL_FS_IOC_SETFLAGS = FS_IOC_SETFLAGS;
+-  unsigned IOCTL_FS_IOC_SETVERSION = FS_IOC_SETVERSION;
++  unsigned IOCTL_FS_IOC_GETFLAGS = _IOR('f', 1, long);
++  unsigned IOCTL_FS_IOC_GETVERSION = _IOR('v', 1, long);
++  unsigned IOCTL_FS_IOC_SETFLAGS = _IOW('f', 2, long);
++  unsigned IOCTL_FS_IOC_SETVERSION = _IOW('v', 2, long);
+   unsigned IOCTL_GIO_CMAP = GIO_CMAP;
+   unsigned IOCTL_GIO_FONT = GIO_FONT;
+   unsigned IOCTL_GIO_UNIMAP = GIO_UNIMAP;

From 2dad60c5a287535e2515b5d249f118def0f1fff0 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 17:21:40 -0700
Subject: [PATCH 08/48] m4: update to 1.4.19.

---
 srcpkgs/m4/patches/fix-glibc-2.27.patch | 167 ------------------------
 srcpkgs/m4/template                     |  12 +-
 2 files changed, 6 insertions(+), 173 deletions(-)
 delete mode 100644 srcpkgs/m4/patches/fix-glibc-2.27.patch

diff --git a/srcpkgs/m4/patches/fix-glibc-2.27.patch b/srcpkgs/m4/patches/fix-glibc-2.27.patch
deleted file mode 100644
index 59d33cff164d..000000000000
--- a/srcpkgs/m4/patches/fix-glibc-2.27.patch
+++ /dev/null
@@ -1,167 +0,0 @@
-From 4af4a4a71827c0bc5e0ec67af23edef4f15cee8e Mon Sep 17 00:00:00 2001
-From: Paul Eggert <eggert@cs.ucla.edu>
-Date: Mon, 5 Mar 2018 10:56:29 -0800
-Subject: [PATCH] fflush: adjust to glibc 2.28 libio.h removal
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Problem reported by Daniel P. Berrangé in:
-https://lists.gnu.org/r/bug-gnulib/2018-03/msg00000.html
-* lib/fbufmode.c (fbufmode):
-* lib/fflush.c (clear_ungetc_buffer_preserving_position)
-(disable_seek_optimization, rpl_fflush):
-* lib/fpending.c (__fpending):
-* lib/fpurge.c (fpurge):
-* lib/freadable.c (freadable):
-* lib/freadahead.c (freadahead):
-* lib/freading.c (freading):
-* lib/freadptr.c (freadptr):
-* lib/freadseek.c (freadptrinc):
-* lib/fseeko.c (fseeko):
-* lib/fseterr.c (fseterr):
-* lib/fwritable.c (fwritable):
-* lib/fwriting.c (fwriting):
-Check _IO_EOF_SEEN instead of _IO_ftrylockfile.
-* lib/stdio-impl.h (_IO_IN_BACKUP) [_IO_EOF_SEEN]:
-Define if not already defined.
-
-[yann.morin.1998@free.fr: partially backport from upstream gnulib]
-Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
-
----
- lib/fflush.c     |  6 +++---
- lib/fpending.c   |  2 +-
- lib/fpurge.c     |  2 +-
- lib/freadahead.c |  2 +-
- lib/freading.c   |  2 +-
- lib/fseeko.c     |  4 ++--
- lib/stdio-impl.h |  6 ++++++
- 7 files changed, 15 insertions(+), 9 deletions(-)
-
-diff --git a/lib/fflush.c b/build-aux/gnulib/lib/fflush.c
-index 983ade0ff..a6edfa105 100644
---- a/lib/fflush.c
-+++ b/lib/fflush.c
-@@ -33,7 +33,7 @@
- #undef fflush
- 
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- 
- /* Clear the stream's ungetc buffer, preserving the value of ftello (fp).  */
- static void
-@@ -72,7 +72,7 @@ clear_ungetc_buffer (FILE *fp)
- 
- #endif
- 
--#if ! (defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
-+#if ! (defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
- 
- # if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT
- /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
-@@ -148,7 +148,7 @@ rpl_fflush (FILE *stream)
-   if (stream == NULL || ! freading (stream))
-     return fflush (stream);
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- 
-   clear_ungetc_buffer_preserving_position (stream);
- 
-diff --git a/lib/fpending.c b/build-aux/gnulib/lib/fpending.c
-index c84e3a5b4..789f50e4e 100644
---- a/lib/fpending.c
-+++ b/lib/fpending.c
-@@ -32,7 +32,7 @@ __fpending (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   return fp->_IO_write_ptr - fp->_IO_write_base;
- #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
-   /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
-diff --git a/lib/fpurge.c b/build-aux/gnulib/lib/fpurge.c
-index b1d417c7a..3aedcc373 100644
---- a/lib/fpurge.c
-+++ b/lib/fpurge.c
-@@ -62,7 +62,7 @@ fpurge (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   fp->_IO_read_end = fp->_IO_read_ptr;
-   fp->_IO_write_ptr = fp->_IO_write_base;
-   /* Avoid memory leak when there is an active ungetc buffer.  */
-diff --git a/lib/freadahead.c b/build-aux/gnulib/lib/freadahead.c
-index c2ecb5b28..23ec76ee5 100644
---- a/lib/freadahead.c
-+++ b/lib/freadahead.c
-@@ -30,7 +30,7 @@ extern size_t __sreadahead (FILE *);
- size_t
- freadahead (FILE *fp)
- {
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   if (fp->_IO_write_ptr > fp->_IO_write_base)
-     return 0;
-   return (fp->_IO_read_end - fp->_IO_read_ptr)
-diff --git a/lib/freading.c b/build-aux/gnulib/lib/freading.c
-index 73c28acdd..c24d0c88a 100644
---- a/lib/freading.c
-+++ b/lib/freading.c
-@@ -31,7 +31,7 @@ freading (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   return ((fp->_flags & _IO_NO_WRITES) != 0
-           || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0
-               && fp->_IO_read_base != NULL));
-diff --git a/lib/fseeko.c b/build-aux/gnulib/lib/fseeko.c
-index 0101ab55f..193f4e8ce 100644
---- a/lib/fseeko.c
-+++ b/lib/fseeko.c
-@@ -47,7 +47,7 @@ fseeko (FILE *fp, off_t offset, int whence)
- #endif
- 
-   /* These tests are based on fpurge.c.  */
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   if (fp->_IO_read_end == fp->_IO_read_ptr
-       && fp->_IO_write_ptr == fp->_IO_write_base
-       && fp->_IO_save_base == NULL)
-@@ -123,7 +123,7 @@ fseeko (FILE *fp, off_t offset, int whence)
-           return -1;
-         }
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-       fp->_flags &= ~_IO_EOF_SEEN;
-       fp->_offset = pos;
- #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
-diff --git a/lib/stdio-impl.h b/build-aux/gnulib/lib/stdio-impl.h
-index 78d896e9f..05c5752a2 100644
---- a/lib/stdio-impl.h
-+++ b/lib/stdio-impl.h
-@@ -18,6 +18,12 @@
-    the same implementation of stdio extension API, except that some fields
-    have different naming conventions, or their access requires some casts.  */
- 
-+/* Glibc 2.28 made _IO_IN_BACKUP private.  For now, work around this
-+   problem by defining it ourselves.  FIXME: Do not rely on glibc
-+   internals.  */
-+#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN
-+# define _IO_IN_BACKUP 0x100
-+#endif
- 
- /* BSD stdio derived implementations.  */
- 
--- 
-2.14.1
-
-
diff --git a/srcpkgs/m4/template b/srcpkgs/m4/template
index 78f3dae6184a..762593d883bd 100644
--- a/srcpkgs/m4/template
+++ b/srcpkgs/m4/template
@@ -1,17 +1,17 @@
 # Template file for 'm4'
 pkgname=m4
-version=1.4.18
-revision=2
+version=1.4.19
+revision=1
 bootstrap=yes
-replaces="chroot-m4>=0"
 build_style=gnu-configure
 configure_args="--enable-changeword --enable-threads"
 short_desc="GNU version of UNIX m4 macro language processor"
-homepage="https://www.gnu.org/software/m4/"
-license="GPL-3.0-or-later"
 maintainer="Enno Boland <gottox@voidlinux.org>"
+license="GPL-3.0-or-later"
+homepage="https://www.gnu.org/software/m4/"
 distfiles="${GNU_SITE}/${pkgname}/${pkgname}-${version}.tar.xz"
-checksum=f2c1e86ca0a404ff281631bdc8377638992744b175afb806e25871a24a934e07
+checksum=63aede5c6d33b6d9b13511cd0be2cac046f2e70fd0a07aa9573a04a82783af96
+replaces="chroot-m4>=0"
 
 if [ "$XBPS_TARGET_LIBC" = musl ]; then
 	export ac_cv_lib_error_at_line=no

From 94ec2d87dba1fccdc5b57344692151911668eb47 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 22:57:59 -0700
Subject: [PATCH 09/48] btrfs-progs: update to 5.19.

---
 srcpkgs/btrfs-progs/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/btrfs-progs/template b/srcpkgs/btrfs-progs/template
index f6c53d8587e1..292d5110106b 100644
--- a/srcpkgs/btrfs-progs/template
+++ b/srcpkgs/btrfs-progs/template
@@ -1,6 +1,6 @@
 # Template file for 'btrfs-progs'
 pkgname=btrfs-progs
-version=5.18.1
+version=5.19
 revision=1
 wrksrc="${pkgname}-v${version}"
 build_style=gnu-configure
@@ -16,7 +16,7 @@ license="GPL-2.0-only, LGPL-2.1-or-later"
 homepage="https://btrfs.wiki.kernel.org/index.php/Main_Page"
 changelog="https://raw.githubusercontent.com/kdave/btrfs-progs/master/CHANGES"
 distfiles="${KERNEL_SITE}/kernel/people/kdave/${pkgname}/${pkgname}-v${version}.tar.xz"
-checksum=6e98a75ccff52e9354daa1ad284c614c490f844273a2fa524cbac9eb841c7255
+checksum=1fbcf06e4b2f80e7a127fd687ed4625a5b74fa674fe212c836ff70e0edfcccf9
 # Most of the tests depend on `mount` and `fallocate` commands, which are not
 # presented in chroot-util-linux
 make_check=no

From 6b6a50a4c7976a14b07d0758bc2fce7515340bb1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 19:39:23 -0700
Subject: [PATCH 10/48] syslinux: fix build for glibc 2.36

---
 .../patches/fix-build-with-glibc-2.36.patch   | 30 +++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 srcpkgs/syslinux/patches/fix-build-with-glibc-2.36.patch

diff --git a/srcpkgs/syslinux/patches/fix-build-with-glibc-2.36.patch b/srcpkgs/syslinux/patches/fix-build-with-glibc-2.36.patch
new file mode 100644
index 000000000000..1303be56c127
--- /dev/null
+++ b/srcpkgs/syslinux/patches/fix-build-with-glibc-2.36.patch
@@ -0,0 +1,30 @@
+--- a/linux/syslinux.c
++++ b/linux/syslinux.c
+@@ -45,7 +45,6 @@
+ #include <sys/stat.h>
+ #include <sys/types.h>
+ #include <sys/wait.h>
+-#include <sys/mount.h>
+ 
+ #include "linuxioctl.h"
+ 
+--- a/libinstaller/syslxcom.c
++++ b/libinstaller/syslxcom.c
+@@ -28,7 +28,6 @@
+ #include <errno.h>
+ #include <sys/stat.h>
+ #include <sys/types.h>
+-#include <sys/mount.h>
+ #include <sys/vfs.h>
+ 
+ #include "linuxioctl.h"
+--- a/extlinux/main.c
++++ b/extlinux/main.c
+@@ -40,7 +40,6 @@
+ #include <sys/stat.h>
+ #include <sys/sysmacros.h>
+ #include <sys/types.h>
+-#include <sys/mount.h>
+ #include <sys/vfs.h>
+ 
+ #include "linuxioctl.h"

From ab81d9e2e28bb11f735575a8558d35454da68d95 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 14 Aug 2022 19:29:36 -0700
Subject: [PATCH 11/48] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove -no-pie from build. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..58d94f8dacba 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -60,6 +60,7 @@ _void_cross_build_binutils() {
 		--disable-multilib \
 		--disable-werror \
 		--disable-gold \
+		--disable-gprofng \
 		--enable-relro \
 		--enable-plugins \
 		--enable-64-bit-bfd \
@@ -132,6 +133,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -460,6 +462,14 @@ do_build() {
 	local binutils_ver linux_ver gcc_ver libc_ver libucontext_ver
 	local tgt=${sourcepkg/cross-}
 
+	export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}"
+	export CXXFLAGS="${CXXFLAGS/-D_FORTIFY_SOURCE=2/}"
+
+	# Disable explicit -fno-PIE, gcc/binutils/libc will figure this out itself.
+	export CFLAGS="${CFLAGS//-fno-PIE/}"
+	export CXXFLAGS="${CXXFLAGS//-fno-PIE/}"
+	export LDFLAGS="${LDFLAGS//-no-pie/}"
+
 	_void_cross_test_ver binutils
 	_void_cross_test_ver linux
 	_void_cross_test_ver gcc
@@ -625,6 +635,9 @@ do_install() {
 	# then remove it because it conflicts with libquadmath package
 	rm -rf ${DESTDIR}/${sysroot}/usr/lib/libquadmath.*
 
+	# Remove libdep linker plugin because it conflicts with system binutils
+	rm -f ${DESTDIR}/usr/lib/bfd-plugins/libdep*
+
 	# Remove leftover symlinks
 	rm -f ${DESTDIR}/usr/lib${XBPS_TARGET_WORDSIZE}
 	rm -f ${DESTDIR}/lib*

From 7ded91fe4b065dada372b9cb54da845914dfc3e2 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:08:52 -0700
Subject: [PATCH 12/48] openssh: suppress werror on gcc12

---
 srcpkgs/openssh/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/openssh/template b/srcpkgs/openssh/template
index 02a2dec35f42..6e8e343a9dca 100644
--- a/srcpkgs/openssh/template
+++ b/srcpkgs/openssh/template
@@ -40,7 +40,7 @@ if [ "$build_option_ldns" -a -z "$build_option_ssl" ]; then
 	broken="option 'ldns' requires option 'ssl'"
 fi
 
-CFLAGS="-Wno-format-truncation -Wno-stringop-truncation"
+CFLAGS="-Wno-format-truncation -Wno-stringop-truncation -Wno-error=maybe-uninitialized"
 
 case $XBPS_TARGET_MACHINE in
 	i686-musl)

From ffa79fd5a3bcbbfa246b36da4270d39ab2144184 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:09:31 -0700
Subject: [PATCH 13/48] linux5.18: update dotconfigs for gcc12

---
 srcpkgs/linux5.18/files/x86_64-dotconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/linux5.18/files/x86_64-dotconfig b/srcpkgs/linux5.18/files/x86_64-dotconfig
index 4e73a3195d40..ea6204868e23 100644
--- a/srcpkgs/linux5.18/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.18/files/x86_64-dotconfig
@@ -512,6 +512,7 @@ CONFIG_RETHUNK=y
 CONFIG_CPU_UNRET_ENTRY=y
 CONFIG_CPU_IBPB_ENTRY=y
 CONFIG_CPU_IBRS_ENTRY=y
+CONFIG_SLS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10060,8 +10061,11 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
 # Memory initialization
 #
 CONFIG_INIT_STACK_NONE=y
+# CONFIG_INIT_STACK_ALL_PATTERN is not set
+# CONFIG_INIT_STACK_ALL_ZERO is not set
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
+# CONFIG_ZERO_CALL_USED_REGS is not set
 # end of Memory initialization
 # end of Kernel hardening options
 # end of Security options
@@ -10538,6 +10542,7 @@ CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
 # CONFIG_UBSAN is not set
 CONFIG_HAVE_ARCH_KCSAN=y
+# CONFIG_KCSAN is not set
 # end of Generic Kernel Debugging Instruments
 
 #

From e9dc325d308a06898e4e455a5bd764baa0501afb Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 18:00:42 -0700
Subject: [PATCH 14/48] xf86-video-vmware: fix build on gcc12

---
 ...183b3395333d5d4c73e25c2d011748f15eda.patch | 30 +++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch

diff --git a/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch b/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch
new file mode 100644
index 000000000000..ff839f16e628
--- /dev/null
+++ b/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch
@@ -0,0 +1,30 @@
+From 77b8183b3395333d5d4c73e25c2d011748f15eda Mon Sep 17 00:00:00 2001
+From: Rudi Heitbaum <rudi@heitbaum.com>
+Date: Sun, 8 May 2022 03:00:10 +0000
+Subject: [PATCH] vmwgfx: fix missing array notation
+
+ Fixes error identified by gcc-12.1.0 compiler
+
+make
+  CC       libvmwgfx_la-vmwgfx_tex_video.lo
+vmwgfx_tex_video.c: In function 'stop_video':
+vmwgfx_tex_video.c:240:20: error: the comparison will always evaluate as 'true' for the address of 'yuv' will never be NULL [-Werror=address]
+  240 |                if (priv->yuv[i]) {
+      |                    ^~~~
+---
+ vmwgfx/vmwgfx_tex_video.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/vmwgfx/vmwgfx_tex_video.c b/vmwgfx/vmwgfx_tex_video.c
+index acc2b56..480a5f1 100644
+--- a/vmwgfx/vmwgfx_tex_video.c
++++ b/vmwgfx/vmwgfx_tex_video.c
+@@ -237,7 +237,7 @@ stop_video(ScrnInfoPtr pScrn, pointer data, Bool shutdown)
+ 
+        for (i=0; i<3; ++i) {
+ 	   for (j=0; j<2; ++j) {
+-	       if (priv->yuv[i]) {
++	       if (priv->yuv[j][i]) {
+ 		   xa_surface_destroy(priv->yuv[j][i]);
+ 		   priv->yuv[j][i] = NULL;
+ 	       }

From 145ee1fe12a516adc8b97b5a37015d2df06a2942 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 18:24:37 -0700
Subject: [PATCH 15/48] doxygen: fix build for gcc 12

---
 srcpkgs/doxygen/patches/compat-gcc12.patch | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100644 srcpkgs/doxygen/patches/compat-gcc12.patch

diff --git a/srcpkgs/doxygen/patches/compat-gcc12.patch b/srcpkgs/doxygen/patches/compat-gcc12.patch
new file mode 100644
index 000000000000..666744a1dceb
--- /dev/null
+++ b/srcpkgs/doxygen/patches/compat-gcc12.patch
@@ -0,0 +1,22 @@
+From 5198966c8d5fec89116d025c74934ac03ea511fa Mon Sep 17 00:00:00 2001
+From: Dimitri van Heesch <doxygen@gmail.com>
+Date: Fri, 6 May 2022 09:55:16 +0200
+Subject: [PATCH] issue #9312: Build: cache.h:53:14: error: 'exchange' is not a
+ member of 'std'
+
+---
+ src/cache.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/cache.h b/src/cache.h
+index 0ff3092ed5..e218eb27d2 100644
+--- a/src/cache.h
++++ b/src/cache.h
+@@ -19,6 +19,7 @@
+ #include <list>
+ #include <unordered_map>
+ #include <mutex>
++#include <utility>
+ #include <ctype.h>
+ 
+ /*! Fixed size cache for value type V using keys of type K.

From 4c6f45ec13cd715c0c896e1a481544dfd95c23a5 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 21 Aug 2022 21:37:00 -0700
Subject: [PATCH 16/48] openjdk7-bootstrap: fix build for gcc12

---
 .../files/dist_patches_glibc.txt              |  1 +
 .../files/dist_patches_musl.txt               |  1 +
 .../icedtea-pointer-comparison-gcc12.patch    | 31 +++++++++++++++++++
 3 files changed, 33 insertions(+)
 create mode 100644 srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch

diff --git a/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt b/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt
index c76c56855441..8061756dfc0c 100644
--- a/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt
+++ b/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt
@@ -6,3 +6,4 @@ icedtea-jdk-no-soname.patch
 icedtea-jdk-xattr.patch
 icedtea-jdk-sysctl_h.patch
 icedtea-cpio.patch
+icedtea-pointer-comparison-gcc12.patch
diff --git a/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt b/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt
index 21812517c7c2..8b35d9c46989 100644
--- a/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt
+++ b/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt
@@ -11,3 +11,4 @@ icedtea-jdk-musl.patch
 icedtea-jdk-no-soname.patch
 icedtea-jdk-xattr.patch
 icedtea-cpio.patch
+icedtea-pointer-comparison-gcc12.patch
diff --git a/srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch b/srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch
new file mode 100644
index 000000000000..c809553443e7
--- /dev/null
+++ b/srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch
@@ -0,0 +1,31 @@
+--- openjdk.orig/hotspot/src/share/vm/opto/lcm.cpp
++++ openjdk/hotspot/src/share/vm/opto/lcm.cpp
+@@ -60,7 +60,7 @@
+ // Check whether val is not-null-decoded compressed oop,
+ // i.e. will grab into the base of the heap if it represents NULL.
+ static bool accesses_heap_base_zone(Node *val) {
+-  if (Universe::narrow_oop_base() > 0) { // Implies UseCompressedOops.
++  if (Universe::narrow_oop_base() > (address)0) { // Implies UseCompressedOops.
+     if (val && val->is_Mach()) {
+       if (val->as_Mach()->ideal_Opcode() == Op_DecodeN) {
+         // This assumes all Decodes with TypePtr::NotNull are matched to nodes that
+--- openjdk.orig/hotspot/src/share/vm/runtime/virtualspace.cpp
++++ openjdk/hotspot/src/share/vm/runtime/virtualspace.cpp
+@@ -527,7 +527,7 @@ ReservedHeapSpace::ReservedHeapSpace(siz
+                 (UseCompressedOops && (Universe::narrow_oop_base() != NULL) &&
+                  Universe::narrow_oop_use_implicit_null_checks()) ?
+                   lcm(os::vm_page_size(), alignment) : 0) {
+-  if (base() > 0) {
++  if (base() > (char*)0) {
+     MemTracker::record_virtual_memory_type((address)base(), mtJavaHeap);
+   }
+ 
+@@ -546,7 +546,7 @@ ReservedHeapSpace::ReservedHeapSpace(con
+                 (UseCompressedOops && (Universe::narrow_oop_base() != NULL) &&
+                  Universe::narrow_oop_use_implicit_null_checks()) ?
+                   lcm(os::vm_page_size(), prefix_align) : 0) {
+-  if (base() > 0) {
++  if (base() > (char*)0) {
+     MemTracker::record_virtual_memory_type((address)base(), mtJavaHeap);
+   }
+ 

From 71f56f8daae89ce3c46063f1e2b8e151c7516ad1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:39:52 -0700
Subject: [PATCH 17/48] libvirt: fix build for glibc 2.36

---
 .../patches/lxc-fix-compat-glibc-2.36.patch   | 34 ++++++++++++++++
 .../virfile-fix-compat-glibc-2.36.patch       | 39 +++++++++++++++++++
 2 files changed, 73 insertions(+)
 create mode 100644 srcpkgs/libvirt/patches/lxc-fix-compat-glibc-2.36.patch
 create mode 100644 srcpkgs/libvirt/patches/virfile-fix-compat-glibc-2.36.patch

diff --git a/srcpkgs/libvirt/patches/lxc-fix-compat-glibc-2.36.patch b/srcpkgs/libvirt/patches/lxc-fix-compat-glibc-2.36.patch
new file mode 100644
index 000000000000..d85b57815010
--- /dev/null
+++ b/srcpkgs/libvirt/patches/lxc-fix-compat-glibc-2.36.patch
@@ -0,0 +1,34 @@
+From 9493c9b79dc541ec9e0fd73c6d87bdf8d30aaa90 Mon Sep 17 00:00:00 2001
+From: Cole Robinson <crobinso@redhat.com>
+Date: Mon, 1 Aug 2022 15:20:38 -0400
+Subject: [PATCH] lxc: containter: fix build with glibc 2.36
+
+With glibc 2.36, sys/mount.h and linux/mount.h conflict:
+https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
+
+lxc_container.c imports sys/mount.h and linux/fs.h, which pulls in
+linux/mount.h.
+
+linux/fs.h isn't required here though. glibc sys/mount.h has had
+MS_MOVE since 2.12 in 2010
+
+Reviewed-by: Erik Skultety <eskultet@redhat.com>
+Signed-off-by: Cole Robinson <crobinso@redhat.com>
+---
+ src/lxc/lxc_container.c | 3 ---
+ 1 file changed, 3 deletions(-)
+
+diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
+index b5278831da7..a5401c2186e 100644
+--- a/src/lxc/lxc_container.c
++++ b/src/lxc/lxc_container.c
+@@ -33,9 +33,6 @@
+ /* Yes, we want linux private one, for _syscall2() macro */
+ #include <linux/unistd.h>
+ 
+-/* For MS_MOVE */
+-#include <linux/fs.h>
+-
+ #if WITH_CAPNG
+ # include <cap-ng.h>
+ #endif
diff --git a/srcpkgs/libvirt/patches/virfile-fix-compat-glibc-2.36.patch b/srcpkgs/libvirt/patches/virfile-fix-compat-glibc-2.36.patch
new file mode 100644
index 000000000000..2ef227ea9b54
--- /dev/null
+++ b/srcpkgs/libvirt/patches/virfile-fix-compat-glibc-2.36.patch
@@ -0,0 +1,39 @@
+From c0d9adf220dc0d223330a7bac37b174132d330ba Mon Sep 17 00:00:00 2001
+From: Cole Robinson <crobinso@redhat.com>
+Date: Mon, 1 Aug 2022 15:24:01 -0400
+Subject: [PATCH] virfile: Fix build with glibc 2.36
+
+With glibc 2.36, sys/mount.h and linux/mount.h conflict:
+https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
+
+virfile.c imports sys/mount.h and linux/fs.h, which pulls in
+linux/mount.h.
+
+Manually define the constants we need from linux/fs.h, like was
+done in llvm:
+
+https://reviews.llvm.org/rGb379129c4beb3f26223288627a1291739f33af02
+
+Reviewed-by: Erik Skultety <eskultet@redhat.com>
+Signed-off-by: Cole Robinson <crobinso@redhat.com>
+---
+ src/util/virfile.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/src/util/virfile.c b/src/util/virfile.c
+index 99da058db3b..ce541b8946b 100644
+--- a/src/util/virfile.c
++++ b/src/util/virfile.c
+@@ -71,7 +71,11 @@
+ # endif
+ # include <sys/ioctl.h>
+ # include <linux/cdrom.h>
+-# include <linux/fs.h>
++/* These come from linux/fs.h, but that header conflicts with
++ * sys/mount.h on glibc 2.36+ */
++# define FS_IOC_GETFLAGS _IOR('f', 1, long)
++# define FS_IOC_SETFLAGS _IOW('f', 2, long)
++# define FS_NOCOW_FL 0x00800000
+ #endif
+ 
+ #if WITH_LIBATTR

From f0c2a0bf2fe94ef1e9e2b54c64657a609a34e6c2 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:41:50 -0700
Subject: [PATCH 18/48] efivar: fix build for glibc 2.36

---
 .../patches/fix-compat-glibc-2.36.patch       | 55 +++++++++++++++++++
 1 file changed, 55 insertions(+)
 create mode 100644 srcpkgs/efivar/patches/fix-compat-glibc-2.36.patch

diff --git a/srcpkgs/efivar/patches/fix-compat-glibc-2.36.patch b/srcpkgs/efivar/patches/fix-compat-glibc-2.36.patch
new file mode 100644
index 000000000000..fcc83aef20cf
--- /dev/null
+++ b/srcpkgs/efivar/patches/fix-compat-glibc-2.36.patch
@@ -0,0 +1,55 @@
+From bc65d63ebf8fe6ac8a099ff15ca200986dba1565 Mon Sep 17 00:00:00 2001
+From: Robbie Harwood <rharwood@redhat.com>
+Date: Thu, 28 Jul 2022 16:11:24 -0400
+Subject: [PATCH] Fix glibc 2.36 build (mount.h conflicts)
+
+glibc has decided that sys/mount.h and linux/mount.h are no longer
+usable at the same time.  This broke the build, since linux/fs.h itself
+includes linux/mount.h.  For now, fix the build by only including
+sys/mount.h where we need it.
+
+See-also: https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
+Resolves: #227
+Signed-off-by: Robbie Harwood <rharwood@redhat.com>
+---
+ src/gpt.c   | 1 +
+ src/linux.c | 1 +
+ src/util.h  | 1 -
+ 3 files changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/gpt.c b/src/gpt.c
+index 1eda0497..21413c3b 100644
+--- a/src/gpt.c
++++ b/src/gpt.c
+@@ -17,6 +17,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <sys/mount.h>
+ #include <sys/param.h>
+ #include <sys/stat.h>
+ #include <sys/utsname.h>
+diff --git a/src/linux.c b/src/linux.c
+index 47e45ae4..1780816f 100644
+--- a/src/linux.c
++++ b/src/linux.c
+@@ -20,6 +20,7 @@
+ #include <stdbool.h>
+ #include <stdio.h>
+ #include <sys/ioctl.h>
++#include <sys/mount.h>
+ #include <sys/socket.h>
+ #include <sys/sysmacros.h>
+ #include <sys/types.h>
+diff --git a/src/util.h b/src/util.h
+index 3300666f..1e67e447 100644
+--- a/src/util.h
++++ b/src/util.h
+@@ -23,7 +23,6 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <sys/ioctl.h>
+-#include <sys/mount.h>
+ #include <sys/stat.h>
+ #include <sys/types.h>
+ #include <tgmath.h>

From b2ccc882457938167af7a050e1cc2a1c24ef0757 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:43:24 -0700
Subject: [PATCH 19/48] libwpd: fix build for gcc12

---
 srcpkgs/libwpd/patches/fix-compat-gcc12.patch | 11 +++++++++++
 1 file changed, 11 insertions(+)
 create mode 100644 srcpkgs/libwpd/patches/fix-compat-gcc12.patch

diff --git a/srcpkgs/libwpd/patches/fix-compat-gcc12.patch b/srcpkgs/libwpd/patches/fix-compat-gcc12.patch
new file mode 100644
index 000000000000..6ebce2463d16
--- /dev/null
+++ b/srcpkgs/libwpd/patches/fix-compat-gcc12.patch
@@ -0,0 +1,11 @@
+diff -rup libwpd-0.10.3.orig/src/lib/WPXTable.h libwpd-0.10.3/src/lib/WPXTable.h
+--- libwpd-0.10.3.orig/src/lib/WPXTable.h	2022-08-23 22:32:45.332593795 -0700
++++ libwpd-0.10.3/src/lib/WPXTable.h	2022-08-23 22:32:59.500651211 -0700
+@@ -37,6 +37,7 @@
+ #define _WPXTABLE_H
+ 
+ #include <vector>
++#include <cstddef>
+ 
+ struct WPXTableCell
+ {

From cc2ada3c9686a23e397c5fb64e49ae89e7cbd93a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:44:07 -0700
Subject: [PATCH 20/48] grub: fix build for binutils 2.36

---
 .../patches/fix-compat-binutils-2.36.patch    | 96 +++++++++++++++++++
 srcpkgs/grub/template                         |  7 +-
 2 files changed, 102 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/grub/patches/fix-compat-binutils-2.36.patch

diff --git a/srcpkgs/grub/patches/fix-compat-binutils-2.36.patch b/srcpkgs/grub/patches/fix-compat-binutils-2.36.patch
new file mode 100644
index 000000000000..d92a91e3253e
--- /dev/null
+++ b/srcpkgs/grub/patches/fix-compat-binutils-2.36.patch
@@ -0,0 +1,96 @@
+From b98275138bf4fc250a1c362dfd2c8b1cf2421701 Mon Sep 17 00:00:00 2001
+From: Michael Chang <mchang@suse.com>
+Date: Tue, 28 Sep 2021 13:50:47 +0800
+Subject: build: Fix build error with binutils 2.36
+
+The following procedure to build xen/pvgrub is broken.
+
+  git clone https://git.savannah.gnu.org/git/grub.git
+  cd grub
+  ./bootstrap
+  mkdir build-xen
+  cd build-xen
+  ../configure --with-platform=xen
+  make
+
+It fails with the message:
+
+  /usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld:
+  section .note.gnu.property VMA [0000000000400158,0000000000400187]
+  overlaps section .bss VMA [000000000000f000,000000000041e1af]
+
+The most significant factor is that new assembler (GNU as) generates the
+.note.gnu.property section as default. This note section overlaps with
+.bss because it doesn't reposition with -Wl,-Ttext,0 with which the base
+address of .text section is set, rather the address of .note.gnu.property
+is calculated for some reason from 0x400000 where the ELF executable
+defaults to start.
+
+Using -Ttext-segment doesn't help either, though it is said to set the
+address of the first byte of the text segment according to "man ld".
+What it actually does is to override the default 0x400000, aka the image
+base address, to something else. The entire process can be observed in
+the default linker script used by gcc [1]. Therefore we can't expect it
+to achieve the same thing as -Ttext given that the first segment where
+.text resides is offset by SIZEOF_HEADERS plus some sections may be
+preceding it within the first segment. The end result is .text always
+has to start with non-zero address with -Wl,-Ttext-segment,0 if using
+default linker script.
+
+It is also worth mentioning that binutils upstream apparently doesn't
+seem to consider this as a bug [2] and proposed to use -Wl,-Ttext-segment,0
+which is not fruitful as what has been tested by Gentoo [3].
+
+As long as GRUB didn't use ISA information encoded in .note.gnu.property,
+we can safely drop it via -Wa,-mx86-used-note=no assembler option to
+fix the linker error above.
+
+This is considered a better approach than using custom linker script to
+drop the .note.gnu.property section because object file manipulation can
+also be hampered one way or the other in that linker script may not be
+helpful. See also this commit removing the section in the process of objcopy.
+
+  6643507ce build: Fix GRUB i386-pc build with Ubuntu gcc
+
+[1] In /usr/lib64/ldscripts/elf_x86_64.x or use 'gcc -Wl,--verbose ...'
+    PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x400000));
+    . = SEGMENT_START("text-segment", 0x400000) + SIZEOF_HEADERS;
+[2] https://sourceware.org/bugzilla/show_bug.cgi?id=27377
+[3] https://bugs.gentoo.org/787221
+
+Signed-off-by: Michael Chang <mchang@suse.com>
+Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
+---
+ configure.ac | 14 ++++++++++++++
+ 1 file changed, 14 insertions(+)
+
+(limited to 'configure.ac')
+
+diff --git a/configure.ac b/configure.ac
+index eeb5d22..8d1c81a 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -840,6 +840,20 @@ if ( test "x$target_cpu" = xi386 || test "x$target_cpu" = xx86_64 ) && test "x$p
+   TARGET_CFLAGS="$TARGET_CFLAGS -mno-mmx -mno-sse -mno-sse2 -mno-sse3 -mno-3dnow"
+ fi
+ 
++if ( test "x$target_cpu" = xi386 || test "x$target_cpu" = xx86_64 ); then
++  AC_CACHE_CHECK([whether -Wa,-mx86-used-note works], [grub_cv_cc_mx86_used_note], [
++    CFLAGS="$TARGET_CFLAGS -Wa,-mx86-used-note=no -Werror"
++    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
++	[grub_cv_cc_mx86_used_note=yes],
++	[grub_cv_cc_mx86_used_note=no])
++  ])
++
++  if test "x$grub_cv_cc_mx86_used_note" = xyes; then
++    TARGET_CFLAGS="$TARGET_CFLAGS -Wa,-mx86-used-note=no"
++    TARGET_CCASFLAGS="$TARGET_CCASFLAGS -Wa,-mx86-used-note=no"
++  fi
++fi
++
+ # GRUB doesn't use float or doubles at all. Yet some toolchains may decide
+ # that floats are a good fit to run instead of what's written in the code.
+ # Given that floating point unit is disabled (if present to begin with)
+-- 
+cgit v1.1
+
diff --git a/srcpkgs/grub/template b/srcpkgs/grub/template
index b1826c38a884..b4d3b07af620 100644
--- a/srcpkgs/grub/template
+++ b/srcpkgs/grub/template
@@ -2,7 +2,8 @@
 pkgname=grub
 version=2.06
 revision=2
-hostmakedepends="python3 pkg-config flex freetype-devel font-unifont-bdf help2man"
+hostmakedepends="python3 pkg-config flex freetype-devel font-unifont-bdf help2man
+ automake gettext-devel-tools"
 makedepends="libusb-compat-devel ncurses-devel freetype-devel
  liblzma-devel device-mapper-devel fuse-devel"
 depends="os-prober"
@@ -43,6 +44,10 @@ case "$XBPS_TARGET_MACHINE" in
 		;;
 esac
 
+pre_configure() {
+	autoreconf -fi
+}
+
 do_configure() {
 	# workaround for https://savannah.gnu.org/bugs/?60458
 	# some more info: https://www.linuxquestions.org/questions/showthread.php?p=6257712

From 44e51d3aedc827370028bcae52f18c26ba469d00 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:45:07 -0700
Subject: [PATCH 21/48] linux-toos: fix build for binutils 2.39

---
 .../patches/binutils-add-compat-check.patch   | 103 ++++++++++++
 .../patches/binutils-disasm-compat.patch      | 102 ++++++++++++
 .../bpf_jit_disasm-binutils-2.39.patch        | 104 ++++++++++++
 .../patches/bpftool-binutils-2.39.patch       | 149 ++++++++++++++++++
 .../patches/perf-binutils-2.39.patch          | 114 ++++++++++++++
 5 files changed, 572 insertions(+)
 create mode 100644 srcpkgs/linux-tools/patches/binutils-add-compat-check.patch
 create mode 100644 srcpkgs/linux-tools/patches/binutils-disasm-compat.patch
 create mode 100644 srcpkgs/linux-tools/patches/bpf_jit_disasm-binutils-2.39.patch
 create mode 100644 srcpkgs/linux-tools/patches/bpftool-binutils-2.39.patch
 create mode 100644 srcpkgs/linux-tools/patches/perf-binutils-2.39.patch

diff --git a/srcpkgs/linux-tools/patches/binutils-add-compat-check.patch b/srcpkgs/linux-tools/patches/binutils-add-compat-check.patch
new file mode 100644
index 000000000000..e4e7ece9635e
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/binutils-add-compat-check.patch
@@ -0,0 +1,103 @@
+From cfd59ca91467056bb2c36907b2fa67b8e1af9952 Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:27 -0700
+Subject: [PATCH] tools build: Add feature test for init_disassemble_info API
+ changes
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation failures for tools/{perf,bpf}, e.g. on debian unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+This commit adds a feature test to detect the new signature.  Subsequent
+commits will use it to fix the build failures.
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Quentin Monnet <quentin@isovalent.com>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-2-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/build/Makefile.feature                        |  1 +
+ tools/build/feature/Makefile                        |  4 ++++
+ tools/build/feature/test-all.c                      |  4 ++++
+ tools/build/feature/test-disassembler-init-styled.c | 13 +++++++++++++
+ 4 files changed, 22 insertions(+)
+ create mode 100644 tools/build/feature/test-disassembler-init-styled.c
+
+diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature
+index 888a0421d43b96..8f6578e4d3249e 100644
+--- a/tools/build/Makefile.feature
++++ b/tools/build/Makefile.feature
+@@ -70,6 +70,7 @@ FEATURE_TESTS_BASIC :=                  \
+         libaio				\
+         libzstd				\
+         disassembler-four-args		\
++        disassembler-init-styled	\
+         file-handle
+ 
+ # FEATURE_TESTS_BASIC + FEATURE_TESTS_EXTRA is the complete list
+diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile
+index 7c2a17e23c30ac..c3059739318a95 100644
+--- a/tools/build/feature/Makefile
++++ b/tools/build/feature/Makefile
+@@ -18,6 +18,7 @@ FILES=                                          \
+          test-libbfd.bin                        \
+          test-libbfd-buildid.bin		\
+          test-disassembler-four-args.bin        \
++         test-disassembler-init-styled.bin	\
+          test-reallocarray.bin			\
+          test-libbfd-liberty.bin                \
+          test-libbfd-liberty-z.bin              \
+@@ -248,6 +249,9 @@ $(OUTPUT)test-libbfd-buildid.bin:
+ $(OUTPUT)test-disassembler-four-args.bin:
+ 	$(BUILD) -DPACKAGE='"perf"' -lbfd -lopcodes
+ 
++$(OUTPUT)test-disassembler-init-styled.bin:
++	$(BUILD) -DPACKAGE='"perf"' -lbfd -lopcodes
++
+ $(OUTPUT)test-reallocarray.bin:
+ 	$(BUILD)
+ 
+diff --git a/tools/build/feature/test-all.c b/tools/build/feature/test-all.c
+index 5ffafb967b6e49..957c02c7b163b5 100644
+--- a/tools/build/feature/test-all.c
++++ b/tools/build/feature/test-all.c
+@@ -166,6 +166,10 @@
+ # include "test-disassembler-four-args.c"
+ #undef main
+ 
++#define main main_test_disassembler_init_styled
++# include "test-disassembler-init-styled.c"
++#undef main
++
+ #define main main_test_libzstd
+ # include "test-libzstd.c"
+ #undef main
+diff --git a/tools/build/feature/test-disassembler-init-styled.c b/tools/build/feature/test-disassembler-init-styled.c
+new file mode 100644
+index 00000000000000..f1ce0ec3bee9d3
+--- /dev/null
++++ b/tools/build/feature/test-disassembler-init-styled.c
+@@ -0,0 +1,13 @@
++// SPDX-License-Identifier: GPL-2.0
++#include <stdio.h>
++#include <dis-asm.h>
++
++int main(void)
++{
++	struct disassemble_info info;
++
++	init_disassemble_info(&info, stdout,
++			      NULL, NULL);
++
++	return 0;
++}
diff --git a/srcpkgs/linux-tools/patches/binutils-disasm-compat.patch b/srcpkgs/linux-tools/patches/binutils-disasm-compat.patch
new file mode 100644
index 000000000000..1a6cc0e6d97c
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/binutils-disasm-compat.patch
@@ -0,0 +1,102 @@
+From a45b3d6926231c3d024ea0de4f7bd967f83709ee Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:29 -0700
+Subject: tools include: add dis-asm-compat.h to handle version differences
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation failures for tools/{perf,bpf}, e.g. on debian unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+This commit introduces a wrapper for init_disassemble_info(), to avoid
+spreading #ifdef DISASM_INIT_STYLED to a bunch of places. Subsequent
+commits will use it to fix the build failures.
+
+It likely is worth adding a wrapper for disassember(), to avoid the already
+existing DISASM_FOUR_ARGS_SIGNATURE ifdefery.
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Signed-off-by: Ben Hutchings <benh@debian.org>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Quentin Monnet <quentin@isovalent.com>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-4-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/include/tools/dis-asm-compat.h | 55 ++++++++++++++++++++++++++++++++++++
+ 1 file changed, 55 insertions(+)
+ create mode 100644 tools/include/tools/dis-asm-compat.h
+
+(limited to 'tools/include/tools/dis-asm-compat.h')
+
+diff --git a/tools/include/tools/dis-asm-compat.h b/tools/include/tools/dis-asm-compat.h
+new file mode 100644
+index 0000000000000..70f331e23ed3d
+--- /dev/null
++++ b/tools/include/tools/dis-asm-compat.h
+@@ -0,0 +1,55 @@
++/* SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause */
++#ifndef _TOOLS_DIS_ASM_COMPAT_H
++#define _TOOLS_DIS_ASM_COMPAT_H
++
++#include <stdio.h>
++#include <dis-asm.h>
++
++/* define types for older binutils version, to centralize ifdef'ery a bit */
++#ifndef DISASM_INIT_STYLED
++enum disassembler_style {DISASSEMBLER_STYLE_NOT_EMPTY};
++typedef int (*fprintf_styled_ftype) (void *, enum disassembler_style, const char*, ...);
++#endif
++
++/*
++ * Trivial fprintf wrapper to be used as the fprintf_styled_func argument to
++ * init_disassemble_info_compat() when normal fprintf suffices.
++ */
++static inline int fprintf_styled(void *out,
++				 enum disassembler_style style,
++				 const char *fmt, ...)
++{
++	va_list args;
++	int r;
++
++	(void)style;
++
++	va_start(args, fmt);
++	r = vfprintf(out, fmt, args);
++	va_end(args);
++
++	return r;
++}
++
++/*
++ * Wrapper for init_disassemble_info() that hides version
++ * differences. Depending on binutils version and architecture either
++ * fprintf_func or fprintf_styled_func will be called.
++ */
++static inline void init_disassemble_info_compat(struct disassemble_info *info,
++						void *stream,
++						fprintf_ftype unstyled_func,
++						fprintf_styled_ftype styled_func)
++{
++#ifdef DISASM_INIT_STYLED
++	init_disassemble_info(info, stream,
++			      unstyled_func,
++			      styled_func);
++#else
++	(void)styled_func;
++	init_disassemble_info(info, stream,
++			      unstyled_func);
++#endif
++}
++
++#endif /* _TOOLS_DIS_ASM_COMPAT_H */
+-- 
+cgit 
+
diff --git a/srcpkgs/linux-tools/patches/bpf_jit_disasm-binutils-2.39.patch b/srcpkgs/linux-tools/patches/bpf_jit_disasm-binutils-2.39.patch
new file mode 100644
index 000000000000..01221fad3a4a
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/bpf_jit_disasm-binutils-2.39.patch
@@ -0,0 +1,104 @@
+From 96ed066054abf11c7d3e106e3011a51f3f1227a3 Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:31 -0700
+Subject: [PATCH] tools bpf_jit_disasm: Fix compilation error with new binutils
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation to fail for tools/bpf/bpf_jit_disasm.c, e.g. on debian
+unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+Wire up the feature test and switch to init_disassemble_info_compat(),
+which were introduced in prior commits, fixing the compilation failure.
+
+I verified that bpf_jit_disasm can still disassemble bpf programs, both
+with the old and new dis-asm.h API. With old binutils there's no change in
+output before/after this patch. When comparing the output from old
+binutils (2.35) to new bintuils with the patch (upstream snapshot) there
+are a few output differences, but they are unrelated to this patch. An
+example hunk is:
+
+     f4:	mov    %r14,%rsi
+     f7:	mov    %r15,%rdx
+     fa:	mov    $0x2a,%ecx
+  -  ff:	callq  0xffffffffea8c4988
+  +  ff:	call   0xffffffffea8c4988
+    104:	test   %rax,%rax
+    107:	jge    0x0000000000000110
+    109:	xor    %eax,%eax
+  - 10b:	jmpq   0x0000000000000073
+  + 10b:	jmp    0x0000000000000073
+    110:	cmp    $0x16,%rax
+
+However, I had to use an older kernel to generate the bpf_jit_enabled =
+2 output, as that has been broken since 5.18 / 1022a5498f6f745c ("bpf,
+x86_64: Use bpf_jit_binary_pack_alloc").
+
+  https://lore.kernel.org/20220703030210.pmjft7qc2eajzi6c@alap3.anarazel.de
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Daniel Borkmann <daniel@iogearbox.net>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Quentin Monnet <quentin@isovalent.com>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-6-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/bpf/Makefile         | 5 ++++-
+ tools/bpf/bpf_jit_disasm.c | 5 ++++-
+ 2 files changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/tools/bpf/Makefile b/tools/bpf/Makefile
+index b11cfc86a3d021..664601ab1705ab 100644
+--- a/tools/bpf/Makefile
++++ b/tools/bpf/Makefile
+@@ -34,7 +34,7 @@ else
+ endif
+ 
+ FEATURE_USER = .bpf
+-FEATURE_TESTS = libbfd disassembler-four-args
++FEATURE_TESTS = libbfd disassembler-four-args disassembler-init-styled
+ FEATURE_DISPLAY = libbfd disassembler-four-args
+ 
+ check_feat := 1
+@@ -56,6 +56,9 @@ endif
+ ifeq ($(feature-disassembler-four-args), 1)
+ CFLAGS += -DDISASM_FOUR_ARGS_SIGNATURE
+ endif
++ifeq ($(feature-disassembler-init-styled), 1)
++CFLAGS += -DDISASM_INIT_STYLED
++endif
+ 
+ $(OUTPUT)%.yacc.c: $(srctree)/tools/bpf/%.y
+ 	$(QUIET_BISON)$(YACC) -o $@ -d $<
+diff --git a/tools/bpf/bpf_jit_disasm.c b/tools/bpf/bpf_jit_disasm.c
+index c8ae9580472814..a90a5d110f9255 100644
+--- a/tools/bpf/bpf_jit_disasm.c
++++ b/tools/bpf/bpf_jit_disasm.c
+@@ -28,6 +28,7 @@
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <limits.h>
++#include <tools/dis-asm-compat.h>
+ 
+ #define CMD_ACTION_SIZE_BUFFER		10
+ #define CMD_ACTION_READ_ALL		3
+@@ -64,7 +65,9 @@ static void get_asm_insns(uint8_t *image, size_t len, int opcodes)
+ 	assert(bfdf);
+ 	assert(bfd_check_format(bfdf, bfd_object));
+ 
+-	init_disassemble_info(&info, stdout, (fprintf_ftype) fprintf);
++	init_disassemble_info_compat(&info, stdout,
++				     (fprintf_ftype) fprintf,
++				     fprintf_styled);
+ 	info.arch = bfd_get_arch(bfdf);
+ 	info.mach = bfd_get_mach(bfdf);
+ 	info.buffer = image;
diff --git a/srcpkgs/linux-tools/patches/bpftool-binutils-2.39.patch b/srcpkgs/linux-tools/patches/bpftool-binutils-2.39.patch
new file mode 100644
index 000000000000..1e55c40011be
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/bpftool-binutils-2.39.patch
@@ -0,0 +1,149 @@
+From 600b7b26c07a070d0153daa76b3806c1e52c9e00 Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:33 -0700
+Subject: [PATCH] tools bpftool: Fix compilation error with new binutils
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation to fail for tools/bpf/bpftool/jit_disasm.c, e.g. on debian
+unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+Wire up the feature test and switch to init_disassemble_info_compat(),
+which were introduced in prior commits, fixing the compilation failure.
+
+I verified that bpftool can still disassemble bpf programs, both with an
+old and new dis-asm.h API. There are no output changes for plain and json
+formats. When comparing the output from old binutils (2.35)
+to new bintuils with the patch (upstream snapshot) there are a few output
+differences, but they are unrelated to this patch. An example hunk is:
+
+     2f:	pop    %r14
+     31:	pop    %r13
+     33:	pop    %rbx
+  -  34:	leaveq
+  -  35:	retq
+  +  34:	leave
+  +  35:	ret
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Quentin Monnet <quentin@isovalent.com>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-8-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/bpf/bpftool/Makefile     |  5 +++-
+ tools/bpf/bpftool/jit_disasm.c | 42 +++++++++++++++++++++++++++-------
+ 2 files changed, 38 insertions(+), 9 deletions(-)
+
+diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile
+index c6d2c77d02524a..436e671b2657d4 100644
+--- a/tools/bpf/bpftool/Makefile
++++ b/tools/bpf/bpftool/Makefile
+@@ -62,7 +62,7 @@ CLANG ?= clang
+ LLVM_STRIP ?= llvm-strip
+ 
+ FEATURE_USER = .bpftool
+-FEATURE_TESTS = libbfd disassembler-four-args reallocarray zlib libcap \
++FEATURE_TESTS = libbfd disassembler-four-args disassembler-init-styled reallocarray zlib libcap \
+ 	clang-bpf-co-re
+ FEATURE_DISPLAY = libbfd disassembler-four-args zlib libcap \
+ 	clang-bpf-co-re
+@@ -117,6 +117,9 @@ endif
+ ifeq ($(feature-disassembler-four-args), 1)
+ CFLAGS += -DDISASM_FOUR_ARGS_SIGNATURE
+ endif
++ifeq ($(feature-disassembler-init-styled), 1)
++    CFLAGS += -DDISASM_INIT_STYLED
++endif
+ 
+ LIBS = $(LIBBPF) -lelf -lz
+ LIBS_BOOTSTRAP = $(LIBBPF_BOOTSTRAP) -lelf -lz
+diff --git a/tools/bpf/bpftool/jit_disasm.c b/tools/bpf/bpftool/jit_disasm.c
+index 24734f2249d6ec..aaf99a0168c90b 100644
+--- a/tools/bpf/bpftool/jit_disasm.c
++++ b/tools/bpf/bpftool/jit_disasm.c
+@@ -24,6 +24,7 @@
+ #include <sys/stat.h>
+ #include <limits.h>
+ #include <bpf/libbpf.h>
++#include <tools/dis-asm-compat.h>
+ 
+ #include "json_writer.h"
+ #include "main.h"
+@@ -39,15 +40,12 @@ static void get_exec_path(char *tpath, s
+ }
+ 
+ static int oper_count;
+-static int fprintf_json(void *out, const char *fmt, ...)
++static int printf_json(void *out, const char *fmt, va_list ap)
+ {
+-	va_list ap;
+ 	char *s;
+ 
+-	va_start(ap, fmt);
+ 	if (vasprintf(&s, fmt, ap) < 0)
+ 		return -1;
+-	va_end(ap);
+ 
+ 	if (!oper_count) {
+ 		int i;
+@@ -73,6 +71,32 @@ static int fprintf_json(void *out, const char *fmt, ...)
+ 	return 0;
+ }
+ 
++static int fprintf_json(void *out, const char *fmt, ...)
++{
++	va_list ap;
++	int r;
++
++	va_start(ap, fmt);
++	r = printf_json(out, fmt, ap);
++	va_end(ap);
++
++	return r;
++}
++
++static int fprintf_json_styled(void *out,
++			       enum disassembler_style style __maybe_unused,
++			       const char *fmt, ...)
++{
++	va_list ap;
++	int r;
++
++	va_start(ap, fmt);
++	r = printf_json(out, fmt, ap);
++	va_end(ap);
++
++	return r;
++}
++
+ void disasm_print_insn(unsigned char *image, ssize_t len, int opcodes,
+ 		       const char *arch, const char *disassembler_options,
+ 		       const struct btf *btf,
+@@ -99,11 +123,13 @@ void disasm_print_insn(unsigned char *image, ssize_t len, int opcodes,
+ 	assert(bfd_check_format(bfdf, bfd_object));
+ 
+ 	if (json_output)
+-		init_disassemble_info(&info, stdout,
+-				      (fprintf_ftype) fprintf_json);
++		init_disassemble_info_compat(&info, stdout,
++					     (fprintf_ftype) fprintf_json,
++					     fprintf_json_styled);
+ 	else
+-		init_disassemble_info(&info, stdout,
+-				      (fprintf_ftype) fprintf);
++		init_disassemble_info_compat(&info, stdout,
++					     (fprintf_ftype) fprintf,
++					     fprintf_styled);
+ 
+ 	/* Update architecture info for offload. */
+ 	if (arch) {
diff --git a/srcpkgs/linux-tools/patches/perf-binutils-2.39.patch b/srcpkgs/linux-tools/patches/perf-binutils-2.39.patch
new file mode 100644
index 000000000000..3484330f7286
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/perf-binutils-2.39.patch
@@ -0,0 +1,114 @@
+From 83aa0120487e8bc3f231e72c460add783f71f17c Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:30 -0700
+Subject: [PATCH] tools perf: Fix compilation error with new binutils
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation failures for tools/perf/util/annotate.c, e.g. on debian
+unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+Wire up the feature test and switch to init_disassemble_info_compat(),
+which were introduced in prior commits, fixing the compilation failure.
+
+I verified that perf can still disassemble bpf programs by using bpftrace
+under load, recording a perf trace, and then annotating the bpf "function"
+with and without the changes. With old binutils there's no change in output
+before/after this patch. When comparing the output from old binutils (2.35)
+to new bintuils with the patch (upstream snapshot) there are a few output
+differences, but they are unrelated to this patch. An example hunk is:
+
+       1.15 :   55:mov    %rbp,%rdx
+       0.00 :   58:add    $0xfffffffffffffff8,%rdx
+       0.00 :   5c:xor    %ecx,%ecx
+  -    1.03 :   5e:callq  0xffffffffe12aca3c
+  +    1.03 :   5e:call   0xffffffffe12aca3c
+       0.00 :   63:xor    %eax,%eax
+  -    2.18 :   65:leaveq
+  -    2.82 :   66:retq
+  +    2.18 :   65:leave
+  +    2.82 :   66:ret
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-5-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/perf/Makefile.config | 8 ++++++++
+ tools/perf/util/annotate.c | 7 ++++---
+ 2 files changed, 12 insertions(+), 3 deletions(-)
+
+diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
+index d3c254c0f5c611..23648ea54e8d3d 100644
+--- a/tools/perf/Makefile.config
++++ b/tools/perf/Makefile.config
+@@ -298,6 +298,7 @@ FEATURE_CHECK_LDFLAGS-libpython := $(PYTHON_EMBED_LDOPTS)
+ FEATURE_CHECK_LDFLAGS-libaio = -lrt
+ 
+ FEATURE_CHECK_LDFLAGS-disassembler-four-args = -lbfd -lopcodes -ldl
++FEATURE_CHECK_LDFLAGS-disassembler-init-styled = -lbfd -lopcodes -ldl
+ 
+ CORE_CFLAGS += -fno-omit-frame-pointer
+ CORE_CFLAGS += -ggdb3
+@@ -818,13 +819,16 @@ else
+   ifeq ($(feature-libbfd-liberty), 1)
+     EXTLIBS += -lbfd -lopcodes -liberty
+     FEATURE_CHECK_LDFLAGS-disassembler-four-args += -liberty -ldl
++    FEATURE_CHECK_LDFLAGS-disassembler-init-styled += -liberty -ldl
+   else
+     ifeq ($(feature-libbfd-liberty-z), 1)
+       EXTLIBS += -lbfd -lopcodes -liberty -lz
+       FEATURE_CHECK_LDFLAGS-disassembler-four-args += -liberty -lz -ldl
++      FEATURE_CHECK_LDFLAGS-disassembler-init-styled += -liberty -lz -ldl
+     endif
+   endif
+   $(call feature_check,disassembler-four-args)
++  $(call feature_check,disassembler-init-styled)
+ endif
+ 
+ ifeq ($(feature-libbfd-buildid), 1)
+@@ -1044,6 +1048,10 @@ ifeq ($(feature-disassembler-four-args), 1)
+     CFLAGS += -DDISASM_FOUR_ARGS_SIGNATURE
+ endif
+ 
++ifeq ($(feature-disassembler-init-styled), 1)
++    CFLAGS += -DDISASM_INIT_STYLED
++endif
++
+ ifeq (${IS_64_BIT}, 1)
+   ifndef NO_PERF_READ_VDSO32
+     $(call feature_check,compile-32)
+diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
+index 82cc396ef516c4..2c6a485c3de5d9 100644
+--- a/tools/perf/util/annotate.c
++++ b/tools/perf/util/annotate.c
+@@ -1676,6 +1676,7 @@ fallback:
+ #define PACKAGE "perf"
+ #include <bfd.h>
+ #include <dis-asm.h>
++#include <tools/dis-asm-compat.h>
+ 
+ static int symbol__disassemble_bpf(struct symbol *sym,
+ 				   struct annotate_args *args)
+@@ -1762,9 +1763,9 @@ static int symbol__disassemble_bpf(struct symbol *sym,
+ 		ret = errno;
+ 		goto out;
+ 	}
+-	init_disassemble_info(&info, s,
+-			      (fprintf_ftype) fprintf);
+-
++	init_disassemble_info_compat(&info, s,
++				     (fprintf_ftype) fprintf,
++				     fprintf_styled);
+ 	info.arch = bfd_get_arch(bfdf);
+ 	info.mach = bfd_get_mach(bfdf);
+ 

From 6ab7f177a7cbf2e5397499f2b9ed143282a37e97 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 14:45:28 -0700
Subject: [PATCH 22/48] libsasl: fix build for libtool 2.4.7

---
 srcpkgs/libsasl/template | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/libsasl/template b/srcpkgs/libsasl/template
index a8817042f843..a2993b39f4a1 100644
--- a/srcpkgs/libsasl/template
+++ b/srcpkgs/libsasl/template
@@ -19,6 +19,7 @@ distfiles="https://github.com/cyrusimap/cyrus-sasl/releases/download/cyrus-sasl-
 checksum=26866b1549b00ffd020f188a43c258017fa1c382b3ddadd8201536f72efb05d5
 
 pre_configure() {
+	rm -f m4/ltversion.m4
 	autoreconf -fi
 }
 

From 144a09021d8151feff39a699b0c81a1e57a52389 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:08 -0700
Subject: [PATCH 23/48] subversion: fix build for libtool 2.4.7

---
 srcpkgs/subversion/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion/template b/srcpkgs/subversion/template
index 8ad178264942..3f1c9e254e61 100644
--- a/srcpkgs/subversion/template
+++ b/srcpkgs/subversion/template
@@ -57,7 +57,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From e8b4c4f25f7bd73cc75cf7687fbaf81a8a998aa4 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:38 -0700
Subject: [PATCH 24/48] subversion-kwallet-auth: fix build for libtool 2.4.7

---
 srcpkgs/subversion-kwallet-auth/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion-kwallet-auth/template b/srcpkgs/subversion-kwallet-auth/template
index 12210f250d51..b4d8621456ea 100644
--- a/srcpkgs/subversion-kwallet-auth/template
+++ b/srcpkgs/subversion-kwallet-auth/template
@@ -59,7 +59,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From 348e384fe9032ba6dbb7caae21e437c4737ac236 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 20:07:32 -0700
Subject: [PATCH 25/48] gpgme: update to 1.18.0.

---
 common/shlibs          | 2 +-
 srcpkgs/gpgme/template | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 8b31fec0557c..3cde524d66bc 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -720,7 +720,7 @@ libdconf.so.1 dconf-0.13.90_1
 libassuan.so.0 libassuan-2.0.1_1
 libgpgme.so.11 libgpgme-1.12.0_2
 libgpgmepp.so.6 gpgmepp-1.7.0_3
-libqgpgme.so.7 gpgmeqt-1.7.0_3
+libqgpgme.so.15 gpgmeqt-1.18.0_1
 libgarcon-1.so.0 garcon-0.1.12_1
 libgarcon-gtk2-1.so.0 garcon-0.4.0_1
 libgarcon-gtk3-1.so.0 garcon-0.6.1_1
diff --git a/srcpkgs/gpgme/template b/srcpkgs/gpgme/template
index 8633075a8404..b1cfd5f78657 100644
--- a/srcpkgs/gpgme/template
+++ b/srcpkgs/gpgme/template
@@ -1,7 +1,7 @@
 # Template file for 'gpgme'
 pkgname=gpgme
-version=1.15.1
-revision=2
+version=1.18.0
+revision=1
 build_style=gnu-configure
 configure_args="--enable-fd-passing
  --with-libgpg-error-prefix=$XBPS_CROSS_BASE/usr
@@ -14,7 +14,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.gnupg.org/software/gpgme/index.html"
 distfiles="https://www.gnupg.org/ftp/gcrypt/gpgme/gpgme-${version}.tar.bz2"
-checksum=eebc3c1b27f1c8979896ff361ba9bb4778b508b2496c2fc10e3775a40b1de1ad
+checksum=361d4eae47ce925dba0ea569af40e7b52c645c4ae2e65e5621bf1b6cdd8b0e9e
 
 if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
 	configure_args+=" ac_cv_sys_file_offset_bits=no"

From 950f43ed4e0a5d9f8182ea0d78db51e16a09919c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 26/48] cross-aarch64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..bd6b23f9fb6a 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From bb089400d196e6d5601405bfe468eb6afc7f4376 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 27/48] cross-aarch64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..427ad2c1e9cd 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From c59cb9d61ade1fbcf8aed884971ba3c9eb568379 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 28/48] cross-arm-linux-gnueabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..2510ee26e789 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From d686d2e06713c557f7fad91eeae358dd11f4f17e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 29/48] cross-arm-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..bd8b16e1b4c1 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 67ad7a519e3db10bdec201be1b0510f488f72953 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 30/48] cross-arm-linux-musleabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..dacfd2655216 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From dc100abc40aa11da6d31750c4033d1899ccc9796 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 31/48] cross-arm-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..9ddd32a9f20d 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 3480bd2e68cdf24206917e478ad49f764beba9e8 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 32/48] cross-armv7l-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..9fb00f18be3b 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From f8c0a3cd5ff94ebc07763ba46c6e5c4302fc7501 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 33/48] cross-armv7l-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..2c72e75ddfe3 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 846b5b955e77623d0418724b23076508dba5b211 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 34/48] cross-i686-pc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..4dc17df648b5 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 2eedddedd6418e0d835128101c54ac0e12006192 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 35/48] cross-mips-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..6009e5c79eb2 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From ad15a594b2ea6ae592b1ef980892d5a2bb59e1e5 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 36/48] cross-mips-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..080164df193d 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="hipperson0 <hipperson0@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 46acfb78cf96d4e1912ee8cbd788097858a49645 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 37/48] cross-mipsel-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..f9fd4b8a04ef 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 1679e41050ce9d3c24bc8171f6274717c2ab7d29 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 38/48] cross-mipsel-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..7418a984474b 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 099fb99cc1d464aab6a6045f73b7a8f05175b9a8 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 39/48] cross-powerpc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..31e57b4e52b2 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From f39bdb5f970f2c63e0fdffb4a55fe71fd00bebd1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 40/48] cross-powerpc-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..a2d1edcf1ffd 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From a452be898c864142703f30a8099648342e8cd0d0 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 41/48] cross-powerpc64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..1a4cbed61e76 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 8ece586fd0648ece4866faa6ec273c36281dd979 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 42/48] cross-powerpc64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 1ebd0fb2048d..ade42018af05 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 88c02bd88232b12b60fba4fcff106eff64634f79 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 43/48] cross-powerpc64le-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 733f5851da5c..03054239001e 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 3c5dc3919f35b68ca190ef28529dfa47c93004aa Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 44/48] cross-powerpc64le-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index 76a70aa1d6db..5887f845f932 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From d6c2aa5e5bee38afb12a409e4f3cef3de064aa60 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 45/48] cross-powerpcle-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 347b8fcf4f55..06530e0d609b 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 07fbce91ba61cd3035d4c3e24f22802bf9a62d40 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 46/48] cross-powerpcle-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index ec9324ddaa99..e68c3962b49c 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 4e54a252765a21a28fcefe489240b29ffe10fa39 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 47/48] cross-x86_64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 0078fbe7224b..7da85c14b62d 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From aecf58e59d48043412bad6a251653dd1f34d8c6c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 48/48] cross-x86_64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..2811de0d3c2e 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (67 preceding siblings ...)
  2022-09-03  5:51 ` oreo639
@ 2022-09-03  5:53 ` oreo639
  2022-09-06 18:52 ` oreo639
                   ` (195 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-09-03  5:53 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5538 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.2.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.2.0

This PR depends on: https://github.com/void-linux/void-packages/pull/32330

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

Also, keep in mind that the libgo musl patch here will need to be updated once musl is updated:
https://github.com/void-linux/void-packages/pull/34902/files#diff-1f42a95b93c9550178ff1fbccbef2f47a72711df15c24c9472e2550076978129R163-R176

This is the updated patch for reference:
https://github.com/alpinelinux/aports/blob/8acb21b8ee881e7ab1c812d9a66a17d2501b8730/main/gcc/0049-libgo-adjust-name-of-union-in-sigevent-struct.patch

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/38817
- [x] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [ ] llvm https://github.com/void-linux/void-packages/pull/38694
- [ ] m4 https://github.com/void-linux/void-packages/pull/33730
- [ ] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [x] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [ ] libvirt https://github.com/void-linux/void-packages/pull/38842
- [ ] syslinux https://github.com/void-linux/void-packages/pull/38876
- [ ] efivar https://github.com/void-linux/void-packages/pull/38874

Known packages that needed to be fixed/updated for gcc12:
- [ ] linux5.18 (in this PR)
- [ ] openssh https://github.com/void-linux/void-packages/pull/38849
- [ ] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [ ] doxygen https://github.com/void-linux/void-packages/pull/38846
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/38817
- [x] libproxy https://github.com/void-linux/void-packages/pull/38818
- [x] exempi https://github.com/void-linux/void-packages/pull/38820
- [ ] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [ ] gpgme https://github.com/void-linux/void-packages/pull/38825
- [x] libunique1 https://github.com/void-linux/void-packages/pull/38848 or https://github.com/void-linux/void-packages/pull/38873
- [ ] libwpd https://github.com/void-linux/void-packages/pull/38878

Needs to be fixed/updated for binutils:
- [ ] grub https://github.com/void-linux/void-packages/pull/38875
- [ ] linux-tools https://github.com/void-linux/void-packages/pull/38877

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [x] kde
- [x] lxde
- [x] lxqt

You can test the ISOs here:
https://drive.google.com/drive/folders/1ix92CYSLUP-KWjLxltdgG4e8Nu2JCY5n?usp=sharing

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 163999 bytes --]

From 08bb662e8443edf8fd6ecee3c99af0f85c40f294 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 01/48] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../fix-libcollector-without-java.patch       | 53 +++++++++++++++
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 16 +++--
 4 files changed, 82 insertions(+), 113 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
 create mode 100644 srcpkgs/binutils/patches/fix-libcollector-without-java.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/fix-libcollector-without-java.patch b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
new file mode 100644
index 000000000000..54384875f358
--- /dev/null
+++ b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
@@ -0,0 +1,53 @@
+From 49ddd814ac1071af7c4f45d5f8398b91862f2c7f Mon Sep 17 00:00:00 2001
+From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
+Date: Wed, 17 Aug 2022 19:55:23 -0700
+Subject: [PATCH] gprofng: fix bug 29479 Collection fails when built without
+ java support
+
+gprofng/ChangeLog
+2022-08-17  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>
+
+	PR gprofng/29479
+	* libcollector/collector.c: Add #if defined(GPROFNG_JAVA_PROFILING) for
+	java specific code.
+	* libcollector/unwind.c: Likewise.
+---
+ gprofng/libcollector/collector.c | 2 ++
+ gprofng/libcollector/unwind.c    | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/gprofng/libcollector/collector.c b/gprofng/libcollector/collector.c
+index 93c9d3330de5..ceff2c1caccb 100644
+--- a/gprofng/libcollector/collector.c
++++ b/gprofng/libcollector/collector.c
+@@ -913,8 +913,10 @@ __collector_open_experiment (const char *exp, const char *params, sp_origin_t or
+   __collector_ext_unwind_key_init (1, NULL);
+ 
+   /* start java attach if suitable */
++#if defined(GPROFNG_JAVA_PROFILING)
+   if (exp_origin == SP_ORIGIN_DBX_ATTACH)
+     __collector_jprofile_start_attach ();
++#endif
+   start_sec_time = CALL_UTIL (time)(NULL);
+   __collector_start_time = collector_interface.getHiResTime ();
+   TprintfT (DBG_LT0, "\t__collector_open_experiment; resetting start_time\n");
+diff --git a/gprofng/libcollector/unwind.c b/gprofng/libcollector/unwind.c
+index 119243788020..f8e11823c81e 100644
+--- a/gprofng/libcollector/unwind.c
++++ b/gprofng/libcollector/unwind.c
+@@ -557,6 +557,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+   int size = max_frame_size;
+ 
+ #define MIN(a,b) ((a)<(b)?(a):(b))
++#if defined(GPROFNG_JAVA_PROFILING)
+   /* get Java info */
+   if (__collector_java_mode && __collector_java_asyncgetcalltrace_loaded && context && !pseudo_context)
+     {
+@@ -569,6 +570,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+ 	  size -= sz;
+ 	}
+     }
++#endif
+ 
+   /* get native stack */
+   if (context)
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..0abcfcfe4f9b 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkg-config"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -44,6 +45,12 @@ do_configure() {
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	# gprofng currently only supports x86 and aarch64 glibc.
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64|i386|aarch64) conf+=" --enable-gprofng" ;;
+		*) conf+=" --disable-gprofng" ;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"
@@ -76,6 +83,7 @@ do_configure() {
 		--libdir=/usr/lib \
 		--mandir=/usr/share/man \
 		--infodir=/usr/share/info \
+		--sysconfdir=/etc \
 		--disable-werror \
 		--disable-shared \
 		--disable-nls \

From 989c4804f52c6346cc8c633f2baacea1474846a9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 02/48] gcc: update to 12.2.0.

---
 common/shlibs                                 | 10 +--
 srcpkgs/gcc/files/gccgo-musl.patch            | 74 ++++---------------
 srcpkgs/gcc/files/libgnarl-musl.patch         | 18 ++---
 srcpkgs/gcc/files/libssp-musl.patch           | 10 +--
 srcpkgs/gcc/patches/libffi_gnulinux.patch     | 11 ---
 .../gcc/patches/libgcc-ibm128-no-tag.patch    | 10 ++-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |  2 +-
 srcpkgs/gcc/template                          | 25 +++----
 8 files changed, 52 insertions(+), 108 deletions(-)
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index 5fe37e3d0b62..8b8be0eafe00 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.2.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.34 perl-5.34.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -845,8 +845,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.2.0_1
+libgnat-12.so libada-12.2.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1695,8 +1695,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.2.0_1
+libasan.so.8 libsanitizer-12.2.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..632ef951097b 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,17 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ a/libgo/go/runtime/os_linux.go
+@@ -363,9 +363,9 @@
+ 
+ 	var timerid int32
+ 	var sevp _sigevent
+-	sevp.sigev_notify = _SIGEV_THREAD_ID
++	sevp.sigev_notify = 4
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.sigev_notify_function))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..446741390d45 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,15 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
+version=12.2.0
+revision=1
 _patchver="${version%pre*}"
 _minorver="${_patchver%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 wrksrc=gcc-${version/pre/_pre}
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +19,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -396,7 +393,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}

From 7c84c84ae51af46de1603d74d96b91e8c7fd3865 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 03/48] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      | 11 ++++--
 2 files changed, 25 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..70c4aa533e66 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,12 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
+
+if [ "$XBPS_LIBC" == "musl" ]; then
+# Musl always searches LD_LIBRARY_PATH before RPATH and RUNPATH
+make_build_args="lt_cv_shlibpath_overrides_runpath=yes"
+fi
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From e95b700a481a564026d94675d4daceed3d647ced Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 04/48] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 1a4e1ca3d594..b04268908c2e 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="q66 <daniel@octaforge.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From 1205cc328263eb92ac4190106c1cfd51148720c2 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 05/48] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 3 files changed, 55 insertions(+), 353 deletions(-)
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index 8b8be0eafe00..8b31fec0557c 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From 73e68ae6657cb1a57fbf10ece312bd2a6f5f4fba Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 21:01:43 -0700
Subject: [PATCH 06/48] gcc-multilib: update to 12.2.0.

---
 srcpkgs/gcc-multilib/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index fcd25755aa75..1a26da26a991 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,16 +3,16 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _majorver="${version%.*}"
-wrksrc=gcc-${version/pre/_pre}
+wrksrc=gcc-${version}
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel

From d06e773351c22e5971855316312d7c642956ebb1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 16:22:03 -0700
Subject: [PATCH 07/48] llvm12: fix build for glibc 2.36

---
 .../compiler-rt-sanitizer-glibc-2.36.patch    | 59 +++++++++++++++++++
 1 file changed, 59 insertions(+)
 create mode 100644 srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch

diff --git a/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch b/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch
new file mode 100644
index 000000000000..e5f24dab8935
--- /dev/null
+++ b/srcpkgs/llvm12/patches/compiler-rt-sanitizer-glibc-2.36.patch
@@ -0,0 +1,59 @@
+From 9cf13067cb5088626ba7ee1ec4c42ec59c7995a0 Mon Sep 17 00:00:00 2001
+From: Fangrui Song <i@maskray.me>
+Date: Mon, 11 Jul 2022 12:53:34 -0700
+Subject: [PATCH] [sanitizer] Remove #include <linux/fs.h> to resolve
+ fsconfig_command/mount_attr conflict with glibc 2.36
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+It is generally not a good idea to mix usage of glibc headers and Linux UAPI
+headers (https://sourceware.org/glibc/wiki/Synchronizing_Headers). In glibc
+since 7eae6a91e9b1670330c9f15730082c91c0b1d570 (milestone: 2.36), sys/mount.h
+defines `fsconfig_command` which conflicts with linux/mount.h:
+
+    .../usr/include/linux/mount.h:95:6: error: redeclaration of ‘enum fsconfig_command’
+
+Remove #include <linux/fs.h> which pulls in linux/mount.h. Expand its 4 macros manually.
+Android sys/mount.h doesn't define BLKBSZGET and it still needs linux/fs.h.
+In the long term we should move Linux specific definitions to sanitizer_platform_limits_linux.cpp
+but this commit is easy to cherry pick into older compiler-rt releases.
+
+Fix https://github.com/llvm/llvm-project/issues/56421
+
+Reviewed By: #sanitizers, vitalybuka, zatrazz
+
+Differential Revision: https://reviews.llvm.org/D129471
+---
+ .../sanitizer_platform_limits_posix.cpp                | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+index 4bd425435d56d..3a94b260686f1 100644
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -73,7 +73,9 @@
+ #include <sys/vt.h>
+ #include <linux/cdrom.h>
+ #include <linux/fd.h>
++#if SANITIZER_ANDROID
+ #include <linux/fs.h>
++#endif
+ #include <linux/hdreg.h>
+ #include <linux/input.h>
+ #include <linux/ioctl.h>
+@@ -876,10 +878,10 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
+   unsigned IOCTL_EVIOCGPROP = IOCTL_NOT_PRESENT;
+   unsigned IOCTL_EVIOCSKEYCODE_V2 = IOCTL_NOT_PRESENT;
+ #endif
+-  unsigned IOCTL_FS_IOC_GETFLAGS = FS_IOC_GETFLAGS;
+-  unsigned IOCTL_FS_IOC_GETVERSION = FS_IOC_GETVERSION;
+-  unsigned IOCTL_FS_IOC_SETFLAGS = FS_IOC_SETFLAGS;
+-  unsigned IOCTL_FS_IOC_SETVERSION = FS_IOC_SETVERSION;
++  unsigned IOCTL_FS_IOC_GETFLAGS = _IOR('f', 1, long);
++  unsigned IOCTL_FS_IOC_GETVERSION = _IOR('v', 1, long);
++  unsigned IOCTL_FS_IOC_SETFLAGS = _IOW('f', 2, long);
++  unsigned IOCTL_FS_IOC_SETVERSION = _IOW('v', 2, long);
+   unsigned IOCTL_GIO_CMAP = GIO_CMAP;
+   unsigned IOCTL_GIO_FONT = GIO_FONT;
+   unsigned IOCTL_GIO_UNIMAP = GIO_UNIMAP;

From 2dad60c5a287535e2515b5d249f118def0f1fff0 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 17:21:40 -0700
Subject: [PATCH 08/48] m4: update to 1.4.19.

---
 srcpkgs/m4/patches/fix-glibc-2.27.patch | 167 ------------------------
 srcpkgs/m4/template                     |  12 +-
 2 files changed, 6 insertions(+), 173 deletions(-)
 delete mode 100644 srcpkgs/m4/patches/fix-glibc-2.27.patch

diff --git a/srcpkgs/m4/patches/fix-glibc-2.27.patch b/srcpkgs/m4/patches/fix-glibc-2.27.patch
deleted file mode 100644
index 59d33cff164d..000000000000
--- a/srcpkgs/m4/patches/fix-glibc-2.27.patch
+++ /dev/null
@@ -1,167 +0,0 @@
-From 4af4a4a71827c0bc5e0ec67af23edef4f15cee8e Mon Sep 17 00:00:00 2001
-From: Paul Eggert <eggert@cs.ucla.edu>
-Date: Mon, 5 Mar 2018 10:56:29 -0800
-Subject: [PATCH] fflush: adjust to glibc 2.28 libio.h removal
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Problem reported by Daniel P. Berrangé in:
-https://lists.gnu.org/r/bug-gnulib/2018-03/msg00000.html
-* lib/fbufmode.c (fbufmode):
-* lib/fflush.c (clear_ungetc_buffer_preserving_position)
-(disable_seek_optimization, rpl_fflush):
-* lib/fpending.c (__fpending):
-* lib/fpurge.c (fpurge):
-* lib/freadable.c (freadable):
-* lib/freadahead.c (freadahead):
-* lib/freading.c (freading):
-* lib/freadptr.c (freadptr):
-* lib/freadseek.c (freadptrinc):
-* lib/fseeko.c (fseeko):
-* lib/fseterr.c (fseterr):
-* lib/fwritable.c (fwritable):
-* lib/fwriting.c (fwriting):
-Check _IO_EOF_SEEN instead of _IO_ftrylockfile.
-* lib/stdio-impl.h (_IO_IN_BACKUP) [_IO_EOF_SEEN]:
-Define if not already defined.
-
-[yann.morin.1998@free.fr: partially backport from upstream gnulib]
-Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
-
----
- lib/fflush.c     |  6 +++---
- lib/fpending.c   |  2 +-
- lib/fpurge.c     |  2 +-
- lib/freadahead.c |  2 +-
- lib/freading.c   |  2 +-
- lib/fseeko.c     |  4 ++--
- lib/stdio-impl.h |  6 ++++++
- 7 files changed, 15 insertions(+), 9 deletions(-)
-
-diff --git a/lib/fflush.c b/build-aux/gnulib/lib/fflush.c
-index 983ade0ff..a6edfa105 100644
---- a/lib/fflush.c
-+++ b/lib/fflush.c
-@@ -33,7 +33,7 @@
- #undef fflush
- 
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- 
- /* Clear the stream's ungetc buffer, preserving the value of ftello (fp).  */
- static void
-@@ -72,7 +72,7 @@ clear_ungetc_buffer (FILE *fp)
- 
- #endif
- 
--#if ! (defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
-+#if ! (defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
- 
- # if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT
- /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
-@@ -148,7 +148,7 @@ rpl_fflush (FILE *stream)
-   if (stream == NULL || ! freading (stream))
-     return fflush (stream);
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- 
-   clear_ungetc_buffer_preserving_position (stream);
- 
-diff --git a/lib/fpending.c b/build-aux/gnulib/lib/fpending.c
-index c84e3a5b4..789f50e4e 100644
---- a/lib/fpending.c
-+++ b/lib/fpending.c
-@@ -32,7 +32,7 @@ __fpending (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   return fp->_IO_write_ptr - fp->_IO_write_base;
- #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
-   /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
-diff --git a/lib/fpurge.c b/build-aux/gnulib/lib/fpurge.c
-index b1d417c7a..3aedcc373 100644
---- a/lib/fpurge.c
-+++ b/lib/fpurge.c
-@@ -62,7 +62,7 @@ fpurge (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   fp->_IO_read_end = fp->_IO_read_ptr;
-   fp->_IO_write_ptr = fp->_IO_write_base;
-   /* Avoid memory leak when there is an active ungetc buffer.  */
-diff --git a/lib/freadahead.c b/build-aux/gnulib/lib/freadahead.c
-index c2ecb5b28..23ec76ee5 100644
---- a/lib/freadahead.c
-+++ b/lib/freadahead.c
-@@ -30,7 +30,7 @@ extern size_t __sreadahead (FILE *);
- size_t
- freadahead (FILE *fp)
- {
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   if (fp->_IO_write_ptr > fp->_IO_write_base)
-     return 0;
-   return (fp->_IO_read_end - fp->_IO_read_ptr)
-diff --git a/lib/freading.c b/build-aux/gnulib/lib/freading.c
-index 73c28acdd..c24d0c88a 100644
---- a/lib/freading.c
-+++ b/lib/freading.c
-@@ -31,7 +31,7 @@ freading (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   return ((fp->_flags & _IO_NO_WRITES) != 0
-           || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0
-               && fp->_IO_read_base != NULL));
-diff --git a/lib/fseeko.c b/build-aux/gnulib/lib/fseeko.c
-index 0101ab55f..193f4e8ce 100644
---- a/lib/fseeko.c
-+++ b/lib/fseeko.c
-@@ -47,7 +47,7 @@ fseeko (FILE *fp, off_t offset, int whence)
- #endif
- 
-   /* These tests are based on fpurge.c.  */
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   if (fp->_IO_read_end == fp->_IO_read_ptr
-       && fp->_IO_write_ptr == fp->_IO_write_base
-       && fp->_IO_save_base == NULL)
-@@ -123,7 +123,7 @@ fseeko (FILE *fp, off_t offset, int whence)
-           return -1;
-         }
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-       fp->_flags &= ~_IO_EOF_SEEN;
-       fp->_offset = pos;
- #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
-diff --git a/lib/stdio-impl.h b/build-aux/gnulib/lib/stdio-impl.h
-index 78d896e9f..05c5752a2 100644
---- a/lib/stdio-impl.h
-+++ b/lib/stdio-impl.h
-@@ -18,6 +18,12 @@
-    the same implementation of stdio extension API, except that some fields
-    have different naming conventions, or their access requires some casts.  */
- 
-+/* Glibc 2.28 made _IO_IN_BACKUP private.  For now, work around this
-+   problem by defining it ourselves.  FIXME: Do not rely on glibc
-+   internals.  */
-+#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN
-+# define _IO_IN_BACKUP 0x100
-+#endif
- 
- /* BSD stdio derived implementations.  */
- 
--- 
-2.14.1
-
-
diff --git a/srcpkgs/m4/template b/srcpkgs/m4/template
index 78f3dae6184a..762593d883bd 100644
--- a/srcpkgs/m4/template
+++ b/srcpkgs/m4/template
@@ -1,17 +1,17 @@
 # Template file for 'm4'
 pkgname=m4
-version=1.4.18
-revision=2
+version=1.4.19
+revision=1
 bootstrap=yes
-replaces="chroot-m4>=0"
 build_style=gnu-configure
 configure_args="--enable-changeword --enable-threads"
 short_desc="GNU version of UNIX m4 macro language processor"
-homepage="https://www.gnu.org/software/m4/"
-license="GPL-3.0-or-later"
 maintainer="Enno Boland <gottox@voidlinux.org>"
+license="GPL-3.0-or-later"
+homepage="https://www.gnu.org/software/m4/"
 distfiles="${GNU_SITE}/${pkgname}/${pkgname}-${version}.tar.xz"
-checksum=f2c1e86ca0a404ff281631bdc8377638992744b175afb806e25871a24a934e07
+checksum=63aede5c6d33b6d9b13511cd0be2cac046f2e70fd0a07aa9573a04a82783af96
+replaces="chroot-m4>=0"
 
 if [ "$XBPS_TARGET_LIBC" = musl ]; then
 	export ac_cv_lib_error_at_line=no

From 94ec2d87dba1fccdc5b57344692151911668eb47 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 22:57:59 -0700
Subject: [PATCH 09/48] btrfs-progs: update to 5.19.

---
 srcpkgs/btrfs-progs/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/btrfs-progs/template b/srcpkgs/btrfs-progs/template
index f6c53d8587e1..292d5110106b 100644
--- a/srcpkgs/btrfs-progs/template
+++ b/srcpkgs/btrfs-progs/template
@@ -1,6 +1,6 @@
 # Template file for 'btrfs-progs'
 pkgname=btrfs-progs
-version=5.18.1
+version=5.19
 revision=1
 wrksrc="${pkgname}-v${version}"
 build_style=gnu-configure
@@ -16,7 +16,7 @@ license="GPL-2.0-only, LGPL-2.1-or-later"
 homepage="https://btrfs.wiki.kernel.org/index.php/Main_Page"
 changelog="https://raw.githubusercontent.com/kdave/btrfs-progs/master/CHANGES"
 distfiles="${KERNEL_SITE}/kernel/people/kdave/${pkgname}/${pkgname}-v${version}.tar.xz"
-checksum=6e98a75ccff52e9354daa1ad284c614c490f844273a2fa524cbac9eb841c7255
+checksum=1fbcf06e4b2f80e7a127fd687ed4625a5b74fa674fe212c836ff70e0edfcccf9
 # Most of the tests depend on `mount` and `fallocate` commands, which are not
 # presented in chroot-util-linux
 make_check=no

From 6b6a50a4c7976a14b07d0758bc2fce7515340bb1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 19:39:23 -0700
Subject: [PATCH 10/48] syslinux: fix build for glibc 2.36

---
 .../patches/fix-build-with-glibc-2.36.patch   | 30 +++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 srcpkgs/syslinux/patches/fix-build-with-glibc-2.36.patch

diff --git a/srcpkgs/syslinux/patches/fix-build-with-glibc-2.36.patch b/srcpkgs/syslinux/patches/fix-build-with-glibc-2.36.patch
new file mode 100644
index 000000000000..1303be56c127
--- /dev/null
+++ b/srcpkgs/syslinux/patches/fix-build-with-glibc-2.36.patch
@@ -0,0 +1,30 @@
+--- a/linux/syslinux.c
++++ b/linux/syslinux.c
+@@ -45,7 +45,6 @@
+ #include <sys/stat.h>
+ #include <sys/types.h>
+ #include <sys/wait.h>
+-#include <sys/mount.h>
+ 
+ #include "linuxioctl.h"
+ 
+--- a/libinstaller/syslxcom.c
++++ b/libinstaller/syslxcom.c
+@@ -28,7 +28,6 @@
+ #include <errno.h>
+ #include <sys/stat.h>
+ #include <sys/types.h>
+-#include <sys/mount.h>
+ #include <sys/vfs.h>
+ 
+ #include "linuxioctl.h"
+--- a/extlinux/main.c
++++ b/extlinux/main.c
+@@ -40,7 +40,6 @@
+ #include <sys/stat.h>
+ #include <sys/sysmacros.h>
+ #include <sys/types.h>
+-#include <sys/mount.h>
+ #include <sys/vfs.h>
+ 
+ #include "linuxioctl.h"

From a481768c45b912e8b2d3555863b3c3864296be95 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 14 Aug 2022 19:29:36 -0700
Subject: [PATCH 11/48] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove -no-pie from build. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..fcc00b3a6c5d 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -53,6 +53,7 @@ _void_cross_build_binutils() {
 		--sbindir=/usr/bin \
 		--libdir=/usr/lib \
 		--libexecdir=/usr/lib \
+		--sysconfdir=/etc \
 		--target=${tgt} \
 		--with-sysroot=/usr/${tgt} \
 		--disable-nls \
@@ -60,6 +61,7 @@ _void_cross_build_binutils() {
 		--disable-multilib \
 		--disable-werror \
 		--disable-gold \
+		--disable-gprofng \
 		--enable-relro \
 		--enable-plugins \
 		--enable-64-bit-bfd \
@@ -132,6 +134,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -460,6 +463,14 @@ do_build() {
 	local binutils_ver linux_ver gcc_ver libc_ver libucontext_ver
 	local tgt=${sourcepkg/cross-}
 
+	export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}"
+	export CXXFLAGS="${CXXFLAGS/-D_FORTIFY_SOURCE=2/}"
+
+	# Disable explicit -fno-PIE, gcc/binutils/libc will figure this out itself.
+	export CFLAGS="${CFLAGS//-fno-PIE/}"
+	export CXXFLAGS="${CXXFLAGS//-fno-PIE/}"
+	export LDFLAGS="${LDFLAGS//-no-pie/}"
+
 	_void_cross_test_ver binutils
 	_void_cross_test_ver linux
 	_void_cross_test_ver gcc
@@ -625,6 +636,9 @@ do_install() {
 	# then remove it because it conflicts with libquadmath package
 	rm -rf ${DESTDIR}/${sysroot}/usr/lib/libquadmath.*
 
+	# Remove libdep linker plugin because it conflicts with system binutils
+	rm -f ${DESTDIR}/usr/lib/bfd-plugins/libdep*
+
 	# Remove leftover symlinks
 	rm -f ${DESTDIR}/usr/lib${XBPS_TARGET_WORDSIZE}
 	rm -f ${DESTDIR}/lib*

From 865efdf21c706e1cd0116654bd6c1c6dd2f384f3 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:08:52 -0700
Subject: [PATCH 12/48] openssh: suppress werror on gcc12

---
 srcpkgs/openssh/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/openssh/template b/srcpkgs/openssh/template
index 02a2dec35f42..6e8e343a9dca 100644
--- a/srcpkgs/openssh/template
+++ b/srcpkgs/openssh/template
@@ -40,7 +40,7 @@ if [ "$build_option_ldns" -a -z "$build_option_ssl" ]; then
 	broken="option 'ldns' requires option 'ssl'"
 fi
 
-CFLAGS="-Wno-format-truncation -Wno-stringop-truncation"
+CFLAGS="-Wno-format-truncation -Wno-stringop-truncation -Wno-error=maybe-uninitialized"
 
 case $XBPS_TARGET_MACHINE in
 	i686-musl)

From f626b148807c3dd6f2cbe77b9e886f4b0cd99816 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:09:31 -0700
Subject: [PATCH 13/48] linux5.18: update dotconfigs for gcc12

---
 srcpkgs/linux5.18/files/x86_64-dotconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/linux5.18/files/x86_64-dotconfig b/srcpkgs/linux5.18/files/x86_64-dotconfig
index 4e73a3195d40..ea6204868e23 100644
--- a/srcpkgs/linux5.18/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.18/files/x86_64-dotconfig
@@ -512,6 +512,7 @@ CONFIG_RETHUNK=y
 CONFIG_CPU_UNRET_ENTRY=y
 CONFIG_CPU_IBPB_ENTRY=y
 CONFIG_CPU_IBRS_ENTRY=y
+CONFIG_SLS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10060,8 +10061,11 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
 # Memory initialization
 #
 CONFIG_INIT_STACK_NONE=y
+# CONFIG_INIT_STACK_ALL_PATTERN is not set
+# CONFIG_INIT_STACK_ALL_ZERO is not set
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
+# CONFIG_ZERO_CALL_USED_REGS is not set
 # end of Memory initialization
 # end of Kernel hardening options
 # end of Security options
@@ -10538,6 +10542,7 @@ CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
 # CONFIG_UBSAN is not set
 CONFIG_HAVE_ARCH_KCSAN=y
+# CONFIG_KCSAN is not set
 # end of Generic Kernel Debugging Instruments
 
 #

From b7b2467312265746d08ef7a5ce07bf23e54d8717 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 18:00:42 -0700
Subject: [PATCH 14/48] xf86-video-vmware: fix build on gcc12

---
 ...183b3395333d5d4c73e25c2d011748f15eda.patch | 30 +++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch

diff --git a/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch b/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch
new file mode 100644
index 000000000000..ff839f16e628
--- /dev/null
+++ b/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch
@@ -0,0 +1,30 @@
+From 77b8183b3395333d5d4c73e25c2d011748f15eda Mon Sep 17 00:00:00 2001
+From: Rudi Heitbaum <rudi@heitbaum.com>
+Date: Sun, 8 May 2022 03:00:10 +0000
+Subject: [PATCH] vmwgfx: fix missing array notation
+
+ Fixes error identified by gcc-12.1.0 compiler
+
+make
+  CC       libvmwgfx_la-vmwgfx_tex_video.lo
+vmwgfx_tex_video.c: In function 'stop_video':
+vmwgfx_tex_video.c:240:20: error: the comparison will always evaluate as 'true' for the address of 'yuv' will never be NULL [-Werror=address]
+  240 |                if (priv->yuv[i]) {
+      |                    ^~~~
+---
+ vmwgfx/vmwgfx_tex_video.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/vmwgfx/vmwgfx_tex_video.c b/vmwgfx/vmwgfx_tex_video.c
+index acc2b56..480a5f1 100644
+--- a/vmwgfx/vmwgfx_tex_video.c
++++ b/vmwgfx/vmwgfx_tex_video.c
+@@ -237,7 +237,7 @@ stop_video(ScrnInfoPtr pScrn, pointer data, Bool shutdown)
+ 
+        for (i=0; i<3; ++i) {
+ 	   for (j=0; j<2; ++j) {
+-	       if (priv->yuv[i]) {
++	       if (priv->yuv[j][i]) {
+ 		   xa_surface_destroy(priv->yuv[j][i]);
+ 		   priv->yuv[j][i] = NULL;
+ 	       }

From 34ebdde40868f3035f47fa16aea601868cc76f88 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 18:24:37 -0700
Subject: [PATCH 15/48] doxygen: fix build for gcc 12

---
 srcpkgs/doxygen/patches/compat-gcc12.patch | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100644 srcpkgs/doxygen/patches/compat-gcc12.patch

diff --git a/srcpkgs/doxygen/patches/compat-gcc12.patch b/srcpkgs/doxygen/patches/compat-gcc12.patch
new file mode 100644
index 000000000000..666744a1dceb
--- /dev/null
+++ b/srcpkgs/doxygen/patches/compat-gcc12.patch
@@ -0,0 +1,22 @@
+From 5198966c8d5fec89116d025c74934ac03ea511fa Mon Sep 17 00:00:00 2001
+From: Dimitri van Heesch <doxygen@gmail.com>
+Date: Fri, 6 May 2022 09:55:16 +0200
+Subject: [PATCH] issue #9312: Build: cache.h:53:14: error: 'exchange' is not a
+ member of 'std'
+
+---
+ src/cache.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/cache.h b/src/cache.h
+index 0ff3092ed5..e218eb27d2 100644
+--- a/src/cache.h
++++ b/src/cache.h
+@@ -19,6 +19,7 @@
+ #include <list>
+ #include <unordered_map>
+ #include <mutex>
++#include <utility>
+ #include <ctype.h>
+ 
+ /*! Fixed size cache for value type V using keys of type K.

From d0ae187c5a61e53a0bcadd23b824ec4ddde8f69c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 21 Aug 2022 21:37:00 -0700
Subject: [PATCH 16/48] openjdk7-bootstrap: fix build for gcc12

---
 .../files/dist_patches_glibc.txt              |  1 +
 .../files/dist_patches_musl.txt               |  1 +
 .../icedtea-pointer-comparison-gcc12.patch    | 31 +++++++++++++++++++
 3 files changed, 33 insertions(+)
 create mode 100644 srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch

diff --git a/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt b/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt
index c76c56855441..8061756dfc0c 100644
--- a/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt
+++ b/srcpkgs/openjdk7-bootstrap/files/dist_patches_glibc.txt
@@ -6,3 +6,4 @@ icedtea-jdk-no-soname.patch
 icedtea-jdk-xattr.patch
 icedtea-jdk-sysctl_h.patch
 icedtea-cpio.patch
+icedtea-pointer-comparison-gcc12.patch
diff --git a/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt b/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt
index 21812517c7c2..8b35d9c46989 100644
--- a/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt
+++ b/srcpkgs/openjdk7-bootstrap/files/dist_patches_musl.txt
@@ -11,3 +11,4 @@ icedtea-jdk-musl.patch
 icedtea-jdk-no-soname.patch
 icedtea-jdk-xattr.patch
 icedtea-cpio.patch
+icedtea-pointer-comparison-gcc12.patch
diff --git a/srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch b/srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch
new file mode 100644
index 000000000000..c809553443e7
--- /dev/null
+++ b/srcpkgs/openjdk7-bootstrap/files/icedtea-pointer-comparison-gcc12.patch
@@ -0,0 +1,31 @@
+--- openjdk.orig/hotspot/src/share/vm/opto/lcm.cpp
++++ openjdk/hotspot/src/share/vm/opto/lcm.cpp
+@@ -60,7 +60,7 @@
+ // Check whether val is not-null-decoded compressed oop,
+ // i.e. will grab into the base of the heap if it represents NULL.
+ static bool accesses_heap_base_zone(Node *val) {
+-  if (Universe::narrow_oop_base() > 0) { // Implies UseCompressedOops.
++  if (Universe::narrow_oop_base() > (address)0) { // Implies UseCompressedOops.
+     if (val && val->is_Mach()) {
+       if (val->as_Mach()->ideal_Opcode() == Op_DecodeN) {
+         // This assumes all Decodes with TypePtr::NotNull are matched to nodes that
+--- openjdk.orig/hotspot/src/share/vm/runtime/virtualspace.cpp
++++ openjdk/hotspot/src/share/vm/runtime/virtualspace.cpp
+@@ -527,7 +527,7 @@ ReservedHeapSpace::ReservedHeapSpace(siz
+                 (UseCompressedOops && (Universe::narrow_oop_base() != NULL) &&
+                  Universe::narrow_oop_use_implicit_null_checks()) ?
+                   lcm(os::vm_page_size(), alignment) : 0) {
+-  if (base() > 0) {
++  if (base() > (char*)0) {
+     MemTracker::record_virtual_memory_type((address)base(), mtJavaHeap);
+   }
+ 
+@@ -546,7 +546,7 @@ ReservedHeapSpace::ReservedHeapSpace(con
+                 (UseCompressedOops && (Universe::narrow_oop_base() != NULL) &&
+                  Universe::narrow_oop_use_implicit_null_checks()) ?
+                   lcm(os::vm_page_size(), prefix_align) : 0) {
+-  if (base() > 0) {
++  if (base() > (char*)0) {
+     MemTracker::record_virtual_memory_type((address)base(), mtJavaHeap);
+   }
+ 

From 18312b15352b0c2c3b8709a9104927908e56d2a2 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:39:52 -0700
Subject: [PATCH 17/48] libvirt: fix build for glibc 2.36

---
 .../patches/lxc-fix-compat-glibc-2.36.patch   | 34 ++++++++++++++++
 .../virfile-fix-compat-glibc-2.36.patch       | 39 +++++++++++++++++++
 2 files changed, 73 insertions(+)
 create mode 100644 srcpkgs/libvirt/patches/lxc-fix-compat-glibc-2.36.patch
 create mode 100644 srcpkgs/libvirt/patches/virfile-fix-compat-glibc-2.36.patch

diff --git a/srcpkgs/libvirt/patches/lxc-fix-compat-glibc-2.36.patch b/srcpkgs/libvirt/patches/lxc-fix-compat-glibc-2.36.patch
new file mode 100644
index 000000000000..d85b57815010
--- /dev/null
+++ b/srcpkgs/libvirt/patches/lxc-fix-compat-glibc-2.36.patch
@@ -0,0 +1,34 @@
+From 9493c9b79dc541ec9e0fd73c6d87bdf8d30aaa90 Mon Sep 17 00:00:00 2001
+From: Cole Robinson <crobinso@redhat.com>
+Date: Mon, 1 Aug 2022 15:20:38 -0400
+Subject: [PATCH] lxc: containter: fix build with glibc 2.36
+
+With glibc 2.36, sys/mount.h and linux/mount.h conflict:
+https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
+
+lxc_container.c imports sys/mount.h and linux/fs.h, which pulls in
+linux/mount.h.
+
+linux/fs.h isn't required here though. glibc sys/mount.h has had
+MS_MOVE since 2.12 in 2010
+
+Reviewed-by: Erik Skultety <eskultet@redhat.com>
+Signed-off-by: Cole Robinson <crobinso@redhat.com>
+---
+ src/lxc/lxc_container.c | 3 ---
+ 1 file changed, 3 deletions(-)
+
+diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
+index b5278831da7..a5401c2186e 100644
+--- a/src/lxc/lxc_container.c
++++ b/src/lxc/lxc_container.c
+@@ -33,9 +33,6 @@
+ /* Yes, we want linux private one, for _syscall2() macro */
+ #include <linux/unistd.h>
+ 
+-/* For MS_MOVE */
+-#include <linux/fs.h>
+-
+ #if WITH_CAPNG
+ # include <cap-ng.h>
+ #endif
diff --git a/srcpkgs/libvirt/patches/virfile-fix-compat-glibc-2.36.patch b/srcpkgs/libvirt/patches/virfile-fix-compat-glibc-2.36.patch
new file mode 100644
index 000000000000..2ef227ea9b54
--- /dev/null
+++ b/srcpkgs/libvirt/patches/virfile-fix-compat-glibc-2.36.patch
@@ -0,0 +1,39 @@
+From c0d9adf220dc0d223330a7bac37b174132d330ba Mon Sep 17 00:00:00 2001
+From: Cole Robinson <crobinso@redhat.com>
+Date: Mon, 1 Aug 2022 15:24:01 -0400
+Subject: [PATCH] virfile: Fix build with glibc 2.36
+
+With glibc 2.36, sys/mount.h and linux/mount.h conflict:
+https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
+
+virfile.c imports sys/mount.h and linux/fs.h, which pulls in
+linux/mount.h.
+
+Manually define the constants we need from linux/fs.h, like was
+done in llvm:
+
+https://reviews.llvm.org/rGb379129c4beb3f26223288627a1291739f33af02
+
+Reviewed-by: Erik Skultety <eskultet@redhat.com>
+Signed-off-by: Cole Robinson <crobinso@redhat.com>
+---
+ src/util/virfile.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/src/util/virfile.c b/src/util/virfile.c
+index 99da058db3b..ce541b8946b 100644
+--- a/src/util/virfile.c
++++ b/src/util/virfile.c
+@@ -71,7 +71,11 @@
+ # endif
+ # include <sys/ioctl.h>
+ # include <linux/cdrom.h>
+-# include <linux/fs.h>
++/* These come from linux/fs.h, but that header conflicts with
++ * sys/mount.h on glibc 2.36+ */
++# define FS_IOC_GETFLAGS _IOR('f', 1, long)
++# define FS_IOC_SETFLAGS _IOW('f', 2, long)
++# define FS_NOCOW_FL 0x00800000
+ #endif
+ 
+ #if WITH_LIBATTR

From 81d431c3f3b5cd4ec5b1d443f594b46e01160926 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:41:50 -0700
Subject: [PATCH 18/48] efivar: fix build for glibc 2.36

---
 .../patches/fix-compat-glibc-2.36.patch       | 55 +++++++++++++++++++
 1 file changed, 55 insertions(+)
 create mode 100644 srcpkgs/efivar/patches/fix-compat-glibc-2.36.patch

diff --git a/srcpkgs/efivar/patches/fix-compat-glibc-2.36.patch b/srcpkgs/efivar/patches/fix-compat-glibc-2.36.patch
new file mode 100644
index 000000000000..fcc83aef20cf
--- /dev/null
+++ b/srcpkgs/efivar/patches/fix-compat-glibc-2.36.patch
@@ -0,0 +1,55 @@
+From bc65d63ebf8fe6ac8a099ff15ca200986dba1565 Mon Sep 17 00:00:00 2001
+From: Robbie Harwood <rharwood@redhat.com>
+Date: Thu, 28 Jul 2022 16:11:24 -0400
+Subject: [PATCH] Fix glibc 2.36 build (mount.h conflicts)
+
+glibc has decided that sys/mount.h and linux/mount.h are no longer
+usable at the same time.  This broke the build, since linux/fs.h itself
+includes linux/mount.h.  For now, fix the build by only including
+sys/mount.h where we need it.
+
+See-also: https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
+Resolves: #227
+Signed-off-by: Robbie Harwood <rharwood@redhat.com>
+---
+ src/gpt.c   | 1 +
+ src/linux.c | 1 +
+ src/util.h  | 1 -
+ 3 files changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/gpt.c b/src/gpt.c
+index 1eda0497..21413c3b 100644
+--- a/src/gpt.c
++++ b/src/gpt.c
+@@ -17,6 +17,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <sys/mount.h>
+ #include <sys/param.h>
+ #include <sys/stat.h>
+ #include <sys/utsname.h>
+diff --git a/src/linux.c b/src/linux.c
+index 47e45ae4..1780816f 100644
+--- a/src/linux.c
++++ b/src/linux.c
+@@ -20,6 +20,7 @@
+ #include <stdbool.h>
+ #include <stdio.h>
+ #include <sys/ioctl.h>
++#include <sys/mount.h>
+ #include <sys/socket.h>
+ #include <sys/sysmacros.h>
+ #include <sys/types.h>
+diff --git a/src/util.h b/src/util.h
+index 3300666f..1e67e447 100644
+--- a/src/util.h
++++ b/src/util.h
+@@ -23,7 +23,6 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <sys/ioctl.h>
+-#include <sys/mount.h>
+ #include <sys/stat.h>
+ #include <sys/types.h>
+ #include <tgmath.h>

From 152fb56aac07b3863de0ffe8ea8c9244d47926bd Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:43:24 -0700
Subject: [PATCH 19/48] libwpd: fix build for gcc12

---
 srcpkgs/libwpd/patches/fix-compat-gcc12.patch | 11 +++++++++++
 1 file changed, 11 insertions(+)
 create mode 100644 srcpkgs/libwpd/patches/fix-compat-gcc12.patch

diff --git a/srcpkgs/libwpd/patches/fix-compat-gcc12.patch b/srcpkgs/libwpd/patches/fix-compat-gcc12.patch
new file mode 100644
index 000000000000..6ebce2463d16
--- /dev/null
+++ b/srcpkgs/libwpd/patches/fix-compat-gcc12.patch
@@ -0,0 +1,11 @@
+diff -rup libwpd-0.10.3.orig/src/lib/WPXTable.h libwpd-0.10.3/src/lib/WPXTable.h
+--- libwpd-0.10.3.orig/src/lib/WPXTable.h	2022-08-23 22:32:45.332593795 -0700
++++ libwpd-0.10.3/src/lib/WPXTable.h	2022-08-23 22:32:59.500651211 -0700
+@@ -37,6 +37,7 @@
+ #define _WPXTABLE_H
+ 
+ #include <vector>
++#include <cstddef>
+ 
+ struct WPXTableCell
+ {

From e31ff4f6f01e9e4c218976f86609b3592aaeaf16 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:44:07 -0700
Subject: [PATCH 20/48] grub: fix build for binutils 2.36

---
 .../patches/fix-compat-binutils-2.36.patch    | 96 +++++++++++++++++++
 srcpkgs/grub/template                         |  7 +-
 2 files changed, 102 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/grub/patches/fix-compat-binutils-2.36.patch

diff --git a/srcpkgs/grub/patches/fix-compat-binutils-2.36.patch b/srcpkgs/grub/patches/fix-compat-binutils-2.36.patch
new file mode 100644
index 000000000000..d92a91e3253e
--- /dev/null
+++ b/srcpkgs/grub/patches/fix-compat-binutils-2.36.patch
@@ -0,0 +1,96 @@
+From b98275138bf4fc250a1c362dfd2c8b1cf2421701 Mon Sep 17 00:00:00 2001
+From: Michael Chang <mchang@suse.com>
+Date: Tue, 28 Sep 2021 13:50:47 +0800
+Subject: build: Fix build error with binutils 2.36
+
+The following procedure to build xen/pvgrub is broken.
+
+  git clone https://git.savannah.gnu.org/git/grub.git
+  cd grub
+  ./bootstrap
+  mkdir build-xen
+  cd build-xen
+  ../configure --with-platform=xen
+  make
+
+It fails with the message:
+
+  /usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld:
+  section .note.gnu.property VMA [0000000000400158,0000000000400187]
+  overlaps section .bss VMA [000000000000f000,000000000041e1af]
+
+The most significant factor is that new assembler (GNU as) generates the
+.note.gnu.property section as default. This note section overlaps with
+.bss because it doesn't reposition with -Wl,-Ttext,0 with which the base
+address of .text section is set, rather the address of .note.gnu.property
+is calculated for some reason from 0x400000 where the ELF executable
+defaults to start.
+
+Using -Ttext-segment doesn't help either, though it is said to set the
+address of the first byte of the text segment according to "man ld".
+What it actually does is to override the default 0x400000, aka the image
+base address, to something else. The entire process can be observed in
+the default linker script used by gcc [1]. Therefore we can't expect it
+to achieve the same thing as -Ttext given that the first segment where
+.text resides is offset by SIZEOF_HEADERS plus some sections may be
+preceding it within the first segment. The end result is .text always
+has to start with non-zero address with -Wl,-Ttext-segment,0 if using
+default linker script.
+
+It is also worth mentioning that binutils upstream apparently doesn't
+seem to consider this as a bug [2] and proposed to use -Wl,-Ttext-segment,0
+which is not fruitful as what has been tested by Gentoo [3].
+
+As long as GRUB didn't use ISA information encoded in .note.gnu.property,
+we can safely drop it via -Wa,-mx86-used-note=no assembler option to
+fix the linker error above.
+
+This is considered a better approach than using custom linker script to
+drop the .note.gnu.property section because object file manipulation can
+also be hampered one way or the other in that linker script may not be
+helpful. See also this commit removing the section in the process of objcopy.
+
+  6643507ce build: Fix GRUB i386-pc build with Ubuntu gcc
+
+[1] In /usr/lib64/ldscripts/elf_x86_64.x or use 'gcc -Wl,--verbose ...'
+    PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x400000));
+    . = SEGMENT_START("text-segment", 0x400000) + SIZEOF_HEADERS;
+[2] https://sourceware.org/bugzilla/show_bug.cgi?id=27377
+[3] https://bugs.gentoo.org/787221
+
+Signed-off-by: Michael Chang <mchang@suse.com>
+Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
+---
+ configure.ac | 14 ++++++++++++++
+ 1 file changed, 14 insertions(+)
+
+(limited to 'configure.ac')
+
+diff --git a/configure.ac b/configure.ac
+index eeb5d22..8d1c81a 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -840,6 +840,20 @@ if ( test "x$target_cpu" = xi386 || test "x$target_cpu" = xx86_64 ) && test "x$p
+   TARGET_CFLAGS="$TARGET_CFLAGS -mno-mmx -mno-sse -mno-sse2 -mno-sse3 -mno-3dnow"
+ fi
+ 
++if ( test "x$target_cpu" = xi386 || test "x$target_cpu" = xx86_64 ); then
++  AC_CACHE_CHECK([whether -Wa,-mx86-used-note works], [grub_cv_cc_mx86_used_note], [
++    CFLAGS="$TARGET_CFLAGS -Wa,-mx86-used-note=no -Werror"
++    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
++	[grub_cv_cc_mx86_used_note=yes],
++	[grub_cv_cc_mx86_used_note=no])
++  ])
++
++  if test "x$grub_cv_cc_mx86_used_note" = xyes; then
++    TARGET_CFLAGS="$TARGET_CFLAGS -Wa,-mx86-used-note=no"
++    TARGET_CCASFLAGS="$TARGET_CCASFLAGS -Wa,-mx86-used-note=no"
++  fi
++fi
++
+ # GRUB doesn't use float or doubles at all. Yet some toolchains may decide
+ # that floats are a good fit to run instead of what's written in the code.
+ # Given that floating point unit is disabled (if present to begin with)
+-- 
+cgit v1.1
+
diff --git a/srcpkgs/grub/template b/srcpkgs/grub/template
index b1826c38a884..b4d3b07af620 100644
--- a/srcpkgs/grub/template
+++ b/srcpkgs/grub/template
@@ -2,7 +2,8 @@
 pkgname=grub
 version=2.06
 revision=2
-hostmakedepends="python3 pkg-config flex freetype-devel font-unifont-bdf help2man"
+hostmakedepends="python3 pkg-config flex freetype-devel font-unifont-bdf help2man
+ automake gettext-devel-tools"
 makedepends="libusb-compat-devel ncurses-devel freetype-devel
  liblzma-devel device-mapper-devel fuse-devel"
 depends="os-prober"
@@ -43,6 +44,10 @@ case "$XBPS_TARGET_MACHINE" in
 		;;
 esac
 
+pre_configure() {
+	autoreconf -fi
+}
+
 do_configure() {
 	# workaround for https://savannah.gnu.org/bugs/?60458
 	# some more info: https://www.linuxquestions.org/questions/showthread.php?p=6257712

From e2ef2878f7fcff709d73792dd7a59b8e557e9794 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:45:07 -0700
Subject: [PATCH 21/48] linux-toos: fix build for binutils 2.39

---
 .../patches/binutils-add-compat-check.patch   | 103 ++++++++++++
 .../patches/binutils-disasm-compat.patch      | 102 ++++++++++++
 .../bpf_jit_disasm-binutils-2.39.patch        | 104 ++++++++++++
 .../patches/bpftool-binutils-2.39.patch       | 149 ++++++++++++++++++
 .../patches/perf-binutils-2.39.patch          | 114 ++++++++++++++
 5 files changed, 572 insertions(+)
 create mode 100644 srcpkgs/linux-tools/patches/binutils-add-compat-check.patch
 create mode 100644 srcpkgs/linux-tools/patches/binutils-disasm-compat.patch
 create mode 100644 srcpkgs/linux-tools/patches/bpf_jit_disasm-binutils-2.39.patch
 create mode 100644 srcpkgs/linux-tools/patches/bpftool-binutils-2.39.patch
 create mode 100644 srcpkgs/linux-tools/patches/perf-binutils-2.39.patch

diff --git a/srcpkgs/linux-tools/patches/binutils-add-compat-check.patch b/srcpkgs/linux-tools/patches/binutils-add-compat-check.patch
new file mode 100644
index 000000000000..e4e7ece9635e
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/binutils-add-compat-check.patch
@@ -0,0 +1,103 @@
+From cfd59ca91467056bb2c36907b2fa67b8e1af9952 Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:27 -0700
+Subject: [PATCH] tools build: Add feature test for init_disassemble_info API
+ changes
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation failures for tools/{perf,bpf}, e.g. on debian unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+This commit adds a feature test to detect the new signature.  Subsequent
+commits will use it to fix the build failures.
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Quentin Monnet <quentin@isovalent.com>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-2-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/build/Makefile.feature                        |  1 +
+ tools/build/feature/Makefile                        |  4 ++++
+ tools/build/feature/test-all.c                      |  4 ++++
+ tools/build/feature/test-disassembler-init-styled.c | 13 +++++++++++++
+ 4 files changed, 22 insertions(+)
+ create mode 100644 tools/build/feature/test-disassembler-init-styled.c
+
+diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature
+index 888a0421d43b96..8f6578e4d3249e 100644
+--- a/tools/build/Makefile.feature
++++ b/tools/build/Makefile.feature
+@@ -70,6 +70,7 @@ FEATURE_TESTS_BASIC :=                  \
+         libaio				\
+         libzstd				\
+         disassembler-four-args		\
++        disassembler-init-styled	\
+         file-handle
+ 
+ # FEATURE_TESTS_BASIC + FEATURE_TESTS_EXTRA is the complete list
+diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile
+index 7c2a17e23c30ac..c3059739318a95 100644
+--- a/tools/build/feature/Makefile
++++ b/tools/build/feature/Makefile
+@@ -18,6 +18,7 @@ FILES=                                          \
+          test-libbfd.bin                        \
+          test-libbfd-buildid.bin		\
+          test-disassembler-four-args.bin        \
++         test-disassembler-init-styled.bin	\
+          test-reallocarray.bin			\
+          test-libbfd-liberty.bin                \
+          test-libbfd-liberty-z.bin              \
+@@ -248,6 +249,9 @@ $(OUTPUT)test-libbfd-buildid.bin:
+ $(OUTPUT)test-disassembler-four-args.bin:
+ 	$(BUILD) -DPACKAGE='"perf"' -lbfd -lopcodes
+ 
++$(OUTPUT)test-disassembler-init-styled.bin:
++	$(BUILD) -DPACKAGE='"perf"' -lbfd -lopcodes
++
+ $(OUTPUT)test-reallocarray.bin:
+ 	$(BUILD)
+ 
+diff --git a/tools/build/feature/test-all.c b/tools/build/feature/test-all.c
+index 5ffafb967b6e49..957c02c7b163b5 100644
+--- a/tools/build/feature/test-all.c
++++ b/tools/build/feature/test-all.c
+@@ -166,6 +166,10 @@
+ # include "test-disassembler-four-args.c"
+ #undef main
+ 
++#define main main_test_disassembler_init_styled
++# include "test-disassembler-init-styled.c"
++#undef main
++
+ #define main main_test_libzstd
+ # include "test-libzstd.c"
+ #undef main
+diff --git a/tools/build/feature/test-disassembler-init-styled.c b/tools/build/feature/test-disassembler-init-styled.c
+new file mode 100644
+index 00000000000000..f1ce0ec3bee9d3
+--- /dev/null
++++ b/tools/build/feature/test-disassembler-init-styled.c
+@@ -0,0 +1,13 @@
++// SPDX-License-Identifier: GPL-2.0
++#include <stdio.h>
++#include <dis-asm.h>
++
++int main(void)
++{
++	struct disassemble_info info;
++
++	init_disassemble_info(&info, stdout,
++			      NULL, NULL);
++
++	return 0;
++}
diff --git a/srcpkgs/linux-tools/patches/binutils-disasm-compat.patch b/srcpkgs/linux-tools/patches/binutils-disasm-compat.patch
new file mode 100644
index 000000000000..1a6cc0e6d97c
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/binutils-disasm-compat.patch
@@ -0,0 +1,102 @@
+From a45b3d6926231c3d024ea0de4f7bd967f83709ee Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:29 -0700
+Subject: tools include: add dis-asm-compat.h to handle version differences
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation failures for tools/{perf,bpf}, e.g. on debian unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+This commit introduces a wrapper for init_disassemble_info(), to avoid
+spreading #ifdef DISASM_INIT_STYLED to a bunch of places. Subsequent
+commits will use it to fix the build failures.
+
+It likely is worth adding a wrapper for disassember(), to avoid the already
+existing DISASM_FOUR_ARGS_SIGNATURE ifdefery.
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Signed-off-by: Ben Hutchings <benh@debian.org>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Quentin Monnet <quentin@isovalent.com>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-4-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/include/tools/dis-asm-compat.h | 55 ++++++++++++++++++++++++++++++++++++
+ 1 file changed, 55 insertions(+)
+ create mode 100644 tools/include/tools/dis-asm-compat.h
+
+(limited to 'tools/include/tools/dis-asm-compat.h')
+
+diff --git a/tools/include/tools/dis-asm-compat.h b/tools/include/tools/dis-asm-compat.h
+new file mode 100644
+index 0000000000000..70f331e23ed3d
+--- /dev/null
++++ b/tools/include/tools/dis-asm-compat.h
+@@ -0,0 +1,55 @@
++/* SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause */
++#ifndef _TOOLS_DIS_ASM_COMPAT_H
++#define _TOOLS_DIS_ASM_COMPAT_H
++
++#include <stdio.h>
++#include <dis-asm.h>
++
++/* define types for older binutils version, to centralize ifdef'ery a bit */
++#ifndef DISASM_INIT_STYLED
++enum disassembler_style {DISASSEMBLER_STYLE_NOT_EMPTY};
++typedef int (*fprintf_styled_ftype) (void *, enum disassembler_style, const char*, ...);
++#endif
++
++/*
++ * Trivial fprintf wrapper to be used as the fprintf_styled_func argument to
++ * init_disassemble_info_compat() when normal fprintf suffices.
++ */
++static inline int fprintf_styled(void *out,
++				 enum disassembler_style style,
++				 const char *fmt, ...)
++{
++	va_list args;
++	int r;
++
++	(void)style;
++
++	va_start(args, fmt);
++	r = vfprintf(out, fmt, args);
++	va_end(args);
++
++	return r;
++}
++
++/*
++ * Wrapper for init_disassemble_info() that hides version
++ * differences. Depending on binutils version and architecture either
++ * fprintf_func or fprintf_styled_func will be called.
++ */
++static inline void init_disassemble_info_compat(struct disassemble_info *info,
++						void *stream,
++						fprintf_ftype unstyled_func,
++						fprintf_styled_ftype styled_func)
++{
++#ifdef DISASM_INIT_STYLED
++	init_disassemble_info(info, stream,
++			      unstyled_func,
++			      styled_func);
++#else
++	(void)styled_func;
++	init_disassemble_info(info, stream,
++			      unstyled_func);
++#endif
++}
++
++#endif /* _TOOLS_DIS_ASM_COMPAT_H */
+-- 
+cgit 
+
diff --git a/srcpkgs/linux-tools/patches/bpf_jit_disasm-binutils-2.39.patch b/srcpkgs/linux-tools/patches/bpf_jit_disasm-binutils-2.39.patch
new file mode 100644
index 000000000000..01221fad3a4a
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/bpf_jit_disasm-binutils-2.39.patch
@@ -0,0 +1,104 @@
+From 96ed066054abf11c7d3e106e3011a51f3f1227a3 Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:31 -0700
+Subject: [PATCH] tools bpf_jit_disasm: Fix compilation error with new binutils
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation to fail for tools/bpf/bpf_jit_disasm.c, e.g. on debian
+unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+Wire up the feature test and switch to init_disassemble_info_compat(),
+which were introduced in prior commits, fixing the compilation failure.
+
+I verified that bpf_jit_disasm can still disassemble bpf programs, both
+with the old and new dis-asm.h API. With old binutils there's no change in
+output before/after this patch. When comparing the output from old
+binutils (2.35) to new bintuils with the patch (upstream snapshot) there
+are a few output differences, but they are unrelated to this patch. An
+example hunk is:
+
+     f4:	mov    %r14,%rsi
+     f7:	mov    %r15,%rdx
+     fa:	mov    $0x2a,%ecx
+  -  ff:	callq  0xffffffffea8c4988
+  +  ff:	call   0xffffffffea8c4988
+    104:	test   %rax,%rax
+    107:	jge    0x0000000000000110
+    109:	xor    %eax,%eax
+  - 10b:	jmpq   0x0000000000000073
+  + 10b:	jmp    0x0000000000000073
+    110:	cmp    $0x16,%rax
+
+However, I had to use an older kernel to generate the bpf_jit_enabled =
+2 output, as that has been broken since 5.18 / 1022a5498f6f745c ("bpf,
+x86_64: Use bpf_jit_binary_pack_alloc").
+
+  https://lore.kernel.org/20220703030210.pmjft7qc2eajzi6c@alap3.anarazel.de
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Daniel Borkmann <daniel@iogearbox.net>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Quentin Monnet <quentin@isovalent.com>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-6-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/bpf/Makefile         | 5 ++++-
+ tools/bpf/bpf_jit_disasm.c | 5 ++++-
+ 2 files changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/tools/bpf/Makefile b/tools/bpf/Makefile
+index b11cfc86a3d021..664601ab1705ab 100644
+--- a/tools/bpf/Makefile
++++ b/tools/bpf/Makefile
+@@ -34,7 +34,7 @@ else
+ endif
+ 
+ FEATURE_USER = .bpf
+-FEATURE_TESTS = libbfd disassembler-four-args
++FEATURE_TESTS = libbfd disassembler-four-args disassembler-init-styled
+ FEATURE_DISPLAY = libbfd disassembler-four-args
+ 
+ check_feat := 1
+@@ -56,6 +56,9 @@ endif
+ ifeq ($(feature-disassembler-four-args), 1)
+ CFLAGS += -DDISASM_FOUR_ARGS_SIGNATURE
+ endif
++ifeq ($(feature-disassembler-init-styled), 1)
++CFLAGS += -DDISASM_INIT_STYLED
++endif
+ 
+ $(OUTPUT)%.yacc.c: $(srctree)/tools/bpf/%.y
+ 	$(QUIET_BISON)$(YACC) -o $@ -d $<
+diff --git a/tools/bpf/bpf_jit_disasm.c b/tools/bpf/bpf_jit_disasm.c
+index c8ae9580472814..a90a5d110f9255 100644
+--- a/tools/bpf/bpf_jit_disasm.c
++++ b/tools/bpf/bpf_jit_disasm.c
+@@ -28,6 +28,7 @@
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <limits.h>
++#include <tools/dis-asm-compat.h>
+ 
+ #define CMD_ACTION_SIZE_BUFFER		10
+ #define CMD_ACTION_READ_ALL		3
+@@ -64,7 +65,9 @@ static void get_asm_insns(uint8_t *image, size_t len, int opcodes)
+ 	assert(bfdf);
+ 	assert(bfd_check_format(bfdf, bfd_object));
+ 
+-	init_disassemble_info(&info, stdout, (fprintf_ftype) fprintf);
++	init_disassemble_info_compat(&info, stdout,
++				     (fprintf_ftype) fprintf,
++				     fprintf_styled);
+ 	info.arch = bfd_get_arch(bfdf);
+ 	info.mach = bfd_get_mach(bfdf);
+ 	info.buffer = image;
diff --git a/srcpkgs/linux-tools/patches/bpftool-binutils-2.39.patch b/srcpkgs/linux-tools/patches/bpftool-binutils-2.39.patch
new file mode 100644
index 000000000000..1e55c40011be
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/bpftool-binutils-2.39.patch
@@ -0,0 +1,149 @@
+From 600b7b26c07a070d0153daa76b3806c1e52c9e00 Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:33 -0700
+Subject: [PATCH] tools bpftool: Fix compilation error with new binutils
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation to fail for tools/bpf/bpftool/jit_disasm.c, e.g. on debian
+unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+Wire up the feature test and switch to init_disassemble_info_compat(),
+which were introduced in prior commits, fixing the compilation failure.
+
+I verified that bpftool can still disassemble bpf programs, both with an
+old and new dis-asm.h API. There are no output changes for plain and json
+formats. When comparing the output from old binutils (2.35)
+to new bintuils with the patch (upstream snapshot) there are a few output
+differences, but they are unrelated to this patch. An example hunk is:
+
+     2f:	pop    %r14
+     31:	pop    %r13
+     33:	pop    %rbx
+  -  34:	leaveq
+  -  35:	retq
+  +  34:	leave
+  +  35:	ret
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Quentin Monnet <quentin@isovalent.com>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-8-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/bpf/bpftool/Makefile     |  5 +++-
+ tools/bpf/bpftool/jit_disasm.c | 42 +++++++++++++++++++++++++++-------
+ 2 files changed, 38 insertions(+), 9 deletions(-)
+
+diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile
+index c6d2c77d02524a..436e671b2657d4 100644
+--- a/tools/bpf/bpftool/Makefile
++++ b/tools/bpf/bpftool/Makefile
+@@ -62,7 +62,7 @@ CLANG ?= clang
+ LLVM_STRIP ?= llvm-strip
+ 
+ FEATURE_USER = .bpftool
+-FEATURE_TESTS = libbfd disassembler-four-args reallocarray zlib libcap \
++FEATURE_TESTS = libbfd disassembler-four-args disassembler-init-styled reallocarray zlib libcap \
+ 	clang-bpf-co-re
+ FEATURE_DISPLAY = libbfd disassembler-four-args zlib libcap \
+ 	clang-bpf-co-re
+@@ -117,6 +117,9 @@ endif
+ ifeq ($(feature-disassembler-four-args), 1)
+ CFLAGS += -DDISASM_FOUR_ARGS_SIGNATURE
+ endif
++ifeq ($(feature-disassembler-init-styled), 1)
++    CFLAGS += -DDISASM_INIT_STYLED
++endif
+ 
+ LIBS = $(LIBBPF) -lelf -lz
+ LIBS_BOOTSTRAP = $(LIBBPF_BOOTSTRAP) -lelf -lz
+diff --git a/tools/bpf/bpftool/jit_disasm.c b/tools/bpf/bpftool/jit_disasm.c
+index 24734f2249d6ec..aaf99a0168c90b 100644
+--- a/tools/bpf/bpftool/jit_disasm.c
++++ b/tools/bpf/bpftool/jit_disasm.c
+@@ -24,6 +24,7 @@
+ #include <sys/stat.h>
+ #include <limits.h>
+ #include <bpf/libbpf.h>
++#include <tools/dis-asm-compat.h>
+ 
+ #include "json_writer.h"
+ #include "main.h"
+@@ -39,15 +40,12 @@ static void get_exec_path(char *tpath, s
+ }
+ 
+ static int oper_count;
+-static int fprintf_json(void *out, const char *fmt, ...)
++static int printf_json(void *out, const char *fmt, va_list ap)
+ {
+-	va_list ap;
+ 	char *s;
+ 
+-	va_start(ap, fmt);
+ 	if (vasprintf(&s, fmt, ap) < 0)
+ 		return -1;
+-	va_end(ap);
+ 
+ 	if (!oper_count) {
+ 		int i;
+@@ -73,6 +71,32 @@ static int fprintf_json(void *out, const char *fmt, ...)
+ 	return 0;
+ }
+ 
++static int fprintf_json(void *out, const char *fmt, ...)
++{
++	va_list ap;
++	int r;
++
++	va_start(ap, fmt);
++	r = printf_json(out, fmt, ap);
++	va_end(ap);
++
++	return r;
++}
++
++static int fprintf_json_styled(void *out,
++			       enum disassembler_style style __maybe_unused,
++			       const char *fmt, ...)
++{
++	va_list ap;
++	int r;
++
++	va_start(ap, fmt);
++	r = printf_json(out, fmt, ap);
++	va_end(ap);
++
++	return r;
++}
++
+ void disasm_print_insn(unsigned char *image, ssize_t len, int opcodes,
+ 		       const char *arch, const char *disassembler_options,
+ 		       const struct btf *btf,
+@@ -99,11 +123,13 @@ void disasm_print_insn(unsigned char *image, ssize_t len, int opcodes,
+ 	assert(bfd_check_format(bfdf, bfd_object));
+ 
+ 	if (json_output)
+-		init_disassemble_info(&info, stdout,
+-				      (fprintf_ftype) fprintf_json);
++		init_disassemble_info_compat(&info, stdout,
++					     (fprintf_ftype) fprintf_json,
++					     fprintf_json_styled);
+ 	else
+-		init_disassemble_info(&info, stdout,
+-				      (fprintf_ftype) fprintf);
++		init_disassemble_info_compat(&info, stdout,
++					     (fprintf_ftype) fprintf,
++					     fprintf_styled);
+ 
+ 	/* Update architecture info for offload. */
+ 	if (arch) {
diff --git a/srcpkgs/linux-tools/patches/perf-binutils-2.39.patch b/srcpkgs/linux-tools/patches/perf-binutils-2.39.patch
new file mode 100644
index 000000000000..3484330f7286
--- /dev/null
+++ b/srcpkgs/linux-tools/patches/perf-binutils-2.39.patch
@@ -0,0 +1,114 @@
+From 83aa0120487e8bc3f231e72c460add783f71f17c Mon Sep 17 00:00:00 2001
+From: Andres Freund <andres@anarazel.de>
+Date: Sun, 31 Jul 2022 18:38:30 -0700
+Subject: [PATCH] tools perf: Fix compilation error with new binutils
+
+binutils changed the signature of init_disassemble_info(), which now causes
+compilation failures for tools/perf/util/annotate.c, e.g. on debian
+unstable.
+
+Relevant binutils commit:
+
+  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
+
+Wire up the feature test and switch to init_disassemble_info_compat(),
+which were introduced in prior commits, fixing the compilation failure.
+
+I verified that perf can still disassemble bpf programs by using bpftrace
+under load, recording a perf trace, and then annotating the bpf "function"
+with and without the changes. With old binutils there's no change in output
+before/after this patch. When comparing the output from old binutils (2.35)
+to new bintuils with the patch (upstream snapshot) there are a few output
+differences, but they are unrelated to this patch. An example hunk is:
+
+       1.15 :   55:mov    %rbp,%rdx
+       0.00 :   58:add    $0xfffffffffffffff8,%rdx
+       0.00 :   5c:xor    %ecx,%ecx
+  -    1.03 :   5e:callq  0xffffffffe12aca3c
+  +    1.03 :   5e:call   0xffffffffe12aca3c
+       0.00 :   63:xor    %eax,%eax
+  -    2.18 :   65:leaveq
+  -    2.82 :   66:retq
+  +    2.18 :   65:leave
+  +    2.82 :   66:ret
+
+Signed-off-by: Andres Freund <andres@anarazel.de>
+Acked-by: Quentin Monnet <quentin@isovalent.com>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Ben Hutchings <benh@debian.org>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Sedat Dilek <sedat.dilek@gmail.com>
+Cc: bpf@vger.kernel.org
+Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
+Link: https://lore.kernel.org/r/20220801013834.156015-5-andres@anarazel.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/perf/Makefile.config | 8 ++++++++
+ tools/perf/util/annotate.c | 7 ++++---
+ 2 files changed, 12 insertions(+), 3 deletions(-)
+
+diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
+index d3c254c0f5c611..23648ea54e8d3d 100644
+--- a/tools/perf/Makefile.config
++++ b/tools/perf/Makefile.config
+@@ -298,6 +298,7 @@ FEATURE_CHECK_LDFLAGS-libpython := $(PYTHON_EMBED_LDOPTS)
+ FEATURE_CHECK_LDFLAGS-libaio = -lrt
+ 
+ FEATURE_CHECK_LDFLAGS-disassembler-four-args = -lbfd -lopcodes -ldl
++FEATURE_CHECK_LDFLAGS-disassembler-init-styled = -lbfd -lopcodes -ldl
+ 
+ CORE_CFLAGS += -fno-omit-frame-pointer
+ CORE_CFLAGS += -ggdb3
+@@ -818,13 +819,16 @@ else
+   ifeq ($(feature-libbfd-liberty), 1)
+     EXTLIBS += -lbfd -lopcodes -liberty
+     FEATURE_CHECK_LDFLAGS-disassembler-four-args += -liberty -ldl
++    FEATURE_CHECK_LDFLAGS-disassembler-init-styled += -liberty -ldl
+   else
+     ifeq ($(feature-libbfd-liberty-z), 1)
+       EXTLIBS += -lbfd -lopcodes -liberty -lz
+       FEATURE_CHECK_LDFLAGS-disassembler-four-args += -liberty -lz -ldl
++      FEATURE_CHECK_LDFLAGS-disassembler-init-styled += -liberty -lz -ldl
+     endif
+   endif
+   $(call feature_check,disassembler-four-args)
++  $(call feature_check,disassembler-init-styled)
+ endif
+ 
+ ifeq ($(feature-libbfd-buildid), 1)
+@@ -1044,6 +1048,10 @@ ifeq ($(feature-disassembler-four-args), 1)
+     CFLAGS += -DDISASM_FOUR_ARGS_SIGNATURE
+ endif
+ 
++ifeq ($(feature-disassembler-init-styled), 1)
++    CFLAGS += -DDISASM_INIT_STYLED
++endif
++
+ ifeq (${IS_64_BIT}, 1)
+   ifndef NO_PERF_READ_VDSO32
+     $(call feature_check,compile-32)
+diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
+index 82cc396ef516c4..2c6a485c3de5d9 100644
+--- a/tools/perf/util/annotate.c
++++ b/tools/perf/util/annotate.c
+@@ -1676,6 +1676,7 @@ fallback:
+ #define PACKAGE "perf"
+ #include <bfd.h>
+ #include <dis-asm.h>
++#include <tools/dis-asm-compat.h>
+ 
+ static int symbol__disassemble_bpf(struct symbol *sym,
+ 				   struct annotate_args *args)
+@@ -1762,9 +1763,9 @@ static int symbol__disassemble_bpf(struct symbol *sym,
+ 		ret = errno;
+ 		goto out;
+ 	}
+-	init_disassemble_info(&info, s,
+-			      (fprintf_ftype) fprintf);
+-
++	init_disassemble_info_compat(&info, s,
++				     (fprintf_ftype) fprintf,
++				     fprintf_styled);
+ 	info.arch = bfd_get_arch(bfdf);
+ 	info.mach = bfd_get_mach(bfdf);
+ 

From 3bf8bed713c5d6588dae1437f03fc0a26c19b5ac Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 14:45:28 -0700
Subject: [PATCH 22/48] libsasl: fix build for libtool 2.4.7

---
 srcpkgs/libsasl/template | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/libsasl/template b/srcpkgs/libsasl/template
index a8817042f843..a2993b39f4a1 100644
--- a/srcpkgs/libsasl/template
+++ b/srcpkgs/libsasl/template
@@ -19,6 +19,7 @@ distfiles="https://github.com/cyrusimap/cyrus-sasl/releases/download/cyrus-sasl-
 checksum=26866b1549b00ffd020f188a43c258017fa1c382b3ddadd8201536f72efb05d5
 
 pre_configure() {
+	rm -f m4/ltversion.m4
 	autoreconf -fi
 }
 

From 82932aa2685261b8c69ebc219617637f8390bb39 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:08 -0700
Subject: [PATCH 23/48] subversion: fix build for libtool 2.4.7

---
 srcpkgs/subversion/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion/template b/srcpkgs/subversion/template
index 8ad178264942..3f1c9e254e61 100644
--- a/srcpkgs/subversion/template
+++ b/srcpkgs/subversion/template
@@ -57,7 +57,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From c72215bd2832bd29c3d9c55be43b799c65d187eb Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:38 -0700
Subject: [PATCH 24/48] subversion-kwallet-auth: fix build for libtool 2.4.7

---
 srcpkgs/subversion-kwallet-auth/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion-kwallet-auth/template b/srcpkgs/subversion-kwallet-auth/template
index 12210f250d51..b4d8621456ea 100644
--- a/srcpkgs/subversion-kwallet-auth/template
+++ b/srcpkgs/subversion-kwallet-auth/template
@@ -59,7 +59,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From 8eeceb5e0a80b2d9076bd2f9b6b8d6195eb83419 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 20:07:32 -0700
Subject: [PATCH 25/48] gpgme: update to 1.18.0.

---
 common/shlibs          | 2 +-
 srcpkgs/gpgme/template | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 8b31fec0557c..3cde524d66bc 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -720,7 +720,7 @@ libdconf.so.1 dconf-0.13.90_1
 libassuan.so.0 libassuan-2.0.1_1
 libgpgme.so.11 libgpgme-1.12.0_2
 libgpgmepp.so.6 gpgmepp-1.7.0_3
-libqgpgme.so.7 gpgmeqt-1.7.0_3
+libqgpgme.so.15 gpgmeqt-1.18.0_1
 libgarcon-1.so.0 garcon-0.1.12_1
 libgarcon-gtk2-1.so.0 garcon-0.4.0_1
 libgarcon-gtk3-1.so.0 garcon-0.6.1_1
diff --git a/srcpkgs/gpgme/template b/srcpkgs/gpgme/template
index 8633075a8404..b1cfd5f78657 100644
--- a/srcpkgs/gpgme/template
+++ b/srcpkgs/gpgme/template
@@ -1,7 +1,7 @@
 # Template file for 'gpgme'
 pkgname=gpgme
-version=1.15.1
-revision=2
+version=1.18.0
+revision=1
 build_style=gnu-configure
 configure_args="--enable-fd-passing
  --with-libgpg-error-prefix=$XBPS_CROSS_BASE/usr
@@ -14,7 +14,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.gnupg.org/software/gpgme/index.html"
 distfiles="https://www.gnupg.org/ftp/gcrypt/gpgme/gpgme-${version}.tar.bz2"
-checksum=eebc3c1b27f1c8979896ff361ba9bb4778b508b2496c2fc10e3775a40b1de1ad
+checksum=361d4eae47ce925dba0ea569af40e7b52c645c4ae2e65e5621bf1b6cdd8b0e9e
 
 if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
 	configure_args+=" ac_cv_sys_file_offset_bits=no"

From 010a85e3e464146f589041b94fc448305b287d68 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 26/48] cross-aarch64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..bd6b23f9fb6a 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 7a497a32d0b300adf4b068487d51fd85089368bf Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 27/48] cross-aarch64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..427ad2c1e9cd 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From c5e261c5187be4ce09dbd5633967cd7bb6e00e7b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 28/48] cross-arm-linux-gnueabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..2510ee26e789 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 363fe26f20c6f2e0f261220a08616cbd85ea7f44 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 29/48] cross-arm-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..bd8b16e1b4c1 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From cd98d9c7a390fff8684ea33a68d7b37bf08ededd Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 30/48] cross-arm-linux-musleabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..dacfd2655216 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 9304f646ab04302fa097dae2f48faa2002cc162d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 31/48] cross-arm-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..9ddd32a9f20d 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 45bbd458633fafbe076bae4b43ff2fb6e6a818ab Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 32/48] cross-armv7l-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..9fb00f18be3b 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From f345b6b6ccdd3e48239959da83e79fe2738206c8 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 33/48] cross-armv7l-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..2c72e75ddfe3 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 95f0187a55b2cea33207638aa720fd9970bf5470 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 34/48] cross-i686-pc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..4dc17df648b5 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From d78fc40303a0a11beffbc6c97e03c143b632216b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 35/48] cross-mips-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..6009e5c79eb2 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 27bd05a283d6561b761fec67c88d3ed269f63b92 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 36/48] cross-mips-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..080164df193d 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="hipperson0 <hipperson0@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From a90470a4be42b84d6015608c2909d7d6e6c69fa2 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 37/48] cross-mipsel-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..f9fd4b8a04ef 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 4a47522ecc3ae8d329870c4905f3cd796f4f499d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 38/48] cross-mipsel-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..7418a984474b 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From ec519bc3d9f1e3580863cffa1bdd36c5417f6cc4 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 39/48] cross-powerpc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..31e57b4e52b2 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From d53f4657ec45d0e1232aa86b87ae63619bcc21c4 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 40/48] cross-powerpc-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..a2d1edcf1ffd 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From ec9f232378807bcfff951ae146fe4f43c5798906 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 41/48] cross-powerpc64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..1a4cbed61e76 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From f1a9d75748deaf1e2fe242386a5427cf16ae49d1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 42/48] cross-powerpc64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 1ebd0fb2048d..ade42018af05 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From e2cefea9945e6aa1d460456fb4c9bf3a17e303bc Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 43/48] cross-powerpc64le-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 733f5851da5c..03054239001e 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From cc1411358a10c3ab4ff1fd0307727dc6471fc19c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 44/48] cross-powerpc64le-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index 76a70aa1d6db..5887f845f932 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From f2cd468a505d23a3b28e2f5fe3f2370781cdcf25 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 45/48] cross-powerpcle-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 347b8fcf4f55..06530e0d609b 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 5590c3e01857e61292a05e31e6deaf3f6da2e47d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 46/48] cross-powerpcle-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index ec9324ddaa99..e68c3962b49c 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From f2c08f00d13e1545088104267d48c23eadf7803f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 47/48] cross-x86_64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 0078fbe7224b..7da85c14b62d 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From f6841425c0c33a7aa146c966d01f37421c9eee5d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 48/48] cross-x86_64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..2811de0d3c2e 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (68 preceding siblings ...)
  2022-09-03  5:53 ` oreo639
@ 2022-09-06 18:52 ` oreo639
  2022-09-08 12:47 ` dkwo
                   ` (194 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-09-06 18:52 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 436 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1225344519

Comment:
I built all of the glibc isos so hopefully most of those major breakages are accounted for, I also provided isos fully compiled using gcc12 for testing purposes.
Feel free to test this PR on musl if you want to and let me know if there are any issues there.

Ofc any feedback is appreciated.

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (69 preceding siblings ...)
  2022-09-06 18:52 ` oreo639
@ 2022-09-08 12:47 ` dkwo
  2022-09-08 21:54 ` [PR PATCH] [Updated] " oreo639
                   ` (193 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: dkwo @ 2022-09-08 12:47 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 198 bytes --]

New comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1240671192

Comment:
Could you perhaps rebase?
Does it cross-compile right now?

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (70 preceding siblings ...)
  2022-09-08 12:47 ` dkwo
@ 2022-09-08 21:54 ` oreo639
  2022-09-08 21:55 ` oreo639
                   ` (192 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-09-08 21:54 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5538 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.2.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.2.0

This PR depends on: https://github.com/void-linux/void-packages/pull/32330

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

Also, keep in mind that the libgo musl patch here will need to be updated once musl is updated:
https://github.com/void-linux/void-packages/pull/34902/files#diff-1f42a95b93c9550178ff1fbccbef2f47a72711df15c24c9472e2550076978129R163-R176

This is the updated patch for reference:
https://github.com/alpinelinux/aports/blob/8acb21b8ee881e7ab1c812d9a66a17d2501b8730/main/gcc/0049-libgo-adjust-name-of-union-in-sigevent-struct.patch

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/38817
- [x] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [x] llvm https://github.com/void-linux/void-packages/pull/38694
- [ ] m4 https://github.com/void-linux/void-packages/pull/33730
- [x] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [x] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [x] libvirt https://github.com/void-linux/void-packages/pull/38842
- [x] syslinux https://github.com/void-linux/void-packages/pull/38876
- [x] efivar https://github.com/void-linux/void-packages/pull/38874

Known packages that needed to be fixed/updated for gcc12:
- [ ] linux5.18 (in this PR)
- [x] openssh https://github.com/void-linux/void-packages/pull/38849
- [x] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [x] doxygen https://github.com/void-linux/void-packages/pull/38846
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/38817
- [x] libproxy https://github.com/void-linux/void-packages/pull/38818
- [x] exempi https://github.com/void-linux/void-packages/pull/38820
- [x] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [ ] gpgme https://github.com/void-linux/void-packages/pull/38825
- [x] libunique1 https://github.com/void-linux/void-packages/pull/38848 or https://github.com/void-linux/void-packages/pull/38873
- [x] libwpd https://github.com/void-linux/void-packages/pull/38878

Needs to be fixed/updated for binutils:
- [x] grub https://github.com/void-linux/void-packages/pull/38875
- [x] linux-tools https://github.com/void-linux/void-packages/pull/38877

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [x] kde
- [x] lxde
- [x] lxqt

You can test the ISOs here:
https://drive.google.com/drive/folders/1ix92CYSLUP-KWjLxltdgG4e8Nu2JCY5n?usp=sharing

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 120929 bytes --]

From dd973a361c39c29112eded2bb3965c3a16e34529 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 01/38] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../fix-libcollector-without-java.patch       | 53 +++++++++++++++
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 16 +++--
 4 files changed, 82 insertions(+), 113 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
 create mode 100644 srcpkgs/binutils/patches/fix-libcollector-without-java.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/fix-libcollector-without-java.patch b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
new file mode 100644
index 000000000000..54384875f358
--- /dev/null
+++ b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
@@ -0,0 +1,53 @@
+From 49ddd814ac1071af7c4f45d5f8398b91862f2c7f Mon Sep 17 00:00:00 2001
+From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
+Date: Wed, 17 Aug 2022 19:55:23 -0700
+Subject: [PATCH] gprofng: fix bug 29479 Collection fails when built without
+ java support
+
+gprofng/ChangeLog
+2022-08-17  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>
+
+	PR gprofng/29479
+	* libcollector/collector.c: Add #if defined(GPROFNG_JAVA_PROFILING) for
+	java specific code.
+	* libcollector/unwind.c: Likewise.
+---
+ gprofng/libcollector/collector.c | 2 ++
+ gprofng/libcollector/unwind.c    | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/gprofng/libcollector/collector.c b/gprofng/libcollector/collector.c
+index 93c9d3330de5..ceff2c1caccb 100644
+--- a/gprofng/libcollector/collector.c
++++ b/gprofng/libcollector/collector.c
+@@ -913,8 +913,10 @@ __collector_open_experiment (const char *exp, const char *params, sp_origin_t or
+   __collector_ext_unwind_key_init (1, NULL);
+ 
+   /* start java attach if suitable */
++#if defined(GPROFNG_JAVA_PROFILING)
+   if (exp_origin == SP_ORIGIN_DBX_ATTACH)
+     __collector_jprofile_start_attach ();
++#endif
+   start_sec_time = CALL_UTIL (time)(NULL);
+   __collector_start_time = collector_interface.getHiResTime ();
+   TprintfT (DBG_LT0, "\t__collector_open_experiment; resetting start_time\n");
+diff --git a/gprofng/libcollector/unwind.c b/gprofng/libcollector/unwind.c
+index 119243788020..f8e11823c81e 100644
+--- a/gprofng/libcollector/unwind.c
++++ b/gprofng/libcollector/unwind.c
+@@ -557,6 +557,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+   int size = max_frame_size;
+ 
+ #define MIN(a,b) ((a)<(b)?(a):(b))
++#if defined(GPROFNG_JAVA_PROFILING)
+   /* get Java info */
+   if (__collector_java_mode && __collector_java_asyncgetcalltrace_loaded && context && !pseudo_context)
+     {
+@@ -569,6 +570,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+ 	  size -= sz;
+ 	}
+     }
++#endif
+ 
+   /* get native stack */
+   if (context)
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..0abcfcfe4f9b 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkg-config"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -44,6 +45,12 @@ do_configure() {
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	# gprofng currently only supports x86 and aarch64 glibc.
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64|i386|aarch64) conf+=" --enable-gprofng" ;;
+		*) conf+=" --disable-gprofng" ;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"
@@ -76,6 +83,7 @@ do_configure() {
 		--libdir=/usr/lib \
 		--mandir=/usr/share/man \
 		--infodir=/usr/share/info \
+		--sysconfdir=/etc \
 		--disable-werror \
 		--disable-shared \
 		--disable-nls \

From 5c2c7e6ef4b248219bd6818526a8986b1e6fc844 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 02/38] gcc: update to 12.2.0.

---
 common/shlibs                                 | 10 +--
 srcpkgs/gcc/files/gccgo-musl.patch            | 74 ++++---------------
 srcpkgs/gcc/files/libgnarl-musl.patch         | 18 ++---
 srcpkgs/gcc/files/libssp-musl.patch           | 10 +--
 srcpkgs/gcc/patches/libffi_gnulinux.patch     | 11 ---
 .../gcc/patches/libgcc-ibm128-no-tag.patch    | 10 ++-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |  2 +-
 srcpkgs/gcc/template                          | 25 +++----
 8 files changed, 52 insertions(+), 108 deletions(-)
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index bd9890ed7846..25a14f17563c 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.2.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.34 perl-5.34.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -846,8 +846,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.2.0_1
+libgnat-12.so libada-12.2.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1696,8 +1696,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.2.0_1
+libasan.so.8 libsanitizer-12.2.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..632ef951097b 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,17 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ a/libgo/go/runtime/os_linux.go
+@@ -363,9 +363,9 @@
+ 
+ 	var timerid int32
+ 	var sevp _sigevent
+-	sevp.sigev_notify = _SIGEV_THREAD_ID
++	sevp.sigev_notify = 4
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.sigev_notify_function))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..446741390d45 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,15 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
+version=12.2.0
+revision=1
 _patchver="${version%pre*}"
 _minorver="${_patchver%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 wrksrc=gcc-${version/pre/_pre}
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +19,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -396,7 +393,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}

From c3dfac895d435672f3f4bf1a6a030fffc953830e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 03/38] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      | 11 ++++--
 2 files changed, 25 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..70c4aa533e66 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,12 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
+
+if [ "$XBPS_LIBC" == "musl" ]; then
+# Musl always searches LD_LIBRARY_PATH before RPATH and RUNPATH
+make_build_args="lt_cv_shlibpath_overrides_runpath=yes"
+fi
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From 86d1ef26e377eeea5abbe3645874159335732edc Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 04/38] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 1a4e1ca3d594..b04268908c2e 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="q66 <daniel@octaforge.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From 2c33c6e1e44316729b7fd19132931307aa9fb2a7 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 05/38] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 3 files changed, 55 insertions(+), 353 deletions(-)
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index 25a14f17563c..d584062cd354 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From bfb41c3f4397e5079f524fcc468d4cd384f906c2 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 21:01:43 -0700
Subject: [PATCH 06/38] gcc-multilib: update to 12.2.0.

---
 srcpkgs/gcc-multilib/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index fcd25755aa75..1a26da26a991 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,16 +3,16 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _majorver="${version%.*}"
-wrksrc=gcc-${version/pre/_pre}
+wrksrc=gcc-${version}
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel

From d3322f5f8db2e76e8f5b763905ab28a50cca7874 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 17:21:40 -0700
Subject: [PATCH 07/38] m4: update to 1.4.19.

---
 srcpkgs/m4/patches/fix-glibc-2.27.patch | 167 ------------------------
 srcpkgs/m4/template                     |  12 +-
 2 files changed, 6 insertions(+), 173 deletions(-)
 delete mode 100644 srcpkgs/m4/patches/fix-glibc-2.27.patch

diff --git a/srcpkgs/m4/patches/fix-glibc-2.27.patch b/srcpkgs/m4/patches/fix-glibc-2.27.patch
deleted file mode 100644
index 59d33cff164d..000000000000
--- a/srcpkgs/m4/patches/fix-glibc-2.27.patch
+++ /dev/null
@@ -1,167 +0,0 @@
-From 4af4a4a71827c0bc5e0ec67af23edef4f15cee8e Mon Sep 17 00:00:00 2001
-From: Paul Eggert <eggert@cs.ucla.edu>
-Date: Mon, 5 Mar 2018 10:56:29 -0800
-Subject: [PATCH] fflush: adjust to glibc 2.28 libio.h removal
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Problem reported by Daniel P. Berrangé in:
-https://lists.gnu.org/r/bug-gnulib/2018-03/msg00000.html
-* lib/fbufmode.c (fbufmode):
-* lib/fflush.c (clear_ungetc_buffer_preserving_position)
-(disable_seek_optimization, rpl_fflush):
-* lib/fpending.c (__fpending):
-* lib/fpurge.c (fpurge):
-* lib/freadable.c (freadable):
-* lib/freadahead.c (freadahead):
-* lib/freading.c (freading):
-* lib/freadptr.c (freadptr):
-* lib/freadseek.c (freadptrinc):
-* lib/fseeko.c (fseeko):
-* lib/fseterr.c (fseterr):
-* lib/fwritable.c (fwritable):
-* lib/fwriting.c (fwriting):
-Check _IO_EOF_SEEN instead of _IO_ftrylockfile.
-* lib/stdio-impl.h (_IO_IN_BACKUP) [_IO_EOF_SEEN]:
-Define if not already defined.
-
-[yann.morin.1998@free.fr: partially backport from upstream gnulib]
-Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
-
----
- lib/fflush.c     |  6 +++---
- lib/fpending.c   |  2 +-
- lib/fpurge.c     |  2 +-
- lib/freadahead.c |  2 +-
- lib/freading.c   |  2 +-
- lib/fseeko.c     |  4 ++--
- lib/stdio-impl.h |  6 ++++++
- 7 files changed, 15 insertions(+), 9 deletions(-)
-
-diff --git a/lib/fflush.c b/build-aux/gnulib/lib/fflush.c
-index 983ade0ff..a6edfa105 100644
---- a/lib/fflush.c
-+++ b/lib/fflush.c
-@@ -33,7 +33,7 @@
- #undef fflush
- 
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- 
- /* Clear the stream's ungetc buffer, preserving the value of ftello (fp).  */
- static void
-@@ -72,7 +72,7 @@ clear_ungetc_buffer (FILE *fp)
- 
- #endif
- 
--#if ! (defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
-+#if ! (defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
- 
- # if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT
- /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
-@@ -148,7 +148,7 @@ rpl_fflush (FILE *stream)
-   if (stream == NULL || ! freading (stream))
-     return fflush (stream);
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- 
-   clear_ungetc_buffer_preserving_position (stream);
- 
-diff --git a/lib/fpending.c b/build-aux/gnulib/lib/fpending.c
-index c84e3a5b4..789f50e4e 100644
---- a/lib/fpending.c
-+++ b/lib/fpending.c
-@@ -32,7 +32,7 @@ __fpending (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   return fp->_IO_write_ptr - fp->_IO_write_base;
- #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
-   /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
-diff --git a/lib/fpurge.c b/build-aux/gnulib/lib/fpurge.c
-index b1d417c7a..3aedcc373 100644
---- a/lib/fpurge.c
-+++ b/lib/fpurge.c
-@@ -62,7 +62,7 @@ fpurge (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   fp->_IO_read_end = fp->_IO_read_ptr;
-   fp->_IO_write_ptr = fp->_IO_write_base;
-   /* Avoid memory leak when there is an active ungetc buffer.  */
-diff --git a/lib/freadahead.c b/build-aux/gnulib/lib/freadahead.c
-index c2ecb5b28..23ec76ee5 100644
---- a/lib/freadahead.c
-+++ b/lib/freadahead.c
-@@ -30,7 +30,7 @@ extern size_t __sreadahead (FILE *);
- size_t
- freadahead (FILE *fp)
- {
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   if (fp->_IO_write_ptr > fp->_IO_write_base)
-     return 0;
-   return (fp->_IO_read_end - fp->_IO_read_ptr)
-diff --git a/lib/freading.c b/build-aux/gnulib/lib/freading.c
-index 73c28acdd..c24d0c88a 100644
---- a/lib/freading.c
-+++ b/lib/freading.c
-@@ -31,7 +31,7 @@ freading (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   return ((fp->_flags & _IO_NO_WRITES) != 0
-           || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0
-               && fp->_IO_read_base != NULL));
-diff --git a/lib/fseeko.c b/build-aux/gnulib/lib/fseeko.c
-index 0101ab55f..193f4e8ce 100644
---- a/lib/fseeko.c
-+++ b/lib/fseeko.c
-@@ -47,7 +47,7 @@ fseeko (FILE *fp, off_t offset, int whence)
- #endif
- 
-   /* These tests are based on fpurge.c.  */
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   if (fp->_IO_read_end == fp->_IO_read_ptr
-       && fp->_IO_write_ptr == fp->_IO_write_base
-       && fp->_IO_save_base == NULL)
-@@ -123,7 +123,7 @@ fseeko (FILE *fp, off_t offset, int whence)
-           return -1;
-         }
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-       fp->_flags &= ~_IO_EOF_SEEN;
-       fp->_offset = pos;
- #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
-diff --git a/lib/stdio-impl.h b/build-aux/gnulib/lib/stdio-impl.h
-index 78d896e9f..05c5752a2 100644
---- a/lib/stdio-impl.h
-+++ b/lib/stdio-impl.h
-@@ -18,6 +18,12 @@
-    the same implementation of stdio extension API, except that some fields
-    have different naming conventions, or their access requires some casts.  */
- 
-+/* Glibc 2.28 made _IO_IN_BACKUP private.  For now, work around this
-+   problem by defining it ourselves.  FIXME: Do not rely on glibc
-+   internals.  */
-+#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN
-+# define _IO_IN_BACKUP 0x100
-+#endif
- 
- /* BSD stdio derived implementations.  */
- 
--- 
-2.14.1
-
-
diff --git a/srcpkgs/m4/template b/srcpkgs/m4/template
index 78f3dae6184a..762593d883bd 100644
--- a/srcpkgs/m4/template
+++ b/srcpkgs/m4/template
@@ -1,17 +1,17 @@
 # Template file for 'm4'
 pkgname=m4
-version=1.4.18
-revision=2
+version=1.4.19
+revision=1
 bootstrap=yes
-replaces="chroot-m4>=0"
 build_style=gnu-configure
 configure_args="--enable-changeword --enable-threads"
 short_desc="GNU version of UNIX m4 macro language processor"
-homepage="https://www.gnu.org/software/m4/"
-license="GPL-3.0-or-later"
 maintainer="Enno Boland <gottox@voidlinux.org>"
+license="GPL-3.0-or-later"
+homepage="https://www.gnu.org/software/m4/"
 distfiles="${GNU_SITE}/${pkgname}/${pkgname}-${version}.tar.xz"
-checksum=f2c1e86ca0a404ff281631bdc8377638992744b175afb806e25871a24a934e07
+checksum=63aede5c6d33b6d9b13511cd0be2cac046f2e70fd0a07aa9573a04a82783af96
+replaces="chroot-m4>=0"
 
 if [ "$XBPS_TARGET_LIBC" = musl ]; then
 	export ac_cv_lib_error_at_line=no

From 69ca31143be35bccd1878f68ec8cb725b7e4b760 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 14 Aug 2022 19:29:36 -0700
Subject: [PATCH 08/38] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove -no-pie from build. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..fcc00b3a6c5d 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -53,6 +53,7 @@ _void_cross_build_binutils() {
 		--sbindir=/usr/bin \
 		--libdir=/usr/lib \
 		--libexecdir=/usr/lib \
+		--sysconfdir=/etc \
 		--target=${tgt} \
 		--with-sysroot=/usr/${tgt} \
 		--disable-nls \
@@ -60,6 +61,7 @@ _void_cross_build_binutils() {
 		--disable-multilib \
 		--disable-werror \
 		--disable-gold \
+		--disable-gprofng \
 		--enable-relro \
 		--enable-plugins \
 		--enable-64-bit-bfd \
@@ -132,6 +134,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -460,6 +463,14 @@ do_build() {
 	local binutils_ver linux_ver gcc_ver libc_ver libucontext_ver
 	local tgt=${sourcepkg/cross-}
 
+	export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}"
+	export CXXFLAGS="${CXXFLAGS/-D_FORTIFY_SOURCE=2/}"
+
+	# Disable explicit -fno-PIE, gcc/binutils/libc will figure this out itself.
+	export CFLAGS="${CFLAGS//-fno-PIE/}"
+	export CXXFLAGS="${CXXFLAGS//-fno-PIE/}"
+	export LDFLAGS="${LDFLAGS//-no-pie/}"
+
 	_void_cross_test_ver binutils
 	_void_cross_test_ver linux
 	_void_cross_test_ver gcc
@@ -625,6 +636,9 @@ do_install() {
 	# then remove it because it conflicts with libquadmath package
 	rm -rf ${DESTDIR}/${sysroot}/usr/lib/libquadmath.*
 
+	# Remove libdep linker plugin because it conflicts with system binutils
+	rm -f ${DESTDIR}/usr/lib/bfd-plugins/libdep*
+
 	# Remove leftover symlinks
 	rm -f ${DESTDIR}/usr/lib${XBPS_TARGET_WORDSIZE}
 	rm -f ${DESTDIR}/lib*

From 095c6ba3886bf14f7920e74f84d6e411f22eaec9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:09:31 -0700
Subject: [PATCH 09/38] linux5.18: update dotconfigs for gcc12

---
 srcpkgs/linux5.18/files/x86_64-dotconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/linux5.18/files/x86_64-dotconfig b/srcpkgs/linux5.18/files/x86_64-dotconfig
index 4e73a3195d40..ea6204868e23 100644
--- a/srcpkgs/linux5.18/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.18/files/x86_64-dotconfig
@@ -512,6 +512,7 @@ CONFIG_RETHUNK=y
 CONFIG_CPU_UNRET_ENTRY=y
 CONFIG_CPU_IBPB_ENTRY=y
 CONFIG_CPU_IBRS_ENTRY=y
+CONFIG_SLS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10060,8 +10061,11 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
 # Memory initialization
 #
 CONFIG_INIT_STACK_NONE=y
+# CONFIG_INIT_STACK_ALL_PATTERN is not set
+# CONFIG_INIT_STACK_ALL_ZERO is not set
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
+# CONFIG_ZERO_CALL_USED_REGS is not set
 # end of Memory initialization
 # end of Kernel hardening options
 # end of Security options
@@ -10538,6 +10542,7 @@ CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
 # CONFIG_UBSAN is not set
 CONFIG_HAVE_ARCH_KCSAN=y
+# CONFIG_KCSAN is not set
 # end of Generic Kernel Debugging Instruments
 
 #

From b27826dd992ce89383e7e36ee54f91c25cc649cc Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 15 Aug 2022 18:00:42 -0700
Subject: [PATCH 10/38] xf86-video-vmware: fix build on gcc12

---
 ...183b3395333d5d4c73e25c2d011748f15eda.patch | 30 +++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch

diff --git a/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch b/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch
new file mode 100644
index 000000000000..ff839f16e628
--- /dev/null
+++ b/srcpkgs/xf86-video-vmware/patches/77b8183b3395333d5d4c73e25c2d011748f15eda.patch
@@ -0,0 +1,30 @@
+From 77b8183b3395333d5d4c73e25c2d011748f15eda Mon Sep 17 00:00:00 2001
+From: Rudi Heitbaum <rudi@heitbaum.com>
+Date: Sun, 8 May 2022 03:00:10 +0000
+Subject: [PATCH] vmwgfx: fix missing array notation
+
+ Fixes error identified by gcc-12.1.0 compiler
+
+make
+  CC       libvmwgfx_la-vmwgfx_tex_video.lo
+vmwgfx_tex_video.c: In function 'stop_video':
+vmwgfx_tex_video.c:240:20: error: the comparison will always evaluate as 'true' for the address of 'yuv' will never be NULL [-Werror=address]
+  240 |                if (priv->yuv[i]) {
+      |                    ^~~~
+---
+ vmwgfx/vmwgfx_tex_video.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/vmwgfx/vmwgfx_tex_video.c b/vmwgfx/vmwgfx_tex_video.c
+index acc2b56..480a5f1 100644
+--- a/vmwgfx/vmwgfx_tex_video.c
++++ b/vmwgfx/vmwgfx_tex_video.c
+@@ -237,7 +237,7 @@ stop_video(ScrnInfoPtr pScrn, pointer data, Bool shutdown)
+ 
+        for (i=0; i<3; ++i) {
+ 	   for (j=0; j<2; ++j) {
+-	       if (priv->yuv[i]) {
++	       if (priv->yuv[j][i]) {
+ 		   xa_surface_destroy(priv->yuv[j][i]);
+ 		   priv->yuv[j][i] = NULL;
+ 	       }

From b1c4bced90e70ace078d820d4ffca5e642d3b691 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 23 Aug 2022 22:39:52 -0700
Subject: [PATCH 11/38] libvirt: fix build for glibc 2.36

---
 .../patches/lxc-fix-compat-glibc-2.36.patch   | 34 ++++++++++++++++
 .../virfile-fix-compat-glibc-2.36.patch       | 39 +++++++++++++++++++
 2 files changed, 73 insertions(+)
 create mode 100644 srcpkgs/libvirt/patches/lxc-fix-compat-glibc-2.36.patch
 create mode 100644 srcpkgs/libvirt/patches/virfile-fix-compat-glibc-2.36.patch

diff --git a/srcpkgs/libvirt/patches/lxc-fix-compat-glibc-2.36.patch b/srcpkgs/libvirt/patches/lxc-fix-compat-glibc-2.36.patch
new file mode 100644
index 000000000000..d85b57815010
--- /dev/null
+++ b/srcpkgs/libvirt/patches/lxc-fix-compat-glibc-2.36.patch
@@ -0,0 +1,34 @@
+From 9493c9b79dc541ec9e0fd73c6d87bdf8d30aaa90 Mon Sep 17 00:00:00 2001
+From: Cole Robinson <crobinso@redhat.com>
+Date: Mon, 1 Aug 2022 15:20:38 -0400
+Subject: [PATCH] lxc: containter: fix build with glibc 2.36
+
+With glibc 2.36, sys/mount.h and linux/mount.h conflict:
+https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
+
+lxc_container.c imports sys/mount.h and linux/fs.h, which pulls in
+linux/mount.h.
+
+linux/fs.h isn't required here though. glibc sys/mount.h has had
+MS_MOVE since 2.12 in 2010
+
+Reviewed-by: Erik Skultety <eskultet@redhat.com>
+Signed-off-by: Cole Robinson <crobinso@redhat.com>
+---
+ src/lxc/lxc_container.c | 3 ---
+ 1 file changed, 3 deletions(-)
+
+diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
+index b5278831da7..a5401c2186e 100644
+--- a/src/lxc/lxc_container.c
++++ b/src/lxc/lxc_container.c
+@@ -33,9 +33,6 @@
+ /* Yes, we want linux private one, for _syscall2() macro */
+ #include <linux/unistd.h>
+ 
+-/* For MS_MOVE */
+-#include <linux/fs.h>
+-
+ #if WITH_CAPNG
+ # include <cap-ng.h>
+ #endif
diff --git a/srcpkgs/libvirt/patches/virfile-fix-compat-glibc-2.36.patch b/srcpkgs/libvirt/patches/virfile-fix-compat-glibc-2.36.patch
new file mode 100644
index 000000000000..2ef227ea9b54
--- /dev/null
+++ b/srcpkgs/libvirt/patches/virfile-fix-compat-glibc-2.36.patch
@@ -0,0 +1,39 @@
+From c0d9adf220dc0d223330a7bac37b174132d330ba Mon Sep 17 00:00:00 2001
+From: Cole Robinson <crobinso@redhat.com>
+Date: Mon, 1 Aug 2022 15:24:01 -0400
+Subject: [PATCH] virfile: Fix build with glibc 2.36
+
+With glibc 2.36, sys/mount.h and linux/mount.h conflict:
+https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
+
+virfile.c imports sys/mount.h and linux/fs.h, which pulls in
+linux/mount.h.
+
+Manually define the constants we need from linux/fs.h, like was
+done in llvm:
+
+https://reviews.llvm.org/rGb379129c4beb3f26223288627a1291739f33af02
+
+Reviewed-by: Erik Skultety <eskultet@redhat.com>
+Signed-off-by: Cole Robinson <crobinso@redhat.com>
+---
+ src/util/virfile.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/src/util/virfile.c b/src/util/virfile.c
+index 99da058db3b..ce541b8946b 100644
+--- a/src/util/virfile.c
++++ b/src/util/virfile.c
+@@ -71,7 +71,11 @@
+ # endif
+ # include <sys/ioctl.h>
+ # include <linux/cdrom.h>
+-# include <linux/fs.h>
++/* These come from linux/fs.h, but that header conflicts with
++ * sys/mount.h on glibc 2.36+ */
++# define FS_IOC_GETFLAGS _IOR('f', 1, long)
++# define FS_IOC_SETFLAGS _IOW('f', 2, long)
++# define FS_NOCOW_FL 0x00800000
+ #endif
+ 
+ #if WITH_LIBATTR

From 071cbea107e802168d76cbf6c030451911dee931 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 14:45:28 -0700
Subject: [PATCH 12/38] libsasl: fix build for libtool 2.4.7

---
 srcpkgs/libsasl/template | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/libsasl/template b/srcpkgs/libsasl/template
index a8817042f843..a2993b39f4a1 100644
--- a/srcpkgs/libsasl/template
+++ b/srcpkgs/libsasl/template
@@ -19,6 +19,7 @@ distfiles="https://github.com/cyrusimap/cyrus-sasl/releases/download/cyrus-sasl-
 checksum=26866b1549b00ffd020f188a43c258017fa1c382b3ddadd8201536f72efb05d5
 
 pre_configure() {
+	rm -f m4/ltversion.m4
 	autoreconf -fi
 }
 

From 3985b1a00fa764291d4c36c79d049b0c63cd9d03 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:08 -0700
Subject: [PATCH 13/38] subversion: fix build for libtool 2.4.7

---
 srcpkgs/subversion/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion/template b/srcpkgs/subversion/template
index 8ad178264942..3f1c9e254e61 100644
--- a/srcpkgs/subversion/template
+++ b/srcpkgs/subversion/template
@@ -57,7 +57,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From 8cf36f5fba638bfe00929d1d5c3e4fb43c6194ca Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:38 -0700
Subject: [PATCH 14/38] subversion-kwallet-auth: fix build for libtool 2.4.7

---
 srcpkgs/subversion-kwallet-auth/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion-kwallet-auth/template b/srcpkgs/subversion-kwallet-auth/template
index 12210f250d51..b4d8621456ea 100644
--- a/srcpkgs/subversion-kwallet-auth/template
+++ b/srcpkgs/subversion-kwallet-auth/template
@@ -59,7 +59,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From d4d27cb21a1c494380235bda363f7d51e8740b93 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 20:07:32 -0700
Subject: [PATCH 15/38] gpgme: update to 1.18.0.

---
 common/shlibs          | 2 +-
 srcpkgs/gpgme/template | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index d584062cd354..f6dac39c01b4 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -721,7 +721,7 @@ libdconf.so.1 dconf-0.13.90_1
 libassuan.so.0 libassuan-2.0.1_1
 libgpgme.so.11 libgpgme-1.12.0_2
 libgpgmepp.so.6 gpgmepp-1.7.0_3
-libqgpgme.so.7 gpgmeqt-1.7.0_3
+libqgpgme.so.15 gpgmeqt-1.18.0_1
 libgarcon-1.so.0 garcon-0.1.12_1
 libgarcon-gtk2-1.so.0 garcon-0.4.0_1
 libgarcon-gtk3-1.so.0 garcon-0.6.1_1
diff --git a/srcpkgs/gpgme/template b/srcpkgs/gpgme/template
index 8633075a8404..b1cfd5f78657 100644
--- a/srcpkgs/gpgme/template
+++ b/srcpkgs/gpgme/template
@@ -1,7 +1,7 @@
 # Template file for 'gpgme'
 pkgname=gpgme
-version=1.15.1
-revision=2
+version=1.18.0
+revision=1
 build_style=gnu-configure
 configure_args="--enable-fd-passing
  --with-libgpg-error-prefix=$XBPS_CROSS_BASE/usr
@@ -14,7 +14,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.gnupg.org/software/gpgme/index.html"
 distfiles="https://www.gnupg.org/ftp/gcrypt/gpgme/gpgme-${version}.tar.bz2"
-checksum=eebc3c1b27f1c8979896ff361ba9bb4778b508b2496c2fc10e3775a40b1de1ad
+checksum=361d4eae47ce925dba0ea569af40e7b52c645c4ae2e65e5621bf1b6cdd8b0e9e
 
 if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
 	configure_args+=" ac_cv_sys_file_offset_bits=no"

From 51cd5df082d8062e7b5a5fa9affe7a21bebbd534 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 16/38] cross-aarch64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..bd6b23f9fb6a 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From f7bc2af0a6eee20643b3a9cdf17d3575af28041c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 17/38] cross-aarch64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..427ad2c1e9cd 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From ad11d17179bd34404e0b78d9f8997a86278135af Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 18/38] cross-arm-linux-gnueabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..2510ee26e789 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 3190ff7ec6483ef534897426423877db387938bb Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 19/38] cross-arm-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..bd8b16e1b4c1 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From d603778c1e87e73b3e50c456d25b3890c2f8d928 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 20/38] cross-arm-linux-musleabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..dacfd2655216 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 215cdfb8c4d7d91b8ecbc97b041a114821334df1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 21/38] cross-arm-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..9ddd32a9f20d 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From f21901cbf6912e8c8a00ea327e0c284d024d44b1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 22/38] cross-armv7l-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..9fb00f18be3b 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From b765ad2be1340c65c6e5b90814eb88aa9b41b882 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 23/38] cross-armv7l-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..2c72e75ddfe3 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 7a1856869fb61a165515b07d3516e082973f27cd Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 24/38] cross-i686-pc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..4dc17df648b5 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From df29c19f0c7c40263e8d1f669a66a5e40393fcc6 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 25/38] cross-mips-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..6009e5c79eb2 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 39bd7dc38e4cd6eabcf0796557d38ac2f6dc7e17 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 26/38] cross-mips-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..080164df193d 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="hipperson0 <hipperson0@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 676234cb4df67cde64e8deb210580b4864b5c260 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 27/38] cross-mipsel-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..f9fd4b8a04ef 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 4f2e9c97576dbc9af0ba0d91d8727f30d17002a4 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 28/38] cross-mipsel-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..7418a984474b 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 09dabb05ee2a81c0ccdf61fef9534d84d047a6f2 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 29/38] cross-powerpc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..31e57b4e52b2 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From bd0583c244ad96eeda5767d9c22a2c47317f8f37 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 30/38] cross-powerpc-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..a2d1edcf1ffd 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 4c33c6c9c4bdf67d2d8274d741283bf48720e30f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 31/38] cross-powerpc64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..1a4cbed61e76 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 0510bbf433b334d0c65daf79290ddbaae7e4dc88 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 32/38] cross-powerpc64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 1ebd0fb2048d..ade42018af05 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 9cf3d0beb51ee7358aee2d66f61e98ac39da0195 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 33/38] cross-powerpc64le-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 733f5851da5c..03054239001e 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 65fdd69cb7717f45bf0a8f4e9bf22f7063c7b8f1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 34/38] cross-powerpc64le-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index 76a70aa1d6db..5887f845f932 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 0561d59129662a1d356972b86fb930211f281ff8 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 35/38] cross-powerpcle-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 347b8fcf4f55..06530e0d609b 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From af170f2103cf6aa28acd832ea34cb11af851c969 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 36/38] cross-powerpcle-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index ec9324ddaa99..e68c3962b49c 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From c6571f6c7b0322e29412c31a5d416c4c0dbb8d76 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 37/38] cross-x86_64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 0078fbe7224b..7da85c14b62d 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 6c9fd682e31efa0b90e38454ec258f8914295f77 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 38/38] cross-x86_64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..2811de0d3c2e 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (71 preceding siblings ...)
  2022-09-08 21:54 ` [PR PATCH] [Updated] " oreo639
@ 2022-09-08 21:55 ` oreo639
  2022-09-08 22:07 ` oreo639
                   ` (191 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-09-08 21:55 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 185 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1241274311

Comment:
> Does it cross-compile right now?

Wdym?

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (72 preceding siblings ...)
  2022-09-08 21:55 ` oreo639
@ 2022-09-08 22:07 ` oreo639
  2022-09-09  0:26 ` oreo639
                   ` (190 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-09-08 22:07 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 324 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1241274311

Comment:
> Does it cross-compile right now?

Wdym?
If you are compiling the cross compilers, you cannot have the cross compilers installed in your masterdir if that is what you are asking?

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (73 preceding siblings ...)
  2022-09-08 22:07 ` oreo639
@ 2022-09-09  0:26 ` oreo639
  2022-09-09  0:27 ` oreo639
                   ` (189 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-09-09  0:26 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 431 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1241274311

Comment:
> Does it cross-compile right now?

Wdym?
If you are compiling the cross compilers, you cannot have the cross compilers installed in your masterdir if that is what you are asking?

Edit: Oh, you're probably talking about what Leah said. We discussed it on IRC, it should be fixed now.

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (74 preceding siblings ...)
  2022-09-09  0:26 ` oreo639
@ 2022-09-09  0:27 ` oreo639
  2022-09-09  0:29 ` oreo639
                   ` (188 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-09-09  0:27 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 459 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1241274311

Comment:
> Does it cross-compile right now?

Wdym?
If you are compiling the cross compilers, you cannot have the cross compilers installed in your masterdir if that is what you are asking?

Edit: Oh, you're probably talking about what Leah said. We discussed it on IRC, it was a copy-paste error that should be fixed now.

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (75 preceding siblings ...)
  2022-09-09  0:27 ` oreo639
@ 2022-09-09  0:29 ` oreo639
  2022-09-09  5:53 ` oreo639
                   ` (187 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-09-09  0:29 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 529 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1241274311

Comment:
> Does it cross-compile right now?

Wdym?
If you are compiling the cross compilers, you cannot have the cross compilers installed in your masterdir if that is what you are asking?

Edit: Oh, you're probably talking about what Leah said. We discussed it on IRC, it was a copy-paste error on some of the mips/ppc cross compilers. I double checked them so they should all be fixed now.

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (76 preceding siblings ...)
  2022-09-09  0:29 ` oreo639
@ 2022-09-09  5:53 ` oreo639
  2022-09-09  6:01 ` [PR PATCH] [Updated] " oreo639
                   ` (186 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-09-09  5:53 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 560 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1241274311

Comment:
> Does it cross-compile right now?

Wdym?
If you are compiling the cross compilers, you cannot have the cross compilers installed in your masterdir if that is what you are asking?

Edit: Oh, you're probably talking about what Leah said. We discussed it on IRC, it was a copy-paste error on some of the mips/ppc cross compilers. I double checked them so they should all be fixed now, ofc feel free to double check.

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (77 preceding siblings ...)
  2022-09-09  5:53 ` oreo639
@ 2022-09-09  6:01 ` oreo639
  2022-09-10 19:28 ` oreo639
                   ` (185 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-09-09  6:01 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5538 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.2.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.2.0

This PR depends on: https://github.com/void-linux/void-packages/pull/32330

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

Also, keep in mind that the libgo musl patch here will need to be updated once musl is updated:
https://github.com/void-linux/void-packages/pull/34902/files#diff-1f42a95b93c9550178ff1fbccbef2f47a72711df15c24c9472e2550076978129R163-R176

This is the updated patch for reference:
https://github.com/alpinelinux/aports/blob/8acb21b8ee881e7ab1c812d9a66a17d2501b8730/main/gcc/0049-libgo-adjust-name-of-union-in-sigevent-struct.patch

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/38817
- [x] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [x] llvm https://github.com/void-linux/void-packages/pull/38694
- [ ] m4 https://github.com/void-linux/void-packages/pull/33730
- [x] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [x] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [x] libvirt https://github.com/void-linux/void-packages/pull/38842
- [x] syslinux https://github.com/void-linux/void-packages/pull/38876
- [x] efivar https://github.com/void-linux/void-packages/pull/38874

Known packages that needed to be fixed/updated for gcc12:
- [ ] linux5.18 (in this PR)
- [x] openssh https://github.com/void-linux/void-packages/pull/38849
- [x] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [x] doxygen https://github.com/void-linux/void-packages/pull/38846
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/38817
- [x] libproxy https://github.com/void-linux/void-packages/pull/38818
- [x] exempi https://github.com/void-linux/void-packages/pull/38820
- [x] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [ ] gpgme https://github.com/void-linux/void-packages/pull/38825
- [x] libunique1 https://github.com/void-linux/void-packages/pull/38848 or https://github.com/void-linux/void-packages/pull/38873
- [x] libwpd https://github.com/void-linux/void-packages/pull/38878

Needs to be fixed/updated for binutils:
- [x] grub https://github.com/void-linux/void-packages/pull/38875
- [x] linux-tools https://github.com/void-linux/void-packages/pull/38877

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [x] kde
- [x] lxde
- [x] lxqt

You can test the ISOs here:
https://drive.google.com/drive/folders/1ix92CYSLUP-KWjLxltdgG4e8Nu2JCY5n?usp=sharing

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 115480 bytes --]

From dd973a361c39c29112eded2bb3965c3a16e34529 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 01/36] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../fix-libcollector-without-java.patch       | 53 +++++++++++++++
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 16 +++--
 4 files changed, 82 insertions(+), 113 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
 create mode 100644 srcpkgs/binutils/patches/fix-libcollector-without-java.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/fix-libcollector-without-java.patch b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
new file mode 100644
index 000000000000..54384875f358
--- /dev/null
+++ b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
@@ -0,0 +1,53 @@
+From 49ddd814ac1071af7c4f45d5f8398b91862f2c7f Mon Sep 17 00:00:00 2001
+From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
+Date: Wed, 17 Aug 2022 19:55:23 -0700
+Subject: [PATCH] gprofng: fix bug 29479 Collection fails when built without
+ java support
+
+gprofng/ChangeLog
+2022-08-17  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>
+
+	PR gprofng/29479
+	* libcollector/collector.c: Add #if defined(GPROFNG_JAVA_PROFILING) for
+	java specific code.
+	* libcollector/unwind.c: Likewise.
+---
+ gprofng/libcollector/collector.c | 2 ++
+ gprofng/libcollector/unwind.c    | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/gprofng/libcollector/collector.c b/gprofng/libcollector/collector.c
+index 93c9d3330de5..ceff2c1caccb 100644
+--- a/gprofng/libcollector/collector.c
++++ b/gprofng/libcollector/collector.c
+@@ -913,8 +913,10 @@ __collector_open_experiment (const char *exp, const char *params, sp_origin_t or
+   __collector_ext_unwind_key_init (1, NULL);
+ 
+   /* start java attach if suitable */
++#if defined(GPROFNG_JAVA_PROFILING)
+   if (exp_origin == SP_ORIGIN_DBX_ATTACH)
+     __collector_jprofile_start_attach ();
++#endif
+   start_sec_time = CALL_UTIL (time)(NULL);
+   __collector_start_time = collector_interface.getHiResTime ();
+   TprintfT (DBG_LT0, "\t__collector_open_experiment; resetting start_time\n");
+diff --git a/gprofng/libcollector/unwind.c b/gprofng/libcollector/unwind.c
+index 119243788020..f8e11823c81e 100644
+--- a/gprofng/libcollector/unwind.c
++++ b/gprofng/libcollector/unwind.c
+@@ -557,6 +557,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+   int size = max_frame_size;
+ 
+ #define MIN(a,b) ((a)<(b)?(a):(b))
++#if defined(GPROFNG_JAVA_PROFILING)
+   /* get Java info */
+   if (__collector_java_mode && __collector_java_asyncgetcalltrace_loaded && context && !pseudo_context)
+     {
+@@ -569,6 +570,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+ 	  size -= sz;
+ 	}
+     }
++#endif
+ 
+   /* get native stack */
+   if (context)
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..0abcfcfe4f9b 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkg-config"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -44,6 +45,12 @@ do_configure() {
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	# gprofng currently only supports x86 and aarch64 glibc.
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64|i386|aarch64) conf+=" --enable-gprofng" ;;
+		*) conf+=" --disable-gprofng" ;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"
@@ -76,6 +83,7 @@ do_configure() {
 		--libdir=/usr/lib \
 		--mandir=/usr/share/man \
 		--infodir=/usr/share/info \
+		--sysconfdir=/etc \
 		--disable-werror \
 		--disable-shared \
 		--disable-nls \

From 5c2c7e6ef4b248219bd6818526a8986b1e6fc844 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 02/36] gcc: update to 12.2.0.

---
 common/shlibs                                 | 10 +--
 srcpkgs/gcc/files/gccgo-musl.patch            | 74 ++++---------------
 srcpkgs/gcc/files/libgnarl-musl.patch         | 18 ++---
 srcpkgs/gcc/files/libssp-musl.patch           | 10 +--
 srcpkgs/gcc/patches/libffi_gnulinux.patch     | 11 ---
 .../gcc/patches/libgcc-ibm128-no-tag.patch    | 10 ++-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |  2 +-
 srcpkgs/gcc/template                          | 25 +++----
 8 files changed, 52 insertions(+), 108 deletions(-)
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index bd9890ed7846..25a14f17563c 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.2.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.34 perl-5.34.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -846,8 +846,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.2.0_1
+libgnat-12.so libada-12.2.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1696,8 +1696,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.2.0_1
+libasan.so.8 libsanitizer-12.2.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..632ef951097b 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,17 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ a/libgo/go/runtime/os_linux.go
+@@ -363,9 +363,9 @@
+ 
+ 	var timerid int32
+ 	var sevp _sigevent
+-	sevp.sigev_notify = _SIGEV_THREAD_ID
++	sevp.sigev_notify = 4
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.sigev_notify_function))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..446741390d45 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,15 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
+version=12.2.0
+revision=1
 _patchver="${version%pre*}"
 _minorver="${_patchver%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 wrksrc=gcc-${version/pre/_pre}
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +19,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -396,7 +393,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}

From c3dfac895d435672f3f4bf1a6a030fffc953830e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 03/36] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      | 11 ++++--
 2 files changed, 25 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..70c4aa533e66 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,12 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
+
+if [ "$XBPS_LIBC" == "musl" ]; then
+# Musl always searches LD_LIBRARY_PATH before RPATH and RUNPATH
+make_build_args="lt_cv_shlibpath_overrides_runpath=yes"
+fi
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From 86d1ef26e377eeea5abbe3645874159335732edc Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 04/36] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 1a4e1ca3d594..b04268908c2e 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="q66 <daniel@octaforge.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From 2c33c6e1e44316729b7fd19132931307aa9fb2a7 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 05/36] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 3 files changed, 55 insertions(+), 353 deletions(-)
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index 25a14f17563c..d584062cd354 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From bfb41c3f4397e5079f524fcc468d4cd384f906c2 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 21:01:43 -0700
Subject: [PATCH 06/36] gcc-multilib: update to 12.2.0.

---
 srcpkgs/gcc-multilib/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index fcd25755aa75..1a26da26a991 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,16 +3,16 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _majorver="${version%.*}"
-wrksrc=gcc-${version/pre/_pre}
+wrksrc=gcc-${version}
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel

From d3322f5f8db2e76e8f5b763905ab28a50cca7874 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 18 Aug 2022 17:21:40 -0700
Subject: [PATCH 07/36] m4: update to 1.4.19.

---
 srcpkgs/m4/patches/fix-glibc-2.27.patch | 167 ------------------------
 srcpkgs/m4/template                     |  12 +-
 2 files changed, 6 insertions(+), 173 deletions(-)
 delete mode 100644 srcpkgs/m4/patches/fix-glibc-2.27.patch

diff --git a/srcpkgs/m4/patches/fix-glibc-2.27.patch b/srcpkgs/m4/patches/fix-glibc-2.27.patch
deleted file mode 100644
index 59d33cff164d..000000000000
--- a/srcpkgs/m4/patches/fix-glibc-2.27.patch
+++ /dev/null
@@ -1,167 +0,0 @@
-From 4af4a4a71827c0bc5e0ec67af23edef4f15cee8e Mon Sep 17 00:00:00 2001
-From: Paul Eggert <eggert@cs.ucla.edu>
-Date: Mon, 5 Mar 2018 10:56:29 -0800
-Subject: [PATCH] fflush: adjust to glibc 2.28 libio.h removal
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Problem reported by Daniel P. Berrangé in:
-https://lists.gnu.org/r/bug-gnulib/2018-03/msg00000.html
-* lib/fbufmode.c (fbufmode):
-* lib/fflush.c (clear_ungetc_buffer_preserving_position)
-(disable_seek_optimization, rpl_fflush):
-* lib/fpending.c (__fpending):
-* lib/fpurge.c (fpurge):
-* lib/freadable.c (freadable):
-* lib/freadahead.c (freadahead):
-* lib/freading.c (freading):
-* lib/freadptr.c (freadptr):
-* lib/freadseek.c (freadptrinc):
-* lib/fseeko.c (fseeko):
-* lib/fseterr.c (fseterr):
-* lib/fwritable.c (fwritable):
-* lib/fwriting.c (fwriting):
-Check _IO_EOF_SEEN instead of _IO_ftrylockfile.
-* lib/stdio-impl.h (_IO_IN_BACKUP) [_IO_EOF_SEEN]:
-Define if not already defined.
-
-[yann.morin.1998@free.fr: partially backport from upstream gnulib]
-Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
-
----
- lib/fflush.c     |  6 +++---
- lib/fpending.c   |  2 +-
- lib/fpurge.c     |  2 +-
- lib/freadahead.c |  2 +-
- lib/freading.c   |  2 +-
- lib/fseeko.c     |  4 ++--
- lib/stdio-impl.h |  6 ++++++
- 7 files changed, 15 insertions(+), 9 deletions(-)
-
-diff --git a/lib/fflush.c b/build-aux/gnulib/lib/fflush.c
-index 983ade0ff..a6edfa105 100644
---- a/lib/fflush.c
-+++ b/lib/fflush.c
-@@ -33,7 +33,7 @@
- #undef fflush
- 
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- 
- /* Clear the stream's ungetc buffer, preserving the value of ftello (fp).  */
- static void
-@@ -72,7 +72,7 @@ clear_ungetc_buffer (FILE *fp)
- 
- #endif
- 
--#if ! (defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
-+#if ! (defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
- 
- # if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT
- /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
-@@ -148,7 +148,7 @@ rpl_fflush (FILE *stream)
-   if (stream == NULL || ! freading (stream))
-     return fflush (stream);
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- 
-   clear_ungetc_buffer_preserving_position (stream);
- 
-diff --git a/lib/fpending.c b/build-aux/gnulib/lib/fpending.c
-index c84e3a5b4..789f50e4e 100644
---- a/lib/fpending.c
-+++ b/lib/fpending.c
-@@ -32,7 +32,7 @@ __fpending (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   return fp->_IO_write_ptr - fp->_IO_write_base;
- #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
-   /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
-diff --git a/lib/fpurge.c b/build-aux/gnulib/lib/fpurge.c
-index b1d417c7a..3aedcc373 100644
---- a/lib/fpurge.c
-+++ b/lib/fpurge.c
-@@ -62,7 +62,7 @@ fpurge (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   fp->_IO_read_end = fp->_IO_read_ptr;
-   fp->_IO_write_ptr = fp->_IO_write_base;
-   /* Avoid memory leak when there is an active ungetc buffer.  */
-diff --git a/lib/freadahead.c b/build-aux/gnulib/lib/freadahead.c
-index c2ecb5b28..23ec76ee5 100644
---- a/lib/freadahead.c
-+++ b/lib/freadahead.c
-@@ -30,7 +30,7 @@ extern size_t __sreadahead (FILE *);
- size_t
- freadahead (FILE *fp)
- {
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   if (fp->_IO_write_ptr > fp->_IO_write_base)
-     return 0;
-   return (fp->_IO_read_end - fp->_IO_read_ptr)
-diff --git a/lib/freading.c b/build-aux/gnulib/lib/freading.c
-index 73c28acdd..c24d0c88a 100644
---- a/lib/freading.c
-+++ b/lib/freading.c
-@@ -31,7 +31,7 @@ freading (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   return ((fp->_flags & _IO_NO_WRITES) != 0
-           || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0
-               && fp->_IO_read_base != NULL));
-diff --git a/lib/fseeko.c b/build-aux/gnulib/lib/fseeko.c
-index 0101ab55f..193f4e8ce 100644
---- a/lib/fseeko.c
-+++ b/lib/fseeko.c
-@@ -47,7 +47,7 @@ fseeko (FILE *fp, off_t offset, int whence)
- #endif
- 
-   /* These tests are based on fpurge.c.  */
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   if (fp->_IO_read_end == fp->_IO_read_ptr
-       && fp->_IO_write_ptr == fp->_IO_write_base
-       && fp->_IO_save_base == NULL)
-@@ -123,7 +123,7 @@ fseeko (FILE *fp, off_t offset, int whence)
-           return -1;
-         }
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-       fp->_flags &= ~_IO_EOF_SEEN;
-       fp->_offset = pos;
- #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
-diff --git a/lib/stdio-impl.h b/build-aux/gnulib/lib/stdio-impl.h
-index 78d896e9f..05c5752a2 100644
---- a/lib/stdio-impl.h
-+++ b/lib/stdio-impl.h
-@@ -18,6 +18,12 @@
-    the same implementation of stdio extension API, except that some fields
-    have different naming conventions, or their access requires some casts.  */
- 
-+/* Glibc 2.28 made _IO_IN_BACKUP private.  For now, work around this
-+   problem by defining it ourselves.  FIXME: Do not rely on glibc
-+   internals.  */
-+#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN
-+# define _IO_IN_BACKUP 0x100
-+#endif
- 
- /* BSD stdio derived implementations.  */
- 
--- 
-2.14.1
-
-
diff --git a/srcpkgs/m4/template b/srcpkgs/m4/template
index 78f3dae6184a..762593d883bd 100644
--- a/srcpkgs/m4/template
+++ b/srcpkgs/m4/template
@@ -1,17 +1,17 @@
 # Template file for 'm4'
 pkgname=m4
-version=1.4.18
-revision=2
+version=1.4.19
+revision=1
 bootstrap=yes
-replaces="chroot-m4>=0"
 build_style=gnu-configure
 configure_args="--enable-changeword --enable-threads"
 short_desc="GNU version of UNIX m4 macro language processor"
-homepage="https://www.gnu.org/software/m4/"
-license="GPL-3.0-or-later"
 maintainer="Enno Boland <gottox@voidlinux.org>"
+license="GPL-3.0-or-later"
+homepage="https://www.gnu.org/software/m4/"
 distfiles="${GNU_SITE}/${pkgname}/${pkgname}-${version}.tar.xz"
-checksum=f2c1e86ca0a404ff281631bdc8377638992744b175afb806e25871a24a934e07
+checksum=63aede5c6d33b6d9b13511cd0be2cac046f2e70fd0a07aa9573a04a82783af96
+replaces="chroot-m4>=0"
 
 if [ "$XBPS_TARGET_LIBC" = musl ]; then
 	export ac_cv_lib_error_at_line=no

From 69ca31143be35bccd1878f68ec8cb725b7e4b760 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 14 Aug 2022 19:29:36 -0700
Subject: [PATCH 08/36] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove -no-pie from build. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..fcc00b3a6c5d 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -53,6 +53,7 @@ _void_cross_build_binutils() {
 		--sbindir=/usr/bin \
 		--libdir=/usr/lib \
 		--libexecdir=/usr/lib \
+		--sysconfdir=/etc \
 		--target=${tgt} \
 		--with-sysroot=/usr/${tgt} \
 		--disable-nls \
@@ -60,6 +61,7 @@ _void_cross_build_binutils() {
 		--disable-multilib \
 		--disable-werror \
 		--disable-gold \
+		--disable-gprofng \
 		--enable-relro \
 		--enable-plugins \
 		--enable-64-bit-bfd \
@@ -132,6 +134,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -460,6 +463,14 @@ do_build() {
 	local binutils_ver linux_ver gcc_ver libc_ver libucontext_ver
 	local tgt=${sourcepkg/cross-}
 
+	export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}"
+	export CXXFLAGS="${CXXFLAGS/-D_FORTIFY_SOURCE=2/}"
+
+	# Disable explicit -fno-PIE, gcc/binutils/libc will figure this out itself.
+	export CFLAGS="${CFLAGS//-fno-PIE/}"
+	export CXXFLAGS="${CXXFLAGS//-fno-PIE/}"
+	export LDFLAGS="${LDFLAGS//-no-pie/}"
+
 	_void_cross_test_ver binutils
 	_void_cross_test_ver linux
 	_void_cross_test_ver gcc
@@ -625,6 +636,9 @@ do_install() {
 	# then remove it because it conflicts with libquadmath package
 	rm -rf ${DESTDIR}/${sysroot}/usr/lib/libquadmath.*
 
+	# Remove libdep linker plugin because it conflicts with system binutils
+	rm -f ${DESTDIR}/usr/lib/bfd-plugins/libdep*
+
 	# Remove leftover symlinks
 	rm -f ${DESTDIR}/usr/lib${XBPS_TARGET_WORDSIZE}
 	rm -f ${DESTDIR}/lib*

From 095c6ba3886bf14f7920e74f84d6e411f22eaec9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:09:31 -0700
Subject: [PATCH 09/36] linux5.18: update dotconfigs for gcc12

---
 srcpkgs/linux5.18/files/x86_64-dotconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/linux5.18/files/x86_64-dotconfig b/srcpkgs/linux5.18/files/x86_64-dotconfig
index 4e73a3195d40..ea6204868e23 100644
--- a/srcpkgs/linux5.18/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.18/files/x86_64-dotconfig
@@ -512,6 +512,7 @@ CONFIG_RETHUNK=y
 CONFIG_CPU_UNRET_ENTRY=y
 CONFIG_CPU_IBPB_ENTRY=y
 CONFIG_CPU_IBRS_ENTRY=y
+CONFIG_SLS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10060,8 +10061,11 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
 # Memory initialization
 #
 CONFIG_INIT_STACK_NONE=y
+# CONFIG_INIT_STACK_ALL_PATTERN is not set
+# CONFIG_INIT_STACK_ALL_ZERO is not set
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
+# CONFIG_ZERO_CALL_USED_REGS is not set
 # end of Memory initialization
 # end of Kernel hardening options
 # end of Security options
@@ -10538,6 +10542,7 @@ CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
 # CONFIG_UBSAN is not set
 CONFIG_HAVE_ARCH_KCSAN=y
+# CONFIG_KCSAN is not set
 # end of Generic Kernel Debugging Instruments
 
 #

From 8c54aa8e7c8f6a367e6599ee0aa112ce6e59b95b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 14:45:28 -0700
Subject: [PATCH 10/36] libsasl: fix build for libtool 2.4.7

---
 srcpkgs/libsasl/template | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/libsasl/template b/srcpkgs/libsasl/template
index a8817042f843..a2993b39f4a1 100644
--- a/srcpkgs/libsasl/template
+++ b/srcpkgs/libsasl/template
@@ -19,6 +19,7 @@ distfiles="https://github.com/cyrusimap/cyrus-sasl/releases/download/cyrus-sasl-
 checksum=26866b1549b00ffd020f188a43c258017fa1c382b3ddadd8201536f72efb05d5
 
 pre_configure() {
+	rm -f m4/ltversion.m4
 	autoreconf -fi
 }
 

From 4cfa6e1aad4108674c557a0cf31911a89b718291 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:08 -0700
Subject: [PATCH 11/36] subversion: fix build for libtool 2.4.7

---
 srcpkgs/subversion/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion/template b/srcpkgs/subversion/template
index 8ad178264942..3f1c9e254e61 100644
--- a/srcpkgs/subversion/template
+++ b/srcpkgs/subversion/template
@@ -57,7 +57,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From 7e19e0f1489dbe86073ea6453b75761dd9954443 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:38 -0700
Subject: [PATCH 12/36] subversion-kwallet-auth: fix build for libtool 2.4.7

---
 srcpkgs/subversion-kwallet-auth/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion-kwallet-auth/template b/srcpkgs/subversion-kwallet-auth/template
index 12210f250d51..b4d8621456ea 100644
--- a/srcpkgs/subversion-kwallet-auth/template
+++ b/srcpkgs/subversion-kwallet-auth/template
@@ -59,7 +59,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From e013f3e42a9d363810f3a70b380a3bf50bbbfaf3 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 20:07:32 -0700
Subject: [PATCH 13/36] gpgme: update to 1.18.0.

---
 common/shlibs          | 2 +-
 srcpkgs/gpgme/template | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index d584062cd354..f6dac39c01b4 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -721,7 +721,7 @@ libdconf.so.1 dconf-0.13.90_1
 libassuan.so.0 libassuan-2.0.1_1
 libgpgme.so.11 libgpgme-1.12.0_2
 libgpgmepp.so.6 gpgmepp-1.7.0_3
-libqgpgme.so.7 gpgmeqt-1.7.0_3
+libqgpgme.so.15 gpgmeqt-1.18.0_1
 libgarcon-1.so.0 garcon-0.1.12_1
 libgarcon-gtk2-1.so.0 garcon-0.4.0_1
 libgarcon-gtk3-1.so.0 garcon-0.6.1_1
diff --git a/srcpkgs/gpgme/template b/srcpkgs/gpgme/template
index 8633075a8404..b1cfd5f78657 100644
--- a/srcpkgs/gpgme/template
+++ b/srcpkgs/gpgme/template
@@ -1,7 +1,7 @@
 # Template file for 'gpgme'
 pkgname=gpgme
-version=1.15.1
-revision=2
+version=1.18.0
+revision=1
 build_style=gnu-configure
 configure_args="--enable-fd-passing
  --with-libgpg-error-prefix=$XBPS_CROSS_BASE/usr
@@ -14,7 +14,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.gnupg.org/software/gpgme/index.html"
 distfiles="https://www.gnupg.org/ftp/gcrypt/gpgme/gpgme-${version}.tar.bz2"
-checksum=eebc3c1b27f1c8979896ff361ba9bb4778b508b2496c2fc10e3775a40b1de1ad
+checksum=361d4eae47ce925dba0ea569af40e7b52c645c4ae2e65e5621bf1b6cdd8b0e9e
 
 if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
 	configure_args+=" ac_cv_sys_file_offset_bits=no"

From 57425f250d69766bdc12e82d4f401d39edfc3881 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 14/36] cross-aarch64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..bd6b23f9fb6a 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 2715163bcedad08e3d6e7cbc97707816fd2fc013 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 15/36] cross-aarch64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..427ad2c1e9cd 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 8a829db83aef82fbf6a3dfe3acc4991d46498118 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 16/36] cross-arm-linux-gnueabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..2510ee26e789 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 0baf6d0d3eb7fe09ebfc8b2dbcbb8d4c8f5e668b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 17/36] cross-arm-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..bd8b16e1b4c1 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From f7d5062652913883b7315a0fe09031b2e7b396b7 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 18/36] cross-arm-linux-musleabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..dacfd2655216 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From a268081fb6de393709549570fa58fbe78f31a10f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 19/36] cross-arm-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..9ddd32a9f20d 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From f5a836761adc955e3d7d48502cedcc2c727cd8a6 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 20/36] cross-armv7l-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..9fb00f18be3b 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From c7508a99c8010f16ac0aa7a89023d1c24da43fc3 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 21/36] cross-armv7l-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..2c72e75ddfe3 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 39ed71c1f0a623a4d00ae78b0ab79290797ad3ec Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 22/36] cross-i686-pc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..4dc17df648b5 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From d3c00116056d572f6880e6fa74fb76e2a909bed6 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 23/36] cross-mips-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..6009e5c79eb2 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From c7844f806424bc5e16db0f0d7accb4e333042de0 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 24/36] cross-mips-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..080164df193d 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="hipperson0 <hipperson0@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 3596d48a54ac20e0b48ea78d943c6d5622a76628 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 25/36] cross-mipsel-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..f9fd4b8a04ef 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From e7effd5550164faa54e3ee18df23ce6a822f65e1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 26/36] cross-mipsel-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..7418a984474b 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 0be4bfd5b2681e340ac1aa8a57da051bacaf23dc Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 27/36] cross-powerpc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..31e57b4e52b2 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From e12d191bb12b6fa76c53e8d656206019fec04281 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 28/36] cross-powerpc-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..a2d1edcf1ffd 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 91881f8c89c775f62ff4625e3fe258043f9a69d5 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 29/36] cross-powerpc64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..1a4cbed61e76 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From b78c70afb653addd194c159b8803f588c4b257bd Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 30/36] cross-powerpc64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 1ebd0fb2048d..ade42018af05 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 1486d53c5eaa67708139a35a627c626d5f2c854e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 31/36] cross-powerpc64le-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 733f5851da5c..03054239001e 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 9c475c6c4c79356b96045ce044cfd274de69f221 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 32/36] cross-powerpc64le-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index 76a70aa1d6db..5887f845f932 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 55b94df171730cae15e2cb984a94a10f325ff16a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 33/36] cross-powerpcle-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 347b8fcf4f55..06530e0d609b 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From d043a3493411d16414bb6066cc78299d7ddae346 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 34/36] cross-powerpcle-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index ec9324ddaa99..e68c3962b49c 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 04d16eefc8d50221cc379cac5becf77d67f05908 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 35/36] cross-x86_64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 0078fbe7224b..7da85c14b62d 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 882636fada17bcf9d13829e8700706341a6ef001 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 36/36] cross-x86_64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..2811de0d3c2e 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (78 preceding siblings ...)
  2022-09-09  6:01 ` [PR PATCH] [Updated] " oreo639
@ 2022-09-10 19:28 ` oreo639
  2022-09-13 22:24 ` oreo639
                   ` (184 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-09-10 19:28 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5538 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.2.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.2.0

This PR depends on: https://github.com/void-linux/void-packages/pull/32330

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

Also, keep in mind that the libgo musl patch here will need to be updated once musl is updated:
https://github.com/void-linux/void-packages/pull/34902/files#diff-1f42a95b93c9550178ff1fbccbef2f47a72711df15c24c9472e2550076978129R163-R176

This is the updated patch for reference:
https://github.com/alpinelinux/aports/blob/8acb21b8ee881e7ab1c812d9a66a17d2501b8730/main/gcc/0049-libgo-adjust-name-of-union-in-sigevent-struct.patch

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/38817
- [x] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [x] llvm https://github.com/void-linux/void-packages/pull/38694
- [x] m4 https://github.com/void-linux/void-packages/pull/33730
- [x] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [x] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [x] libvirt https://github.com/void-linux/void-packages/pull/38842
- [x] syslinux https://github.com/void-linux/void-packages/pull/38876
- [x] efivar https://github.com/void-linux/void-packages/pull/38874

Known packages that needed to be fixed/updated for gcc12:
- [ ] linux5.18 (in this PR)
- [x] openssh https://github.com/void-linux/void-packages/pull/38849
- [x] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [x] doxygen https://github.com/void-linux/void-packages/pull/38846
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/38817
- [x] libproxy https://github.com/void-linux/void-packages/pull/38818
- [x] exempi https://github.com/void-linux/void-packages/pull/38820
- [x] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [ ] gpgme https://github.com/void-linux/void-packages/pull/38825
- [x] libunique1 https://github.com/void-linux/void-packages/pull/38848 or https://github.com/void-linux/void-packages/pull/38873
- [x] libwpd https://github.com/void-linux/void-packages/pull/38878

Needs to be fixed/updated for binutils:
- [x] grub https://github.com/void-linux/void-packages/pull/38875
- [x] linux-tools https://github.com/void-linux/void-packages/pull/38877

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [x] kde
- [x] lxde
- [x] lxqt

You can test the ISOs here:
https://drive.google.com/drive/folders/1ix92CYSLUP-KWjLxltdgG4e8Nu2JCY5n?usp=sharing

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 106814 bytes --]

From c8d5cc319fb3347f1d34aa0974be65c00c8a0fa3 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 01/35] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../fix-libcollector-without-java.patch       | 53 +++++++++++++++
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 16 +++--
 4 files changed, 82 insertions(+), 113 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
 create mode 100644 srcpkgs/binutils/patches/fix-libcollector-without-java.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/fix-libcollector-without-java.patch b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
new file mode 100644
index 000000000000..54384875f358
--- /dev/null
+++ b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
@@ -0,0 +1,53 @@
+From 49ddd814ac1071af7c4f45d5f8398b91862f2c7f Mon Sep 17 00:00:00 2001
+From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
+Date: Wed, 17 Aug 2022 19:55:23 -0700
+Subject: [PATCH] gprofng: fix bug 29479 Collection fails when built without
+ java support
+
+gprofng/ChangeLog
+2022-08-17  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>
+
+	PR gprofng/29479
+	* libcollector/collector.c: Add #if defined(GPROFNG_JAVA_PROFILING) for
+	java specific code.
+	* libcollector/unwind.c: Likewise.
+---
+ gprofng/libcollector/collector.c | 2 ++
+ gprofng/libcollector/unwind.c    | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/gprofng/libcollector/collector.c b/gprofng/libcollector/collector.c
+index 93c9d3330de5..ceff2c1caccb 100644
+--- a/gprofng/libcollector/collector.c
++++ b/gprofng/libcollector/collector.c
+@@ -913,8 +913,10 @@ __collector_open_experiment (const char *exp, const char *params, sp_origin_t or
+   __collector_ext_unwind_key_init (1, NULL);
+ 
+   /* start java attach if suitable */
++#if defined(GPROFNG_JAVA_PROFILING)
+   if (exp_origin == SP_ORIGIN_DBX_ATTACH)
+     __collector_jprofile_start_attach ();
++#endif
+   start_sec_time = CALL_UTIL (time)(NULL);
+   __collector_start_time = collector_interface.getHiResTime ();
+   TprintfT (DBG_LT0, "\t__collector_open_experiment; resetting start_time\n");
+diff --git a/gprofng/libcollector/unwind.c b/gprofng/libcollector/unwind.c
+index 119243788020..f8e11823c81e 100644
+--- a/gprofng/libcollector/unwind.c
++++ b/gprofng/libcollector/unwind.c
+@@ -557,6 +557,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+   int size = max_frame_size;
+ 
+ #define MIN(a,b) ((a)<(b)?(a):(b))
++#if defined(GPROFNG_JAVA_PROFILING)
+   /* get Java info */
+   if (__collector_java_mode && __collector_java_asyncgetcalltrace_loaded && context && !pseudo_context)
+     {
+@@ -569,6 +570,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+ 	  size -= sz;
+ 	}
+     }
++#endif
+ 
+   /* get native stack */
+   if (context)
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..0abcfcfe4f9b 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkg-config"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -44,6 +45,12 @@ do_configure() {
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	# gprofng currently only supports x86 and aarch64 glibc.
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64|i386|aarch64) conf+=" --enable-gprofng" ;;
+		*) conf+=" --disable-gprofng" ;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"
@@ -76,6 +83,7 @@ do_configure() {
 		--libdir=/usr/lib \
 		--mandir=/usr/share/man \
 		--infodir=/usr/share/info \
+		--sysconfdir=/etc \
 		--disable-werror \
 		--disable-shared \
 		--disable-nls \

From 18a617dd6b829e92f89bcb940e46d3ed8695d4ba Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 02/35] gcc: update to 12.2.0.

---
 common/shlibs                                 | 10 +--
 srcpkgs/gcc/files/gccgo-musl.patch            | 74 ++++---------------
 srcpkgs/gcc/files/libgnarl-musl.patch         | 18 ++---
 srcpkgs/gcc/files/libssp-musl.patch           | 10 +--
 srcpkgs/gcc/patches/libffi_gnulinux.patch     | 11 ---
 .../gcc/patches/libgcc-ibm128-no-tag.patch    | 10 ++-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |  2 +-
 srcpkgs/gcc/template                          | 25 +++----
 8 files changed, 52 insertions(+), 108 deletions(-)
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index de889fceaf6c..74055ddc60be 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.2.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.34 perl-5.34.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -846,8 +846,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.2.0_1
+libgnat-12.so libada-12.2.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1696,8 +1696,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.2.0_1
+libasan.so.8 libsanitizer-12.2.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..632ef951097b 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,17 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ a/libgo/go/runtime/os_linux.go
+@@ -363,9 +363,9 @@
+ 
+ 	var timerid int32
+ 	var sevp _sigevent
+-	sevp.sigev_notify = _SIGEV_THREAD_ID
++	sevp.sigev_notify = 4
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.sigev_notify_function))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..446741390d45 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,15 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
+version=12.2.0
+revision=1
 _patchver="${version%pre*}"
 _minorver="${_patchver%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 wrksrc=gcc-${version/pre/_pre}
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +19,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -396,7 +393,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}

From fe82c3c55aa8ede786bb92d8edab3b7ad9ec2092 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 03/35] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      | 11 ++++--
 2 files changed, 25 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..70c4aa533e66 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,12 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
+
+if [ "$XBPS_LIBC" == "musl" ]; then
+# Musl always searches LD_LIBRARY_PATH before RPATH and RUNPATH
+make_build_args="lt_cv_shlibpath_overrides_runpath=yes"
+fi
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From cbe33d074c0132d74119d24bdab8550d0858c0db Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 04/35] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 1a4e1ca3d594..b04268908c2e 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="q66 <daniel@octaforge.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From aead62a1b88598db6e67b944c93af7150de45cd8 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 05/35] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 3 files changed, 55 insertions(+), 353 deletions(-)
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index 74055ddc60be..e5cdf6a3b9ab 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From 227ae55235c427f9d70e3ed207ca9ced4600562c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 21:01:43 -0700
Subject: [PATCH 06/35] gcc-multilib: update to 12.2.0.

---
 srcpkgs/gcc-multilib/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index fcd25755aa75..1a26da26a991 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,16 +3,16 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _majorver="${version%.*}"
-wrksrc=gcc-${version/pre/_pre}
+wrksrc=gcc-${version}
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel

From fcd95b5515df6f9d4a464189887c6af47be0d8a7 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 14 Aug 2022 19:29:36 -0700
Subject: [PATCH 07/35] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove -no-pie from build. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..fcc00b3a6c5d 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -53,6 +53,7 @@ _void_cross_build_binutils() {
 		--sbindir=/usr/bin \
 		--libdir=/usr/lib \
 		--libexecdir=/usr/lib \
+		--sysconfdir=/etc \
 		--target=${tgt} \
 		--with-sysroot=/usr/${tgt} \
 		--disable-nls \
@@ -60,6 +61,7 @@ _void_cross_build_binutils() {
 		--disable-multilib \
 		--disable-werror \
 		--disable-gold \
+		--disable-gprofng \
 		--enable-relro \
 		--enable-plugins \
 		--enable-64-bit-bfd \
@@ -132,6 +134,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -460,6 +463,14 @@ do_build() {
 	local binutils_ver linux_ver gcc_ver libc_ver libucontext_ver
 	local tgt=${sourcepkg/cross-}
 
+	export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}"
+	export CXXFLAGS="${CXXFLAGS/-D_FORTIFY_SOURCE=2/}"
+
+	# Disable explicit -fno-PIE, gcc/binutils/libc will figure this out itself.
+	export CFLAGS="${CFLAGS//-fno-PIE/}"
+	export CXXFLAGS="${CXXFLAGS//-fno-PIE/}"
+	export LDFLAGS="${LDFLAGS//-no-pie/}"
+
 	_void_cross_test_ver binutils
 	_void_cross_test_ver linux
 	_void_cross_test_ver gcc
@@ -625,6 +636,9 @@ do_install() {
 	# then remove it because it conflicts with libquadmath package
 	rm -rf ${DESTDIR}/${sysroot}/usr/lib/libquadmath.*
 
+	# Remove libdep linker plugin because it conflicts with system binutils
+	rm -f ${DESTDIR}/usr/lib/bfd-plugins/libdep*
+
 	# Remove leftover symlinks
 	rm -f ${DESTDIR}/usr/lib${XBPS_TARGET_WORDSIZE}
 	rm -f ${DESTDIR}/lib*

From 1b2ac3583102f03d9a736fd33a38b3b4b919b908 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:09:31 -0700
Subject: [PATCH 08/35] linux5.18: update dotconfigs for gcc12

---
 srcpkgs/linux5.18/files/x86_64-dotconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/linux5.18/files/x86_64-dotconfig b/srcpkgs/linux5.18/files/x86_64-dotconfig
index 4e73a3195d40..ea6204868e23 100644
--- a/srcpkgs/linux5.18/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.18/files/x86_64-dotconfig
@@ -512,6 +512,7 @@ CONFIG_RETHUNK=y
 CONFIG_CPU_UNRET_ENTRY=y
 CONFIG_CPU_IBPB_ENTRY=y
 CONFIG_CPU_IBRS_ENTRY=y
+CONFIG_SLS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10060,8 +10061,11 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
 # Memory initialization
 #
 CONFIG_INIT_STACK_NONE=y
+# CONFIG_INIT_STACK_ALL_PATTERN is not set
+# CONFIG_INIT_STACK_ALL_ZERO is not set
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
+# CONFIG_ZERO_CALL_USED_REGS is not set
 # end of Memory initialization
 # end of Kernel hardening options
 # end of Security options
@@ -10538,6 +10542,7 @@ CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
 # CONFIG_UBSAN is not set
 CONFIG_HAVE_ARCH_KCSAN=y
+# CONFIG_KCSAN is not set
 # end of Generic Kernel Debugging Instruments
 
 #

From eefb9b9bef243cf8f55aa541f4561302b488c0b6 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 14:45:28 -0700
Subject: [PATCH 09/35] libsasl: fix build for libtool 2.4.7

---
 srcpkgs/libsasl/template | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/libsasl/template b/srcpkgs/libsasl/template
index a8817042f843..a2993b39f4a1 100644
--- a/srcpkgs/libsasl/template
+++ b/srcpkgs/libsasl/template
@@ -19,6 +19,7 @@ distfiles="https://github.com/cyrusimap/cyrus-sasl/releases/download/cyrus-sasl-
 checksum=26866b1549b00ffd020f188a43c258017fa1c382b3ddadd8201536f72efb05d5
 
 pre_configure() {
+	rm -f m4/ltversion.m4
 	autoreconf -fi
 }
 

From 7ba94804e7a0c58172c8130513877e32a75c5d0d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:08 -0700
Subject: [PATCH 10/35] subversion: fix build for libtool 2.4.7

---
 srcpkgs/subversion/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion/template b/srcpkgs/subversion/template
index 8ad178264942..3f1c9e254e61 100644
--- a/srcpkgs/subversion/template
+++ b/srcpkgs/subversion/template
@@ -57,7 +57,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From 6dbb7da1e410ca37cd864a8ec98b519a039b0aa8 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:38 -0700
Subject: [PATCH 11/35] subversion-kwallet-auth: fix build for libtool 2.4.7

---
 srcpkgs/subversion-kwallet-auth/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion-kwallet-auth/template b/srcpkgs/subversion-kwallet-auth/template
index 12210f250d51..b4d8621456ea 100644
--- a/srcpkgs/subversion-kwallet-auth/template
+++ b/srcpkgs/subversion-kwallet-auth/template
@@ -59,7 +59,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From 1047121659ff7725d39ab50dbb7bb352ae82f10a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 20:07:32 -0700
Subject: [PATCH 12/35] gpgme: update to 1.18.0.

---
 common/shlibs          | 2 +-
 srcpkgs/gpgme/template | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index e5cdf6a3b9ab..a1d2847ac24c 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -721,7 +721,7 @@ libdconf.so.1 dconf-0.13.90_1
 libassuan.so.0 libassuan-2.0.1_1
 libgpgme.so.11 libgpgme-1.12.0_2
 libgpgmepp.so.6 gpgmepp-1.7.0_3
-libqgpgme.so.7 gpgmeqt-1.7.0_3
+libqgpgme.so.15 gpgmeqt-1.18.0_1
 libgarcon-1.so.0 garcon-0.1.12_1
 libgarcon-gtk2-1.so.0 garcon-0.4.0_1
 libgarcon-gtk3-1.so.0 garcon-0.6.1_1
diff --git a/srcpkgs/gpgme/template b/srcpkgs/gpgme/template
index 8633075a8404..b1cfd5f78657 100644
--- a/srcpkgs/gpgme/template
+++ b/srcpkgs/gpgme/template
@@ -1,7 +1,7 @@
 # Template file for 'gpgme'
 pkgname=gpgme
-version=1.15.1
-revision=2
+version=1.18.0
+revision=1
 build_style=gnu-configure
 configure_args="--enable-fd-passing
  --with-libgpg-error-prefix=$XBPS_CROSS_BASE/usr
@@ -14,7 +14,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.gnupg.org/software/gpgme/index.html"
 distfiles="https://www.gnupg.org/ftp/gcrypt/gpgme/gpgme-${version}.tar.bz2"
-checksum=eebc3c1b27f1c8979896ff361ba9bb4778b508b2496c2fc10e3775a40b1de1ad
+checksum=361d4eae47ce925dba0ea569af40e7b52c645c4ae2e65e5621bf1b6cdd8b0e9e
 
 if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
 	configure_args+=" ac_cv_sys_file_offset_bits=no"

From 59f2a879601b2544c9774a032729700f44b7119a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 13/35] cross-aarch64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..bd6b23f9fb6a 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 1cb748a00f0f2962f70403158d86f0a198f20ee1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 14/35] cross-aarch64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..427ad2c1e9cd 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 8058dfea4663e46ffd7929af9506f348930360d6 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 15/35] cross-arm-linux-gnueabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..2510ee26e789 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From b81c4c83f87cd62c06858a5c390af344cc07e3d0 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 16/35] cross-arm-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..bd8b16e1b4c1 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From b27419af4c1f97f31c2b28e331c7184a94d5ad19 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 17/35] cross-arm-linux-musleabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..dacfd2655216 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From f1e958953b739111e7b865b27e3c6045d4433de4 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 18/35] cross-arm-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..9ddd32a9f20d 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From ff96364b845258347c4b2c86e4a10b697f5ce650 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 19/35] cross-armv7l-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..9fb00f18be3b 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 72d7ba740d56b1f0e5050ab981a8eb104b223f6d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 20/35] cross-armv7l-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..2c72e75ddfe3 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 6e11f4fa376742a7b96b430df461f01ec76e41d9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 21/35] cross-i686-pc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..4dc17df648b5 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From b57d72d35d2f01f5c4797c4e3e6aa34d5da6b252 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 22/35] cross-mips-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..6009e5c79eb2 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From d80c9276d08ca39a4db2725074b1817b86687dcc Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 23/35] cross-mips-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..080164df193d 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="hipperson0 <hipperson0@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From afe288eecb7fb81086dd4b75eec13786e143bed0 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 24/35] cross-mipsel-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..f9fd4b8a04ef 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 8894b2f92f5d431e1b35ff496f5efd7c23685e9e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 25/35] cross-mipsel-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..7418a984474b 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 7a7b8df0be4ea9917f26948cb55682cd48ef40e0 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 26/35] cross-powerpc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..31e57b4e52b2 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 090d2c5355a944e9b7a2dd6f0dfb3d4ebbdb585b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 27/35] cross-powerpc-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..a2d1edcf1ffd 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 10602c676d55ef2358c0e5b0a10ee0760ff2c33a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 28/35] cross-powerpc64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..1a4cbed61e76 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From dbe355d544098c81c45c87dfa9adf2e3bb6a41ad Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 29/35] cross-powerpc64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 1ebd0fb2048d..ade42018af05 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 1b6cae5c46b067c74402dc5631a85573444bc9d1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 30/35] cross-powerpc64le-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 733f5851da5c..03054239001e 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 5006ad02bfa049b58272fcd3aa6b938769cc1a68 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 31/35] cross-powerpc64le-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index 76a70aa1d6db..5887f845f932 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From f62642336bed26dd9e3c67545a5ade4d308c678f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 32/35] cross-powerpcle-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 347b8fcf4f55..06530e0d609b 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 61f7415049f4c89d318edf83d231e6d209578994 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 33/35] cross-powerpcle-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index ec9324ddaa99..e68c3962b49c 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 0cc4328aa4d445e0efe66958ea3ee3f2ce9f270e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 34/35] cross-x86_64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 0078fbe7224b..7da85c14b62d 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 3ab588e26da859ea4a419d21c7f095c7dbe9e45d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 35/35] cross-x86_64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..2811de0d3c2e 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (79 preceding siblings ...)
  2022-09-10 19:28 ` oreo639
@ 2022-09-13 22:24 ` oreo639
  2022-09-14  5:37 ` oreo639
                   ` (183 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-09-13 22:24 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5538 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.2.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.2.0

This PR depends on: https://github.com/void-linux/void-packages/pull/32330

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

Also, keep in mind that the libgo musl patch here will need to be updated once musl is updated:
https://github.com/void-linux/void-packages/pull/34902/files#diff-1f42a95b93c9550178ff1fbccbef2f47a72711df15c24c9472e2550076978129R163-R176

This is the updated patch for reference:
https://github.com/alpinelinux/aports/blob/8acb21b8ee881e7ab1c812d9a66a17d2501b8730/main/gcc/0049-libgo-adjust-name-of-union-in-sigevent-struct.patch

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/38817
- [x] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [x] llvm https://github.com/void-linux/void-packages/pull/38694
- [x] m4 https://github.com/void-linux/void-packages/pull/33730
- [x] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [x] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [x] libvirt https://github.com/void-linux/void-packages/pull/38842
- [x] syslinux https://github.com/void-linux/void-packages/pull/38876
- [x] efivar https://github.com/void-linux/void-packages/pull/38874

Known packages that needed to be fixed/updated for gcc12:
- [ ] linux5.18 (in this PR)
- [x] openssh https://github.com/void-linux/void-packages/pull/38849
- [x] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [x] doxygen https://github.com/void-linux/void-packages/pull/38846
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/38817
- [x] libproxy https://github.com/void-linux/void-packages/pull/38818
- [x] exempi https://github.com/void-linux/void-packages/pull/38820
- [x] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [ ] gpgme https://github.com/void-linux/void-packages/pull/38825
- [x] libunique1 https://github.com/void-linux/void-packages/pull/38848 or https://github.com/void-linux/void-packages/pull/38873
- [x] libwpd https://github.com/void-linux/void-packages/pull/38878

Needs to be fixed/updated for binutils:
- [x] grub https://github.com/void-linux/void-packages/pull/38875
- [x] linux-tools https://github.com/void-linux/void-packages/pull/38877

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [x] kde
- [x] lxde
- [x] lxqt

You can test the ISOs here:
https://drive.google.com/drive/folders/1ix92CYSLUP-KWjLxltdgG4e8Nu2JCY5n?usp=sharing

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 106814 bytes --]

From 176b101ec674cc5f6c609bf5bc86b0bed1e50621 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 01/35] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../fix-libcollector-without-java.patch       | 53 +++++++++++++++
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 16 +++--
 4 files changed, 82 insertions(+), 113 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
 create mode 100644 srcpkgs/binutils/patches/fix-libcollector-without-java.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/fix-libcollector-without-java.patch b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
new file mode 100644
index 000000000000..54384875f358
--- /dev/null
+++ b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
@@ -0,0 +1,53 @@
+From 49ddd814ac1071af7c4f45d5f8398b91862f2c7f Mon Sep 17 00:00:00 2001
+From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
+Date: Wed, 17 Aug 2022 19:55:23 -0700
+Subject: [PATCH] gprofng: fix bug 29479 Collection fails when built without
+ java support
+
+gprofng/ChangeLog
+2022-08-17  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>
+
+	PR gprofng/29479
+	* libcollector/collector.c: Add #if defined(GPROFNG_JAVA_PROFILING) for
+	java specific code.
+	* libcollector/unwind.c: Likewise.
+---
+ gprofng/libcollector/collector.c | 2 ++
+ gprofng/libcollector/unwind.c    | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/gprofng/libcollector/collector.c b/gprofng/libcollector/collector.c
+index 93c9d3330de5..ceff2c1caccb 100644
+--- a/gprofng/libcollector/collector.c
++++ b/gprofng/libcollector/collector.c
+@@ -913,8 +913,10 @@ __collector_open_experiment (const char *exp, const char *params, sp_origin_t or
+   __collector_ext_unwind_key_init (1, NULL);
+ 
+   /* start java attach if suitable */
++#if defined(GPROFNG_JAVA_PROFILING)
+   if (exp_origin == SP_ORIGIN_DBX_ATTACH)
+     __collector_jprofile_start_attach ();
++#endif
+   start_sec_time = CALL_UTIL (time)(NULL);
+   __collector_start_time = collector_interface.getHiResTime ();
+   TprintfT (DBG_LT0, "\t__collector_open_experiment; resetting start_time\n");
+diff --git a/gprofng/libcollector/unwind.c b/gprofng/libcollector/unwind.c
+index 119243788020..f8e11823c81e 100644
+--- a/gprofng/libcollector/unwind.c
++++ b/gprofng/libcollector/unwind.c
+@@ -557,6 +557,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+   int size = max_frame_size;
+ 
+ #define MIN(a,b) ((a)<(b)?(a):(b))
++#if defined(GPROFNG_JAVA_PROFILING)
+   /* get Java info */
+   if (__collector_java_mode && __collector_java_asyncgetcalltrace_loaded && context && !pseudo_context)
+     {
+@@ -569,6 +570,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+ 	  size -= sz;
+ 	}
+     }
++#endif
+ 
+   /* get native stack */
+   if (context)
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..0abcfcfe4f9b 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkg-config"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -44,6 +45,12 @@ do_configure() {
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	# gprofng currently only supports x86 and aarch64 glibc.
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64|i386|aarch64) conf+=" --enable-gprofng" ;;
+		*) conf+=" --disable-gprofng" ;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"
@@ -76,6 +83,7 @@ do_configure() {
 		--libdir=/usr/lib \
 		--mandir=/usr/share/man \
 		--infodir=/usr/share/info \
+		--sysconfdir=/etc \
 		--disable-werror \
 		--disable-shared \
 		--disable-nls \

From 0d214b6f012a502824c67a1c78348f4d865fb2fb Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 02/35] gcc: update to 12.2.0.

---
 common/shlibs                                 | 10 +--
 srcpkgs/gcc/files/gccgo-musl.patch            | 74 ++++---------------
 srcpkgs/gcc/files/libgnarl-musl.patch         | 18 ++---
 srcpkgs/gcc/files/libssp-musl.patch           | 10 +--
 srcpkgs/gcc/patches/libffi_gnulinux.patch     | 11 ---
 .../gcc/patches/libgcc-ibm128-no-tag.patch    | 10 ++-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |  2 +-
 srcpkgs/gcc/template                          | 25 +++----
 8 files changed, 52 insertions(+), 108 deletions(-)
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index ec58b8c40619..8f737837ffaf 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.2.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.34 perl-5.34.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -846,8 +846,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.2.0_1
+libgnat-12.so libada-12.2.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1697,8 +1697,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.2.0_1
+libasan.so.8 libsanitizer-12.2.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..632ef951097b 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,17 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ a/libgo/go/runtime/os_linux.go
+@@ -363,9 +363,9 @@
+ 
+ 	var timerid int32
+ 	var sevp _sigevent
+-	sevp.sigev_notify = _SIGEV_THREAD_ID
++	sevp.sigev_notify = 4
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.sigev_notify_function))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..446741390d45 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,15 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
+version=12.2.0
+revision=1
 _patchver="${version%pre*}"
 _minorver="${_patchver%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 wrksrc=gcc-${version/pre/_pre}
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +19,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -396,7 +393,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}

From 82c2e1f0f7425e267fa6e52f929fbb8c3fc297a1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 03/35] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      | 11 ++++--
 2 files changed, 25 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..70c4aa533e66 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,12 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
+
+if [ "$XBPS_LIBC" == "musl" ]; then
+# Musl always searches LD_LIBRARY_PATH before RPATH and RUNPATH
+make_build_args="lt_cv_shlibpath_overrides_runpath=yes"
+fi
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From 6103b082b66718a6a96215e1a6c5da95a4ca00c2 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 04/35] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 1a4e1ca3d594..b04268908c2e 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="q66 <daniel@octaforge.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From 7db0af360deae49e89d926452e515d2f096f42e6 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 05/35] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 3 files changed, 55 insertions(+), 353 deletions(-)
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index 8f737837ffaf..e9adcaefb3dc 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From 49a94a8d852cefebe5428994ccc45f84743ccb52 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 21:01:43 -0700
Subject: [PATCH 06/35] gcc-multilib: update to 12.2.0.

---
 srcpkgs/gcc-multilib/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index fcd25755aa75..1a26da26a991 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,16 +3,16 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _majorver="${version%.*}"
-wrksrc=gcc-${version/pre/_pre}
+wrksrc=gcc-${version}
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel

From 522f4954221654b4a70edbc087d6fe14226c2a49 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 14 Aug 2022 19:29:36 -0700
Subject: [PATCH 07/35] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove -no-pie from build. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..fcc00b3a6c5d 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -53,6 +53,7 @@ _void_cross_build_binutils() {
 		--sbindir=/usr/bin \
 		--libdir=/usr/lib \
 		--libexecdir=/usr/lib \
+		--sysconfdir=/etc \
 		--target=${tgt} \
 		--with-sysroot=/usr/${tgt} \
 		--disable-nls \
@@ -60,6 +61,7 @@ _void_cross_build_binutils() {
 		--disable-multilib \
 		--disable-werror \
 		--disable-gold \
+		--disable-gprofng \
 		--enable-relro \
 		--enable-plugins \
 		--enable-64-bit-bfd \
@@ -132,6 +134,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -460,6 +463,14 @@ do_build() {
 	local binutils_ver linux_ver gcc_ver libc_ver libucontext_ver
 	local tgt=${sourcepkg/cross-}
 
+	export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}"
+	export CXXFLAGS="${CXXFLAGS/-D_FORTIFY_SOURCE=2/}"
+
+	# Disable explicit -fno-PIE, gcc/binutils/libc will figure this out itself.
+	export CFLAGS="${CFLAGS//-fno-PIE/}"
+	export CXXFLAGS="${CXXFLAGS//-fno-PIE/}"
+	export LDFLAGS="${LDFLAGS//-no-pie/}"
+
 	_void_cross_test_ver binutils
 	_void_cross_test_ver linux
 	_void_cross_test_ver gcc
@@ -625,6 +636,9 @@ do_install() {
 	# then remove it because it conflicts with libquadmath package
 	rm -rf ${DESTDIR}/${sysroot}/usr/lib/libquadmath.*
 
+	# Remove libdep linker plugin because it conflicts with system binutils
+	rm -f ${DESTDIR}/usr/lib/bfd-plugins/libdep*
+
 	# Remove leftover symlinks
 	rm -f ${DESTDIR}/usr/lib${XBPS_TARGET_WORDSIZE}
 	rm -f ${DESTDIR}/lib*

From d2f4be95639fe42a2efabd9227e227d0a992d20f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:09:31 -0700
Subject: [PATCH 08/35] linux5.18: update dotconfigs for gcc12

---
 srcpkgs/linux5.18/files/x86_64-dotconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/linux5.18/files/x86_64-dotconfig b/srcpkgs/linux5.18/files/x86_64-dotconfig
index 4e73a3195d40..ea6204868e23 100644
--- a/srcpkgs/linux5.18/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.18/files/x86_64-dotconfig
@@ -512,6 +512,7 @@ CONFIG_RETHUNK=y
 CONFIG_CPU_UNRET_ENTRY=y
 CONFIG_CPU_IBPB_ENTRY=y
 CONFIG_CPU_IBRS_ENTRY=y
+CONFIG_SLS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10060,8 +10061,11 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
 # Memory initialization
 #
 CONFIG_INIT_STACK_NONE=y
+# CONFIG_INIT_STACK_ALL_PATTERN is not set
+# CONFIG_INIT_STACK_ALL_ZERO is not set
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
+# CONFIG_ZERO_CALL_USED_REGS is not set
 # end of Memory initialization
 # end of Kernel hardening options
 # end of Security options
@@ -10538,6 +10542,7 @@ CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
 # CONFIG_UBSAN is not set
 CONFIG_HAVE_ARCH_KCSAN=y
+# CONFIG_KCSAN is not set
 # end of Generic Kernel Debugging Instruments
 
 #

From 668539878fa4784cbc362e6845a9a7e1dd0c7488 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 14:45:28 -0700
Subject: [PATCH 09/35] libsasl: fix build for libtool 2.4.7

---
 srcpkgs/libsasl/template | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/libsasl/template b/srcpkgs/libsasl/template
index a8817042f843..a2993b39f4a1 100644
--- a/srcpkgs/libsasl/template
+++ b/srcpkgs/libsasl/template
@@ -19,6 +19,7 @@ distfiles="https://github.com/cyrusimap/cyrus-sasl/releases/download/cyrus-sasl-
 checksum=26866b1549b00ffd020f188a43c258017fa1c382b3ddadd8201536f72efb05d5
 
 pre_configure() {
+	rm -f m4/ltversion.m4
 	autoreconf -fi
 }
 

From d0c32e4975b9f09d8e103da052549704dafb97df Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:08 -0700
Subject: [PATCH 10/35] subversion: fix build for libtool 2.4.7

---
 srcpkgs/subversion/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion/template b/srcpkgs/subversion/template
index 8ad178264942..3f1c9e254e61 100644
--- a/srcpkgs/subversion/template
+++ b/srcpkgs/subversion/template
@@ -57,7 +57,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From af6233cdd09fb170a4f782a750be75a56e554456 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:38 -0700
Subject: [PATCH 11/35] subversion-kwallet-auth: fix build for libtool 2.4.7

---
 srcpkgs/subversion-kwallet-auth/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion-kwallet-auth/template b/srcpkgs/subversion-kwallet-auth/template
index 12210f250d51..b4d8621456ea 100644
--- a/srcpkgs/subversion-kwallet-auth/template
+++ b/srcpkgs/subversion-kwallet-auth/template
@@ -59,7 +59,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From ae5e2b8abe5dffad438f5bff5068295504014d9a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 20:07:32 -0700
Subject: [PATCH 12/35] gpgme: update to 1.18.0.

---
 common/shlibs          | 2 +-
 srcpkgs/gpgme/template | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index e9adcaefb3dc..361e3dddca3e 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -721,7 +721,7 @@ libdconf.so.1 dconf-0.13.90_1
 libassuan.so.0 libassuan-2.0.1_1
 libgpgme.so.11 libgpgme-1.12.0_2
 libgpgmepp.so.6 gpgmepp-1.7.0_3
-libqgpgme.so.7 gpgmeqt-1.7.0_3
+libqgpgme.so.15 gpgmeqt-1.18.0_1
 libgarcon-1.so.0 garcon-0.1.12_1
 libgarcon-gtk2-1.so.0 garcon-0.4.0_1
 libgarcon-gtk3-1.so.0 garcon-0.6.1_1
diff --git a/srcpkgs/gpgme/template b/srcpkgs/gpgme/template
index 8633075a8404..b1cfd5f78657 100644
--- a/srcpkgs/gpgme/template
+++ b/srcpkgs/gpgme/template
@@ -1,7 +1,7 @@
 # Template file for 'gpgme'
 pkgname=gpgme
-version=1.15.1
-revision=2
+version=1.18.0
+revision=1
 build_style=gnu-configure
 configure_args="--enable-fd-passing
  --with-libgpg-error-prefix=$XBPS_CROSS_BASE/usr
@@ -14,7 +14,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.gnupg.org/software/gpgme/index.html"
 distfiles="https://www.gnupg.org/ftp/gcrypt/gpgme/gpgme-${version}.tar.bz2"
-checksum=eebc3c1b27f1c8979896ff361ba9bb4778b508b2496c2fc10e3775a40b1de1ad
+checksum=361d4eae47ce925dba0ea569af40e7b52c645c4ae2e65e5621bf1b6cdd8b0e9e
 
 if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
 	configure_args+=" ac_cv_sys_file_offset_bits=no"

From d96652443a82ff7bd936ae12122bf75dc17e5ac8 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 13/35] cross-aarch64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..bd6b23f9fb6a 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From e9145e9f5b3e212d8566a87df86aac6447fd35f8 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 14/35] cross-aarch64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..427ad2c1e9cd 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 0df31479594280277102c5ccbe5304ac922c1423 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 15/35] cross-arm-linux-gnueabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..2510ee26e789 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 2c55156bad6859ffba303d3c6543b33a1f44e1ab Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 16/35] cross-arm-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..bd8b16e1b4c1 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From eba617ab57345850654654012c7c361b0c221302 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 17/35] cross-arm-linux-musleabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..dacfd2655216 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 5923711d3e075068908cbf7f54e0ac02ebf8b5b8 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 18/35] cross-arm-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..9ddd32a9f20d 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From dd9d7253753c9bf36f25d7937f1a80afcb9d5e09 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 19/35] cross-armv7l-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..9fb00f18be3b 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 838eee10f19a42d64a5cb26053ef01335c46db96 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 20/35] cross-armv7l-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..2c72e75ddfe3 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From ffbd84b0eb465206dde555de824f85ecbb8bf41f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 21/35] cross-i686-pc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..4dc17df648b5 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From d0addc56ce6e07c407c1229b9fee81646b98d0a8 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 22/35] cross-mips-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..6009e5c79eb2 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From f4b04e06e38eff250f0ebbf9942a8629028dbd03 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 23/35] cross-mips-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..080164df193d 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="hipperson0 <hipperson0@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 7fba3458532094343a07612215a006781315318d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 24/35] cross-mipsel-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..f9fd4b8a04ef 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 05d18cc01debb139ae0150d1445e0d9896a222d3 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 25/35] cross-mipsel-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..7418a984474b 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 05e597b8aee0cc7d3ffcae3566deb1b9fe259d40 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 26/35] cross-powerpc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..31e57b4e52b2 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From e9cace5d9ef08187f3dc889d1ab8e1b03a43d662 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 27/35] cross-powerpc-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..a2d1edcf1ffd 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 841e0c8375fbfc2bf0d4c548299d3b31dfb9dd21 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 28/35] cross-powerpc64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..1a4cbed61e76 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From c5e46d093e60b21d43a03c65b20a2dbb0afb1b8e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 29/35] cross-powerpc64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 1ebd0fb2048d..ade42018af05 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 0426f571ce9ec2323a2cff4d06ea6100996355f6 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 30/35] cross-powerpc64le-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 733f5851da5c..03054239001e 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From ff0f5786d97632b285d52859fccdc9c68c096063 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 31/35] cross-powerpc64le-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index 76a70aa1d6db..5887f845f932 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 4104216eaab065a2adaf3ccd07953254c345deb2 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 32/35] cross-powerpcle-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 347b8fcf4f55..06530e0d609b 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From b7e8b94358c6a60c518ca86a229ed9d82527f311 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 33/35] cross-powerpcle-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index ec9324ddaa99..e68c3962b49c 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 49071f53dcc00b884153373660591e9ce0bafe7e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 34/35] cross-x86_64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 0078fbe7224b..7da85c14b62d 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 425c638f5fa5acc2a15f2aaed989812a3331e560 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 35/35] cross-x86_64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..2811de0d3c2e 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (80 preceding siblings ...)
  2022-09-13 22:24 ` oreo639
@ 2022-09-14  5:37 ` oreo639
  2022-09-14 10:53 ` oreo639
                   ` (182 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-09-14  5:37 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5599 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.2.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.2.0

This PR depends on: https://github.com/void-linux/void-packages/pull/32330

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

Also, keep in mind that the libgo musl patch here will need to be updated once musl is updated:
https://github.com/void-linux/void-packages/pull/34902/files#diff-1f42a95b93c9550178ff1fbccbef2f47a72711df15c24c9472e2550076978129R163-R176

This is the updated patch for reference:
https://github.com/alpinelinux/aports/blob/8acb21b8ee881e7ab1c812d9a66a17d2501b8730/main/gcc/0049-libgo-adjust-name-of-union-in-sigevent-struct.patch

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/38817
- [x] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [x] llvm https://github.com/void-linux/void-packages/pull/38694
- [x] m4 https://github.com/void-linux/void-packages/pull/33730
- [x] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [x] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [x] libvirt https://github.com/void-linux/void-packages/pull/38842
- [x] syslinux https://github.com/void-linux/void-packages/pull/38876
- [x] efivar https://github.com/void-linux/void-packages/pull/38874

Known packages that needed to be fixed/updated for gcc12:
- [ ] linux5.18 (in this PR)
- [x] openssh https://github.com/void-linux/void-packages/pull/38849
- [x] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [x] doxygen https://github.com/void-linux/void-packages/pull/38846
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/38817
- [x] libproxy https://github.com/void-linux/void-packages/pull/38818
- [x] exempi https://github.com/void-linux/void-packages/pull/38820
- [x] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [ ] gpgme https://github.com/void-linux/void-packages/pull/38825
- [x] libunique1 https://github.com/void-linux/void-packages/pull/38848 or https://github.com/void-linux/void-packages/pull/38873
- [x] libwpd https://github.com/void-linux/void-packages/pull/38878

Needs to be fixed/updated for binutils:
- [x] grub https://github.com/void-linux/void-packages/pull/38875
- [x] linux-tools https://github.com/void-linux/void-packages/pull/38877
- [ ] kcov https://github.com/SimonKagstrom/kcov/issues/381

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [x] kde
- [x] lxde
- [x] lxqt

You can test the ISOs here:
https://drive.google.com/drive/folders/1ix92CYSLUP-KWjLxltdgG4e8Nu2JCY5n?usp=sharing

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 107105 bytes --]

From 4fa8ad96f87ace620a1c39d675a9950a39c82fbe Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 01/35] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../fix-libcollector-without-java.patch       | 53 +++++++++++++++
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 21 ++++--
 4 files changed, 85 insertions(+), 115 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
 create mode 100644 srcpkgs/binutils/patches/fix-libcollector-without-java.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/fix-libcollector-without-java.patch b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
new file mode 100644
index 000000000000..54384875f358
--- /dev/null
+++ b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
@@ -0,0 +1,53 @@
+From 49ddd814ac1071af7c4f45d5f8398b91862f2c7f Mon Sep 17 00:00:00 2001
+From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
+Date: Wed, 17 Aug 2022 19:55:23 -0700
+Subject: [PATCH] gprofng: fix bug 29479 Collection fails when built without
+ java support
+
+gprofng/ChangeLog
+2022-08-17  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>
+
+	PR gprofng/29479
+	* libcollector/collector.c: Add #if defined(GPROFNG_JAVA_PROFILING) for
+	java specific code.
+	* libcollector/unwind.c: Likewise.
+---
+ gprofng/libcollector/collector.c | 2 ++
+ gprofng/libcollector/unwind.c    | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/gprofng/libcollector/collector.c b/gprofng/libcollector/collector.c
+index 93c9d3330de5..ceff2c1caccb 100644
+--- a/gprofng/libcollector/collector.c
++++ b/gprofng/libcollector/collector.c
+@@ -913,8 +913,10 @@ __collector_open_experiment (const char *exp, const char *params, sp_origin_t or
+   __collector_ext_unwind_key_init (1, NULL);
+ 
+   /* start java attach if suitable */
++#if defined(GPROFNG_JAVA_PROFILING)
+   if (exp_origin == SP_ORIGIN_DBX_ATTACH)
+     __collector_jprofile_start_attach ();
++#endif
+   start_sec_time = CALL_UTIL (time)(NULL);
+   __collector_start_time = collector_interface.getHiResTime ();
+   TprintfT (DBG_LT0, "\t__collector_open_experiment; resetting start_time\n");
+diff --git a/gprofng/libcollector/unwind.c b/gprofng/libcollector/unwind.c
+index 119243788020..f8e11823c81e 100644
+--- a/gprofng/libcollector/unwind.c
++++ b/gprofng/libcollector/unwind.c
+@@ -557,6 +557,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+   int size = max_frame_size;
+ 
+ #define MIN(a,b) ((a)<(b)?(a):(b))
++#if defined(GPROFNG_JAVA_PROFILING)
+   /* get Java info */
+   if (__collector_java_mode && __collector_java_asyncgetcalltrace_loaded && context && !pseudo_context)
+     {
+@@ -569,6 +570,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+ 	  size -= sz;
+ 	}
+     }
++#endif
+ 
+   /* get native stack */
+   if (context)
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..71895f2073fd 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkg-config"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -44,6 +45,12 @@ do_configure() {
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	# gprofng currently only supports x86 and aarch64 glibc.
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64|i386|aarch64) conf+=" --enable-gprofng" ;;
+		*) conf+=" --disable-gprofng" ;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"
@@ -76,9 +83,10 @@ do_configure() {
 		--libdir=/usr/lib \
 		--mandir=/usr/share/man \
 		--infodir=/usr/share/info \
+		--sysconfdir=/etc \
 		--disable-werror \
-		--disable-shared \
 		--disable-nls \
+		--enable-shared \
 		--enable-threads \
 		--enable-plugins \
 		--enable-relro \
@@ -142,7 +150,8 @@ binutils-devel_package() {
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/*.a"
-		vmove "usr/lib/*.so"
+		vmove "usr/lib/libbfd.so"
+		vmove "usr/lib/libopcodes.so"
 	}
 }
 

From fd02958439028ca2babae1bfb119ed88bdc94c89 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 02/35] gcc: update to 12.2.0.

---
 common/shlibs                                 | 10 +--
 srcpkgs/gcc/files/gccgo-musl.patch            | 74 ++++---------------
 srcpkgs/gcc/files/libgnarl-musl.patch         | 18 ++---
 srcpkgs/gcc/files/libssp-musl.patch           | 10 +--
 srcpkgs/gcc/patches/libffi_gnulinux.patch     | 11 ---
 .../gcc/patches/libgcc-ibm128-no-tag.patch    | 10 ++-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |  2 +-
 srcpkgs/gcc/template                          | 25 +++----
 8 files changed, 52 insertions(+), 108 deletions(-)
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index ec58b8c40619..8f737837ffaf 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.2.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.34 perl-5.34.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -846,8 +846,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.2.0_1
+libgnat-12.so libada-12.2.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1697,8 +1697,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.2.0_1
+libasan.so.8 libsanitizer-12.2.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..632ef951097b 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,17 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ a/libgo/go/runtime/os_linux.go
+@@ -363,9 +363,9 @@
+ 
+ 	var timerid int32
+ 	var sevp _sigevent
+-	sevp.sigev_notify = _SIGEV_THREAD_ID
++	sevp.sigev_notify = 4
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.sigev_notify_function))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..446741390d45 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,15 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
+version=12.2.0
+revision=1
 _patchver="${version%pre*}"
 _minorver="${_patchver%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 wrksrc=gcc-${version/pre/_pre}
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +19,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -396,7 +393,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}

From c2e96356f4be7f41bc7783f2bc885b7d53a387e7 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 03/35] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      | 11 ++++--
 2 files changed, 25 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..70c4aa533e66 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,12 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
+
+if [ "$XBPS_LIBC" == "musl" ]; then
+# Musl always searches LD_LIBRARY_PATH before RPATH and RUNPATH
+make_build_args="lt_cv_shlibpath_overrides_runpath=yes"
+fi
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From 98b6da4e4a931beb54513e11a8a3709e05d32c2e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 04/35] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 1a4e1ca3d594..b04268908c2e 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="q66 <daniel@octaforge.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From 6c4496b6e5ea08e3c0d94b11512ba9c2928a8687 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 05/35] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 3 files changed, 55 insertions(+), 353 deletions(-)
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index 8f737837ffaf..e9adcaefb3dc 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From 530ec2de9523060bd6ee26be6c383e7285fa6a5e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 21:01:43 -0700
Subject: [PATCH 06/35] gcc-multilib: update to 12.2.0.

---
 srcpkgs/gcc-multilib/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index fcd25755aa75..1a26da26a991 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,16 +3,16 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _majorver="${version%.*}"
-wrksrc=gcc-${version/pre/_pre}
+wrksrc=gcc-${version}
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel

From 1648b99c3b7e666ff92b9807a5f1b9157a4eda58 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 14 Aug 2022 19:29:36 -0700
Subject: [PATCH 07/35] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove -no-pie from build. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..fcc00b3a6c5d 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -53,6 +53,7 @@ _void_cross_build_binutils() {
 		--sbindir=/usr/bin \
 		--libdir=/usr/lib \
 		--libexecdir=/usr/lib \
+		--sysconfdir=/etc \
 		--target=${tgt} \
 		--with-sysroot=/usr/${tgt} \
 		--disable-nls \
@@ -60,6 +61,7 @@ _void_cross_build_binutils() {
 		--disable-multilib \
 		--disable-werror \
 		--disable-gold \
+		--disable-gprofng \
 		--enable-relro \
 		--enable-plugins \
 		--enable-64-bit-bfd \
@@ -132,6 +134,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -460,6 +463,14 @@ do_build() {
 	local binutils_ver linux_ver gcc_ver libc_ver libucontext_ver
 	local tgt=${sourcepkg/cross-}
 
+	export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}"
+	export CXXFLAGS="${CXXFLAGS/-D_FORTIFY_SOURCE=2/}"
+
+	# Disable explicit -fno-PIE, gcc/binutils/libc will figure this out itself.
+	export CFLAGS="${CFLAGS//-fno-PIE/}"
+	export CXXFLAGS="${CXXFLAGS//-fno-PIE/}"
+	export LDFLAGS="${LDFLAGS//-no-pie/}"
+
 	_void_cross_test_ver binutils
 	_void_cross_test_ver linux
 	_void_cross_test_ver gcc
@@ -625,6 +636,9 @@ do_install() {
 	# then remove it because it conflicts with libquadmath package
 	rm -rf ${DESTDIR}/${sysroot}/usr/lib/libquadmath.*
 
+	# Remove libdep linker plugin because it conflicts with system binutils
+	rm -f ${DESTDIR}/usr/lib/bfd-plugins/libdep*
+
 	# Remove leftover symlinks
 	rm -f ${DESTDIR}/usr/lib${XBPS_TARGET_WORDSIZE}
 	rm -f ${DESTDIR}/lib*

From d6cdb1cad8eadc70da701e10109200df0249127d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:09:31 -0700
Subject: [PATCH 08/35] linux5.18: update dotconfigs for gcc12

---
 srcpkgs/linux5.18/files/x86_64-dotconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/linux5.18/files/x86_64-dotconfig b/srcpkgs/linux5.18/files/x86_64-dotconfig
index 4e73a3195d40..ea6204868e23 100644
--- a/srcpkgs/linux5.18/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.18/files/x86_64-dotconfig
@@ -512,6 +512,7 @@ CONFIG_RETHUNK=y
 CONFIG_CPU_UNRET_ENTRY=y
 CONFIG_CPU_IBPB_ENTRY=y
 CONFIG_CPU_IBRS_ENTRY=y
+CONFIG_SLS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10060,8 +10061,11 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
 # Memory initialization
 #
 CONFIG_INIT_STACK_NONE=y
+# CONFIG_INIT_STACK_ALL_PATTERN is not set
+# CONFIG_INIT_STACK_ALL_ZERO is not set
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
+# CONFIG_ZERO_CALL_USED_REGS is not set
 # end of Memory initialization
 # end of Kernel hardening options
 # end of Security options
@@ -10538,6 +10542,7 @@ CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
 # CONFIG_UBSAN is not set
 CONFIG_HAVE_ARCH_KCSAN=y
+# CONFIG_KCSAN is not set
 # end of Generic Kernel Debugging Instruments
 
 #

From 62a1b769139e4546f8ac3641e08f9a5511fd06ed Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 14:45:28 -0700
Subject: [PATCH 09/35] libsasl: fix build for libtool 2.4.7

---
 srcpkgs/libsasl/template | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/libsasl/template b/srcpkgs/libsasl/template
index a8817042f843..a2993b39f4a1 100644
--- a/srcpkgs/libsasl/template
+++ b/srcpkgs/libsasl/template
@@ -19,6 +19,7 @@ distfiles="https://github.com/cyrusimap/cyrus-sasl/releases/download/cyrus-sasl-
 checksum=26866b1549b00ffd020f188a43c258017fa1c382b3ddadd8201536f72efb05d5
 
 pre_configure() {
+	rm -f m4/ltversion.m4
 	autoreconf -fi
 }
 

From f493c7c3e07c4ca9cf60da86b6e4b3af435c22ef Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:08 -0700
Subject: [PATCH 10/35] subversion: fix build for libtool 2.4.7

---
 srcpkgs/subversion/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion/template b/srcpkgs/subversion/template
index 8ad178264942..3f1c9e254e61 100644
--- a/srcpkgs/subversion/template
+++ b/srcpkgs/subversion/template
@@ -57,7 +57,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From 2406e90e95323ef33fe8d82c4affd63d9c920130 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:38 -0700
Subject: [PATCH 11/35] subversion-kwallet-auth: fix build for libtool 2.4.7

---
 srcpkgs/subversion-kwallet-auth/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion-kwallet-auth/template b/srcpkgs/subversion-kwallet-auth/template
index 12210f250d51..b4d8621456ea 100644
--- a/srcpkgs/subversion-kwallet-auth/template
+++ b/srcpkgs/subversion-kwallet-auth/template
@@ -59,7 +59,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From b40adcc201762a6f9ff96d639ccb1f57814720ec Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 20:07:32 -0700
Subject: [PATCH 12/35] gpgme: update to 1.18.0.

---
 common/shlibs          | 2 +-
 srcpkgs/gpgme/template | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index e9adcaefb3dc..361e3dddca3e 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -721,7 +721,7 @@ libdconf.so.1 dconf-0.13.90_1
 libassuan.so.0 libassuan-2.0.1_1
 libgpgme.so.11 libgpgme-1.12.0_2
 libgpgmepp.so.6 gpgmepp-1.7.0_3
-libqgpgme.so.7 gpgmeqt-1.7.0_3
+libqgpgme.so.15 gpgmeqt-1.18.0_1
 libgarcon-1.so.0 garcon-0.1.12_1
 libgarcon-gtk2-1.so.0 garcon-0.4.0_1
 libgarcon-gtk3-1.so.0 garcon-0.6.1_1
diff --git a/srcpkgs/gpgme/template b/srcpkgs/gpgme/template
index 8633075a8404..b1cfd5f78657 100644
--- a/srcpkgs/gpgme/template
+++ b/srcpkgs/gpgme/template
@@ -1,7 +1,7 @@
 # Template file for 'gpgme'
 pkgname=gpgme
-version=1.15.1
-revision=2
+version=1.18.0
+revision=1
 build_style=gnu-configure
 configure_args="--enable-fd-passing
  --with-libgpg-error-prefix=$XBPS_CROSS_BASE/usr
@@ -14,7 +14,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.gnupg.org/software/gpgme/index.html"
 distfiles="https://www.gnupg.org/ftp/gcrypt/gpgme/gpgme-${version}.tar.bz2"
-checksum=eebc3c1b27f1c8979896ff361ba9bb4778b508b2496c2fc10e3775a40b1de1ad
+checksum=361d4eae47ce925dba0ea569af40e7b52c645c4ae2e65e5621bf1b6cdd8b0e9e
 
 if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
 	configure_args+=" ac_cv_sys_file_offset_bits=no"

From e1c23b3e698f6f289bb7e8006048e1dc4b0bec1f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 13/35] cross-aarch64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..bd6b23f9fb6a 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From e953747c46121ef489a8ea35c303731aa8bd5359 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 14/35] cross-aarch64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..427ad2c1e9cd 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 72a03b143863dfbf57a203ee73551db819d4dddd Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 15/35] cross-arm-linux-gnueabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..2510ee26e789 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 548c5c8b9aba40c35ad4fd0f96d59b8a8312aaf3 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 16/35] cross-arm-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..bd8b16e1b4c1 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 4c72671d916afad68f8d339043d93071226616e9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 17/35] cross-arm-linux-musleabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..dacfd2655216 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From c48023df736d52e1eacde1a2aae3a50c0d40aa15 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 18/35] cross-arm-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..9ddd32a9f20d 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 8bc3920227c68fd7b386debfa027eedef456e9e1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 19/35] cross-armv7l-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..9fb00f18be3b 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 52f775a67be7985ed05ae41460ee7d020efcbc4e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 20/35] cross-armv7l-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..2c72e75ddfe3 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 4453e64f06a34fb2aceed3ed77286a76db0b7e8c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 21/35] cross-i686-pc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..4dc17df648b5 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From da229151942cc1317168ca19f3cd9eca6361c098 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 22/35] cross-mips-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..6009e5c79eb2 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From bc815eedde5bf67cfd22e9d74d59e1f85d1c6987 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 23/35] cross-mips-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..080164df193d 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="hipperson0 <hipperson0@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 86ecd8d9641a8c927631bcad189b7c395be5c3b1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 24/35] cross-mipsel-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..f9fd4b8a04ef 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 308989396db15e757fef8444b4e5a590e0aacfd6 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 25/35] cross-mipsel-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..7418a984474b 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From beee45a1f2e1c896e7c097d1ba97685c91fc3b94 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 26/35] cross-powerpc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..31e57b4e52b2 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From e5f8435a9e178205f801603b57b64fafe348d2cc Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 27/35] cross-powerpc-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..a2d1edcf1ffd 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 10cf2df97ad47ce4bb5d0a104ac1375c6bd60f51 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 28/35] cross-powerpc64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..1a4cbed61e76 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 0685c08f067f96c234e41670c7192f2779805d00 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 29/35] cross-powerpc64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 1ebd0fb2048d..ade42018af05 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 7121536b84631bd1d94607b123a7b68ac98e3d72 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 30/35] cross-powerpc64le-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 733f5851da5c..03054239001e 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From b8a7c303ca8ce28f01909a404f86d866268db923 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 31/35] cross-powerpc64le-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index 76a70aa1d6db..5887f845f932 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From bee4679d1d0d3644945ab489be5aac57f9a73c9f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 32/35] cross-powerpcle-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 347b8fcf4f55..06530e0d609b 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 484d33becfde00512de59e93c52c79d55b21a4be Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 33/35] cross-powerpcle-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index ec9324ddaa99..e68c3962b49c 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 83a1aededab2babdc6598f1cc52fc3d411b27294 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 34/35] cross-x86_64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 0078fbe7224b..7da85c14b62d 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From b0e604fd498e5dbe4f68c186d0ac35731ce59ae8 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 35/35] cross-x86_64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..2811de0d3c2e 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (81 preceding siblings ...)
  2022-09-14  5:37 ` oreo639
@ 2022-09-14 10:53 ` oreo639
  2022-09-15  9:13 ` xfervi
                   ` (181 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-09-14 10:53 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5622 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.2.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.2.0

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

Also, keep in mind that the libgo musl patch here will need to be updated once musl is updated:
https://github.com/void-linux/void-packages/pull/34902/files#diff-1f42a95b93c9550178ff1fbccbef2f47a72711df15c24c9472e2550076978129R163-R176

Edit: I can fix it once this PR is merged: https://github.com/void-linux/void-packages/pull/39279

This is the updated patch for reference:
https://github.com/alpinelinux/aports/blob/8acb21b8ee881e7ab1c812d9a66a17d2501b8730/main/gcc/0049-libgo-adjust-name-of-union-in-sigevent-struct.patch

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/38817
- [x] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [x] llvm https://github.com/void-linux/void-packages/pull/38694
- [x] m4 https://github.com/void-linux/void-packages/pull/33730
- [x] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [x] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [x] libvirt https://github.com/void-linux/void-packages/pull/38842
- [x] syslinux https://github.com/void-linux/void-packages/pull/38876
- [x] efivar https://github.com/void-linux/void-packages/pull/38874

Known packages that needed to be fixed/updated for gcc12:
- [ ] linux5.18 (in this PR)
- [x] openssh https://github.com/void-linux/void-packages/pull/38849
- [x] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [x] doxygen https://github.com/void-linux/void-packages/pull/38846
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/38817
- [x] libproxy https://github.com/void-linux/void-packages/pull/38818
- [x] exempi https://github.com/void-linux/void-packages/pull/38820
- [x] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [ ] gpgme https://github.com/void-linux/void-packages/pull/38825
- [x] libunique1 https://github.com/void-linux/void-packages/pull/38848 or https://github.com/void-linux/void-packages/pull/38873
- [x] libwpd https://github.com/void-linux/void-packages/pull/38878

Needs to be fixed/updated for binutils:
- [x] grub https://github.com/void-linux/void-packages/pull/38875
- [x] linux-tools https://github.com/void-linux/void-packages/pull/38877
- [ ] kcov https://github.com/SimonKagstrom/kcov/issues/381

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [x] kde
- [x] lxde
- [x] lxqt

You can test the ISOs here:
https://drive.google.com/drive/folders/1ix92CYSLUP-KWjLxltdgG4e8Nu2JCY5n?usp=sharing

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 110912 bytes --]

From 9645b199c0ff70d034c6227625c5526e34b5bbd8 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 01/36] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../fix-libcollector-without-java.patch       | 53 +++++++++++++++
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 21 ++++--
 4 files changed, 85 insertions(+), 115 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
 create mode 100644 srcpkgs/binutils/patches/fix-libcollector-without-java.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/fix-libcollector-without-java.patch b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
new file mode 100644
index 000000000000..54384875f358
--- /dev/null
+++ b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
@@ -0,0 +1,53 @@
+From 49ddd814ac1071af7c4f45d5f8398b91862f2c7f Mon Sep 17 00:00:00 2001
+From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
+Date: Wed, 17 Aug 2022 19:55:23 -0700
+Subject: [PATCH] gprofng: fix bug 29479 Collection fails when built without
+ java support
+
+gprofng/ChangeLog
+2022-08-17  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>
+
+	PR gprofng/29479
+	* libcollector/collector.c: Add #if defined(GPROFNG_JAVA_PROFILING) for
+	java specific code.
+	* libcollector/unwind.c: Likewise.
+---
+ gprofng/libcollector/collector.c | 2 ++
+ gprofng/libcollector/unwind.c    | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/gprofng/libcollector/collector.c b/gprofng/libcollector/collector.c
+index 93c9d3330de5..ceff2c1caccb 100644
+--- a/gprofng/libcollector/collector.c
++++ b/gprofng/libcollector/collector.c
+@@ -913,8 +913,10 @@ __collector_open_experiment (const char *exp, const char *params, sp_origin_t or
+   __collector_ext_unwind_key_init (1, NULL);
+ 
+   /* start java attach if suitable */
++#if defined(GPROFNG_JAVA_PROFILING)
+   if (exp_origin == SP_ORIGIN_DBX_ATTACH)
+     __collector_jprofile_start_attach ();
++#endif
+   start_sec_time = CALL_UTIL (time)(NULL);
+   __collector_start_time = collector_interface.getHiResTime ();
+   TprintfT (DBG_LT0, "\t__collector_open_experiment; resetting start_time\n");
+diff --git a/gprofng/libcollector/unwind.c b/gprofng/libcollector/unwind.c
+index 119243788020..f8e11823c81e 100644
+--- a/gprofng/libcollector/unwind.c
++++ b/gprofng/libcollector/unwind.c
+@@ -557,6 +557,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+   int size = max_frame_size;
+ 
+ #define MIN(a,b) ((a)<(b)?(a):(b))
++#if defined(GPROFNG_JAVA_PROFILING)
+   /* get Java info */
+   if (__collector_java_mode && __collector_java_asyncgetcalltrace_loaded && context && !pseudo_context)
+     {
+@@ -569,6 +570,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+ 	  size -= sz;
+ 	}
+     }
++#endif
+ 
+   /* get native stack */
+   if (context)
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..71895f2073fd 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkg-config"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -44,6 +45,12 @@ do_configure() {
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	# gprofng currently only supports x86 and aarch64 glibc.
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64|i386|aarch64) conf+=" --enable-gprofng" ;;
+		*) conf+=" --disable-gprofng" ;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"
@@ -76,9 +83,10 @@ do_configure() {
 		--libdir=/usr/lib \
 		--mandir=/usr/share/man \
 		--infodir=/usr/share/info \
+		--sysconfdir=/etc \
 		--disable-werror \
-		--disable-shared \
 		--disable-nls \
+		--enable-shared \
 		--enable-threads \
 		--enable-plugins \
 		--enable-relro \
@@ -142,7 +150,8 @@ binutils-devel_package() {
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/*.a"
-		vmove "usr/lib/*.so"
+		vmove "usr/lib/libbfd.so"
+		vmove "usr/lib/libopcodes.so"
 	}
 }
 

From aa6ac57f8f068e0d5a7fcacbcffa277bfccb5e7f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 02/36] gcc: update to 12.2.0.

---
 common/shlibs                                 | 10 +--
 srcpkgs/gcc/files/gccgo-musl.patch            | 71 +++----------------
 srcpkgs/gcc/files/libgnarl-musl.patch         | 18 ++---
 srcpkgs/gcc/files/libssp-musl.patch           | 10 +--
 srcpkgs/gcc/patches/libffi_gnulinux.patch     | 11 ---
 .../gcc/patches/libgcc-ibm128-no-tag.patch    | 10 ++-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |  2 +-
 srcpkgs/gcc/template                          | 25 +++----
 8 files changed, 49 insertions(+), 108 deletions(-)
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index ec58b8c40619..8f737837ffaf 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.2.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.34 perl-5.34.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -846,8 +846,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.2.0_1
+libgnat-12.so libada-12.2.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1697,8 +1697,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.2.0_1
+libasan.so.8 libsanitizer-12.2.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..12ec68dd8aa3 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,14 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ b/libgo/go/runtime/os_linux.go
+@@ -365,7 +365,7 @@ func setThreadCPUProfiler(hz int32) {
+ 	var sevp _sigevent
+ 	sevp.sigev_notify = _SIGEV_THREAD_ID
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.__sev_fields))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..446741390d45 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,15 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
+version=12.2.0
+revision=1
 _patchver="${version%pre*}"
 _minorver="${_patchver%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 wrksrc=gcc-${version/pre/_pre}
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +19,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -396,7 +393,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}

From 3ad2a902fe127210bbb332765ae51868373fe3e0 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 03/36] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      | 11 ++++--
 2 files changed, 25 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..70c4aa533e66 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,12 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
+
+if [ "$XBPS_LIBC" == "musl" ]; then
+# Musl always searches LD_LIBRARY_PATH before RPATH and RUNPATH
+make_build_args="lt_cv_shlibpath_overrides_runpath=yes"
+fi
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From f95c4c24b98050847bcd642839f535cd518a43c7 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 04/36] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 1a4e1ca3d594..b04268908c2e 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="q66 <daniel@octaforge.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From 87521a0529af4107b3943d1a551d2aaa4a3365b0 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 05/36] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 3 files changed, 55 insertions(+), 353 deletions(-)
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index 8f737837ffaf..e9adcaefb3dc 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From d4b2fce1f6065492cb4d4cef70f546e31c637480 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Wed, 14 Sep 2022 03:48:32 -0700
Subject: [PATCH 06/36] musl: add support for SIGEV_THREAD_ID timers

https://git.musl-libc.org/cgit/musl/commit/?id=7c71792e87691451f2a6b76348e83ad1889f1dcb
---
 ...d-support-for-SIGEV_THREAD_ID-timers.patch | 74 +++++++++++++++++++
 srcpkgs/musl/template                         |  2 +-
 2 files changed, 75 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch

diff --git a/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
new file mode 100644
index 000000000000..e20dff5ba0d4
--- /dev/null
+++ b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
@@ -0,0 +1,74 @@
+From 7c71792e87691451f2a6b76348e83ad1889f1dcb Mon Sep 17 00:00:00 2001
+From: James Y Knight <jyknight@google.com>
+Date: Sun, 30 Jun 2019 21:55:20 -0400
+Subject: [PATCH] add support for SIGEV_THREAD_ID timers
+
+This is like SIGEV_SIGNAL, but targeted to a particular thread's
+tid, rather than the process.
+---
+ include/signal.h        | 16 +++++++++++++---
+ src/time/timer_create.c |  8 ++++++--
+ 2 files changed, 19 insertions(+), 5 deletions(-)
+
+diff --git a/include/signal.h b/include/signal.h
+index fbdf667b2..9ed929e4f 100644
+--- a/include/signal.h
++++ b/include/signal.h
+@@ -180,14 +180,24 @@ struct sigevent {
+ 	union sigval sigev_value;
+ 	int sigev_signo;
+ 	int sigev_notify;
+-	void (*sigev_notify_function)(union sigval);
+-	pthread_attr_t *sigev_notify_attributes;
+-	char __pad[56-3*sizeof(long)];
++	union {
++		char __pad[64 - 2*sizeof(int) - sizeof(union sigval)];
++		pid_t sigev_notify_thread_id;
++		struct {
++			void (*sigev_notify_function)(union sigval);
++			pthread_attr_t *sigev_notify_attributes;
++		} __sev_thread;
++	} __sev_fields;
+ };
+ 
++#define sigev_notify_thread_id __sev_fields.sigev_notify_thread_id
++#define sigev_notify_function __sev_fields.__sev_thread.sigev_notify_function
++#define sigev_notify_attributes __sev_fields.__sev_thread.sigev_notify_attributes
++
+ #define SIGEV_SIGNAL 0
+ #define SIGEV_NONE 1
+ #define SIGEV_THREAD 2
++#define SIGEV_THREAD_ID 4
+ 
+ int __libc_current_sigrtmin(void);
+ int __libc_current_sigrtmax(void);
+diff --git a/src/time/timer_create.c b/src/time/timer_create.c
+index 5ddfda278..4bef23905 100644
+--- a/src/time/timer_create.c
++++ b/src/time/timer_create.c
+@@ -71,11 +71,15 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 	switch (evp ? evp->sigev_notify : SIGEV_SIGNAL) {
+ 	case SIGEV_NONE:
+ 	case SIGEV_SIGNAL:
++	case SIGEV_THREAD_ID:
+ 		if (evp) {
+ 			ksev.sigev_value = evp->sigev_value;
+ 			ksev.sigev_signo = evp->sigev_signo;
+ 			ksev.sigev_notify = evp->sigev_notify;
+-			ksev.sigev_tid = 0;
++			if (evp->sigev_notify == SIGEV_THREAD_ID)
++				ksev.sigev_tid = evp->sigev_notify_thread_id;
++			else
++				ksev.sigev_tid = 0;
+ 			ksevp = &ksev;
+ 		}
+ 		if (syscall(SYS_timer_create, clk, ksevp, &timerid) < 0)
+@@ -107,7 +111,7 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 
+ 		ksev.sigev_value.sival_ptr = 0;
+ 		ksev.sigev_signo = SIGTIMER;
+-		ksev.sigev_notify = 4; /* SIGEV_THREAD_ID */
++		ksev.sigev_notify = SIGEV_THREAD_ID;
+ 		ksev.sigev_tid = td->tid;
+ 		if (syscall(SYS_timer_create, clk, &ksev, &timerid) < 0)
+ 			timerid = -1;
diff --git a/srcpkgs/musl/template b/srcpkgs/musl/template
index 5bdc5c48e623..34e6ed4fba6e 100644
--- a/srcpkgs/musl/template
+++ b/srcpkgs/musl/template
@@ -2,7 +2,7 @@
 pkgname=musl
 reverts="1.2.0_1"
 version=1.1.24
-revision=10
+revision=11
 archs="*-musl"
 bootstrap=yes
 build_style=gnu-configure

From b7e014efeee3e27876c794729dadea84b8f3a6a0 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 21:01:43 -0700
Subject: [PATCH 07/36] gcc-multilib: update to 12.2.0.

---
 srcpkgs/gcc-multilib/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index fcd25755aa75..1a26da26a991 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,16 +3,16 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _majorver="${version%.*}"
-wrksrc=gcc-${version/pre/_pre}
+wrksrc=gcc-${version}
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel

From 3203ed3bd038d5734283b8a905c14021c8af1db9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 14 Aug 2022 19:29:36 -0700
Subject: [PATCH 08/36] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove -no-pie from build. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..fcc00b3a6c5d 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -53,6 +53,7 @@ _void_cross_build_binutils() {
 		--sbindir=/usr/bin \
 		--libdir=/usr/lib \
 		--libexecdir=/usr/lib \
+		--sysconfdir=/etc \
 		--target=${tgt} \
 		--with-sysroot=/usr/${tgt} \
 		--disable-nls \
@@ -60,6 +61,7 @@ _void_cross_build_binutils() {
 		--disable-multilib \
 		--disable-werror \
 		--disable-gold \
+		--disable-gprofng \
 		--enable-relro \
 		--enable-plugins \
 		--enable-64-bit-bfd \
@@ -132,6 +134,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -460,6 +463,14 @@ do_build() {
 	local binutils_ver linux_ver gcc_ver libc_ver libucontext_ver
 	local tgt=${sourcepkg/cross-}
 
+	export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}"
+	export CXXFLAGS="${CXXFLAGS/-D_FORTIFY_SOURCE=2/}"
+
+	# Disable explicit -fno-PIE, gcc/binutils/libc will figure this out itself.
+	export CFLAGS="${CFLAGS//-fno-PIE/}"
+	export CXXFLAGS="${CXXFLAGS//-fno-PIE/}"
+	export LDFLAGS="${LDFLAGS//-no-pie/}"
+
 	_void_cross_test_ver binutils
 	_void_cross_test_ver linux
 	_void_cross_test_ver gcc
@@ -625,6 +636,9 @@ do_install() {
 	# then remove it because it conflicts with libquadmath package
 	rm -rf ${DESTDIR}/${sysroot}/usr/lib/libquadmath.*
 
+	# Remove libdep linker plugin because it conflicts with system binutils
+	rm -f ${DESTDIR}/usr/lib/bfd-plugins/libdep*
+
 	# Remove leftover symlinks
 	rm -f ${DESTDIR}/usr/lib${XBPS_TARGET_WORDSIZE}
 	rm -f ${DESTDIR}/lib*

From 104f468633fd05ee46b233b476b787f7b4b10935 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:09:31 -0700
Subject: [PATCH 09/36] linux5.18: update dotconfigs for gcc12

---
 srcpkgs/linux5.18/files/x86_64-dotconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/linux5.18/files/x86_64-dotconfig b/srcpkgs/linux5.18/files/x86_64-dotconfig
index 4e73a3195d40..ea6204868e23 100644
--- a/srcpkgs/linux5.18/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.18/files/x86_64-dotconfig
@@ -512,6 +512,7 @@ CONFIG_RETHUNK=y
 CONFIG_CPU_UNRET_ENTRY=y
 CONFIG_CPU_IBPB_ENTRY=y
 CONFIG_CPU_IBRS_ENTRY=y
+CONFIG_SLS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10060,8 +10061,11 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
 # Memory initialization
 #
 CONFIG_INIT_STACK_NONE=y
+# CONFIG_INIT_STACK_ALL_PATTERN is not set
+# CONFIG_INIT_STACK_ALL_ZERO is not set
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
+# CONFIG_ZERO_CALL_USED_REGS is not set
 # end of Memory initialization
 # end of Kernel hardening options
 # end of Security options
@@ -10538,6 +10542,7 @@ CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
 # CONFIG_UBSAN is not set
 CONFIG_HAVE_ARCH_KCSAN=y
+# CONFIG_KCSAN is not set
 # end of Generic Kernel Debugging Instruments
 
 #

From 7693519cc4303548ffc134026047d52b2c30ae49 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 14:45:28 -0700
Subject: [PATCH 10/36] libsasl: fix build for libtool 2.4.7

---
 srcpkgs/libsasl/template | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/libsasl/template b/srcpkgs/libsasl/template
index a8817042f843..a2993b39f4a1 100644
--- a/srcpkgs/libsasl/template
+++ b/srcpkgs/libsasl/template
@@ -19,6 +19,7 @@ distfiles="https://github.com/cyrusimap/cyrus-sasl/releases/download/cyrus-sasl-
 checksum=26866b1549b00ffd020f188a43c258017fa1c382b3ddadd8201536f72efb05d5
 
 pre_configure() {
+	rm -f m4/ltversion.m4
 	autoreconf -fi
 }
 

From 1362c45b8af7016fa41132d4c16c7d057ae0f22e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:08 -0700
Subject: [PATCH 11/36] subversion: fix build for libtool 2.4.7

---
 srcpkgs/subversion/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion/template b/srcpkgs/subversion/template
index 8ad178264942..3f1c9e254e61 100644
--- a/srcpkgs/subversion/template
+++ b/srcpkgs/subversion/template
@@ -57,7 +57,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From a502cfa6547ad81c909f704bc6d895e5fc373312 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:38 -0700
Subject: [PATCH 12/36] subversion-kwallet-auth: fix build for libtool 2.4.7

---
 srcpkgs/subversion-kwallet-auth/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion-kwallet-auth/template b/srcpkgs/subversion-kwallet-auth/template
index 12210f250d51..b4d8621456ea 100644
--- a/srcpkgs/subversion-kwallet-auth/template
+++ b/srcpkgs/subversion-kwallet-auth/template
@@ -59,7 +59,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From 8e97e64a7965073c64b0d4e49c2975f512d3c4cd Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 20:07:32 -0700
Subject: [PATCH 13/36] gpgme: update to 1.18.0.

---
 common/shlibs          | 2 +-
 srcpkgs/gpgme/template | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index e9adcaefb3dc..361e3dddca3e 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -721,7 +721,7 @@ libdconf.so.1 dconf-0.13.90_1
 libassuan.so.0 libassuan-2.0.1_1
 libgpgme.so.11 libgpgme-1.12.0_2
 libgpgmepp.so.6 gpgmepp-1.7.0_3
-libqgpgme.so.7 gpgmeqt-1.7.0_3
+libqgpgme.so.15 gpgmeqt-1.18.0_1
 libgarcon-1.so.0 garcon-0.1.12_1
 libgarcon-gtk2-1.so.0 garcon-0.4.0_1
 libgarcon-gtk3-1.so.0 garcon-0.6.1_1
diff --git a/srcpkgs/gpgme/template b/srcpkgs/gpgme/template
index 8633075a8404..b1cfd5f78657 100644
--- a/srcpkgs/gpgme/template
+++ b/srcpkgs/gpgme/template
@@ -1,7 +1,7 @@
 # Template file for 'gpgme'
 pkgname=gpgme
-version=1.15.1
-revision=2
+version=1.18.0
+revision=1
 build_style=gnu-configure
 configure_args="--enable-fd-passing
  --with-libgpg-error-prefix=$XBPS_CROSS_BASE/usr
@@ -14,7 +14,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.gnupg.org/software/gpgme/index.html"
 distfiles="https://www.gnupg.org/ftp/gcrypt/gpgme/gpgme-${version}.tar.bz2"
-checksum=eebc3c1b27f1c8979896ff361ba9bb4778b508b2496c2fc10e3775a40b1de1ad
+checksum=361d4eae47ce925dba0ea569af40e7b52c645c4ae2e65e5621bf1b6cdd8b0e9e
 
 if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
 	configure_args+=" ac_cv_sys_file_offset_bits=no"

From 69763aed4215551607144529baef8f604ecc5bc4 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 14/36] cross-aarch64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..bd6b23f9fb6a 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 7e34d03bcaa20a07dc94a9831de80b414147a8fd Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 15/36] cross-aarch64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..427ad2c1e9cd 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From ea80aaf966ee61771113d36774f96696f6c7d614 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 16/36] cross-arm-linux-gnueabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..2510ee26e789 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 4fdd1581a0cea8ad8a47cade50f99ff5e83e3740 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 17/36] cross-arm-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..bd8b16e1b4c1 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 67fd125e7681680f36dc4e399bb2bb5398136784 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 18/36] cross-arm-linux-musleabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..dacfd2655216 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From e4f499ca790f0b66f229c69d8d6db75ff9242bbf Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 19/36] cross-arm-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..9ddd32a9f20d 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 0589f0120ee23d34f184e9cc008be9bfe6b29f06 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 20/36] cross-armv7l-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..9fb00f18be3b 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From e188ff3c5a9c329f57811a34be7c23bf8a5cb0c6 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 21/36] cross-armv7l-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..2c72e75ddfe3 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 92898e1b041355a45671b8b3909adbf0a9a69900 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 22/36] cross-i686-pc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..4dc17df648b5 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From ac49b6281550c8ad20feb83c58a178f1195c9d73 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 23/36] cross-mips-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..6009e5c79eb2 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 598e52a211f90f9ca193e7e9f5360ae81eb640de Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 24/36] cross-mips-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..080164df193d 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="hipperson0 <hipperson0@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 5d52dbf8a5815b9ab1c52aa49acb1fa28f4e3363 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 25/36] cross-mipsel-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..f9fd4b8a04ef 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 066f4985bb29a1a60ab4628c0d0453a7988ac681 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 26/36] cross-mipsel-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..7418a984474b 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 3e32e9dd9f0774bfa1149d88f95851021b3314e9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 27/36] cross-powerpc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..31e57b4e52b2 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 7a26e8dcfec9de2def7cb5e125e25a21f0b06a37 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 28/36] cross-powerpc-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..a2d1edcf1ffd 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 7540d72f58395ee6b2e2cce9e454178b8afcdaac Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 29/36] cross-powerpc64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..1a4cbed61e76 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 43fcac4522bd499ad5576deee411582bb8c4b0a7 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 30/36] cross-powerpc64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 1ebd0fb2048d..ade42018af05 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From f186bda32ba6d0fd2366fc5e1125401cc34c97ef Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 31/36] cross-powerpc64le-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 733f5851da5c..03054239001e 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From b44b60744b4ceb41dd7812e69b51d91cc2288379 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 32/36] cross-powerpc64le-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index 76a70aa1d6db..5887f845f932 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 3bcdedd181bc4bd2db0f8e9dba62b93d28e1e7ad Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 33/36] cross-powerpcle-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 347b8fcf4f55..06530e0d609b 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 8fc411004168d89be5ab7efe08f7e899ff103e96 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 34/36] cross-powerpcle-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index ec9324ddaa99..e68c3962b49c 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 7265ea71bcb3211bb9ae5e80942dbbb4c4f06a4c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 35/36] cross-x86_64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 0078fbe7224b..7da85c14b62d 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From e07dea50418cb2db0abfafbac93851f963640d70 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 36/36] cross-x86_64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..2811de0d3c2e 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (82 preceding siblings ...)
  2022-09-14 10:53 ` oreo639
@ 2022-09-15  9:13 ` xfervi
  2022-09-15  9:17 ` oreo639
                   ` (180 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: xfervi @ 2022-09-15  9:13 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 278 bytes --]

New comment by xfervi on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1247818871

Comment:
I've tried installing gpgme from your fork and I got "cross-vpkg-dummy conflct" or something like that? Is that intended to be like that?

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (83 preceding siblings ...)
  2022-09-15  9:13 ` xfervi
@ 2022-09-15  9:17 ` oreo639
  2022-09-15  9:20 ` oreo639
                   ` (179 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-09-15  9:17 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 280 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1247824189

Comment:
1. Don't install gpgme from this PR (the propper PR is linked in the original post).
2. The full error and command used would be helpful.

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (84 preceding siblings ...)
  2022-09-15  9:17 ` oreo639
@ 2022-09-15  9:20 ` oreo639
  2022-09-15  9:21 ` [PR PATCH] [Updated] " oreo639
                   ` (178 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-09-15  9:20 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 319 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1247824189

Comment:
1. Don't install gpgme from this PR (the propper PR is linked in the original post, it's just here to fix a build failure).
2. The full error and command used would be helpful.

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (85 preceding siblings ...)
  2022-09-15  9:20 ` oreo639
@ 2022-09-15  9:21 ` oreo639
  2022-09-15  9:22 ` oreo639
                   ` (177 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-09-15  9:21 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5092 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.2.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.2.0

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/38817
- [x] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [x] llvm https://github.com/void-linux/void-packages/pull/38694
- [x] m4 https://github.com/void-linux/void-packages/pull/33730
- [x] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [x] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [x] libvirt https://github.com/void-linux/void-packages/pull/38842
- [x] syslinux https://github.com/void-linux/void-packages/pull/38876
- [x] efivar https://github.com/void-linux/void-packages/pull/38874

Known packages that needed to be fixed/updated for gcc12:
- [ ] linux5.18 (in this PR)
- [x] openssh https://github.com/void-linux/void-packages/pull/38849
- [x] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [x] doxygen https://github.com/void-linux/void-packages/pull/38846
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/38817
- [x] libproxy https://github.com/void-linux/void-packages/pull/38818
- [x] exempi https://github.com/void-linux/void-packages/pull/38820
- [x] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [ ] gpgme https://github.com/void-linux/void-packages/pull/38825
- [x] libunique1 https://github.com/void-linux/void-packages/pull/38848 or https://github.com/void-linux/void-packages/pull/38873
- [x] libwpd https://github.com/void-linux/void-packages/pull/38878

Needs to be fixed/updated for binutils:
- [x] grub https://github.com/void-linux/void-packages/pull/38875
- [x] linux-tools https://github.com/void-linux/void-packages/pull/38877
- [ ] kcov https://github.com/void-linux/void-packages/pull/39291

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [x] kde
- [x] lxde
- [x] lxqt

You can test the ISOs here:
https://drive.google.com/drive/folders/1ix92CYSLUP-KWjLxltdgG4e8Nu2JCY5n?usp=sharing

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 110912 bytes --]

From 21072caf22bca881c773801c9ebdadb1dac40525 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 01/36] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../fix-libcollector-without-java.patch       | 53 +++++++++++++++
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 21 ++++--
 4 files changed, 85 insertions(+), 115 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
 create mode 100644 srcpkgs/binutils/patches/fix-libcollector-without-java.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/fix-libcollector-without-java.patch b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
new file mode 100644
index 000000000000..54384875f358
--- /dev/null
+++ b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
@@ -0,0 +1,53 @@
+From 49ddd814ac1071af7c4f45d5f8398b91862f2c7f Mon Sep 17 00:00:00 2001
+From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
+Date: Wed, 17 Aug 2022 19:55:23 -0700
+Subject: [PATCH] gprofng: fix bug 29479 Collection fails when built without
+ java support
+
+gprofng/ChangeLog
+2022-08-17  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>
+
+	PR gprofng/29479
+	* libcollector/collector.c: Add #if defined(GPROFNG_JAVA_PROFILING) for
+	java specific code.
+	* libcollector/unwind.c: Likewise.
+---
+ gprofng/libcollector/collector.c | 2 ++
+ gprofng/libcollector/unwind.c    | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/gprofng/libcollector/collector.c b/gprofng/libcollector/collector.c
+index 93c9d3330de5..ceff2c1caccb 100644
+--- a/gprofng/libcollector/collector.c
++++ b/gprofng/libcollector/collector.c
+@@ -913,8 +913,10 @@ __collector_open_experiment (const char *exp, const char *params, sp_origin_t or
+   __collector_ext_unwind_key_init (1, NULL);
+ 
+   /* start java attach if suitable */
++#if defined(GPROFNG_JAVA_PROFILING)
+   if (exp_origin == SP_ORIGIN_DBX_ATTACH)
+     __collector_jprofile_start_attach ();
++#endif
+   start_sec_time = CALL_UTIL (time)(NULL);
+   __collector_start_time = collector_interface.getHiResTime ();
+   TprintfT (DBG_LT0, "\t__collector_open_experiment; resetting start_time\n");
+diff --git a/gprofng/libcollector/unwind.c b/gprofng/libcollector/unwind.c
+index 119243788020..f8e11823c81e 100644
+--- a/gprofng/libcollector/unwind.c
++++ b/gprofng/libcollector/unwind.c
+@@ -557,6 +557,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+   int size = max_frame_size;
+ 
+ #define MIN(a,b) ((a)<(b)?(a):(b))
++#if defined(GPROFNG_JAVA_PROFILING)
+   /* get Java info */
+   if (__collector_java_mode && __collector_java_asyncgetcalltrace_loaded && context && !pseudo_context)
+     {
+@@ -569,6 +570,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+ 	  size -= sz;
+ 	}
+     }
++#endif
+ 
+   /* get native stack */
+   if (context)
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..71895f2073fd 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkg-config"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -44,6 +45,12 @@ do_configure() {
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	# gprofng currently only supports x86 and aarch64 glibc.
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64|i386|aarch64) conf+=" --enable-gprofng" ;;
+		*) conf+=" --disable-gprofng" ;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"
@@ -76,9 +83,10 @@ do_configure() {
 		--libdir=/usr/lib \
 		--mandir=/usr/share/man \
 		--infodir=/usr/share/info \
+		--sysconfdir=/etc \
 		--disable-werror \
-		--disable-shared \
 		--disable-nls \
+		--enable-shared \
 		--enable-threads \
 		--enable-plugins \
 		--enable-relro \
@@ -142,7 +150,8 @@ binutils-devel_package() {
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/*.a"
-		vmove "usr/lib/*.so"
+		vmove "usr/lib/libbfd.so"
+		vmove "usr/lib/libopcodes.so"
 	}
 }
 

From 94ced4f30e936d24e13a01ae64669e4a4b4addce Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 02/36] gcc: update to 12.2.0.

---
 common/shlibs                                 | 10 +--
 srcpkgs/gcc/files/gccgo-musl.patch            | 71 +++----------------
 srcpkgs/gcc/files/libgnarl-musl.patch         | 18 ++---
 srcpkgs/gcc/files/libssp-musl.patch           | 10 +--
 srcpkgs/gcc/patches/libffi_gnulinux.patch     | 11 ---
 .../gcc/patches/libgcc-ibm128-no-tag.patch    | 10 ++-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |  2 +-
 srcpkgs/gcc/template                          | 25 +++----
 8 files changed, 49 insertions(+), 108 deletions(-)
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index ec58b8c40619..8f737837ffaf 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.2.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.34 perl-5.34.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -846,8 +846,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.2.0_1
+libgnat-12.so libada-12.2.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1697,8 +1697,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.2.0_1
+libasan.so.8 libsanitizer-12.2.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..12ec68dd8aa3 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,14 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ b/libgo/go/runtime/os_linux.go
+@@ -365,7 +365,7 @@ func setThreadCPUProfiler(hz int32) {
+ 	var sevp _sigevent
+ 	sevp.sigev_notify = _SIGEV_THREAD_ID
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.__sev_fields))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..446741390d45 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,15 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
+version=12.2.0
+revision=1
 _patchver="${version%pre*}"
 _minorver="${_patchver%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 wrksrc=gcc-${version/pre/_pre}
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +19,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -396,7 +393,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}

From b93f5006d6dbdf55585b781a90890689ec85a3dc Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 03/36] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      | 11 ++++--
 2 files changed, 25 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..70c4aa533e66 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,12 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
+
+if [ "$XBPS_LIBC" == "musl" ]; then
+# Musl always searches LD_LIBRARY_PATH before RPATH and RUNPATH
+make_build_args="lt_cv_shlibpath_overrides_runpath=yes"
+fi
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From dbdc58a94b3d524bd5c95e93791e32dedc94c64e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 04/36] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 1a4e1ca3d594..b04268908c2e 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="q66 <daniel@octaforge.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From d55530d4ebd7a97aee4b0e9ed947c8cabb695225 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 05/36] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 3 files changed, 55 insertions(+), 353 deletions(-)
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index 8f737837ffaf..e9adcaefb3dc 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From ae2420ee43f3dcdf485de5a99704bd505c13745a Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Wed, 14 Sep 2022 03:48:32 -0700
Subject: [PATCH 06/36] musl: add support for SIGEV_THREAD_ID timers

https://git.musl-libc.org/cgit/musl/commit/?id=7c71792e87691451f2a6b76348e83ad1889f1dcb
---
 ...d-support-for-SIGEV_THREAD_ID-timers.patch | 74 +++++++++++++++++++
 srcpkgs/musl/template                         |  2 +-
 2 files changed, 75 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch

diff --git a/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
new file mode 100644
index 000000000000..e20dff5ba0d4
--- /dev/null
+++ b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
@@ -0,0 +1,74 @@
+From 7c71792e87691451f2a6b76348e83ad1889f1dcb Mon Sep 17 00:00:00 2001
+From: James Y Knight <jyknight@google.com>
+Date: Sun, 30 Jun 2019 21:55:20 -0400
+Subject: [PATCH] add support for SIGEV_THREAD_ID timers
+
+This is like SIGEV_SIGNAL, but targeted to a particular thread's
+tid, rather than the process.
+---
+ include/signal.h        | 16 +++++++++++++---
+ src/time/timer_create.c |  8 ++++++--
+ 2 files changed, 19 insertions(+), 5 deletions(-)
+
+diff --git a/include/signal.h b/include/signal.h
+index fbdf667b2..9ed929e4f 100644
+--- a/include/signal.h
++++ b/include/signal.h
+@@ -180,14 +180,24 @@ struct sigevent {
+ 	union sigval sigev_value;
+ 	int sigev_signo;
+ 	int sigev_notify;
+-	void (*sigev_notify_function)(union sigval);
+-	pthread_attr_t *sigev_notify_attributes;
+-	char __pad[56-3*sizeof(long)];
++	union {
++		char __pad[64 - 2*sizeof(int) - sizeof(union sigval)];
++		pid_t sigev_notify_thread_id;
++		struct {
++			void (*sigev_notify_function)(union sigval);
++			pthread_attr_t *sigev_notify_attributes;
++		} __sev_thread;
++	} __sev_fields;
+ };
+ 
++#define sigev_notify_thread_id __sev_fields.sigev_notify_thread_id
++#define sigev_notify_function __sev_fields.__sev_thread.sigev_notify_function
++#define sigev_notify_attributes __sev_fields.__sev_thread.sigev_notify_attributes
++
+ #define SIGEV_SIGNAL 0
+ #define SIGEV_NONE 1
+ #define SIGEV_THREAD 2
++#define SIGEV_THREAD_ID 4
+ 
+ int __libc_current_sigrtmin(void);
+ int __libc_current_sigrtmax(void);
+diff --git a/src/time/timer_create.c b/src/time/timer_create.c
+index 5ddfda278..4bef23905 100644
+--- a/src/time/timer_create.c
++++ b/src/time/timer_create.c
+@@ -71,11 +71,15 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 	switch (evp ? evp->sigev_notify : SIGEV_SIGNAL) {
+ 	case SIGEV_NONE:
+ 	case SIGEV_SIGNAL:
++	case SIGEV_THREAD_ID:
+ 		if (evp) {
+ 			ksev.sigev_value = evp->sigev_value;
+ 			ksev.sigev_signo = evp->sigev_signo;
+ 			ksev.sigev_notify = evp->sigev_notify;
+-			ksev.sigev_tid = 0;
++			if (evp->sigev_notify == SIGEV_THREAD_ID)
++				ksev.sigev_tid = evp->sigev_notify_thread_id;
++			else
++				ksev.sigev_tid = 0;
+ 			ksevp = &ksev;
+ 		}
+ 		if (syscall(SYS_timer_create, clk, ksevp, &timerid) < 0)
+@@ -107,7 +111,7 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 
+ 		ksev.sigev_value.sival_ptr = 0;
+ 		ksev.sigev_signo = SIGTIMER;
+-		ksev.sigev_notify = 4; /* SIGEV_THREAD_ID */
++		ksev.sigev_notify = SIGEV_THREAD_ID;
+ 		ksev.sigev_tid = td->tid;
+ 		if (syscall(SYS_timer_create, clk, &ksev, &timerid) < 0)
+ 			timerid = -1;
diff --git a/srcpkgs/musl/template b/srcpkgs/musl/template
index 5bdc5c48e623..34e6ed4fba6e 100644
--- a/srcpkgs/musl/template
+++ b/srcpkgs/musl/template
@@ -2,7 +2,7 @@
 pkgname=musl
 reverts="1.2.0_1"
 version=1.1.24
-revision=10
+revision=11
 archs="*-musl"
 bootstrap=yes
 build_style=gnu-configure

From c1da8312cd30b63dd6bd052ac788636fcfa8b4df Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 21:01:43 -0700
Subject: [PATCH 07/36] gcc-multilib: update to 12.2.0.

---
 srcpkgs/gcc-multilib/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index fcd25755aa75..1a26da26a991 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,16 +3,16 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _majorver="${version%.*}"
-wrksrc=gcc-${version/pre/_pre}
+wrksrc=gcc-${version}
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel

From 171b5d7059d7e1831356ee87f86cccdfc14e722e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 14 Aug 2022 19:29:36 -0700
Subject: [PATCH 08/36] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove -no-pie from build. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..fcc00b3a6c5d 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -53,6 +53,7 @@ _void_cross_build_binutils() {
 		--sbindir=/usr/bin \
 		--libdir=/usr/lib \
 		--libexecdir=/usr/lib \
+		--sysconfdir=/etc \
 		--target=${tgt} \
 		--with-sysroot=/usr/${tgt} \
 		--disable-nls \
@@ -60,6 +61,7 @@ _void_cross_build_binutils() {
 		--disable-multilib \
 		--disable-werror \
 		--disable-gold \
+		--disable-gprofng \
 		--enable-relro \
 		--enable-plugins \
 		--enable-64-bit-bfd \
@@ -132,6 +134,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -460,6 +463,14 @@ do_build() {
 	local binutils_ver linux_ver gcc_ver libc_ver libucontext_ver
 	local tgt=${sourcepkg/cross-}
 
+	export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}"
+	export CXXFLAGS="${CXXFLAGS/-D_FORTIFY_SOURCE=2/}"
+
+	# Disable explicit -fno-PIE, gcc/binutils/libc will figure this out itself.
+	export CFLAGS="${CFLAGS//-fno-PIE/}"
+	export CXXFLAGS="${CXXFLAGS//-fno-PIE/}"
+	export LDFLAGS="${LDFLAGS//-no-pie/}"
+
 	_void_cross_test_ver binutils
 	_void_cross_test_ver linux
 	_void_cross_test_ver gcc
@@ -625,6 +636,9 @@ do_install() {
 	# then remove it because it conflicts with libquadmath package
 	rm -rf ${DESTDIR}/${sysroot}/usr/lib/libquadmath.*
 
+	# Remove libdep linker plugin because it conflicts with system binutils
+	rm -f ${DESTDIR}/usr/lib/bfd-plugins/libdep*
+
 	# Remove leftover symlinks
 	rm -f ${DESTDIR}/usr/lib${XBPS_TARGET_WORDSIZE}
 	rm -f ${DESTDIR}/lib*

From eb447570b52d883d22a98c93a8a3ccf58a5d8c98 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:09:31 -0700
Subject: [PATCH 09/36] linux5.18: update dotconfigs for gcc12

---
 srcpkgs/linux5.18/files/x86_64-dotconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/linux5.18/files/x86_64-dotconfig b/srcpkgs/linux5.18/files/x86_64-dotconfig
index 4e73a3195d40..ea6204868e23 100644
--- a/srcpkgs/linux5.18/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.18/files/x86_64-dotconfig
@@ -512,6 +512,7 @@ CONFIG_RETHUNK=y
 CONFIG_CPU_UNRET_ENTRY=y
 CONFIG_CPU_IBPB_ENTRY=y
 CONFIG_CPU_IBRS_ENTRY=y
+CONFIG_SLS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10060,8 +10061,11 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
 # Memory initialization
 #
 CONFIG_INIT_STACK_NONE=y
+# CONFIG_INIT_STACK_ALL_PATTERN is not set
+# CONFIG_INIT_STACK_ALL_ZERO is not set
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
+# CONFIG_ZERO_CALL_USED_REGS is not set
 # end of Memory initialization
 # end of Kernel hardening options
 # end of Security options
@@ -10538,6 +10542,7 @@ CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
 # CONFIG_UBSAN is not set
 CONFIG_HAVE_ARCH_KCSAN=y
+# CONFIG_KCSAN is not set
 # end of Generic Kernel Debugging Instruments
 
 #

From 32fadb751b9884de51fbad754b9707f9420ed21b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 14:45:28 -0700
Subject: [PATCH 10/36] libsasl: fix build for libtool 2.4.7

---
 srcpkgs/libsasl/template | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/libsasl/template b/srcpkgs/libsasl/template
index a8817042f843..a2993b39f4a1 100644
--- a/srcpkgs/libsasl/template
+++ b/srcpkgs/libsasl/template
@@ -19,6 +19,7 @@ distfiles="https://github.com/cyrusimap/cyrus-sasl/releases/download/cyrus-sasl-
 checksum=26866b1549b00ffd020f188a43c258017fa1c382b3ddadd8201536f72efb05d5
 
 pre_configure() {
+	rm -f m4/ltversion.m4
 	autoreconf -fi
 }
 

From a451a96050e208db481991661d00c025b81ddc2b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:08 -0700
Subject: [PATCH 11/36] subversion: fix build for libtool 2.4.7

---
 srcpkgs/subversion/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion/template b/srcpkgs/subversion/template
index 8ad178264942..3f1c9e254e61 100644
--- a/srcpkgs/subversion/template
+++ b/srcpkgs/subversion/template
@@ -57,7 +57,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From a097811281ba43e1733419f13e74978a91081b88 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:38 -0700
Subject: [PATCH 12/36] subversion-kwallet-auth: fix build for libtool 2.4.7

---
 srcpkgs/subversion-kwallet-auth/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion-kwallet-auth/template b/srcpkgs/subversion-kwallet-auth/template
index 12210f250d51..b4d8621456ea 100644
--- a/srcpkgs/subversion-kwallet-auth/template
+++ b/srcpkgs/subversion-kwallet-auth/template
@@ -59,7 +59,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From 53738ed959ec36298c09a0dcf45acfdc072d039b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 20:07:32 -0700
Subject: [PATCH 13/36] gpgme: update to 1.18.0.

---
 common/shlibs          | 2 +-
 srcpkgs/gpgme/template | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index e9adcaefb3dc..361e3dddca3e 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -721,7 +721,7 @@ libdconf.so.1 dconf-0.13.90_1
 libassuan.so.0 libassuan-2.0.1_1
 libgpgme.so.11 libgpgme-1.12.0_2
 libgpgmepp.so.6 gpgmepp-1.7.0_3
-libqgpgme.so.7 gpgmeqt-1.7.0_3
+libqgpgme.so.15 gpgmeqt-1.18.0_1
 libgarcon-1.so.0 garcon-0.1.12_1
 libgarcon-gtk2-1.so.0 garcon-0.4.0_1
 libgarcon-gtk3-1.so.0 garcon-0.6.1_1
diff --git a/srcpkgs/gpgme/template b/srcpkgs/gpgme/template
index 8633075a8404..b1cfd5f78657 100644
--- a/srcpkgs/gpgme/template
+++ b/srcpkgs/gpgme/template
@@ -1,7 +1,7 @@
 # Template file for 'gpgme'
 pkgname=gpgme
-version=1.15.1
-revision=2
+version=1.18.0
+revision=1
 build_style=gnu-configure
 configure_args="--enable-fd-passing
  --with-libgpg-error-prefix=$XBPS_CROSS_BASE/usr
@@ -14,7 +14,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.gnupg.org/software/gpgme/index.html"
 distfiles="https://www.gnupg.org/ftp/gcrypt/gpgme/gpgme-${version}.tar.bz2"
-checksum=eebc3c1b27f1c8979896ff361ba9bb4778b508b2496c2fc10e3775a40b1de1ad
+checksum=361d4eae47ce925dba0ea569af40e7b52c645c4ae2e65e5621bf1b6cdd8b0e9e
 
 if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
 	configure_args+=" ac_cv_sys_file_offset_bits=no"

From f16e883ca8e27084fd054204c97d6ee942d7197e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 14/36] cross-aarch64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..bd6b23f9fb6a 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 3f0605d9c4d844a8d3e0c0743d916b655826fb14 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 15/36] cross-aarch64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..427ad2c1e9cd 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 775402d5902ce710bd6cfa00d761c73dd193a735 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 16/36] cross-arm-linux-gnueabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..2510ee26e789 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From fe39158d5307fd8f4b8e51127cce46cb0a330ed6 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 17/36] cross-arm-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..bd8b16e1b4c1 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 35a50c2fff1a60c22e19e35dd5f035362204c2a9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 18/36] cross-arm-linux-musleabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..dacfd2655216 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 1d5b52809a6d2d28b7bb6b65c91e5bd45f73828f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 19/36] cross-arm-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..9ddd32a9f20d 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 6a6a90a0e475780e30b37b60bac35111036210e3 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 20/36] cross-armv7l-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..9fb00f18be3b 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From af319a9cbd868f4954694ebdd12877ac6a0bd581 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 21/36] cross-armv7l-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..2c72e75ddfe3 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 725e7d169a2cf44943c43f6116b034cdb2d30a20 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 22/36] cross-i686-pc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..4dc17df648b5 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From bdc23d8cae313677e6944801a522726ef449317d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 23/36] cross-mips-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..6009e5c79eb2 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 1f66cdc63a89d9266c45eb32b212457ef353c4e2 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 24/36] cross-mips-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..080164df193d 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="hipperson0 <hipperson0@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From d79b67ed0bbb57c3644efe075ac64efdf0eda26c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 25/36] cross-mipsel-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..f9fd4b8a04ef 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 031924b93976d555152b42d08f307b47e76d1345 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 26/36] cross-mipsel-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..7418a984474b 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 8fd8ce8fecc5a893fc4b4c9dbb05017a0b525c20 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 27/36] cross-powerpc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..31e57b4e52b2 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 3acad08ae4501a0030a9e3c532d52541b2985a3e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 28/36] cross-powerpc-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..a2d1edcf1ffd 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From d6536c9b21e9114a6b90e8425f7127b1b3817ac8 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 29/36] cross-powerpc64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..1a4cbed61e76 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 3f1a19049043f7acd801ea0a9a620300eace3f04 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 30/36] cross-powerpc64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 1ebd0fb2048d..ade42018af05 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 94daeb4d1032a90b05eda369b29c5d38c0960fe3 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 31/36] cross-powerpc64le-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 733f5851da5c..03054239001e 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 150a28a99876853044162b23174e08b1f6fb63ab Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 32/36] cross-powerpc64le-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index 76a70aa1d6db..5887f845f932 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 8a8c17550a232454243cf87ad9f26c50d99fe1f1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 33/36] cross-powerpcle-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 347b8fcf4f55..06530e0d609b 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From b761412e6a109edf442f58e3aa740873d77cc61a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 34/36] cross-powerpcle-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index ec9324ddaa99..e68c3962b49c 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 89dad1c893ffe74259494dc8a258f3e0e0298671 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 35/36] cross-x86_64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 0078fbe7224b..7da85c14b62d 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 6675ebeaab4115e61e2e53fbfd1e5fc375a7a8b8 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 36/36] cross-x86_64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..2811de0d3c2e 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (86 preceding siblings ...)
  2022-09-15  9:21 ` [PR PATCH] [Updated] " oreo639
@ 2022-09-15  9:22 ` oreo639
  2022-09-15  9:24 ` oreo639
                   ` (176 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-09-15  9:22 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 315 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1247824189

Comment:
Don't install gpgme from this PR (the propper PR is linked in the original post, it's just here to fix a build failure).

The full error and command used would be helpful.

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (87 preceding siblings ...)
  2022-09-15  9:22 ` oreo639
@ 2022-09-15  9:24 ` oreo639
  2022-09-15  9:24 ` oreo639
                   ` (175 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-09-15  9:24 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 434 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1247824189

Comment:
Don't install gpgme from this PR (the propper PR is linked in the original post, it's just here to fix a build failure).

The full error and command used would be helpful. (also you can always try deleting your masterdir and running binary-bootstrap to re-create it if things get messed up)

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (88 preceding siblings ...)
  2022-09-15  9:24 ` oreo639
@ 2022-09-15  9:24 ` oreo639
  2022-09-15  9:26 ` oreo639
                   ` (174 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-09-15  9:24 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 435 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1247824189

Comment:
Don't install gpgme from this PR (the propper PR is linked in the original post, it's just here to fix a build failure).

The full error and command used would be helpful. (also, you can always try deleting your masterdir and running binary-bootstrap to re-create it if things get messed up)

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (89 preceding siblings ...)
  2022-09-15  9:24 ` oreo639
@ 2022-09-15  9:26 ` oreo639
  2022-09-15  9:27 ` oreo639
                   ` (173 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-09-15  9:26 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 500 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1247824189

Comment:
Don't install gpgme from this PR (the propper PR is linked in the original post, it's just duplicated here to fix a build failures experienced when building the ISOs fully from source).

The full error and command used would be helpful. (also, you can always try deleting your masterdir and running binary-bootstrap to re-create it if things get messed up)

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (90 preceding siblings ...)
  2022-09-15  9:26 ` oreo639
@ 2022-09-15  9:27 ` oreo639
  2022-09-15  9:30 ` oreo639
                   ` (172 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-09-15  9:27 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 513 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1247824189

Comment:
Don't install gpgme from this PR (the propper PR is linked in the original post, it's just duplicated here to fix a build failures experienced when building the ISOs fully from source).

The full error and command used would be helpful. (also, you can always try deleting your masterdir and running `./xbps-src binary-bootstrap` to re-create it if things get messed up)

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (91 preceding siblings ...)
  2022-09-15  9:27 ` oreo639
@ 2022-09-15  9:30 ` oreo639
  2022-09-15  9:31 ` oreo639
                   ` (171 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-09-15  9:30 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 518 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1247824189

Comment:
I don't installing gpgme from this PR (the propper PR is linked in the original post, it's just duplicated here to fix a build failures experienced when building the ISOs fully from source).

The full error and command used would be helpful. (also, you can always try deleting your masterdir and running `./xbps-src binary-bootstrap` to re-create it if things get messed up)

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (92 preceding siblings ...)
  2022-09-15  9:30 ` oreo639
@ 2022-09-15  9:31 ` oreo639
  2022-09-15  9:31 ` oreo639
                   ` (170 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-09-15  9:31 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 558 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1247824189

Comment:
I don't installing gpgme from this PR (the propper PR is linked in the original post, it's just duplicated here to fix a build failures experienced when building the ISOs fully from source and it's missing some important patches).

The full error and command used would be helpful. (also, you can always try deleting your masterdir and running `./xbps-src binary-bootstrap` to re-create it if things get messed up)

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (93 preceding siblings ...)
  2022-09-15  9:31 ` oreo639
@ 2022-09-15  9:31 ` oreo639
  2022-09-15  9:48 ` [PR PATCH] [Updated] " oreo639
                   ` (169 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-09-15  9:31 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 518 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1247824189

Comment:
I don't installing gpgme from this PR (the propper PR is linked in the original post, it's just duplicated here to fix a build failures experienced when building the ISOs fully from source).

The full error and command used would be helpful. (also, you can always try deleting your masterdir and running `./xbps-src binary-bootstrap` to re-create it if things get messed up)

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (94 preceding siblings ...)
  2022-09-15  9:31 ` oreo639
@ 2022-09-15  9:48 ` oreo639
  2022-09-15 18:28 ` TeusLollo
                   ` (168 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-09-15  9:48 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5092 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.2.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.2.0

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/38817
- [x] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [x] llvm https://github.com/void-linux/void-packages/pull/38694
- [x] m4 https://github.com/void-linux/void-packages/pull/33730
- [x] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [x] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [x] libvirt https://github.com/void-linux/void-packages/pull/38842
- [x] syslinux https://github.com/void-linux/void-packages/pull/38876
- [x] efivar https://github.com/void-linux/void-packages/pull/38874

Known packages that needed to be fixed/updated for gcc12:
- [ ] linux5.18 (in this PR)
- [x] openssh https://github.com/void-linux/void-packages/pull/38849
- [x] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [x] doxygen https://github.com/void-linux/void-packages/pull/38846
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/38817
- [x] libproxy https://github.com/void-linux/void-packages/pull/38818
- [x] exempi https://github.com/void-linux/void-packages/pull/38820
- [x] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [ ] gpgme https://github.com/void-linux/void-packages/pull/38825
- [x] libunique1 https://github.com/void-linux/void-packages/pull/38848 or https://github.com/void-linux/void-packages/pull/38873
- [x] libwpd https://github.com/void-linux/void-packages/pull/38878

Needs to be fixed/updated for binutils:
- [x] grub https://github.com/void-linux/void-packages/pull/38875
- [x] linux-tools https://github.com/void-linux/void-packages/pull/38877
- [ ] kcov https://github.com/void-linux/void-packages/pull/39291

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [x] kde
- [x] lxde
- [x] lxqt

You can test the ISOs here:
https://drive.google.com/drive/folders/1ix92CYSLUP-KWjLxltdgG4e8Nu2JCY5n?usp=sharing

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 109242 bytes --]

From 21072caf22bca881c773801c9ebdadb1dac40525 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 01/35] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../fix-libcollector-without-java.patch       | 53 +++++++++++++++
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 21 ++++--
 4 files changed, 85 insertions(+), 115 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
 create mode 100644 srcpkgs/binutils/patches/fix-libcollector-without-java.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/fix-libcollector-without-java.patch b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
new file mode 100644
index 000000000000..54384875f358
--- /dev/null
+++ b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
@@ -0,0 +1,53 @@
+From 49ddd814ac1071af7c4f45d5f8398b91862f2c7f Mon Sep 17 00:00:00 2001
+From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
+Date: Wed, 17 Aug 2022 19:55:23 -0700
+Subject: [PATCH] gprofng: fix bug 29479 Collection fails when built without
+ java support
+
+gprofng/ChangeLog
+2022-08-17  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>
+
+	PR gprofng/29479
+	* libcollector/collector.c: Add #if defined(GPROFNG_JAVA_PROFILING) for
+	java specific code.
+	* libcollector/unwind.c: Likewise.
+---
+ gprofng/libcollector/collector.c | 2 ++
+ gprofng/libcollector/unwind.c    | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/gprofng/libcollector/collector.c b/gprofng/libcollector/collector.c
+index 93c9d3330de5..ceff2c1caccb 100644
+--- a/gprofng/libcollector/collector.c
++++ b/gprofng/libcollector/collector.c
+@@ -913,8 +913,10 @@ __collector_open_experiment (const char *exp, const char *params, sp_origin_t or
+   __collector_ext_unwind_key_init (1, NULL);
+ 
+   /* start java attach if suitable */
++#if defined(GPROFNG_JAVA_PROFILING)
+   if (exp_origin == SP_ORIGIN_DBX_ATTACH)
+     __collector_jprofile_start_attach ();
++#endif
+   start_sec_time = CALL_UTIL (time)(NULL);
+   __collector_start_time = collector_interface.getHiResTime ();
+   TprintfT (DBG_LT0, "\t__collector_open_experiment; resetting start_time\n");
+diff --git a/gprofng/libcollector/unwind.c b/gprofng/libcollector/unwind.c
+index 119243788020..f8e11823c81e 100644
+--- a/gprofng/libcollector/unwind.c
++++ b/gprofng/libcollector/unwind.c
+@@ -557,6 +557,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+   int size = max_frame_size;
+ 
+ #define MIN(a,b) ((a)<(b)?(a):(b))
++#if defined(GPROFNG_JAVA_PROFILING)
+   /* get Java info */
+   if (__collector_java_mode && __collector_java_asyncgetcalltrace_loaded && context && !pseudo_context)
+     {
+@@ -569,6 +570,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+ 	  size -= sz;
+ 	}
+     }
++#endif
+ 
+   /* get native stack */
+   if (context)
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..71895f2073fd 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkg-config"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -44,6 +45,12 @@ do_configure() {
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	# gprofng currently only supports x86 and aarch64 glibc.
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64|i386|aarch64) conf+=" --enable-gprofng" ;;
+		*) conf+=" --disable-gprofng" ;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"
@@ -76,9 +83,10 @@ do_configure() {
 		--libdir=/usr/lib \
 		--mandir=/usr/share/man \
 		--infodir=/usr/share/info \
+		--sysconfdir=/etc \
 		--disable-werror \
-		--disable-shared \
 		--disable-nls \
+		--enable-shared \
 		--enable-threads \
 		--enable-plugins \
 		--enable-relro \
@@ -142,7 +150,8 @@ binutils-devel_package() {
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/*.a"
-		vmove "usr/lib/*.so"
+		vmove "usr/lib/libbfd.so"
+		vmove "usr/lib/libopcodes.so"
 	}
 }
 

From 94ced4f30e936d24e13a01ae64669e4a4b4addce Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 02/35] gcc: update to 12.2.0.

---
 common/shlibs                                 | 10 +--
 srcpkgs/gcc/files/gccgo-musl.patch            | 71 +++----------------
 srcpkgs/gcc/files/libgnarl-musl.patch         | 18 ++---
 srcpkgs/gcc/files/libssp-musl.patch           | 10 +--
 srcpkgs/gcc/patches/libffi_gnulinux.patch     | 11 ---
 .../gcc/patches/libgcc-ibm128-no-tag.patch    | 10 ++-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |  2 +-
 srcpkgs/gcc/template                          | 25 +++----
 8 files changed, 49 insertions(+), 108 deletions(-)
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index ec58b8c40619..8f737837ffaf 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.2.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.34 perl-5.34.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -846,8 +846,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.2.0_1
+libgnat-12.so libada-12.2.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1697,8 +1697,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.2.0_1
+libasan.so.8 libsanitizer-12.2.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..12ec68dd8aa3 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,14 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ b/libgo/go/runtime/os_linux.go
+@@ -365,7 +365,7 @@ func setThreadCPUProfiler(hz int32) {
+ 	var sevp _sigevent
+ 	sevp.sigev_notify = _SIGEV_THREAD_ID
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.__sev_fields))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..446741390d45 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,15 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
+version=12.2.0
+revision=1
 _patchver="${version%pre*}"
 _minorver="${_patchver%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 wrksrc=gcc-${version/pre/_pre}
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +19,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -396,7 +393,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}

From b93f5006d6dbdf55585b781a90890689ec85a3dc Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 03/35] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      | 11 ++++--
 2 files changed, 25 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..70c4aa533e66 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,12 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
+
+if [ "$XBPS_LIBC" == "musl" ]; then
+# Musl always searches LD_LIBRARY_PATH before RPATH and RUNPATH
+make_build_args="lt_cv_shlibpath_overrides_runpath=yes"
+fi
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From dbdc58a94b3d524bd5c95e93791e32dedc94c64e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 04/35] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 1a4e1ca3d594..b04268908c2e 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="q66 <daniel@octaforge.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From d55530d4ebd7a97aee4b0e9ed947c8cabb695225 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 05/35] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 3 files changed, 55 insertions(+), 353 deletions(-)
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index 8f737837ffaf..e9adcaefb3dc 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From ae2420ee43f3dcdf485de5a99704bd505c13745a Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Wed, 14 Sep 2022 03:48:32 -0700
Subject: [PATCH 06/35] musl: add support for SIGEV_THREAD_ID timers

https://git.musl-libc.org/cgit/musl/commit/?id=7c71792e87691451f2a6b76348e83ad1889f1dcb
---
 ...d-support-for-SIGEV_THREAD_ID-timers.patch | 74 +++++++++++++++++++
 srcpkgs/musl/template                         |  2 +-
 2 files changed, 75 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch

diff --git a/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
new file mode 100644
index 000000000000..e20dff5ba0d4
--- /dev/null
+++ b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
@@ -0,0 +1,74 @@
+From 7c71792e87691451f2a6b76348e83ad1889f1dcb Mon Sep 17 00:00:00 2001
+From: James Y Knight <jyknight@google.com>
+Date: Sun, 30 Jun 2019 21:55:20 -0400
+Subject: [PATCH] add support for SIGEV_THREAD_ID timers
+
+This is like SIGEV_SIGNAL, but targeted to a particular thread's
+tid, rather than the process.
+---
+ include/signal.h        | 16 +++++++++++++---
+ src/time/timer_create.c |  8 ++++++--
+ 2 files changed, 19 insertions(+), 5 deletions(-)
+
+diff --git a/include/signal.h b/include/signal.h
+index fbdf667b2..9ed929e4f 100644
+--- a/include/signal.h
++++ b/include/signal.h
+@@ -180,14 +180,24 @@ struct sigevent {
+ 	union sigval sigev_value;
+ 	int sigev_signo;
+ 	int sigev_notify;
+-	void (*sigev_notify_function)(union sigval);
+-	pthread_attr_t *sigev_notify_attributes;
+-	char __pad[56-3*sizeof(long)];
++	union {
++		char __pad[64 - 2*sizeof(int) - sizeof(union sigval)];
++		pid_t sigev_notify_thread_id;
++		struct {
++			void (*sigev_notify_function)(union sigval);
++			pthread_attr_t *sigev_notify_attributes;
++		} __sev_thread;
++	} __sev_fields;
+ };
+ 
++#define sigev_notify_thread_id __sev_fields.sigev_notify_thread_id
++#define sigev_notify_function __sev_fields.__sev_thread.sigev_notify_function
++#define sigev_notify_attributes __sev_fields.__sev_thread.sigev_notify_attributes
++
+ #define SIGEV_SIGNAL 0
+ #define SIGEV_NONE 1
+ #define SIGEV_THREAD 2
++#define SIGEV_THREAD_ID 4
+ 
+ int __libc_current_sigrtmin(void);
+ int __libc_current_sigrtmax(void);
+diff --git a/src/time/timer_create.c b/src/time/timer_create.c
+index 5ddfda278..4bef23905 100644
+--- a/src/time/timer_create.c
++++ b/src/time/timer_create.c
+@@ -71,11 +71,15 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 	switch (evp ? evp->sigev_notify : SIGEV_SIGNAL) {
+ 	case SIGEV_NONE:
+ 	case SIGEV_SIGNAL:
++	case SIGEV_THREAD_ID:
+ 		if (evp) {
+ 			ksev.sigev_value = evp->sigev_value;
+ 			ksev.sigev_signo = evp->sigev_signo;
+ 			ksev.sigev_notify = evp->sigev_notify;
+-			ksev.sigev_tid = 0;
++			if (evp->sigev_notify == SIGEV_THREAD_ID)
++				ksev.sigev_tid = evp->sigev_notify_thread_id;
++			else
++				ksev.sigev_tid = 0;
+ 			ksevp = &ksev;
+ 		}
+ 		if (syscall(SYS_timer_create, clk, ksevp, &timerid) < 0)
+@@ -107,7 +111,7 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 
+ 		ksev.sigev_value.sival_ptr = 0;
+ 		ksev.sigev_signo = SIGTIMER;
+-		ksev.sigev_notify = 4; /* SIGEV_THREAD_ID */
++		ksev.sigev_notify = SIGEV_THREAD_ID;
+ 		ksev.sigev_tid = td->tid;
+ 		if (syscall(SYS_timer_create, clk, &ksev, &timerid) < 0)
+ 			timerid = -1;
diff --git a/srcpkgs/musl/template b/srcpkgs/musl/template
index 5bdc5c48e623..34e6ed4fba6e 100644
--- a/srcpkgs/musl/template
+++ b/srcpkgs/musl/template
@@ -2,7 +2,7 @@
 pkgname=musl
 reverts="1.2.0_1"
 version=1.1.24
-revision=10
+revision=11
 archs="*-musl"
 bootstrap=yes
 build_style=gnu-configure

From c1da8312cd30b63dd6bd052ac788636fcfa8b4df Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 21:01:43 -0700
Subject: [PATCH 07/35] gcc-multilib: update to 12.2.0.

---
 srcpkgs/gcc-multilib/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index fcd25755aa75..1a26da26a991 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,16 +3,16 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _majorver="${version%.*}"
-wrksrc=gcc-${version/pre/_pre}
+wrksrc=gcc-${version}
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel

From 171b5d7059d7e1831356ee87f86cccdfc14e722e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 14 Aug 2022 19:29:36 -0700
Subject: [PATCH 08/35] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove -no-pie from build. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..fcc00b3a6c5d 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -53,6 +53,7 @@ _void_cross_build_binutils() {
 		--sbindir=/usr/bin \
 		--libdir=/usr/lib \
 		--libexecdir=/usr/lib \
+		--sysconfdir=/etc \
 		--target=${tgt} \
 		--with-sysroot=/usr/${tgt} \
 		--disable-nls \
@@ -60,6 +61,7 @@ _void_cross_build_binutils() {
 		--disable-multilib \
 		--disable-werror \
 		--disable-gold \
+		--disable-gprofng \
 		--enable-relro \
 		--enable-plugins \
 		--enable-64-bit-bfd \
@@ -132,6 +134,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -460,6 +463,14 @@ do_build() {
 	local binutils_ver linux_ver gcc_ver libc_ver libucontext_ver
 	local tgt=${sourcepkg/cross-}
 
+	export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}"
+	export CXXFLAGS="${CXXFLAGS/-D_FORTIFY_SOURCE=2/}"
+
+	# Disable explicit -fno-PIE, gcc/binutils/libc will figure this out itself.
+	export CFLAGS="${CFLAGS//-fno-PIE/}"
+	export CXXFLAGS="${CXXFLAGS//-fno-PIE/}"
+	export LDFLAGS="${LDFLAGS//-no-pie/}"
+
 	_void_cross_test_ver binutils
 	_void_cross_test_ver linux
 	_void_cross_test_ver gcc
@@ -625,6 +636,9 @@ do_install() {
 	# then remove it because it conflicts with libquadmath package
 	rm -rf ${DESTDIR}/${sysroot}/usr/lib/libquadmath.*
 
+	# Remove libdep linker plugin because it conflicts with system binutils
+	rm -f ${DESTDIR}/usr/lib/bfd-plugins/libdep*
+
 	# Remove leftover symlinks
 	rm -f ${DESTDIR}/usr/lib${XBPS_TARGET_WORDSIZE}
 	rm -f ${DESTDIR}/lib*

From eb447570b52d883d22a98c93a8a3ccf58a5d8c98 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:09:31 -0700
Subject: [PATCH 09/35] linux5.18: update dotconfigs for gcc12

---
 srcpkgs/linux5.18/files/x86_64-dotconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/linux5.18/files/x86_64-dotconfig b/srcpkgs/linux5.18/files/x86_64-dotconfig
index 4e73a3195d40..ea6204868e23 100644
--- a/srcpkgs/linux5.18/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.18/files/x86_64-dotconfig
@@ -512,6 +512,7 @@ CONFIG_RETHUNK=y
 CONFIG_CPU_UNRET_ENTRY=y
 CONFIG_CPU_IBPB_ENTRY=y
 CONFIG_CPU_IBRS_ENTRY=y
+CONFIG_SLS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10060,8 +10061,11 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
 # Memory initialization
 #
 CONFIG_INIT_STACK_NONE=y
+# CONFIG_INIT_STACK_ALL_PATTERN is not set
+# CONFIG_INIT_STACK_ALL_ZERO is not set
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
+# CONFIG_ZERO_CALL_USED_REGS is not set
 # end of Memory initialization
 # end of Kernel hardening options
 # end of Security options
@@ -10538,6 +10542,7 @@ CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
 # CONFIG_UBSAN is not set
 CONFIG_HAVE_ARCH_KCSAN=y
+# CONFIG_KCSAN is not set
 # end of Generic Kernel Debugging Instruments
 
 #

From 32fadb751b9884de51fbad754b9707f9420ed21b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 14:45:28 -0700
Subject: [PATCH 10/35] libsasl: fix build for libtool 2.4.7

---
 srcpkgs/libsasl/template | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/libsasl/template b/srcpkgs/libsasl/template
index a8817042f843..a2993b39f4a1 100644
--- a/srcpkgs/libsasl/template
+++ b/srcpkgs/libsasl/template
@@ -19,6 +19,7 @@ distfiles="https://github.com/cyrusimap/cyrus-sasl/releases/download/cyrus-sasl-
 checksum=26866b1549b00ffd020f188a43c258017fa1c382b3ddadd8201536f72efb05d5
 
 pre_configure() {
+	rm -f m4/ltversion.m4
 	autoreconf -fi
 }
 

From a451a96050e208db481991661d00c025b81ddc2b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:08 -0700
Subject: [PATCH 11/35] subversion: fix build for libtool 2.4.7

---
 srcpkgs/subversion/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion/template b/srcpkgs/subversion/template
index 8ad178264942..3f1c9e254e61 100644
--- a/srcpkgs/subversion/template
+++ b/srcpkgs/subversion/template
@@ -57,7 +57,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From a097811281ba43e1733419f13e74978a91081b88 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:38 -0700
Subject: [PATCH 12/35] subversion-kwallet-auth: fix build for libtool 2.4.7

---
 srcpkgs/subversion-kwallet-auth/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion-kwallet-auth/template b/srcpkgs/subversion-kwallet-auth/template
index 12210f250d51..b4d8621456ea 100644
--- a/srcpkgs/subversion-kwallet-auth/template
+++ b/srcpkgs/subversion-kwallet-auth/template
@@ -59,7 +59,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From c7d33b7e940b2d121928703aa339f7679e9dc0d9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 13/35] cross-aarch64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..bd6b23f9fb6a 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 80b3a290f3d958498d6e7bf611c376ad5c914b1c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 14/35] cross-aarch64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..427ad2c1e9cd 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From df7dab2569beb80171bb7ee970c6840917893962 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 15/35] cross-arm-linux-gnueabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..2510ee26e789 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 8fd49f148133ec9b01d27802d49d4df39cb3878f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 16/35] cross-arm-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..bd8b16e1b4c1 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From d36b2985e9c8f1dd0db4b0d4ee1a1f5d87740ba6 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 17/35] cross-arm-linux-musleabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..dacfd2655216 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 578118fc9e8eb6783194f148e5adbd0453ab4658 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 18/35] cross-arm-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..9ddd32a9f20d 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From bcd9e16b2868bab6c9a76bd43f05c02a99a49f17 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 19/35] cross-armv7l-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..9fb00f18be3b 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 6ff8e5999e4038a52babdf8360ed8a3f819eb33f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 20/35] cross-armv7l-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..2c72e75ddfe3 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 95dc75e8a5ef1ecfd22434172a626d093a5d7e49 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 21/35] cross-i686-pc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..4dc17df648b5 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 13e6657eb5ffa2da54777f1245dabea3156808ce Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 22/35] cross-mips-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..6009e5c79eb2 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From ff955d95738fa16acdbe355ef3b4f70f22b922be Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 23/35] cross-mips-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..080164df193d 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="hipperson0 <hipperson0@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From d551677447b20f2dc31afcdef6f61838f678b977 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 24/35] cross-mipsel-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..f9fd4b8a04ef 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From e11cb365854b8ee8a4860c97c40acd472575b32f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 25/35] cross-mipsel-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..7418a984474b 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From af760461f895c848ee5c075c23ffac3d34479799 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 26/35] cross-powerpc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..31e57b4e52b2 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From ca67021f9effb70a6319c2dd3dd79da278eff36d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 27/35] cross-powerpc-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..a2d1edcf1ffd 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From e39916941e657a43690ca210adf91d1cfbb6da0e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 28/35] cross-powerpc64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..1a4cbed61e76 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 40ec1432847e62d898f73893ede2d4d09899474d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 29/35] cross-powerpc64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 1ebd0fb2048d..ade42018af05 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 2eed5d01b12c9ecc738f3f0bf3c1eb55d9e4096f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 30/35] cross-powerpc64le-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 733f5851da5c..03054239001e 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From b994b8a1d537620c1894baf31fd5d455216e1057 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 31/35] cross-powerpc64le-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index 76a70aa1d6db..5887f845f932 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 1da81662bc72f8834487264d5c46359253dbb264 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 32/35] cross-powerpcle-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 347b8fcf4f55..06530e0d609b 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 469a7e251247009e9bc2fd6950025bf8ff65e34c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 33/35] cross-powerpcle-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index ec9324ddaa99..e68c3962b49c 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 2708237c6822116d2b442b2a0870cd74803fa30e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 34/35] cross-x86_64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 0078fbe7224b..7da85c14b62d 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 2ac89c384676aec46f724c96008c196406727c6d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 35/35] cross-x86_64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..2811de0d3c2e 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (95 preceding siblings ...)
  2022-09-15  9:48 ` [PR PATCH] [Updated] " oreo639
@ 2022-09-15 18:28 ` TeusLollo
  2022-09-15 18:29 ` TeusLollo
                   ` (167 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: TeusLollo @ 2022-09-15 18:28 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 749 bytes --]

New comment by TeusLollo on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1248453336

Comment:
Excellent. Thanks for your work, Mr. Oreo639! And also thanks to the rest of the Void gang!

BTW, I believe the title should mention that this PR is related to both the latest of gcc and glibc. 
This because, as it is, this PR is kinda buried, and I couldn't find much about an update to the latest glibc until those recent commits started flocking in. 

Also, maybe a milestone somewhere would also be useful, since on reddit users have been asking for glibc updates since weeks by now. 

This is mostly cosmetic of course, so take my mostly-useless advice with a pinch of salt. 

Again, thanks!

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (96 preceding siblings ...)
  2022-09-15 18:28 ` TeusLollo
@ 2022-09-15 18:29 ` TeusLollo
  2022-09-16  4:39 ` xfervi
                   ` (166 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: TeusLollo @ 2022-09-15 18:29 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 786 bytes --]

New comment by TeusLollo on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1248453336

Comment:
Excellent. Thanks for your work, Mr. Oreo639! And also thanks to the rest of the Void gang!

BTW, I believe the title should mention that this PR is related to both the latest of gcc and glibc. 
This because, as it is, this PR is kinda buried, and I couldn't find much about an update to the latest glibc until those recent commits started flocking in. 

Also, maybe a milestone somewhere would also be useful, since on reddit users have been asking for glibc updates since weeks by now, and they clearly haven't found this. 

This is mostly cosmetic of course, so take my mostly-useless advice with a pinch of salt. 

Again, thanks!

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (97 preceding siblings ...)
  2022-09-15 18:29 ` TeusLollo
@ 2022-09-16  4:39 ` xfervi
  2022-09-16  4:40 ` xfervi
                   ` (165 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: xfervi @ 2022-09-16  4:39 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 757 bytes --]

New comment by xfervi on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1248911576

Comment:
About gpgme - yes, that's my fault.

But I now I've tried compiling gcc and getting this at comparing stage 2 and 3:


`..... (many other "differs")
mpfr/src/set_si.o differs
make[2]: *** [Makefile:32435: compare] Error1
make[1]: *** [Makefile:32415: stage3-bubble] Error 2
make[1]: Leaving directory '/builddir/gcc-12.2.0/build
make: *** [Makefile:1081: all] Error 2
=> ERROR: gcc-12.2.0_1: do_build: 'make ${makejobs}' exited with 2
=> ERROR:        in do_build() at srcpkgs/gcc/template:324`

I used ./xbps-src binary-bootstrap, and then ./xbps-src pkg gcc. Anything I can do without completely recompiling again?

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (98 preceding siblings ...)
  2022-09-16  4:39 ` xfervi
@ 2022-09-16  4:40 ` xfervi
  2022-09-16  4:40 ` xfervi
                   ` (164 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: xfervi @ 2022-09-16  4:40 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 767 bytes --]

New comment by xfervi on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1248911576

Comment:
About gpgme - yes, that's my fault.

But I now I've tried compiling gcc and getting this at comparing stage 2 and 3:


`..... (many other "differs")`
`mpfr/src/set_si.o differs`
make[2]: *** [Makefile:32435: compare] Error1
`make[1]: *** [Makefile:32415: stage3-bubble] Error 2`
`make[1]: Leaving directory '/builddir/gcc-12.2.0/build`
`make: *** [Makefile:1081: all] Error 2
=> ERROR: gcc-12.2.0_1: do_build: 'make ${makejobs}' exited with 2`
`=> ERROR:        in do_build() at srcpkgs/gcc/template:324`

I used ./xbps-src binary-bootstrap, and then ./xbps-src pkg gcc. Anything I can do without completely recompiling again?

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (99 preceding siblings ...)
  2022-09-16  4:40 ` xfervi
@ 2022-09-16  4:40 ` xfervi
  2022-09-16  4:41 ` xfervi
                   ` (163 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: xfervi @ 2022-09-16  4:40 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 769 bytes --]

New comment by xfervi on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1248911576

Comment:
About gpgme - yes, that's my fault.

But I now I've tried compiling gcc and getting this at comparing stage 2 and 3:


`..... (many other "differs")`
`mpfr/src/set_si.o differs`
`make[2]: *** [Makefile:32435: compare] Error1`
`make[1]: *** [Makefile:32415: stage3-bubble] Error 2`
`make[1]: Leaving directory '/builddir/gcc-12.2.0/build`
`make: *** [Makefile:1081: all] Error 2
=> ERROR: gcc-12.2.0_1: do_build: 'make ${makejobs}' exited with 2`
`=> ERROR:        in do_build() at srcpkgs/gcc/template:324`

I used ./xbps-src binary-bootstrap, and then ./xbps-src pkg gcc. Anything I can do without completely recompiling again?

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (100 preceding siblings ...)
  2022-09-16  4:40 ` xfervi
@ 2022-09-16  4:41 ` xfervi
  2022-09-16  4:44 ` oreo639
                   ` (162 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: xfervi @ 2022-09-16  4:41 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 771 bytes --]

New comment by xfervi on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1248911576

Comment:
About gpgme - yes, that's my fault.

But I now I've tried compiling gcc and getting this at comparing stage 2 and 3:


`..... (many other "differs")`
`mpfr/src/set_si.o differs`
`make[2]: *** [Makefile:32435: compare] Error1`
`make[1]: *** [Makefile:32415: stage3-bubble] Error 2`
`make[1]: Leaving directory '/builddir/gcc-12.2.0/build`
`make: *** [Makefile:1081: all] Error 2`
`=> ERROR: gcc-12.2.0_1: do_build: 'make ${makejobs}' exited with 2`
`=> ERROR:        in do_build() at srcpkgs/gcc/template:324`

I used ./xbps-src binary-bootstrap, and then ./xbps-src pkg gcc. Anything I can do without completely recompiling again?

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (101 preceding siblings ...)
  2022-09-16  4:41 ` xfervi
@ 2022-09-16  4:44 ` oreo639
  2022-09-16  4:50 ` oreo639
                   ` (161 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-09-16  4:44 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 222 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1248913804

Comment:
Can you paste the whole output into a gist (feel free to run the command again).

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (102 preceding siblings ...)
  2022-09-16  4:44 ` oreo639
@ 2022-09-16  4:50 ` oreo639
  2022-09-16  4:50 ` oreo639
                   ` (160 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-09-16  4:50 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 379 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1248913804

Comment:
Can you paste the whole output into a gist (feel free to run the command again).
(Also if you didn't previously, you should make sure you deleted your `masterdir/builddir` after running binary bootstrap to get rid of any leftover files)

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (103 preceding siblings ...)
  2022-09-16  4:50 ` oreo639
@ 2022-09-16  4:50 ` oreo639
  2022-09-16  4:56 ` oreo639
                   ` (159 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-09-16  4:50 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 385 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1248913804

Comment:
Can you paste the whole output into a gist (feel free to run the command again).
(Also if you didn't previously, you should make sure you deleted your `masterdir/builddir` after running binary bootstrap to get rid of any leftover build files)

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (104 preceding siblings ...)
  2022-09-16  4:50 ` oreo639
@ 2022-09-16  4:56 ` oreo639
  2022-09-16  5:03 ` xfervi
                   ` (158 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-09-16  4:56 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 415 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1248913804

Comment:
Can you paste the whole output into a gist (feel free to run the command again).
(Also if you didn't previously, you should make sure you deleted your `masterdir/builddir` after running binary bootstrap to make sure there aren't any leftover files from a non-chroot build)

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (105 preceding siblings ...)
  2022-09-16  4:56 ` oreo639
@ 2022-09-16  5:03 ` xfervi
  2022-09-16  5:05 ` oreo639
                   ` (157 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: xfervi @ 2022-09-16  5:03 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 292 bytes --]

New comment by xfervi on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1248921725

Comment:
https://gist.github.com/xfervi/840e1d0fc948128eac6ec7563f60698f
Here it is. Also, there is no dirs in builddir except for gcc, gmp, isl, mpc and mpfr.

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (106 preceding siblings ...)
  2022-09-16  5:03 ` xfervi
@ 2022-09-16  5:05 ` oreo639
  2022-09-16  5:06 ` oreo639
                   ` (156 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-09-16  5:05 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 279 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1248923013

Comment:
> Also, there is no dirs in builddir except for gcc, gmp, isl, mpc and mpfr.

Yes, I'm saying to delete them and try to build it again.

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (107 preceding siblings ...)
  2022-09-16  5:05 ` oreo639
@ 2022-09-16  5:06 ` oreo639
  2022-09-16  5:08 ` oreo639
                   ` (155 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-09-16  5:06 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 314 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1248923013

Comment:
> Also, there is no dirs in builddir except for gcc, gmp, isl, mpc and mpfr.

Yes, I'm saying to delete them and try to build it again. (also delete the .xbps-gcc folder)

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (108 preceding siblings ...)
  2022-09-16  5:06 ` oreo639
@ 2022-09-16  5:08 ` oreo639
  2022-09-16  5:10 ` xfervi
                   ` (154 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-09-16  5:08 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 432 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1248923013

Comment:
> Also, there is no dirs in builddir except for gcc, gmp, isl, mpc and mpfr.

Yes, I'm saying to delete them and try to build it again. (also delete the .xbps-gcc folder)

Also, you can do `./xbps-src pkg -jN gcc` to do a multithreadded build (with N being the max number of processes).

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (109 preceding siblings ...)
  2022-09-16  5:08 ` oreo639
@ 2022-09-16  5:10 ` xfervi
  2022-09-16 12:40 ` xfervi
                   ` (153 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: xfervi @ 2022-09-16  5:10 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 236 bytes --]

New comment by xfervi on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1248925437

Comment:
Ah sure... I'll try building again. Thanks for tip btw, as previous build took around 15 hours.

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (110 preceding siblings ...)
  2022-09-16  5:10 ` xfervi
@ 2022-09-16 12:40 ` xfervi
  2022-09-17  3:52 ` [PR PATCH] [Updated] " oreo639
                   ` (152 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: xfervi @ 2022-09-16 12:40 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 194 bytes --]

New comment by xfervi on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1249313641

Comment:
I'm not sure how, but recompiling fixed that. Thanks!

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (111 preceding siblings ...)
  2022-09-16 12:40 ` xfervi
@ 2022-09-17  3:52 ` oreo639
  2022-09-23  1:21 ` Seltyk
                   ` (151 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-09-17  3:52 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5092 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.2.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.2.0

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/38817
- [x] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [x] llvm https://github.com/void-linux/void-packages/pull/38694
- [x] m4 https://github.com/void-linux/void-packages/pull/33730
- [x] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [x] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [x] libvirt https://github.com/void-linux/void-packages/pull/38842
- [x] syslinux https://github.com/void-linux/void-packages/pull/38876
- [x] efivar https://github.com/void-linux/void-packages/pull/38874

Known packages that needed to be fixed/updated for gcc12:
- [ ] linux5.18 (in this PR)
- [x] openssh https://github.com/void-linux/void-packages/pull/38849
- [x] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [x] doxygen https://github.com/void-linux/void-packages/pull/38846
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/38817
- [x] libproxy https://github.com/void-linux/void-packages/pull/38818
- [x] exempi https://github.com/void-linux/void-packages/pull/38820
- [x] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [ ] gpgme https://github.com/void-linux/void-packages/pull/38825
- [x] libunique1 https://github.com/void-linux/void-packages/pull/38848 or https://github.com/void-linux/void-packages/pull/38873
- [x] libwpd https://github.com/void-linux/void-packages/pull/38878

Needs to be fixed/updated for binutils:
- [x] grub https://github.com/void-linux/void-packages/pull/38875
- [x] linux-tools https://github.com/void-linux/void-packages/pull/38877
- [ ] kcov https://github.com/void-linux/void-packages/pull/39291

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [x] kde
- [x] lxde
- [x] lxqt

You can test the ISOs here:
https://drive.google.com/drive/folders/1ix92CYSLUP-KWjLxltdgG4e8Nu2JCY5n?usp=sharing

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 111459 bytes --]

From 21072caf22bca881c773801c9ebdadb1dac40525 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 01/36] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../fix-libcollector-without-java.patch       | 53 +++++++++++++++
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 21 ++++--
 4 files changed, 85 insertions(+), 115 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
 create mode 100644 srcpkgs/binutils/patches/fix-libcollector-without-java.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/fix-libcollector-without-java.patch b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
new file mode 100644
index 000000000000..54384875f358
--- /dev/null
+++ b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
@@ -0,0 +1,53 @@
+From 49ddd814ac1071af7c4f45d5f8398b91862f2c7f Mon Sep 17 00:00:00 2001
+From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
+Date: Wed, 17 Aug 2022 19:55:23 -0700
+Subject: [PATCH] gprofng: fix bug 29479 Collection fails when built without
+ java support
+
+gprofng/ChangeLog
+2022-08-17  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>
+
+	PR gprofng/29479
+	* libcollector/collector.c: Add #if defined(GPROFNG_JAVA_PROFILING) for
+	java specific code.
+	* libcollector/unwind.c: Likewise.
+---
+ gprofng/libcollector/collector.c | 2 ++
+ gprofng/libcollector/unwind.c    | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/gprofng/libcollector/collector.c b/gprofng/libcollector/collector.c
+index 93c9d3330de5..ceff2c1caccb 100644
+--- a/gprofng/libcollector/collector.c
++++ b/gprofng/libcollector/collector.c
+@@ -913,8 +913,10 @@ __collector_open_experiment (const char *exp, const char *params, sp_origin_t or
+   __collector_ext_unwind_key_init (1, NULL);
+ 
+   /* start java attach if suitable */
++#if defined(GPROFNG_JAVA_PROFILING)
+   if (exp_origin == SP_ORIGIN_DBX_ATTACH)
+     __collector_jprofile_start_attach ();
++#endif
+   start_sec_time = CALL_UTIL (time)(NULL);
+   __collector_start_time = collector_interface.getHiResTime ();
+   TprintfT (DBG_LT0, "\t__collector_open_experiment; resetting start_time\n");
+diff --git a/gprofng/libcollector/unwind.c b/gprofng/libcollector/unwind.c
+index 119243788020..f8e11823c81e 100644
+--- a/gprofng/libcollector/unwind.c
++++ b/gprofng/libcollector/unwind.c
+@@ -557,6 +557,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+   int size = max_frame_size;
+ 
+ #define MIN(a,b) ((a)<(b)?(a):(b))
++#if defined(GPROFNG_JAVA_PROFILING)
+   /* get Java info */
+   if (__collector_java_mode && __collector_java_asyncgetcalltrace_loaded && context && !pseudo_context)
+     {
+@@ -569,6 +570,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+ 	  size -= sz;
+ 	}
+     }
++#endif
+ 
+   /* get native stack */
+   if (context)
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..71895f2073fd 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkg-config"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -44,6 +45,12 @@ do_configure() {
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	# gprofng currently only supports x86 and aarch64 glibc.
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64|i386|aarch64) conf+=" --enable-gprofng" ;;
+		*) conf+=" --disable-gprofng" ;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"
@@ -76,9 +83,10 @@ do_configure() {
 		--libdir=/usr/lib \
 		--mandir=/usr/share/man \
 		--infodir=/usr/share/info \
+		--sysconfdir=/etc \
 		--disable-werror \
-		--disable-shared \
 		--disable-nls \
+		--enable-shared \
 		--enable-threads \
 		--enable-plugins \
 		--enable-relro \
@@ -142,7 +150,8 @@ binutils-devel_package() {
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/*.a"
-		vmove "usr/lib/*.so"
+		vmove "usr/lib/libbfd.so"
+		vmove "usr/lib/libopcodes.so"
 	}
 }
 

From 94ced4f30e936d24e13a01ae64669e4a4b4addce Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 02/36] gcc: update to 12.2.0.

---
 common/shlibs                                 | 10 +--
 srcpkgs/gcc/files/gccgo-musl.patch            | 71 +++----------------
 srcpkgs/gcc/files/libgnarl-musl.patch         | 18 ++---
 srcpkgs/gcc/files/libssp-musl.patch           | 10 +--
 srcpkgs/gcc/patches/libffi_gnulinux.patch     | 11 ---
 .../gcc/patches/libgcc-ibm128-no-tag.patch    | 10 ++-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |  2 +-
 srcpkgs/gcc/template                          | 25 +++----
 8 files changed, 49 insertions(+), 108 deletions(-)
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index ec58b8c40619..8f737837ffaf 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.2.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.34 perl-5.34.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -846,8 +846,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.2.0_1
+libgnat-12.so libada-12.2.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1697,8 +1697,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.2.0_1
+libasan.so.8 libsanitizer-12.2.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..12ec68dd8aa3 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,14 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ b/libgo/go/runtime/os_linux.go
+@@ -365,7 +365,7 @@ func setThreadCPUProfiler(hz int32) {
+ 	var sevp _sigevent
+ 	sevp.sigev_notify = _SIGEV_THREAD_ID
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.__sev_fields))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..446741390d45 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,15 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
+version=12.2.0
+revision=1
 _patchver="${version%pre*}"
 _minorver="${_patchver%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 wrksrc=gcc-${version/pre/_pre}
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +19,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -396,7 +393,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}

From b93f5006d6dbdf55585b781a90890689ec85a3dc Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 03/36] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      | 11 ++++--
 2 files changed, 25 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..70c4aa533e66 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,12 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
+
+if [ "$XBPS_LIBC" == "musl" ]; then
+# Musl always searches LD_LIBRARY_PATH before RPATH and RUNPATH
+make_build_args="lt_cv_shlibpath_overrides_runpath=yes"
+fi
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From dbdc58a94b3d524bd5c95e93791e32dedc94c64e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 04/36] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 1a4e1ca3d594..b04268908c2e 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="q66 <daniel@octaforge.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From d55530d4ebd7a97aee4b0e9ed947c8cabb695225 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 05/36] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 3 files changed, 55 insertions(+), 353 deletions(-)
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index 8f737837ffaf..e9adcaefb3dc 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From ae2420ee43f3dcdf485de5a99704bd505c13745a Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Wed, 14 Sep 2022 03:48:32 -0700
Subject: [PATCH 06/36] musl: add support for SIGEV_THREAD_ID timers

https://git.musl-libc.org/cgit/musl/commit/?id=7c71792e87691451f2a6b76348e83ad1889f1dcb
---
 ...d-support-for-SIGEV_THREAD_ID-timers.patch | 74 +++++++++++++++++++
 srcpkgs/musl/template                         |  2 +-
 2 files changed, 75 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch

diff --git a/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
new file mode 100644
index 000000000000..e20dff5ba0d4
--- /dev/null
+++ b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
@@ -0,0 +1,74 @@
+From 7c71792e87691451f2a6b76348e83ad1889f1dcb Mon Sep 17 00:00:00 2001
+From: James Y Knight <jyknight@google.com>
+Date: Sun, 30 Jun 2019 21:55:20 -0400
+Subject: [PATCH] add support for SIGEV_THREAD_ID timers
+
+This is like SIGEV_SIGNAL, but targeted to a particular thread's
+tid, rather than the process.
+---
+ include/signal.h        | 16 +++++++++++++---
+ src/time/timer_create.c |  8 ++++++--
+ 2 files changed, 19 insertions(+), 5 deletions(-)
+
+diff --git a/include/signal.h b/include/signal.h
+index fbdf667b2..9ed929e4f 100644
+--- a/include/signal.h
++++ b/include/signal.h
+@@ -180,14 +180,24 @@ struct sigevent {
+ 	union sigval sigev_value;
+ 	int sigev_signo;
+ 	int sigev_notify;
+-	void (*sigev_notify_function)(union sigval);
+-	pthread_attr_t *sigev_notify_attributes;
+-	char __pad[56-3*sizeof(long)];
++	union {
++		char __pad[64 - 2*sizeof(int) - sizeof(union sigval)];
++		pid_t sigev_notify_thread_id;
++		struct {
++			void (*sigev_notify_function)(union sigval);
++			pthread_attr_t *sigev_notify_attributes;
++		} __sev_thread;
++	} __sev_fields;
+ };
+ 
++#define sigev_notify_thread_id __sev_fields.sigev_notify_thread_id
++#define sigev_notify_function __sev_fields.__sev_thread.sigev_notify_function
++#define sigev_notify_attributes __sev_fields.__sev_thread.sigev_notify_attributes
++
+ #define SIGEV_SIGNAL 0
+ #define SIGEV_NONE 1
+ #define SIGEV_THREAD 2
++#define SIGEV_THREAD_ID 4
+ 
+ int __libc_current_sigrtmin(void);
+ int __libc_current_sigrtmax(void);
+diff --git a/src/time/timer_create.c b/src/time/timer_create.c
+index 5ddfda278..4bef23905 100644
+--- a/src/time/timer_create.c
++++ b/src/time/timer_create.c
+@@ -71,11 +71,15 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 	switch (evp ? evp->sigev_notify : SIGEV_SIGNAL) {
+ 	case SIGEV_NONE:
+ 	case SIGEV_SIGNAL:
++	case SIGEV_THREAD_ID:
+ 		if (evp) {
+ 			ksev.sigev_value = evp->sigev_value;
+ 			ksev.sigev_signo = evp->sigev_signo;
+ 			ksev.sigev_notify = evp->sigev_notify;
+-			ksev.sigev_tid = 0;
++			if (evp->sigev_notify == SIGEV_THREAD_ID)
++				ksev.sigev_tid = evp->sigev_notify_thread_id;
++			else
++				ksev.sigev_tid = 0;
+ 			ksevp = &ksev;
+ 		}
+ 		if (syscall(SYS_timer_create, clk, ksevp, &timerid) < 0)
+@@ -107,7 +111,7 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 
+ 		ksev.sigev_value.sival_ptr = 0;
+ 		ksev.sigev_signo = SIGTIMER;
+-		ksev.sigev_notify = 4; /* SIGEV_THREAD_ID */
++		ksev.sigev_notify = SIGEV_THREAD_ID;
+ 		ksev.sigev_tid = td->tid;
+ 		if (syscall(SYS_timer_create, clk, &ksev, &timerid) < 0)
+ 			timerid = -1;
diff --git a/srcpkgs/musl/template b/srcpkgs/musl/template
index 5bdc5c48e623..34e6ed4fba6e 100644
--- a/srcpkgs/musl/template
+++ b/srcpkgs/musl/template
@@ -2,7 +2,7 @@
 pkgname=musl
 reverts="1.2.0_1"
 version=1.1.24
-revision=10
+revision=11
 archs="*-musl"
 bootstrap=yes
 build_style=gnu-configure

From c1da8312cd30b63dd6bd052ac788636fcfa8b4df Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 21:01:43 -0700
Subject: [PATCH 07/36] gcc-multilib: update to 12.2.0.

---
 srcpkgs/gcc-multilib/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index fcd25755aa75..1a26da26a991 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,16 +3,16 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _majorver="${version%.*}"
-wrksrc=gcc-${version/pre/_pre}
+wrksrc=gcc-${version}
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel

From 171b5d7059d7e1831356ee87f86cccdfc14e722e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 14 Aug 2022 19:29:36 -0700
Subject: [PATCH 08/36] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove -no-pie from build. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..fcc00b3a6c5d 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -53,6 +53,7 @@ _void_cross_build_binutils() {
 		--sbindir=/usr/bin \
 		--libdir=/usr/lib \
 		--libexecdir=/usr/lib \
+		--sysconfdir=/etc \
 		--target=${tgt} \
 		--with-sysroot=/usr/${tgt} \
 		--disable-nls \
@@ -60,6 +61,7 @@ _void_cross_build_binutils() {
 		--disable-multilib \
 		--disable-werror \
 		--disable-gold \
+		--disable-gprofng \
 		--enable-relro \
 		--enable-plugins \
 		--enable-64-bit-bfd \
@@ -132,6 +134,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -460,6 +463,14 @@ do_build() {
 	local binutils_ver linux_ver gcc_ver libc_ver libucontext_ver
 	local tgt=${sourcepkg/cross-}
 
+	export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}"
+	export CXXFLAGS="${CXXFLAGS/-D_FORTIFY_SOURCE=2/}"
+
+	# Disable explicit -fno-PIE, gcc/binutils/libc will figure this out itself.
+	export CFLAGS="${CFLAGS//-fno-PIE/}"
+	export CXXFLAGS="${CXXFLAGS//-fno-PIE/}"
+	export LDFLAGS="${LDFLAGS//-no-pie/}"
+
 	_void_cross_test_ver binutils
 	_void_cross_test_ver linux
 	_void_cross_test_ver gcc
@@ -625,6 +636,9 @@ do_install() {
 	# then remove it because it conflicts with libquadmath package
 	rm -rf ${DESTDIR}/${sysroot}/usr/lib/libquadmath.*
 
+	# Remove libdep linker plugin because it conflicts with system binutils
+	rm -f ${DESTDIR}/usr/lib/bfd-plugins/libdep*
+
 	# Remove leftover symlinks
 	rm -f ${DESTDIR}/usr/lib${XBPS_TARGET_WORDSIZE}
 	rm -f ${DESTDIR}/lib*

From eb447570b52d883d22a98c93a8a3ccf58a5d8c98 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:09:31 -0700
Subject: [PATCH 09/36] linux5.18: update dotconfigs for gcc12

---
 srcpkgs/linux5.18/files/x86_64-dotconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/linux5.18/files/x86_64-dotconfig b/srcpkgs/linux5.18/files/x86_64-dotconfig
index 4e73a3195d40..ea6204868e23 100644
--- a/srcpkgs/linux5.18/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.18/files/x86_64-dotconfig
@@ -512,6 +512,7 @@ CONFIG_RETHUNK=y
 CONFIG_CPU_UNRET_ENTRY=y
 CONFIG_CPU_IBPB_ENTRY=y
 CONFIG_CPU_IBRS_ENTRY=y
+CONFIG_SLS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10060,8 +10061,11 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
 # Memory initialization
 #
 CONFIG_INIT_STACK_NONE=y
+# CONFIG_INIT_STACK_ALL_PATTERN is not set
+# CONFIG_INIT_STACK_ALL_ZERO is not set
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
+# CONFIG_ZERO_CALL_USED_REGS is not set
 # end of Memory initialization
 # end of Kernel hardening options
 # end of Security options
@@ -10538,6 +10542,7 @@ CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
 # CONFIG_UBSAN is not set
 CONFIG_HAVE_ARCH_KCSAN=y
+# CONFIG_KCSAN is not set
 # end of Generic Kernel Debugging Instruments
 
 #

From 32fadb751b9884de51fbad754b9707f9420ed21b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 14:45:28 -0700
Subject: [PATCH 10/36] libsasl: fix build for libtool 2.4.7

---
 srcpkgs/libsasl/template | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/libsasl/template b/srcpkgs/libsasl/template
index a8817042f843..a2993b39f4a1 100644
--- a/srcpkgs/libsasl/template
+++ b/srcpkgs/libsasl/template
@@ -19,6 +19,7 @@ distfiles="https://github.com/cyrusimap/cyrus-sasl/releases/download/cyrus-sasl-
 checksum=26866b1549b00ffd020f188a43c258017fa1c382b3ddadd8201536f72efb05d5
 
 pre_configure() {
+	rm -f m4/ltversion.m4
 	autoreconf -fi
 }
 

From a451a96050e208db481991661d00c025b81ddc2b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:08 -0700
Subject: [PATCH 11/36] subversion: fix build for libtool 2.4.7

---
 srcpkgs/subversion/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion/template b/srcpkgs/subversion/template
index 8ad178264942..3f1c9e254e61 100644
--- a/srcpkgs/subversion/template
+++ b/srcpkgs/subversion/template
@@ -57,7 +57,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From a097811281ba43e1733419f13e74978a91081b88 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:38 -0700
Subject: [PATCH 12/36] subversion-kwallet-auth: fix build for libtool 2.4.7

---
 srcpkgs/subversion-kwallet-auth/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion-kwallet-auth/template b/srcpkgs/subversion-kwallet-auth/template
index 12210f250d51..b4d8621456ea 100644
--- a/srcpkgs/subversion-kwallet-auth/template
+++ b/srcpkgs/subversion-kwallet-auth/template
@@ -59,7 +59,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From c7d33b7e940b2d121928703aa339f7679e9dc0d9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 13/36] cross-aarch64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..bd6b23f9fb6a 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 80b3a290f3d958498d6e7bf611c376ad5c914b1c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 14/36] cross-aarch64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..427ad2c1e9cd 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From df7dab2569beb80171bb7ee970c6840917893962 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 15/36] cross-arm-linux-gnueabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..2510ee26e789 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 8fd49f148133ec9b01d27802d49d4df39cb3878f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 16/36] cross-arm-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..bd8b16e1b4c1 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From d36b2985e9c8f1dd0db4b0d4ee1a1f5d87740ba6 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 17/36] cross-arm-linux-musleabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..dacfd2655216 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 578118fc9e8eb6783194f148e5adbd0453ab4658 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 18/36] cross-arm-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..9ddd32a9f20d 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From bcd9e16b2868bab6c9a76bd43f05c02a99a49f17 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 19/36] cross-armv7l-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..9fb00f18be3b 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 6ff8e5999e4038a52babdf8360ed8a3f819eb33f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 20/36] cross-armv7l-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..2c72e75ddfe3 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 95dc75e8a5ef1ecfd22434172a626d093a5d7e49 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 21/36] cross-i686-pc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..4dc17df648b5 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 55d895d7606353df13ece4dd29b39db922b0b03c Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Fri, 16 Sep 2022 20:52:19 -0700
Subject: [PATCH 22/36] cross-i686-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-linux-musl/template b/srcpkgs/cross-i686-linux-musl/template
index 8be16a230d8d..78b4d813a113 100644
--- a/srcpkgs/cross-i686-linux-musl/template
+++ b/srcpkgs/cross-i686-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-i686-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-i686-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From e28f113ff637b35ce63bdaa87d4271291e7f4a72 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 23/36] cross-mips-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..6009e5c79eb2 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From b384589daa89e2a7b5be896bcbcd60b81d46371e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 24/36] cross-mips-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..080164df193d 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="hipperson0 <hipperson0@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 2296e708041212e88593a294cafdb71f5c561a26 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 25/36] cross-mipsel-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..f9fd4b8a04ef 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 4b361b64fb9f51339261e1bb9e3ce150519d6ddb Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 26/36] cross-mipsel-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..7418a984474b 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 4165645bfc76f6a3f9ff9f6fbc848bcdd7d6e394 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 27/36] cross-powerpc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..31e57b4e52b2 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 83aa17dee1c3960f4d09344acde94976e4766430 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 28/36] cross-powerpc-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..a2d1edcf1ffd 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From b1345628e03e8e8aae4bef80d7076e3cb3f1d884 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 29/36] cross-powerpc64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..1a4cbed61e76 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 2b2ec0ed53f586f940ab9151b41a663b732e055d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 30/36] cross-powerpc64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 1ebd0fb2048d..ade42018af05 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 41d4802a15d49624434d084f6fb61f1dd9207a06 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 31/36] cross-powerpc64le-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 733f5851da5c..03054239001e 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 03946855c4395c867dc3065bfe50b0f83779bf09 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 32/36] cross-powerpc64le-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index 76a70aa1d6db..5887f845f932 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 27141431ba7943d5a590db06d021d329cd239347 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 33/36] cross-powerpcle-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 347b8fcf4f55..06530e0d609b 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 2674d5914a25f7b224b3808c3c623f999b35907e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 34/36] cross-powerpcle-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index ec9324ddaa99..e68c3962b49c 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="q66 <daniel@octaforge.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From d93e42e5752642e3d32824efa99ee2e8366b24c5 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 35/36] cross-x86_64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 0078fbe7224b..7da85c14b62d 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 837be88488faaba4b7447d313dd48776becde6aa Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 36/36] cross-x86_64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..2811de0d3c2e 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (112 preceding siblings ...)
  2022-09-17  3:52 ` [PR PATCH] [Updated] " oreo639
@ 2022-09-23  1:21 ` Seltyk
  2022-09-23  1:24 ` Seltyk
                   ` (150 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: Seltyk @ 2022-09-23  1:21 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 730 bytes --]

New comment by Seltyk on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1255707869

Comment:
glibc 2.36 removes DT_HASH which breaks Easy Anti-Cheat (see [this Proton issue](https://github.com/ValveSoftware/Proton/issues/6051) or [this Phoronix article](https://www.phoronix.com/news/Glibc-2.36-EAC-Problems) for more info). I don't think I have any games with that, but I can't be the only person who games on Void, so certainly this PR will cause issues for at least one person. What can be done to prevent this issue? I see two options: glibc could be held at 2.35, or patches could be used to reintroduce DT_HASH (but I doubt anybody wants to be the poor soul maintaining that).

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (113 preceding siblings ...)
  2022-09-23  1:21 ` Seltyk
@ 2022-09-23  1:24 ` Seltyk
  2022-09-23  1:39 ` Seltyk
                   ` (149 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: Seltyk @ 2022-09-23  1:24 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 951 bytes --]

New comment by Seltyk on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1255707869

Comment:
glibc 2.36 removes DT_HASH which breaks Easy Anti-Cheat (see [this Proton issue](https://github.com/ValveSoftware/Proton/issues/6051) or [this Phoronix article](https://www.phoronix.com/news/Glibc-2.36-EAC-Problems) for more info). I don't think I have any games with that, but I can't be the only person who games on Void, so certainly this PR will cause issues for at least one person. What can be done to prevent this issue? I see two options: glibc could be held at 2.35, or patches could be used to reintroduce DT_HASH (but I doubt anybody wants to be the poor soul maintaining that). Option 1 seems the best in my opinion: 2.35 is recent enough to use [R2Northstar](https://r2northstar.gitbook.io/r2northstar-wiki/using-northstar/playing-on-linux) (which requires 2.33+) but old enough to play EAC games.

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (114 preceding siblings ...)
  2022-09-23  1:24 ` Seltyk
@ 2022-09-23  1:39 ` Seltyk
  2022-09-23  1:42 ` oreo639
                   ` (148 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: Seltyk @ 2022-09-23  1:39 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 918 bytes --]

New comment by Seltyk on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1255707869

Comment:
glibc 2.36 removes DT_HASH which breaks Easy Anti-Cheat (see [this Proton issue](https://github.com/ValveSoftware/Proton/issues/6051) or [this Phoronix article](https://www.phoronix.com/news/Glibc-2.36-EAC-Problems) for more info). I don't think I have any games with that, but I can't be the only person who games on Void, so certainly this PR will cause issues for at least one person. What can be done to prevent this issue? I see two options: glibc could be held at 2.35, or patches could be used to reintroduce DT_HASH (but I doubt anybody wants to be the poor soul maintaining that). glibc 2.35 is recent enough to use [R2Northstar](https://r2northstar.gitbook.io/r2northstar-wiki/using-northstar/playing-on-linux) (which requires 2.33+) but old enough to play EAC games.

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (115 preceding siblings ...)
  2022-09-23  1:39 ` Seltyk
@ 2022-09-23  1:42 ` oreo639
  2022-09-23  1:44 ` oreo639
                   ` (147 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-09-23  1:42 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 532 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1255715853

Comment:
> glibc 2.36 removes DT_HASH which breaks Easy Anti-Cheat

I couldn't get an EAC game to work on glibc 2.32 so whatever. If it affects someone, they can say so.

> but I doubt anybody wants to be the poor soul maintaining that

It's literally just a linker flag. It's a bug in EAC that expects sysv-style hashes with glibc when most distros configure bfd to only use gnu-style hashes.

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (116 preceding siblings ...)
  2022-09-23  1:42 ` oreo639
@ 2022-09-23  1:44 ` oreo639
  2022-09-23  1:44 ` oreo639
                   ` (146 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-09-23  1:44 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 541 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1255715853

Comment:
> glibc 2.36 removes DT_HASH which breaks Easy Anti-Cheat

I couldn't get an EAC game to work on glibc 2.32 so whatever. If it affects someone, they can say so.

> but I doubt anybody wants to be the poor soul maintaining that

It's literally just a linker flag. It's a bug in EAC that expects sysv-style hashes with glibc when most distros configure bfd/binutils to only use gnu-style hashes.

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (117 preceding siblings ...)
  2022-09-23  1:44 ` oreo639
@ 2022-09-23  1:44 ` oreo639
  2022-09-23  1:46 ` oreo639
                   ` (145 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-09-23  1:44 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 544 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1255715853

Comment:
> glibc 2.36 removes DT_HASH which breaks Easy Anti-Cheat

I couldn't get an EAC game to work on glibc 2.32 so whatever. If it affects someone, they can say so.

> but I doubt anybody wants to be the poor soul maintaining that

It's literally just a linker flag. It's a bug in EAC that it expects sysv-style hashes with glibc when most distros configure bfd/binutils to only use gnu-style hashes.

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (118 preceding siblings ...)
  2022-09-23  1:44 ` oreo639
@ 2022-09-23  1:46 ` oreo639
  2022-09-23  1:53 ` oreo639
                   ` (144 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-09-23  1:46 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 554 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1255715853

Comment:
> glibc 2.36 removes DT_HASH which breaks Easy Anti-Cheat

I couldn't get an EAC game to work on Void with glibc 2.32 so whatever. If it affects someone, they can say so.

> but I doubt anybody wants to be the poor soul maintaining that

It's literally just a linker flag. It's a bug in EAC that it expects sysv-style hashes with glibc when most distros configure bfd/binutils to only use gnu-style hashes.

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (119 preceding siblings ...)
  2022-09-23  1:46 ` oreo639
@ 2022-09-23  1:53 ` oreo639
  2022-09-23  2:38 ` oreo639
                   ` (143 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-09-23  1:53 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 561 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1255715853

Comment:
> glibc 2.36 removes DT_HASH which breaks Easy Anti-Cheat

I couldn't get an EAC game to work on Void with glibc 2.32 so whatever. If it affects someone, they can say so.

> but I doubt anybody wants to be the poor soul maintaining that

It's literally just a linker flag. It's a bug in EAC that it expects sysv-style hashes in glibc binaries when most distros configure bfd/binutils to only use gnu-style hashes.

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (120 preceding siblings ...)
  2022-09-23  1:53 ` oreo639
@ 2022-09-23  2:38 ` oreo639
  2022-09-23  2:56 ` oreo639
                   ` (142 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-09-23  2:38 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 551 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1255715853

Comment:
> glibc 2.36 removes DT_HASH which breaks Easy Anti-Cheat

I couldn't get an EAC game to work on Void with glibc 2.32 so whatever. If it affects someone, they can say so.

> but I doubt anybody wants to be the poor soul maintaining that

It's just a linker flag. It's a bug in EAC that it expects sysv-style hashes in glibc binaries when most distros configure bfd/binutils to only use gnu-style hashes.

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (121 preceding siblings ...)
  2022-09-23  2:38 ` oreo639
@ 2022-09-23  2:56 ` oreo639
  2022-09-23  2:57 ` oreo639
                   ` (141 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-09-23  2:56 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 570 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1255715853

Comment:
> glibc 2.36 removes DT_HASH which breaks Easy Anti-Cheat

I couldn't get an EAC game to work on Void with glibc 2.32 so whatever. If it affects someone, they can say so.

> but I doubt anybody wants to be the poor soul maintaining that

It's just a linker flag. That being said, it's a bug that EAC that it expects sysv-style hashes in glibc binaries when most distros configure bfd/binutils to only use gnu-style hashes.

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (122 preceding siblings ...)
  2022-09-23  2:56 ` oreo639
@ 2022-09-23  2:57 ` oreo639
  2022-09-23 13:41 ` TeusLollo
                   ` (140 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-09-23  2:57 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 562 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1255715853

Comment:
> glibc 2.36 removes DT_HASH which breaks Easy Anti-Cheat

I couldn't get an EAC game to work on Void with glibc 2.32 so whatever. If it affects someone, they can say so.

> but I doubt anybody wants to be the poor soul maintaining that

It's just a linker flag. That being said, it's a bug that EAC expects sysv-style hashes in glibc binaries when most distros configure bfd/binutils to only use gnu-style hashes.

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (123 preceding siblings ...)
  2022-09-23  2:57 ` oreo639
@ 2022-09-23 13:41 ` TeusLollo
  2022-09-24  4:01 ` Seltyk
                   ` (139 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: TeusLollo @ 2022-09-23 13:41 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1103 bytes --]

New comment by TeusLollo on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1256231980

Comment:
I agree with oreo639. It's a bug in EAC, and they are supposed to fix it (I know, I know, they never do in practice).

https://github.com/ValveSoftware/Proton/issues/6051#issuecomment-1204399354
They also say here to utilize Steam in Flatpak to work-around this issue, which may help?

I would say to continue working working on the glibc update (Which will still take a while, anyway). I'm already having trouble with some compiling explicitly requiring glibc 2.36 only. 

Maybe in the meantime upstream glibc will do something, or maybe someone at Proton will come up with a shim/wrapper of some sort?

Mind you, I'm not dismissing this problem in any way (I'm sorry if I came out sounding like that), I just think those changes in glibc 2.36 were justified, and that in general Void should not be stuck on an older glibc version due to potential compatibility problems emerging (Which I personally I'm already encountering on some private repos). 

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (124 preceding siblings ...)
  2022-09-23 13:41 ` TeusLollo
@ 2022-09-24  4:01 ` Seltyk
  2022-09-24  4:02 ` Seltyk
                   ` (138 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: Seltyk @ 2022-09-24  4:01 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 843 bytes --]

New comment by Seltyk on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1256849471

Comment:
> It's just a linker flag. That being said, it's a bug that EAC expects sysv-style hashes in glibc binaries

Well, learned something new today.

> they [Epic] are supposed to fix it (I know, I know, they never do in practice)

And therein lies the rub, right? The ideal solution would be for EAC to be updated, but that just isn't gonna happen. Perhaps even worse, some games using EAC may be done updating permanently, and depending on how they built/linked EAC, they may *never* incorporate this hypothetical upgrade. In other words, Steak in Flatpak might be the only good, permanent solution to this bug… which drives me nuts, because I'm stubborn and I won't touch Flatpak if I can help it

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (125 preceding siblings ...)
  2022-09-24  4:01 ` Seltyk
@ 2022-09-24  4:02 ` Seltyk
  2022-09-24 15:16 ` TeusLollo
                   ` (137 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: Seltyk @ 2022-09-24  4:02 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 866 bytes --]

New comment by Seltyk on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1256849471

Comment:
> It's just a linker flag. That being said, it's a bug that EAC expects sysv-style hashes in glibc binaries

Well, learned something new today.

> they [Epic] are supposed to fix it (I know, I know, they never do in practice)

And therein lies the rub, right? The ideal solution would be for EAC to be updated, but that just isn't gonna happen. Perhaps even worse, some games using EAC may be done updating permanently, and depending on how they built/linked EAC, they may *never* incorporate this hypothetical upgrade. In other words, Steam in Flatpak might be the only effective, permanent solution to this bug… which drives me nuts, because I'm stubborn and I won't touch Flatpak with a 10 ft pole if I can help it

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (126 preceding siblings ...)
  2022-09-24  4:02 ` Seltyk
@ 2022-09-24 15:16 ` TeusLollo
  2022-09-24 15:20 ` SolitudeSF
                   ` (136 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: TeusLollo @ 2022-09-24 15:16 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 6806 bytes --]

New comment by TeusLollo on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1256992328

Comment:
> And therein lies the rub, right? The ideal solution would be for EAC to be updated, but that just isn't gonna happen. Perhaps even worse, some games using EAC may be done updating permanently, and depending on how they built/linked EAC, they may _never_ incorporate this hypothetical upgrade. In other words, Steam in Flatpak might be the only effective, permanent solution to this bug… which drives me nuts, because I'm stubborn and I won't touch Flatpak with a 10 ft pole if I can help it

**As I said, I'm not trying to be dismissive of the problem. But look at this:**

_Did glibc 2.36 need a release note about dropped -Wl,--hash-style=both? Game users affected by the problem might argue that this was a high profile change and a deprecation or warning notice was needed. I disagree.
I beg that you read Carlos's summary. DT_HASH is a protocol between a linker and a dynamic loader. It is not intended to be consumed by a random non-standard ELF consumer. In addition, 16 years have been sufficiently long for any non-standard ELF consumer to know that DT_HASH has been mostly eliminated from Linux distributions. The glibc change removed one remnant DT_HASH use. It really was not as impactful as other changes in glibc 2.36._

**16 YEARS in deprecation. 
And what's more, is that's now even a proper ABI component, more of an ABI detail whatsoever:**

_Is DT_HASH optional in the generic ABI?_

_If one reads much from the generic ABI wording, it says "mandatory", and therefore it is not optional. Does this make sense?_

_Technically a dynamic loader does not need a hash table to perform symbol lookup. It can start at the dynamic symbol table beginning specified by DT_SYMTAB, and scan to the end. Wait, in the absence of DT_HASH (DT_GNU_HASH is an extension, we want a way without an extension), there is no reliable way to get the number of dynamic symbol table entries. I tend to think this is outside of the generic ABI's business to require something. An ELF object can freely use an extension to provide the information. Specifying things in such a verbatim way is not ELF's spirit. Michael Matz disagrees in a [reply](https://groups.google.com/g/generic-abi/c/th5919osPAQ/m/uGSA05KIAgAJ) to "Making DT_HASH optional?"._

**Source :** https://maskray.me/blog/2022-08-21-glibc-and-dt-gnu-hash

I don't think glibc developers were in the wrong here. There was plenty of time to dismiss deprecated code segments. In fact, had they done this before, none of that would have happened at this scale. 

But, do we really want to shift the burden of maintenance from giant entertainment companies who really should be doing due to their own financial interests, to mostly volunteer-run distros which now should either hold back upgrades, or otherwise fork the glibc to patch-in ancient code segments deprecated since decades? I know the Linux market segment is abysmal in the video-game department, but we're still talking about companies with giant revenues, who apparently don't want to hire a college graduate for a week/month to fix very simple problems on time. 

Maybe we could use xbps-alternatives to import and package from whoever will be doing the patching on the glibc 2.36 with such a "legacy" component, and whoever needs the patched glibc package, uses that, while the rest resides into the "vanilla" glibc 2.36? Not very elegant, and probably prone to breakage, but it still requires a maintainer on the Void Linux side.  

Or maybe the Proton devs will come up with a shim of sort? Sounds really like their thing, after all. 
Or maybe the Steam-client could finally be recompiled in a 64-bit x86_64 architecture, and packaged into a decent AppImage? I mean, they bothered with Flatpak, why not AppImage? Licensing issues, I presume?

**All I'm saying is, the problem is downstream. VERY downstream.** 
Holding back the glibc upgrades now (And probably further future upgrades next year, by the looks of it, since who should be doing it does not seem to care about updating their EAC software) will just multiply concerns for Void Linux maintainers who do this for free. 

Who knows what will happen next year on the gcc, and how it may react with the older glibc 2.35 if we get stuck on that because of EAC woes? What further software will break and will need dedicated patching? What if it stresses Void Linux maintainers too much, and sends the whole distro in a downward spiral? And lastly, do we really want to force ALL users to stick on the glibc 2.35, and deprive them of increased performance and security benefits which the glibc 2.36 provides? All because ONE company refuses to upgrade a VERY DOWNSTREAM piece of software?

I'm pleased to see gaming on Linux, and on Void Linux particularly (I mean, gaming beyond the good old DOOM sourceports and the like). But in this case, holding back feels like it could damage the entire distro. We're already a bit behind (Not by much, but still) on gcc/glibc upgrades for a "rolling", albeit "stable", distro. See how much work has been required, on this very thread, to update the gcc/glibc. Do we want to throw out all of those efforts because a giant company refuses to update software it should update, in their very interests to do so?

Gaming, or more like, "Mainstream" gaming on Linux is clearly still on its infancy, and although it has been making giant leaps in the past 5 years (Thanks to Valve, that should be admitted), it still has ways to go, clearly. 

For now, I indicated the usage of Flatpak (Which neither myself like, mind you, ESPECIALLY with the Steam-client) which appears to be a functional if cumbersome workaround. Maybe an AppImage would work even better, assuming it can be assembled at all due to licensing requirements?

But, the work on the gcc/glibc upgrades should continue, regardless. We can't just throw out all those efforts now, and further risk multiple headaches and performance/security concerns down the line on ALL software for ALL users, just because ONE company refuses to update their entertainment products. 

You're very welcome to say that I probably am concerned about the glibc 2.36 update because of personal reasons (Which is true, albeit marginally so for now), but I still stand by the wall of text above that I have indicated objective arguments. 

**I believe we should find workarounds to the EAC problem, but work on the gcc/glibc updating should continue undisturbed to the benefit of ALL users, due to maintainability, performance, and security concerns solved by the glibc 2.36 update, while sticking with glibc 2.35 instead would be detrimental to the entire distro.** 


^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (127 preceding siblings ...)
  2022-09-24 15:16 ` TeusLollo
@ 2022-09-24 15:20 ` SolitudeSF
  2022-09-24 15:26 ` TeusLollo
                   ` (135 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: SolitudeSF @ 2022-09-24 15:20 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 258 bytes --]

New comment by SolitudeSF on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1256993024

Comment:
what is the downside of having both hash styles enabled if that is only linker flag away? that is what arch does.

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (128 preceding siblings ...)
  2022-09-24 15:20 ` SolitudeSF
@ 2022-09-24 15:26 ` TeusLollo
  2022-09-24 17:50 ` Seltyk
                   ` (134 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: TeusLollo @ 2022-09-24 15:26 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 904 bytes --]

New comment by TeusLollo on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1256994245

Comment:
> what is the downside of having both hash styles enabled if that is only linker flag away? that is what arch does.

Requires a fork of the glibc 2.36 patched with that very "legacy" component. May have specific security/performance concerns, depending on context. 

Finding a dedicated maintainer is presumed to be unfavorable in the case of Void Linux, due to small manpower pool. 

Lastly, is it legitimate for upstream to bend the knee to maintain deprecated components and accumulate technical debt and security concerns, all because who should be doing updates refuses to do so?

Maybe more of a shim would work, but that's on Proton to do. 

Or maybe upstream glibc will deliver an hotfix in the coming weeks, and all points will become moot. 

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (129 preceding siblings ...)
  2022-09-24 15:26 ` TeusLollo
@ 2022-09-24 17:50 ` Seltyk
  2022-09-24 17:50 ` Seltyk
                   ` (133 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: Seltyk @ 2022-09-24 17:50 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 668 bytes --]

New comment by Seltyk on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1257029203

Comment:
I should have made it clear that at no point was I disagreeing with you, Teus. I was more just lamenting the inevitable bumpy road ahead. Sooner or (more likely) later this whole EAC debacle will be a thing of the past and future generations of Linux gamers will look back on this thread and laugh at me. But right now, it's nice to should into the Void and get it off my chest: updateing glibc is important, but there lies dragons, and fighting them will be a chore.

I apologise for coming off strongly, I never intended to

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (130 preceding siblings ...)
  2022-09-24 17:50 ` Seltyk
@ 2022-09-24 17:50 ` Seltyk
  2022-09-24 20:04 ` oreo639
                   ` (132 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: Seltyk @ 2022-09-24 17:50 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 672 bytes --]

New comment by Seltyk on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1257029203

Comment:
I should have made it clear that at no point was I disagreeing with you, Teus. I was more just lamenting the inevitable bumpy road ahead. Sooner or (more likely) later this whole EAC debacle will be a thing of the past and future generations of Linux gamers will look back on this thread and laugh at me. But right now, it feels betetr to shout into the Void and get it off my chest: updating glibc is important, but there lies dragons, and fighting them will be a chore.

I apologise for coming off strongly, I never intended to

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (131 preceding siblings ...)
  2022-09-24 17:50 ` Seltyk
@ 2022-09-24 20:04 ` oreo639
  2022-09-24 20:05 ` oreo639
                   ` (131 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-09-24 20:04 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 701 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1255715853

Comment:
> glibc 2.36 removes DT_HASH which breaks Easy Anti-Cheat

I couldn't get an EAC game to work on Void with glibc 2.32 so whatever. If it affects someone, they can say so.

> but I doubt anybody wants to be the poor soul maintaining that

It's just a linker flag. That being said, it's a bug that EAC expects sysv-style hashes in glibc binaries when most distros configure bfd/binutils to only use gnu-style hashes.

Edit: my only point what that I see no reason in working around an issue for a piece of software if it doesn't support Void, that's it.

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (132 preceding siblings ...)
  2022-09-24 20:04 ` oreo639
@ 2022-09-24 20:05 ` oreo639
  2022-09-24 20:59 ` TeusLollo
                   ` (130 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-09-24 20:05 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 695 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1255715853

Comment:
> glibc 2.36 removes DT_HASH which breaks Easy Anti-Cheat

I couldn't get an EAC game to work on Void with glibc 2.32 so whatever. If it affects someone, they can say so.

> but I doubt anybody wants to be the poor soul maintaining that

It's just a linker flag. That being said, it's a bug that EAC expects sysv-style hashes in glibc binaries when most distros configure bfd/binutils to only use gnu-style hashes.

Edit: my point was that I see no reason in working around an issue for a piece of software if it doesn't support Void, that's it.

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (133 preceding siblings ...)
  2022-09-24 20:05 ` oreo639
@ 2022-09-24 20:59 ` TeusLollo
  2022-09-25  0:11 ` oreo639
                   ` (129 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: TeusLollo @ 2022-09-24 20:59 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1778 bytes --]

New comment by TeusLollo on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1257064352

Comment:
> I apologise for coming off strongly, I never intended to

I myself should apologize for the walls of text, and maybe the excessively rough tone of my answers (However, this text-based medium is that it is, and when being read it always sounds rough, in my experience)

But point still stands, and I believe it's not just personal, glibc 2.36 did changes that were justified, and we should upgrade, since otherwise, being stuck on glibc 2.35 while gcc moves forward, is likely to cause myriads of other problems and headaches in the future (With potentially no end in sight, since we don't know if/when EAC will finally be updated properly), as well as depriving all users, for all applications and tooling, of numerous security and performance benefits (Which glibc 2.36 has, notably so, especially compared to recent releases). 

All of this would be so simple if EAC were to be finally updated after almost 2 months, if the Steam-client could finally be recompiled to 64-bit x86_64 and packaged into an AppImage (That would solve most problems Flatpak currently has, I personally think), or if otherwise coding practices were just a tiny bit better, and not "barely functional". 

But hey, even Nvidia recently dropped an open-source driver. If that could happen, maybe EAC and Steam could finally put their stuff together? One can hope.

Anyway, personally I believe a shim to do a sort of translate-call at Proton level will probably be what happens, since even Ubuntu and its derivatives are eventually going to meet this problem if EAC is not fixed timely, and I doubt they will stick to glibc 2.35 just for that. 


^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (134 preceding siblings ...)
  2022-09-24 20:59 ` TeusLollo
@ 2022-09-25  0:11 ` oreo639
  2022-09-25  0:11 ` oreo639
                   ` (128 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-09-25  0:11 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 642 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1257087709

Comment:
> I just think those changes in glibc 2.36 were justified, and that in general Void should not be stuck on an older glibc version due to potential compatibility problems emerging (Which I personally I'm already encountering on some private repos).

This is not the right place to argue whether the change was justified or not. And if you yourself are experiencing compatibility problems with glibc 2.36 I would encourage you to mention so, either here (assuming it is related to this PR) or on IRC.

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (135 preceding siblings ...)
  2022-09-25  0:11 ` oreo639
@ 2022-09-25  0:11 ` oreo639
  2022-09-25  0:12 ` oreo639
                   ` (127 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-09-25  0:11 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 652 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1257087709

Comment:
> I just think those changes in glibc 2.36 were justified, and that in general Void should not be stuck on an older glibc version due to potential compatibility problems emerging (Which I personally I'm already encountering on some private repos).

This is not the right place to argue whether you think the change was justified or not. And if you yourself are experiencing compatibility problems with glibc 2.36 I would encourage you to mention so, either here (assuming it is related to this PR) or on IRC.

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (136 preceding siblings ...)
  2022-09-25  0:11 ` oreo639
@ 2022-09-25  0:12 ` oreo639
  2022-09-25  0:14 ` oreo639
                   ` (126 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-09-25  0:12 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 661 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1257087709

Comment:
> I just think those changes in glibc 2.36 were justified, and that in general Void should not be stuck on an older glibc version due to potential compatibility problems emerging (Which I personally I'm already encountering on some private repos).

This is not the right place to argue whether you think the change in glibc was justified or not. And if you yourself are experiencing compatibility problems with glibc 2.36 I would encourage you to mention so, either here (assuming it is related to this PR) or on IRC.

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (137 preceding siblings ...)
  2022-09-25  0:12 ` oreo639
@ 2022-09-25  0:14 ` oreo639
  2022-09-25  0:14 ` oreo639
                   ` (125 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-09-25  0:14 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 684 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1257087709

Comment:
> I just think those changes in glibc 2.36 were justified, and that in general Void should not be stuck on an older glibc version due to potential compatibility problems emerging (Which I personally I'm already encountering on some private repos).

This is not the right place to argue whether you think the change in glibc was justified or not. And if you yourself are experiencing compatibility problems with the glibc 2.36 package in this PR I would encourage you to mention so, either here (assuming it is related to this PR) or on IRC.

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (138 preceding siblings ...)
  2022-09-25  0:14 ` oreo639
@ 2022-09-25  0:14 ` oreo639
  2022-09-25  0:20 ` oreo639
                   ` (124 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-09-25  0:14 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 648 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1257087709

Comment:
> I just think those changes in glibc 2.36 were justified, and that in general Void should not be stuck on an older glibc version due to potential compatibility problems emerging (Which I personally I'm already encountering on some private repos).

This is not the right place to argue whether you think the change in glibc was justified or not. And if you yourself are experiencing compatibility problems with the glibc 2.36 changes in this PR I would encourage you to mention so, either here or on IRC.

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (139 preceding siblings ...)
  2022-09-25  0:14 ` oreo639
@ 2022-09-25  0:20 ` oreo639
  2022-09-25  0:52 ` TeusLollo
                   ` (123 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-09-25  0:20 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 653 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1257087709

Comment:
> I just think those changes in glibc 2.36 were justified, and that in general Void should not be stuck on an older glibc version due to potential compatibility problems emerging (Which I personally I'm already encountering on some private repos).

imo, this is not the right place to argue whether you think the change in glibc was justified or not. And if you yourself are experiencing compatibility problems with the glibc 2.36 changes in this PR I would encourage you to mention so, either here or on IRC.

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (140 preceding siblings ...)
  2022-09-25  0:20 ` oreo639
@ 2022-09-25  0:52 ` TeusLollo
  2022-09-25  1:33 ` [PR PATCH] [Updated] " oreo639
                   ` (122 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: TeusLollo @ 2022-09-25  0:52 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 782 bytes --]

New comment by TeusLollo on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1257092972

Comment:
> imo, this is not the right place to argue whether you think the change in glibc was justified or not. And if you yourself are experiencing compatibility problems with the glibc 2.36 changes in this PR I would encourage you to mention so, either here or on IRC.

Of course, we were just discussing the state of the EAC situation, and what to make of it. 

And no, I'm not experiencing problems with the glibc 2.36 changes, I'm experience problems with binaries a colleague of mine has sent me, which specifically were compiled with glibc 2.36, which of course didn't work. 

I'll just wait for the glibc update, whenever it comes. 

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (141 preceding siblings ...)
  2022-09-25  0:52 ` TeusLollo
@ 2022-09-25  1:33 ` oreo639
  2022-09-26 22:46 ` JamiKettunen
                   ` (121 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-09-25  1:33 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5092 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.2.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.2.0

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/38817
- [x] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [x] llvm https://github.com/void-linux/void-packages/pull/38694
- [x] m4 https://github.com/void-linux/void-packages/pull/33730
- [x] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [x] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [x] libvirt https://github.com/void-linux/void-packages/pull/38842
- [x] syslinux https://github.com/void-linux/void-packages/pull/38876
- [x] efivar https://github.com/void-linux/void-packages/pull/38874

Known packages that needed to be fixed/updated for gcc12:
- [ ] linux5.18 (in this PR)
- [x] openssh https://github.com/void-linux/void-packages/pull/38849
- [x] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [x] doxygen https://github.com/void-linux/void-packages/pull/38846
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/38817
- [x] libproxy https://github.com/void-linux/void-packages/pull/38818
- [x] exempi https://github.com/void-linux/void-packages/pull/38820
- [x] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [ ] gpgme https://github.com/void-linux/void-packages/pull/38825
- [x] libunique1 https://github.com/void-linux/void-packages/pull/38848 or https://github.com/void-linux/void-packages/pull/38873
- [x] libwpd https://github.com/void-linux/void-packages/pull/38878

Needs to be fixed/updated for binutils:
- [x] grub https://github.com/void-linux/void-packages/pull/38875
- [x] linux-tools https://github.com/void-linux/void-packages/pull/38877
- [x] kcov https://github.com/void-linux/void-packages/pull/39291

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [x] kde
- [x] lxde
- [x] lxqt

You can test the ISOs here:
https://drive.google.com/drive/folders/1ix92CYSLUP-KWjLxltdgG4e8Nu2JCY5n?usp=sharing

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 111479 bytes --]

From 3b9481465e99367a3c759e96ea186a5c406fcb8f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 01/36] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../fix-libcollector-without-java.patch       | 53 +++++++++++++++
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 21 ++++--
 4 files changed, 85 insertions(+), 115 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
 create mode 100644 srcpkgs/binutils/patches/fix-libcollector-without-java.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/fix-libcollector-without-java.patch b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
new file mode 100644
index 000000000000..54384875f358
--- /dev/null
+++ b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
@@ -0,0 +1,53 @@
+From 49ddd814ac1071af7c4f45d5f8398b91862f2c7f Mon Sep 17 00:00:00 2001
+From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
+Date: Wed, 17 Aug 2022 19:55:23 -0700
+Subject: [PATCH] gprofng: fix bug 29479 Collection fails when built without
+ java support
+
+gprofng/ChangeLog
+2022-08-17  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>
+
+	PR gprofng/29479
+	* libcollector/collector.c: Add #if defined(GPROFNG_JAVA_PROFILING) for
+	java specific code.
+	* libcollector/unwind.c: Likewise.
+---
+ gprofng/libcollector/collector.c | 2 ++
+ gprofng/libcollector/unwind.c    | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/gprofng/libcollector/collector.c b/gprofng/libcollector/collector.c
+index 93c9d3330de5..ceff2c1caccb 100644
+--- a/gprofng/libcollector/collector.c
++++ b/gprofng/libcollector/collector.c
+@@ -913,8 +913,10 @@ __collector_open_experiment (const char *exp, const char *params, sp_origin_t or
+   __collector_ext_unwind_key_init (1, NULL);
+ 
+   /* start java attach if suitable */
++#if defined(GPROFNG_JAVA_PROFILING)
+   if (exp_origin == SP_ORIGIN_DBX_ATTACH)
+     __collector_jprofile_start_attach ();
++#endif
+   start_sec_time = CALL_UTIL (time)(NULL);
+   __collector_start_time = collector_interface.getHiResTime ();
+   TprintfT (DBG_LT0, "\t__collector_open_experiment; resetting start_time\n");
+diff --git a/gprofng/libcollector/unwind.c b/gprofng/libcollector/unwind.c
+index 119243788020..f8e11823c81e 100644
+--- a/gprofng/libcollector/unwind.c
++++ b/gprofng/libcollector/unwind.c
+@@ -557,6 +557,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+   int size = max_frame_size;
+ 
+ #define MIN(a,b) ((a)<(b)?(a):(b))
++#if defined(GPROFNG_JAVA_PROFILING)
+   /* get Java info */
+   if (__collector_java_mode && __collector_java_asyncgetcalltrace_loaded && context && !pseudo_context)
+     {
+@@ -569,6 +570,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+ 	  size -= sz;
+ 	}
+     }
++#endif
+ 
+   /* get native stack */
+   if (context)
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..71895f2073fd 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkg-config"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -44,6 +45,12 @@ do_configure() {
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	# gprofng currently only supports x86 and aarch64 glibc.
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64|i386|aarch64) conf+=" --enable-gprofng" ;;
+		*) conf+=" --disable-gprofng" ;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"
@@ -76,9 +83,10 @@ do_configure() {
 		--libdir=/usr/lib \
 		--mandir=/usr/share/man \
 		--infodir=/usr/share/info \
+		--sysconfdir=/etc \
 		--disable-werror \
-		--disable-shared \
 		--disable-nls \
+		--enable-shared \
 		--enable-threads \
 		--enable-plugins \
 		--enable-relro \
@@ -142,7 +150,8 @@ binutils-devel_package() {
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/*.a"
-		vmove "usr/lib/*.so"
+		vmove "usr/lib/libbfd.so"
+		vmove "usr/lib/libopcodes.so"
 	}
 }
 

From 9254b7dcce99242e5a3dfc7076d68b0fb79ebc42 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 02/36] gcc: update to 12.2.0.

---
 common/shlibs                                 | 10 +--
 srcpkgs/gcc/files/gccgo-musl.patch            | 71 +++----------------
 srcpkgs/gcc/files/libgnarl-musl.patch         | 18 ++---
 srcpkgs/gcc/files/libssp-musl.patch           | 10 +--
 srcpkgs/gcc/patches/libffi_gnulinux.patch     | 11 ---
 .../gcc/patches/libgcc-ibm128-no-tag.patch    | 10 ++-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |  2 +-
 srcpkgs/gcc/template                          | 25 +++----
 8 files changed, 49 insertions(+), 108 deletions(-)
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index c962f0ab7622..faffd8f826cc 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.2.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.34 perl-5.34.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -846,8 +846,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.2.0_1
+libgnat-12.so libada-12.2.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1696,8 +1696,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.2.0_1
+libasan.so.8 libsanitizer-12.2.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..12ec68dd8aa3 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,14 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ b/libgo/go/runtime/os_linux.go
+@@ -365,7 +365,7 @@ func setThreadCPUProfiler(hz int32) {
+ 	var sevp _sigevent
+ 	sevp.sigev_notify = _SIGEV_THREAD_ID
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.__sev_fields))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..446741390d45 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,15 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
+version=12.2.0
+revision=1
 _patchver="${version%pre*}"
 _minorver="${_patchver%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 wrksrc=gcc-${version/pre/_pre}
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +19,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -396,7 +393,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}

From c2e7f7af886e675602c2cccef4529b9a63cf84c6 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 03/36] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      | 11 ++++--
 2 files changed, 25 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..70c4aa533e66 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,12 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
+
+if [ "$XBPS_LIBC" == "musl" ]; then
+# Musl always searches LD_LIBRARY_PATH before RPATH and RUNPATH
+make_build_args="lt_cv_shlibpath_overrides_runpath=yes"
+fi
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From 1c362bcc71521d9eb1e7eafd3cdc25f32cb944ba Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 04/36] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 55255dceae8b..ca2d858a7abc 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From 04615f5b7e180ab6b6fe8bf585de6361f3517524 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 05/36] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 3 files changed, 55 insertions(+), 353 deletions(-)
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index faffd8f826cc..1b302a6b3cd4 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From c4d5e1b9fcba600f61d50b84c40d4a7a3de2f1eb Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Wed, 14 Sep 2022 03:48:32 -0700
Subject: [PATCH 06/36] musl: add support for SIGEV_THREAD_ID timers

https://git.musl-libc.org/cgit/musl/commit/?id=7c71792e87691451f2a6b76348e83ad1889f1dcb
---
 ...d-support-for-SIGEV_THREAD_ID-timers.patch | 74 +++++++++++++++++++
 srcpkgs/musl/template                         |  2 +-
 2 files changed, 75 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch

diff --git a/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
new file mode 100644
index 000000000000..e20dff5ba0d4
--- /dev/null
+++ b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
@@ -0,0 +1,74 @@
+From 7c71792e87691451f2a6b76348e83ad1889f1dcb Mon Sep 17 00:00:00 2001
+From: James Y Knight <jyknight@google.com>
+Date: Sun, 30 Jun 2019 21:55:20 -0400
+Subject: [PATCH] add support for SIGEV_THREAD_ID timers
+
+This is like SIGEV_SIGNAL, but targeted to a particular thread's
+tid, rather than the process.
+---
+ include/signal.h        | 16 +++++++++++++---
+ src/time/timer_create.c |  8 ++++++--
+ 2 files changed, 19 insertions(+), 5 deletions(-)
+
+diff --git a/include/signal.h b/include/signal.h
+index fbdf667b2..9ed929e4f 100644
+--- a/include/signal.h
++++ b/include/signal.h
+@@ -180,14 +180,24 @@ struct sigevent {
+ 	union sigval sigev_value;
+ 	int sigev_signo;
+ 	int sigev_notify;
+-	void (*sigev_notify_function)(union sigval);
+-	pthread_attr_t *sigev_notify_attributes;
+-	char __pad[56-3*sizeof(long)];
++	union {
++		char __pad[64 - 2*sizeof(int) - sizeof(union sigval)];
++		pid_t sigev_notify_thread_id;
++		struct {
++			void (*sigev_notify_function)(union sigval);
++			pthread_attr_t *sigev_notify_attributes;
++		} __sev_thread;
++	} __sev_fields;
+ };
+ 
++#define sigev_notify_thread_id __sev_fields.sigev_notify_thread_id
++#define sigev_notify_function __sev_fields.__sev_thread.sigev_notify_function
++#define sigev_notify_attributes __sev_fields.__sev_thread.sigev_notify_attributes
++
+ #define SIGEV_SIGNAL 0
+ #define SIGEV_NONE 1
+ #define SIGEV_THREAD 2
++#define SIGEV_THREAD_ID 4
+ 
+ int __libc_current_sigrtmin(void);
+ int __libc_current_sigrtmax(void);
+diff --git a/src/time/timer_create.c b/src/time/timer_create.c
+index 5ddfda278..4bef23905 100644
+--- a/src/time/timer_create.c
++++ b/src/time/timer_create.c
+@@ -71,11 +71,15 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 	switch (evp ? evp->sigev_notify : SIGEV_SIGNAL) {
+ 	case SIGEV_NONE:
+ 	case SIGEV_SIGNAL:
++	case SIGEV_THREAD_ID:
+ 		if (evp) {
+ 			ksev.sigev_value = evp->sigev_value;
+ 			ksev.sigev_signo = evp->sigev_signo;
+ 			ksev.sigev_notify = evp->sigev_notify;
+-			ksev.sigev_tid = 0;
++			if (evp->sigev_notify == SIGEV_THREAD_ID)
++				ksev.sigev_tid = evp->sigev_notify_thread_id;
++			else
++				ksev.sigev_tid = 0;
+ 			ksevp = &ksev;
+ 		}
+ 		if (syscall(SYS_timer_create, clk, ksevp, &timerid) < 0)
+@@ -107,7 +111,7 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 
+ 		ksev.sigev_value.sival_ptr = 0;
+ 		ksev.sigev_signo = SIGTIMER;
+-		ksev.sigev_notify = 4; /* SIGEV_THREAD_ID */
++		ksev.sigev_notify = SIGEV_THREAD_ID;
+ 		ksev.sigev_tid = td->tid;
+ 		if (syscall(SYS_timer_create, clk, &ksev, &timerid) < 0)
+ 			timerid = -1;
diff --git a/srcpkgs/musl/template b/srcpkgs/musl/template
index 5bdc5c48e623..34e6ed4fba6e 100644
--- a/srcpkgs/musl/template
+++ b/srcpkgs/musl/template
@@ -2,7 +2,7 @@
 pkgname=musl
 reverts="1.2.0_1"
 version=1.1.24
-revision=10
+revision=11
 archs="*-musl"
 bootstrap=yes
 build_style=gnu-configure

From 5e7b40cf46a6ee2b0f866611be0fbb6809649da0 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 21:01:43 -0700
Subject: [PATCH 07/36] gcc-multilib: update to 12.2.0.

---
 srcpkgs/gcc-multilib/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index fcd25755aa75..1a26da26a991 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,16 +3,16 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _majorver="${version%.*}"
-wrksrc=gcc-${version/pre/_pre}
+wrksrc=gcc-${version}
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel

From 1ddf043acd8d1cb7779a69fa10905df61389fff0 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 14 Aug 2022 19:29:36 -0700
Subject: [PATCH 08/36] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove -no-pie from build. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..fcc00b3a6c5d 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -53,6 +53,7 @@ _void_cross_build_binutils() {
 		--sbindir=/usr/bin \
 		--libdir=/usr/lib \
 		--libexecdir=/usr/lib \
+		--sysconfdir=/etc \
 		--target=${tgt} \
 		--with-sysroot=/usr/${tgt} \
 		--disable-nls \
@@ -60,6 +61,7 @@ _void_cross_build_binutils() {
 		--disable-multilib \
 		--disable-werror \
 		--disable-gold \
+		--disable-gprofng \
 		--enable-relro \
 		--enable-plugins \
 		--enable-64-bit-bfd \
@@ -132,6 +134,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -460,6 +463,14 @@ do_build() {
 	local binutils_ver linux_ver gcc_ver libc_ver libucontext_ver
 	local tgt=${sourcepkg/cross-}
 
+	export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}"
+	export CXXFLAGS="${CXXFLAGS/-D_FORTIFY_SOURCE=2/}"
+
+	# Disable explicit -fno-PIE, gcc/binutils/libc will figure this out itself.
+	export CFLAGS="${CFLAGS//-fno-PIE/}"
+	export CXXFLAGS="${CXXFLAGS//-fno-PIE/}"
+	export LDFLAGS="${LDFLAGS//-no-pie/}"
+
 	_void_cross_test_ver binutils
 	_void_cross_test_ver linux
 	_void_cross_test_ver gcc
@@ -625,6 +636,9 @@ do_install() {
 	# then remove it because it conflicts with libquadmath package
 	rm -rf ${DESTDIR}/${sysroot}/usr/lib/libquadmath.*
 
+	# Remove libdep linker plugin because it conflicts with system binutils
+	rm -f ${DESTDIR}/usr/lib/bfd-plugins/libdep*
+
 	# Remove leftover symlinks
 	rm -f ${DESTDIR}/usr/lib${XBPS_TARGET_WORDSIZE}
 	rm -f ${DESTDIR}/lib*

From e0e1de33e711bc9f1b8977ba47b226c58c625d56 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:09:31 -0700
Subject: [PATCH 09/36] linux5.18: update dotconfigs for gcc12

---
 srcpkgs/linux5.18/files/x86_64-dotconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/linux5.18/files/x86_64-dotconfig b/srcpkgs/linux5.18/files/x86_64-dotconfig
index 4e73a3195d40..ea6204868e23 100644
--- a/srcpkgs/linux5.18/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.18/files/x86_64-dotconfig
@@ -512,6 +512,7 @@ CONFIG_RETHUNK=y
 CONFIG_CPU_UNRET_ENTRY=y
 CONFIG_CPU_IBPB_ENTRY=y
 CONFIG_CPU_IBRS_ENTRY=y
+CONFIG_SLS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10060,8 +10061,11 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
 # Memory initialization
 #
 CONFIG_INIT_STACK_NONE=y
+# CONFIG_INIT_STACK_ALL_PATTERN is not set
+# CONFIG_INIT_STACK_ALL_ZERO is not set
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
+# CONFIG_ZERO_CALL_USED_REGS is not set
 # end of Memory initialization
 # end of Kernel hardening options
 # end of Security options
@@ -10538,6 +10542,7 @@ CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
 # CONFIG_UBSAN is not set
 CONFIG_HAVE_ARCH_KCSAN=y
+# CONFIG_KCSAN is not set
 # end of Generic Kernel Debugging Instruments
 
 #

From 3c6cee9f7e330ac36b30b51a7252e6867337c6ab Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 14:45:28 -0700
Subject: [PATCH 10/36] libsasl: fix build for libtool 2.4.7

---
 srcpkgs/libsasl/template | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/libsasl/template b/srcpkgs/libsasl/template
index a8817042f843..a2993b39f4a1 100644
--- a/srcpkgs/libsasl/template
+++ b/srcpkgs/libsasl/template
@@ -19,6 +19,7 @@ distfiles="https://github.com/cyrusimap/cyrus-sasl/releases/download/cyrus-sasl-
 checksum=26866b1549b00ffd020f188a43c258017fa1c382b3ddadd8201536f72efb05d5
 
 pre_configure() {
+	rm -f m4/ltversion.m4
 	autoreconf -fi
 }
 

From b3e396e5aed5c0112874624cd6e0c51b990216f3 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:08 -0700
Subject: [PATCH 11/36] subversion: fix build for libtool 2.4.7

---
 srcpkgs/subversion/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion/template b/srcpkgs/subversion/template
index 8ad178264942..3f1c9e254e61 100644
--- a/srcpkgs/subversion/template
+++ b/srcpkgs/subversion/template
@@ -57,7 +57,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From 3d5df27f00b2d6a8f560146f89131779687a303c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:38 -0700
Subject: [PATCH 12/36] subversion-kwallet-auth: fix build for libtool 2.4.7

---
 srcpkgs/subversion-kwallet-auth/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion-kwallet-auth/template b/srcpkgs/subversion-kwallet-auth/template
index 12210f250d51..b4d8621456ea 100644
--- a/srcpkgs/subversion-kwallet-auth/template
+++ b/srcpkgs/subversion-kwallet-auth/template
@@ -59,7 +59,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From f3b9a0448d14fa73874fa2176a05e8c933c037b9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 13/36] cross-aarch64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..bd6b23f9fb6a 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From edfaca290251699754d59ea86fcffd2846dff2bc Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 14/36] cross-aarch64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..427ad2c1e9cd 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From c3025bc52816a247f7be2d08a906edb4c105fc02 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 15/36] cross-arm-linux-gnueabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..2510ee26e789 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From d1a592fa94cca66a56def9297098b2382d81fc60 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 16/36] cross-arm-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..bd8b16e1b4c1 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 4424acaff6e269848d333d02460b0e87fcd566d1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 17/36] cross-arm-linux-musleabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..dacfd2655216 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 43a413c955c9b2e7c175c372618d155b018d1e15 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 18/36] cross-arm-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..9ddd32a9f20d 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 97e58e44f8316d80171daf5af7466908e286d51b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 19/36] cross-armv7l-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..9fb00f18be3b 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From b6f31612a911f3f36b462e598fee7b17abd4da91 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 20/36] cross-armv7l-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..2c72e75ddfe3 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 23bcbc889198e84b87dca7b2c8a383df43a2cba0 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 21/36] cross-i686-pc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..4dc17df648b5 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 5b174df900a3c13604595f8a940dd7023da160ae Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Fri, 16 Sep 2022 20:52:19 -0700
Subject: [PATCH 22/36] cross-i686-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-linux-musl/template b/srcpkgs/cross-i686-linux-musl/template
index 8be16a230d8d..78b4d813a113 100644
--- a/srcpkgs/cross-i686-linux-musl/template
+++ b/srcpkgs/cross-i686-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-i686-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-i686-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 1e3aa3b5a0bc0bf5646d80523f205c075fd01a9f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 23/36] cross-mips-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..6009e5c79eb2 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From b3264c6d46afdf1f7ade6be328386d04966949da Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 24/36] cross-mips-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..080164df193d 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="hipperson0 <hipperson0@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 70c62070d2bb6d6f636fd1eb13b66eb2fe806718 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 25/36] cross-mipsel-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..f9fd4b8a04ef 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 48b4d74d43922dcf001c27f0a4ffb387cc0e4eb6 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 26/36] cross-mipsel-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..7418a984474b 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 827dead2e3cd97c85eeb13b93ac4b7c98e1e2f30 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 27/36] cross-powerpc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..31e57b4e52b2 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From c5deb8478c334d9d1db0f39d435fdbb838503663 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 28/36] cross-powerpc-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..a2d1edcf1ffd 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 8d5c6f54e5db786f1502f640caa4302a6fcff356 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 29/36] cross-powerpc64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..1a4cbed61e76 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From d0c7ad813ac3311a7a48ab2e1537d6ea44b444a7 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 30/36] cross-powerpc64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 016f18776a6d..19b1ff859eb6 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 33cca1e923e7b4e9690eb2ca7fa7b33d0db514df Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 31/36] cross-powerpc64le-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 463d7e92d20d..9d99a3a315d2 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From a7660a902737439e5c02339bd5b7bbb616ae0c05 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 32/36] cross-powerpc64le-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index c17a3cccfe29..3128baa7372e 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From c5d79b1b70733445a8976115b224aacf448d1e5c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 33/36] cross-powerpcle-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 9aede3c465ce..6f914b3877ee 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From bcbcd7be80c3fdd31fe19be9f5b9200092a0e169 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 34/36] cross-powerpcle-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index 045cfda987fe..20e70bed4c60 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From d7c0cafa41f2e9b46da4a9b0e5dc42c4ffa640d2 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 35/36] cross-x86_64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 8918f3c22a1c..5219cd50f851 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 954202cc11c602122d951efb3542be92e7708da9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 36/36] cross-x86_64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..2811de0d3c2e 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (142 preceding siblings ...)
  2022-09-25  1:33 ` [PR PATCH] [Updated] " oreo639
@ 2022-09-26 22:46 ` JamiKettunen
  2022-09-26 22:47 ` JamiKettunen
                   ` (120 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: JamiKettunen @ 2022-09-26 22:46 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2919 bytes --]

New comment by JamiKettunen on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1258734576

Comment:
Just tried to build `cross-aarch64-linux-gnu` from here (rebased to 52e2d1873f93a46ec44eb32c14ec6a63c701ad77 locally though) on `x86_64-glibc`, it failed with:
```
aarch64-linux-gnu-gcc -Wl,-rpath-link=/builddir/cross-aarch64-linux-gnu-0.35/glibc_build:/builddir/cross-aarch64-linux-gnu-0.35/glibc_build/math:/builddir/cross-aarch64-linux-gnu-0.35/glibc_build/elf:/builddir/cross-aarch64-linux-gnu-0.35/glibc_build/dlfcn:/builddir/cross-aarch64-linux-gnu-0.35/glibc_build/nss:/builddir/cross-aarch64-linux-gnu-0.35/glibc_build/nis:/builddir/cross-aarch64-linux-gnu-0.35/glibc_build/rt:/builddir/cross-aarch64-linux-gnu-0.35/glibc_build/resolv:/builddir/cross-aarch64-linux-gnu-0.35/glibc_build/mathvec:/builddir/cross-aarch64-linux-gnu-0.35/glibc_build/support:/builddir/cross-aarch64-linux-gnu-0.35/glibc_build/crypt:/builddir/cross-aarch64-linux-gnu-0.35/glibc_build/nptl -o /builddir/cross-aarch64-linux-gnu-0.35/glibc_build/support/links-dso-program -pie  -Wl,-O1 -nostdlib -nostartfiles   -Wl,--as-needed      -Wl,-z,relro  /builddir/cross-aarch64-linux-gnu-0.35/glibc_build/csu/Scrt1.o /builddir/cross-aarch64-linux-gnu-0.35/glibc_build/csu/crti.o `aarch64-linux-gnu-gcc  --print-file-name=crtbeginS.o` /builddir/cross-aarch64-linux-gnu-0.35/glibc_build/support/links-dso-program.o -lstdc++ -lgcc -lgcc_s  -Wl,-dynamic-linker=/lib/ld-linux-aarch64.so.1  /builddir/cross-aarch64-linux-gnu-0.35/glibc_build/libc.so.6 /builddir/cross-aarch64-linux-gnu-0.35/glibc_build/libc_nonshared.a -Wl,--as-needed /builddir/cross-aarch64-linux-gnu-0.35/glibc_build/elf/ld.so -Wl,--no-as-needed -lgcc  `aarch64-linux-gnu-gcc  --print-file-name=crtendS.o` /builddir/cross-aarch64-linux-gnu-0.35/glibc_build/csu/crtn.o
/builddir/cross-aarch64-linux-gnu-0.35/build_root/usr/bin/../lib/gcc/aarch64-linux-gnu/12.2.0/../../../../aarch64-linux-gnu/bin/ld: cannot find -lstdc++: No such file or directory
/builddir/cross-aarch64-linux-gnu-0.35/build_root/usr/bin/../lib/gcc/aarch64-linux-gnu/12.2.0/../../../../aarch64-linux-gnu/bin/ld: cannot find -lgcc_s: No such file or directory
collect2: error: ld returned 1 exit status
make[2]: *** [../Rules:230: /builddir/cross-aarch64-linux-gnu-0.35/glibc_build/support/links-dso-program] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory '/builddir/cross-aarch64-linux-gnu-0.35/glibc-2.36/support'
make[1]: *** [Makefile:484: support/others] Error 2
make[1]: Leaving directory '/builddir/cross-aarch64-linux-gnu-0.35/glibc-2.36'
make: *** [Makefile:9: all] Error 2
=> ERROR: cross-aarch64-linux-gnu-0.35_1: do_build: 'make ${makejobs}' exited with 2
=> ERROR:   in _void_cross_build_glibc() at common/build-style/void-cross.sh:282
=> ERROR:   in do_build() at common/build-style/void-cross.sh:535
```

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (143 preceding siblings ...)
  2022-09-26 22:46 ` JamiKettunen
@ 2022-09-26 22:47 ` JamiKettunen
  2022-09-26 22:50 ` oreo639
                   ` (119 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: JamiKettunen @ 2022-09-26 22:47 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2980 bytes --]

New comment by JamiKettunen on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1258734576

Comment:
Just tried to build `cross-aarch64-linux-gnu` from here (rebased to 52e2d1873f93a46ec44eb32c14ec6a63c701ad77 locally though) on `x86_64-glibc`, it failed with:
```
aarch64-linux-gnu-gcc -Wl,-rpath-link=/builddir/cross-aarch64-linux-gnu-0.35/glibc_build:/builddir/cross-aarch64-linux-gnu-0.35/glibc_build/math:/builddir/cross-aarch64-linux-gnu-0.35/glibc_build/elf:/builddir/cross-aarch64-linux-gnu-0.35/glibc_build/dlfcn:/builddir/cross-aarch64-linux-gnu-0.35/glibc_build/nss:/builddir/cross-aarch64-linux-gnu-0.35/glibc_build/nis:/builddir/cross-aarch64-linux-gnu-0.35/glibc_build/rt:/builddir/cross-aarch64-linux-gnu-0.35/glibc_build/resolv:/builddir/cross-aarch64-linux-gnu-0.35/glibc_build/mathvec:/builddir/cross-aarch64-linux-gnu-0.35/glibc_build/support:/builddir/cross-aarch64-linux-gnu-0.35/glibc_build/crypt:/builddir/cross-aarch64-linux-gnu-0.35/glibc_build/nptl -o /builddir/cross-aarch64-linux-gnu-0.35/glibc_build/support/links-dso-program -pie  -Wl,-O1 -nostdlib -nostartfiles   -Wl,--as-needed      -Wl,-z,relro  /builddir/cross-aarch64-linux-gnu-0.35/glibc_build/csu/Scrt1.o /builddir/cross-aarch64-linux-gnu-0.35/glibc_build/csu/crti.o `aarch64-linux-gnu-gcc  --print-file-name=crtbeginS.o` /builddir/cross-aarch64-linux-gnu-0.35/glibc_build/support/links-dso-program.o -lstdc++ -lgcc -lgcc_s  -Wl,-dynamic-linker=/lib/ld-linux-aarch64.so.1  /builddir/cross-aarch64-linux-gnu-0.35/glibc_build/libc.so.6 /builddir/cross-aarch64-linux-gnu-0.35/glibc_build/libc_nonshared.a -Wl,--as-needed /builddir/cross-aarch64-linux-gnu-0.35/glibc_build/elf/ld.so -Wl,--no-as-needed -lgcc  `aarch64-linux-gnu-gcc  --print-file-name=crtendS.o` /builddir/cross-aarch64-linux-gnu-0.35/glibc_build/csu/crtn.o
/builddir/cross-aarch64-linux-gnu-0.35/build_root/usr/bin/../lib/gcc/aarch64-linux-gnu/12.2.0/../../../../aarch64-linux-gnu/bin/ld: cannot find -lstdc++: No such file or directory
/builddir/cross-aarch64-linux-gnu-0.35/build_root/usr/bin/../lib/gcc/aarch64-linux-gnu/12.2.0/../../../../aarch64-linux-gnu/bin/ld: cannot find -lgcc_s: No such file or directory
collect2: error: ld returned 1 exit status
make[2]: *** [../Rules:230: /builddir/cross-aarch64-linux-gnu-0.35/glibc_build/support/links-dso-program] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory '/builddir/cross-aarch64-linux-gnu-0.35/glibc-2.36/support'
make[1]: *** [Makefile:484: support/others] Error 2
make[1]: Leaving directory '/builddir/cross-aarch64-linux-gnu-0.35/glibc-2.36'
make: *** [Makefile:9: all] Error 2
=> ERROR: cross-aarch64-linux-gnu-0.35_1: do_build: 'make ${makejobs}' exited with 2
=> ERROR:   in _void_cross_build_glibc() at common/build-style/void-cross.sh:282
=> ERROR:   in do_build() at common/build-style/void-cross.sh:535
```
This was after successfully building `gcc` for native arch.

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (144 preceding siblings ...)
  2022-09-26 22:47 ` JamiKettunen
@ 2022-09-26 22:50 ` oreo639
  2022-09-26 23:03 ` JamiKettunen
                   ` (118 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-09-26 22:50 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 246 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1258737310

Comment:
That means you have `cross-aarch64-linux-gnu` currently installed in your masterdir. Create a new one.


^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (145 preceding siblings ...)
  2022-09-26 22:50 ` oreo639
@ 2022-09-26 23:03 ` JamiKettunen
  2022-09-26 23:03 ` JamiKettunen
                   ` (117 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: JamiKettunen @ 2022-09-26 23:03 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 297 bytes --]

New comment by JamiKettunen on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1258745122

Comment:
That did the trick, thanks! I assume that is expected behavior for upgrade of `cross-aarch64-linux-gnu` (removing removal of pre-existing masterdirs)?

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (146 preceding siblings ...)
  2022-09-26 23:03 ` JamiKettunen
@ 2022-09-26 23:03 ` JamiKettunen
  2022-10-02 23:47 ` [PR PATCH] [Updated] " oreo639
                   ` (116 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: JamiKettunen @ 2022-09-26 23:03 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 288 bytes --]

New comment by JamiKettunen on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1258745122

Comment:
That did the trick, thanks! I assume that is expected behavior for upgrade of `cross-aarch64-linux-gnu` (removal of pre-existing masterdirs)?

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (147 preceding siblings ...)
  2022-09-26 23:03 ` JamiKettunen
@ 2022-10-02 23:47 ` oreo639
  2022-10-03  2:51 ` oreo639
                   ` (115 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-10-02 23:47 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5092 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.2.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.2.0

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/38817
- [x] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [x] llvm https://github.com/void-linux/void-packages/pull/38694
- [x] m4 https://github.com/void-linux/void-packages/pull/33730
- [x] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [x] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [x] libvirt https://github.com/void-linux/void-packages/pull/38842
- [x] syslinux https://github.com/void-linux/void-packages/pull/38876
- [x] efivar https://github.com/void-linux/void-packages/pull/38874

Known packages that needed to be fixed/updated for gcc12:
- [ ] linux5.18 (in this PR)
- [x] openssh https://github.com/void-linux/void-packages/pull/38849
- [x] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [x] doxygen https://github.com/void-linux/void-packages/pull/38846
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/38817
- [x] libproxy https://github.com/void-linux/void-packages/pull/38818
- [x] exempi https://github.com/void-linux/void-packages/pull/38820
- [x] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [ ] gpgme https://github.com/void-linux/void-packages/pull/38825
- [x] libunique1 https://github.com/void-linux/void-packages/pull/38848 or https://github.com/void-linux/void-packages/pull/38873
- [x] libwpd https://github.com/void-linux/void-packages/pull/38878

Needs to be fixed/updated for binutils:
- [x] grub https://github.com/void-linux/void-packages/pull/38875
- [x] linux-tools https://github.com/void-linux/void-packages/pull/38877
- [x] kcov https://github.com/void-linux/void-packages/pull/39291

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [x] kde
- [x] lxde
- [x] lxqt

You can test the ISOs here:
https://drive.google.com/drive/folders/1ix92CYSLUP-KWjLxltdgG4e8Nu2JCY5n?usp=sharing

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 112576 bytes --]

From 820aab3b6746e7f9713956c418fffb433f433bd1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 01/37] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../fix-libcollector-without-java.patch       | 53 +++++++++++++++
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 22 +++++--
 4 files changed, 86 insertions(+), 115 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
 create mode 100644 srcpkgs/binutils/patches/fix-libcollector-without-java.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/fix-libcollector-without-java.patch b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
new file mode 100644
index 000000000000..54384875f358
--- /dev/null
+++ b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
@@ -0,0 +1,53 @@
+From 49ddd814ac1071af7c4f45d5f8398b91862f2c7f Mon Sep 17 00:00:00 2001
+From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
+Date: Wed, 17 Aug 2022 19:55:23 -0700
+Subject: [PATCH] gprofng: fix bug 29479 Collection fails when built without
+ java support
+
+gprofng/ChangeLog
+2022-08-17  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>
+
+	PR gprofng/29479
+	* libcollector/collector.c: Add #if defined(GPROFNG_JAVA_PROFILING) for
+	java specific code.
+	* libcollector/unwind.c: Likewise.
+---
+ gprofng/libcollector/collector.c | 2 ++
+ gprofng/libcollector/unwind.c    | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/gprofng/libcollector/collector.c b/gprofng/libcollector/collector.c
+index 93c9d3330de5..ceff2c1caccb 100644
+--- a/gprofng/libcollector/collector.c
++++ b/gprofng/libcollector/collector.c
+@@ -913,8 +913,10 @@ __collector_open_experiment (const char *exp, const char *params, sp_origin_t or
+   __collector_ext_unwind_key_init (1, NULL);
+ 
+   /* start java attach if suitable */
++#if defined(GPROFNG_JAVA_PROFILING)
+   if (exp_origin == SP_ORIGIN_DBX_ATTACH)
+     __collector_jprofile_start_attach ();
++#endif
+   start_sec_time = CALL_UTIL (time)(NULL);
+   __collector_start_time = collector_interface.getHiResTime ();
+   TprintfT (DBG_LT0, "\t__collector_open_experiment; resetting start_time\n");
+diff --git a/gprofng/libcollector/unwind.c b/gprofng/libcollector/unwind.c
+index 119243788020..f8e11823c81e 100644
+--- a/gprofng/libcollector/unwind.c
++++ b/gprofng/libcollector/unwind.c
+@@ -557,6 +557,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+   int size = max_frame_size;
+ 
+ #define MIN(a,b) ((a)<(b)?(a):(b))
++#if defined(GPROFNG_JAVA_PROFILING)
+   /* get Java info */
+   if (__collector_java_mode && __collector_java_asyncgetcalltrace_loaded && context && !pseudo_context)
+     {
+@@ -569,6 +570,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+ 	  size -= sz;
+ 	}
+     }
++#endif
+ 
+   /* get native stack */
+   if (context)
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..7002a308b2ab 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkg-config"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -44,6 +45,12 @@ do_configure() {
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	# gprofng currently only supports x86 and aarch64 glibc.
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64|i386|aarch64) conf+=" --enable-gprofng" ;;
+		*) conf+=" --disable-gprofng" ;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"
@@ -76,13 +83,15 @@ do_configure() {
 		--libdir=/usr/lib \
 		--mandir=/usr/share/man \
 		--infodir=/usr/share/info \
+		--sysconfdir=/etc \
 		--disable-werror \
-		--disable-shared \
 		--disable-nls \
+		--enable-shared \
 		--enable-threads \
 		--enable-plugins \
 		--enable-relro \
 		--enable-gold \
+		--enable-new-dtags \
 		--enable-deterministic-archives \
 		--enable-64-bit-bfd \
 		--enable-ld=default \
@@ -142,7 +151,8 @@ binutils-devel_package() {
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/*.a"
-		vmove "usr/lib/*.so"
+		vmove "usr/lib/libbfd.so"
+		vmove "usr/lib/libopcodes.so"
 	}
 }
 

From 9d4fecedb4c19489d1c0d5c0a7de4ed90868ca23 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 2 Oct 2022 16:46:59 -0700
Subject: [PATCH 02/37] gdb: resolve conflict with binutils 2.39

---
 srcpkgs/gdb/template | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/gdb/template b/srcpkgs/gdb/template
index ff7c9d9a5911..5970402eb27e 100644
--- a/srcpkgs/gdb/template
+++ b/srcpkgs/gdb/template
@@ -1,7 +1,7 @@
 # Template file for 'gdb'
 pkgname=gdb
 version=12.1
-revision=1
+revision=2
 build_style=gnu-configure
 pycompile_dirs="/usr/share/gdb/python"
 configure_args="--disable-werror --disable-nls --with-system-readline
@@ -48,7 +48,8 @@ vopt_conflict debuginfod static
 
 post_install() {
 	# resolve conflicts with binutils
-	rm -r ${DESTDIR}/usr/{include,lib,share/info/bfd.info*}
+	rm -rf ${DESTDIR}/usr/{include,lib}
+	rm -rf ${DESTDIR}/usr/share/info/{bfd,ctf-spec}.info*
 }
 
 gdb-common_package() {

From c9171e5da4a57e0efe62958091747d3248e5839e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 03/37] gcc: update to 12.2.0.

---
 common/shlibs                                 | 10 +--
 srcpkgs/gcc/files/gccgo-musl.patch            | 71 +++----------------
 srcpkgs/gcc/files/libgnarl-musl.patch         | 18 ++---
 srcpkgs/gcc/files/libssp-musl.patch           | 10 +--
 srcpkgs/gcc/patches/libffi_gnulinux.patch     | 11 ---
 .../gcc/patches/libgcc-ibm128-no-tag.patch    | 10 ++-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |  2 +-
 srcpkgs/gcc/template                          | 25 +++----
 8 files changed, 49 insertions(+), 108 deletions(-)
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index 3297091f7cc0..1441a3fa834a 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.2.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.36 perl-5.36.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -847,8 +847,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.2.0_1
+libgnat-12.so libada-12.2.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1697,8 +1697,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.2.0_1
+libasan.so.8 libsanitizer-12.2.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..12ec68dd8aa3 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,14 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ b/libgo/go/runtime/os_linux.go
+@@ -365,7 +365,7 @@ func setThreadCPUProfiler(hz int32) {
+ 	var sevp _sigevent
+ 	sevp.sigev_notify = _SIGEV_THREAD_ID
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.__sev_fields))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..446741390d45 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,15 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
+version=12.2.0
+revision=1
 _patchver="${version%pre*}"
 _minorver="${_patchver%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 wrksrc=gcc-${version/pre/_pre}
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +19,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -396,7 +393,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}

From 51f829dac6990e6a736b923a9ac2da8d946047fb Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 04/37] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      | 11 ++++--
 2 files changed, 25 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..70c4aa533e66 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,12 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
+
+if [ "$XBPS_LIBC" == "musl" ]; then
+# Musl always searches LD_LIBRARY_PATH before RPATH and RUNPATH
+make_build_args="lt_cv_shlibpath_overrides_runpath=yes"
+fi
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From e6011e159c121068fdaabc2d3f552567940c9f19 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 05/37] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 55255dceae8b..ca2d858a7abc 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From e065c4b67cdbf330bf9be93ced2da346435acd30 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 06/37] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 3 files changed, 55 insertions(+), 353 deletions(-)
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index 1441a3fa834a..8ebf2e2f9fd7 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From 0bfe3f78e9453e08a804c30fa77ac615e1823539 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Wed, 14 Sep 2022 03:48:32 -0700
Subject: [PATCH 07/37] musl: add support for SIGEV_THREAD_ID timers

https://git.musl-libc.org/cgit/musl/commit/?id=7c71792e87691451f2a6b76348e83ad1889f1dcb
---
 ...d-support-for-SIGEV_THREAD_ID-timers.patch | 74 +++++++++++++++++++
 srcpkgs/musl/template                         |  2 +-
 2 files changed, 75 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch

diff --git a/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
new file mode 100644
index 000000000000..e20dff5ba0d4
--- /dev/null
+++ b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
@@ -0,0 +1,74 @@
+From 7c71792e87691451f2a6b76348e83ad1889f1dcb Mon Sep 17 00:00:00 2001
+From: James Y Knight <jyknight@google.com>
+Date: Sun, 30 Jun 2019 21:55:20 -0400
+Subject: [PATCH] add support for SIGEV_THREAD_ID timers
+
+This is like SIGEV_SIGNAL, but targeted to a particular thread's
+tid, rather than the process.
+---
+ include/signal.h        | 16 +++++++++++++---
+ src/time/timer_create.c |  8 ++++++--
+ 2 files changed, 19 insertions(+), 5 deletions(-)
+
+diff --git a/include/signal.h b/include/signal.h
+index fbdf667b2..9ed929e4f 100644
+--- a/include/signal.h
++++ b/include/signal.h
+@@ -180,14 +180,24 @@ struct sigevent {
+ 	union sigval sigev_value;
+ 	int sigev_signo;
+ 	int sigev_notify;
+-	void (*sigev_notify_function)(union sigval);
+-	pthread_attr_t *sigev_notify_attributes;
+-	char __pad[56-3*sizeof(long)];
++	union {
++		char __pad[64 - 2*sizeof(int) - sizeof(union sigval)];
++		pid_t sigev_notify_thread_id;
++		struct {
++			void (*sigev_notify_function)(union sigval);
++			pthread_attr_t *sigev_notify_attributes;
++		} __sev_thread;
++	} __sev_fields;
+ };
+ 
++#define sigev_notify_thread_id __sev_fields.sigev_notify_thread_id
++#define sigev_notify_function __sev_fields.__sev_thread.sigev_notify_function
++#define sigev_notify_attributes __sev_fields.__sev_thread.sigev_notify_attributes
++
+ #define SIGEV_SIGNAL 0
+ #define SIGEV_NONE 1
+ #define SIGEV_THREAD 2
++#define SIGEV_THREAD_ID 4
+ 
+ int __libc_current_sigrtmin(void);
+ int __libc_current_sigrtmax(void);
+diff --git a/src/time/timer_create.c b/src/time/timer_create.c
+index 5ddfda278..4bef23905 100644
+--- a/src/time/timer_create.c
++++ b/src/time/timer_create.c
+@@ -71,11 +71,15 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 	switch (evp ? evp->sigev_notify : SIGEV_SIGNAL) {
+ 	case SIGEV_NONE:
+ 	case SIGEV_SIGNAL:
++	case SIGEV_THREAD_ID:
+ 		if (evp) {
+ 			ksev.sigev_value = evp->sigev_value;
+ 			ksev.sigev_signo = evp->sigev_signo;
+ 			ksev.sigev_notify = evp->sigev_notify;
+-			ksev.sigev_tid = 0;
++			if (evp->sigev_notify == SIGEV_THREAD_ID)
++				ksev.sigev_tid = evp->sigev_notify_thread_id;
++			else
++				ksev.sigev_tid = 0;
+ 			ksevp = &ksev;
+ 		}
+ 		if (syscall(SYS_timer_create, clk, ksevp, &timerid) < 0)
+@@ -107,7 +111,7 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 
+ 		ksev.sigev_value.sival_ptr = 0;
+ 		ksev.sigev_signo = SIGTIMER;
+-		ksev.sigev_notify = 4; /* SIGEV_THREAD_ID */
++		ksev.sigev_notify = SIGEV_THREAD_ID;
+ 		ksev.sigev_tid = td->tid;
+ 		if (syscall(SYS_timer_create, clk, &ksev, &timerid) < 0)
+ 			timerid = -1;
diff --git a/srcpkgs/musl/template b/srcpkgs/musl/template
index 5bdc5c48e623..34e6ed4fba6e 100644
--- a/srcpkgs/musl/template
+++ b/srcpkgs/musl/template
@@ -2,7 +2,7 @@
 pkgname=musl
 reverts="1.2.0_1"
 version=1.1.24
-revision=10
+revision=11
 archs="*-musl"
 bootstrap=yes
 build_style=gnu-configure

From 2a8fa87428ee4b2bc6b39d0b3c34f9b61963f8eb Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 21:01:43 -0700
Subject: [PATCH 08/37] gcc-multilib: update to 12.2.0.

---
 srcpkgs/gcc-multilib/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index fcd25755aa75..1a26da26a991 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,16 +3,16 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _majorver="${version%.*}"
-wrksrc=gcc-${version/pre/_pre}
+wrksrc=gcc-${version}
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel

From 9d363b55c9b5a20f556c47d117f1752db4ec304c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 14 Aug 2022 19:29:36 -0700
Subject: [PATCH 09/37] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove -no-pie from build. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..fcc00b3a6c5d 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -53,6 +53,7 @@ _void_cross_build_binutils() {
 		--sbindir=/usr/bin \
 		--libdir=/usr/lib \
 		--libexecdir=/usr/lib \
+		--sysconfdir=/etc \
 		--target=${tgt} \
 		--with-sysroot=/usr/${tgt} \
 		--disable-nls \
@@ -60,6 +61,7 @@ _void_cross_build_binutils() {
 		--disable-multilib \
 		--disable-werror \
 		--disable-gold \
+		--disable-gprofng \
 		--enable-relro \
 		--enable-plugins \
 		--enable-64-bit-bfd \
@@ -132,6 +134,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -460,6 +463,14 @@ do_build() {
 	local binutils_ver linux_ver gcc_ver libc_ver libucontext_ver
 	local tgt=${sourcepkg/cross-}
 
+	export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}"
+	export CXXFLAGS="${CXXFLAGS/-D_FORTIFY_SOURCE=2/}"
+
+	# Disable explicit -fno-PIE, gcc/binutils/libc will figure this out itself.
+	export CFLAGS="${CFLAGS//-fno-PIE/}"
+	export CXXFLAGS="${CXXFLAGS//-fno-PIE/}"
+	export LDFLAGS="${LDFLAGS//-no-pie/}"
+
 	_void_cross_test_ver binutils
 	_void_cross_test_ver linux
 	_void_cross_test_ver gcc
@@ -625,6 +636,9 @@ do_install() {
 	# then remove it because it conflicts with libquadmath package
 	rm -rf ${DESTDIR}/${sysroot}/usr/lib/libquadmath.*
 
+	# Remove libdep linker plugin because it conflicts with system binutils
+	rm -f ${DESTDIR}/usr/lib/bfd-plugins/libdep*
+
 	# Remove leftover symlinks
 	rm -f ${DESTDIR}/usr/lib${XBPS_TARGET_WORDSIZE}
 	rm -f ${DESTDIR}/lib*

From c1b4dc55af3a9c302be64a8084849dd622bfcd76 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:09:31 -0700
Subject: [PATCH 10/37] linux5.18: update dotconfigs for gcc12

---
 srcpkgs/linux5.18/files/x86_64-dotconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/linux5.18/files/x86_64-dotconfig b/srcpkgs/linux5.18/files/x86_64-dotconfig
index 4e73a3195d40..ea6204868e23 100644
--- a/srcpkgs/linux5.18/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.18/files/x86_64-dotconfig
@@ -512,6 +512,7 @@ CONFIG_RETHUNK=y
 CONFIG_CPU_UNRET_ENTRY=y
 CONFIG_CPU_IBPB_ENTRY=y
 CONFIG_CPU_IBRS_ENTRY=y
+CONFIG_SLS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10060,8 +10061,11 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
 # Memory initialization
 #
 CONFIG_INIT_STACK_NONE=y
+# CONFIG_INIT_STACK_ALL_PATTERN is not set
+# CONFIG_INIT_STACK_ALL_ZERO is not set
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
+# CONFIG_ZERO_CALL_USED_REGS is not set
 # end of Memory initialization
 # end of Kernel hardening options
 # end of Security options
@@ -10538,6 +10542,7 @@ CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
 # CONFIG_UBSAN is not set
 CONFIG_HAVE_ARCH_KCSAN=y
+# CONFIG_KCSAN is not set
 # end of Generic Kernel Debugging Instruments
 
 #

From 2be614cb50cc19332e25a86bb32d133c8ef380ad Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 14:45:28 -0700
Subject: [PATCH 11/37] libsasl: fix build for libtool 2.4.7

---
 srcpkgs/libsasl/template | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/libsasl/template b/srcpkgs/libsasl/template
index a8817042f843..a2993b39f4a1 100644
--- a/srcpkgs/libsasl/template
+++ b/srcpkgs/libsasl/template
@@ -19,6 +19,7 @@ distfiles="https://github.com/cyrusimap/cyrus-sasl/releases/download/cyrus-sasl-
 checksum=26866b1549b00ffd020f188a43c258017fa1c382b3ddadd8201536f72efb05d5
 
 pre_configure() {
+	rm -f m4/ltversion.m4
 	autoreconf -fi
 }
 

From bd97a988cd0acf8605ea75ae46fb42d5e833057d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:08 -0700
Subject: [PATCH 12/37] subversion: fix build for libtool 2.4.7

---
 srcpkgs/subversion/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion/template b/srcpkgs/subversion/template
index 18c35e3a2132..4c32a6342c6a 100644
--- a/srcpkgs/subversion/template
+++ b/srcpkgs/subversion/template
@@ -59,7 +59,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From 3d351c302695608b2860cd4b6de84cb11ef0e465 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:38 -0700
Subject: [PATCH 13/37] subversion-kwallet-auth: fix build for libtool 2.4.7

---
 srcpkgs/subversion-kwallet-auth/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion-kwallet-auth/template b/srcpkgs/subversion-kwallet-auth/template
index 12210f250d51..b4d8621456ea 100644
--- a/srcpkgs/subversion-kwallet-auth/template
+++ b/srcpkgs/subversion-kwallet-auth/template
@@ -59,7 +59,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From b3866d97bb4bb4e97fd2cef7ee573cacb32ca4ff Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 14/37] cross-aarch64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..bd6b23f9fb6a 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 5f902b43109b76a500670323994789fb4f2f86ba Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 15/37] cross-aarch64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..427ad2c1e9cd 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From ee68a7d8ab5694bb300e6deeb94cd83b99af81f9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 16/37] cross-arm-linux-gnueabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..2510ee26e789 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 3af84a228109b430a13211e0a991a154b948ab53 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 17/37] cross-arm-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..bd8b16e1b4c1 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From f5530bef8ad5a9cdb982e65afad1b200ba4ea6e0 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 18/37] cross-arm-linux-musleabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..dacfd2655216 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 176f246e869944e9677c924c905b699491d68def Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 19/37] cross-arm-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..9ddd32a9f20d 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From a9e5762015fbe2f83ca70f917d6a1b18d73d6668 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 20/37] cross-armv7l-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..9fb00f18be3b 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From c6deedc158c9b8e5d5532eadf185e1d7eb360a0d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 21/37] cross-armv7l-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..2c72e75ddfe3 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From b31d065de1ebda07bd0dd193fd4d039059ec03d0 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 22/37] cross-i686-pc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..4dc17df648b5 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From f256e34f1bef1ae1231b961a99066da3adc8dd86 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Fri, 16 Sep 2022 20:52:19 -0700
Subject: [PATCH 23/37] cross-i686-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-linux-musl/template b/srcpkgs/cross-i686-linux-musl/template
index 8be16a230d8d..78b4d813a113 100644
--- a/srcpkgs/cross-i686-linux-musl/template
+++ b/srcpkgs/cross-i686-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-i686-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-i686-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 88faf8d7b5dc374af319981ca8f918b4887e7bcd Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 24/37] cross-mips-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..6009e5c79eb2 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From b57f86599fe77bf38802235f58223fdfe50b2e3f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 25/37] cross-mips-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..080164df193d 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="hipperson0 <hipperson0@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From db68f3f55954eb9b98729f8a86b68905c0a18212 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 26/37] cross-mipsel-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..f9fd4b8a04ef 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From e83227ce20aa982065abdba814d9bbf8004959f9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 27/37] cross-mipsel-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..7418a984474b 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From e1cc343f5ff4c8d13dac170de5f919a6dd54224b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 28/37] cross-powerpc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..31e57b4e52b2 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From a05a15e843651432cb1f84fe9152e0db96b3501d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 29/37] cross-powerpc-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..a2d1edcf1ffd 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 602aea641d0507b88cf59f81b1ea2354e342f8c5 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 30/37] cross-powerpc64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..1a4cbed61e76 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 9832bbbb8bf4b268624548e2aaebf2624e689e0f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 31/37] cross-powerpc64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 016f18776a6d..19b1ff859eb6 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From d4c84b1de08ca2e64420bdd974b21fb4adfd8385 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 32/37] cross-powerpc64le-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 463d7e92d20d..9d99a3a315d2 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From fd32874c04d0bcdc946ec8954bf8bcbc9c5823a1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 33/37] cross-powerpc64le-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index c17a3cccfe29..3128baa7372e 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 2b90695618b6bb1c8134415b74b11faea3729de8 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 34/37] cross-powerpcle-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 9aede3c465ce..6f914b3877ee 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 0c7feee4a38ca48640bdc8f81b7dd0d365501d99 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 35/37] cross-powerpcle-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index 045cfda987fe..20e70bed4c60 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From fd0aea291edf6c22091186139157f700110b4eef Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 36/37] cross-x86_64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 8918f3c22a1c..5219cd50f851 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From fcc60b7435cd7618ad2ed8a99d3b19eb8c4e9459 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 37/37] cross-x86_64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..2811de0d3c2e 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (148 preceding siblings ...)
  2022-10-02 23:47 ` [PR PATCH] [Updated] " oreo639
@ 2022-10-03  2:51 ` oreo639
  2022-10-03  6:26 ` oreo639
                   ` (114 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-10-03  2:51 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5092 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.2.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.2.0

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/38817
- [x] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [x] llvm https://github.com/void-linux/void-packages/pull/38694
- [x] m4 https://github.com/void-linux/void-packages/pull/33730
- [x] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [x] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [x] libvirt https://github.com/void-linux/void-packages/pull/38842
- [x] syslinux https://github.com/void-linux/void-packages/pull/38876
- [x] efivar https://github.com/void-linux/void-packages/pull/38874

Known packages that needed to be fixed/updated for gcc12:
- [ ] linux5.18 (in this PR)
- [x] openssh https://github.com/void-linux/void-packages/pull/38849
- [x] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [x] doxygen https://github.com/void-linux/void-packages/pull/38846
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/38817
- [x] libproxy https://github.com/void-linux/void-packages/pull/38818
- [x] exempi https://github.com/void-linux/void-packages/pull/38820
- [x] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [ ] gpgme https://github.com/void-linux/void-packages/pull/38825
- [x] libunique1 https://github.com/void-linux/void-packages/pull/38848 or https://github.com/void-linux/void-packages/pull/38873
- [x] libwpd https://github.com/void-linux/void-packages/pull/38878

Needs to be fixed/updated for binutils:
- [x] grub https://github.com/void-linux/void-packages/pull/38875
- [x] linux-tools https://github.com/void-linux/void-packages/pull/38877
- [x] kcov https://github.com/void-linux/void-packages/pull/39291

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [x] kde
- [x] lxde
- [x] lxqt

You can test the ISOs here:
https://drive.google.com/drive/folders/1ix92CYSLUP-KWjLxltdgG4e8Nu2JCY5n?usp=sharing

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 112573 bytes --]

From 7003dff6de12664babfe04fde809c45a286252b8 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 01/37] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../fix-libcollector-without-java.patch       | 53 +++++++++++++++
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 22 +++++--
 4 files changed, 86 insertions(+), 115 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
 create mode 100644 srcpkgs/binutils/patches/fix-libcollector-without-java.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/fix-libcollector-without-java.patch b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
new file mode 100644
index 000000000000..54384875f358
--- /dev/null
+++ b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
@@ -0,0 +1,53 @@
+From 49ddd814ac1071af7c4f45d5f8398b91862f2c7f Mon Sep 17 00:00:00 2001
+From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
+Date: Wed, 17 Aug 2022 19:55:23 -0700
+Subject: [PATCH] gprofng: fix bug 29479 Collection fails when built without
+ java support
+
+gprofng/ChangeLog
+2022-08-17  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>
+
+	PR gprofng/29479
+	* libcollector/collector.c: Add #if defined(GPROFNG_JAVA_PROFILING) for
+	java specific code.
+	* libcollector/unwind.c: Likewise.
+---
+ gprofng/libcollector/collector.c | 2 ++
+ gprofng/libcollector/unwind.c    | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/gprofng/libcollector/collector.c b/gprofng/libcollector/collector.c
+index 93c9d3330de5..ceff2c1caccb 100644
+--- a/gprofng/libcollector/collector.c
++++ b/gprofng/libcollector/collector.c
+@@ -913,8 +913,10 @@ __collector_open_experiment (const char *exp, const char *params, sp_origin_t or
+   __collector_ext_unwind_key_init (1, NULL);
+ 
+   /* start java attach if suitable */
++#if defined(GPROFNG_JAVA_PROFILING)
+   if (exp_origin == SP_ORIGIN_DBX_ATTACH)
+     __collector_jprofile_start_attach ();
++#endif
+   start_sec_time = CALL_UTIL (time)(NULL);
+   __collector_start_time = collector_interface.getHiResTime ();
+   TprintfT (DBG_LT0, "\t__collector_open_experiment; resetting start_time\n");
+diff --git a/gprofng/libcollector/unwind.c b/gprofng/libcollector/unwind.c
+index 119243788020..f8e11823c81e 100644
+--- a/gprofng/libcollector/unwind.c
++++ b/gprofng/libcollector/unwind.c
+@@ -557,6 +557,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+   int size = max_frame_size;
+ 
+ #define MIN(a,b) ((a)<(b)?(a):(b))
++#if defined(GPROFNG_JAVA_PROFILING)
+   /* get Java info */
+   if (__collector_java_mode && __collector_java_asyncgetcalltrace_loaded && context && !pseudo_context)
+     {
+@@ -569,6 +570,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+ 	  size -= sz;
+ 	}
+     }
++#endif
+ 
+   /* get native stack */
+   if (context)
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..79cd4e2b7c1f 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkgconf"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -44,6 +45,12 @@ do_configure() {
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	# gprofng currently only supports x86 and aarch64 glibc.
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64|i386|aarch64) conf+=" --enable-gprofng" ;;
+		*) conf+=" --disable-gprofng" ;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"
@@ -76,13 +83,15 @@ do_configure() {
 		--libdir=/usr/lib \
 		--mandir=/usr/share/man \
 		--infodir=/usr/share/info \
+		--sysconfdir=/etc \
 		--disable-werror \
-		--disable-shared \
 		--disable-nls \
+		--enable-shared \
 		--enable-threads \
 		--enable-plugins \
 		--enable-relro \
 		--enable-gold \
+		--enable-new-dtags \
 		--enable-deterministic-archives \
 		--enable-64-bit-bfd \
 		--enable-ld=default \
@@ -142,7 +151,8 @@ binutils-devel_package() {
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/*.a"
-		vmove "usr/lib/*.so"
+		vmove "usr/lib/libbfd.so"
+		vmove "usr/lib/libopcodes.so"
 	}
 }
 

From 734eb0b37f7c1ed1e76956cb48db773a436122ad Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 2 Oct 2022 16:46:59 -0700
Subject: [PATCH 02/37] gdb: resolve conflict with binutils 2.39

---
 srcpkgs/gdb/template | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/gdb/template b/srcpkgs/gdb/template
index ff7c9d9a5911..5970402eb27e 100644
--- a/srcpkgs/gdb/template
+++ b/srcpkgs/gdb/template
@@ -1,7 +1,7 @@
 # Template file for 'gdb'
 pkgname=gdb
 version=12.1
-revision=1
+revision=2
 build_style=gnu-configure
 pycompile_dirs="/usr/share/gdb/python"
 configure_args="--disable-werror --disable-nls --with-system-readline
@@ -48,7 +48,8 @@ vopt_conflict debuginfod static
 
 post_install() {
 	# resolve conflicts with binutils
-	rm -r ${DESTDIR}/usr/{include,lib,share/info/bfd.info*}
+	rm -rf ${DESTDIR}/usr/{include,lib}
+	rm -rf ${DESTDIR}/usr/share/info/{bfd,ctf-spec}.info*
 }
 
 gdb-common_package() {

From 4209f6bbc942f55cf1b83ec29d6f86d6ce2118fc Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 03/37] gcc: update to 12.2.0.

---
 common/shlibs                                 | 10 +--
 srcpkgs/gcc/files/gccgo-musl.patch            | 71 +++----------------
 srcpkgs/gcc/files/libgnarl-musl.patch         | 18 ++---
 srcpkgs/gcc/files/libssp-musl.patch           | 10 +--
 srcpkgs/gcc/patches/libffi_gnulinux.patch     | 11 ---
 .../gcc/patches/libgcc-ibm128-no-tag.patch    | 10 ++-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |  2 +-
 srcpkgs/gcc/template                          | 25 +++----
 8 files changed, 49 insertions(+), 108 deletions(-)
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index 3297091f7cc0..1441a3fa834a 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.2.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.36 perl-5.36.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -847,8 +847,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.2.0_1
+libgnat-12.so libada-12.2.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1697,8 +1697,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.2.0_1
+libasan.so.8 libsanitizer-12.2.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..12ec68dd8aa3 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,14 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ b/libgo/go/runtime/os_linux.go
+@@ -365,7 +365,7 @@ func setThreadCPUProfiler(hz int32) {
+ 	var sevp _sigevent
+ 	sevp.sigev_notify = _SIGEV_THREAD_ID
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.__sev_fields))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..446741390d45 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,15 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
+version=12.2.0
+revision=1
 _patchver="${version%pre*}"
 _minorver="${_patchver%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 wrksrc=gcc-${version/pre/_pre}
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +19,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -396,7 +393,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}

From ca3a2ea3cccedde09b1fb70a72740b20ca563bdc Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 04/37] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      | 11 ++++--
 2 files changed, 25 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..70c4aa533e66 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,12 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
+
+if [ "$XBPS_LIBC" == "musl" ]; then
+# Musl always searches LD_LIBRARY_PATH before RPATH and RUNPATH
+make_build_args="lt_cv_shlibpath_overrides_runpath=yes"
+fi
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From 881ff1cc74fffd1c5d7fb91ba8413ec75dc0bbd8 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 05/37] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 55255dceae8b..ca2d858a7abc 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From da6b3766eb204c8bcdad459bd8cc58e517077ea5 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 06/37] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 3 files changed, 55 insertions(+), 353 deletions(-)
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index 1441a3fa834a..8ebf2e2f9fd7 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From 66c9a109b2f7a388312511a99e8fb891942f86b0 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Wed, 14 Sep 2022 03:48:32 -0700
Subject: [PATCH 07/37] musl: add support for SIGEV_THREAD_ID timers

https://git.musl-libc.org/cgit/musl/commit/?id=7c71792e87691451f2a6b76348e83ad1889f1dcb
---
 ...d-support-for-SIGEV_THREAD_ID-timers.patch | 74 +++++++++++++++++++
 srcpkgs/musl/template                         |  2 +-
 2 files changed, 75 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch

diff --git a/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
new file mode 100644
index 000000000000..e20dff5ba0d4
--- /dev/null
+++ b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
@@ -0,0 +1,74 @@
+From 7c71792e87691451f2a6b76348e83ad1889f1dcb Mon Sep 17 00:00:00 2001
+From: James Y Knight <jyknight@google.com>
+Date: Sun, 30 Jun 2019 21:55:20 -0400
+Subject: [PATCH] add support for SIGEV_THREAD_ID timers
+
+This is like SIGEV_SIGNAL, but targeted to a particular thread's
+tid, rather than the process.
+---
+ include/signal.h        | 16 +++++++++++++---
+ src/time/timer_create.c |  8 ++++++--
+ 2 files changed, 19 insertions(+), 5 deletions(-)
+
+diff --git a/include/signal.h b/include/signal.h
+index fbdf667b2..9ed929e4f 100644
+--- a/include/signal.h
++++ b/include/signal.h
+@@ -180,14 +180,24 @@ struct sigevent {
+ 	union sigval sigev_value;
+ 	int sigev_signo;
+ 	int sigev_notify;
+-	void (*sigev_notify_function)(union sigval);
+-	pthread_attr_t *sigev_notify_attributes;
+-	char __pad[56-3*sizeof(long)];
++	union {
++		char __pad[64 - 2*sizeof(int) - sizeof(union sigval)];
++		pid_t sigev_notify_thread_id;
++		struct {
++			void (*sigev_notify_function)(union sigval);
++			pthread_attr_t *sigev_notify_attributes;
++		} __sev_thread;
++	} __sev_fields;
+ };
+ 
++#define sigev_notify_thread_id __sev_fields.sigev_notify_thread_id
++#define sigev_notify_function __sev_fields.__sev_thread.sigev_notify_function
++#define sigev_notify_attributes __sev_fields.__sev_thread.sigev_notify_attributes
++
+ #define SIGEV_SIGNAL 0
+ #define SIGEV_NONE 1
+ #define SIGEV_THREAD 2
++#define SIGEV_THREAD_ID 4
+ 
+ int __libc_current_sigrtmin(void);
+ int __libc_current_sigrtmax(void);
+diff --git a/src/time/timer_create.c b/src/time/timer_create.c
+index 5ddfda278..4bef23905 100644
+--- a/src/time/timer_create.c
++++ b/src/time/timer_create.c
+@@ -71,11 +71,15 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 	switch (evp ? evp->sigev_notify : SIGEV_SIGNAL) {
+ 	case SIGEV_NONE:
+ 	case SIGEV_SIGNAL:
++	case SIGEV_THREAD_ID:
+ 		if (evp) {
+ 			ksev.sigev_value = evp->sigev_value;
+ 			ksev.sigev_signo = evp->sigev_signo;
+ 			ksev.sigev_notify = evp->sigev_notify;
+-			ksev.sigev_tid = 0;
++			if (evp->sigev_notify == SIGEV_THREAD_ID)
++				ksev.sigev_tid = evp->sigev_notify_thread_id;
++			else
++				ksev.sigev_tid = 0;
+ 			ksevp = &ksev;
+ 		}
+ 		if (syscall(SYS_timer_create, clk, ksevp, &timerid) < 0)
+@@ -107,7 +111,7 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 
+ 		ksev.sigev_value.sival_ptr = 0;
+ 		ksev.sigev_signo = SIGTIMER;
+-		ksev.sigev_notify = 4; /* SIGEV_THREAD_ID */
++		ksev.sigev_notify = SIGEV_THREAD_ID;
+ 		ksev.sigev_tid = td->tid;
+ 		if (syscall(SYS_timer_create, clk, &ksev, &timerid) < 0)
+ 			timerid = -1;
diff --git a/srcpkgs/musl/template b/srcpkgs/musl/template
index 5bdc5c48e623..34e6ed4fba6e 100644
--- a/srcpkgs/musl/template
+++ b/srcpkgs/musl/template
@@ -2,7 +2,7 @@
 pkgname=musl
 reverts="1.2.0_1"
 version=1.1.24
-revision=10
+revision=11
 archs="*-musl"
 bootstrap=yes
 build_style=gnu-configure

From 422ff0073e3562313d26e23f90e30938f51e6afd Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 21:01:43 -0700
Subject: [PATCH 08/37] gcc-multilib: update to 12.2.0.

---
 srcpkgs/gcc-multilib/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index fcd25755aa75..1a26da26a991 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,16 +3,16 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _majorver="${version%.*}"
-wrksrc=gcc-${version/pre/_pre}
+wrksrc=gcc-${version}
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel

From 81e73007306a067ec90b63241c3e37b7c9b0f490 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 14 Aug 2022 19:29:36 -0700
Subject: [PATCH 09/37] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove -no-pie from build. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..fcc00b3a6c5d 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -53,6 +53,7 @@ _void_cross_build_binutils() {
 		--sbindir=/usr/bin \
 		--libdir=/usr/lib \
 		--libexecdir=/usr/lib \
+		--sysconfdir=/etc \
 		--target=${tgt} \
 		--with-sysroot=/usr/${tgt} \
 		--disable-nls \
@@ -60,6 +61,7 @@ _void_cross_build_binutils() {
 		--disable-multilib \
 		--disable-werror \
 		--disable-gold \
+		--disable-gprofng \
 		--enable-relro \
 		--enable-plugins \
 		--enable-64-bit-bfd \
@@ -132,6 +134,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -460,6 +463,14 @@ do_build() {
 	local binutils_ver linux_ver gcc_ver libc_ver libucontext_ver
 	local tgt=${sourcepkg/cross-}
 
+	export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}"
+	export CXXFLAGS="${CXXFLAGS/-D_FORTIFY_SOURCE=2/}"
+
+	# Disable explicit -fno-PIE, gcc/binutils/libc will figure this out itself.
+	export CFLAGS="${CFLAGS//-fno-PIE/}"
+	export CXXFLAGS="${CXXFLAGS//-fno-PIE/}"
+	export LDFLAGS="${LDFLAGS//-no-pie/}"
+
 	_void_cross_test_ver binutils
 	_void_cross_test_ver linux
 	_void_cross_test_ver gcc
@@ -625,6 +636,9 @@ do_install() {
 	# then remove it because it conflicts with libquadmath package
 	rm -rf ${DESTDIR}/${sysroot}/usr/lib/libquadmath.*
 
+	# Remove libdep linker plugin because it conflicts with system binutils
+	rm -f ${DESTDIR}/usr/lib/bfd-plugins/libdep*
+
 	# Remove leftover symlinks
 	rm -f ${DESTDIR}/usr/lib${XBPS_TARGET_WORDSIZE}
 	rm -f ${DESTDIR}/lib*

From 219e97694dc44139c27cd8022cf1dd965fde9378 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:09:31 -0700
Subject: [PATCH 10/37] linux5.18: update dotconfigs for gcc12

---
 srcpkgs/linux5.18/files/x86_64-dotconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/linux5.18/files/x86_64-dotconfig b/srcpkgs/linux5.18/files/x86_64-dotconfig
index 4e73a3195d40..ea6204868e23 100644
--- a/srcpkgs/linux5.18/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.18/files/x86_64-dotconfig
@@ -512,6 +512,7 @@ CONFIG_RETHUNK=y
 CONFIG_CPU_UNRET_ENTRY=y
 CONFIG_CPU_IBPB_ENTRY=y
 CONFIG_CPU_IBRS_ENTRY=y
+CONFIG_SLS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10060,8 +10061,11 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
 # Memory initialization
 #
 CONFIG_INIT_STACK_NONE=y
+# CONFIG_INIT_STACK_ALL_PATTERN is not set
+# CONFIG_INIT_STACK_ALL_ZERO is not set
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
+# CONFIG_ZERO_CALL_USED_REGS is not set
 # end of Memory initialization
 # end of Kernel hardening options
 # end of Security options
@@ -10538,6 +10542,7 @@ CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
 # CONFIG_UBSAN is not set
 CONFIG_HAVE_ARCH_KCSAN=y
+# CONFIG_KCSAN is not set
 # end of Generic Kernel Debugging Instruments
 
 #

From 938bab5a21c33e553bd44b18e80b53b9298ba419 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 14:45:28 -0700
Subject: [PATCH 11/37] libsasl: fix build for libtool 2.4.7

---
 srcpkgs/libsasl/template | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/libsasl/template b/srcpkgs/libsasl/template
index a8817042f843..a2993b39f4a1 100644
--- a/srcpkgs/libsasl/template
+++ b/srcpkgs/libsasl/template
@@ -19,6 +19,7 @@ distfiles="https://github.com/cyrusimap/cyrus-sasl/releases/download/cyrus-sasl-
 checksum=26866b1549b00ffd020f188a43c258017fa1c382b3ddadd8201536f72efb05d5
 
 pre_configure() {
+	rm -f m4/ltversion.m4
 	autoreconf -fi
 }
 

From 97e07e28f73b53869a1f9d93fb7f60164338a778 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:08 -0700
Subject: [PATCH 12/37] subversion: fix build for libtool 2.4.7

---
 srcpkgs/subversion/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion/template b/srcpkgs/subversion/template
index 18c35e3a2132..4c32a6342c6a 100644
--- a/srcpkgs/subversion/template
+++ b/srcpkgs/subversion/template
@@ -59,7 +59,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From 4b7df894ce74162cc21e1c4ecda28d1a77b3e332 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:38 -0700
Subject: [PATCH 13/37] subversion-kwallet-auth: fix build for libtool 2.4.7

---
 srcpkgs/subversion-kwallet-auth/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion-kwallet-auth/template b/srcpkgs/subversion-kwallet-auth/template
index 12210f250d51..b4d8621456ea 100644
--- a/srcpkgs/subversion-kwallet-auth/template
+++ b/srcpkgs/subversion-kwallet-auth/template
@@ -59,7 +59,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From dbc0a95c05e7bea92bd71e3d94767e653fe9eea5 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 14/37] cross-aarch64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..bd6b23f9fb6a 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 8f2e76597241d3ca36347e3c20f70c6d12de09a7 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 15/37] cross-aarch64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..427ad2c1e9cd 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 4a97b260d8cae80ccd1eff8ed91fc97b076ca7e5 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 16/37] cross-arm-linux-gnueabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..2510ee26e789 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From b62e52e987a6f690287eb192c8e25517c34f1889 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 17/37] cross-arm-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..bd8b16e1b4c1 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From be65b4f536eebb1474d31557dd40631db89f7a39 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 18/37] cross-arm-linux-musleabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..dacfd2655216 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 313b9da0be5045a001e95f3628626abdee01c00b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 19/37] cross-arm-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..9ddd32a9f20d 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 26c7b0f6872b2778c5003227a1f5dbae39bb5289 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 20/37] cross-armv7l-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..9fb00f18be3b 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 446957facaf2ebcb283ff7a0cdd4738885e7ad22 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 21/37] cross-armv7l-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..2c72e75ddfe3 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 9ff29f8d717a750bad1322410649d418c9f27f9d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 22/37] cross-i686-pc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..4dc17df648b5 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 9f052a1cf4f2e27985821184b27c80230a14866e Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Fri, 16 Sep 2022 20:52:19 -0700
Subject: [PATCH 23/37] cross-i686-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-linux-musl/template b/srcpkgs/cross-i686-linux-musl/template
index 8be16a230d8d..78b4d813a113 100644
--- a/srcpkgs/cross-i686-linux-musl/template
+++ b/srcpkgs/cross-i686-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-i686-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-i686-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 1deddfb04c33f0cd421d545f0ca790f73147d3e9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 24/37] cross-mips-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..6009e5c79eb2 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From fb9a72e870f894ad689bdeb0ae83e7e437b9be74 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 25/37] cross-mips-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..080164df193d 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="hipperson0 <hipperson0@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 9eba8b0de79902a1b219a7486069512701cbc780 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 26/37] cross-mipsel-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..f9fd4b8a04ef 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 694d40ba49f17d099902c3a1c09c8c8b0521209d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 27/37] cross-mipsel-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..7418a984474b 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 631747e5e22d36db982022e232804b84401773fb Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 28/37] cross-powerpc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..31e57b4e52b2 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 61994cf306e4163a9bf00d5235e70d66a41c6a33 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 29/37] cross-powerpc-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..a2d1edcf1ffd 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 6001890eeec13729bcc1b8762660cb4959a902d2 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 30/37] cross-powerpc64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..1a4cbed61e76 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From c9c81ddddf59a45df26eb122f5a3d55d11933314 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 31/37] cross-powerpc64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 016f18776a6d..19b1ff859eb6 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 8abbacd5c11cc1104573c33c516cae6cb46fce8b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 32/37] cross-powerpc64le-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 463d7e92d20d..9d99a3a315d2 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 163721616fdfbfd1a27f4de89f2c8980e123c564 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 33/37] cross-powerpc64le-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index c17a3cccfe29..3128baa7372e 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From ba32938c4cf4e2485464e2a30c413d6bdd628d77 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 34/37] cross-powerpcle-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 9aede3c465ce..6f914b3877ee 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 11602af9433fc3eff2543fdce985de90f98fe3f6 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 35/37] cross-powerpcle-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index 045cfda987fe..20e70bed4c60 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 2c77d6b99ee0d9642e51171ce3846d1e4fd1b9c1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 36/37] cross-x86_64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 8918f3c22a1c..5219cd50f851 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 98c73a3896b64e0024d446437f2d1231b38ca103 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 37/37] cross-x86_64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..2811de0d3c2e 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (149 preceding siblings ...)
  2022-10-03  2:51 ` oreo639
@ 2022-10-03  6:26 ` oreo639
  2022-10-03  6:32 ` oreo639
                   ` (113 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-10-03  6:26 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5092 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.2.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.2.0

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/38817
- [x] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [x] llvm https://github.com/void-linux/void-packages/pull/38694
- [x] m4 https://github.com/void-linux/void-packages/pull/33730
- [x] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [x] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [x] libvirt https://github.com/void-linux/void-packages/pull/38842
- [x] syslinux https://github.com/void-linux/void-packages/pull/38876
- [x] efivar https://github.com/void-linux/void-packages/pull/38874

Known packages that needed to be fixed/updated for gcc12:
- [ ] linux5.18 (in this PR)
- [x] openssh https://github.com/void-linux/void-packages/pull/38849
- [x] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [x] doxygen https://github.com/void-linux/void-packages/pull/38846
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/38817
- [x] libproxy https://github.com/void-linux/void-packages/pull/38818
- [x] exempi https://github.com/void-linux/void-packages/pull/38820
- [x] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [ ] gpgme https://github.com/void-linux/void-packages/pull/38825
- [x] libunique1 https://github.com/void-linux/void-packages/pull/38848 or https://github.com/void-linux/void-packages/pull/38873
- [x] libwpd https://github.com/void-linux/void-packages/pull/38878

Needs to be fixed/updated for binutils:
- [x] grub https://github.com/void-linux/void-packages/pull/38875
- [x] linux-tools https://github.com/void-linux/void-packages/pull/38877
- [x] kcov https://github.com/void-linux/void-packages/pull/39291

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [x] kde
- [x] lxde
- [x] lxqt

You can test the ISOs here:
https://drive.google.com/drive/folders/1ix92CYSLUP-KWjLxltdgG4e8Nu2JCY5n?usp=sharing

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 112635 bytes --]

From 7003dff6de12664babfe04fde809c45a286252b8 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 01/37] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../fix-libcollector-without-java.patch       | 53 +++++++++++++++
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 22 +++++--
 4 files changed, 86 insertions(+), 115 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
 create mode 100644 srcpkgs/binutils/patches/fix-libcollector-without-java.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/fix-libcollector-without-java.patch b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
new file mode 100644
index 000000000000..54384875f358
--- /dev/null
+++ b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
@@ -0,0 +1,53 @@
+From 49ddd814ac1071af7c4f45d5f8398b91862f2c7f Mon Sep 17 00:00:00 2001
+From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
+Date: Wed, 17 Aug 2022 19:55:23 -0700
+Subject: [PATCH] gprofng: fix bug 29479 Collection fails when built without
+ java support
+
+gprofng/ChangeLog
+2022-08-17  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>
+
+	PR gprofng/29479
+	* libcollector/collector.c: Add #if defined(GPROFNG_JAVA_PROFILING) for
+	java specific code.
+	* libcollector/unwind.c: Likewise.
+---
+ gprofng/libcollector/collector.c | 2 ++
+ gprofng/libcollector/unwind.c    | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/gprofng/libcollector/collector.c b/gprofng/libcollector/collector.c
+index 93c9d3330de5..ceff2c1caccb 100644
+--- a/gprofng/libcollector/collector.c
++++ b/gprofng/libcollector/collector.c
+@@ -913,8 +913,10 @@ __collector_open_experiment (const char *exp, const char *params, sp_origin_t or
+   __collector_ext_unwind_key_init (1, NULL);
+ 
+   /* start java attach if suitable */
++#if defined(GPROFNG_JAVA_PROFILING)
+   if (exp_origin == SP_ORIGIN_DBX_ATTACH)
+     __collector_jprofile_start_attach ();
++#endif
+   start_sec_time = CALL_UTIL (time)(NULL);
+   __collector_start_time = collector_interface.getHiResTime ();
+   TprintfT (DBG_LT0, "\t__collector_open_experiment; resetting start_time\n");
+diff --git a/gprofng/libcollector/unwind.c b/gprofng/libcollector/unwind.c
+index 119243788020..f8e11823c81e 100644
+--- a/gprofng/libcollector/unwind.c
++++ b/gprofng/libcollector/unwind.c
+@@ -557,6 +557,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+   int size = max_frame_size;
+ 
+ #define MIN(a,b) ((a)<(b)?(a):(b))
++#if defined(GPROFNG_JAVA_PROFILING)
+   /* get Java info */
+   if (__collector_java_mode && __collector_java_asyncgetcalltrace_loaded && context && !pseudo_context)
+     {
+@@ -569,6 +570,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+ 	  size -= sz;
+ 	}
+     }
++#endif
+ 
+   /* get native stack */
+   if (context)
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..79cd4e2b7c1f 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkgconf"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -44,6 +45,12 @@ do_configure() {
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	# gprofng currently only supports x86 and aarch64 glibc.
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64|i386|aarch64) conf+=" --enable-gprofng" ;;
+		*) conf+=" --disable-gprofng" ;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"
@@ -76,13 +83,15 @@ do_configure() {
 		--libdir=/usr/lib \
 		--mandir=/usr/share/man \
 		--infodir=/usr/share/info \
+		--sysconfdir=/etc \
 		--disable-werror \
-		--disable-shared \
 		--disable-nls \
+		--enable-shared \
 		--enable-threads \
 		--enable-plugins \
 		--enable-relro \
 		--enable-gold \
+		--enable-new-dtags \
 		--enable-deterministic-archives \
 		--enable-64-bit-bfd \
 		--enable-ld=default \
@@ -142,7 +151,8 @@ binutils-devel_package() {
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/*.a"
-		vmove "usr/lib/*.so"
+		vmove "usr/lib/libbfd.so"
+		vmove "usr/lib/libopcodes.so"
 	}
 }
 

From 734eb0b37f7c1ed1e76956cb48db773a436122ad Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 2 Oct 2022 16:46:59 -0700
Subject: [PATCH 02/37] gdb: resolve conflict with binutils 2.39

---
 srcpkgs/gdb/template | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/gdb/template b/srcpkgs/gdb/template
index ff7c9d9a5911..5970402eb27e 100644
--- a/srcpkgs/gdb/template
+++ b/srcpkgs/gdb/template
@@ -1,7 +1,7 @@
 # Template file for 'gdb'
 pkgname=gdb
 version=12.1
-revision=1
+revision=2
 build_style=gnu-configure
 pycompile_dirs="/usr/share/gdb/python"
 configure_args="--disable-werror --disable-nls --with-system-readline
@@ -48,7 +48,8 @@ vopt_conflict debuginfod static
 
 post_install() {
 	# resolve conflicts with binutils
-	rm -r ${DESTDIR}/usr/{include,lib,share/info/bfd.info*}
+	rm -rf ${DESTDIR}/usr/{include,lib}
+	rm -rf ${DESTDIR}/usr/share/info/{bfd,ctf-spec}.info*
 }
 
 gdb-common_package() {

From 4209f6bbc942f55cf1b83ec29d6f86d6ce2118fc Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 03/37] gcc: update to 12.2.0.

---
 common/shlibs                                 | 10 +--
 srcpkgs/gcc/files/gccgo-musl.patch            | 71 +++----------------
 srcpkgs/gcc/files/libgnarl-musl.patch         | 18 ++---
 srcpkgs/gcc/files/libssp-musl.patch           | 10 +--
 srcpkgs/gcc/patches/libffi_gnulinux.patch     | 11 ---
 .../gcc/patches/libgcc-ibm128-no-tag.patch    | 10 ++-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |  2 +-
 srcpkgs/gcc/template                          | 25 +++----
 8 files changed, 49 insertions(+), 108 deletions(-)
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index 3297091f7cc0..1441a3fa834a 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.2.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.36 perl-5.36.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -847,8 +847,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.2.0_1
+libgnat-12.so libada-12.2.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1697,8 +1697,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.2.0_1
+libasan.so.8 libsanitizer-12.2.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..12ec68dd8aa3 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,14 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ b/libgo/go/runtime/os_linux.go
+@@ -365,7 +365,7 @@ func setThreadCPUProfiler(hz int32) {
+ 	var sevp _sigevent
+ 	sevp.sigev_notify = _SIGEV_THREAD_ID
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.__sev_fields))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..446741390d45 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,15 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
+version=12.2.0
+revision=1
 _patchver="${version%pre*}"
 _minorver="${_patchver%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 wrksrc=gcc-${version/pre/_pre}
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +19,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -396,7 +393,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}

From ca3a2ea3cccedde09b1fb70a72740b20ca563bdc Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 04/37] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      | 11 ++++--
 2 files changed, 25 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..70c4aa533e66 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,12 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
+
+if [ "$XBPS_LIBC" == "musl" ]; then
+# Musl always searches LD_LIBRARY_PATH before RPATH and RUNPATH
+make_build_args="lt_cv_shlibpath_overrides_runpath=yes"
+fi
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From 881ff1cc74fffd1c5d7fb91ba8413ec75dc0bbd8 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 05/37] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 55255dceae8b..ca2d858a7abc 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From da6b3766eb204c8bcdad459bd8cc58e517077ea5 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 06/37] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 3 files changed, 55 insertions(+), 353 deletions(-)
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index 1441a3fa834a..8ebf2e2f9fd7 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From 66c9a109b2f7a388312511a99e8fb891942f86b0 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Wed, 14 Sep 2022 03:48:32 -0700
Subject: [PATCH 07/37] musl: add support for SIGEV_THREAD_ID timers

https://git.musl-libc.org/cgit/musl/commit/?id=7c71792e87691451f2a6b76348e83ad1889f1dcb
---
 ...d-support-for-SIGEV_THREAD_ID-timers.patch | 74 +++++++++++++++++++
 srcpkgs/musl/template                         |  2 +-
 2 files changed, 75 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch

diff --git a/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
new file mode 100644
index 000000000000..e20dff5ba0d4
--- /dev/null
+++ b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
@@ -0,0 +1,74 @@
+From 7c71792e87691451f2a6b76348e83ad1889f1dcb Mon Sep 17 00:00:00 2001
+From: James Y Knight <jyknight@google.com>
+Date: Sun, 30 Jun 2019 21:55:20 -0400
+Subject: [PATCH] add support for SIGEV_THREAD_ID timers
+
+This is like SIGEV_SIGNAL, but targeted to a particular thread's
+tid, rather than the process.
+---
+ include/signal.h        | 16 +++++++++++++---
+ src/time/timer_create.c |  8 ++++++--
+ 2 files changed, 19 insertions(+), 5 deletions(-)
+
+diff --git a/include/signal.h b/include/signal.h
+index fbdf667b2..9ed929e4f 100644
+--- a/include/signal.h
++++ b/include/signal.h
+@@ -180,14 +180,24 @@ struct sigevent {
+ 	union sigval sigev_value;
+ 	int sigev_signo;
+ 	int sigev_notify;
+-	void (*sigev_notify_function)(union sigval);
+-	pthread_attr_t *sigev_notify_attributes;
+-	char __pad[56-3*sizeof(long)];
++	union {
++		char __pad[64 - 2*sizeof(int) - sizeof(union sigval)];
++		pid_t sigev_notify_thread_id;
++		struct {
++			void (*sigev_notify_function)(union sigval);
++			pthread_attr_t *sigev_notify_attributes;
++		} __sev_thread;
++	} __sev_fields;
+ };
+ 
++#define sigev_notify_thread_id __sev_fields.sigev_notify_thread_id
++#define sigev_notify_function __sev_fields.__sev_thread.sigev_notify_function
++#define sigev_notify_attributes __sev_fields.__sev_thread.sigev_notify_attributes
++
+ #define SIGEV_SIGNAL 0
+ #define SIGEV_NONE 1
+ #define SIGEV_THREAD 2
++#define SIGEV_THREAD_ID 4
+ 
+ int __libc_current_sigrtmin(void);
+ int __libc_current_sigrtmax(void);
+diff --git a/src/time/timer_create.c b/src/time/timer_create.c
+index 5ddfda278..4bef23905 100644
+--- a/src/time/timer_create.c
++++ b/src/time/timer_create.c
+@@ -71,11 +71,15 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 	switch (evp ? evp->sigev_notify : SIGEV_SIGNAL) {
+ 	case SIGEV_NONE:
+ 	case SIGEV_SIGNAL:
++	case SIGEV_THREAD_ID:
+ 		if (evp) {
+ 			ksev.sigev_value = evp->sigev_value;
+ 			ksev.sigev_signo = evp->sigev_signo;
+ 			ksev.sigev_notify = evp->sigev_notify;
+-			ksev.sigev_tid = 0;
++			if (evp->sigev_notify == SIGEV_THREAD_ID)
++				ksev.sigev_tid = evp->sigev_notify_thread_id;
++			else
++				ksev.sigev_tid = 0;
+ 			ksevp = &ksev;
+ 		}
+ 		if (syscall(SYS_timer_create, clk, ksevp, &timerid) < 0)
+@@ -107,7 +111,7 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 
+ 		ksev.sigev_value.sival_ptr = 0;
+ 		ksev.sigev_signo = SIGTIMER;
+-		ksev.sigev_notify = 4; /* SIGEV_THREAD_ID */
++		ksev.sigev_notify = SIGEV_THREAD_ID;
+ 		ksev.sigev_tid = td->tid;
+ 		if (syscall(SYS_timer_create, clk, &ksev, &timerid) < 0)
+ 			timerid = -1;
diff --git a/srcpkgs/musl/template b/srcpkgs/musl/template
index 5bdc5c48e623..34e6ed4fba6e 100644
--- a/srcpkgs/musl/template
+++ b/srcpkgs/musl/template
@@ -2,7 +2,7 @@
 pkgname=musl
 reverts="1.2.0_1"
 version=1.1.24
-revision=10
+revision=11
 archs="*-musl"
 bootstrap=yes
 build_style=gnu-configure

From 422ff0073e3562313d26e23f90e30938f51e6afd Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 21:01:43 -0700
Subject: [PATCH 08/37] gcc-multilib: update to 12.2.0.

---
 srcpkgs/gcc-multilib/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index fcd25755aa75..1a26da26a991 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,16 +3,16 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _majorver="${version%.*}"
-wrksrc=gcc-${version/pre/_pre}
+wrksrc=gcc-${version}
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel

From 6e70514b069cacf89acb2dd2ddeb919c48164396 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 14 Aug 2022 19:29:36 -0700
Subject: [PATCH 09/37] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove -no-pie from build. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..5d40f0cdd8a6 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -53,6 +53,7 @@ _void_cross_build_binutils() {
 		--sbindir=/usr/bin \
 		--libdir=/usr/lib \
 		--libexecdir=/usr/lib \
+		--sysconfdir=/etc \
 		--target=${tgt} \
 		--with-sysroot=/usr/${tgt} \
 		--disable-nls \
@@ -60,7 +61,9 @@ _void_cross_build_binutils() {
 		--disable-multilib \
 		--disable-werror \
 		--disable-gold \
+		--disable-gprofng \
 		--enable-relro \
+		--enable-new-dtags \
 		--enable-plugins \
 		--enable-64-bit-bfd \
 		--enable-deterministic-archives \
@@ -132,6 +135,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -460,6 +464,14 @@ do_build() {
 	local binutils_ver linux_ver gcc_ver libc_ver libucontext_ver
 	local tgt=${sourcepkg/cross-}
 
+	export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}"
+	export CXXFLAGS="${CXXFLAGS/-D_FORTIFY_SOURCE=2/}"
+
+	# Disable explicit -fno-PIE, gcc/binutils/libc will figure this out itself.
+	export CFLAGS="${CFLAGS//-fno-PIE/}"
+	export CXXFLAGS="${CXXFLAGS//-fno-PIE/}"
+	export LDFLAGS="${LDFLAGS//-no-pie/}"
+
 	_void_cross_test_ver binutils
 	_void_cross_test_ver linux
 	_void_cross_test_ver gcc
@@ -625,6 +637,9 @@ do_install() {
 	# then remove it because it conflicts with libquadmath package
 	rm -rf ${DESTDIR}/${sysroot}/usr/lib/libquadmath.*
 
+	# Remove libdep linker plugin because it conflicts with system binutils
+	rm -f ${DESTDIR}/usr/lib/bfd-plugins/libdep*
+
 	# Remove leftover symlinks
 	rm -f ${DESTDIR}/usr/lib${XBPS_TARGET_WORDSIZE}
 	rm -f ${DESTDIR}/lib*

From e5e5fc973b51fd1188be8b30b54a4b3f09edaf35 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:09:31 -0700
Subject: [PATCH 10/37] linux5.18: update dotconfigs for gcc12

---
 srcpkgs/linux5.18/files/x86_64-dotconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/linux5.18/files/x86_64-dotconfig b/srcpkgs/linux5.18/files/x86_64-dotconfig
index 4e73a3195d40..ea6204868e23 100644
--- a/srcpkgs/linux5.18/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.18/files/x86_64-dotconfig
@@ -512,6 +512,7 @@ CONFIG_RETHUNK=y
 CONFIG_CPU_UNRET_ENTRY=y
 CONFIG_CPU_IBPB_ENTRY=y
 CONFIG_CPU_IBRS_ENTRY=y
+CONFIG_SLS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10060,8 +10061,11 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
 # Memory initialization
 #
 CONFIG_INIT_STACK_NONE=y
+# CONFIG_INIT_STACK_ALL_PATTERN is not set
+# CONFIG_INIT_STACK_ALL_ZERO is not set
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
+# CONFIG_ZERO_CALL_USED_REGS is not set
 # end of Memory initialization
 # end of Kernel hardening options
 # end of Security options
@@ -10538,6 +10542,7 @@ CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
 # CONFIG_UBSAN is not set
 CONFIG_HAVE_ARCH_KCSAN=y
+# CONFIG_KCSAN is not set
 # end of Generic Kernel Debugging Instruments
 
 #

From ff84cea6517f8255ee507a02b1da62066a468be4 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 14:45:28 -0700
Subject: [PATCH 11/37] libsasl: fix build for libtool 2.4.7

---
 srcpkgs/libsasl/template | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/libsasl/template b/srcpkgs/libsasl/template
index a8817042f843..a2993b39f4a1 100644
--- a/srcpkgs/libsasl/template
+++ b/srcpkgs/libsasl/template
@@ -19,6 +19,7 @@ distfiles="https://github.com/cyrusimap/cyrus-sasl/releases/download/cyrus-sasl-
 checksum=26866b1549b00ffd020f188a43c258017fa1c382b3ddadd8201536f72efb05d5
 
 pre_configure() {
+	rm -f m4/ltversion.m4
 	autoreconf -fi
 }
 

From 4a926ce861d0b777cb1c3324d4013872300dd3cb Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:08 -0700
Subject: [PATCH 12/37] subversion: fix build for libtool 2.4.7

---
 srcpkgs/subversion/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion/template b/srcpkgs/subversion/template
index 18c35e3a2132..4c32a6342c6a 100644
--- a/srcpkgs/subversion/template
+++ b/srcpkgs/subversion/template
@@ -59,7 +59,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From ac13599c9d0efc2af61ebd17b9dbb415708c1c6a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:38 -0700
Subject: [PATCH 13/37] subversion-kwallet-auth: fix build for libtool 2.4.7

---
 srcpkgs/subversion-kwallet-auth/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion-kwallet-auth/template b/srcpkgs/subversion-kwallet-auth/template
index 12210f250d51..b4d8621456ea 100644
--- a/srcpkgs/subversion-kwallet-auth/template
+++ b/srcpkgs/subversion-kwallet-auth/template
@@ -59,7 +59,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From e5c8bed4f04c2c6944d66f3758eb017e64ec8626 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 14/37] cross-aarch64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..bd6b23f9fb6a 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From f55526335f125d3cad84920e571e52829b655d4d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 15/37] cross-aarch64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..427ad2c1e9cd 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From a909a2d65680d6e5beae5e275c2eec24dd1f4fac Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 16/37] cross-arm-linux-gnueabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..2510ee26e789 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From d67f215552cd82f45e51b58fa10dfe8dab68bc1b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 17/37] cross-arm-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..bd8b16e1b4c1 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 85f06f16f0217bc007c2b0a3a139b4221dc3f3c2 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 18/37] cross-arm-linux-musleabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..dacfd2655216 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 8b498e4f3d83b5e634b0cbd26c4d91ba6d3fc60e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 19/37] cross-arm-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..9ddd32a9f20d 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From bf78b6d485be8f499a639f3a8e1376e4141a9248 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 20/37] cross-armv7l-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..9fb00f18be3b 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 9efd03eedbadac944c89f35b6aed82cf82a2aa7f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 21/37] cross-armv7l-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..2c72e75ddfe3 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 5972fb7a41fe36db99d4e70e900c26b18f94f990 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 22/37] cross-i686-pc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..4dc17df648b5 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 189eb2344072f43e7dcdeaabcc8e030e1faa8945 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Fri, 16 Sep 2022 20:52:19 -0700
Subject: [PATCH 23/37] cross-i686-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-linux-musl/template b/srcpkgs/cross-i686-linux-musl/template
index 8be16a230d8d..78b4d813a113 100644
--- a/srcpkgs/cross-i686-linux-musl/template
+++ b/srcpkgs/cross-i686-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-i686-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-i686-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 2cb6ca60eb4d4e896ff3792478a9ce1a0d255b50 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 24/37] cross-mips-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..6009e5c79eb2 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 63b5ffbdbd58ae72a006d16397e216acd87bc939 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 25/37] cross-mips-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..080164df193d 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="hipperson0 <hipperson0@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From f9df4b1d641c4ebc5d2edb307c6de3bba938e25b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 26/37] cross-mipsel-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..f9fd4b8a04ef 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From eab0cfecd41685ae8118839aea2ebb139b895501 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 27/37] cross-mipsel-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..7418a984474b 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From dceb7a8ebe1aeab0dc65163a4b94e78cb15a7e4d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 28/37] cross-powerpc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..31e57b4e52b2 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 1da2c9be142daef1ba7761d6100edc5cc5e8187f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 29/37] cross-powerpc-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..a2d1edcf1ffd 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From f084cb4afdc4b1073ccbe34171fb49d31c8014e3 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 30/37] cross-powerpc64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..1a4cbed61e76 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 6c34b002fbbb306a79e8a31c52ea72af536d8db1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 31/37] cross-powerpc64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 016f18776a6d..19b1ff859eb6 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From b93929f7f7787322721caaa495e74f0a22043d70 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 32/37] cross-powerpc64le-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 463d7e92d20d..9d99a3a315d2 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From cf2287c3c712e4fb79f5ddbe3f9b3ec8f5d7fc52 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 33/37] cross-powerpc64le-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index c17a3cccfe29..3128baa7372e 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From b61bbdaa2dba8d38c6b7ac4cc0d1f4d7491a60bd Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 34/37] cross-powerpcle-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 9aede3c465ce..6f914b3877ee 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From eec1e6d95008b9b79ff9ec00c38a5e1cb23e9313 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 35/37] cross-powerpcle-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index 045cfda987fe..20e70bed4c60 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 26f07356ab12cd06205f51e3ac6ad2d1417628bd Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 36/37] cross-x86_64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 8918f3c22a1c..5219cd50f851 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 2429088b10dfc8703dbbd8b681342c2082651992 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 37/37] cross-x86_64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..2811de0d3c2e 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (150 preceding siblings ...)
  2022-10-03  6:26 ` oreo639
@ 2022-10-03  6:32 ` oreo639
  2022-10-04  8:43 ` oreo639
                   ` (112 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-10-03  6:32 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5092 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.2.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.2.0

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/38817
- [x] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [x] llvm https://github.com/void-linux/void-packages/pull/38694
- [x] m4 https://github.com/void-linux/void-packages/pull/33730
- [x] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [x] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [x] libvirt https://github.com/void-linux/void-packages/pull/38842
- [x] syslinux https://github.com/void-linux/void-packages/pull/38876
- [x] efivar https://github.com/void-linux/void-packages/pull/38874

Known packages that needed to be fixed/updated for gcc12:
- [ ] linux5.18 (in this PR)
- [x] openssh https://github.com/void-linux/void-packages/pull/38849
- [x] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [x] doxygen https://github.com/void-linux/void-packages/pull/38846
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/38817
- [x] libproxy https://github.com/void-linux/void-packages/pull/38818
- [x] exempi https://github.com/void-linux/void-packages/pull/38820
- [x] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [ ] gpgme https://github.com/void-linux/void-packages/pull/38825
- [x] libunique1 https://github.com/void-linux/void-packages/pull/38848 or https://github.com/void-linux/void-packages/pull/38873
- [x] libwpd https://github.com/void-linux/void-packages/pull/38878

Needs to be fixed/updated for binutils:
- [x] grub https://github.com/void-linux/void-packages/pull/38875
- [x] linux-tools https://github.com/void-linux/void-packages/pull/38877
- [x] kcov https://github.com/void-linux/void-packages/pull/39291

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [x] kde
- [x] lxde
- [x] lxqt

You can test the ISOs here:
https://drive.google.com/drive/folders/1ix92CYSLUP-KWjLxltdgG4e8Nu2JCY5n?usp=sharing

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 112637 bytes --]

From 7003dff6de12664babfe04fde809c45a286252b8 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 01/37] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../fix-libcollector-without-java.patch       | 53 +++++++++++++++
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 22 +++++--
 4 files changed, 86 insertions(+), 115 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
 create mode 100644 srcpkgs/binutils/patches/fix-libcollector-without-java.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/fix-libcollector-without-java.patch b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
new file mode 100644
index 000000000000..54384875f358
--- /dev/null
+++ b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
@@ -0,0 +1,53 @@
+From 49ddd814ac1071af7c4f45d5f8398b91862f2c7f Mon Sep 17 00:00:00 2001
+From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
+Date: Wed, 17 Aug 2022 19:55:23 -0700
+Subject: [PATCH] gprofng: fix bug 29479 Collection fails when built without
+ java support
+
+gprofng/ChangeLog
+2022-08-17  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>
+
+	PR gprofng/29479
+	* libcollector/collector.c: Add #if defined(GPROFNG_JAVA_PROFILING) for
+	java specific code.
+	* libcollector/unwind.c: Likewise.
+---
+ gprofng/libcollector/collector.c | 2 ++
+ gprofng/libcollector/unwind.c    | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/gprofng/libcollector/collector.c b/gprofng/libcollector/collector.c
+index 93c9d3330de5..ceff2c1caccb 100644
+--- a/gprofng/libcollector/collector.c
++++ b/gprofng/libcollector/collector.c
+@@ -913,8 +913,10 @@ __collector_open_experiment (const char *exp, const char *params, sp_origin_t or
+   __collector_ext_unwind_key_init (1, NULL);
+ 
+   /* start java attach if suitable */
++#if defined(GPROFNG_JAVA_PROFILING)
+   if (exp_origin == SP_ORIGIN_DBX_ATTACH)
+     __collector_jprofile_start_attach ();
++#endif
+   start_sec_time = CALL_UTIL (time)(NULL);
+   __collector_start_time = collector_interface.getHiResTime ();
+   TprintfT (DBG_LT0, "\t__collector_open_experiment; resetting start_time\n");
+diff --git a/gprofng/libcollector/unwind.c b/gprofng/libcollector/unwind.c
+index 119243788020..f8e11823c81e 100644
+--- a/gprofng/libcollector/unwind.c
++++ b/gprofng/libcollector/unwind.c
+@@ -557,6 +557,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+   int size = max_frame_size;
+ 
+ #define MIN(a,b) ((a)<(b)?(a):(b))
++#if defined(GPROFNG_JAVA_PROFILING)
+   /* get Java info */
+   if (__collector_java_mode && __collector_java_asyncgetcalltrace_loaded && context && !pseudo_context)
+     {
+@@ -569,6 +570,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+ 	  size -= sz;
+ 	}
+     }
++#endif
+ 
+   /* get native stack */
+   if (context)
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..79cd4e2b7c1f 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkgconf"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -44,6 +45,12 @@ do_configure() {
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	# gprofng currently only supports x86 and aarch64 glibc.
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64|i386|aarch64) conf+=" --enable-gprofng" ;;
+		*) conf+=" --disable-gprofng" ;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"
@@ -76,13 +83,15 @@ do_configure() {
 		--libdir=/usr/lib \
 		--mandir=/usr/share/man \
 		--infodir=/usr/share/info \
+		--sysconfdir=/etc \
 		--disable-werror \
-		--disable-shared \
 		--disable-nls \
+		--enable-shared \
 		--enable-threads \
 		--enable-plugins \
 		--enable-relro \
 		--enable-gold \
+		--enable-new-dtags \
 		--enable-deterministic-archives \
 		--enable-64-bit-bfd \
 		--enable-ld=default \
@@ -142,7 +151,8 @@ binutils-devel_package() {
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/*.a"
-		vmove "usr/lib/*.so"
+		vmove "usr/lib/libbfd.so"
+		vmove "usr/lib/libopcodes.so"
 	}
 }
 

From 734eb0b37f7c1ed1e76956cb48db773a436122ad Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 2 Oct 2022 16:46:59 -0700
Subject: [PATCH 02/37] gdb: resolve conflict with binutils 2.39

---
 srcpkgs/gdb/template | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/gdb/template b/srcpkgs/gdb/template
index ff7c9d9a5911..5970402eb27e 100644
--- a/srcpkgs/gdb/template
+++ b/srcpkgs/gdb/template
@@ -1,7 +1,7 @@
 # Template file for 'gdb'
 pkgname=gdb
 version=12.1
-revision=1
+revision=2
 build_style=gnu-configure
 pycompile_dirs="/usr/share/gdb/python"
 configure_args="--disable-werror --disable-nls --with-system-readline
@@ -48,7 +48,8 @@ vopt_conflict debuginfod static
 
 post_install() {
 	# resolve conflicts with binutils
-	rm -r ${DESTDIR}/usr/{include,lib,share/info/bfd.info*}
+	rm -rf ${DESTDIR}/usr/{include,lib}
+	rm -rf ${DESTDIR}/usr/share/info/{bfd,ctf-spec}.info*
 }
 
 gdb-common_package() {

From 4209f6bbc942f55cf1b83ec29d6f86d6ce2118fc Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 03/37] gcc: update to 12.2.0.

---
 common/shlibs                                 | 10 +--
 srcpkgs/gcc/files/gccgo-musl.patch            | 71 +++----------------
 srcpkgs/gcc/files/libgnarl-musl.patch         | 18 ++---
 srcpkgs/gcc/files/libssp-musl.patch           | 10 +--
 srcpkgs/gcc/patches/libffi_gnulinux.patch     | 11 ---
 .../gcc/patches/libgcc-ibm128-no-tag.patch    | 10 ++-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |  2 +-
 srcpkgs/gcc/template                          | 25 +++----
 8 files changed, 49 insertions(+), 108 deletions(-)
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index 3297091f7cc0..1441a3fa834a 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.2.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.36 perl-5.36.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -847,8 +847,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.2.0_1
+libgnat-12.so libada-12.2.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1697,8 +1697,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.2.0_1
+libasan.so.8 libsanitizer-12.2.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..12ec68dd8aa3 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,14 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ b/libgo/go/runtime/os_linux.go
+@@ -365,7 +365,7 @@ func setThreadCPUProfiler(hz int32) {
+ 	var sevp _sigevent
+ 	sevp.sigev_notify = _SIGEV_THREAD_ID
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.__sev_fields))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..446741390d45 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,15 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
+version=12.2.0
+revision=1
 _patchver="${version%pre*}"
 _minorver="${_patchver%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 wrksrc=gcc-${version/pre/_pre}
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +19,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -396,7 +393,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}

From 1d58346f2e46683a8cc3dc008934237198edaaa5 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 04/37] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      | 11 ++++--
 2 files changed, 25 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..51611929d643 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,12 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
+
+if [ "$XBPS_LIBC" == "musl" ]; then
+	# Musl always searches LD_LIBRARY_PATH before RPATH and RUNPATH
+	make_build_args="lt_cv_shlibpath_overrides_runpath=yes"
+fi
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From 95413d4a9ef100d4d0030de8f8c0f972193e51af Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 05/37] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 55255dceae8b..ca2d858a7abc 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From 4b4b8936ae9bf57f641dfe7f3f3fbd7283a13565 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 06/37] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 3 files changed, 55 insertions(+), 353 deletions(-)
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index 1441a3fa834a..8ebf2e2f9fd7 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From b9f1e67cbdcd9e28939ab286002a8016226db442 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Wed, 14 Sep 2022 03:48:32 -0700
Subject: [PATCH 07/37] musl: add support for SIGEV_THREAD_ID timers

https://git.musl-libc.org/cgit/musl/commit/?id=7c71792e87691451f2a6b76348e83ad1889f1dcb
---
 ...d-support-for-SIGEV_THREAD_ID-timers.patch | 74 +++++++++++++++++++
 srcpkgs/musl/template                         |  2 +-
 2 files changed, 75 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch

diff --git a/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
new file mode 100644
index 000000000000..e20dff5ba0d4
--- /dev/null
+++ b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
@@ -0,0 +1,74 @@
+From 7c71792e87691451f2a6b76348e83ad1889f1dcb Mon Sep 17 00:00:00 2001
+From: James Y Knight <jyknight@google.com>
+Date: Sun, 30 Jun 2019 21:55:20 -0400
+Subject: [PATCH] add support for SIGEV_THREAD_ID timers
+
+This is like SIGEV_SIGNAL, but targeted to a particular thread's
+tid, rather than the process.
+---
+ include/signal.h        | 16 +++++++++++++---
+ src/time/timer_create.c |  8 ++++++--
+ 2 files changed, 19 insertions(+), 5 deletions(-)
+
+diff --git a/include/signal.h b/include/signal.h
+index fbdf667b2..9ed929e4f 100644
+--- a/include/signal.h
++++ b/include/signal.h
+@@ -180,14 +180,24 @@ struct sigevent {
+ 	union sigval sigev_value;
+ 	int sigev_signo;
+ 	int sigev_notify;
+-	void (*sigev_notify_function)(union sigval);
+-	pthread_attr_t *sigev_notify_attributes;
+-	char __pad[56-3*sizeof(long)];
++	union {
++		char __pad[64 - 2*sizeof(int) - sizeof(union sigval)];
++		pid_t sigev_notify_thread_id;
++		struct {
++			void (*sigev_notify_function)(union sigval);
++			pthread_attr_t *sigev_notify_attributes;
++		} __sev_thread;
++	} __sev_fields;
+ };
+ 
++#define sigev_notify_thread_id __sev_fields.sigev_notify_thread_id
++#define sigev_notify_function __sev_fields.__sev_thread.sigev_notify_function
++#define sigev_notify_attributes __sev_fields.__sev_thread.sigev_notify_attributes
++
+ #define SIGEV_SIGNAL 0
+ #define SIGEV_NONE 1
+ #define SIGEV_THREAD 2
++#define SIGEV_THREAD_ID 4
+ 
+ int __libc_current_sigrtmin(void);
+ int __libc_current_sigrtmax(void);
+diff --git a/src/time/timer_create.c b/src/time/timer_create.c
+index 5ddfda278..4bef23905 100644
+--- a/src/time/timer_create.c
++++ b/src/time/timer_create.c
+@@ -71,11 +71,15 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 	switch (evp ? evp->sigev_notify : SIGEV_SIGNAL) {
+ 	case SIGEV_NONE:
+ 	case SIGEV_SIGNAL:
++	case SIGEV_THREAD_ID:
+ 		if (evp) {
+ 			ksev.sigev_value = evp->sigev_value;
+ 			ksev.sigev_signo = evp->sigev_signo;
+ 			ksev.sigev_notify = evp->sigev_notify;
+-			ksev.sigev_tid = 0;
++			if (evp->sigev_notify == SIGEV_THREAD_ID)
++				ksev.sigev_tid = evp->sigev_notify_thread_id;
++			else
++				ksev.sigev_tid = 0;
+ 			ksevp = &ksev;
+ 		}
+ 		if (syscall(SYS_timer_create, clk, ksevp, &timerid) < 0)
+@@ -107,7 +111,7 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 
+ 		ksev.sigev_value.sival_ptr = 0;
+ 		ksev.sigev_signo = SIGTIMER;
+-		ksev.sigev_notify = 4; /* SIGEV_THREAD_ID */
++		ksev.sigev_notify = SIGEV_THREAD_ID;
+ 		ksev.sigev_tid = td->tid;
+ 		if (syscall(SYS_timer_create, clk, &ksev, &timerid) < 0)
+ 			timerid = -1;
diff --git a/srcpkgs/musl/template b/srcpkgs/musl/template
index 5bdc5c48e623..34e6ed4fba6e 100644
--- a/srcpkgs/musl/template
+++ b/srcpkgs/musl/template
@@ -2,7 +2,7 @@
 pkgname=musl
 reverts="1.2.0_1"
 version=1.1.24
-revision=10
+revision=11
 archs="*-musl"
 bootstrap=yes
 build_style=gnu-configure

From b62505b9919c1af55f22c1dca678c37ef5643b20 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 21:01:43 -0700
Subject: [PATCH 08/37] gcc-multilib: update to 12.2.0.

---
 srcpkgs/gcc-multilib/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index fcd25755aa75..1a26da26a991 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,16 +3,16 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _majorver="${version%.*}"
-wrksrc=gcc-${version/pre/_pre}
+wrksrc=gcc-${version}
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel

From b7c027ab92342b496a5007c4c5129f89db20957a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 14 Aug 2022 19:29:36 -0700
Subject: [PATCH 09/37] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove -no-pie from build. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..5d40f0cdd8a6 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -53,6 +53,7 @@ _void_cross_build_binutils() {
 		--sbindir=/usr/bin \
 		--libdir=/usr/lib \
 		--libexecdir=/usr/lib \
+		--sysconfdir=/etc \
 		--target=${tgt} \
 		--with-sysroot=/usr/${tgt} \
 		--disable-nls \
@@ -60,7 +61,9 @@ _void_cross_build_binutils() {
 		--disable-multilib \
 		--disable-werror \
 		--disable-gold \
+		--disable-gprofng \
 		--enable-relro \
+		--enable-new-dtags \
 		--enable-plugins \
 		--enable-64-bit-bfd \
 		--enable-deterministic-archives \
@@ -132,6 +135,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -460,6 +464,14 @@ do_build() {
 	local binutils_ver linux_ver gcc_ver libc_ver libucontext_ver
 	local tgt=${sourcepkg/cross-}
 
+	export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}"
+	export CXXFLAGS="${CXXFLAGS/-D_FORTIFY_SOURCE=2/}"
+
+	# Disable explicit -fno-PIE, gcc/binutils/libc will figure this out itself.
+	export CFLAGS="${CFLAGS//-fno-PIE/}"
+	export CXXFLAGS="${CXXFLAGS//-fno-PIE/}"
+	export LDFLAGS="${LDFLAGS//-no-pie/}"
+
 	_void_cross_test_ver binutils
 	_void_cross_test_ver linux
 	_void_cross_test_ver gcc
@@ -625,6 +637,9 @@ do_install() {
 	# then remove it because it conflicts with libquadmath package
 	rm -rf ${DESTDIR}/${sysroot}/usr/lib/libquadmath.*
 
+	# Remove libdep linker plugin because it conflicts with system binutils
+	rm -f ${DESTDIR}/usr/lib/bfd-plugins/libdep*
+
 	# Remove leftover symlinks
 	rm -f ${DESTDIR}/usr/lib${XBPS_TARGET_WORDSIZE}
 	rm -f ${DESTDIR}/lib*

From 6eeae2a84bb8af37059575f040a4bd3b0ee5c78d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:09:31 -0700
Subject: [PATCH 10/37] linux5.18: update dotconfigs for gcc12

---
 srcpkgs/linux5.18/files/x86_64-dotconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/linux5.18/files/x86_64-dotconfig b/srcpkgs/linux5.18/files/x86_64-dotconfig
index 4e73a3195d40..ea6204868e23 100644
--- a/srcpkgs/linux5.18/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.18/files/x86_64-dotconfig
@@ -512,6 +512,7 @@ CONFIG_RETHUNK=y
 CONFIG_CPU_UNRET_ENTRY=y
 CONFIG_CPU_IBPB_ENTRY=y
 CONFIG_CPU_IBRS_ENTRY=y
+CONFIG_SLS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10060,8 +10061,11 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
 # Memory initialization
 #
 CONFIG_INIT_STACK_NONE=y
+# CONFIG_INIT_STACK_ALL_PATTERN is not set
+# CONFIG_INIT_STACK_ALL_ZERO is not set
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
+# CONFIG_ZERO_CALL_USED_REGS is not set
 # end of Memory initialization
 # end of Kernel hardening options
 # end of Security options
@@ -10538,6 +10542,7 @@ CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
 # CONFIG_UBSAN is not set
 CONFIG_HAVE_ARCH_KCSAN=y
+# CONFIG_KCSAN is not set
 # end of Generic Kernel Debugging Instruments
 
 #

From 8c9dacd88aa261a7de044adb93d6f9c868aed34d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 14:45:28 -0700
Subject: [PATCH 11/37] libsasl: fix build for libtool 2.4.7

---
 srcpkgs/libsasl/template | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/libsasl/template b/srcpkgs/libsasl/template
index a8817042f843..a2993b39f4a1 100644
--- a/srcpkgs/libsasl/template
+++ b/srcpkgs/libsasl/template
@@ -19,6 +19,7 @@ distfiles="https://github.com/cyrusimap/cyrus-sasl/releases/download/cyrus-sasl-
 checksum=26866b1549b00ffd020f188a43c258017fa1c382b3ddadd8201536f72efb05d5
 
 pre_configure() {
+	rm -f m4/ltversion.m4
 	autoreconf -fi
 }
 

From 22237437af2d9bbe9169123c460baf5faf028ec0 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:08 -0700
Subject: [PATCH 12/37] subversion: fix build for libtool 2.4.7

---
 srcpkgs/subversion/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion/template b/srcpkgs/subversion/template
index 18c35e3a2132..4c32a6342c6a 100644
--- a/srcpkgs/subversion/template
+++ b/srcpkgs/subversion/template
@@ -59,7 +59,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From 022b15d7645f944b632073ddd7c1b60504a6a362 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:38 -0700
Subject: [PATCH 13/37] subversion-kwallet-auth: fix build for libtool 2.4.7

---
 srcpkgs/subversion-kwallet-auth/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion-kwallet-auth/template b/srcpkgs/subversion-kwallet-auth/template
index 12210f250d51..b4d8621456ea 100644
--- a/srcpkgs/subversion-kwallet-auth/template
+++ b/srcpkgs/subversion-kwallet-auth/template
@@ -59,7 +59,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From 6adc5b01a2a9dc535c5a4199c1fa209f578b06c0 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 14/37] cross-aarch64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..bd6b23f9fb6a 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 0f2a4ad469df64f1c8bddd177051ef7f98b6a442 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 15/37] cross-aarch64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..427ad2c1e9cd 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From e6ae600243643ca9e598f15a209129b85cd3524a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 16/37] cross-arm-linux-gnueabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..2510ee26e789 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From d3a7ff6aa63c40e5e4485464a2e8f42ffae7ecb8 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 17/37] cross-arm-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..bd8b16e1b4c1 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 0d6582b841964e289f8acc194b404afc07cacf38 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 18/37] cross-arm-linux-musleabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..dacfd2655216 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 0e09582fdca7c17d63b7772dec343ab63971a80e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 19/37] cross-arm-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..9ddd32a9f20d 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 028c49c7544b1b9c9b22195788251d7589373351 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 20/37] cross-armv7l-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..9fb00f18be3b 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 42d15b715362138bc58543ebdec4017378e99be2 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 21/37] cross-armv7l-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..2c72e75ddfe3 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 1d31c290287e43e2957706280f0ebff0c2f31594 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 22/37] cross-i686-pc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..4dc17df648b5 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From f4a52dc3e697cd11987f074748d3755fbbf1429e Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Fri, 16 Sep 2022 20:52:19 -0700
Subject: [PATCH 23/37] cross-i686-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-linux-musl/template b/srcpkgs/cross-i686-linux-musl/template
index 8be16a230d8d..78b4d813a113 100644
--- a/srcpkgs/cross-i686-linux-musl/template
+++ b/srcpkgs/cross-i686-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-i686-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-i686-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From fdca42458412ec3e4abad117293cb48e621bf749 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 24/37] cross-mips-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..6009e5c79eb2 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From de101aebfc00287e5720d95c9c675a9d74f81b99 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 25/37] cross-mips-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..080164df193d 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="hipperson0 <hipperson0@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From c81dac2b5e53367b2cde09efb2cb2fcb5eb97088 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 26/37] cross-mipsel-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..f9fd4b8a04ef 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From de314d2a8c6f40147f36bb81270d7844bc3adf46 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 27/37] cross-mipsel-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..7418a984474b 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From b48a2cadc0777212fd5c3e16425955f47ad09278 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 28/37] cross-powerpc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..31e57b4e52b2 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 5b068a14a94dbf51c619da805cb5fa82a483236d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 29/37] cross-powerpc-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..a2d1edcf1ffd 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 4ae524ae8e1301d3907eab87c9b53a47b64204d9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 30/37] cross-powerpc64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..1a4cbed61e76 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From e1093b147f7c2ff120541ba44bfa7bdf0bb18c9e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 31/37] cross-powerpc64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 016f18776a6d..19b1ff859eb6 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 33924b31cfd5b670bd9c96fd126077d2643763d3 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 32/37] cross-powerpc64le-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 463d7e92d20d..9d99a3a315d2 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From b046ebf9a4ac152541a8cf1f8058f7d2437902fe Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 33/37] cross-powerpc64le-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index c17a3cccfe29..3128baa7372e 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From a7603b86f2bbccdd1703e33728c169ef4688e4a0 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 34/37] cross-powerpcle-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 9aede3c465ce..6f914b3877ee 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From b74eb90c64a906ebc43b09cbcfd180f840ad2a51 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 35/37] cross-powerpcle-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index 045cfda987fe..20e70bed4c60 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From b21bb6951ddd125e607deec96f1479bc545d606c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 36/37] cross-x86_64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 8918f3c22a1c..5219cd50f851 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From d58918226fa6e695431073b0a7f63c3315e4ad57 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 37/37] cross-x86_64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..2811de0d3c2e 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (151 preceding siblings ...)
  2022-10-03  6:32 ` oreo639
@ 2022-10-04  8:43 ` oreo639
  2022-10-04 10:54 ` oreo639
                   ` (111 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-10-04  8:43 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5256 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.2.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.2.0

Saved for future reference: paper has a list of failing builds here (some may be already fixed or may be unrelated to this PR): https://vasilek.cz/logs/lab/bad/

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [x] llvm https://github.com/void-linux/void-packages/pull/38694
- [x] m4 https://github.com/void-linux/void-packages/pull/33730
- [x] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [x] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [x] libvirt https://github.com/void-linux/void-packages/pull/38842
- [x] syslinux https://github.com/void-linux/void-packages/pull/38876
- [x] efivar https://github.com/void-linux/void-packages/pull/38874

Known packages that needed to be fixed/updated for gcc12:
- [ ] linux5.18 (in this PR)
- [x] openssh https://github.com/void-linux/void-packages/pull/38849
- [x] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [x] doxygen https://github.com/void-linux/void-packages/pull/38846
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] libproxy https://github.com/void-linux/void-packages/pull/38818
- [x] exempi https://github.com/void-linux/void-packages/pull/38820
- [x] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [ ] gpgme https://github.com/void-linux/void-packages/pull/38825
- [x] libunique1 https://github.com/void-linux/void-packages/pull/38848 or https://github.com/void-linux/void-packages/pull/38873
- [x] libwpd https://github.com/void-linux/void-packages/pull/38878

Needs to be fixed/updated for binutils:
- [x] grub https://github.com/void-linux/void-packages/pull/38875
- [x] linux-tools https://github.com/void-linux/void-packages/pull/38877
- [x] kcov https://github.com/void-linux/void-packages/pull/39291

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [x] kde
- [x] lxde
- [x] lxqt

You can test the ISOs here:
https://drive.google.com/drive/folders/1ix92CYSLUP-KWjLxltdgG4e8Nu2JCY5n?usp=sharing

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 112637 bytes --]

From 5a4f5f730a9c9663609668f7a733ae2918d02fcf Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 01/37] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../fix-libcollector-without-java.patch       | 53 +++++++++++++++
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 22 +++++--
 4 files changed, 86 insertions(+), 115 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
 create mode 100644 srcpkgs/binutils/patches/fix-libcollector-without-java.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/fix-libcollector-without-java.patch b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
new file mode 100644
index 000000000000..54384875f358
--- /dev/null
+++ b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
@@ -0,0 +1,53 @@
+From 49ddd814ac1071af7c4f45d5f8398b91862f2c7f Mon Sep 17 00:00:00 2001
+From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
+Date: Wed, 17 Aug 2022 19:55:23 -0700
+Subject: [PATCH] gprofng: fix bug 29479 Collection fails when built without
+ java support
+
+gprofng/ChangeLog
+2022-08-17  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>
+
+	PR gprofng/29479
+	* libcollector/collector.c: Add #if defined(GPROFNG_JAVA_PROFILING) for
+	java specific code.
+	* libcollector/unwind.c: Likewise.
+---
+ gprofng/libcollector/collector.c | 2 ++
+ gprofng/libcollector/unwind.c    | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/gprofng/libcollector/collector.c b/gprofng/libcollector/collector.c
+index 93c9d3330de5..ceff2c1caccb 100644
+--- a/gprofng/libcollector/collector.c
++++ b/gprofng/libcollector/collector.c
+@@ -913,8 +913,10 @@ __collector_open_experiment (const char *exp, const char *params, sp_origin_t or
+   __collector_ext_unwind_key_init (1, NULL);
+ 
+   /* start java attach if suitable */
++#if defined(GPROFNG_JAVA_PROFILING)
+   if (exp_origin == SP_ORIGIN_DBX_ATTACH)
+     __collector_jprofile_start_attach ();
++#endif
+   start_sec_time = CALL_UTIL (time)(NULL);
+   __collector_start_time = collector_interface.getHiResTime ();
+   TprintfT (DBG_LT0, "\t__collector_open_experiment; resetting start_time\n");
+diff --git a/gprofng/libcollector/unwind.c b/gprofng/libcollector/unwind.c
+index 119243788020..f8e11823c81e 100644
+--- a/gprofng/libcollector/unwind.c
++++ b/gprofng/libcollector/unwind.c
+@@ -557,6 +557,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+   int size = max_frame_size;
+ 
+ #define MIN(a,b) ((a)<(b)?(a):(b))
++#if defined(GPROFNG_JAVA_PROFILING)
+   /* get Java info */
+   if (__collector_java_mode && __collector_java_asyncgetcalltrace_loaded && context && !pseudo_context)
+     {
+@@ -569,6 +570,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+ 	  size -= sz;
+ 	}
+     }
++#endif
+ 
+   /* get native stack */
+   if (context)
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..79cd4e2b7c1f 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkgconf"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -44,6 +45,12 @@ do_configure() {
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	# gprofng currently only supports x86 and aarch64 glibc.
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64|i386|aarch64) conf+=" --enable-gprofng" ;;
+		*) conf+=" --disable-gprofng" ;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"
@@ -76,13 +83,15 @@ do_configure() {
 		--libdir=/usr/lib \
 		--mandir=/usr/share/man \
 		--infodir=/usr/share/info \
+		--sysconfdir=/etc \
 		--disable-werror \
-		--disable-shared \
 		--disable-nls \
+		--enable-shared \
 		--enable-threads \
 		--enable-plugins \
 		--enable-relro \
 		--enable-gold \
+		--enable-new-dtags \
 		--enable-deterministic-archives \
 		--enable-64-bit-bfd \
 		--enable-ld=default \
@@ -142,7 +151,8 @@ binutils-devel_package() {
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/*.a"
-		vmove "usr/lib/*.so"
+		vmove "usr/lib/libbfd.so"
+		vmove "usr/lib/libopcodes.so"
 	}
 }
 

From 701f248a0be8ddc09f1d583e57ca211f98f03163 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 2 Oct 2022 16:46:59 -0700
Subject: [PATCH 02/37] gdb: resolve conflict with binutils 2.39

---
 srcpkgs/gdb/template | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/gdb/template b/srcpkgs/gdb/template
index ff7c9d9a5911..5970402eb27e 100644
--- a/srcpkgs/gdb/template
+++ b/srcpkgs/gdb/template
@@ -1,7 +1,7 @@
 # Template file for 'gdb'
 pkgname=gdb
 version=12.1
-revision=1
+revision=2
 build_style=gnu-configure
 pycompile_dirs="/usr/share/gdb/python"
 configure_args="--disable-werror --disable-nls --with-system-readline
@@ -48,7 +48,8 @@ vopt_conflict debuginfod static
 
 post_install() {
 	# resolve conflicts with binutils
-	rm -r ${DESTDIR}/usr/{include,lib,share/info/bfd.info*}
+	rm -rf ${DESTDIR}/usr/{include,lib}
+	rm -rf ${DESTDIR}/usr/share/info/{bfd,ctf-spec}.info*
 }
 
 gdb-common_package() {

From 404887b3f5cee348753a61f7e291536d2fcb5ad5 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 03/37] gcc: update to 12.2.0.

---
 common/shlibs                                 | 10 +--
 srcpkgs/gcc/files/gccgo-musl.patch            | 71 +++----------------
 srcpkgs/gcc/files/libgnarl-musl.patch         | 18 ++---
 srcpkgs/gcc/files/libssp-musl.patch           | 10 +--
 srcpkgs/gcc/patches/libffi_gnulinux.patch     | 11 ---
 .../gcc/patches/libgcc-ibm128-no-tag.patch    | 10 ++-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |  2 +-
 srcpkgs/gcc/template                          | 25 +++----
 8 files changed, 49 insertions(+), 108 deletions(-)
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index 5d4b0a9899ad..dac3556fb949 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.2.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.36 perl-5.36.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -847,8 +847,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.2.0_1
+libgnat-12.so libada-12.2.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1697,8 +1697,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.2.0_1
+libasan.so.8 libsanitizer-12.2.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..12ec68dd8aa3 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,14 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ b/libgo/go/runtime/os_linux.go
+@@ -365,7 +365,7 @@ func setThreadCPUProfiler(hz int32) {
+ 	var sevp _sigevent
+ 	sevp.sigev_notify = _SIGEV_THREAD_ID
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.__sev_fields))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..446741390d45 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,15 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
+version=12.2.0
+revision=1
 _patchver="${version%pre*}"
 _minorver="${_patchver%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 wrksrc=gcc-${version/pre/_pre}
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +19,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -396,7 +393,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}

From 24a908dbed45ecf60871c25aa00966a47c1ffa7b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 04/37] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      | 11 ++++--
 2 files changed, 25 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..51611929d643 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,12 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
+
+if [ "$XBPS_LIBC" == "musl" ]; then
+	# Musl always searches LD_LIBRARY_PATH before RPATH and RUNPATH
+	make_build_args="lt_cv_shlibpath_overrides_runpath=yes"
+fi
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From 1e5f3d30238236e1b9d656341ca5438b1c072ca6 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 05/37] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 55255dceae8b..ca2d858a7abc 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From a3a22d6e81ddfe521a51f0de9846c05d21809b8b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 06/37] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 3 files changed, 55 insertions(+), 353 deletions(-)
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index dac3556fb949..bf246b638dae 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From 8514dc9552652e5523406bdb58a4c2d769d0fc7d Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Wed, 14 Sep 2022 03:48:32 -0700
Subject: [PATCH 07/37] musl: add support for SIGEV_THREAD_ID timers

https://git.musl-libc.org/cgit/musl/commit/?id=7c71792e87691451f2a6b76348e83ad1889f1dcb
---
 ...d-support-for-SIGEV_THREAD_ID-timers.patch | 74 +++++++++++++++++++
 srcpkgs/musl/template                         |  2 +-
 2 files changed, 75 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch

diff --git a/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
new file mode 100644
index 000000000000..e20dff5ba0d4
--- /dev/null
+++ b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
@@ -0,0 +1,74 @@
+From 7c71792e87691451f2a6b76348e83ad1889f1dcb Mon Sep 17 00:00:00 2001
+From: James Y Knight <jyknight@google.com>
+Date: Sun, 30 Jun 2019 21:55:20 -0400
+Subject: [PATCH] add support for SIGEV_THREAD_ID timers
+
+This is like SIGEV_SIGNAL, but targeted to a particular thread's
+tid, rather than the process.
+---
+ include/signal.h        | 16 +++++++++++++---
+ src/time/timer_create.c |  8 ++++++--
+ 2 files changed, 19 insertions(+), 5 deletions(-)
+
+diff --git a/include/signal.h b/include/signal.h
+index fbdf667b2..9ed929e4f 100644
+--- a/include/signal.h
++++ b/include/signal.h
+@@ -180,14 +180,24 @@ struct sigevent {
+ 	union sigval sigev_value;
+ 	int sigev_signo;
+ 	int sigev_notify;
+-	void (*sigev_notify_function)(union sigval);
+-	pthread_attr_t *sigev_notify_attributes;
+-	char __pad[56-3*sizeof(long)];
++	union {
++		char __pad[64 - 2*sizeof(int) - sizeof(union sigval)];
++		pid_t sigev_notify_thread_id;
++		struct {
++			void (*sigev_notify_function)(union sigval);
++			pthread_attr_t *sigev_notify_attributes;
++		} __sev_thread;
++	} __sev_fields;
+ };
+ 
++#define sigev_notify_thread_id __sev_fields.sigev_notify_thread_id
++#define sigev_notify_function __sev_fields.__sev_thread.sigev_notify_function
++#define sigev_notify_attributes __sev_fields.__sev_thread.sigev_notify_attributes
++
+ #define SIGEV_SIGNAL 0
+ #define SIGEV_NONE 1
+ #define SIGEV_THREAD 2
++#define SIGEV_THREAD_ID 4
+ 
+ int __libc_current_sigrtmin(void);
+ int __libc_current_sigrtmax(void);
+diff --git a/src/time/timer_create.c b/src/time/timer_create.c
+index 5ddfda278..4bef23905 100644
+--- a/src/time/timer_create.c
++++ b/src/time/timer_create.c
+@@ -71,11 +71,15 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 	switch (evp ? evp->sigev_notify : SIGEV_SIGNAL) {
+ 	case SIGEV_NONE:
+ 	case SIGEV_SIGNAL:
++	case SIGEV_THREAD_ID:
+ 		if (evp) {
+ 			ksev.sigev_value = evp->sigev_value;
+ 			ksev.sigev_signo = evp->sigev_signo;
+ 			ksev.sigev_notify = evp->sigev_notify;
+-			ksev.sigev_tid = 0;
++			if (evp->sigev_notify == SIGEV_THREAD_ID)
++				ksev.sigev_tid = evp->sigev_notify_thread_id;
++			else
++				ksev.sigev_tid = 0;
+ 			ksevp = &ksev;
+ 		}
+ 		if (syscall(SYS_timer_create, clk, ksevp, &timerid) < 0)
+@@ -107,7 +111,7 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 
+ 		ksev.sigev_value.sival_ptr = 0;
+ 		ksev.sigev_signo = SIGTIMER;
+-		ksev.sigev_notify = 4; /* SIGEV_THREAD_ID */
++		ksev.sigev_notify = SIGEV_THREAD_ID;
+ 		ksev.sigev_tid = td->tid;
+ 		if (syscall(SYS_timer_create, clk, &ksev, &timerid) < 0)
+ 			timerid = -1;
diff --git a/srcpkgs/musl/template b/srcpkgs/musl/template
index 5bdc5c48e623..34e6ed4fba6e 100644
--- a/srcpkgs/musl/template
+++ b/srcpkgs/musl/template
@@ -2,7 +2,7 @@
 pkgname=musl
 reverts="1.2.0_1"
 version=1.1.24
-revision=10
+revision=11
 archs="*-musl"
 bootstrap=yes
 build_style=gnu-configure

From 9e6d3760c66cf4af49bd6e0f8628541332d41a3a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 21:01:43 -0700
Subject: [PATCH 08/37] gcc-multilib: update to 12.2.0.

---
 srcpkgs/gcc-multilib/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index fcd25755aa75..1a26da26a991 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,16 +3,16 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _majorver="${version%.*}"
-wrksrc=gcc-${version/pre/_pre}
+wrksrc=gcc-${version}
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel

From 2c810c8c02b5caf061fe7c30930ef79f08d6ae02 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 14 Aug 2022 19:29:36 -0700
Subject: [PATCH 09/37] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove -no-pie from build. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..5d40f0cdd8a6 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -53,6 +53,7 @@ _void_cross_build_binutils() {
 		--sbindir=/usr/bin \
 		--libdir=/usr/lib \
 		--libexecdir=/usr/lib \
+		--sysconfdir=/etc \
 		--target=${tgt} \
 		--with-sysroot=/usr/${tgt} \
 		--disable-nls \
@@ -60,7 +61,9 @@ _void_cross_build_binutils() {
 		--disable-multilib \
 		--disable-werror \
 		--disable-gold \
+		--disable-gprofng \
 		--enable-relro \
+		--enable-new-dtags \
 		--enable-plugins \
 		--enable-64-bit-bfd \
 		--enable-deterministic-archives \
@@ -132,6 +135,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -460,6 +464,14 @@ do_build() {
 	local binutils_ver linux_ver gcc_ver libc_ver libucontext_ver
 	local tgt=${sourcepkg/cross-}
 
+	export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}"
+	export CXXFLAGS="${CXXFLAGS/-D_FORTIFY_SOURCE=2/}"
+
+	# Disable explicit -fno-PIE, gcc/binutils/libc will figure this out itself.
+	export CFLAGS="${CFLAGS//-fno-PIE/}"
+	export CXXFLAGS="${CXXFLAGS//-fno-PIE/}"
+	export LDFLAGS="${LDFLAGS//-no-pie/}"
+
 	_void_cross_test_ver binutils
 	_void_cross_test_ver linux
 	_void_cross_test_ver gcc
@@ -625,6 +637,9 @@ do_install() {
 	# then remove it because it conflicts with libquadmath package
 	rm -rf ${DESTDIR}/${sysroot}/usr/lib/libquadmath.*
 
+	# Remove libdep linker plugin because it conflicts with system binutils
+	rm -f ${DESTDIR}/usr/lib/bfd-plugins/libdep*
+
 	# Remove leftover symlinks
 	rm -f ${DESTDIR}/usr/lib${XBPS_TARGET_WORDSIZE}
 	rm -f ${DESTDIR}/lib*

From 975673ce2212e92ef17fa16b3f188e1120c94803 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:09:31 -0700
Subject: [PATCH 10/37] linux5.18: update dotconfigs for gcc12

---
 srcpkgs/linux5.18/files/x86_64-dotconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/linux5.18/files/x86_64-dotconfig b/srcpkgs/linux5.18/files/x86_64-dotconfig
index 4e73a3195d40..ea6204868e23 100644
--- a/srcpkgs/linux5.18/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.18/files/x86_64-dotconfig
@@ -512,6 +512,7 @@ CONFIG_RETHUNK=y
 CONFIG_CPU_UNRET_ENTRY=y
 CONFIG_CPU_IBPB_ENTRY=y
 CONFIG_CPU_IBRS_ENTRY=y
+CONFIG_SLS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10060,8 +10061,11 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
 # Memory initialization
 #
 CONFIG_INIT_STACK_NONE=y
+# CONFIG_INIT_STACK_ALL_PATTERN is not set
+# CONFIG_INIT_STACK_ALL_ZERO is not set
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
+# CONFIG_ZERO_CALL_USED_REGS is not set
 # end of Memory initialization
 # end of Kernel hardening options
 # end of Security options
@@ -10538,6 +10542,7 @@ CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
 # CONFIG_UBSAN is not set
 CONFIG_HAVE_ARCH_KCSAN=y
+# CONFIG_KCSAN is not set
 # end of Generic Kernel Debugging Instruments
 
 #

From efd3e16cee295baa5ce506fab22364760e89e279 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 14:45:28 -0700
Subject: [PATCH 11/37] libsasl: fix build for libtool 2.4.7

---
 srcpkgs/libsasl/template | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/libsasl/template b/srcpkgs/libsasl/template
index a8817042f843..a2993b39f4a1 100644
--- a/srcpkgs/libsasl/template
+++ b/srcpkgs/libsasl/template
@@ -19,6 +19,7 @@ distfiles="https://github.com/cyrusimap/cyrus-sasl/releases/download/cyrus-sasl-
 checksum=26866b1549b00ffd020f188a43c258017fa1c382b3ddadd8201536f72efb05d5
 
 pre_configure() {
+	rm -f m4/ltversion.m4
 	autoreconf -fi
 }
 

From 5d381c92a0658b807cb80977c8cd1d816d80ce0e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:08 -0700
Subject: [PATCH 12/37] subversion: fix build for libtool 2.4.7

---
 srcpkgs/subversion/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion/template b/srcpkgs/subversion/template
index 18c35e3a2132..4c32a6342c6a 100644
--- a/srcpkgs/subversion/template
+++ b/srcpkgs/subversion/template
@@ -59,7 +59,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From e734c69ec9219f315f1e98f754c8e06e8669b8e6 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:38 -0700
Subject: [PATCH 13/37] subversion-kwallet-auth: fix build for libtool 2.4.7

---
 srcpkgs/subversion-kwallet-auth/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion-kwallet-auth/template b/srcpkgs/subversion-kwallet-auth/template
index 12210f250d51..b4d8621456ea 100644
--- a/srcpkgs/subversion-kwallet-auth/template
+++ b/srcpkgs/subversion-kwallet-auth/template
@@ -59,7 +59,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From e4be7ec3cbc75fdf10b9ffee35ece550cc5ebbfa Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 14/37] cross-aarch64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..bd6b23f9fb6a 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 4bc6c725afbe29925b38775764e66e521f2b799b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 15/37] cross-aarch64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..427ad2c1e9cd 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From e1719fac950a8d579cdab9d35cb4235c76d3a0f6 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 16/37] cross-arm-linux-gnueabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..2510ee26e789 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 00f67b033ea95b90ac20d6a6382499704942ee08 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 17/37] cross-arm-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..bd8b16e1b4c1 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 2f96ec818cba9a797bc3b8c217a8d5f38e9f072e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 18/37] cross-arm-linux-musleabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..dacfd2655216 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 57815deee57a7ca462484e14df4579e39543a56c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 19/37] cross-arm-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..9ddd32a9f20d 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From fd97759dfff8c1fe79aa5bd18b832496a46ddfbe Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 20/37] cross-armv7l-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..9fb00f18be3b 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 0e2d92f69151d8cfd08f65f9fe09ccb8fd7e46f6 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 21/37] cross-armv7l-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..2c72e75ddfe3 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 2d36c106e070beaf4ab129d700223527b5d8faec Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 22/37] cross-i686-pc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..4dc17df648b5 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 414ac5426ea30ec5a4050c98c1fee739182f8891 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Fri, 16 Sep 2022 20:52:19 -0700
Subject: [PATCH 23/37] cross-i686-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-linux-musl/template b/srcpkgs/cross-i686-linux-musl/template
index 8be16a230d8d..78b4d813a113 100644
--- a/srcpkgs/cross-i686-linux-musl/template
+++ b/srcpkgs/cross-i686-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-i686-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-i686-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 19ca5fdc285eb85dbbf3a700610be3496c2ca5c3 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 24/37] cross-mips-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..6009e5c79eb2 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From a833e15b5c19574c51655574fa97fe27d0bccafd Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 25/37] cross-mips-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..080164df193d 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="hipperson0 <hipperson0@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From e5afa62cab49d9732bb0acd1cd7b519fd5feb2a5 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 26/37] cross-mipsel-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..f9fd4b8a04ef 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From cb747dc80bb2c3a58a50b59549de23781d8cefe7 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 27/37] cross-mipsel-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..7418a984474b 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From a418c968f6a1d777f422db6397e2cbfc47010978 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 28/37] cross-powerpc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..31e57b4e52b2 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From b4b7025867810868a22c9e0182b44efd08d885ee Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 29/37] cross-powerpc-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..a2d1edcf1ffd 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 2a467d5824054f736a39db626df7dfac65b0af73 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 30/37] cross-powerpc64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..1a4cbed61e76 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From b95d1e8194a84db363b34b7bed31b2b1392be166 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 31/37] cross-powerpc64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 016f18776a6d..19b1ff859eb6 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 9dea7ffd05f8a0a4d52fdd8f05d36b61c5b5ae0f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 32/37] cross-powerpc64le-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 463d7e92d20d..9d99a3a315d2 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 41bb3e7ba64b0d10ce760a4b537c6e6ef7b89d9a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 33/37] cross-powerpc64le-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index c17a3cccfe29..3128baa7372e 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 9132a99e5c279d236ff3aad59e83a904ffbbe7a0 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 34/37] cross-powerpcle-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 9aede3c465ce..6f914b3877ee 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 3ca917ac18b7ef693cc7228e5765b1cc4ec9fff0 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 35/37] cross-powerpcle-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index 045cfda987fe..20e70bed4c60 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 155a1084b609142f47d36e470091a720bdd8d502 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 36/37] cross-x86_64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 8918f3c22a1c..5219cd50f851 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 1f1f8c31c9635c55e96f07387247024952faa352 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 37/37] cross-x86_64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..2811de0d3c2e 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (152 preceding siblings ...)
  2022-10-04  8:43 ` oreo639
@ 2022-10-04 10:54 ` oreo639
  2022-10-04 11:02 ` oreo639
                   ` (110 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-10-04 10:54 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5256 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.2.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.2.0

Saved for future reference: paper has a list of failing builds here (some may be already fixed or may be unrelated to this PR): https://vasilek.cz/logs/lab/bad/

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [x] llvm https://github.com/void-linux/void-packages/pull/38694
- [x] m4 https://github.com/void-linux/void-packages/pull/33730
- [x] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [x] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [x] libvirt https://github.com/void-linux/void-packages/pull/38842
- [x] syslinux https://github.com/void-linux/void-packages/pull/38876
- [x] efivar https://github.com/void-linux/void-packages/pull/38874

Known packages that needed to be fixed/updated for gcc12:
- [ ] linux5.18 (in this PR)
- [x] openssh https://github.com/void-linux/void-packages/pull/38849
- [x] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [x] doxygen https://github.com/void-linux/void-packages/pull/38846
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] libproxy https://github.com/void-linux/void-packages/pull/38818
- [x] exempi https://github.com/void-linux/void-packages/pull/38820
- [x] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [ ] gpgme https://github.com/void-linux/void-packages/pull/38825
- [x] libunique1 https://github.com/void-linux/void-packages/pull/38848 or https://github.com/void-linux/void-packages/pull/38873
- [x] libwpd https://github.com/void-linux/void-packages/pull/38878

Needs to be fixed/updated for binutils:
- [x] grub https://github.com/void-linux/void-packages/pull/38875
- [x] linux-tools https://github.com/void-linux/void-packages/pull/38877
- [x] kcov https://github.com/void-linux/void-packages/pull/39291

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [x] kde
- [x] lxde
- [x] lxqt

You can test the ISOs here:
https://drive.google.com/drive/folders/1ix92CYSLUP-KWjLxltdgG4e8Nu2JCY5n?usp=sharing

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 117285 bytes --]

From e3db94502c1488e8fdc07408ac8b777ce7c68a71 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 01/38] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../fix-libcollector-without-java.patch       | 53 +++++++++++++++
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 22 +++++--
 4 files changed, 86 insertions(+), 115 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
 create mode 100644 srcpkgs/binutils/patches/fix-libcollector-without-java.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/fix-libcollector-without-java.patch b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
new file mode 100644
index 000000000000..54384875f358
--- /dev/null
+++ b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
@@ -0,0 +1,53 @@
+From 49ddd814ac1071af7c4f45d5f8398b91862f2c7f Mon Sep 17 00:00:00 2001
+From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
+Date: Wed, 17 Aug 2022 19:55:23 -0700
+Subject: [PATCH] gprofng: fix bug 29479 Collection fails when built without
+ java support
+
+gprofng/ChangeLog
+2022-08-17  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>
+
+	PR gprofng/29479
+	* libcollector/collector.c: Add #if defined(GPROFNG_JAVA_PROFILING) for
+	java specific code.
+	* libcollector/unwind.c: Likewise.
+---
+ gprofng/libcollector/collector.c | 2 ++
+ gprofng/libcollector/unwind.c    | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/gprofng/libcollector/collector.c b/gprofng/libcollector/collector.c
+index 93c9d3330de5..ceff2c1caccb 100644
+--- a/gprofng/libcollector/collector.c
++++ b/gprofng/libcollector/collector.c
+@@ -913,8 +913,10 @@ __collector_open_experiment (const char *exp, const char *params, sp_origin_t or
+   __collector_ext_unwind_key_init (1, NULL);
+ 
+   /* start java attach if suitable */
++#if defined(GPROFNG_JAVA_PROFILING)
+   if (exp_origin == SP_ORIGIN_DBX_ATTACH)
+     __collector_jprofile_start_attach ();
++#endif
+   start_sec_time = CALL_UTIL (time)(NULL);
+   __collector_start_time = collector_interface.getHiResTime ();
+   TprintfT (DBG_LT0, "\t__collector_open_experiment; resetting start_time\n");
+diff --git a/gprofng/libcollector/unwind.c b/gprofng/libcollector/unwind.c
+index 119243788020..f8e11823c81e 100644
+--- a/gprofng/libcollector/unwind.c
++++ b/gprofng/libcollector/unwind.c
+@@ -557,6 +557,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+   int size = max_frame_size;
+ 
+ #define MIN(a,b) ((a)<(b)?(a):(b))
++#if defined(GPROFNG_JAVA_PROFILING)
+   /* get Java info */
+   if (__collector_java_mode && __collector_java_asyncgetcalltrace_loaded && context && !pseudo_context)
+     {
+@@ -569,6 +570,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+ 	  size -= sz;
+ 	}
+     }
++#endif
+ 
+   /* get native stack */
+   if (context)
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..79cd4e2b7c1f 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkgconf"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -44,6 +45,12 @@ do_configure() {
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	# gprofng currently only supports x86 and aarch64 glibc.
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64|i386|aarch64) conf+=" --enable-gprofng" ;;
+		*) conf+=" --disable-gprofng" ;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"
@@ -76,13 +83,15 @@ do_configure() {
 		--libdir=/usr/lib \
 		--mandir=/usr/share/man \
 		--infodir=/usr/share/info \
+		--sysconfdir=/etc \
 		--disable-werror \
-		--disable-shared \
 		--disable-nls \
+		--enable-shared \
 		--enable-threads \
 		--enable-plugins \
 		--enable-relro \
 		--enable-gold \
+		--enable-new-dtags \
 		--enable-deterministic-archives \
 		--enable-64-bit-bfd \
 		--enable-ld=default \
@@ -142,7 +151,8 @@ binutils-devel_package() {
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/*.a"
-		vmove "usr/lib/*.so"
+		vmove "usr/lib/libbfd.so"
+		vmove "usr/lib/libopcodes.so"
 	}
 }
 

From 37d2b1aec79b17a60744f35ad868fb595822ae55 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 2 Oct 2022 16:46:59 -0700
Subject: [PATCH 02/38] gdb: resolve conflict with binutils 2.39

---
 srcpkgs/gdb/template | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/gdb/template b/srcpkgs/gdb/template
index ff7c9d9a5911..5970402eb27e 100644
--- a/srcpkgs/gdb/template
+++ b/srcpkgs/gdb/template
@@ -1,7 +1,7 @@
 # Template file for 'gdb'
 pkgname=gdb
 version=12.1
-revision=1
+revision=2
 build_style=gnu-configure
 pycompile_dirs="/usr/share/gdb/python"
 configure_args="--disable-werror --disable-nls --with-system-readline
@@ -48,7 +48,8 @@ vopt_conflict debuginfod static
 
 post_install() {
 	# resolve conflicts with binutils
-	rm -r ${DESTDIR}/usr/{include,lib,share/info/bfd.info*}
+	rm -rf ${DESTDIR}/usr/{include,lib}
+	rm -rf ${DESTDIR}/usr/share/info/{bfd,ctf-spec}.info*
 }
 
 gdb-common_package() {

From 718f25128f938e69900b0b4402c7464c0582734e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 03/38] gcc: update to 12.2.0.

---
 common/shlibs                                 | 10 +--
 srcpkgs/gcc/files/gccgo-musl.patch            | 71 +++----------------
 srcpkgs/gcc/files/libgnarl-musl.patch         | 18 ++---
 srcpkgs/gcc/files/libssp-musl.patch           | 10 +--
 srcpkgs/gcc/patches/libffi_gnulinux.patch     | 11 ---
 .../gcc/patches/libgcc-ibm128-no-tag.patch    | 10 ++-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |  2 +-
 srcpkgs/gcc/template                          | 26 +++----
 8 files changed, 49 insertions(+), 109 deletions(-)
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index 5d4b0a9899ad..dac3556fb949 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.2.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.36 perl-5.36.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -847,8 +847,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.2.0_1
+libgnat-12.so libada-12.2.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1697,8 +1697,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.2.0_1
+libasan.so.8 libsanitizer-12.2.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..12ec68dd8aa3 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,14 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ b/libgo/go/runtime/os_linux.go
+@@ -365,7 +365,7 @@ func setThreadCPUProfiler(hz int32) {
+ 	var sevp _sigevent
+ 	sevp.sigev_notify = _SIGEV_THREAD_ID
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.__sev_fields))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..658670793168 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,35 +3,31 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
+version=12.2.0
+revision=1
 _patchver="${version%pre*}"
 _minorver="${_patchver%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
-wrksrc=gcc-${version/pre/_pre}
+_mpc_version=1.2.1
+_isl_version=0.24
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -396,7 +392,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}

From b402cb67dcd608e4eaf98ae68d0fe37a4e62f213 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 04/38] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      | 11 ++++--
 2 files changed, 25 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..51611929d643 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,12 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
+
+if [ "$XBPS_LIBC" == "musl" ]; then
+	# Musl always searches LD_LIBRARY_PATH before RPATH and RUNPATH
+	make_build_args="lt_cv_shlibpath_overrides_runpath=yes"
+fi
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From 6e6a7cd9951addad3c6f4577f03d5f62d03fc04b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 05/38] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 55255dceae8b..ca2d858a7abc 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From 44345b502f9f6a7ef28955bea3fe9939d80bc435 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 06/38] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 3 files changed, 55 insertions(+), 353 deletions(-)
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index dac3556fb949..bf246b638dae 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From cbb5a04056ab42d355c869acb2a2f5c567289043 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Wed, 14 Sep 2022 03:48:32 -0700
Subject: [PATCH 07/38] musl: add support for SIGEV_THREAD_ID timers

https://git.musl-libc.org/cgit/musl/commit/?id=7c71792e87691451f2a6b76348e83ad1889f1dcb
---
 ...d-support-for-SIGEV_THREAD_ID-timers.patch | 74 +++++++++++++++++++
 srcpkgs/musl/template                         |  2 +-
 2 files changed, 75 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch

diff --git a/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
new file mode 100644
index 000000000000..e20dff5ba0d4
--- /dev/null
+++ b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
@@ -0,0 +1,74 @@
+From 7c71792e87691451f2a6b76348e83ad1889f1dcb Mon Sep 17 00:00:00 2001
+From: James Y Knight <jyknight@google.com>
+Date: Sun, 30 Jun 2019 21:55:20 -0400
+Subject: [PATCH] add support for SIGEV_THREAD_ID timers
+
+This is like SIGEV_SIGNAL, but targeted to a particular thread's
+tid, rather than the process.
+---
+ include/signal.h        | 16 +++++++++++++---
+ src/time/timer_create.c |  8 ++++++--
+ 2 files changed, 19 insertions(+), 5 deletions(-)
+
+diff --git a/include/signal.h b/include/signal.h
+index fbdf667b2..9ed929e4f 100644
+--- a/include/signal.h
++++ b/include/signal.h
+@@ -180,14 +180,24 @@ struct sigevent {
+ 	union sigval sigev_value;
+ 	int sigev_signo;
+ 	int sigev_notify;
+-	void (*sigev_notify_function)(union sigval);
+-	pthread_attr_t *sigev_notify_attributes;
+-	char __pad[56-3*sizeof(long)];
++	union {
++		char __pad[64 - 2*sizeof(int) - sizeof(union sigval)];
++		pid_t sigev_notify_thread_id;
++		struct {
++			void (*sigev_notify_function)(union sigval);
++			pthread_attr_t *sigev_notify_attributes;
++		} __sev_thread;
++	} __sev_fields;
+ };
+ 
++#define sigev_notify_thread_id __sev_fields.sigev_notify_thread_id
++#define sigev_notify_function __sev_fields.__sev_thread.sigev_notify_function
++#define sigev_notify_attributes __sev_fields.__sev_thread.sigev_notify_attributes
++
+ #define SIGEV_SIGNAL 0
+ #define SIGEV_NONE 1
+ #define SIGEV_THREAD 2
++#define SIGEV_THREAD_ID 4
+ 
+ int __libc_current_sigrtmin(void);
+ int __libc_current_sigrtmax(void);
+diff --git a/src/time/timer_create.c b/src/time/timer_create.c
+index 5ddfda278..4bef23905 100644
+--- a/src/time/timer_create.c
++++ b/src/time/timer_create.c
+@@ -71,11 +71,15 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 	switch (evp ? evp->sigev_notify : SIGEV_SIGNAL) {
+ 	case SIGEV_NONE:
+ 	case SIGEV_SIGNAL:
++	case SIGEV_THREAD_ID:
+ 		if (evp) {
+ 			ksev.sigev_value = evp->sigev_value;
+ 			ksev.sigev_signo = evp->sigev_signo;
+ 			ksev.sigev_notify = evp->sigev_notify;
+-			ksev.sigev_tid = 0;
++			if (evp->sigev_notify == SIGEV_THREAD_ID)
++				ksev.sigev_tid = evp->sigev_notify_thread_id;
++			else
++				ksev.sigev_tid = 0;
+ 			ksevp = &ksev;
+ 		}
+ 		if (syscall(SYS_timer_create, clk, ksevp, &timerid) < 0)
+@@ -107,7 +111,7 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 
+ 		ksev.sigev_value.sival_ptr = 0;
+ 		ksev.sigev_signo = SIGTIMER;
+-		ksev.sigev_notify = 4; /* SIGEV_THREAD_ID */
++		ksev.sigev_notify = SIGEV_THREAD_ID;
+ 		ksev.sigev_tid = td->tid;
+ 		if (syscall(SYS_timer_create, clk, &ksev, &timerid) < 0)
+ 			timerid = -1;
diff --git a/srcpkgs/musl/template b/srcpkgs/musl/template
index 5bdc5c48e623..34e6ed4fba6e 100644
--- a/srcpkgs/musl/template
+++ b/srcpkgs/musl/template
@@ -2,7 +2,7 @@
 pkgname=musl
 reverts="1.2.0_1"
 version=1.1.24
-revision=10
+revision=11
 archs="*-musl"
 bootstrap=yes
 build_style=gnu-configure

From 268d2e0abd2cbab7df8bfa93d7a95b9d2122539b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 21:01:43 -0700
Subject: [PATCH 08/38] gcc-multilib: update to 12.2.0.

---
 srcpkgs/gcc-multilib/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index fcd25755aa75..1a26da26a991 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,16 +3,16 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _majorver="${version%.*}"
-wrksrc=gcc-${version/pre/_pre}
+wrksrc=gcc-${version}
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel

From 8194304e775502766f8b73735dde392f2d91fa7d Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Tue, 4 Oct 2022 03:49:13 -0700
Subject: [PATCH 09/38] libgccjit: update to 12.2.0.

---
 srcpkgs/libgccjit/files/libgccjit-musl.patch | 63 --------------------
 srcpkgs/libgccjit/template                   | 22 +++----
 2 files changed, 9 insertions(+), 76 deletions(-)
 delete mode 100644 srcpkgs/libgccjit/files/libgccjit-musl.patch

diff --git a/srcpkgs/libgccjit/files/libgccjit-musl.patch b/srcpkgs/libgccjit/files/libgccjit-musl.patch
deleted file mode 100644
index d2ed16928c82..000000000000
--- a/srcpkgs/libgccjit/files/libgccjit-musl.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-diff --git a/gcc/jit/jit-playback.c b/gcc/jit/jit-playback.c
-index 5bccf591a..35f5e35ef 100644
---- a/gcc/jit/jit-playback.c
-+++ b/gcc/jit/jit-playback.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -41,8 +43,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "diagnostic.h"
- #include "stmt.h"
- 
--#include <pthread.h>
--
- #include "jit-playback.h"
- #include "jit-result.h"
- #include "jit-builtins.h"
-diff --git a/gcc/jit/jit-recording.c b/gcc/jit/jit-recording.c
-index a237d574f..5785e3269 100644
---- a/gcc/jit/jit-recording.c
-+++ b/gcc/jit/jit-recording.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -25,8 +27,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "pretty-print.h"
- #include "toplev.h"
- 
--#include <pthread.h>
--
- #include "jit-builtins.h"
- #include "jit-recording.h"
- #include "jit-playback.h"
-diff --git a/gcc/jit/libgccjit.c b/gcc/jit/libgccjit.c
-index f9c33c63c..75f21d275 100644
---- a/gcc/jit/libgccjit.c
-+++ b/gcc/jit/libgccjit.c
-@@ -18,13 +18,13 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
- #include "timevar.h"
- #include "typed-splay-tree.h"
- #include "cppbuiltin.h"
--#include <pthread.h>
- 
- #include "libgccjit.h"
- #include "jit-recording.h"
diff --git a/srcpkgs/libgccjit/template b/srcpkgs/libgccjit/template
index 6f1d6256dcd6..b2ce8037a0b9 100644
--- a/srcpkgs/libgccjit/template
+++ b/srcpkgs/libgccjit/template
@@ -3,35 +3,31 @@
 # which use the version number.
 
 pkgname=libgccjit
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _patchver="${version%pre*}"
 _minorver="${_patchver%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
-wrksrc=gcc-${version/pre/_pre}
+_mpc_version=1.2.1
+_isl_version=0.24
 short_desc="Just-In-Time Compilation library for GCC"
 maintainer="Lane Biocini <lane@mailbox.org>"
 homepage="https://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 nopie=yes
 lib32disabled=yes
 makedepends="zlib-devel"

From 18b8744d01ff27199c69f342faeef39a2076a906 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 14 Aug 2022 19:29:36 -0700
Subject: [PATCH 10/38] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove -no-pie from build. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..5d40f0cdd8a6 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -53,6 +53,7 @@ _void_cross_build_binutils() {
 		--sbindir=/usr/bin \
 		--libdir=/usr/lib \
 		--libexecdir=/usr/lib \
+		--sysconfdir=/etc \
 		--target=${tgt} \
 		--with-sysroot=/usr/${tgt} \
 		--disable-nls \
@@ -60,7 +61,9 @@ _void_cross_build_binutils() {
 		--disable-multilib \
 		--disable-werror \
 		--disable-gold \
+		--disable-gprofng \
 		--enable-relro \
+		--enable-new-dtags \
 		--enable-plugins \
 		--enable-64-bit-bfd \
 		--enable-deterministic-archives \
@@ -132,6 +135,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -460,6 +464,14 @@ do_build() {
 	local binutils_ver linux_ver gcc_ver libc_ver libucontext_ver
 	local tgt=${sourcepkg/cross-}
 
+	export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}"
+	export CXXFLAGS="${CXXFLAGS/-D_FORTIFY_SOURCE=2/}"
+
+	# Disable explicit -fno-PIE, gcc/binutils/libc will figure this out itself.
+	export CFLAGS="${CFLAGS//-fno-PIE/}"
+	export CXXFLAGS="${CXXFLAGS//-fno-PIE/}"
+	export LDFLAGS="${LDFLAGS//-no-pie/}"
+
 	_void_cross_test_ver binutils
 	_void_cross_test_ver linux
 	_void_cross_test_ver gcc
@@ -625,6 +637,9 @@ do_install() {
 	# then remove it because it conflicts with libquadmath package
 	rm -rf ${DESTDIR}/${sysroot}/usr/lib/libquadmath.*
 
+	# Remove libdep linker plugin because it conflicts with system binutils
+	rm -f ${DESTDIR}/usr/lib/bfd-plugins/libdep*
+
 	# Remove leftover symlinks
 	rm -f ${DESTDIR}/usr/lib${XBPS_TARGET_WORDSIZE}
 	rm -f ${DESTDIR}/lib*

From a5618d71b0557050d5b18de81c8aa939fb843d05 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:09:31 -0700
Subject: [PATCH 11/38] linux5.18: update dotconfigs for gcc12

---
 srcpkgs/linux5.18/files/x86_64-dotconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/linux5.18/files/x86_64-dotconfig b/srcpkgs/linux5.18/files/x86_64-dotconfig
index 4e73a3195d40..ea6204868e23 100644
--- a/srcpkgs/linux5.18/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.18/files/x86_64-dotconfig
@@ -512,6 +512,7 @@ CONFIG_RETHUNK=y
 CONFIG_CPU_UNRET_ENTRY=y
 CONFIG_CPU_IBPB_ENTRY=y
 CONFIG_CPU_IBRS_ENTRY=y
+CONFIG_SLS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10060,8 +10061,11 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
 # Memory initialization
 #
 CONFIG_INIT_STACK_NONE=y
+# CONFIG_INIT_STACK_ALL_PATTERN is not set
+# CONFIG_INIT_STACK_ALL_ZERO is not set
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
+# CONFIG_ZERO_CALL_USED_REGS is not set
 # end of Memory initialization
 # end of Kernel hardening options
 # end of Security options
@@ -10538,6 +10542,7 @@ CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
 # CONFIG_UBSAN is not set
 CONFIG_HAVE_ARCH_KCSAN=y
+# CONFIG_KCSAN is not set
 # end of Generic Kernel Debugging Instruments
 
 #

From 9ec55c69c19d6ddb9fff809f72c245eae503b07b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 14:45:28 -0700
Subject: [PATCH 12/38] libsasl: fix build for libtool 2.4.7

---
 srcpkgs/libsasl/template | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/libsasl/template b/srcpkgs/libsasl/template
index a8817042f843..a2993b39f4a1 100644
--- a/srcpkgs/libsasl/template
+++ b/srcpkgs/libsasl/template
@@ -19,6 +19,7 @@ distfiles="https://github.com/cyrusimap/cyrus-sasl/releases/download/cyrus-sasl-
 checksum=26866b1549b00ffd020f188a43c258017fa1c382b3ddadd8201536f72efb05d5
 
 pre_configure() {
+	rm -f m4/ltversion.m4
 	autoreconf -fi
 }
 

From a2dea869ecef430b5a315aca7be3f231d068b644 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:08 -0700
Subject: [PATCH 13/38] subversion: fix build for libtool 2.4.7

---
 srcpkgs/subversion/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion/template b/srcpkgs/subversion/template
index 18c35e3a2132..4c32a6342c6a 100644
--- a/srcpkgs/subversion/template
+++ b/srcpkgs/subversion/template
@@ -59,7 +59,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From 20c6f3dbfed0677d0dc43cb0ae960bc2aad383ed Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:38 -0700
Subject: [PATCH 14/38] subversion-kwallet-auth: fix build for libtool 2.4.7

---
 srcpkgs/subversion-kwallet-auth/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion-kwallet-auth/template b/srcpkgs/subversion-kwallet-auth/template
index 12210f250d51..b4d8621456ea 100644
--- a/srcpkgs/subversion-kwallet-auth/template
+++ b/srcpkgs/subversion-kwallet-auth/template
@@ -59,7 +59,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From 45400f58e20014549affb1b411fe931f211052ec Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 15/38] cross-aarch64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..bd6b23f9fb6a 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From a9c98eb81a7fcc343d278c6662d380b0dfc6f81e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 16/38] cross-aarch64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..427ad2c1e9cd 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 1d30558d5e27997979a1582af8e66b2c3e7432dd Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 17/38] cross-arm-linux-gnueabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..2510ee26e789 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 4d69d711c1f4fd6ca2381693fd4f41d142285939 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 18/38] cross-arm-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..bd8b16e1b4c1 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 9e0df63663eb22e80736c77577ec8e772065f5ec Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 19/38] cross-arm-linux-musleabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..dacfd2655216 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From aa54b99cdf3da42f2c8cf5ec85016b93c2f73b52 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 20/38] cross-arm-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..9ddd32a9f20d 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From a1bc1a90c57c903b40812a0984457c7418087857 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 21/38] cross-armv7l-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..9fb00f18be3b 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 98b156b561ca4655a1b212ea9b7c7578440f4601 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 22/38] cross-armv7l-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..2c72e75ddfe3 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 2fa0c435adca4cb784df1b1c708e1f78edcb43c3 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 23/38] cross-i686-pc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..4dc17df648b5 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From d6c2e42b91d5679bc84708b518e5549c32a2f331 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Fri, 16 Sep 2022 20:52:19 -0700
Subject: [PATCH 24/38] cross-i686-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-linux-musl/template b/srcpkgs/cross-i686-linux-musl/template
index 8be16a230d8d..78b4d813a113 100644
--- a/srcpkgs/cross-i686-linux-musl/template
+++ b/srcpkgs/cross-i686-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-i686-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-i686-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 1924236790cc43845fb3cbc7b6fc19b28dab43df Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 25/38] cross-mips-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..6009e5c79eb2 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From d567f2ba50c2a03c696c7cfc04cb0d862f8fe3e0 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 26/38] cross-mips-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..080164df193d 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="hipperson0 <hipperson0@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From e6b28fde3a0cb9346b937b0ccb22326c6e077cea Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 27/38] cross-mipsel-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..f9fd4b8a04ef 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From f0fab666677c88421079ffd3c85a9abad6ccba69 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 28/38] cross-mipsel-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..7418a984474b 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 9d89f8a36ad4631d47f5cc2975c826b84a73a206 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 29/38] cross-powerpc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..31e57b4e52b2 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 3e927a942b58f7c84e4b466632d81c1fb874c725 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 30/38] cross-powerpc-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..a2d1edcf1ffd 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From dd30be4814448ef07de31bf0d63c76aa92a3e638 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 31/38] cross-powerpc64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..1a4cbed61e76 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 052f3768ce0cafc69fe03431799bdec65e623be1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 32/38] cross-powerpc64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 016f18776a6d..19b1ff859eb6 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 20e933425e047a8d25a7288e35096f4b78397792 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 33/38] cross-powerpc64le-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 463d7e92d20d..9d99a3a315d2 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From ed58f884106535426029a56d3775eb4d61d4577b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 34/38] cross-powerpc64le-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index c17a3cccfe29..3128baa7372e 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From af8ac80d8dded0f4947b93bbb4706a23385c9d1c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 35/38] cross-powerpcle-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 9aede3c465ce..6f914b3877ee 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 27fd70dea587de41234c71550ef474df8c93ad09 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 36/38] cross-powerpcle-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index 045cfda987fe..20e70bed4c60 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From aeba22b67e08c3196a83a71d6f4482192af42b03 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 37/38] cross-x86_64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 8918f3c22a1c..5219cd50f851 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 291ffb5fac7c9e8bfb56548094913eeefa7c06d9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 38/38] cross-x86_64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..2811de0d3c2e 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (153 preceding siblings ...)
  2022-10-04 10:54 ` oreo639
@ 2022-10-04 11:02 ` oreo639
  2022-10-04 11:09 ` oreo639
                   ` (109 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-10-04 11:02 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5256 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.2.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.2.0

Saved for future reference: paper has a list of failing builds here (some may be already fixed or may be unrelated to this PR): https://vasilek.cz/logs/lab/bad/

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [x] llvm https://github.com/void-linux/void-packages/pull/38694
- [x] m4 https://github.com/void-linux/void-packages/pull/33730
- [x] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [x] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [x] libvirt https://github.com/void-linux/void-packages/pull/38842
- [x] syslinux https://github.com/void-linux/void-packages/pull/38876
- [x] efivar https://github.com/void-linux/void-packages/pull/38874

Known packages that needed to be fixed/updated for gcc12:
- [ ] linux5.18 (in this PR)
- [x] openssh https://github.com/void-linux/void-packages/pull/38849
- [x] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [x] doxygen https://github.com/void-linux/void-packages/pull/38846
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] libproxy https://github.com/void-linux/void-packages/pull/38818
- [x] exempi https://github.com/void-linux/void-packages/pull/38820
- [x] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [ ] gpgme https://github.com/void-linux/void-packages/pull/38825
- [x] libunique1 https://github.com/void-linux/void-packages/pull/38848 or https://github.com/void-linux/void-packages/pull/38873
- [x] libwpd https://github.com/void-linux/void-packages/pull/38878

Needs to be fixed/updated for binutils:
- [x] grub https://github.com/void-linux/void-packages/pull/38875
- [x] linux-tools https://github.com/void-linux/void-packages/pull/38877
- [x] kcov https://github.com/void-linux/void-packages/pull/39291

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [x] kde
- [x] lxde
- [x] lxqt

You can test the ISOs here:
https://drive.google.com/drive/folders/1ix92CYSLUP-KWjLxltdgG4e8Nu2JCY5n?usp=sharing

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 117261 bytes --]

From e3db94502c1488e8fdc07408ac8b777ce7c68a71 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 01/38] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../fix-libcollector-without-java.patch       | 53 +++++++++++++++
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 22 +++++--
 4 files changed, 86 insertions(+), 115 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
 create mode 100644 srcpkgs/binutils/patches/fix-libcollector-without-java.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/fix-libcollector-without-java.patch b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
new file mode 100644
index 000000000000..54384875f358
--- /dev/null
+++ b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
@@ -0,0 +1,53 @@
+From 49ddd814ac1071af7c4f45d5f8398b91862f2c7f Mon Sep 17 00:00:00 2001
+From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
+Date: Wed, 17 Aug 2022 19:55:23 -0700
+Subject: [PATCH] gprofng: fix bug 29479 Collection fails when built without
+ java support
+
+gprofng/ChangeLog
+2022-08-17  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>
+
+	PR gprofng/29479
+	* libcollector/collector.c: Add #if defined(GPROFNG_JAVA_PROFILING) for
+	java specific code.
+	* libcollector/unwind.c: Likewise.
+---
+ gprofng/libcollector/collector.c | 2 ++
+ gprofng/libcollector/unwind.c    | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/gprofng/libcollector/collector.c b/gprofng/libcollector/collector.c
+index 93c9d3330de5..ceff2c1caccb 100644
+--- a/gprofng/libcollector/collector.c
++++ b/gprofng/libcollector/collector.c
+@@ -913,8 +913,10 @@ __collector_open_experiment (const char *exp, const char *params, sp_origin_t or
+   __collector_ext_unwind_key_init (1, NULL);
+ 
+   /* start java attach if suitable */
++#if defined(GPROFNG_JAVA_PROFILING)
+   if (exp_origin == SP_ORIGIN_DBX_ATTACH)
+     __collector_jprofile_start_attach ();
++#endif
+   start_sec_time = CALL_UTIL (time)(NULL);
+   __collector_start_time = collector_interface.getHiResTime ();
+   TprintfT (DBG_LT0, "\t__collector_open_experiment; resetting start_time\n");
+diff --git a/gprofng/libcollector/unwind.c b/gprofng/libcollector/unwind.c
+index 119243788020..f8e11823c81e 100644
+--- a/gprofng/libcollector/unwind.c
++++ b/gprofng/libcollector/unwind.c
+@@ -557,6 +557,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+   int size = max_frame_size;
+ 
+ #define MIN(a,b) ((a)<(b)?(a):(b))
++#if defined(GPROFNG_JAVA_PROFILING)
+   /* get Java info */
+   if (__collector_java_mode && __collector_java_asyncgetcalltrace_loaded && context && !pseudo_context)
+     {
+@@ -569,6 +570,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+ 	  size -= sz;
+ 	}
+     }
++#endif
+ 
+   /* get native stack */
+   if (context)
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..79cd4e2b7c1f 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkgconf"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -44,6 +45,12 @@ do_configure() {
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	# gprofng currently only supports x86 and aarch64 glibc.
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64|i386|aarch64) conf+=" --enable-gprofng" ;;
+		*) conf+=" --disable-gprofng" ;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"
@@ -76,13 +83,15 @@ do_configure() {
 		--libdir=/usr/lib \
 		--mandir=/usr/share/man \
 		--infodir=/usr/share/info \
+		--sysconfdir=/etc \
 		--disable-werror \
-		--disable-shared \
 		--disable-nls \
+		--enable-shared \
 		--enable-threads \
 		--enable-plugins \
 		--enable-relro \
 		--enable-gold \
+		--enable-new-dtags \
 		--enable-deterministic-archives \
 		--enable-64-bit-bfd \
 		--enable-ld=default \
@@ -142,7 +151,8 @@ binutils-devel_package() {
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/*.a"
-		vmove "usr/lib/*.so"
+		vmove "usr/lib/libbfd.so"
+		vmove "usr/lib/libopcodes.so"
 	}
 }
 

From 37d2b1aec79b17a60744f35ad868fb595822ae55 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 2 Oct 2022 16:46:59 -0700
Subject: [PATCH 02/38] gdb: resolve conflict with binutils 2.39

---
 srcpkgs/gdb/template | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/gdb/template b/srcpkgs/gdb/template
index ff7c9d9a5911..5970402eb27e 100644
--- a/srcpkgs/gdb/template
+++ b/srcpkgs/gdb/template
@@ -1,7 +1,7 @@
 # Template file for 'gdb'
 pkgname=gdb
 version=12.1
-revision=1
+revision=2
 build_style=gnu-configure
 pycompile_dirs="/usr/share/gdb/python"
 configure_args="--disable-werror --disable-nls --with-system-readline
@@ -48,7 +48,8 @@ vopt_conflict debuginfod static
 
 post_install() {
 	# resolve conflicts with binutils
-	rm -r ${DESTDIR}/usr/{include,lib,share/info/bfd.info*}
+	rm -rf ${DESTDIR}/usr/{include,lib}
+	rm -rf ${DESTDIR}/usr/share/info/{bfd,ctf-spec}.info*
 }
 
 gdb-common_package() {

From 718f25128f938e69900b0b4402c7464c0582734e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 03/38] gcc: update to 12.2.0.

---
 common/shlibs                                 | 10 +--
 srcpkgs/gcc/files/gccgo-musl.patch            | 71 +++----------------
 srcpkgs/gcc/files/libgnarl-musl.patch         | 18 ++---
 srcpkgs/gcc/files/libssp-musl.patch           | 10 +--
 srcpkgs/gcc/patches/libffi_gnulinux.patch     | 11 ---
 .../gcc/patches/libgcc-ibm128-no-tag.patch    | 10 ++-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |  2 +-
 srcpkgs/gcc/template                          | 26 +++----
 8 files changed, 49 insertions(+), 109 deletions(-)
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index 5d4b0a9899ad..dac3556fb949 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.2.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.36 perl-5.36.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -847,8 +847,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.2.0_1
+libgnat-12.so libada-12.2.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1697,8 +1697,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.2.0_1
+libasan.so.8 libsanitizer-12.2.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..12ec68dd8aa3 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,14 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ b/libgo/go/runtime/os_linux.go
+@@ -365,7 +365,7 @@ func setThreadCPUProfiler(hz int32) {
+ 	var sevp _sigevent
+ 	sevp.sigev_notify = _SIGEV_THREAD_ID
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.__sev_fields))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..658670793168 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,35 +3,31 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
+version=12.2.0
+revision=1
 _patchver="${version%pre*}"
 _minorver="${_patchver%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
-wrksrc=gcc-${version/pre/_pre}
+_mpc_version=1.2.1
+_isl_version=0.24
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -396,7 +392,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}

From b402cb67dcd608e4eaf98ae68d0fe37a4e62f213 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 04/38] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      | 11 ++++--
 2 files changed, 25 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..51611929d643 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,12 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
+
+if [ "$XBPS_LIBC" == "musl" ]; then
+	# Musl always searches LD_LIBRARY_PATH before RPATH and RUNPATH
+	make_build_args="lt_cv_shlibpath_overrides_runpath=yes"
+fi
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From 6e6a7cd9951addad3c6f4577f03d5f62d03fc04b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 05/38] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 55255dceae8b..ca2d858a7abc 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From 44345b502f9f6a7ef28955bea3fe9939d80bc435 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 06/38] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 3 files changed, 55 insertions(+), 353 deletions(-)
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index dac3556fb949..bf246b638dae 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From cbb5a04056ab42d355c869acb2a2f5c567289043 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Wed, 14 Sep 2022 03:48:32 -0700
Subject: [PATCH 07/38] musl: add support for SIGEV_THREAD_ID timers

https://git.musl-libc.org/cgit/musl/commit/?id=7c71792e87691451f2a6b76348e83ad1889f1dcb
---
 ...d-support-for-SIGEV_THREAD_ID-timers.patch | 74 +++++++++++++++++++
 srcpkgs/musl/template                         |  2 +-
 2 files changed, 75 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch

diff --git a/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
new file mode 100644
index 000000000000..e20dff5ba0d4
--- /dev/null
+++ b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
@@ -0,0 +1,74 @@
+From 7c71792e87691451f2a6b76348e83ad1889f1dcb Mon Sep 17 00:00:00 2001
+From: James Y Knight <jyknight@google.com>
+Date: Sun, 30 Jun 2019 21:55:20 -0400
+Subject: [PATCH] add support for SIGEV_THREAD_ID timers
+
+This is like SIGEV_SIGNAL, but targeted to a particular thread's
+tid, rather than the process.
+---
+ include/signal.h        | 16 +++++++++++++---
+ src/time/timer_create.c |  8 ++++++--
+ 2 files changed, 19 insertions(+), 5 deletions(-)
+
+diff --git a/include/signal.h b/include/signal.h
+index fbdf667b2..9ed929e4f 100644
+--- a/include/signal.h
++++ b/include/signal.h
+@@ -180,14 +180,24 @@ struct sigevent {
+ 	union sigval sigev_value;
+ 	int sigev_signo;
+ 	int sigev_notify;
+-	void (*sigev_notify_function)(union sigval);
+-	pthread_attr_t *sigev_notify_attributes;
+-	char __pad[56-3*sizeof(long)];
++	union {
++		char __pad[64 - 2*sizeof(int) - sizeof(union sigval)];
++		pid_t sigev_notify_thread_id;
++		struct {
++			void (*sigev_notify_function)(union sigval);
++			pthread_attr_t *sigev_notify_attributes;
++		} __sev_thread;
++	} __sev_fields;
+ };
+ 
++#define sigev_notify_thread_id __sev_fields.sigev_notify_thread_id
++#define sigev_notify_function __sev_fields.__sev_thread.sigev_notify_function
++#define sigev_notify_attributes __sev_fields.__sev_thread.sigev_notify_attributes
++
+ #define SIGEV_SIGNAL 0
+ #define SIGEV_NONE 1
+ #define SIGEV_THREAD 2
++#define SIGEV_THREAD_ID 4
+ 
+ int __libc_current_sigrtmin(void);
+ int __libc_current_sigrtmax(void);
+diff --git a/src/time/timer_create.c b/src/time/timer_create.c
+index 5ddfda278..4bef23905 100644
+--- a/src/time/timer_create.c
++++ b/src/time/timer_create.c
+@@ -71,11 +71,15 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 	switch (evp ? evp->sigev_notify : SIGEV_SIGNAL) {
+ 	case SIGEV_NONE:
+ 	case SIGEV_SIGNAL:
++	case SIGEV_THREAD_ID:
+ 		if (evp) {
+ 			ksev.sigev_value = evp->sigev_value;
+ 			ksev.sigev_signo = evp->sigev_signo;
+ 			ksev.sigev_notify = evp->sigev_notify;
+-			ksev.sigev_tid = 0;
++			if (evp->sigev_notify == SIGEV_THREAD_ID)
++				ksev.sigev_tid = evp->sigev_notify_thread_id;
++			else
++				ksev.sigev_tid = 0;
+ 			ksevp = &ksev;
+ 		}
+ 		if (syscall(SYS_timer_create, clk, ksevp, &timerid) < 0)
+@@ -107,7 +111,7 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 
+ 		ksev.sigev_value.sival_ptr = 0;
+ 		ksev.sigev_signo = SIGTIMER;
+-		ksev.sigev_notify = 4; /* SIGEV_THREAD_ID */
++		ksev.sigev_notify = SIGEV_THREAD_ID;
+ 		ksev.sigev_tid = td->tid;
+ 		if (syscall(SYS_timer_create, clk, &ksev, &timerid) < 0)
+ 			timerid = -1;
diff --git a/srcpkgs/musl/template b/srcpkgs/musl/template
index 5bdc5c48e623..34e6ed4fba6e 100644
--- a/srcpkgs/musl/template
+++ b/srcpkgs/musl/template
@@ -2,7 +2,7 @@
 pkgname=musl
 reverts="1.2.0_1"
 version=1.1.24
-revision=10
+revision=11
 archs="*-musl"
 bootstrap=yes
 build_style=gnu-configure

From c4fcfde207b2a1777ac3b8a8d429a7bcb20b73f1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 21:01:43 -0700
Subject: [PATCH 08/38] gcc-multilib: update to 12.2.0.

---
 srcpkgs/gcc-multilib/template | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index fcd25755aa75..03212e05df7b 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,16 +3,15 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _majorver="${version%.*}"
-wrksrc=gcc-${version/pre/_pre}
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel

From 65779479860aec3d1a35fe6f0208867f2193fdd1 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Tue, 4 Oct 2022 03:49:13 -0700
Subject: [PATCH 09/38] libgccjit: update to 12.2.0.

---
 srcpkgs/libgccjit/files/libgccjit-musl.patch | 63 --------------------
 srcpkgs/libgccjit/template                   | 22 +++----
 2 files changed, 9 insertions(+), 76 deletions(-)
 delete mode 100644 srcpkgs/libgccjit/files/libgccjit-musl.patch

diff --git a/srcpkgs/libgccjit/files/libgccjit-musl.patch b/srcpkgs/libgccjit/files/libgccjit-musl.patch
deleted file mode 100644
index d2ed16928c82..000000000000
--- a/srcpkgs/libgccjit/files/libgccjit-musl.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-diff --git a/gcc/jit/jit-playback.c b/gcc/jit/jit-playback.c
-index 5bccf591a..35f5e35ef 100644
---- a/gcc/jit/jit-playback.c
-+++ b/gcc/jit/jit-playback.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -41,8 +43,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "diagnostic.h"
- #include "stmt.h"
- 
--#include <pthread.h>
--
- #include "jit-playback.h"
- #include "jit-result.h"
- #include "jit-builtins.h"
-diff --git a/gcc/jit/jit-recording.c b/gcc/jit/jit-recording.c
-index a237d574f..5785e3269 100644
---- a/gcc/jit/jit-recording.c
-+++ b/gcc/jit/jit-recording.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -25,8 +27,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "pretty-print.h"
- #include "toplev.h"
- 
--#include <pthread.h>
--
- #include "jit-builtins.h"
- #include "jit-recording.h"
- #include "jit-playback.h"
-diff --git a/gcc/jit/libgccjit.c b/gcc/jit/libgccjit.c
-index f9c33c63c..75f21d275 100644
---- a/gcc/jit/libgccjit.c
-+++ b/gcc/jit/libgccjit.c
-@@ -18,13 +18,13 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
- #include "timevar.h"
- #include "typed-splay-tree.h"
- #include "cppbuiltin.h"
--#include <pthread.h>
- 
- #include "libgccjit.h"
- #include "jit-recording.h"
diff --git a/srcpkgs/libgccjit/template b/srcpkgs/libgccjit/template
index 6f1d6256dcd6..b2ce8037a0b9 100644
--- a/srcpkgs/libgccjit/template
+++ b/srcpkgs/libgccjit/template
@@ -3,35 +3,31 @@
 # which use the version number.
 
 pkgname=libgccjit
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _patchver="${version%pre*}"
 _minorver="${_patchver%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
-wrksrc=gcc-${version/pre/_pre}
+_mpc_version=1.2.1
+_isl_version=0.24
 short_desc="Just-In-Time Compilation library for GCC"
 maintainer="Lane Biocini <lane@mailbox.org>"
 homepage="https://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 nopie=yes
 lib32disabled=yes
 makedepends="zlib-devel"

From a6b191b2420de0113b7254a91f0bc4d6cd3b6cb8 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 14 Aug 2022 19:29:36 -0700
Subject: [PATCH 10/38] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove -no-pie from build. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..5d40f0cdd8a6 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -53,6 +53,7 @@ _void_cross_build_binutils() {
 		--sbindir=/usr/bin \
 		--libdir=/usr/lib \
 		--libexecdir=/usr/lib \
+		--sysconfdir=/etc \
 		--target=${tgt} \
 		--with-sysroot=/usr/${tgt} \
 		--disable-nls \
@@ -60,7 +61,9 @@ _void_cross_build_binutils() {
 		--disable-multilib \
 		--disable-werror \
 		--disable-gold \
+		--disable-gprofng \
 		--enable-relro \
+		--enable-new-dtags \
 		--enable-plugins \
 		--enable-64-bit-bfd \
 		--enable-deterministic-archives \
@@ -132,6 +135,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -460,6 +464,14 @@ do_build() {
 	local binutils_ver linux_ver gcc_ver libc_ver libucontext_ver
 	local tgt=${sourcepkg/cross-}
 
+	export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}"
+	export CXXFLAGS="${CXXFLAGS/-D_FORTIFY_SOURCE=2/}"
+
+	# Disable explicit -fno-PIE, gcc/binutils/libc will figure this out itself.
+	export CFLAGS="${CFLAGS//-fno-PIE/}"
+	export CXXFLAGS="${CXXFLAGS//-fno-PIE/}"
+	export LDFLAGS="${LDFLAGS//-no-pie/}"
+
 	_void_cross_test_ver binutils
 	_void_cross_test_ver linux
 	_void_cross_test_ver gcc
@@ -625,6 +637,9 @@ do_install() {
 	# then remove it because it conflicts with libquadmath package
 	rm -rf ${DESTDIR}/${sysroot}/usr/lib/libquadmath.*
 
+	# Remove libdep linker plugin because it conflicts with system binutils
+	rm -f ${DESTDIR}/usr/lib/bfd-plugins/libdep*
+
 	# Remove leftover symlinks
 	rm -f ${DESTDIR}/usr/lib${XBPS_TARGET_WORDSIZE}
 	rm -f ${DESTDIR}/lib*

From 9631b51119b48e3625f78477b9c380703fb61a27 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:09:31 -0700
Subject: [PATCH 11/38] linux5.18: update dotconfigs for gcc12

---
 srcpkgs/linux5.18/files/x86_64-dotconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/linux5.18/files/x86_64-dotconfig b/srcpkgs/linux5.18/files/x86_64-dotconfig
index 4e73a3195d40..ea6204868e23 100644
--- a/srcpkgs/linux5.18/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.18/files/x86_64-dotconfig
@@ -512,6 +512,7 @@ CONFIG_RETHUNK=y
 CONFIG_CPU_UNRET_ENTRY=y
 CONFIG_CPU_IBPB_ENTRY=y
 CONFIG_CPU_IBRS_ENTRY=y
+CONFIG_SLS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10060,8 +10061,11 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
 # Memory initialization
 #
 CONFIG_INIT_STACK_NONE=y
+# CONFIG_INIT_STACK_ALL_PATTERN is not set
+# CONFIG_INIT_STACK_ALL_ZERO is not set
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
+# CONFIG_ZERO_CALL_USED_REGS is not set
 # end of Memory initialization
 # end of Kernel hardening options
 # end of Security options
@@ -10538,6 +10542,7 @@ CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
 # CONFIG_UBSAN is not set
 CONFIG_HAVE_ARCH_KCSAN=y
+# CONFIG_KCSAN is not set
 # end of Generic Kernel Debugging Instruments
 
 #

From 3f46891d9fa610f22cbd63cf7ccb50f9e7e893fd Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 14:45:28 -0700
Subject: [PATCH 12/38] libsasl: fix build for libtool 2.4.7

---
 srcpkgs/libsasl/template | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/libsasl/template b/srcpkgs/libsasl/template
index a8817042f843..a2993b39f4a1 100644
--- a/srcpkgs/libsasl/template
+++ b/srcpkgs/libsasl/template
@@ -19,6 +19,7 @@ distfiles="https://github.com/cyrusimap/cyrus-sasl/releases/download/cyrus-sasl-
 checksum=26866b1549b00ffd020f188a43c258017fa1c382b3ddadd8201536f72efb05d5
 
 pre_configure() {
+	rm -f m4/ltversion.m4
 	autoreconf -fi
 }
 

From 40b90c7d5a0d0eb63ab0c03b6cd0d00223d1b14f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:08 -0700
Subject: [PATCH 13/38] subversion: fix build for libtool 2.4.7

---
 srcpkgs/subversion/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion/template b/srcpkgs/subversion/template
index 18c35e3a2132..4c32a6342c6a 100644
--- a/srcpkgs/subversion/template
+++ b/srcpkgs/subversion/template
@@ -59,7 +59,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From 0d9763b7903aa83f99993fd1e6253d61a5ea6043 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:38 -0700
Subject: [PATCH 14/38] subversion-kwallet-auth: fix build for libtool 2.4.7

---
 srcpkgs/subversion-kwallet-auth/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/subversion-kwallet-auth/template b/srcpkgs/subversion-kwallet-auth/template
index 12210f250d51..b4d8621456ea 100644
--- a/srcpkgs/subversion-kwallet-auth/template
+++ b/srcpkgs/subversion-kwallet-auth/template
@@ -59,7 +59,7 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+	./autogen.sh --release
 }
 
 post_configure() {

From 35c92b62a2a5c19b73ee054350da575e734f0fad Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 15/38] cross-aarch64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..bd6b23f9fb6a 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From df35c29522c0d817fd79111fc08ac2f913e730dc Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 16/38] cross-aarch64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..427ad2c1e9cd 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 50c62cb01232beceb7925af610bb062ebf8d7444 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 17/38] cross-arm-linux-gnueabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..2510ee26e789 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From d43f81b6b588743ad2758ac098ceb2e5a083cdc2 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 18/38] cross-arm-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..bd8b16e1b4c1 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From dc71701133cbb036f586c8ec5849041222af50ca Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 19/38] cross-arm-linux-musleabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..dacfd2655216 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From d95cb0136f89830c0f91c6ac1abb0d71e49f58d7 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 20/38] cross-arm-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..9ddd32a9f20d 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From c1034c31b7efbc914e3e3fb6be85f472c9439eeb Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 21/38] cross-armv7l-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..9fb00f18be3b 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From d0b05fe9e47016c99419b1ca36d538f7afc483b1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 22/38] cross-armv7l-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..2c72e75ddfe3 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 6f2f3e3a3b1638673c916c9bd6ccaddde1c25b1a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 23/38] cross-i686-pc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..4dc17df648b5 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 1f387947a69f7b1aa091449a1ffa5af7d097b548 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Fri, 16 Sep 2022 20:52:19 -0700
Subject: [PATCH 24/38] cross-i686-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-linux-musl/template b/srcpkgs/cross-i686-linux-musl/template
index 8be16a230d8d..78b4d813a113 100644
--- a/srcpkgs/cross-i686-linux-musl/template
+++ b/srcpkgs/cross-i686-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-i686-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-i686-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 7095b61b6db2f66bcbfad0ac43112b9e65d1eb1d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 25/38] cross-mips-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..6009e5c79eb2 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 22113d21fc3507dd336bcf30984034f9fa0039f7 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 26/38] cross-mips-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..080164df193d 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="hipperson0 <hipperson0@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From c5bb2d7b18e420669f3c5ff98e0a9259ebb4b33a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 27/38] cross-mipsel-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..f9fd4b8a04ef 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 0e0ebe4ca0536da9e70e232916abf47485e55967 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 28/38] cross-mipsel-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..7418a984474b 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 8e581eb1c6ebc170c05c50f15eb1e432f8c36f68 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 29/38] cross-powerpc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..31e57b4e52b2 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 47eb9a0496d53abe4c797396799d73f9c6ebefb8 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 30/38] cross-powerpc-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..a2d1edcf1ffd 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 6fd4a9dc9affe2e6008968e2c33d6715f1c01296 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 31/38] cross-powerpc64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..1a4cbed61e76 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From c680664cebd665a4d3263896ab775c556bbe7c18 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 32/38] cross-powerpc64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 016f18776a6d..19b1ff859eb6 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 7346dbff8cdec268be24d39979f28a1f20ce0acb Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 33/38] cross-powerpc64le-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 463d7e92d20d..9d99a3a315d2 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 23067b5683636b68eb399485dd578b22917ad584 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 34/38] cross-powerpc64le-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index c17a3cccfe29..3128baa7372e 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 6697d54ac5f1de097c7813b47e623d6c644f9d38 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 35/38] cross-powerpcle-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 9aede3c465ce..6f914b3877ee 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 1ee23febd0096c92f92c03bfb0d96f7c4e5ff0c1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 36/38] cross-powerpcle-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index 045cfda987fe..20e70bed4c60 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 5a78efcc3f881d4745925861ed55c45afcc89351 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 37/38] cross-x86_64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 8918f3c22a1c..5219cd50f851 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 093bda87de4cbd44cac52f16b0cbffa460ae78eb Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 38/38] cross-x86_64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..2811de0d3c2e 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (154 preceding siblings ...)
  2022-10-04 11:02 ` oreo639
@ 2022-10-04 11:09 ` oreo639
  2022-10-04 20:04 ` paper42
                   ` (108 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-10-04 11:09 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5256 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.2.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.2.0

Saved for future reference: paper has a list of failing builds here (some may be already fixed or may be unrelated to this PR): https://vasilek.cz/logs/lab/bad/

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [x] llvm https://github.com/void-linux/void-packages/pull/38694
- [x] m4 https://github.com/void-linux/void-packages/pull/33730
- [x] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [x] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [x] libvirt https://github.com/void-linux/void-packages/pull/38842
- [x] syslinux https://github.com/void-linux/void-packages/pull/38876
- [x] efivar https://github.com/void-linux/void-packages/pull/38874

Known packages that needed to be fixed/updated for gcc12:
- [ ] linux5.18 (in this PR)
- [x] openssh https://github.com/void-linux/void-packages/pull/38849
- [x] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [x] doxygen https://github.com/void-linux/void-packages/pull/38846
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] libproxy https://github.com/void-linux/void-packages/pull/38818
- [x] exempi https://github.com/void-linux/void-packages/pull/38820
- [x] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [ ] gpgme https://github.com/void-linux/void-packages/pull/38825
- [x] libunique1 https://github.com/void-linux/void-packages/pull/38848 or https://github.com/void-linux/void-packages/pull/38873
- [x] libwpd https://github.com/void-linux/void-packages/pull/38878

Needs to be fixed/updated for binutils:
- [x] grub https://github.com/void-linux/void-packages/pull/38875
- [x] linux-tools https://github.com/void-linux/void-packages/pull/38877
- [x] kcov https://github.com/void-linux/void-packages/pull/39291

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [x] kde
- [x] lxde
- [x] lxqt

You can test the ISOs here:
https://drive.google.com/drive/folders/1ix92CYSLUP-KWjLxltdgG4e8Nu2JCY5n?usp=sharing

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 118709 bytes --]

From e3db94502c1488e8fdc07408ac8b777ce7c68a71 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 01/37] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../fix-libcollector-without-java.patch       | 53 +++++++++++++++
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 22 +++++--
 4 files changed, 86 insertions(+), 115 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
 create mode 100644 srcpkgs/binutils/patches/fix-libcollector-without-java.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/fix-libcollector-without-java.patch b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
new file mode 100644
index 000000000000..54384875f358
--- /dev/null
+++ b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
@@ -0,0 +1,53 @@
+From 49ddd814ac1071af7c4f45d5f8398b91862f2c7f Mon Sep 17 00:00:00 2001
+From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
+Date: Wed, 17 Aug 2022 19:55:23 -0700
+Subject: [PATCH] gprofng: fix bug 29479 Collection fails when built without
+ java support
+
+gprofng/ChangeLog
+2022-08-17  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>
+
+	PR gprofng/29479
+	* libcollector/collector.c: Add #if defined(GPROFNG_JAVA_PROFILING) for
+	java specific code.
+	* libcollector/unwind.c: Likewise.
+---
+ gprofng/libcollector/collector.c | 2 ++
+ gprofng/libcollector/unwind.c    | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/gprofng/libcollector/collector.c b/gprofng/libcollector/collector.c
+index 93c9d3330de5..ceff2c1caccb 100644
+--- a/gprofng/libcollector/collector.c
++++ b/gprofng/libcollector/collector.c
+@@ -913,8 +913,10 @@ __collector_open_experiment (const char *exp, const char *params, sp_origin_t or
+   __collector_ext_unwind_key_init (1, NULL);
+ 
+   /* start java attach if suitable */
++#if defined(GPROFNG_JAVA_PROFILING)
+   if (exp_origin == SP_ORIGIN_DBX_ATTACH)
+     __collector_jprofile_start_attach ();
++#endif
+   start_sec_time = CALL_UTIL (time)(NULL);
+   __collector_start_time = collector_interface.getHiResTime ();
+   TprintfT (DBG_LT0, "\t__collector_open_experiment; resetting start_time\n");
+diff --git a/gprofng/libcollector/unwind.c b/gprofng/libcollector/unwind.c
+index 119243788020..f8e11823c81e 100644
+--- a/gprofng/libcollector/unwind.c
++++ b/gprofng/libcollector/unwind.c
+@@ -557,6 +557,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+   int size = max_frame_size;
+ 
+ #define MIN(a,b) ((a)<(b)?(a):(b))
++#if defined(GPROFNG_JAVA_PROFILING)
+   /* get Java info */
+   if (__collector_java_mode && __collector_java_asyncgetcalltrace_loaded && context && !pseudo_context)
+     {
+@@ -569,6 +570,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+ 	  size -= sz;
+ 	}
+     }
++#endif
+ 
+   /* get native stack */
+   if (context)
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..79cd4e2b7c1f 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkgconf"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -44,6 +45,12 @@ do_configure() {
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	# gprofng currently only supports x86 and aarch64 glibc.
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64|i386|aarch64) conf+=" --enable-gprofng" ;;
+		*) conf+=" --disable-gprofng" ;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"
@@ -76,13 +83,15 @@ do_configure() {
 		--libdir=/usr/lib \
 		--mandir=/usr/share/man \
 		--infodir=/usr/share/info \
+		--sysconfdir=/etc \
 		--disable-werror \
-		--disable-shared \
 		--disable-nls \
+		--enable-shared \
 		--enable-threads \
 		--enable-plugins \
 		--enable-relro \
 		--enable-gold \
+		--enable-new-dtags \
 		--enable-deterministic-archives \
 		--enable-64-bit-bfd \
 		--enable-ld=default \
@@ -142,7 +151,8 @@ binutils-devel_package() {
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/*.a"
-		vmove "usr/lib/*.so"
+		vmove "usr/lib/libbfd.so"
+		vmove "usr/lib/libopcodes.so"
 	}
 }
 

From 37d2b1aec79b17a60744f35ad868fb595822ae55 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 2 Oct 2022 16:46:59 -0700
Subject: [PATCH 02/37] gdb: resolve conflict with binutils 2.39

---
 srcpkgs/gdb/template | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/gdb/template b/srcpkgs/gdb/template
index ff7c9d9a5911..5970402eb27e 100644
--- a/srcpkgs/gdb/template
+++ b/srcpkgs/gdb/template
@@ -1,7 +1,7 @@
 # Template file for 'gdb'
 pkgname=gdb
 version=12.1
-revision=1
+revision=2
 build_style=gnu-configure
 pycompile_dirs="/usr/share/gdb/python"
 configure_args="--disable-werror --disable-nls --with-system-readline
@@ -48,7 +48,8 @@ vopt_conflict debuginfod static
 
 post_install() {
 	# resolve conflicts with binutils
-	rm -r ${DESTDIR}/usr/{include,lib,share/info/bfd.info*}
+	rm -rf ${DESTDIR}/usr/{include,lib}
+	rm -rf ${DESTDIR}/usr/share/info/{bfd,ctf-spec}.info*
 }
 
 gdb-common_package() {

From 718f25128f938e69900b0b4402c7464c0582734e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 03/37] gcc: update to 12.2.0.

---
 common/shlibs                                 | 10 +--
 srcpkgs/gcc/files/gccgo-musl.patch            | 71 +++----------------
 srcpkgs/gcc/files/libgnarl-musl.patch         | 18 ++---
 srcpkgs/gcc/files/libssp-musl.patch           | 10 +--
 srcpkgs/gcc/patches/libffi_gnulinux.patch     | 11 ---
 .../gcc/patches/libgcc-ibm128-no-tag.patch    | 10 ++-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |  2 +-
 srcpkgs/gcc/template                          | 26 +++----
 8 files changed, 49 insertions(+), 109 deletions(-)
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index 5d4b0a9899ad..dac3556fb949 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.2.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.36 perl-5.36.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -847,8 +847,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.2.0_1
+libgnat-12.so libada-12.2.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1697,8 +1697,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.2.0_1
+libasan.so.8 libsanitizer-12.2.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..12ec68dd8aa3 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,14 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ b/libgo/go/runtime/os_linux.go
+@@ -365,7 +365,7 @@ func setThreadCPUProfiler(hz int32) {
+ 	var sevp _sigevent
+ 	sevp.sigev_notify = _SIGEV_THREAD_ID
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.__sev_fields))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..658670793168 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,35 +3,31 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
+version=12.2.0
+revision=1
 _patchver="${version%pre*}"
 _minorver="${_patchver%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
-wrksrc=gcc-${version/pre/_pre}
+_mpc_version=1.2.1
+_isl_version=0.24
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -396,7 +392,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}

From b402cb67dcd608e4eaf98ae68d0fe37a4e62f213 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 04/37] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      | 11 ++++--
 2 files changed, 25 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..51611929d643 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,12 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
+
+if [ "$XBPS_LIBC" == "musl" ]; then
+	# Musl always searches LD_LIBRARY_PATH before RPATH and RUNPATH
+	make_build_args="lt_cv_shlibpath_overrides_runpath=yes"
+fi
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From 6e6a7cd9951addad3c6f4577f03d5f62d03fc04b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 05/37] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 55255dceae8b..ca2d858a7abc 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From 44345b502f9f6a7ef28955bea3fe9939d80bc435 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 06/37] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 3 files changed, 55 insertions(+), 353 deletions(-)
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index dac3556fb949..bf246b638dae 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From cbb5a04056ab42d355c869acb2a2f5c567289043 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Wed, 14 Sep 2022 03:48:32 -0700
Subject: [PATCH 07/37] musl: add support for SIGEV_THREAD_ID timers

https://git.musl-libc.org/cgit/musl/commit/?id=7c71792e87691451f2a6b76348e83ad1889f1dcb
---
 ...d-support-for-SIGEV_THREAD_ID-timers.patch | 74 +++++++++++++++++++
 srcpkgs/musl/template                         |  2 +-
 2 files changed, 75 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch

diff --git a/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
new file mode 100644
index 000000000000..e20dff5ba0d4
--- /dev/null
+++ b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
@@ -0,0 +1,74 @@
+From 7c71792e87691451f2a6b76348e83ad1889f1dcb Mon Sep 17 00:00:00 2001
+From: James Y Knight <jyknight@google.com>
+Date: Sun, 30 Jun 2019 21:55:20 -0400
+Subject: [PATCH] add support for SIGEV_THREAD_ID timers
+
+This is like SIGEV_SIGNAL, but targeted to a particular thread's
+tid, rather than the process.
+---
+ include/signal.h        | 16 +++++++++++++---
+ src/time/timer_create.c |  8 ++++++--
+ 2 files changed, 19 insertions(+), 5 deletions(-)
+
+diff --git a/include/signal.h b/include/signal.h
+index fbdf667b2..9ed929e4f 100644
+--- a/include/signal.h
++++ b/include/signal.h
+@@ -180,14 +180,24 @@ struct sigevent {
+ 	union sigval sigev_value;
+ 	int sigev_signo;
+ 	int sigev_notify;
+-	void (*sigev_notify_function)(union sigval);
+-	pthread_attr_t *sigev_notify_attributes;
+-	char __pad[56-3*sizeof(long)];
++	union {
++		char __pad[64 - 2*sizeof(int) - sizeof(union sigval)];
++		pid_t sigev_notify_thread_id;
++		struct {
++			void (*sigev_notify_function)(union sigval);
++			pthread_attr_t *sigev_notify_attributes;
++		} __sev_thread;
++	} __sev_fields;
+ };
+ 
++#define sigev_notify_thread_id __sev_fields.sigev_notify_thread_id
++#define sigev_notify_function __sev_fields.__sev_thread.sigev_notify_function
++#define sigev_notify_attributes __sev_fields.__sev_thread.sigev_notify_attributes
++
+ #define SIGEV_SIGNAL 0
+ #define SIGEV_NONE 1
+ #define SIGEV_THREAD 2
++#define SIGEV_THREAD_ID 4
+ 
+ int __libc_current_sigrtmin(void);
+ int __libc_current_sigrtmax(void);
+diff --git a/src/time/timer_create.c b/src/time/timer_create.c
+index 5ddfda278..4bef23905 100644
+--- a/src/time/timer_create.c
++++ b/src/time/timer_create.c
+@@ -71,11 +71,15 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 	switch (evp ? evp->sigev_notify : SIGEV_SIGNAL) {
+ 	case SIGEV_NONE:
+ 	case SIGEV_SIGNAL:
++	case SIGEV_THREAD_ID:
+ 		if (evp) {
+ 			ksev.sigev_value = evp->sigev_value;
+ 			ksev.sigev_signo = evp->sigev_signo;
+ 			ksev.sigev_notify = evp->sigev_notify;
+-			ksev.sigev_tid = 0;
++			if (evp->sigev_notify == SIGEV_THREAD_ID)
++				ksev.sigev_tid = evp->sigev_notify_thread_id;
++			else
++				ksev.sigev_tid = 0;
+ 			ksevp = &ksev;
+ 		}
+ 		if (syscall(SYS_timer_create, clk, ksevp, &timerid) < 0)
+@@ -107,7 +111,7 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 
+ 		ksev.sigev_value.sival_ptr = 0;
+ 		ksev.sigev_signo = SIGTIMER;
+-		ksev.sigev_notify = 4; /* SIGEV_THREAD_ID */
++		ksev.sigev_notify = SIGEV_THREAD_ID;
+ 		ksev.sigev_tid = td->tid;
+ 		if (syscall(SYS_timer_create, clk, &ksev, &timerid) < 0)
+ 			timerid = -1;
diff --git a/srcpkgs/musl/template b/srcpkgs/musl/template
index 5bdc5c48e623..34e6ed4fba6e 100644
--- a/srcpkgs/musl/template
+++ b/srcpkgs/musl/template
@@ -2,7 +2,7 @@
 pkgname=musl
 reverts="1.2.0_1"
 version=1.1.24
-revision=10
+revision=11
 archs="*-musl"
 bootstrap=yes
 build_style=gnu-configure

From c4fcfde207b2a1777ac3b8a8d429a7bcb20b73f1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 21:01:43 -0700
Subject: [PATCH 08/37] gcc-multilib: update to 12.2.0.

---
 srcpkgs/gcc-multilib/template | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index fcd25755aa75..03212e05df7b 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,16 +3,15 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _majorver="${version%.*}"
-wrksrc=gcc-${version/pre/_pre}
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel

From 65779479860aec3d1a35fe6f0208867f2193fdd1 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Tue, 4 Oct 2022 03:49:13 -0700
Subject: [PATCH 09/37] libgccjit: update to 12.2.0.

---
 srcpkgs/libgccjit/files/libgccjit-musl.patch | 63 --------------------
 srcpkgs/libgccjit/template                   | 22 +++----
 2 files changed, 9 insertions(+), 76 deletions(-)
 delete mode 100644 srcpkgs/libgccjit/files/libgccjit-musl.patch

diff --git a/srcpkgs/libgccjit/files/libgccjit-musl.patch b/srcpkgs/libgccjit/files/libgccjit-musl.patch
deleted file mode 100644
index d2ed16928c82..000000000000
--- a/srcpkgs/libgccjit/files/libgccjit-musl.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-diff --git a/gcc/jit/jit-playback.c b/gcc/jit/jit-playback.c
-index 5bccf591a..35f5e35ef 100644
---- a/gcc/jit/jit-playback.c
-+++ b/gcc/jit/jit-playback.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -41,8 +43,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "diagnostic.h"
- #include "stmt.h"
- 
--#include <pthread.h>
--
- #include "jit-playback.h"
- #include "jit-result.h"
- #include "jit-builtins.h"
-diff --git a/gcc/jit/jit-recording.c b/gcc/jit/jit-recording.c
-index a237d574f..5785e3269 100644
---- a/gcc/jit/jit-recording.c
-+++ b/gcc/jit/jit-recording.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -25,8 +27,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "pretty-print.h"
- #include "toplev.h"
- 
--#include <pthread.h>
--
- #include "jit-builtins.h"
- #include "jit-recording.h"
- #include "jit-playback.h"
-diff --git a/gcc/jit/libgccjit.c b/gcc/jit/libgccjit.c
-index f9c33c63c..75f21d275 100644
---- a/gcc/jit/libgccjit.c
-+++ b/gcc/jit/libgccjit.c
-@@ -18,13 +18,13 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
- #include "timevar.h"
- #include "typed-splay-tree.h"
- #include "cppbuiltin.h"
--#include <pthread.h>
- 
- #include "libgccjit.h"
- #include "jit-recording.h"
diff --git a/srcpkgs/libgccjit/template b/srcpkgs/libgccjit/template
index 6f1d6256dcd6..b2ce8037a0b9 100644
--- a/srcpkgs/libgccjit/template
+++ b/srcpkgs/libgccjit/template
@@ -3,35 +3,31 @@
 # which use the version number.
 
 pkgname=libgccjit
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _patchver="${version%pre*}"
 _minorver="${_patchver%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
-wrksrc=gcc-${version/pre/_pre}
+_mpc_version=1.2.1
+_isl_version=0.24
 short_desc="Just-In-Time Compilation library for GCC"
 maintainer="Lane Biocini <lane@mailbox.org>"
 homepage="https://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 nopie=yes
 lib32disabled=yes
 makedepends="zlib-devel"

From a6b191b2420de0113b7254a91f0bc4d6cd3b6cb8 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 14 Aug 2022 19:29:36 -0700
Subject: [PATCH 10/37] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove -no-pie from build. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..5d40f0cdd8a6 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -53,6 +53,7 @@ _void_cross_build_binutils() {
 		--sbindir=/usr/bin \
 		--libdir=/usr/lib \
 		--libexecdir=/usr/lib \
+		--sysconfdir=/etc \
 		--target=${tgt} \
 		--with-sysroot=/usr/${tgt} \
 		--disable-nls \
@@ -60,7 +61,9 @@ _void_cross_build_binutils() {
 		--disable-multilib \
 		--disable-werror \
 		--disable-gold \
+		--disable-gprofng \
 		--enable-relro \
+		--enable-new-dtags \
 		--enable-plugins \
 		--enable-64-bit-bfd \
 		--enable-deterministic-archives \
@@ -132,6 +135,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -460,6 +464,14 @@ do_build() {
 	local binutils_ver linux_ver gcc_ver libc_ver libucontext_ver
 	local tgt=${sourcepkg/cross-}
 
+	export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}"
+	export CXXFLAGS="${CXXFLAGS/-D_FORTIFY_SOURCE=2/}"
+
+	# Disable explicit -fno-PIE, gcc/binutils/libc will figure this out itself.
+	export CFLAGS="${CFLAGS//-fno-PIE/}"
+	export CXXFLAGS="${CXXFLAGS//-fno-PIE/}"
+	export LDFLAGS="${LDFLAGS//-no-pie/}"
+
 	_void_cross_test_ver binutils
 	_void_cross_test_ver linux
 	_void_cross_test_ver gcc
@@ -625,6 +637,9 @@ do_install() {
 	# then remove it because it conflicts with libquadmath package
 	rm -rf ${DESTDIR}/${sysroot}/usr/lib/libquadmath.*
 
+	# Remove libdep linker plugin because it conflicts with system binutils
+	rm -f ${DESTDIR}/usr/lib/bfd-plugins/libdep*
+
 	# Remove leftover symlinks
 	rm -f ${DESTDIR}/usr/lib${XBPS_TARGET_WORDSIZE}
 	rm -f ${DESTDIR}/lib*

From 9631b51119b48e3625f78477b9c380703fb61a27 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:09:31 -0700
Subject: [PATCH 11/37] linux5.18: update dotconfigs for gcc12

---
 srcpkgs/linux5.18/files/x86_64-dotconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/linux5.18/files/x86_64-dotconfig b/srcpkgs/linux5.18/files/x86_64-dotconfig
index 4e73a3195d40..ea6204868e23 100644
--- a/srcpkgs/linux5.18/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.18/files/x86_64-dotconfig
@@ -512,6 +512,7 @@ CONFIG_RETHUNK=y
 CONFIG_CPU_UNRET_ENTRY=y
 CONFIG_CPU_IBPB_ENTRY=y
 CONFIG_CPU_IBRS_ENTRY=y
+CONFIG_SLS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10060,8 +10061,11 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
 # Memory initialization
 #
 CONFIG_INIT_STACK_NONE=y
+# CONFIG_INIT_STACK_ALL_PATTERN is not set
+# CONFIG_INIT_STACK_ALL_ZERO is not set
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
+# CONFIG_ZERO_CALL_USED_REGS is not set
 # end of Memory initialization
 # end of Kernel hardening options
 # end of Security options
@@ -10538,6 +10542,7 @@ CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
 # CONFIG_UBSAN is not set
 CONFIG_HAVE_ARCH_KCSAN=y
+# CONFIG_KCSAN is not set
 # end of Generic Kernel Debugging Instruments
 
 #

From b42296c9d14f21dc0d165d2f251008cba83aa52a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:08 -0700
Subject: [PATCH 12/37] subversion: fix build for libtool 2.4.7

---
 srcpkgs/subversion/template | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/subversion/template b/srcpkgs/subversion/template
index 18c35e3a2132..0aa41212c5fd 100644
--- a/srcpkgs/subversion/template
+++ b/srcpkgs/subversion/template
@@ -24,6 +24,8 @@ distfiles="http://apache.uvigo.es/subversion/subversion-${version}.tar.bz2"
 checksum=c9130e8d0b75728a66f0e7038fc77052e671830d785b5616aad53b4810d3cc28
 
 pre_configure() {
+	./autogen.sh --release
+
 	# Based on native build values
 	cat <<-EOF >config.cache
 	ac_cv_python_includes=-I${XBPS_CROSS_BASE}/usr/include/python${py3_ver}
@@ -59,7 +61,12 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+
+	if [ "$XBPS_BUILD_ENVIRONMENT" = "void-packages-ci" ]; then
+		# This test will fail when run as the root user,
+		# because flock() will ignore file permissions.
+		vsed -i subversion/tests/libsvn_fs/locks-test.c -e '/SVN_TEST_OPTS_PASS(obtain_write_lock_failure,/,+3d'
+	fi
 }
 
 post_configure() {

From b56a1e144fc42351e083d0bc1eb2d907ae1d7925 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:38 -0700
Subject: [PATCH 13/37] subversion-kwallet-auth: update to 1.14.2.

Fix failing distfiles.
Fix build for libtool 2.4.7
---
 srcpkgs/subversion-kwallet-auth/template | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/subversion-kwallet-auth/template b/srcpkgs/subversion-kwallet-auth/template
index 12210f250d51..9cc68c3fe5f1 100644
--- a/srcpkgs/subversion-kwallet-auth/template
+++ b/srcpkgs/subversion-kwallet-auth/template
@@ -3,7 +3,7 @@
 # THIS PKG MUST BE SYNCHRONIZED WITH "srcpkgs/subversion".
 #
 pkgname=subversion-kwallet-auth
-version=1.14.1
+version=1.14.2
 revision=1
 wrksrc="subversion-${version}"
 build_style=gnu-configure
@@ -22,10 +22,12 @@ license="Apache-2.0, BSD-3-Clause"
 homepage="http://subversion.apache.org/"
 changelog="https://subversion.apache.org/docs/release-notes/${version%.*}.html"
 distfiles="http://apache.uvigo.es/subversion/subversion-${version}.tar.bz2"
-checksum=2c5da93c255d2e5569fa91d92457fdb65396b0666fad4fd59b22e154d986e1a9
+checksum=c9130e8d0b75728a66f0e7038fc77052e671830d785b5616aad53b4810d3cc28
 lib32disabled=yes
 
 pre_configure() {
+	./autogen.sh --release
+
 	# Based on native build values
 	cat <<-EOF >config.cache
 	ac_cv_python_includes=-I${XBPS_CROSS_BASE}/usr/include/python${py3_ver}
@@ -55,11 +57,18 @@ pre_configure() {
 		cp "$XBPS_CROSS_BASE/usr/lib/perl5/core_perl/Config"*.p? $PERL5LIB
 		cp "$XBPS_CROSS_BASE/usr/lib/perl5/core_perl/Errno.pm" $PERL5LIB
 		vsed -e "s;archlibexp => '\(.*\)';archlibexp => '${XBPS_CROSS_BASE}\1';" \
-			-i $PERL5LIB/Config.pm $PERL5LIB/Config_heavy.pl
+			-i $PERL5LIB/Config.pm
+		vsed -e "s;archlibexp='\(.*\)';archlibexp='${XBPS_CROSS_BASE}\1';" \
+			-i $PERL5LIB/Config_heavy.pl
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+
+	if [ "$XBPS_BUILD_ENVIRONMENT" = "void-packages-ci" ]; then
+		# This test will fail when run as the root user,
+		# because flock() will ignore file permissions.
+		vsed -i subversion/tests/libsvn_fs/locks-test.c -e '/SVN_TEST_OPTS_PASS(obtain_write_lock_failure,/,+3d'
+	fi
 }
 
 post_configure() {

From fad8c4ee6d177d0c1bfeefdc0ee6ee0d02bb142e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 14/37] cross-aarch64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..bd6b23f9fb6a 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From f8591d5276674746d1375f272c0c69a4163d4109 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 15/37] cross-aarch64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..427ad2c1e9cd 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 92caa0a3c3fed0285c4e8a0c5338e6d7b212a2be Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 16/37] cross-arm-linux-gnueabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..2510ee26e789 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 693aa26dff594dba3fcc7c4ee9374d0825110cc5 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 17/37] cross-arm-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..bd8b16e1b4c1 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 27bb76ff6730705833a32cefe0da9f6d6c7176b8 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 18/37] cross-arm-linux-musleabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..dacfd2655216 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 216ea6a8e402ff3ecc1f9dbd117dedf16d35075c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 19/37] cross-arm-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..9ddd32a9f20d 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 16f18d2f03f6250927409aa39e16d7235d552418 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 20/37] cross-armv7l-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..9fb00f18be3b 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From bc8dc72a2d06882d295425dcd9eccca59d7f244f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 21/37] cross-armv7l-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..2c72e75ddfe3 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 5314e857693a7808897e14bd0aa35e3321a788a2 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 22/37] cross-i686-pc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..4dc17df648b5 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 4ff13a3b528025a2ef0b3f0185424944cb20b8f7 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Fri, 16 Sep 2022 20:52:19 -0700
Subject: [PATCH 23/37] cross-i686-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-linux-musl/template b/srcpkgs/cross-i686-linux-musl/template
index 8be16a230d8d..78b4d813a113 100644
--- a/srcpkgs/cross-i686-linux-musl/template
+++ b/srcpkgs/cross-i686-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-i686-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-i686-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 6114009f582fe069acb232c9d74bda1638897683 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 24/37] cross-mips-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..6009e5c79eb2 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From fcdf5e9d47486d38e0d30f42defd7b71672e7d43 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 25/37] cross-mips-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..080164df193d 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="hipperson0 <hipperson0@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From bae6dee81b97308ee7f96856dee4a495604fb54b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 26/37] cross-mipsel-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..f9fd4b8a04ef 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 8773a8afdd7257d3859fc205d677c95b135763d8 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 27/37] cross-mipsel-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..7418a984474b 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From b34a37c24b1bcc4e0330206a1e06a9770b48badb Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 28/37] cross-powerpc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..31e57b4e52b2 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From be6f12eedb5a8b01752d63dacaa7eae6098c6e03 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 29/37] cross-powerpc-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..a2d1edcf1ffd 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 4bc6c7764a008bff4edbb72c836cd0e89404a664 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 30/37] cross-powerpc64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..1a4cbed61e76 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From e452406538a6b2117da9beb1e75aca7ded7c3fe0 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 31/37] cross-powerpc64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 016f18776a6d..19b1ff859eb6 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 8e4a4086d88b11b59cb046192a2d735071fb6252 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 32/37] cross-powerpc64le-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 463d7e92d20d..9d99a3a315d2 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 375f6951c4237fc01e4655ff9b3c1d803abce4fe Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 33/37] cross-powerpc64le-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index c17a3cccfe29..3128baa7372e 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 18480e66f5de2d0cfbbd606a57ac1362e2d124b4 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 34/37] cross-powerpcle-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 9aede3c465ce..6f914b3877ee 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From e3e46ca470abf6c8eedea0fdbf74e657b340b600 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 35/37] cross-powerpcle-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index 045cfda987fe..20e70bed4c60 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 29387842cee6b613b9101dea99d08a9a5d76768d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 36/37] cross-x86_64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 8918f3c22a1c..5219cd50f851 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 2cd1f305c7cee8e7fdde03998331e1657cbd6e28 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 37/37] cross-x86_64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..2811de0d3c2e 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (155 preceding siblings ...)
  2022-10-04 11:09 ` oreo639
@ 2022-10-04 20:04 ` paper42
  2022-10-05  4:27 ` oreo639
                   ` (107 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: paper42 @ 2022-10-04 20:04 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 336 bytes --]

New comment by paper42 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1267516763

Comment:
I think we could use create_wrksrc in gcc and libgccjit, modifying cross-* packages for that would probably require changes to the void-cross build style, so that could be done in a separate PR.

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (156 preceding siblings ...)
  2022-10-04 20:04 ` paper42
@ 2022-10-05  4:27 ` oreo639
  2022-10-05  4:28 ` oreo639
                   ` (106 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-10-05  4:27 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 434 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1267923092

Comment:
> I think we could use create_wrksrc in gcc and libgccjit

Alright. Good idea.

> modifying cross-* packages for that would probably require changes to the void-cross build style, so that could be done in a separate PR.

Those already use `create_wrksrc=yes` so that won't be necessary.

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (157 preceding siblings ...)
  2022-10-05  4:27 ` oreo639
@ 2022-10-05  4:28 ` oreo639
  2022-10-05  8:40 ` [PR PATCH] [Updated] " oreo639
                   ` (105 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-10-05  4:28 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 536 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1267923092

Comment:
> I think we could use create_wrksrc in gcc and libgccjit

Alright. Good idea.

> modifying cross-* packages for that would probably require changes to the void-cross build style, so that could be done in a separate PR.

Those already use `create_wrksrc=yes` so that won't be necessary.
https://github.com/void-linux/void-packages/blob/master/common/environment/build-style/void-cross.sh

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (158 preceding siblings ...)
  2022-10-05  4:28 ` oreo639
@ 2022-10-05  8:40 ` oreo639
  2022-10-06 20:29 ` paper42
                   ` (104 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-10-05  8:40 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5395 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.2.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.2.0

Saved for future reference: paper has a list of failing builds here: https://vasilek.cz/logs/lab/bad/
Note: Some may be fixed already (i.e. DarkRadiant, EmulationStation, giada and TSC), some may be unrelated to this PR (i.e. the KDE build failures), and some may just be OOMs (i.e. igt-gpu-tools).

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [x] llvm https://github.com/void-linux/void-packages/pull/38694
- [x] m4 https://github.com/void-linux/void-packages/pull/33730
- [x] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [x] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [x] libvirt https://github.com/void-linux/void-packages/pull/38842
- [x] syslinux https://github.com/void-linux/void-packages/pull/38876
- [x] efivar https://github.com/void-linux/void-packages/pull/38874

Known packages that needed to be fixed/updated for gcc12:
- [ ] linux5.18 (in this PR)
- [x] openssh https://github.com/void-linux/void-packages/pull/38849
- [x] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [x] doxygen https://github.com/void-linux/void-packages/pull/38846
- [ ] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] libproxy https://github.com/void-linux/void-packages/pull/38818
- [x] exempi https://github.com/void-linux/void-packages/pull/38820
- [x] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [ ] gpgme https://github.com/void-linux/void-packages/pull/38825
- [x] libunique1 https://github.com/void-linux/void-packages/pull/38848 or https://github.com/void-linux/void-packages/pull/38873
- [x] libwpd https://github.com/void-linux/void-packages/pull/38878

Needs to be fixed/updated for binutils:
- [x] grub https://github.com/void-linux/void-packages/pull/38875
- [x] linux-tools https://github.com/void-linux/void-packages/pull/38877
- [x] kcov https://github.com/void-linux/void-packages/pull/39291

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [x] kde
- [x] lxde
- [x] lxqt

You can test the ISOs here:
https://drive.google.com/drive/folders/1ix92CYSLUP-KWjLxltdgG4e8Nu2JCY5n?usp=sharing

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 129758 bytes --]

From e3db94502c1488e8fdc07408ac8b777ce7c68a71 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 01/37] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../fix-libcollector-without-java.patch       | 53 +++++++++++++++
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 22 +++++--
 4 files changed, 86 insertions(+), 115 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
 create mode 100644 srcpkgs/binutils/patches/fix-libcollector-without-java.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/fix-libcollector-without-java.patch b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
new file mode 100644
index 000000000000..54384875f358
--- /dev/null
+++ b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
@@ -0,0 +1,53 @@
+From 49ddd814ac1071af7c4f45d5f8398b91862f2c7f Mon Sep 17 00:00:00 2001
+From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
+Date: Wed, 17 Aug 2022 19:55:23 -0700
+Subject: [PATCH] gprofng: fix bug 29479 Collection fails when built without
+ java support
+
+gprofng/ChangeLog
+2022-08-17  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>
+
+	PR gprofng/29479
+	* libcollector/collector.c: Add #if defined(GPROFNG_JAVA_PROFILING) for
+	java specific code.
+	* libcollector/unwind.c: Likewise.
+---
+ gprofng/libcollector/collector.c | 2 ++
+ gprofng/libcollector/unwind.c    | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/gprofng/libcollector/collector.c b/gprofng/libcollector/collector.c
+index 93c9d3330de5..ceff2c1caccb 100644
+--- a/gprofng/libcollector/collector.c
++++ b/gprofng/libcollector/collector.c
+@@ -913,8 +913,10 @@ __collector_open_experiment (const char *exp, const char *params, sp_origin_t or
+   __collector_ext_unwind_key_init (1, NULL);
+ 
+   /* start java attach if suitable */
++#if defined(GPROFNG_JAVA_PROFILING)
+   if (exp_origin == SP_ORIGIN_DBX_ATTACH)
+     __collector_jprofile_start_attach ();
++#endif
+   start_sec_time = CALL_UTIL (time)(NULL);
+   __collector_start_time = collector_interface.getHiResTime ();
+   TprintfT (DBG_LT0, "\t__collector_open_experiment; resetting start_time\n");
+diff --git a/gprofng/libcollector/unwind.c b/gprofng/libcollector/unwind.c
+index 119243788020..f8e11823c81e 100644
+--- a/gprofng/libcollector/unwind.c
++++ b/gprofng/libcollector/unwind.c
+@@ -557,6 +557,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+   int size = max_frame_size;
+ 
+ #define MIN(a,b) ((a)<(b)?(a):(b))
++#if defined(GPROFNG_JAVA_PROFILING)
+   /* get Java info */
+   if (__collector_java_mode && __collector_java_asyncgetcalltrace_loaded && context && !pseudo_context)
+     {
+@@ -569,6 +570,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+ 	  size -= sz;
+ 	}
+     }
++#endif
+ 
+   /* get native stack */
+   if (context)
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..79cd4e2b7c1f 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkgconf"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -44,6 +45,12 @@ do_configure() {
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	# gprofng currently only supports x86 and aarch64 glibc.
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64|i386|aarch64) conf+=" --enable-gprofng" ;;
+		*) conf+=" --disable-gprofng" ;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"
@@ -76,13 +83,15 @@ do_configure() {
 		--libdir=/usr/lib \
 		--mandir=/usr/share/man \
 		--infodir=/usr/share/info \
+		--sysconfdir=/etc \
 		--disable-werror \
-		--disable-shared \
 		--disable-nls \
+		--enable-shared \
 		--enable-threads \
 		--enable-plugins \
 		--enable-relro \
 		--enable-gold \
+		--enable-new-dtags \
 		--enable-deterministic-archives \
 		--enable-64-bit-bfd \
 		--enable-ld=default \
@@ -142,7 +151,8 @@ binutils-devel_package() {
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/*.a"
-		vmove "usr/lib/*.so"
+		vmove "usr/lib/libbfd.so"
+		vmove "usr/lib/libopcodes.so"
 	}
 }
 

From 37d2b1aec79b17a60744f35ad868fb595822ae55 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 2 Oct 2022 16:46:59 -0700
Subject: [PATCH 02/37] gdb: resolve conflict with binutils 2.39

---
 srcpkgs/gdb/template | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/gdb/template b/srcpkgs/gdb/template
index ff7c9d9a5911..5970402eb27e 100644
--- a/srcpkgs/gdb/template
+++ b/srcpkgs/gdb/template
@@ -1,7 +1,7 @@
 # Template file for 'gdb'
 pkgname=gdb
 version=12.1
-revision=1
+revision=2
 build_style=gnu-configure
 pycompile_dirs="/usr/share/gdb/python"
 configure_args="--disable-werror --disable-nls --with-system-readline
@@ -48,7 +48,8 @@ vopt_conflict debuginfod static
 
 post_install() {
 	# resolve conflicts with binutils
-	rm -r ${DESTDIR}/usr/{include,lib,share/info/bfd.info*}
+	rm -rf ${DESTDIR}/usr/{include,lib}
+	rm -rf ${DESTDIR}/usr/share/info/{bfd,ctf-spec}.info*
 }
 
 gdb-common_package() {

From 8e291845c69ca144a37bd66404585ba854a83164 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 03/37] gcc: update to 12.2.0.

---
 common/shlibs                                 |  10 +-
 srcpkgs/gcc/files/gccgo-musl.patch            |  71 ++--------
 srcpkgs/gcc/files/libgnarl-musl.patch         |  18 +--
 srcpkgs/gcc/files/libssp-musl.patch           |  10 +-
 srcpkgs/gcc/patches/libffi_gnulinux.patch     |  11 --
 .../gcc/patches/libgcc-ibm128-no-tag.patch    |  10 +-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |   2 +-
 srcpkgs/gcc/template                          | 123 +++++++++---------
 8 files changed, 98 insertions(+), 157 deletions(-)
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index 5d4b0a9899ad..dac3556fb949 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.2.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.36 perl-5.36.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -847,8 +847,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.2.0_1
+libgnat-12.so libada-12.2.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1697,8 +1697,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.2.0_1
+libasan.so.8 libsanitizer-12.2.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..12ec68dd8aa3 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,14 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ b/libgo/go/runtime/os_linux.go
+@@ -365,7 +365,7 @@ func setThreadCPUProfiler(hz int32) {
+ 	var sevp _sigevent
+ 	sevp.sigev_notify = _SIGEV_THREAD_ID
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.__sev_fields))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..7c93c93f93af 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,37 +3,35 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
+version=12.2.0
+revision=1
+_minorver="${version%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
-wrksrc=gcc-${version/pre/_pre}
+_mpc_version=1.2.1
+_isl_version=0.24
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
+create_wrksrc=yes
+build_wrksrc="gcc-${version}"
+patch_args="-Np1 --directory=${build_wrksrc}"
 lib32disabled=yes
 bootstrap=yes
 replaces="gcc-gcj<7.2.0 gcc-gcj-jdk-compat<7.2.0 libmpx>=0 libmpx-devel>=0"
@@ -70,13 +68,13 @@ if [ "$build_option_gnatboot" ]; then
 	case "$XBPS_TARGET_MACHINE" in
 	x86_64)
 		_gnat_tarball="gnat-gpl-2017-x86_64-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/591c6d80c7a447af2deed1d7>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/9682e2e1f2f232ce03fe21d77b14c37a0de5649b?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" b942bcac20dea39748b39f8b624d9619f60a8dee2e8195dbe3829c835b0956e6"
 		build_options_default="gnatboot"
 		;;
 	i686)
 		_gnat_tarball="gnat-gpl-2014-x86-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/564b3e9dc8e196b040fbe248>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/c5e9e6fdff5cb77ed90cf8c62536653e27c0bed6?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" 3b693510f5d22a240abb3034934c1adbd80ccd6e4f61a4f491cc408fdfd9c042"
 		build_options_default="gnatboot"
 		;;
@@ -155,25 +153,24 @@ if [ "$CROSS_BUILD" ]; then
 fi
 
 post_extract() {
-	mkdir -p ${wrksrc}/{gmp,mpfr,mpc,isl}
-	cp -ar ${XBPS_BUILDDIR}/gmp-${_gmp_version}/* ${wrksrc}/gmp/
-	cp -ar ${XBPS_BUILDDIR}/mpfr-${_mpfr_version}/* ${wrksrc}/mpfr/
-	cp -ar ${XBPS_BUILDDIR}/mpc-${_mpc_version}/* ${wrksrc}/mpc/
-	cp -ar ${XBPS_BUILDDIR}/isl-${_isl_version}/* ${wrksrc}/isl/
+	mv ${wrksrc}/gmp-${_gmp_version} ${wrksrc}/${build_wrksrc}/gmp
+	mv ${wrksrc}/mpfr-${_mpfr_version} ${wrksrc}/${build_wrksrc}/mpfr
+	mv ${wrksrc}/mpc-${_mpc_version} ${wrksrc}/${build_wrksrc}/mpc
+	mv ${wrksrc}/isl-${_isl_version} ${wrksrc}/${build_wrksrc}/isl
 
 	if [ "$build_option_gnatboot" ]; then
 		local f="${XBPS_SRCDISTDIR}/${pkgname}-${version}/${_gnat_tarball}"
 		msg_normal "Extracting ${_gnat_tarball} ...\n"
-		mkdir -p ${wrksrc}/gnat-ins
-		tar -x -f "$f" --strip-components=1 -C ${wrksrc}/gnat-ins
-		cd ${wrksrc}/gnat-ins
-		make ins-all prefix=${wrksrc}/gnat
-		cd ${wrksrc}
-		rm -rf ${wrksrc}/gnat-ins
+		mkdir -p ${wrksrc}/${build_wrksrc}/gnat-ins
+		tar -x -f "$f" --strip-components=1 -C ${wrksrc}/${build_wrksrc}/gnat-ins
+		cd ${wrksrc}/${build_wrksrc}/gnat-ins
+		make ins-all prefix=${wrksrc}/${build_wrksrc}/gnat
+		cd ${wrksrc}/${build_wrksrc}
+		rm -rf ${wrksrc}/${build_wrksrc}/gnat-ins
 
 		# Rename obsolete ld and as
-		find ${wrksrc}/gnat -name ld -exec mv -v {} {}.old \;
-		find ${wrksrc}/gnat -name as -exec mv -v {} {}.old \;
+		find ${wrksrc}/${build_wrksrc}/gnat -name ld -exec mv -v {} {}.old \;
+		find ${wrksrc}/${build_wrksrc}/gnat -name as -exec mv -v {} {}.old \;
 	fi
 }
 
@@ -185,9 +182,9 @@ pre_configure() {
 	sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
 
 	if [ "$XBPS_TARGET_LIBC" = musl ]; then
-		patch -p1 -i ${FILESDIR}/libgnarl-musl.patch
-		patch -p1 -i ${FILESDIR}/libssp-musl.patch
-		patch -p1 -i ${FILESDIR}/gccgo-musl.patch
+		for p in ${FILESDIR}/*-musl.patch; do
+			patch -p1 -i $p
+		done
 	fi
 }
 do_configure() {
@@ -297,19 +294,19 @@ do_configure() {
 		_args+=" --enable-languages=${_langs},ada"
 		_args+=" --enable-libada"
 		CONFIG_SHELL=/bin/bash \
-		CC="${wrksrc}/gnat/bin/gcc" \
-		GNATBIND="${wrksrc}/gnat/bin/gnatbind" \
-		GNATMAKE="${wrksrc}/gnat/bin/gnatmake" \
-		PATH="${wrksrc}/gnat/bin:$PATH" \
-			${wrksrc}/configure ${_args}
+		CC="${wrksrc}/${build_wrksrc}/gnat/bin/gcc" \
+		GNATBIND="${wrksrc}/${build_wrksrc}/gnat/bin/gnatbind" \
+		GNATMAKE="${wrksrc}/${build_wrksrc}/gnat/bin/gnatmake" \
+		PATH="${wrksrc}/${build_wrksrc}/gnat/bin:$PATH" \
+			${wrksrc}/${build_wrksrc}/configure ${_args}
 	elif [ "$build_option_ada" ]; then
 		_args+=" --enable-languages=${_langs},ada"
 		CONFIG_SHELL=/bin/bash \
-			${wrksrc}/configure ${_args}
+			${wrksrc}/${build_wrksrc}/configure ${_args}
 	else
 		_args+=" --enable-languages=${_langs}"
 		CONFIG_SHELL=/bin/bash \
-			${wrksrc}/configure ${_args}
+			${wrksrc}/${build_wrksrc}/configure ${_args}
 	fi
 }
 do_build() {
@@ -318,10 +315,10 @@ do_build() {
 	fi
 	cd build
 	if [ "$build_option_gnatboot" ]; then
-		CC="${wrksrc}/gnat/bin/gcc" \
-		GNATBIND="${wrksrc}/gnat/bin/gnatbind" \
-		GNATMAKE="${wrksrc}/gnat/bin/gnatmake" \
-		PATH="${wrksrc}/gnat/bin:$PATH" \
+		CC="${wrksrc}/${build_wrksrc}/gnat/bin/gcc" \
+		GNATBIND="${wrksrc}/${build_wrksrc}/gnat/bin/gnatbind" \
+		GNATMAKE="${wrksrc}/${build_wrksrc}/gnat/bin/gnatmake" \
+		PATH="${wrksrc}/${build_wrksrc}/gnat/bin:$PATH" \
 		make ${makejobs}
 	else
 		make ${makejobs}
@@ -330,7 +327,7 @@ do_build() {
 pre_install() {
 	if [ "$CROSS_BUILD" ]; then
 		# XXX otherwise links to host libpthread
-		for f in $(find ${wrksrc}/build/${XBPS_CROSS_TRIPLET} -type f -name libtool); do
+		for f in $(find ${wrksrc}/${build_wrksrc}/build/${XBPS_CROSS_TRIPLET} -type f -name libtool); do
 			sed -e "s,add_dir=\"-L\$libdir\",add_dir=\"-L${XBPS_CROSS_BASE}\$libdir\",g" -i $f
 		done
 	fi
@@ -342,16 +339,16 @@ do_install() {
 
 	# Make version a symlink of major version to make all versions
 	# from the same series work automagically.
-	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver} \
+	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${version} \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver}
 	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver} \
-		${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}
+		${DESTDIR}/usr/lib/gcc/${_triplet}/${version}
 
 	# Ditto for c++ headers.
-	mv ${DESTDIR}/usr/include/c++/${_patchver} \
+	mv ${DESTDIR}/usr/include/c++/${version} \
 		${DESTDIR}/usr/include/c++/${_minorver}
 	ln -sfr ${DESTDIR}/usr/include/c++/${_minorver} \
-		${DESTDIR}/usr/include/c++/${_patchver}
+		${DESTDIR}/usr/include/c++/${version}
 
 	# cc symlink
 	ln -sfr ${DESTDIR}/usr/bin/gcc ${DESTDIR}/usr/bin/cc
@@ -360,7 +357,7 @@ do_install() {
 
 	# lto plugin symlink
 	vmkdir usr/lib/bfd-plugins
-	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}/liblto_plugin.so \
+	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${version}/liblto_plugin.so \
 		${DESTDIR}/usr/lib/bfd-plugins
 
 	# Remove "fixed" header
@@ -375,8 +372,8 @@ do_install() {
 	rm -f ${DESTDIR}/usr/lib/*.py
 
 	# Remove more python stuff.
-	if [ -d ${DESTDIR}/usr/share/gcc-${_patchver}/python ]; then
-		rm -rf ${DESTDIR}/usr/share/gcc-${_patchver}/python
+	if [ -d ${DESTDIR}/usr/share/gcc-${version}/python ]; then
+		rm -rf ${DESTDIR}/usr/share/gcc-${version}/python
 	fi
 
 	# Install c89 and c99 wrappers and its manpages, from NetBSD.
@@ -396,7 +393,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}
@@ -449,7 +446,7 @@ gcc-fortran_package() {
 		if [ "$CROSS_BUILD" ]; then
 			# A number of OMP modules are not built when cross
 			# compiling gcc. Copy them from the cross compiler.
-			local src="/usr/lib/gcc/${_triplet}/${_patchver}/finclude"
+			local src="/usr/lib/gcc/${_triplet}/${version}/finclude"
 			local dst="usr/lib/gcc/${_triplet}/${_minorver}/finclude"
 			for f in omp_lib.f90 omp_lib.h omp_lib.mod omp_lib_kinds.mod \
 				openacc.f90 openacc.mod openacc_kinds.mod openacc_lib.h; do
@@ -516,7 +513,7 @@ libgfortran_package() {
 	short_desc+=" - Fortran library"
 	pkg_install() {
 		vmove "usr/lib/libgfortran.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -537,7 +534,7 @@ libgo_package() {
 	nostrip=yes
 	pkg_install() {
 		vmove "usr/lib/libgo.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -553,7 +550,7 @@ libobjc_package() {
 	short_desc+=" - Objective-C library"
 	pkg_install() {
 		vmove "usr/lib/libobjc.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -572,7 +569,7 @@ libquadmath_package() {
 	short_desc+=" - quadmath library"
 	pkg_install() {
 		vmove "usr/lib/libquadmath.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -614,7 +611,7 @@ libgcc_package() {
 	noverifyrdeps=yes
 	pkg_install() {
 		vmove "usr/lib/libgcc_s.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -645,7 +642,7 @@ libgomp_package() {
 	short_desc+=" - OpenMP v4.0 library"
 	pkg_install() {
 		vmove "usr/lib/libgomp*.so.*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -700,7 +697,7 @@ libssp_package() {
 	short_desc+=" - SSP (StackSmashingProtection) library"
 	pkg_install() {
 		vmove "usr/lib/libssp.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -718,6 +715,6 @@ libstdc++_package() {
 	short_desc+=" - Standard C++ Library"
 	pkg_install() {
 		vmove "usr/lib/libstdc++.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }

From 6ead3dd76e356185d73041791eb7f3b3521bbc54 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 04/37] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      | 11 ++++--
 2 files changed, 25 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..51611929d643 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,12 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
+
+if [ "$XBPS_LIBC" == "musl" ]; then
+	# Musl always searches LD_LIBRARY_PATH before RPATH and RUNPATH
+	make_build_args="lt_cv_shlibpath_overrides_runpath=yes"
+fi
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From 08832503f372698b5e93758911d690abdccc8f9a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 05/37] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 55255dceae8b..ca2d858a7abc 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From 80fd437b43a37d0d8d6bddfe54ffa977e574cd60 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 06/37] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 3 files changed, 55 insertions(+), 353 deletions(-)
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index dac3556fb949..bf246b638dae 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From 490d7e313853ee5f255a27cd287ae4b9f547875b Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Wed, 14 Sep 2022 03:48:32 -0700
Subject: [PATCH 07/37] musl: add support for SIGEV_THREAD_ID timers

https://git.musl-libc.org/cgit/musl/commit/?id=7c71792e87691451f2a6b76348e83ad1889f1dcb
---
 ...d-support-for-SIGEV_THREAD_ID-timers.patch | 74 +++++++++++++++++++
 srcpkgs/musl/template                         |  2 +-
 2 files changed, 75 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch

diff --git a/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
new file mode 100644
index 000000000000..e20dff5ba0d4
--- /dev/null
+++ b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
@@ -0,0 +1,74 @@
+From 7c71792e87691451f2a6b76348e83ad1889f1dcb Mon Sep 17 00:00:00 2001
+From: James Y Knight <jyknight@google.com>
+Date: Sun, 30 Jun 2019 21:55:20 -0400
+Subject: [PATCH] add support for SIGEV_THREAD_ID timers
+
+This is like SIGEV_SIGNAL, but targeted to a particular thread's
+tid, rather than the process.
+---
+ include/signal.h        | 16 +++++++++++++---
+ src/time/timer_create.c |  8 ++++++--
+ 2 files changed, 19 insertions(+), 5 deletions(-)
+
+diff --git a/include/signal.h b/include/signal.h
+index fbdf667b2..9ed929e4f 100644
+--- a/include/signal.h
++++ b/include/signal.h
+@@ -180,14 +180,24 @@ struct sigevent {
+ 	union sigval sigev_value;
+ 	int sigev_signo;
+ 	int sigev_notify;
+-	void (*sigev_notify_function)(union sigval);
+-	pthread_attr_t *sigev_notify_attributes;
+-	char __pad[56-3*sizeof(long)];
++	union {
++		char __pad[64 - 2*sizeof(int) - sizeof(union sigval)];
++		pid_t sigev_notify_thread_id;
++		struct {
++			void (*sigev_notify_function)(union sigval);
++			pthread_attr_t *sigev_notify_attributes;
++		} __sev_thread;
++	} __sev_fields;
+ };
+ 
++#define sigev_notify_thread_id __sev_fields.sigev_notify_thread_id
++#define sigev_notify_function __sev_fields.__sev_thread.sigev_notify_function
++#define sigev_notify_attributes __sev_fields.__sev_thread.sigev_notify_attributes
++
+ #define SIGEV_SIGNAL 0
+ #define SIGEV_NONE 1
+ #define SIGEV_THREAD 2
++#define SIGEV_THREAD_ID 4
+ 
+ int __libc_current_sigrtmin(void);
+ int __libc_current_sigrtmax(void);
+diff --git a/src/time/timer_create.c b/src/time/timer_create.c
+index 5ddfda278..4bef23905 100644
+--- a/src/time/timer_create.c
++++ b/src/time/timer_create.c
+@@ -71,11 +71,15 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 	switch (evp ? evp->sigev_notify : SIGEV_SIGNAL) {
+ 	case SIGEV_NONE:
+ 	case SIGEV_SIGNAL:
++	case SIGEV_THREAD_ID:
+ 		if (evp) {
+ 			ksev.sigev_value = evp->sigev_value;
+ 			ksev.sigev_signo = evp->sigev_signo;
+ 			ksev.sigev_notify = evp->sigev_notify;
+-			ksev.sigev_tid = 0;
++			if (evp->sigev_notify == SIGEV_THREAD_ID)
++				ksev.sigev_tid = evp->sigev_notify_thread_id;
++			else
++				ksev.sigev_tid = 0;
+ 			ksevp = &ksev;
+ 		}
+ 		if (syscall(SYS_timer_create, clk, ksevp, &timerid) < 0)
+@@ -107,7 +111,7 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 
+ 		ksev.sigev_value.sival_ptr = 0;
+ 		ksev.sigev_signo = SIGTIMER;
+-		ksev.sigev_notify = 4; /* SIGEV_THREAD_ID */
++		ksev.sigev_notify = SIGEV_THREAD_ID;
+ 		ksev.sigev_tid = td->tid;
+ 		if (syscall(SYS_timer_create, clk, &ksev, &timerid) < 0)
+ 			timerid = -1;
diff --git a/srcpkgs/musl/template b/srcpkgs/musl/template
index 5bdc5c48e623..34e6ed4fba6e 100644
--- a/srcpkgs/musl/template
+++ b/srcpkgs/musl/template
@@ -2,7 +2,7 @@
 pkgname=musl
 reverts="1.2.0_1"
 version=1.1.24
-revision=10
+revision=11
 archs="*-musl"
 bootstrap=yes
 build_style=gnu-configure

From d0424568d626aa825933103a732f42c505d9bdf5 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 21:01:43 -0700
Subject: [PATCH 08/37] gcc-multilib: update to 12.2.0.

---
 srcpkgs/gcc-multilib/template | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index fcd25755aa75..ba9bafcadfd6 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,16 +3,15 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _majorver="${version%.*}"
-wrksrc=gcc-${version/pre/_pre}
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel
@@ -71,7 +70,7 @@ do_build() {
 	make ${makejobs}
 }
 do_install() {
-	local _pc_triplet=x86_64-pc-linux-gnu _version=${version%pre1}
+	local _pc_triplet=x86_64-pc-linux-gnu
 	# Install to a tempdir and then only copy relevant files.
 	cd ${wrksrc}
 	make DESTDIR=${wrksrc}/${pkgname}-build install
@@ -81,9 +80,9 @@ do_install() {
 	vmkdir usr/include/c++/${_majorver}/${_triplet}
 	vmkdir usr/lib/gcc/${_triplet}/${_majorver}
 
-	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${_version}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${version}/32 \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_majorver}/
-	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${_version}/${_pc_triplet}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${version}/${_pc_triplet}/32 \
 		${DESTDIR}/usr/include/c++/${_majorver}/${_triplet}
 
 	vinstall ${wrksrc}/host-${_pc_triplet}/gcc/specs 644 usr/lib/gcc/${_triplet}/${_majorver}

From dfe108f9a3fbf82ce73c375d881709a85347509c Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Tue, 4 Oct 2022 03:49:13 -0700
Subject: [PATCH 09/37] libgccjit: update to 12.2.0.

---
 srcpkgs/libgccjit/files/libgccjit-musl.patch | 63 --------------------
 srcpkgs/libgccjit/template                   | 38 ++++++------
 2 files changed, 17 insertions(+), 84 deletions(-)
 delete mode 100644 srcpkgs/libgccjit/files/libgccjit-musl.patch

diff --git a/srcpkgs/libgccjit/files/libgccjit-musl.patch b/srcpkgs/libgccjit/files/libgccjit-musl.patch
deleted file mode 100644
index d2ed16928c82..000000000000
--- a/srcpkgs/libgccjit/files/libgccjit-musl.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-diff --git a/gcc/jit/jit-playback.c b/gcc/jit/jit-playback.c
-index 5bccf591a..35f5e35ef 100644
---- a/gcc/jit/jit-playback.c
-+++ b/gcc/jit/jit-playback.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -41,8 +43,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "diagnostic.h"
- #include "stmt.h"
- 
--#include <pthread.h>
--
- #include "jit-playback.h"
- #include "jit-result.h"
- #include "jit-builtins.h"
-diff --git a/gcc/jit/jit-recording.c b/gcc/jit/jit-recording.c
-index a237d574f..5785e3269 100644
---- a/gcc/jit/jit-recording.c
-+++ b/gcc/jit/jit-recording.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -25,8 +27,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "pretty-print.h"
- #include "toplev.h"
- 
--#include <pthread.h>
--
- #include "jit-builtins.h"
- #include "jit-recording.h"
- #include "jit-playback.h"
-diff --git a/gcc/jit/libgccjit.c b/gcc/jit/libgccjit.c
-index f9c33c63c..75f21d275 100644
---- a/gcc/jit/libgccjit.c
-+++ b/gcc/jit/libgccjit.c
-@@ -18,13 +18,13 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
- #include "timevar.h"
- #include "typed-splay-tree.h"
- #include "cppbuiltin.h"
--#include <pthread.h>
- 
- #include "libgccjit.h"
- #include "jit-recording.h"
diff --git a/srcpkgs/libgccjit/template b/srcpkgs/libgccjit/template
index 6f1d6256dcd6..2f2802eaba8b 100644
--- a/srcpkgs/libgccjit/template
+++ b/srcpkgs/libgccjit/template
@@ -3,36 +3,32 @@
 # which use the version number.
 
 pkgname=libgccjit
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
+version=12.2.0
 revision=1
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
-_majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
-wrksrc=gcc-${version/pre/_pre}
+_mpc_version=1.2.1
+_isl_version=0.24
 short_desc="Just-In-Time Compilation library for GCC"
 maintainer="Lane Biocini <lane@mailbox.org>"
 homepage="https://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 nopie=yes
+create_wrksrc=yes
+build_wrksrc="gcc-${version}"
+patch_args="-Np1 --directory=${build_wrksrc}"
 lib32disabled=yes
 makedepends="zlib-devel"
 hostmakedepends="tar texinfo perl flex"
@@ -40,10 +36,10 @@ depends="gcc"
 checkdepends="dejagnu"
 
 post_extract() {
-	mv ${XBPS_BUILDDIR}/gmp-${_gmp_version} ${wrksrc}/gmp
-	mv ${XBPS_BUILDDIR}/mpfr-${_mpfr_version} ${wrksrc}/mpfr
-	mv ${XBPS_BUILDDIR}/mpc-${_mpc_version} ${wrksrc}/mpc
-	mv ${XBPS_BUILDDIR}/isl-${_isl_version} ${wrksrc}/isl
+	mv ${wrksrc}/gmp-${_gmp_version} ${wrksrc}/${build_wrksrc}/gmp
+	mv ${wrksrc}/mpfr-${_mpfr_version} ${wrksrc}/${build_wrksrc}/mpfr
+	mv ${wrksrc}/mpc-${_mpc_version} ${wrksrc}/${build_wrksrc}/mpc
+	mv ${wrksrc}/isl-${_isl_version} ${wrksrc}/${build_wrksrc}/isl
 }
 
 pre_configure() {
@@ -186,7 +182,7 @@ do_configure() {
 	[ -z "$XBPS_CHECK_PKGS" ] && _langs="jit" || _langs="jit,c++"
 	_args+=" --enable-languages=${_langs}"
 	CONFIG_SHELL=/bin/bash \
-		${wrksrc}/configure ${_args}
+		${wrksrc}/${build_wrksrc}/configure ${_args}
 }
 
 do_build() {

From a85b43ed5a36350a7453ab35a8ec7096019eca5c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 14 Aug 2022 19:29:36 -0700
Subject: [PATCH 10/37] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove -no-pie from build. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..5d40f0cdd8a6 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -53,6 +53,7 @@ _void_cross_build_binutils() {
 		--sbindir=/usr/bin \
 		--libdir=/usr/lib \
 		--libexecdir=/usr/lib \
+		--sysconfdir=/etc \
 		--target=${tgt} \
 		--with-sysroot=/usr/${tgt} \
 		--disable-nls \
@@ -60,7 +61,9 @@ _void_cross_build_binutils() {
 		--disable-multilib \
 		--disable-werror \
 		--disable-gold \
+		--disable-gprofng \
 		--enable-relro \
+		--enable-new-dtags \
 		--enable-plugins \
 		--enable-64-bit-bfd \
 		--enable-deterministic-archives \
@@ -132,6 +135,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -460,6 +464,14 @@ do_build() {
 	local binutils_ver linux_ver gcc_ver libc_ver libucontext_ver
 	local tgt=${sourcepkg/cross-}
 
+	export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}"
+	export CXXFLAGS="${CXXFLAGS/-D_FORTIFY_SOURCE=2/}"
+
+	# Disable explicit -fno-PIE, gcc/binutils/libc will figure this out itself.
+	export CFLAGS="${CFLAGS//-fno-PIE/}"
+	export CXXFLAGS="${CXXFLAGS//-fno-PIE/}"
+	export LDFLAGS="${LDFLAGS//-no-pie/}"
+
 	_void_cross_test_ver binutils
 	_void_cross_test_ver linux
 	_void_cross_test_ver gcc
@@ -625,6 +637,9 @@ do_install() {
 	# then remove it because it conflicts with libquadmath package
 	rm -rf ${DESTDIR}/${sysroot}/usr/lib/libquadmath.*
 
+	# Remove libdep linker plugin because it conflicts with system binutils
+	rm -f ${DESTDIR}/usr/lib/bfd-plugins/libdep*
+
 	# Remove leftover symlinks
 	rm -f ${DESTDIR}/usr/lib${XBPS_TARGET_WORDSIZE}
 	rm -f ${DESTDIR}/lib*

From d89367ca6db31157c748276ab0ecc45d7cb8937d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:09:31 -0700
Subject: [PATCH 11/37] linux5.18: update dotconfigs for gcc12

---
 srcpkgs/linux5.18/files/x86_64-dotconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/linux5.18/files/x86_64-dotconfig b/srcpkgs/linux5.18/files/x86_64-dotconfig
index 4e73a3195d40..ea6204868e23 100644
--- a/srcpkgs/linux5.18/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.18/files/x86_64-dotconfig
@@ -512,6 +512,7 @@ CONFIG_RETHUNK=y
 CONFIG_CPU_UNRET_ENTRY=y
 CONFIG_CPU_IBPB_ENTRY=y
 CONFIG_CPU_IBRS_ENTRY=y
+CONFIG_SLS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10060,8 +10061,11 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
 # Memory initialization
 #
 CONFIG_INIT_STACK_NONE=y
+# CONFIG_INIT_STACK_ALL_PATTERN is not set
+# CONFIG_INIT_STACK_ALL_ZERO is not set
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
+# CONFIG_ZERO_CALL_USED_REGS is not set
 # end of Memory initialization
 # end of Kernel hardening options
 # end of Security options
@@ -10538,6 +10542,7 @@ CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
 # CONFIG_UBSAN is not set
 CONFIG_HAVE_ARCH_KCSAN=y
+# CONFIG_KCSAN is not set
 # end of Generic Kernel Debugging Instruments
 
 #

From 2d45057a6eaf4d680c5e0ecd64a3b64eb6718d20 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:08 -0700
Subject: [PATCH 12/37] subversion: fix build for libtool 2.4.7

---
 srcpkgs/subversion/template | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/subversion/template b/srcpkgs/subversion/template
index 18c35e3a2132..0aa41212c5fd 100644
--- a/srcpkgs/subversion/template
+++ b/srcpkgs/subversion/template
@@ -24,6 +24,8 @@ distfiles="http://apache.uvigo.es/subversion/subversion-${version}.tar.bz2"
 checksum=c9130e8d0b75728a66f0e7038fc77052e671830d785b5616aad53b4810d3cc28
 
 pre_configure() {
+	./autogen.sh --release
+
 	# Based on native build values
 	cat <<-EOF >config.cache
 	ac_cv_python_includes=-I${XBPS_CROSS_BASE}/usr/include/python${py3_ver}
@@ -59,7 +61,12 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+
+	if [ "$XBPS_BUILD_ENVIRONMENT" = "void-packages-ci" ]; then
+		# This test will fail when run as the root user,
+		# because flock() will ignore file permissions.
+		vsed -i subversion/tests/libsvn_fs/locks-test.c -e '/SVN_TEST_OPTS_PASS(obtain_write_lock_failure,/,+3d'
+	fi
 }
 
 post_configure() {

From 77e34d890441b83f53e89bd39c687637a81e5e0f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:38 -0700
Subject: [PATCH 13/37] subversion-kwallet-auth: update to 1.14.2.

Fix failing distfiles.
Fix build for libtool 2.4.7
---
 srcpkgs/subversion-kwallet-auth/template | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/subversion-kwallet-auth/template b/srcpkgs/subversion-kwallet-auth/template
index 12210f250d51..9cc68c3fe5f1 100644
--- a/srcpkgs/subversion-kwallet-auth/template
+++ b/srcpkgs/subversion-kwallet-auth/template
@@ -3,7 +3,7 @@
 # THIS PKG MUST BE SYNCHRONIZED WITH "srcpkgs/subversion".
 #
 pkgname=subversion-kwallet-auth
-version=1.14.1
+version=1.14.2
 revision=1
 wrksrc="subversion-${version}"
 build_style=gnu-configure
@@ -22,10 +22,12 @@ license="Apache-2.0, BSD-3-Clause"
 homepage="http://subversion.apache.org/"
 changelog="https://subversion.apache.org/docs/release-notes/${version%.*}.html"
 distfiles="http://apache.uvigo.es/subversion/subversion-${version}.tar.bz2"
-checksum=2c5da93c255d2e5569fa91d92457fdb65396b0666fad4fd59b22e154d986e1a9
+checksum=c9130e8d0b75728a66f0e7038fc77052e671830d785b5616aad53b4810d3cc28
 lib32disabled=yes
 
 pre_configure() {
+	./autogen.sh --release
+
 	# Based on native build values
 	cat <<-EOF >config.cache
 	ac_cv_python_includes=-I${XBPS_CROSS_BASE}/usr/include/python${py3_ver}
@@ -55,11 +57,18 @@ pre_configure() {
 		cp "$XBPS_CROSS_BASE/usr/lib/perl5/core_perl/Config"*.p? $PERL5LIB
 		cp "$XBPS_CROSS_BASE/usr/lib/perl5/core_perl/Errno.pm" $PERL5LIB
 		vsed -e "s;archlibexp => '\(.*\)';archlibexp => '${XBPS_CROSS_BASE}\1';" \
-			-i $PERL5LIB/Config.pm $PERL5LIB/Config_heavy.pl
+			-i $PERL5LIB/Config.pm
+		vsed -e "s;archlibexp='\(.*\)';archlibexp='${XBPS_CROSS_BASE}\1';" \
+			-i $PERL5LIB/Config_heavy.pl
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+
+	if [ "$XBPS_BUILD_ENVIRONMENT" = "void-packages-ci" ]; then
+		# This test will fail when run as the root user,
+		# because flock() will ignore file permissions.
+		vsed -i subversion/tests/libsvn_fs/locks-test.c -e '/SVN_TEST_OPTS_PASS(obtain_write_lock_failure,/,+3d'
+	fi
 }
 
 post_configure() {

From 8a8855de382f7b161dc8905efa7a951732d15bb2 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 14/37] cross-aarch64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..bd6b23f9fb6a 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 29776e34816b6d38fad22ba2af2f835176a9caf0 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 15/37] cross-aarch64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..427ad2c1e9cd 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 0cddb3b66160eb4a28dd2cdb9d71dbb931446511 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 16/37] cross-arm-linux-gnueabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..2510ee26e789 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 8d5720e2a591e5278237fe5947137e6448b81bb0 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 17/37] cross-arm-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..bd8b16e1b4c1 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From a6097e7c680b2cf269e74f7dfbb70cbb45b24836 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 18/37] cross-arm-linux-musleabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..dacfd2655216 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From b364c318d57eb904ced4e5792ce099318e74ec6d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 19/37] cross-arm-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..9ddd32a9f20d 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 6b0dc964c748604888ea8cdd5946ffd6456735aa Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 20/37] cross-armv7l-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..9fb00f18be3b 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 64cda51019ae2a6d7d83874e65bce9b631dbb668 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 21/37] cross-armv7l-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..2c72e75ddfe3 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From f58252908e700c53e2a73c1acfdeea6aab6d474e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 22/37] cross-i686-pc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..4dc17df648b5 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 98622d71ca5d1dc2160cde4f108e4d293883837d Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Fri, 16 Sep 2022 20:52:19 -0700
Subject: [PATCH 23/37] cross-i686-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-linux-musl/template b/srcpkgs/cross-i686-linux-musl/template
index 8be16a230d8d..78b4d813a113 100644
--- a/srcpkgs/cross-i686-linux-musl/template
+++ b/srcpkgs/cross-i686-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-i686-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-i686-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 291d073f870a69cab5ec31845f2e164f702bed1b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 24/37] cross-mips-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..6009e5c79eb2 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 487b1069df18cfec47348929a95124b43fe990df Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 25/37] cross-mips-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..080164df193d 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="hipperson0 <hipperson0@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 1e7699c89aa429d8e79f0a0e13584ebe79ad8035 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 26/37] cross-mipsel-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..f9fd4b8a04ef 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 7406d55d07e9a50052a01b7ee8c27037135999ec Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 27/37] cross-mipsel-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..7418a984474b 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 5e26b8eb71798deb2d2439e615f3aa1d7a7bad28 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 28/37] cross-powerpc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..31e57b4e52b2 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 809a8422f6e749246d84cb7816072eb06844116f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 29/37] cross-powerpc-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..a2d1edcf1ffd 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 0b1a16377b27b4c913ac73fddca2037fc1b31491 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 30/37] cross-powerpc64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..1a4cbed61e76 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 4ca3d149bfaa186e86b7ee9e017876d988549f94 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 31/37] cross-powerpc64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 016f18776a6d..19b1ff859eb6 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 634dd57701b422940ae2db5b68f4781e9f5de90d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 32/37] cross-powerpc64le-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 463d7e92d20d..9d99a3a315d2 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 1557eed71afd1738691b75f19b4288d16b94d9aa Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 33/37] cross-powerpc64le-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index c17a3cccfe29..3128baa7372e 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 3f05b4a59a175bba9a9a4465cbdcead1d789c12c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 34/37] cross-powerpcle-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 9aede3c465ce..6f914b3877ee 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 479c5c5609ff084cdfe0d05f5a9725c785da3bd6 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 35/37] cross-powerpcle-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index 045cfda987fe..20e70bed4c60 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 0127d6499cf6539816b851fb36d4bbc34b2c33c2 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 36/37] cross-x86_64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 8918f3c22a1c..5219cd50f851 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 8ea1ae3d1e7040a65e70d6ae3c3d65b42601b021 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 37/37] cross-x86_64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..2811de0d3c2e 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (159 preceding siblings ...)
  2022-10-05  8:40 ` [PR PATCH] [Updated] " oreo639
@ 2022-10-06 20:29 ` paper42
  2022-10-06 21:31 ` oreo639
                   ` (103 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: paper42 @ 2022-10-06 20:29 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 292 bytes --]

New comment by paper42 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1270641848

Comment:
* libgccjit doesn't build for me: https://vasilek.cz/logs/lab/bad/libgccjit.txt
* removed-packages should be updated if gccgo doesn't now work on ppc

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (160 preceding siblings ...)
  2022-10-06 20:29 ` paper42
@ 2022-10-06 21:31 ` oreo639
  2022-10-06 21:36 ` oreo639
                   ` (102 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-10-06 21:31 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 662 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1270720185

Comment:
> mv: cannot move '/builddir/gmp-6.2.1' to '/builddir/libgccjit-12.2.0/gmp': No such file or directory
> => ERROR: libgccjit-12.2.0_1: post_extract: 'mv ${XBPS_BUILDDIR}/gmp-${_gmp_version} ${wrksrc}/gmp' exited with 1

That command was changed in this PR, (it should be `mv ${wrksrc}/gmp-${_gmp_version} ${wrksrc}/${build_wrksrc}/gmp`) are you using the latest version of this branch?

> removed-packages should be updated if gccgo doesn't now work on ppc

Wdym? I never changed anything related to gccgo on ppc?

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (161 preceding siblings ...)
  2022-10-06 21:31 ` oreo639
@ 2022-10-06 21:36 ` oreo639
  2022-10-07  9:11 ` paper42
                   ` (101 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-10-06 21:36 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 664 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1270720185

Comment:
> mv: cannot move '/builddir/gmp-6.2.1' to '/builddir/libgccjit-12.2.0/gmp': No such file or directory
> => ERROR: libgccjit-12.2.0_1: post_extract: `'mv ${XBPS_BUILDDIR}/gmp-${_gmp_version} ${wrksrc}/gmp'` exited with 1

That command was changed in this PR, (it should be `mv ${wrksrc}/gmp-${_gmp_version} ${wrksrc}/${build_wrksrc}/gmp`) are you using the latest version of this branch?

> removed-packages should be updated if gccgo doesn't now work on ppc

Wdym? I never changed anything related to gccgo on ppc?

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (162 preceding siblings ...)
  2022-10-06 21:36 ` oreo639
@ 2022-10-07  9:11 ` paper42
  2022-10-08  0:10 ` ayoubelmhamdi
                   ` (100 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: paper42 @ 2022-10-07  9:11 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 913 bytes --]

New comment by paper42 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1271330787

Comment:
> > mv: cannot move '/builddir/gmp-6.2.1' to '/builddir/libgccjit-12.2.0/gmp': No such file or directory
> > => ERROR: libgccjit-12.2.0_1: post_extract: `'mv ${XBPS_BUILDDIR}/gmp-${_gmp_version} ${wrksrc}/gmp'` exited with 1
> 
> That command was changed in this PR, (it should be `mv ${wrksrc}/gmp-${_gmp_version} ${wrksrc}/${build_wrksrc}/gmp`) are you using the latest version of this branch?

It's possible, I only cherry picked the libgccjit commit a  few days ago, I will do a proper rebase.

> > removed-packages should be updated if gccgo doesn't now work on ppc
> 
> Wdym? I never changed anything related to gccgo on ppc?

Now I see the removal is only necessary for older gcc versions, gccgo doesn't build for ppc now, so we don't have to remove it.

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (163 preceding siblings ...)
  2022-10-07  9:11 ` paper42
@ 2022-10-08  0:10 ` ayoubelmhamdi
  2022-10-08  0:12 ` oreo639
                   ` (99 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: ayoubelmhamdi @ 2022-10-08  0:10 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 243 bytes --]

New comment by ayoubelmhamdi on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1272171661

Comment:
The `template` need some refactoring, because the `xlint` found a lot of rules that not flowed.

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (164 preceding siblings ...)
  2022-10-08  0:10 ` ayoubelmhamdi
@ 2022-10-08  0:12 ` oreo639
  2022-10-08 10:57 ` [PR REVIEW] " Duncaen
                   ` (98 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-10-08  0:12 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 265 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1272172273

Comment:
> The template need some refactoring, because the xlint found a lot of rules that not flowed.

Those are false positives.

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR REVIEW] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (165 preceding siblings ...)
  2022-10-08  0:12 ` oreo639
@ 2022-10-08 10:57 ` Duncaen
  2022-10-08 19:57 ` paper42
                   ` (97 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: Duncaen @ 2022-10-08 10:57 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 168 bytes --]

New review comment by Duncaen on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#discussion_r990626674

Comment:
`wrksrc` is required.

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (166 preceding siblings ...)
  2022-10-08 10:57 ` [PR REVIEW] " Duncaen
@ 2022-10-08 19:57 ` paper42
  2022-10-08 21:03 ` [PR PATCH] [Updated] " oreo639
                   ` (96 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: paper42 @ 2022-10-08 19:57 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 359 bytes --]

New comment by paper42 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1272388052

Comment:
#39809 contains a list of packages that fail to build with gcc 12 and have to be fixed before this PR can be merged. It does not include failures due to the glibc update because that list is from a musl world rebuild.

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (167 preceding siblings ...)
  2022-10-08 19:57 ` paper42
@ 2022-10-08 21:03 ` oreo639
  2022-10-08 21:03 ` [PR REVIEW] " oreo639
                   ` (95 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-10-08 21:03 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5483 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.2.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.2.0

Saved for future reference: paper has a list of failing builds here: https://vasilek.cz/logs/lab/bad/

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [x] llvm https://github.com/void-linux/void-packages/pull/38694
- [x] m4 https://github.com/void-linux/void-packages/pull/33730
- [x] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [x] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [x] libvirt https://github.com/void-linux/void-packages/pull/38842
- [x] syslinux https://github.com/void-linux/void-packages/pull/38876
- [x] efivar https://github.com/void-linux/void-packages/pull/38874
- [ ] gpgme https://github.com/void-linux/void-packages/pull/38825

Known packages that needed to be fixed/updated for gcc12:
- [ ] linux5.18 (in this PR)
- [x] openssh https://github.com/void-linux/void-packages/pull/38849
- [x] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [x] doxygen https://github.com/void-linux/void-packages/pull/38846
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] libproxy https://github.com/void-linux/void-packages/pull/38818
- [x] exempi https://github.com/void-linux/void-packages/pull/38820
- [x] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [x] libunique1 https://github.com/void-linux/void-packages/pull/38848 or https://github.com/void-linux/void-packages/pull/38873
- [x] libwpd https://github.com/void-linux/void-packages/pull/38878
- [x] cglm https://github.com/void-linux/void-packages/pull/39748
- [ ] coreboot-utils https://github.com/void-linux/void-packages/pull/39749
- [x] apl https://github.com/void-linux/void-packages/pull/39750
- [x] igt-gpu-tools https://github.com/void-linux/void-packages/pull/39780

Needs to be fixed/updated for binutils:
- [x] grub https://github.com/void-linux/void-packages/pull/38875
- [x] linux-tools https://github.com/void-linux/void-packages/pull/38877
- [x] kcov https://github.com/void-linux/void-packages/pull/39291

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [x] kde
- [x] lxde
- [x] lxqt

You can test the ISOs here:
https://drive.google.com/drive/folders/1ix92CYSLUP-KWjLxltdgG4e8Nu2JCY5n?usp=sharing

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 129784 bytes --]

From 91b93569781cb8b7e011528bea5179a9e9600170 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 01/37] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../fix-libcollector-without-java.patch       | 53 +++++++++++++++
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 22 +++++--
 4 files changed, 86 insertions(+), 115 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
 create mode 100644 srcpkgs/binutils/patches/fix-libcollector-without-java.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/fix-libcollector-without-java.patch b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
new file mode 100644
index 000000000000..54384875f358
--- /dev/null
+++ b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
@@ -0,0 +1,53 @@
+From 49ddd814ac1071af7c4f45d5f8398b91862f2c7f Mon Sep 17 00:00:00 2001
+From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
+Date: Wed, 17 Aug 2022 19:55:23 -0700
+Subject: [PATCH] gprofng: fix bug 29479 Collection fails when built without
+ java support
+
+gprofng/ChangeLog
+2022-08-17  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>
+
+	PR gprofng/29479
+	* libcollector/collector.c: Add #if defined(GPROFNG_JAVA_PROFILING) for
+	java specific code.
+	* libcollector/unwind.c: Likewise.
+---
+ gprofng/libcollector/collector.c | 2 ++
+ gprofng/libcollector/unwind.c    | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/gprofng/libcollector/collector.c b/gprofng/libcollector/collector.c
+index 93c9d3330de5..ceff2c1caccb 100644
+--- a/gprofng/libcollector/collector.c
++++ b/gprofng/libcollector/collector.c
+@@ -913,8 +913,10 @@ __collector_open_experiment (const char *exp, const char *params, sp_origin_t or
+   __collector_ext_unwind_key_init (1, NULL);
+ 
+   /* start java attach if suitable */
++#if defined(GPROFNG_JAVA_PROFILING)
+   if (exp_origin == SP_ORIGIN_DBX_ATTACH)
+     __collector_jprofile_start_attach ();
++#endif
+   start_sec_time = CALL_UTIL (time)(NULL);
+   __collector_start_time = collector_interface.getHiResTime ();
+   TprintfT (DBG_LT0, "\t__collector_open_experiment; resetting start_time\n");
+diff --git a/gprofng/libcollector/unwind.c b/gprofng/libcollector/unwind.c
+index 119243788020..f8e11823c81e 100644
+--- a/gprofng/libcollector/unwind.c
++++ b/gprofng/libcollector/unwind.c
+@@ -557,6 +557,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+   int size = max_frame_size;
+ 
+ #define MIN(a,b) ((a)<(b)?(a):(b))
++#if defined(GPROFNG_JAVA_PROFILING)
+   /* get Java info */
+   if (__collector_java_mode && __collector_java_asyncgetcalltrace_loaded && context && !pseudo_context)
+     {
+@@ -569,6 +570,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+ 	  size -= sz;
+ 	}
+     }
++#endif
+ 
+   /* get native stack */
+   if (context)
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..79cd4e2b7c1f 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkgconf"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -44,6 +45,12 @@ do_configure() {
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	# gprofng currently only supports x86 and aarch64 glibc.
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64|i386|aarch64) conf+=" --enable-gprofng" ;;
+		*) conf+=" --disable-gprofng" ;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"
@@ -76,13 +83,15 @@ do_configure() {
 		--libdir=/usr/lib \
 		--mandir=/usr/share/man \
 		--infodir=/usr/share/info \
+		--sysconfdir=/etc \
 		--disable-werror \
-		--disable-shared \
 		--disable-nls \
+		--enable-shared \
 		--enable-threads \
 		--enable-plugins \
 		--enable-relro \
 		--enable-gold \
+		--enable-new-dtags \
 		--enable-deterministic-archives \
 		--enable-64-bit-bfd \
 		--enable-ld=default \
@@ -142,7 +151,8 @@ binutils-devel_package() {
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/*.a"
-		vmove "usr/lib/*.so"
+		vmove "usr/lib/libbfd.so"
+		vmove "usr/lib/libopcodes.so"
 	}
 }
 

From bfda9f29d8d233ef7c261f35c08e749f8b3768eb Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 2 Oct 2022 16:46:59 -0700
Subject: [PATCH 02/37] gdb: resolve conflict with binutils 2.39

---
 srcpkgs/gdb/template | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/gdb/template b/srcpkgs/gdb/template
index ff7c9d9a5911..5970402eb27e 100644
--- a/srcpkgs/gdb/template
+++ b/srcpkgs/gdb/template
@@ -1,7 +1,7 @@
 # Template file for 'gdb'
 pkgname=gdb
 version=12.1
-revision=1
+revision=2
 build_style=gnu-configure
 pycompile_dirs="/usr/share/gdb/python"
 configure_args="--disable-werror --disable-nls --with-system-readline
@@ -48,7 +48,8 @@ vopt_conflict debuginfod static
 
 post_install() {
 	# resolve conflicts with binutils
-	rm -r ${DESTDIR}/usr/{include,lib,share/info/bfd.info*}
+	rm -rf ${DESTDIR}/usr/{include,lib}
+	rm -rf ${DESTDIR}/usr/share/info/{bfd,ctf-spec}.info*
 }
 
 gdb-common_package() {

From 2c1d318004fccd257f52f8f1e92d51c2671aedb1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 03/37] gcc: update to 12.2.0.

---
 common/shlibs                                 |  10 +-
 srcpkgs/gcc/files/gccgo-musl.patch            |  71 ++--------
 srcpkgs/gcc/files/libgnarl-musl.patch         |  18 +--
 srcpkgs/gcc/files/libssp-musl.patch           |  10 +-
 srcpkgs/gcc/patches/libffi_gnulinux.patch     |  11 --
 .../gcc/patches/libgcc-ibm128-no-tag.patch    |  10 +-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |   2 +-
 srcpkgs/gcc/template                          | 123 +++++++++---------
 8 files changed, 98 insertions(+), 157 deletions(-)
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index 6d015301db7e..98df5e9347ae 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.2.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.36 perl-5.36.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -847,8 +847,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.2.0_1
+libgnat-12.so libada-12.2.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1697,8 +1697,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.2.0_1
+libasan.so.8 libsanitizer-12.2.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..12ec68dd8aa3 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,14 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ b/libgo/go/runtime/os_linux.go
+@@ -365,7 +365,7 @@ func setThreadCPUProfiler(hz int32) {
+ 	var sevp _sigevent
+ 	sevp.sigev_notify = _SIGEV_THREAD_ID
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.__sev_fields))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..7c93c93f93af 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,37 +3,35 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
+version=12.2.0
+revision=1
+_minorver="${version%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
-wrksrc=gcc-${version/pre/_pre}
+_mpc_version=1.2.1
+_isl_version=0.24
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
+create_wrksrc=yes
+build_wrksrc="gcc-${version}"
+patch_args="-Np1 --directory=${build_wrksrc}"
 lib32disabled=yes
 bootstrap=yes
 replaces="gcc-gcj<7.2.0 gcc-gcj-jdk-compat<7.2.0 libmpx>=0 libmpx-devel>=0"
@@ -70,13 +68,13 @@ if [ "$build_option_gnatboot" ]; then
 	case "$XBPS_TARGET_MACHINE" in
 	x86_64)
 		_gnat_tarball="gnat-gpl-2017-x86_64-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/591c6d80c7a447af2deed1d7>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/9682e2e1f2f232ce03fe21d77b14c37a0de5649b?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" b942bcac20dea39748b39f8b624d9619f60a8dee2e8195dbe3829c835b0956e6"
 		build_options_default="gnatboot"
 		;;
 	i686)
 		_gnat_tarball="gnat-gpl-2014-x86-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/564b3e9dc8e196b040fbe248>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/c5e9e6fdff5cb77ed90cf8c62536653e27c0bed6?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" 3b693510f5d22a240abb3034934c1adbd80ccd6e4f61a4f491cc408fdfd9c042"
 		build_options_default="gnatboot"
 		;;
@@ -155,25 +153,24 @@ if [ "$CROSS_BUILD" ]; then
 fi
 
 post_extract() {
-	mkdir -p ${wrksrc}/{gmp,mpfr,mpc,isl}
-	cp -ar ${XBPS_BUILDDIR}/gmp-${_gmp_version}/* ${wrksrc}/gmp/
-	cp -ar ${XBPS_BUILDDIR}/mpfr-${_mpfr_version}/* ${wrksrc}/mpfr/
-	cp -ar ${XBPS_BUILDDIR}/mpc-${_mpc_version}/* ${wrksrc}/mpc/
-	cp -ar ${XBPS_BUILDDIR}/isl-${_isl_version}/* ${wrksrc}/isl/
+	mv ${wrksrc}/gmp-${_gmp_version} ${wrksrc}/${build_wrksrc}/gmp
+	mv ${wrksrc}/mpfr-${_mpfr_version} ${wrksrc}/${build_wrksrc}/mpfr
+	mv ${wrksrc}/mpc-${_mpc_version} ${wrksrc}/${build_wrksrc}/mpc
+	mv ${wrksrc}/isl-${_isl_version} ${wrksrc}/${build_wrksrc}/isl
 
 	if [ "$build_option_gnatboot" ]; then
 		local f="${XBPS_SRCDISTDIR}/${pkgname}-${version}/${_gnat_tarball}"
 		msg_normal "Extracting ${_gnat_tarball} ...\n"
-		mkdir -p ${wrksrc}/gnat-ins
-		tar -x -f "$f" --strip-components=1 -C ${wrksrc}/gnat-ins
-		cd ${wrksrc}/gnat-ins
-		make ins-all prefix=${wrksrc}/gnat
-		cd ${wrksrc}
-		rm -rf ${wrksrc}/gnat-ins
+		mkdir -p ${wrksrc}/${build_wrksrc}/gnat-ins
+		tar -x -f "$f" --strip-components=1 -C ${wrksrc}/${build_wrksrc}/gnat-ins
+		cd ${wrksrc}/${build_wrksrc}/gnat-ins
+		make ins-all prefix=${wrksrc}/${build_wrksrc}/gnat
+		cd ${wrksrc}/${build_wrksrc}
+		rm -rf ${wrksrc}/${build_wrksrc}/gnat-ins
 
 		# Rename obsolete ld and as
-		find ${wrksrc}/gnat -name ld -exec mv -v {} {}.old \;
-		find ${wrksrc}/gnat -name as -exec mv -v {} {}.old \;
+		find ${wrksrc}/${build_wrksrc}/gnat -name ld -exec mv -v {} {}.old \;
+		find ${wrksrc}/${build_wrksrc}/gnat -name as -exec mv -v {} {}.old \;
 	fi
 }
 
@@ -185,9 +182,9 @@ pre_configure() {
 	sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
 
 	if [ "$XBPS_TARGET_LIBC" = musl ]; then
-		patch -p1 -i ${FILESDIR}/libgnarl-musl.patch
-		patch -p1 -i ${FILESDIR}/libssp-musl.patch
-		patch -p1 -i ${FILESDIR}/gccgo-musl.patch
+		for p in ${FILESDIR}/*-musl.patch; do
+			patch -p1 -i $p
+		done
 	fi
 }
 do_configure() {
@@ -297,19 +294,19 @@ do_configure() {
 		_args+=" --enable-languages=${_langs},ada"
 		_args+=" --enable-libada"
 		CONFIG_SHELL=/bin/bash \
-		CC="${wrksrc}/gnat/bin/gcc" \
-		GNATBIND="${wrksrc}/gnat/bin/gnatbind" \
-		GNATMAKE="${wrksrc}/gnat/bin/gnatmake" \
-		PATH="${wrksrc}/gnat/bin:$PATH" \
-			${wrksrc}/configure ${_args}
+		CC="${wrksrc}/${build_wrksrc}/gnat/bin/gcc" \
+		GNATBIND="${wrksrc}/${build_wrksrc}/gnat/bin/gnatbind" \
+		GNATMAKE="${wrksrc}/${build_wrksrc}/gnat/bin/gnatmake" \
+		PATH="${wrksrc}/${build_wrksrc}/gnat/bin:$PATH" \
+			${wrksrc}/${build_wrksrc}/configure ${_args}
 	elif [ "$build_option_ada" ]; then
 		_args+=" --enable-languages=${_langs},ada"
 		CONFIG_SHELL=/bin/bash \
-			${wrksrc}/configure ${_args}
+			${wrksrc}/${build_wrksrc}/configure ${_args}
 	else
 		_args+=" --enable-languages=${_langs}"
 		CONFIG_SHELL=/bin/bash \
-			${wrksrc}/configure ${_args}
+			${wrksrc}/${build_wrksrc}/configure ${_args}
 	fi
 }
 do_build() {
@@ -318,10 +315,10 @@ do_build() {
 	fi
 	cd build
 	if [ "$build_option_gnatboot" ]; then
-		CC="${wrksrc}/gnat/bin/gcc" \
-		GNATBIND="${wrksrc}/gnat/bin/gnatbind" \
-		GNATMAKE="${wrksrc}/gnat/bin/gnatmake" \
-		PATH="${wrksrc}/gnat/bin:$PATH" \
+		CC="${wrksrc}/${build_wrksrc}/gnat/bin/gcc" \
+		GNATBIND="${wrksrc}/${build_wrksrc}/gnat/bin/gnatbind" \
+		GNATMAKE="${wrksrc}/${build_wrksrc}/gnat/bin/gnatmake" \
+		PATH="${wrksrc}/${build_wrksrc}/gnat/bin:$PATH" \
 		make ${makejobs}
 	else
 		make ${makejobs}
@@ -330,7 +327,7 @@ do_build() {
 pre_install() {
 	if [ "$CROSS_BUILD" ]; then
 		# XXX otherwise links to host libpthread
-		for f in $(find ${wrksrc}/build/${XBPS_CROSS_TRIPLET} -type f -name libtool); do
+		for f in $(find ${wrksrc}/${build_wrksrc}/build/${XBPS_CROSS_TRIPLET} -type f -name libtool); do
 			sed -e "s,add_dir=\"-L\$libdir\",add_dir=\"-L${XBPS_CROSS_BASE}\$libdir\",g" -i $f
 		done
 	fi
@@ -342,16 +339,16 @@ do_install() {
 
 	# Make version a symlink of major version to make all versions
 	# from the same series work automagically.
-	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver} \
+	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${version} \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver}
 	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver} \
-		${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}
+		${DESTDIR}/usr/lib/gcc/${_triplet}/${version}
 
 	# Ditto for c++ headers.
-	mv ${DESTDIR}/usr/include/c++/${_patchver} \
+	mv ${DESTDIR}/usr/include/c++/${version} \
 		${DESTDIR}/usr/include/c++/${_minorver}
 	ln -sfr ${DESTDIR}/usr/include/c++/${_minorver} \
-		${DESTDIR}/usr/include/c++/${_patchver}
+		${DESTDIR}/usr/include/c++/${version}
 
 	# cc symlink
 	ln -sfr ${DESTDIR}/usr/bin/gcc ${DESTDIR}/usr/bin/cc
@@ -360,7 +357,7 @@ do_install() {
 
 	# lto plugin symlink
 	vmkdir usr/lib/bfd-plugins
-	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}/liblto_plugin.so \
+	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${version}/liblto_plugin.so \
 		${DESTDIR}/usr/lib/bfd-plugins
 
 	# Remove "fixed" header
@@ -375,8 +372,8 @@ do_install() {
 	rm -f ${DESTDIR}/usr/lib/*.py
 
 	# Remove more python stuff.
-	if [ -d ${DESTDIR}/usr/share/gcc-${_patchver}/python ]; then
-		rm -rf ${DESTDIR}/usr/share/gcc-${_patchver}/python
+	if [ -d ${DESTDIR}/usr/share/gcc-${version}/python ]; then
+		rm -rf ${DESTDIR}/usr/share/gcc-${version}/python
 	fi
 
 	# Install c89 and c99 wrappers and its manpages, from NetBSD.
@@ -396,7 +393,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}
@@ -449,7 +446,7 @@ gcc-fortran_package() {
 		if [ "$CROSS_BUILD" ]; then
 			# A number of OMP modules are not built when cross
 			# compiling gcc. Copy them from the cross compiler.
-			local src="/usr/lib/gcc/${_triplet}/${_patchver}/finclude"
+			local src="/usr/lib/gcc/${_triplet}/${version}/finclude"
 			local dst="usr/lib/gcc/${_triplet}/${_minorver}/finclude"
 			for f in omp_lib.f90 omp_lib.h omp_lib.mod omp_lib_kinds.mod \
 				openacc.f90 openacc.mod openacc_kinds.mod openacc_lib.h; do
@@ -516,7 +513,7 @@ libgfortran_package() {
 	short_desc+=" - Fortran library"
 	pkg_install() {
 		vmove "usr/lib/libgfortran.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -537,7 +534,7 @@ libgo_package() {
 	nostrip=yes
 	pkg_install() {
 		vmove "usr/lib/libgo.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -553,7 +550,7 @@ libobjc_package() {
 	short_desc+=" - Objective-C library"
 	pkg_install() {
 		vmove "usr/lib/libobjc.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -572,7 +569,7 @@ libquadmath_package() {
 	short_desc+=" - quadmath library"
 	pkg_install() {
 		vmove "usr/lib/libquadmath.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -614,7 +611,7 @@ libgcc_package() {
 	noverifyrdeps=yes
 	pkg_install() {
 		vmove "usr/lib/libgcc_s.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -645,7 +642,7 @@ libgomp_package() {
 	short_desc+=" - OpenMP v4.0 library"
 	pkg_install() {
 		vmove "usr/lib/libgomp*.so.*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -700,7 +697,7 @@ libssp_package() {
 	short_desc+=" - SSP (StackSmashingProtection) library"
 	pkg_install() {
 		vmove "usr/lib/libssp.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -718,6 +715,6 @@ libstdc++_package() {
 	short_desc+=" - Standard C++ Library"
 	pkg_install() {
 		vmove "usr/lib/libstdc++.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }

From d094915cc66b1fd3e84e08f8abb72512572b9c0a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 04/37] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      | 11 ++++--
 2 files changed, 25 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..51611929d643 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,12 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
+
+if [ "$XBPS_LIBC" == "musl" ]; then
+	# Musl always searches LD_LIBRARY_PATH before RPATH and RUNPATH
+	make_build_args="lt_cv_shlibpath_overrides_runpath=yes"
+fi
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From 9d992cede2da10b99141dda028a85c2fff85d83d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 05/37] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 55255dceae8b..ca2d858a7abc 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From 61cf448ae0aa8e16c8d0cc58da189f3451dbae94 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 06/37] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 3 files changed, 55 insertions(+), 353 deletions(-)
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index 98df5e9347ae..831a075118cd 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From 59c4d58ddb4f86b5d9d7f96b09a2422950cafe6b Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Wed, 14 Sep 2022 03:48:32 -0700
Subject: [PATCH 07/37] musl: add support for SIGEV_THREAD_ID timers

https://git.musl-libc.org/cgit/musl/commit/?id=7c71792e87691451f2a6b76348e83ad1889f1dcb
---
 ...d-support-for-SIGEV_THREAD_ID-timers.patch | 74 +++++++++++++++++++
 srcpkgs/musl/template                         |  2 +-
 2 files changed, 75 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch

diff --git a/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
new file mode 100644
index 000000000000..e20dff5ba0d4
--- /dev/null
+++ b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
@@ -0,0 +1,74 @@
+From 7c71792e87691451f2a6b76348e83ad1889f1dcb Mon Sep 17 00:00:00 2001
+From: James Y Knight <jyknight@google.com>
+Date: Sun, 30 Jun 2019 21:55:20 -0400
+Subject: [PATCH] add support for SIGEV_THREAD_ID timers
+
+This is like SIGEV_SIGNAL, but targeted to a particular thread's
+tid, rather than the process.
+---
+ include/signal.h        | 16 +++++++++++++---
+ src/time/timer_create.c |  8 ++++++--
+ 2 files changed, 19 insertions(+), 5 deletions(-)
+
+diff --git a/include/signal.h b/include/signal.h
+index fbdf667b2..9ed929e4f 100644
+--- a/include/signal.h
++++ b/include/signal.h
+@@ -180,14 +180,24 @@ struct sigevent {
+ 	union sigval sigev_value;
+ 	int sigev_signo;
+ 	int sigev_notify;
+-	void (*sigev_notify_function)(union sigval);
+-	pthread_attr_t *sigev_notify_attributes;
+-	char __pad[56-3*sizeof(long)];
++	union {
++		char __pad[64 - 2*sizeof(int) - sizeof(union sigval)];
++		pid_t sigev_notify_thread_id;
++		struct {
++			void (*sigev_notify_function)(union sigval);
++			pthread_attr_t *sigev_notify_attributes;
++		} __sev_thread;
++	} __sev_fields;
+ };
+ 
++#define sigev_notify_thread_id __sev_fields.sigev_notify_thread_id
++#define sigev_notify_function __sev_fields.__sev_thread.sigev_notify_function
++#define sigev_notify_attributes __sev_fields.__sev_thread.sigev_notify_attributes
++
+ #define SIGEV_SIGNAL 0
+ #define SIGEV_NONE 1
+ #define SIGEV_THREAD 2
++#define SIGEV_THREAD_ID 4
+ 
+ int __libc_current_sigrtmin(void);
+ int __libc_current_sigrtmax(void);
+diff --git a/src/time/timer_create.c b/src/time/timer_create.c
+index 5ddfda278..4bef23905 100644
+--- a/src/time/timer_create.c
++++ b/src/time/timer_create.c
+@@ -71,11 +71,15 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 	switch (evp ? evp->sigev_notify : SIGEV_SIGNAL) {
+ 	case SIGEV_NONE:
+ 	case SIGEV_SIGNAL:
++	case SIGEV_THREAD_ID:
+ 		if (evp) {
+ 			ksev.sigev_value = evp->sigev_value;
+ 			ksev.sigev_signo = evp->sigev_signo;
+ 			ksev.sigev_notify = evp->sigev_notify;
+-			ksev.sigev_tid = 0;
++			if (evp->sigev_notify == SIGEV_THREAD_ID)
++				ksev.sigev_tid = evp->sigev_notify_thread_id;
++			else
++				ksev.sigev_tid = 0;
+ 			ksevp = &ksev;
+ 		}
+ 		if (syscall(SYS_timer_create, clk, ksevp, &timerid) < 0)
+@@ -107,7 +111,7 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 
+ 		ksev.sigev_value.sival_ptr = 0;
+ 		ksev.sigev_signo = SIGTIMER;
+-		ksev.sigev_notify = 4; /* SIGEV_THREAD_ID */
++		ksev.sigev_notify = SIGEV_THREAD_ID;
+ 		ksev.sigev_tid = td->tid;
+ 		if (syscall(SYS_timer_create, clk, &ksev, &timerid) < 0)
+ 			timerid = -1;
diff --git a/srcpkgs/musl/template b/srcpkgs/musl/template
index 5bdc5c48e623..34e6ed4fba6e 100644
--- a/srcpkgs/musl/template
+++ b/srcpkgs/musl/template
@@ -2,7 +2,7 @@
 pkgname=musl
 reverts="1.2.0_1"
 version=1.1.24
-revision=10
+revision=11
 archs="*-musl"
 bootstrap=yes
 build_style=gnu-configure

From c6ceb90072520f1f4ae68f51c932b9649033ba0a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 21:01:43 -0700
Subject: [PATCH 08/37] gcc-multilib: update to 12.2.0.

---
 srcpkgs/gcc-multilib/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index fcd25755aa75..df60849babc2 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,16 +3,16 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _majorver="${version%.*}"
-wrksrc=gcc-${version/pre/_pre}
+wrksrc="gcc-${version}"
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel
@@ -71,7 +71,7 @@ do_build() {
 	make ${makejobs}
 }
 do_install() {
-	local _pc_triplet=x86_64-pc-linux-gnu _version=${version%pre1}
+	local _pc_triplet=x86_64-pc-linux-gnu
 	# Install to a tempdir and then only copy relevant files.
 	cd ${wrksrc}
 	make DESTDIR=${wrksrc}/${pkgname}-build install
@@ -81,9 +81,9 @@ do_install() {
 	vmkdir usr/include/c++/${_majorver}/${_triplet}
 	vmkdir usr/lib/gcc/${_triplet}/${_majorver}
 
-	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${_version}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${version}/32 \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_majorver}/
-	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${_version}/${_pc_triplet}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${version}/${_pc_triplet}/32 \
 		${DESTDIR}/usr/include/c++/${_majorver}/${_triplet}
 
 	vinstall ${wrksrc}/host-${_pc_triplet}/gcc/specs 644 usr/lib/gcc/${_triplet}/${_majorver}

From f0309af65c393bc913034bdbcf0ca00cbe620412 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Tue, 4 Oct 2022 03:49:13 -0700
Subject: [PATCH 09/37] libgccjit: update to 12.2.0.

---
 srcpkgs/libgccjit/files/libgccjit-musl.patch | 63 --------------------
 srcpkgs/libgccjit/template                   | 38 ++++++------
 2 files changed, 17 insertions(+), 84 deletions(-)
 delete mode 100644 srcpkgs/libgccjit/files/libgccjit-musl.patch

diff --git a/srcpkgs/libgccjit/files/libgccjit-musl.patch b/srcpkgs/libgccjit/files/libgccjit-musl.patch
deleted file mode 100644
index d2ed16928c82..000000000000
--- a/srcpkgs/libgccjit/files/libgccjit-musl.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-diff --git a/gcc/jit/jit-playback.c b/gcc/jit/jit-playback.c
-index 5bccf591a..35f5e35ef 100644
---- a/gcc/jit/jit-playback.c
-+++ b/gcc/jit/jit-playback.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -41,8 +43,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "diagnostic.h"
- #include "stmt.h"
- 
--#include <pthread.h>
--
- #include "jit-playback.h"
- #include "jit-result.h"
- #include "jit-builtins.h"
-diff --git a/gcc/jit/jit-recording.c b/gcc/jit/jit-recording.c
-index a237d574f..5785e3269 100644
---- a/gcc/jit/jit-recording.c
-+++ b/gcc/jit/jit-recording.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -25,8 +27,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "pretty-print.h"
- #include "toplev.h"
- 
--#include <pthread.h>
--
- #include "jit-builtins.h"
- #include "jit-recording.h"
- #include "jit-playback.h"
-diff --git a/gcc/jit/libgccjit.c b/gcc/jit/libgccjit.c
-index f9c33c63c..75f21d275 100644
---- a/gcc/jit/libgccjit.c
-+++ b/gcc/jit/libgccjit.c
-@@ -18,13 +18,13 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
- #include "timevar.h"
- #include "typed-splay-tree.h"
- #include "cppbuiltin.h"
--#include <pthread.h>
- 
- #include "libgccjit.h"
- #include "jit-recording.h"
diff --git a/srcpkgs/libgccjit/template b/srcpkgs/libgccjit/template
index 6f1d6256dcd6..2f2802eaba8b 100644
--- a/srcpkgs/libgccjit/template
+++ b/srcpkgs/libgccjit/template
@@ -3,36 +3,32 @@
 # which use the version number.
 
 pkgname=libgccjit
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
+version=12.2.0
 revision=1
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
-_majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
-wrksrc=gcc-${version/pre/_pre}
+_mpc_version=1.2.1
+_isl_version=0.24
 short_desc="Just-In-Time Compilation library for GCC"
 maintainer="Lane Biocini <lane@mailbox.org>"
 homepage="https://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 nopie=yes
+create_wrksrc=yes
+build_wrksrc="gcc-${version}"
+patch_args="-Np1 --directory=${build_wrksrc}"
 lib32disabled=yes
 makedepends="zlib-devel"
 hostmakedepends="tar texinfo perl flex"
@@ -40,10 +36,10 @@ depends="gcc"
 checkdepends="dejagnu"
 
 post_extract() {
-	mv ${XBPS_BUILDDIR}/gmp-${_gmp_version} ${wrksrc}/gmp
-	mv ${XBPS_BUILDDIR}/mpfr-${_mpfr_version} ${wrksrc}/mpfr
-	mv ${XBPS_BUILDDIR}/mpc-${_mpc_version} ${wrksrc}/mpc
-	mv ${XBPS_BUILDDIR}/isl-${_isl_version} ${wrksrc}/isl
+	mv ${wrksrc}/gmp-${_gmp_version} ${wrksrc}/${build_wrksrc}/gmp
+	mv ${wrksrc}/mpfr-${_mpfr_version} ${wrksrc}/${build_wrksrc}/mpfr
+	mv ${wrksrc}/mpc-${_mpc_version} ${wrksrc}/${build_wrksrc}/mpc
+	mv ${wrksrc}/isl-${_isl_version} ${wrksrc}/${build_wrksrc}/isl
 }
 
 pre_configure() {
@@ -186,7 +182,7 @@ do_configure() {
 	[ -z "$XBPS_CHECK_PKGS" ] && _langs="jit" || _langs="jit,c++"
 	_args+=" --enable-languages=${_langs}"
 	CONFIG_SHELL=/bin/bash \
-		${wrksrc}/configure ${_args}
+		${wrksrc}/${build_wrksrc}/configure ${_args}
 }
 
 do_build() {

From dd8652aa9f97ee71e57e46b20b47372250161b65 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 14 Aug 2022 19:29:36 -0700
Subject: [PATCH 10/37] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove -no-pie from build. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..5d40f0cdd8a6 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -53,6 +53,7 @@ _void_cross_build_binutils() {
 		--sbindir=/usr/bin \
 		--libdir=/usr/lib \
 		--libexecdir=/usr/lib \
+		--sysconfdir=/etc \
 		--target=${tgt} \
 		--with-sysroot=/usr/${tgt} \
 		--disable-nls \
@@ -60,7 +61,9 @@ _void_cross_build_binutils() {
 		--disable-multilib \
 		--disable-werror \
 		--disable-gold \
+		--disable-gprofng \
 		--enable-relro \
+		--enable-new-dtags \
 		--enable-plugins \
 		--enable-64-bit-bfd \
 		--enable-deterministic-archives \
@@ -132,6 +135,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -460,6 +464,14 @@ do_build() {
 	local binutils_ver linux_ver gcc_ver libc_ver libucontext_ver
 	local tgt=${sourcepkg/cross-}
 
+	export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}"
+	export CXXFLAGS="${CXXFLAGS/-D_FORTIFY_SOURCE=2/}"
+
+	# Disable explicit -fno-PIE, gcc/binutils/libc will figure this out itself.
+	export CFLAGS="${CFLAGS//-fno-PIE/}"
+	export CXXFLAGS="${CXXFLAGS//-fno-PIE/}"
+	export LDFLAGS="${LDFLAGS//-no-pie/}"
+
 	_void_cross_test_ver binutils
 	_void_cross_test_ver linux
 	_void_cross_test_ver gcc
@@ -625,6 +637,9 @@ do_install() {
 	# then remove it because it conflicts with libquadmath package
 	rm -rf ${DESTDIR}/${sysroot}/usr/lib/libquadmath.*
 
+	# Remove libdep linker plugin because it conflicts with system binutils
+	rm -f ${DESTDIR}/usr/lib/bfd-plugins/libdep*
+
 	# Remove leftover symlinks
 	rm -f ${DESTDIR}/usr/lib${XBPS_TARGET_WORDSIZE}
 	rm -f ${DESTDIR}/lib*

From aa55ca8795fe9e79f1382410ac0cad92c6097a5b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:09:31 -0700
Subject: [PATCH 11/37] linux5.18: update dotconfigs for gcc12

---
 srcpkgs/linux5.18/files/x86_64-dotconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/linux5.18/files/x86_64-dotconfig b/srcpkgs/linux5.18/files/x86_64-dotconfig
index 4e73a3195d40..ea6204868e23 100644
--- a/srcpkgs/linux5.18/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.18/files/x86_64-dotconfig
@@ -512,6 +512,7 @@ CONFIG_RETHUNK=y
 CONFIG_CPU_UNRET_ENTRY=y
 CONFIG_CPU_IBPB_ENTRY=y
 CONFIG_CPU_IBRS_ENTRY=y
+CONFIG_SLS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10060,8 +10061,11 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
 # Memory initialization
 #
 CONFIG_INIT_STACK_NONE=y
+# CONFIG_INIT_STACK_ALL_PATTERN is not set
+# CONFIG_INIT_STACK_ALL_ZERO is not set
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
+# CONFIG_ZERO_CALL_USED_REGS is not set
 # end of Memory initialization
 # end of Kernel hardening options
 # end of Security options
@@ -10538,6 +10542,7 @@ CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
 # CONFIG_UBSAN is not set
 CONFIG_HAVE_ARCH_KCSAN=y
+# CONFIG_KCSAN is not set
 # end of Generic Kernel Debugging Instruments
 
 #

From a936dd0b7865f123edf3f7736a42ce11b8d0d14d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:08 -0700
Subject: [PATCH 12/37] subversion: fix build for libtool 2.4.7

---
 srcpkgs/subversion/template | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/subversion/template b/srcpkgs/subversion/template
index 18c35e3a2132..0aa41212c5fd 100644
--- a/srcpkgs/subversion/template
+++ b/srcpkgs/subversion/template
@@ -24,6 +24,8 @@ distfiles="http://apache.uvigo.es/subversion/subversion-${version}.tar.bz2"
 checksum=c9130e8d0b75728a66f0e7038fc77052e671830d785b5616aad53b4810d3cc28
 
 pre_configure() {
+	./autogen.sh --release
+
 	# Based on native build values
 	cat <<-EOF >config.cache
 	ac_cv_python_includes=-I${XBPS_CROSS_BASE}/usr/include/python${py3_ver}
@@ -59,7 +61,12 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+
+	if [ "$XBPS_BUILD_ENVIRONMENT" = "void-packages-ci" ]; then
+		# This test will fail when run as the root user,
+		# because flock() will ignore file permissions.
+		vsed -i subversion/tests/libsvn_fs/locks-test.c -e '/SVN_TEST_OPTS_PASS(obtain_write_lock_failure,/,+3d'
+	fi
 }
 
 post_configure() {

From af198bc411df0d3dea6f20ae271d39836bffd1f7 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:38 -0700
Subject: [PATCH 13/37] subversion-kwallet-auth: update to 1.14.2.

Fix failing distfiles.
Fix build for libtool 2.4.7
---
 srcpkgs/subversion-kwallet-auth/template | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/subversion-kwallet-auth/template b/srcpkgs/subversion-kwallet-auth/template
index 12210f250d51..9cc68c3fe5f1 100644
--- a/srcpkgs/subversion-kwallet-auth/template
+++ b/srcpkgs/subversion-kwallet-auth/template
@@ -3,7 +3,7 @@
 # THIS PKG MUST BE SYNCHRONIZED WITH "srcpkgs/subversion".
 #
 pkgname=subversion-kwallet-auth
-version=1.14.1
+version=1.14.2
 revision=1
 wrksrc="subversion-${version}"
 build_style=gnu-configure
@@ -22,10 +22,12 @@ license="Apache-2.0, BSD-3-Clause"
 homepage="http://subversion.apache.org/"
 changelog="https://subversion.apache.org/docs/release-notes/${version%.*}.html"
 distfiles="http://apache.uvigo.es/subversion/subversion-${version}.tar.bz2"
-checksum=2c5da93c255d2e5569fa91d92457fdb65396b0666fad4fd59b22e154d986e1a9
+checksum=c9130e8d0b75728a66f0e7038fc77052e671830d785b5616aad53b4810d3cc28
 lib32disabled=yes
 
 pre_configure() {
+	./autogen.sh --release
+
 	# Based on native build values
 	cat <<-EOF >config.cache
 	ac_cv_python_includes=-I${XBPS_CROSS_BASE}/usr/include/python${py3_ver}
@@ -55,11 +57,18 @@ pre_configure() {
 		cp "$XBPS_CROSS_BASE/usr/lib/perl5/core_perl/Config"*.p? $PERL5LIB
 		cp "$XBPS_CROSS_BASE/usr/lib/perl5/core_perl/Errno.pm" $PERL5LIB
 		vsed -e "s;archlibexp => '\(.*\)';archlibexp => '${XBPS_CROSS_BASE}\1';" \
-			-i $PERL5LIB/Config.pm $PERL5LIB/Config_heavy.pl
+			-i $PERL5LIB/Config.pm
+		vsed -e "s;archlibexp='\(.*\)';archlibexp='${XBPS_CROSS_BASE}\1';" \
+			-i $PERL5LIB/Config_heavy.pl
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+
+	if [ "$XBPS_BUILD_ENVIRONMENT" = "void-packages-ci" ]; then
+		# This test will fail when run as the root user,
+		# because flock() will ignore file permissions.
+		vsed -i subversion/tests/libsvn_fs/locks-test.c -e '/SVN_TEST_OPTS_PASS(obtain_write_lock_failure,/,+3d'
+	fi
 }
 
 post_configure() {

From 0b0aa6f2fe427263b8c71bbed74a228a998dab6b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 14/37] cross-aarch64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..bd6b23f9fb6a 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 209c35cf7979230210124a28e67b88b76b8aa055 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 15/37] cross-aarch64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..427ad2c1e9cd 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From b54e663d1d6a9c6ccd83155b51405a5cc76a7bec Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 16/37] cross-arm-linux-gnueabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..2510ee26e789 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From abf9a78b5f5a1f98c263de3a9d43501c04bc6873 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 17/37] cross-arm-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..bd8b16e1b4c1 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 2344ac01ceb35340d5dd278474324cbe47a039bc Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 18/37] cross-arm-linux-musleabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..dacfd2655216 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 0d9e6829e838b42334a70baf81b9b05ce0004915 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 19/37] cross-arm-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..9ddd32a9f20d 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 34e80210bb69ec93aa96b945fe9b6ac8f807fd8b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 20/37] cross-armv7l-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..9fb00f18be3b 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 9b00cbb2cf514ee8aa608e74c5259433690d4957 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 21/37] cross-armv7l-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..2c72e75ddfe3 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 1d4fd3f4df1895cb39abc8113839590168d78e67 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 22/37] cross-i686-pc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..4dc17df648b5 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 595297df47413aecba14b713946f88c23139d6c1 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Fri, 16 Sep 2022 20:52:19 -0700
Subject: [PATCH 23/37] cross-i686-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-linux-musl/template b/srcpkgs/cross-i686-linux-musl/template
index 8be16a230d8d..78b4d813a113 100644
--- a/srcpkgs/cross-i686-linux-musl/template
+++ b/srcpkgs/cross-i686-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-i686-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-i686-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 56a54db18889f7c9f494b04d29bc3efa32adc339 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 24/37] cross-mips-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..6009e5c79eb2 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 6a44bf40f8709d56055d0f0c9b6b4f4773393c72 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 25/37] cross-mips-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..080164df193d 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="hipperson0 <hipperson0@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 2572c5ecf29e95a57c9b4b6592da845a309130b3 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 26/37] cross-mipsel-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..f9fd4b8a04ef 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 7a7bbbcd701cf08fa0429b4ca46d5d5ca219b197 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 27/37] cross-mipsel-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..7418a984474b 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From acba6f46c4a9837582af1a015a79121c5948e4e1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 28/37] cross-powerpc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..31e57b4e52b2 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 06b5a00c143ac46934c29008c45876ee624d5b62 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 29/37] cross-powerpc-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..a2d1edcf1ffd 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 15406f7ce75f40dfe9039e9d4a0da059e60059df Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 30/37] cross-powerpc64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..1a4cbed61e76 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From ed0d7a80bd04f43918a019181ea36b89c1c7d220 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 31/37] cross-powerpc64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 016f18776a6d..19b1ff859eb6 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 8ee12e88db527b174deabb7d0d465a0e973ca38d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 32/37] cross-powerpc64le-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 463d7e92d20d..9d99a3a315d2 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 33e6f698df64963872a5ce6e42a3ba4ee5550f02 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 33/37] cross-powerpc64le-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index c17a3cccfe29..3128baa7372e 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 10695eb8adf2d293764f78d6dafa2ced82e83ca9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 34/37] cross-powerpcle-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 9aede3c465ce..6f914b3877ee 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 10fbfcef08271fb3a573df0890986100871e6952 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 35/37] cross-powerpcle-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index 045cfda987fe..20e70bed4c60 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 2f73d04d37903d14b037f4d29a857b558d95e0d9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 36/37] cross-x86_64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 8918f3c22a1c..5219cd50f851 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 4c8fe93deb1f118f6d96957cc217583db8657a89 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 37/37] cross-x86_64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..2811de0d3c2e 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR REVIEW] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (168 preceding siblings ...)
  2022-10-08 21:03 ` [PR PATCH] [Updated] " oreo639
@ 2022-10-08 21:03 ` oreo639
  2022-10-09  1:32 ` oreo639
                   ` (94 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-10-08 21:03 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 154 bytes --]

New review comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#discussion_r990695254

Comment:
Thanks.

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (169 preceding siblings ...)
  2022-10-08 21:03 ` [PR REVIEW] " oreo639
@ 2022-10-09  1:32 ` oreo639
  2022-10-09  1:45 ` ayoubelmhamdi
                   ` (93 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-10-09  1:32 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 226 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1272428063

Comment:
Did you do `./xbps-src binary-bootstrap`? (Make sure to delete your masterdir first)

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (170 preceding siblings ...)
  2022-10-09  1:32 ` oreo639
@ 2022-10-09  1:45 ` ayoubelmhamdi
  2022-10-09  1:57 ` oreo639
                   ` (92 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: ayoubelmhamdi @ 2022-10-09  1:45 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 231 bytes --]

New comment by ayoubelmhamdi on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1272429709

Comment:
@oreo639 I will start from scratch, perhaps, I have some problems with permissions,

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (171 preceding siblings ...)
  2022-10-09  1:45 ` ayoubelmhamdi
@ 2022-10-09  1:57 ` oreo639
  2022-10-09  1:57 ` oreo639
                   ` (91 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-10-09  1:57 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 309 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1272431052

Comment:
Just follow the instructions here and make sure to use binary-bootstrap:
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#testing-pull-requests

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (172 preceding siblings ...)
  2022-10-09  1:57 ` oreo639
@ 2022-10-09  1:57 ` oreo639
  2022-10-09  1:59 ` oreo639
                   ` (90 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-10-09  1:57 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 308 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1272431052

Comment:
Just follow the instructions here and make sure to do binary-bootstrap:
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#testing-pull-requests

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (173 preceding siblings ...)
  2022-10-09  1:57 ` oreo639
@ 2022-10-09  1:59 ` oreo639
  2022-10-09  3:36 ` oreo639
                   ` (89 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-10-09  1:59 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 304 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1272431052

Comment:
Look at the instructions here and make sure to do binary-bootstrap:
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#testing-pull-requests

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (174 preceding siblings ...)
  2022-10-09  1:59 ` oreo639
@ 2022-10-09  3:36 ` oreo639
  2022-10-09  7:47 ` ayoubelmhamdi
                   ` (88 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-10-09  3:36 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 310 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1272431052

Comment:
Try following the instructions here and make sure to do binary-bootstrap:
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#testing-pull-requests

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (175 preceding siblings ...)
  2022-10-09  3:36 ` oreo639
@ 2022-10-09  7:47 ` ayoubelmhamdi
  2022-10-10  4:15 ` [PR PATCH] [Updated] " oreo639
                   ` (87 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: ayoubelmhamdi @ 2022-10-09  7:47 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1390 bytes --]

New comment by ayoubelmhamdi on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1272480188

Comment:
@oreo639 
how I can solve this issue with `cmake`
```
checking for ftruncate... yes
checking for ffsll... yes
checking mremap with MREMAP_MAYMOVE... yes
checking for a sed that does not truncate output... /bin/sed
checking whether cc is Clang... no
checking whether pthreads work with -pthread... no
checking whether pthreads work with -pthreads... no
checking for the pthreads library -lpthreads... no
checking whether pthreads work without any flags... no
checking whether pthreads work with -Kthread... no
checking whether pthreads work with -pthread... no
checking whether pthreads work with -pthreads... no
checking whether pthreads work with -mthreads... no
checking for the pthreads library -lpthread... no
checking whether pthreads work with --thread-safe... no
checking whether pthreads work with -mt... no
checking for pthread-config... no
configure: error: pthread not found
make[1]: *** [Makefile:6806: configure-gold] Error 1
make[1]: Leaving directory '/home/data/opt/xbps-src/void-packages/masterdir/builddir/binutils-2.39/build'
make: *** [Makefile:1004: all] Error 2
=> ERROR: binutils-2.39_1: do_build: 'make ${makejobs}' exited with 2
=> ERROR:   in do_build() at srcpkgs/binutils/template:105
```

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (176 preceding siblings ...)
  2022-10-09  7:47 ` ayoubelmhamdi
@ 2022-10-10  4:15 ` oreo639
  2022-10-10  5:05 ` oreo639
                   ` (86 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-10-10  4:15 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5478 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.2.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.2.0

There is a list of failing builds here: https://github.com/void-linux/void-packages/issues/39809

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [x] llvm https://github.com/void-linux/void-packages/pull/38694
- [x] m4 https://github.com/void-linux/void-packages/pull/33730
- [x] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [x] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [x] libvirt https://github.com/void-linux/void-packages/pull/38842
- [x] syslinux https://github.com/void-linux/void-packages/pull/38876
- [x] efivar https://github.com/void-linux/void-packages/pull/38874
- [ ] gpgme https://github.com/void-linux/void-packages/pull/38825

Known packages that needed to be fixed/updated for gcc12:
- [ ] linux5.18 (in this PR)
- [x] openssh https://github.com/void-linux/void-packages/pull/38849
- [x] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [x] doxygen https://github.com/void-linux/void-packages/pull/38846
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] libproxy https://github.com/void-linux/void-packages/pull/38818
- [x] exempi https://github.com/void-linux/void-packages/pull/38820
- [x] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [x] libunique1 https://github.com/void-linux/void-packages/pull/38848 or https://github.com/void-linux/void-packages/pull/38873
- [x] libwpd https://github.com/void-linux/void-packages/pull/38878
- [x] cglm https://github.com/void-linux/void-packages/pull/39748
- [x] coreboot-utils https://github.com/void-linux/void-packages/pull/39749
- [x] apl https://github.com/void-linux/void-packages/pull/39750
- [x] igt-gpu-tools https://github.com/void-linux/void-packages/pull/39780

Needs to be fixed/updated for binutils:
- [x] grub https://github.com/void-linux/void-packages/pull/38875
- [x] linux-tools https://github.com/void-linux/void-packages/pull/38877
- [x] kcov https://github.com/void-linux/void-packages/pull/39291

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [x] kde
- [x] lxde
- [x] lxqt

You can test the ISOs here:
https://drive.google.com/drive/folders/1ix92CYSLUP-KWjLxltdgG4e8Nu2JCY5n?usp=sharing

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 130133 bytes --]

From b7ec4edfe2a526c2474b734d3403db5f6d84cd20 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 01/37] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../fix-libcollector-without-java.patch       | 53 +++++++++++++++
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 25 ++++---
 4 files changed, 87 insertions(+), 117 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
 create mode 100644 srcpkgs/binutils/patches/fix-libcollector-without-java.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/fix-libcollector-without-java.patch b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
new file mode 100644
index 000000000000..54384875f358
--- /dev/null
+++ b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
@@ -0,0 +1,53 @@
+From 49ddd814ac1071af7c4f45d5f8398b91862f2c7f Mon Sep 17 00:00:00 2001
+From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
+Date: Wed, 17 Aug 2022 19:55:23 -0700
+Subject: [PATCH] gprofng: fix bug 29479 Collection fails when built without
+ java support
+
+gprofng/ChangeLog
+2022-08-17  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>
+
+	PR gprofng/29479
+	* libcollector/collector.c: Add #if defined(GPROFNG_JAVA_PROFILING) for
+	java specific code.
+	* libcollector/unwind.c: Likewise.
+---
+ gprofng/libcollector/collector.c | 2 ++
+ gprofng/libcollector/unwind.c    | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/gprofng/libcollector/collector.c b/gprofng/libcollector/collector.c
+index 93c9d3330de5..ceff2c1caccb 100644
+--- a/gprofng/libcollector/collector.c
++++ b/gprofng/libcollector/collector.c
+@@ -913,8 +913,10 @@ __collector_open_experiment (const char *exp, const char *params, sp_origin_t or
+   __collector_ext_unwind_key_init (1, NULL);
+ 
+   /* start java attach if suitable */
++#if defined(GPROFNG_JAVA_PROFILING)
+   if (exp_origin == SP_ORIGIN_DBX_ATTACH)
+     __collector_jprofile_start_attach ();
++#endif
+   start_sec_time = CALL_UTIL (time)(NULL);
+   __collector_start_time = collector_interface.getHiResTime ();
+   TprintfT (DBG_LT0, "\t__collector_open_experiment; resetting start_time\n");
+diff --git a/gprofng/libcollector/unwind.c b/gprofng/libcollector/unwind.c
+index 119243788020..f8e11823c81e 100644
+--- a/gprofng/libcollector/unwind.c
++++ b/gprofng/libcollector/unwind.c
+@@ -557,6 +557,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+   int size = max_frame_size;
+ 
+ #define MIN(a,b) ((a)<(b)?(a):(b))
++#if defined(GPROFNG_JAVA_PROFILING)
+   /* get Java info */
+   if (__collector_java_mode && __collector_java_asyncgetcalltrace_loaded && context && !pseudo_context)
+     {
+@@ -569,6 +570,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+ 	  size -= sz;
+ 	}
+     }
++#endif
+ 
+   /* get native stack */
+   if (context)
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..c355a5fc8016 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkgconf"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -35,15 +36,21 @@ do_configure() {
 	local conf
 
 	if [ "$CHROOT_READY" ]; then
-		conf+=" --with-debuginfod"
+		conf+=" --with-debuginfod --enable-shared"
 	else
-		conf+=" --without-debuginfod --disable-install-libbfd"
+		conf+=" --without-debuginfod --disable-shared --disable-install-libbfd"
 	fi
 	if [ "$CROSS_BUILD" ]; then
 		# we don't want --with-sysroot=${XBPS_CROSS_BASE} like gnu-configure
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	# gprofng currently only supports x86 and aarch64 glibc.
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64|i386|aarch64) conf+=" --enable-gprofng" ;;
+		*) conf+=" --disable-gprofng" ;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"
@@ -76,13 +83,14 @@ do_configure() {
 		--libdir=/usr/lib \
 		--mandir=/usr/share/man \
 		--infodir=/usr/share/info \
+		--sysconfdir=/etc \
 		--disable-werror \
-		--disable-shared \
 		--disable-nls \
 		--enable-threads \
 		--enable-plugins \
 		--enable-relro \
 		--enable-gold \
+		--enable-new-dtags \
 		--enable-deterministic-archives \
 		--enable-64-bit-bfd \
 		--enable-ld=default \
@@ -142,7 +150,8 @@ binutils-devel_package() {
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/*.a"
-		vmove "usr/lib/*.so"
+		vmove "usr/lib/libbfd.so"
+		vmove "usr/lib/libopcodes.so"
 	}
 }
 

From 4d8d5b492e6a618174e9dc03ec065f104b157692 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 2 Oct 2022 16:46:59 -0700
Subject: [PATCH 02/37] gdb: resolve conflict with binutils 2.39

---
 srcpkgs/gdb/template | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/gdb/template b/srcpkgs/gdb/template
index ff7c9d9a5911..5970402eb27e 100644
--- a/srcpkgs/gdb/template
+++ b/srcpkgs/gdb/template
@@ -1,7 +1,7 @@
 # Template file for 'gdb'
 pkgname=gdb
 version=12.1
-revision=1
+revision=2
 build_style=gnu-configure
 pycompile_dirs="/usr/share/gdb/python"
 configure_args="--disable-werror --disable-nls --with-system-readline
@@ -48,7 +48,8 @@ vopt_conflict debuginfod static
 
 post_install() {
 	# resolve conflicts with binutils
-	rm -r ${DESTDIR}/usr/{include,lib,share/info/bfd.info*}
+	rm -rf ${DESTDIR}/usr/{include,lib}
+	rm -rf ${DESTDIR}/usr/share/info/{bfd,ctf-spec}.info*
 }
 
 gdb-common_package() {

From b3a772277b08adf4484ae0dadf3320251e9fb6cb Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 03/37] gcc: update to 12.2.0.

---
 common/shlibs                                 |  10 +-
 srcpkgs/gcc/files/gccgo-musl.patch            |  71 ++--------
 srcpkgs/gcc/files/libgnarl-musl.patch         |  18 +--
 srcpkgs/gcc/files/libssp-musl.patch           |  10 +-
 srcpkgs/gcc/patches/libffi_gnulinux.patch     |  11 --
 .../gcc/patches/libgcc-ibm128-no-tag.patch    |  10 +-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |   2 +-
 srcpkgs/gcc/template                          | 123 +++++++++---------
 8 files changed, 98 insertions(+), 157 deletions(-)
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index 9f95ac87a7ea..881c8d459eaa 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.2.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.36 perl-5.36.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -847,8 +847,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.2.0_1
+libgnat-12.so libada-12.2.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1697,8 +1697,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.2.0_1
+libasan.so.8 libsanitizer-12.2.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..12ec68dd8aa3 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,14 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ b/libgo/go/runtime/os_linux.go
+@@ -365,7 +365,7 @@ func setThreadCPUProfiler(hz int32) {
+ 	var sevp _sigevent
+ 	sevp.sigev_notify = _SIGEV_THREAD_ID
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.__sev_fields))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..7c93c93f93af 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,37 +3,35 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
+version=12.2.0
+revision=1
+_minorver="${version%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
-wrksrc=gcc-${version/pre/_pre}
+_mpc_version=1.2.1
+_isl_version=0.24
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
+create_wrksrc=yes
+build_wrksrc="gcc-${version}"
+patch_args="-Np1 --directory=${build_wrksrc}"
 lib32disabled=yes
 bootstrap=yes
 replaces="gcc-gcj<7.2.0 gcc-gcj-jdk-compat<7.2.0 libmpx>=0 libmpx-devel>=0"
@@ -70,13 +68,13 @@ if [ "$build_option_gnatboot" ]; then
 	case "$XBPS_TARGET_MACHINE" in
 	x86_64)
 		_gnat_tarball="gnat-gpl-2017-x86_64-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/591c6d80c7a447af2deed1d7>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/9682e2e1f2f232ce03fe21d77b14c37a0de5649b?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" b942bcac20dea39748b39f8b624d9619f60a8dee2e8195dbe3829c835b0956e6"
 		build_options_default="gnatboot"
 		;;
 	i686)
 		_gnat_tarball="gnat-gpl-2014-x86-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/564b3e9dc8e196b040fbe248>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/c5e9e6fdff5cb77ed90cf8c62536653e27c0bed6?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" 3b693510f5d22a240abb3034934c1adbd80ccd6e4f61a4f491cc408fdfd9c042"
 		build_options_default="gnatboot"
 		;;
@@ -155,25 +153,24 @@ if [ "$CROSS_BUILD" ]; then
 fi
 
 post_extract() {
-	mkdir -p ${wrksrc}/{gmp,mpfr,mpc,isl}
-	cp -ar ${XBPS_BUILDDIR}/gmp-${_gmp_version}/* ${wrksrc}/gmp/
-	cp -ar ${XBPS_BUILDDIR}/mpfr-${_mpfr_version}/* ${wrksrc}/mpfr/
-	cp -ar ${XBPS_BUILDDIR}/mpc-${_mpc_version}/* ${wrksrc}/mpc/
-	cp -ar ${XBPS_BUILDDIR}/isl-${_isl_version}/* ${wrksrc}/isl/
+	mv ${wrksrc}/gmp-${_gmp_version} ${wrksrc}/${build_wrksrc}/gmp
+	mv ${wrksrc}/mpfr-${_mpfr_version} ${wrksrc}/${build_wrksrc}/mpfr
+	mv ${wrksrc}/mpc-${_mpc_version} ${wrksrc}/${build_wrksrc}/mpc
+	mv ${wrksrc}/isl-${_isl_version} ${wrksrc}/${build_wrksrc}/isl
 
 	if [ "$build_option_gnatboot" ]; then
 		local f="${XBPS_SRCDISTDIR}/${pkgname}-${version}/${_gnat_tarball}"
 		msg_normal "Extracting ${_gnat_tarball} ...\n"
-		mkdir -p ${wrksrc}/gnat-ins
-		tar -x -f "$f" --strip-components=1 -C ${wrksrc}/gnat-ins
-		cd ${wrksrc}/gnat-ins
-		make ins-all prefix=${wrksrc}/gnat
-		cd ${wrksrc}
-		rm -rf ${wrksrc}/gnat-ins
+		mkdir -p ${wrksrc}/${build_wrksrc}/gnat-ins
+		tar -x -f "$f" --strip-components=1 -C ${wrksrc}/${build_wrksrc}/gnat-ins
+		cd ${wrksrc}/${build_wrksrc}/gnat-ins
+		make ins-all prefix=${wrksrc}/${build_wrksrc}/gnat
+		cd ${wrksrc}/${build_wrksrc}
+		rm -rf ${wrksrc}/${build_wrksrc}/gnat-ins
 
 		# Rename obsolete ld and as
-		find ${wrksrc}/gnat -name ld -exec mv -v {} {}.old \;
-		find ${wrksrc}/gnat -name as -exec mv -v {} {}.old \;
+		find ${wrksrc}/${build_wrksrc}/gnat -name ld -exec mv -v {} {}.old \;
+		find ${wrksrc}/${build_wrksrc}/gnat -name as -exec mv -v {} {}.old \;
 	fi
 }
 
@@ -185,9 +182,9 @@ pre_configure() {
 	sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
 
 	if [ "$XBPS_TARGET_LIBC" = musl ]; then
-		patch -p1 -i ${FILESDIR}/libgnarl-musl.patch
-		patch -p1 -i ${FILESDIR}/libssp-musl.patch
-		patch -p1 -i ${FILESDIR}/gccgo-musl.patch
+		for p in ${FILESDIR}/*-musl.patch; do
+			patch -p1 -i $p
+		done
 	fi
 }
 do_configure() {
@@ -297,19 +294,19 @@ do_configure() {
 		_args+=" --enable-languages=${_langs},ada"
 		_args+=" --enable-libada"
 		CONFIG_SHELL=/bin/bash \
-		CC="${wrksrc}/gnat/bin/gcc" \
-		GNATBIND="${wrksrc}/gnat/bin/gnatbind" \
-		GNATMAKE="${wrksrc}/gnat/bin/gnatmake" \
-		PATH="${wrksrc}/gnat/bin:$PATH" \
-			${wrksrc}/configure ${_args}
+		CC="${wrksrc}/${build_wrksrc}/gnat/bin/gcc" \
+		GNATBIND="${wrksrc}/${build_wrksrc}/gnat/bin/gnatbind" \
+		GNATMAKE="${wrksrc}/${build_wrksrc}/gnat/bin/gnatmake" \
+		PATH="${wrksrc}/${build_wrksrc}/gnat/bin:$PATH" \
+			${wrksrc}/${build_wrksrc}/configure ${_args}
 	elif [ "$build_option_ada" ]; then
 		_args+=" --enable-languages=${_langs},ada"
 		CONFIG_SHELL=/bin/bash \
-			${wrksrc}/configure ${_args}
+			${wrksrc}/${build_wrksrc}/configure ${_args}
 	else
 		_args+=" --enable-languages=${_langs}"
 		CONFIG_SHELL=/bin/bash \
-			${wrksrc}/configure ${_args}
+			${wrksrc}/${build_wrksrc}/configure ${_args}
 	fi
 }
 do_build() {
@@ -318,10 +315,10 @@ do_build() {
 	fi
 	cd build
 	if [ "$build_option_gnatboot" ]; then
-		CC="${wrksrc}/gnat/bin/gcc" \
-		GNATBIND="${wrksrc}/gnat/bin/gnatbind" \
-		GNATMAKE="${wrksrc}/gnat/bin/gnatmake" \
-		PATH="${wrksrc}/gnat/bin:$PATH" \
+		CC="${wrksrc}/${build_wrksrc}/gnat/bin/gcc" \
+		GNATBIND="${wrksrc}/${build_wrksrc}/gnat/bin/gnatbind" \
+		GNATMAKE="${wrksrc}/${build_wrksrc}/gnat/bin/gnatmake" \
+		PATH="${wrksrc}/${build_wrksrc}/gnat/bin:$PATH" \
 		make ${makejobs}
 	else
 		make ${makejobs}
@@ -330,7 +327,7 @@ do_build() {
 pre_install() {
 	if [ "$CROSS_BUILD" ]; then
 		# XXX otherwise links to host libpthread
-		for f in $(find ${wrksrc}/build/${XBPS_CROSS_TRIPLET} -type f -name libtool); do
+		for f in $(find ${wrksrc}/${build_wrksrc}/build/${XBPS_CROSS_TRIPLET} -type f -name libtool); do
 			sed -e "s,add_dir=\"-L\$libdir\",add_dir=\"-L${XBPS_CROSS_BASE}\$libdir\",g" -i $f
 		done
 	fi
@@ -342,16 +339,16 @@ do_install() {
 
 	# Make version a symlink of major version to make all versions
 	# from the same series work automagically.
-	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver} \
+	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${version} \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver}
 	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver} \
-		${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}
+		${DESTDIR}/usr/lib/gcc/${_triplet}/${version}
 
 	# Ditto for c++ headers.
-	mv ${DESTDIR}/usr/include/c++/${_patchver} \
+	mv ${DESTDIR}/usr/include/c++/${version} \
 		${DESTDIR}/usr/include/c++/${_minorver}
 	ln -sfr ${DESTDIR}/usr/include/c++/${_minorver} \
-		${DESTDIR}/usr/include/c++/${_patchver}
+		${DESTDIR}/usr/include/c++/${version}
 
 	# cc symlink
 	ln -sfr ${DESTDIR}/usr/bin/gcc ${DESTDIR}/usr/bin/cc
@@ -360,7 +357,7 @@ do_install() {
 
 	# lto plugin symlink
 	vmkdir usr/lib/bfd-plugins
-	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}/liblto_plugin.so \
+	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${version}/liblto_plugin.so \
 		${DESTDIR}/usr/lib/bfd-plugins
 
 	# Remove "fixed" header
@@ -375,8 +372,8 @@ do_install() {
 	rm -f ${DESTDIR}/usr/lib/*.py
 
 	# Remove more python stuff.
-	if [ -d ${DESTDIR}/usr/share/gcc-${_patchver}/python ]; then
-		rm -rf ${DESTDIR}/usr/share/gcc-${_patchver}/python
+	if [ -d ${DESTDIR}/usr/share/gcc-${version}/python ]; then
+		rm -rf ${DESTDIR}/usr/share/gcc-${version}/python
 	fi
 
 	# Install c89 and c99 wrappers and its manpages, from NetBSD.
@@ -396,7 +393,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}
@@ -449,7 +446,7 @@ gcc-fortran_package() {
 		if [ "$CROSS_BUILD" ]; then
 			# A number of OMP modules are not built when cross
 			# compiling gcc. Copy them from the cross compiler.
-			local src="/usr/lib/gcc/${_triplet}/${_patchver}/finclude"
+			local src="/usr/lib/gcc/${_triplet}/${version}/finclude"
 			local dst="usr/lib/gcc/${_triplet}/${_minorver}/finclude"
 			for f in omp_lib.f90 omp_lib.h omp_lib.mod omp_lib_kinds.mod \
 				openacc.f90 openacc.mod openacc_kinds.mod openacc_lib.h; do
@@ -516,7 +513,7 @@ libgfortran_package() {
 	short_desc+=" - Fortran library"
 	pkg_install() {
 		vmove "usr/lib/libgfortran.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -537,7 +534,7 @@ libgo_package() {
 	nostrip=yes
 	pkg_install() {
 		vmove "usr/lib/libgo.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -553,7 +550,7 @@ libobjc_package() {
 	short_desc+=" - Objective-C library"
 	pkg_install() {
 		vmove "usr/lib/libobjc.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -572,7 +569,7 @@ libquadmath_package() {
 	short_desc+=" - quadmath library"
 	pkg_install() {
 		vmove "usr/lib/libquadmath.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -614,7 +611,7 @@ libgcc_package() {
 	noverifyrdeps=yes
 	pkg_install() {
 		vmove "usr/lib/libgcc_s.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -645,7 +642,7 @@ libgomp_package() {
 	short_desc+=" - OpenMP v4.0 library"
 	pkg_install() {
 		vmove "usr/lib/libgomp*.so.*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -700,7 +697,7 @@ libssp_package() {
 	short_desc+=" - SSP (StackSmashingProtection) library"
 	pkg_install() {
 		vmove "usr/lib/libssp.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -718,6 +715,6 @@ libstdc++_package() {
 	short_desc+=" - Standard C++ Library"
 	pkg_install() {
 		vmove "usr/lib/libstdc++.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }

From 31e5b59ee32d4ac037ce9a01d3954d2c60f306dc Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 04/37] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      | 11 ++++--
 2 files changed, 25 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..51611929d643 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,12 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
+
+if [ "$XBPS_LIBC" == "musl" ]; then
+	# Musl always searches LD_LIBRARY_PATH before RPATH and RUNPATH
+	make_build_args="lt_cv_shlibpath_overrides_runpath=yes"
+fi
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From e9782c6d60dd6ef95e626d9def9a0ffd07e89310 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 05/37] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 55255dceae8b..ca2d858a7abc 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From a22eb792fbcf5168e68613739d6fc216d9e25efc Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 06/37] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 3 files changed, 55 insertions(+), 353 deletions(-)
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index 881c8d459eaa..6fdbf8105d54 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From 91a02305b4796b0f2463bf2bfcdd7c1a2dac61e2 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Wed, 14 Sep 2022 03:48:32 -0700
Subject: [PATCH 07/37] musl: add support for SIGEV_THREAD_ID timers

https://git.musl-libc.org/cgit/musl/commit/?id=7c71792e87691451f2a6b76348e83ad1889f1dcb
---
 ...d-support-for-SIGEV_THREAD_ID-timers.patch | 74 +++++++++++++++++++
 srcpkgs/musl/template                         |  2 +-
 2 files changed, 75 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch

diff --git a/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
new file mode 100644
index 000000000000..e20dff5ba0d4
--- /dev/null
+++ b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
@@ -0,0 +1,74 @@
+From 7c71792e87691451f2a6b76348e83ad1889f1dcb Mon Sep 17 00:00:00 2001
+From: James Y Knight <jyknight@google.com>
+Date: Sun, 30 Jun 2019 21:55:20 -0400
+Subject: [PATCH] add support for SIGEV_THREAD_ID timers
+
+This is like SIGEV_SIGNAL, but targeted to a particular thread's
+tid, rather than the process.
+---
+ include/signal.h        | 16 +++++++++++++---
+ src/time/timer_create.c |  8 ++++++--
+ 2 files changed, 19 insertions(+), 5 deletions(-)
+
+diff --git a/include/signal.h b/include/signal.h
+index fbdf667b2..9ed929e4f 100644
+--- a/include/signal.h
++++ b/include/signal.h
+@@ -180,14 +180,24 @@ struct sigevent {
+ 	union sigval sigev_value;
+ 	int sigev_signo;
+ 	int sigev_notify;
+-	void (*sigev_notify_function)(union sigval);
+-	pthread_attr_t *sigev_notify_attributes;
+-	char __pad[56-3*sizeof(long)];
++	union {
++		char __pad[64 - 2*sizeof(int) - sizeof(union sigval)];
++		pid_t sigev_notify_thread_id;
++		struct {
++			void (*sigev_notify_function)(union sigval);
++			pthread_attr_t *sigev_notify_attributes;
++		} __sev_thread;
++	} __sev_fields;
+ };
+ 
++#define sigev_notify_thread_id __sev_fields.sigev_notify_thread_id
++#define sigev_notify_function __sev_fields.__sev_thread.sigev_notify_function
++#define sigev_notify_attributes __sev_fields.__sev_thread.sigev_notify_attributes
++
+ #define SIGEV_SIGNAL 0
+ #define SIGEV_NONE 1
+ #define SIGEV_THREAD 2
++#define SIGEV_THREAD_ID 4
+ 
+ int __libc_current_sigrtmin(void);
+ int __libc_current_sigrtmax(void);
+diff --git a/src/time/timer_create.c b/src/time/timer_create.c
+index 5ddfda278..4bef23905 100644
+--- a/src/time/timer_create.c
++++ b/src/time/timer_create.c
+@@ -71,11 +71,15 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 	switch (evp ? evp->sigev_notify : SIGEV_SIGNAL) {
+ 	case SIGEV_NONE:
+ 	case SIGEV_SIGNAL:
++	case SIGEV_THREAD_ID:
+ 		if (evp) {
+ 			ksev.sigev_value = evp->sigev_value;
+ 			ksev.sigev_signo = evp->sigev_signo;
+ 			ksev.sigev_notify = evp->sigev_notify;
+-			ksev.sigev_tid = 0;
++			if (evp->sigev_notify == SIGEV_THREAD_ID)
++				ksev.sigev_tid = evp->sigev_notify_thread_id;
++			else
++				ksev.sigev_tid = 0;
+ 			ksevp = &ksev;
+ 		}
+ 		if (syscall(SYS_timer_create, clk, ksevp, &timerid) < 0)
+@@ -107,7 +111,7 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 
+ 		ksev.sigev_value.sival_ptr = 0;
+ 		ksev.sigev_signo = SIGTIMER;
+-		ksev.sigev_notify = 4; /* SIGEV_THREAD_ID */
++		ksev.sigev_notify = SIGEV_THREAD_ID;
+ 		ksev.sigev_tid = td->tid;
+ 		if (syscall(SYS_timer_create, clk, &ksev, &timerid) < 0)
+ 			timerid = -1;
diff --git a/srcpkgs/musl/template b/srcpkgs/musl/template
index 5bdc5c48e623..34e6ed4fba6e 100644
--- a/srcpkgs/musl/template
+++ b/srcpkgs/musl/template
@@ -2,7 +2,7 @@
 pkgname=musl
 reverts="1.2.0_1"
 version=1.1.24
-revision=10
+revision=11
 archs="*-musl"
 bootstrap=yes
 build_style=gnu-configure

From f7dad10bfe21d3f39330aa2969f7d0aa85b89336 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 21:01:43 -0700
Subject: [PATCH 08/37] gcc-multilib: update to 12.2.0.

---
 srcpkgs/gcc-multilib/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index fcd25755aa75..df60849babc2 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,16 +3,16 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _majorver="${version%.*}"
-wrksrc=gcc-${version/pre/_pre}
+wrksrc="gcc-${version}"
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel
@@ -71,7 +71,7 @@ do_build() {
 	make ${makejobs}
 }
 do_install() {
-	local _pc_triplet=x86_64-pc-linux-gnu _version=${version%pre1}
+	local _pc_triplet=x86_64-pc-linux-gnu
 	# Install to a tempdir and then only copy relevant files.
 	cd ${wrksrc}
 	make DESTDIR=${wrksrc}/${pkgname}-build install
@@ -81,9 +81,9 @@ do_install() {
 	vmkdir usr/include/c++/${_majorver}/${_triplet}
 	vmkdir usr/lib/gcc/${_triplet}/${_majorver}
 
-	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${_version}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${version}/32 \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_majorver}/
-	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${_version}/${_pc_triplet}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${version}/${_pc_triplet}/32 \
 		${DESTDIR}/usr/include/c++/${_majorver}/${_triplet}
 
 	vinstall ${wrksrc}/host-${_pc_triplet}/gcc/specs 644 usr/lib/gcc/${_triplet}/${_majorver}

From 4a7afbdf99f440a3519416174bb32b895e3edfed Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Tue, 4 Oct 2022 03:49:13 -0700
Subject: [PATCH 09/37] libgccjit: update to 12.2.0.

---
 srcpkgs/libgccjit/files/libgccjit-musl.patch | 63 --------------------
 srcpkgs/libgccjit/template                   | 38 ++++++------
 2 files changed, 17 insertions(+), 84 deletions(-)
 delete mode 100644 srcpkgs/libgccjit/files/libgccjit-musl.patch

diff --git a/srcpkgs/libgccjit/files/libgccjit-musl.patch b/srcpkgs/libgccjit/files/libgccjit-musl.patch
deleted file mode 100644
index d2ed16928c82..000000000000
--- a/srcpkgs/libgccjit/files/libgccjit-musl.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-diff --git a/gcc/jit/jit-playback.c b/gcc/jit/jit-playback.c
-index 5bccf591a..35f5e35ef 100644
---- a/gcc/jit/jit-playback.c
-+++ b/gcc/jit/jit-playback.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -41,8 +43,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "diagnostic.h"
- #include "stmt.h"
- 
--#include <pthread.h>
--
- #include "jit-playback.h"
- #include "jit-result.h"
- #include "jit-builtins.h"
-diff --git a/gcc/jit/jit-recording.c b/gcc/jit/jit-recording.c
-index a237d574f..5785e3269 100644
---- a/gcc/jit/jit-recording.c
-+++ b/gcc/jit/jit-recording.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -25,8 +27,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "pretty-print.h"
- #include "toplev.h"
- 
--#include <pthread.h>
--
- #include "jit-builtins.h"
- #include "jit-recording.h"
- #include "jit-playback.h"
-diff --git a/gcc/jit/libgccjit.c b/gcc/jit/libgccjit.c
-index f9c33c63c..75f21d275 100644
---- a/gcc/jit/libgccjit.c
-+++ b/gcc/jit/libgccjit.c
-@@ -18,13 +18,13 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
- #include "timevar.h"
- #include "typed-splay-tree.h"
- #include "cppbuiltin.h"
--#include <pthread.h>
- 
- #include "libgccjit.h"
- #include "jit-recording.h"
diff --git a/srcpkgs/libgccjit/template b/srcpkgs/libgccjit/template
index 6f1d6256dcd6..2f2802eaba8b 100644
--- a/srcpkgs/libgccjit/template
+++ b/srcpkgs/libgccjit/template
@@ -3,36 +3,32 @@
 # which use the version number.
 
 pkgname=libgccjit
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
+version=12.2.0
 revision=1
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
-_majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
-wrksrc=gcc-${version/pre/_pre}
+_mpc_version=1.2.1
+_isl_version=0.24
 short_desc="Just-In-Time Compilation library for GCC"
 maintainer="Lane Biocini <lane@mailbox.org>"
 homepage="https://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 nopie=yes
+create_wrksrc=yes
+build_wrksrc="gcc-${version}"
+patch_args="-Np1 --directory=${build_wrksrc}"
 lib32disabled=yes
 makedepends="zlib-devel"
 hostmakedepends="tar texinfo perl flex"
@@ -40,10 +36,10 @@ depends="gcc"
 checkdepends="dejagnu"
 
 post_extract() {
-	mv ${XBPS_BUILDDIR}/gmp-${_gmp_version} ${wrksrc}/gmp
-	mv ${XBPS_BUILDDIR}/mpfr-${_mpfr_version} ${wrksrc}/mpfr
-	mv ${XBPS_BUILDDIR}/mpc-${_mpc_version} ${wrksrc}/mpc
-	mv ${XBPS_BUILDDIR}/isl-${_isl_version} ${wrksrc}/isl
+	mv ${wrksrc}/gmp-${_gmp_version} ${wrksrc}/${build_wrksrc}/gmp
+	mv ${wrksrc}/mpfr-${_mpfr_version} ${wrksrc}/${build_wrksrc}/mpfr
+	mv ${wrksrc}/mpc-${_mpc_version} ${wrksrc}/${build_wrksrc}/mpc
+	mv ${wrksrc}/isl-${_isl_version} ${wrksrc}/${build_wrksrc}/isl
 }
 
 pre_configure() {
@@ -186,7 +182,7 @@ do_configure() {
 	[ -z "$XBPS_CHECK_PKGS" ] && _langs="jit" || _langs="jit,c++"
 	_args+=" --enable-languages=${_langs}"
 	CONFIG_SHELL=/bin/bash \
-		${wrksrc}/configure ${_args}
+		${wrksrc}/${build_wrksrc}/configure ${_args}
 }
 
 do_build() {

From 49824fa36e3e4e706b758be8b5ae8b5d696bade1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 14 Aug 2022 19:29:36 -0700
Subject: [PATCH 10/37] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove -no-pie from build. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..5d40f0cdd8a6 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -53,6 +53,7 @@ _void_cross_build_binutils() {
 		--sbindir=/usr/bin \
 		--libdir=/usr/lib \
 		--libexecdir=/usr/lib \
+		--sysconfdir=/etc \
 		--target=${tgt} \
 		--with-sysroot=/usr/${tgt} \
 		--disable-nls \
@@ -60,7 +61,9 @@ _void_cross_build_binutils() {
 		--disable-multilib \
 		--disable-werror \
 		--disable-gold \
+		--disable-gprofng \
 		--enable-relro \
+		--enable-new-dtags \
 		--enable-plugins \
 		--enable-64-bit-bfd \
 		--enable-deterministic-archives \
@@ -132,6 +135,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -460,6 +464,14 @@ do_build() {
 	local binutils_ver linux_ver gcc_ver libc_ver libucontext_ver
 	local tgt=${sourcepkg/cross-}
 
+	export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}"
+	export CXXFLAGS="${CXXFLAGS/-D_FORTIFY_SOURCE=2/}"
+
+	# Disable explicit -fno-PIE, gcc/binutils/libc will figure this out itself.
+	export CFLAGS="${CFLAGS//-fno-PIE/}"
+	export CXXFLAGS="${CXXFLAGS//-fno-PIE/}"
+	export LDFLAGS="${LDFLAGS//-no-pie/}"
+
 	_void_cross_test_ver binutils
 	_void_cross_test_ver linux
 	_void_cross_test_ver gcc
@@ -625,6 +637,9 @@ do_install() {
 	# then remove it because it conflicts with libquadmath package
 	rm -rf ${DESTDIR}/${sysroot}/usr/lib/libquadmath.*
 
+	# Remove libdep linker plugin because it conflicts with system binutils
+	rm -f ${DESTDIR}/usr/lib/bfd-plugins/libdep*
+
 	# Remove leftover symlinks
 	rm -f ${DESTDIR}/usr/lib${XBPS_TARGET_WORDSIZE}
 	rm -f ${DESTDIR}/lib*

From 104e08a8b19706d72c974d1ab84173617714e965 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:09:31 -0700
Subject: [PATCH 11/37] linux5.18: update dotconfigs for gcc12

---
 srcpkgs/linux5.18/files/x86_64-dotconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/linux5.18/files/x86_64-dotconfig b/srcpkgs/linux5.18/files/x86_64-dotconfig
index 4e73a3195d40..ea6204868e23 100644
--- a/srcpkgs/linux5.18/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.18/files/x86_64-dotconfig
@@ -512,6 +512,7 @@ CONFIG_RETHUNK=y
 CONFIG_CPU_UNRET_ENTRY=y
 CONFIG_CPU_IBPB_ENTRY=y
 CONFIG_CPU_IBRS_ENTRY=y
+CONFIG_SLS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10060,8 +10061,11 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
 # Memory initialization
 #
 CONFIG_INIT_STACK_NONE=y
+# CONFIG_INIT_STACK_ALL_PATTERN is not set
+# CONFIG_INIT_STACK_ALL_ZERO is not set
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
+# CONFIG_ZERO_CALL_USED_REGS is not set
 # end of Memory initialization
 # end of Kernel hardening options
 # end of Security options
@@ -10538,6 +10542,7 @@ CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
 # CONFIG_UBSAN is not set
 CONFIG_HAVE_ARCH_KCSAN=y
+# CONFIG_KCSAN is not set
 # end of Generic Kernel Debugging Instruments
 
 #

From 8156fba8690f2e4be958be942f7d0464f636077c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:08 -0700
Subject: [PATCH 12/37] subversion: fix build for libtool 2.4.7

---
 srcpkgs/subversion/template | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/subversion/template b/srcpkgs/subversion/template
index 18c35e3a2132..0aa41212c5fd 100644
--- a/srcpkgs/subversion/template
+++ b/srcpkgs/subversion/template
@@ -24,6 +24,8 @@ distfiles="http://apache.uvigo.es/subversion/subversion-${version}.tar.bz2"
 checksum=c9130e8d0b75728a66f0e7038fc77052e671830d785b5616aad53b4810d3cc28
 
 pre_configure() {
+	./autogen.sh --release
+
 	# Based on native build values
 	cat <<-EOF >config.cache
 	ac_cv_python_includes=-I${XBPS_CROSS_BASE}/usr/include/python${py3_ver}
@@ -59,7 +61,12 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+
+	if [ "$XBPS_BUILD_ENVIRONMENT" = "void-packages-ci" ]; then
+		# This test will fail when run as the root user,
+		# because flock() will ignore file permissions.
+		vsed -i subversion/tests/libsvn_fs/locks-test.c -e '/SVN_TEST_OPTS_PASS(obtain_write_lock_failure,/,+3d'
+	fi
 }
 
 post_configure() {

From 8d60e793912093ab31504b9fa5f924cade9ea4a7 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:38 -0700
Subject: [PATCH 13/37] subversion-kwallet-auth: update to 1.14.2.

Fix failing distfiles.
Fix build for libtool 2.4.7
---
 srcpkgs/subversion-kwallet-auth/template | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/subversion-kwallet-auth/template b/srcpkgs/subversion-kwallet-auth/template
index 12210f250d51..9cc68c3fe5f1 100644
--- a/srcpkgs/subversion-kwallet-auth/template
+++ b/srcpkgs/subversion-kwallet-auth/template
@@ -3,7 +3,7 @@
 # THIS PKG MUST BE SYNCHRONIZED WITH "srcpkgs/subversion".
 #
 pkgname=subversion-kwallet-auth
-version=1.14.1
+version=1.14.2
 revision=1
 wrksrc="subversion-${version}"
 build_style=gnu-configure
@@ -22,10 +22,12 @@ license="Apache-2.0, BSD-3-Clause"
 homepage="http://subversion.apache.org/"
 changelog="https://subversion.apache.org/docs/release-notes/${version%.*}.html"
 distfiles="http://apache.uvigo.es/subversion/subversion-${version}.tar.bz2"
-checksum=2c5da93c255d2e5569fa91d92457fdb65396b0666fad4fd59b22e154d986e1a9
+checksum=c9130e8d0b75728a66f0e7038fc77052e671830d785b5616aad53b4810d3cc28
 lib32disabled=yes
 
 pre_configure() {
+	./autogen.sh --release
+
 	# Based on native build values
 	cat <<-EOF >config.cache
 	ac_cv_python_includes=-I${XBPS_CROSS_BASE}/usr/include/python${py3_ver}
@@ -55,11 +57,18 @@ pre_configure() {
 		cp "$XBPS_CROSS_BASE/usr/lib/perl5/core_perl/Config"*.p? $PERL5LIB
 		cp "$XBPS_CROSS_BASE/usr/lib/perl5/core_perl/Errno.pm" $PERL5LIB
 		vsed -e "s;archlibexp => '\(.*\)';archlibexp => '${XBPS_CROSS_BASE}\1';" \
-			-i $PERL5LIB/Config.pm $PERL5LIB/Config_heavy.pl
+			-i $PERL5LIB/Config.pm
+		vsed -e "s;archlibexp='\(.*\)';archlibexp='${XBPS_CROSS_BASE}\1';" \
+			-i $PERL5LIB/Config_heavy.pl
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+
+	if [ "$XBPS_BUILD_ENVIRONMENT" = "void-packages-ci" ]; then
+		# This test will fail when run as the root user,
+		# because flock() will ignore file permissions.
+		vsed -i subversion/tests/libsvn_fs/locks-test.c -e '/SVN_TEST_OPTS_PASS(obtain_write_lock_failure,/,+3d'
+	fi
 }
 
 post_configure() {

From 49bc6b679103898b84ac950483d8e7b789ceba56 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 14/37] cross-aarch64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..bd6b23f9fb6a 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From f43dfdcd11027a0274f907b334f679f6174a4d2b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 15/37] cross-aarch64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..427ad2c1e9cd 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 88b5245aac21e17bd4038b131d3824a74844ed06 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 16/37] cross-arm-linux-gnueabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..2510ee26e789 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 85180d578ef1eef62ed347ac090f631ae1c1a39e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 17/37] cross-arm-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..bd8b16e1b4c1 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 427ecff20c420e2a97e204d4afee034b51f0713c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 18/37] cross-arm-linux-musleabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..dacfd2655216 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 1374a4a58281a5fc812db1e88b09cbdf0d62538a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 19/37] cross-arm-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..9ddd32a9f20d 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 90de9c62910ff6b9847666d192ed8cdbffa8e567 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 20/37] cross-armv7l-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..9fb00f18be3b 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From c52c3a32b929c91409afdf657815cccc6e2f667a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 21/37] cross-armv7l-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..2c72e75ddfe3 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From d433196002ab41f4a9f00fb1e9519419c5386986 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 22/37] cross-i686-pc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..4dc17df648b5 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From ccb66e417401402cf6ae8d8054e2553fb8a1a382 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Fri, 16 Sep 2022 20:52:19 -0700
Subject: [PATCH 23/37] cross-i686-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-linux-musl/template b/srcpkgs/cross-i686-linux-musl/template
index 8be16a230d8d..78b4d813a113 100644
--- a/srcpkgs/cross-i686-linux-musl/template
+++ b/srcpkgs/cross-i686-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-i686-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-i686-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 967dd77309e1785346583ff48facbd4524817031 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 24/37] cross-mips-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..6009e5c79eb2 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 374f4dc1b353b6de6840e01dcdc5fbd06dfd7f04 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 25/37] cross-mips-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..080164df193d 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="hipperson0 <hipperson0@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 8919e520328fbcc4317b6daaf33d634f778fd35a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 26/37] cross-mipsel-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..f9fd4b8a04ef 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 07222aaac4849bd49b30fc9b65b191b8621501cd Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 27/37] cross-mipsel-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..7418a984474b 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 0cc82d0cbaab075f0214a268136887322efdc2f9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 28/37] cross-powerpc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..31e57b4e52b2 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 9c6370a74425c101bcac8c418ea22740d05d4a80 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 29/37] cross-powerpc-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..a2d1edcf1ffd 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 5720ddbd9862b42074f106e17203f38ee276385f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 30/37] cross-powerpc64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..1a4cbed61e76 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 52abef73303d7747dbd0d15a332ff8d8d5d0e224 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 31/37] cross-powerpc64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 016f18776a6d..19b1ff859eb6 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 92c08f5794d9b40058812805b4be8f210a094cb9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 32/37] cross-powerpc64le-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 463d7e92d20d..9d99a3a315d2 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 2472f7e6a83a729081e3a238ff32f543d10268ab Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 33/37] cross-powerpc64le-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index c17a3cccfe29..3128baa7372e 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 2dac7bbd6397990e36ff7bea97b6a4b6953e2116 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 34/37] cross-powerpcle-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 9aede3c465ce..6f914b3877ee 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 020d86970e8ba53f39b6a883a1558edcbd0278d6 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 35/37] cross-powerpcle-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index 045cfda987fe..20e70bed4c60 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 70d445fea150a00b04dd9830851d494f04b2e0e1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 36/37] cross-x86_64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 8918f3c22a1c..5219cd50f851 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 1882c027b35a795f9aae6d8425676c73130f26ac Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 37/37] cross-x86_64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..2811de0d3c2e 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (177 preceding siblings ...)
  2022-10-10  4:15 ` [PR PATCH] [Updated] " oreo639
@ 2022-10-10  5:05 ` oreo639
  2022-10-10  5:10 ` oreo639
                   ` (85 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-10-10  5:05 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5478 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.2.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.2.0

There is a list of failing builds here: https://github.com/void-linux/void-packages/issues/39809

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [x] llvm https://github.com/void-linux/void-packages/pull/38694
- [x] m4 https://github.com/void-linux/void-packages/pull/33730
- [x] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [x] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [x] libvirt https://github.com/void-linux/void-packages/pull/38842
- [x] syslinux https://github.com/void-linux/void-packages/pull/38876
- [x] efivar https://github.com/void-linux/void-packages/pull/38874
- [ ] gpgme https://github.com/void-linux/void-packages/pull/38825

Known packages that needed to be fixed/updated for gcc12:
- [ ] linux5.18 (in this PR)
- [x] openssh https://github.com/void-linux/void-packages/pull/38849
- [x] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [x] doxygen https://github.com/void-linux/void-packages/pull/38846
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] libproxy https://github.com/void-linux/void-packages/pull/38818
- [x] exempi https://github.com/void-linux/void-packages/pull/38820
- [x] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [x] libunique1 https://github.com/void-linux/void-packages/pull/38848 or https://github.com/void-linux/void-packages/pull/38873
- [x] libwpd https://github.com/void-linux/void-packages/pull/38878
- [x] cglm https://github.com/void-linux/void-packages/pull/39748
- [x] coreboot-utils https://github.com/void-linux/void-packages/pull/39749
- [x] apl https://github.com/void-linux/void-packages/pull/39750
- [x] igt-gpu-tools https://github.com/void-linux/void-packages/pull/39780

Needs to be fixed/updated for binutils:
- [x] grub https://github.com/void-linux/void-packages/pull/38875
- [x] linux-tools https://github.com/void-linux/void-packages/pull/38877
- [x] kcov https://github.com/void-linux/void-packages/pull/39291

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [x] kde
- [x] lxde
- [x] lxqt

You can test the ISOs here:
https://drive.google.com/drive/folders/1ix92CYSLUP-KWjLxltdgG4e8Nu2JCY5n?usp=sharing

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 130430 bytes --]

From b7ec4edfe2a526c2474b734d3403db5f6d84cd20 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 01/37] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../fix-libcollector-without-java.patch       | 53 +++++++++++++++
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 25 ++++---
 4 files changed, 87 insertions(+), 117 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
 create mode 100644 srcpkgs/binutils/patches/fix-libcollector-without-java.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/fix-libcollector-without-java.patch b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
new file mode 100644
index 000000000000..54384875f358
--- /dev/null
+++ b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
@@ -0,0 +1,53 @@
+From 49ddd814ac1071af7c4f45d5f8398b91862f2c7f Mon Sep 17 00:00:00 2001
+From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
+Date: Wed, 17 Aug 2022 19:55:23 -0700
+Subject: [PATCH] gprofng: fix bug 29479 Collection fails when built without
+ java support
+
+gprofng/ChangeLog
+2022-08-17  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>
+
+	PR gprofng/29479
+	* libcollector/collector.c: Add #if defined(GPROFNG_JAVA_PROFILING) for
+	java specific code.
+	* libcollector/unwind.c: Likewise.
+---
+ gprofng/libcollector/collector.c | 2 ++
+ gprofng/libcollector/unwind.c    | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/gprofng/libcollector/collector.c b/gprofng/libcollector/collector.c
+index 93c9d3330de5..ceff2c1caccb 100644
+--- a/gprofng/libcollector/collector.c
++++ b/gprofng/libcollector/collector.c
+@@ -913,8 +913,10 @@ __collector_open_experiment (const char *exp, const char *params, sp_origin_t or
+   __collector_ext_unwind_key_init (1, NULL);
+ 
+   /* start java attach if suitable */
++#if defined(GPROFNG_JAVA_PROFILING)
+   if (exp_origin == SP_ORIGIN_DBX_ATTACH)
+     __collector_jprofile_start_attach ();
++#endif
+   start_sec_time = CALL_UTIL (time)(NULL);
+   __collector_start_time = collector_interface.getHiResTime ();
+   TprintfT (DBG_LT0, "\t__collector_open_experiment; resetting start_time\n");
+diff --git a/gprofng/libcollector/unwind.c b/gprofng/libcollector/unwind.c
+index 119243788020..f8e11823c81e 100644
+--- a/gprofng/libcollector/unwind.c
++++ b/gprofng/libcollector/unwind.c
+@@ -557,6 +557,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+   int size = max_frame_size;
+ 
+ #define MIN(a,b) ((a)<(b)?(a):(b))
++#if defined(GPROFNG_JAVA_PROFILING)
+   /* get Java info */
+   if (__collector_java_mode && __collector_java_asyncgetcalltrace_loaded && context && !pseudo_context)
+     {
+@@ -569,6 +570,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+ 	  size -= sz;
+ 	}
+     }
++#endif
+ 
+   /* get native stack */
+   if (context)
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..c355a5fc8016 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkgconf"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -35,15 +36,21 @@ do_configure() {
 	local conf
 
 	if [ "$CHROOT_READY" ]; then
-		conf+=" --with-debuginfod"
+		conf+=" --with-debuginfod --enable-shared"
 	else
-		conf+=" --without-debuginfod --disable-install-libbfd"
+		conf+=" --without-debuginfod --disable-shared --disable-install-libbfd"
 	fi
 	if [ "$CROSS_BUILD" ]; then
 		# we don't want --with-sysroot=${XBPS_CROSS_BASE} like gnu-configure
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	# gprofng currently only supports x86 and aarch64 glibc.
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64|i386|aarch64) conf+=" --enable-gprofng" ;;
+		*) conf+=" --disable-gprofng" ;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"
@@ -76,13 +83,14 @@ do_configure() {
 		--libdir=/usr/lib \
 		--mandir=/usr/share/man \
 		--infodir=/usr/share/info \
+		--sysconfdir=/etc \
 		--disable-werror \
-		--disable-shared \
 		--disable-nls \
 		--enable-threads \
 		--enable-plugins \
 		--enable-relro \
 		--enable-gold \
+		--enable-new-dtags \
 		--enable-deterministic-archives \
 		--enable-64-bit-bfd \
 		--enable-ld=default \
@@ -142,7 +150,8 @@ binutils-devel_package() {
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/*.a"
-		vmove "usr/lib/*.so"
+		vmove "usr/lib/libbfd.so"
+		vmove "usr/lib/libopcodes.so"
 	}
 }
 

From 4d8d5b492e6a618174e9dc03ec065f104b157692 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 2 Oct 2022 16:46:59 -0700
Subject: [PATCH 02/37] gdb: resolve conflict with binutils 2.39

---
 srcpkgs/gdb/template | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/gdb/template b/srcpkgs/gdb/template
index ff7c9d9a5911..5970402eb27e 100644
--- a/srcpkgs/gdb/template
+++ b/srcpkgs/gdb/template
@@ -1,7 +1,7 @@
 # Template file for 'gdb'
 pkgname=gdb
 version=12.1
-revision=1
+revision=2
 build_style=gnu-configure
 pycompile_dirs="/usr/share/gdb/python"
 configure_args="--disable-werror --disable-nls --with-system-readline
@@ -48,7 +48,8 @@ vopt_conflict debuginfod static
 
 post_install() {
 	# resolve conflicts with binutils
-	rm -r ${DESTDIR}/usr/{include,lib,share/info/bfd.info*}
+	rm -rf ${DESTDIR}/usr/{include,lib}
+	rm -rf ${DESTDIR}/usr/share/info/{bfd,ctf-spec}.info*
 }
 
 gdb-common_package() {

From b32fa08643351133406b743c472b597c216e747d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 03/37] gcc: update to 12.2.0.

---
 common/shlibs                                 |  10 +-
 srcpkgs/gcc/files/gccgo-musl.patch            |  71 ++--------
 srcpkgs/gcc/files/libgnarl-musl.patch         |  18 +--
 srcpkgs/gcc/files/libssp-musl.patch           |  10 +-
 srcpkgs/gcc/patches/libffi_gnulinux.patch     |  11 --
 .../gcc/patches/libgcc-ibm128-no-tag.patch    |  10 +-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |   2 +-
 srcpkgs/gcc/template                          | 125 +++++++++---------
 8 files changed, 99 insertions(+), 158 deletions(-)
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index 9f95ac87a7ea..881c8d459eaa 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.2.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.36 perl-5.36.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -847,8 +847,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.2.0_1
+libgnat-12.so libada-12.2.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1697,8 +1697,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.2.0_1
+libasan.so.8 libsanitizer-12.2.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..12ec68dd8aa3 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,14 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ b/libgo/go/runtime/os_linux.go
+@@ -365,7 +365,7 @@ func setThreadCPUProfiler(hz int32) {
+ 	var sevp _sigevent
+ 	sevp.sigev_notify = _SIGEV_THREAD_ID
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.__sev_fields))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..3482329838a2 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,37 +3,35 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
+version=12.2.0
+revision=1
+_minorver="${version%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
-wrksrc=gcc-${version/pre/_pre}
+_mpc_version=1.2.1
+_isl_version=0.24
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
+create_wrksrc=yes
+build_wrksrc="gcc-${version}"
+patch_args="-Np1 --directory=${build_wrksrc}"
 lib32disabled=yes
 bootstrap=yes
 replaces="gcc-gcj<7.2.0 gcc-gcj-jdk-compat<7.2.0 libmpx>=0 libmpx-devel>=0"
@@ -53,7 +51,7 @@ if [ "$CHROOT_READY" ]; then
 else
 	_have_gccgo=no
 fi
-makedepends="zlib-devel"
+makedepends="zlib-devel libzstd-devel"
 depends="binutils libgcc-devel-${version}_${revision}
  libstdc++-devel-${version}_${revision} libssp-devel-${version}_${revision}"
 checkdepends="dejagnu"
@@ -70,13 +68,13 @@ if [ "$build_option_gnatboot" ]; then
 	case "$XBPS_TARGET_MACHINE" in
 	x86_64)
 		_gnat_tarball="gnat-gpl-2017-x86_64-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/591c6d80c7a447af2deed1d7>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/9682e2e1f2f232ce03fe21d77b14c37a0de5649b?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" b942bcac20dea39748b39f8b624d9619f60a8dee2e8195dbe3829c835b0956e6"
 		build_options_default="gnatboot"
 		;;
 	i686)
 		_gnat_tarball="gnat-gpl-2014-x86-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/564b3e9dc8e196b040fbe248>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/c5e9e6fdff5cb77ed90cf8c62536653e27c0bed6?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" 3b693510f5d22a240abb3034934c1adbd80ccd6e4f61a4f491cc408fdfd9c042"
 		build_options_default="gnatboot"
 		;;
@@ -155,25 +153,24 @@ if [ "$CROSS_BUILD" ]; then
 fi
 
 post_extract() {
-	mkdir -p ${wrksrc}/{gmp,mpfr,mpc,isl}
-	cp -ar ${XBPS_BUILDDIR}/gmp-${_gmp_version}/* ${wrksrc}/gmp/
-	cp -ar ${XBPS_BUILDDIR}/mpfr-${_mpfr_version}/* ${wrksrc}/mpfr/
-	cp -ar ${XBPS_BUILDDIR}/mpc-${_mpc_version}/* ${wrksrc}/mpc/
-	cp -ar ${XBPS_BUILDDIR}/isl-${_isl_version}/* ${wrksrc}/isl/
+	mv ${wrksrc}/gmp-${_gmp_version} ${wrksrc}/${build_wrksrc}/gmp
+	mv ${wrksrc}/mpfr-${_mpfr_version} ${wrksrc}/${build_wrksrc}/mpfr
+	mv ${wrksrc}/mpc-${_mpc_version} ${wrksrc}/${build_wrksrc}/mpc
+	mv ${wrksrc}/isl-${_isl_version} ${wrksrc}/${build_wrksrc}/isl
 
 	if [ "$build_option_gnatboot" ]; then
 		local f="${XBPS_SRCDISTDIR}/${pkgname}-${version}/${_gnat_tarball}"
 		msg_normal "Extracting ${_gnat_tarball} ...\n"
-		mkdir -p ${wrksrc}/gnat-ins
-		tar -x -f "$f" --strip-components=1 -C ${wrksrc}/gnat-ins
-		cd ${wrksrc}/gnat-ins
-		make ins-all prefix=${wrksrc}/gnat
-		cd ${wrksrc}
-		rm -rf ${wrksrc}/gnat-ins
+		mkdir -p ${wrksrc}/${build_wrksrc}/gnat-ins
+		tar -x -f "$f" --strip-components=1 -C ${wrksrc}/${build_wrksrc}/gnat-ins
+		cd ${wrksrc}/${build_wrksrc}/gnat-ins
+		make ins-all prefix=${wrksrc}/${build_wrksrc}/gnat
+		cd ${wrksrc}/${build_wrksrc}
+		rm -rf ${wrksrc}/${build_wrksrc}/gnat-ins
 
 		# Rename obsolete ld and as
-		find ${wrksrc}/gnat -name ld -exec mv -v {} {}.old \;
-		find ${wrksrc}/gnat -name as -exec mv -v {} {}.old \;
+		find ${wrksrc}/${build_wrksrc}/gnat -name ld -exec mv -v {} {}.old \;
+		find ${wrksrc}/${build_wrksrc}/gnat -name as -exec mv -v {} {}.old \;
 	fi
 }
 
@@ -185,9 +182,9 @@ pre_configure() {
 	sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
 
 	if [ "$XBPS_TARGET_LIBC" = musl ]; then
-		patch -p1 -i ${FILESDIR}/libgnarl-musl.patch
-		patch -p1 -i ${FILESDIR}/libssp-musl.patch
-		patch -p1 -i ${FILESDIR}/gccgo-musl.patch
+		for p in ${FILESDIR}/*-musl.patch; do
+			patch -p1 -i $p
+		done
 	fi
 }
 do_configure() {
@@ -297,19 +294,19 @@ do_configure() {
 		_args+=" --enable-languages=${_langs},ada"
 		_args+=" --enable-libada"
 		CONFIG_SHELL=/bin/bash \
-		CC="${wrksrc}/gnat/bin/gcc" \
-		GNATBIND="${wrksrc}/gnat/bin/gnatbind" \
-		GNATMAKE="${wrksrc}/gnat/bin/gnatmake" \
-		PATH="${wrksrc}/gnat/bin:$PATH" \
-			${wrksrc}/configure ${_args}
+		CC="${wrksrc}/${build_wrksrc}/gnat/bin/gcc" \
+		GNATBIND="${wrksrc}/${build_wrksrc}/gnat/bin/gnatbind" \
+		GNATMAKE="${wrksrc}/${build_wrksrc}/gnat/bin/gnatmake" \
+		PATH="${wrksrc}/${build_wrksrc}/gnat/bin:$PATH" \
+			${wrksrc}/${build_wrksrc}/configure ${_args}
 	elif [ "$build_option_ada" ]; then
 		_args+=" --enable-languages=${_langs},ada"
 		CONFIG_SHELL=/bin/bash \
-			${wrksrc}/configure ${_args}
+			${wrksrc}/${build_wrksrc}/configure ${_args}
 	else
 		_args+=" --enable-languages=${_langs}"
 		CONFIG_SHELL=/bin/bash \
-			${wrksrc}/configure ${_args}
+			${wrksrc}/${build_wrksrc}/configure ${_args}
 	fi
 }
 do_build() {
@@ -318,10 +315,10 @@ do_build() {
 	fi
 	cd build
 	if [ "$build_option_gnatboot" ]; then
-		CC="${wrksrc}/gnat/bin/gcc" \
-		GNATBIND="${wrksrc}/gnat/bin/gnatbind" \
-		GNATMAKE="${wrksrc}/gnat/bin/gnatmake" \
-		PATH="${wrksrc}/gnat/bin:$PATH" \
+		CC="${wrksrc}/${build_wrksrc}/gnat/bin/gcc" \
+		GNATBIND="${wrksrc}/${build_wrksrc}/gnat/bin/gnatbind" \
+		GNATMAKE="${wrksrc}/${build_wrksrc}/gnat/bin/gnatmake" \
+		PATH="${wrksrc}/${build_wrksrc}/gnat/bin:$PATH" \
 		make ${makejobs}
 	else
 		make ${makejobs}
@@ -330,7 +327,7 @@ do_build() {
 pre_install() {
 	if [ "$CROSS_BUILD" ]; then
 		# XXX otherwise links to host libpthread
-		for f in $(find ${wrksrc}/build/${XBPS_CROSS_TRIPLET} -type f -name libtool); do
+		for f in $(find ${wrksrc}/${build_wrksrc}/build/${XBPS_CROSS_TRIPLET} -type f -name libtool); do
 			sed -e "s,add_dir=\"-L\$libdir\",add_dir=\"-L${XBPS_CROSS_BASE}\$libdir\",g" -i $f
 		done
 	fi
@@ -342,16 +339,16 @@ do_install() {
 
 	# Make version a symlink of major version to make all versions
 	# from the same series work automagically.
-	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver} \
+	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${version} \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver}
 	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver} \
-		${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}
+		${DESTDIR}/usr/lib/gcc/${_triplet}/${version}
 
 	# Ditto for c++ headers.
-	mv ${DESTDIR}/usr/include/c++/${_patchver} \
+	mv ${DESTDIR}/usr/include/c++/${version} \
 		${DESTDIR}/usr/include/c++/${_minorver}
 	ln -sfr ${DESTDIR}/usr/include/c++/${_minorver} \
-		${DESTDIR}/usr/include/c++/${_patchver}
+		${DESTDIR}/usr/include/c++/${version}
 
 	# cc symlink
 	ln -sfr ${DESTDIR}/usr/bin/gcc ${DESTDIR}/usr/bin/cc
@@ -360,7 +357,7 @@ do_install() {
 
 	# lto plugin symlink
 	vmkdir usr/lib/bfd-plugins
-	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}/liblto_plugin.so \
+	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${version}/liblto_plugin.so \
 		${DESTDIR}/usr/lib/bfd-plugins
 
 	# Remove "fixed" header
@@ -375,8 +372,8 @@ do_install() {
 	rm -f ${DESTDIR}/usr/lib/*.py
 
 	# Remove more python stuff.
-	if [ -d ${DESTDIR}/usr/share/gcc-${_patchver}/python ]; then
-		rm -rf ${DESTDIR}/usr/share/gcc-${_patchver}/python
+	if [ -d ${DESTDIR}/usr/share/gcc-${version}/python ]; then
+		rm -rf ${DESTDIR}/usr/share/gcc-${version}/python
 	fi
 
 	# Install c89 and c99 wrappers and its manpages, from NetBSD.
@@ -396,7 +393,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}
@@ -449,7 +446,7 @@ gcc-fortran_package() {
 		if [ "$CROSS_BUILD" ]; then
 			# A number of OMP modules are not built when cross
 			# compiling gcc. Copy them from the cross compiler.
-			local src="/usr/lib/gcc/${_triplet}/${_patchver}/finclude"
+			local src="/usr/lib/gcc/${_triplet}/${version}/finclude"
 			local dst="usr/lib/gcc/${_triplet}/${_minorver}/finclude"
 			for f in omp_lib.f90 omp_lib.h omp_lib.mod omp_lib_kinds.mod \
 				openacc.f90 openacc.mod openacc_kinds.mod openacc_lib.h; do
@@ -516,7 +513,7 @@ libgfortran_package() {
 	short_desc+=" - Fortran library"
 	pkg_install() {
 		vmove "usr/lib/libgfortran.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -537,7 +534,7 @@ libgo_package() {
 	nostrip=yes
 	pkg_install() {
 		vmove "usr/lib/libgo.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -553,7 +550,7 @@ libobjc_package() {
 	short_desc+=" - Objective-C library"
 	pkg_install() {
 		vmove "usr/lib/libobjc.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -572,7 +569,7 @@ libquadmath_package() {
 	short_desc+=" - quadmath library"
 	pkg_install() {
 		vmove "usr/lib/libquadmath.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -614,7 +611,7 @@ libgcc_package() {
 	noverifyrdeps=yes
 	pkg_install() {
 		vmove "usr/lib/libgcc_s.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -645,7 +642,7 @@ libgomp_package() {
 	short_desc+=" - OpenMP v4.0 library"
 	pkg_install() {
 		vmove "usr/lib/libgomp*.so.*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -700,7 +697,7 @@ libssp_package() {
 	short_desc+=" - SSP (StackSmashingProtection) library"
 	pkg_install() {
 		vmove "usr/lib/libssp.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -718,6 +715,6 @@ libstdc++_package() {
 	short_desc+=" - Standard C++ Library"
 	pkg_install() {
 		vmove "usr/lib/libstdc++.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }

From 8550727ccbdb86e5eba8ad007d55082ebf1d700d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 04/37] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      | 11 ++++--
 2 files changed, 25 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..51611929d643 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,12 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
+
+if [ "$XBPS_LIBC" == "musl" ]; then
+	# Musl always searches LD_LIBRARY_PATH before RPATH and RUNPATH
+	make_build_args="lt_cv_shlibpath_overrides_runpath=yes"
+fi
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From d4d804a2f92e12fd4c01e49c4afc50276a1d8731 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 05/37] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 55255dceae8b..ca2d858a7abc 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From ebade3746faa5a9527d9b9f03285d58a65f37940 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 06/37] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 3 files changed, 55 insertions(+), 353 deletions(-)
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index 881c8d459eaa..6fdbf8105d54 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From 907cd0253e5987f1e15c8d9810b09cb8247cbcd6 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Wed, 14 Sep 2022 03:48:32 -0700
Subject: [PATCH 07/37] musl: add support for SIGEV_THREAD_ID timers

https://git.musl-libc.org/cgit/musl/commit/?id=7c71792e87691451f2a6b76348e83ad1889f1dcb
---
 ...d-support-for-SIGEV_THREAD_ID-timers.patch | 74 +++++++++++++++++++
 srcpkgs/musl/template                         |  2 +-
 2 files changed, 75 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch

diff --git a/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
new file mode 100644
index 000000000000..e20dff5ba0d4
--- /dev/null
+++ b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
@@ -0,0 +1,74 @@
+From 7c71792e87691451f2a6b76348e83ad1889f1dcb Mon Sep 17 00:00:00 2001
+From: James Y Knight <jyknight@google.com>
+Date: Sun, 30 Jun 2019 21:55:20 -0400
+Subject: [PATCH] add support for SIGEV_THREAD_ID timers
+
+This is like SIGEV_SIGNAL, but targeted to a particular thread's
+tid, rather than the process.
+---
+ include/signal.h        | 16 +++++++++++++---
+ src/time/timer_create.c |  8 ++++++--
+ 2 files changed, 19 insertions(+), 5 deletions(-)
+
+diff --git a/include/signal.h b/include/signal.h
+index fbdf667b2..9ed929e4f 100644
+--- a/include/signal.h
++++ b/include/signal.h
+@@ -180,14 +180,24 @@ struct sigevent {
+ 	union sigval sigev_value;
+ 	int sigev_signo;
+ 	int sigev_notify;
+-	void (*sigev_notify_function)(union sigval);
+-	pthread_attr_t *sigev_notify_attributes;
+-	char __pad[56-3*sizeof(long)];
++	union {
++		char __pad[64 - 2*sizeof(int) - sizeof(union sigval)];
++		pid_t sigev_notify_thread_id;
++		struct {
++			void (*sigev_notify_function)(union sigval);
++			pthread_attr_t *sigev_notify_attributes;
++		} __sev_thread;
++	} __sev_fields;
+ };
+ 
++#define sigev_notify_thread_id __sev_fields.sigev_notify_thread_id
++#define sigev_notify_function __sev_fields.__sev_thread.sigev_notify_function
++#define sigev_notify_attributes __sev_fields.__sev_thread.sigev_notify_attributes
++
+ #define SIGEV_SIGNAL 0
+ #define SIGEV_NONE 1
+ #define SIGEV_THREAD 2
++#define SIGEV_THREAD_ID 4
+ 
+ int __libc_current_sigrtmin(void);
+ int __libc_current_sigrtmax(void);
+diff --git a/src/time/timer_create.c b/src/time/timer_create.c
+index 5ddfda278..4bef23905 100644
+--- a/src/time/timer_create.c
++++ b/src/time/timer_create.c
+@@ -71,11 +71,15 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 	switch (evp ? evp->sigev_notify : SIGEV_SIGNAL) {
+ 	case SIGEV_NONE:
+ 	case SIGEV_SIGNAL:
++	case SIGEV_THREAD_ID:
+ 		if (evp) {
+ 			ksev.sigev_value = evp->sigev_value;
+ 			ksev.sigev_signo = evp->sigev_signo;
+ 			ksev.sigev_notify = evp->sigev_notify;
+-			ksev.sigev_tid = 0;
++			if (evp->sigev_notify == SIGEV_THREAD_ID)
++				ksev.sigev_tid = evp->sigev_notify_thread_id;
++			else
++				ksev.sigev_tid = 0;
+ 			ksevp = &ksev;
+ 		}
+ 		if (syscall(SYS_timer_create, clk, ksevp, &timerid) < 0)
+@@ -107,7 +111,7 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 
+ 		ksev.sigev_value.sival_ptr = 0;
+ 		ksev.sigev_signo = SIGTIMER;
+-		ksev.sigev_notify = 4; /* SIGEV_THREAD_ID */
++		ksev.sigev_notify = SIGEV_THREAD_ID;
+ 		ksev.sigev_tid = td->tid;
+ 		if (syscall(SYS_timer_create, clk, &ksev, &timerid) < 0)
+ 			timerid = -1;
diff --git a/srcpkgs/musl/template b/srcpkgs/musl/template
index 5bdc5c48e623..34e6ed4fba6e 100644
--- a/srcpkgs/musl/template
+++ b/srcpkgs/musl/template
@@ -2,7 +2,7 @@
 pkgname=musl
 reverts="1.2.0_1"
 version=1.1.24
-revision=10
+revision=11
 archs="*-musl"
 bootstrap=yes
 build_style=gnu-configure

From 18fab7a0fc25faaa0360e6801a2efe5de8d981e1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 21:01:43 -0700
Subject: [PATCH 08/37] gcc-multilib: update to 12.2.0.

---
 srcpkgs/gcc-multilib/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index fcd25755aa75..df60849babc2 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,16 +3,16 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _majorver="${version%.*}"
-wrksrc=gcc-${version/pre/_pre}
+wrksrc="gcc-${version}"
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel
@@ -71,7 +71,7 @@ do_build() {
 	make ${makejobs}
 }
 do_install() {
-	local _pc_triplet=x86_64-pc-linux-gnu _version=${version%pre1}
+	local _pc_triplet=x86_64-pc-linux-gnu
 	# Install to a tempdir and then only copy relevant files.
 	cd ${wrksrc}
 	make DESTDIR=${wrksrc}/${pkgname}-build install
@@ -81,9 +81,9 @@ do_install() {
 	vmkdir usr/include/c++/${_majorver}/${_triplet}
 	vmkdir usr/lib/gcc/${_triplet}/${_majorver}
 
-	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${_version}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${version}/32 \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_majorver}/
-	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${_version}/${_pc_triplet}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${version}/${_pc_triplet}/32 \
 		${DESTDIR}/usr/include/c++/${_majorver}/${_triplet}
 
 	vinstall ${wrksrc}/host-${_pc_triplet}/gcc/specs 644 usr/lib/gcc/${_triplet}/${_majorver}

From 147715a69aff2b8d15d327e8f1fcc5715b171db0 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Tue, 4 Oct 2022 03:49:13 -0700
Subject: [PATCH 09/37] libgccjit: update to 12.2.0.

---
 srcpkgs/libgccjit/files/libgccjit-musl.patch | 63 --------------------
 srcpkgs/libgccjit/template                   | 38 ++++++------
 2 files changed, 17 insertions(+), 84 deletions(-)
 delete mode 100644 srcpkgs/libgccjit/files/libgccjit-musl.patch

diff --git a/srcpkgs/libgccjit/files/libgccjit-musl.patch b/srcpkgs/libgccjit/files/libgccjit-musl.patch
deleted file mode 100644
index d2ed16928c82..000000000000
--- a/srcpkgs/libgccjit/files/libgccjit-musl.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-diff --git a/gcc/jit/jit-playback.c b/gcc/jit/jit-playback.c
-index 5bccf591a..35f5e35ef 100644
---- a/gcc/jit/jit-playback.c
-+++ b/gcc/jit/jit-playback.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -41,8 +43,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "diagnostic.h"
- #include "stmt.h"
- 
--#include <pthread.h>
--
- #include "jit-playback.h"
- #include "jit-result.h"
- #include "jit-builtins.h"
-diff --git a/gcc/jit/jit-recording.c b/gcc/jit/jit-recording.c
-index a237d574f..5785e3269 100644
---- a/gcc/jit/jit-recording.c
-+++ b/gcc/jit/jit-recording.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -25,8 +27,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "pretty-print.h"
- #include "toplev.h"
- 
--#include <pthread.h>
--
- #include "jit-builtins.h"
- #include "jit-recording.h"
- #include "jit-playback.h"
-diff --git a/gcc/jit/libgccjit.c b/gcc/jit/libgccjit.c
-index f9c33c63c..75f21d275 100644
---- a/gcc/jit/libgccjit.c
-+++ b/gcc/jit/libgccjit.c
-@@ -18,13 +18,13 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
- #include "timevar.h"
- #include "typed-splay-tree.h"
- #include "cppbuiltin.h"
--#include <pthread.h>
- 
- #include "libgccjit.h"
- #include "jit-recording.h"
diff --git a/srcpkgs/libgccjit/template b/srcpkgs/libgccjit/template
index 6f1d6256dcd6..2f2802eaba8b 100644
--- a/srcpkgs/libgccjit/template
+++ b/srcpkgs/libgccjit/template
@@ -3,36 +3,32 @@
 # which use the version number.
 
 pkgname=libgccjit
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
+version=12.2.0
 revision=1
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
-_majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
-wrksrc=gcc-${version/pre/_pre}
+_mpc_version=1.2.1
+_isl_version=0.24
 short_desc="Just-In-Time Compilation library for GCC"
 maintainer="Lane Biocini <lane@mailbox.org>"
 homepage="https://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 nopie=yes
+create_wrksrc=yes
+build_wrksrc="gcc-${version}"
+patch_args="-Np1 --directory=${build_wrksrc}"
 lib32disabled=yes
 makedepends="zlib-devel"
 hostmakedepends="tar texinfo perl flex"
@@ -40,10 +36,10 @@ depends="gcc"
 checkdepends="dejagnu"
 
 post_extract() {
-	mv ${XBPS_BUILDDIR}/gmp-${_gmp_version} ${wrksrc}/gmp
-	mv ${XBPS_BUILDDIR}/mpfr-${_mpfr_version} ${wrksrc}/mpfr
-	mv ${XBPS_BUILDDIR}/mpc-${_mpc_version} ${wrksrc}/mpc
-	mv ${XBPS_BUILDDIR}/isl-${_isl_version} ${wrksrc}/isl
+	mv ${wrksrc}/gmp-${_gmp_version} ${wrksrc}/${build_wrksrc}/gmp
+	mv ${wrksrc}/mpfr-${_mpfr_version} ${wrksrc}/${build_wrksrc}/mpfr
+	mv ${wrksrc}/mpc-${_mpc_version} ${wrksrc}/${build_wrksrc}/mpc
+	mv ${wrksrc}/isl-${_isl_version} ${wrksrc}/${build_wrksrc}/isl
 }
 
 pre_configure() {
@@ -186,7 +182,7 @@ do_configure() {
 	[ -z "$XBPS_CHECK_PKGS" ] && _langs="jit" || _langs="jit,c++"
 	_args+=" --enable-languages=${_langs}"
 	CONFIG_SHELL=/bin/bash \
-		${wrksrc}/configure ${_args}
+		${wrksrc}/${build_wrksrc}/configure ${_args}
 }
 
 do_build() {

From fe6a17eaef52914ccfc6ddd3dfa4801072409365 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 14 Aug 2022 19:29:36 -0700
Subject: [PATCH 10/37] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove -no-pie from build. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..5d40f0cdd8a6 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -53,6 +53,7 @@ _void_cross_build_binutils() {
 		--sbindir=/usr/bin \
 		--libdir=/usr/lib \
 		--libexecdir=/usr/lib \
+		--sysconfdir=/etc \
 		--target=${tgt} \
 		--with-sysroot=/usr/${tgt} \
 		--disable-nls \
@@ -60,7 +61,9 @@ _void_cross_build_binutils() {
 		--disable-multilib \
 		--disable-werror \
 		--disable-gold \
+		--disable-gprofng \
 		--enable-relro \
+		--enable-new-dtags \
 		--enable-plugins \
 		--enable-64-bit-bfd \
 		--enable-deterministic-archives \
@@ -132,6 +135,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -460,6 +464,14 @@ do_build() {
 	local binutils_ver linux_ver gcc_ver libc_ver libucontext_ver
 	local tgt=${sourcepkg/cross-}
 
+	export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}"
+	export CXXFLAGS="${CXXFLAGS/-D_FORTIFY_SOURCE=2/}"
+
+	# Disable explicit -fno-PIE, gcc/binutils/libc will figure this out itself.
+	export CFLAGS="${CFLAGS//-fno-PIE/}"
+	export CXXFLAGS="${CXXFLAGS//-fno-PIE/}"
+	export LDFLAGS="${LDFLAGS//-no-pie/}"
+
 	_void_cross_test_ver binutils
 	_void_cross_test_ver linux
 	_void_cross_test_ver gcc
@@ -625,6 +637,9 @@ do_install() {
 	# then remove it because it conflicts with libquadmath package
 	rm -rf ${DESTDIR}/${sysroot}/usr/lib/libquadmath.*
 
+	# Remove libdep linker plugin because it conflicts with system binutils
+	rm -f ${DESTDIR}/usr/lib/bfd-plugins/libdep*
+
 	# Remove leftover symlinks
 	rm -f ${DESTDIR}/usr/lib${XBPS_TARGET_WORDSIZE}
 	rm -f ${DESTDIR}/lib*

From 036ea68be519b84721bb718f8c9bdbc0f82824fc Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:09:31 -0700
Subject: [PATCH 11/37] linux5.18: update dotconfigs for gcc12

---
 srcpkgs/linux5.18/files/x86_64-dotconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/linux5.18/files/x86_64-dotconfig b/srcpkgs/linux5.18/files/x86_64-dotconfig
index 4e73a3195d40..ea6204868e23 100644
--- a/srcpkgs/linux5.18/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.18/files/x86_64-dotconfig
@@ -512,6 +512,7 @@ CONFIG_RETHUNK=y
 CONFIG_CPU_UNRET_ENTRY=y
 CONFIG_CPU_IBPB_ENTRY=y
 CONFIG_CPU_IBRS_ENTRY=y
+CONFIG_SLS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10060,8 +10061,11 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
 # Memory initialization
 #
 CONFIG_INIT_STACK_NONE=y
+# CONFIG_INIT_STACK_ALL_PATTERN is not set
+# CONFIG_INIT_STACK_ALL_ZERO is not set
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
+# CONFIG_ZERO_CALL_USED_REGS is not set
 # end of Memory initialization
 # end of Kernel hardening options
 # end of Security options
@@ -10538,6 +10542,7 @@ CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
 # CONFIG_UBSAN is not set
 CONFIG_HAVE_ARCH_KCSAN=y
+# CONFIG_KCSAN is not set
 # end of Generic Kernel Debugging Instruments
 
 #

From 18ff200ffcebf362babd12acb41ba5be4d9c87dc Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:08 -0700
Subject: [PATCH 12/37] subversion: fix build for libtool 2.4.7

---
 srcpkgs/subversion/template | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/subversion/template b/srcpkgs/subversion/template
index 18c35e3a2132..0aa41212c5fd 100644
--- a/srcpkgs/subversion/template
+++ b/srcpkgs/subversion/template
@@ -24,6 +24,8 @@ distfiles="http://apache.uvigo.es/subversion/subversion-${version}.tar.bz2"
 checksum=c9130e8d0b75728a66f0e7038fc77052e671830d785b5616aad53b4810d3cc28
 
 pre_configure() {
+	./autogen.sh --release
+
 	# Based on native build values
 	cat <<-EOF >config.cache
 	ac_cv_python_includes=-I${XBPS_CROSS_BASE}/usr/include/python${py3_ver}
@@ -59,7 +61,12 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+
+	if [ "$XBPS_BUILD_ENVIRONMENT" = "void-packages-ci" ]; then
+		# This test will fail when run as the root user,
+		# because flock() will ignore file permissions.
+		vsed -i subversion/tests/libsvn_fs/locks-test.c -e '/SVN_TEST_OPTS_PASS(obtain_write_lock_failure,/,+3d'
+	fi
 }
 
 post_configure() {

From 53bcf3f73d690b76c5541ac5190a3d0b5b3a9e20 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:38 -0700
Subject: [PATCH 13/37] subversion-kwallet-auth: update to 1.14.2.

Fix failing distfiles.
Fix build for libtool 2.4.7
---
 srcpkgs/subversion-kwallet-auth/template | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/subversion-kwallet-auth/template b/srcpkgs/subversion-kwallet-auth/template
index 12210f250d51..9cc68c3fe5f1 100644
--- a/srcpkgs/subversion-kwallet-auth/template
+++ b/srcpkgs/subversion-kwallet-auth/template
@@ -3,7 +3,7 @@
 # THIS PKG MUST BE SYNCHRONIZED WITH "srcpkgs/subversion".
 #
 pkgname=subversion-kwallet-auth
-version=1.14.1
+version=1.14.2
 revision=1
 wrksrc="subversion-${version}"
 build_style=gnu-configure
@@ -22,10 +22,12 @@ license="Apache-2.0, BSD-3-Clause"
 homepage="http://subversion.apache.org/"
 changelog="https://subversion.apache.org/docs/release-notes/${version%.*}.html"
 distfiles="http://apache.uvigo.es/subversion/subversion-${version}.tar.bz2"
-checksum=2c5da93c255d2e5569fa91d92457fdb65396b0666fad4fd59b22e154d986e1a9
+checksum=c9130e8d0b75728a66f0e7038fc77052e671830d785b5616aad53b4810d3cc28
 lib32disabled=yes
 
 pre_configure() {
+	./autogen.sh --release
+
 	# Based on native build values
 	cat <<-EOF >config.cache
 	ac_cv_python_includes=-I${XBPS_CROSS_BASE}/usr/include/python${py3_ver}
@@ -55,11 +57,18 @@ pre_configure() {
 		cp "$XBPS_CROSS_BASE/usr/lib/perl5/core_perl/Config"*.p? $PERL5LIB
 		cp "$XBPS_CROSS_BASE/usr/lib/perl5/core_perl/Errno.pm" $PERL5LIB
 		vsed -e "s;archlibexp => '\(.*\)';archlibexp => '${XBPS_CROSS_BASE}\1';" \
-			-i $PERL5LIB/Config.pm $PERL5LIB/Config_heavy.pl
+			-i $PERL5LIB/Config.pm
+		vsed -e "s;archlibexp='\(.*\)';archlibexp='${XBPS_CROSS_BASE}\1';" \
+			-i $PERL5LIB/Config_heavy.pl
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+
+	if [ "$XBPS_BUILD_ENVIRONMENT" = "void-packages-ci" ]; then
+		# This test will fail when run as the root user,
+		# because flock() will ignore file permissions.
+		vsed -i subversion/tests/libsvn_fs/locks-test.c -e '/SVN_TEST_OPTS_PASS(obtain_write_lock_failure,/,+3d'
+	fi
 }
 
 post_configure() {

From ff6f2ce88511fba135d2bf14ec1a728188068a04 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 14/37] cross-aarch64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..bd6b23f9fb6a 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 1261b85140669b13cd4c012afe12f4a8c625a9fe Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 15/37] cross-aarch64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..427ad2c1e9cd 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From a4baec08759561d643e3388b556025696953acc6 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 16/37] cross-arm-linux-gnueabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..2510ee26e789 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 563c8a6eec7f12ab691f203596c1e92962103fa5 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 17/37] cross-arm-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..bd8b16e1b4c1 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From e8c7567ec463f571f1153e06140c91ec457d740a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 18/37] cross-arm-linux-musleabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..dacfd2655216 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 16e31b8877edd6edfa4fbcc094b3955c6f7b409a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 19/37] cross-arm-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..9ddd32a9f20d 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From e7edae72c849029caedadd2b59b8167f18090dc9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 20/37] cross-armv7l-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..9fb00f18be3b 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From c3bbdb43cd2069bccdf31088d5950320e2efbaf8 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 21/37] cross-armv7l-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..2c72e75ddfe3 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From e37b5fe879cafbdfb692c650ab360a6457c3688d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 22/37] cross-i686-pc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..4dc17df648b5 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 656cd641a1b1faa505ea0bfd8cc885bd31fe2433 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Fri, 16 Sep 2022 20:52:19 -0700
Subject: [PATCH 23/37] cross-i686-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-linux-musl/template b/srcpkgs/cross-i686-linux-musl/template
index 8be16a230d8d..78b4d813a113 100644
--- a/srcpkgs/cross-i686-linux-musl/template
+++ b/srcpkgs/cross-i686-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-i686-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-i686-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 48bac21b0205dc06087f15acced828fcc83b3035 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 24/37] cross-mips-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..6009e5c79eb2 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 718c6e2f418b51a821d15f921c1c8107a056ea52 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 25/37] cross-mips-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..080164df193d 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="hipperson0 <hipperson0@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From e30f6ae4ad46c36bf4716a2429d655bae712a088 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 26/37] cross-mipsel-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..f9fd4b8a04ef 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From e6127c1c3be29dd60883b9f90fb5b8075cd022da Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 27/37] cross-mipsel-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..7418a984474b 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 6fbafadcc734913393ea4c0e96ecfe2cef0bc263 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 28/37] cross-powerpc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..31e57b4e52b2 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 4e7117ba487a49a376719b2dc464ed697d8034aa Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 29/37] cross-powerpc-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..a2d1edcf1ffd 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 4f82e1c8fa1e4800b43face8f10e9eed13b93566 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 30/37] cross-powerpc64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..1a4cbed61e76 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 27cbc24ec7db2eb7120ac0c920cf751f284bf4af Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 31/37] cross-powerpc64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 016f18776a6d..19b1ff859eb6 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 588eff453bfe2478951b1357d7f23373ccaccc3a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 32/37] cross-powerpc64le-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 463d7e92d20d..9d99a3a315d2 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 0d5dc053e3e0d745822e70650fe895d3723d3b28 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 33/37] cross-powerpc64le-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index c17a3cccfe29..3128baa7372e 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 37538a0cc117c8900ab3a5e73e0ff73b2241820b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 34/37] cross-powerpcle-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 9aede3c465ce..6f914b3877ee 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 63ef5780a18604e76946ae489f421d3cc9204782 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 35/37] cross-powerpcle-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index 045cfda987fe..20e70bed4c60 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From eb4806c4525148dd6f860d94022d4744d74a19fe Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 36/37] cross-x86_64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 8918f3c22a1c..5219cd50f851 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 21f3bd4516bc55eb7f77a8d43c36347e26e33656 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 37/37] cross-x86_64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..2811de0d3c2e 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (178 preceding siblings ...)
  2022-10-10  5:05 ` oreo639
@ 2022-10-10  5:10 ` oreo639
  2022-10-13 18:49 ` Johnnynator
                   ` (84 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-10-10  5:10 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5478 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.2.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.2.0

There is a list of failing builds here: https://github.com/void-linux/void-packages/issues/39809

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [x] llvm https://github.com/void-linux/void-packages/pull/38694
- [x] m4 https://github.com/void-linux/void-packages/pull/33730
- [x] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [x] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [x] libvirt https://github.com/void-linux/void-packages/pull/38842
- [x] syslinux https://github.com/void-linux/void-packages/pull/38876
- [x] efivar https://github.com/void-linux/void-packages/pull/38874
- [ ] gpgme https://github.com/void-linux/void-packages/pull/38825

Known packages that needed to be fixed/updated for gcc12:
- [ ] linux5.18 (in this PR)
- [x] openssh https://github.com/void-linux/void-packages/pull/38849
- [x] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [x] doxygen https://github.com/void-linux/void-packages/pull/38846
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] libproxy https://github.com/void-linux/void-packages/pull/38818
- [x] exempi https://github.com/void-linux/void-packages/pull/38820
- [x] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [x] libunique1 https://github.com/void-linux/void-packages/pull/38848 or https://github.com/void-linux/void-packages/pull/38873
- [x] libwpd https://github.com/void-linux/void-packages/pull/38878
- [x] cglm https://github.com/void-linux/void-packages/pull/39748
- [x] coreboot-utils https://github.com/void-linux/void-packages/pull/39749
- [x] apl https://github.com/void-linux/void-packages/pull/39750
- [x] igt-gpu-tools https://github.com/void-linux/void-packages/pull/39780

Needs to be fixed/updated for binutils:
- [x] grub https://github.com/void-linux/void-packages/pull/38875
- [x] linux-tools https://github.com/void-linux/void-packages/pull/38877
- [x] kcov https://github.com/void-linux/void-packages/pull/39291

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [x] kde
- [x] lxde
- [x] lxqt

You can test the ISOs here:
https://drive.google.com/drive/folders/1ix92CYSLUP-KWjLxltdgG4e8Nu2JCY5n?usp=sharing

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 130714 bytes --]

From b7ec4edfe2a526c2474b734d3403db5f6d84cd20 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 01/37] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../fix-libcollector-without-java.patch       | 53 +++++++++++++++
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 25 ++++---
 4 files changed, 87 insertions(+), 117 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
 create mode 100644 srcpkgs/binutils/patches/fix-libcollector-without-java.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/fix-libcollector-without-java.patch b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
new file mode 100644
index 000000000000..54384875f358
--- /dev/null
+++ b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
@@ -0,0 +1,53 @@
+From 49ddd814ac1071af7c4f45d5f8398b91862f2c7f Mon Sep 17 00:00:00 2001
+From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
+Date: Wed, 17 Aug 2022 19:55:23 -0700
+Subject: [PATCH] gprofng: fix bug 29479 Collection fails when built without
+ java support
+
+gprofng/ChangeLog
+2022-08-17  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>
+
+	PR gprofng/29479
+	* libcollector/collector.c: Add #if defined(GPROFNG_JAVA_PROFILING) for
+	java specific code.
+	* libcollector/unwind.c: Likewise.
+---
+ gprofng/libcollector/collector.c | 2 ++
+ gprofng/libcollector/unwind.c    | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/gprofng/libcollector/collector.c b/gprofng/libcollector/collector.c
+index 93c9d3330de5..ceff2c1caccb 100644
+--- a/gprofng/libcollector/collector.c
++++ b/gprofng/libcollector/collector.c
+@@ -913,8 +913,10 @@ __collector_open_experiment (const char *exp, const char *params, sp_origin_t or
+   __collector_ext_unwind_key_init (1, NULL);
+ 
+   /* start java attach if suitable */
++#if defined(GPROFNG_JAVA_PROFILING)
+   if (exp_origin == SP_ORIGIN_DBX_ATTACH)
+     __collector_jprofile_start_attach ();
++#endif
+   start_sec_time = CALL_UTIL (time)(NULL);
+   __collector_start_time = collector_interface.getHiResTime ();
+   TprintfT (DBG_LT0, "\t__collector_open_experiment; resetting start_time\n");
+diff --git a/gprofng/libcollector/unwind.c b/gprofng/libcollector/unwind.c
+index 119243788020..f8e11823c81e 100644
+--- a/gprofng/libcollector/unwind.c
++++ b/gprofng/libcollector/unwind.c
+@@ -557,6 +557,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+   int size = max_frame_size;
+ 
+ #define MIN(a,b) ((a)<(b)?(a):(b))
++#if defined(GPROFNG_JAVA_PROFILING)
+   /* get Java info */
+   if (__collector_java_mode && __collector_java_asyncgetcalltrace_loaded && context && !pseudo_context)
+     {
+@@ -569,6 +570,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+ 	  size -= sz;
+ 	}
+     }
++#endif
+ 
+   /* get native stack */
+   if (context)
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..c355a5fc8016 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkgconf"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -35,15 +36,21 @@ do_configure() {
 	local conf
 
 	if [ "$CHROOT_READY" ]; then
-		conf+=" --with-debuginfod"
+		conf+=" --with-debuginfod --enable-shared"
 	else
-		conf+=" --without-debuginfod --disable-install-libbfd"
+		conf+=" --without-debuginfod --disable-shared --disable-install-libbfd"
 	fi
 	if [ "$CROSS_BUILD" ]; then
 		# we don't want --with-sysroot=${XBPS_CROSS_BASE} like gnu-configure
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	# gprofng currently only supports x86 and aarch64 glibc.
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64|i386|aarch64) conf+=" --enable-gprofng" ;;
+		*) conf+=" --disable-gprofng" ;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"
@@ -76,13 +83,14 @@ do_configure() {
 		--libdir=/usr/lib \
 		--mandir=/usr/share/man \
 		--infodir=/usr/share/info \
+		--sysconfdir=/etc \
 		--disable-werror \
-		--disable-shared \
 		--disable-nls \
 		--enable-threads \
 		--enable-plugins \
 		--enable-relro \
 		--enable-gold \
+		--enable-new-dtags \
 		--enable-deterministic-archives \
 		--enable-64-bit-bfd \
 		--enable-ld=default \
@@ -142,7 +150,8 @@ binutils-devel_package() {
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/*.a"
-		vmove "usr/lib/*.so"
+		vmove "usr/lib/libbfd.so"
+		vmove "usr/lib/libopcodes.so"
 	}
 }
 

From 4d8d5b492e6a618174e9dc03ec065f104b157692 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 2 Oct 2022 16:46:59 -0700
Subject: [PATCH 02/37] gdb: resolve conflict with binutils 2.39

---
 srcpkgs/gdb/template | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/gdb/template b/srcpkgs/gdb/template
index ff7c9d9a5911..5970402eb27e 100644
--- a/srcpkgs/gdb/template
+++ b/srcpkgs/gdb/template
@@ -1,7 +1,7 @@
 # Template file for 'gdb'
 pkgname=gdb
 version=12.1
-revision=1
+revision=2
 build_style=gnu-configure
 pycompile_dirs="/usr/share/gdb/python"
 configure_args="--disable-werror --disable-nls --with-system-readline
@@ -48,7 +48,8 @@ vopt_conflict debuginfod static
 
 post_install() {
 	# resolve conflicts with binutils
-	rm -r ${DESTDIR}/usr/{include,lib,share/info/bfd.info*}
+	rm -rf ${DESTDIR}/usr/{include,lib}
+	rm -rf ${DESTDIR}/usr/share/info/{bfd,ctf-spec}.info*
 }
 
 gdb-common_package() {

From b32fa08643351133406b743c472b597c216e747d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 03/37] gcc: update to 12.2.0.

---
 common/shlibs                                 |  10 +-
 srcpkgs/gcc/files/gccgo-musl.patch            |  71 ++--------
 srcpkgs/gcc/files/libgnarl-musl.patch         |  18 +--
 srcpkgs/gcc/files/libssp-musl.patch           |  10 +-
 srcpkgs/gcc/patches/libffi_gnulinux.patch     |  11 --
 .../gcc/patches/libgcc-ibm128-no-tag.patch    |  10 +-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |   2 +-
 srcpkgs/gcc/template                          | 125 +++++++++---------
 8 files changed, 99 insertions(+), 158 deletions(-)
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index 9f95ac87a7ea..881c8d459eaa 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.2.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.36 perl-5.36.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -847,8 +847,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.2.0_1
+libgnat-12.so libada-12.2.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1697,8 +1697,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.2.0_1
+libasan.so.8 libsanitizer-12.2.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..12ec68dd8aa3 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,14 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ b/libgo/go/runtime/os_linux.go
+@@ -365,7 +365,7 @@ func setThreadCPUProfiler(hz int32) {
+ 	var sevp _sigevent
+ 	sevp.sigev_notify = _SIGEV_THREAD_ID
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.__sev_fields))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..3482329838a2 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,37 +3,35 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
+version=12.2.0
+revision=1
+_minorver="${version%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
-wrksrc=gcc-${version/pre/_pre}
+_mpc_version=1.2.1
+_isl_version=0.24
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
+create_wrksrc=yes
+build_wrksrc="gcc-${version}"
+patch_args="-Np1 --directory=${build_wrksrc}"
 lib32disabled=yes
 bootstrap=yes
 replaces="gcc-gcj<7.2.0 gcc-gcj-jdk-compat<7.2.0 libmpx>=0 libmpx-devel>=0"
@@ -53,7 +51,7 @@ if [ "$CHROOT_READY" ]; then
 else
 	_have_gccgo=no
 fi
-makedepends="zlib-devel"
+makedepends="zlib-devel libzstd-devel"
 depends="binutils libgcc-devel-${version}_${revision}
  libstdc++-devel-${version}_${revision} libssp-devel-${version}_${revision}"
 checkdepends="dejagnu"
@@ -70,13 +68,13 @@ if [ "$build_option_gnatboot" ]; then
 	case "$XBPS_TARGET_MACHINE" in
 	x86_64)
 		_gnat_tarball="gnat-gpl-2017-x86_64-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/591c6d80c7a447af2deed1d7>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/9682e2e1f2f232ce03fe21d77b14c37a0de5649b?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" b942bcac20dea39748b39f8b624d9619f60a8dee2e8195dbe3829c835b0956e6"
 		build_options_default="gnatboot"
 		;;
 	i686)
 		_gnat_tarball="gnat-gpl-2014-x86-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/564b3e9dc8e196b040fbe248>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/c5e9e6fdff5cb77ed90cf8c62536653e27c0bed6?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" 3b693510f5d22a240abb3034934c1adbd80ccd6e4f61a4f491cc408fdfd9c042"
 		build_options_default="gnatboot"
 		;;
@@ -155,25 +153,24 @@ if [ "$CROSS_BUILD" ]; then
 fi
 
 post_extract() {
-	mkdir -p ${wrksrc}/{gmp,mpfr,mpc,isl}
-	cp -ar ${XBPS_BUILDDIR}/gmp-${_gmp_version}/* ${wrksrc}/gmp/
-	cp -ar ${XBPS_BUILDDIR}/mpfr-${_mpfr_version}/* ${wrksrc}/mpfr/
-	cp -ar ${XBPS_BUILDDIR}/mpc-${_mpc_version}/* ${wrksrc}/mpc/
-	cp -ar ${XBPS_BUILDDIR}/isl-${_isl_version}/* ${wrksrc}/isl/
+	mv ${wrksrc}/gmp-${_gmp_version} ${wrksrc}/${build_wrksrc}/gmp
+	mv ${wrksrc}/mpfr-${_mpfr_version} ${wrksrc}/${build_wrksrc}/mpfr
+	mv ${wrksrc}/mpc-${_mpc_version} ${wrksrc}/${build_wrksrc}/mpc
+	mv ${wrksrc}/isl-${_isl_version} ${wrksrc}/${build_wrksrc}/isl
 
 	if [ "$build_option_gnatboot" ]; then
 		local f="${XBPS_SRCDISTDIR}/${pkgname}-${version}/${_gnat_tarball}"
 		msg_normal "Extracting ${_gnat_tarball} ...\n"
-		mkdir -p ${wrksrc}/gnat-ins
-		tar -x -f "$f" --strip-components=1 -C ${wrksrc}/gnat-ins
-		cd ${wrksrc}/gnat-ins
-		make ins-all prefix=${wrksrc}/gnat
-		cd ${wrksrc}
-		rm -rf ${wrksrc}/gnat-ins
+		mkdir -p ${wrksrc}/${build_wrksrc}/gnat-ins
+		tar -x -f "$f" --strip-components=1 -C ${wrksrc}/${build_wrksrc}/gnat-ins
+		cd ${wrksrc}/${build_wrksrc}/gnat-ins
+		make ins-all prefix=${wrksrc}/${build_wrksrc}/gnat
+		cd ${wrksrc}/${build_wrksrc}
+		rm -rf ${wrksrc}/${build_wrksrc}/gnat-ins
 
 		# Rename obsolete ld and as
-		find ${wrksrc}/gnat -name ld -exec mv -v {} {}.old \;
-		find ${wrksrc}/gnat -name as -exec mv -v {} {}.old \;
+		find ${wrksrc}/${build_wrksrc}/gnat -name ld -exec mv -v {} {}.old \;
+		find ${wrksrc}/${build_wrksrc}/gnat -name as -exec mv -v {} {}.old \;
 	fi
 }
 
@@ -185,9 +182,9 @@ pre_configure() {
 	sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
 
 	if [ "$XBPS_TARGET_LIBC" = musl ]; then
-		patch -p1 -i ${FILESDIR}/libgnarl-musl.patch
-		patch -p1 -i ${FILESDIR}/libssp-musl.patch
-		patch -p1 -i ${FILESDIR}/gccgo-musl.patch
+		for p in ${FILESDIR}/*-musl.patch; do
+			patch -p1 -i $p
+		done
 	fi
 }
 do_configure() {
@@ -297,19 +294,19 @@ do_configure() {
 		_args+=" --enable-languages=${_langs},ada"
 		_args+=" --enable-libada"
 		CONFIG_SHELL=/bin/bash \
-		CC="${wrksrc}/gnat/bin/gcc" \
-		GNATBIND="${wrksrc}/gnat/bin/gnatbind" \
-		GNATMAKE="${wrksrc}/gnat/bin/gnatmake" \
-		PATH="${wrksrc}/gnat/bin:$PATH" \
-			${wrksrc}/configure ${_args}
+		CC="${wrksrc}/${build_wrksrc}/gnat/bin/gcc" \
+		GNATBIND="${wrksrc}/${build_wrksrc}/gnat/bin/gnatbind" \
+		GNATMAKE="${wrksrc}/${build_wrksrc}/gnat/bin/gnatmake" \
+		PATH="${wrksrc}/${build_wrksrc}/gnat/bin:$PATH" \
+			${wrksrc}/${build_wrksrc}/configure ${_args}
 	elif [ "$build_option_ada" ]; then
 		_args+=" --enable-languages=${_langs},ada"
 		CONFIG_SHELL=/bin/bash \
-			${wrksrc}/configure ${_args}
+			${wrksrc}/${build_wrksrc}/configure ${_args}
 	else
 		_args+=" --enable-languages=${_langs}"
 		CONFIG_SHELL=/bin/bash \
-			${wrksrc}/configure ${_args}
+			${wrksrc}/${build_wrksrc}/configure ${_args}
 	fi
 }
 do_build() {
@@ -318,10 +315,10 @@ do_build() {
 	fi
 	cd build
 	if [ "$build_option_gnatboot" ]; then
-		CC="${wrksrc}/gnat/bin/gcc" \
-		GNATBIND="${wrksrc}/gnat/bin/gnatbind" \
-		GNATMAKE="${wrksrc}/gnat/bin/gnatmake" \
-		PATH="${wrksrc}/gnat/bin:$PATH" \
+		CC="${wrksrc}/${build_wrksrc}/gnat/bin/gcc" \
+		GNATBIND="${wrksrc}/${build_wrksrc}/gnat/bin/gnatbind" \
+		GNATMAKE="${wrksrc}/${build_wrksrc}/gnat/bin/gnatmake" \
+		PATH="${wrksrc}/${build_wrksrc}/gnat/bin:$PATH" \
 		make ${makejobs}
 	else
 		make ${makejobs}
@@ -330,7 +327,7 @@ do_build() {
 pre_install() {
 	if [ "$CROSS_BUILD" ]; then
 		# XXX otherwise links to host libpthread
-		for f in $(find ${wrksrc}/build/${XBPS_CROSS_TRIPLET} -type f -name libtool); do
+		for f in $(find ${wrksrc}/${build_wrksrc}/build/${XBPS_CROSS_TRIPLET} -type f -name libtool); do
 			sed -e "s,add_dir=\"-L\$libdir\",add_dir=\"-L${XBPS_CROSS_BASE}\$libdir\",g" -i $f
 		done
 	fi
@@ -342,16 +339,16 @@ do_install() {
 
 	# Make version a symlink of major version to make all versions
 	# from the same series work automagically.
-	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver} \
+	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${version} \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver}
 	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver} \
-		${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}
+		${DESTDIR}/usr/lib/gcc/${_triplet}/${version}
 
 	# Ditto for c++ headers.
-	mv ${DESTDIR}/usr/include/c++/${_patchver} \
+	mv ${DESTDIR}/usr/include/c++/${version} \
 		${DESTDIR}/usr/include/c++/${_minorver}
 	ln -sfr ${DESTDIR}/usr/include/c++/${_minorver} \
-		${DESTDIR}/usr/include/c++/${_patchver}
+		${DESTDIR}/usr/include/c++/${version}
 
 	# cc symlink
 	ln -sfr ${DESTDIR}/usr/bin/gcc ${DESTDIR}/usr/bin/cc
@@ -360,7 +357,7 @@ do_install() {
 
 	# lto plugin symlink
 	vmkdir usr/lib/bfd-plugins
-	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}/liblto_plugin.so \
+	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${version}/liblto_plugin.so \
 		${DESTDIR}/usr/lib/bfd-plugins
 
 	# Remove "fixed" header
@@ -375,8 +372,8 @@ do_install() {
 	rm -f ${DESTDIR}/usr/lib/*.py
 
 	# Remove more python stuff.
-	if [ -d ${DESTDIR}/usr/share/gcc-${_patchver}/python ]; then
-		rm -rf ${DESTDIR}/usr/share/gcc-${_patchver}/python
+	if [ -d ${DESTDIR}/usr/share/gcc-${version}/python ]; then
+		rm -rf ${DESTDIR}/usr/share/gcc-${version}/python
 	fi
 
 	# Install c89 and c99 wrappers and its manpages, from NetBSD.
@@ -396,7 +393,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}
@@ -449,7 +446,7 @@ gcc-fortran_package() {
 		if [ "$CROSS_BUILD" ]; then
 			# A number of OMP modules are not built when cross
 			# compiling gcc. Copy them from the cross compiler.
-			local src="/usr/lib/gcc/${_triplet}/${_patchver}/finclude"
+			local src="/usr/lib/gcc/${_triplet}/${version}/finclude"
 			local dst="usr/lib/gcc/${_triplet}/${_minorver}/finclude"
 			for f in omp_lib.f90 omp_lib.h omp_lib.mod omp_lib_kinds.mod \
 				openacc.f90 openacc.mod openacc_kinds.mod openacc_lib.h; do
@@ -516,7 +513,7 @@ libgfortran_package() {
 	short_desc+=" - Fortran library"
 	pkg_install() {
 		vmove "usr/lib/libgfortran.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -537,7 +534,7 @@ libgo_package() {
 	nostrip=yes
 	pkg_install() {
 		vmove "usr/lib/libgo.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -553,7 +550,7 @@ libobjc_package() {
 	short_desc+=" - Objective-C library"
 	pkg_install() {
 		vmove "usr/lib/libobjc.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -572,7 +569,7 @@ libquadmath_package() {
 	short_desc+=" - quadmath library"
 	pkg_install() {
 		vmove "usr/lib/libquadmath.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -614,7 +611,7 @@ libgcc_package() {
 	noverifyrdeps=yes
 	pkg_install() {
 		vmove "usr/lib/libgcc_s.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -645,7 +642,7 @@ libgomp_package() {
 	short_desc+=" - OpenMP v4.0 library"
 	pkg_install() {
 		vmove "usr/lib/libgomp*.so.*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -700,7 +697,7 @@ libssp_package() {
 	short_desc+=" - SSP (StackSmashingProtection) library"
 	pkg_install() {
 		vmove "usr/lib/libssp.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -718,6 +715,6 @@ libstdc++_package() {
 	short_desc+=" - Standard C++ Library"
 	pkg_install() {
 		vmove "usr/lib/libstdc++.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }

From 8550727ccbdb86e5eba8ad007d55082ebf1d700d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 04/37] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      | 11 ++++--
 2 files changed, 25 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..51611929d643 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,12 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
+
+if [ "$XBPS_LIBC" == "musl" ]; then
+	# Musl always searches LD_LIBRARY_PATH before RPATH and RUNPATH
+	make_build_args="lt_cv_shlibpath_overrides_runpath=yes"
+fi
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From d4d804a2f92e12fd4c01e49c4afc50276a1d8731 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 05/37] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 55255dceae8b..ca2d858a7abc 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From ebade3746faa5a9527d9b9f03285d58a65f37940 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 06/37] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 3 files changed, 55 insertions(+), 353 deletions(-)
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index 881c8d459eaa..6fdbf8105d54 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From 907cd0253e5987f1e15c8d9810b09cb8247cbcd6 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Wed, 14 Sep 2022 03:48:32 -0700
Subject: [PATCH 07/37] musl: add support for SIGEV_THREAD_ID timers

https://git.musl-libc.org/cgit/musl/commit/?id=7c71792e87691451f2a6b76348e83ad1889f1dcb
---
 ...d-support-for-SIGEV_THREAD_ID-timers.patch | 74 +++++++++++++++++++
 srcpkgs/musl/template                         |  2 +-
 2 files changed, 75 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch

diff --git a/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
new file mode 100644
index 000000000000..e20dff5ba0d4
--- /dev/null
+++ b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
@@ -0,0 +1,74 @@
+From 7c71792e87691451f2a6b76348e83ad1889f1dcb Mon Sep 17 00:00:00 2001
+From: James Y Knight <jyknight@google.com>
+Date: Sun, 30 Jun 2019 21:55:20 -0400
+Subject: [PATCH] add support for SIGEV_THREAD_ID timers
+
+This is like SIGEV_SIGNAL, but targeted to a particular thread's
+tid, rather than the process.
+---
+ include/signal.h        | 16 +++++++++++++---
+ src/time/timer_create.c |  8 ++++++--
+ 2 files changed, 19 insertions(+), 5 deletions(-)
+
+diff --git a/include/signal.h b/include/signal.h
+index fbdf667b2..9ed929e4f 100644
+--- a/include/signal.h
++++ b/include/signal.h
+@@ -180,14 +180,24 @@ struct sigevent {
+ 	union sigval sigev_value;
+ 	int sigev_signo;
+ 	int sigev_notify;
+-	void (*sigev_notify_function)(union sigval);
+-	pthread_attr_t *sigev_notify_attributes;
+-	char __pad[56-3*sizeof(long)];
++	union {
++		char __pad[64 - 2*sizeof(int) - sizeof(union sigval)];
++		pid_t sigev_notify_thread_id;
++		struct {
++			void (*sigev_notify_function)(union sigval);
++			pthread_attr_t *sigev_notify_attributes;
++		} __sev_thread;
++	} __sev_fields;
+ };
+ 
++#define sigev_notify_thread_id __sev_fields.sigev_notify_thread_id
++#define sigev_notify_function __sev_fields.__sev_thread.sigev_notify_function
++#define sigev_notify_attributes __sev_fields.__sev_thread.sigev_notify_attributes
++
+ #define SIGEV_SIGNAL 0
+ #define SIGEV_NONE 1
+ #define SIGEV_THREAD 2
++#define SIGEV_THREAD_ID 4
+ 
+ int __libc_current_sigrtmin(void);
+ int __libc_current_sigrtmax(void);
+diff --git a/src/time/timer_create.c b/src/time/timer_create.c
+index 5ddfda278..4bef23905 100644
+--- a/src/time/timer_create.c
++++ b/src/time/timer_create.c
+@@ -71,11 +71,15 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 	switch (evp ? evp->sigev_notify : SIGEV_SIGNAL) {
+ 	case SIGEV_NONE:
+ 	case SIGEV_SIGNAL:
++	case SIGEV_THREAD_ID:
+ 		if (evp) {
+ 			ksev.sigev_value = evp->sigev_value;
+ 			ksev.sigev_signo = evp->sigev_signo;
+ 			ksev.sigev_notify = evp->sigev_notify;
+-			ksev.sigev_tid = 0;
++			if (evp->sigev_notify == SIGEV_THREAD_ID)
++				ksev.sigev_tid = evp->sigev_notify_thread_id;
++			else
++				ksev.sigev_tid = 0;
+ 			ksevp = &ksev;
+ 		}
+ 		if (syscall(SYS_timer_create, clk, ksevp, &timerid) < 0)
+@@ -107,7 +111,7 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 
+ 		ksev.sigev_value.sival_ptr = 0;
+ 		ksev.sigev_signo = SIGTIMER;
+-		ksev.sigev_notify = 4; /* SIGEV_THREAD_ID */
++		ksev.sigev_notify = SIGEV_THREAD_ID;
+ 		ksev.sigev_tid = td->tid;
+ 		if (syscall(SYS_timer_create, clk, &ksev, &timerid) < 0)
+ 			timerid = -1;
diff --git a/srcpkgs/musl/template b/srcpkgs/musl/template
index 5bdc5c48e623..34e6ed4fba6e 100644
--- a/srcpkgs/musl/template
+++ b/srcpkgs/musl/template
@@ -2,7 +2,7 @@
 pkgname=musl
 reverts="1.2.0_1"
 version=1.1.24
-revision=10
+revision=11
 archs="*-musl"
 bootstrap=yes
 build_style=gnu-configure

From 18fab7a0fc25faaa0360e6801a2efe5de8d981e1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 21:01:43 -0700
Subject: [PATCH 08/37] gcc-multilib: update to 12.2.0.

---
 srcpkgs/gcc-multilib/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index fcd25755aa75..df60849babc2 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,16 +3,16 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _majorver="${version%.*}"
-wrksrc=gcc-${version/pre/_pre}
+wrksrc="gcc-${version}"
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel
@@ -71,7 +71,7 @@ do_build() {
 	make ${makejobs}
 }
 do_install() {
-	local _pc_triplet=x86_64-pc-linux-gnu _version=${version%pre1}
+	local _pc_triplet=x86_64-pc-linux-gnu
 	# Install to a tempdir and then only copy relevant files.
 	cd ${wrksrc}
 	make DESTDIR=${wrksrc}/${pkgname}-build install
@@ -81,9 +81,9 @@ do_install() {
 	vmkdir usr/include/c++/${_majorver}/${_triplet}
 	vmkdir usr/lib/gcc/${_triplet}/${_majorver}
 
-	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${_version}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${version}/32 \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_majorver}/
-	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${_version}/${_pc_triplet}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${version}/${_pc_triplet}/32 \
 		${DESTDIR}/usr/include/c++/${_majorver}/${_triplet}
 
 	vinstall ${wrksrc}/host-${_pc_triplet}/gcc/specs 644 usr/lib/gcc/${_triplet}/${_majorver}

From 147715a69aff2b8d15d327e8f1fcc5715b171db0 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Tue, 4 Oct 2022 03:49:13 -0700
Subject: [PATCH 09/37] libgccjit: update to 12.2.0.

---
 srcpkgs/libgccjit/files/libgccjit-musl.patch | 63 --------------------
 srcpkgs/libgccjit/template                   | 38 ++++++------
 2 files changed, 17 insertions(+), 84 deletions(-)
 delete mode 100644 srcpkgs/libgccjit/files/libgccjit-musl.patch

diff --git a/srcpkgs/libgccjit/files/libgccjit-musl.patch b/srcpkgs/libgccjit/files/libgccjit-musl.patch
deleted file mode 100644
index d2ed16928c82..000000000000
--- a/srcpkgs/libgccjit/files/libgccjit-musl.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-diff --git a/gcc/jit/jit-playback.c b/gcc/jit/jit-playback.c
-index 5bccf591a..35f5e35ef 100644
---- a/gcc/jit/jit-playback.c
-+++ b/gcc/jit/jit-playback.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -41,8 +43,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "diagnostic.h"
- #include "stmt.h"
- 
--#include <pthread.h>
--
- #include "jit-playback.h"
- #include "jit-result.h"
- #include "jit-builtins.h"
-diff --git a/gcc/jit/jit-recording.c b/gcc/jit/jit-recording.c
-index a237d574f..5785e3269 100644
---- a/gcc/jit/jit-recording.c
-+++ b/gcc/jit/jit-recording.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -25,8 +27,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "pretty-print.h"
- #include "toplev.h"
- 
--#include <pthread.h>
--
- #include "jit-builtins.h"
- #include "jit-recording.h"
- #include "jit-playback.h"
-diff --git a/gcc/jit/libgccjit.c b/gcc/jit/libgccjit.c
-index f9c33c63c..75f21d275 100644
---- a/gcc/jit/libgccjit.c
-+++ b/gcc/jit/libgccjit.c
-@@ -18,13 +18,13 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
- #include "timevar.h"
- #include "typed-splay-tree.h"
- #include "cppbuiltin.h"
--#include <pthread.h>
- 
- #include "libgccjit.h"
- #include "jit-recording.h"
diff --git a/srcpkgs/libgccjit/template b/srcpkgs/libgccjit/template
index 6f1d6256dcd6..2f2802eaba8b 100644
--- a/srcpkgs/libgccjit/template
+++ b/srcpkgs/libgccjit/template
@@ -3,36 +3,32 @@
 # which use the version number.
 
 pkgname=libgccjit
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
+version=12.2.0
 revision=1
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
-_majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
-wrksrc=gcc-${version/pre/_pre}
+_mpc_version=1.2.1
+_isl_version=0.24
 short_desc="Just-In-Time Compilation library for GCC"
 maintainer="Lane Biocini <lane@mailbox.org>"
 homepage="https://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 nopie=yes
+create_wrksrc=yes
+build_wrksrc="gcc-${version}"
+patch_args="-Np1 --directory=${build_wrksrc}"
 lib32disabled=yes
 makedepends="zlib-devel"
 hostmakedepends="tar texinfo perl flex"
@@ -40,10 +36,10 @@ depends="gcc"
 checkdepends="dejagnu"
 
 post_extract() {
-	mv ${XBPS_BUILDDIR}/gmp-${_gmp_version} ${wrksrc}/gmp
-	mv ${XBPS_BUILDDIR}/mpfr-${_mpfr_version} ${wrksrc}/mpfr
-	mv ${XBPS_BUILDDIR}/mpc-${_mpc_version} ${wrksrc}/mpc
-	mv ${XBPS_BUILDDIR}/isl-${_isl_version} ${wrksrc}/isl
+	mv ${wrksrc}/gmp-${_gmp_version} ${wrksrc}/${build_wrksrc}/gmp
+	mv ${wrksrc}/mpfr-${_mpfr_version} ${wrksrc}/${build_wrksrc}/mpfr
+	mv ${wrksrc}/mpc-${_mpc_version} ${wrksrc}/${build_wrksrc}/mpc
+	mv ${wrksrc}/isl-${_isl_version} ${wrksrc}/${build_wrksrc}/isl
 }
 
 pre_configure() {
@@ -186,7 +182,7 @@ do_configure() {
 	[ -z "$XBPS_CHECK_PKGS" ] && _langs="jit" || _langs="jit,c++"
 	_args+=" --enable-languages=${_langs}"
 	CONFIG_SHELL=/bin/bash \
-		${wrksrc}/configure ${_args}
+		${wrksrc}/${build_wrksrc}/configure ${_args}
 }
 
 do_build() {

From fe6a17eaef52914ccfc6ddd3dfa4801072409365 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 14 Aug 2022 19:29:36 -0700
Subject: [PATCH 10/37] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove -no-pie from build. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..5d40f0cdd8a6 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -53,6 +53,7 @@ _void_cross_build_binutils() {
 		--sbindir=/usr/bin \
 		--libdir=/usr/lib \
 		--libexecdir=/usr/lib \
+		--sysconfdir=/etc \
 		--target=${tgt} \
 		--with-sysroot=/usr/${tgt} \
 		--disable-nls \
@@ -60,7 +61,9 @@ _void_cross_build_binutils() {
 		--disable-multilib \
 		--disable-werror \
 		--disable-gold \
+		--disable-gprofng \
 		--enable-relro \
+		--enable-new-dtags \
 		--enable-plugins \
 		--enable-64-bit-bfd \
 		--enable-deterministic-archives \
@@ -132,6 +135,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -460,6 +464,14 @@ do_build() {
 	local binutils_ver linux_ver gcc_ver libc_ver libucontext_ver
 	local tgt=${sourcepkg/cross-}
 
+	export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}"
+	export CXXFLAGS="${CXXFLAGS/-D_FORTIFY_SOURCE=2/}"
+
+	# Disable explicit -fno-PIE, gcc/binutils/libc will figure this out itself.
+	export CFLAGS="${CFLAGS//-fno-PIE/}"
+	export CXXFLAGS="${CXXFLAGS//-fno-PIE/}"
+	export LDFLAGS="${LDFLAGS//-no-pie/}"
+
 	_void_cross_test_ver binutils
 	_void_cross_test_ver linux
 	_void_cross_test_ver gcc
@@ -625,6 +637,9 @@ do_install() {
 	# then remove it because it conflicts with libquadmath package
 	rm -rf ${DESTDIR}/${sysroot}/usr/lib/libquadmath.*
 
+	# Remove libdep linker plugin because it conflicts with system binutils
+	rm -f ${DESTDIR}/usr/lib/bfd-plugins/libdep*
+
 	# Remove leftover symlinks
 	rm -f ${DESTDIR}/usr/lib${XBPS_TARGET_WORDSIZE}
 	rm -f ${DESTDIR}/lib*

From 036ea68be519b84721bb718f8c9bdbc0f82824fc Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:09:31 -0700
Subject: [PATCH 11/37] linux5.18: update dotconfigs for gcc12

---
 srcpkgs/linux5.18/files/x86_64-dotconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/linux5.18/files/x86_64-dotconfig b/srcpkgs/linux5.18/files/x86_64-dotconfig
index 4e73a3195d40..ea6204868e23 100644
--- a/srcpkgs/linux5.18/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.18/files/x86_64-dotconfig
@@ -512,6 +512,7 @@ CONFIG_RETHUNK=y
 CONFIG_CPU_UNRET_ENTRY=y
 CONFIG_CPU_IBPB_ENTRY=y
 CONFIG_CPU_IBRS_ENTRY=y
+CONFIG_SLS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10060,8 +10061,11 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
 # Memory initialization
 #
 CONFIG_INIT_STACK_NONE=y
+# CONFIG_INIT_STACK_ALL_PATTERN is not set
+# CONFIG_INIT_STACK_ALL_ZERO is not set
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
+# CONFIG_ZERO_CALL_USED_REGS is not set
 # end of Memory initialization
 # end of Kernel hardening options
 # end of Security options
@@ -10538,6 +10542,7 @@ CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
 # CONFIG_UBSAN is not set
 CONFIG_HAVE_ARCH_KCSAN=y
+# CONFIG_KCSAN is not set
 # end of Generic Kernel Debugging Instruments
 
 #

From 18ff200ffcebf362babd12acb41ba5be4d9c87dc Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:08 -0700
Subject: [PATCH 12/37] subversion: fix build for libtool 2.4.7

---
 srcpkgs/subversion/template | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/subversion/template b/srcpkgs/subversion/template
index 18c35e3a2132..0aa41212c5fd 100644
--- a/srcpkgs/subversion/template
+++ b/srcpkgs/subversion/template
@@ -24,6 +24,8 @@ distfiles="http://apache.uvigo.es/subversion/subversion-${version}.tar.bz2"
 checksum=c9130e8d0b75728a66f0e7038fc77052e671830d785b5616aad53b4810d3cc28
 
 pre_configure() {
+	./autogen.sh --release
+
 	# Based on native build values
 	cat <<-EOF >config.cache
 	ac_cv_python_includes=-I${XBPS_CROSS_BASE}/usr/include/python${py3_ver}
@@ -59,7 +61,12 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+
+	if [ "$XBPS_BUILD_ENVIRONMENT" = "void-packages-ci" ]; then
+		# This test will fail when run as the root user,
+		# because flock() will ignore file permissions.
+		vsed -i subversion/tests/libsvn_fs/locks-test.c -e '/SVN_TEST_OPTS_PASS(obtain_write_lock_failure,/,+3d'
+	fi
 }
 
 post_configure() {

From 53bcf3f73d690b76c5541ac5190a3d0b5b3a9e20 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:38 -0700
Subject: [PATCH 13/37] subversion-kwallet-auth: update to 1.14.2.

Fix failing distfiles.
Fix build for libtool 2.4.7
---
 srcpkgs/subversion-kwallet-auth/template | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/subversion-kwallet-auth/template b/srcpkgs/subversion-kwallet-auth/template
index 12210f250d51..9cc68c3fe5f1 100644
--- a/srcpkgs/subversion-kwallet-auth/template
+++ b/srcpkgs/subversion-kwallet-auth/template
@@ -3,7 +3,7 @@
 # THIS PKG MUST BE SYNCHRONIZED WITH "srcpkgs/subversion".
 #
 pkgname=subversion-kwallet-auth
-version=1.14.1
+version=1.14.2
 revision=1
 wrksrc="subversion-${version}"
 build_style=gnu-configure
@@ -22,10 +22,12 @@ license="Apache-2.0, BSD-3-Clause"
 homepage="http://subversion.apache.org/"
 changelog="https://subversion.apache.org/docs/release-notes/${version%.*}.html"
 distfiles="http://apache.uvigo.es/subversion/subversion-${version}.tar.bz2"
-checksum=2c5da93c255d2e5569fa91d92457fdb65396b0666fad4fd59b22e154d986e1a9
+checksum=c9130e8d0b75728a66f0e7038fc77052e671830d785b5616aad53b4810d3cc28
 lib32disabled=yes
 
 pre_configure() {
+	./autogen.sh --release
+
 	# Based on native build values
 	cat <<-EOF >config.cache
 	ac_cv_python_includes=-I${XBPS_CROSS_BASE}/usr/include/python${py3_ver}
@@ -55,11 +57,18 @@ pre_configure() {
 		cp "$XBPS_CROSS_BASE/usr/lib/perl5/core_perl/Config"*.p? $PERL5LIB
 		cp "$XBPS_CROSS_BASE/usr/lib/perl5/core_perl/Errno.pm" $PERL5LIB
 		vsed -e "s;archlibexp => '\(.*\)';archlibexp => '${XBPS_CROSS_BASE}\1';" \
-			-i $PERL5LIB/Config.pm $PERL5LIB/Config_heavy.pl
+			-i $PERL5LIB/Config.pm
+		vsed -e "s;archlibexp='\(.*\)';archlibexp='${XBPS_CROSS_BASE}\1';" \
+			-i $PERL5LIB/Config_heavy.pl
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+
+	if [ "$XBPS_BUILD_ENVIRONMENT" = "void-packages-ci" ]; then
+		# This test will fail when run as the root user,
+		# because flock() will ignore file permissions.
+		vsed -i subversion/tests/libsvn_fs/locks-test.c -e '/SVN_TEST_OPTS_PASS(obtain_write_lock_failure,/,+3d'
+	fi
 }
 
 post_configure() {

From ff6f2ce88511fba135d2bf14ec1a728188068a04 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 14/37] cross-aarch64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..bd6b23f9fb6a 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 1261b85140669b13cd4c012afe12f4a8c625a9fe Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 15/37] cross-aarch64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..427ad2c1e9cd 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From a4baec08759561d643e3388b556025696953acc6 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 16/37] cross-arm-linux-gnueabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..2510ee26e789 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 563c8a6eec7f12ab691f203596c1e92962103fa5 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 17/37] cross-arm-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..bd8b16e1b4c1 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From e8c7567ec463f571f1153e06140c91ec457d740a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 18/37] cross-arm-linux-musleabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..dacfd2655216 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 16e31b8877edd6edfa4fbcc094b3955c6f7b409a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 19/37] cross-arm-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..9ddd32a9f20d 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From e7edae72c849029caedadd2b59b8167f18090dc9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 20/37] cross-armv7l-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..9fb00f18be3b 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From c3bbdb43cd2069bccdf31088d5950320e2efbaf8 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 21/37] cross-armv7l-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..2c72e75ddfe3 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From e37b5fe879cafbdfb692c650ab360a6457c3688d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 22/37] cross-i686-pc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..4dc17df648b5 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 656cd641a1b1faa505ea0bfd8cc885bd31fe2433 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Fri, 16 Sep 2022 20:52:19 -0700
Subject: [PATCH 23/37] cross-i686-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-linux-musl/template b/srcpkgs/cross-i686-linux-musl/template
index 8be16a230d8d..78b4d813a113 100644
--- a/srcpkgs/cross-i686-linux-musl/template
+++ b/srcpkgs/cross-i686-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-i686-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-i686-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 48bac21b0205dc06087f15acced828fcc83b3035 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 24/37] cross-mips-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..6009e5c79eb2 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 718c6e2f418b51a821d15f921c1c8107a056ea52 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 25/37] cross-mips-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..080164df193d 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="hipperson0 <hipperson0@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From e30f6ae4ad46c36bf4716a2429d655bae712a088 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 26/37] cross-mipsel-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..f9fd4b8a04ef 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From e6127c1c3be29dd60883b9f90fb5b8075cd022da Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 27/37] cross-mipsel-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..7418a984474b 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 6fbafadcc734913393ea4c0e96ecfe2cef0bc263 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 28/37] cross-powerpc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..31e57b4e52b2 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 4e7117ba487a49a376719b2dc464ed697d8034aa Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 29/37] cross-powerpc-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..a2d1edcf1ffd 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 4f82e1c8fa1e4800b43face8f10e9eed13b93566 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 30/37] cross-powerpc64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..1a4cbed61e76 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 27cbc24ec7db2eb7120ac0c920cf751f284bf4af Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 31/37] cross-powerpc64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 016f18776a6d..19b1ff859eb6 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 588eff453bfe2478951b1357d7f23373ccaccc3a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 32/37] cross-powerpc64le-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 463d7e92d20d..9d99a3a315d2 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 0d5dc053e3e0d745822e70650fe895d3723d3b28 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 33/37] cross-powerpc64le-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index c17a3cccfe29..3128baa7372e 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 9250784b03f2af560d33d3a2f7d8d5bae8cbac41 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 34/37] cross-powerpcle-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 9aede3c465ce..0462a1015a1a 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 
@@ -35,6 +35,8 @@ if [ "$XBPS_TARGET_MACHINE" = "ppcle" ]; then
 	broken="Can't build crosstoolchain to itself"
 fi
 
+broken="glibc uses big-endian specific instructions on 32-bit powerpc"
+
 cross-powerpcle-linux-gnu-libc_package() {
 	short_desc+=" - glibc files"
 	nostrip=yes

From b9855ff5f9c8d1e491454113425b48224c96404e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 35/37] cross-powerpcle-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index 045cfda987fe..20e70bed4c60 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From df64fd7b43c3487ae2ef53f66e07482c8f38d0a1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 36/37] cross-x86_64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 8918f3c22a1c..5219cd50f851 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 1577cf07e3414fd08e1da03bb66b54d93169981a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 37/37] cross-x86_64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..2811de0d3c2e 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (179 preceding siblings ...)
  2022-10-10  5:10 ` oreo639
@ 2022-10-13 18:49 ` Johnnynator
  2022-10-13 19:02 ` oreo639
                   ` (83 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: Johnnynator @ 2022-10-13 18:49 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 493 bytes --]

New comment by Johnnynator on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1278039701

Comment:
We probably should include a patch for glibc 2.36 to restore DT_HASH, so we do not break certain "Epic" anti cheat or potentially some other games that might need it. See: https://github.com/ValveSoftware/Proton/issues/6051

https://git.launchpad.net/ubuntu/+source/glibc/plain/debian/patches/restore-libc-DT_HASH.patch?h=ubuntu/kinetic-proposed

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (180 preceding siblings ...)
  2022-10-13 18:49 ` Johnnynator
@ 2022-10-13 19:02 ` oreo639
  2022-10-13 19:02 ` oreo639
                   ` (82 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-10-13 19:02 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 698 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1278053460

Comment:
I tried a free EAC game that was reported to work with Linux (Multiversus) and I couldn't get it to work on glibc 2.32, or on glibc 2.36 with or without that patch. Are you able to confirm any EAC games work on Void with glibc 2.32 that will be broken by updating to glibc 2.36, otherwise I don't see the point in working around a bug for an anticheat that doesn't even support Void?

As for the other two potential breakages, libstrangle isn't shipped in our repos and I don't see the point in patching this indefinitely just for possibly Shovel Knight?

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (181 preceding siblings ...)
  2022-10-13 19:02 ` oreo639
@ 2022-10-13 19:02 ` oreo639
  2022-10-13 19:04 ` oreo639
                   ` (81 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-10-13 19:02 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 718 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1278053460

Comment:
I tried a free EAC game that was reported to work with Linux (Multiversus) and I couldn't get it to work on glibc 2.32, or on glibc 2.36 with or without that patch. I will ask again, is anyone able to confirm any EAC games work on Void with glibc 2.32 that will be broken by updating to glibc 2.36, otherwise I don't see the point in working around a bug for an anticheat that doesn't even support Void?

As for the other two potential breakages, libstrangle isn't shipped in our repos and I don't see the point in patching this indefinitely just for possibly Shovel Knight?

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (182 preceding siblings ...)
  2022-10-13 19:02 ` oreo639
@ 2022-10-13 19:04 ` oreo639
  2022-10-13 19:28 ` oreo639
                   ` (80 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-10-13 19:04 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 718 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1278053460

Comment:
I tried a free EAC game that was reported to work with Linux (Multiversus) and I couldn't get it to work on glibc 2.32, or on glibc 2.36 with or without that patch. I will ask again, is anyone able to confirm any EAC games work on Void with glibc 2.32 that will be broken by updating to glibc 2.36? Otherwise I don't see the point in working around a bug for an anticheat that doesn't even support Void.

As for the other two potential breakages, libstrangle isn't shipped in our repos and I don't see the point in patching this indefinitely just for possibly Shovel Knight?

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (183 preceding siblings ...)
  2022-10-13 19:04 ` oreo639
@ 2022-10-13 19:28 ` oreo639
  2022-10-13 19:28 ` oreo639
                   ` (79 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-10-13 19:28 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 745 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1278053460

Comment:
I tried a free EAC game that was reported to work with Linux (Multiversus) and I couldn't get it to work on glibc 2.32, or on glibc 2.36 with or without that patch. I will ask again, is anyone able to confirm any EAC games work on Void with glibc 2.32 that will be broken by updating to glibc 2.36? If you can, please say so, otherwise I don't see the point in working around a bug for an anticheat that doesn't even support Void.

As for the other two potential breakages, libstrangle isn't shipped in our repos and I don't see the point in patching this indefinitely just for possibly Shovel Knight?

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (184 preceding siblings ...)
  2022-10-13 19:28 ` oreo639
@ 2022-10-13 19:28 ` oreo639
  2022-10-13 19:28 ` oreo639
                   ` (78 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-10-13 19:28 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 745 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1278053460

Comment:
I tried a free EAC game that was reported to work with Linux (Multiversus) and I couldn't get it to work on glibc 2.32, or on glibc 2.36 with or without that patch. I will ask again, is anyone able to confirm any EAC games work on Void with glibc 2.32 that will be broken by updating to glibc 2.36? If you can, please say so. Otherwise I don't see the point in working around a bug for an anticheat that doesn't even support Void.

As for the other two potential breakages, libstrangle isn't shipped in our repos and I don't see the point in patching this indefinitely just for possibly Shovel Knight?

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (185 preceding siblings ...)
  2022-10-13 19:28 ` oreo639
@ 2022-10-13 19:28 ` oreo639
  2022-10-13 19:29 ` oreo639
                   ` (77 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-10-13 19:28 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 718 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1278053460

Comment:
I tried a free EAC game that was reported to work with Linux (Multiversus) and I couldn't get it to work on glibc 2.32, or on glibc 2.36 with or without that patch. I will ask again, is anyone able to confirm any EAC games work on Void with glibc 2.32 that will be broken by updating to glibc 2.36? Otherwise I don't see the point in working around a bug for an anticheat that doesn't even support Void.

As for the other two potential breakages, libstrangle isn't shipped in our repos and I don't see the point in patching this indefinitely just for possibly Shovel Knight?

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (186 preceding siblings ...)
  2022-10-13 19:28 ` oreo639
@ 2022-10-13 19:29 ` oreo639
  2022-10-13 19:47 ` oreo639
                   ` (76 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-10-13 19:29 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 774 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1278053460

Comment:
I tried a free EAC game that was reported to work with Linux (Multiversus) and I couldn't get it to work on glibc 2.32, or on glibc 2.36 with or without that patch. I will ask again, is anyone able to confirm any EAC games work on Void with glibc 2.32 that will be broken by updating to glibc 2.36? (or can anyone confirm that any EAC games run on Void?) Otherwise I don't see the point in working around a bug for an anticheat that doesn't even support Void.

As for the other two potential breakages, libstrangle isn't shipped in our repos and I don't see the point in patching this indefinitely just for possibly Shovel Knight?

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (187 preceding siblings ...)
  2022-10-13 19:29 ` oreo639
@ 2022-10-13 19:47 ` oreo639
  2022-10-13 20:02 ` toukoAMG
                   ` (75 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-10-13 19:47 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 756 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1278053460

Comment:
I tried a free EAC game that was reported to work with Linux (Multiversus) and I couldn't get it to work on glibc 2.32, or on glibc 2.36 with or without that patch. Is anyone able to confirm any EAC games work on Void with glibc 2.32 that will be broken by updating to glibc 2.36? (or can anyone confirm that any EAC games run on Void?) Otherwise I don't see the point in working around a bug for an anticheat that doesn't even support Void.

As for the other two potential breakages, libstrangle isn't shipped in our repos and I don't see the point in patching this indefinitely just for possibly Shovel Knight?

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (188 preceding siblings ...)
  2022-10-13 19:47 ` oreo639
@ 2022-10-13 20:02 ` toukoAMG
  2022-10-13 20:28 ` TeusLollo
                   ` (74 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: toukoAMG @ 2022-10-13 20:02 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 204 bytes --]

New comment by toukoAMG on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1278117823

Comment:
For me, fall guys under Heroic games launcher with EAC works.

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (189 preceding siblings ...)
  2022-10-13 20:02 ` toukoAMG
@ 2022-10-13 20:28 ` TeusLollo
  2022-10-13 20:32 ` TeusLollo
                   ` (73 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: TeusLollo @ 2022-10-13 20:28 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 3182 bytes --]

New comment by TeusLollo on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1278144921

Comment:
We should notice that the guys at Proton say to utilize Flatpak, if EAC is the only concern, which seems confirmed to be working well:

https://github.com/ValveSoftware/Proton/issues/6051#issuecomment-1204399354

Also, some stuff about the DT_HASH stuff worth mentioning:

_Did glibc 2.36 need a release note about dropped -Wl,--hash-style=both? Game users affected by the problem might argue that this was a high profile change and a deprecation or warning notice was needed. I disagree.
I beg that you read Carlos's summary. DT_HASH is a protocol between a linker and a dynamic loader. It is not intended to be consumed by a random non-standard ELF consumer. In addition, 16 years have been sufficiently long for any non-standard ELF consumer to know that DT_HASH has been mostly eliminated from Linux distributions. The glibc change removed one remnant DT_HASH use. It really was not as impactful as other changes in glibc 2.36._

_Is_ _DT_HASH_ _optional in the generic ABI?_

_If one reads much from the generic ABI wording, it says "mandatory", and therefore it is not optional. Does this make sense?_

_Technically a dynamic loader does not need a hash table to perform symbol lookup. It can start at the dynamic symbol table beginning specified by DT_SYMTAB, and scan to the end. Wait, in the absence of DT_HASH (DT_GNU_HASH is an extension, we want a way without an extension), there is no reliable way to get the number of dynamic symbol table entries. I tend to think this is outside of the generic ABI's business to require something. An ELF object can freely use an extension to provide the information. Specifying things in such a verbatim way is not ELF's spirit. Michael Matz disagrees in a [reply](https://groups.google.com/g/generic-abi/c/th5919osPAQ/m/uGSA05KIAgAJ) to "Making DT_HASH optional?"._

Source : https://maskray.me/blog/2022-08-21-glibc-and-dt-gnu-hash

I don't know about restoring something that appears to be closer to an ABI detail/extension, not even a proper component, that has been **16 YEARS** in deprecation. 

Are there security/performance concerns by proceeding with such a restoration? 
Is it even worth the hassle, since it's only relevant for a few entertainment products, for which a workaround also exists?
Why hasn't EAC been updated by those who should update it after several weeks, and why such responsibilities should otherwise fall upon distro maintainers?

Worth also noting that if EAC is not updated, Proton devs may eventually produce some other workaround themselves, as they do with most stuff anyway. 

Worth also noting that things appear to work for some, as confirmed by a recent comment, hence EAC is only broken in some specific situations:
https://github.com/void-linux/void-packages/pull/34902#issuecomment-1278117823

At the very least it should be examined what Arch devs are doing, if any problems are propping up, and for how long they are considering to proceed with such restorations (I doubt they'll do this for infinity and beyond). 

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (190 preceding siblings ...)
  2022-10-13 20:28 ` TeusLollo
@ 2022-10-13 20:32 ` TeusLollo
  2022-10-13 22:44 ` oreo639
                   ` (72 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: TeusLollo @ 2022-10-13 20:32 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 3172 bytes --]

New comment by TeusLollo on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1278144921

Comment:
We should notice that the guys at Proton say to utilize Flatpak, if EAC is the only concern, which seems confirmed to be working well:

https://github.com/ValveSoftware/Proton/issues/6051#issuecomment-1204399354

Also, some stuff about DT_HASH worth mentioning:

_Did glibc 2.36 need a release note about dropped -Wl,--hash-style=both? Game users affected by the problem might argue that this was a high profile change and a deprecation or warning notice was needed. I disagree.
I beg that you read Carlos's summary. DT_HASH is a protocol between a linker and a dynamic loader. It is not intended to be consumed by a random non-standard ELF consumer. In addition, 16 years have been sufficiently long for any non-standard ELF consumer to know that DT_HASH has been mostly eliminated from Linux distributions. The glibc change removed one remnant DT_HASH use. It really was not as impactful as other changes in glibc 2.36._

_Is_ _DT_HASH_ _optional in the generic ABI?_

_If one reads much from the generic ABI wording, it says "mandatory", and therefore it is not optional. Does this make sense?_

_Technically a dynamic loader does not need a hash table to perform symbol lookup. It can start at the dynamic symbol table beginning specified by DT_SYMTAB, and scan to the end. Wait, in the absence of DT_HASH (DT_GNU_HASH is an extension, we want a way without an extension), there is no reliable way to get the number of dynamic symbol table entries. I tend to think this is outside of the generic ABI's business to require something. An ELF object can freely use an extension to provide the information. Specifying things in such a verbatim way is not ELF's spirit. Michael Matz disagrees in a [reply](https://groups.google.com/g/generic-abi/c/th5919osPAQ/m/uGSA05KIAgAJ) to "Making DT_HASH optional?"._

Source : https://maskray.me/blog/2022-08-21-glibc-and-dt-gnu-hash

I don't know about restoring something that appears to be closer to an ABI detail/extension, not even a proper component, that has been **16 YEARS** in deprecation. 

Are there security/performance concerns by proceeding with such a restoration? 
Is it even worth the hassle, since it's only relevant for a few entertainment products, for which a workaround also exists?
Why hasn't EAC been updated by those who should update it after several weeks, and why such responsibilities should otherwise fall upon distro maintainers?

Worth also noting that if EAC is not updated, Proton devs may eventually produce some other workaround themselves, as they do with most stuff anyway. 

Worth also noting that things appear to work for some, as confirmed by a recent comment, hence EAC is only broken in some specific situations:
https://github.com/void-linux/void-packages/pull/34902#issuecomment-1278117823

At the very least it should be examined what Arch devs are doing, if any problems are propping up, and for how long they are considering to proceed with such restorations (I doubt they'll do this for infinity and beyond). 

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (191 preceding siblings ...)
  2022-10-13 20:32 ` TeusLollo
@ 2022-10-13 22:44 ` oreo639
  2022-10-13 22:49 ` oreo639
                   ` (71 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-10-13 22:44 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 230 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1278254698

Comment:
> For me, fall guys under Heroic games launcher with EAC works.

Is this with flatpak?

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (192 preceding siblings ...)
  2022-10-13 22:44 ` oreo639
@ 2022-10-13 22:49 ` oreo639
  2022-10-14  3:18 ` oreo639
                   ` (70 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-10-13 22:49 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 304 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1278254698

Comment:
> For me, fall guys under Heroic games launcher with EAC works.

Is this through flatpak or something else? (flatpak has its own separate environment from Void)

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (193 preceding siblings ...)
  2022-10-13 22:49 ` oreo639
@ 2022-10-14  3:18 ` oreo639
  2022-10-14  4:01 ` [PR PATCH] [Updated] " oreo639
                   ` (69 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-10-14  3:18 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 782 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1278053460

Comment:
I tried a free EAC game that was reported to work with Linux (Multiversus) and I couldn't get it to work on glibc 2.32, or on glibc 2.36 with or without that patch.

As for the other two potential breakages, libstrangle isn't shipped in our repos and I don't see the point in patching this indefinitely just for possibly Shovel Knight?

Is anyone able to confirm any EAC games work on Void with glibc 2.32 that will be broken by updating to glibc 2.36? (or can anyone confirm that any EAC games run on Void, not including flatpak?) Otherwise I don't see the point in working around a bug for an anticheat that doesn't even support Void.

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (194 preceding siblings ...)
  2022-10-14  3:18 ` oreo639
@ 2022-10-14  4:01 ` oreo639
  2022-10-14  4:08 ` oreo639
                   ` (68 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-10-14  4:01 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5478 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.2.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.2.0

There is a list of failing builds here: https://github.com/void-linux/void-packages/issues/39809

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [x] llvm https://github.com/void-linux/void-packages/pull/38694
- [x] m4 https://github.com/void-linux/void-packages/pull/33730
- [x] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [x] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [x] libvirt https://github.com/void-linux/void-packages/pull/38842
- [x] syslinux https://github.com/void-linux/void-packages/pull/38876
- [x] efivar https://github.com/void-linux/void-packages/pull/38874
- [ ] gpgme https://github.com/void-linux/void-packages/pull/38825

Known packages that needed to be fixed/updated for gcc12:
- [ ] linux5.18 (in this PR)
- [x] openssh https://github.com/void-linux/void-packages/pull/38849
- [x] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [x] doxygen https://github.com/void-linux/void-packages/pull/38846
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] libproxy https://github.com/void-linux/void-packages/pull/38818
- [x] exempi https://github.com/void-linux/void-packages/pull/38820
- [x] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [x] libunique1 https://github.com/void-linux/void-packages/pull/38848 or https://github.com/void-linux/void-packages/pull/38873
- [x] libwpd https://github.com/void-linux/void-packages/pull/38878
- [x] cglm https://github.com/void-linux/void-packages/pull/39748
- [x] coreboot-utils https://github.com/void-linux/void-packages/pull/39749
- [x] apl https://github.com/void-linux/void-packages/pull/39750
- [x] igt-gpu-tools https://github.com/void-linux/void-packages/pull/39780

Needs to be fixed/updated for binutils:
- [x] grub https://github.com/void-linux/void-packages/pull/38875
- [x] linux-tools https://github.com/void-linux/void-packages/pull/38877
- [x] kcov https://github.com/void-linux/void-packages/pull/39291

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [x] kde
- [x] lxde
- [x] lxqt

You can test the ISOs here:
https://drive.google.com/drive/folders/1ix92CYSLUP-KWjLxltdgG4e8Nu2JCY5n?usp=sharing

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 131236 bytes --]

From 702dc0a3467d60d629616d4653a1efbb5aded05c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 01/37] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../fix-libcollector-without-java.patch       | 53 +++++++++++++++
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 25 ++++---
 4 files changed, 87 insertions(+), 117 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
 create mode 100644 srcpkgs/binutils/patches/fix-libcollector-without-java.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/fix-libcollector-without-java.patch b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
new file mode 100644
index 000000000000..54384875f358
--- /dev/null
+++ b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
@@ -0,0 +1,53 @@
+From 49ddd814ac1071af7c4f45d5f8398b91862f2c7f Mon Sep 17 00:00:00 2001
+From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
+Date: Wed, 17 Aug 2022 19:55:23 -0700
+Subject: [PATCH] gprofng: fix bug 29479 Collection fails when built without
+ java support
+
+gprofng/ChangeLog
+2022-08-17  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>
+
+	PR gprofng/29479
+	* libcollector/collector.c: Add #if defined(GPROFNG_JAVA_PROFILING) for
+	java specific code.
+	* libcollector/unwind.c: Likewise.
+---
+ gprofng/libcollector/collector.c | 2 ++
+ gprofng/libcollector/unwind.c    | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/gprofng/libcollector/collector.c b/gprofng/libcollector/collector.c
+index 93c9d3330de5..ceff2c1caccb 100644
+--- a/gprofng/libcollector/collector.c
++++ b/gprofng/libcollector/collector.c
+@@ -913,8 +913,10 @@ __collector_open_experiment (const char *exp, const char *params, sp_origin_t or
+   __collector_ext_unwind_key_init (1, NULL);
+ 
+   /* start java attach if suitable */
++#if defined(GPROFNG_JAVA_PROFILING)
+   if (exp_origin == SP_ORIGIN_DBX_ATTACH)
+     __collector_jprofile_start_attach ();
++#endif
+   start_sec_time = CALL_UTIL (time)(NULL);
+   __collector_start_time = collector_interface.getHiResTime ();
+   TprintfT (DBG_LT0, "\t__collector_open_experiment; resetting start_time\n");
+diff --git a/gprofng/libcollector/unwind.c b/gprofng/libcollector/unwind.c
+index 119243788020..f8e11823c81e 100644
+--- a/gprofng/libcollector/unwind.c
++++ b/gprofng/libcollector/unwind.c
+@@ -557,6 +557,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+   int size = max_frame_size;
+ 
+ #define MIN(a,b) ((a)<(b)?(a):(b))
++#if defined(GPROFNG_JAVA_PROFILING)
+   /* get Java info */
+   if (__collector_java_mode && __collector_java_asyncgetcalltrace_loaded && context && !pseudo_context)
+     {
+@@ -569,6 +570,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+ 	  size -= sz;
+ 	}
+     }
++#endif
+ 
+   /* get native stack */
+   if (context)
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..c355a5fc8016 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkgconf"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -35,15 +36,21 @@ do_configure() {
 	local conf
 
 	if [ "$CHROOT_READY" ]; then
-		conf+=" --with-debuginfod"
+		conf+=" --with-debuginfod --enable-shared"
 	else
-		conf+=" --without-debuginfod --disable-install-libbfd"
+		conf+=" --without-debuginfod --disable-shared --disable-install-libbfd"
 	fi
 	if [ "$CROSS_BUILD" ]; then
 		# we don't want --with-sysroot=${XBPS_CROSS_BASE} like gnu-configure
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	# gprofng currently only supports x86 and aarch64 glibc.
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64|i386|aarch64) conf+=" --enable-gprofng" ;;
+		*) conf+=" --disable-gprofng" ;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"
@@ -76,13 +83,14 @@ do_configure() {
 		--libdir=/usr/lib \
 		--mandir=/usr/share/man \
 		--infodir=/usr/share/info \
+		--sysconfdir=/etc \
 		--disable-werror \
-		--disable-shared \
 		--disable-nls \
 		--enable-threads \
 		--enable-plugins \
 		--enable-relro \
 		--enable-gold \
+		--enable-new-dtags \
 		--enable-deterministic-archives \
 		--enable-64-bit-bfd \
 		--enable-ld=default \
@@ -142,7 +150,8 @@ binutils-devel_package() {
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/*.a"
-		vmove "usr/lib/*.so"
+		vmove "usr/lib/libbfd.so"
+		vmove "usr/lib/libopcodes.so"
 	}
 }
 

From 70f450d8dd2903a2a59a9f7ad86f1663f4a26062 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 2 Oct 2022 16:46:59 -0700
Subject: [PATCH 02/37] gdb: resolve conflict with binutils 2.39

---
 srcpkgs/gdb/template | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/gdb/template b/srcpkgs/gdb/template
index ff7c9d9a5911..5970402eb27e 100644
--- a/srcpkgs/gdb/template
+++ b/srcpkgs/gdb/template
@@ -1,7 +1,7 @@
 # Template file for 'gdb'
 pkgname=gdb
 version=12.1
-revision=1
+revision=2
 build_style=gnu-configure
 pycompile_dirs="/usr/share/gdb/python"
 configure_args="--disable-werror --disable-nls --with-system-readline
@@ -48,7 +48,8 @@ vopt_conflict debuginfod static
 
 post_install() {
 	# resolve conflicts with binutils
-	rm -r ${DESTDIR}/usr/{include,lib,share/info/bfd.info*}
+	rm -rf ${DESTDIR}/usr/{include,lib}
+	rm -rf ${DESTDIR}/usr/share/info/{bfd,ctf-spec}.info*
 }
 
 gdb-common_package() {

From de9fa664bcc94d45f313e8d9d81b5138091076cb Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 03/37] gcc: update to 12.2.0.

---
 common/shlibs                                 |  10 +-
 srcpkgs/gcc/files/gccgo-musl.patch            |  71 ++-------
 srcpkgs/gcc/files/libgnarl-musl.patch         |  18 +--
 srcpkgs/gcc/files/libssp-musl.patch           |  10 +-
 srcpkgs/gcc/patches/libffi_gnulinux.patch     |  11 --
 .../gcc/patches/libgcc-ibm128-no-tag.patch    |  10 +-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |   2 +-
 srcpkgs/gcc/template                          | 136 +++++++++---------
 8 files changed, 105 insertions(+), 163 deletions(-)
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index fe70a5765f50..46050bf2d74c 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.2.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.36 perl-5.36.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -847,8 +847,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.2.0_1
+libgnat-12.so libada-12.2.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1698,8 +1698,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.2.0_1
+libasan.so.8 libsanitizer-12.2.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..12ec68dd8aa3 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,14 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ b/libgo/go/runtime/os_linux.go
+@@ -365,7 +365,7 @@ func setThreadCPUProfiler(hz int32) {
+ 	var sevp _sigevent
+ 	sevp.sigev_notify = _SIGEV_THREAD_ID
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.__sev_fields))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..9410a4654060 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,37 +3,35 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
+version=12.2.0
+revision=1
+_minorver="${version%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
-wrksrc=gcc-${version/pre/_pre}
+_mpc_version=1.2.1
+_isl_version=0.24
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
+create_wrksrc=yes
+build_wrksrc="gcc-${version}"
+patch_args="-Np1 --directory=${build_wrksrc}"
 lib32disabled=yes
 bootstrap=yes
 replaces="gcc-gcj<7.2.0 gcc-gcj-jdk-compat<7.2.0 libmpx>=0 libmpx-devel>=0"
@@ -52,8 +50,11 @@ if [ "$CHROOT_READY" ]; then
 	hostmakedepends="tar texinfo perl flex"
 else
 	_have_gccgo=no
+	# libzstd fails to link in bootstrap with glibc 2.36
+	# when zlib has been compiled with glibc 2.32.
+	LDFLAGS="-lzstd -pthread"
 fi
-makedepends="zlib-devel"
+makedepends="zlib-devel libzstd-devel"
 depends="binutils libgcc-devel-${version}_${revision}
  libstdc++-devel-${version}_${revision} libssp-devel-${version}_${revision}"
 checkdepends="dejagnu"
@@ -70,13 +71,13 @@ if [ "$build_option_gnatboot" ]; then
 	case "$XBPS_TARGET_MACHINE" in
 	x86_64)
 		_gnat_tarball="gnat-gpl-2017-x86_64-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/591c6d80c7a447af2deed1d7>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/9682e2e1f2f232ce03fe21d77b14c37a0de5649b?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" b942bcac20dea39748b39f8b624d9619f60a8dee2e8195dbe3829c835b0956e6"
 		build_options_default="gnatboot"
 		;;
 	i686)
 		_gnat_tarball="gnat-gpl-2014-x86-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/564b3e9dc8e196b040fbe248>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/c5e9e6fdff5cb77ed90cf8c62536653e27c0bed6?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" 3b693510f5d22a240abb3034934c1adbd80ccd6e4f61a4f491cc408fdfd9c042"
 		build_options_default="gnatboot"
 		;;
@@ -155,25 +156,24 @@ if [ "$CROSS_BUILD" ]; then
 fi
 
 post_extract() {
-	mkdir -p ${wrksrc}/{gmp,mpfr,mpc,isl}
-	cp -ar ${XBPS_BUILDDIR}/gmp-${_gmp_version}/* ${wrksrc}/gmp/
-	cp -ar ${XBPS_BUILDDIR}/mpfr-${_mpfr_version}/* ${wrksrc}/mpfr/
-	cp -ar ${XBPS_BUILDDIR}/mpc-${_mpc_version}/* ${wrksrc}/mpc/
-	cp -ar ${XBPS_BUILDDIR}/isl-${_isl_version}/* ${wrksrc}/isl/
+	ln -s ${wrksrc}/gmp-${_gmp_version} ${wrksrc}/${build_wrksrc}/gmp
+	ln -s ${wrksrc}/mpfr-${_mpfr_version} ${wrksrc}/${build_wrksrc}/mpfr
+	ln -s ${wrksrc}/mpc-${_mpc_version} ${wrksrc}/${build_wrksrc}/mpc
+	ln -s ${wrksrc}/isl-${_isl_version} ${wrksrc}/${build_wrksrc}/isl
 
 	if [ "$build_option_gnatboot" ]; then
 		local f="${XBPS_SRCDISTDIR}/${pkgname}-${version}/${_gnat_tarball}"
 		msg_normal "Extracting ${_gnat_tarball} ...\n"
-		mkdir -p ${wrksrc}/gnat-ins
-		tar -x -f "$f" --strip-components=1 -C ${wrksrc}/gnat-ins
-		cd ${wrksrc}/gnat-ins
-		make ins-all prefix=${wrksrc}/gnat
-		cd ${wrksrc}
-		rm -rf ${wrksrc}/gnat-ins
+		mkdir -p ${wrksrc}/${build_wrksrc}/gnat-ins
+		tar -x -f "$f" --strip-components=1 -C ${wrksrc}/${build_wrksrc}/gnat-ins
+		cd ${wrksrc}/${build_wrksrc}/gnat-ins
+		make ins-all prefix=${wrksrc}/${build_wrksrc}/gnat
+		cd ${wrksrc}/${build_wrksrc}
+		rm -rf ${wrksrc}/${build_wrksrc}/gnat-ins
 
 		# Rename obsolete ld and as
-		find ${wrksrc}/gnat -name ld -exec mv -v {} {}.old \;
-		find ${wrksrc}/gnat -name as -exec mv -v {} {}.old \;
+		find ${wrksrc}/${build_wrksrc}/gnat -name ld -exec mv -v {} {}.old \;
+		find ${wrksrc}/${build_wrksrc}/gnat -name as -exec mv -v {} {}.old \;
 	fi
 }
 
@@ -185,9 +185,9 @@ pre_configure() {
 	sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
 
 	if [ "$XBPS_TARGET_LIBC" = musl ]; then
-		patch -p1 -i ${FILESDIR}/libgnarl-musl.patch
-		patch -p1 -i ${FILESDIR}/libssp-musl.patch
-		patch -p1 -i ${FILESDIR}/gccgo-musl.patch
+		for p in ${FILESDIR}/*-musl.patch; do
+			patch -p1 -i $p
+		done
 	fi
 }
 do_configure() {
@@ -297,19 +297,19 @@ do_configure() {
 		_args+=" --enable-languages=${_langs},ada"
 		_args+=" --enable-libada"
 		CONFIG_SHELL=/bin/bash \
-		CC="${wrksrc}/gnat/bin/gcc" \
-		GNATBIND="${wrksrc}/gnat/bin/gnatbind" \
-		GNATMAKE="${wrksrc}/gnat/bin/gnatmake" \
-		PATH="${wrksrc}/gnat/bin:$PATH" \
-			${wrksrc}/configure ${_args}
+		CC="${wrksrc}/${build_wrksrc}/gnat/bin/gcc" \
+		GNATBIND="${wrksrc}/${build_wrksrc}/gnat/bin/gnatbind" \
+		GNATMAKE="${wrksrc}/${build_wrksrc}/gnat/bin/gnatmake" \
+		PATH="${wrksrc}/${build_wrksrc}/gnat/bin:$PATH" \
+			${wrksrc}/${build_wrksrc}/configure ${_args}
 	elif [ "$build_option_ada" ]; then
 		_args+=" --enable-languages=${_langs},ada"
 		CONFIG_SHELL=/bin/bash \
-			${wrksrc}/configure ${_args}
+			${wrksrc}/${build_wrksrc}/configure ${_args}
 	else
 		_args+=" --enable-languages=${_langs}"
 		CONFIG_SHELL=/bin/bash \
-			${wrksrc}/configure ${_args}
+			${wrksrc}/${build_wrksrc}/configure ${_args}
 	fi
 }
 do_build() {
@@ -318,10 +318,10 @@ do_build() {
 	fi
 	cd build
 	if [ "$build_option_gnatboot" ]; then
-		CC="${wrksrc}/gnat/bin/gcc" \
-		GNATBIND="${wrksrc}/gnat/bin/gnatbind" \
-		GNATMAKE="${wrksrc}/gnat/bin/gnatmake" \
-		PATH="${wrksrc}/gnat/bin:$PATH" \
+		CC="${wrksrc}/${build_wrksrc}/gnat/bin/gcc" \
+		GNATBIND="${wrksrc}/${build_wrksrc}/gnat/bin/gnatbind" \
+		GNATMAKE="${wrksrc}/${build_wrksrc}/gnat/bin/gnatmake" \
+		PATH="${wrksrc}/${build_wrksrc}/gnat/bin:$PATH" \
 		make ${makejobs}
 	else
 		make ${makejobs}
@@ -330,7 +330,7 @@ do_build() {
 pre_install() {
 	if [ "$CROSS_BUILD" ]; then
 		# XXX otherwise links to host libpthread
-		for f in $(find ${wrksrc}/build/${XBPS_CROSS_TRIPLET} -type f -name libtool); do
+		for f in $(find ${wrksrc}/${build_wrksrc}/build/${XBPS_CROSS_TRIPLET} -type f -name libtool); do
 			sed -e "s,add_dir=\"-L\$libdir\",add_dir=\"-L${XBPS_CROSS_BASE}\$libdir\",g" -i $f
 		done
 	fi
@@ -342,16 +342,16 @@ do_install() {
 
 	# Make version a symlink of major version to make all versions
 	# from the same series work automagically.
-	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver} \
+	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${version} \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver}
 	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver} \
-		${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}
+		${DESTDIR}/usr/lib/gcc/${_triplet}/${version}
 
 	# Ditto for c++ headers.
-	mv ${DESTDIR}/usr/include/c++/${_patchver} \
+	mv ${DESTDIR}/usr/include/c++/${version} \
 		${DESTDIR}/usr/include/c++/${_minorver}
 	ln -sfr ${DESTDIR}/usr/include/c++/${_minorver} \
-		${DESTDIR}/usr/include/c++/${_patchver}
+		${DESTDIR}/usr/include/c++/${version}
 
 	# cc symlink
 	ln -sfr ${DESTDIR}/usr/bin/gcc ${DESTDIR}/usr/bin/cc
@@ -360,7 +360,7 @@ do_install() {
 
 	# lto plugin symlink
 	vmkdir usr/lib/bfd-plugins
-	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}/liblto_plugin.so \
+	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${version}/liblto_plugin.so \
 		${DESTDIR}/usr/lib/bfd-plugins
 
 	# Remove "fixed" header
@@ -371,13 +371,9 @@ do_install() {
 	rm -f ${DESTDIR}/usr/lib/libffi*
 	rm -f ${DESTDIR}/usr/share/man/man3/ffi*
 
-	# Remove all python scripts in libdir.
-	rm -f ${DESTDIR}/usr/lib/*.py
-
-	# Remove more python stuff.
-	if [ -d ${DESTDIR}/usr/share/gcc-${_patchver}/python ]; then
-		rm -rf ${DESTDIR}/usr/share/gcc-${_patchver}/python
-	fi
+	# Move libstdc++ gdb helpers to location where gdb can autoload them
+	mkdir -p ${DESTDIR}/usr/share/gdb/auto-load/usr/lib
+	mv ${DESTDIR}/usr/lib/*.py ${DESTDIR}/usr/share/gdb/auto-load/usr/lib
 
 	# Install c89 and c99 wrappers and its manpages, from NetBSD.
 	for f in c89 c99; do
@@ -396,7 +392,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}
@@ -449,7 +445,7 @@ gcc-fortran_package() {
 		if [ "$CROSS_BUILD" ]; then
 			# A number of OMP modules are not built when cross
 			# compiling gcc. Copy them from the cross compiler.
-			local src="/usr/lib/gcc/${_triplet}/${_patchver}/finclude"
+			local src="/usr/lib/gcc/${_triplet}/${version}/finclude"
 			local dst="usr/lib/gcc/${_triplet}/${_minorver}/finclude"
 			for f in omp_lib.f90 omp_lib.h omp_lib.mod omp_lib_kinds.mod \
 				openacc.f90 openacc.mod openacc_kinds.mod openacc_lib.h; do
@@ -516,7 +512,7 @@ libgfortran_package() {
 	short_desc+=" - Fortran library"
 	pkg_install() {
 		vmove "usr/lib/libgfortran.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -537,7 +533,7 @@ libgo_package() {
 	nostrip=yes
 	pkg_install() {
 		vmove "usr/lib/libgo.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -553,7 +549,7 @@ libobjc_package() {
 	short_desc+=" - Objective-C library"
 	pkg_install() {
 		vmove "usr/lib/libobjc.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -572,7 +568,7 @@ libquadmath_package() {
 	short_desc+=" - quadmath library"
 	pkg_install() {
 		vmove "usr/lib/libquadmath.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -614,7 +610,7 @@ libgcc_package() {
 	noverifyrdeps=yes
 	pkg_install() {
 		vmove "usr/lib/libgcc_s.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -645,7 +641,7 @@ libgomp_package() {
 	short_desc+=" - OpenMP v4.0 library"
 	pkg_install() {
 		vmove "usr/lib/libgomp*.so.*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -700,7 +696,7 @@ libssp_package() {
 	short_desc+=" - SSP (StackSmashingProtection) library"
 	pkg_install() {
 		vmove "usr/lib/libssp.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -717,7 +713,9 @@ libstdc++-devel_package() {
 libstdc++_package() {
 	short_desc+=" - Standard C++ Library"
 	pkg_install() {
+		vmove usr/share/gdb
+		vmove usr/share/gcc-${_patchver}/python
 		vmove "usr/lib/libstdc++.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }

From 73c4e7b3fb17c13d131fea1ba65ee5542fa4f4b9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 04/37] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      | 11 ++++--
 2 files changed, 25 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..51611929d643 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,12 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
+
+if [ "$XBPS_LIBC" == "musl" ]; then
+	# Musl always searches LD_LIBRARY_PATH before RPATH and RUNPATH
+	make_build_args="lt_cv_shlibpath_overrides_runpath=yes"
+fi
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From 9468e0cc6f066e624948cf286240ce0f0c7b4220 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 05/37] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 55255dceae8b..ca2d858a7abc 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From b0bb1d2fdb05f02fe21f114154936d9fd4dc11ca Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 06/37] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 3 files changed, 55 insertions(+), 353 deletions(-)
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index 46050bf2d74c..cec470401b35 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From 859a4bdf07a9f871be94f677b57c873d0377f63d Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Wed, 14 Sep 2022 03:48:32 -0700
Subject: [PATCH 07/37] musl: add support for SIGEV_THREAD_ID timers

https://git.musl-libc.org/cgit/musl/commit/?id=7c71792e87691451f2a6b76348e83ad1889f1dcb
---
 ...d-support-for-SIGEV_THREAD_ID-timers.patch | 74 +++++++++++++++++++
 srcpkgs/musl/template                         |  2 +-
 2 files changed, 75 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch

diff --git a/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
new file mode 100644
index 000000000000..e20dff5ba0d4
--- /dev/null
+++ b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
@@ -0,0 +1,74 @@
+From 7c71792e87691451f2a6b76348e83ad1889f1dcb Mon Sep 17 00:00:00 2001
+From: James Y Knight <jyknight@google.com>
+Date: Sun, 30 Jun 2019 21:55:20 -0400
+Subject: [PATCH] add support for SIGEV_THREAD_ID timers
+
+This is like SIGEV_SIGNAL, but targeted to a particular thread's
+tid, rather than the process.
+---
+ include/signal.h        | 16 +++++++++++++---
+ src/time/timer_create.c |  8 ++++++--
+ 2 files changed, 19 insertions(+), 5 deletions(-)
+
+diff --git a/include/signal.h b/include/signal.h
+index fbdf667b2..9ed929e4f 100644
+--- a/include/signal.h
++++ b/include/signal.h
+@@ -180,14 +180,24 @@ struct sigevent {
+ 	union sigval sigev_value;
+ 	int sigev_signo;
+ 	int sigev_notify;
+-	void (*sigev_notify_function)(union sigval);
+-	pthread_attr_t *sigev_notify_attributes;
+-	char __pad[56-3*sizeof(long)];
++	union {
++		char __pad[64 - 2*sizeof(int) - sizeof(union sigval)];
++		pid_t sigev_notify_thread_id;
++		struct {
++			void (*sigev_notify_function)(union sigval);
++			pthread_attr_t *sigev_notify_attributes;
++		} __sev_thread;
++	} __sev_fields;
+ };
+ 
++#define sigev_notify_thread_id __sev_fields.sigev_notify_thread_id
++#define sigev_notify_function __sev_fields.__sev_thread.sigev_notify_function
++#define sigev_notify_attributes __sev_fields.__sev_thread.sigev_notify_attributes
++
+ #define SIGEV_SIGNAL 0
+ #define SIGEV_NONE 1
+ #define SIGEV_THREAD 2
++#define SIGEV_THREAD_ID 4
+ 
+ int __libc_current_sigrtmin(void);
+ int __libc_current_sigrtmax(void);
+diff --git a/src/time/timer_create.c b/src/time/timer_create.c
+index 5ddfda278..4bef23905 100644
+--- a/src/time/timer_create.c
++++ b/src/time/timer_create.c
+@@ -71,11 +71,15 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 	switch (evp ? evp->sigev_notify : SIGEV_SIGNAL) {
+ 	case SIGEV_NONE:
+ 	case SIGEV_SIGNAL:
++	case SIGEV_THREAD_ID:
+ 		if (evp) {
+ 			ksev.sigev_value = evp->sigev_value;
+ 			ksev.sigev_signo = evp->sigev_signo;
+ 			ksev.sigev_notify = evp->sigev_notify;
+-			ksev.sigev_tid = 0;
++			if (evp->sigev_notify == SIGEV_THREAD_ID)
++				ksev.sigev_tid = evp->sigev_notify_thread_id;
++			else
++				ksev.sigev_tid = 0;
+ 			ksevp = &ksev;
+ 		}
+ 		if (syscall(SYS_timer_create, clk, ksevp, &timerid) < 0)
+@@ -107,7 +111,7 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 
+ 		ksev.sigev_value.sival_ptr = 0;
+ 		ksev.sigev_signo = SIGTIMER;
+-		ksev.sigev_notify = 4; /* SIGEV_THREAD_ID */
++		ksev.sigev_notify = SIGEV_THREAD_ID;
+ 		ksev.sigev_tid = td->tid;
+ 		if (syscall(SYS_timer_create, clk, &ksev, &timerid) < 0)
+ 			timerid = -1;
diff --git a/srcpkgs/musl/template b/srcpkgs/musl/template
index 5bdc5c48e623..34e6ed4fba6e 100644
--- a/srcpkgs/musl/template
+++ b/srcpkgs/musl/template
@@ -2,7 +2,7 @@
 pkgname=musl
 reverts="1.2.0_1"
 version=1.1.24
-revision=10
+revision=11
 archs="*-musl"
 bootstrap=yes
 build_style=gnu-configure

From a7366a6da871406af1d0eb0246fb2060404360ec Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 21:01:43 -0700
Subject: [PATCH 08/37] gcc-multilib: update to 12.2.0.

---
 srcpkgs/gcc-multilib/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index fcd25755aa75..df60849babc2 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,16 +3,16 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _majorver="${version%.*}"
-wrksrc=gcc-${version/pre/_pre}
+wrksrc="gcc-${version}"
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel
@@ -71,7 +71,7 @@ do_build() {
 	make ${makejobs}
 }
 do_install() {
-	local _pc_triplet=x86_64-pc-linux-gnu _version=${version%pre1}
+	local _pc_triplet=x86_64-pc-linux-gnu
 	# Install to a tempdir and then only copy relevant files.
 	cd ${wrksrc}
 	make DESTDIR=${wrksrc}/${pkgname}-build install
@@ -81,9 +81,9 @@ do_install() {
 	vmkdir usr/include/c++/${_majorver}/${_triplet}
 	vmkdir usr/lib/gcc/${_triplet}/${_majorver}
 
-	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${_version}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${version}/32 \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_majorver}/
-	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${_version}/${_pc_triplet}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${version}/${_pc_triplet}/32 \
 		${DESTDIR}/usr/include/c++/${_majorver}/${_triplet}
 
 	vinstall ${wrksrc}/host-${_pc_triplet}/gcc/specs 644 usr/lib/gcc/${_triplet}/${_majorver}

From 4b49ae0b78430ededed9c11216ab422cbd50c27e Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Tue, 4 Oct 2022 03:49:13 -0700
Subject: [PATCH 09/37] libgccjit: update to 12.2.0.

---
 srcpkgs/libgccjit/files/libgccjit-musl.patch | 63 --------------------
 srcpkgs/libgccjit/template                   | 38 ++++++------
 2 files changed, 17 insertions(+), 84 deletions(-)
 delete mode 100644 srcpkgs/libgccjit/files/libgccjit-musl.patch

diff --git a/srcpkgs/libgccjit/files/libgccjit-musl.patch b/srcpkgs/libgccjit/files/libgccjit-musl.patch
deleted file mode 100644
index d2ed16928c82..000000000000
--- a/srcpkgs/libgccjit/files/libgccjit-musl.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-diff --git a/gcc/jit/jit-playback.c b/gcc/jit/jit-playback.c
-index 5bccf591a..35f5e35ef 100644
---- a/gcc/jit/jit-playback.c
-+++ b/gcc/jit/jit-playback.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -41,8 +43,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "diagnostic.h"
- #include "stmt.h"
- 
--#include <pthread.h>
--
- #include "jit-playback.h"
- #include "jit-result.h"
- #include "jit-builtins.h"
-diff --git a/gcc/jit/jit-recording.c b/gcc/jit/jit-recording.c
-index a237d574f..5785e3269 100644
---- a/gcc/jit/jit-recording.c
-+++ b/gcc/jit/jit-recording.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -25,8 +27,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "pretty-print.h"
- #include "toplev.h"
- 
--#include <pthread.h>
--
- #include "jit-builtins.h"
- #include "jit-recording.h"
- #include "jit-playback.h"
-diff --git a/gcc/jit/libgccjit.c b/gcc/jit/libgccjit.c
-index f9c33c63c..75f21d275 100644
---- a/gcc/jit/libgccjit.c
-+++ b/gcc/jit/libgccjit.c
-@@ -18,13 +18,13 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
- #include "timevar.h"
- #include "typed-splay-tree.h"
- #include "cppbuiltin.h"
--#include <pthread.h>
- 
- #include "libgccjit.h"
- #include "jit-recording.h"
diff --git a/srcpkgs/libgccjit/template b/srcpkgs/libgccjit/template
index 6f1d6256dcd6..b5d4540ce667 100644
--- a/srcpkgs/libgccjit/template
+++ b/srcpkgs/libgccjit/template
@@ -3,36 +3,32 @@
 # which use the version number.
 
 pkgname=libgccjit
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
+version=12.2.0
 revision=1
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
-_majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
-wrksrc=gcc-${version/pre/_pre}
+_mpc_version=1.2.1
+_isl_version=0.24
 short_desc="Just-In-Time Compilation library for GCC"
 maintainer="Lane Biocini <lane@mailbox.org>"
 homepage="https://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 nopie=yes
+create_wrksrc=yes
+build_wrksrc="gcc-${version}"
+patch_args="-Np1 --directory=${build_wrksrc}"
 lib32disabled=yes
 makedepends="zlib-devel"
 hostmakedepends="tar texinfo perl flex"
@@ -40,10 +36,10 @@ depends="gcc"
 checkdepends="dejagnu"
 
 post_extract() {
-	mv ${XBPS_BUILDDIR}/gmp-${_gmp_version} ${wrksrc}/gmp
-	mv ${XBPS_BUILDDIR}/mpfr-${_mpfr_version} ${wrksrc}/mpfr
-	mv ${XBPS_BUILDDIR}/mpc-${_mpc_version} ${wrksrc}/mpc
-	mv ${XBPS_BUILDDIR}/isl-${_isl_version} ${wrksrc}/isl
+	ln -s ${wrksrc}/gmp-${_gmp_version} ${wrksrc}/${build_wrksrc}/gmp
+	ln -s ${wrksrc}/mpfr-${_mpfr_version} ${wrksrc}/${build_wrksrc}/mpfr
+	ln -s ${wrksrc}/mpc-${_mpc_version} ${wrksrc}/${build_wrksrc}/mpc
+	ln -s ${wrksrc}/isl-${_isl_version} ${wrksrc}/${build_wrksrc}/isl
 }
 
 pre_configure() {
@@ -186,7 +182,7 @@ do_configure() {
 	[ -z "$XBPS_CHECK_PKGS" ] && _langs="jit" || _langs="jit,c++"
 	_args+=" --enable-languages=${_langs}"
 	CONFIG_SHELL=/bin/bash \
-		${wrksrc}/configure ${_args}
+		${wrksrc}/${build_wrksrc}/configure ${_args}
 }
 
 do_build() {

From 61c17ed5482c800eb3e06ec2e5a3b17b0c681b11 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 14 Aug 2022 19:29:36 -0700
Subject: [PATCH 10/37] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove -no-pie from build. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..5d40f0cdd8a6 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -53,6 +53,7 @@ _void_cross_build_binutils() {
 		--sbindir=/usr/bin \
 		--libdir=/usr/lib \
 		--libexecdir=/usr/lib \
+		--sysconfdir=/etc \
 		--target=${tgt} \
 		--with-sysroot=/usr/${tgt} \
 		--disable-nls \
@@ -60,7 +61,9 @@ _void_cross_build_binutils() {
 		--disable-multilib \
 		--disable-werror \
 		--disable-gold \
+		--disable-gprofng \
 		--enable-relro \
+		--enable-new-dtags \
 		--enable-plugins \
 		--enable-64-bit-bfd \
 		--enable-deterministic-archives \
@@ -132,6 +135,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -460,6 +464,14 @@ do_build() {
 	local binutils_ver linux_ver gcc_ver libc_ver libucontext_ver
 	local tgt=${sourcepkg/cross-}
 
+	export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}"
+	export CXXFLAGS="${CXXFLAGS/-D_FORTIFY_SOURCE=2/}"
+
+	# Disable explicit -fno-PIE, gcc/binutils/libc will figure this out itself.
+	export CFLAGS="${CFLAGS//-fno-PIE/}"
+	export CXXFLAGS="${CXXFLAGS//-fno-PIE/}"
+	export LDFLAGS="${LDFLAGS//-no-pie/}"
+
 	_void_cross_test_ver binutils
 	_void_cross_test_ver linux
 	_void_cross_test_ver gcc
@@ -625,6 +637,9 @@ do_install() {
 	# then remove it because it conflicts with libquadmath package
 	rm -rf ${DESTDIR}/${sysroot}/usr/lib/libquadmath.*
 
+	# Remove libdep linker plugin because it conflicts with system binutils
+	rm -f ${DESTDIR}/usr/lib/bfd-plugins/libdep*
+
 	# Remove leftover symlinks
 	rm -f ${DESTDIR}/usr/lib${XBPS_TARGET_WORDSIZE}
 	rm -f ${DESTDIR}/lib*

From 25834965c557e9c5112f1c179c6369640a4bfc0e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:09:31 -0700
Subject: [PATCH 11/37] linux5.18: update dotconfigs for gcc12

---
 srcpkgs/linux5.18/files/x86_64-dotconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/linux5.18/files/x86_64-dotconfig b/srcpkgs/linux5.18/files/x86_64-dotconfig
index 4e73a3195d40..ea6204868e23 100644
--- a/srcpkgs/linux5.18/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.18/files/x86_64-dotconfig
@@ -512,6 +512,7 @@ CONFIG_RETHUNK=y
 CONFIG_CPU_UNRET_ENTRY=y
 CONFIG_CPU_IBPB_ENTRY=y
 CONFIG_CPU_IBRS_ENTRY=y
+CONFIG_SLS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10060,8 +10061,11 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
 # Memory initialization
 #
 CONFIG_INIT_STACK_NONE=y
+# CONFIG_INIT_STACK_ALL_PATTERN is not set
+# CONFIG_INIT_STACK_ALL_ZERO is not set
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
+# CONFIG_ZERO_CALL_USED_REGS is not set
 # end of Memory initialization
 # end of Kernel hardening options
 # end of Security options
@@ -10538,6 +10542,7 @@ CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
 # CONFIG_UBSAN is not set
 CONFIG_HAVE_ARCH_KCSAN=y
+# CONFIG_KCSAN is not set
 # end of Generic Kernel Debugging Instruments
 
 #

From f6d17f27b898fd20912d88737a533e0660af20b5 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:08 -0700
Subject: [PATCH 12/37] subversion: fix build for libtool 2.4.7

---
 srcpkgs/subversion/template | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/subversion/template b/srcpkgs/subversion/template
index 18c35e3a2132..0aa41212c5fd 100644
--- a/srcpkgs/subversion/template
+++ b/srcpkgs/subversion/template
@@ -24,6 +24,8 @@ distfiles="http://apache.uvigo.es/subversion/subversion-${version}.tar.bz2"
 checksum=c9130e8d0b75728a66f0e7038fc77052e671830d785b5616aad53b4810d3cc28
 
 pre_configure() {
+	./autogen.sh --release
+
 	# Based on native build values
 	cat <<-EOF >config.cache
 	ac_cv_python_includes=-I${XBPS_CROSS_BASE}/usr/include/python${py3_ver}
@@ -59,7 +61,12 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+
+	if [ "$XBPS_BUILD_ENVIRONMENT" = "void-packages-ci" ]; then
+		# This test will fail when run as the root user,
+		# because flock() will ignore file permissions.
+		vsed -i subversion/tests/libsvn_fs/locks-test.c -e '/SVN_TEST_OPTS_PASS(obtain_write_lock_failure,/,+3d'
+	fi
 }
 
 post_configure() {

From baa42a319c6049255df78b1c2ed2b91e80d5c1ec Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:38 -0700
Subject: [PATCH 13/37] subversion-kwallet-auth: update to 1.14.2.

Fix failing distfiles.
Fix build for libtool 2.4.7
---
 srcpkgs/subversion-kwallet-auth/template | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/subversion-kwallet-auth/template b/srcpkgs/subversion-kwallet-auth/template
index 12210f250d51..9cc68c3fe5f1 100644
--- a/srcpkgs/subversion-kwallet-auth/template
+++ b/srcpkgs/subversion-kwallet-auth/template
@@ -3,7 +3,7 @@
 # THIS PKG MUST BE SYNCHRONIZED WITH "srcpkgs/subversion".
 #
 pkgname=subversion-kwallet-auth
-version=1.14.1
+version=1.14.2
 revision=1
 wrksrc="subversion-${version}"
 build_style=gnu-configure
@@ -22,10 +22,12 @@ license="Apache-2.0, BSD-3-Clause"
 homepage="http://subversion.apache.org/"
 changelog="https://subversion.apache.org/docs/release-notes/${version%.*}.html"
 distfiles="http://apache.uvigo.es/subversion/subversion-${version}.tar.bz2"
-checksum=2c5da93c255d2e5569fa91d92457fdb65396b0666fad4fd59b22e154d986e1a9
+checksum=c9130e8d0b75728a66f0e7038fc77052e671830d785b5616aad53b4810d3cc28
 lib32disabled=yes
 
 pre_configure() {
+	./autogen.sh --release
+
 	# Based on native build values
 	cat <<-EOF >config.cache
 	ac_cv_python_includes=-I${XBPS_CROSS_BASE}/usr/include/python${py3_ver}
@@ -55,11 +57,18 @@ pre_configure() {
 		cp "$XBPS_CROSS_BASE/usr/lib/perl5/core_perl/Config"*.p? $PERL5LIB
 		cp "$XBPS_CROSS_BASE/usr/lib/perl5/core_perl/Errno.pm" $PERL5LIB
 		vsed -e "s;archlibexp => '\(.*\)';archlibexp => '${XBPS_CROSS_BASE}\1';" \
-			-i $PERL5LIB/Config.pm $PERL5LIB/Config_heavy.pl
+			-i $PERL5LIB/Config.pm
+		vsed -e "s;archlibexp='\(.*\)';archlibexp='${XBPS_CROSS_BASE}\1';" \
+			-i $PERL5LIB/Config_heavy.pl
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+
+	if [ "$XBPS_BUILD_ENVIRONMENT" = "void-packages-ci" ]; then
+		# This test will fail when run as the root user,
+		# because flock() will ignore file permissions.
+		vsed -i subversion/tests/libsvn_fs/locks-test.c -e '/SVN_TEST_OPTS_PASS(obtain_write_lock_failure,/,+3d'
+	fi
 }
 
 post_configure() {

From 0f281e19d041357ee04af3981ebe890ebb33e673 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 14/37] cross-aarch64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..bd6b23f9fb6a 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 71d4ceb6bc7c03e5a46de2ac572740383f27395a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 15/37] cross-aarch64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..427ad2c1e9cd 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 3285b704372672f3365ad52ee7809f8340c9f921 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 16/37] cross-arm-linux-gnueabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..2510ee26e789 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 2fd47981575dae732c6a984be51e3a95dd082030 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 17/37] cross-arm-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..bd8b16e1b4c1 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 1f784d01c5a7111434bbf543f2b6a3937de18f61 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 18/37] cross-arm-linux-musleabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..dacfd2655216 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 3f8ef1d2641ff61515ff87e2cad9cebb8d75f51f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 19/37] cross-arm-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..9ddd32a9f20d 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 21cae6f9aeff296feac588bace043037c0acea79 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 20/37] cross-armv7l-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..9fb00f18be3b 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 6e7a1ed4326d1f50de13dc51a38f06bae500c3b6 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 21/37] cross-armv7l-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..2c72e75ddfe3 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 95be9bf7e3d29a4e29acf40bceb03bfdefbbe73e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 22/37] cross-i686-pc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..4dc17df648b5 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 31d516061a6dcbede814970e9d53e87ded55b013 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Fri, 16 Sep 2022 20:52:19 -0700
Subject: [PATCH 23/37] cross-i686-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-linux-musl/template b/srcpkgs/cross-i686-linux-musl/template
index 8be16a230d8d..78b4d813a113 100644
--- a/srcpkgs/cross-i686-linux-musl/template
+++ b/srcpkgs/cross-i686-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-i686-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-i686-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From bffb4b8e5f4b5c3e241fa2cdc42e2d759e449039 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 24/37] cross-mips-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..6009e5c79eb2 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 915444b2bbdcb41b52662a408bcc417f4210b8e0 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 25/37] cross-mips-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..080164df193d 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="hipperson0 <hipperson0@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 073e1c655241485eb828f2b58167dafa164de366 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 26/37] cross-mipsel-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..f9fd4b8a04ef 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 27b03b7a314c8fd8eff5444595a865c2b1822718 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 27/37] cross-mipsel-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..7418a984474b 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 0bc6b4adb9fc2d8fea638b44ad37ee34b6dd9286 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 28/37] cross-powerpc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..31e57b4e52b2 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 5840123996224b41a52953c9d26ca3edd655cda4 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 29/37] cross-powerpc-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..a2d1edcf1ffd 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From b3d78ae3ad77be8c83d4566e3dd1ec58ac84f142 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 30/37] cross-powerpc64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..1a4cbed61e76 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 90809cadb2cb39d604934048d42d61969dbb1e25 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 31/37] cross-powerpc64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 016f18776a6d..19b1ff859eb6 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From b26d0ad8cfa0e8defe930b8f94cb2f46d230803b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 32/37] cross-powerpc64le-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 463d7e92d20d..9d99a3a315d2 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From ae61082251cdc7a4efcce26fff58517def284de3 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 33/37] cross-powerpc64le-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index c17a3cccfe29..3128baa7372e 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From c1ea6e063d20b3da26878e56fdab51f37ee6834a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 34/37] cross-powerpcle-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 9aede3c465ce..0462a1015a1a 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 
@@ -35,6 +35,8 @@ if [ "$XBPS_TARGET_MACHINE" = "ppcle" ]; then
 	broken="Can't build crosstoolchain to itself"
 fi
 
+broken="glibc uses big-endian specific instructions on 32-bit powerpc"
+
 cross-powerpcle-linux-gnu-libc_package() {
 	short_desc+=" - glibc files"
 	nostrip=yes

From 4ec457fccc738a06a356ad48d68b12628f661dd1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 35/37] cross-powerpcle-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index 045cfda987fe..20e70bed4c60 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From c66e285b198699734781d296c40bdf47aaa4de3b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 36/37] cross-x86_64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 8918f3c22a1c..5219cd50f851 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From cdfeda76107ed51cb40010b502ab5e68fa065ebb Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 37/37] cross-x86_64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..2811de0d3c2e 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (195 preceding siblings ...)
  2022-10-14  4:01 ` [PR PATCH] [Updated] " oreo639
@ 2022-10-14  4:08 ` oreo639
  2022-10-14  4:54 ` oreo639
                   ` (67 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-10-14  4:08 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5478 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.2.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.2.0

There is a list of failing builds here: https://github.com/void-linux/void-packages/issues/39809

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [x] llvm https://github.com/void-linux/void-packages/pull/38694
- [x] m4 https://github.com/void-linux/void-packages/pull/33730
- [x] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [x] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [x] libvirt https://github.com/void-linux/void-packages/pull/38842
- [x] syslinux https://github.com/void-linux/void-packages/pull/38876
- [x] efivar https://github.com/void-linux/void-packages/pull/38874
- [ ] gpgme https://github.com/void-linux/void-packages/pull/38825

Known packages that needed to be fixed/updated for gcc12:
- [ ] linux5.18 (in this PR)
- [x] openssh https://github.com/void-linux/void-packages/pull/38849
- [x] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [x] doxygen https://github.com/void-linux/void-packages/pull/38846
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] libproxy https://github.com/void-linux/void-packages/pull/38818
- [x] exempi https://github.com/void-linux/void-packages/pull/38820
- [x] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [x] libunique1 https://github.com/void-linux/void-packages/pull/38848 or https://github.com/void-linux/void-packages/pull/38873
- [x] libwpd https://github.com/void-linux/void-packages/pull/38878
- [x] cglm https://github.com/void-linux/void-packages/pull/39748
- [x] coreboot-utils https://github.com/void-linux/void-packages/pull/39749
- [x] apl https://github.com/void-linux/void-packages/pull/39750
- [x] igt-gpu-tools https://github.com/void-linux/void-packages/pull/39780

Needs to be fixed/updated for binutils:
- [x] grub https://github.com/void-linux/void-packages/pull/38875
- [x] linux-tools https://github.com/void-linux/void-packages/pull/38877
- [x] kcov https://github.com/void-linux/void-packages/pull/39291

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [x] kde
- [x] lxde
- [x] lxqt

You can test the ISOs here:
https://drive.google.com/drive/folders/1ix92CYSLUP-KWjLxltdgG4e8Nu2JCY5n?usp=sharing

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 131243 bytes --]

From 702dc0a3467d60d629616d4653a1efbb5aded05c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 01/37] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../fix-libcollector-without-java.patch       | 53 +++++++++++++++
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 25 ++++---
 4 files changed, 87 insertions(+), 117 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
 create mode 100644 srcpkgs/binutils/patches/fix-libcollector-without-java.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/fix-libcollector-without-java.patch b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
new file mode 100644
index 000000000000..54384875f358
--- /dev/null
+++ b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
@@ -0,0 +1,53 @@
+From 49ddd814ac1071af7c4f45d5f8398b91862f2c7f Mon Sep 17 00:00:00 2001
+From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
+Date: Wed, 17 Aug 2022 19:55:23 -0700
+Subject: [PATCH] gprofng: fix bug 29479 Collection fails when built without
+ java support
+
+gprofng/ChangeLog
+2022-08-17  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>
+
+	PR gprofng/29479
+	* libcollector/collector.c: Add #if defined(GPROFNG_JAVA_PROFILING) for
+	java specific code.
+	* libcollector/unwind.c: Likewise.
+---
+ gprofng/libcollector/collector.c | 2 ++
+ gprofng/libcollector/unwind.c    | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/gprofng/libcollector/collector.c b/gprofng/libcollector/collector.c
+index 93c9d3330de5..ceff2c1caccb 100644
+--- a/gprofng/libcollector/collector.c
++++ b/gprofng/libcollector/collector.c
+@@ -913,8 +913,10 @@ __collector_open_experiment (const char *exp, const char *params, sp_origin_t or
+   __collector_ext_unwind_key_init (1, NULL);
+ 
+   /* start java attach if suitable */
++#if defined(GPROFNG_JAVA_PROFILING)
+   if (exp_origin == SP_ORIGIN_DBX_ATTACH)
+     __collector_jprofile_start_attach ();
++#endif
+   start_sec_time = CALL_UTIL (time)(NULL);
+   __collector_start_time = collector_interface.getHiResTime ();
+   TprintfT (DBG_LT0, "\t__collector_open_experiment; resetting start_time\n");
+diff --git a/gprofng/libcollector/unwind.c b/gprofng/libcollector/unwind.c
+index 119243788020..f8e11823c81e 100644
+--- a/gprofng/libcollector/unwind.c
++++ b/gprofng/libcollector/unwind.c
+@@ -557,6 +557,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+   int size = max_frame_size;
+ 
+ #define MIN(a,b) ((a)<(b)?(a):(b))
++#if defined(GPROFNG_JAVA_PROFILING)
+   /* get Java info */
+   if (__collector_java_mode && __collector_java_asyncgetcalltrace_loaded && context && !pseudo_context)
+     {
+@@ -569,6 +570,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+ 	  size -= sz;
+ 	}
+     }
++#endif
+ 
+   /* get native stack */
+   if (context)
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..c355a5fc8016 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkgconf"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -35,15 +36,21 @@ do_configure() {
 	local conf
 
 	if [ "$CHROOT_READY" ]; then
-		conf+=" --with-debuginfod"
+		conf+=" --with-debuginfod --enable-shared"
 	else
-		conf+=" --without-debuginfod --disable-install-libbfd"
+		conf+=" --without-debuginfod --disable-shared --disable-install-libbfd"
 	fi
 	if [ "$CROSS_BUILD" ]; then
 		# we don't want --with-sysroot=${XBPS_CROSS_BASE} like gnu-configure
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	# gprofng currently only supports x86 and aarch64 glibc.
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64|i386|aarch64) conf+=" --enable-gprofng" ;;
+		*) conf+=" --disable-gprofng" ;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"
@@ -76,13 +83,14 @@ do_configure() {
 		--libdir=/usr/lib \
 		--mandir=/usr/share/man \
 		--infodir=/usr/share/info \
+		--sysconfdir=/etc \
 		--disable-werror \
-		--disable-shared \
 		--disable-nls \
 		--enable-threads \
 		--enable-plugins \
 		--enable-relro \
 		--enable-gold \
+		--enable-new-dtags \
 		--enable-deterministic-archives \
 		--enable-64-bit-bfd \
 		--enable-ld=default \
@@ -142,7 +150,8 @@ binutils-devel_package() {
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/*.a"
-		vmove "usr/lib/*.so"
+		vmove "usr/lib/libbfd.so"
+		vmove "usr/lib/libopcodes.so"
 	}
 }
 

From 70f450d8dd2903a2a59a9f7ad86f1663f4a26062 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 2 Oct 2022 16:46:59 -0700
Subject: [PATCH 02/37] gdb: resolve conflict with binutils 2.39

---
 srcpkgs/gdb/template | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/gdb/template b/srcpkgs/gdb/template
index ff7c9d9a5911..5970402eb27e 100644
--- a/srcpkgs/gdb/template
+++ b/srcpkgs/gdb/template
@@ -1,7 +1,7 @@
 # Template file for 'gdb'
 pkgname=gdb
 version=12.1
-revision=1
+revision=2
 build_style=gnu-configure
 pycompile_dirs="/usr/share/gdb/python"
 configure_args="--disable-werror --disable-nls --with-system-readline
@@ -48,7 +48,8 @@ vopt_conflict debuginfod static
 
 post_install() {
 	# resolve conflicts with binutils
-	rm -r ${DESTDIR}/usr/{include,lib,share/info/bfd.info*}
+	rm -rf ${DESTDIR}/usr/{include,lib}
+	rm -rf ${DESTDIR}/usr/share/info/{bfd,ctf-spec}.info*
 }
 
 gdb-common_package() {

From de9fa664bcc94d45f313e8d9d81b5138091076cb Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 03/37] gcc: update to 12.2.0.

---
 common/shlibs                                 |  10 +-
 srcpkgs/gcc/files/gccgo-musl.patch            |  71 ++-------
 srcpkgs/gcc/files/libgnarl-musl.patch         |  18 +--
 srcpkgs/gcc/files/libssp-musl.patch           |  10 +-
 srcpkgs/gcc/patches/libffi_gnulinux.patch     |  11 --
 .../gcc/patches/libgcc-ibm128-no-tag.patch    |  10 +-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |   2 +-
 srcpkgs/gcc/template                          | 136 +++++++++---------
 8 files changed, 105 insertions(+), 163 deletions(-)
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index fe70a5765f50..46050bf2d74c 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.2.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.36 perl-5.36.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -847,8 +847,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.2.0_1
+libgnat-12.so libada-12.2.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1698,8 +1698,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.2.0_1
+libasan.so.8 libsanitizer-12.2.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..12ec68dd8aa3 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,14 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ b/libgo/go/runtime/os_linux.go
+@@ -365,7 +365,7 @@ func setThreadCPUProfiler(hz int32) {
+ 	var sevp _sigevent
+ 	sevp.sigev_notify = _SIGEV_THREAD_ID
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.__sev_fields))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..9410a4654060 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,37 +3,35 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
+version=12.2.0
+revision=1
+_minorver="${version%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
-wrksrc=gcc-${version/pre/_pre}
+_mpc_version=1.2.1
+_isl_version=0.24
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
+create_wrksrc=yes
+build_wrksrc="gcc-${version}"
+patch_args="-Np1 --directory=${build_wrksrc}"
 lib32disabled=yes
 bootstrap=yes
 replaces="gcc-gcj<7.2.0 gcc-gcj-jdk-compat<7.2.0 libmpx>=0 libmpx-devel>=0"
@@ -52,8 +50,11 @@ if [ "$CHROOT_READY" ]; then
 	hostmakedepends="tar texinfo perl flex"
 else
 	_have_gccgo=no
+	# libzstd fails to link in bootstrap with glibc 2.36
+	# when zlib has been compiled with glibc 2.32.
+	LDFLAGS="-lzstd -pthread"
 fi
-makedepends="zlib-devel"
+makedepends="zlib-devel libzstd-devel"
 depends="binutils libgcc-devel-${version}_${revision}
  libstdc++-devel-${version}_${revision} libssp-devel-${version}_${revision}"
 checkdepends="dejagnu"
@@ -70,13 +71,13 @@ if [ "$build_option_gnatboot" ]; then
 	case "$XBPS_TARGET_MACHINE" in
 	x86_64)
 		_gnat_tarball="gnat-gpl-2017-x86_64-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/591c6d80c7a447af2deed1d7>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/9682e2e1f2f232ce03fe21d77b14c37a0de5649b?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" b942bcac20dea39748b39f8b624d9619f60a8dee2e8195dbe3829c835b0956e6"
 		build_options_default="gnatboot"
 		;;
 	i686)
 		_gnat_tarball="gnat-gpl-2014-x86-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/564b3e9dc8e196b040fbe248>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/c5e9e6fdff5cb77ed90cf8c62536653e27c0bed6?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" 3b693510f5d22a240abb3034934c1adbd80ccd6e4f61a4f491cc408fdfd9c042"
 		build_options_default="gnatboot"
 		;;
@@ -155,25 +156,24 @@ if [ "$CROSS_BUILD" ]; then
 fi
 
 post_extract() {
-	mkdir -p ${wrksrc}/{gmp,mpfr,mpc,isl}
-	cp -ar ${XBPS_BUILDDIR}/gmp-${_gmp_version}/* ${wrksrc}/gmp/
-	cp -ar ${XBPS_BUILDDIR}/mpfr-${_mpfr_version}/* ${wrksrc}/mpfr/
-	cp -ar ${XBPS_BUILDDIR}/mpc-${_mpc_version}/* ${wrksrc}/mpc/
-	cp -ar ${XBPS_BUILDDIR}/isl-${_isl_version}/* ${wrksrc}/isl/
+	ln -s ${wrksrc}/gmp-${_gmp_version} ${wrksrc}/${build_wrksrc}/gmp
+	ln -s ${wrksrc}/mpfr-${_mpfr_version} ${wrksrc}/${build_wrksrc}/mpfr
+	ln -s ${wrksrc}/mpc-${_mpc_version} ${wrksrc}/${build_wrksrc}/mpc
+	ln -s ${wrksrc}/isl-${_isl_version} ${wrksrc}/${build_wrksrc}/isl
 
 	if [ "$build_option_gnatboot" ]; then
 		local f="${XBPS_SRCDISTDIR}/${pkgname}-${version}/${_gnat_tarball}"
 		msg_normal "Extracting ${_gnat_tarball} ...\n"
-		mkdir -p ${wrksrc}/gnat-ins
-		tar -x -f "$f" --strip-components=1 -C ${wrksrc}/gnat-ins
-		cd ${wrksrc}/gnat-ins
-		make ins-all prefix=${wrksrc}/gnat
-		cd ${wrksrc}
-		rm -rf ${wrksrc}/gnat-ins
+		mkdir -p ${wrksrc}/${build_wrksrc}/gnat-ins
+		tar -x -f "$f" --strip-components=1 -C ${wrksrc}/${build_wrksrc}/gnat-ins
+		cd ${wrksrc}/${build_wrksrc}/gnat-ins
+		make ins-all prefix=${wrksrc}/${build_wrksrc}/gnat
+		cd ${wrksrc}/${build_wrksrc}
+		rm -rf ${wrksrc}/${build_wrksrc}/gnat-ins
 
 		# Rename obsolete ld and as
-		find ${wrksrc}/gnat -name ld -exec mv -v {} {}.old \;
-		find ${wrksrc}/gnat -name as -exec mv -v {} {}.old \;
+		find ${wrksrc}/${build_wrksrc}/gnat -name ld -exec mv -v {} {}.old \;
+		find ${wrksrc}/${build_wrksrc}/gnat -name as -exec mv -v {} {}.old \;
 	fi
 }
 
@@ -185,9 +185,9 @@ pre_configure() {
 	sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
 
 	if [ "$XBPS_TARGET_LIBC" = musl ]; then
-		patch -p1 -i ${FILESDIR}/libgnarl-musl.patch
-		patch -p1 -i ${FILESDIR}/libssp-musl.patch
-		patch -p1 -i ${FILESDIR}/gccgo-musl.patch
+		for p in ${FILESDIR}/*-musl.patch; do
+			patch -p1 -i $p
+		done
 	fi
 }
 do_configure() {
@@ -297,19 +297,19 @@ do_configure() {
 		_args+=" --enable-languages=${_langs},ada"
 		_args+=" --enable-libada"
 		CONFIG_SHELL=/bin/bash \
-		CC="${wrksrc}/gnat/bin/gcc" \
-		GNATBIND="${wrksrc}/gnat/bin/gnatbind" \
-		GNATMAKE="${wrksrc}/gnat/bin/gnatmake" \
-		PATH="${wrksrc}/gnat/bin:$PATH" \
-			${wrksrc}/configure ${_args}
+		CC="${wrksrc}/${build_wrksrc}/gnat/bin/gcc" \
+		GNATBIND="${wrksrc}/${build_wrksrc}/gnat/bin/gnatbind" \
+		GNATMAKE="${wrksrc}/${build_wrksrc}/gnat/bin/gnatmake" \
+		PATH="${wrksrc}/${build_wrksrc}/gnat/bin:$PATH" \
+			${wrksrc}/${build_wrksrc}/configure ${_args}
 	elif [ "$build_option_ada" ]; then
 		_args+=" --enable-languages=${_langs},ada"
 		CONFIG_SHELL=/bin/bash \
-			${wrksrc}/configure ${_args}
+			${wrksrc}/${build_wrksrc}/configure ${_args}
 	else
 		_args+=" --enable-languages=${_langs}"
 		CONFIG_SHELL=/bin/bash \
-			${wrksrc}/configure ${_args}
+			${wrksrc}/${build_wrksrc}/configure ${_args}
 	fi
 }
 do_build() {
@@ -318,10 +318,10 @@ do_build() {
 	fi
 	cd build
 	if [ "$build_option_gnatboot" ]; then
-		CC="${wrksrc}/gnat/bin/gcc" \
-		GNATBIND="${wrksrc}/gnat/bin/gnatbind" \
-		GNATMAKE="${wrksrc}/gnat/bin/gnatmake" \
-		PATH="${wrksrc}/gnat/bin:$PATH" \
+		CC="${wrksrc}/${build_wrksrc}/gnat/bin/gcc" \
+		GNATBIND="${wrksrc}/${build_wrksrc}/gnat/bin/gnatbind" \
+		GNATMAKE="${wrksrc}/${build_wrksrc}/gnat/bin/gnatmake" \
+		PATH="${wrksrc}/${build_wrksrc}/gnat/bin:$PATH" \
 		make ${makejobs}
 	else
 		make ${makejobs}
@@ -330,7 +330,7 @@ do_build() {
 pre_install() {
 	if [ "$CROSS_BUILD" ]; then
 		# XXX otherwise links to host libpthread
-		for f in $(find ${wrksrc}/build/${XBPS_CROSS_TRIPLET} -type f -name libtool); do
+		for f in $(find ${wrksrc}/${build_wrksrc}/build/${XBPS_CROSS_TRIPLET} -type f -name libtool); do
 			sed -e "s,add_dir=\"-L\$libdir\",add_dir=\"-L${XBPS_CROSS_BASE}\$libdir\",g" -i $f
 		done
 	fi
@@ -342,16 +342,16 @@ do_install() {
 
 	# Make version a symlink of major version to make all versions
 	# from the same series work automagically.
-	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver} \
+	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${version} \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver}
 	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver} \
-		${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}
+		${DESTDIR}/usr/lib/gcc/${_triplet}/${version}
 
 	# Ditto for c++ headers.
-	mv ${DESTDIR}/usr/include/c++/${_patchver} \
+	mv ${DESTDIR}/usr/include/c++/${version} \
 		${DESTDIR}/usr/include/c++/${_minorver}
 	ln -sfr ${DESTDIR}/usr/include/c++/${_minorver} \
-		${DESTDIR}/usr/include/c++/${_patchver}
+		${DESTDIR}/usr/include/c++/${version}
 
 	# cc symlink
 	ln -sfr ${DESTDIR}/usr/bin/gcc ${DESTDIR}/usr/bin/cc
@@ -360,7 +360,7 @@ do_install() {
 
 	# lto plugin symlink
 	vmkdir usr/lib/bfd-plugins
-	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}/liblto_plugin.so \
+	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${version}/liblto_plugin.so \
 		${DESTDIR}/usr/lib/bfd-plugins
 
 	# Remove "fixed" header
@@ -371,13 +371,9 @@ do_install() {
 	rm -f ${DESTDIR}/usr/lib/libffi*
 	rm -f ${DESTDIR}/usr/share/man/man3/ffi*
 
-	# Remove all python scripts in libdir.
-	rm -f ${DESTDIR}/usr/lib/*.py
-
-	# Remove more python stuff.
-	if [ -d ${DESTDIR}/usr/share/gcc-${_patchver}/python ]; then
-		rm -rf ${DESTDIR}/usr/share/gcc-${_patchver}/python
-	fi
+	# Move libstdc++ gdb helpers to location where gdb can autoload them
+	mkdir -p ${DESTDIR}/usr/share/gdb/auto-load/usr/lib
+	mv ${DESTDIR}/usr/lib/*.py ${DESTDIR}/usr/share/gdb/auto-load/usr/lib
 
 	# Install c89 and c99 wrappers and its manpages, from NetBSD.
 	for f in c89 c99; do
@@ -396,7 +392,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}
@@ -449,7 +445,7 @@ gcc-fortran_package() {
 		if [ "$CROSS_BUILD" ]; then
 			# A number of OMP modules are not built when cross
 			# compiling gcc. Copy them from the cross compiler.
-			local src="/usr/lib/gcc/${_triplet}/${_patchver}/finclude"
+			local src="/usr/lib/gcc/${_triplet}/${version}/finclude"
 			local dst="usr/lib/gcc/${_triplet}/${_minorver}/finclude"
 			for f in omp_lib.f90 omp_lib.h omp_lib.mod omp_lib_kinds.mod \
 				openacc.f90 openacc.mod openacc_kinds.mod openacc_lib.h; do
@@ -516,7 +512,7 @@ libgfortran_package() {
 	short_desc+=" - Fortran library"
 	pkg_install() {
 		vmove "usr/lib/libgfortran.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -537,7 +533,7 @@ libgo_package() {
 	nostrip=yes
 	pkg_install() {
 		vmove "usr/lib/libgo.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -553,7 +549,7 @@ libobjc_package() {
 	short_desc+=" - Objective-C library"
 	pkg_install() {
 		vmove "usr/lib/libobjc.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -572,7 +568,7 @@ libquadmath_package() {
 	short_desc+=" - quadmath library"
 	pkg_install() {
 		vmove "usr/lib/libquadmath.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -614,7 +610,7 @@ libgcc_package() {
 	noverifyrdeps=yes
 	pkg_install() {
 		vmove "usr/lib/libgcc_s.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -645,7 +641,7 @@ libgomp_package() {
 	short_desc+=" - OpenMP v4.0 library"
 	pkg_install() {
 		vmove "usr/lib/libgomp*.so.*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -700,7 +696,7 @@ libssp_package() {
 	short_desc+=" - SSP (StackSmashingProtection) library"
 	pkg_install() {
 		vmove "usr/lib/libssp.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -717,7 +713,9 @@ libstdc++-devel_package() {
 libstdc++_package() {
 	short_desc+=" - Standard C++ Library"
 	pkg_install() {
+		vmove usr/share/gdb
+		vmove usr/share/gcc-${_patchver}/python
 		vmove "usr/lib/libstdc++.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }

From bf713779d6b2aa07f418569df03bc64841151fdc Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 04/37] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      | 11 ++++--
 2 files changed, 25 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..a4087ec2055e 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,12 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
+
+if [ "$XBPS_TARGET_LIBC" == "musl" ]; then
+	# Musl always searches LD_LIBRARY_PATH before RPATH and RUNPATH
+	make_build_args="lt_cv_shlibpath_overrides_runpath=yes"
+fi
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From 1366b904dc8538400fe5a52533858fe7384bd918 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 05/37] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 55255dceae8b..ca2d858a7abc 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From 1508573409bc67652965d2fb99b69604909b61fb Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 06/37] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 3 files changed, 55 insertions(+), 353 deletions(-)
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index 46050bf2d74c..cec470401b35 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From 1c8ce57389e2be2f44cab55093e927ea5d932af4 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Wed, 14 Sep 2022 03:48:32 -0700
Subject: [PATCH 07/37] musl: add support for SIGEV_THREAD_ID timers

https://git.musl-libc.org/cgit/musl/commit/?id=7c71792e87691451f2a6b76348e83ad1889f1dcb
---
 ...d-support-for-SIGEV_THREAD_ID-timers.patch | 74 +++++++++++++++++++
 srcpkgs/musl/template                         |  2 +-
 2 files changed, 75 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch

diff --git a/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
new file mode 100644
index 000000000000..e20dff5ba0d4
--- /dev/null
+++ b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
@@ -0,0 +1,74 @@
+From 7c71792e87691451f2a6b76348e83ad1889f1dcb Mon Sep 17 00:00:00 2001
+From: James Y Knight <jyknight@google.com>
+Date: Sun, 30 Jun 2019 21:55:20 -0400
+Subject: [PATCH] add support for SIGEV_THREAD_ID timers
+
+This is like SIGEV_SIGNAL, but targeted to a particular thread's
+tid, rather than the process.
+---
+ include/signal.h        | 16 +++++++++++++---
+ src/time/timer_create.c |  8 ++++++--
+ 2 files changed, 19 insertions(+), 5 deletions(-)
+
+diff --git a/include/signal.h b/include/signal.h
+index fbdf667b2..9ed929e4f 100644
+--- a/include/signal.h
++++ b/include/signal.h
+@@ -180,14 +180,24 @@ struct sigevent {
+ 	union sigval sigev_value;
+ 	int sigev_signo;
+ 	int sigev_notify;
+-	void (*sigev_notify_function)(union sigval);
+-	pthread_attr_t *sigev_notify_attributes;
+-	char __pad[56-3*sizeof(long)];
++	union {
++		char __pad[64 - 2*sizeof(int) - sizeof(union sigval)];
++		pid_t sigev_notify_thread_id;
++		struct {
++			void (*sigev_notify_function)(union sigval);
++			pthread_attr_t *sigev_notify_attributes;
++		} __sev_thread;
++	} __sev_fields;
+ };
+ 
++#define sigev_notify_thread_id __sev_fields.sigev_notify_thread_id
++#define sigev_notify_function __sev_fields.__sev_thread.sigev_notify_function
++#define sigev_notify_attributes __sev_fields.__sev_thread.sigev_notify_attributes
++
+ #define SIGEV_SIGNAL 0
+ #define SIGEV_NONE 1
+ #define SIGEV_THREAD 2
++#define SIGEV_THREAD_ID 4
+ 
+ int __libc_current_sigrtmin(void);
+ int __libc_current_sigrtmax(void);
+diff --git a/src/time/timer_create.c b/src/time/timer_create.c
+index 5ddfda278..4bef23905 100644
+--- a/src/time/timer_create.c
++++ b/src/time/timer_create.c
+@@ -71,11 +71,15 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 	switch (evp ? evp->sigev_notify : SIGEV_SIGNAL) {
+ 	case SIGEV_NONE:
+ 	case SIGEV_SIGNAL:
++	case SIGEV_THREAD_ID:
+ 		if (evp) {
+ 			ksev.sigev_value = evp->sigev_value;
+ 			ksev.sigev_signo = evp->sigev_signo;
+ 			ksev.sigev_notify = evp->sigev_notify;
+-			ksev.sigev_tid = 0;
++			if (evp->sigev_notify == SIGEV_THREAD_ID)
++				ksev.sigev_tid = evp->sigev_notify_thread_id;
++			else
++				ksev.sigev_tid = 0;
+ 			ksevp = &ksev;
+ 		}
+ 		if (syscall(SYS_timer_create, clk, ksevp, &timerid) < 0)
+@@ -107,7 +111,7 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 
+ 		ksev.sigev_value.sival_ptr = 0;
+ 		ksev.sigev_signo = SIGTIMER;
+-		ksev.sigev_notify = 4; /* SIGEV_THREAD_ID */
++		ksev.sigev_notify = SIGEV_THREAD_ID;
+ 		ksev.sigev_tid = td->tid;
+ 		if (syscall(SYS_timer_create, clk, &ksev, &timerid) < 0)
+ 			timerid = -1;
diff --git a/srcpkgs/musl/template b/srcpkgs/musl/template
index 5bdc5c48e623..34e6ed4fba6e 100644
--- a/srcpkgs/musl/template
+++ b/srcpkgs/musl/template
@@ -2,7 +2,7 @@
 pkgname=musl
 reverts="1.2.0_1"
 version=1.1.24
-revision=10
+revision=11
 archs="*-musl"
 bootstrap=yes
 build_style=gnu-configure

From 891bdaf6f5c8f069a171d9e17db2a7cd7ab67bf1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 21:01:43 -0700
Subject: [PATCH 08/37] gcc-multilib: update to 12.2.0.

---
 srcpkgs/gcc-multilib/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index fcd25755aa75..df60849babc2 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,16 +3,16 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _majorver="${version%.*}"
-wrksrc=gcc-${version/pre/_pre}
+wrksrc="gcc-${version}"
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel
@@ -71,7 +71,7 @@ do_build() {
 	make ${makejobs}
 }
 do_install() {
-	local _pc_triplet=x86_64-pc-linux-gnu _version=${version%pre1}
+	local _pc_triplet=x86_64-pc-linux-gnu
 	# Install to a tempdir and then only copy relevant files.
 	cd ${wrksrc}
 	make DESTDIR=${wrksrc}/${pkgname}-build install
@@ -81,9 +81,9 @@ do_install() {
 	vmkdir usr/include/c++/${_majorver}/${_triplet}
 	vmkdir usr/lib/gcc/${_triplet}/${_majorver}
 
-	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${_version}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${version}/32 \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_majorver}/
-	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${_version}/${_pc_triplet}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${version}/${_pc_triplet}/32 \
 		${DESTDIR}/usr/include/c++/${_majorver}/${_triplet}
 
 	vinstall ${wrksrc}/host-${_pc_triplet}/gcc/specs 644 usr/lib/gcc/${_triplet}/${_majorver}

From 340c7a5f9c5812844211265ff616f5247783456d Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Tue, 4 Oct 2022 03:49:13 -0700
Subject: [PATCH 09/37] libgccjit: update to 12.2.0.

---
 srcpkgs/libgccjit/files/libgccjit-musl.patch | 63 --------------------
 srcpkgs/libgccjit/template                   | 38 ++++++------
 2 files changed, 17 insertions(+), 84 deletions(-)
 delete mode 100644 srcpkgs/libgccjit/files/libgccjit-musl.patch

diff --git a/srcpkgs/libgccjit/files/libgccjit-musl.patch b/srcpkgs/libgccjit/files/libgccjit-musl.patch
deleted file mode 100644
index d2ed16928c82..000000000000
--- a/srcpkgs/libgccjit/files/libgccjit-musl.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-diff --git a/gcc/jit/jit-playback.c b/gcc/jit/jit-playback.c
-index 5bccf591a..35f5e35ef 100644
---- a/gcc/jit/jit-playback.c
-+++ b/gcc/jit/jit-playback.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -41,8 +43,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "diagnostic.h"
- #include "stmt.h"
- 
--#include <pthread.h>
--
- #include "jit-playback.h"
- #include "jit-result.h"
- #include "jit-builtins.h"
-diff --git a/gcc/jit/jit-recording.c b/gcc/jit/jit-recording.c
-index a237d574f..5785e3269 100644
---- a/gcc/jit/jit-recording.c
-+++ b/gcc/jit/jit-recording.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -25,8 +27,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "pretty-print.h"
- #include "toplev.h"
- 
--#include <pthread.h>
--
- #include "jit-builtins.h"
- #include "jit-recording.h"
- #include "jit-playback.h"
-diff --git a/gcc/jit/libgccjit.c b/gcc/jit/libgccjit.c
-index f9c33c63c..75f21d275 100644
---- a/gcc/jit/libgccjit.c
-+++ b/gcc/jit/libgccjit.c
-@@ -18,13 +18,13 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
- #include "timevar.h"
- #include "typed-splay-tree.h"
- #include "cppbuiltin.h"
--#include <pthread.h>
- 
- #include "libgccjit.h"
- #include "jit-recording.h"
diff --git a/srcpkgs/libgccjit/template b/srcpkgs/libgccjit/template
index 6f1d6256dcd6..b5d4540ce667 100644
--- a/srcpkgs/libgccjit/template
+++ b/srcpkgs/libgccjit/template
@@ -3,36 +3,32 @@
 # which use the version number.
 
 pkgname=libgccjit
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
+version=12.2.0
 revision=1
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
-_majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
-wrksrc=gcc-${version/pre/_pre}
+_mpc_version=1.2.1
+_isl_version=0.24
 short_desc="Just-In-Time Compilation library for GCC"
 maintainer="Lane Biocini <lane@mailbox.org>"
 homepage="https://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 nopie=yes
+create_wrksrc=yes
+build_wrksrc="gcc-${version}"
+patch_args="-Np1 --directory=${build_wrksrc}"
 lib32disabled=yes
 makedepends="zlib-devel"
 hostmakedepends="tar texinfo perl flex"
@@ -40,10 +36,10 @@ depends="gcc"
 checkdepends="dejagnu"
 
 post_extract() {
-	mv ${XBPS_BUILDDIR}/gmp-${_gmp_version} ${wrksrc}/gmp
-	mv ${XBPS_BUILDDIR}/mpfr-${_mpfr_version} ${wrksrc}/mpfr
-	mv ${XBPS_BUILDDIR}/mpc-${_mpc_version} ${wrksrc}/mpc
-	mv ${XBPS_BUILDDIR}/isl-${_isl_version} ${wrksrc}/isl
+	ln -s ${wrksrc}/gmp-${_gmp_version} ${wrksrc}/${build_wrksrc}/gmp
+	ln -s ${wrksrc}/mpfr-${_mpfr_version} ${wrksrc}/${build_wrksrc}/mpfr
+	ln -s ${wrksrc}/mpc-${_mpc_version} ${wrksrc}/${build_wrksrc}/mpc
+	ln -s ${wrksrc}/isl-${_isl_version} ${wrksrc}/${build_wrksrc}/isl
 }
 
 pre_configure() {
@@ -186,7 +182,7 @@ do_configure() {
 	[ -z "$XBPS_CHECK_PKGS" ] && _langs="jit" || _langs="jit,c++"
 	_args+=" --enable-languages=${_langs}"
 	CONFIG_SHELL=/bin/bash \
-		${wrksrc}/configure ${_args}
+		${wrksrc}/${build_wrksrc}/configure ${_args}
 }
 
 do_build() {

From 608bc397ea8a100817500992adc48f6d32efd4da Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 14 Aug 2022 19:29:36 -0700
Subject: [PATCH 10/37] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove -no-pie from build. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..5d40f0cdd8a6 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -53,6 +53,7 @@ _void_cross_build_binutils() {
 		--sbindir=/usr/bin \
 		--libdir=/usr/lib \
 		--libexecdir=/usr/lib \
+		--sysconfdir=/etc \
 		--target=${tgt} \
 		--with-sysroot=/usr/${tgt} \
 		--disable-nls \
@@ -60,7 +61,9 @@ _void_cross_build_binutils() {
 		--disable-multilib \
 		--disable-werror \
 		--disable-gold \
+		--disable-gprofng \
 		--enable-relro \
+		--enable-new-dtags \
 		--enable-plugins \
 		--enable-64-bit-bfd \
 		--enable-deterministic-archives \
@@ -132,6 +135,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -460,6 +464,14 @@ do_build() {
 	local binutils_ver linux_ver gcc_ver libc_ver libucontext_ver
 	local tgt=${sourcepkg/cross-}
 
+	export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}"
+	export CXXFLAGS="${CXXFLAGS/-D_FORTIFY_SOURCE=2/}"
+
+	# Disable explicit -fno-PIE, gcc/binutils/libc will figure this out itself.
+	export CFLAGS="${CFLAGS//-fno-PIE/}"
+	export CXXFLAGS="${CXXFLAGS//-fno-PIE/}"
+	export LDFLAGS="${LDFLAGS//-no-pie/}"
+
 	_void_cross_test_ver binutils
 	_void_cross_test_ver linux
 	_void_cross_test_ver gcc
@@ -625,6 +637,9 @@ do_install() {
 	# then remove it because it conflicts with libquadmath package
 	rm -rf ${DESTDIR}/${sysroot}/usr/lib/libquadmath.*
 
+	# Remove libdep linker plugin because it conflicts with system binutils
+	rm -f ${DESTDIR}/usr/lib/bfd-plugins/libdep*
+
 	# Remove leftover symlinks
 	rm -f ${DESTDIR}/usr/lib${XBPS_TARGET_WORDSIZE}
 	rm -f ${DESTDIR}/lib*

From da4fcf3d26b9cb418329a8ca8e69be01e409472a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:09:31 -0700
Subject: [PATCH 11/37] linux5.18: update dotconfigs for gcc12

---
 srcpkgs/linux5.18/files/x86_64-dotconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/linux5.18/files/x86_64-dotconfig b/srcpkgs/linux5.18/files/x86_64-dotconfig
index 4e73a3195d40..ea6204868e23 100644
--- a/srcpkgs/linux5.18/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.18/files/x86_64-dotconfig
@@ -512,6 +512,7 @@ CONFIG_RETHUNK=y
 CONFIG_CPU_UNRET_ENTRY=y
 CONFIG_CPU_IBPB_ENTRY=y
 CONFIG_CPU_IBRS_ENTRY=y
+CONFIG_SLS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10060,8 +10061,11 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
 # Memory initialization
 #
 CONFIG_INIT_STACK_NONE=y
+# CONFIG_INIT_STACK_ALL_PATTERN is not set
+# CONFIG_INIT_STACK_ALL_ZERO is not set
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
+# CONFIG_ZERO_CALL_USED_REGS is not set
 # end of Memory initialization
 # end of Kernel hardening options
 # end of Security options
@@ -10538,6 +10542,7 @@ CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
 # CONFIG_UBSAN is not set
 CONFIG_HAVE_ARCH_KCSAN=y
+# CONFIG_KCSAN is not set
 # end of Generic Kernel Debugging Instruments
 
 #

From bd4558db739acc136c3247f610938c5ef416c2bf Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:08 -0700
Subject: [PATCH 12/37] subversion: fix build for libtool 2.4.7

---
 srcpkgs/subversion/template | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/subversion/template b/srcpkgs/subversion/template
index 18c35e3a2132..0aa41212c5fd 100644
--- a/srcpkgs/subversion/template
+++ b/srcpkgs/subversion/template
@@ -24,6 +24,8 @@ distfiles="http://apache.uvigo.es/subversion/subversion-${version}.tar.bz2"
 checksum=c9130e8d0b75728a66f0e7038fc77052e671830d785b5616aad53b4810d3cc28
 
 pre_configure() {
+	./autogen.sh --release
+
 	# Based on native build values
 	cat <<-EOF >config.cache
 	ac_cv_python_includes=-I${XBPS_CROSS_BASE}/usr/include/python${py3_ver}
@@ -59,7 +61,12 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+
+	if [ "$XBPS_BUILD_ENVIRONMENT" = "void-packages-ci" ]; then
+		# This test will fail when run as the root user,
+		# because flock() will ignore file permissions.
+		vsed -i subversion/tests/libsvn_fs/locks-test.c -e '/SVN_TEST_OPTS_PASS(obtain_write_lock_failure,/,+3d'
+	fi
 }
 
 post_configure() {

From 505846455f4b183497c4d40eeb797188b89c3a60 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:38 -0700
Subject: [PATCH 13/37] subversion-kwallet-auth: update to 1.14.2.

Fix failing distfiles.
Fix build for libtool 2.4.7
---
 srcpkgs/subversion-kwallet-auth/template | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/subversion-kwallet-auth/template b/srcpkgs/subversion-kwallet-auth/template
index 12210f250d51..9cc68c3fe5f1 100644
--- a/srcpkgs/subversion-kwallet-auth/template
+++ b/srcpkgs/subversion-kwallet-auth/template
@@ -3,7 +3,7 @@
 # THIS PKG MUST BE SYNCHRONIZED WITH "srcpkgs/subversion".
 #
 pkgname=subversion-kwallet-auth
-version=1.14.1
+version=1.14.2
 revision=1
 wrksrc="subversion-${version}"
 build_style=gnu-configure
@@ -22,10 +22,12 @@ license="Apache-2.0, BSD-3-Clause"
 homepage="http://subversion.apache.org/"
 changelog="https://subversion.apache.org/docs/release-notes/${version%.*}.html"
 distfiles="http://apache.uvigo.es/subversion/subversion-${version}.tar.bz2"
-checksum=2c5da93c255d2e5569fa91d92457fdb65396b0666fad4fd59b22e154d986e1a9
+checksum=c9130e8d0b75728a66f0e7038fc77052e671830d785b5616aad53b4810d3cc28
 lib32disabled=yes
 
 pre_configure() {
+	./autogen.sh --release
+
 	# Based on native build values
 	cat <<-EOF >config.cache
 	ac_cv_python_includes=-I${XBPS_CROSS_BASE}/usr/include/python${py3_ver}
@@ -55,11 +57,18 @@ pre_configure() {
 		cp "$XBPS_CROSS_BASE/usr/lib/perl5/core_perl/Config"*.p? $PERL5LIB
 		cp "$XBPS_CROSS_BASE/usr/lib/perl5/core_perl/Errno.pm" $PERL5LIB
 		vsed -e "s;archlibexp => '\(.*\)';archlibexp => '${XBPS_CROSS_BASE}\1';" \
-			-i $PERL5LIB/Config.pm $PERL5LIB/Config_heavy.pl
+			-i $PERL5LIB/Config.pm
+		vsed -e "s;archlibexp='\(.*\)';archlibexp='${XBPS_CROSS_BASE}\1';" \
+			-i $PERL5LIB/Config_heavy.pl
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+
+	if [ "$XBPS_BUILD_ENVIRONMENT" = "void-packages-ci" ]; then
+		# This test will fail when run as the root user,
+		# because flock() will ignore file permissions.
+		vsed -i subversion/tests/libsvn_fs/locks-test.c -e '/SVN_TEST_OPTS_PASS(obtain_write_lock_failure,/,+3d'
+	fi
 }
 
 post_configure() {

From 5fdf4d9ae484097fd875b557401a100645692960 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 14/37] cross-aarch64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..bd6b23f9fb6a 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 90692242a423d7178f28472db6b721fa0ff9eab2 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 15/37] cross-aarch64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..427ad2c1e9cd 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 19b8c393f990c019d9c8e19728b6ec2e49ca0381 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 16/37] cross-arm-linux-gnueabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..2510ee26e789 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 59b556818e8fe73806040a9197b689479cf73be1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 17/37] cross-arm-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..bd8b16e1b4c1 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 7a4710a2031e4a7cdae07592c3f23f044da0cce7 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 18/37] cross-arm-linux-musleabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..dacfd2655216 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 39158e4d3437692ff48efd5e977c70b1446f99ad Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 19/37] cross-arm-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..9ddd32a9f20d 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 364b79a16d58add50c21a799c5f921bab4c54423 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 20/37] cross-armv7l-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..9fb00f18be3b 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 80fcd9cdf8f1b71e343c7ea6c3c434acce2e4067 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 21/37] cross-armv7l-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..2c72e75ddfe3 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 476a7959d60fb0018bbb87a12387cf543977ab5b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 22/37] cross-i686-pc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..4dc17df648b5 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From e8d6c91ed888566163964b6f49551afe9ee63b7c Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Fri, 16 Sep 2022 20:52:19 -0700
Subject: [PATCH 23/37] cross-i686-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-linux-musl/template b/srcpkgs/cross-i686-linux-musl/template
index 8be16a230d8d..78b4d813a113 100644
--- a/srcpkgs/cross-i686-linux-musl/template
+++ b/srcpkgs/cross-i686-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-i686-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-i686-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 123071fe1e02c9153bf896c64ff8d04afe5f540e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 24/37] cross-mips-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..6009e5c79eb2 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 0ac748c37e4cd1c8f482ed6692d4b3178fe6e29b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 25/37] cross-mips-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..080164df193d 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="hipperson0 <hipperson0@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 5f5cd7a2c17e8e7b532f94e15321a7af47b34a24 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 26/37] cross-mipsel-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..f9fd4b8a04ef 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 619b06508545c07537ed68021b7055a1c8ec5fab Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 27/37] cross-mipsel-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..7418a984474b 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 815a1d2053018d3c2a28618d89db18a84d7e2deb Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 28/37] cross-powerpc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..31e57b4e52b2 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 2ff7b93881668b6a656e4196ee41c0ab1b871388 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 29/37] cross-powerpc-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..a2d1edcf1ffd 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 2c59e6a7ca2d7fb3a222977f68cfedd14bffb356 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 30/37] cross-powerpc64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..1a4cbed61e76 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 59a5afe83b2e2e010c1facc237f11848d0388379 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 31/37] cross-powerpc64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 016f18776a6d..19b1ff859eb6 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From c723e5287ea42b91373dc9c2552be4febd3c86ec Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 32/37] cross-powerpc64le-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 463d7e92d20d..9d99a3a315d2 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 2086e1082a824b9381efa54895f76a34507ed0de Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 33/37] cross-powerpc64le-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index c17a3cccfe29..3128baa7372e 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 776910474900574c7c5d39359d94fde73a744d2f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 34/37] cross-powerpcle-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 9aede3c465ce..0462a1015a1a 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 
@@ -35,6 +35,8 @@ if [ "$XBPS_TARGET_MACHINE" = "ppcle" ]; then
 	broken="Can't build crosstoolchain to itself"
 fi
 
+broken="glibc uses big-endian specific instructions on 32-bit powerpc"
+
 cross-powerpcle-linux-gnu-libc_package() {
 	short_desc+=" - glibc files"
 	nostrip=yes

From d6bf2bcba5ab88009b776521c985f69a047c813a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 35/37] cross-powerpcle-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index 045cfda987fe..20e70bed4c60 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From ed502af78e5f2aaf30c2183fa3195f2102e2ed08 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 36/37] cross-x86_64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 8918f3c22a1c..5219cd50f851 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 3c9bdf9a307f9a1dd6d38ec049e9e6053637baee Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 37/37] cross-x86_64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..2811de0d3c2e 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (196 preceding siblings ...)
  2022-10-14  4:08 ` oreo639
@ 2022-10-14  4:54 ` oreo639
  2022-10-14  9:02 ` oreo639
                   ` (66 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-10-14  4:54 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5478 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.2.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.2.0

There is a list of failing builds here: https://github.com/void-linux/void-packages/issues/39809

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [x] llvm https://github.com/void-linux/void-packages/pull/38694
- [x] m4 https://github.com/void-linux/void-packages/pull/33730
- [x] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [x] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [x] libvirt https://github.com/void-linux/void-packages/pull/38842
- [x] syslinux https://github.com/void-linux/void-packages/pull/38876
- [x] efivar https://github.com/void-linux/void-packages/pull/38874
- [ ] gpgme https://github.com/void-linux/void-packages/pull/38825

Known packages that needed to be fixed/updated for gcc12:
- [ ] linux5.18 (in this PR)
- [x] openssh https://github.com/void-linux/void-packages/pull/38849
- [x] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [x] doxygen https://github.com/void-linux/void-packages/pull/38846
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] libproxy https://github.com/void-linux/void-packages/pull/38818
- [x] exempi https://github.com/void-linux/void-packages/pull/38820
- [x] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [x] libunique1 https://github.com/void-linux/void-packages/pull/38848 or https://github.com/void-linux/void-packages/pull/38873
- [x] libwpd https://github.com/void-linux/void-packages/pull/38878
- [x] cglm https://github.com/void-linux/void-packages/pull/39748
- [x] coreboot-utils https://github.com/void-linux/void-packages/pull/39749
- [x] apl https://github.com/void-linux/void-packages/pull/39750
- [x] igt-gpu-tools https://github.com/void-linux/void-packages/pull/39780

Needs to be fixed/updated for binutils:
- [x] grub https://github.com/void-linux/void-packages/pull/38875
- [x] linux-tools https://github.com/void-linux/void-packages/pull/38877
- [x] kcov https://github.com/void-linux/void-packages/pull/39291

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [x] kde
- [x] lxde
- [x] lxqt

You can test the ISOs here:
https://drive.google.com/drive/folders/1ix92CYSLUP-KWjLxltdgG4e8Nu2JCY5n?usp=sharing

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 131241 bytes --]

From 702dc0a3467d60d629616d4653a1efbb5aded05c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 01/37] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../fix-libcollector-without-java.patch       | 53 +++++++++++++++
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 25 ++++---
 4 files changed, 87 insertions(+), 117 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
 create mode 100644 srcpkgs/binutils/patches/fix-libcollector-without-java.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/fix-libcollector-without-java.patch b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
new file mode 100644
index 000000000000..54384875f358
--- /dev/null
+++ b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
@@ -0,0 +1,53 @@
+From 49ddd814ac1071af7c4f45d5f8398b91862f2c7f Mon Sep 17 00:00:00 2001
+From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
+Date: Wed, 17 Aug 2022 19:55:23 -0700
+Subject: [PATCH] gprofng: fix bug 29479 Collection fails when built without
+ java support
+
+gprofng/ChangeLog
+2022-08-17  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>
+
+	PR gprofng/29479
+	* libcollector/collector.c: Add #if defined(GPROFNG_JAVA_PROFILING) for
+	java specific code.
+	* libcollector/unwind.c: Likewise.
+---
+ gprofng/libcollector/collector.c | 2 ++
+ gprofng/libcollector/unwind.c    | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/gprofng/libcollector/collector.c b/gprofng/libcollector/collector.c
+index 93c9d3330de5..ceff2c1caccb 100644
+--- a/gprofng/libcollector/collector.c
++++ b/gprofng/libcollector/collector.c
+@@ -913,8 +913,10 @@ __collector_open_experiment (const char *exp, const char *params, sp_origin_t or
+   __collector_ext_unwind_key_init (1, NULL);
+ 
+   /* start java attach if suitable */
++#if defined(GPROFNG_JAVA_PROFILING)
+   if (exp_origin == SP_ORIGIN_DBX_ATTACH)
+     __collector_jprofile_start_attach ();
++#endif
+   start_sec_time = CALL_UTIL (time)(NULL);
+   __collector_start_time = collector_interface.getHiResTime ();
+   TprintfT (DBG_LT0, "\t__collector_open_experiment; resetting start_time\n");
+diff --git a/gprofng/libcollector/unwind.c b/gprofng/libcollector/unwind.c
+index 119243788020..f8e11823c81e 100644
+--- a/gprofng/libcollector/unwind.c
++++ b/gprofng/libcollector/unwind.c
+@@ -557,6 +557,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+   int size = max_frame_size;
+ 
+ #define MIN(a,b) ((a)<(b)?(a):(b))
++#if defined(GPROFNG_JAVA_PROFILING)
+   /* get Java info */
+   if (__collector_java_mode && __collector_java_asyncgetcalltrace_loaded && context && !pseudo_context)
+     {
+@@ -569,6 +570,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+ 	  size -= sz;
+ 	}
+     }
++#endif
+ 
+   /* get native stack */
+   if (context)
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..c355a5fc8016 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkgconf"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -35,15 +36,21 @@ do_configure() {
 	local conf
 
 	if [ "$CHROOT_READY" ]; then
-		conf+=" --with-debuginfod"
+		conf+=" --with-debuginfod --enable-shared"
 	else
-		conf+=" --without-debuginfod --disable-install-libbfd"
+		conf+=" --without-debuginfod --disable-shared --disable-install-libbfd"
 	fi
 	if [ "$CROSS_BUILD" ]; then
 		# we don't want --with-sysroot=${XBPS_CROSS_BASE} like gnu-configure
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	# gprofng currently only supports x86 and aarch64 glibc.
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64|i386|aarch64) conf+=" --enable-gprofng" ;;
+		*) conf+=" --disable-gprofng" ;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"
@@ -76,13 +83,14 @@ do_configure() {
 		--libdir=/usr/lib \
 		--mandir=/usr/share/man \
 		--infodir=/usr/share/info \
+		--sysconfdir=/etc \
 		--disable-werror \
-		--disable-shared \
 		--disable-nls \
 		--enable-threads \
 		--enable-plugins \
 		--enable-relro \
 		--enable-gold \
+		--enable-new-dtags \
 		--enable-deterministic-archives \
 		--enable-64-bit-bfd \
 		--enable-ld=default \
@@ -142,7 +150,8 @@ binutils-devel_package() {
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/*.a"
-		vmove "usr/lib/*.so"
+		vmove "usr/lib/libbfd.so"
+		vmove "usr/lib/libopcodes.so"
 	}
 }
 

From 70f450d8dd2903a2a59a9f7ad86f1663f4a26062 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 2 Oct 2022 16:46:59 -0700
Subject: [PATCH 02/37] gdb: resolve conflict with binutils 2.39

---
 srcpkgs/gdb/template | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/gdb/template b/srcpkgs/gdb/template
index ff7c9d9a5911..5970402eb27e 100644
--- a/srcpkgs/gdb/template
+++ b/srcpkgs/gdb/template
@@ -1,7 +1,7 @@
 # Template file for 'gdb'
 pkgname=gdb
 version=12.1
-revision=1
+revision=2
 build_style=gnu-configure
 pycompile_dirs="/usr/share/gdb/python"
 configure_args="--disable-werror --disable-nls --with-system-readline
@@ -48,7 +48,8 @@ vopt_conflict debuginfod static
 
 post_install() {
 	# resolve conflicts with binutils
-	rm -r ${DESTDIR}/usr/{include,lib,share/info/bfd.info*}
+	rm -rf ${DESTDIR}/usr/{include,lib}
+	rm -rf ${DESTDIR}/usr/share/info/{bfd,ctf-spec}.info*
 }
 
 gdb-common_package() {

From 23c2561b203a52fa9e712d164e515eb4259e3ba1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 03/37] gcc: update to 12.2.0.

---
 common/shlibs                                 |  10 +-
 srcpkgs/gcc/files/gccgo-musl.patch            |  71 ++-------
 srcpkgs/gcc/files/libgnarl-musl.patch         |  18 +--
 srcpkgs/gcc/files/libssp-musl.patch           |  10 +-
 srcpkgs/gcc/patches/libffi_gnulinux.patch     |  11 --
 .../gcc/patches/libgcc-ibm128-no-tag.patch    |  10 +-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |   2 +-
 srcpkgs/gcc/template                          | 136 +++++++++---------
 8 files changed, 105 insertions(+), 163 deletions(-)
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index fe70a5765f50..46050bf2d74c 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.2.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.36 perl-5.36.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -847,8 +847,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.2.0_1
+libgnat-12.so libada-12.2.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1698,8 +1698,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.2.0_1
+libasan.so.8 libsanitizer-12.2.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..12ec68dd8aa3 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,14 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ b/libgo/go/runtime/os_linux.go
+@@ -365,7 +365,7 @@ func setThreadCPUProfiler(hz int32) {
+ 	var sevp _sigevent
+ 	sevp.sigev_notify = _SIGEV_THREAD_ID
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.__sev_fields))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..5ffd54e466ae 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,37 +3,35 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
+version=12.2.0
+revision=1
+_minorver="${version%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
-wrksrc=gcc-${version/pre/_pre}
+_mpc_version=1.2.1
+_isl_version=0.24
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
+create_wrksrc=yes
+build_wrksrc="gcc-${version}"
+patch_args="-Np1 --directory=${build_wrksrc}"
 lib32disabled=yes
 bootstrap=yes
 replaces="gcc-gcj<7.2.0 gcc-gcj-jdk-compat<7.2.0 libmpx>=0 libmpx-devel>=0"
@@ -52,8 +50,11 @@ if [ "$CHROOT_READY" ]; then
 	hostmakedepends="tar texinfo perl flex"
 else
 	_have_gccgo=no
+	# libzstd fails to link in bootstrap with glibc 2.36
+	# when zlib has been compiled with glibc 2.32.
+	LDFLAGS="-lzstd -pthread"
 fi
-makedepends="zlib-devel"
+makedepends="zlib-devel libzstd-devel"
 depends="binutils libgcc-devel-${version}_${revision}
  libstdc++-devel-${version}_${revision} libssp-devel-${version}_${revision}"
 checkdepends="dejagnu"
@@ -70,13 +71,13 @@ if [ "$build_option_gnatboot" ]; then
 	case "$XBPS_TARGET_MACHINE" in
 	x86_64)
 		_gnat_tarball="gnat-gpl-2017-x86_64-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/591c6d80c7a447af2deed1d7>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/9682e2e1f2f232ce03fe21d77b14c37a0de5649b?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" b942bcac20dea39748b39f8b624d9619f60a8dee2e8195dbe3829c835b0956e6"
 		build_options_default="gnatboot"
 		;;
 	i686)
 		_gnat_tarball="gnat-gpl-2014-x86-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/564b3e9dc8e196b040fbe248>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/c5e9e6fdff5cb77ed90cf8c62536653e27c0bed6?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" 3b693510f5d22a240abb3034934c1adbd80ccd6e4f61a4f491cc408fdfd9c042"
 		build_options_default="gnatboot"
 		;;
@@ -155,25 +156,24 @@ if [ "$CROSS_BUILD" ]; then
 fi
 
 post_extract() {
-	mkdir -p ${wrksrc}/{gmp,mpfr,mpc,isl}
-	cp -ar ${XBPS_BUILDDIR}/gmp-${_gmp_version}/* ${wrksrc}/gmp/
-	cp -ar ${XBPS_BUILDDIR}/mpfr-${_mpfr_version}/* ${wrksrc}/mpfr/
-	cp -ar ${XBPS_BUILDDIR}/mpc-${_mpc_version}/* ${wrksrc}/mpc/
-	cp -ar ${XBPS_BUILDDIR}/isl-${_isl_version}/* ${wrksrc}/isl/
+	ln -s ${wrksrc}/gmp-${_gmp_version} ${wrksrc}/${build_wrksrc}/gmp
+	ln -s ${wrksrc}/mpfr-${_mpfr_version} ${wrksrc}/${build_wrksrc}/mpfr
+	ln -s ${wrksrc}/mpc-${_mpc_version} ${wrksrc}/${build_wrksrc}/mpc
+	ln -s ${wrksrc}/isl-${_isl_version} ${wrksrc}/${build_wrksrc}/isl
 
 	if [ "$build_option_gnatboot" ]; then
 		local f="${XBPS_SRCDISTDIR}/${pkgname}-${version}/${_gnat_tarball}"
 		msg_normal "Extracting ${_gnat_tarball} ...\n"
-		mkdir -p ${wrksrc}/gnat-ins
-		tar -x -f "$f" --strip-components=1 -C ${wrksrc}/gnat-ins
-		cd ${wrksrc}/gnat-ins
-		make ins-all prefix=${wrksrc}/gnat
-		cd ${wrksrc}
-		rm -rf ${wrksrc}/gnat-ins
+		mkdir -p ${wrksrc}/${build_wrksrc}/gnat-ins
+		tar -x -f "$f" --strip-components=1 -C ${wrksrc}/${build_wrksrc}/gnat-ins
+		cd ${wrksrc}/${build_wrksrc}/gnat-ins
+		make ins-all prefix=${wrksrc}/${build_wrksrc}/gnat
+		cd ${wrksrc}/${build_wrksrc}
+		rm -rf ${wrksrc}/${build_wrksrc}/gnat-ins
 
 		# Rename obsolete ld and as
-		find ${wrksrc}/gnat -name ld -exec mv -v {} {}.old \;
-		find ${wrksrc}/gnat -name as -exec mv -v {} {}.old \;
+		find ${wrksrc}/${build_wrksrc}/gnat -name ld -exec mv -v {} {}.old \;
+		find ${wrksrc}/${build_wrksrc}/gnat -name as -exec mv -v {} {}.old \;
 	fi
 }
 
@@ -185,9 +185,9 @@ pre_configure() {
 	sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
 
 	if [ "$XBPS_TARGET_LIBC" = musl ]; then
-		patch -p1 -i ${FILESDIR}/libgnarl-musl.patch
-		patch -p1 -i ${FILESDIR}/libssp-musl.patch
-		patch -p1 -i ${FILESDIR}/gccgo-musl.patch
+		for p in ${FILESDIR}/*-musl.patch; do
+			patch -p1 -i $p
+		done
 	fi
 }
 do_configure() {
@@ -297,19 +297,19 @@ do_configure() {
 		_args+=" --enable-languages=${_langs},ada"
 		_args+=" --enable-libada"
 		CONFIG_SHELL=/bin/bash \
-		CC="${wrksrc}/gnat/bin/gcc" \
-		GNATBIND="${wrksrc}/gnat/bin/gnatbind" \
-		GNATMAKE="${wrksrc}/gnat/bin/gnatmake" \
-		PATH="${wrksrc}/gnat/bin:$PATH" \
-			${wrksrc}/configure ${_args}
+		CC="${wrksrc}/${build_wrksrc}/gnat/bin/gcc" \
+		GNATBIND="${wrksrc}/${build_wrksrc}/gnat/bin/gnatbind" \
+		GNATMAKE="${wrksrc}/${build_wrksrc}/gnat/bin/gnatmake" \
+		PATH="${wrksrc}/${build_wrksrc}/gnat/bin:$PATH" \
+			${wrksrc}/${build_wrksrc}/configure ${_args}
 	elif [ "$build_option_ada" ]; then
 		_args+=" --enable-languages=${_langs},ada"
 		CONFIG_SHELL=/bin/bash \
-			${wrksrc}/configure ${_args}
+			${wrksrc}/${build_wrksrc}/configure ${_args}
 	else
 		_args+=" --enable-languages=${_langs}"
 		CONFIG_SHELL=/bin/bash \
-			${wrksrc}/configure ${_args}
+			${wrksrc}/${build_wrksrc}/configure ${_args}
 	fi
 }
 do_build() {
@@ -318,10 +318,10 @@ do_build() {
 	fi
 	cd build
 	if [ "$build_option_gnatboot" ]; then
-		CC="${wrksrc}/gnat/bin/gcc" \
-		GNATBIND="${wrksrc}/gnat/bin/gnatbind" \
-		GNATMAKE="${wrksrc}/gnat/bin/gnatmake" \
-		PATH="${wrksrc}/gnat/bin:$PATH" \
+		CC="${wrksrc}/${build_wrksrc}/gnat/bin/gcc" \
+		GNATBIND="${wrksrc}/${build_wrksrc}/gnat/bin/gnatbind" \
+		GNATMAKE="${wrksrc}/${build_wrksrc}/gnat/bin/gnatmake" \
+		PATH="${wrksrc}/${build_wrksrc}/gnat/bin:$PATH" \
 		make ${makejobs}
 	else
 		make ${makejobs}
@@ -330,7 +330,7 @@ do_build() {
 pre_install() {
 	if [ "$CROSS_BUILD" ]; then
 		# XXX otherwise links to host libpthread
-		for f in $(find ${wrksrc}/build/${XBPS_CROSS_TRIPLET} -type f -name libtool); do
+		for f in $(find ${wrksrc}/${build_wrksrc}/build/${XBPS_CROSS_TRIPLET} -type f -name libtool); do
 			sed -e "s,add_dir=\"-L\$libdir\",add_dir=\"-L${XBPS_CROSS_BASE}\$libdir\",g" -i $f
 		done
 	fi
@@ -342,16 +342,16 @@ do_install() {
 
 	# Make version a symlink of major version to make all versions
 	# from the same series work automagically.
-	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver} \
+	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${version} \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver}
 	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver} \
-		${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}
+		${DESTDIR}/usr/lib/gcc/${_triplet}/${version}
 
 	# Ditto for c++ headers.
-	mv ${DESTDIR}/usr/include/c++/${_patchver} \
+	mv ${DESTDIR}/usr/include/c++/${version} \
 		${DESTDIR}/usr/include/c++/${_minorver}
 	ln -sfr ${DESTDIR}/usr/include/c++/${_minorver} \
-		${DESTDIR}/usr/include/c++/${_patchver}
+		${DESTDIR}/usr/include/c++/${version}
 
 	# cc symlink
 	ln -sfr ${DESTDIR}/usr/bin/gcc ${DESTDIR}/usr/bin/cc
@@ -360,7 +360,7 @@ do_install() {
 
 	# lto plugin symlink
 	vmkdir usr/lib/bfd-plugins
-	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}/liblto_plugin.so \
+	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${version}/liblto_plugin.so \
 		${DESTDIR}/usr/lib/bfd-plugins
 
 	# Remove "fixed" header
@@ -371,13 +371,9 @@ do_install() {
 	rm -f ${DESTDIR}/usr/lib/libffi*
 	rm -f ${DESTDIR}/usr/share/man/man3/ffi*
 
-	# Remove all python scripts in libdir.
-	rm -f ${DESTDIR}/usr/lib/*.py
-
-	# Remove more python stuff.
-	if [ -d ${DESTDIR}/usr/share/gcc-${_patchver}/python ]; then
-		rm -rf ${DESTDIR}/usr/share/gcc-${_patchver}/python
-	fi
+	# Move libstdc++ gdb helpers to location where gdb can autoload them
+	mkdir -p ${DESTDIR}/usr/share/gdb/auto-load/usr/lib
+	mv ${DESTDIR}/usr/lib/*.py ${DESTDIR}/usr/share/gdb/auto-load/usr/lib
 
 	# Install c89 and c99 wrappers and its manpages, from NetBSD.
 	for f in c89 c99; do
@@ -396,7 +392,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}
@@ -449,7 +445,7 @@ gcc-fortran_package() {
 		if [ "$CROSS_BUILD" ]; then
 			# A number of OMP modules are not built when cross
 			# compiling gcc. Copy them from the cross compiler.
-			local src="/usr/lib/gcc/${_triplet}/${_patchver}/finclude"
+			local src="/usr/lib/gcc/${_triplet}/${version}/finclude"
 			local dst="usr/lib/gcc/${_triplet}/${_minorver}/finclude"
 			for f in omp_lib.f90 omp_lib.h omp_lib.mod omp_lib_kinds.mod \
 				openacc.f90 openacc.mod openacc_kinds.mod openacc_lib.h; do
@@ -516,7 +512,7 @@ libgfortran_package() {
 	short_desc+=" - Fortran library"
 	pkg_install() {
 		vmove "usr/lib/libgfortran.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -537,7 +533,7 @@ libgo_package() {
 	nostrip=yes
 	pkg_install() {
 		vmove "usr/lib/libgo.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -553,7 +549,7 @@ libobjc_package() {
 	short_desc+=" - Objective-C library"
 	pkg_install() {
 		vmove "usr/lib/libobjc.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -572,7 +568,7 @@ libquadmath_package() {
 	short_desc+=" - quadmath library"
 	pkg_install() {
 		vmove "usr/lib/libquadmath.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -614,7 +610,7 @@ libgcc_package() {
 	noverifyrdeps=yes
 	pkg_install() {
 		vmove "usr/lib/libgcc_s.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -645,7 +641,7 @@ libgomp_package() {
 	short_desc+=" - OpenMP v4.0 library"
 	pkg_install() {
 		vmove "usr/lib/libgomp*.so.*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -700,7 +696,7 @@ libssp_package() {
 	short_desc+=" - SSP (StackSmashingProtection) library"
 	pkg_install() {
 		vmove "usr/lib/libssp.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -717,7 +713,9 @@ libstdc++-devel_package() {
 libstdc++_package() {
 	short_desc+=" - Standard C++ Library"
 	pkg_install() {
+		vmove usr/share/gdb
+		vmove usr/share/gcc-${version}/python
 		vmove "usr/lib/libstdc++.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }

From 67ac508c3e115b43ee1c0bbca58a116aeb02b68c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 04/37] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      | 11 ++++--
 2 files changed, 25 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..a4087ec2055e 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,12 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
+
+if [ "$XBPS_TARGET_LIBC" == "musl" ]; then
+	# Musl always searches LD_LIBRARY_PATH before RPATH and RUNPATH
+	make_build_args="lt_cv_shlibpath_overrides_runpath=yes"
+fi
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From 5ad58ec16999319239d044d43333dc2c058a7d2d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 05/37] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 55255dceae8b..ca2d858a7abc 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From 8b7c7e25e8159b2a973f212eb1639cb95d6d9305 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 06/37] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 3 files changed, 55 insertions(+), 353 deletions(-)
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index 46050bf2d74c..cec470401b35 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From ad8e16821cd7a86e9ed05353a2115ae9a9dcc265 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Wed, 14 Sep 2022 03:48:32 -0700
Subject: [PATCH 07/37] musl: add support for SIGEV_THREAD_ID timers

https://git.musl-libc.org/cgit/musl/commit/?id=7c71792e87691451f2a6b76348e83ad1889f1dcb
---
 ...d-support-for-SIGEV_THREAD_ID-timers.patch | 74 +++++++++++++++++++
 srcpkgs/musl/template                         |  2 +-
 2 files changed, 75 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch

diff --git a/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
new file mode 100644
index 000000000000..e20dff5ba0d4
--- /dev/null
+++ b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
@@ -0,0 +1,74 @@
+From 7c71792e87691451f2a6b76348e83ad1889f1dcb Mon Sep 17 00:00:00 2001
+From: James Y Knight <jyknight@google.com>
+Date: Sun, 30 Jun 2019 21:55:20 -0400
+Subject: [PATCH] add support for SIGEV_THREAD_ID timers
+
+This is like SIGEV_SIGNAL, but targeted to a particular thread's
+tid, rather than the process.
+---
+ include/signal.h        | 16 +++++++++++++---
+ src/time/timer_create.c |  8 ++++++--
+ 2 files changed, 19 insertions(+), 5 deletions(-)
+
+diff --git a/include/signal.h b/include/signal.h
+index fbdf667b2..9ed929e4f 100644
+--- a/include/signal.h
++++ b/include/signal.h
+@@ -180,14 +180,24 @@ struct sigevent {
+ 	union sigval sigev_value;
+ 	int sigev_signo;
+ 	int sigev_notify;
+-	void (*sigev_notify_function)(union sigval);
+-	pthread_attr_t *sigev_notify_attributes;
+-	char __pad[56-3*sizeof(long)];
++	union {
++		char __pad[64 - 2*sizeof(int) - sizeof(union sigval)];
++		pid_t sigev_notify_thread_id;
++		struct {
++			void (*sigev_notify_function)(union sigval);
++			pthread_attr_t *sigev_notify_attributes;
++		} __sev_thread;
++	} __sev_fields;
+ };
+ 
++#define sigev_notify_thread_id __sev_fields.sigev_notify_thread_id
++#define sigev_notify_function __sev_fields.__sev_thread.sigev_notify_function
++#define sigev_notify_attributes __sev_fields.__sev_thread.sigev_notify_attributes
++
+ #define SIGEV_SIGNAL 0
+ #define SIGEV_NONE 1
+ #define SIGEV_THREAD 2
++#define SIGEV_THREAD_ID 4
+ 
+ int __libc_current_sigrtmin(void);
+ int __libc_current_sigrtmax(void);
+diff --git a/src/time/timer_create.c b/src/time/timer_create.c
+index 5ddfda278..4bef23905 100644
+--- a/src/time/timer_create.c
++++ b/src/time/timer_create.c
+@@ -71,11 +71,15 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 	switch (evp ? evp->sigev_notify : SIGEV_SIGNAL) {
+ 	case SIGEV_NONE:
+ 	case SIGEV_SIGNAL:
++	case SIGEV_THREAD_ID:
+ 		if (evp) {
+ 			ksev.sigev_value = evp->sigev_value;
+ 			ksev.sigev_signo = evp->sigev_signo;
+ 			ksev.sigev_notify = evp->sigev_notify;
+-			ksev.sigev_tid = 0;
++			if (evp->sigev_notify == SIGEV_THREAD_ID)
++				ksev.sigev_tid = evp->sigev_notify_thread_id;
++			else
++				ksev.sigev_tid = 0;
+ 			ksevp = &ksev;
+ 		}
+ 		if (syscall(SYS_timer_create, clk, ksevp, &timerid) < 0)
+@@ -107,7 +111,7 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 
+ 		ksev.sigev_value.sival_ptr = 0;
+ 		ksev.sigev_signo = SIGTIMER;
+-		ksev.sigev_notify = 4; /* SIGEV_THREAD_ID */
++		ksev.sigev_notify = SIGEV_THREAD_ID;
+ 		ksev.sigev_tid = td->tid;
+ 		if (syscall(SYS_timer_create, clk, &ksev, &timerid) < 0)
+ 			timerid = -1;
diff --git a/srcpkgs/musl/template b/srcpkgs/musl/template
index 5bdc5c48e623..34e6ed4fba6e 100644
--- a/srcpkgs/musl/template
+++ b/srcpkgs/musl/template
@@ -2,7 +2,7 @@
 pkgname=musl
 reverts="1.2.0_1"
 version=1.1.24
-revision=10
+revision=11
 archs="*-musl"
 bootstrap=yes
 build_style=gnu-configure

From 71e4a3d7730ac469f1d747f51cfa7145f4eee50a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 21:01:43 -0700
Subject: [PATCH 08/37] gcc-multilib: update to 12.2.0.

---
 srcpkgs/gcc-multilib/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index fcd25755aa75..df60849babc2 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,16 +3,16 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _majorver="${version%.*}"
-wrksrc=gcc-${version/pre/_pre}
+wrksrc="gcc-${version}"
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel
@@ -71,7 +71,7 @@ do_build() {
 	make ${makejobs}
 }
 do_install() {
-	local _pc_triplet=x86_64-pc-linux-gnu _version=${version%pre1}
+	local _pc_triplet=x86_64-pc-linux-gnu
 	# Install to a tempdir and then only copy relevant files.
 	cd ${wrksrc}
 	make DESTDIR=${wrksrc}/${pkgname}-build install
@@ -81,9 +81,9 @@ do_install() {
 	vmkdir usr/include/c++/${_majorver}/${_triplet}
 	vmkdir usr/lib/gcc/${_triplet}/${_majorver}
 
-	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${_version}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${version}/32 \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_majorver}/
-	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${_version}/${_pc_triplet}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${version}/${_pc_triplet}/32 \
 		${DESTDIR}/usr/include/c++/${_majorver}/${_triplet}
 
 	vinstall ${wrksrc}/host-${_pc_triplet}/gcc/specs 644 usr/lib/gcc/${_triplet}/${_majorver}

From 17268b8f25af55fd3171db729909a3b5b3f3620c Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Tue, 4 Oct 2022 03:49:13 -0700
Subject: [PATCH 09/37] libgccjit: update to 12.2.0.

---
 srcpkgs/libgccjit/files/libgccjit-musl.patch | 63 --------------------
 srcpkgs/libgccjit/template                   | 38 ++++++------
 2 files changed, 17 insertions(+), 84 deletions(-)
 delete mode 100644 srcpkgs/libgccjit/files/libgccjit-musl.patch

diff --git a/srcpkgs/libgccjit/files/libgccjit-musl.patch b/srcpkgs/libgccjit/files/libgccjit-musl.patch
deleted file mode 100644
index d2ed16928c82..000000000000
--- a/srcpkgs/libgccjit/files/libgccjit-musl.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-diff --git a/gcc/jit/jit-playback.c b/gcc/jit/jit-playback.c
-index 5bccf591a..35f5e35ef 100644
---- a/gcc/jit/jit-playback.c
-+++ b/gcc/jit/jit-playback.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -41,8 +43,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "diagnostic.h"
- #include "stmt.h"
- 
--#include <pthread.h>
--
- #include "jit-playback.h"
- #include "jit-result.h"
- #include "jit-builtins.h"
-diff --git a/gcc/jit/jit-recording.c b/gcc/jit/jit-recording.c
-index a237d574f..5785e3269 100644
---- a/gcc/jit/jit-recording.c
-+++ b/gcc/jit/jit-recording.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -25,8 +27,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "pretty-print.h"
- #include "toplev.h"
- 
--#include <pthread.h>
--
- #include "jit-builtins.h"
- #include "jit-recording.h"
- #include "jit-playback.h"
-diff --git a/gcc/jit/libgccjit.c b/gcc/jit/libgccjit.c
-index f9c33c63c..75f21d275 100644
---- a/gcc/jit/libgccjit.c
-+++ b/gcc/jit/libgccjit.c
-@@ -18,13 +18,13 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
- #include "timevar.h"
- #include "typed-splay-tree.h"
- #include "cppbuiltin.h"
--#include <pthread.h>
- 
- #include "libgccjit.h"
- #include "jit-recording.h"
diff --git a/srcpkgs/libgccjit/template b/srcpkgs/libgccjit/template
index 6f1d6256dcd6..b5d4540ce667 100644
--- a/srcpkgs/libgccjit/template
+++ b/srcpkgs/libgccjit/template
@@ -3,36 +3,32 @@
 # which use the version number.
 
 pkgname=libgccjit
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
+version=12.2.0
 revision=1
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
-_majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
-wrksrc=gcc-${version/pre/_pre}
+_mpc_version=1.2.1
+_isl_version=0.24
 short_desc="Just-In-Time Compilation library for GCC"
 maintainer="Lane Biocini <lane@mailbox.org>"
 homepage="https://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 nopie=yes
+create_wrksrc=yes
+build_wrksrc="gcc-${version}"
+patch_args="-Np1 --directory=${build_wrksrc}"
 lib32disabled=yes
 makedepends="zlib-devel"
 hostmakedepends="tar texinfo perl flex"
@@ -40,10 +36,10 @@ depends="gcc"
 checkdepends="dejagnu"
 
 post_extract() {
-	mv ${XBPS_BUILDDIR}/gmp-${_gmp_version} ${wrksrc}/gmp
-	mv ${XBPS_BUILDDIR}/mpfr-${_mpfr_version} ${wrksrc}/mpfr
-	mv ${XBPS_BUILDDIR}/mpc-${_mpc_version} ${wrksrc}/mpc
-	mv ${XBPS_BUILDDIR}/isl-${_isl_version} ${wrksrc}/isl
+	ln -s ${wrksrc}/gmp-${_gmp_version} ${wrksrc}/${build_wrksrc}/gmp
+	ln -s ${wrksrc}/mpfr-${_mpfr_version} ${wrksrc}/${build_wrksrc}/mpfr
+	ln -s ${wrksrc}/mpc-${_mpc_version} ${wrksrc}/${build_wrksrc}/mpc
+	ln -s ${wrksrc}/isl-${_isl_version} ${wrksrc}/${build_wrksrc}/isl
 }
 
 pre_configure() {
@@ -186,7 +182,7 @@ do_configure() {
 	[ -z "$XBPS_CHECK_PKGS" ] && _langs="jit" || _langs="jit,c++"
 	_args+=" --enable-languages=${_langs}"
 	CONFIG_SHELL=/bin/bash \
-		${wrksrc}/configure ${_args}
+		${wrksrc}/${build_wrksrc}/configure ${_args}
 }
 
 do_build() {

From 0a45382cd8c6f33e3be54f43ac25482033642209 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 14 Aug 2022 19:29:36 -0700
Subject: [PATCH 10/37] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove -no-pie from build. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..5d40f0cdd8a6 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -53,6 +53,7 @@ _void_cross_build_binutils() {
 		--sbindir=/usr/bin \
 		--libdir=/usr/lib \
 		--libexecdir=/usr/lib \
+		--sysconfdir=/etc \
 		--target=${tgt} \
 		--with-sysroot=/usr/${tgt} \
 		--disable-nls \
@@ -60,7 +61,9 @@ _void_cross_build_binutils() {
 		--disable-multilib \
 		--disable-werror \
 		--disable-gold \
+		--disable-gprofng \
 		--enable-relro \
+		--enable-new-dtags \
 		--enable-plugins \
 		--enable-64-bit-bfd \
 		--enable-deterministic-archives \
@@ -132,6 +135,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -460,6 +464,14 @@ do_build() {
 	local binutils_ver linux_ver gcc_ver libc_ver libucontext_ver
 	local tgt=${sourcepkg/cross-}
 
+	export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}"
+	export CXXFLAGS="${CXXFLAGS/-D_FORTIFY_SOURCE=2/}"
+
+	# Disable explicit -fno-PIE, gcc/binutils/libc will figure this out itself.
+	export CFLAGS="${CFLAGS//-fno-PIE/}"
+	export CXXFLAGS="${CXXFLAGS//-fno-PIE/}"
+	export LDFLAGS="${LDFLAGS//-no-pie/}"
+
 	_void_cross_test_ver binutils
 	_void_cross_test_ver linux
 	_void_cross_test_ver gcc
@@ -625,6 +637,9 @@ do_install() {
 	# then remove it because it conflicts with libquadmath package
 	rm -rf ${DESTDIR}/${sysroot}/usr/lib/libquadmath.*
 
+	# Remove libdep linker plugin because it conflicts with system binutils
+	rm -f ${DESTDIR}/usr/lib/bfd-plugins/libdep*
+
 	# Remove leftover symlinks
 	rm -f ${DESTDIR}/usr/lib${XBPS_TARGET_WORDSIZE}
 	rm -f ${DESTDIR}/lib*

From b0cdb25553e84a8a522bcd7fd40e591455493b47 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:09:31 -0700
Subject: [PATCH 11/37] linux5.18: update dotconfigs for gcc12

---
 srcpkgs/linux5.18/files/x86_64-dotconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/linux5.18/files/x86_64-dotconfig b/srcpkgs/linux5.18/files/x86_64-dotconfig
index 4e73a3195d40..ea6204868e23 100644
--- a/srcpkgs/linux5.18/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.18/files/x86_64-dotconfig
@@ -512,6 +512,7 @@ CONFIG_RETHUNK=y
 CONFIG_CPU_UNRET_ENTRY=y
 CONFIG_CPU_IBPB_ENTRY=y
 CONFIG_CPU_IBRS_ENTRY=y
+CONFIG_SLS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10060,8 +10061,11 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
 # Memory initialization
 #
 CONFIG_INIT_STACK_NONE=y
+# CONFIG_INIT_STACK_ALL_PATTERN is not set
+# CONFIG_INIT_STACK_ALL_ZERO is not set
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
+# CONFIG_ZERO_CALL_USED_REGS is not set
 # end of Memory initialization
 # end of Kernel hardening options
 # end of Security options
@@ -10538,6 +10542,7 @@ CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
 # CONFIG_UBSAN is not set
 CONFIG_HAVE_ARCH_KCSAN=y
+# CONFIG_KCSAN is not set
 # end of Generic Kernel Debugging Instruments
 
 #

From aac5ab8ba57e4beaad078a6a214dc8b84d4f838c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:08 -0700
Subject: [PATCH 12/37] subversion: fix build for libtool 2.4.7

---
 srcpkgs/subversion/template | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/subversion/template b/srcpkgs/subversion/template
index 18c35e3a2132..0aa41212c5fd 100644
--- a/srcpkgs/subversion/template
+++ b/srcpkgs/subversion/template
@@ -24,6 +24,8 @@ distfiles="http://apache.uvigo.es/subversion/subversion-${version}.tar.bz2"
 checksum=c9130e8d0b75728a66f0e7038fc77052e671830d785b5616aad53b4810d3cc28
 
 pre_configure() {
+	./autogen.sh --release
+
 	# Based on native build values
 	cat <<-EOF >config.cache
 	ac_cv_python_includes=-I${XBPS_CROSS_BASE}/usr/include/python${py3_ver}
@@ -59,7 +61,12 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+
+	if [ "$XBPS_BUILD_ENVIRONMENT" = "void-packages-ci" ]; then
+		# This test will fail when run as the root user,
+		# because flock() will ignore file permissions.
+		vsed -i subversion/tests/libsvn_fs/locks-test.c -e '/SVN_TEST_OPTS_PASS(obtain_write_lock_failure,/,+3d'
+	fi
 }
 
 post_configure() {

From 23ecdd87a8c0b4535f2c8e7c1600c963130b00ad Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:38 -0700
Subject: [PATCH 13/37] subversion-kwallet-auth: update to 1.14.2.

Fix failing distfiles.
Fix build for libtool 2.4.7
---
 srcpkgs/subversion-kwallet-auth/template | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/subversion-kwallet-auth/template b/srcpkgs/subversion-kwallet-auth/template
index 12210f250d51..9cc68c3fe5f1 100644
--- a/srcpkgs/subversion-kwallet-auth/template
+++ b/srcpkgs/subversion-kwallet-auth/template
@@ -3,7 +3,7 @@
 # THIS PKG MUST BE SYNCHRONIZED WITH "srcpkgs/subversion".
 #
 pkgname=subversion-kwallet-auth
-version=1.14.1
+version=1.14.2
 revision=1
 wrksrc="subversion-${version}"
 build_style=gnu-configure
@@ -22,10 +22,12 @@ license="Apache-2.0, BSD-3-Clause"
 homepage="http://subversion.apache.org/"
 changelog="https://subversion.apache.org/docs/release-notes/${version%.*}.html"
 distfiles="http://apache.uvigo.es/subversion/subversion-${version}.tar.bz2"
-checksum=2c5da93c255d2e5569fa91d92457fdb65396b0666fad4fd59b22e154d986e1a9
+checksum=c9130e8d0b75728a66f0e7038fc77052e671830d785b5616aad53b4810d3cc28
 lib32disabled=yes
 
 pre_configure() {
+	./autogen.sh --release
+
 	# Based on native build values
 	cat <<-EOF >config.cache
 	ac_cv_python_includes=-I${XBPS_CROSS_BASE}/usr/include/python${py3_ver}
@@ -55,11 +57,18 @@ pre_configure() {
 		cp "$XBPS_CROSS_BASE/usr/lib/perl5/core_perl/Config"*.p? $PERL5LIB
 		cp "$XBPS_CROSS_BASE/usr/lib/perl5/core_perl/Errno.pm" $PERL5LIB
 		vsed -e "s;archlibexp => '\(.*\)';archlibexp => '${XBPS_CROSS_BASE}\1';" \
-			-i $PERL5LIB/Config.pm $PERL5LIB/Config_heavy.pl
+			-i $PERL5LIB/Config.pm
+		vsed -e "s;archlibexp='\(.*\)';archlibexp='${XBPS_CROSS_BASE}\1';" \
+			-i $PERL5LIB/Config_heavy.pl
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+
+	if [ "$XBPS_BUILD_ENVIRONMENT" = "void-packages-ci" ]; then
+		# This test will fail when run as the root user,
+		# because flock() will ignore file permissions.
+		vsed -i subversion/tests/libsvn_fs/locks-test.c -e '/SVN_TEST_OPTS_PASS(obtain_write_lock_failure,/,+3d'
+	fi
 }
 
 post_configure() {

From bcb981f3f66f4924bc4064e4328f3f6c045aae70 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 14/37] cross-aarch64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..bd6b23f9fb6a 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From a69447eae7ff4ce766c780af67bb64134060a212 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 15/37] cross-aarch64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..427ad2c1e9cd 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 7801ee2e39d579e0b2d315d5dc144d2dab51f522 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 16/37] cross-arm-linux-gnueabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..2510ee26e789 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 95c6d3c8e0b0eaf22cf3396fc68dd9bf3f72c373 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 17/37] cross-arm-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..bd8b16e1b4c1 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 8c984eb2b558a3e3854204c9ffd7209364b8b5b3 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 18/37] cross-arm-linux-musleabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..dacfd2655216 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 02fe6c98554fb3127d1b9c1eb236e979fbf9d831 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 19/37] cross-arm-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..9ddd32a9f20d 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 0c5e77dc4ebb8be4d07dbe72feb40be9918252a1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 20/37] cross-armv7l-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..9fb00f18be3b 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From c53d662ca6ca471002ab7544adbaac7abe3c293b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 21/37] cross-armv7l-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..2c72e75ddfe3 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 88396c42570b5845a8aa2c84ba0f150ef459482b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 22/37] cross-i686-pc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..4dc17df648b5 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From f4c2895a6bb578a4a1086bbdfd32efefcfbbd298 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Fri, 16 Sep 2022 20:52:19 -0700
Subject: [PATCH 23/37] cross-i686-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-linux-musl/template b/srcpkgs/cross-i686-linux-musl/template
index 8be16a230d8d..78b4d813a113 100644
--- a/srcpkgs/cross-i686-linux-musl/template
+++ b/srcpkgs/cross-i686-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-i686-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-i686-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From a866d792e6095fb3f53456e76391bdc5b5bbbc6d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 24/37] cross-mips-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..6009e5c79eb2 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From b527df98b8628168e8cc8b2fc27100ae36823ec2 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 25/37] cross-mips-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..080164df193d 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="hipperson0 <hipperson0@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 79108378308728b355ab40d657f6589483ec6db2 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 26/37] cross-mipsel-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..f9fd4b8a04ef 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 3137c04be522ee8c420936bfb045960ac3efe7d0 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 27/37] cross-mipsel-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..7418a984474b 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From e80cd94011391365ff3b2f740f258753fa143df8 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 28/37] cross-powerpc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..31e57b4e52b2 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From a4439b50c1e4b950ea7af1986bb99687d9189df5 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 29/37] cross-powerpc-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..a2d1edcf1ffd 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From bb1ec614cd4bdff671bb888bbb62f8f8a4f27af6 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 30/37] cross-powerpc64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..1a4cbed61e76 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From db101084a563af2b2f58d682af1c889b602d7cc8 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 31/37] cross-powerpc64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 016f18776a6d..19b1ff859eb6 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From eb0f5c9a8657eb884dd6dd90daabb27221b377bd Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 32/37] cross-powerpc64le-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 463d7e92d20d..9d99a3a315d2 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From c80d9a9674e638a2e2c820668d6aa7684179f8a4 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 33/37] cross-powerpc64le-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index c17a3cccfe29..3128baa7372e 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From f2ebfc2c16334a2cc9f5dfaed5867ee4f5127a47 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 34/37] cross-powerpcle-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 9aede3c465ce..0462a1015a1a 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 
@@ -35,6 +35,8 @@ if [ "$XBPS_TARGET_MACHINE" = "ppcle" ]; then
 	broken="Can't build crosstoolchain to itself"
 fi
 
+broken="glibc uses big-endian specific instructions on 32-bit powerpc"
+
 cross-powerpcle-linux-gnu-libc_package() {
 	short_desc+=" - glibc files"
 	nostrip=yes

From e0f7ae41a6149c712c3b12b247c85bdbfe1d3224 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 35/37] cross-powerpcle-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index 045cfda987fe..20e70bed4c60 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 1e569503dd572c014a8d91101778b902806d64c8 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 36/37] cross-x86_64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 8918f3c22a1c..5219cd50f851 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 41857088ff979f478cffdb4a13b47a0f79cea30b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 37/37] cross-x86_64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..2811de0d3c2e 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (197 preceding siblings ...)
  2022-10-14  4:54 ` oreo639
@ 2022-10-14  9:02 ` oreo639
  2022-10-14  9:04 ` oreo639
                   ` (65 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-10-14  9:02 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5478 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.2.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.2.0

There is a list of failing builds here: https://github.com/void-linux/void-packages/issues/39809

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [x] llvm https://github.com/void-linux/void-packages/pull/38694
- [x] m4 https://github.com/void-linux/void-packages/pull/33730
- [x] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [x] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [x] libvirt https://github.com/void-linux/void-packages/pull/38842
- [x] syslinux https://github.com/void-linux/void-packages/pull/38876
- [x] efivar https://github.com/void-linux/void-packages/pull/38874
- [ ] gpgme https://github.com/void-linux/void-packages/pull/38825

Known packages that needed to be fixed/updated for gcc12:
- [ ] linux5.18 (in this PR)
- [x] openssh https://github.com/void-linux/void-packages/pull/38849
- [x] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [x] doxygen https://github.com/void-linux/void-packages/pull/38846
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] libproxy https://github.com/void-linux/void-packages/pull/38818
- [x] exempi https://github.com/void-linux/void-packages/pull/38820
- [x] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [x] libunique1 https://github.com/void-linux/void-packages/pull/38848 or https://github.com/void-linux/void-packages/pull/38873
- [x] libwpd https://github.com/void-linux/void-packages/pull/38878
- [x] cglm https://github.com/void-linux/void-packages/pull/39748
- [x] coreboot-utils https://github.com/void-linux/void-packages/pull/39749
- [x] apl https://github.com/void-linux/void-packages/pull/39750
- [x] igt-gpu-tools https://github.com/void-linux/void-packages/pull/39780

Needs to be fixed/updated for binutils:
- [x] grub https://github.com/void-linux/void-packages/pull/38875
- [x] linux-tools https://github.com/void-linux/void-packages/pull/38877
- [x] kcov https://github.com/void-linux/void-packages/pull/39291

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [x] kde
- [x] lxde
- [x] lxqt

You can test the ISOs here:
https://drive.google.com/drive/folders/1ix92CYSLUP-KWjLxltdgG4e8Nu2JCY5n?usp=sharing

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 136367 bytes --]

From fbf1a62679f519e8c86a501129188ceb820e2d45 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 01/37] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../fix-libcollector-without-java.patch       | 53 +++++++++++++++
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 25 ++++---
 4 files changed, 87 insertions(+), 117 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
 create mode 100644 srcpkgs/binutils/patches/fix-libcollector-without-java.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/fix-libcollector-without-java.patch b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
new file mode 100644
index 000000000000..54384875f358
--- /dev/null
+++ b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
@@ -0,0 +1,53 @@
+From 49ddd814ac1071af7c4f45d5f8398b91862f2c7f Mon Sep 17 00:00:00 2001
+From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
+Date: Wed, 17 Aug 2022 19:55:23 -0700
+Subject: [PATCH] gprofng: fix bug 29479 Collection fails when built without
+ java support
+
+gprofng/ChangeLog
+2022-08-17  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>
+
+	PR gprofng/29479
+	* libcollector/collector.c: Add #if defined(GPROFNG_JAVA_PROFILING) for
+	java specific code.
+	* libcollector/unwind.c: Likewise.
+---
+ gprofng/libcollector/collector.c | 2 ++
+ gprofng/libcollector/unwind.c    | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/gprofng/libcollector/collector.c b/gprofng/libcollector/collector.c
+index 93c9d3330de5..ceff2c1caccb 100644
+--- a/gprofng/libcollector/collector.c
++++ b/gprofng/libcollector/collector.c
+@@ -913,8 +913,10 @@ __collector_open_experiment (const char *exp, const char *params, sp_origin_t or
+   __collector_ext_unwind_key_init (1, NULL);
+ 
+   /* start java attach if suitable */
++#if defined(GPROFNG_JAVA_PROFILING)
+   if (exp_origin == SP_ORIGIN_DBX_ATTACH)
+     __collector_jprofile_start_attach ();
++#endif
+   start_sec_time = CALL_UTIL (time)(NULL);
+   __collector_start_time = collector_interface.getHiResTime ();
+   TprintfT (DBG_LT0, "\t__collector_open_experiment; resetting start_time\n");
+diff --git a/gprofng/libcollector/unwind.c b/gprofng/libcollector/unwind.c
+index 119243788020..f8e11823c81e 100644
+--- a/gprofng/libcollector/unwind.c
++++ b/gprofng/libcollector/unwind.c
+@@ -557,6 +557,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+   int size = max_frame_size;
+ 
+ #define MIN(a,b) ((a)<(b)?(a):(b))
++#if defined(GPROFNG_JAVA_PROFILING)
+   /* get Java info */
+   if (__collector_java_mode && __collector_java_asyncgetcalltrace_loaded && context && !pseudo_context)
+     {
+@@ -569,6 +570,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+ 	  size -= sz;
+ 	}
+     }
++#endif
+ 
+   /* get native stack */
+   if (context)
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..c355a5fc8016 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkgconf"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -35,15 +36,21 @@ do_configure() {
 	local conf
 
 	if [ "$CHROOT_READY" ]; then
-		conf+=" --with-debuginfod"
+		conf+=" --with-debuginfod --enable-shared"
 	else
-		conf+=" --without-debuginfod --disable-install-libbfd"
+		conf+=" --without-debuginfod --disable-shared --disable-install-libbfd"
 	fi
 	if [ "$CROSS_BUILD" ]; then
 		# we don't want --with-sysroot=${XBPS_CROSS_BASE} like gnu-configure
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	# gprofng currently only supports x86 and aarch64 glibc.
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64|i386|aarch64) conf+=" --enable-gprofng" ;;
+		*) conf+=" --disable-gprofng" ;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"
@@ -76,13 +83,14 @@ do_configure() {
 		--libdir=/usr/lib \
 		--mandir=/usr/share/man \
 		--infodir=/usr/share/info \
+		--sysconfdir=/etc \
 		--disable-werror \
-		--disable-shared \
 		--disable-nls \
 		--enable-threads \
 		--enable-plugins \
 		--enable-relro \
 		--enable-gold \
+		--enable-new-dtags \
 		--enable-deterministic-archives \
 		--enable-64-bit-bfd \
 		--enable-ld=default \
@@ -142,7 +150,8 @@ binutils-devel_package() {
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/*.a"
-		vmove "usr/lib/*.so"
+		vmove "usr/lib/libbfd.so"
+		vmove "usr/lib/libopcodes.so"
 	}
 }
 

From 575965414ecbb00a4a724f350d64e50b96216b32 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 2 Oct 2022 16:46:59 -0700
Subject: [PATCH 02/37] gdb: resolve conflict with binutils 2.39

---
 srcpkgs/gdb/template | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/gdb/template b/srcpkgs/gdb/template
index ff7c9d9a5911..5970402eb27e 100644
--- a/srcpkgs/gdb/template
+++ b/srcpkgs/gdb/template
@@ -1,7 +1,7 @@
 # Template file for 'gdb'
 pkgname=gdb
 version=12.1
-revision=1
+revision=2
 build_style=gnu-configure
 pycompile_dirs="/usr/share/gdb/python"
 configure_args="--disable-werror --disable-nls --with-system-readline
@@ -48,7 +48,8 @@ vopt_conflict debuginfod static
 
 post_install() {
 	# resolve conflicts with binutils
-	rm -r ${DESTDIR}/usr/{include,lib,share/info/bfd.info*}
+	rm -rf ${DESTDIR}/usr/{include,lib}
+	rm -rf ${DESTDIR}/usr/share/info/{bfd,ctf-spec}.info*
 }
 
 gdb-common_package() {

From e7cd89dc29ec074c033cedce73a0ea981ca9ae54 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 03/37] gcc: update to 12.2.0.

---
 common/shlibs                                 |  10 +-
 srcpkgs/gcc/files/gccgo-musl.patch            |  71 ++-------
 srcpkgs/gcc/files/libgnarl-musl.patch         |  18 +--
 srcpkgs/gcc/files/libssp-musl.patch           |  10 +-
 srcpkgs/gcc/patches/libffi_gnulinux.patch     |  11 --
 .../gcc/patches/libgcc-ibm128-no-tag.patch    |  10 +-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |   2 +-
 srcpkgs/gcc/template                          | 136 +++++++++---------
 8 files changed, 105 insertions(+), 163 deletions(-)
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index 2c579d7b5a3e..006ab88d9696 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.2.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.36 perl-5.36.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -847,8 +847,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.2.0_1
+libgnat-12.so libada-12.2.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1698,8 +1698,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.2.0_1
+libasan.so.8 libsanitizer-12.2.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..12ec68dd8aa3 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,14 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ b/libgo/go/runtime/os_linux.go
+@@ -365,7 +365,7 @@ func setThreadCPUProfiler(hz int32) {
+ 	var sevp _sigevent
+ 	sevp.sigev_notify = _SIGEV_THREAD_ID
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.__sev_fields))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..5ffd54e466ae 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,37 +3,35 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
+version=12.2.0
+revision=1
+_minorver="${version%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
-wrksrc=gcc-${version/pre/_pre}
+_mpc_version=1.2.1
+_isl_version=0.24
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
+create_wrksrc=yes
+build_wrksrc="gcc-${version}"
+patch_args="-Np1 --directory=${build_wrksrc}"
 lib32disabled=yes
 bootstrap=yes
 replaces="gcc-gcj<7.2.0 gcc-gcj-jdk-compat<7.2.0 libmpx>=0 libmpx-devel>=0"
@@ -52,8 +50,11 @@ if [ "$CHROOT_READY" ]; then
 	hostmakedepends="tar texinfo perl flex"
 else
 	_have_gccgo=no
+	# libzstd fails to link in bootstrap with glibc 2.36
+	# when zlib has been compiled with glibc 2.32.
+	LDFLAGS="-lzstd -pthread"
 fi
-makedepends="zlib-devel"
+makedepends="zlib-devel libzstd-devel"
 depends="binutils libgcc-devel-${version}_${revision}
  libstdc++-devel-${version}_${revision} libssp-devel-${version}_${revision}"
 checkdepends="dejagnu"
@@ -70,13 +71,13 @@ if [ "$build_option_gnatboot" ]; then
 	case "$XBPS_TARGET_MACHINE" in
 	x86_64)
 		_gnat_tarball="gnat-gpl-2017-x86_64-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/591c6d80c7a447af2deed1d7>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/9682e2e1f2f232ce03fe21d77b14c37a0de5649b?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" b942bcac20dea39748b39f8b624d9619f60a8dee2e8195dbe3829c835b0956e6"
 		build_options_default="gnatboot"
 		;;
 	i686)
 		_gnat_tarball="gnat-gpl-2014-x86-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/564b3e9dc8e196b040fbe248>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/c5e9e6fdff5cb77ed90cf8c62536653e27c0bed6?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" 3b693510f5d22a240abb3034934c1adbd80ccd6e4f61a4f491cc408fdfd9c042"
 		build_options_default="gnatboot"
 		;;
@@ -155,25 +156,24 @@ if [ "$CROSS_BUILD" ]; then
 fi
 
 post_extract() {
-	mkdir -p ${wrksrc}/{gmp,mpfr,mpc,isl}
-	cp -ar ${XBPS_BUILDDIR}/gmp-${_gmp_version}/* ${wrksrc}/gmp/
-	cp -ar ${XBPS_BUILDDIR}/mpfr-${_mpfr_version}/* ${wrksrc}/mpfr/
-	cp -ar ${XBPS_BUILDDIR}/mpc-${_mpc_version}/* ${wrksrc}/mpc/
-	cp -ar ${XBPS_BUILDDIR}/isl-${_isl_version}/* ${wrksrc}/isl/
+	ln -s ${wrksrc}/gmp-${_gmp_version} ${wrksrc}/${build_wrksrc}/gmp
+	ln -s ${wrksrc}/mpfr-${_mpfr_version} ${wrksrc}/${build_wrksrc}/mpfr
+	ln -s ${wrksrc}/mpc-${_mpc_version} ${wrksrc}/${build_wrksrc}/mpc
+	ln -s ${wrksrc}/isl-${_isl_version} ${wrksrc}/${build_wrksrc}/isl
 
 	if [ "$build_option_gnatboot" ]; then
 		local f="${XBPS_SRCDISTDIR}/${pkgname}-${version}/${_gnat_tarball}"
 		msg_normal "Extracting ${_gnat_tarball} ...\n"
-		mkdir -p ${wrksrc}/gnat-ins
-		tar -x -f "$f" --strip-components=1 -C ${wrksrc}/gnat-ins
-		cd ${wrksrc}/gnat-ins
-		make ins-all prefix=${wrksrc}/gnat
-		cd ${wrksrc}
-		rm -rf ${wrksrc}/gnat-ins
+		mkdir -p ${wrksrc}/${build_wrksrc}/gnat-ins
+		tar -x -f "$f" --strip-components=1 -C ${wrksrc}/${build_wrksrc}/gnat-ins
+		cd ${wrksrc}/${build_wrksrc}/gnat-ins
+		make ins-all prefix=${wrksrc}/${build_wrksrc}/gnat
+		cd ${wrksrc}/${build_wrksrc}
+		rm -rf ${wrksrc}/${build_wrksrc}/gnat-ins
 
 		# Rename obsolete ld and as
-		find ${wrksrc}/gnat -name ld -exec mv -v {} {}.old \;
-		find ${wrksrc}/gnat -name as -exec mv -v {} {}.old \;
+		find ${wrksrc}/${build_wrksrc}/gnat -name ld -exec mv -v {} {}.old \;
+		find ${wrksrc}/${build_wrksrc}/gnat -name as -exec mv -v {} {}.old \;
 	fi
 }
 
@@ -185,9 +185,9 @@ pre_configure() {
 	sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
 
 	if [ "$XBPS_TARGET_LIBC" = musl ]; then
-		patch -p1 -i ${FILESDIR}/libgnarl-musl.patch
-		patch -p1 -i ${FILESDIR}/libssp-musl.patch
-		patch -p1 -i ${FILESDIR}/gccgo-musl.patch
+		for p in ${FILESDIR}/*-musl.patch; do
+			patch -p1 -i $p
+		done
 	fi
 }
 do_configure() {
@@ -297,19 +297,19 @@ do_configure() {
 		_args+=" --enable-languages=${_langs},ada"
 		_args+=" --enable-libada"
 		CONFIG_SHELL=/bin/bash \
-		CC="${wrksrc}/gnat/bin/gcc" \
-		GNATBIND="${wrksrc}/gnat/bin/gnatbind" \
-		GNATMAKE="${wrksrc}/gnat/bin/gnatmake" \
-		PATH="${wrksrc}/gnat/bin:$PATH" \
-			${wrksrc}/configure ${_args}
+		CC="${wrksrc}/${build_wrksrc}/gnat/bin/gcc" \
+		GNATBIND="${wrksrc}/${build_wrksrc}/gnat/bin/gnatbind" \
+		GNATMAKE="${wrksrc}/${build_wrksrc}/gnat/bin/gnatmake" \
+		PATH="${wrksrc}/${build_wrksrc}/gnat/bin:$PATH" \
+			${wrksrc}/${build_wrksrc}/configure ${_args}
 	elif [ "$build_option_ada" ]; then
 		_args+=" --enable-languages=${_langs},ada"
 		CONFIG_SHELL=/bin/bash \
-			${wrksrc}/configure ${_args}
+			${wrksrc}/${build_wrksrc}/configure ${_args}
 	else
 		_args+=" --enable-languages=${_langs}"
 		CONFIG_SHELL=/bin/bash \
-			${wrksrc}/configure ${_args}
+			${wrksrc}/${build_wrksrc}/configure ${_args}
 	fi
 }
 do_build() {
@@ -318,10 +318,10 @@ do_build() {
 	fi
 	cd build
 	if [ "$build_option_gnatboot" ]; then
-		CC="${wrksrc}/gnat/bin/gcc" \
-		GNATBIND="${wrksrc}/gnat/bin/gnatbind" \
-		GNATMAKE="${wrksrc}/gnat/bin/gnatmake" \
-		PATH="${wrksrc}/gnat/bin:$PATH" \
+		CC="${wrksrc}/${build_wrksrc}/gnat/bin/gcc" \
+		GNATBIND="${wrksrc}/${build_wrksrc}/gnat/bin/gnatbind" \
+		GNATMAKE="${wrksrc}/${build_wrksrc}/gnat/bin/gnatmake" \
+		PATH="${wrksrc}/${build_wrksrc}/gnat/bin:$PATH" \
 		make ${makejobs}
 	else
 		make ${makejobs}
@@ -330,7 +330,7 @@ do_build() {
 pre_install() {
 	if [ "$CROSS_BUILD" ]; then
 		# XXX otherwise links to host libpthread
-		for f in $(find ${wrksrc}/build/${XBPS_CROSS_TRIPLET} -type f -name libtool); do
+		for f in $(find ${wrksrc}/${build_wrksrc}/build/${XBPS_CROSS_TRIPLET} -type f -name libtool); do
 			sed -e "s,add_dir=\"-L\$libdir\",add_dir=\"-L${XBPS_CROSS_BASE}\$libdir\",g" -i $f
 		done
 	fi
@@ -342,16 +342,16 @@ do_install() {
 
 	# Make version a symlink of major version to make all versions
 	# from the same series work automagically.
-	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver} \
+	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${version} \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver}
 	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver} \
-		${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}
+		${DESTDIR}/usr/lib/gcc/${_triplet}/${version}
 
 	# Ditto for c++ headers.
-	mv ${DESTDIR}/usr/include/c++/${_patchver} \
+	mv ${DESTDIR}/usr/include/c++/${version} \
 		${DESTDIR}/usr/include/c++/${_minorver}
 	ln -sfr ${DESTDIR}/usr/include/c++/${_minorver} \
-		${DESTDIR}/usr/include/c++/${_patchver}
+		${DESTDIR}/usr/include/c++/${version}
 
 	# cc symlink
 	ln -sfr ${DESTDIR}/usr/bin/gcc ${DESTDIR}/usr/bin/cc
@@ -360,7 +360,7 @@ do_install() {
 
 	# lto plugin symlink
 	vmkdir usr/lib/bfd-plugins
-	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}/liblto_plugin.so \
+	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${version}/liblto_plugin.so \
 		${DESTDIR}/usr/lib/bfd-plugins
 
 	# Remove "fixed" header
@@ -371,13 +371,9 @@ do_install() {
 	rm -f ${DESTDIR}/usr/lib/libffi*
 	rm -f ${DESTDIR}/usr/share/man/man3/ffi*
 
-	# Remove all python scripts in libdir.
-	rm -f ${DESTDIR}/usr/lib/*.py
-
-	# Remove more python stuff.
-	if [ -d ${DESTDIR}/usr/share/gcc-${_patchver}/python ]; then
-		rm -rf ${DESTDIR}/usr/share/gcc-${_patchver}/python
-	fi
+	# Move libstdc++ gdb helpers to location where gdb can autoload them
+	mkdir -p ${DESTDIR}/usr/share/gdb/auto-load/usr/lib
+	mv ${DESTDIR}/usr/lib/*.py ${DESTDIR}/usr/share/gdb/auto-load/usr/lib
 
 	# Install c89 and c99 wrappers and its manpages, from NetBSD.
 	for f in c89 c99; do
@@ -396,7 +392,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}
@@ -449,7 +445,7 @@ gcc-fortran_package() {
 		if [ "$CROSS_BUILD" ]; then
 			# A number of OMP modules are not built when cross
 			# compiling gcc. Copy them from the cross compiler.
-			local src="/usr/lib/gcc/${_triplet}/${_patchver}/finclude"
+			local src="/usr/lib/gcc/${_triplet}/${version}/finclude"
 			local dst="usr/lib/gcc/${_triplet}/${_minorver}/finclude"
 			for f in omp_lib.f90 omp_lib.h omp_lib.mod omp_lib_kinds.mod \
 				openacc.f90 openacc.mod openacc_kinds.mod openacc_lib.h; do
@@ -516,7 +512,7 @@ libgfortran_package() {
 	short_desc+=" - Fortran library"
 	pkg_install() {
 		vmove "usr/lib/libgfortran.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -537,7 +533,7 @@ libgo_package() {
 	nostrip=yes
 	pkg_install() {
 		vmove "usr/lib/libgo.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -553,7 +549,7 @@ libobjc_package() {
 	short_desc+=" - Objective-C library"
 	pkg_install() {
 		vmove "usr/lib/libobjc.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -572,7 +568,7 @@ libquadmath_package() {
 	short_desc+=" - quadmath library"
 	pkg_install() {
 		vmove "usr/lib/libquadmath.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -614,7 +610,7 @@ libgcc_package() {
 	noverifyrdeps=yes
 	pkg_install() {
 		vmove "usr/lib/libgcc_s.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -645,7 +641,7 @@ libgomp_package() {
 	short_desc+=" - OpenMP v4.0 library"
 	pkg_install() {
 		vmove "usr/lib/libgomp*.so.*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -700,7 +696,7 @@ libssp_package() {
 	short_desc+=" - SSP (StackSmashingProtection) library"
 	pkg_install() {
 		vmove "usr/lib/libssp.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -717,7 +713,9 @@ libstdc++-devel_package() {
 libstdc++_package() {
 	short_desc+=" - Standard C++ Library"
 	pkg_install() {
+		vmove usr/share/gdb
+		vmove usr/share/gcc-${version}/python
 		vmove "usr/lib/libstdc++.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }

From cf62635ca6c8ebd3db709b16432382bf914cea4a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 04/37] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      | 11 ++++--
 2 files changed, 25 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..a4087ec2055e 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,12 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
+
+if [ "$XBPS_TARGET_LIBC" == "musl" ]; then
+	# Musl always searches LD_LIBRARY_PATH before RPATH and RUNPATH
+	make_build_args="lt_cv_shlibpath_overrides_runpath=yes"
+fi
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From 675de62be1c0e30eaefa2d72e3a7d92cc9e8e71a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 05/37] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 55255dceae8b..ca2d858a7abc 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From 0145ab3aef79a08daad80c9fc745515cae7efa4c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 06/37] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 ...e-hash-style-both-for-building-glibc.patch | 143 +++++++++
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 4 files changed, 198 insertions(+), 353 deletions(-)
 create mode 100644 srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index 006ab88d9696..79f9929d89b5 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch b/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
new file mode 100644
index 000000000000..177e0a82a126
--- /dev/null
+++ b/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
@@ -0,0 +1,143 @@
+Temporary workaround for EAC bug.
+
+From 8e90e2cc5e57d7ca3a40602d278e9642a8b66716 Mon Sep 17 00:00:00 2001
+From: oreo639 <oreo6391@gmail.com>
+Date: Tue, 13 Sep 2022 14:30:35 -0700
+Subject: [PATCH] Revert "Do not use --hash-style=both for building glibc
+ shared objects"
+
+This reverts commit e47de5cb2d4dbecb58f569ed241e8e95c568f03c.
+---
+ Makeconfig     |  9 +++++++++
+ Makerules      |  7 +++++++
+ config.make.in |  1 +
+ configure      | 28 ++++++++++++++++++++++++++++
+ configure.ac   | 16 ++++++++++++++++
+ 5 files changed, 61 insertions(+)
+
+diff --git a/Makeconfig b/Makeconfig
+index ba70321af1..e2131d4389 100644
+--- a/Makeconfig
++++ b/Makeconfig
+@@ -371,6 +371,15 @@ dt-relr-ldflag =
+ no-dt-relr-ldflag =
+ endif
+ 
++ifeq (yes,$(have-hash-style))
++# For the time being we unconditionally use 'both'.  At some time we
++# should declare statically linked code as 'out of luck' and compile
++# with --hash-style=gnu only.
++hashstyle-LDFLAGS = -Wl,--hash-style=both
++LDFLAGS.so += $(hashstyle-LDFLAGS)
++LDFLAGS-rtld += $(hashstyle-LDFLAGS)
++endif
++
+ ifeq (no,$(build-pie-default))
+ pie-default = $(no-pie-ccflag)
+ else # build-pie-default
+diff --git a/Makerules b/Makerules
+index d1e139d03c..44134e37ce 100644
+--- a/Makerules
++++ b/Makerules
+@@ -558,6 +558,13 @@ $(common-objpfx)shlib.lds: $(common-objpfx)config.make $(..)Makerules
+ 		  -Wl,--verbose 2>/dev/null | \
+ 	  sed > $@T \
+ 	      -e '/^=========/,/^=========/!d;/^=========/d' \
++	      $(if $(filter yes,$(have-hash-style)), \
++		   -e 's/^.*\.gnu\.hash[ 	]*:.*$$/  .note.ABI-tag : { *(.note.ABI-tag) } &/' \
++		   -e '/^[ 	]*\.hash[ 	]*:.*$$/{h;d;}' \
++		   -e '/DATA_SEGMENT_ALIGN/{H;g}' \
++		, \
++		   -e 's/^.*\.hash[ 	]*:.*$$/  .note.ABI-tag : { *(.note.ABI-tag) } &/' \
++	       ) \
+ 	      -e 's/^.*\*(\.dynbss).*$$/& \
+ 		 PROVIDE(__start___libc_freeres_ptrs = .); \
+ 		 *(__libc_freeres_ptrs) \
+diff --git a/config.make.in b/config.make.in
+index d7c416cbea..130e639da2 100644
+--- a/config.make.in
++++ b/config.make.in
+@@ -69,6 +69,7 @@ have-libaudit = @have_libaudit@
+ have-libcap = @have_libcap@
+ have-cc-with-libunwind = @libc_cv_cc_with_libunwind@
+ bind-now = @bindnow@
++have-hash-style = @libc_cv_hashstyle@
+ use-default-link = @use_default_link@
+ have-cxx-thread_local = @libc_cv_cxx_thread_local@
+ have-loop-to-function = @libc_cv_cc_loop_to_function@
+diff --git a/configure b/configure
+index ff2c406b3b..07f9376668 100755
+--- a/configure
++++ b/configure
+@@ -621,6 +621,7 @@ libc_cv_cc_submachine
+ libc_cv_cc_nofma
+ libc_cv_mtls_dialect_gnu2
+ libc_cv_has_glob_dat
++libc_cv_hashstyle
+ libc_cv_fpie
+ libc_cv_z_execstack
+ ASFLAGS_config
+@@ -6192,6 +6193,33 @@ $as_echo "$libc_cv_fpie" >&6; }
+ 
+ 
+ 
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --hash-style option" >&5
++$as_echo_n "checking for --hash-style option... " >&6; }
++if ${libc_cv_hashstyle+:} false; then :
++  $as_echo_n "(cached) " >&6
++else
++  cat > conftest.c <<EOF
++int _start (void) { return 42; }
++EOF
++if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS $no_ssp
++			    -fPIC -shared -o conftest.so conftest.c
++			    -Wl,--hash-style=both -nostdlib 1>&5'
++  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
++  test $ac_status = 0; }; }
++then
++  libc_cv_hashstyle=yes
++else
++  libc_cv_hashstyle=no
++fi
++rm -f conftest*
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_hashstyle" >&5
++$as_echo "$libc_cv_hashstyle" >&6; }
++
++
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLOB_DAT reloc" >&5
+ $as_echo_n "checking for GLOB_DAT reloc... " >&6; }
+ if ${libc_cv_has_glob_dat+:} false; then :
+diff --git a/configure.ac b/configure.ac
+index eb5bc6a131..870347c5cd 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1360,6 +1360,22 @@ LIBC_TRY_CC_OPTION([-fpie], [libc_cv_fpie=yes], [libc_cv_fpie=no])
+ 
+ AC_SUBST(libc_cv_fpie)
+ 
++AC_CACHE_CHECK(for --hash-style option,
++	       libc_cv_hashstyle, [dnl
++cat > conftest.c <<EOF
++int _start (void) { return 42; }
++EOF
++if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS $no_ssp
++			    -fPIC -shared -o conftest.so conftest.c
++			    -Wl,--hash-style=both -nostdlib 1>&AS_MESSAGE_LOG_FD])
++then
++  libc_cv_hashstyle=yes
++else
++  libc_cv_hashstyle=no
++fi
++rm -f conftest*])
++AC_SUBST(libc_cv_hashstyle)
++
+ AC_CACHE_CHECK(for GLOB_DAT reloc,
+ 	       libc_cv_has_glob_dat, [dnl
+ cat > conftest.c <<EOF
+-- 
+2.37.3
+
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From d85efa1b3d4c06a2eb1cb8ebeb985b1ca207f969 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Wed, 14 Sep 2022 03:48:32 -0700
Subject: [PATCH 07/37] musl: add support for SIGEV_THREAD_ID timers

https://git.musl-libc.org/cgit/musl/commit/?id=7c71792e87691451f2a6b76348e83ad1889f1dcb
---
 ...d-support-for-SIGEV_THREAD_ID-timers.patch | 74 +++++++++++++++++++
 srcpkgs/musl/template                         |  2 +-
 2 files changed, 75 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch

diff --git a/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
new file mode 100644
index 000000000000..e20dff5ba0d4
--- /dev/null
+++ b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
@@ -0,0 +1,74 @@
+From 7c71792e87691451f2a6b76348e83ad1889f1dcb Mon Sep 17 00:00:00 2001
+From: James Y Knight <jyknight@google.com>
+Date: Sun, 30 Jun 2019 21:55:20 -0400
+Subject: [PATCH] add support for SIGEV_THREAD_ID timers
+
+This is like SIGEV_SIGNAL, but targeted to a particular thread's
+tid, rather than the process.
+---
+ include/signal.h        | 16 +++++++++++++---
+ src/time/timer_create.c |  8 ++++++--
+ 2 files changed, 19 insertions(+), 5 deletions(-)
+
+diff --git a/include/signal.h b/include/signal.h
+index fbdf667b2..9ed929e4f 100644
+--- a/include/signal.h
++++ b/include/signal.h
+@@ -180,14 +180,24 @@ struct sigevent {
+ 	union sigval sigev_value;
+ 	int sigev_signo;
+ 	int sigev_notify;
+-	void (*sigev_notify_function)(union sigval);
+-	pthread_attr_t *sigev_notify_attributes;
+-	char __pad[56-3*sizeof(long)];
++	union {
++		char __pad[64 - 2*sizeof(int) - sizeof(union sigval)];
++		pid_t sigev_notify_thread_id;
++		struct {
++			void (*sigev_notify_function)(union sigval);
++			pthread_attr_t *sigev_notify_attributes;
++		} __sev_thread;
++	} __sev_fields;
+ };
+ 
++#define sigev_notify_thread_id __sev_fields.sigev_notify_thread_id
++#define sigev_notify_function __sev_fields.__sev_thread.sigev_notify_function
++#define sigev_notify_attributes __sev_fields.__sev_thread.sigev_notify_attributes
++
+ #define SIGEV_SIGNAL 0
+ #define SIGEV_NONE 1
+ #define SIGEV_THREAD 2
++#define SIGEV_THREAD_ID 4
+ 
+ int __libc_current_sigrtmin(void);
+ int __libc_current_sigrtmax(void);
+diff --git a/src/time/timer_create.c b/src/time/timer_create.c
+index 5ddfda278..4bef23905 100644
+--- a/src/time/timer_create.c
++++ b/src/time/timer_create.c
+@@ -71,11 +71,15 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 	switch (evp ? evp->sigev_notify : SIGEV_SIGNAL) {
+ 	case SIGEV_NONE:
+ 	case SIGEV_SIGNAL:
++	case SIGEV_THREAD_ID:
+ 		if (evp) {
+ 			ksev.sigev_value = evp->sigev_value;
+ 			ksev.sigev_signo = evp->sigev_signo;
+ 			ksev.sigev_notify = evp->sigev_notify;
+-			ksev.sigev_tid = 0;
++			if (evp->sigev_notify == SIGEV_THREAD_ID)
++				ksev.sigev_tid = evp->sigev_notify_thread_id;
++			else
++				ksev.sigev_tid = 0;
+ 			ksevp = &ksev;
+ 		}
+ 		if (syscall(SYS_timer_create, clk, ksevp, &timerid) < 0)
+@@ -107,7 +111,7 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 
+ 		ksev.sigev_value.sival_ptr = 0;
+ 		ksev.sigev_signo = SIGTIMER;
+-		ksev.sigev_notify = 4; /* SIGEV_THREAD_ID */
++		ksev.sigev_notify = SIGEV_THREAD_ID;
+ 		ksev.sigev_tid = td->tid;
+ 		if (syscall(SYS_timer_create, clk, &ksev, &timerid) < 0)
+ 			timerid = -1;
diff --git a/srcpkgs/musl/template b/srcpkgs/musl/template
index 5bdc5c48e623..34e6ed4fba6e 100644
--- a/srcpkgs/musl/template
+++ b/srcpkgs/musl/template
@@ -2,7 +2,7 @@
 pkgname=musl
 reverts="1.2.0_1"
 version=1.1.24
-revision=10
+revision=11
 archs="*-musl"
 bootstrap=yes
 build_style=gnu-configure

From 476b59ba60052755b70a64ea3998fad012ce808c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 21:01:43 -0700
Subject: [PATCH 08/37] gcc-multilib: update to 12.2.0.

---
 srcpkgs/gcc-multilib/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index fcd25755aa75..df60849babc2 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,16 +3,16 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _majorver="${version%.*}"
-wrksrc=gcc-${version/pre/_pre}
+wrksrc="gcc-${version}"
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel
@@ -71,7 +71,7 @@ do_build() {
 	make ${makejobs}
 }
 do_install() {
-	local _pc_triplet=x86_64-pc-linux-gnu _version=${version%pre1}
+	local _pc_triplet=x86_64-pc-linux-gnu
 	# Install to a tempdir and then only copy relevant files.
 	cd ${wrksrc}
 	make DESTDIR=${wrksrc}/${pkgname}-build install
@@ -81,9 +81,9 @@ do_install() {
 	vmkdir usr/include/c++/${_majorver}/${_triplet}
 	vmkdir usr/lib/gcc/${_triplet}/${_majorver}
 
-	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${_version}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${version}/32 \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_majorver}/
-	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${_version}/${_pc_triplet}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${version}/${_pc_triplet}/32 \
 		${DESTDIR}/usr/include/c++/${_majorver}/${_triplet}
 
 	vinstall ${wrksrc}/host-${_pc_triplet}/gcc/specs 644 usr/lib/gcc/${_triplet}/${_majorver}

From aa1dd62c389ddb27c5585274a25dacfc58472997 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Tue, 4 Oct 2022 03:49:13 -0700
Subject: [PATCH 09/37] libgccjit: update to 12.2.0.

---
 srcpkgs/libgccjit/files/libgccjit-musl.patch | 63 --------------------
 srcpkgs/libgccjit/template                   | 38 ++++++------
 2 files changed, 17 insertions(+), 84 deletions(-)
 delete mode 100644 srcpkgs/libgccjit/files/libgccjit-musl.patch

diff --git a/srcpkgs/libgccjit/files/libgccjit-musl.patch b/srcpkgs/libgccjit/files/libgccjit-musl.patch
deleted file mode 100644
index d2ed16928c82..000000000000
--- a/srcpkgs/libgccjit/files/libgccjit-musl.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-diff --git a/gcc/jit/jit-playback.c b/gcc/jit/jit-playback.c
-index 5bccf591a..35f5e35ef 100644
---- a/gcc/jit/jit-playback.c
-+++ b/gcc/jit/jit-playback.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -41,8 +43,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "diagnostic.h"
- #include "stmt.h"
- 
--#include <pthread.h>
--
- #include "jit-playback.h"
- #include "jit-result.h"
- #include "jit-builtins.h"
-diff --git a/gcc/jit/jit-recording.c b/gcc/jit/jit-recording.c
-index a237d574f..5785e3269 100644
---- a/gcc/jit/jit-recording.c
-+++ b/gcc/jit/jit-recording.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -25,8 +27,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "pretty-print.h"
- #include "toplev.h"
- 
--#include <pthread.h>
--
- #include "jit-builtins.h"
- #include "jit-recording.h"
- #include "jit-playback.h"
-diff --git a/gcc/jit/libgccjit.c b/gcc/jit/libgccjit.c
-index f9c33c63c..75f21d275 100644
---- a/gcc/jit/libgccjit.c
-+++ b/gcc/jit/libgccjit.c
-@@ -18,13 +18,13 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
- #include "timevar.h"
- #include "typed-splay-tree.h"
- #include "cppbuiltin.h"
--#include <pthread.h>
- 
- #include "libgccjit.h"
- #include "jit-recording.h"
diff --git a/srcpkgs/libgccjit/template b/srcpkgs/libgccjit/template
index 6f1d6256dcd6..b5d4540ce667 100644
--- a/srcpkgs/libgccjit/template
+++ b/srcpkgs/libgccjit/template
@@ -3,36 +3,32 @@
 # which use the version number.
 
 pkgname=libgccjit
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
+version=12.2.0
 revision=1
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
-_majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
-wrksrc=gcc-${version/pre/_pre}
+_mpc_version=1.2.1
+_isl_version=0.24
 short_desc="Just-In-Time Compilation library for GCC"
 maintainer="Lane Biocini <lane@mailbox.org>"
 homepage="https://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 nopie=yes
+create_wrksrc=yes
+build_wrksrc="gcc-${version}"
+patch_args="-Np1 --directory=${build_wrksrc}"
 lib32disabled=yes
 makedepends="zlib-devel"
 hostmakedepends="tar texinfo perl flex"
@@ -40,10 +36,10 @@ depends="gcc"
 checkdepends="dejagnu"
 
 post_extract() {
-	mv ${XBPS_BUILDDIR}/gmp-${_gmp_version} ${wrksrc}/gmp
-	mv ${XBPS_BUILDDIR}/mpfr-${_mpfr_version} ${wrksrc}/mpfr
-	mv ${XBPS_BUILDDIR}/mpc-${_mpc_version} ${wrksrc}/mpc
-	mv ${XBPS_BUILDDIR}/isl-${_isl_version} ${wrksrc}/isl
+	ln -s ${wrksrc}/gmp-${_gmp_version} ${wrksrc}/${build_wrksrc}/gmp
+	ln -s ${wrksrc}/mpfr-${_mpfr_version} ${wrksrc}/${build_wrksrc}/mpfr
+	ln -s ${wrksrc}/mpc-${_mpc_version} ${wrksrc}/${build_wrksrc}/mpc
+	ln -s ${wrksrc}/isl-${_isl_version} ${wrksrc}/${build_wrksrc}/isl
 }
 
 pre_configure() {
@@ -186,7 +182,7 @@ do_configure() {
 	[ -z "$XBPS_CHECK_PKGS" ] && _langs="jit" || _langs="jit,c++"
 	_args+=" --enable-languages=${_langs}"
 	CONFIG_SHELL=/bin/bash \
-		${wrksrc}/configure ${_args}
+		${wrksrc}/${build_wrksrc}/configure ${_args}
 }
 
 do_build() {

From afd377b6e4a371ac870fb002e71394b87a1446e0 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 14 Aug 2022 19:29:36 -0700
Subject: [PATCH 10/37] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove -no-pie from build. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..5d40f0cdd8a6 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -53,6 +53,7 @@ _void_cross_build_binutils() {
 		--sbindir=/usr/bin \
 		--libdir=/usr/lib \
 		--libexecdir=/usr/lib \
+		--sysconfdir=/etc \
 		--target=${tgt} \
 		--with-sysroot=/usr/${tgt} \
 		--disable-nls \
@@ -60,7 +61,9 @@ _void_cross_build_binutils() {
 		--disable-multilib \
 		--disable-werror \
 		--disable-gold \
+		--disable-gprofng \
 		--enable-relro \
+		--enable-new-dtags \
 		--enable-plugins \
 		--enable-64-bit-bfd \
 		--enable-deterministic-archives \
@@ -132,6 +135,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -460,6 +464,14 @@ do_build() {
 	local binutils_ver linux_ver gcc_ver libc_ver libucontext_ver
 	local tgt=${sourcepkg/cross-}
 
+	export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}"
+	export CXXFLAGS="${CXXFLAGS/-D_FORTIFY_SOURCE=2/}"
+
+	# Disable explicit -fno-PIE, gcc/binutils/libc will figure this out itself.
+	export CFLAGS="${CFLAGS//-fno-PIE/}"
+	export CXXFLAGS="${CXXFLAGS//-fno-PIE/}"
+	export LDFLAGS="${LDFLAGS//-no-pie/}"
+
 	_void_cross_test_ver binutils
 	_void_cross_test_ver linux
 	_void_cross_test_ver gcc
@@ -625,6 +637,9 @@ do_install() {
 	# then remove it because it conflicts with libquadmath package
 	rm -rf ${DESTDIR}/${sysroot}/usr/lib/libquadmath.*
 
+	# Remove libdep linker plugin because it conflicts with system binutils
+	rm -f ${DESTDIR}/usr/lib/bfd-plugins/libdep*
+
 	# Remove leftover symlinks
 	rm -f ${DESTDIR}/usr/lib${XBPS_TARGET_WORDSIZE}
 	rm -f ${DESTDIR}/lib*

From 8d74321e9568ce173e713f601764f418ce18f23d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:09:31 -0700
Subject: [PATCH 11/37] linux5.18: update dotconfigs for gcc12

---
 srcpkgs/linux5.18/files/x86_64-dotconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/linux5.18/files/x86_64-dotconfig b/srcpkgs/linux5.18/files/x86_64-dotconfig
index 4e73a3195d40..ea6204868e23 100644
--- a/srcpkgs/linux5.18/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.18/files/x86_64-dotconfig
@@ -512,6 +512,7 @@ CONFIG_RETHUNK=y
 CONFIG_CPU_UNRET_ENTRY=y
 CONFIG_CPU_IBPB_ENTRY=y
 CONFIG_CPU_IBRS_ENTRY=y
+CONFIG_SLS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10060,8 +10061,11 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
 # Memory initialization
 #
 CONFIG_INIT_STACK_NONE=y
+# CONFIG_INIT_STACK_ALL_PATTERN is not set
+# CONFIG_INIT_STACK_ALL_ZERO is not set
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
+# CONFIG_ZERO_CALL_USED_REGS is not set
 # end of Memory initialization
 # end of Kernel hardening options
 # end of Security options
@@ -10538,6 +10542,7 @@ CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
 # CONFIG_UBSAN is not set
 CONFIG_HAVE_ARCH_KCSAN=y
+# CONFIG_KCSAN is not set
 # end of Generic Kernel Debugging Instruments
 
 #

From 71acec031ab0ceb80f71a8ecd888abeb3b7f7a13 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:08 -0700
Subject: [PATCH 12/37] subversion: fix build for libtool 2.4.7

---
 srcpkgs/subversion/template | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/subversion/template b/srcpkgs/subversion/template
index 18c35e3a2132..0aa41212c5fd 100644
--- a/srcpkgs/subversion/template
+++ b/srcpkgs/subversion/template
@@ -24,6 +24,8 @@ distfiles="http://apache.uvigo.es/subversion/subversion-${version}.tar.bz2"
 checksum=c9130e8d0b75728a66f0e7038fc77052e671830d785b5616aad53b4810d3cc28
 
 pre_configure() {
+	./autogen.sh --release
+
 	# Based on native build values
 	cat <<-EOF >config.cache
 	ac_cv_python_includes=-I${XBPS_CROSS_BASE}/usr/include/python${py3_ver}
@@ -59,7 +61,12 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+
+	if [ "$XBPS_BUILD_ENVIRONMENT" = "void-packages-ci" ]; then
+		# This test will fail when run as the root user,
+		# because flock() will ignore file permissions.
+		vsed -i subversion/tests/libsvn_fs/locks-test.c -e '/SVN_TEST_OPTS_PASS(obtain_write_lock_failure,/,+3d'
+	fi
 }
 
 post_configure() {

From b31847bc684256e224ae8b5b8d1621737779c382 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:38 -0700
Subject: [PATCH 13/37] subversion-kwallet-auth: update to 1.14.2.

Fix failing distfiles.
Fix build for libtool 2.4.7
---
 srcpkgs/subversion-kwallet-auth/template | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/subversion-kwallet-auth/template b/srcpkgs/subversion-kwallet-auth/template
index 12210f250d51..9cc68c3fe5f1 100644
--- a/srcpkgs/subversion-kwallet-auth/template
+++ b/srcpkgs/subversion-kwallet-auth/template
@@ -3,7 +3,7 @@
 # THIS PKG MUST BE SYNCHRONIZED WITH "srcpkgs/subversion".
 #
 pkgname=subversion-kwallet-auth
-version=1.14.1
+version=1.14.2
 revision=1
 wrksrc="subversion-${version}"
 build_style=gnu-configure
@@ -22,10 +22,12 @@ license="Apache-2.0, BSD-3-Clause"
 homepage="http://subversion.apache.org/"
 changelog="https://subversion.apache.org/docs/release-notes/${version%.*}.html"
 distfiles="http://apache.uvigo.es/subversion/subversion-${version}.tar.bz2"
-checksum=2c5da93c255d2e5569fa91d92457fdb65396b0666fad4fd59b22e154d986e1a9
+checksum=c9130e8d0b75728a66f0e7038fc77052e671830d785b5616aad53b4810d3cc28
 lib32disabled=yes
 
 pre_configure() {
+	./autogen.sh --release
+
 	# Based on native build values
 	cat <<-EOF >config.cache
 	ac_cv_python_includes=-I${XBPS_CROSS_BASE}/usr/include/python${py3_ver}
@@ -55,11 +57,18 @@ pre_configure() {
 		cp "$XBPS_CROSS_BASE/usr/lib/perl5/core_perl/Config"*.p? $PERL5LIB
 		cp "$XBPS_CROSS_BASE/usr/lib/perl5/core_perl/Errno.pm" $PERL5LIB
 		vsed -e "s;archlibexp => '\(.*\)';archlibexp => '${XBPS_CROSS_BASE}\1';" \
-			-i $PERL5LIB/Config.pm $PERL5LIB/Config_heavy.pl
+			-i $PERL5LIB/Config.pm
+		vsed -e "s;archlibexp='\(.*\)';archlibexp='${XBPS_CROSS_BASE}\1';" \
+			-i $PERL5LIB/Config_heavy.pl
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+
+	if [ "$XBPS_BUILD_ENVIRONMENT" = "void-packages-ci" ]; then
+		# This test will fail when run as the root user,
+		# because flock() will ignore file permissions.
+		vsed -i subversion/tests/libsvn_fs/locks-test.c -e '/SVN_TEST_OPTS_PASS(obtain_write_lock_failure,/,+3d'
+	fi
 }
 
 post_configure() {

From c941ec57088d24eed9e5d1de5d958b7d66233396 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 14/37] cross-aarch64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..bd6b23f9fb6a 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 5df684bd292d303b8f8521f6b36ee1bbdb56e28e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 15/37] cross-aarch64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..427ad2c1e9cd 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 5a16b23bed24dba60464bd4648b6fd10c1e298a9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 16/37] cross-arm-linux-gnueabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..2510ee26e789 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 8b3906ff67ace0410f934aa15962c352c7a8982b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 17/37] cross-arm-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..bd8b16e1b4c1 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 9e23701434c803c8b0c265851c2e076bbb059b07 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 18/37] cross-arm-linux-musleabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..dacfd2655216 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 7ee6bb58eec1899c2aad8f8cd541096c7e8622c5 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 19/37] cross-arm-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..9ddd32a9f20d 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 4f869e3229427870ba45e761f4b0cf79942a3adb Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 20/37] cross-armv7l-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..9fb00f18be3b 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 4c8a673bcab117ddec40137dcb1346b192bb9c45 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 21/37] cross-armv7l-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..2c72e75ddfe3 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From ba4e42e211065943ca103ecd2f759e2475ccedc0 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 22/37] cross-i686-pc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..4dc17df648b5 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From e8768cd19087543eef0f9be0421d2916a517681b Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Fri, 16 Sep 2022 20:52:19 -0700
Subject: [PATCH 23/37] cross-i686-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-linux-musl/template b/srcpkgs/cross-i686-linux-musl/template
index 8be16a230d8d..78b4d813a113 100644
--- a/srcpkgs/cross-i686-linux-musl/template
+++ b/srcpkgs/cross-i686-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-i686-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-i686-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From ff481a4ce152d86f560a5bb48c00ca0cc37f1e85 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 24/37] cross-mips-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..6009e5c79eb2 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 58516c9ad687d325467640b2e5c924b1d5e4f9e4 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 25/37] cross-mips-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..080164df193d 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="hipperson0 <hipperson0@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 6f5e6eec6f7a23c57601f29c54c9821def066d7f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 26/37] cross-mipsel-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..f9fd4b8a04ef 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 555fefa2518c85d01fd1a8760e1847c47af89a0b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 27/37] cross-mipsel-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..7418a984474b 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 5c07b0de853299ff5c46576e446611dadb252328 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 28/37] cross-powerpc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..31e57b4e52b2 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 5651535fd4ef6f7a0268424288a2d26756027245 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 29/37] cross-powerpc-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..a2d1edcf1ffd 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 1a1bd20916b01c91f3086b8c98b13730dba333bb Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 30/37] cross-powerpc64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..1a4cbed61e76 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 4a2c1d7dfa78729f7765ec54a71b1ec21a967579 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 31/37] cross-powerpc64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 016f18776a6d..19b1ff859eb6 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 30d3d9748e43323636f2da5aa2b023a191e6d11d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 32/37] cross-powerpc64le-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 463d7e92d20d..9d99a3a315d2 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From fbe19e908f523a06b654e5ea5c8c61de0f898475 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 33/37] cross-powerpc64le-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index c17a3cccfe29..3128baa7372e 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 7c9bbc247f93aa3091192e2da11a98796a02f25c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 34/37] cross-powerpcle-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 9aede3c465ce..0462a1015a1a 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 
@@ -35,6 +35,8 @@ if [ "$XBPS_TARGET_MACHINE" = "ppcle" ]; then
 	broken="Can't build crosstoolchain to itself"
 fi
 
+broken="glibc uses big-endian specific instructions on 32-bit powerpc"
+
 cross-powerpcle-linux-gnu-libc_package() {
 	short_desc+=" - glibc files"
 	nostrip=yes

From 06212fec11ab0b2d7cf946e2202f718afe3d8f0e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 35/37] cross-powerpcle-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index 045cfda987fe..20e70bed4c60 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 9c26df2badc1069ea039ebded1c1a9262534e4e1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 36/37] cross-x86_64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 8918f3c22a1c..5219cd50f851 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 1e3b2d3d31b3e06ac3c0cb17e0ee2653aec460a0 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 37/37] cross-x86_64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..2811de0d3c2e 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (198 preceding siblings ...)
  2022-10-14  9:02 ` oreo639
@ 2022-10-14  9:04 ` oreo639
  2022-10-14  9:33 ` oreo639
                   ` (64 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-10-14  9:04 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5478 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.2.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.2.0

There is a list of failing builds here: https://github.com/void-linux/void-packages/issues/39809

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [x] llvm https://github.com/void-linux/void-packages/pull/38694
- [x] m4 https://github.com/void-linux/void-packages/pull/33730
- [x] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [x] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [x] libvirt https://github.com/void-linux/void-packages/pull/38842
- [x] syslinux https://github.com/void-linux/void-packages/pull/38876
- [x] efivar https://github.com/void-linux/void-packages/pull/38874
- [ ] gpgme https://github.com/void-linux/void-packages/pull/38825

Known packages that needed to be fixed/updated for gcc12:
- [ ] linux5.18 (in this PR)
- [x] openssh https://github.com/void-linux/void-packages/pull/38849
- [x] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [x] doxygen https://github.com/void-linux/void-packages/pull/38846
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] libproxy https://github.com/void-linux/void-packages/pull/38818
- [x] exempi https://github.com/void-linux/void-packages/pull/38820
- [x] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [x] libunique1 https://github.com/void-linux/void-packages/pull/38848 or https://github.com/void-linux/void-packages/pull/38873
- [x] libwpd https://github.com/void-linux/void-packages/pull/38878
- [x] cglm https://github.com/void-linux/void-packages/pull/39748
- [x] coreboot-utils https://github.com/void-linux/void-packages/pull/39749
- [x] apl https://github.com/void-linux/void-packages/pull/39750
- [x] igt-gpu-tools https://github.com/void-linux/void-packages/pull/39780

Needs to be fixed/updated for binutils:
- [x] grub https://github.com/void-linux/void-packages/pull/38875
- [x] linux-tools https://github.com/void-linux/void-packages/pull/38877
- [x] kcov https://github.com/void-linux/void-packages/pull/39291

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [x] kde
- [x] lxde
- [x] lxqt

You can test the ISOs here:
https://drive.google.com/drive/folders/1ix92CYSLUP-KWjLxltdgG4e8Nu2JCY5n?usp=sharing

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 136429 bytes --]

From fbf1a62679f519e8c86a501129188ceb820e2d45 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 01/37] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../fix-libcollector-without-java.patch       | 53 +++++++++++++++
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 25 ++++---
 4 files changed, 87 insertions(+), 117 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
 create mode 100644 srcpkgs/binutils/patches/fix-libcollector-without-java.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/fix-libcollector-without-java.patch b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
new file mode 100644
index 000000000000..54384875f358
--- /dev/null
+++ b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
@@ -0,0 +1,53 @@
+From 49ddd814ac1071af7c4f45d5f8398b91862f2c7f Mon Sep 17 00:00:00 2001
+From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
+Date: Wed, 17 Aug 2022 19:55:23 -0700
+Subject: [PATCH] gprofng: fix bug 29479 Collection fails when built without
+ java support
+
+gprofng/ChangeLog
+2022-08-17  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>
+
+	PR gprofng/29479
+	* libcollector/collector.c: Add #if defined(GPROFNG_JAVA_PROFILING) for
+	java specific code.
+	* libcollector/unwind.c: Likewise.
+---
+ gprofng/libcollector/collector.c | 2 ++
+ gprofng/libcollector/unwind.c    | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/gprofng/libcollector/collector.c b/gprofng/libcollector/collector.c
+index 93c9d3330de5..ceff2c1caccb 100644
+--- a/gprofng/libcollector/collector.c
++++ b/gprofng/libcollector/collector.c
+@@ -913,8 +913,10 @@ __collector_open_experiment (const char *exp, const char *params, sp_origin_t or
+   __collector_ext_unwind_key_init (1, NULL);
+ 
+   /* start java attach if suitable */
++#if defined(GPROFNG_JAVA_PROFILING)
+   if (exp_origin == SP_ORIGIN_DBX_ATTACH)
+     __collector_jprofile_start_attach ();
++#endif
+   start_sec_time = CALL_UTIL (time)(NULL);
+   __collector_start_time = collector_interface.getHiResTime ();
+   TprintfT (DBG_LT0, "\t__collector_open_experiment; resetting start_time\n");
+diff --git a/gprofng/libcollector/unwind.c b/gprofng/libcollector/unwind.c
+index 119243788020..f8e11823c81e 100644
+--- a/gprofng/libcollector/unwind.c
++++ b/gprofng/libcollector/unwind.c
+@@ -557,6 +557,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+   int size = max_frame_size;
+ 
+ #define MIN(a,b) ((a)<(b)?(a):(b))
++#if defined(GPROFNG_JAVA_PROFILING)
+   /* get Java info */
+   if (__collector_java_mode && __collector_java_asyncgetcalltrace_loaded && context && !pseudo_context)
+     {
+@@ -569,6 +570,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+ 	  size -= sz;
+ 	}
+     }
++#endif
+ 
+   /* get native stack */
+   if (context)
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..c355a5fc8016 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkgconf"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -35,15 +36,21 @@ do_configure() {
 	local conf
 
 	if [ "$CHROOT_READY" ]; then
-		conf+=" --with-debuginfod"
+		conf+=" --with-debuginfod --enable-shared"
 	else
-		conf+=" --without-debuginfod --disable-install-libbfd"
+		conf+=" --without-debuginfod --disable-shared --disable-install-libbfd"
 	fi
 	if [ "$CROSS_BUILD" ]; then
 		# we don't want --with-sysroot=${XBPS_CROSS_BASE} like gnu-configure
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	# gprofng currently only supports x86 and aarch64 glibc.
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64|i386|aarch64) conf+=" --enable-gprofng" ;;
+		*) conf+=" --disable-gprofng" ;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"
@@ -76,13 +83,14 @@ do_configure() {
 		--libdir=/usr/lib \
 		--mandir=/usr/share/man \
 		--infodir=/usr/share/info \
+		--sysconfdir=/etc \
 		--disable-werror \
-		--disable-shared \
 		--disable-nls \
 		--enable-threads \
 		--enable-plugins \
 		--enable-relro \
 		--enable-gold \
+		--enable-new-dtags \
 		--enable-deterministic-archives \
 		--enable-64-bit-bfd \
 		--enable-ld=default \
@@ -142,7 +150,8 @@ binutils-devel_package() {
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/*.a"
-		vmove "usr/lib/*.so"
+		vmove "usr/lib/libbfd.so"
+		vmove "usr/lib/libopcodes.so"
 	}
 }
 

From 575965414ecbb00a4a724f350d64e50b96216b32 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 2 Oct 2022 16:46:59 -0700
Subject: [PATCH 02/37] gdb: resolve conflict with binutils 2.39

---
 srcpkgs/gdb/template | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/gdb/template b/srcpkgs/gdb/template
index ff7c9d9a5911..5970402eb27e 100644
--- a/srcpkgs/gdb/template
+++ b/srcpkgs/gdb/template
@@ -1,7 +1,7 @@
 # Template file for 'gdb'
 pkgname=gdb
 version=12.1
-revision=1
+revision=2
 build_style=gnu-configure
 pycompile_dirs="/usr/share/gdb/python"
 configure_args="--disable-werror --disable-nls --with-system-readline
@@ -48,7 +48,8 @@ vopt_conflict debuginfod static
 
 post_install() {
 	# resolve conflicts with binutils
-	rm -r ${DESTDIR}/usr/{include,lib,share/info/bfd.info*}
+	rm -rf ${DESTDIR}/usr/{include,lib}
+	rm -rf ${DESTDIR}/usr/share/info/{bfd,ctf-spec}.info*
 }
 
 gdb-common_package() {

From e7cd89dc29ec074c033cedce73a0ea981ca9ae54 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 03/37] gcc: update to 12.2.0.

---
 common/shlibs                                 |  10 +-
 srcpkgs/gcc/files/gccgo-musl.patch            |  71 ++-------
 srcpkgs/gcc/files/libgnarl-musl.patch         |  18 +--
 srcpkgs/gcc/files/libssp-musl.patch           |  10 +-
 srcpkgs/gcc/patches/libffi_gnulinux.patch     |  11 --
 .../gcc/patches/libgcc-ibm128-no-tag.patch    |  10 +-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |   2 +-
 srcpkgs/gcc/template                          | 136 +++++++++---------
 8 files changed, 105 insertions(+), 163 deletions(-)
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index 2c579d7b5a3e..006ab88d9696 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.2.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.36 perl-5.36.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -847,8 +847,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.2.0_1
+libgnat-12.so libada-12.2.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1698,8 +1698,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.2.0_1
+libasan.so.8 libsanitizer-12.2.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..12ec68dd8aa3 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,14 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ b/libgo/go/runtime/os_linux.go
+@@ -365,7 +365,7 @@ func setThreadCPUProfiler(hz int32) {
+ 	var sevp _sigevent
+ 	sevp.sigev_notify = _SIGEV_THREAD_ID
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.__sev_fields))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..5ffd54e466ae 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,37 +3,35 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
+version=12.2.0
+revision=1
+_minorver="${version%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
-wrksrc=gcc-${version/pre/_pre}
+_mpc_version=1.2.1
+_isl_version=0.24
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
+create_wrksrc=yes
+build_wrksrc="gcc-${version}"
+patch_args="-Np1 --directory=${build_wrksrc}"
 lib32disabled=yes
 bootstrap=yes
 replaces="gcc-gcj<7.2.0 gcc-gcj-jdk-compat<7.2.0 libmpx>=0 libmpx-devel>=0"
@@ -52,8 +50,11 @@ if [ "$CHROOT_READY" ]; then
 	hostmakedepends="tar texinfo perl flex"
 else
 	_have_gccgo=no
+	# libzstd fails to link in bootstrap with glibc 2.36
+	# when zlib has been compiled with glibc 2.32.
+	LDFLAGS="-lzstd -pthread"
 fi
-makedepends="zlib-devel"
+makedepends="zlib-devel libzstd-devel"
 depends="binutils libgcc-devel-${version}_${revision}
  libstdc++-devel-${version}_${revision} libssp-devel-${version}_${revision}"
 checkdepends="dejagnu"
@@ -70,13 +71,13 @@ if [ "$build_option_gnatboot" ]; then
 	case "$XBPS_TARGET_MACHINE" in
 	x86_64)
 		_gnat_tarball="gnat-gpl-2017-x86_64-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/591c6d80c7a447af2deed1d7>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/9682e2e1f2f232ce03fe21d77b14c37a0de5649b?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" b942bcac20dea39748b39f8b624d9619f60a8dee2e8195dbe3829c835b0956e6"
 		build_options_default="gnatboot"
 		;;
 	i686)
 		_gnat_tarball="gnat-gpl-2014-x86-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/564b3e9dc8e196b040fbe248>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/c5e9e6fdff5cb77ed90cf8c62536653e27c0bed6?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" 3b693510f5d22a240abb3034934c1adbd80ccd6e4f61a4f491cc408fdfd9c042"
 		build_options_default="gnatboot"
 		;;
@@ -155,25 +156,24 @@ if [ "$CROSS_BUILD" ]; then
 fi
 
 post_extract() {
-	mkdir -p ${wrksrc}/{gmp,mpfr,mpc,isl}
-	cp -ar ${XBPS_BUILDDIR}/gmp-${_gmp_version}/* ${wrksrc}/gmp/
-	cp -ar ${XBPS_BUILDDIR}/mpfr-${_mpfr_version}/* ${wrksrc}/mpfr/
-	cp -ar ${XBPS_BUILDDIR}/mpc-${_mpc_version}/* ${wrksrc}/mpc/
-	cp -ar ${XBPS_BUILDDIR}/isl-${_isl_version}/* ${wrksrc}/isl/
+	ln -s ${wrksrc}/gmp-${_gmp_version} ${wrksrc}/${build_wrksrc}/gmp
+	ln -s ${wrksrc}/mpfr-${_mpfr_version} ${wrksrc}/${build_wrksrc}/mpfr
+	ln -s ${wrksrc}/mpc-${_mpc_version} ${wrksrc}/${build_wrksrc}/mpc
+	ln -s ${wrksrc}/isl-${_isl_version} ${wrksrc}/${build_wrksrc}/isl
 
 	if [ "$build_option_gnatboot" ]; then
 		local f="${XBPS_SRCDISTDIR}/${pkgname}-${version}/${_gnat_tarball}"
 		msg_normal "Extracting ${_gnat_tarball} ...\n"
-		mkdir -p ${wrksrc}/gnat-ins
-		tar -x -f "$f" --strip-components=1 -C ${wrksrc}/gnat-ins
-		cd ${wrksrc}/gnat-ins
-		make ins-all prefix=${wrksrc}/gnat
-		cd ${wrksrc}
-		rm -rf ${wrksrc}/gnat-ins
+		mkdir -p ${wrksrc}/${build_wrksrc}/gnat-ins
+		tar -x -f "$f" --strip-components=1 -C ${wrksrc}/${build_wrksrc}/gnat-ins
+		cd ${wrksrc}/${build_wrksrc}/gnat-ins
+		make ins-all prefix=${wrksrc}/${build_wrksrc}/gnat
+		cd ${wrksrc}/${build_wrksrc}
+		rm -rf ${wrksrc}/${build_wrksrc}/gnat-ins
 
 		# Rename obsolete ld and as
-		find ${wrksrc}/gnat -name ld -exec mv -v {} {}.old \;
-		find ${wrksrc}/gnat -name as -exec mv -v {} {}.old \;
+		find ${wrksrc}/${build_wrksrc}/gnat -name ld -exec mv -v {} {}.old \;
+		find ${wrksrc}/${build_wrksrc}/gnat -name as -exec mv -v {} {}.old \;
 	fi
 }
 
@@ -185,9 +185,9 @@ pre_configure() {
 	sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
 
 	if [ "$XBPS_TARGET_LIBC" = musl ]; then
-		patch -p1 -i ${FILESDIR}/libgnarl-musl.patch
-		patch -p1 -i ${FILESDIR}/libssp-musl.patch
-		patch -p1 -i ${FILESDIR}/gccgo-musl.patch
+		for p in ${FILESDIR}/*-musl.patch; do
+			patch -p1 -i $p
+		done
 	fi
 }
 do_configure() {
@@ -297,19 +297,19 @@ do_configure() {
 		_args+=" --enable-languages=${_langs},ada"
 		_args+=" --enable-libada"
 		CONFIG_SHELL=/bin/bash \
-		CC="${wrksrc}/gnat/bin/gcc" \
-		GNATBIND="${wrksrc}/gnat/bin/gnatbind" \
-		GNATMAKE="${wrksrc}/gnat/bin/gnatmake" \
-		PATH="${wrksrc}/gnat/bin:$PATH" \
-			${wrksrc}/configure ${_args}
+		CC="${wrksrc}/${build_wrksrc}/gnat/bin/gcc" \
+		GNATBIND="${wrksrc}/${build_wrksrc}/gnat/bin/gnatbind" \
+		GNATMAKE="${wrksrc}/${build_wrksrc}/gnat/bin/gnatmake" \
+		PATH="${wrksrc}/${build_wrksrc}/gnat/bin:$PATH" \
+			${wrksrc}/${build_wrksrc}/configure ${_args}
 	elif [ "$build_option_ada" ]; then
 		_args+=" --enable-languages=${_langs},ada"
 		CONFIG_SHELL=/bin/bash \
-			${wrksrc}/configure ${_args}
+			${wrksrc}/${build_wrksrc}/configure ${_args}
 	else
 		_args+=" --enable-languages=${_langs}"
 		CONFIG_SHELL=/bin/bash \
-			${wrksrc}/configure ${_args}
+			${wrksrc}/${build_wrksrc}/configure ${_args}
 	fi
 }
 do_build() {
@@ -318,10 +318,10 @@ do_build() {
 	fi
 	cd build
 	if [ "$build_option_gnatboot" ]; then
-		CC="${wrksrc}/gnat/bin/gcc" \
-		GNATBIND="${wrksrc}/gnat/bin/gnatbind" \
-		GNATMAKE="${wrksrc}/gnat/bin/gnatmake" \
-		PATH="${wrksrc}/gnat/bin:$PATH" \
+		CC="${wrksrc}/${build_wrksrc}/gnat/bin/gcc" \
+		GNATBIND="${wrksrc}/${build_wrksrc}/gnat/bin/gnatbind" \
+		GNATMAKE="${wrksrc}/${build_wrksrc}/gnat/bin/gnatmake" \
+		PATH="${wrksrc}/${build_wrksrc}/gnat/bin:$PATH" \
 		make ${makejobs}
 	else
 		make ${makejobs}
@@ -330,7 +330,7 @@ do_build() {
 pre_install() {
 	if [ "$CROSS_BUILD" ]; then
 		# XXX otherwise links to host libpthread
-		for f in $(find ${wrksrc}/build/${XBPS_CROSS_TRIPLET} -type f -name libtool); do
+		for f in $(find ${wrksrc}/${build_wrksrc}/build/${XBPS_CROSS_TRIPLET} -type f -name libtool); do
 			sed -e "s,add_dir=\"-L\$libdir\",add_dir=\"-L${XBPS_CROSS_BASE}\$libdir\",g" -i $f
 		done
 	fi
@@ -342,16 +342,16 @@ do_install() {
 
 	# Make version a symlink of major version to make all versions
 	# from the same series work automagically.
-	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver} \
+	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${version} \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver}
 	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver} \
-		${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}
+		${DESTDIR}/usr/lib/gcc/${_triplet}/${version}
 
 	# Ditto for c++ headers.
-	mv ${DESTDIR}/usr/include/c++/${_patchver} \
+	mv ${DESTDIR}/usr/include/c++/${version} \
 		${DESTDIR}/usr/include/c++/${_minorver}
 	ln -sfr ${DESTDIR}/usr/include/c++/${_minorver} \
-		${DESTDIR}/usr/include/c++/${_patchver}
+		${DESTDIR}/usr/include/c++/${version}
 
 	# cc symlink
 	ln -sfr ${DESTDIR}/usr/bin/gcc ${DESTDIR}/usr/bin/cc
@@ -360,7 +360,7 @@ do_install() {
 
 	# lto plugin symlink
 	vmkdir usr/lib/bfd-plugins
-	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}/liblto_plugin.so \
+	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${version}/liblto_plugin.so \
 		${DESTDIR}/usr/lib/bfd-plugins
 
 	# Remove "fixed" header
@@ -371,13 +371,9 @@ do_install() {
 	rm -f ${DESTDIR}/usr/lib/libffi*
 	rm -f ${DESTDIR}/usr/share/man/man3/ffi*
 
-	# Remove all python scripts in libdir.
-	rm -f ${DESTDIR}/usr/lib/*.py
-
-	# Remove more python stuff.
-	if [ -d ${DESTDIR}/usr/share/gcc-${_patchver}/python ]; then
-		rm -rf ${DESTDIR}/usr/share/gcc-${_patchver}/python
-	fi
+	# Move libstdc++ gdb helpers to location where gdb can autoload them
+	mkdir -p ${DESTDIR}/usr/share/gdb/auto-load/usr/lib
+	mv ${DESTDIR}/usr/lib/*.py ${DESTDIR}/usr/share/gdb/auto-load/usr/lib
 
 	# Install c89 and c99 wrappers and its manpages, from NetBSD.
 	for f in c89 c99; do
@@ -396,7 +392,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}
@@ -449,7 +445,7 @@ gcc-fortran_package() {
 		if [ "$CROSS_BUILD" ]; then
 			# A number of OMP modules are not built when cross
 			# compiling gcc. Copy them from the cross compiler.
-			local src="/usr/lib/gcc/${_triplet}/${_patchver}/finclude"
+			local src="/usr/lib/gcc/${_triplet}/${version}/finclude"
 			local dst="usr/lib/gcc/${_triplet}/${_minorver}/finclude"
 			for f in omp_lib.f90 omp_lib.h omp_lib.mod omp_lib_kinds.mod \
 				openacc.f90 openacc.mod openacc_kinds.mod openacc_lib.h; do
@@ -516,7 +512,7 @@ libgfortran_package() {
 	short_desc+=" - Fortran library"
 	pkg_install() {
 		vmove "usr/lib/libgfortran.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -537,7 +533,7 @@ libgo_package() {
 	nostrip=yes
 	pkg_install() {
 		vmove "usr/lib/libgo.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -553,7 +549,7 @@ libobjc_package() {
 	short_desc+=" - Objective-C library"
 	pkg_install() {
 		vmove "usr/lib/libobjc.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -572,7 +568,7 @@ libquadmath_package() {
 	short_desc+=" - quadmath library"
 	pkg_install() {
 		vmove "usr/lib/libquadmath.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -614,7 +610,7 @@ libgcc_package() {
 	noverifyrdeps=yes
 	pkg_install() {
 		vmove "usr/lib/libgcc_s.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -645,7 +641,7 @@ libgomp_package() {
 	short_desc+=" - OpenMP v4.0 library"
 	pkg_install() {
 		vmove "usr/lib/libgomp*.so.*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -700,7 +696,7 @@ libssp_package() {
 	short_desc+=" - SSP (StackSmashingProtection) library"
 	pkg_install() {
 		vmove "usr/lib/libssp.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -717,7 +713,9 @@ libstdc++-devel_package() {
 libstdc++_package() {
 	short_desc+=" - Standard C++ Library"
 	pkg_install() {
+		vmove usr/share/gdb
+		vmove usr/share/gcc-${version}/python
 		vmove "usr/lib/libstdc++.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }

From cf62635ca6c8ebd3db709b16432382bf914cea4a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 04/37] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      | 11 ++++--
 2 files changed, 25 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..a4087ec2055e 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,12 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
+
+if [ "$XBPS_TARGET_LIBC" == "musl" ]; then
+	# Musl always searches LD_LIBRARY_PATH before RPATH and RUNPATH
+	make_build_args="lt_cv_shlibpath_overrides_runpath=yes"
+fi
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From 675de62be1c0e30eaefa2d72e3a7d92cc9e8e71a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 05/37] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 55255dceae8b..ca2d858a7abc 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From 5a254303dcc6dc7cb8121bfcd8ff9af71ac9ba5f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 06/37] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 ...e-hash-style-both-for-building-glibc.patch | 145 +++++++++
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 4 files changed, 200 insertions(+), 353 deletions(-)
 create mode 100644 srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index 006ab88d9696..79f9929d89b5 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch b/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
new file mode 100644
index 000000000000..d1f0afd88175
--- /dev/null
+++ b/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
@@ -0,0 +1,145 @@
+Temporary workaround for EAC bug.
+
+See: https://sourceware.org/bugzilla/show_bug.cgi?id=29456
+
+From 8e90e2cc5e57d7ca3a40602d278e9642a8b66716 Mon Sep 17 00:00:00 2001
+From: oreo639 <oreo6391@gmail.com>
+Date: Tue, 13 Sep 2022 14:30:35 -0700
+Subject: [PATCH] Revert "Do not use --hash-style=both for building glibc
+ shared objects"
+
+This reverts commit e47de5cb2d4dbecb58f569ed241e8e95c568f03c.
+---
+ Makeconfig     |  9 +++++++++
+ Makerules      |  7 +++++++
+ config.make.in |  1 +
+ configure      | 28 ++++++++++++++++++++++++++++
+ configure.ac   | 16 ++++++++++++++++
+ 5 files changed, 61 insertions(+)
+
+diff --git a/Makeconfig b/Makeconfig
+index ba70321af1..e2131d4389 100644
+--- a/Makeconfig
++++ b/Makeconfig
+@@ -371,6 +371,15 @@ dt-relr-ldflag =
+ no-dt-relr-ldflag =
+ endif
+ 
++ifeq (yes,$(have-hash-style))
++# For the time being we unconditionally use 'both'.  At some time we
++# should declare statically linked code as 'out of luck' and compile
++# with --hash-style=gnu only.
++hashstyle-LDFLAGS = -Wl,--hash-style=both
++LDFLAGS.so += $(hashstyle-LDFLAGS)
++LDFLAGS-rtld += $(hashstyle-LDFLAGS)
++endif
++
+ ifeq (no,$(build-pie-default))
+ pie-default = $(no-pie-ccflag)
+ else # build-pie-default
+diff --git a/Makerules b/Makerules
+index d1e139d03c..44134e37ce 100644
+--- a/Makerules
++++ b/Makerules
+@@ -558,6 +558,13 @@ $(common-objpfx)shlib.lds: $(common-objpfx)config.make $(..)Makerules
+ 		  -Wl,--verbose 2>/dev/null | \
+ 	  sed > $@T \
+ 	      -e '/^=========/,/^=========/!d;/^=========/d' \
++	      $(if $(filter yes,$(have-hash-style)), \
++		   -e 's/^.*\.gnu\.hash[ 	]*:.*$$/  .note.ABI-tag : { *(.note.ABI-tag) } &/' \
++		   -e '/^[ 	]*\.hash[ 	]*:.*$$/{h;d;}' \
++		   -e '/DATA_SEGMENT_ALIGN/{H;g}' \
++		, \
++		   -e 's/^.*\.hash[ 	]*:.*$$/  .note.ABI-tag : { *(.note.ABI-tag) } &/' \
++	       ) \
+ 	      -e 's/^.*\*(\.dynbss).*$$/& \
+ 		 PROVIDE(__start___libc_freeres_ptrs = .); \
+ 		 *(__libc_freeres_ptrs) \
+diff --git a/config.make.in b/config.make.in
+index d7c416cbea..130e639da2 100644
+--- a/config.make.in
++++ b/config.make.in
+@@ -69,6 +69,7 @@ have-libaudit = @have_libaudit@
+ have-libcap = @have_libcap@
+ have-cc-with-libunwind = @libc_cv_cc_with_libunwind@
+ bind-now = @bindnow@
++have-hash-style = @libc_cv_hashstyle@
+ use-default-link = @use_default_link@
+ have-cxx-thread_local = @libc_cv_cxx_thread_local@
+ have-loop-to-function = @libc_cv_cc_loop_to_function@
+diff --git a/configure b/configure
+index ff2c406b3b..07f9376668 100755
+--- a/configure
++++ b/configure
+@@ -621,6 +621,7 @@ libc_cv_cc_submachine
+ libc_cv_cc_nofma
+ libc_cv_mtls_dialect_gnu2
+ libc_cv_has_glob_dat
++libc_cv_hashstyle
+ libc_cv_fpie
+ libc_cv_z_execstack
+ ASFLAGS_config
+@@ -6192,6 +6193,33 @@ $as_echo "$libc_cv_fpie" >&6; }
+ 
+ 
+ 
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --hash-style option" >&5
++$as_echo_n "checking for --hash-style option... " >&6; }
++if ${libc_cv_hashstyle+:} false; then :
++  $as_echo_n "(cached) " >&6
++else
++  cat > conftest.c <<EOF
++int _start (void) { return 42; }
++EOF
++if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS $no_ssp
++			    -fPIC -shared -o conftest.so conftest.c
++			    -Wl,--hash-style=both -nostdlib 1>&5'
++  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
++  test $ac_status = 0; }; }
++then
++  libc_cv_hashstyle=yes
++else
++  libc_cv_hashstyle=no
++fi
++rm -f conftest*
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_hashstyle" >&5
++$as_echo "$libc_cv_hashstyle" >&6; }
++
++
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLOB_DAT reloc" >&5
+ $as_echo_n "checking for GLOB_DAT reloc... " >&6; }
+ if ${libc_cv_has_glob_dat+:} false; then :
+diff --git a/configure.ac b/configure.ac
+index eb5bc6a131..870347c5cd 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1360,6 +1360,22 @@ LIBC_TRY_CC_OPTION([-fpie], [libc_cv_fpie=yes], [libc_cv_fpie=no])
+ 
+ AC_SUBST(libc_cv_fpie)
+ 
++AC_CACHE_CHECK(for --hash-style option,
++	       libc_cv_hashstyle, [dnl
++cat > conftest.c <<EOF
++int _start (void) { return 42; }
++EOF
++if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS $no_ssp
++			    -fPIC -shared -o conftest.so conftest.c
++			    -Wl,--hash-style=both -nostdlib 1>&AS_MESSAGE_LOG_FD])
++then
++  libc_cv_hashstyle=yes
++else
++  libc_cv_hashstyle=no
++fi
++rm -f conftest*])
++AC_SUBST(libc_cv_hashstyle)
++
+ AC_CACHE_CHECK(for GLOB_DAT reloc,
+ 	       libc_cv_has_glob_dat, [dnl
+ cat > conftest.c <<EOF
+-- 
+2.37.3
+
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From 063739c7cf80e3d17e61f6e6d8be4a50711bf241 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Wed, 14 Sep 2022 03:48:32 -0700
Subject: [PATCH 07/37] musl: add support for SIGEV_THREAD_ID timers

https://git.musl-libc.org/cgit/musl/commit/?id=7c71792e87691451f2a6b76348e83ad1889f1dcb
---
 ...d-support-for-SIGEV_THREAD_ID-timers.patch | 74 +++++++++++++++++++
 srcpkgs/musl/template                         |  2 +-
 2 files changed, 75 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch

diff --git a/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
new file mode 100644
index 000000000000..e20dff5ba0d4
--- /dev/null
+++ b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
@@ -0,0 +1,74 @@
+From 7c71792e87691451f2a6b76348e83ad1889f1dcb Mon Sep 17 00:00:00 2001
+From: James Y Knight <jyknight@google.com>
+Date: Sun, 30 Jun 2019 21:55:20 -0400
+Subject: [PATCH] add support for SIGEV_THREAD_ID timers
+
+This is like SIGEV_SIGNAL, but targeted to a particular thread's
+tid, rather than the process.
+---
+ include/signal.h        | 16 +++++++++++++---
+ src/time/timer_create.c |  8 ++++++--
+ 2 files changed, 19 insertions(+), 5 deletions(-)
+
+diff --git a/include/signal.h b/include/signal.h
+index fbdf667b2..9ed929e4f 100644
+--- a/include/signal.h
++++ b/include/signal.h
+@@ -180,14 +180,24 @@ struct sigevent {
+ 	union sigval sigev_value;
+ 	int sigev_signo;
+ 	int sigev_notify;
+-	void (*sigev_notify_function)(union sigval);
+-	pthread_attr_t *sigev_notify_attributes;
+-	char __pad[56-3*sizeof(long)];
++	union {
++		char __pad[64 - 2*sizeof(int) - sizeof(union sigval)];
++		pid_t sigev_notify_thread_id;
++		struct {
++			void (*sigev_notify_function)(union sigval);
++			pthread_attr_t *sigev_notify_attributes;
++		} __sev_thread;
++	} __sev_fields;
+ };
+ 
++#define sigev_notify_thread_id __sev_fields.sigev_notify_thread_id
++#define sigev_notify_function __sev_fields.__sev_thread.sigev_notify_function
++#define sigev_notify_attributes __sev_fields.__sev_thread.sigev_notify_attributes
++
+ #define SIGEV_SIGNAL 0
+ #define SIGEV_NONE 1
+ #define SIGEV_THREAD 2
++#define SIGEV_THREAD_ID 4
+ 
+ int __libc_current_sigrtmin(void);
+ int __libc_current_sigrtmax(void);
+diff --git a/src/time/timer_create.c b/src/time/timer_create.c
+index 5ddfda278..4bef23905 100644
+--- a/src/time/timer_create.c
++++ b/src/time/timer_create.c
+@@ -71,11 +71,15 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 	switch (evp ? evp->sigev_notify : SIGEV_SIGNAL) {
+ 	case SIGEV_NONE:
+ 	case SIGEV_SIGNAL:
++	case SIGEV_THREAD_ID:
+ 		if (evp) {
+ 			ksev.sigev_value = evp->sigev_value;
+ 			ksev.sigev_signo = evp->sigev_signo;
+ 			ksev.sigev_notify = evp->sigev_notify;
+-			ksev.sigev_tid = 0;
++			if (evp->sigev_notify == SIGEV_THREAD_ID)
++				ksev.sigev_tid = evp->sigev_notify_thread_id;
++			else
++				ksev.sigev_tid = 0;
+ 			ksevp = &ksev;
+ 		}
+ 		if (syscall(SYS_timer_create, clk, ksevp, &timerid) < 0)
+@@ -107,7 +111,7 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 
+ 		ksev.sigev_value.sival_ptr = 0;
+ 		ksev.sigev_signo = SIGTIMER;
+-		ksev.sigev_notify = 4; /* SIGEV_THREAD_ID */
++		ksev.sigev_notify = SIGEV_THREAD_ID;
+ 		ksev.sigev_tid = td->tid;
+ 		if (syscall(SYS_timer_create, clk, &ksev, &timerid) < 0)
+ 			timerid = -1;
diff --git a/srcpkgs/musl/template b/srcpkgs/musl/template
index 5bdc5c48e623..34e6ed4fba6e 100644
--- a/srcpkgs/musl/template
+++ b/srcpkgs/musl/template
@@ -2,7 +2,7 @@
 pkgname=musl
 reverts="1.2.0_1"
 version=1.1.24
-revision=10
+revision=11
 archs="*-musl"
 bootstrap=yes
 build_style=gnu-configure

From 7b5bc930143034f9d547a4087261190be443b1aa Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 21:01:43 -0700
Subject: [PATCH 08/37] gcc-multilib: update to 12.2.0.

---
 srcpkgs/gcc-multilib/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index fcd25755aa75..df60849babc2 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,16 +3,16 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _majorver="${version%.*}"
-wrksrc=gcc-${version/pre/_pre}
+wrksrc="gcc-${version}"
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel
@@ -71,7 +71,7 @@ do_build() {
 	make ${makejobs}
 }
 do_install() {
-	local _pc_triplet=x86_64-pc-linux-gnu _version=${version%pre1}
+	local _pc_triplet=x86_64-pc-linux-gnu
 	# Install to a tempdir and then only copy relevant files.
 	cd ${wrksrc}
 	make DESTDIR=${wrksrc}/${pkgname}-build install
@@ -81,9 +81,9 @@ do_install() {
 	vmkdir usr/include/c++/${_majorver}/${_triplet}
 	vmkdir usr/lib/gcc/${_triplet}/${_majorver}
 
-	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${_version}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${version}/32 \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_majorver}/
-	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${_version}/${_pc_triplet}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${version}/${_pc_triplet}/32 \
 		${DESTDIR}/usr/include/c++/${_majorver}/${_triplet}
 
 	vinstall ${wrksrc}/host-${_pc_triplet}/gcc/specs 644 usr/lib/gcc/${_triplet}/${_majorver}

From 0b2576e4f12e02c3efac9f8bb1828fdc680ae5bd Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Tue, 4 Oct 2022 03:49:13 -0700
Subject: [PATCH 09/37] libgccjit: update to 12.2.0.

---
 srcpkgs/libgccjit/files/libgccjit-musl.patch | 63 --------------------
 srcpkgs/libgccjit/template                   | 38 ++++++------
 2 files changed, 17 insertions(+), 84 deletions(-)
 delete mode 100644 srcpkgs/libgccjit/files/libgccjit-musl.patch

diff --git a/srcpkgs/libgccjit/files/libgccjit-musl.patch b/srcpkgs/libgccjit/files/libgccjit-musl.patch
deleted file mode 100644
index d2ed16928c82..000000000000
--- a/srcpkgs/libgccjit/files/libgccjit-musl.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-diff --git a/gcc/jit/jit-playback.c b/gcc/jit/jit-playback.c
-index 5bccf591a..35f5e35ef 100644
---- a/gcc/jit/jit-playback.c
-+++ b/gcc/jit/jit-playback.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -41,8 +43,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "diagnostic.h"
- #include "stmt.h"
- 
--#include <pthread.h>
--
- #include "jit-playback.h"
- #include "jit-result.h"
- #include "jit-builtins.h"
-diff --git a/gcc/jit/jit-recording.c b/gcc/jit/jit-recording.c
-index a237d574f..5785e3269 100644
---- a/gcc/jit/jit-recording.c
-+++ b/gcc/jit/jit-recording.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -25,8 +27,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "pretty-print.h"
- #include "toplev.h"
- 
--#include <pthread.h>
--
- #include "jit-builtins.h"
- #include "jit-recording.h"
- #include "jit-playback.h"
-diff --git a/gcc/jit/libgccjit.c b/gcc/jit/libgccjit.c
-index f9c33c63c..75f21d275 100644
---- a/gcc/jit/libgccjit.c
-+++ b/gcc/jit/libgccjit.c
-@@ -18,13 +18,13 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
- #include "timevar.h"
- #include "typed-splay-tree.h"
- #include "cppbuiltin.h"
--#include <pthread.h>
- 
- #include "libgccjit.h"
- #include "jit-recording.h"
diff --git a/srcpkgs/libgccjit/template b/srcpkgs/libgccjit/template
index 6f1d6256dcd6..b5d4540ce667 100644
--- a/srcpkgs/libgccjit/template
+++ b/srcpkgs/libgccjit/template
@@ -3,36 +3,32 @@
 # which use the version number.
 
 pkgname=libgccjit
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
+version=12.2.0
 revision=1
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
-_majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
-wrksrc=gcc-${version/pre/_pre}
+_mpc_version=1.2.1
+_isl_version=0.24
 short_desc="Just-In-Time Compilation library for GCC"
 maintainer="Lane Biocini <lane@mailbox.org>"
 homepage="https://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 nopie=yes
+create_wrksrc=yes
+build_wrksrc="gcc-${version}"
+patch_args="-Np1 --directory=${build_wrksrc}"
 lib32disabled=yes
 makedepends="zlib-devel"
 hostmakedepends="tar texinfo perl flex"
@@ -40,10 +36,10 @@ depends="gcc"
 checkdepends="dejagnu"
 
 post_extract() {
-	mv ${XBPS_BUILDDIR}/gmp-${_gmp_version} ${wrksrc}/gmp
-	mv ${XBPS_BUILDDIR}/mpfr-${_mpfr_version} ${wrksrc}/mpfr
-	mv ${XBPS_BUILDDIR}/mpc-${_mpc_version} ${wrksrc}/mpc
-	mv ${XBPS_BUILDDIR}/isl-${_isl_version} ${wrksrc}/isl
+	ln -s ${wrksrc}/gmp-${_gmp_version} ${wrksrc}/${build_wrksrc}/gmp
+	ln -s ${wrksrc}/mpfr-${_mpfr_version} ${wrksrc}/${build_wrksrc}/mpfr
+	ln -s ${wrksrc}/mpc-${_mpc_version} ${wrksrc}/${build_wrksrc}/mpc
+	ln -s ${wrksrc}/isl-${_isl_version} ${wrksrc}/${build_wrksrc}/isl
 }
 
 pre_configure() {
@@ -186,7 +182,7 @@ do_configure() {
 	[ -z "$XBPS_CHECK_PKGS" ] && _langs="jit" || _langs="jit,c++"
 	_args+=" --enable-languages=${_langs}"
 	CONFIG_SHELL=/bin/bash \
-		${wrksrc}/configure ${_args}
+		${wrksrc}/${build_wrksrc}/configure ${_args}
 }
 
 do_build() {

From be7cdb339e9a8efa683e74ce3cc3d9e3dd9e48ec Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 14 Aug 2022 19:29:36 -0700
Subject: [PATCH 10/37] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove -no-pie from build. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..5d40f0cdd8a6 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -53,6 +53,7 @@ _void_cross_build_binutils() {
 		--sbindir=/usr/bin \
 		--libdir=/usr/lib \
 		--libexecdir=/usr/lib \
+		--sysconfdir=/etc \
 		--target=${tgt} \
 		--with-sysroot=/usr/${tgt} \
 		--disable-nls \
@@ -60,7 +61,9 @@ _void_cross_build_binutils() {
 		--disable-multilib \
 		--disable-werror \
 		--disable-gold \
+		--disable-gprofng \
 		--enable-relro \
+		--enable-new-dtags \
 		--enable-plugins \
 		--enable-64-bit-bfd \
 		--enable-deterministic-archives \
@@ -132,6 +135,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -460,6 +464,14 @@ do_build() {
 	local binutils_ver linux_ver gcc_ver libc_ver libucontext_ver
 	local tgt=${sourcepkg/cross-}
 
+	export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}"
+	export CXXFLAGS="${CXXFLAGS/-D_FORTIFY_SOURCE=2/}"
+
+	# Disable explicit -fno-PIE, gcc/binutils/libc will figure this out itself.
+	export CFLAGS="${CFLAGS//-fno-PIE/}"
+	export CXXFLAGS="${CXXFLAGS//-fno-PIE/}"
+	export LDFLAGS="${LDFLAGS//-no-pie/}"
+
 	_void_cross_test_ver binutils
 	_void_cross_test_ver linux
 	_void_cross_test_ver gcc
@@ -625,6 +637,9 @@ do_install() {
 	# then remove it because it conflicts with libquadmath package
 	rm -rf ${DESTDIR}/${sysroot}/usr/lib/libquadmath.*
 
+	# Remove libdep linker plugin because it conflicts with system binutils
+	rm -f ${DESTDIR}/usr/lib/bfd-plugins/libdep*
+
 	# Remove leftover symlinks
 	rm -f ${DESTDIR}/usr/lib${XBPS_TARGET_WORDSIZE}
 	rm -f ${DESTDIR}/lib*

From 2255290e7bbb56576b28af26b7552db49b0e8d75 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:09:31 -0700
Subject: [PATCH 11/37] linux5.18: update dotconfigs for gcc12

---
 srcpkgs/linux5.18/files/x86_64-dotconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/linux5.18/files/x86_64-dotconfig b/srcpkgs/linux5.18/files/x86_64-dotconfig
index 4e73a3195d40..ea6204868e23 100644
--- a/srcpkgs/linux5.18/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.18/files/x86_64-dotconfig
@@ -512,6 +512,7 @@ CONFIG_RETHUNK=y
 CONFIG_CPU_UNRET_ENTRY=y
 CONFIG_CPU_IBPB_ENTRY=y
 CONFIG_CPU_IBRS_ENTRY=y
+CONFIG_SLS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10060,8 +10061,11 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
 # Memory initialization
 #
 CONFIG_INIT_STACK_NONE=y
+# CONFIG_INIT_STACK_ALL_PATTERN is not set
+# CONFIG_INIT_STACK_ALL_ZERO is not set
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
+# CONFIG_ZERO_CALL_USED_REGS is not set
 # end of Memory initialization
 # end of Kernel hardening options
 # end of Security options
@@ -10538,6 +10542,7 @@ CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
 # CONFIG_UBSAN is not set
 CONFIG_HAVE_ARCH_KCSAN=y
+# CONFIG_KCSAN is not set
 # end of Generic Kernel Debugging Instruments
 
 #

From efd1cd049b641f6f82be65ece050875ddbabb18c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:08 -0700
Subject: [PATCH 12/37] subversion: fix build for libtool 2.4.7

---
 srcpkgs/subversion/template | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/subversion/template b/srcpkgs/subversion/template
index 18c35e3a2132..0aa41212c5fd 100644
--- a/srcpkgs/subversion/template
+++ b/srcpkgs/subversion/template
@@ -24,6 +24,8 @@ distfiles="http://apache.uvigo.es/subversion/subversion-${version}.tar.bz2"
 checksum=c9130e8d0b75728a66f0e7038fc77052e671830d785b5616aad53b4810d3cc28
 
 pre_configure() {
+	./autogen.sh --release
+
 	# Based on native build values
 	cat <<-EOF >config.cache
 	ac_cv_python_includes=-I${XBPS_CROSS_BASE}/usr/include/python${py3_ver}
@@ -59,7 +61,12 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+
+	if [ "$XBPS_BUILD_ENVIRONMENT" = "void-packages-ci" ]; then
+		# This test will fail when run as the root user,
+		# because flock() will ignore file permissions.
+		vsed -i subversion/tests/libsvn_fs/locks-test.c -e '/SVN_TEST_OPTS_PASS(obtain_write_lock_failure,/,+3d'
+	fi
 }
 
 post_configure() {

From fcf2cca0bc4b4662e979eab4688138598d1180b9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:38 -0700
Subject: [PATCH 13/37] subversion-kwallet-auth: update to 1.14.2.

Fix failing distfiles.
Fix build for libtool 2.4.7
---
 srcpkgs/subversion-kwallet-auth/template | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/subversion-kwallet-auth/template b/srcpkgs/subversion-kwallet-auth/template
index 12210f250d51..9cc68c3fe5f1 100644
--- a/srcpkgs/subversion-kwallet-auth/template
+++ b/srcpkgs/subversion-kwallet-auth/template
@@ -3,7 +3,7 @@
 # THIS PKG MUST BE SYNCHRONIZED WITH "srcpkgs/subversion".
 #
 pkgname=subversion-kwallet-auth
-version=1.14.1
+version=1.14.2
 revision=1
 wrksrc="subversion-${version}"
 build_style=gnu-configure
@@ -22,10 +22,12 @@ license="Apache-2.0, BSD-3-Clause"
 homepage="http://subversion.apache.org/"
 changelog="https://subversion.apache.org/docs/release-notes/${version%.*}.html"
 distfiles="http://apache.uvigo.es/subversion/subversion-${version}.tar.bz2"
-checksum=2c5da93c255d2e5569fa91d92457fdb65396b0666fad4fd59b22e154d986e1a9
+checksum=c9130e8d0b75728a66f0e7038fc77052e671830d785b5616aad53b4810d3cc28
 lib32disabled=yes
 
 pre_configure() {
+	./autogen.sh --release
+
 	# Based on native build values
 	cat <<-EOF >config.cache
 	ac_cv_python_includes=-I${XBPS_CROSS_BASE}/usr/include/python${py3_ver}
@@ -55,11 +57,18 @@ pre_configure() {
 		cp "$XBPS_CROSS_BASE/usr/lib/perl5/core_perl/Config"*.p? $PERL5LIB
 		cp "$XBPS_CROSS_BASE/usr/lib/perl5/core_perl/Errno.pm" $PERL5LIB
 		vsed -e "s;archlibexp => '\(.*\)';archlibexp => '${XBPS_CROSS_BASE}\1';" \
-			-i $PERL5LIB/Config.pm $PERL5LIB/Config_heavy.pl
+			-i $PERL5LIB/Config.pm
+		vsed -e "s;archlibexp='\(.*\)';archlibexp='${XBPS_CROSS_BASE}\1';" \
+			-i $PERL5LIB/Config_heavy.pl
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+
+	if [ "$XBPS_BUILD_ENVIRONMENT" = "void-packages-ci" ]; then
+		# This test will fail when run as the root user,
+		# because flock() will ignore file permissions.
+		vsed -i subversion/tests/libsvn_fs/locks-test.c -e '/SVN_TEST_OPTS_PASS(obtain_write_lock_failure,/,+3d'
+	fi
 }
 
 post_configure() {

From eafcc33edea90db6e72b3756f2873f634d687652 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 14/37] cross-aarch64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..bd6b23f9fb6a 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 525186dc44ff237bab5054d16e97b664dd74dd13 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 15/37] cross-aarch64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..427ad2c1e9cd 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From efec4d31723e3677f3bae1b56a8d815a6519c3fe Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 16/37] cross-arm-linux-gnueabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..2510ee26e789 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From dd4a3fd5b05617688a1ec30958a22b991bfc21a4 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 17/37] cross-arm-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..bd8b16e1b4c1 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 5f8f2a08a4efd7cb2c7fca2b8a5a0f3732902bc6 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 18/37] cross-arm-linux-musleabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..dacfd2655216 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 96258eda0e98e3ae16193d1275885ce23ed1d88d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 19/37] cross-arm-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..9ddd32a9f20d 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From e2920421d1885ce5ff8660ffe271d274a46c5fa9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 20/37] cross-armv7l-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..9fb00f18be3b 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 4f8fefb9b8bbd21f7ca86e6af45585fd27fa401f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 21/37] cross-armv7l-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..2c72e75ddfe3 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From f4891d32f6cd2d520af63423a57b5c04b1123b5d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 22/37] cross-i686-pc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..4dc17df648b5 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 48bb969823a8ef04865e64c582445ba30d04d568 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Fri, 16 Sep 2022 20:52:19 -0700
Subject: [PATCH 23/37] cross-i686-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-linux-musl/template b/srcpkgs/cross-i686-linux-musl/template
index 8be16a230d8d..78b4d813a113 100644
--- a/srcpkgs/cross-i686-linux-musl/template
+++ b/srcpkgs/cross-i686-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-i686-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-i686-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From fb6eb0ccc657160df22460395ecbc1f95e785cc0 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 24/37] cross-mips-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..6009e5c79eb2 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 76b9f6ba6edec56e23d3c9868b48434af819b6cd Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 25/37] cross-mips-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..080164df193d 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="hipperson0 <hipperson0@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 8f42e4fe3df679f76e33c9eaa0b439af0062b7ee Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 26/37] cross-mipsel-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..f9fd4b8a04ef 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From c099441d149fe47a7996064c31b99def61543833 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 27/37] cross-mipsel-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..7418a984474b 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 2b75979f6580d4be2a020c157ecb0decd0fec9be Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 28/37] cross-powerpc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..31e57b4e52b2 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From fa2dea8cb1cd8bf82c17d02c58e2462881f19165 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 29/37] cross-powerpc-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..a2d1edcf1ffd 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 2ae3663c6f734ac4867ac8bfe63a4d4e6cef05d4 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 30/37] cross-powerpc64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..1a4cbed61e76 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 357256a1044a3e4f66e8d216eae0dacb86d0162f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 31/37] cross-powerpc64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 016f18776a6d..19b1ff859eb6 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 3ca8420a2654c7dc0451499a8beb0e606cd9ae4b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 32/37] cross-powerpc64le-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 463d7e92d20d..9d99a3a315d2 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 2fe61c7e20e6e8571b226d391ae73ac9d7a61058 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 33/37] cross-powerpc64le-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index c17a3cccfe29..3128baa7372e 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 37f651bf856e6a933f1f7bff64b5921351616bb5 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 34/37] cross-powerpcle-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 9aede3c465ce..0462a1015a1a 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 
@@ -35,6 +35,8 @@ if [ "$XBPS_TARGET_MACHINE" = "ppcle" ]; then
 	broken="Can't build crosstoolchain to itself"
 fi
 
+broken="glibc uses big-endian specific instructions on 32-bit powerpc"
+
 cross-powerpcle-linux-gnu-libc_package() {
 	short_desc+=" - glibc files"
 	nostrip=yes

From bc6bfbdc65394e50594497b09f8609c418fbd9ca Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 35/37] cross-powerpcle-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index 045cfda987fe..20e70bed4c60 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From e1199b9c4a46cb18ffa4b3e95a84720d6c377d39 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 36/37] cross-x86_64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 8918f3c22a1c..5219cd50f851 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 1f76454fa61c76f0b7a333a05a1ed92ff8fe2b2b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 37/37] cross-x86_64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..2811de0d3c2e 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (199 preceding siblings ...)
  2022-10-14  9:04 ` oreo639
@ 2022-10-14  9:33 ` oreo639
  2022-10-14  9:33 ` oreo639
                   ` (63 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-10-14  9:33 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 242 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1278745540

Comment:
Johnnynator was able to reproduce the issue. Apparently I just forgot about glibc-32bit. :facepalm: 

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (200 preceding siblings ...)
  2022-10-14  9:33 ` oreo639
@ 2022-10-14  9:33 ` oreo639
  2022-10-14 10:10 ` [PR PATCH] [Updated] " oreo639
                   ` (62 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-10-14  9:33 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 246 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1278745540

Comment:
Johnnynator was able to reproduce the EAC issue. Apparently I just forgot about glibc-32bit. :facepalm: 

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (201 preceding siblings ...)
  2022-10-14  9:33 ` oreo639
@ 2022-10-14 10:10 ` oreo639
  2022-10-14 10:11 ` oreo639
                   ` (61 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-10-14 10:10 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5478 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.2.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.2.0

There is a list of failing builds here: https://github.com/void-linux/void-packages/issues/39809

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [x] llvm https://github.com/void-linux/void-packages/pull/38694
- [x] m4 https://github.com/void-linux/void-packages/pull/33730
- [x] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [x] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [x] libvirt https://github.com/void-linux/void-packages/pull/38842
- [x] syslinux https://github.com/void-linux/void-packages/pull/38876
- [x] efivar https://github.com/void-linux/void-packages/pull/38874
- [ ] gpgme https://github.com/void-linux/void-packages/pull/38825

Known packages that needed to be fixed/updated for gcc12:
- [ ] linux5.18 (in this PR)
- [x] openssh https://github.com/void-linux/void-packages/pull/38849
- [x] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [x] doxygen https://github.com/void-linux/void-packages/pull/38846
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] libproxy https://github.com/void-linux/void-packages/pull/38818
- [x] exempi https://github.com/void-linux/void-packages/pull/38820
- [x] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [x] libunique1 https://github.com/void-linux/void-packages/pull/38848 or https://github.com/void-linux/void-packages/pull/38873
- [x] libwpd https://github.com/void-linux/void-packages/pull/38878
- [x] cglm https://github.com/void-linux/void-packages/pull/39748
- [x] coreboot-utils https://github.com/void-linux/void-packages/pull/39749
- [x] apl https://github.com/void-linux/void-packages/pull/39750
- [x] igt-gpu-tools https://github.com/void-linux/void-packages/pull/39780

Needs to be fixed/updated for binutils:
- [x] grub https://github.com/void-linux/void-packages/pull/38875
- [x] linux-tools https://github.com/void-linux/void-packages/pull/38877
- [x] kcov https://github.com/void-linux/void-packages/pull/39291

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [x] kde
- [x] lxde
- [x] lxqt

You can test the ISOs here:
https://drive.google.com/drive/folders/1ix92CYSLUP-KWjLxltdgG4e8Nu2JCY5n?usp=sharing

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 136429 bytes --]

From fbf1a62679f519e8c86a501129188ceb820e2d45 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 01/37] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../fix-libcollector-without-java.patch       | 53 +++++++++++++++
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 25 ++++---
 4 files changed, 87 insertions(+), 117 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
 create mode 100644 srcpkgs/binutils/patches/fix-libcollector-without-java.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/fix-libcollector-without-java.patch b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
new file mode 100644
index 000000000000..54384875f358
--- /dev/null
+++ b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
@@ -0,0 +1,53 @@
+From 49ddd814ac1071af7c4f45d5f8398b91862f2c7f Mon Sep 17 00:00:00 2001
+From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
+Date: Wed, 17 Aug 2022 19:55:23 -0700
+Subject: [PATCH] gprofng: fix bug 29479 Collection fails when built without
+ java support
+
+gprofng/ChangeLog
+2022-08-17  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>
+
+	PR gprofng/29479
+	* libcollector/collector.c: Add #if defined(GPROFNG_JAVA_PROFILING) for
+	java specific code.
+	* libcollector/unwind.c: Likewise.
+---
+ gprofng/libcollector/collector.c | 2 ++
+ gprofng/libcollector/unwind.c    | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/gprofng/libcollector/collector.c b/gprofng/libcollector/collector.c
+index 93c9d3330de5..ceff2c1caccb 100644
+--- a/gprofng/libcollector/collector.c
++++ b/gprofng/libcollector/collector.c
+@@ -913,8 +913,10 @@ __collector_open_experiment (const char *exp, const char *params, sp_origin_t or
+   __collector_ext_unwind_key_init (1, NULL);
+ 
+   /* start java attach if suitable */
++#if defined(GPROFNG_JAVA_PROFILING)
+   if (exp_origin == SP_ORIGIN_DBX_ATTACH)
+     __collector_jprofile_start_attach ();
++#endif
+   start_sec_time = CALL_UTIL (time)(NULL);
+   __collector_start_time = collector_interface.getHiResTime ();
+   TprintfT (DBG_LT0, "\t__collector_open_experiment; resetting start_time\n");
+diff --git a/gprofng/libcollector/unwind.c b/gprofng/libcollector/unwind.c
+index 119243788020..f8e11823c81e 100644
+--- a/gprofng/libcollector/unwind.c
++++ b/gprofng/libcollector/unwind.c
+@@ -557,6 +557,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+   int size = max_frame_size;
+ 
+ #define MIN(a,b) ((a)<(b)?(a):(b))
++#if defined(GPROFNG_JAVA_PROFILING)
+   /* get Java info */
+   if (__collector_java_mode && __collector_java_asyncgetcalltrace_loaded && context && !pseudo_context)
+     {
+@@ -569,6 +570,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+ 	  size -= sz;
+ 	}
+     }
++#endif
+ 
+   /* get native stack */
+   if (context)
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..c355a5fc8016 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkgconf"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -35,15 +36,21 @@ do_configure() {
 	local conf
 
 	if [ "$CHROOT_READY" ]; then
-		conf+=" --with-debuginfod"
+		conf+=" --with-debuginfod --enable-shared"
 	else
-		conf+=" --without-debuginfod --disable-install-libbfd"
+		conf+=" --without-debuginfod --disable-shared --disable-install-libbfd"
 	fi
 	if [ "$CROSS_BUILD" ]; then
 		# we don't want --with-sysroot=${XBPS_CROSS_BASE} like gnu-configure
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	# gprofng currently only supports x86 and aarch64 glibc.
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64|i386|aarch64) conf+=" --enable-gprofng" ;;
+		*) conf+=" --disable-gprofng" ;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"
@@ -76,13 +83,14 @@ do_configure() {
 		--libdir=/usr/lib \
 		--mandir=/usr/share/man \
 		--infodir=/usr/share/info \
+		--sysconfdir=/etc \
 		--disable-werror \
-		--disable-shared \
 		--disable-nls \
 		--enable-threads \
 		--enable-plugins \
 		--enable-relro \
 		--enable-gold \
+		--enable-new-dtags \
 		--enable-deterministic-archives \
 		--enable-64-bit-bfd \
 		--enable-ld=default \
@@ -142,7 +150,8 @@ binutils-devel_package() {
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/*.a"
-		vmove "usr/lib/*.so"
+		vmove "usr/lib/libbfd.so"
+		vmove "usr/lib/libopcodes.so"
 	}
 }
 

From 575965414ecbb00a4a724f350d64e50b96216b32 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 2 Oct 2022 16:46:59 -0700
Subject: [PATCH 02/37] gdb: resolve conflict with binutils 2.39

---
 srcpkgs/gdb/template | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/gdb/template b/srcpkgs/gdb/template
index ff7c9d9a5911..5970402eb27e 100644
--- a/srcpkgs/gdb/template
+++ b/srcpkgs/gdb/template
@@ -1,7 +1,7 @@
 # Template file for 'gdb'
 pkgname=gdb
 version=12.1
-revision=1
+revision=2
 build_style=gnu-configure
 pycompile_dirs="/usr/share/gdb/python"
 configure_args="--disable-werror --disable-nls --with-system-readline
@@ -48,7 +48,8 @@ vopt_conflict debuginfod static
 
 post_install() {
 	# resolve conflicts with binutils
-	rm -r ${DESTDIR}/usr/{include,lib,share/info/bfd.info*}
+	rm -rf ${DESTDIR}/usr/{include,lib}
+	rm -rf ${DESTDIR}/usr/share/info/{bfd,ctf-spec}.info*
 }
 
 gdb-common_package() {

From e7cd89dc29ec074c033cedce73a0ea981ca9ae54 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 03/37] gcc: update to 12.2.0.

---
 common/shlibs                                 |  10 +-
 srcpkgs/gcc/files/gccgo-musl.patch            |  71 ++-------
 srcpkgs/gcc/files/libgnarl-musl.patch         |  18 +--
 srcpkgs/gcc/files/libssp-musl.patch           |  10 +-
 srcpkgs/gcc/patches/libffi_gnulinux.patch     |  11 --
 .../gcc/patches/libgcc-ibm128-no-tag.patch    |  10 +-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |   2 +-
 srcpkgs/gcc/template                          | 136 +++++++++---------
 8 files changed, 105 insertions(+), 163 deletions(-)
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index 2c579d7b5a3e..006ab88d9696 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.2.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.36 perl-5.36.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -847,8 +847,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.2.0_1
+libgnat-12.so libada-12.2.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1698,8 +1698,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.2.0_1
+libasan.so.8 libsanitizer-12.2.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..12ec68dd8aa3 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,14 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ b/libgo/go/runtime/os_linux.go
+@@ -365,7 +365,7 @@ func setThreadCPUProfiler(hz int32) {
+ 	var sevp _sigevent
+ 	sevp.sigev_notify = _SIGEV_THREAD_ID
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.__sev_fields))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..5ffd54e466ae 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,37 +3,35 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
+version=12.2.0
+revision=1
+_minorver="${version%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
-wrksrc=gcc-${version/pre/_pre}
+_mpc_version=1.2.1
+_isl_version=0.24
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
+create_wrksrc=yes
+build_wrksrc="gcc-${version}"
+patch_args="-Np1 --directory=${build_wrksrc}"
 lib32disabled=yes
 bootstrap=yes
 replaces="gcc-gcj<7.2.0 gcc-gcj-jdk-compat<7.2.0 libmpx>=0 libmpx-devel>=0"
@@ -52,8 +50,11 @@ if [ "$CHROOT_READY" ]; then
 	hostmakedepends="tar texinfo perl flex"
 else
 	_have_gccgo=no
+	# libzstd fails to link in bootstrap with glibc 2.36
+	# when zlib has been compiled with glibc 2.32.
+	LDFLAGS="-lzstd -pthread"
 fi
-makedepends="zlib-devel"
+makedepends="zlib-devel libzstd-devel"
 depends="binutils libgcc-devel-${version}_${revision}
  libstdc++-devel-${version}_${revision} libssp-devel-${version}_${revision}"
 checkdepends="dejagnu"
@@ -70,13 +71,13 @@ if [ "$build_option_gnatboot" ]; then
 	case "$XBPS_TARGET_MACHINE" in
 	x86_64)
 		_gnat_tarball="gnat-gpl-2017-x86_64-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/591c6d80c7a447af2deed1d7>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/9682e2e1f2f232ce03fe21d77b14c37a0de5649b?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" b942bcac20dea39748b39f8b624d9619f60a8dee2e8195dbe3829c835b0956e6"
 		build_options_default="gnatboot"
 		;;
 	i686)
 		_gnat_tarball="gnat-gpl-2014-x86-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/564b3e9dc8e196b040fbe248>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/c5e9e6fdff5cb77ed90cf8c62536653e27c0bed6?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" 3b693510f5d22a240abb3034934c1adbd80ccd6e4f61a4f491cc408fdfd9c042"
 		build_options_default="gnatboot"
 		;;
@@ -155,25 +156,24 @@ if [ "$CROSS_BUILD" ]; then
 fi
 
 post_extract() {
-	mkdir -p ${wrksrc}/{gmp,mpfr,mpc,isl}
-	cp -ar ${XBPS_BUILDDIR}/gmp-${_gmp_version}/* ${wrksrc}/gmp/
-	cp -ar ${XBPS_BUILDDIR}/mpfr-${_mpfr_version}/* ${wrksrc}/mpfr/
-	cp -ar ${XBPS_BUILDDIR}/mpc-${_mpc_version}/* ${wrksrc}/mpc/
-	cp -ar ${XBPS_BUILDDIR}/isl-${_isl_version}/* ${wrksrc}/isl/
+	ln -s ${wrksrc}/gmp-${_gmp_version} ${wrksrc}/${build_wrksrc}/gmp
+	ln -s ${wrksrc}/mpfr-${_mpfr_version} ${wrksrc}/${build_wrksrc}/mpfr
+	ln -s ${wrksrc}/mpc-${_mpc_version} ${wrksrc}/${build_wrksrc}/mpc
+	ln -s ${wrksrc}/isl-${_isl_version} ${wrksrc}/${build_wrksrc}/isl
 
 	if [ "$build_option_gnatboot" ]; then
 		local f="${XBPS_SRCDISTDIR}/${pkgname}-${version}/${_gnat_tarball}"
 		msg_normal "Extracting ${_gnat_tarball} ...\n"
-		mkdir -p ${wrksrc}/gnat-ins
-		tar -x -f "$f" --strip-components=1 -C ${wrksrc}/gnat-ins
-		cd ${wrksrc}/gnat-ins
-		make ins-all prefix=${wrksrc}/gnat
-		cd ${wrksrc}
-		rm -rf ${wrksrc}/gnat-ins
+		mkdir -p ${wrksrc}/${build_wrksrc}/gnat-ins
+		tar -x -f "$f" --strip-components=1 -C ${wrksrc}/${build_wrksrc}/gnat-ins
+		cd ${wrksrc}/${build_wrksrc}/gnat-ins
+		make ins-all prefix=${wrksrc}/${build_wrksrc}/gnat
+		cd ${wrksrc}/${build_wrksrc}
+		rm -rf ${wrksrc}/${build_wrksrc}/gnat-ins
 
 		# Rename obsolete ld and as
-		find ${wrksrc}/gnat -name ld -exec mv -v {} {}.old \;
-		find ${wrksrc}/gnat -name as -exec mv -v {} {}.old \;
+		find ${wrksrc}/${build_wrksrc}/gnat -name ld -exec mv -v {} {}.old \;
+		find ${wrksrc}/${build_wrksrc}/gnat -name as -exec mv -v {} {}.old \;
 	fi
 }
 
@@ -185,9 +185,9 @@ pre_configure() {
 	sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
 
 	if [ "$XBPS_TARGET_LIBC" = musl ]; then
-		patch -p1 -i ${FILESDIR}/libgnarl-musl.patch
-		patch -p1 -i ${FILESDIR}/libssp-musl.patch
-		patch -p1 -i ${FILESDIR}/gccgo-musl.patch
+		for p in ${FILESDIR}/*-musl.patch; do
+			patch -p1 -i $p
+		done
 	fi
 }
 do_configure() {
@@ -297,19 +297,19 @@ do_configure() {
 		_args+=" --enable-languages=${_langs},ada"
 		_args+=" --enable-libada"
 		CONFIG_SHELL=/bin/bash \
-		CC="${wrksrc}/gnat/bin/gcc" \
-		GNATBIND="${wrksrc}/gnat/bin/gnatbind" \
-		GNATMAKE="${wrksrc}/gnat/bin/gnatmake" \
-		PATH="${wrksrc}/gnat/bin:$PATH" \
-			${wrksrc}/configure ${_args}
+		CC="${wrksrc}/${build_wrksrc}/gnat/bin/gcc" \
+		GNATBIND="${wrksrc}/${build_wrksrc}/gnat/bin/gnatbind" \
+		GNATMAKE="${wrksrc}/${build_wrksrc}/gnat/bin/gnatmake" \
+		PATH="${wrksrc}/${build_wrksrc}/gnat/bin:$PATH" \
+			${wrksrc}/${build_wrksrc}/configure ${_args}
 	elif [ "$build_option_ada" ]; then
 		_args+=" --enable-languages=${_langs},ada"
 		CONFIG_SHELL=/bin/bash \
-			${wrksrc}/configure ${_args}
+			${wrksrc}/${build_wrksrc}/configure ${_args}
 	else
 		_args+=" --enable-languages=${_langs}"
 		CONFIG_SHELL=/bin/bash \
-			${wrksrc}/configure ${_args}
+			${wrksrc}/${build_wrksrc}/configure ${_args}
 	fi
 }
 do_build() {
@@ -318,10 +318,10 @@ do_build() {
 	fi
 	cd build
 	if [ "$build_option_gnatboot" ]; then
-		CC="${wrksrc}/gnat/bin/gcc" \
-		GNATBIND="${wrksrc}/gnat/bin/gnatbind" \
-		GNATMAKE="${wrksrc}/gnat/bin/gnatmake" \
-		PATH="${wrksrc}/gnat/bin:$PATH" \
+		CC="${wrksrc}/${build_wrksrc}/gnat/bin/gcc" \
+		GNATBIND="${wrksrc}/${build_wrksrc}/gnat/bin/gnatbind" \
+		GNATMAKE="${wrksrc}/${build_wrksrc}/gnat/bin/gnatmake" \
+		PATH="${wrksrc}/${build_wrksrc}/gnat/bin:$PATH" \
 		make ${makejobs}
 	else
 		make ${makejobs}
@@ -330,7 +330,7 @@ do_build() {
 pre_install() {
 	if [ "$CROSS_BUILD" ]; then
 		# XXX otherwise links to host libpthread
-		for f in $(find ${wrksrc}/build/${XBPS_CROSS_TRIPLET} -type f -name libtool); do
+		for f in $(find ${wrksrc}/${build_wrksrc}/build/${XBPS_CROSS_TRIPLET} -type f -name libtool); do
 			sed -e "s,add_dir=\"-L\$libdir\",add_dir=\"-L${XBPS_CROSS_BASE}\$libdir\",g" -i $f
 		done
 	fi
@@ -342,16 +342,16 @@ do_install() {
 
 	# Make version a symlink of major version to make all versions
 	# from the same series work automagically.
-	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver} \
+	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${version} \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver}
 	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver} \
-		${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}
+		${DESTDIR}/usr/lib/gcc/${_triplet}/${version}
 
 	# Ditto for c++ headers.
-	mv ${DESTDIR}/usr/include/c++/${_patchver} \
+	mv ${DESTDIR}/usr/include/c++/${version} \
 		${DESTDIR}/usr/include/c++/${_minorver}
 	ln -sfr ${DESTDIR}/usr/include/c++/${_minorver} \
-		${DESTDIR}/usr/include/c++/${_patchver}
+		${DESTDIR}/usr/include/c++/${version}
 
 	# cc symlink
 	ln -sfr ${DESTDIR}/usr/bin/gcc ${DESTDIR}/usr/bin/cc
@@ -360,7 +360,7 @@ do_install() {
 
 	# lto plugin symlink
 	vmkdir usr/lib/bfd-plugins
-	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}/liblto_plugin.so \
+	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${version}/liblto_plugin.so \
 		${DESTDIR}/usr/lib/bfd-plugins
 
 	# Remove "fixed" header
@@ -371,13 +371,9 @@ do_install() {
 	rm -f ${DESTDIR}/usr/lib/libffi*
 	rm -f ${DESTDIR}/usr/share/man/man3/ffi*
 
-	# Remove all python scripts in libdir.
-	rm -f ${DESTDIR}/usr/lib/*.py
-
-	# Remove more python stuff.
-	if [ -d ${DESTDIR}/usr/share/gcc-${_patchver}/python ]; then
-		rm -rf ${DESTDIR}/usr/share/gcc-${_patchver}/python
-	fi
+	# Move libstdc++ gdb helpers to location where gdb can autoload them
+	mkdir -p ${DESTDIR}/usr/share/gdb/auto-load/usr/lib
+	mv ${DESTDIR}/usr/lib/*.py ${DESTDIR}/usr/share/gdb/auto-load/usr/lib
 
 	# Install c89 and c99 wrappers and its manpages, from NetBSD.
 	for f in c89 c99; do
@@ -396,7 +392,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}
@@ -449,7 +445,7 @@ gcc-fortran_package() {
 		if [ "$CROSS_BUILD" ]; then
 			# A number of OMP modules are not built when cross
 			# compiling gcc. Copy them from the cross compiler.
-			local src="/usr/lib/gcc/${_triplet}/${_patchver}/finclude"
+			local src="/usr/lib/gcc/${_triplet}/${version}/finclude"
 			local dst="usr/lib/gcc/${_triplet}/${_minorver}/finclude"
 			for f in omp_lib.f90 omp_lib.h omp_lib.mod omp_lib_kinds.mod \
 				openacc.f90 openacc.mod openacc_kinds.mod openacc_lib.h; do
@@ -516,7 +512,7 @@ libgfortran_package() {
 	short_desc+=" - Fortran library"
 	pkg_install() {
 		vmove "usr/lib/libgfortran.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -537,7 +533,7 @@ libgo_package() {
 	nostrip=yes
 	pkg_install() {
 		vmove "usr/lib/libgo.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -553,7 +549,7 @@ libobjc_package() {
 	short_desc+=" - Objective-C library"
 	pkg_install() {
 		vmove "usr/lib/libobjc.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -572,7 +568,7 @@ libquadmath_package() {
 	short_desc+=" - quadmath library"
 	pkg_install() {
 		vmove "usr/lib/libquadmath.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -614,7 +610,7 @@ libgcc_package() {
 	noverifyrdeps=yes
 	pkg_install() {
 		vmove "usr/lib/libgcc_s.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -645,7 +641,7 @@ libgomp_package() {
 	short_desc+=" - OpenMP v4.0 library"
 	pkg_install() {
 		vmove "usr/lib/libgomp*.so.*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -700,7 +696,7 @@ libssp_package() {
 	short_desc+=" - SSP (StackSmashingProtection) library"
 	pkg_install() {
 		vmove "usr/lib/libssp.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -717,7 +713,9 @@ libstdc++-devel_package() {
 libstdc++_package() {
 	short_desc+=" - Standard C++ Library"
 	pkg_install() {
+		vmove usr/share/gdb
+		vmove usr/share/gcc-${version}/python
 		vmove "usr/lib/libstdc++.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }

From cf62635ca6c8ebd3db709b16432382bf914cea4a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 04/37] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      | 11 ++++--
 2 files changed, 25 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..a4087ec2055e 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,12 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
+
+if [ "$XBPS_TARGET_LIBC" == "musl" ]; then
+	# Musl always searches LD_LIBRARY_PATH before RPATH and RUNPATH
+	make_build_args="lt_cv_shlibpath_overrides_runpath=yes"
+fi
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From 675de62be1c0e30eaefa2d72e3a7d92cc9e8e71a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 05/37] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 55255dceae8b..ca2d858a7abc 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From 40059adb68f595733f4a879e3a559851cb792ae6 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 06/37] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 ...e-hash-style-both-for-building-glibc.patch | 145 +++++++++
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 4 files changed, 200 insertions(+), 353 deletions(-)
 create mode 100644 srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index 006ab88d9696..79f9929d89b5 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch b/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
new file mode 100644
index 000000000000..d1f0afd88175
--- /dev/null
+++ b/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
@@ -0,0 +1,145 @@
+Temporary workaround for EAC bug.
+
+See: https://sourceware.org/bugzilla/show_bug.cgi?id=29456
+
+From 8e90e2cc5e57d7ca3a40602d278e9642a8b66716 Mon Sep 17 00:00:00 2001
+From: oreo639 <oreo6391@gmail.com>
+Date: Tue, 13 Sep 2022 14:30:35 -0700
+Subject: [PATCH] Revert "Do not use --hash-style=both for building glibc
+ shared objects"
+
+This reverts commit e47de5cb2d4dbecb58f569ed241e8e95c568f03c.
+---
+ Makeconfig     |  9 +++++++++
+ Makerules      |  7 +++++++
+ config.make.in |  1 +
+ configure      | 28 ++++++++++++++++++++++++++++
+ configure.ac   | 16 ++++++++++++++++
+ 5 files changed, 61 insertions(+)
+
+diff --git a/Makeconfig b/Makeconfig
+index ba70321af1..e2131d4389 100644
+--- a/Makeconfig
++++ b/Makeconfig
+@@ -371,6 +371,15 @@ dt-relr-ldflag =
+ no-dt-relr-ldflag =
+ endif
+ 
++ifeq (yes,$(have-hash-style))
++# For the time being we unconditionally use 'both'.  At some time we
++# should declare statically linked code as 'out of luck' and compile
++# with --hash-style=gnu only.
++hashstyle-LDFLAGS = -Wl,--hash-style=both
++LDFLAGS.so += $(hashstyle-LDFLAGS)
++LDFLAGS-rtld += $(hashstyle-LDFLAGS)
++endif
++
+ ifeq (no,$(build-pie-default))
+ pie-default = $(no-pie-ccflag)
+ else # build-pie-default
+diff --git a/Makerules b/Makerules
+index d1e139d03c..44134e37ce 100644
+--- a/Makerules
++++ b/Makerules
+@@ -558,6 +558,13 @@ $(common-objpfx)shlib.lds: $(common-objpfx)config.make $(..)Makerules
+ 		  -Wl,--verbose 2>/dev/null | \
+ 	  sed > $@T \
+ 	      -e '/^=========/,/^=========/!d;/^=========/d' \
++	      $(if $(filter yes,$(have-hash-style)), \
++		   -e 's/^.*\.gnu\.hash[ 	]*:.*$$/  .note.ABI-tag : { *(.note.ABI-tag) } &/' \
++		   -e '/^[ 	]*\.hash[ 	]*:.*$$/{h;d;}' \
++		   -e '/DATA_SEGMENT_ALIGN/{H;g}' \
++		, \
++		   -e 's/^.*\.hash[ 	]*:.*$$/  .note.ABI-tag : { *(.note.ABI-tag) } &/' \
++	       ) \
+ 	      -e 's/^.*\*(\.dynbss).*$$/& \
+ 		 PROVIDE(__start___libc_freeres_ptrs = .); \
+ 		 *(__libc_freeres_ptrs) \
+diff --git a/config.make.in b/config.make.in
+index d7c416cbea..130e639da2 100644
+--- a/config.make.in
++++ b/config.make.in
+@@ -69,6 +69,7 @@ have-libaudit = @have_libaudit@
+ have-libcap = @have_libcap@
+ have-cc-with-libunwind = @libc_cv_cc_with_libunwind@
+ bind-now = @bindnow@
++have-hash-style = @libc_cv_hashstyle@
+ use-default-link = @use_default_link@
+ have-cxx-thread_local = @libc_cv_cxx_thread_local@
+ have-loop-to-function = @libc_cv_cc_loop_to_function@
+diff --git a/configure b/configure
+index ff2c406b3b..07f9376668 100755
+--- a/configure
++++ b/configure
+@@ -621,6 +621,7 @@ libc_cv_cc_submachine
+ libc_cv_cc_nofma
+ libc_cv_mtls_dialect_gnu2
+ libc_cv_has_glob_dat
++libc_cv_hashstyle
+ libc_cv_fpie
+ libc_cv_z_execstack
+ ASFLAGS_config
+@@ -6192,6 +6193,33 @@ $as_echo "$libc_cv_fpie" >&6; }
+ 
+ 
+ 
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --hash-style option" >&5
++$as_echo_n "checking for --hash-style option... " >&6; }
++if ${libc_cv_hashstyle+:} false; then :
++  $as_echo_n "(cached) " >&6
++else
++  cat > conftest.c <<EOF
++int _start (void) { return 42; }
++EOF
++if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS $no_ssp
++			    -fPIC -shared -o conftest.so conftest.c
++			    -Wl,--hash-style=both -nostdlib 1>&5'
++  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
++  test $ac_status = 0; }; }
++then
++  libc_cv_hashstyle=yes
++else
++  libc_cv_hashstyle=no
++fi
++rm -f conftest*
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_hashstyle" >&5
++$as_echo "$libc_cv_hashstyle" >&6; }
++
++
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLOB_DAT reloc" >&5
+ $as_echo_n "checking for GLOB_DAT reloc... " >&6; }
+ if ${libc_cv_has_glob_dat+:} false; then :
+diff --git a/configure.ac b/configure.ac
+index eb5bc6a131..870347c5cd 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1360,6 +1360,22 @@ LIBC_TRY_CC_OPTION([-fpie], [libc_cv_fpie=yes], [libc_cv_fpie=no])
+ 
+ AC_SUBST(libc_cv_fpie)
+ 
++AC_CACHE_CHECK(for --hash-style option,
++	       libc_cv_hashstyle, [dnl
++cat > conftest.c <<EOF
++int _start (void) { return 42; }
++EOF
++if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS $no_ssp
++			    -fPIC -shared -o conftest.so conftest.c
++			    -Wl,--hash-style=both -nostdlib 1>&AS_MESSAGE_LOG_FD])
++then
++  libc_cv_hashstyle=yes
++else
++  libc_cv_hashstyle=no
++fi
++rm -f conftest*])
++AC_SUBST(libc_cv_hashstyle)
++
+ AC_CACHE_CHECK(for GLOB_DAT reloc,
+ 	       libc_cv_has_glob_dat, [dnl
+ cat > conftest.c <<EOF
+-- 
+2.37.3
+
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From 9342790471bb0e9a532ad7879692deb4583938dd Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Wed, 14 Sep 2022 03:48:32 -0700
Subject: [PATCH 07/37] musl: add support for SIGEV_THREAD_ID timers

https://git.musl-libc.org/cgit/musl/commit/?id=7c71792e87691451f2a6b76348e83ad1889f1dcb
---
 ...d-support-for-SIGEV_THREAD_ID-timers.patch | 74 +++++++++++++++++++
 srcpkgs/musl/template                         |  2 +-
 2 files changed, 75 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch

diff --git a/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
new file mode 100644
index 000000000000..e20dff5ba0d4
--- /dev/null
+++ b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
@@ -0,0 +1,74 @@
+From 7c71792e87691451f2a6b76348e83ad1889f1dcb Mon Sep 17 00:00:00 2001
+From: James Y Knight <jyknight@google.com>
+Date: Sun, 30 Jun 2019 21:55:20 -0400
+Subject: [PATCH] add support for SIGEV_THREAD_ID timers
+
+This is like SIGEV_SIGNAL, but targeted to a particular thread's
+tid, rather than the process.
+---
+ include/signal.h        | 16 +++++++++++++---
+ src/time/timer_create.c |  8 ++++++--
+ 2 files changed, 19 insertions(+), 5 deletions(-)
+
+diff --git a/include/signal.h b/include/signal.h
+index fbdf667b2..9ed929e4f 100644
+--- a/include/signal.h
++++ b/include/signal.h
+@@ -180,14 +180,24 @@ struct sigevent {
+ 	union sigval sigev_value;
+ 	int sigev_signo;
+ 	int sigev_notify;
+-	void (*sigev_notify_function)(union sigval);
+-	pthread_attr_t *sigev_notify_attributes;
+-	char __pad[56-3*sizeof(long)];
++	union {
++		char __pad[64 - 2*sizeof(int) - sizeof(union sigval)];
++		pid_t sigev_notify_thread_id;
++		struct {
++			void (*sigev_notify_function)(union sigval);
++			pthread_attr_t *sigev_notify_attributes;
++		} __sev_thread;
++	} __sev_fields;
+ };
+ 
++#define sigev_notify_thread_id __sev_fields.sigev_notify_thread_id
++#define sigev_notify_function __sev_fields.__sev_thread.sigev_notify_function
++#define sigev_notify_attributes __sev_fields.__sev_thread.sigev_notify_attributes
++
+ #define SIGEV_SIGNAL 0
+ #define SIGEV_NONE 1
+ #define SIGEV_THREAD 2
++#define SIGEV_THREAD_ID 4
+ 
+ int __libc_current_sigrtmin(void);
+ int __libc_current_sigrtmax(void);
+diff --git a/src/time/timer_create.c b/src/time/timer_create.c
+index 5ddfda278..4bef23905 100644
+--- a/src/time/timer_create.c
++++ b/src/time/timer_create.c
+@@ -71,11 +71,15 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 	switch (evp ? evp->sigev_notify : SIGEV_SIGNAL) {
+ 	case SIGEV_NONE:
+ 	case SIGEV_SIGNAL:
++	case SIGEV_THREAD_ID:
+ 		if (evp) {
+ 			ksev.sigev_value = evp->sigev_value;
+ 			ksev.sigev_signo = evp->sigev_signo;
+ 			ksev.sigev_notify = evp->sigev_notify;
+-			ksev.sigev_tid = 0;
++			if (evp->sigev_notify == SIGEV_THREAD_ID)
++				ksev.sigev_tid = evp->sigev_notify_thread_id;
++			else
++				ksev.sigev_tid = 0;
+ 			ksevp = &ksev;
+ 		}
+ 		if (syscall(SYS_timer_create, clk, ksevp, &timerid) < 0)
+@@ -107,7 +111,7 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 
+ 		ksev.sigev_value.sival_ptr = 0;
+ 		ksev.sigev_signo = SIGTIMER;
+-		ksev.sigev_notify = 4; /* SIGEV_THREAD_ID */
++		ksev.sigev_notify = SIGEV_THREAD_ID;
+ 		ksev.sigev_tid = td->tid;
+ 		if (syscall(SYS_timer_create, clk, &ksev, &timerid) < 0)
+ 			timerid = -1;
diff --git a/srcpkgs/musl/template b/srcpkgs/musl/template
index 5bdc5c48e623..34e6ed4fba6e 100644
--- a/srcpkgs/musl/template
+++ b/srcpkgs/musl/template
@@ -2,7 +2,7 @@
 pkgname=musl
 reverts="1.2.0_1"
 version=1.1.24
-revision=10
+revision=11
 archs="*-musl"
 bootstrap=yes
 build_style=gnu-configure

From 22a009e2196cd7a8b803a650b74d124aee8a9d68 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 21:01:43 -0700
Subject: [PATCH 08/37] gcc-multilib: update to 12.2.0.

---
 srcpkgs/gcc-multilib/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index fcd25755aa75..df60849babc2 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,16 +3,16 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _majorver="${version%.*}"
-wrksrc=gcc-${version/pre/_pre}
+wrksrc="gcc-${version}"
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel
@@ -71,7 +71,7 @@ do_build() {
 	make ${makejobs}
 }
 do_install() {
-	local _pc_triplet=x86_64-pc-linux-gnu _version=${version%pre1}
+	local _pc_triplet=x86_64-pc-linux-gnu
 	# Install to a tempdir and then only copy relevant files.
 	cd ${wrksrc}
 	make DESTDIR=${wrksrc}/${pkgname}-build install
@@ -81,9 +81,9 @@ do_install() {
 	vmkdir usr/include/c++/${_majorver}/${_triplet}
 	vmkdir usr/lib/gcc/${_triplet}/${_majorver}
 
-	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${_version}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${version}/32 \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_majorver}/
-	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${_version}/${_pc_triplet}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${version}/${_pc_triplet}/32 \
 		${DESTDIR}/usr/include/c++/${_majorver}/${_triplet}
 
 	vinstall ${wrksrc}/host-${_pc_triplet}/gcc/specs 644 usr/lib/gcc/${_triplet}/${_majorver}

From 46c7f16946e179d8962ece466cb233d6b6094b7f Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Tue, 4 Oct 2022 03:49:13 -0700
Subject: [PATCH 09/37] libgccjit: update to 12.2.0.

---
 srcpkgs/libgccjit/files/libgccjit-musl.patch | 63 --------------------
 srcpkgs/libgccjit/template                   | 38 ++++++------
 2 files changed, 17 insertions(+), 84 deletions(-)
 delete mode 100644 srcpkgs/libgccjit/files/libgccjit-musl.patch

diff --git a/srcpkgs/libgccjit/files/libgccjit-musl.patch b/srcpkgs/libgccjit/files/libgccjit-musl.patch
deleted file mode 100644
index d2ed16928c82..000000000000
--- a/srcpkgs/libgccjit/files/libgccjit-musl.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-diff --git a/gcc/jit/jit-playback.c b/gcc/jit/jit-playback.c
-index 5bccf591a..35f5e35ef 100644
---- a/gcc/jit/jit-playback.c
-+++ b/gcc/jit/jit-playback.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -41,8 +43,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "diagnostic.h"
- #include "stmt.h"
- 
--#include <pthread.h>
--
- #include "jit-playback.h"
- #include "jit-result.h"
- #include "jit-builtins.h"
-diff --git a/gcc/jit/jit-recording.c b/gcc/jit/jit-recording.c
-index a237d574f..5785e3269 100644
---- a/gcc/jit/jit-recording.c
-+++ b/gcc/jit/jit-recording.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -25,8 +27,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "pretty-print.h"
- #include "toplev.h"
- 
--#include <pthread.h>
--
- #include "jit-builtins.h"
- #include "jit-recording.h"
- #include "jit-playback.h"
-diff --git a/gcc/jit/libgccjit.c b/gcc/jit/libgccjit.c
-index f9c33c63c..75f21d275 100644
---- a/gcc/jit/libgccjit.c
-+++ b/gcc/jit/libgccjit.c
-@@ -18,13 +18,13 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
- #include "timevar.h"
- #include "typed-splay-tree.h"
- #include "cppbuiltin.h"
--#include <pthread.h>
- 
- #include "libgccjit.h"
- #include "jit-recording.h"
diff --git a/srcpkgs/libgccjit/template b/srcpkgs/libgccjit/template
index 6f1d6256dcd6..b5d4540ce667 100644
--- a/srcpkgs/libgccjit/template
+++ b/srcpkgs/libgccjit/template
@@ -3,36 +3,32 @@
 # which use the version number.
 
 pkgname=libgccjit
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
+version=12.2.0
 revision=1
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
-_majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
-wrksrc=gcc-${version/pre/_pre}
+_mpc_version=1.2.1
+_isl_version=0.24
 short_desc="Just-In-Time Compilation library for GCC"
 maintainer="Lane Biocini <lane@mailbox.org>"
 homepage="https://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 nopie=yes
+create_wrksrc=yes
+build_wrksrc="gcc-${version}"
+patch_args="-Np1 --directory=${build_wrksrc}"
 lib32disabled=yes
 makedepends="zlib-devel"
 hostmakedepends="tar texinfo perl flex"
@@ -40,10 +36,10 @@ depends="gcc"
 checkdepends="dejagnu"
 
 post_extract() {
-	mv ${XBPS_BUILDDIR}/gmp-${_gmp_version} ${wrksrc}/gmp
-	mv ${XBPS_BUILDDIR}/mpfr-${_mpfr_version} ${wrksrc}/mpfr
-	mv ${XBPS_BUILDDIR}/mpc-${_mpc_version} ${wrksrc}/mpc
-	mv ${XBPS_BUILDDIR}/isl-${_isl_version} ${wrksrc}/isl
+	ln -s ${wrksrc}/gmp-${_gmp_version} ${wrksrc}/${build_wrksrc}/gmp
+	ln -s ${wrksrc}/mpfr-${_mpfr_version} ${wrksrc}/${build_wrksrc}/mpfr
+	ln -s ${wrksrc}/mpc-${_mpc_version} ${wrksrc}/${build_wrksrc}/mpc
+	ln -s ${wrksrc}/isl-${_isl_version} ${wrksrc}/${build_wrksrc}/isl
 }
 
 pre_configure() {
@@ -186,7 +182,7 @@ do_configure() {
 	[ -z "$XBPS_CHECK_PKGS" ] && _langs="jit" || _langs="jit,c++"
 	_args+=" --enable-languages=${_langs}"
 	CONFIG_SHELL=/bin/bash \
-		${wrksrc}/configure ${_args}
+		${wrksrc}/${build_wrksrc}/configure ${_args}
 }
 
 do_build() {

From 1bb8f82cc1e0ceecfe3d5a102dd5ce53e8bffb98 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 14 Aug 2022 19:29:36 -0700
Subject: [PATCH 10/37] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove -no-pie from build. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..5d40f0cdd8a6 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -53,6 +53,7 @@ _void_cross_build_binutils() {
 		--sbindir=/usr/bin \
 		--libdir=/usr/lib \
 		--libexecdir=/usr/lib \
+		--sysconfdir=/etc \
 		--target=${tgt} \
 		--with-sysroot=/usr/${tgt} \
 		--disable-nls \
@@ -60,7 +61,9 @@ _void_cross_build_binutils() {
 		--disable-multilib \
 		--disable-werror \
 		--disable-gold \
+		--disable-gprofng \
 		--enable-relro \
+		--enable-new-dtags \
 		--enable-plugins \
 		--enable-64-bit-bfd \
 		--enable-deterministic-archives \
@@ -132,6 +135,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -460,6 +464,14 @@ do_build() {
 	local binutils_ver linux_ver gcc_ver libc_ver libucontext_ver
 	local tgt=${sourcepkg/cross-}
 
+	export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}"
+	export CXXFLAGS="${CXXFLAGS/-D_FORTIFY_SOURCE=2/}"
+
+	# Disable explicit -fno-PIE, gcc/binutils/libc will figure this out itself.
+	export CFLAGS="${CFLAGS//-fno-PIE/}"
+	export CXXFLAGS="${CXXFLAGS//-fno-PIE/}"
+	export LDFLAGS="${LDFLAGS//-no-pie/}"
+
 	_void_cross_test_ver binutils
 	_void_cross_test_ver linux
 	_void_cross_test_ver gcc
@@ -625,6 +637,9 @@ do_install() {
 	# then remove it because it conflicts with libquadmath package
 	rm -rf ${DESTDIR}/${sysroot}/usr/lib/libquadmath.*
 
+	# Remove libdep linker plugin because it conflicts with system binutils
+	rm -f ${DESTDIR}/usr/lib/bfd-plugins/libdep*
+
 	# Remove leftover symlinks
 	rm -f ${DESTDIR}/usr/lib${XBPS_TARGET_WORDSIZE}
 	rm -f ${DESTDIR}/lib*

From 39f26f99d847f3f604018e9f38bc4c6013007690 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:09:31 -0700
Subject: [PATCH 11/37] linux5.18: update dotconfigs for gcc12

---
 srcpkgs/linux5.18/files/x86_64-dotconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/linux5.18/files/x86_64-dotconfig b/srcpkgs/linux5.18/files/x86_64-dotconfig
index 4e73a3195d40..ea6204868e23 100644
--- a/srcpkgs/linux5.18/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.18/files/x86_64-dotconfig
@@ -512,6 +512,7 @@ CONFIG_RETHUNK=y
 CONFIG_CPU_UNRET_ENTRY=y
 CONFIG_CPU_IBPB_ENTRY=y
 CONFIG_CPU_IBRS_ENTRY=y
+CONFIG_SLS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10060,8 +10061,11 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
 # Memory initialization
 #
 CONFIG_INIT_STACK_NONE=y
+# CONFIG_INIT_STACK_ALL_PATTERN is not set
+# CONFIG_INIT_STACK_ALL_ZERO is not set
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
+# CONFIG_ZERO_CALL_USED_REGS is not set
 # end of Memory initialization
 # end of Kernel hardening options
 # end of Security options
@@ -10538,6 +10542,7 @@ CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
 # CONFIG_UBSAN is not set
 CONFIG_HAVE_ARCH_KCSAN=y
+# CONFIG_KCSAN is not set
 # end of Generic Kernel Debugging Instruments
 
 #

From c0173f5aae9bad3d78de4f8d99cf27499528514e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:08 -0700
Subject: [PATCH 12/37] subversion: fix build for libtool 2.4.7

---
 srcpkgs/subversion/template | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/subversion/template b/srcpkgs/subversion/template
index 18c35e3a2132..0aa41212c5fd 100644
--- a/srcpkgs/subversion/template
+++ b/srcpkgs/subversion/template
@@ -24,6 +24,8 @@ distfiles="http://apache.uvigo.es/subversion/subversion-${version}.tar.bz2"
 checksum=c9130e8d0b75728a66f0e7038fc77052e671830d785b5616aad53b4810d3cc28
 
 pre_configure() {
+	./autogen.sh --release
+
 	# Based on native build values
 	cat <<-EOF >config.cache
 	ac_cv_python_includes=-I${XBPS_CROSS_BASE}/usr/include/python${py3_ver}
@@ -59,7 +61,12 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+
+	if [ "$XBPS_BUILD_ENVIRONMENT" = "void-packages-ci" ]; then
+		# This test will fail when run as the root user,
+		# because flock() will ignore file permissions.
+		vsed -i subversion/tests/libsvn_fs/locks-test.c -e '/SVN_TEST_OPTS_PASS(obtain_write_lock_failure,/,+3d'
+	fi
 }
 
 post_configure() {

From 3248d9d8fad1794595573e662ed8b8f6bd714d0a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:38 -0700
Subject: [PATCH 13/37] subversion-kwallet-auth: update to 1.14.2.

Fix failing distfiles.
Fix build for libtool 2.4.7
---
 srcpkgs/subversion-kwallet-auth/template | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/subversion-kwallet-auth/template b/srcpkgs/subversion-kwallet-auth/template
index 12210f250d51..9cc68c3fe5f1 100644
--- a/srcpkgs/subversion-kwallet-auth/template
+++ b/srcpkgs/subversion-kwallet-auth/template
@@ -3,7 +3,7 @@
 # THIS PKG MUST BE SYNCHRONIZED WITH "srcpkgs/subversion".
 #
 pkgname=subversion-kwallet-auth
-version=1.14.1
+version=1.14.2
 revision=1
 wrksrc="subversion-${version}"
 build_style=gnu-configure
@@ -22,10 +22,12 @@ license="Apache-2.0, BSD-3-Clause"
 homepage="http://subversion.apache.org/"
 changelog="https://subversion.apache.org/docs/release-notes/${version%.*}.html"
 distfiles="http://apache.uvigo.es/subversion/subversion-${version}.tar.bz2"
-checksum=2c5da93c255d2e5569fa91d92457fdb65396b0666fad4fd59b22e154d986e1a9
+checksum=c9130e8d0b75728a66f0e7038fc77052e671830d785b5616aad53b4810d3cc28
 lib32disabled=yes
 
 pre_configure() {
+	./autogen.sh --release
+
 	# Based on native build values
 	cat <<-EOF >config.cache
 	ac_cv_python_includes=-I${XBPS_CROSS_BASE}/usr/include/python${py3_ver}
@@ -55,11 +57,18 @@ pre_configure() {
 		cp "$XBPS_CROSS_BASE/usr/lib/perl5/core_perl/Config"*.p? $PERL5LIB
 		cp "$XBPS_CROSS_BASE/usr/lib/perl5/core_perl/Errno.pm" $PERL5LIB
 		vsed -e "s;archlibexp => '\(.*\)';archlibexp => '${XBPS_CROSS_BASE}\1';" \
-			-i $PERL5LIB/Config.pm $PERL5LIB/Config_heavy.pl
+			-i $PERL5LIB/Config.pm
+		vsed -e "s;archlibexp='\(.*\)';archlibexp='${XBPS_CROSS_BASE}\1';" \
+			-i $PERL5LIB/Config_heavy.pl
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+
+	if [ "$XBPS_BUILD_ENVIRONMENT" = "void-packages-ci" ]; then
+		# This test will fail when run as the root user,
+		# because flock() will ignore file permissions.
+		vsed -i subversion/tests/libsvn_fs/locks-test.c -e '/SVN_TEST_OPTS_PASS(obtain_write_lock_failure,/,+3d'
+	fi
 }
 
 post_configure() {

From 485314c79e48f8a9c53983881c2ac66e794a1fe6 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 14/37] cross-aarch64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..bd6b23f9fb6a 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 68214dcedbf974fd9fb5a4729363ef39e169df9b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 15/37] cross-aarch64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..427ad2c1e9cd 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 7e00d0d9a3e0a3b400e2b13797779548069ec863 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 16/37] cross-arm-linux-gnueabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..2510ee26e789 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 574e81e2be0c2c8808dc471594fb5bb2d93584df Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 17/37] cross-arm-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..bd8b16e1b4c1 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 13778d802d3c2a5ebda19edb7822ea305801c052 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 18/37] cross-arm-linux-musleabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..dacfd2655216 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From deeab638b79e487376a1e4014c4facf9ccf6f64f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 19/37] cross-arm-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..9ddd32a9f20d 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From c203b1d5a69faf993f4914b08554ea2441549f31 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 20/37] cross-armv7l-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..9fb00f18be3b 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From ee382a3152e50400d121a68bf8d38d7e21d2ba83 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 21/37] cross-armv7l-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..2c72e75ddfe3 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 146c2857f6cbbafc3ba59df08ccf18887c5ca80b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 22/37] cross-i686-pc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..4dc17df648b5 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From b9c385be813b63212b381d2dad9c612b7ecaee08 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Fri, 16 Sep 2022 20:52:19 -0700
Subject: [PATCH 23/37] cross-i686-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-linux-musl/template b/srcpkgs/cross-i686-linux-musl/template
index 8be16a230d8d..78b4d813a113 100644
--- a/srcpkgs/cross-i686-linux-musl/template
+++ b/srcpkgs/cross-i686-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-i686-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-i686-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From a8f33ce609057974411a9d2a9b31a1f8fe8e42c1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 24/37] cross-mips-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..6009e5c79eb2 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From ebd754bd353fd6ec85a1d5f595a83cb89c3bd9fc Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 25/37] cross-mips-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..080164df193d 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="hipperson0 <hipperson0@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 9393ee697fc6581ffe22b959d8d6f26e59d3ab82 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 26/37] cross-mipsel-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..f9fd4b8a04ef 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 5602655bdf6a6b47e15f08380e02e1151e8bc534 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 27/37] cross-mipsel-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..7418a984474b 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From fd6731cf4315134ee152a2907acd148fcb85393c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 28/37] cross-powerpc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..31e57b4e52b2 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From c107413012d49c0d9b2827985ce5edfb6e97b18b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 29/37] cross-powerpc-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..a2d1edcf1ffd 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From b8f438f86016f9eca165afca4f559b32d8ae44b5 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 30/37] cross-powerpc64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..1a4cbed61e76 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 6a4df6be570d63f88daf5666b859ff6e1a69ff5a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 31/37] cross-powerpc64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 016f18776a6d..19b1ff859eb6 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 271ab411d9b05ef2521fd288042b7b6ad24861a7 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 32/37] cross-powerpc64le-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 463d7e92d20d..9d99a3a315d2 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 49339c379b743d8b72e07bd0a49ea5f1a6ae5e74 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 33/37] cross-powerpc64le-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index c17a3cccfe29..3128baa7372e 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 08abd79742a2b606f6bd423ad51ecf63d00e473f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 34/37] cross-powerpcle-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 9aede3c465ce..0462a1015a1a 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 
@@ -35,6 +35,8 @@ if [ "$XBPS_TARGET_MACHINE" = "ppcle" ]; then
 	broken="Can't build crosstoolchain to itself"
 fi
 
+broken="glibc uses big-endian specific instructions on 32-bit powerpc"
+
 cross-powerpcle-linux-gnu-libc_package() {
 	short_desc+=" - glibc files"
 	nostrip=yes

From 9a8e14e0c1005d8642dd316475cd337bd496113d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 35/37] cross-powerpcle-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index 045cfda987fe..20e70bed4c60 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 5beb6ab724fe866bc5b5dbd792a2c120798b582d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 36/37] cross-x86_64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 8918f3c22a1c..5219cd50f851 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 3695b0f08e06b358074b053d3f2907ef1e4eaebc Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 37/37] cross-x86_64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..2811de0d3c2e 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (202 preceding siblings ...)
  2022-10-14 10:10 ` [PR PATCH] [Updated] " oreo639
@ 2022-10-14 10:11 ` oreo639
  2022-10-15 10:41 ` oreo639
                   ` (60 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-10-14 10:11 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5478 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.2.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.2.0

There is a list of failing builds here: https://github.com/void-linux/void-packages/issues/39809

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [x] llvm https://github.com/void-linux/void-packages/pull/38694
- [x] m4 https://github.com/void-linux/void-packages/pull/33730
- [x] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [x] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [x] libvirt https://github.com/void-linux/void-packages/pull/38842
- [x] syslinux https://github.com/void-linux/void-packages/pull/38876
- [x] efivar https://github.com/void-linux/void-packages/pull/38874
- [ ] gpgme https://github.com/void-linux/void-packages/pull/38825

Known packages that needed to be fixed/updated for gcc12:
- [ ] linux5.18 (in this PR)
- [x] openssh https://github.com/void-linux/void-packages/pull/38849
- [x] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [x] doxygen https://github.com/void-linux/void-packages/pull/38846
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] libproxy https://github.com/void-linux/void-packages/pull/38818
- [x] exempi https://github.com/void-linux/void-packages/pull/38820
- [x] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [x] libunique1 https://github.com/void-linux/void-packages/pull/38848 or https://github.com/void-linux/void-packages/pull/38873
- [x] libwpd https://github.com/void-linux/void-packages/pull/38878
- [x] cglm https://github.com/void-linux/void-packages/pull/39748
- [x] coreboot-utils https://github.com/void-linux/void-packages/pull/39749
- [x] apl https://github.com/void-linux/void-packages/pull/39750
- [x] igt-gpu-tools https://github.com/void-linux/void-packages/pull/39780

Needs to be fixed/updated for binutils:
- [x] grub https://github.com/void-linux/void-packages/pull/38875
- [x] linux-tools https://github.com/void-linux/void-packages/pull/38877
- [x] kcov https://github.com/void-linux/void-packages/pull/39291

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [x] kde
- [x] lxde
- [x] lxqt

You can test the ISOs here:
https://drive.google.com/drive/folders/1ix92CYSLUP-KWjLxltdgG4e8Nu2JCY5n?usp=sharing

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 133461 bytes --]

From fbf1a62679f519e8c86a501129188ceb820e2d45 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 01/37] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../fix-libcollector-without-java.patch       | 53 +++++++++++++++
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 25 ++++---
 4 files changed, 87 insertions(+), 117 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
 create mode 100644 srcpkgs/binutils/patches/fix-libcollector-without-java.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/fix-libcollector-without-java.patch b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
new file mode 100644
index 000000000000..54384875f358
--- /dev/null
+++ b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
@@ -0,0 +1,53 @@
+From 49ddd814ac1071af7c4f45d5f8398b91862f2c7f Mon Sep 17 00:00:00 2001
+From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
+Date: Wed, 17 Aug 2022 19:55:23 -0700
+Subject: [PATCH] gprofng: fix bug 29479 Collection fails when built without
+ java support
+
+gprofng/ChangeLog
+2022-08-17  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>
+
+	PR gprofng/29479
+	* libcollector/collector.c: Add #if defined(GPROFNG_JAVA_PROFILING) for
+	java specific code.
+	* libcollector/unwind.c: Likewise.
+---
+ gprofng/libcollector/collector.c | 2 ++
+ gprofng/libcollector/unwind.c    | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/gprofng/libcollector/collector.c b/gprofng/libcollector/collector.c
+index 93c9d3330de5..ceff2c1caccb 100644
+--- a/gprofng/libcollector/collector.c
++++ b/gprofng/libcollector/collector.c
+@@ -913,8 +913,10 @@ __collector_open_experiment (const char *exp, const char *params, sp_origin_t or
+   __collector_ext_unwind_key_init (1, NULL);
+ 
+   /* start java attach if suitable */
++#if defined(GPROFNG_JAVA_PROFILING)
+   if (exp_origin == SP_ORIGIN_DBX_ATTACH)
+     __collector_jprofile_start_attach ();
++#endif
+   start_sec_time = CALL_UTIL (time)(NULL);
+   __collector_start_time = collector_interface.getHiResTime ();
+   TprintfT (DBG_LT0, "\t__collector_open_experiment; resetting start_time\n");
+diff --git a/gprofng/libcollector/unwind.c b/gprofng/libcollector/unwind.c
+index 119243788020..f8e11823c81e 100644
+--- a/gprofng/libcollector/unwind.c
++++ b/gprofng/libcollector/unwind.c
+@@ -557,6 +557,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+   int size = max_frame_size;
+ 
+ #define MIN(a,b) ((a)<(b)?(a):(b))
++#if defined(GPROFNG_JAVA_PROFILING)
+   /* get Java info */
+   if (__collector_java_mode && __collector_java_asyncgetcalltrace_loaded && context && !pseudo_context)
+     {
+@@ -569,6 +570,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+ 	  size -= sz;
+ 	}
+     }
++#endif
+ 
+   /* get native stack */
+   if (context)
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..c355a5fc8016 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkgconf"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -35,15 +36,21 @@ do_configure() {
 	local conf
 
 	if [ "$CHROOT_READY" ]; then
-		conf+=" --with-debuginfod"
+		conf+=" --with-debuginfod --enable-shared"
 	else
-		conf+=" --without-debuginfod --disable-install-libbfd"
+		conf+=" --without-debuginfod --disable-shared --disable-install-libbfd"
 	fi
 	if [ "$CROSS_BUILD" ]; then
 		# we don't want --with-sysroot=${XBPS_CROSS_BASE} like gnu-configure
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	# gprofng currently only supports x86 and aarch64 glibc.
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64|i386|aarch64) conf+=" --enable-gprofng" ;;
+		*) conf+=" --disable-gprofng" ;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"
@@ -76,13 +83,14 @@ do_configure() {
 		--libdir=/usr/lib \
 		--mandir=/usr/share/man \
 		--infodir=/usr/share/info \
+		--sysconfdir=/etc \
 		--disable-werror \
-		--disable-shared \
 		--disable-nls \
 		--enable-threads \
 		--enable-plugins \
 		--enable-relro \
 		--enable-gold \
+		--enable-new-dtags \
 		--enable-deterministic-archives \
 		--enable-64-bit-bfd \
 		--enable-ld=default \
@@ -142,7 +150,8 @@ binutils-devel_package() {
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/*.a"
-		vmove "usr/lib/*.so"
+		vmove "usr/lib/libbfd.so"
+		vmove "usr/lib/libopcodes.so"
 	}
 }
 

From 575965414ecbb00a4a724f350d64e50b96216b32 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 2 Oct 2022 16:46:59 -0700
Subject: [PATCH 02/37] gdb: resolve conflict with binutils 2.39

---
 srcpkgs/gdb/template | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/gdb/template b/srcpkgs/gdb/template
index ff7c9d9a5911..5970402eb27e 100644
--- a/srcpkgs/gdb/template
+++ b/srcpkgs/gdb/template
@@ -1,7 +1,7 @@
 # Template file for 'gdb'
 pkgname=gdb
 version=12.1
-revision=1
+revision=2
 build_style=gnu-configure
 pycompile_dirs="/usr/share/gdb/python"
 configure_args="--disable-werror --disable-nls --with-system-readline
@@ -48,7 +48,8 @@ vopt_conflict debuginfod static
 
 post_install() {
 	# resolve conflicts with binutils
-	rm -r ${DESTDIR}/usr/{include,lib,share/info/bfd.info*}
+	rm -rf ${DESTDIR}/usr/{include,lib}
+	rm -rf ${DESTDIR}/usr/share/info/{bfd,ctf-spec}.info*
 }
 
 gdb-common_package() {

From e7cd89dc29ec074c033cedce73a0ea981ca9ae54 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 03/37] gcc: update to 12.2.0.

---
 common/shlibs                                 |  10 +-
 srcpkgs/gcc/files/gccgo-musl.patch            |  71 ++-------
 srcpkgs/gcc/files/libgnarl-musl.patch         |  18 +--
 srcpkgs/gcc/files/libssp-musl.patch           |  10 +-
 srcpkgs/gcc/patches/libffi_gnulinux.patch     |  11 --
 .../gcc/patches/libgcc-ibm128-no-tag.patch    |  10 +-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |   2 +-
 srcpkgs/gcc/template                          | 136 +++++++++---------
 8 files changed, 105 insertions(+), 163 deletions(-)
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index 2c579d7b5a3e..006ab88d9696 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.2.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.36 perl-5.36.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -847,8 +847,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.2.0_1
+libgnat-12.so libada-12.2.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1698,8 +1698,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.2.0_1
+libasan.so.8 libsanitizer-12.2.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..12ec68dd8aa3 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,14 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ b/libgo/go/runtime/os_linux.go
+@@ -365,7 +365,7 @@ func setThreadCPUProfiler(hz int32) {
+ 	var sevp _sigevent
+ 	sevp.sigev_notify = _SIGEV_THREAD_ID
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.__sev_fields))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..5ffd54e466ae 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,37 +3,35 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
+version=12.2.0
+revision=1
+_minorver="${version%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
-wrksrc=gcc-${version/pre/_pre}
+_mpc_version=1.2.1
+_isl_version=0.24
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
+create_wrksrc=yes
+build_wrksrc="gcc-${version}"
+patch_args="-Np1 --directory=${build_wrksrc}"
 lib32disabled=yes
 bootstrap=yes
 replaces="gcc-gcj<7.2.0 gcc-gcj-jdk-compat<7.2.0 libmpx>=0 libmpx-devel>=0"
@@ -52,8 +50,11 @@ if [ "$CHROOT_READY" ]; then
 	hostmakedepends="tar texinfo perl flex"
 else
 	_have_gccgo=no
+	# libzstd fails to link in bootstrap with glibc 2.36
+	# when zlib has been compiled with glibc 2.32.
+	LDFLAGS="-lzstd -pthread"
 fi
-makedepends="zlib-devel"
+makedepends="zlib-devel libzstd-devel"
 depends="binutils libgcc-devel-${version}_${revision}
  libstdc++-devel-${version}_${revision} libssp-devel-${version}_${revision}"
 checkdepends="dejagnu"
@@ -70,13 +71,13 @@ if [ "$build_option_gnatboot" ]; then
 	case "$XBPS_TARGET_MACHINE" in
 	x86_64)
 		_gnat_tarball="gnat-gpl-2017-x86_64-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/591c6d80c7a447af2deed1d7>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/9682e2e1f2f232ce03fe21d77b14c37a0de5649b?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" b942bcac20dea39748b39f8b624d9619f60a8dee2e8195dbe3829c835b0956e6"
 		build_options_default="gnatboot"
 		;;
 	i686)
 		_gnat_tarball="gnat-gpl-2014-x86-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/564b3e9dc8e196b040fbe248>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/c5e9e6fdff5cb77ed90cf8c62536653e27c0bed6?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" 3b693510f5d22a240abb3034934c1adbd80ccd6e4f61a4f491cc408fdfd9c042"
 		build_options_default="gnatboot"
 		;;
@@ -155,25 +156,24 @@ if [ "$CROSS_BUILD" ]; then
 fi
 
 post_extract() {
-	mkdir -p ${wrksrc}/{gmp,mpfr,mpc,isl}
-	cp -ar ${XBPS_BUILDDIR}/gmp-${_gmp_version}/* ${wrksrc}/gmp/
-	cp -ar ${XBPS_BUILDDIR}/mpfr-${_mpfr_version}/* ${wrksrc}/mpfr/
-	cp -ar ${XBPS_BUILDDIR}/mpc-${_mpc_version}/* ${wrksrc}/mpc/
-	cp -ar ${XBPS_BUILDDIR}/isl-${_isl_version}/* ${wrksrc}/isl/
+	ln -s ${wrksrc}/gmp-${_gmp_version} ${wrksrc}/${build_wrksrc}/gmp
+	ln -s ${wrksrc}/mpfr-${_mpfr_version} ${wrksrc}/${build_wrksrc}/mpfr
+	ln -s ${wrksrc}/mpc-${_mpc_version} ${wrksrc}/${build_wrksrc}/mpc
+	ln -s ${wrksrc}/isl-${_isl_version} ${wrksrc}/${build_wrksrc}/isl
 
 	if [ "$build_option_gnatboot" ]; then
 		local f="${XBPS_SRCDISTDIR}/${pkgname}-${version}/${_gnat_tarball}"
 		msg_normal "Extracting ${_gnat_tarball} ...\n"
-		mkdir -p ${wrksrc}/gnat-ins
-		tar -x -f "$f" --strip-components=1 -C ${wrksrc}/gnat-ins
-		cd ${wrksrc}/gnat-ins
-		make ins-all prefix=${wrksrc}/gnat
-		cd ${wrksrc}
-		rm -rf ${wrksrc}/gnat-ins
+		mkdir -p ${wrksrc}/${build_wrksrc}/gnat-ins
+		tar -x -f "$f" --strip-components=1 -C ${wrksrc}/${build_wrksrc}/gnat-ins
+		cd ${wrksrc}/${build_wrksrc}/gnat-ins
+		make ins-all prefix=${wrksrc}/${build_wrksrc}/gnat
+		cd ${wrksrc}/${build_wrksrc}
+		rm -rf ${wrksrc}/${build_wrksrc}/gnat-ins
 
 		# Rename obsolete ld and as
-		find ${wrksrc}/gnat -name ld -exec mv -v {} {}.old \;
-		find ${wrksrc}/gnat -name as -exec mv -v {} {}.old \;
+		find ${wrksrc}/${build_wrksrc}/gnat -name ld -exec mv -v {} {}.old \;
+		find ${wrksrc}/${build_wrksrc}/gnat -name as -exec mv -v {} {}.old \;
 	fi
 }
 
@@ -185,9 +185,9 @@ pre_configure() {
 	sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
 
 	if [ "$XBPS_TARGET_LIBC" = musl ]; then
-		patch -p1 -i ${FILESDIR}/libgnarl-musl.patch
-		patch -p1 -i ${FILESDIR}/libssp-musl.patch
-		patch -p1 -i ${FILESDIR}/gccgo-musl.patch
+		for p in ${FILESDIR}/*-musl.patch; do
+			patch -p1 -i $p
+		done
 	fi
 }
 do_configure() {
@@ -297,19 +297,19 @@ do_configure() {
 		_args+=" --enable-languages=${_langs},ada"
 		_args+=" --enable-libada"
 		CONFIG_SHELL=/bin/bash \
-		CC="${wrksrc}/gnat/bin/gcc" \
-		GNATBIND="${wrksrc}/gnat/bin/gnatbind" \
-		GNATMAKE="${wrksrc}/gnat/bin/gnatmake" \
-		PATH="${wrksrc}/gnat/bin:$PATH" \
-			${wrksrc}/configure ${_args}
+		CC="${wrksrc}/${build_wrksrc}/gnat/bin/gcc" \
+		GNATBIND="${wrksrc}/${build_wrksrc}/gnat/bin/gnatbind" \
+		GNATMAKE="${wrksrc}/${build_wrksrc}/gnat/bin/gnatmake" \
+		PATH="${wrksrc}/${build_wrksrc}/gnat/bin:$PATH" \
+			${wrksrc}/${build_wrksrc}/configure ${_args}
 	elif [ "$build_option_ada" ]; then
 		_args+=" --enable-languages=${_langs},ada"
 		CONFIG_SHELL=/bin/bash \
-			${wrksrc}/configure ${_args}
+			${wrksrc}/${build_wrksrc}/configure ${_args}
 	else
 		_args+=" --enable-languages=${_langs}"
 		CONFIG_SHELL=/bin/bash \
-			${wrksrc}/configure ${_args}
+			${wrksrc}/${build_wrksrc}/configure ${_args}
 	fi
 }
 do_build() {
@@ -318,10 +318,10 @@ do_build() {
 	fi
 	cd build
 	if [ "$build_option_gnatboot" ]; then
-		CC="${wrksrc}/gnat/bin/gcc" \
-		GNATBIND="${wrksrc}/gnat/bin/gnatbind" \
-		GNATMAKE="${wrksrc}/gnat/bin/gnatmake" \
-		PATH="${wrksrc}/gnat/bin:$PATH" \
+		CC="${wrksrc}/${build_wrksrc}/gnat/bin/gcc" \
+		GNATBIND="${wrksrc}/${build_wrksrc}/gnat/bin/gnatbind" \
+		GNATMAKE="${wrksrc}/${build_wrksrc}/gnat/bin/gnatmake" \
+		PATH="${wrksrc}/${build_wrksrc}/gnat/bin:$PATH" \
 		make ${makejobs}
 	else
 		make ${makejobs}
@@ -330,7 +330,7 @@ do_build() {
 pre_install() {
 	if [ "$CROSS_BUILD" ]; then
 		# XXX otherwise links to host libpthread
-		for f in $(find ${wrksrc}/build/${XBPS_CROSS_TRIPLET} -type f -name libtool); do
+		for f in $(find ${wrksrc}/${build_wrksrc}/build/${XBPS_CROSS_TRIPLET} -type f -name libtool); do
 			sed -e "s,add_dir=\"-L\$libdir\",add_dir=\"-L${XBPS_CROSS_BASE}\$libdir\",g" -i $f
 		done
 	fi
@@ -342,16 +342,16 @@ do_install() {
 
 	# Make version a symlink of major version to make all versions
 	# from the same series work automagically.
-	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver} \
+	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${version} \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver}
 	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver} \
-		${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}
+		${DESTDIR}/usr/lib/gcc/${_triplet}/${version}
 
 	# Ditto for c++ headers.
-	mv ${DESTDIR}/usr/include/c++/${_patchver} \
+	mv ${DESTDIR}/usr/include/c++/${version} \
 		${DESTDIR}/usr/include/c++/${_minorver}
 	ln -sfr ${DESTDIR}/usr/include/c++/${_minorver} \
-		${DESTDIR}/usr/include/c++/${_patchver}
+		${DESTDIR}/usr/include/c++/${version}
 
 	# cc symlink
 	ln -sfr ${DESTDIR}/usr/bin/gcc ${DESTDIR}/usr/bin/cc
@@ -360,7 +360,7 @@ do_install() {
 
 	# lto plugin symlink
 	vmkdir usr/lib/bfd-plugins
-	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}/liblto_plugin.so \
+	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${version}/liblto_plugin.so \
 		${DESTDIR}/usr/lib/bfd-plugins
 
 	# Remove "fixed" header
@@ -371,13 +371,9 @@ do_install() {
 	rm -f ${DESTDIR}/usr/lib/libffi*
 	rm -f ${DESTDIR}/usr/share/man/man3/ffi*
 
-	# Remove all python scripts in libdir.
-	rm -f ${DESTDIR}/usr/lib/*.py
-
-	# Remove more python stuff.
-	if [ -d ${DESTDIR}/usr/share/gcc-${_patchver}/python ]; then
-		rm -rf ${DESTDIR}/usr/share/gcc-${_patchver}/python
-	fi
+	# Move libstdc++ gdb helpers to location where gdb can autoload them
+	mkdir -p ${DESTDIR}/usr/share/gdb/auto-load/usr/lib
+	mv ${DESTDIR}/usr/lib/*.py ${DESTDIR}/usr/share/gdb/auto-load/usr/lib
 
 	# Install c89 and c99 wrappers and its manpages, from NetBSD.
 	for f in c89 c99; do
@@ -396,7 +392,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}
@@ -449,7 +445,7 @@ gcc-fortran_package() {
 		if [ "$CROSS_BUILD" ]; then
 			# A number of OMP modules are not built when cross
 			# compiling gcc. Copy them from the cross compiler.
-			local src="/usr/lib/gcc/${_triplet}/${_patchver}/finclude"
+			local src="/usr/lib/gcc/${_triplet}/${version}/finclude"
 			local dst="usr/lib/gcc/${_triplet}/${_minorver}/finclude"
 			for f in omp_lib.f90 omp_lib.h omp_lib.mod omp_lib_kinds.mod \
 				openacc.f90 openacc.mod openacc_kinds.mod openacc_lib.h; do
@@ -516,7 +512,7 @@ libgfortran_package() {
 	short_desc+=" - Fortran library"
 	pkg_install() {
 		vmove "usr/lib/libgfortran.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -537,7 +533,7 @@ libgo_package() {
 	nostrip=yes
 	pkg_install() {
 		vmove "usr/lib/libgo.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -553,7 +549,7 @@ libobjc_package() {
 	short_desc+=" - Objective-C library"
 	pkg_install() {
 		vmove "usr/lib/libobjc.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -572,7 +568,7 @@ libquadmath_package() {
 	short_desc+=" - quadmath library"
 	pkg_install() {
 		vmove "usr/lib/libquadmath.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -614,7 +610,7 @@ libgcc_package() {
 	noverifyrdeps=yes
 	pkg_install() {
 		vmove "usr/lib/libgcc_s.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -645,7 +641,7 @@ libgomp_package() {
 	short_desc+=" - OpenMP v4.0 library"
 	pkg_install() {
 		vmove "usr/lib/libgomp*.so.*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -700,7 +696,7 @@ libssp_package() {
 	short_desc+=" - SSP (StackSmashingProtection) library"
 	pkg_install() {
 		vmove "usr/lib/libssp.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -717,7 +713,9 @@ libstdc++-devel_package() {
 libstdc++_package() {
 	short_desc+=" - Standard C++ Library"
 	pkg_install() {
+		vmove usr/share/gdb
+		vmove usr/share/gcc-${version}/python
 		vmove "usr/lib/libstdc++.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }

From cf62635ca6c8ebd3db709b16432382bf914cea4a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 04/37] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      | 11 ++++--
 2 files changed, 25 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..a4087ec2055e 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,12 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
+
+if [ "$XBPS_TARGET_LIBC" == "musl" ]; then
+	# Musl always searches LD_LIBRARY_PATH before RPATH and RUNPATH
+	make_build_args="lt_cv_shlibpath_overrides_runpath=yes"
+fi
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From 675de62be1c0e30eaefa2d72e3a7d92cc9e8e71a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 05/37] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 55255dceae8b..ca2d858a7abc 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From 5738c22a514c7fc21c16e7a0ac43a001407d04ac Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 06/37] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 ...e-hash-style-both-for-building-glibc.patch |  51 ++++
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 4 files changed, 106 insertions(+), 353 deletions(-)
 create mode 100644 srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index 006ab88d9696..79f9929d89b5 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch b/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
new file mode 100644
index 000000000000..9c5553e92609
--- /dev/null
+++ b/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
@@ -0,0 +1,51 @@
+Temporary workaround for EAC bug.
+
+See: https://sourceware.org/bugzilla/show_bug.cgi?id=29456
+
+From 8e90e2cc5e57d7ca3a40602d278e9642a8b66716 Mon Sep 17 00:00:00 2001
+From: oreo639 <oreo6391@gmail.com>
+Date: Tue, 13 Sep 2022 14:30:35 -0700
+Subject: [PATCH] Revert "Do not use --hash-style=both for building glibc
+ shared objects"
+
+This reverts commit e47de5cb2d4dbecb58f569ed241e8e95c568f03c.
+---
+ Makeconfig     |  9 +++++++++
+ Makerules      |  7 +++++++
+ 5 files changed, 61 insertions(+)
+
+diff --git a/Makeconfig b/Makeconfig
+index ba70321af1..e2131d4389 100644
+--- a/Makeconfig
++++ b/Makeconfig
+@@ -371,6 +371,13 @@ dt-relr-ldflag =
+ no-dt-relr-ldflag =
+ endif
+ 
++# For the time being we unconditionally use 'both'.  At some time we
++# should declare statically linked code as 'out of luck' and compile
++# with --hash-style=gnu only.
++hashstyle-LDFLAGS = -Wl,--hash-style=both
++LDFLAGS.so += $(hashstyle-LDFLAGS)
++LDFLAGS-rtld += $(hashstyle-LDFLAGS)
++
+ ifeq (no,$(build-pie-default))
+ pie-default = $(no-pie-ccflag)
+ else # build-pie-default
+diff --git a/Makerules b/Makerules
+index d1e139d03c..44134e37ce 100644
+--- a/Makerules
++++ b/Makerules
+@@ -558,6 +558,9 @@ $(common-objpfx)shlib.lds: $(common-objpfx)config.make $(..)Makerules
+ 		  -Wl,--verbose 2>/dev/null | \
+ 	  sed > $@T \
+ 	      -e '/^=========/,/^=========/!d;/^=========/d' \
++		   -e 's/^.*\.gnu\.hash[ 	]*:.*$$/  .note.ABI-tag : { *(.note.ABI-tag) } &/' \
++		   -e '/^[ 	]*\.hash[ 	]*:.*$$/{h;d;}' \
++		   -e '/DATA_SEGMENT_ALIGN/{H;g}' \
+ 	      -e 's/^.*\*(\.dynbss).*$$/& \
+ 		 PROVIDE(__start___libc_freeres_ptrs = .); \
+ 		 *(__libc_freeres_ptrs) \
+-- 
+2.37.3
+
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From 3e3c442db2926270bc2683d894d9f3ce04ba7e2c Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Wed, 14 Sep 2022 03:48:32 -0700
Subject: [PATCH 07/37] musl: add support for SIGEV_THREAD_ID timers

https://git.musl-libc.org/cgit/musl/commit/?id=7c71792e87691451f2a6b76348e83ad1889f1dcb
---
 ...d-support-for-SIGEV_THREAD_ID-timers.patch | 74 +++++++++++++++++++
 srcpkgs/musl/template                         |  2 +-
 2 files changed, 75 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch

diff --git a/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
new file mode 100644
index 000000000000..e20dff5ba0d4
--- /dev/null
+++ b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
@@ -0,0 +1,74 @@
+From 7c71792e87691451f2a6b76348e83ad1889f1dcb Mon Sep 17 00:00:00 2001
+From: James Y Knight <jyknight@google.com>
+Date: Sun, 30 Jun 2019 21:55:20 -0400
+Subject: [PATCH] add support for SIGEV_THREAD_ID timers
+
+This is like SIGEV_SIGNAL, but targeted to a particular thread's
+tid, rather than the process.
+---
+ include/signal.h        | 16 +++++++++++++---
+ src/time/timer_create.c |  8 ++++++--
+ 2 files changed, 19 insertions(+), 5 deletions(-)
+
+diff --git a/include/signal.h b/include/signal.h
+index fbdf667b2..9ed929e4f 100644
+--- a/include/signal.h
++++ b/include/signal.h
+@@ -180,14 +180,24 @@ struct sigevent {
+ 	union sigval sigev_value;
+ 	int sigev_signo;
+ 	int sigev_notify;
+-	void (*sigev_notify_function)(union sigval);
+-	pthread_attr_t *sigev_notify_attributes;
+-	char __pad[56-3*sizeof(long)];
++	union {
++		char __pad[64 - 2*sizeof(int) - sizeof(union sigval)];
++		pid_t sigev_notify_thread_id;
++		struct {
++			void (*sigev_notify_function)(union sigval);
++			pthread_attr_t *sigev_notify_attributes;
++		} __sev_thread;
++	} __sev_fields;
+ };
+ 
++#define sigev_notify_thread_id __sev_fields.sigev_notify_thread_id
++#define sigev_notify_function __sev_fields.__sev_thread.sigev_notify_function
++#define sigev_notify_attributes __sev_fields.__sev_thread.sigev_notify_attributes
++
+ #define SIGEV_SIGNAL 0
+ #define SIGEV_NONE 1
+ #define SIGEV_THREAD 2
++#define SIGEV_THREAD_ID 4
+ 
+ int __libc_current_sigrtmin(void);
+ int __libc_current_sigrtmax(void);
+diff --git a/src/time/timer_create.c b/src/time/timer_create.c
+index 5ddfda278..4bef23905 100644
+--- a/src/time/timer_create.c
++++ b/src/time/timer_create.c
+@@ -71,11 +71,15 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 	switch (evp ? evp->sigev_notify : SIGEV_SIGNAL) {
+ 	case SIGEV_NONE:
+ 	case SIGEV_SIGNAL:
++	case SIGEV_THREAD_ID:
+ 		if (evp) {
+ 			ksev.sigev_value = evp->sigev_value;
+ 			ksev.sigev_signo = evp->sigev_signo;
+ 			ksev.sigev_notify = evp->sigev_notify;
+-			ksev.sigev_tid = 0;
++			if (evp->sigev_notify == SIGEV_THREAD_ID)
++				ksev.sigev_tid = evp->sigev_notify_thread_id;
++			else
++				ksev.sigev_tid = 0;
+ 			ksevp = &ksev;
+ 		}
+ 		if (syscall(SYS_timer_create, clk, ksevp, &timerid) < 0)
+@@ -107,7 +111,7 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 
+ 		ksev.sigev_value.sival_ptr = 0;
+ 		ksev.sigev_signo = SIGTIMER;
+-		ksev.sigev_notify = 4; /* SIGEV_THREAD_ID */
++		ksev.sigev_notify = SIGEV_THREAD_ID;
+ 		ksev.sigev_tid = td->tid;
+ 		if (syscall(SYS_timer_create, clk, &ksev, &timerid) < 0)
+ 			timerid = -1;
diff --git a/srcpkgs/musl/template b/srcpkgs/musl/template
index 5bdc5c48e623..34e6ed4fba6e 100644
--- a/srcpkgs/musl/template
+++ b/srcpkgs/musl/template
@@ -2,7 +2,7 @@
 pkgname=musl
 reverts="1.2.0_1"
 version=1.1.24
-revision=10
+revision=11
 archs="*-musl"
 bootstrap=yes
 build_style=gnu-configure

From 94ab3659d7f7b77734e1ff53ace1af330b2676da Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 21:01:43 -0700
Subject: [PATCH 08/37] gcc-multilib: update to 12.2.0.

---
 srcpkgs/gcc-multilib/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index fcd25755aa75..df60849babc2 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,16 +3,16 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _majorver="${version%.*}"
-wrksrc=gcc-${version/pre/_pre}
+wrksrc="gcc-${version}"
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel
@@ -71,7 +71,7 @@ do_build() {
 	make ${makejobs}
 }
 do_install() {
-	local _pc_triplet=x86_64-pc-linux-gnu _version=${version%pre1}
+	local _pc_triplet=x86_64-pc-linux-gnu
 	# Install to a tempdir and then only copy relevant files.
 	cd ${wrksrc}
 	make DESTDIR=${wrksrc}/${pkgname}-build install
@@ -81,9 +81,9 @@ do_install() {
 	vmkdir usr/include/c++/${_majorver}/${_triplet}
 	vmkdir usr/lib/gcc/${_triplet}/${_majorver}
 
-	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${_version}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${version}/32 \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_majorver}/
-	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${_version}/${_pc_triplet}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${version}/${_pc_triplet}/32 \
 		${DESTDIR}/usr/include/c++/${_majorver}/${_triplet}
 
 	vinstall ${wrksrc}/host-${_pc_triplet}/gcc/specs 644 usr/lib/gcc/${_triplet}/${_majorver}

From 2f49eeaa95eb447abfef86b87c986646cd7e9d69 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Tue, 4 Oct 2022 03:49:13 -0700
Subject: [PATCH 09/37] libgccjit: update to 12.2.0.

---
 srcpkgs/libgccjit/files/libgccjit-musl.patch | 63 --------------------
 srcpkgs/libgccjit/template                   | 38 ++++++------
 2 files changed, 17 insertions(+), 84 deletions(-)
 delete mode 100644 srcpkgs/libgccjit/files/libgccjit-musl.patch

diff --git a/srcpkgs/libgccjit/files/libgccjit-musl.patch b/srcpkgs/libgccjit/files/libgccjit-musl.patch
deleted file mode 100644
index d2ed16928c82..000000000000
--- a/srcpkgs/libgccjit/files/libgccjit-musl.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-diff --git a/gcc/jit/jit-playback.c b/gcc/jit/jit-playback.c
-index 5bccf591a..35f5e35ef 100644
---- a/gcc/jit/jit-playback.c
-+++ b/gcc/jit/jit-playback.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -41,8 +43,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "diagnostic.h"
- #include "stmt.h"
- 
--#include <pthread.h>
--
- #include "jit-playback.h"
- #include "jit-result.h"
- #include "jit-builtins.h"
-diff --git a/gcc/jit/jit-recording.c b/gcc/jit/jit-recording.c
-index a237d574f..5785e3269 100644
---- a/gcc/jit/jit-recording.c
-+++ b/gcc/jit/jit-recording.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -25,8 +27,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "pretty-print.h"
- #include "toplev.h"
- 
--#include <pthread.h>
--
- #include "jit-builtins.h"
- #include "jit-recording.h"
- #include "jit-playback.h"
-diff --git a/gcc/jit/libgccjit.c b/gcc/jit/libgccjit.c
-index f9c33c63c..75f21d275 100644
---- a/gcc/jit/libgccjit.c
-+++ b/gcc/jit/libgccjit.c
-@@ -18,13 +18,13 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
- #include "timevar.h"
- #include "typed-splay-tree.h"
- #include "cppbuiltin.h"
--#include <pthread.h>
- 
- #include "libgccjit.h"
- #include "jit-recording.h"
diff --git a/srcpkgs/libgccjit/template b/srcpkgs/libgccjit/template
index 6f1d6256dcd6..b5d4540ce667 100644
--- a/srcpkgs/libgccjit/template
+++ b/srcpkgs/libgccjit/template
@@ -3,36 +3,32 @@
 # which use the version number.
 
 pkgname=libgccjit
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
+version=12.2.0
 revision=1
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
-_majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
-wrksrc=gcc-${version/pre/_pre}
+_mpc_version=1.2.1
+_isl_version=0.24
 short_desc="Just-In-Time Compilation library for GCC"
 maintainer="Lane Biocini <lane@mailbox.org>"
 homepage="https://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 nopie=yes
+create_wrksrc=yes
+build_wrksrc="gcc-${version}"
+patch_args="-Np1 --directory=${build_wrksrc}"
 lib32disabled=yes
 makedepends="zlib-devel"
 hostmakedepends="tar texinfo perl flex"
@@ -40,10 +36,10 @@ depends="gcc"
 checkdepends="dejagnu"
 
 post_extract() {
-	mv ${XBPS_BUILDDIR}/gmp-${_gmp_version} ${wrksrc}/gmp
-	mv ${XBPS_BUILDDIR}/mpfr-${_mpfr_version} ${wrksrc}/mpfr
-	mv ${XBPS_BUILDDIR}/mpc-${_mpc_version} ${wrksrc}/mpc
-	mv ${XBPS_BUILDDIR}/isl-${_isl_version} ${wrksrc}/isl
+	ln -s ${wrksrc}/gmp-${_gmp_version} ${wrksrc}/${build_wrksrc}/gmp
+	ln -s ${wrksrc}/mpfr-${_mpfr_version} ${wrksrc}/${build_wrksrc}/mpfr
+	ln -s ${wrksrc}/mpc-${_mpc_version} ${wrksrc}/${build_wrksrc}/mpc
+	ln -s ${wrksrc}/isl-${_isl_version} ${wrksrc}/${build_wrksrc}/isl
 }
 
 pre_configure() {
@@ -186,7 +182,7 @@ do_configure() {
 	[ -z "$XBPS_CHECK_PKGS" ] && _langs="jit" || _langs="jit,c++"
 	_args+=" --enable-languages=${_langs}"
 	CONFIG_SHELL=/bin/bash \
-		${wrksrc}/configure ${_args}
+		${wrksrc}/${build_wrksrc}/configure ${_args}
 }
 
 do_build() {

From c0a791441d11985a6410fda6fb11b12b7c56783d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 14 Aug 2022 19:29:36 -0700
Subject: [PATCH 10/37] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove -no-pie from build. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..5d40f0cdd8a6 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -53,6 +53,7 @@ _void_cross_build_binutils() {
 		--sbindir=/usr/bin \
 		--libdir=/usr/lib \
 		--libexecdir=/usr/lib \
+		--sysconfdir=/etc \
 		--target=${tgt} \
 		--with-sysroot=/usr/${tgt} \
 		--disable-nls \
@@ -60,7 +61,9 @@ _void_cross_build_binutils() {
 		--disable-multilib \
 		--disable-werror \
 		--disable-gold \
+		--disable-gprofng \
 		--enable-relro \
+		--enable-new-dtags \
 		--enable-plugins \
 		--enable-64-bit-bfd \
 		--enable-deterministic-archives \
@@ -132,6 +135,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -460,6 +464,14 @@ do_build() {
 	local binutils_ver linux_ver gcc_ver libc_ver libucontext_ver
 	local tgt=${sourcepkg/cross-}
 
+	export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}"
+	export CXXFLAGS="${CXXFLAGS/-D_FORTIFY_SOURCE=2/}"
+
+	# Disable explicit -fno-PIE, gcc/binutils/libc will figure this out itself.
+	export CFLAGS="${CFLAGS//-fno-PIE/}"
+	export CXXFLAGS="${CXXFLAGS//-fno-PIE/}"
+	export LDFLAGS="${LDFLAGS//-no-pie/}"
+
 	_void_cross_test_ver binutils
 	_void_cross_test_ver linux
 	_void_cross_test_ver gcc
@@ -625,6 +637,9 @@ do_install() {
 	# then remove it because it conflicts with libquadmath package
 	rm -rf ${DESTDIR}/${sysroot}/usr/lib/libquadmath.*
 
+	# Remove libdep linker plugin because it conflicts with system binutils
+	rm -f ${DESTDIR}/usr/lib/bfd-plugins/libdep*
+
 	# Remove leftover symlinks
 	rm -f ${DESTDIR}/usr/lib${XBPS_TARGET_WORDSIZE}
 	rm -f ${DESTDIR}/lib*

From 606f15b47720eebb324c178bd73e5a5f849ade40 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:09:31 -0700
Subject: [PATCH 11/37] linux5.18: update dotconfigs for gcc12

---
 srcpkgs/linux5.18/files/x86_64-dotconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/linux5.18/files/x86_64-dotconfig b/srcpkgs/linux5.18/files/x86_64-dotconfig
index 4e73a3195d40..ea6204868e23 100644
--- a/srcpkgs/linux5.18/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.18/files/x86_64-dotconfig
@@ -512,6 +512,7 @@ CONFIG_RETHUNK=y
 CONFIG_CPU_UNRET_ENTRY=y
 CONFIG_CPU_IBPB_ENTRY=y
 CONFIG_CPU_IBRS_ENTRY=y
+CONFIG_SLS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10060,8 +10061,11 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
 # Memory initialization
 #
 CONFIG_INIT_STACK_NONE=y
+# CONFIG_INIT_STACK_ALL_PATTERN is not set
+# CONFIG_INIT_STACK_ALL_ZERO is not set
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
+# CONFIG_ZERO_CALL_USED_REGS is not set
 # end of Memory initialization
 # end of Kernel hardening options
 # end of Security options
@@ -10538,6 +10542,7 @@ CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
 # CONFIG_UBSAN is not set
 CONFIG_HAVE_ARCH_KCSAN=y
+# CONFIG_KCSAN is not set
 # end of Generic Kernel Debugging Instruments
 
 #

From 197911615f70b55cb575d1f96340e82984be0eb6 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:08 -0700
Subject: [PATCH 12/37] subversion: fix build for libtool 2.4.7

---
 srcpkgs/subversion/template | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/subversion/template b/srcpkgs/subversion/template
index 18c35e3a2132..0aa41212c5fd 100644
--- a/srcpkgs/subversion/template
+++ b/srcpkgs/subversion/template
@@ -24,6 +24,8 @@ distfiles="http://apache.uvigo.es/subversion/subversion-${version}.tar.bz2"
 checksum=c9130e8d0b75728a66f0e7038fc77052e671830d785b5616aad53b4810d3cc28
 
 pre_configure() {
+	./autogen.sh --release
+
 	# Based on native build values
 	cat <<-EOF >config.cache
 	ac_cv_python_includes=-I${XBPS_CROSS_BASE}/usr/include/python${py3_ver}
@@ -59,7 +61,12 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+
+	if [ "$XBPS_BUILD_ENVIRONMENT" = "void-packages-ci" ]; then
+		# This test will fail when run as the root user,
+		# because flock() will ignore file permissions.
+		vsed -i subversion/tests/libsvn_fs/locks-test.c -e '/SVN_TEST_OPTS_PASS(obtain_write_lock_failure,/,+3d'
+	fi
 }
 
 post_configure() {

From 7e991e08edee5bd04c65d1629e58cee6f5be9af0 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:38 -0700
Subject: [PATCH 13/37] subversion-kwallet-auth: update to 1.14.2.

Fix failing distfiles.
Fix build for libtool 2.4.7
---
 srcpkgs/subversion-kwallet-auth/template | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/subversion-kwallet-auth/template b/srcpkgs/subversion-kwallet-auth/template
index 12210f250d51..9cc68c3fe5f1 100644
--- a/srcpkgs/subversion-kwallet-auth/template
+++ b/srcpkgs/subversion-kwallet-auth/template
@@ -3,7 +3,7 @@
 # THIS PKG MUST BE SYNCHRONIZED WITH "srcpkgs/subversion".
 #
 pkgname=subversion-kwallet-auth
-version=1.14.1
+version=1.14.2
 revision=1
 wrksrc="subversion-${version}"
 build_style=gnu-configure
@@ -22,10 +22,12 @@ license="Apache-2.0, BSD-3-Clause"
 homepage="http://subversion.apache.org/"
 changelog="https://subversion.apache.org/docs/release-notes/${version%.*}.html"
 distfiles="http://apache.uvigo.es/subversion/subversion-${version}.tar.bz2"
-checksum=2c5da93c255d2e5569fa91d92457fdb65396b0666fad4fd59b22e154d986e1a9
+checksum=c9130e8d0b75728a66f0e7038fc77052e671830d785b5616aad53b4810d3cc28
 lib32disabled=yes
 
 pre_configure() {
+	./autogen.sh --release
+
 	# Based on native build values
 	cat <<-EOF >config.cache
 	ac_cv_python_includes=-I${XBPS_CROSS_BASE}/usr/include/python${py3_ver}
@@ -55,11 +57,18 @@ pre_configure() {
 		cp "$XBPS_CROSS_BASE/usr/lib/perl5/core_perl/Config"*.p? $PERL5LIB
 		cp "$XBPS_CROSS_BASE/usr/lib/perl5/core_perl/Errno.pm" $PERL5LIB
 		vsed -e "s;archlibexp => '\(.*\)';archlibexp => '${XBPS_CROSS_BASE}\1';" \
-			-i $PERL5LIB/Config.pm $PERL5LIB/Config_heavy.pl
+			-i $PERL5LIB/Config.pm
+		vsed -e "s;archlibexp='\(.*\)';archlibexp='${XBPS_CROSS_BASE}\1';" \
+			-i $PERL5LIB/Config_heavy.pl
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+
+	if [ "$XBPS_BUILD_ENVIRONMENT" = "void-packages-ci" ]; then
+		# This test will fail when run as the root user,
+		# because flock() will ignore file permissions.
+		vsed -i subversion/tests/libsvn_fs/locks-test.c -e '/SVN_TEST_OPTS_PASS(obtain_write_lock_failure,/,+3d'
+	fi
 }
 
 post_configure() {

From 90c8cfb2585062d5ea3f8156243b6b3b271375f8 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 14/37] cross-aarch64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..bd6b23f9fb6a 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 58b8c75cecd9e22a3b898577ff0d00a73fac4da6 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 15/37] cross-aarch64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..427ad2c1e9cd 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 8365e66b22c614ee6fda50ae98f1127b0d243015 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 16/37] cross-arm-linux-gnueabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..2510ee26e789 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 732b53aa159da701defdb624969f037865b94cd6 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 17/37] cross-arm-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..bd8b16e1b4c1 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 8b311f4c72abace6cd9ac735c535819d26d3a773 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 18/37] cross-arm-linux-musleabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..dacfd2655216 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 411671d3d8398452a818f1de8c7cb4cf735528f3 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 19/37] cross-arm-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..9ddd32a9f20d 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 714ba59dc16ed0f6cef47895f10b87348132298c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 20/37] cross-armv7l-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..9fb00f18be3b 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 5cfdaa52205ff3111cf28503abd59dc83a201e99 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 21/37] cross-armv7l-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..2c72e75ddfe3 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From e852033dc38648418954564ea3d47c0b1fc2ed13 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 22/37] cross-i686-pc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..4dc17df648b5 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 2de95586dfb6de272637c8e405ee690472a15d5e Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Fri, 16 Sep 2022 20:52:19 -0700
Subject: [PATCH 23/37] cross-i686-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-linux-musl/template b/srcpkgs/cross-i686-linux-musl/template
index 8be16a230d8d..78b4d813a113 100644
--- a/srcpkgs/cross-i686-linux-musl/template
+++ b/srcpkgs/cross-i686-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-i686-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-i686-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 7f0ce7f7a576e18804b732e07e8c034205850c16 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 24/37] cross-mips-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..6009e5c79eb2 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From fc731d592bf92d1aba24d7bae8ee3041f6337cea Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 25/37] cross-mips-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..080164df193d 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="hipperson0 <hipperson0@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 6faf36a69308793c63a050bac350ac2365148cb4 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 26/37] cross-mipsel-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..f9fd4b8a04ef 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 044572df3d88d501f274f1e085153c3cca0ce3cd Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 27/37] cross-mipsel-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..7418a984474b 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 470f36b484160126cbd3b97cbf3c7a72a6a2e3e7 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 28/37] cross-powerpc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..31e57b4e52b2 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From b3b833a1d2b268ab532e4cc8e3f80d20727458be Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 29/37] cross-powerpc-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..a2d1edcf1ffd 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From a6f524b1aa06ba3114ea12c835c4d7911063f0f3 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 30/37] cross-powerpc64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..1a4cbed61e76 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From f0dd7343c82d8680115610934e6525dee1070653 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 31/37] cross-powerpc64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 016f18776a6d..19b1ff859eb6 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 41f0bd03282dcb7da0c4bafb13448e452d8f4cbf Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 32/37] cross-powerpc64le-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 463d7e92d20d..9d99a3a315d2 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From ed11f69fd62cf7476dacd80632f154cbca30cfb2 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 33/37] cross-powerpc64le-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index c17a3cccfe29..3128baa7372e 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 36ac0ab86cbd0b1bbb5cf594aa1258b310e8e605 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 34/37] cross-powerpcle-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 9aede3c465ce..0462a1015a1a 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 
@@ -35,6 +35,8 @@ if [ "$XBPS_TARGET_MACHINE" = "ppcle" ]; then
 	broken="Can't build crosstoolchain to itself"
 fi
 
+broken="glibc uses big-endian specific instructions on 32-bit powerpc"
+
 cross-powerpcle-linux-gnu-libc_package() {
 	short_desc+=" - glibc files"
 	nostrip=yes

From da1ddb38e9f0d2cb802847b38cd97115f9349f63 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 35/37] cross-powerpcle-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index 045cfda987fe..20e70bed4c60 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From bbcc89fd0a00e8110416cf6f44ec94cc71a2da20 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 36/37] cross-x86_64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 8918f3c22a1c..5219cd50f851 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From befd9b64a0adf5ea3dfacdc8372c7e6e0e6c1ad2 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 37/37] cross-x86_64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..2811de0d3c2e 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (203 preceding siblings ...)
  2022-10-14 10:11 ` oreo639
@ 2022-10-15 10:41 ` oreo639
  2022-10-18  4:48 ` oreo639
                   ` (59 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-10-15 10:41 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5478 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.2.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.2.0

There is a list of failing builds here: https://github.com/void-linux/void-packages/issues/39809

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [x] llvm https://github.com/void-linux/void-packages/pull/38694
- [x] m4 https://github.com/void-linux/void-packages/pull/33730
- [x] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [x] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [x] libvirt https://github.com/void-linux/void-packages/pull/38842
- [x] syslinux https://github.com/void-linux/void-packages/pull/38876
- [x] efivar https://github.com/void-linux/void-packages/pull/38874
- [ ] gpgme https://github.com/void-linux/void-packages/pull/38825

Known packages that needed to be fixed/updated for gcc12:
- [ ] linux5.18 (in this PR)
- [x] openssh https://github.com/void-linux/void-packages/pull/38849
- [x] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [x] doxygen https://github.com/void-linux/void-packages/pull/38846
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] libproxy https://github.com/void-linux/void-packages/pull/38818
- [x] exempi https://github.com/void-linux/void-packages/pull/38820
- [x] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [x] libunique1 https://github.com/void-linux/void-packages/pull/38848 or https://github.com/void-linux/void-packages/pull/38873
- [x] libwpd https://github.com/void-linux/void-packages/pull/38878
- [x] cglm https://github.com/void-linux/void-packages/pull/39748
- [x] coreboot-utils https://github.com/void-linux/void-packages/pull/39749
- [x] apl https://github.com/void-linux/void-packages/pull/39750
- [x] igt-gpu-tools https://github.com/void-linux/void-packages/pull/39780

Needs to be fixed/updated for binutils:
- [x] grub https://github.com/void-linux/void-packages/pull/38875
- [x] linux-tools https://github.com/void-linux/void-packages/pull/38877
- [x] kcov https://github.com/void-linux/void-packages/pull/39291

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [x] kde
- [x] lxde
- [x] lxqt

You can test the ISOs here:
https://drive.google.com/drive/folders/1ix92CYSLUP-KWjLxltdgG4e8Nu2JCY5n?usp=sharing

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 135112 bytes --]

From a1bb1fe8bde69914a643adb59fc5b4259158d3e1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 01/38] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../fix-libcollector-without-java.patch       | 53 +++++++++++++++
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 25 ++++---
 4 files changed, 87 insertions(+), 117 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
 create mode 100644 srcpkgs/binutils/patches/fix-libcollector-without-java.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/fix-libcollector-without-java.patch b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
new file mode 100644
index 000000000000..54384875f358
--- /dev/null
+++ b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
@@ -0,0 +1,53 @@
+From 49ddd814ac1071af7c4f45d5f8398b91862f2c7f Mon Sep 17 00:00:00 2001
+From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
+Date: Wed, 17 Aug 2022 19:55:23 -0700
+Subject: [PATCH] gprofng: fix bug 29479 Collection fails when built without
+ java support
+
+gprofng/ChangeLog
+2022-08-17  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>
+
+	PR gprofng/29479
+	* libcollector/collector.c: Add #if defined(GPROFNG_JAVA_PROFILING) for
+	java specific code.
+	* libcollector/unwind.c: Likewise.
+---
+ gprofng/libcollector/collector.c | 2 ++
+ gprofng/libcollector/unwind.c    | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/gprofng/libcollector/collector.c b/gprofng/libcollector/collector.c
+index 93c9d3330de5..ceff2c1caccb 100644
+--- a/gprofng/libcollector/collector.c
++++ b/gprofng/libcollector/collector.c
+@@ -913,8 +913,10 @@ __collector_open_experiment (const char *exp, const char *params, sp_origin_t or
+   __collector_ext_unwind_key_init (1, NULL);
+ 
+   /* start java attach if suitable */
++#if defined(GPROFNG_JAVA_PROFILING)
+   if (exp_origin == SP_ORIGIN_DBX_ATTACH)
+     __collector_jprofile_start_attach ();
++#endif
+   start_sec_time = CALL_UTIL (time)(NULL);
+   __collector_start_time = collector_interface.getHiResTime ();
+   TprintfT (DBG_LT0, "\t__collector_open_experiment; resetting start_time\n");
+diff --git a/gprofng/libcollector/unwind.c b/gprofng/libcollector/unwind.c
+index 119243788020..f8e11823c81e 100644
+--- a/gprofng/libcollector/unwind.c
++++ b/gprofng/libcollector/unwind.c
+@@ -557,6 +557,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+   int size = max_frame_size;
+ 
+ #define MIN(a,b) ((a)<(b)?(a):(b))
++#if defined(GPROFNG_JAVA_PROFILING)
+   /* get Java info */
+   if (__collector_java_mode && __collector_java_asyncgetcalltrace_loaded && context && !pseudo_context)
+     {
+@@ -569,6 +570,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+ 	  size -= sz;
+ 	}
+     }
++#endif
+ 
+   /* get native stack */
+   if (context)
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..c355a5fc8016 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkgconf"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -35,15 +36,21 @@ do_configure() {
 	local conf
 
 	if [ "$CHROOT_READY" ]; then
-		conf+=" --with-debuginfod"
+		conf+=" --with-debuginfod --enable-shared"
 	else
-		conf+=" --without-debuginfod --disable-install-libbfd"
+		conf+=" --without-debuginfod --disable-shared --disable-install-libbfd"
 	fi
 	if [ "$CROSS_BUILD" ]; then
 		# we don't want --with-sysroot=${XBPS_CROSS_BASE} like gnu-configure
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	# gprofng currently only supports x86 and aarch64 glibc.
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64|i386|aarch64) conf+=" --enable-gprofng" ;;
+		*) conf+=" --disable-gprofng" ;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"
@@ -76,13 +83,14 @@ do_configure() {
 		--libdir=/usr/lib \
 		--mandir=/usr/share/man \
 		--infodir=/usr/share/info \
+		--sysconfdir=/etc \
 		--disable-werror \
-		--disable-shared \
 		--disable-nls \
 		--enable-threads \
 		--enable-plugins \
 		--enable-relro \
 		--enable-gold \
+		--enable-new-dtags \
 		--enable-deterministic-archives \
 		--enable-64-bit-bfd \
 		--enable-ld=default \
@@ -142,7 +150,8 @@ binutils-devel_package() {
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/*.a"
-		vmove "usr/lib/*.so"
+		vmove "usr/lib/libbfd.so"
+		vmove "usr/lib/libopcodes.so"
 	}
 }
 

From 4f363cdc84dede94ef2f6b23388b4663361c58e9 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 2 Oct 2022 16:46:59 -0700
Subject: [PATCH 02/38] gdb: resolve conflict with binutils 2.39

---
 srcpkgs/gdb/template | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/gdb/template b/srcpkgs/gdb/template
index ff7c9d9a5911..5970402eb27e 100644
--- a/srcpkgs/gdb/template
+++ b/srcpkgs/gdb/template
@@ -1,7 +1,7 @@
 # Template file for 'gdb'
 pkgname=gdb
 version=12.1
-revision=1
+revision=2
 build_style=gnu-configure
 pycompile_dirs="/usr/share/gdb/python"
 configure_args="--disable-werror --disable-nls --with-system-readline
@@ -48,7 +48,8 @@ vopt_conflict debuginfod static
 
 post_install() {
 	# resolve conflicts with binutils
-	rm -r ${DESTDIR}/usr/{include,lib,share/info/bfd.info*}
+	rm -rf ${DESTDIR}/usr/{include,lib}
+	rm -rf ${DESTDIR}/usr/share/info/{bfd,ctf-spec}.info*
 }
 
 gdb-common_package() {

From a73280a2b35c5b48501d867018d981abcc3f34af Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 03/38] gcc: update to 12.2.0.

---
 common/shlibs                                 |  10 +-
 srcpkgs/gcc/files/gccgo-musl.patch            |  71 ++-------
 srcpkgs/gcc/files/libgnarl-musl.patch         |  18 +--
 srcpkgs/gcc/files/libssp-musl.patch           |  10 +-
 srcpkgs/gcc/patches/libffi_gnulinux.patch     |  11 --
 .../gcc/patches/libgcc-ibm128-no-tag.patch    |  10 +-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |   2 +-
 srcpkgs/gcc/template                          | 136 +++++++++---------
 8 files changed, 105 insertions(+), 163 deletions(-)
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index 8194333576fb..1e34115dd21e 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.2.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.36 perl-5.36.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -848,8 +848,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.2.0_1
+libgnat-12.so libada-12.2.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1699,8 +1699,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.2.0_1
+libasan.so.8 libsanitizer-12.2.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..12ec68dd8aa3 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,14 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ b/libgo/go/runtime/os_linux.go
+@@ -365,7 +365,7 @@ func setThreadCPUProfiler(hz int32) {
+ 	var sevp _sigevent
+ 	sevp.sigev_notify = _SIGEV_THREAD_ID
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.__sev_fields))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..5ffd54e466ae 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,37 +3,35 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
+version=12.2.0
+revision=1
+_minorver="${version%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
-wrksrc=gcc-${version/pre/_pre}
+_mpc_version=1.2.1
+_isl_version=0.24
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
+create_wrksrc=yes
+build_wrksrc="gcc-${version}"
+patch_args="-Np1 --directory=${build_wrksrc}"
 lib32disabled=yes
 bootstrap=yes
 replaces="gcc-gcj<7.2.0 gcc-gcj-jdk-compat<7.2.0 libmpx>=0 libmpx-devel>=0"
@@ -52,8 +50,11 @@ if [ "$CHROOT_READY" ]; then
 	hostmakedepends="tar texinfo perl flex"
 else
 	_have_gccgo=no
+	# libzstd fails to link in bootstrap with glibc 2.36
+	# when zlib has been compiled with glibc 2.32.
+	LDFLAGS="-lzstd -pthread"
 fi
-makedepends="zlib-devel"
+makedepends="zlib-devel libzstd-devel"
 depends="binutils libgcc-devel-${version}_${revision}
  libstdc++-devel-${version}_${revision} libssp-devel-${version}_${revision}"
 checkdepends="dejagnu"
@@ -70,13 +71,13 @@ if [ "$build_option_gnatboot" ]; then
 	case "$XBPS_TARGET_MACHINE" in
 	x86_64)
 		_gnat_tarball="gnat-gpl-2017-x86_64-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/591c6d80c7a447af2deed1d7>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/9682e2e1f2f232ce03fe21d77b14c37a0de5649b?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" b942bcac20dea39748b39f8b624d9619f60a8dee2e8195dbe3829c835b0956e6"
 		build_options_default="gnatboot"
 		;;
 	i686)
 		_gnat_tarball="gnat-gpl-2014-x86-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/564b3e9dc8e196b040fbe248>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/c5e9e6fdff5cb77ed90cf8c62536653e27c0bed6?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" 3b693510f5d22a240abb3034934c1adbd80ccd6e4f61a4f491cc408fdfd9c042"
 		build_options_default="gnatboot"
 		;;
@@ -155,25 +156,24 @@ if [ "$CROSS_BUILD" ]; then
 fi
 
 post_extract() {
-	mkdir -p ${wrksrc}/{gmp,mpfr,mpc,isl}
-	cp -ar ${XBPS_BUILDDIR}/gmp-${_gmp_version}/* ${wrksrc}/gmp/
-	cp -ar ${XBPS_BUILDDIR}/mpfr-${_mpfr_version}/* ${wrksrc}/mpfr/
-	cp -ar ${XBPS_BUILDDIR}/mpc-${_mpc_version}/* ${wrksrc}/mpc/
-	cp -ar ${XBPS_BUILDDIR}/isl-${_isl_version}/* ${wrksrc}/isl/
+	ln -s ${wrksrc}/gmp-${_gmp_version} ${wrksrc}/${build_wrksrc}/gmp
+	ln -s ${wrksrc}/mpfr-${_mpfr_version} ${wrksrc}/${build_wrksrc}/mpfr
+	ln -s ${wrksrc}/mpc-${_mpc_version} ${wrksrc}/${build_wrksrc}/mpc
+	ln -s ${wrksrc}/isl-${_isl_version} ${wrksrc}/${build_wrksrc}/isl
 
 	if [ "$build_option_gnatboot" ]; then
 		local f="${XBPS_SRCDISTDIR}/${pkgname}-${version}/${_gnat_tarball}"
 		msg_normal "Extracting ${_gnat_tarball} ...\n"
-		mkdir -p ${wrksrc}/gnat-ins
-		tar -x -f "$f" --strip-components=1 -C ${wrksrc}/gnat-ins
-		cd ${wrksrc}/gnat-ins
-		make ins-all prefix=${wrksrc}/gnat
-		cd ${wrksrc}
-		rm -rf ${wrksrc}/gnat-ins
+		mkdir -p ${wrksrc}/${build_wrksrc}/gnat-ins
+		tar -x -f "$f" --strip-components=1 -C ${wrksrc}/${build_wrksrc}/gnat-ins
+		cd ${wrksrc}/${build_wrksrc}/gnat-ins
+		make ins-all prefix=${wrksrc}/${build_wrksrc}/gnat
+		cd ${wrksrc}/${build_wrksrc}
+		rm -rf ${wrksrc}/${build_wrksrc}/gnat-ins
 
 		# Rename obsolete ld and as
-		find ${wrksrc}/gnat -name ld -exec mv -v {} {}.old \;
-		find ${wrksrc}/gnat -name as -exec mv -v {} {}.old \;
+		find ${wrksrc}/${build_wrksrc}/gnat -name ld -exec mv -v {} {}.old \;
+		find ${wrksrc}/${build_wrksrc}/gnat -name as -exec mv -v {} {}.old \;
 	fi
 }
 
@@ -185,9 +185,9 @@ pre_configure() {
 	sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
 
 	if [ "$XBPS_TARGET_LIBC" = musl ]; then
-		patch -p1 -i ${FILESDIR}/libgnarl-musl.patch
-		patch -p1 -i ${FILESDIR}/libssp-musl.patch
-		patch -p1 -i ${FILESDIR}/gccgo-musl.patch
+		for p in ${FILESDIR}/*-musl.patch; do
+			patch -p1 -i $p
+		done
 	fi
 }
 do_configure() {
@@ -297,19 +297,19 @@ do_configure() {
 		_args+=" --enable-languages=${_langs},ada"
 		_args+=" --enable-libada"
 		CONFIG_SHELL=/bin/bash \
-		CC="${wrksrc}/gnat/bin/gcc" \
-		GNATBIND="${wrksrc}/gnat/bin/gnatbind" \
-		GNATMAKE="${wrksrc}/gnat/bin/gnatmake" \
-		PATH="${wrksrc}/gnat/bin:$PATH" \
-			${wrksrc}/configure ${_args}
+		CC="${wrksrc}/${build_wrksrc}/gnat/bin/gcc" \
+		GNATBIND="${wrksrc}/${build_wrksrc}/gnat/bin/gnatbind" \
+		GNATMAKE="${wrksrc}/${build_wrksrc}/gnat/bin/gnatmake" \
+		PATH="${wrksrc}/${build_wrksrc}/gnat/bin:$PATH" \
+			${wrksrc}/${build_wrksrc}/configure ${_args}
 	elif [ "$build_option_ada" ]; then
 		_args+=" --enable-languages=${_langs},ada"
 		CONFIG_SHELL=/bin/bash \
-			${wrksrc}/configure ${_args}
+			${wrksrc}/${build_wrksrc}/configure ${_args}
 	else
 		_args+=" --enable-languages=${_langs}"
 		CONFIG_SHELL=/bin/bash \
-			${wrksrc}/configure ${_args}
+			${wrksrc}/${build_wrksrc}/configure ${_args}
 	fi
 }
 do_build() {
@@ -318,10 +318,10 @@ do_build() {
 	fi
 	cd build
 	if [ "$build_option_gnatboot" ]; then
-		CC="${wrksrc}/gnat/bin/gcc" \
-		GNATBIND="${wrksrc}/gnat/bin/gnatbind" \
-		GNATMAKE="${wrksrc}/gnat/bin/gnatmake" \
-		PATH="${wrksrc}/gnat/bin:$PATH" \
+		CC="${wrksrc}/${build_wrksrc}/gnat/bin/gcc" \
+		GNATBIND="${wrksrc}/${build_wrksrc}/gnat/bin/gnatbind" \
+		GNATMAKE="${wrksrc}/${build_wrksrc}/gnat/bin/gnatmake" \
+		PATH="${wrksrc}/${build_wrksrc}/gnat/bin:$PATH" \
 		make ${makejobs}
 	else
 		make ${makejobs}
@@ -330,7 +330,7 @@ do_build() {
 pre_install() {
 	if [ "$CROSS_BUILD" ]; then
 		# XXX otherwise links to host libpthread
-		for f in $(find ${wrksrc}/build/${XBPS_CROSS_TRIPLET} -type f -name libtool); do
+		for f in $(find ${wrksrc}/${build_wrksrc}/build/${XBPS_CROSS_TRIPLET} -type f -name libtool); do
 			sed -e "s,add_dir=\"-L\$libdir\",add_dir=\"-L${XBPS_CROSS_BASE}\$libdir\",g" -i $f
 		done
 	fi
@@ -342,16 +342,16 @@ do_install() {
 
 	# Make version a symlink of major version to make all versions
 	# from the same series work automagically.
-	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver} \
+	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${version} \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver}
 	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver} \
-		${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}
+		${DESTDIR}/usr/lib/gcc/${_triplet}/${version}
 
 	# Ditto for c++ headers.
-	mv ${DESTDIR}/usr/include/c++/${_patchver} \
+	mv ${DESTDIR}/usr/include/c++/${version} \
 		${DESTDIR}/usr/include/c++/${_minorver}
 	ln -sfr ${DESTDIR}/usr/include/c++/${_minorver} \
-		${DESTDIR}/usr/include/c++/${_patchver}
+		${DESTDIR}/usr/include/c++/${version}
 
 	# cc symlink
 	ln -sfr ${DESTDIR}/usr/bin/gcc ${DESTDIR}/usr/bin/cc
@@ -360,7 +360,7 @@ do_install() {
 
 	# lto plugin symlink
 	vmkdir usr/lib/bfd-plugins
-	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}/liblto_plugin.so \
+	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${version}/liblto_plugin.so \
 		${DESTDIR}/usr/lib/bfd-plugins
 
 	# Remove "fixed" header
@@ -371,13 +371,9 @@ do_install() {
 	rm -f ${DESTDIR}/usr/lib/libffi*
 	rm -f ${DESTDIR}/usr/share/man/man3/ffi*
 
-	# Remove all python scripts in libdir.
-	rm -f ${DESTDIR}/usr/lib/*.py
-
-	# Remove more python stuff.
-	if [ -d ${DESTDIR}/usr/share/gcc-${_patchver}/python ]; then
-		rm -rf ${DESTDIR}/usr/share/gcc-${_patchver}/python
-	fi
+	# Move libstdc++ gdb helpers to location where gdb can autoload them
+	mkdir -p ${DESTDIR}/usr/share/gdb/auto-load/usr/lib
+	mv ${DESTDIR}/usr/lib/*.py ${DESTDIR}/usr/share/gdb/auto-load/usr/lib
 
 	# Install c89 and c99 wrappers and its manpages, from NetBSD.
 	for f in c89 c99; do
@@ -396,7 +392,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}
@@ -449,7 +445,7 @@ gcc-fortran_package() {
 		if [ "$CROSS_BUILD" ]; then
 			# A number of OMP modules are not built when cross
 			# compiling gcc. Copy them from the cross compiler.
-			local src="/usr/lib/gcc/${_triplet}/${_patchver}/finclude"
+			local src="/usr/lib/gcc/${_triplet}/${version}/finclude"
 			local dst="usr/lib/gcc/${_triplet}/${_minorver}/finclude"
 			for f in omp_lib.f90 omp_lib.h omp_lib.mod omp_lib_kinds.mod \
 				openacc.f90 openacc.mod openacc_kinds.mod openacc_lib.h; do
@@ -516,7 +512,7 @@ libgfortran_package() {
 	short_desc+=" - Fortran library"
 	pkg_install() {
 		vmove "usr/lib/libgfortran.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -537,7 +533,7 @@ libgo_package() {
 	nostrip=yes
 	pkg_install() {
 		vmove "usr/lib/libgo.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -553,7 +549,7 @@ libobjc_package() {
 	short_desc+=" - Objective-C library"
 	pkg_install() {
 		vmove "usr/lib/libobjc.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -572,7 +568,7 @@ libquadmath_package() {
 	short_desc+=" - quadmath library"
 	pkg_install() {
 		vmove "usr/lib/libquadmath.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -614,7 +610,7 @@ libgcc_package() {
 	noverifyrdeps=yes
 	pkg_install() {
 		vmove "usr/lib/libgcc_s.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -645,7 +641,7 @@ libgomp_package() {
 	short_desc+=" - OpenMP v4.0 library"
 	pkg_install() {
 		vmove "usr/lib/libgomp*.so.*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -700,7 +696,7 @@ libssp_package() {
 	short_desc+=" - SSP (StackSmashingProtection) library"
 	pkg_install() {
 		vmove "usr/lib/libssp.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -717,7 +713,9 @@ libstdc++-devel_package() {
 libstdc++_package() {
 	short_desc+=" - Standard C++ Library"
 	pkg_install() {
+		vmove usr/share/gdb
+		vmove usr/share/gcc-${version}/python
 		vmove "usr/lib/libstdc++.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }

From fb0f90c85c2f0a53c11870cc17e6939efa447095 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 04/38] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      | 11 ++++--
 2 files changed, 25 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..a4087ec2055e 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,12 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
+
+if [ "$XBPS_TARGET_LIBC" == "musl" ]; then
+	# Musl always searches LD_LIBRARY_PATH before RPATH and RUNPATH
+	make_build_args="lt_cv_shlibpath_overrides_runpath=yes"
+fi
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From 847237c64896c4aba7058751176ccf7624eaeb0f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 05/38] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 55255dceae8b..ca2d858a7abc 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From b7bf855c4f23678d4047e62301dd6dfbca927ed2 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 06/38] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 ...e-hash-style-both-for-building-glibc.patch |  51 ++++
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 4 files changed, 106 insertions(+), 353 deletions(-)
 create mode 100644 srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index 1e34115dd21e..8dec835de2b6 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch b/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
new file mode 100644
index 000000000000..9c5553e92609
--- /dev/null
+++ b/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
@@ -0,0 +1,51 @@
+Temporary workaround for EAC bug.
+
+See: https://sourceware.org/bugzilla/show_bug.cgi?id=29456
+
+From 8e90e2cc5e57d7ca3a40602d278e9642a8b66716 Mon Sep 17 00:00:00 2001
+From: oreo639 <oreo6391@gmail.com>
+Date: Tue, 13 Sep 2022 14:30:35 -0700
+Subject: [PATCH] Revert "Do not use --hash-style=both for building glibc
+ shared objects"
+
+This reverts commit e47de5cb2d4dbecb58f569ed241e8e95c568f03c.
+---
+ Makeconfig     |  9 +++++++++
+ Makerules      |  7 +++++++
+ 5 files changed, 61 insertions(+)
+
+diff --git a/Makeconfig b/Makeconfig
+index ba70321af1..e2131d4389 100644
+--- a/Makeconfig
++++ b/Makeconfig
+@@ -371,6 +371,13 @@ dt-relr-ldflag =
+ no-dt-relr-ldflag =
+ endif
+ 
++# For the time being we unconditionally use 'both'.  At some time we
++# should declare statically linked code as 'out of luck' and compile
++# with --hash-style=gnu only.
++hashstyle-LDFLAGS = -Wl,--hash-style=both
++LDFLAGS.so += $(hashstyle-LDFLAGS)
++LDFLAGS-rtld += $(hashstyle-LDFLAGS)
++
+ ifeq (no,$(build-pie-default))
+ pie-default = $(no-pie-ccflag)
+ else # build-pie-default
+diff --git a/Makerules b/Makerules
+index d1e139d03c..44134e37ce 100644
+--- a/Makerules
++++ b/Makerules
+@@ -558,6 +558,9 @@ $(common-objpfx)shlib.lds: $(common-objpfx)config.make $(..)Makerules
+ 		  -Wl,--verbose 2>/dev/null | \
+ 	  sed > $@T \
+ 	      -e '/^=========/,/^=========/!d;/^=========/d' \
++		   -e 's/^.*\.gnu\.hash[ 	]*:.*$$/  .note.ABI-tag : { *(.note.ABI-tag) } &/' \
++		   -e '/^[ 	]*\.hash[ 	]*:.*$$/{h;d;}' \
++		   -e '/DATA_SEGMENT_ALIGN/{H;g}' \
+ 	      -e 's/^.*\*(\.dynbss).*$$/& \
+ 		 PROVIDE(__start___libc_freeres_ptrs = .); \
+ 		 *(__libc_freeres_ptrs) \
+-- 
+2.37.3
+
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From 0953307f17d65cd724f099ee61464d00045874dd Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Wed, 14 Sep 2022 03:48:32 -0700
Subject: [PATCH 07/38] musl: add support for SIGEV_THREAD_ID timers

https://git.musl-libc.org/cgit/musl/commit/?id=7c71792e87691451f2a6b76348e83ad1889f1dcb
---
 ...d-support-for-SIGEV_THREAD_ID-timers.patch | 74 +++++++++++++++++++
 srcpkgs/musl/template                         |  2 +-
 2 files changed, 75 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch

diff --git a/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
new file mode 100644
index 000000000000..e20dff5ba0d4
--- /dev/null
+++ b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
@@ -0,0 +1,74 @@
+From 7c71792e87691451f2a6b76348e83ad1889f1dcb Mon Sep 17 00:00:00 2001
+From: James Y Knight <jyknight@google.com>
+Date: Sun, 30 Jun 2019 21:55:20 -0400
+Subject: [PATCH] add support for SIGEV_THREAD_ID timers
+
+This is like SIGEV_SIGNAL, but targeted to a particular thread's
+tid, rather than the process.
+---
+ include/signal.h        | 16 +++++++++++++---
+ src/time/timer_create.c |  8 ++++++--
+ 2 files changed, 19 insertions(+), 5 deletions(-)
+
+diff --git a/include/signal.h b/include/signal.h
+index fbdf667b2..9ed929e4f 100644
+--- a/include/signal.h
++++ b/include/signal.h
+@@ -180,14 +180,24 @@ struct sigevent {
+ 	union sigval sigev_value;
+ 	int sigev_signo;
+ 	int sigev_notify;
+-	void (*sigev_notify_function)(union sigval);
+-	pthread_attr_t *sigev_notify_attributes;
+-	char __pad[56-3*sizeof(long)];
++	union {
++		char __pad[64 - 2*sizeof(int) - sizeof(union sigval)];
++		pid_t sigev_notify_thread_id;
++		struct {
++			void (*sigev_notify_function)(union sigval);
++			pthread_attr_t *sigev_notify_attributes;
++		} __sev_thread;
++	} __sev_fields;
+ };
+ 
++#define sigev_notify_thread_id __sev_fields.sigev_notify_thread_id
++#define sigev_notify_function __sev_fields.__sev_thread.sigev_notify_function
++#define sigev_notify_attributes __sev_fields.__sev_thread.sigev_notify_attributes
++
+ #define SIGEV_SIGNAL 0
+ #define SIGEV_NONE 1
+ #define SIGEV_THREAD 2
++#define SIGEV_THREAD_ID 4
+ 
+ int __libc_current_sigrtmin(void);
+ int __libc_current_sigrtmax(void);
+diff --git a/src/time/timer_create.c b/src/time/timer_create.c
+index 5ddfda278..4bef23905 100644
+--- a/src/time/timer_create.c
++++ b/src/time/timer_create.c
+@@ -71,11 +71,15 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 	switch (evp ? evp->sigev_notify : SIGEV_SIGNAL) {
+ 	case SIGEV_NONE:
+ 	case SIGEV_SIGNAL:
++	case SIGEV_THREAD_ID:
+ 		if (evp) {
+ 			ksev.sigev_value = evp->sigev_value;
+ 			ksev.sigev_signo = evp->sigev_signo;
+ 			ksev.sigev_notify = evp->sigev_notify;
+-			ksev.sigev_tid = 0;
++			if (evp->sigev_notify == SIGEV_THREAD_ID)
++				ksev.sigev_tid = evp->sigev_notify_thread_id;
++			else
++				ksev.sigev_tid = 0;
+ 			ksevp = &ksev;
+ 		}
+ 		if (syscall(SYS_timer_create, clk, ksevp, &timerid) < 0)
+@@ -107,7 +111,7 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 
+ 		ksev.sigev_value.sival_ptr = 0;
+ 		ksev.sigev_signo = SIGTIMER;
+-		ksev.sigev_notify = 4; /* SIGEV_THREAD_ID */
++		ksev.sigev_notify = SIGEV_THREAD_ID;
+ 		ksev.sigev_tid = td->tid;
+ 		if (syscall(SYS_timer_create, clk, &ksev, &timerid) < 0)
+ 			timerid = -1;
diff --git a/srcpkgs/musl/template b/srcpkgs/musl/template
index 5bdc5c48e623..34e6ed4fba6e 100644
--- a/srcpkgs/musl/template
+++ b/srcpkgs/musl/template
@@ -2,7 +2,7 @@
 pkgname=musl
 reverts="1.2.0_1"
 version=1.1.24
-revision=10
+revision=11
 archs="*-musl"
 bootstrap=yes
 build_style=gnu-configure

From 2daccaded059dd7373cd94a8de503a3ca2d5a43a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 21:01:43 -0700
Subject: [PATCH 08/38] gcc-multilib: update to 12.2.0.

---
 srcpkgs/gcc-multilib/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index fcd25755aa75..df60849babc2 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,16 +3,16 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _majorver="${version%.*}"
-wrksrc=gcc-${version/pre/_pre}
+wrksrc="gcc-${version}"
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel
@@ -71,7 +71,7 @@ do_build() {
 	make ${makejobs}
 }
 do_install() {
-	local _pc_triplet=x86_64-pc-linux-gnu _version=${version%pre1}
+	local _pc_triplet=x86_64-pc-linux-gnu
 	# Install to a tempdir and then only copy relevant files.
 	cd ${wrksrc}
 	make DESTDIR=${wrksrc}/${pkgname}-build install
@@ -81,9 +81,9 @@ do_install() {
 	vmkdir usr/include/c++/${_majorver}/${_triplet}
 	vmkdir usr/lib/gcc/${_triplet}/${_majorver}
 
-	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${_version}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${version}/32 \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_majorver}/
-	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${_version}/${_pc_triplet}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${version}/${_pc_triplet}/32 \
 		${DESTDIR}/usr/include/c++/${_majorver}/${_triplet}
 
 	vinstall ${wrksrc}/host-${_pc_triplet}/gcc/specs 644 usr/lib/gcc/${_triplet}/${_majorver}

From e749fcc01d681c6d1da1b5f4817a24027c0ca4a0 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Tue, 4 Oct 2022 03:49:13 -0700
Subject: [PATCH 09/38] libgccjit: update to 12.2.0.

---
 srcpkgs/libgccjit/files/libgccjit-musl.patch | 63 --------------------
 srcpkgs/libgccjit/template                   | 38 ++++++------
 2 files changed, 17 insertions(+), 84 deletions(-)
 delete mode 100644 srcpkgs/libgccjit/files/libgccjit-musl.patch

diff --git a/srcpkgs/libgccjit/files/libgccjit-musl.patch b/srcpkgs/libgccjit/files/libgccjit-musl.patch
deleted file mode 100644
index d2ed16928c82..000000000000
--- a/srcpkgs/libgccjit/files/libgccjit-musl.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-diff --git a/gcc/jit/jit-playback.c b/gcc/jit/jit-playback.c
-index 5bccf591a..35f5e35ef 100644
---- a/gcc/jit/jit-playback.c
-+++ b/gcc/jit/jit-playback.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -41,8 +43,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "diagnostic.h"
- #include "stmt.h"
- 
--#include <pthread.h>
--
- #include "jit-playback.h"
- #include "jit-result.h"
- #include "jit-builtins.h"
-diff --git a/gcc/jit/jit-recording.c b/gcc/jit/jit-recording.c
-index a237d574f..5785e3269 100644
---- a/gcc/jit/jit-recording.c
-+++ b/gcc/jit/jit-recording.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -25,8 +27,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "pretty-print.h"
- #include "toplev.h"
- 
--#include <pthread.h>
--
- #include "jit-builtins.h"
- #include "jit-recording.h"
- #include "jit-playback.h"
-diff --git a/gcc/jit/libgccjit.c b/gcc/jit/libgccjit.c
-index f9c33c63c..75f21d275 100644
---- a/gcc/jit/libgccjit.c
-+++ b/gcc/jit/libgccjit.c
-@@ -18,13 +18,13 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
- #include "timevar.h"
- #include "typed-splay-tree.h"
- #include "cppbuiltin.h"
--#include <pthread.h>
- 
- #include "libgccjit.h"
- #include "jit-recording.h"
diff --git a/srcpkgs/libgccjit/template b/srcpkgs/libgccjit/template
index 6f1d6256dcd6..b5d4540ce667 100644
--- a/srcpkgs/libgccjit/template
+++ b/srcpkgs/libgccjit/template
@@ -3,36 +3,32 @@
 # which use the version number.
 
 pkgname=libgccjit
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
+version=12.2.0
 revision=1
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
-_majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
-wrksrc=gcc-${version/pre/_pre}
+_mpc_version=1.2.1
+_isl_version=0.24
 short_desc="Just-In-Time Compilation library for GCC"
 maintainer="Lane Biocini <lane@mailbox.org>"
 homepage="https://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 nopie=yes
+create_wrksrc=yes
+build_wrksrc="gcc-${version}"
+patch_args="-Np1 --directory=${build_wrksrc}"
 lib32disabled=yes
 makedepends="zlib-devel"
 hostmakedepends="tar texinfo perl flex"
@@ -40,10 +36,10 @@ depends="gcc"
 checkdepends="dejagnu"
 
 post_extract() {
-	mv ${XBPS_BUILDDIR}/gmp-${_gmp_version} ${wrksrc}/gmp
-	mv ${XBPS_BUILDDIR}/mpfr-${_mpfr_version} ${wrksrc}/mpfr
-	mv ${XBPS_BUILDDIR}/mpc-${_mpc_version} ${wrksrc}/mpc
-	mv ${XBPS_BUILDDIR}/isl-${_isl_version} ${wrksrc}/isl
+	ln -s ${wrksrc}/gmp-${_gmp_version} ${wrksrc}/${build_wrksrc}/gmp
+	ln -s ${wrksrc}/mpfr-${_mpfr_version} ${wrksrc}/${build_wrksrc}/mpfr
+	ln -s ${wrksrc}/mpc-${_mpc_version} ${wrksrc}/${build_wrksrc}/mpc
+	ln -s ${wrksrc}/isl-${_isl_version} ${wrksrc}/${build_wrksrc}/isl
 }
 
 pre_configure() {
@@ -186,7 +182,7 @@ do_configure() {
 	[ -z "$XBPS_CHECK_PKGS" ] && _langs="jit" || _langs="jit,c++"
 	_args+=" --enable-languages=${_langs}"
 	CONFIG_SHELL=/bin/bash \
-		${wrksrc}/configure ${_args}
+		${wrksrc}/${build_wrksrc}/configure ${_args}
 }
 
 do_build() {

From 18dd43c0dd31bdf635b2507ee6b371e546cc978a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 14 Aug 2022 19:29:36 -0700
Subject: [PATCH 10/38] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove -no-pie from build. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..5d40f0cdd8a6 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -53,6 +53,7 @@ _void_cross_build_binutils() {
 		--sbindir=/usr/bin \
 		--libdir=/usr/lib \
 		--libexecdir=/usr/lib \
+		--sysconfdir=/etc \
 		--target=${tgt} \
 		--with-sysroot=/usr/${tgt} \
 		--disable-nls \
@@ -60,7 +61,9 @@ _void_cross_build_binutils() {
 		--disable-multilib \
 		--disable-werror \
 		--disable-gold \
+		--disable-gprofng \
 		--enable-relro \
+		--enable-new-dtags \
 		--enable-plugins \
 		--enable-64-bit-bfd \
 		--enable-deterministic-archives \
@@ -132,6 +135,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -460,6 +464,14 @@ do_build() {
 	local binutils_ver linux_ver gcc_ver libc_ver libucontext_ver
 	local tgt=${sourcepkg/cross-}
 
+	export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}"
+	export CXXFLAGS="${CXXFLAGS/-D_FORTIFY_SOURCE=2/}"
+
+	# Disable explicit -fno-PIE, gcc/binutils/libc will figure this out itself.
+	export CFLAGS="${CFLAGS//-fno-PIE/}"
+	export CXXFLAGS="${CXXFLAGS//-fno-PIE/}"
+	export LDFLAGS="${LDFLAGS//-no-pie/}"
+
 	_void_cross_test_ver binutils
 	_void_cross_test_ver linux
 	_void_cross_test_ver gcc
@@ -625,6 +637,9 @@ do_install() {
 	# then remove it because it conflicts with libquadmath package
 	rm -rf ${DESTDIR}/${sysroot}/usr/lib/libquadmath.*
 
+	# Remove libdep linker plugin because it conflicts with system binutils
+	rm -f ${DESTDIR}/usr/lib/bfd-plugins/libdep*
+
 	# Remove leftover symlinks
 	rm -f ${DESTDIR}/usr/lib${XBPS_TARGET_WORDSIZE}
 	rm -f ${DESTDIR}/lib*

From c76cf356173ed92ccb64fbbf5d865077e022e3c8 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:09:31 -0700
Subject: [PATCH 11/38] linux5.18: update dotconfigs for gcc12

---
 srcpkgs/linux5.18/files/x86_64-dotconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/linux5.18/files/x86_64-dotconfig b/srcpkgs/linux5.18/files/x86_64-dotconfig
index 4e73a3195d40..ea6204868e23 100644
--- a/srcpkgs/linux5.18/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.18/files/x86_64-dotconfig
@@ -512,6 +512,7 @@ CONFIG_RETHUNK=y
 CONFIG_CPU_UNRET_ENTRY=y
 CONFIG_CPU_IBPB_ENTRY=y
 CONFIG_CPU_IBRS_ENTRY=y
+CONFIG_SLS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10060,8 +10061,11 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
 # Memory initialization
 #
 CONFIG_INIT_STACK_NONE=y
+# CONFIG_INIT_STACK_ALL_PATTERN is not set
+# CONFIG_INIT_STACK_ALL_ZERO is not set
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
+# CONFIG_ZERO_CALL_USED_REGS is not set
 # end of Memory initialization
 # end of Kernel hardening options
 # end of Security options
@@ -10538,6 +10542,7 @@ CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
 # CONFIG_UBSAN is not set
 CONFIG_HAVE_ARCH_KCSAN=y
+# CONFIG_KCSAN is not set
 # end of Generic Kernel Debugging Instruments
 
 #

From 9ec0c9c77ce734d9855d43cd9d0623c712c99e22 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:08 -0700
Subject: [PATCH 12/38] subversion: fix build for libtool 2.4.7

---
 srcpkgs/subversion/template | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/subversion/template b/srcpkgs/subversion/template
index 18c35e3a2132..0aa41212c5fd 100644
--- a/srcpkgs/subversion/template
+++ b/srcpkgs/subversion/template
@@ -24,6 +24,8 @@ distfiles="http://apache.uvigo.es/subversion/subversion-${version}.tar.bz2"
 checksum=c9130e8d0b75728a66f0e7038fc77052e671830d785b5616aad53b4810d3cc28
 
 pre_configure() {
+	./autogen.sh --release
+
 	# Based on native build values
 	cat <<-EOF >config.cache
 	ac_cv_python_includes=-I${XBPS_CROSS_BASE}/usr/include/python${py3_ver}
@@ -59,7 +61,12 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+
+	if [ "$XBPS_BUILD_ENVIRONMENT" = "void-packages-ci" ]; then
+		# This test will fail when run as the root user,
+		# because flock() will ignore file permissions.
+		vsed -i subversion/tests/libsvn_fs/locks-test.c -e '/SVN_TEST_OPTS_PASS(obtain_write_lock_failure,/,+3d'
+	fi
 }
 
 post_configure() {

From 53c0948dd377c485cad25247aba263bdec816a4c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:38 -0700
Subject: [PATCH 13/38] subversion-kwallet-auth: update to 1.14.2.

Fix failing distfiles.
Fix build for libtool 2.4.7
---
 srcpkgs/subversion-kwallet-auth/template | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/subversion-kwallet-auth/template b/srcpkgs/subversion-kwallet-auth/template
index 12210f250d51..9cc68c3fe5f1 100644
--- a/srcpkgs/subversion-kwallet-auth/template
+++ b/srcpkgs/subversion-kwallet-auth/template
@@ -3,7 +3,7 @@
 # THIS PKG MUST BE SYNCHRONIZED WITH "srcpkgs/subversion".
 #
 pkgname=subversion-kwallet-auth
-version=1.14.1
+version=1.14.2
 revision=1
 wrksrc="subversion-${version}"
 build_style=gnu-configure
@@ -22,10 +22,12 @@ license="Apache-2.0, BSD-3-Clause"
 homepage="http://subversion.apache.org/"
 changelog="https://subversion.apache.org/docs/release-notes/${version%.*}.html"
 distfiles="http://apache.uvigo.es/subversion/subversion-${version}.tar.bz2"
-checksum=2c5da93c255d2e5569fa91d92457fdb65396b0666fad4fd59b22e154d986e1a9
+checksum=c9130e8d0b75728a66f0e7038fc77052e671830d785b5616aad53b4810d3cc28
 lib32disabled=yes
 
 pre_configure() {
+	./autogen.sh --release
+
 	# Based on native build values
 	cat <<-EOF >config.cache
 	ac_cv_python_includes=-I${XBPS_CROSS_BASE}/usr/include/python${py3_ver}
@@ -55,11 +57,18 @@ pre_configure() {
 		cp "$XBPS_CROSS_BASE/usr/lib/perl5/core_perl/Config"*.p? $PERL5LIB
 		cp "$XBPS_CROSS_BASE/usr/lib/perl5/core_perl/Errno.pm" $PERL5LIB
 		vsed -e "s;archlibexp => '\(.*\)';archlibexp => '${XBPS_CROSS_BASE}\1';" \
-			-i $PERL5LIB/Config.pm $PERL5LIB/Config_heavy.pl
+			-i $PERL5LIB/Config.pm
+		vsed -e "s;archlibexp='\(.*\)';archlibexp='${XBPS_CROSS_BASE}\1';" \
+			-i $PERL5LIB/Config_heavy.pl
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+
+	if [ "$XBPS_BUILD_ENVIRONMENT" = "void-packages-ci" ]; then
+		# This test will fail when run as the root user,
+		# because flock() will ignore file permissions.
+		vsed -i subversion/tests/libsvn_fs/locks-test.c -e '/SVN_TEST_OPTS_PASS(obtain_write_lock_failure,/,+3d'
+	fi
 }
 
 post_configure() {

From 8ff656ba45b15543d95fa063108765930b7d1aa5 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 15 Oct 2022 03:39:40 -0700
Subject: [PATCH 14/38] qemu: remove broken patch

This the necessary patch has been imported into musl so no need
to cast the sigevent struct to a more glibc-like one.
---
 .../musl-fix-sigevent-and-sigval_t.patch      | 27 -------------------
 1 file changed, 27 deletions(-)
 delete mode 100644 srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch

diff --git a/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch b/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch
deleted file mode 100644
index 4b4f1117c15f..000000000000
--- a/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-Note: Remove this patch with musl 1.2.2
-
---- a/linux-user/syscall.c
-+++ b/linux-user/syscall.c
-@@ -5020,10 +5020,21 @@
- #ifndef HAVE_SIGEV_NOTIFY_THREAD_ID
- #define sigev_notify_thread_id _sigev_un._tid
- #endif
- 
--static inline abi_long target_to_host_sigevent(struct sigevent *host_sevp,
-+struct host_sigevent {
-+    union sigval sigev_value;
-+    int sigev_signo;
-+    int sigev_notify;
-+    union {
-+       char _pad[64 - sizeof(int) * 2 - sizeof(union sigval)];
-+       int _tid;
-+    } _sigev_un;
-+};
-+
-+static inline abi_long target_to_host_sigevent(struct sigevent *sevp,
-                                                abi_ulong target_addr)
- {
-+    struct host_sigevent *host_sevp = (struct host_sigevent *) sevp;
-     struct target_sigevent *target_sevp;
- 
-     if (!lock_user_struct(VERIFY_READ, target_sevp, target_addr, 1)) {

From c7b6eac04f3f83927c1accf277cedec607d5335b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 15/38] cross-aarch64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..bd6b23f9fb6a 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 22094bbaaab7a3b4321c7383726b5246353ddd2d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 16/38] cross-aarch64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..427ad2c1e9cd 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 29910946b7f5c93c6f9a54e41e8f414583c8f5df Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 17/38] cross-arm-linux-gnueabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..2510ee26e789 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From b4ad66075598e963861813d6d6407d1a6e31489a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 18/38] cross-arm-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..bd8b16e1b4c1 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From e924e2e0a0d7b3daf703b6f2b9c27a36b7f9ea46 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 19/38] cross-arm-linux-musleabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..dacfd2655216 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From ecc81d7e5569e2415436ad077c8466d6dcba1487 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 20/38] cross-arm-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..9ddd32a9f20d 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 1b686e1b9138a2805578ef52ec79f7f2bdcb4380 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 21/38] cross-armv7l-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..9fb00f18be3b 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 26a2ca66f8238bf9212437a3a66a071ca18444a6 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 22/38] cross-armv7l-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..2c72e75ddfe3 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From d89021dc4d93a3e3b0006e70a77ec213045ba1c6 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 23/38] cross-i686-pc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..4dc17df648b5 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From d9260deea2a66d69687bb26b857691c833090d74 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Fri, 16 Sep 2022 20:52:19 -0700
Subject: [PATCH 24/38] cross-i686-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-linux-musl/template b/srcpkgs/cross-i686-linux-musl/template
index 8be16a230d8d..78b4d813a113 100644
--- a/srcpkgs/cross-i686-linux-musl/template
+++ b/srcpkgs/cross-i686-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-i686-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-i686-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 5affca5a973a56014a587a8358d89d4b6c012610 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 25/38] cross-mips-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..6009e5c79eb2 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 508a88f9e76b74a441674301af548f2ec1b0f2d0 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 26/38] cross-mips-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..080164df193d 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="hipperson0 <hipperson0@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 9f07fae32d34ea628ccf12a1cae8025cb98b9a18 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 27/38] cross-mipsel-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..f9fd4b8a04ef 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 3dd933541a7d46cc0454dc8e529ff0d70501fa98 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 28/38] cross-mipsel-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..7418a984474b 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 46e307b412e7125b5fb668f323c26b6102799b0c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 29/38] cross-powerpc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..31e57b4e52b2 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 3d490034fdf66c86638a3102758efc28cd3de3f1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 30/38] cross-powerpc-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..a2d1edcf1ffd 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From f30be4e9b5f9a934d02042d387f66bf68ca7cd55 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 31/38] cross-powerpc64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..1a4cbed61e76 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 06bd1190786074990ad9ac014bc3424f770f6235 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 32/38] cross-powerpc64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 016f18776a6d..19b1ff859eb6 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 17e10cbfa73b2a24989598f8232d804a65ccbf14 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 33/38] cross-powerpc64le-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 463d7e92d20d..9d99a3a315d2 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 8ab38c2756048c5fd16da3ed4d12c10cb1558a7b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 34/38] cross-powerpc64le-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index c17a3cccfe29..3128baa7372e 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From e29d7bd982b5984711a793dc33c17ad8b7e36e43 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 35/38] cross-powerpcle-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 9aede3c465ce..0462a1015a1a 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 
@@ -35,6 +35,8 @@ if [ "$XBPS_TARGET_MACHINE" = "ppcle" ]; then
 	broken="Can't build crosstoolchain to itself"
 fi
 
+broken="glibc uses big-endian specific instructions on 32-bit powerpc"
+
 cross-powerpcle-linux-gnu-libc_package() {
 	short_desc+=" - glibc files"
 	nostrip=yes

From 8e44f06a374336317a17f56ad6acfe50c4a60c1b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 36/38] cross-powerpcle-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index 045cfda987fe..20e70bed4c60 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 9b58c3e394aa1b106700c26fdf06322e2a98a23f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 37/38] cross-x86_64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 8918f3c22a1c..5219cd50f851 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From aa7b0bf2ffe25e571df438916a5a7a9470e7a8bd Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 38/38] cross-x86_64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..2811de0d3c2e 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (204 preceding siblings ...)
  2022-10-15 10:41 ` oreo639
@ 2022-10-18  4:48 ` oreo639
  2022-10-18 18:03 ` oreo639
                   ` (58 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-10-18  4:48 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5478 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.2.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.2.0

There is a list of failing builds here: https://github.com/void-linux/void-packages/issues/39809

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [x] llvm https://github.com/void-linux/void-packages/pull/38694
- [x] m4 https://github.com/void-linux/void-packages/pull/33730
- [x] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [x] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [x] libvirt https://github.com/void-linux/void-packages/pull/38842
- [x] syslinux https://github.com/void-linux/void-packages/pull/38876
- [x] efivar https://github.com/void-linux/void-packages/pull/38874
- [ ] gpgme https://github.com/void-linux/void-packages/pull/38825

Known packages that needed to be fixed/updated for gcc12:
- [ ] linux5.18 (in this PR)
- [x] openssh https://github.com/void-linux/void-packages/pull/38849
- [x] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [x] doxygen https://github.com/void-linux/void-packages/pull/38846
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] libproxy https://github.com/void-linux/void-packages/pull/38818
- [x] exempi https://github.com/void-linux/void-packages/pull/38820
- [x] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [x] libunique1 https://github.com/void-linux/void-packages/pull/38848 or https://github.com/void-linux/void-packages/pull/38873
- [x] libwpd https://github.com/void-linux/void-packages/pull/38878
- [x] cglm https://github.com/void-linux/void-packages/pull/39748
- [x] coreboot-utils https://github.com/void-linux/void-packages/pull/39749
- [x] apl https://github.com/void-linux/void-packages/pull/39750
- [x] igt-gpu-tools https://github.com/void-linux/void-packages/pull/39780

Needs to be fixed/updated for binutils:
- [x] grub https://github.com/void-linux/void-packages/pull/38875
- [x] linux-tools https://github.com/void-linux/void-packages/pull/38877
- [x] kcov https://github.com/void-linux/void-packages/pull/39291

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [x] kde
- [x] lxde
- [x] lxqt

You can test the ISOs here:
https://drive.google.com/drive/folders/1ix92CYSLUP-KWjLxltdgG4e8Nu2JCY5n?usp=sharing

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 135107 bytes --]

From a1bb1fe8bde69914a643adb59fc5b4259158d3e1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 01/38] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../fix-libcollector-without-java.patch       | 53 +++++++++++++++
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 25 ++++---
 4 files changed, 87 insertions(+), 117 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
 create mode 100644 srcpkgs/binutils/patches/fix-libcollector-without-java.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/fix-libcollector-without-java.patch b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
new file mode 100644
index 000000000000..54384875f358
--- /dev/null
+++ b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
@@ -0,0 +1,53 @@
+From 49ddd814ac1071af7c4f45d5f8398b91862f2c7f Mon Sep 17 00:00:00 2001
+From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
+Date: Wed, 17 Aug 2022 19:55:23 -0700
+Subject: [PATCH] gprofng: fix bug 29479 Collection fails when built without
+ java support
+
+gprofng/ChangeLog
+2022-08-17  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>
+
+	PR gprofng/29479
+	* libcollector/collector.c: Add #if defined(GPROFNG_JAVA_PROFILING) for
+	java specific code.
+	* libcollector/unwind.c: Likewise.
+---
+ gprofng/libcollector/collector.c | 2 ++
+ gprofng/libcollector/unwind.c    | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/gprofng/libcollector/collector.c b/gprofng/libcollector/collector.c
+index 93c9d3330de5..ceff2c1caccb 100644
+--- a/gprofng/libcollector/collector.c
++++ b/gprofng/libcollector/collector.c
+@@ -913,8 +913,10 @@ __collector_open_experiment (const char *exp, const char *params, sp_origin_t or
+   __collector_ext_unwind_key_init (1, NULL);
+ 
+   /* start java attach if suitable */
++#if defined(GPROFNG_JAVA_PROFILING)
+   if (exp_origin == SP_ORIGIN_DBX_ATTACH)
+     __collector_jprofile_start_attach ();
++#endif
+   start_sec_time = CALL_UTIL (time)(NULL);
+   __collector_start_time = collector_interface.getHiResTime ();
+   TprintfT (DBG_LT0, "\t__collector_open_experiment; resetting start_time\n");
+diff --git a/gprofng/libcollector/unwind.c b/gprofng/libcollector/unwind.c
+index 119243788020..f8e11823c81e 100644
+--- a/gprofng/libcollector/unwind.c
++++ b/gprofng/libcollector/unwind.c
+@@ -557,6 +557,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+   int size = max_frame_size;
+ 
+ #define MIN(a,b) ((a)<(b)?(a):(b))
++#if defined(GPROFNG_JAVA_PROFILING)
+   /* get Java info */
+   if (__collector_java_mode && __collector_java_asyncgetcalltrace_loaded && context && !pseudo_context)
+     {
+@@ -569,6 +570,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+ 	  size -= sz;
+ 	}
+     }
++#endif
+ 
+   /* get native stack */
+   if (context)
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..c355a5fc8016 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkgconf"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -35,15 +36,21 @@ do_configure() {
 	local conf
 
 	if [ "$CHROOT_READY" ]; then
-		conf+=" --with-debuginfod"
+		conf+=" --with-debuginfod --enable-shared"
 	else
-		conf+=" --without-debuginfod --disable-install-libbfd"
+		conf+=" --without-debuginfod --disable-shared --disable-install-libbfd"
 	fi
 	if [ "$CROSS_BUILD" ]; then
 		# we don't want --with-sysroot=${XBPS_CROSS_BASE} like gnu-configure
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	# gprofng currently only supports x86 and aarch64 glibc.
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64|i386|aarch64) conf+=" --enable-gprofng" ;;
+		*) conf+=" --disable-gprofng" ;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"
@@ -76,13 +83,14 @@ do_configure() {
 		--libdir=/usr/lib \
 		--mandir=/usr/share/man \
 		--infodir=/usr/share/info \
+		--sysconfdir=/etc \
 		--disable-werror \
-		--disable-shared \
 		--disable-nls \
 		--enable-threads \
 		--enable-plugins \
 		--enable-relro \
 		--enable-gold \
+		--enable-new-dtags \
 		--enable-deterministic-archives \
 		--enable-64-bit-bfd \
 		--enable-ld=default \
@@ -142,7 +150,8 @@ binutils-devel_package() {
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/*.a"
-		vmove "usr/lib/*.so"
+		vmove "usr/lib/libbfd.so"
+		vmove "usr/lib/libopcodes.so"
 	}
 }
 

From 4f363cdc84dede94ef2f6b23388b4663361c58e9 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 2 Oct 2022 16:46:59 -0700
Subject: [PATCH 02/38] gdb: resolve conflict with binutils 2.39

---
 srcpkgs/gdb/template | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/gdb/template b/srcpkgs/gdb/template
index ff7c9d9a5911..5970402eb27e 100644
--- a/srcpkgs/gdb/template
+++ b/srcpkgs/gdb/template
@@ -1,7 +1,7 @@
 # Template file for 'gdb'
 pkgname=gdb
 version=12.1
-revision=1
+revision=2
 build_style=gnu-configure
 pycompile_dirs="/usr/share/gdb/python"
 configure_args="--disable-werror --disable-nls --with-system-readline
@@ -48,7 +48,8 @@ vopt_conflict debuginfod static
 
 post_install() {
 	# resolve conflicts with binutils
-	rm -r ${DESTDIR}/usr/{include,lib,share/info/bfd.info*}
+	rm -rf ${DESTDIR}/usr/{include,lib}
+	rm -rf ${DESTDIR}/usr/share/info/{bfd,ctf-spec}.info*
 }
 
 gdb-common_package() {

From a73280a2b35c5b48501d867018d981abcc3f34af Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 03/38] gcc: update to 12.2.0.

---
 common/shlibs                                 |  10 +-
 srcpkgs/gcc/files/gccgo-musl.patch            |  71 ++-------
 srcpkgs/gcc/files/libgnarl-musl.patch         |  18 +--
 srcpkgs/gcc/files/libssp-musl.patch           |  10 +-
 srcpkgs/gcc/patches/libffi_gnulinux.patch     |  11 --
 .../gcc/patches/libgcc-ibm128-no-tag.patch    |  10 +-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |   2 +-
 srcpkgs/gcc/template                          | 136 +++++++++---------
 8 files changed, 105 insertions(+), 163 deletions(-)
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index 8194333576fb..1e34115dd21e 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.2.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.36 perl-5.36.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -848,8 +848,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.2.0_1
+libgnat-12.so libada-12.2.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1699,8 +1699,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.2.0_1
+libasan.so.8 libsanitizer-12.2.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..12ec68dd8aa3 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,14 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ b/libgo/go/runtime/os_linux.go
+@@ -365,7 +365,7 @@ func setThreadCPUProfiler(hz int32) {
+ 	var sevp _sigevent
+ 	sevp.sigev_notify = _SIGEV_THREAD_ID
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.__sev_fields))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..5ffd54e466ae 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,37 +3,35 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
+version=12.2.0
+revision=1
+_minorver="${version%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
-wrksrc=gcc-${version/pre/_pre}
+_mpc_version=1.2.1
+_isl_version=0.24
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
+create_wrksrc=yes
+build_wrksrc="gcc-${version}"
+patch_args="-Np1 --directory=${build_wrksrc}"
 lib32disabled=yes
 bootstrap=yes
 replaces="gcc-gcj<7.2.0 gcc-gcj-jdk-compat<7.2.0 libmpx>=0 libmpx-devel>=0"
@@ -52,8 +50,11 @@ if [ "$CHROOT_READY" ]; then
 	hostmakedepends="tar texinfo perl flex"
 else
 	_have_gccgo=no
+	# libzstd fails to link in bootstrap with glibc 2.36
+	# when zlib has been compiled with glibc 2.32.
+	LDFLAGS="-lzstd -pthread"
 fi
-makedepends="zlib-devel"
+makedepends="zlib-devel libzstd-devel"
 depends="binutils libgcc-devel-${version}_${revision}
  libstdc++-devel-${version}_${revision} libssp-devel-${version}_${revision}"
 checkdepends="dejagnu"
@@ -70,13 +71,13 @@ if [ "$build_option_gnatboot" ]; then
 	case "$XBPS_TARGET_MACHINE" in
 	x86_64)
 		_gnat_tarball="gnat-gpl-2017-x86_64-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/591c6d80c7a447af2deed1d7>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/9682e2e1f2f232ce03fe21d77b14c37a0de5649b?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" b942bcac20dea39748b39f8b624d9619f60a8dee2e8195dbe3829c835b0956e6"
 		build_options_default="gnatboot"
 		;;
 	i686)
 		_gnat_tarball="gnat-gpl-2014-x86-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/564b3e9dc8e196b040fbe248>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/c5e9e6fdff5cb77ed90cf8c62536653e27c0bed6?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" 3b693510f5d22a240abb3034934c1adbd80ccd6e4f61a4f491cc408fdfd9c042"
 		build_options_default="gnatboot"
 		;;
@@ -155,25 +156,24 @@ if [ "$CROSS_BUILD" ]; then
 fi
 
 post_extract() {
-	mkdir -p ${wrksrc}/{gmp,mpfr,mpc,isl}
-	cp -ar ${XBPS_BUILDDIR}/gmp-${_gmp_version}/* ${wrksrc}/gmp/
-	cp -ar ${XBPS_BUILDDIR}/mpfr-${_mpfr_version}/* ${wrksrc}/mpfr/
-	cp -ar ${XBPS_BUILDDIR}/mpc-${_mpc_version}/* ${wrksrc}/mpc/
-	cp -ar ${XBPS_BUILDDIR}/isl-${_isl_version}/* ${wrksrc}/isl/
+	ln -s ${wrksrc}/gmp-${_gmp_version} ${wrksrc}/${build_wrksrc}/gmp
+	ln -s ${wrksrc}/mpfr-${_mpfr_version} ${wrksrc}/${build_wrksrc}/mpfr
+	ln -s ${wrksrc}/mpc-${_mpc_version} ${wrksrc}/${build_wrksrc}/mpc
+	ln -s ${wrksrc}/isl-${_isl_version} ${wrksrc}/${build_wrksrc}/isl
 
 	if [ "$build_option_gnatboot" ]; then
 		local f="${XBPS_SRCDISTDIR}/${pkgname}-${version}/${_gnat_tarball}"
 		msg_normal "Extracting ${_gnat_tarball} ...\n"
-		mkdir -p ${wrksrc}/gnat-ins
-		tar -x -f "$f" --strip-components=1 -C ${wrksrc}/gnat-ins
-		cd ${wrksrc}/gnat-ins
-		make ins-all prefix=${wrksrc}/gnat
-		cd ${wrksrc}
-		rm -rf ${wrksrc}/gnat-ins
+		mkdir -p ${wrksrc}/${build_wrksrc}/gnat-ins
+		tar -x -f "$f" --strip-components=1 -C ${wrksrc}/${build_wrksrc}/gnat-ins
+		cd ${wrksrc}/${build_wrksrc}/gnat-ins
+		make ins-all prefix=${wrksrc}/${build_wrksrc}/gnat
+		cd ${wrksrc}/${build_wrksrc}
+		rm -rf ${wrksrc}/${build_wrksrc}/gnat-ins
 
 		# Rename obsolete ld and as
-		find ${wrksrc}/gnat -name ld -exec mv -v {} {}.old \;
-		find ${wrksrc}/gnat -name as -exec mv -v {} {}.old \;
+		find ${wrksrc}/${build_wrksrc}/gnat -name ld -exec mv -v {} {}.old \;
+		find ${wrksrc}/${build_wrksrc}/gnat -name as -exec mv -v {} {}.old \;
 	fi
 }
 
@@ -185,9 +185,9 @@ pre_configure() {
 	sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
 
 	if [ "$XBPS_TARGET_LIBC" = musl ]; then
-		patch -p1 -i ${FILESDIR}/libgnarl-musl.patch
-		patch -p1 -i ${FILESDIR}/libssp-musl.patch
-		patch -p1 -i ${FILESDIR}/gccgo-musl.patch
+		for p in ${FILESDIR}/*-musl.patch; do
+			patch -p1 -i $p
+		done
 	fi
 }
 do_configure() {
@@ -297,19 +297,19 @@ do_configure() {
 		_args+=" --enable-languages=${_langs},ada"
 		_args+=" --enable-libada"
 		CONFIG_SHELL=/bin/bash \
-		CC="${wrksrc}/gnat/bin/gcc" \
-		GNATBIND="${wrksrc}/gnat/bin/gnatbind" \
-		GNATMAKE="${wrksrc}/gnat/bin/gnatmake" \
-		PATH="${wrksrc}/gnat/bin:$PATH" \
-			${wrksrc}/configure ${_args}
+		CC="${wrksrc}/${build_wrksrc}/gnat/bin/gcc" \
+		GNATBIND="${wrksrc}/${build_wrksrc}/gnat/bin/gnatbind" \
+		GNATMAKE="${wrksrc}/${build_wrksrc}/gnat/bin/gnatmake" \
+		PATH="${wrksrc}/${build_wrksrc}/gnat/bin:$PATH" \
+			${wrksrc}/${build_wrksrc}/configure ${_args}
 	elif [ "$build_option_ada" ]; then
 		_args+=" --enable-languages=${_langs},ada"
 		CONFIG_SHELL=/bin/bash \
-			${wrksrc}/configure ${_args}
+			${wrksrc}/${build_wrksrc}/configure ${_args}
 	else
 		_args+=" --enable-languages=${_langs}"
 		CONFIG_SHELL=/bin/bash \
-			${wrksrc}/configure ${_args}
+			${wrksrc}/${build_wrksrc}/configure ${_args}
 	fi
 }
 do_build() {
@@ -318,10 +318,10 @@ do_build() {
 	fi
 	cd build
 	if [ "$build_option_gnatboot" ]; then
-		CC="${wrksrc}/gnat/bin/gcc" \
-		GNATBIND="${wrksrc}/gnat/bin/gnatbind" \
-		GNATMAKE="${wrksrc}/gnat/bin/gnatmake" \
-		PATH="${wrksrc}/gnat/bin:$PATH" \
+		CC="${wrksrc}/${build_wrksrc}/gnat/bin/gcc" \
+		GNATBIND="${wrksrc}/${build_wrksrc}/gnat/bin/gnatbind" \
+		GNATMAKE="${wrksrc}/${build_wrksrc}/gnat/bin/gnatmake" \
+		PATH="${wrksrc}/${build_wrksrc}/gnat/bin:$PATH" \
 		make ${makejobs}
 	else
 		make ${makejobs}
@@ -330,7 +330,7 @@ do_build() {
 pre_install() {
 	if [ "$CROSS_BUILD" ]; then
 		# XXX otherwise links to host libpthread
-		for f in $(find ${wrksrc}/build/${XBPS_CROSS_TRIPLET} -type f -name libtool); do
+		for f in $(find ${wrksrc}/${build_wrksrc}/build/${XBPS_CROSS_TRIPLET} -type f -name libtool); do
 			sed -e "s,add_dir=\"-L\$libdir\",add_dir=\"-L${XBPS_CROSS_BASE}\$libdir\",g" -i $f
 		done
 	fi
@@ -342,16 +342,16 @@ do_install() {
 
 	# Make version a symlink of major version to make all versions
 	# from the same series work automagically.
-	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver} \
+	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${version} \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver}
 	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver} \
-		${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}
+		${DESTDIR}/usr/lib/gcc/${_triplet}/${version}
 
 	# Ditto for c++ headers.
-	mv ${DESTDIR}/usr/include/c++/${_patchver} \
+	mv ${DESTDIR}/usr/include/c++/${version} \
 		${DESTDIR}/usr/include/c++/${_minorver}
 	ln -sfr ${DESTDIR}/usr/include/c++/${_minorver} \
-		${DESTDIR}/usr/include/c++/${_patchver}
+		${DESTDIR}/usr/include/c++/${version}
 
 	# cc symlink
 	ln -sfr ${DESTDIR}/usr/bin/gcc ${DESTDIR}/usr/bin/cc
@@ -360,7 +360,7 @@ do_install() {
 
 	# lto plugin symlink
 	vmkdir usr/lib/bfd-plugins
-	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}/liblto_plugin.so \
+	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${version}/liblto_plugin.so \
 		${DESTDIR}/usr/lib/bfd-plugins
 
 	# Remove "fixed" header
@@ -371,13 +371,9 @@ do_install() {
 	rm -f ${DESTDIR}/usr/lib/libffi*
 	rm -f ${DESTDIR}/usr/share/man/man3/ffi*
 
-	# Remove all python scripts in libdir.
-	rm -f ${DESTDIR}/usr/lib/*.py
-
-	# Remove more python stuff.
-	if [ -d ${DESTDIR}/usr/share/gcc-${_patchver}/python ]; then
-		rm -rf ${DESTDIR}/usr/share/gcc-${_patchver}/python
-	fi
+	# Move libstdc++ gdb helpers to location where gdb can autoload them
+	mkdir -p ${DESTDIR}/usr/share/gdb/auto-load/usr/lib
+	mv ${DESTDIR}/usr/lib/*.py ${DESTDIR}/usr/share/gdb/auto-load/usr/lib
 
 	# Install c89 and c99 wrappers and its manpages, from NetBSD.
 	for f in c89 c99; do
@@ -396,7 +392,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}
@@ -449,7 +445,7 @@ gcc-fortran_package() {
 		if [ "$CROSS_BUILD" ]; then
 			# A number of OMP modules are not built when cross
 			# compiling gcc. Copy them from the cross compiler.
-			local src="/usr/lib/gcc/${_triplet}/${_patchver}/finclude"
+			local src="/usr/lib/gcc/${_triplet}/${version}/finclude"
 			local dst="usr/lib/gcc/${_triplet}/${_minorver}/finclude"
 			for f in omp_lib.f90 omp_lib.h omp_lib.mod omp_lib_kinds.mod \
 				openacc.f90 openacc.mod openacc_kinds.mod openacc_lib.h; do
@@ -516,7 +512,7 @@ libgfortran_package() {
 	short_desc+=" - Fortran library"
 	pkg_install() {
 		vmove "usr/lib/libgfortran.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -537,7 +533,7 @@ libgo_package() {
 	nostrip=yes
 	pkg_install() {
 		vmove "usr/lib/libgo.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -553,7 +549,7 @@ libobjc_package() {
 	short_desc+=" - Objective-C library"
 	pkg_install() {
 		vmove "usr/lib/libobjc.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -572,7 +568,7 @@ libquadmath_package() {
 	short_desc+=" - quadmath library"
 	pkg_install() {
 		vmove "usr/lib/libquadmath.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -614,7 +610,7 @@ libgcc_package() {
 	noverifyrdeps=yes
 	pkg_install() {
 		vmove "usr/lib/libgcc_s.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -645,7 +641,7 @@ libgomp_package() {
 	short_desc+=" - OpenMP v4.0 library"
 	pkg_install() {
 		vmove "usr/lib/libgomp*.so.*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -700,7 +696,7 @@ libssp_package() {
 	short_desc+=" - SSP (StackSmashingProtection) library"
 	pkg_install() {
 		vmove "usr/lib/libssp.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -717,7 +713,9 @@ libstdc++-devel_package() {
 libstdc++_package() {
 	short_desc+=" - Standard C++ Library"
 	pkg_install() {
+		vmove usr/share/gdb
+		vmove usr/share/gcc-${version}/python
 		vmove "usr/lib/libstdc++.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }

From fb0f90c85c2f0a53c11870cc17e6939efa447095 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 04/38] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      | 11 ++++--
 2 files changed, 25 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..a4087ec2055e 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,12 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
+
+if [ "$XBPS_TARGET_LIBC" == "musl" ]; then
+	# Musl always searches LD_LIBRARY_PATH before RPATH and RUNPATH
+	make_build_args="lt_cv_shlibpath_overrides_runpath=yes"
+fi
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From 847237c64896c4aba7058751176ccf7624eaeb0f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 05/38] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 55255dceae8b..ca2d858a7abc 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From b7bf855c4f23678d4047e62301dd6dfbca927ed2 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 06/38] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 ...e-hash-style-both-for-building-glibc.patch |  51 ++++
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 4 files changed, 106 insertions(+), 353 deletions(-)
 create mode 100644 srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index 1e34115dd21e..8dec835de2b6 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch b/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
new file mode 100644
index 000000000000..9c5553e92609
--- /dev/null
+++ b/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
@@ -0,0 +1,51 @@
+Temporary workaround for EAC bug.
+
+See: https://sourceware.org/bugzilla/show_bug.cgi?id=29456
+
+From 8e90e2cc5e57d7ca3a40602d278e9642a8b66716 Mon Sep 17 00:00:00 2001
+From: oreo639 <oreo6391@gmail.com>
+Date: Tue, 13 Sep 2022 14:30:35 -0700
+Subject: [PATCH] Revert "Do not use --hash-style=both for building glibc
+ shared objects"
+
+This reverts commit e47de5cb2d4dbecb58f569ed241e8e95c568f03c.
+---
+ Makeconfig     |  9 +++++++++
+ Makerules      |  7 +++++++
+ 5 files changed, 61 insertions(+)
+
+diff --git a/Makeconfig b/Makeconfig
+index ba70321af1..e2131d4389 100644
+--- a/Makeconfig
++++ b/Makeconfig
+@@ -371,6 +371,13 @@ dt-relr-ldflag =
+ no-dt-relr-ldflag =
+ endif
+ 
++# For the time being we unconditionally use 'both'.  At some time we
++# should declare statically linked code as 'out of luck' and compile
++# with --hash-style=gnu only.
++hashstyle-LDFLAGS = -Wl,--hash-style=both
++LDFLAGS.so += $(hashstyle-LDFLAGS)
++LDFLAGS-rtld += $(hashstyle-LDFLAGS)
++
+ ifeq (no,$(build-pie-default))
+ pie-default = $(no-pie-ccflag)
+ else # build-pie-default
+diff --git a/Makerules b/Makerules
+index d1e139d03c..44134e37ce 100644
+--- a/Makerules
++++ b/Makerules
+@@ -558,6 +558,9 @@ $(common-objpfx)shlib.lds: $(common-objpfx)config.make $(..)Makerules
+ 		  -Wl,--verbose 2>/dev/null | \
+ 	  sed > $@T \
+ 	      -e '/^=========/,/^=========/!d;/^=========/d' \
++		   -e 's/^.*\.gnu\.hash[ 	]*:.*$$/  .note.ABI-tag : { *(.note.ABI-tag) } &/' \
++		   -e '/^[ 	]*\.hash[ 	]*:.*$$/{h;d;}' \
++		   -e '/DATA_SEGMENT_ALIGN/{H;g}' \
+ 	      -e 's/^.*\*(\.dynbss).*$$/& \
+ 		 PROVIDE(__start___libc_freeres_ptrs = .); \
+ 		 *(__libc_freeres_ptrs) \
+-- 
+2.37.3
+
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From 0953307f17d65cd724f099ee61464d00045874dd Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Wed, 14 Sep 2022 03:48:32 -0700
Subject: [PATCH 07/38] musl: add support for SIGEV_THREAD_ID timers

https://git.musl-libc.org/cgit/musl/commit/?id=7c71792e87691451f2a6b76348e83ad1889f1dcb
---
 ...d-support-for-SIGEV_THREAD_ID-timers.patch | 74 +++++++++++++++++++
 srcpkgs/musl/template                         |  2 +-
 2 files changed, 75 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch

diff --git a/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
new file mode 100644
index 000000000000..e20dff5ba0d4
--- /dev/null
+++ b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
@@ -0,0 +1,74 @@
+From 7c71792e87691451f2a6b76348e83ad1889f1dcb Mon Sep 17 00:00:00 2001
+From: James Y Knight <jyknight@google.com>
+Date: Sun, 30 Jun 2019 21:55:20 -0400
+Subject: [PATCH] add support for SIGEV_THREAD_ID timers
+
+This is like SIGEV_SIGNAL, but targeted to a particular thread's
+tid, rather than the process.
+---
+ include/signal.h        | 16 +++++++++++++---
+ src/time/timer_create.c |  8 ++++++--
+ 2 files changed, 19 insertions(+), 5 deletions(-)
+
+diff --git a/include/signal.h b/include/signal.h
+index fbdf667b2..9ed929e4f 100644
+--- a/include/signal.h
++++ b/include/signal.h
+@@ -180,14 +180,24 @@ struct sigevent {
+ 	union sigval sigev_value;
+ 	int sigev_signo;
+ 	int sigev_notify;
+-	void (*sigev_notify_function)(union sigval);
+-	pthread_attr_t *sigev_notify_attributes;
+-	char __pad[56-3*sizeof(long)];
++	union {
++		char __pad[64 - 2*sizeof(int) - sizeof(union sigval)];
++		pid_t sigev_notify_thread_id;
++		struct {
++			void (*sigev_notify_function)(union sigval);
++			pthread_attr_t *sigev_notify_attributes;
++		} __sev_thread;
++	} __sev_fields;
+ };
+ 
++#define sigev_notify_thread_id __sev_fields.sigev_notify_thread_id
++#define sigev_notify_function __sev_fields.__sev_thread.sigev_notify_function
++#define sigev_notify_attributes __sev_fields.__sev_thread.sigev_notify_attributes
++
+ #define SIGEV_SIGNAL 0
+ #define SIGEV_NONE 1
+ #define SIGEV_THREAD 2
++#define SIGEV_THREAD_ID 4
+ 
+ int __libc_current_sigrtmin(void);
+ int __libc_current_sigrtmax(void);
+diff --git a/src/time/timer_create.c b/src/time/timer_create.c
+index 5ddfda278..4bef23905 100644
+--- a/src/time/timer_create.c
++++ b/src/time/timer_create.c
+@@ -71,11 +71,15 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 	switch (evp ? evp->sigev_notify : SIGEV_SIGNAL) {
+ 	case SIGEV_NONE:
+ 	case SIGEV_SIGNAL:
++	case SIGEV_THREAD_ID:
+ 		if (evp) {
+ 			ksev.sigev_value = evp->sigev_value;
+ 			ksev.sigev_signo = evp->sigev_signo;
+ 			ksev.sigev_notify = evp->sigev_notify;
+-			ksev.sigev_tid = 0;
++			if (evp->sigev_notify == SIGEV_THREAD_ID)
++				ksev.sigev_tid = evp->sigev_notify_thread_id;
++			else
++				ksev.sigev_tid = 0;
+ 			ksevp = &ksev;
+ 		}
+ 		if (syscall(SYS_timer_create, clk, ksevp, &timerid) < 0)
+@@ -107,7 +111,7 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 
+ 		ksev.sigev_value.sival_ptr = 0;
+ 		ksev.sigev_signo = SIGTIMER;
+-		ksev.sigev_notify = 4; /* SIGEV_THREAD_ID */
++		ksev.sigev_notify = SIGEV_THREAD_ID;
+ 		ksev.sigev_tid = td->tid;
+ 		if (syscall(SYS_timer_create, clk, &ksev, &timerid) < 0)
+ 			timerid = -1;
diff --git a/srcpkgs/musl/template b/srcpkgs/musl/template
index 5bdc5c48e623..34e6ed4fba6e 100644
--- a/srcpkgs/musl/template
+++ b/srcpkgs/musl/template
@@ -2,7 +2,7 @@
 pkgname=musl
 reverts="1.2.0_1"
 version=1.1.24
-revision=10
+revision=11
 archs="*-musl"
 bootstrap=yes
 build_style=gnu-configure

From 2daccaded059dd7373cd94a8de503a3ca2d5a43a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 21:01:43 -0700
Subject: [PATCH 08/38] gcc-multilib: update to 12.2.0.

---
 srcpkgs/gcc-multilib/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index fcd25755aa75..df60849babc2 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,16 +3,16 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _majorver="${version%.*}"
-wrksrc=gcc-${version/pre/_pre}
+wrksrc="gcc-${version}"
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel
@@ -71,7 +71,7 @@ do_build() {
 	make ${makejobs}
 }
 do_install() {
-	local _pc_triplet=x86_64-pc-linux-gnu _version=${version%pre1}
+	local _pc_triplet=x86_64-pc-linux-gnu
 	# Install to a tempdir and then only copy relevant files.
 	cd ${wrksrc}
 	make DESTDIR=${wrksrc}/${pkgname}-build install
@@ -81,9 +81,9 @@ do_install() {
 	vmkdir usr/include/c++/${_majorver}/${_triplet}
 	vmkdir usr/lib/gcc/${_triplet}/${_majorver}
 
-	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${_version}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${version}/32 \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_majorver}/
-	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${_version}/${_pc_triplet}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${version}/${_pc_triplet}/32 \
 		${DESTDIR}/usr/include/c++/${_majorver}/${_triplet}
 
 	vinstall ${wrksrc}/host-${_pc_triplet}/gcc/specs 644 usr/lib/gcc/${_triplet}/${_majorver}

From e749fcc01d681c6d1da1b5f4817a24027c0ca4a0 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Tue, 4 Oct 2022 03:49:13 -0700
Subject: [PATCH 09/38] libgccjit: update to 12.2.0.

---
 srcpkgs/libgccjit/files/libgccjit-musl.patch | 63 --------------------
 srcpkgs/libgccjit/template                   | 38 ++++++------
 2 files changed, 17 insertions(+), 84 deletions(-)
 delete mode 100644 srcpkgs/libgccjit/files/libgccjit-musl.patch

diff --git a/srcpkgs/libgccjit/files/libgccjit-musl.patch b/srcpkgs/libgccjit/files/libgccjit-musl.patch
deleted file mode 100644
index d2ed16928c82..000000000000
--- a/srcpkgs/libgccjit/files/libgccjit-musl.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-diff --git a/gcc/jit/jit-playback.c b/gcc/jit/jit-playback.c
-index 5bccf591a..35f5e35ef 100644
---- a/gcc/jit/jit-playback.c
-+++ b/gcc/jit/jit-playback.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -41,8 +43,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "diagnostic.h"
- #include "stmt.h"
- 
--#include <pthread.h>
--
- #include "jit-playback.h"
- #include "jit-result.h"
- #include "jit-builtins.h"
-diff --git a/gcc/jit/jit-recording.c b/gcc/jit/jit-recording.c
-index a237d574f..5785e3269 100644
---- a/gcc/jit/jit-recording.c
-+++ b/gcc/jit/jit-recording.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -25,8 +27,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "pretty-print.h"
- #include "toplev.h"
- 
--#include <pthread.h>
--
- #include "jit-builtins.h"
- #include "jit-recording.h"
- #include "jit-playback.h"
-diff --git a/gcc/jit/libgccjit.c b/gcc/jit/libgccjit.c
-index f9c33c63c..75f21d275 100644
---- a/gcc/jit/libgccjit.c
-+++ b/gcc/jit/libgccjit.c
-@@ -18,13 +18,13 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
- #include "timevar.h"
- #include "typed-splay-tree.h"
- #include "cppbuiltin.h"
--#include <pthread.h>
- 
- #include "libgccjit.h"
- #include "jit-recording.h"
diff --git a/srcpkgs/libgccjit/template b/srcpkgs/libgccjit/template
index 6f1d6256dcd6..b5d4540ce667 100644
--- a/srcpkgs/libgccjit/template
+++ b/srcpkgs/libgccjit/template
@@ -3,36 +3,32 @@
 # which use the version number.
 
 pkgname=libgccjit
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
+version=12.2.0
 revision=1
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
-_majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
-wrksrc=gcc-${version/pre/_pre}
+_mpc_version=1.2.1
+_isl_version=0.24
 short_desc="Just-In-Time Compilation library for GCC"
 maintainer="Lane Biocini <lane@mailbox.org>"
 homepage="https://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 nopie=yes
+create_wrksrc=yes
+build_wrksrc="gcc-${version}"
+patch_args="-Np1 --directory=${build_wrksrc}"
 lib32disabled=yes
 makedepends="zlib-devel"
 hostmakedepends="tar texinfo perl flex"
@@ -40,10 +36,10 @@ depends="gcc"
 checkdepends="dejagnu"
 
 post_extract() {
-	mv ${XBPS_BUILDDIR}/gmp-${_gmp_version} ${wrksrc}/gmp
-	mv ${XBPS_BUILDDIR}/mpfr-${_mpfr_version} ${wrksrc}/mpfr
-	mv ${XBPS_BUILDDIR}/mpc-${_mpc_version} ${wrksrc}/mpc
-	mv ${XBPS_BUILDDIR}/isl-${_isl_version} ${wrksrc}/isl
+	ln -s ${wrksrc}/gmp-${_gmp_version} ${wrksrc}/${build_wrksrc}/gmp
+	ln -s ${wrksrc}/mpfr-${_mpfr_version} ${wrksrc}/${build_wrksrc}/mpfr
+	ln -s ${wrksrc}/mpc-${_mpc_version} ${wrksrc}/${build_wrksrc}/mpc
+	ln -s ${wrksrc}/isl-${_isl_version} ${wrksrc}/${build_wrksrc}/isl
 }
 
 pre_configure() {
@@ -186,7 +182,7 @@ do_configure() {
 	[ -z "$XBPS_CHECK_PKGS" ] && _langs="jit" || _langs="jit,c++"
 	_args+=" --enable-languages=${_langs}"
 	CONFIG_SHELL=/bin/bash \
-		${wrksrc}/configure ${_args}
+		${wrksrc}/${build_wrksrc}/configure ${_args}
 }
 
 do_build() {

From 18dd43c0dd31bdf635b2507ee6b371e546cc978a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 14 Aug 2022 19:29:36 -0700
Subject: [PATCH 10/38] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove -no-pie from build. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..5d40f0cdd8a6 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -53,6 +53,7 @@ _void_cross_build_binutils() {
 		--sbindir=/usr/bin \
 		--libdir=/usr/lib \
 		--libexecdir=/usr/lib \
+		--sysconfdir=/etc \
 		--target=${tgt} \
 		--with-sysroot=/usr/${tgt} \
 		--disable-nls \
@@ -60,7 +61,9 @@ _void_cross_build_binutils() {
 		--disable-multilib \
 		--disable-werror \
 		--disable-gold \
+		--disable-gprofng \
 		--enable-relro \
+		--enable-new-dtags \
 		--enable-plugins \
 		--enable-64-bit-bfd \
 		--enable-deterministic-archives \
@@ -132,6 +135,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -460,6 +464,14 @@ do_build() {
 	local binutils_ver linux_ver gcc_ver libc_ver libucontext_ver
 	local tgt=${sourcepkg/cross-}
 
+	export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}"
+	export CXXFLAGS="${CXXFLAGS/-D_FORTIFY_SOURCE=2/}"
+
+	# Disable explicit -fno-PIE, gcc/binutils/libc will figure this out itself.
+	export CFLAGS="${CFLAGS//-fno-PIE/}"
+	export CXXFLAGS="${CXXFLAGS//-fno-PIE/}"
+	export LDFLAGS="${LDFLAGS//-no-pie/}"
+
 	_void_cross_test_ver binutils
 	_void_cross_test_ver linux
 	_void_cross_test_ver gcc
@@ -625,6 +637,9 @@ do_install() {
 	# then remove it because it conflicts with libquadmath package
 	rm -rf ${DESTDIR}/${sysroot}/usr/lib/libquadmath.*
 
+	# Remove libdep linker plugin because it conflicts with system binutils
+	rm -f ${DESTDIR}/usr/lib/bfd-plugins/libdep*
+
 	# Remove leftover symlinks
 	rm -f ${DESTDIR}/usr/lib${XBPS_TARGET_WORDSIZE}
 	rm -f ${DESTDIR}/lib*

From c76cf356173ed92ccb64fbbf5d865077e022e3c8 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 20:09:31 -0700
Subject: [PATCH 11/38] linux5.18: update dotconfigs for gcc12

---
 srcpkgs/linux5.18/files/x86_64-dotconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/linux5.18/files/x86_64-dotconfig b/srcpkgs/linux5.18/files/x86_64-dotconfig
index 4e73a3195d40..ea6204868e23 100644
--- a/srcpkgs/linux5.18/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.18/files/x86_64-dotconfig
@@ -512,6 +512,7 @@ CONFIG_RETHUNK=y
 CONFIG_CPU_UNRET_ENTRY=y
 CONFIG_CPU_IBPB_ENTRY=y
 CONFIG_CPU_IBRS_ENTRY=y
+CONFIG_SLS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10060,8 +10061,11 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
 # Memory initialization
 #
 CONFIG_INIT_STACK_NONE=y
+# CONFIG_INIT_STACK_ALL_PATTERN is not set
+# CONFIG_INIT_STACK_ALL_ZERO is not set
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
+# CONFIG_ZERO_CALL_USED_REGS is not set
 # end of Memory initialization
 # end of Kernel hardening options
 # end of Security options
@@ -10538,6 +10542,7 @@ CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
 # CONFIG_UBSAN is not set
 CONFIG_HAVE_ARCH_KCSAN=y
+# CONFIG_KCSAN is not set
 # end of Generic Kernel Debugging Instruments
 
 #

From 9ec0c9c77ce734d9855d43cd9d0623c712c99e22 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:08 -0700
Subject: [PATCH 12/38] subversion: fix build for libtool 2.4.7

---
 srcpkgs/subversion/template | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/subversion/template b/srcpkgs/subversion/template
index 18c35e3a2132..0aa41212c5fd 100644
--- a/srcpkgs/subversion/template
+++ b/srcpkgs/subversion/template
@@ -24,6 +24,8 @@ distfiles="http://apache.uvigo.es/subversion/subversion-${version}.tar.bz2"
 checksum=c9130e8d0b75728a66f0e7038fc77052e671830d785b5616aad53b4810d3cc28
 
 pre_configure() {
+	./autogen.sh --release
+
 	# Based on native build values
 	cat <<-EOF >config.cache
 	ac_cv_python_includes=-I${XBPS_CROSS_BASE}/usr/include/python${py3_ver}
@@ -59,7 +61,12 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+
+	if [ "$XBPS_BUILD_ENVIRONMENT" = "void-packages-ci" ]; then
+		# This test will fail when run as the root user,
+		# because flock() will ignore file permissions.
+		vsed -i subversion/tests/libsvn_fs/locks-test.c -e '/SVN_TEST_OPTS_PASS(obtain_write_lock_failure,/,+3d'
+	fi
 }
 
 post_configure() {

From 53c0948dd377c485cad25247aba263bdec816a4c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:38 -0700
Subject: [PATCH 13/38] subversion-kwallet-auth: update to 1.14.2.

Fix failing distfiles.
Fix build for libtool 2.4.7
---
 srcpkgs/subversion-kwallet-auth/template | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/subversion-kwallet-auth/template b/srcpkgs/subversion-kwallet-auth/template
index 12210f250d51..9cc68c3fe5f1 100644
--- a/srcpkgs/subversion-kwallet-auth/template
+++ b/srcpkgs/subversion-kwallet-auth/template
@@ -3,7 +3,7 @@
 # THIS PKG MUST BE SYNCHRONIZED WITH "srcpkgs/subversion".
 #
 pkgname=subversion-kwallet-auth
-version=1.14.1
+version=1.14.2
 revision=1
 wrksrc="subversion-${version}"
 build_style=gnu-configure
@@ -22,10 +22,12 @@ license="Apache-2.0, BSD-3-Clause"
 homepage="http://subversion.apache.org/"
 changelog="https://subversion.apache.org/docs/release-notes/${version%.*}.html"
 distfiles="http://apache.uvigo.es/subversion/subversion-${version}.tar.bz2"
-checksum=2c5da93c255d2e5569fa91d92457fdb65396b0666fad4fd59b22e154d986e1a9
+checksum=c9130e8d0b75728a66f0e7038fc77052e671830d785b5616aad53b4810d3cc28
 lib32disabled=yes
 
 pre_configure() {
+	./autogen.sh --release
+
 	# Based on native build values
 	cat <<-EOF >config.cache
 	ac_cv_python_includes=-I${XBPS_CROSS_BASE}/usr/include/python${py3_ver}
@@ -55,11 +57,18 @@ pre_configure() {
 		cp "$XBPS_CROSS_BASE/usr/lib/perl5/core_perl/Config"*.p? $PERL5LIB
 		cp "$XBPS_CROSS_BASE/usr/lib/perl5/core_perl/Errno.pm" $PERL5LIB
 		vsed -e "s;archlibexp => '\(.*\)';archlibexp => '${XBPS_CROSS_BASE}\1';" \
-			-i $PERL5LIB/Config.pm $PERL5LIB/Config_heavy.pl
+			-i $PERL5LIB/Config.pm
+		vsed -e "s;archlibexp='\(.*\)';archlibexp='${XBPS_CROSS_BASE}\1';" \
+			-i $PERL5LIB/Config_heavy.pl
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+
+	if [ "$XBPS_BUILD_ENVIRONMENT" = "void-packages-ci" ]; then
+		# This test will fail when run as the root user,
+		# because flock() will ignore file permissions.
+		vsed -i subversion/tests/libsvn_fs/locks-test.c -e '/SVN_TEST_OPTS_PASS(obtain_write_lock_failure,/,+3d'
+	fi
 }
 
 post_configure() {

From f5fdf43c749f8aef02cb3e3320dcea48184c613d Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 15 Oct 2022 03:39:40 -0700
Subject: [PATCH 14/38] qemu: remove broken patch

The necessary patch has been imported into musl so no need
to cast the sigevent struct to a more glibc-like one.
---
 .../musl-fix-sigevent-and-sigval_t.patch      | 27 -------------------
 1 file changed, 27 deletions(-)
 delete mode 100644 srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch

diff --git a/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch b/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch
deleted file mode 100644
index 4b4f1117c15f..000000000000
--- a/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-Note: Remove this patch with musl 1.2.2
-
---- a/linux-user/syscall.c
-+++ b/linux-user/syscall.c
-@@ -5020,10 +5020,21 @@
- #ifndef HAVE_SIGEV_NOTIFY_THREAD_ID
- #define sigev_notify_thread_id _sigev_un._tid
- #endif
- 
--static inline abi_long target_to_host_sigevent(struct sigevent *host_sevp,
-+struct host_sigevent {
-+    union sigval sigev_value;
-+    int sigev_signo;
-+    int sigev_notify;
-+    union {
-+       char _pad[64 - sizeof(int) * 2 - sizeof(union sigval)];
-+       int _tid;
-+    } _sigev_un;
-+};
-+
-+static inline abi_long target_to_host_sigevent(struct sigevent *sevp,
-                                                abi_ulong target_addr)
- {
-+    struct host_sigevent *host_sevp = (struct host_sigevent *) sevp;
-     struct target_sigevent *target_sevp;
- 
-     if (!lock_user_struct(VERIFY_READ, target_sevp, target_addr, 1)) {

From 48cce077cae4b940bd6a8633bb650077a8e303c1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 15/38] cross-aarch64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..bd6b23f9fb6a 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From a2a05a2a37bcb0f06c22b9c86cc69d35b0de5c99 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 16/38] cross-aarch64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..427ad2c1e9cd 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From fa9c36de3746c1fe39e9f32e908ec265541578d2 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 17/38] cross-arm-linux-gnueabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..2510ee26e789 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 732ad5a4efff1c50f0302fe84c01e6d3076d3e5d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 18/38] cross-arm-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..bd8b16e1b4c1 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 195c0040dbe7331ff0c1458e9d9ffc2419cbef84 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 19/38] cross-arm-linux-musleabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..dacfd2655216 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 6e6a8e2b061f4388d4680b87882a470b266bc7e2 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 20/38] cross-arm-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..9ddd32a9f20d 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 5648731cb1258669830c25fee6aaed602a26963c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 21/38] cross-armv7l-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..9fb00f18be3b 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 6111c5ad206513f165fc5e872a6278a0303c34c7 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 22/38] cross-armv7l-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..2c72e75ddfe3 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 2b8aea677b6318b4a60859beff82aa9786e2eb79 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 23/38] cross-i686-pc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..4dc17df648b5 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 85541bf2b9d06c2d69191f585637db4d5d3e7e73 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Fri, 16 Sep 2022 20:52:19 -0700
Subject: [PATCH 24/38] cross-i686-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-linux-musl/template b/srcpkgs/cross-i686-linux-musl/template
index 8be16a230d8d..78b4d813a113 100644
--- a/srcpkgs/cross-i686-linux-musl/template
+++ b/srcpkgs/cross-i686-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-i686-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-i686-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From e91d63320926fc7fb47b72d5c1f8c3296d5d5d64 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 25/38] cross-mips-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..6009e5c79eb2 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From d096cf778c974081f6e550a281d72ec7df003d1b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 26/38] cross-mips-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..080164df193d 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="hipperson0 <hipperson0@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From d48d7c7f3d5019e568f28eef53fb9f9cdde757ae Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 27/38] cross-mipsel-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..f9fd4b8a04ef 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 760405b6028a1eea8e3f215e74f22b8afb94c044 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 28/38] cross-mipsel-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..7418a984474b 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From e3a18e0e2ae3923f6ce3bcb42b7ab54477164655 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 29/38] cross-powerpc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..31e57b4e52b2 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From cce6ef658455e47b0c60a414d0c2e301f371935f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 30/38] cross-powerpc-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..a2d1edcf1ffd 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 0a97ee3c7ae66b89c22d30e47404f0396d4a585e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 31/38] cross-powerpc64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..1a4cbed61e76 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From cc6a780355dedd70cef63415bb4ca6ee3786fd8a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 32/38] cross-powerpc64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 016f18776a6d..19b1ff859eb6 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 03788610350bfdcae60accf015e0e607fac30d5d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 33/38] cross-powerpc64le-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 463d7e92d20d..9d99a3a315d2 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 6b165d968dc63b529db4d432f6675571c55a7b52 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 34/38] cross-powerpc64le-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index c17a3cccfe29..3128baa7372e 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 8a31bfa45037dd9cfc8ba22b7e512f6531d5e804 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 35/38] cross-powerpcle-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 9aede3c465ce..0462a1015a1a 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 
@@ -35,6 +35,8 @@ if [ "$XBPS_TARGET_MACHINE" = "ppcle" ]; then
 	broken="Can't build crosstoolchain to itself"
 fi
 
+broken="glibc uses big-endian specific instructions on 32-bit powerpc"
+
 cross-powerpcle-linux-gnu-libc_package() {
 	short_desc+=" - glibc files"
 	nostrip=yes

From 08a3ee632df54fe15507d944d49ad61ea6b1e8c7 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 36/38] cross-powerpcle-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index 045cfda987fe..20e70bed4c60 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 1c1a7e6e529973cc8fcf618ba9813a0879a02716 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 37/38] cross-x86_64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 8918f3c22a1c..5219cd50f851 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 91f3ebc1c07593b8e482282f842d45ffc806b6b9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 38/38] cross-x86_64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..2811de0d3c2e 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (205 preceding siblings ...)
  2022-10-18  4:48 ` oreo639
@ 2022-10-18 18:03 ` oreo639
  2022-10-19  8:14 ` oreo639
                   ` (57 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-10-18 18:03 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5478 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.2.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.2.0

There is a list of failing builds here: https://github.com/void-linux/void-packages/issues/39809

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [x] llvm https://github.com/void-linux/void-packages/pull/38694
- [x] m4 https://github.com/void-linux/void-packages/pull/33730
- [x] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [x] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [x] libvirt https://github.com/void-linux/void-packages/pull/38842
- [x] syslinux https://github.com/void-linux/void-packages/pull/38876
- [x] efivar https://github.com/void-linux/void-packages/pull/38874
- [x] gpgme https://github.com/void-linux/void-packages/pull/38825

Known packages that needed to be fixed/updated for gcc12:
- [ ] linux5.18 (in this PR)
- [x] openssh https://github.com/void-linux/void-packages/pull/38849
- [x] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [x] doxygen https://github.com/void-linux/void-packages/pull/38846
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] libproxy https://github.com/void-linux/void-packages/pull/38818
- [x] exempi https://github.com/void-linux/void-packages/pull/38820
- [x] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [x] libunique1 https://github.com/void-linux/void-packages/pull/38848 or https://github.com/void-linux/void-packages/pull/38873
- [x] libwpd https://github.com/void-linux/void-packages/pull/38878
- [x] cglm https://github.com/void-linux/void-packages/pull/39748
- [x] coreboot-utils https://github.com/void-linux/void-packages/pull/39749
- [x] apl https://github.com/void-linux/void-packages/pull/39750
- [x] igt-gpu-tools https://github.com/void-linux/void-packages/pull/39780

Needs to be fixed/updated for binutils:
- [x] grub https://github.com/void-linux/void-packages/pull/38875
- [x] linux-tools https://github.com/void-linux/void-packages/pull/38877
- [x] kcov https://github.com/void-linux/void-packages/pull/39291

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [x] kde
- [x] lxde
- [x] lxqt

You can test the ISOs here:
https://drive.google.com/drive/folders/1ix92CYSLUP-KWjLxltdgG4e8Nu2JCY5n?usp=sharing

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 133711 bytes --]

From 2d9fac891a8c8b812dcf2b4db065c86bcc1fb6f7 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 01/37] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../fix-libcollector-without-java.patch       | 53 +++++++++++++++
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 25 ++++---
 4 files changed, 87 insertions(+), 117 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
 create mode 100644 srcpkgs/binutils/patches/fix-libcollector-without-java.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/fix-libcollector-without-java.patch b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
new file mode 100644
index 000000000000..54384875f358
--- /dev/null
+++ b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
@@ -0,0 +1,53 @@
+From 49ddd814ac1071af7c4f45d5f8398b91862f2c7f Mon Sep 17 00:00:00 2001
+From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
+Date: Wed, 17 Aug 2022 19:55:23 -0700
+Subject: [PATCH] gprofng: fix bug 29479 Collection fails when built without
+ java support
+
+gprofng/ChangeLog
+2022-08-17  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>
+
+	PR gprofng/29479
+	* libcollector/collector.c: Add #if defined(GPROFNG_JAVA_PROFILING) for
+	java specific code.
+	* libcollector/unwind.c: Likewise.
+---
+ gprofng/libcollector/collector.c | 2 ++
+ gprofng/libcollector/unwind.c    | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/gprofng/libcollector/collector.c b/gprofng/libcollector/collector.c
+index 93c9d3330de5..ceff2c1caccb 100644
+--- a/gprofng/libcollector/collector.c
++++ b/gprofng/libcollector/collector.c
+@@ -913,8 +913,10 @@ __collector_open_experiment (const char *exp, const char *params, sp_origin_t or
+   __collector_ext_unwind_key_init (1, NULL);
+ 
+   /* start java attach if suitable */
++#if defined(GPROFNG_JAVA_PROFILING)
+   if (exp_origin == SP_ORIGIN_DBX_ATTACH)
+     __collector_jprofile_start_attach ();
++#endif
+   start_sec_time = CALL_UTIL (time)(NULL);
+   __collector_start_time = collector_interface.getHiResTime ();
+   TprintfT (DBG_LT0, "\t__collector_open_experiment; resetting start_time\n");
+diff --git a/gprofng/libcollector/unwind.c b/gprofng/libcollector/unwind.c
+index 119243788020..f8e11823c81e 100644
+--- a/gprofng/libcollector/unwind.c
++++ b/gprofng/libcollector/unwind.c
+@@ -557,6 +557,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+   int size = max_frame_size;
+ 
+ #define MIN(a,b) ((a)<(b)?(a):(b))
++#if defined(GPROFNG_JAVA_PROFILING)
+   /* get Java info */
+   if (__collector_java_mode && __collector_java_asyncgetcalltrace_loaded && context && !pseudo_context)
+     {
+@@ -569,6 +570,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+ 	  size -= sz;
+ 	}
+     }
++#endif
+ 
+   /* get native stack */
+   if (context)
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..c355a5fc8016 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkgconf"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -35,15 +36,21 @@ do_configure() {
 	local conf
 
 	if [ "$CHROOT_READY" ]; then
-		conf+=" --with-debuginfod"
+		conf+=" --with-debuginfod --enable-shared"
 	else
-		conf+=" --without-debuginfod --disable-install-libbfd"
+		conf+=" --without-debuginfod --disable-shared --disable-install-libbfd"
 	fi
 	if [ "$CROSS_BUILD" ]; then
 		# we don't want --with-sysroot=${XBPS_CROSS_BASE} like gnu-configure
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	# gprofng currently only supports x86 and aarch64 glibc.
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64|i386|aarch64) conf+=" --enable-gprofng" ;;
+		*) conf+=" --disable-gprofng" ;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"
@@ -76,13 +83,14 @@ do_configure() {
 		--libdir=/usr/lib \
 		--mandir=/usr/share/man \
 		--infodir=/usr/share/info \
+		--sysconfdir=/etc \
 		--disable-werror \
-		--disable-shared \
 		--disable-nls \
 		--enable-threads \
 		--enable-plugins \
 		--enable-relro \
 		--enable-gold \
+		--enable-new-dtags \
 		--enable-deterministic-archives \
 		--enable-64-bit-bfd \
 		--enable-ld=default \
@@ -142,7 +150,8 @@ binutils-devel_package() {
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/*.a"
-		vmove "usr/lib/*.so"
+		vmove "usr/lib/libbfd.so"
+		vmove "usr/lib/libopcodes.so"
 	}
 }
 

From 672f603c7846c0e6f05f9bea2a9470091cf0c88c Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 2 Oct 2022 16:46:59 -0700
Subject: [PATCH 02/37] gdb: resolve conflict with binutils 2.39

---
 srcpkgs/gdb/template | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/gdb/template b/srcpkgs/gdb/template
index ff7c9d9a5911..5970402eb27e 100644
--- a/srcpkgs/gdb/template
+++ b/srcpkgs/gdb/template
@@ -1,7 +1,7 @@
 # Template file for 'gdb'
 pkgname=gdb
 version=12.1
-revision=1
+revision=2
 build_style=gnu-configure
 pycompile_dirs="/usr/share/gdb/python"
 configure_args="--disable-werror --disable-nls --with-system-readline
@@ -48,7 +48,8 @@ vopt_conflict debuginfod static
 
 post_install() {
 	# resolve conflicts with binutils
-	rm -r ${DESTDIR}/usr/{include,lib,share/info/bfd.info*}
+	rm -rf ${DESTDIR}/usr/{include,lib}
+	rm -rf ${DESTDIR}/usr/share/info/{bfd,ctf-spec}.info*
 }
 
 gdb-common_package() {

From 350225597d7f68be4caa62fafae6adfc4d4ebf6c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 03/37] gcc: update to 12.2.0.

---
 common/shlibs                                 |  10 +-
 srcpkgs/gcc/files/gccgo-musl.patch            |  71 ++-------
 srcpkgs/gcc/files/libgnarl-musl.patch         |  18 +--
 srcpkgs/gcc/files/libssp-musl.patch           |  10 +-
 srcpkgs/gcc/patches/libffi_gnulinux.patch     |  11 --
 .../gcc/patches/libgcc-ibm128-no-tag.patch    |  10 +-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |   2 +-
 srcpkgs/gcc/template                          | 136 +++++++++---------
 8 files changed, 105 insertions(+), 163 deletions(-)
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index ecab4d8f7ecc..5f5f92ef7ed7 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.2.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.36 perl-5.36.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -848,8 +848,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.2.0_1
+libgnat-12.so libada-12.2.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1699,8 +1699,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.2.0_1
+libasan.so.8 libsanitizer-12.2.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..12ec68dd8aa3 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,14 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ b/libgo/go/runtime/os_linux.go
+@@ -365,7 +365,7 @@ func setThreadCPUProfiler(hz int32) {
+ 	var sevp _sigevent
+ 	sevp.sigev_notify = _SIGEV_THREAD_ID
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.__sev_fields))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..5ffd54e466ae 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,37 +3,35 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
+version=12.2.0
+revision=1
+_minorver="${version%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
-wrksrc=gcc-${version/pre/_pre}
+_mpc_version=1.2.1
+_isl_version=0.24
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
+create_wrksrc=yes
+build_wrksrc="gcc-${version}"
+patch_args="-Np1 --directory=${build_wrksrc}"
 lib32disabled=yes
 bootstrap=yes
 replaces="gcc-gcj<7.2.0 gcc-gcj-jdk-compat<7.2.0 libmpx>=0 libmpx-devel>=0"
@@ -52,8 +50,11 @@ if [ "$CHROOT_READY" ]; then
 	hostmakedepends="tar texinfo perl flex"
 else
 	_have_gccgo=no
+	# libzstd fails to link in bootstrap with glibc 2.36
+	# when zlib has been compiled with glibc 2.32.
+	LDFLAGS="-lzstd -pthread"
 fi
-makedepends="zlib-devel"
+makedepends="zlib-devel libzstd-devel"
 depends="binutils libgcc-devel-${version}_${revision}
  libstdc++-devel-${version}_${revision} libssp-devel-${version}_${revision}"
 checkdepends="dejagnu"
@@ -70,13 +71,13 @@ if [ "$build_option_gnatboot" ]; then
 	case "$XBPS_TARGET_MACHINE" in
 	x86_64)
 		_gnat_tarball="gnat-gpl-2017-x86_64-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/591c6d80c7a447af2deed1d7>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/9682e2e1f2f232ce03fe21d77b14c37a0de5649b?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" b942bcac20dea39748b39f8b624d9619f60a8dee2e8195dbe3829c835b0956e6"
 		build_options_default="gnatboot"
 		;;
 	i686)
 		_gnat_tarball="gnat-gpl-2014-x86-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/564b3e9dc8e196b040fbe248>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/c5e9e6fdff5cb77ed90cf8c62536653e27c0bed6?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" 3b693510f5d22a240abb3034934c1adbd80ccd6e4f61a4f491cc408fdfd9c042"
 		build_options_default="gnatboot"
 		;;
@@ -155,25 +156,24 @@ if [ "$CROSS_BUILD" ]; then
 fi
 
 post_extract() {
-	mkdir -p ${wrksrc}/{gmp,mpfr,mpc,isl}
-	cp -ar ${XBPS_BUILDDIR}/gmp-${_gmp_version}/* ${wrksrc}/gmp/
-	cp -ar ${XBPS_BUILDDIR}/mpfr-${_mpfr_version}/* ${wrksrc}/mpfr/
-	cp -ar ${XBPS_BUILDDIR}/mpc-${_mpc_version}/* ${wrksrc}/mpc/
-	cp -ar ${XBPS_BUILDDIR}/isl-${_isl_version}/* ${wrksrc}/isl/
+	ln -s ${wrksrc}/gmp-${_gmp_version} ${wrksrc}/${build_wrksrc}/gmp
+	ln -s ${wrksrc}/mpfr-${_mpfr_version} ${wrksrc}/${build_wrksrc}/mpfr
+	ln -s ${wrksrc}/mpc-${_mpc_version} ${wrksrc}/${build_wrksrc}/mpc
+	ln -s ${wrksrc}/isl-${_isl_version} ${wrksrc}/${build_wrksrc}/isl
 
 	if [ "$build_option_gnatboot" ]; then
 		local f="${XBPS_SRCDISTDIR}/${pkgname}-${version}/${_gnat_tarball}"
 		msg_normal "Extracting ${_gnat_tarball} ...\n"
-		mkdir -p ${wrksrc}/gnat-ins
-		tar -x -f "$f" --strip-components=1 -C ${wrksrc}/gnat-ins
-		cd ${wrksrc}/gnat-ins
-		make ins-all prefix=${wrksrc}/gnat
-		cd ${wrksrc}
-		rm -rf ${wrksrc}/gnat-ins
+		mkdir -p ${wrksrc}/${build_wrksrc}/gnat-ins
+		tar -x -f "$f" --strip-components=1 -C ${wrksrc}/${build_wrksrc}/gnat-ins
+		cd ${wrksrc}/${build_wrksrc}/gnat-ins
+		make ins-all prefix=${wrksrc}/${build_wrksrc}/gnat
+		cd ${wrksrc}/${build_wrksrc}
+		rm -rf ${wrksrc}/${build_wrksrc}/gnat-ins
 
 		# Rename obsolete ld and as
-		find ${wrksrc}/gnat -name ld -exec mv -v {} {}.old \;
-		find ${wrksrc}/gnat -name as -exec mv -v {} {}.old \;
+		find ${wrksrc}/${build_wrksrc}/gnat -name ld -exec mv -v {} {}.old \;
+		find ${wrksrc}/${build_wrksrc}/gnat -name as -exec mv -v {} {}.old \;
 	fi
 }
 
@@ -185,9 +185,9 @@ pre_configure() {
 	sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
 
 	if [ "$XBPS_TARGET_LIBC" = musl ]; then
-		patch -p1 -i ${FILESDIR}/libgnarl-musl.patch
-		patch -p1 -i ${FILESDIR}/libssp-musl.patch
-		patch -p1 -i ${FILESDIR}/gccgo-musl.patch
+		for p in ${FILESDIR}/*-musl.patch; do
+			patch -p1 -i $p
+		done
 	fi
 }
 do_configure() {
@@ -297,19 +297,19 @@ do_configure() {
 		_args+=" --enable-languages=${_langs},ada"
 		_args+=" --enable-libada"
 		CONFIG_SHELL=/bin/bash \
-		CC="${wrksrc}/gnat/bin/gcc" \
-		GNATBIND="${wrksrc}/gnat/bin/gnatbind" \
-		GNATMAKE="${wrksrc}/gnat/bin/gnatmake" \
-		PATH="${wrksrc}/gnat/bin:$PATH" \
-			${wrksrc}/configure ${_args}
+		CC="${wrksrc}/${build_wrksrc}/gnat/bin/gcc" \
+		GNATBIND="${wrksrc}/${build_wrksrc}/gnat/bin/gnatbind" \
+		GNATMAKE="${wrksrc}/${build_wrksrc}/gnat/bin/gnatmake" \
+		PATH="${wrksrc}/${build_wrksrc}/gnat/bin:$PATH" \
+			${wrksrc}/${build_wrksrc}/configure ${_args}
 	elif [ "$build_option_ada" ]; then
 		_args+=" --enable-languages=${_langs},ada"
 		CONFIG_SHELL=/bin/bash \
-			${wrksrc}/configure ${_args}
+			${wrksrc}/${build_wrksrc}/configure ${_args}
 	else
 		_args+=" --enable-languages=${_langs}"
 		CONFIG_SHELL=/bin/bash \
-			${wrksrc}/configure ${_args}
+			${wrksrc}/${build_wrksrc}/configure ${_args}
 	fi
 }
 do_build() {
@@ -318,10 +318,10 @@ do_build() {
 	fi
 	cd build
 	if [ "$build_option_gnatboot" ]; then
-		CC="${wrksrc}/gnat/bin/gcc" \
-		GNATBIND="${wrksrc}/gnat/bin/gnatbind" \
-		GNATMAKE="${wrksrc}/gnat/bin/gnatmake" \
-		PATH="${wrksrc}/gnat/bin:$PATH" \
+		CC="${wrksrc}/${build_wrksrc}/gnat/bin/gcc" \
+		GNATBIND="${wrksrc}/${build_wrksrc}/gnat/bin/gnatbind" \
+		GNATMAKE="${wrksrc}/${build_wrksrc}/gnat/bin/gnatmake" \
+		PATH="${wrksrc}/${build_wrksrc}/gnat/bin:$PATH" \
 		make ${makejobs}
 	else
 		make ${makejobs}
@@ -330,7 +330,7 @@ do_build() {
 pre_install() {
 	if [ "$CROSS_BUILD" ]; then
 		# XXX otherwise links to host libpthread
-		for f in $(find ${wrksrc}/build/${XBPS_CROSS_TRIPLET} -type f -name libtool); do
+		for f in $(find ${wrksrc}/${build_wrksrc}/build/${XBPS_CROSS_TRIPLET} -type f -name libtool); do
 			sed -e "s,add_dir=\"-L\$libdir\",add_dir=\"-L${XBPS_CROSS_BASE}\$libdir\",g" -i $f
 		done
 	fi
@@ -342,16 +342,16 @@ do_install() {
 
 	# Make version a symlink of major version to make all versions
 	# from the same series work automagically.
-	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver} \
+	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${version} \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver}
 	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver} \
-		${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}
+		${DESTDIR}/usr/lib/gcc/${_triplet}/${version}
 
 	# Ditto for c++ headers.
-	mv ${DESTDIR}/usr/include/c++/${_patchver} \
+	mv ${DESTDIR}/usr/include/c++/${version} \
 		${DESTDIR}/usr/include/c++/${_minorver}
 	ln -sfr ${DESTDIR}/usr/include/c++/${_minorver} \
-		${DESTDIR}/usr/include/c++/${_patchver}
+		${DESTDIR}/usr/include/c++/${version}
 
 	# cc symlink
 	ln -sfr ${DESTDIR}/usr/bin/gcc ${DESTDIR}/usr/bin/cc
@@ -360,7 +360,7 @@ do_install() {
 
 	# lto plugin symlink
 	vmkdir usr/lib/bfd-plugins
-	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}/liblto_plugin.so \
+	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${version}/liblto_plugin.so \
 		${DESTDIR}/usr/lib/bfd-plugins
 
 	# Remove "fixed" header
@@ -371,13 +371,9 @@ do_install() {
 	rm -f ${DESTDIR}/usr/lib/libffi*
 	rm -f ${DESTDIR}/usr/share/man/man3/ffi*
 
-	# Remove all python scripts in libdir.
-	rm -f ${DESTDIR}/usr/lib/*.py
-
-	# Remove more python stuff.
-	if [ -d ${DESTDIR}/usr/share/gcc-${_patchver}/python ]; then
-		rm -rf ${DESTDIR}/usr/share/gcc-${_patchver}/python
-	fi
+	# Move libstdc++ gdb helpers to location where gdb can autoload them
+	mkdir -p ${DESTDIR}/usr/share/gdb/auto-load/usr/lib
+	mv ${DESTDIR}/usr/lib/*.py ${DESTDIR}/usr/share/gdb/auto-load/usr/lib
 
 	# Install c89 and c99 wrappers and its manpages, from NetBSD.
 	for f in c89 c99; do
@@ -396,7 +392,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}
@@ -449,7 +445,7 @@ gcc-fortran_package() {
 		if [ "$CROSS_BUILD" ]; then
 			# A number of OMP modules are not built when cross
 			# compiling gcc. Copy them from the cross compiler.
-			local src="/usr/lib/gcc/${_triplet}/${_patchver}/finclude"
+			local src="/usr/lib/gcc/${_triplet}/${version}/finclude"
 			local dst="usr/lib/gcc/${_triplet}/${_minorver}/finclude"
 			for f in omp_lib.f90 omp_lib.h omp_lib.mod omp_lib_kinds.mod \
 				openacc.f90 openacc.mod openacc_kinds.mod openacc_lib.h; do
@@ -516,7 +512,7 @@ libgfortran_package() {
 	short_desc+=" - Fortran library"
 	pkg_install() {
 		vmove "usr/lib/libgfortran.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -537,7 +533,7 @@ libgo_package() {
 	nostrip=yes
 	pkg_install() {
 		vmove "usr/lib/libgo.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -553,7 +549,7 @@ libobjc_package() {
 	short_desc+=" - Objective-C library"
 	pkg_install() {
 		vmove "usr/lib/libobjc.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -572,7 +568,7 @@ libquadmath_package() {
 	short_desc+=" - quadmath library"
 	pkg_install() {
 		vmove "usr/lib/libquadmath.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -614,7 +610,7 @@ libgcc_package() {
 	noverifyrdeps=yes
 	pkg_install() {
 		vmove "usr/lib/libgcc_s.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -645,7 +641,7 @@ libgomp_package() {
 	short_desc+=" - OpenMP v4.0 library"
 	pkg_install() {
 		vmove "usr/lib/libgomp*.so.*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -700,7 +696,7 @@ libssp_package() {
 	short_desc+=" - SSP (StackSmashingProtection) library"
 	pkg_install() {
 		vmove "usr/lib/libssp.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -717,7 +713,9 @@ libstdc++-devel_package() {
 libstdc++_package() {
 	short_desc+=" - Standard C++ Library"
 	pkg_install() {
+		vmove usr/share/gdb
+		vmove usr/share/gcc-${version}/python
 		vmove "usr/lib/libstdc++.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }

From 36c607a50bd23167d8886c160d55a138aa297617 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 04/37] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      | 11 ++++--
 2 files changed, 25 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..a4087ec2055e 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,12 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
+
+if [ "$XBPS_TARGET_LIBC" == "musl" ]; then
+	# Musl always searches LD_LIBRARY_PATH before RPATH and RUNPATH
+	make_build_args="lt_cv_shlibpath_overrides_runpath=yes"
+fi
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From fbe8a31f665cbefb9651848d366b4eecea90f693 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 05/37] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 55255dceae8b..ca2d858a7abc 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From e7664b17e224fe4269d81ee2d9c1b58dba569958 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 06/37] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 ...e-hash-style-both-for-building-glibc.patch |  51 ++++
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 4 files changed, 106 insertions(+), 353 deletions(-)
 create mode 100644 srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index 5f5f92ef7ed7..34624efcb647 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch b/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
new file mode 100644
index 000000000000..9c5553e92609
--- /dev/null
+++ b/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
@@ -0,0 +1,51 @@
+Temporary workaround for EAC bug.
+
+See: https://sourceware.org/bugzilla/show_bug.cgi?id=29456
+
+From 8e90e2cc5e57d7ca3a40602d278e9642a8b66716 Mon Sep 17 00:00:00 2001
+From: oreo639 <oreo6391@gmail.com>
+Date: Tue, 13 Sep 2022 14:30:35 -0700
+Subject: [PATCH] Revert "Do not use --hash-style=both for building glibc
+ shared objects"
+
+This reverts commit e47de5cb2d4dbecb58f569ed241e8e95c568f03c.
+---
+ Makeconfig     |  9 +++++++++
+ Makerules      |  7 +++++++
+ 5 files changed, 61 insertions(+)
+
+diff --git a/Makeconfig b/Makeconfig
+index ba70321af1..e2131d4389 100644
+--- a/Makeconfig
++++ b/Makeconfig
+@@ -371,6 +371,13 @@ dt-relr-ldflag =
+ no-dt-relr-ldflag =
+ endif
+ 
++# For the time being we unconditionally use 'both'.  At some time we
++# should declare statically linked code as 'out of luck' and compile
++# with --hash-style=gnu only.
++hashstyle-LDFLAGS = -Wl,--hash-style=both
++LDFLAGS.so += $(hashstyle-LDFLAGS)
++LDFLAGS-rtld += $(hashstyle-LDFLAGS)
++
+ ifeq (no,$(build-pie-default))
+ pie-default = $(no-pie-ccflag)
+ else # build-pie-default
+diff --git a/Makerules b/Makerules
+index d1e139d03c..44134e37ce 100644
+--- a/Makerules
++++ b/Makerules
+@@ -558,6 +558,9 @@ $(common-objpfx)shlib.lds: $(common-objpfx)config.make $(..)Makerules
+ 		  -Wl,--verbose 2>/dev/null | \
+ 	  sed > $@T \
+ 	      -e '/^=========/,/^=========/!d;/^=========/d' \
++		   -e 's/^.*\.gnu\.hash[ 	]*:.*$$/  .note.ABI-tag : { *(.note.ABI-tag) } &/' \
++		   -e '/^[ 	]*\.hash[ 	]*:.*$$/{h;d;}' \
++		   -e '/DATA_SEGMENT_ALIGN/{H;g}' \
+ 	      -e 's/^.*\*(\.dynbss).*$$/& \
+ 		 PROVIDE(__start___libc_freeres_ptrs = .); \
+ 		 *(__libc_freeres_ptrs) \
+-- 
+2.37.3
+
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From 8f3c85b9960470128fb2b57b4028cec5265f92ac Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Wed, 14 Sep 2022 03:48:32 -0700
Subject: [PATCH 07/37] musl: add support for SIGEV_THREAD_ID timers

https://git.musl-libc.org/cgit/musl/commit/?id=7c71792e87691451f2a6b76348e83ad1889f1dcb
---
 ...d-support-for-SIGEV_THREAD_ID-timers.patch | 74 +++++++++++++++++++
 srcpkgs/musl/template                         |  2 +-
 2 files changed, 75 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch

diff --git a/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
new file mode 100644
index 000000000000..e20dff5ba0d4
--- /dev/null
+++ b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
@@ -0,0 +1,74 @@
+From 7c71792e87691451f2a6b76348e83ad1889f1dcb Mon Sep 17 00:00:00 2001
+From: James Y Knight <jyknight@google.com>
+Date: Sun, 30 Jun 2019 21:55:20 -0400
+Subject: [PATCH] add support for SIGEV_THREAD_ID timers
+
+This is like SIGEV_SIGNAL, but targeted to a particular thread's
+tid, rather than the process.
+---
+ include/signal.h        | 16 +++++++++++++---
+ src/time/timer_create.c |  8 ++++++--
+ 2 files changed, 19 insertions(+), 5 deletions(-)
+
+diff --git a/include/signal.h b/include/signal.h
+index fbdf667b2..9ed929e4f 100644
+--- a/include/signal.h
++++ b/include/signal.h
+@@ -180,14 +180,24 @@ struct sigevent {
+ 	union sigval sigev_value;
+ 	int sigev_signo;
+ 	int sigev_notify;
+-	void (*sigev_notify_function)(union sigval);
+-	pthread_attr_t *sigev_notify_attributes;
+-	char __pad[56-3*sizeof(long)];
++	union {
++		char __pad[64 - 2*sizeof(int) - sizeof(union sigval)];
++		pid_t sigev_notify_thread_id;
++		struct {
++			void (*sigev_notify_function)(union sigval);
++			pthread_attr_t *sigev_notify_attributes;
++		} __sev_thread;
++	} __sev_fields;
+ };
+ 
++#define sigev_notify_thread_id __sev_fields.sigev_notify_thread_id
++#define sigev_notify_function __sev_fields.__sev_thread.sigev_notify_function
++#define sigev_notify_attributes __sev_fields.__sev_thread.sigev_notify_attributes
++
+ #define SIGEV_SIGNAL 0
+ #define SIGEV_NONE 1
+ #define SIGEV_THREAD 2
++#define SIGEV_THREAD_ID 4
+ 
+ int __libc_current_sigrtmin(void);
+ int __libc_current_sigrtmax(void);
+diff --git a/src/time/timer_create.c b/src/time/timer_create.c
+index 5ddfda278..4bef23905 100644
+--- a/src/time/timer_create.c
++++ b/src/time/timer_create.c
+@@ -71,11 +71,15 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 	switch (evp ? evp->sigev_notify : SIGEV_SIGNAL) {
+ 	case SIGEV_NONE:
+ 	case SIGEV_SIGNAL:
++	case SIGEV_THREAD_ID:
+ 		if (evp) {
+ 			ksev.sigev_value = evp->sigev_value;
+ 			ksev.sigev_signo = evp->sigev_signo;
+ 			ksev.sigev_notify = evp->sigev_notify;
+-			ksev.sigev_tid = 0;
++			if (evp->sigev_notify == SIGEV_THREAD_ID)
++				ksev.sigev_tid = evp->sigev_notify_thread_id;
++			else
++				ksev.sigev_tid = 0;
+ 			ksevp = &ksev;
+ 		}
+ 		if (syscall(SYS_timer_create, clk, ksevp, &timerid) < 0)
+@@ -107,7 +111,7 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 
+ 		ksev.sigev_value.sival_ptr = 0;
+ 		ksev.sigev_signo = SIGTIMER;
+-		ksev.sigev_notify = 4; /* SIGEV_THREAD_ID */
++		ksev.sigev_notify = SIGEV_THREAD_ID;
+ 		ksev.sigev_tid = td->tid;
+ 		if (syscall(SYS_timer_create, clk, &ksev, &timerid) < 0)
+ 			timerid = -1;
diff --git a/srcpkgs/musl/template b/srcpkgs/musl/template
index 5bdc5c48e623..34e6ed4fba6e 100644
--- a/srcpkgs/musl/template
+++ b/srcpkgs/musl/template
@@ -2,7 +2,7 @@
 pkgname=musl
 reverts="1.2.0_1"
 version=1.1.24
-revision=10
+revision=11
 archs="*-musl"
 bootstrap=yes
 build_style=gnu-configure

From b6d0fd12c16973c85bfb69e48ef83d95c54d6929 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 21:01:43 -0700
Subject: [PATCH 08/37] gcc-multilib: update to 12.2.0.

---
 srcpkgs/gcc-multilib/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index fcd25755aa75..df60849babc2 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,16 +3,16 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _majorver="${version%.*}"
-wrksrc=gcc-${version/pre/_pre}
+wrksrc="gcc-${version}"
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel
@@ -71,7 +71,7 @@ do_build() {
 	make ${makejobs}
 }
 do_install() {
-	local _pc_triplet=x86_64-pc-linux-gnu _version=${version%pre1}
+	local _pc_triplet=x86_64-pc-linux-gnu
 	# Install to a tempdir and then only copy relevant files.
 	cd ${wrksrc}
 	make DESTDIR=${wrksrc}/${pkgname}-build install
@@ -81,9 +81,9 @@ do_install() {
 	vmkdir usr/include/c++/${_majorver}/${_triplet}
 	vmkdir usr/lib/gcc/${_triplet}/${_majorver}
 
-	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${_version}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${version}/32 \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_majorver}/
-	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${_version}/${_pc_triplet}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${version}/${_pc_triplet}/32 \
 		${DESTDIR}/usr/include/c++/${_majorver}/${_triplet}
 
 	vinstall ${wrksrc}/host-${_pc_triplet}/gcc/specs 644 usr/lib/gcc/${_triplet}/${_majorver}

From e1a332f9a744f9966cec05917bcf2f404421471a Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Tue, 4 Oct 2022 03:49:13 -0700
Subject: [PATCH 09/37] libgccjit: update to 12.2.0.

---
 srcpkgs/libgccjit/files/libgccjit-musl.patch | 63 --------------------
 srcpkgs/libgccjit/template                   | 38 ++++++------
 2 files changed, 17 insertions(+), 84 deletions(-)
 delete mode 100644 srcpkgs/libgccjit/files/libgccjit-musl.patch

diff --git a/srcpkgs/libgccjit/files/libgccjit-musl.patch b/srcpkgs/libgccjit/files/libgccjit-musl.patch
deleted file mode 100644
index d2ed16928c82..000000000000
--- a/srcpkgs/libgccjit/files/libgccjit-musl.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-diff --git a/gcc/jit/jit-playback.c b/gcc/jit/jit-playback.c
-index 5bccf591a..35f5e35ef 100644
---- a/gcc/jit/jit-playback.c
-+++ b/gcc/jit/jit-playback.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -41,8 +43,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "diagnostic.h"
- #include "stmt.h"
- 
--#include <pthread.h>
--
- #include "jit-playback.h"
- #include "jit-result.h"
- #include "jit-builtins.h"
-diff --git a/gcc/jit/jit-recording.c b/gcc/jit/jit-recording.c
-index a237d574f..5785e3269 100644
---- a/gcc/jit/jit-recording.c
-+++ b/gcc/jit/jit-recording.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -25,8 +27,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "pretty-print.h"
- #include "toplev.h"
- 
--#include <pthread.h>
--
- #include "jit-builtins.h"
- #include "jit-recording.h"
- #include "jit-playback.h"
-diff --git a/gcc/jit/libgccjit.c b/gcc/jit/libgccjit.c
-index f9c33c63c..75f21d275 100644
---- a/gcc/jit/libgccjit.c
-+++ b/gcc/jit/libgccjit.c
-@@ -18,13 +18,13 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
- #include "timevar.h"
- #include "typed-splay-tree.h"
- #include "cppbuiltin.h"
--#include <pthread.h>
- 
- #include "libgccjit.h"
- #include "jit-recording.h"
diff --git a/srcpkgs/libgccjit/template b/srcpkgs/libgccjit/template
index 6f1d6256dcd6..b5d4540ce667 100644
--- a/srcpkgs/libgccjit/template
+++ b/srcpkgs/libgccjit/template
@@ -3,36 +3,32 @@
 # which use the version number.
 
 pkgname=libgccjit
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
+version=12.2.0
 revision=1
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
-_majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
-wrksrc=gcc-${version/pre/_pre}
+_mpc_version=1.2.1
+_isl_version=0.24
 short_desc="Just-In-Time Compilation library for GCC"
 maintainer="Lane Biocini <lane@mailbox.org>"
 homepage="https://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 nopie=yes
+create_wrksrc=yes
+build_wrksrc="gcc-${version}"
+patch_args="-Np1 --directory=${build_wrksrc}"
 lib32disabled=yes
 makedepends="zlib-devel"
 hostmakedepends="tar texinfo perl flex"
@@ -40,10 +36,10 @@ depends="gcc"
 checkdepends="dejagnu"
 
 post_extract() {
-	mv ${XBPS_BUILDDIR}/gmp-${_gmp_version} ${wrksrc}/gmp
-	mv ${XBPS_BUILDDIR}/mpfr-${_mpfr_version} ${wrksrc}/mpfr
-	mv ${XBPS_BUILDDIR}/mpc-${_mpc_version} ${wrksrc}/mpc
-	mv ${XBPS_BUILDDIR}/isl-${_isl_version} ${wrksrc}/isl
+	ln -s ${wrksrc}/gmp-${_gmp_version} ${wrksrc}/${build_wrksrc}/gmp
+	ln -s ${wrksrc}/mpfr-${_mpfr_version} ${wrksrc}/${build_wrksrc}/mpfr
+	ln -s ${wrksrc}/mpc-${_mpc_version} ${wrksrc}/${build_wrksrc}/mpc
+	ln -s ${wrksrc}/isl-${_isl_version} ${wrksrc}/${build_wrksrc}/isl
 }
 
 pre_configure() {
@@ -186,7 +182,7 @@ do_configure() {
 	[ -z "$XBPS_CHECK_PKGS" ] && _langs="jit" || _langs="jit,c++"
 	_args+=" --enable-languages=${_langs}"
 	CONFIG_SHELL=/bin/bash \
-		${wrksrc}/configure ${_args}
+		${wrksrc}/${build_wrksrc}/configure ${_args}
 }
 
 do_build() {

From 49adeea68a18e7708191db92deefd22a4b76dd91 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 14 Aug 2022 19:29:36 -0700
Subject: [PATCH 10/37] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove -no-pie from build. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..5d40f0cdd8a6 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -53,6 +53,7 @@ _void_cross_build_binutils() {
 		--sbindir=/usr/bin \
 		--libdir=/usr/lib \
 		--libexecdir=/usr/lib \
+		--sysconfdir=/etc \
 		--target=${tgt} \
 		--with-sysroot=/usr/${tgt} \
 		--disable-nls \
@@ -60,7 +61,9 @@ _void_cross_build_binutils() {
 		--disable-multilib \
 		--disable-werror \
 		--disable-gold \
+		--disable-gprofng \
 		--enable-relro \
+		--enable-new-dtags \
 		--enable-plugins \
 		--enable-64-bit-bfd \
 		--enable-deterministic-archives \
@@ -132,6 +135,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -460,6 +464,14 @@ do_build() {
 	local binutils_ver linux_ver gcc_ver libc_ver libucontext_ver
 	local tgt=${sourcepkg/cross-}
 
+	export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}"
+	export CXXFLAGS="${CXXFLAGS/-D_FORTIFY_SOURCE=2/}"
+
+	# Disable explicit -fno-PIE, gcc/binutils/libc will figure this out itself.
+	export CFLAGS="${CFLAGS//-fno-PIE/}"
+	export CXXFLAGS="${CXXFLAGS//-fno-PIE/}"
+	export LDFLAGS="${LDFLAGS//-no-pie/}"
+
 	_void_cross_test_ver binutils
 	_void_cross_test_ver linux
 	_void_cross_test_ver gcc
@@ -625,6 +637,9 @@ do_install() {
 	# then remove it because it conflicts with libquadmath package
 	rm -rf ${DESTDIR}/${sysroot}/usr/lib/libquadmath.*
 
+	# Remove libdep linker plugin because it conflicts with system binutils
+	rm -f ${DESTDIR}/usr/lib/bfd-plugins/libdep*
+
 	# Remove leftover symlinks
 	rm -f ${DESTDIR}/usr/lib${XBPS_TARGET_WORDSIZE}
 	rm -f ${DESTDIR}/lib*

From 53ff375b523d06604f1ede411aeaf17e53943022 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:08 -0700
Subject: [PATCH 11/37] subversion: fix build for libtool 2.4.7

---
 srcpkgs/subversion/template | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/subversion/template b/srcpkgs/subversion/template
index 18c35e3a2132..0aa41212c5fd 100644
--- a/srcpkgs/subversion/template
+++ b/srcpkgs/subversion/template
@@ -24,6 +24,8 @@ distfiles="http://apache.uvigo.es/subversion/subversion-${version}.tar.bz2"
 checksum=c9130e8d0b75728a66f0e7038fc77052e671830d785b5616aad53b4810d3cc28
 
 pre_configure() {
+	./autogen.sh --release
+
 	# Based on native build values
 	cat <<-EOF >config.cache
 	ac_cv_python_includes=-I${XBPS_CROSS_BASE}/usr/include/python${py3_ver}
@@ -59,7 +61,12 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+
+	if [ "$XBPS_BUILD_ENVIRONMENT" = "void-packages-ci" ]; then
+		# This test will fail when run as the root user,
+		# because flock() will ignore file permissions.
+		vsed -i subversion/tests/libsvn_fs/locks-test.c -e '/SVN_TEST_OPTS_PASS(obtain_write_lock_failure,/,+3d'
+	fi
 }
 
 post_configure() {

From c1314d87b6eb9768c816a39e30413b61dd092b74 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:38 -0700
Subject: [PATCH 12/37] subversion-kwallet-auth: update to 1.14.2.

Fix failing distfiles.
Fix build for libtool 2.4.7
---
 srcpkgs/subversion-kwallet-auth/template | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/subversion-kwallet-auth/template b/srcpkgs/subversion-kwallet-auth/template
index 12210f250d51..9cc68c3fe5f1 100644
--- a/srcpkgs/subversion-kwallet-auth/template
+++ b/srcpkgs/subversion-kwallet-auth/template
@@ -3,7 +3,7 @@
 # THIS PKG MUST BE SYNCHRONIZED WITH "srcpkgs/subversion".
 #
 pkgname=subversion-kwallet-auth
-version=1.14.1
+version=1.14.2
 revision=1
 wrksrc="subversion-${version}"
 build_style=gnu-configure
@@ -22,10 +22,12 @@ license="Apache-2.0, BSD-3-Clause"
 homepage="http://subversion.apache.org/"
 changelog="https://subversion.apache.org/docs/release-notes/${version%.*}.html"
 distfiles="http://apache.uvigo.es/subversion/subversion-${version}.tar.bz2"
-checksum=2c5da93c255d2e5569fa91d92457fdb65396b0666fad4fd59b22e154d986e1a9
+checksum=c9130e8d0b75728a66f0e7038fc77052e671830d785b5616aad53b4810d3cc28
 lib32disabled=yes
 
 pre_configure() {
+	./autogen.sh --release
+
 	# Based on native build values
 	cat <<-EOF >config.cache
 	ac_cv_python_includes=-I${XBPS_CROSS_BASE}/usr/include/python${py3_ver}
@@ -55,11 +57,18 @@ pre_configure() {
 		cp "$XBPS_CROSS_BASE/usr/lib/perl5/core_perl/Config"*.p? $PERL5LIB
 		cp "$XBPS_CROSS_BASE/usr/lib/perl5/core_perl/Errno.pm" $PERL5LIB
 		vsed -e "s;archlibexp => '\(.*\)';archlibexp => '${XBPS_CROSS_BASE}\1';" \
-			-i $PERL5LIB/Config.pm $PERL5LIB/Config_heavy.pl
+			-i $PERL5LIB/Config.pm
+		vsed -e "s;archlibexp='\(.*\)';archlibexp='${XBPS_CROSS_BASE}\1';" \
+			-i $PERL5LIB/Config_heavy.pl
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+
+	if [ "$XBPS_BUILD_ENVIRONMENT" = "void-packages-ci" ]; then
+		# This test will fail when run as the root user,
+		# because flock() will ignore file permissions.
+		vsed -i subversion/tests/libsvn_fs/locks-test.c -e '/SVN_TEST_OPTS_PASS(obtain_write_lock_failure,/,+3d'
+	fi
 }
 
 post_configure() {

From 9671e8041373ba4b182a12b8f7e676250ea1fc7f Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 15 Oct 2022 03:39:40 -0700
Subject: [PATCH 13/37] qemu: remove broken patch

The necessary patch has been imported into musl so no need
to cast the sigevent struct to a more glibc-like one.
---
 .../musl-fix-sigevent-and-sigval_t.patch      | 27 -------------------
 1 file changed, 27 deletions(-)
 delete mode 100644 srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch

diff --git a/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch b/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch
deleted file mode 100644
index 4b4f1117c15f..000000000000
--- a/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-Note: Remove this patch with musl 1.2.2
-
---- a/linux-user/syscall.c
-+++ b/linux-user/syscall.c
-@@ -5020,10 +5020,21 @@
- #ifndef HAVE_SIGEV_NOTIFY_THREAD_ID
- #define sigev_notify_thread_id _sigev_un._tid
- #endif
- 
--static inline abi_long target_to_host_sigevent(struct sigevent *host_sevp,
-+struct host_sigevent {
-+    union sigval sigev_value;
-+    int sigev_signo;
-+    int sigev_notify;
-+    union {
-+       char _pad[64 - sizeof(int) * 2 - sizeof(union sigval)];
-+       int _tid;
-+    } _sigev_un;
-+};
-+
-+static inline abi_long target_to_host_sigevent(struct sigevent *sevp,
-                                                abi_ulong target_addr)
- {
-+    struct host_sigevent *host_sevp = (struct host_sigevent *) sevp;
-     struct target_sigevent *target_sevp;
- 
-     if (!lock_user_struct(VERIFY_READ, target_sevp, target_addr, 1)) {

From df31de1b11915a435dbbd0e67d995d92a4dff7ba Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 14/37] cross-aarch64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..bd6b23f9fb6a 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From ba65f392a112db5bc7cecb4fd35ee7bac18531c0 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 15/37] cross-aarch64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..427ad2c1e9cd 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 59a493b20bad0120cc5a1798fb85f44a28f20d93 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 16/37] cross-arm-linux-gnueabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..2510ee26e789 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 0b80a8f5d4c4dd9f74988ab4edd8884b4f08214e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 17/37] cross-arm-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..bd8b16e1b4c1 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 65196c47c5a1c9de818f0dfbd474695ecea5bef3 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 18/37] cross-arm-linux-musleabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..dacfd2655216 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 3cf4d8f65b3245e666fbfaa7a578e285e7cf6b11 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 19/37] cross-arm-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..9ddd32a9f20d 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 11cc3e02b8d3f890dd820dd5d9a02402dddeb63e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 20/37] cross-armv7l-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..9fb00f18be3b 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 8d518f8ccfa08b191937743dd6901445954b7975 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 21/37] cross-armv7l-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..2c72e75ddfe3 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 76bb0a8dbeaf0f15620b99a3ddbb98b68f40415e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 22/37] cross-i686-pc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..4dc17df648b5 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From c3b8355053b0e06065a78da75e04abb8a4298b6b Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Fri, 16 Sep 2022 20:52:19 -0700
Subject: [PATCH 23/37] cross-i686-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-linux-musl/template b/srcpkgs/cross-i686-linux-musl/template
index 8be16a230d8d..78b4d813a113 100644
--- a/srcpkgs/cross-i686-linux-musl/template
+++ b/srcpkgs/cross-i686-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-i686-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-i686-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 9fbce5d10f0cfe45a4301653a1a812a0207493db Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 24/37] cross-mips-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..6009e5c79eb2 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 438322391d97dac8f8bbdea2e11d4724eb43d3da Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 25/37] cross-mips-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..080164df193d 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="hipperson0 <hipperson0@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 1ba605ae29202e1b9ff3ed1b7139857f807b2e6a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 26/37] cross-mipsel-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..f9fd4b8a04ef 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 903daa2a7de6934c300e02706eb37fde2e5364ee Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 27/37] cross-mipsel-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..7418a984474b 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From ba8a75730557cc073a0b09bc5685e19e278259d8 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 28/37] cross-powerpc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..31e57b4e52b2 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 25517bbeff2c24dc1298c6c9fd6e5a699bfbc317 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 29/37] cross-powerpc-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..a2d1edcf1ffd 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From d7cdc3412046ec369817b027dc8526b86afd1057 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 30/37] cross-powerpc64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..1a4cbed61e76 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From d4ac316789550977893ac47a4d593296fbccab67 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 31/37] cross-powerpc64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 016f18776a6d..19b1ff859eb6 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 2c392b98794cde59d341d39f5bac00159911c94d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 32/37] cross-powerpc64le-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 463d7e92d20d..9d99a3a315d2 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 2c6cf7851ff984f79e8958526963e44a243577b7 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 33/37] cross-powerpc64le-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index c17a3cccfe29..3128baa7372e 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 2e6ca8a980c86f2e27b7d51637db00be45fa8c42 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 34/37] cross-powerpcle-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 9aede3c465ce..0462a1015a1a 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 
@@ -35,6 +35,8 @@ if [ "$XBPS_TARGET_MACHINE" = "ppcle" ]; then
 	broken="Can't build crosstoolchain to itself"
 fi
 
+broken="glibc uses big-endian specific instructions on 32-bit powerpc"
+
 cross-powerpcle-linux-gnu-libc_package() {
 	short_desc+=" - glibc files"
 	nostrip=yes

From 87cf6d340f7c2f2fb8d9e9440a7a838e2f8d7128 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 35/37] cross-powerpcle-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index 045cfda987fe..20e70bed4c60 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 2663bcfaf9416a2cf3bcab684132561aceb9a7d8 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 36/37] cross-x86_64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 8918f3c22a1c..5219cd50f851 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 3b0197fe8b481f3aadca0603733a75bbf5765430 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 37/37] cross-x86_64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..2811de0d3c2e 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (206 preceding siblings ...)
  2022-10-18 18:03 ` oreo639
@ 2022-10-19  8:14 ` oreo639
  2022-11-05 15:35 ` pwhite1989
                   ` (56 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-10-19  8:14 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5478 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.2.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.2.0

There is a list of failing builds here: https://github.com/void-linux/void-packages/issues/39809

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [x] llvm https://github.com/void-linux/void-packages/pull/38694
- [x] m4 https://github.com/void-linux/void-packages/pull/33730
- [x] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [x] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [x] libvirt https://github.com/void-linux/void-packages/pull/38842
- [x] syslinux https://github.com/void-linux/void-packages/pull/38876
- [x] efivar https://github.com/void-linux/void-packages/pull/38874
- [x] gpgme https://github.com/void-linux/void-packages/pull/38825

Known packages that needed to be fixed/updated for gcc12:
- [ ] linux5.18 (in this PR)
- [x] openssh https://github.com/void-linux/void-packages/pull/38849
- [x] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [x] doxygen https://github.com/void-linux/void-packages/pull/38846
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] libproxy https://github.com/void-linux/void-packages/pull/38818
- [x] exempi https://github.com/void-linux/void-packages/pull/38820
- [x] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [x] libunique1 https://github.com/void-linux/void-packages/pull/38848 or https://github.com/void-linux/void-packages/pull/38873
- [x] libwpd https://github.com/void-linux/void-packages/pull/38878
- [x] cglm https://github.com/void-linux/void-packages/pull/39748
- [x] coreboot-utils https://github.com/void-linux/void-packages/pull/39749
- [x] apl https://github.com/void-linux/void-packages/pull/39750
- [x] igt-gpu-tools https://github.com/void-linux/void-packages/pull/39780

Needs to be fixed/updated for binutils:
- [x] grub https://github.com/void-linux/void-packages/pull/38875
- [x] linux-tools https://github.com/void-linux/void-packages/pull/38877
- [x] kcov https://github.com/void-linux/void-packages/pull/39291

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [x] kde
- [x] lxde
- [x] lxqt

You can test the ISOs here:
https://drive.google.com/drive/folders/1ix92CYSLUP-KWjLxltdgG4e8Nu2JCY5n?usp=sharing

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 133711 bytes --]

From b017393fc87296c750db153ef449e313988459db Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 01:14:21 -0700
Subject: [PATCH 01/37] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../fix-libcollector-without-java.patch       | 53 +++++++++++++++
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 25 ++++---
 4 files changed, 87 insertions(+), 117 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
 create mode 100644 srcpkgs/binutils/patches/fix-libcollector-without-java.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/fix-libcollector-without-java.patch b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
new file mode 100644
index 000000000000..54384875f358
--- /dev/null
+++ b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
@@ -0,0 +1,53 @@
+From 49ddd814ac1071af7c4f45d5f8398b91862f2c7f Mon Sep 17 00:00:00 2001
+From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
+Date: Wed, 17 Aug 2022 19:55:23 -0700
+Subject: [PATCH] gprofng: fix bug 29479 Collection fails when built without
+ java support
+
+gprofng/ChangeLog
+2022-08-17  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>
+
+	PR gprofng/29479
+	* libcollector/collector.c: Add #if defined(GPROFNG_JAVA_PROFILING) for
+	java specific code.
+	* libcollector/unwind.c: Likewise.
+---
+ gprofng/libcollector/collector.c | 2 ++
+ gprofng/libcollector/unwind.c    | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/gprofng/libcollector/collector.c b/gprofng/libcollector/collector.c
+index 93c9d3330de5..ceff2c1caccb 100644
+--- a/gprofng/libcollector/collector.c
++++ b/gprofng/libcollector/collector.c
+@@ -913,8 +913,10 @@ __collector_open_experiment (const char *exp, const char *params, sp_origin_t or
+   __collector_ext_unwind_key_init (1, NULL);
+ 
+   /* start java attach if suitable */
++#if defined(GPROFNG_JAVA_PROFILING)
+   if (exp_origin == SP_ORIGIN_DBX_ATTACH)
+     __collector_jprofile_start_attach ();
++#endif
+   start_sec_time = CALL_UTIL (time)(NULL);
+   __collector_start_time = collector_interface.getHiResTime ();
+   TprintfT (DBG_LT0, "\t__collector_open_experiment; resetting start_time\n");
+diff --git a/gprofng/libcollector/unwind.c b/gprofng/libcollector/unwind.c
+index 119243788020..f8e11823c81e 100644
+--- a/gprofng/libcollector/unwind.c
++++ b/gprofng/libcollector/unwind.c
+@@ -557,6 +557,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+   int size = max_frame_size;
+ 
+ #define MIN(a,b) ((a)<(b)?(a):(b))
++#if defined(GPROFNG_JAVA_PROFILING)
+   /* get Java info */
+   if (__collector_java_mode && __collector_java_asyncgetcalltrace_loaded && context && !pseudo_context)
+     {
+@@ -569,6 +570,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+ 	  size -= sz;
+ 	}
+     }
++#endif
+ 
+   /* get native stack */
+   if (context)
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..c355a5fc8016 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkgconf"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -35,15 +36,21 @@ do_configure() {
 	local conf
 
 	if [ "$CHROOT_READY" ]; then
-		conf+=" --with-debuginfod"
+		conf+=" --with-debuginfod --enable-shared"
 	else
-		conf+=" --without-debuginfod --disable-install-libbfd"
+		conf+=" --without-debuginfod --disable-shared --disable-install-libbfd"
 	fi
 	if [ "$CROSS_BUILD" ]; then
 		# we don't want --with-sysroot=${XBPS_CROSS_BASE} like gnu-configure
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	# gprofng currently only supports x86 and aarch64 glibc.
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64|i386|aarch64) conf+=" --enable-gprofng" ;;
+		*) conf+=" --disable-gprofng" ;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"
@@ -76,13 +83,14 @@ do_configure() {
 		--libdir=/usr/lib \
 		--mandir=/usr/share/man \
 		--infodir=/usr/share/info \
+		--sysconfdir=/etc \
 		--disable-werror \
-		--disable-shared \
 		--disable-nls \
 		--enable-threads \
 		--enable-plugins \
 		--enable-relro \
 		--enable-gold \
+		--enable-new-dtags \
 		--enable-deterministic-archives \
 		--enable-64-bit-bfd \
 		--enable-ld=default \
@@ -142,7 +150,8 @@ binutils-devel_package() {
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/*.a"
-		vmove "usr/lib/*.so"
+		vmove "usr/lib/libbfd.so"
+		vmove "usr/lib/libopcodes.so"
 	}
 }
 

From 476516af9e7eda4bbebdd50a2b0683b2add439f3 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 2 Oct 2022 16:46:59 -0700
Subject: [PATCH 02/37] gdb: resolve conflict with binutils 2.39

---
 srcpkgs/gdb/template | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/gdb/template b/srcpkgs/gdb/template
index ff7c9d9a5911..5970402eb27e 100644
--- a/srcpkgs/gdb/template
+++ b/srcpkgs/gdb/template
@@ -1,7 +1,7 @@
 # Template file for 'gdb'
 pkgname=gdb
 version=12.1
-revision=1
+revision=2
 build_style=gnu-configure
 pycompile_dirs="/usr/share/gdb/python"
 configure_args="--disable-werror --disable-nls --with-system-readline
@@ -48,7 +48,8 @@ vopt_conflict debuginfod static
 
 post_install() {
 	# resolve conflicts with binutils
-	rm -r ${DESTDIR}/usr/{include,lib,share/info/bfd.info*}
+	rm -rf ${DESTDIR}/usr/{include,lib}
+	rm -rf ${DESTDIR}/usr/share/info/{bfd,ctf-spec}.info*
 }
 
 gdb-common_package() {

From 6e1f52a9736ca55cae7832dbb283989448a709a1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:26:59 -0700
Subject: [PATCH 03/37] gcc: update to 12.2.0.

---
 common/shlibs                                 |  10 +-
 srcpkgs/gcc/files/gccgo-musl.patch            |  71 ++-------
 srcpkgs/gcc/files/libgnarl-musl.patch         |  18 +--
 srcpkgs/gcc/files/libssp-musl.patch           |  10 +-
 srcpkgs/gcc/patches/libffi_gnulinux.patch     |  11 --
 .../gcc/patches/libgcc-ibm128-no-tag.patch    |  10 +-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |   2 +-
 srcpkgs/gcc/template                          | 136 +++++++++---------
 8 files changed, 105 insertions(+), 163 deletions(-)
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index ecab4d8f7ecc..5f5f92ef7ed7 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.2.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.36 perl-5.36.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -848,8 +848,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.2.0_1
+libgnat-12.so libada-12.2.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1699,8 +1699,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.2.0_1
+libasan.so.8 libsanitizer-12.2.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..12ec68dd8aa3 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,14 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ b/libgo/go/runtime/os_linux.go
+@@ -365,7 +365,7 @@ func setThreadCPUProfiler(hz int32) {
+ 	var sevp _sigevent
+ 	sevp.sigev_notify = _SIGEV_THREAD_ID
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.__sev_fields))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 09727ef34fb2..5ffd54e466ae 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,37 +3,35 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
+version=12.2.0
+revision=1
+_minorver="${version%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
-wrksrc=gcc-${version/pre/_pre}
+_mpc_version=1.2.1
+_isl_version=0.24
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
+create_wrksrc=yes
+build_wrksrc="gcc-${version}"
+patch_args="-Np1 --directory=${build_wrksrc}"
 lib32disabled=yes
 bootstrap=yes
 replaces="gcc-gcj<7.2.0 gcc-gcj-jdk-compat<7.2.0 libmpx>=0 libmpx-devel>=0"
@@ -52,8 +50,11 @@ if [ "$CHROOT_READY" ]; then
 	hostmakedepends="tar texinfo perl flex"
 else
 	_have_gccgo=no
+	# libzstd fails to link in bootstrap with glibc 2.36
+	# when zlib has been compiled with glibc 2.32.
+	LDFLAGS="-lzstd -pthread"
 fi
-makedepends="zlib-devel"
+makedepends="zlib-devel libzstd-devel"
 depends="binutils libgcc-devel-${version}_${revision}
  libstdc++-devel-${version}_${revision} libssp-devel-${version}_${revision}"
 checkdepends="dejagnu"
@@ -70,13 +71,13 @@ if [ "$build_option_gnatboot" ]; then
 	case "$XBPS_TARGET_MACHINE" in
 	x86_64)
 		_gnat_tarball="gnat-gpl-2017-x86_64-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/591c6d80c7a447af2deed1d7>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/9682e2e1f2f232ce03fe21d77b14c37a0de5649b?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" b942bcac20dea39748b39f8b624d9619f60a8dee2e8195dbe3829c835b0956e6"
 		build_options_default="gnatboot"
 		;;
 	i686)
 		_gnat_tarball="gnat-gpl-2014-x86-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/564b3e9dc8e196b040fbe248>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/c5e9e6fdff5cb77ed90cf8c62536653e27c0bed6?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" 3b693510f5d22a240abb3034934c1adbd80ccd6e4f61a4f491cc408fdfd9c042"
 		build_options_default="gnatboot"
 		;;
@@ -155,25 +156,24 @@ if [ "$CROSS_BUILD" ]; then
 fi
 
 post_extract() {
-	mkdir -p ${wrksrc}/{gmp,mpfr,mpc,isl}
-	cp -ar ${XBPS_BUILDDIR}/gmp-${_gmp_version}/* ${wrksrc}/gmp/
-	cp -ar ${XBPS_BUILDDIR}/mpfr-${_mpfr_version}/* ${wrksrc}/mpfr/
-	cp -ar ${XBPS_BUILDDIR}/mpc-${_mpc_version}/* ${wrksrc}/mpc/
-	cp -ar ${XBPS_BUILDDIR}/isl-${_isl_version}/* ${wrksrc}/isl/
+	ln -s ${wrksrc}/gmp-${_gmp_version} ${wrksrc}/${build_wrksrc}/gmp
+	ln -s ${wrksrc}/mpfr-${_mpfr_version} ${wrksrc}/${build_wrksrc}/mpfr
+	ln -s ${wrksrc}/mpc-${_mpc_version} ${wrksrc}/${build_wrksrc}/mpc
+	ln -s ${wrksrc}/isl-${_isl_version} ${wrksrc}/${build_wrksrc}/isl
 
 	if [ "$build_option_gnatboot" ]; then
 		local f="${XBPS_SRCDISTDIR}/${pkgname}-${version}/${_gnat_tarball}"
 		msg_normal "Extracting ${_gnat_tarball} ...\n"
-		mkdir -p ${wrksrc}/gnat-ins
-		tar -x -f "$f" --strip-components=1 -C ${wrksrc}/gnat-ins
-		cd ${wrksrc}/gnat-ins
-		make ins-all prefix=${wrksrc}/gnat
-		cd ${wrksrc}
-		rm -rf ${wrksrc}/gnat-ins
+		mkdir -p ${wrksrc}/${build_wrksrc}/gnat-ins
+		tar -x -f "$f" --strip-components=1 -C ${wrksrc}/${build_wrksrc}/gnat-ins
+		cd ${wrksrc}/${build_wrksrc}/gnat-ins
+		make ins-all prefix=${wrksrc}/${build_wrksrc}/gnat
+		cd ${wrksrc}/${build_wrksrc}
+		rm -rf ${wrksrc}/${build_wrksrc}/gnat-ins
 
 		# Rename obsolete ld and as
-		find ${wrksrc}/gnat -name ld -exec mv -v {} {}.old \;
-		find ${wrksrc}/gnat -name as -exec mv -v {} {}.old \;
+		find ${wrksrc}/${build_wrksrc}/gnat -name ld -exec mv -v {} {}.old \;
+		find ${wrksrc}/${build_wrksrc}/gnat -name as -exec mv -v {} {}.old \;
 	fi
 }
 
@@ -185,9 +185,9 @@ pre_configure() {
 	sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
 
 	if [ "$XBPS_TARGET_LIBC" = musl ]; then
-		patch -p1 -i ${FILESDIR}/libgnarl-musl.patch
-		patch -p1 -i ${FILESDIR}/libssp-musl.patch
-		patch -p1 -i ${FILESDIR}/gccgo-musl.patch
+		for p in ${FILESDIR}/*-musl.patch; do
+			patch -p1 -i $p
+		done
 	fi
 }
 do_configure() {
@@ -297,19 +297,19 @@ do_configure() {
 		_args+=" --enable-languages=${_langs},ada"
 		_args+=" --enable-libada"
 		CONFIG_SHELL=/bin/bash \
-		CC="${wrksrc}/gnat/bin/gcc" \
-		GNATBIND="${wrksrc}/gnat/bin/gnatbind" \
-		GNATMAKE="${wrksrc}/gnat/bin/gnatmake" \
-		PATH="${wrksrc}/gnat/bin:$PATH" \
-			${wrksrc}/configure ${_args}
+		CC="${wrksrc}/${build_wrksrc}/gnat/bin/gcc" \
+		GNATBIND="${wrksrc}/${build_wrksrc}/gnat/bin/gnatbind" \
+		GNATMAKE="${wrksrc}/${build_wrksrc}/gnat/bin/gnatmake" \
+		PATH="${wrksrc}/${build_wrksrc}/gnat/bin:$PATH" \
+			${wrksrc}/${build_wrksrc}/configure ${_args}
 	elif [ "$build_option_ada" ]; then
 		_args+=" --enable-languages=${_langs},ada"
 		CONFIG_SHELL=/bin/bash \
-			${wrksrc}/configure ${_args}
+			${wrksrc}/${build_wrksrc}/configure ${_args}
 	else
 		_args+=" --enable-languages=${_langs}"
 		CONFIG_SHELL=/bin/bash \
-			${wrksrc}/configure ${_args}
+			${wrksrc}/${build_wrksrc}/configure ${_args}
 	fi
 }
 do_build() {
@@ -318,10 +318,10 @@ do_build() {
 	fi
 	cd build
 	if [ "$build_option_gnatboot" ]; then
-		CC="${wrksrc}/gnat/bin/gcc" \
-		GNATBIND="${wrksrc}/gnat/bin/gnatbind" \
-		GNATMAKE="${wrksrc}/gnat/bin/gnatmake" \
-		PATH="${wrksrc}/gnat/bin:$PATH" \
+		CC="${wrksrc}/${build_wrksrc}/gnat/bin/gcc" \
+		GNATBIND="${wrksrc}/${build_wrksrc}/gnat/bin/gnatbind" \
+		GNATMAKE="${wrksrc}/${build_wrksrc}/gnat/bin/gnatmake" \
+		PATH="${wrksrc}/${build_wrksrc}/gnat/bin:$PATH" \
 		make ${makejobs}
 	else
 		make ${makejobs}
@@ -330,7 +330,7 @@ do_build() {
 pre_install() {
 	if [ "$CROSS_BUILD" ]; then
 		# XXX otherwise links to host libpthread
-		for f in $(find ${wrksrc}/build/${XBPS_CROSS_TRIPLET} -type f -name libtool); do
+		for f in $(find ${wrksrc}/${build_wrksrc}/build/${XBPS_CROSS_TRIPLET} -type f -name libtool); do
 			sed -e "s,add_dir=\"-L\$libdir\",add_dir=\"-L${XBPS_CROSS_BASE}\$libdir\",g" -i $f
 		done
 	fi
@@ -342,16 +342,16 @@ do_install() {
 
 	# Make version a symlink of major version to make all versions
 	# from the same series work automagically.
-	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver} \
+	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${version} \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver}
 	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver} \
-		${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}
+		${DESTDIR}/usr/lib/gcc/${_triplet}/${version}
 
 	# Ditto for c++ headers.
-	mv ${DESTDIR}/usr/include/c++/${_patchver} \
+	mv ${DESTDIR}/usr/include/c++/${version} \
 		${DESTDIR}/usr/include/c++/${_minorver}
 	ln -sfr ${DESTDIR}/usr/include/c++/${_minorver} \
-		${DESTDIR}/usr/include/c++/${_patchver}
+		${DESTDIR}/usr/include/c++/${version}
 
 	# cc symlink
 	ln -sfr ${DESTDIR}/usr/bin/gcc ${DESTDIR}/usr/bin/cc
@@ -360,7 +360,7 @@ do_install() {
 
 	# lto plugin symlink
 	vmkdir usr/lib/bfd-plugins
-	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}/liblto_plugin.so \
+	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${version}/liblto_plugin.so \
 		${DESTDIR}/usr/lib/bfd-plugins
 
 	# Remove "fixed" header
@@ -371,13 +371,9 @@ do_install() {
 	rm -f ${DESTDIR}/usr/lib/libffi*
 	rm -f ${DESTDIR}/usr/share/man/man3/ffi*
 
-	# Remove all python scripts in libdir.
-	rm -f ${DESTDIR}/usr/lib/*.py
-
-	# Remove more python stuff.
-	if [ -d ${DESTDIR}/usr/share/gcc-${_patchver}/python ]; then
-		rm -rf ${DESTDIR}/usr/share/gcc-${_patchver}/python
-	fi
+	# Move libstdc++ gdb helpers to location where gdb can autoload them
+	mkdir -p ${DESTDIR}/usr/share/gdb/auto-load/usr/lib
+	mv ${DESTDIR}/usr/lib/*.py ${DESTDIR}/usr/share/gdb/auto-load/usr/lib
 
 	# Install c89 and c99 wrappers and its manpages, from NetBSD.
 	for f in c89 c99; do
@@ -396,7 +392,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}
@@ -449,7 +445,7 @@ gcc-fortran_package() {
 		if [ "$CROSS_BUILD" ]; then
 			# A number of OMP modules are not built when cross
 			# compiling gcc. Copy them from the cross compiler.
-			local src="/usr/lib/gcc/${_triplet}/${_patchver}/finclude"
+			local src="/usr/lib/gcc/${_triplet}/${version}/finclude"
 			local dst="usr/lib/gcc/${_triplet}/${_minorver}/finclude"
 			for f in omp_lib.f90 omp_lib.h omp_lib.mod omp_lib_kinds.mod \
 				openacc.f90 openacc.mod openacc_kinds.mod openacc_lib.h; do
@@ -516,7 +512,7 @@ libgfortran_package() {
 	short_desc+=" - Fortran library"
 	pkg_install() {
 		vmove "usr/lib/libgfortran.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -537,7 +533,7 @@ libgo_package() {
 	nostrip=yes
 	pkg_install() {
 		vmove "usr/lib/libgo.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -553,7 +549,7 @@ libobjc_package() {
 	short_desc+=" - Objective-C library"
 	pkg_install() {
 		vmove "usr/lib/libobjc.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -572,7 +568,7 @@ libquadmath_package() {
 	short_desc+=" - quadmath library"
 	pkg_install() {
 		vmove "usr/lib/libquadmath.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -614,7 +610,7 @@ libgcc_package() {
 	noverifyrdeps=yes
 	pkg_install() {
 		vmove "usr/lib/libgcc_s.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -645,7 +641,7 @@ libgomp_package() {
 	short_desc+=" - OpenMP v4.0 library"
 	pkg_install() {
 		vmove "usr/lib/libgomp*.so.*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -700,7 +696,7 @@ libssp_package() {
 	short_desc+=" - SSP (StackSmashingProtection) library"
 	pkg_install() {
 		vmove "usr/lib/libssp.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -717,7 +713,9 @@ libstdc++-devel_package() {
 libstdc++_package() {
 	short_desc+=" - Standard C++ Library"
 	pkg_install() {
+		vmove usr/share/gdb
+		vmove usr/share/gcc-${version}/python
 		vmove "usr/lib/libstdc++.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }

From 647ea37a0f9fe733240919fe674344c8a5d8b15b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 06:27:47 -0700
Subject: [PATCH 04/37] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      | 11 ++++--
 2 files changed, 25 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..a4087ec2055e 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,12 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
+
+if [ "$XBPS_TARGET_LIBC" == "musl" ]; then
+	# Musl always searches LD_LIBRARY_PATH before RPATH and RUNPATH
+	make_build_args="lt_cv_shlibpath_overrides_runpath=yes"
+fi
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From 6658211ce5af6ec4cb36d5ca34a7c7cb64bc928b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 17:20:16 -0700
Subject: [PATCH 05/37] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 55255dceae8b..ca2d858a7abc 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From 14e4a2ebb36927c1086ac7645b4c7cdeb7a05900 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 12 Aug 2022 23:31:45 -0700
Subject: [PATCH 06/37] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 ...e-hash-style-both-for-building-glibc.patch |  51 ++++
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 4 files changed, 106 insertions(+), 353 deletions(-)
 create mode 100644 srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index 5f5f92ef7ed7..34624efcb647 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch b/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
new file mode 100644
index 000000000000..9c5553e92609
--- /dev/null
+++ b/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
@@ -0,0 +1,51 @@
+Temporary workaround for EAC bug.
+
+See: https://sourceware.org/bugzilla/show_bug.cgi?id=29456
+
+From 8e90e2cc5e57d7ca3a40602d278e9642a8b66716 Mon Sep 17 00:00:00 2001
+From: oreo639 <oreo6391@gmail.com>
+Date: Tue, 13 Sep 2022 14:30:35 -0700
+Subject: [PATCH] Revert "Do not use --hash-style=both for building glibc
+ shared objects"
+
+This reverts commit e47de5cb2d4dbecb58f569ed241e8e95c568f03c.
+---
+ Makeconfig     |  9 +++++++++
+ Makerules      |  7 +++++++
+ 5 files changed, 61 insertions(+)
+
+diff --git a/Makeconfig b/Makeconfig
+index ba70321af1..e2131d4389 100644
+--- a/Makeconfig
++++ b/Makeconfig
+@@ -371,6 +371,13 @@ dt-relr-ldflag =
+ no-dt-relr-ldflag =
+ endif
+ 
++# For the time being we unconditionally use 'both'.  At some time we
++# should declare statically linked code as 'out of luck' and compile
++# with --hash-style=gnu only.
++hashstyle-LDFLAGS = -Wl,--hash-style=both
++LDFLAGS.so += $(hashstyle-LDFLAGS)
++LDFLAGS-rtld += $(hashstyle-LDFLAGS)
++
+ ifeq (no,$(build-pie-default))
+ pie-default = $(no-pie-ccflag)
+ else # build-pie-default
+diff --git a/Makerules b/Makerules
+index d1e139d03c..44134e37ce 100644
+--- a/Makerules
++++ b/Makerules
+@@ -558,6 +558,9 @@ $(common-objpfx)shlib.lds: $(common-objpfx)config.make $(..)Makerules
+ 		  -Wl,--verbose 2>/dev/null | \
+ 	  sed > $@T \
+ 	      -e '/^=========/,/^=========/!d;/^=========/d' \
++		   -e 's/^.*\.gnu\.hash[ 	]*:.*$$/  .note.ABI-tag : { *(.note.ABI-tag) } &/' \
++		   -e '/^[ 	]*\.hash[ 	]*:.*$$/{h;d;}' \
++		   -e '/DATA_SEGMENT_ALIGN/{H;g}' \
+ 	      -e 's/^.*\*(\.dynbss).*$$/& \
+ 		 PROVIDE(__start___libc_freeres_ptrs = .); \
+ 		 *(__libc_freeres_ptrs) \
+-- 
+2.37.3
+
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From ca029e234596a9690647fabcc0cfc83be3558969 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Wed, 14 Sep 2022 03:48:32 -0700
Subject: [PATCH 07/37] musl: add support for SIGEV_THREAD_ID timers

https://git.musl-libc.org/cgit/musl/commit/?id=7c71792e87691451f2a6b76348e83ad1889f1dcb
---
 ...d-support-for-SIGEV_THREAD_ID-timers.patch | 74 +++++++++++++++++++
 srcpkgs/musl/template                         |  2 +-
 2 files changed, 75 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch

diff --git a/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
new file mode 100644
index 000000000000..e20dff5ba0d4
--- /dev/null
+++ b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
@@ -0,0 +1,74 @@
+From 7c71792e87691451f2a6b76348e83ad1889f1dcb Mon Sep 17 00:00:00 2001
+From: James Y Knight <jyknight@google.com>
+Date: Sun, 30 Jun 2019 21:55:20 -0400
+Subject: [PATCH] add support for SIGEV_THREAD_ID timers
+
+This is like SIGEV_SIGNAL, but targeted to a particular thread's
+tid, rather than the process.
+---
+ include/signal.h        | 16 +++++++++++++---
+ src/time/timer_create.c |  8 ++++++--
+ 2 files changed, 19 insertions(+), 5 deletions(-)
+
+diff --git a/include/signal.h b/include/signal.h
+index fbdf667b2..9ed929e4f 100644
+--- a/include/signal.h
++++ b/include/signal.h
+@@ -180,14 +180,24 @@ struct sigevent {
+ 	union sigval sigev_value;
+ 	int sigev_signo;
+ 	int sigev_notify;
+-	void (*sigev_notify_function)(union sigval);
+-	pthread_attr_t *sigev_notify_attributes;
+-	char __pad[56-3*sizeof(long)];
++	union {
++		char __pad[64 - 2*sizeof(int) - sizeof(union sigval)];
++		pid_t sigev_notify_thread_id;
++		struct {
++			void (*sigev_notify_function)(union sigval);
++			pthread_attr_t *sigev_notify_attributes;
++		} __sev_thread;
++	} __sev_fields;
+ };
+ 
++#define sigev_notify_thread_id __sev_fields.sigev_notify_thread_id
++#define sigev_notify_function __sev_fields.__sev_thread.sigev_notify_function
++#define sigev_notify_attributes __sev_fields.__sev_thread.sigev_notify_attributes
++
+ #define SIGEV_SIGNAL 0
+ #define SIGEV_NONE 1
+ #define SIGEV_THREAD 2
++#define SIGEV_THREAD_ID 4
+ 
+ int __libc_current_sigrtmin(void);
+ int __libc_current_sigrtmax(void);
+diff --git a/src/time/timer_create.c b/src/time/timer_create.c
+index 5ddfda278..4bef23905 100644
+--- a/src/time/timer_create.c
++++ b/src/time/timer_create.c
+@@ -71,11 +71,15 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 	switch (evp ? evp->sigev_notify : SIGEV_SIGNAL) {
+ 	case SIGEV_NONE:
+ 	case SIGEV_SIGNAL:
++	case SIGEV_THREAD_ID:
+ 		if (evp) {
+ 			ksev.sigev_value = evp->sigev_value;
+ 			ksev.sigev_signo = evp->sigev_signo;
+ 			ksev.sigev_notify = evp->sigev_notify;
+-			ksev.sigev_tid = 0;
++			if (evp->sigev_notify == SIGEV_THREAD_ID)
++				ksev.sigev_tid = evp->sigev_notify_thread_id;
++			else
++				ksev.sigev_tid = 0;
+ 			ksevp = &ksev;
+ 		}
+ 		if (syscall(SYS_timer_create, clk, ksevp, &timerid) < 0)
+@@ -107,7 +111,7 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 
+ 		ksev.sigev_value.sival_ptr = 0;
+ 		ksev.sigev_signo = SIGTIMER;
+-		ksev.sigev_notify = 4; /* SIGEV_THREAD_ID */
++		ksev.sigev_notify = SIGEV_THREAD_ID;
+ 		ksev.sigev_tid = td->tid;
+ 		if (syscall(SYS_timer_create, clk, &ksev, &timerid) < 0)
+ 			timerid = -1;
diff --git a/srcpkgs/musl/template b/srcpkgs/musl/template
index 5bdc5c48e623..34e6ed4fba6e 100644
--- a/srcpkgs/musl/template
+++ b/srcpkgs/musl/template
@@ -2,7 +2,7 @@
 pkgname=musl
 reverts="1.2.0_1"
 version=1.1.24
-revision=10
+revision=11
 archs="*-musl"
 bootstrap=yes
 build_style=gnu-configure

From 6ba7b166a49fc3514073ca4850240202545ba66b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Mon, 22 Aug 2022 21:01:43 -0700
Subject: [PATCH 08/37] gcc-multilib: update to 12.2.0.

---
 srcpkgs/gcc-multilib/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index fcd25755aa75..df60849babc2 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,16 +3,16 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _majorver="${version%.*}"
-wrksrc=gcc-${version/pre/_pre}
+wrksrc="gcc-${version}"
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel
@@ -71,7 +71,7 @@ do_build() {
 	make ${makejobs}
 }
 do_install() {
-	local _pc_triplet=x86_64-pc-linux-gnu _version=${version%pre1}
+	local _pc_triplet=x86_64-pc-linux-gnu
 	# Install to a tempdir and then only copy relevant files.
 	cd ${wrksrc}
 	make DESTDIR=${wrksrc}/${pkgname}-build install
@@ -81,9 +81,9 @@ do_install() {
 	vmkdir usr/include/c++/${_majorver}/${_triplet}
 	vmkdir usr/lib/gcc/${_triplet}/${_majorver}
 
-	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${_version}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${version}/32 \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_majorver}/
-	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${_version}/${_pc_triplet}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${version}/${_pc_triplet}/32 \
 		${DESTDIR}/usr/include/c++/${_majorver}/${_triplet}
 
 	vinstall ${wrksrc}/host-${_pc_triplet}/gcc/specs 644 usr/lib/gcc/${_triplet}/${_majorver}

From 018a1d81e430f81cb45df44a005b790c971bc839 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Tue, 4 Oct 2022 03:49:13 -0700
Subject: [PATCH 09/37] libgccjit: update to 12.2.0.

---
 srcpkgs/libgccjit/files/libgccjit-musl.patch | 63 --------------------
 srcpkgs/libgccjit/template                   | 38 ++++++------
 2 files changed, 17 insertions(+), 84 deletions(-)
 delete mode 100644 srcpkgs/libgccjit/files/libgccjit-musl.patch

diff --git a/srcpkgs/libgccjit/files/libgccjit-musl.patch b/srcpkgs/libgccjit/files/libgccjit-musl.patch
deleted file mode 100644
index d2ed16928c82..000000000000
--- a/srcpkgs/libgccjit/files/libgccjit-musl.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-diff --git a/gcc/jit/jit-playback.c b/gcc/jit/jit-playback.c
-index 5bccf591a..35f5e35ef 100644
---- a/gcc/jit/jit-playback.c
-+++ b/gcc/jit/jit-playback.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -41,8 +43,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "diagnostic.h"
- #include "stmt.h"
- 
--#include <pthread.h>
--
- #include "jit-playback.h"
- #include "jit-result.h"
- #include "jit-builtins.h"
-diff --git a/gcc/jit/jit-recording.c b/gcc/jit/jit-recording.c
-index a237d574f..5785e3269 100644
---- a/gcc/jit/jit-recording.c
-+++ b/gcc/jit/jit-recording.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -25,8 +27,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "pretty-print.h"
- #include "toplev.h"
- 
--#include <pthread.h>
--
- #include "jit-builtins.h"
- #include "jit-recording.h"
- #include "jit-playback.h"
-diff --git a/gcc/jit/libgccjit.c b/gcc/jit/libgccjit.c
-index f9c33c63c..75f21d275 100644
---- a/gcc/jit/libgccjit.c
-+++ b/gcc/jit/libgccjit.c
-@@ -18,13 +18,13 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
- #include "timevar.h"
- #include "typed-splay-tree.h"
- #include "cppbuiltin.h"
--#include <pthread.h>
- 
- #include "libgccjit.h"
- #include "jit-recording.h"
diff --git a/srcpkgs/libgccjit/template b/srcpkgs/libgccjit/template
index 6f1d6256dcd6..b5d4540ce667 100644
--- a/srcpkgs/libgccjit/template
+++ b/srcpkgs/libgccjit/template
@@ -3,36 +3,32 @@
 # which use the version number.
 
 pkgname=libgccjit
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
+version=12.2.0
 revision=1
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
-_majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
-wrksrc=gcc-${version/pre/_pre}
+_mpc_version=1.2.1
+_isl_version=0.24
 short_desc="Just-In-Time Compilation library for GCC"
 maintainer="Lane Biocini <lane@mailbox.org>"
 homepage="https://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 nopie=yes
+create_wrksrc=yes
+build_wrksrc="gcc-${version}"
+patch_args="-Np1 --directory=${build_wrksrc}"
 lib32disabled=yes
 makedepends="zlib-devel"
 hostmakedepends="tar texinfo perl flex"
@@ -40,10 +36,10 @@ depends="gcc"
 checkdepends="dejagnu"
 
 post_extract() {
-	mv ${XBPS_BUILDDIR}/gmp-${_gmp_version} ${wrksrc}/gmp
-	mv ${XBPS_BUILDDIR}/mpfr-${_mpfr_version} ${wrksrc}/mpfr
-	mv ${XBPS_BUILDDIR}/mpc-${_mpc_version} ${wrksrc}/mpc
-	mv ${XBPS_BUILDDIR}/isl-${_isl_version} ${wrksrc}/isl
+	ln -s ${wrksrc}/gmp-${_gmp_version} ${wrksrc}/${build_wrksrc}/gmp
+	ln -s ${wrksrc}/mpfr-${_mpfr_version} ${wrksrc}/${build_wrksrc}/mpfr
+	ln -s ${wrksrc}/mpc-${_mpc_version} ${wrksrc}/${build_wrksrc}/mpc
+	ln -s ${wrksrc}/isl-${_isl_version} ${wrksrc}/${build_wrksrc}/isl
 }
 
 pre_configure() {
@@ -186,7 +182,7 @@ do_configure() {
 	[ -z "$XBPS_CHECK_PKGS" ] && _langs="jit" || _langs="jit,c++"
 	_args+=" --enable-languages=${_langs}"
 	CONFIG_SHELL=/bin/bash \
-		${wrksrc}/configure ${_args}
+		${wrksrc}/${build_wrksrc}/configure ${_args}
 }
 
 do_build() {

From f7e1edc231f35b3320c013ee86848185458184be Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sun, 14 Aug 2022 19:29:36 -0700
Subject: [PATCH 10/37] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove -no-pie from build. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..5d40f0cdd8a6 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -53,6 +53,7 @@ _void_cross_build_binutils() {
 		--sbindir=/usr/bin \
 		--libdir=/usr/lib \
 		--libexecdir=/usr/lib \
+		--sysconfdir=/etc \
 		--target=${tgt} \
 		--with-sysroot=/usr/${tgt} \
 		--disable-nls \
@@ -60,7 +61,9 @@ _void_cross_build_binutils() {
 		--disable-multilib \
 		--disable-werror \
 		--disable-gold \
+		--disable-gprofng \
 		--enable-relro \
+		--enable-new-dtags \
 		--enable-plugins \
 		--enable-64-bit-bfd \
 		--enable-deterministic-archives \
@@ -132,6 +135,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -460,6 +464,14 @@ do_build() {
 	local binutils_ver linux_ver gcc_ver libc_ver libucontext_ver
 	local tgt=${sourcepkg/cross-}
 
+	export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}"
+	export CXXFLAGS="${CXXFLAGS/-D_FORTIFY_SOURCE=2/}"
+
+	# Disable explicit -fno-PIE, gcc/binutils/libc will figure this out itself.
+	export CFLAGS="${CFLAGS//-fno-PIE/}"
+	export CXXFLAGS="${CXXFLAGS//-fno-PIE/}"
+	export LDFLAGS="${LDFLAGS//-no-pie/}"
+
 	_void_cross_test_ver binutils
 	_void_cross_test_ver linux
 	_void_cross_test_ver gcc
@@ -625,6 +637,9 @@ do_install() {
 	# then remove it because it conflicts with libquadmath package
 	rm -rf ${DESTDIR}/${sysroot}/usr/lib/libquadmath.*
 
+	# Remove libdep linker plugin because it conflicts with system binutils
+	rm -f ${DESTDIR}/usr/lib/bfd-plugins/libdep*
+
 	# Remove leftover symlinks
 	rm -f ${DESTDIR}/usr/lib${XBPS_TARGET_WORDSIZE}
 	rm -f ${DESTDIR}/lib*

From 65d33dc05362dfb8d077465ba6ce98a17811f1dc Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:08 -0700
Subject: [PATCH 11/37] subversion: fix build for libtool 2.4.7

---
 srcpkgs/subversion/template | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/subversion/template b/srcpkgs/subversion/template
index 18c35e3a2132..0aa41212c5fd 100644
--- a/srcpkgs/subversion/template
+++ b/srcpkgs/subversion/template
@@ -24,6 +24,8 @@ distfiles="http://apache.uvigo.es/subversion/subversion-${version}.tar.bz2"
 checksum=c9130e8d0b75728a66f0e7038fc77052e671830d785b5616aad53b4810d3cc28
 
 pre_configure() {
+	./autogen.sh --release
+
 	# Based on native build values
 	cat <<-EOF >config.cache
 	ac_cv_python_includes=-I${XBPS_CROSS_BASE}/usr/include/python${py3_ver}
@@ -59,7 +61,12 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+
+	if [ "$XBPS_BUILD_ENVIRONMENT" = "void-packages-ci" ]; then
+		# This test will fail when run as the root user,
+		# because flock() will ignore file permissions.
+		vsed -i subversion/tests/libsvn_fs/locks-test.c -e '/SVN_TEST_OPTS_PASS(obtain_write_lock_failure,/,+3d'
+	fi
 }
 
 post_configure() {

From dd59e9103ca3e05a7154a8b110a8a91acef40b12 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Sat, 20 Aug 2022 15:50:38 -0700
Subject: [PATCH 12/37] subversion-kwallet-auth: update to 1.14.2.

Fix failing distfiles.
Fix build for libtool 2.4.7
---
 srcpkgs/subversion-kwallet-auth/template | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/subversion-kwallet-auth/template b/srcpkgs/subversion-kwallet-auth/template
index 12210f250d51..9cc68c3fe5f1 100644
--- a/srcpkgs/subversion-kwallet-auth/template
+++ b/srcpkgs/subversion-kwallet-auth/template
@@ -3,7 +3,7 @@
 # THIS PKG MUST BE SYNCHRONIZED WITH "srcpkgs/subversion".
 #
 pkgname=subversion-kwallet-auth
-version=1.14.1
+version=1.14.2
 revision=1
 wrksrc="subversion-${version}"
 build_style=gnu-configure
@@ -22,10 +22,12 @@ license="Apache-2.0, BSD-3-Clause"
 homepage="http://subversion.apache.org/"
 changelog="https://subversion.apache.org/docs/release-notes/${version%.*}.html"
 distfiles="http://apache.uvigo.es/subversion/subversion-${version}.tar.bz2"
-checksum=2c5da93c255d2e5569fa91d92457fdb65396b0666fad4fd59b22e154d986e1a9
+checksum=c9130e8d0b75728a66f0e7038fc77052e671830d785b5616aad53b4810d3cc28
 lib32disabled=yes
 
 pre_configure() {
+	./autogen.sh --release
+
 	# Based on native build values
 	cat <<-EOF >config.cache
 	ac_cv_python_includes=-I${XBPS_CROSS_BASE}/usr/include/python${py3_ver}
@@ -55,11 +57,18 @@ pre_configure() {
 		cp "$XBPS_CROSS_BASE/usr/lib/perl5/core_perl/Config"*.p? $PERL5LIB
 		cp "$XBPS_CROSS_BASE/usr/lib/perl5/core_perl/Errno.pm" $PERL5LIB
 		vsed -e "s;archlibexp => '\(.*\)';archlibexp => '${XBPS_CROSS_BASE}\1';" \
-			-i $PERL5LIB/Config.pm $PERL5LIB/Config_heavy.pl
+			-i $PERL5LIB/Config.pm
+		vsed -e "s;archlibexp='\(.*\)';archlibexp='${XBPS_CROSS_BASE}\1';" \
+			-i $PERL5LIB/Config_heavy.pl
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+
+	if [ "$XBPS_BUILD_ENVIRONMENT" = "void-packages-ci" ]; then
+		# This test will fail when run as the root user,
+		# because flock() will ignore file permissions.
+		vsed -i subversion/tests/libsvn_fs/locks-test.c -e '/SVN_TEST_OPTS_PASS(obtain_write_lock_failure,/,+3d'
+	fi
 }
 
 post_configure() {

From 1b9e9ba1e27d1f102b5a1cd120cd22b4688284ba Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 15 Oct 2022 03:39:40 -0700
Subject: [PATCH 13/37] qemu: remove broken patch

The necessary patch has been imported into musl so no need
to cast the sigevent struct to a more glibc-like one.
---
 .../musl-fix-sigevent-and-sigval_t.patch      | 27 -------------------
 1 file changed, 27 deletions(-)
 delete mode 100644 srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch

diff --git a/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch b/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch
deleted file mode 100644
index 4b4f1117c15f..000000000000
--- a/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-Note: Remove this patch with musl 1.2.2
-
---- a/linux-user/syscall.c
-+++ b/linux-user/syscall.c
-@@ -5020,10 +5020,21 @@
- #ifndef HAVE_SIGEV_NOTIFY_THREAD_ID
- #define sigev_notify_thread_id _sigev_un._tid
- #endif
- 
--static inline abi_long target_to_host_sigevent(struct sigevent *host_sevp,
-+struct host_sigevent {
-+    union sigval sigev_value;
-+    int sigev_signo;
-+    int sigev_notify;
-+    union {
-+       char _pad[64 - sizeof(int) * 2 - sizeof(union sigval)];
-+       int _tid;
-+    } _sigev_un;
-+};
-+
-+static inline abi_long target_to_host_sigevent(struct sigevent *sevp,
-                                                abi_ulong target_addr)
- {
-+    struct host_sigevent *host_sevp = (struct host_sigevent *) sevp;
-     struct target_sigevent *target_sevp;
- 
-     if (!lock_user_struct(VERIFY_READ, target_sevp, target_addr, 1)) {

From ff17212d58162e37648189f17f08e1bd48316a0f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 14/37] cross-aarch64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..bd6b23f9fb6a 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From a9a9613b224bf9addd0ad931c59ab183d426f7fc Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 15/37] cross-aarch64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..427ad2c1e9cd 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 31b08ff3910b9d051520cf0f7ac6304dd120fd42 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 16/37] cross-arm-linux-gnueabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..2510ee26e789 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 9efe91ee61422435c947d3f873d482c73ad422eb Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 17/37] cross-arm-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..bd8b16e1b4c1 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From c01a84060d806ab2b46cd5b3c5f4c5546e8611e3 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 18/37] cross-arm-linux-musleabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..dacfd2655216 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 2ac854b49bf4a141945ba4bf11643303cb491c5f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 19/37] cross-arm-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..9ddd32a9f20d 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 66c9cbd38a230f8d21e4f26936a4c51f31f54797 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 20/37] cross-armv7l-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..9fb00f18be3b 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From bfed7842097032b63376eb208d3377147a13f915 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 21/37] cross-armv7l-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..2c72e75ddfe3 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From ee44b93984d3d2a55778bac056a251595cb52de7 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 22/37] cross-i686-pc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..4dc17df648b5 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 9add13d201cfc31f3f9ca710b5207496c66d23f0 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Fri, 16 Sep 2022 20:52:19 -0700
Subject: [PATCH 23/37] cross-i686-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-linux-musl/template b/srcpkgs/cross-i686-linux-musl/template
index 8be16a230d8d..78b4d813a113 100644
--- a/srcpkgs/cross-i686-linux-musl/template
+++ b/srcpkgs/cross-i686-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-i686-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-i686-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From f3e759916b69e155cab8cf8f4e85118a45fb6b29 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 24/37] cross-mips-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..6009e5c79eb2 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 3c8001c5ece2e4d1bb10a32af09ad24688ec2ca4 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 25/37] cross-mips-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..080164df193d 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="hipperson0 <hipperson0@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 9ca8384b91a31a24788881a701a5231e76558951 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 26/37] cross-mipsel-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..f9fd4b8a04ef 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 6ba00cb06040dc69131ec894467b3ac0a2099214 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 27/37] cross-mipsel-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..7418a984474b 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From bd81e4aa7d0c0063c9beb127862b743f0ef720b1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 28/37] cross-powerpc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..31e57b4e52b2 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 054b6a89e1eb9694400c57277dace67a57720bcc Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:15 -0700
Subject: [PATCH 29/37] cross-powerpc-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..a2d1edcf1ffd 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From b48fe7d02a13506ac2b5739078e279e77490c0f3 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 30/37] cross-powerpc64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..1a4cbed61e76 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 4af94e7c62fbd830308f7eb91c6d20c0f146fa10 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 31/37] cross-powerpc64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 016f18776a6d..19b1ff859eb6 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From dd10966c1d60cef070b3037a7108cbde55100fae Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 32/37] cross-powerpc64le-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 463d7e92d20d..9d99a3a315d2 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 5d7d89c4dac263b1e8730de9a30b9761acdcd40b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 33/37] cross-powerpc64le-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index c17a3cccfe29..3128baa7372e 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From a19eb67ce691a1aa438c08c49e514d46a74784fd Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 34/37] cross-powerpcle-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 9aede3c465ce..0462a1015a1a 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 
@@ -35,6 +35,8 @@ if [ "$XBPS_TARGET_MACHINE" = "ppcle" ]; then
 	broken="Can't build crosstoolchain to itself"
 fi
 
+broken="glibc uses big-endian specific instructions on 32-bit powerpc"
+
 cross-powerpcle-linux-gnu-libc_package() {
 	short_desc+=" - glibc files"
 	nostrip=yes

From 130b7fa3d56c5530bb459ccbffa2a6de56458fc5 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 35/37] cross-powerpcle-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index 045cfda987fe..20e70bed4c60 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 0e6476ccfbe9c9f659b2a0475178d2c5069fc607 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 36/37] cross-x86_64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 8918f3c22a1c..5219cd50f851 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From c175bfc9e553eb67ac6cefbc9a000d016033d50d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:31:16 -0700
Subject: [PATCH 37/37] cross-x86_64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..2811de0d3c2e 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (207 preceding siblings ...)
  2022-10-19  8:14 ` oreo639
@ 2022-11-05 15:35 ` pwhite1989
  2022-11-05 15:36 ` pwhite1989
                   ` (55 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: pwhite1989 @ 2022-11-05 15:35 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1238 bytes --]

New comment by pwhite1989 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1304569062

Comment:
Hey just fetched the pr to try on my fresh void install (terminal only) and came across errors. Will have to manually type as I can't copy/paste:

First fetched the pr and ran `./xbps-src binary-bootstrap`
Then ran `./xbps-src pkg gcc`

This ran for a few hours, but failed with the following messages:
`make[4]: *** No rule to make target '../libbacktrace/libbacktrace.la', needed by 'libgo.la'. Stop.
make[4]: Leaving directory '/builddir/gcc-12.2.0/gcc-12.2.0/build/x86_64-unknown-linux-gnu/libgo'
make[3]: *** [Makefile:2338: all-recursive] Error 1
make[3]: Leaving directory '/builddir/gcc-12.2.0/gcc-12.2.0/build/x86_64-unknown-linux-gnu/libgo'
make[2]: *** [Makefile:1209: all] Error 2
make[2]: Leaving directory '/builddir/gcc-12.2.0/gcc-12.2.0/build/x86_64-unknown-linux-gnu/libgo'
make[1]: *** [Makefile:27788: all-target-libgo] Error 2
make[1]: Leaving directory '/builddir/gcc-12.2.0/gcc-12.2.0/build'
make: *** [Makefile:1083: all] Error 2
=> ERROR: gcc-12.2.0_1: do_build: 'make ${makejobs}' exited with 2
=> ERROR:    in do_build() at srcpkgs/gcc/template:327`


^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (208 preceding siblings ...)
  2022-11-05 15:35 ` pwhite1989
@ 2022-11-05 15:36 ` pwhite1989
  2022-11-05 15:39 ` paper42
                   ` (54 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: pwhite1989 @ 2022-11-05 15:36 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1262 bytes --]

New comment by pwhite1989 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1304569062

Comment:
Hey just fetched the pr to try on my fresh void install (terminal only) and came across errors. Will have to manually type as I can't copy/paste:

First fetched the pr and ran `./xbps-src binary-bootstrap`
Then ran `./xbps-src pkg gcc`

This ran for a few hours, but failed with the following messages:
```make[4]: *** No rule to make target '../libbacktrace/libbacktrace.la', needed by 'libgo.la'. Stop.

make[4]: Leaving directory '/builddir/gcc-12.2.0/gcc-12.2.0/build/x86_64-unknown-linux-gnu/libgo'

make[3]: *** [Makefile:2338: all-recursive] Error 1

make[3]: Leaving directory '/builddir/gcc-12.2.0/gcc-12.2.0/build/x86_64-unknown-linux-gnu/libgo'

make[2]: *** [Makefile:1209: all] Error 2

make[2]: Leaving directory '/builddir/gcc-12.2.0/gcc-12.2.0/build/x86_64-unknown-linux-gnu/libgo'

make[1]: *** [Makefile:27788: all-target-libgo] Error 2

make[1]: Leaving directory '/builddir/gcc-12.2.0/gcc-12.2.0/build'

make: *** [Makefile:1083: all] Error 2

=> ERROR: gcc-12.2.0_1: do_build: 'make ${makejobs}' exited with 2

=> ERROR:    in do_build() at srcpkgs/gcc/template:327```


^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (209 preceding siblings ...)
  2022-11-05 15:36 ` pwhite1989
@ 2022-11-05 15:39 ` paper42
  2022-11-05 18:38 ` [PR PATCH] [Updated] " oreo639
                   ` (53 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: paper42 @ 2022-11-05 15:39 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 400 bytes --]

New comment by paper42 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1304569698

Comment:
That's not showing any errors, they are before that. This PR is outdated and should be rebased before you try to build gcc and you probably want to set XBPS_MAKEJOBS in the config or add `-j<num>` to the command to make sure you are using more than one core.

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (210 preceding siblings ...)
  2022-11-05 15:39 ` paper42
@ 2022-11-05 18:38 ` oreo639
  2022-11-06 15:10 ` pwhite1989
                   ` (52 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-11-05 18:38 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5448 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.2.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.2.0

There is a list of failing builds here: https://github.com/void-linux/void-packages/issues/39809

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [x] llvm https://github.com/void-linux/void-packages/pull/38694
- [x] m4 https://github.com/void-linux/void-packages/pull/33730
- [x] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [x] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [x] libvirt https://github.com/void-linux/void-packages/pull/38842
- [x] syslinux https://github.com/void-linux/void-packages/pull/38876
- [x] efivar https://github.com/void-linux/void-packages/pull/38874
- [x] gpgme https://github.com/void-linux/void-packages/pull/38825

Known packages that needed to be fixed/updated for gcc12:
- [x] openssh https://github.com/void-linux/void-packages/pull/38849
- [x] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [x] doxygen https://github.com/void-linux/void-packages/pull/38846
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] libproxy https://github.com/void-linux/void-packages/pull/38818
- [x] exempi https://github.com/void-linux/void-packages/pull/38820
- [x] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [x] libunique1 https://github.com/void-linux/void-packages/pull/38848 or https://github.com/void-linux/void-packages/pull/38873
- [x] libwpd https://github.com/void-linux/void-packages/pull/38878
- [x] cglm https://github.com/void-linux/void-packages/pull/39748
- [x] coreboot-utils https://github.com/void-linux/void-packages/pull/39749
- [x] apl https://github.com/void-linux/void-packages/pull/39750
- [x] igt-gpu-tools https://github.com/void-linux/void-packages/pull/39780

Needs to be fixed/updated for binutils:
- [x] grub https://github.com/void-linux/void-packages/pull/38875
- [x] linux-tools https://github.com/void-linux/void-packages/pull/38877
- [x] kcov https://github.com/void-linux/void-packages/pull/39291

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [x] kde
- [x] lxde
- [x] lxqt

You can test the ISOs here:
https://drive.google.com/drive/folders/1ix92CYSLUP-KWjLxltdgG4e8Nu2JCY5n?usp=sharing

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 127813 bytes --]

From f7a2db222a1f6603061cf183780256e121449c66 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 01/37] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../fix-libcollector-without-java.patch       | 53 +++++++++++++++
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 25 ++++---
 4 files changed, 87 insertions(+), 117 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
 create mode 100644 srcpkgs/binutils/patches/fix-libcollector-without-java.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/fix-libcollector-without-java.patch b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
new file mode 100644
index 000000000000..54384875f358
--- /dev/null
+++ b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
@@ -0,0 +1,53 @@
+From 49ddd814ac1071af7c4f45d5f8398b91862f2c7f Mon Sep 17 00:00:00 2001
+From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
+Date: Wed, 17 Aug 2022 19:55:23 -0700
+Subject: [PATCH] gprofng: fix bug 29479 Collection fails when built without
+ java support
+
+gprofng/ChangeLog
+2022-08-17  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>
+
+	PR gprofng/29479
+	* libcollector/collector.c: Add #if defined(GPROFNG_JAVA_PROFILING) for
+	java specific code.
+	* libcollector/unwind.c: Likewise.
+---
+ gprofng/libcollector/collector.c | 2 ++
+ gprofng/libcollector/unwind.c    | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/gprofng/libcollector/collector.c b/gprofng/libcollector/collector.c
+index 93c9d3330de5..ceff2c1caccb 100644
+--- a/gprofng/libcollector/collector.c
++++ b/gprofng/libcollector/collector.c
+@@ -913,8 +913,10 @@ __collector_open_experiment (const char *exp, const char *params, sp_origin_t or
+   __collector_ext_unwind_key_init (1, NULL);
+ 
+   /* start java attach if suitable */
++#if defined(GPROFNG_JAVA_PROFILING)
+   if (exp_origin == SP_ORIGIN_DBX_ATTACH)
+     __collector_jprofile_start_attach ();
++#endif
+   start_sec_time = CALL_UTIL (time)(NULL);
+   __collector_start_time = collector_interface.getHiResTime ();
+   TprintfT (DBG_LT0, "\t__collector_open_experiment; resetting start_time\n");
+diff --git a/gprofng/libcollector/unwind.c b/gprofng/libcollector/unwind.c
+index 119243788020..f8e11823c81e 100644
+--- a/gprofng/libcollector/unwind.c
++++ b/gprofng/libcollector/unwind.c
+@@ -557,6 +557,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+   int size = max_frame_size;
+ 
+ #define MIN(a,b) ((a)<(b)?(a):(b))
++#if defined(GPROFNG_JAVA_PROFILING)
+   /* get Java info */
+   if (__collector_java_mode && __collector_java_asyncgetcalltrace_loaded && context && !pseudo_context)
+     {
+@@ -569,6 +570,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+ 	  size -= sz;
+ 	}
+     }
++#endif
+ 
+   /* get native stack */
+   if (context)
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..c355a5fc8016 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkgconf"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -35,15 +36,21 @@ do_configure() {
 	local conf
 
 	if [ "$CHROOT_READY" ]; then
-		conf+=" --with-debuginfod"
+		conf+=" --with-debuginfod --enable-shared"
 	else
-		conf+=" --without-debuginfod --disable-install-libbfd"
+		conf+=" --without-debuginfod --disable-shared --disable-install-libbfd"
 	fi
 	if [ "$CROSS_BUILD" ]; then
 		# we don't want --with-sysroot=${XBPS_CROSS_BASE} like gnu-configure
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	# gprofng currently only supports x86 and aarch64 glibc.
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64|i386|aarch64) conf+=" --enable-gprofng" ;;
+		*) conf+=" --disable-gprofng" ;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"
@@ -76,13 +83,14 @@ do_configure() {
 		--libdir=/usr/lib \
 		--mandir=/usr/share/man \
 		--infodir=/usr/share/info \
+		--sysconfdir=/etc \
 		--disable-werror \
-		--disable-shared \
 		--disable-nls \
 		--enable-threads \
 		--enable-plugins \
 		--enable-relro \
 		--enable-gold \
+		--enable-new-dtags \
 		--enable-deterministic-archives \
 		--enable-64-bit-bfd \
 		--enable-ld=default \
@@ -142,7 +150,8 @@ binutils-devel_package() {
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/*.a"
-		vmove "usr/lib/*.so"
+		vmove "usr/lib/libbfd.so"
+		vmove "usr/lib/libopcodes.so"
 	}
 }
 

From fe6f7982aa82bfb1c109b858255088c296eb31bc Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 02/37] gdb: resolve conflict with binutils 2.39

---
 srcpkgs/gdb/template | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/gdb/template b/srcpkgs/gdb/template
index 9c5f17ffc519..5970402eb27e 100644
--- a/srcpkgs/gdb/template
+++ b/srcpkgs/gdb/template
@@ -48,7 +48,8 @@ vopt_conflict debuginfod static
 
 post_install() {
 	# resolve conflicts with binutils
-	rm -r ${DESTDIR}/usr/{include,lib,share/info/bfd.info*}
+	rm -rf ${DESTDIR}/usr/{include,lib}
+	rm -rf ${DESTDIR}/usr/share/info/{bfd,ctf-spec}.info*
 }
 
 gdb-common_package() {

From 650676defc26fd536bd676a4c2af3e80f996dba3 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 03/37] gcc: update to 12.2.0.

---
 common/shlibs                                 | 10 +--
 srcpkgs/gcc/files/gccgo-musl.patch            | 71 +++------------
 srcpkgs/gcc/files/libgnarl-musl.patch         | 18 ++--
 srcpkgs/gcc/files/libssp-musl.patch           | 10 +--
 srcpkgs/gcc/patches/libffi_gnulinux.patch     | 11 ---
 .../gcc/patches/libgcc-ibm128-no-tag.patch    | 10 ++-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |  2 +-
 srcpkgs/gcc/template                          | 87 +++++++++----------
 8 files changed, 80 insertions(+), 139 deletions(-)
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index 5136df346db0..116561080072 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.2.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.36 perl-5.36.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -858,8 +858,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.2.0_1
+libgnat-12.so libada-12.2.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1711,8 +1711,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.2.0_1
+libasan.so.8 libsanitizer-12.2.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..12ec68dd8aa3 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,14 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ b/libgo/go/runtime/os_linux.go
+@@ -365,7 +365,7 @@ func setThreadCPUProfiler(hz int32) {
+ 	var sevp _sigevent
+ 	sevp.sigev_notify = _SIGEV_THREAD_ID
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.__sev_fields))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index ab3643de4f98..a20af7c0ef2e 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,14 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
+version=12.2.0
+revision=1
+_minorver="${version%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 create_wrksrc=yes
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +18,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -52,8 +48,11 @@ if [ "$CHROOT_READY" ]; then
 	hostmakedepends="tar texinfo perl flex"
 else
 	_have_gccgo=no
+	# libzstd fails to link in bootstrap with glibc 2.36
+	# when zlib has been compiled with glibc 2.32.
+	LDFLAGS="-lzstd -pthread"
 fi
-makedepends="zlib-devel"
+makedepends="zlib-devel libzstd-devel"
 depends="binutils libgcc-devel-${version}_${revision}
  libstdc++-devel-${version}_${revision} libssp-devel-${version}_${revision}"
 checkdepends="dejagnu"
@@ -70,13 +69,13 @@ if [ "$build_option_gnatboot" ]; then
 	case "$XBPS_TARGET_MACHINE" in
 	x86_64)
 		_gnat_tarball="gnat-gpl-2017-x86_64-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/591c6d80c7a447af2deed1d7>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/9682e2e1f2f232ce03fe21d77b14c37a0de5649b?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" b942bcac20dea39748b39f8b624d9619f60a8dee2e8195dbe3829c835b0956e6"
 		build_options_default="gnatboot"
 		;;
 	i686)
 		_gnat_tarball="gnat-gpl-2014-x86-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/564b3e9dc8e196b040fbe248>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/c5e9e6fdff5cb77ed90cf8c62536653e27c0bed6?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" 3b693510f5d22a240abb3034934c1adbd80ccd6e4f61a4f491cc408fdfd9c042"
 		build_options_default="gnatboot"
 		;;
@@ -155,8 +154,8 @@ if [ "$CROSS_BUILD" ]; then
 fi
 
 post_extract() {
-	mv gcc-${version/pre/_pre}/* gcc-${version/pre/_pre}/.??* .
-	rmdir gcc-${version/pre/_pre}
+	mv gcc-${version}/* gcc-${version}/.??* .
+	rmdir gcc-${version}
 	mv gmp-${_gmp_version} gmp
 	mv mpfr-${_mpfr_version} mpfr
 	mv mpc-${_mpc_version} mpc
@@ -186,9 +185,9 @@ pre_configure() {
 	sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
 
 	if [ "$XBPS_TARGET_LIBC" = musl ]; then
-		patch -p1 -i ${FILESDIR}/libgnarl-musl.patch
-		patch -p1 -i ${FILESDIR}/libssp-musl.patch
-		patch -p1 -i ${FILESDIR}/gccgo-musl.patch
+		for p in ${FILESDIR}/*-musl.patch; do
+			patch -p1 -i $p
+		done
 	fi
 }
 do_configure() {
@@ -343,16 +342,16 @@ do_install() {
 
 	# Make version a symlink of major version to make all versions
 	# from the same series work automagically.
-	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver} \
+	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${version} \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver}
 	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver} \
-		${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}
+		${DESTDIR}/usr/lib/gcc/${_triplet}/${version}
 
 	# Ditto for c++ headers.
-	mv ${DESTDIR}/usr/include/c++/${_patchver} \
+	mv ${DESTDIR}/usr/include/c++/${version} \
 		${DESTDIR}/usr/include/c++/${_minorver}
 	ln -sfr ${DESTDIR}/usr/include/c++/${_minorver} \
-		${DESTDIR}/usr/include/c++/${_patchver}
+		${DESTDIR}/usr/include/c++/${version}
 
 	# cc symlink
 	ln -sfr ${DESTDIR}/usr/bin/gcc ${DESTDIR}/usr/bin/cc
@@ -361,7 +360,7 @@ do_install() {
 
 	# lto plugin symlink
 	vmkdir usr/lib/bfd-plugins
-	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}/liblto_plugin.so \
+	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${version}/liblto_plugin.so \
 		${DESTDIR}/usr/lib/bfd-plugins
 
 	# Remove "fixed" header
@@ -372,13 +371,9 @@ do_install() {
 	rm -f ${DESTDIR}/usr/lib/libffi*
 	rm -f ${DESTDIR}/usr/share/man/man3/ffi*
 
-	# Remove all python scripts in libdir.
-	rm -f ${DESTDIR}/usr/lib/*.py
-
-	# Remove more python stuff.
-	if [ -d ${DESTDIR}/usr/share/gcc-${_patchver}/python ]; then
-		rm -rf ${DESTDIR}/usr/share/gcc-${_patchver}/python
-	fi
+	# Move libstdc++ gdb helpers to location where gdb can autoload them
+	mkdir -p ${DESTDIR}/usr/share/gdb/auto-load/usr/lib
+	mv ${DESTDIR}/usr/lib/*.py ${DESTDIR}/usr/share/gdb/auto-load/usr/lib
 
 	# Install c89 and c99 wrappers and its manpages, from NetBSD.
 	for f in c89 c99; do
@@ -397,7 +392,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}
@@ -450,7 +445,7 @@ gcc-fortran_package() {
 		if [ "$CROSS_BUILD" ]; then
 			# A number of OMP modules are not built when cross
 			# compiling gcc. Copy them from the cross compiler.
-			local src="/usr/lib/gcc/${_triplet}/${_patchver}/finclude"
+			local src="/usr/lib/gcc/${_triplet}/${version}/finclude"
 			local dst="usr/lib/gcc/${_triplet}/${_minorver}/finclude"
 			for f in omp_lib.f90 omp_lib.h omp_lib.mod omp_lib_kinds.mod \
 				openacc.f90 openacc.mod openacc_kinds.mod openacc_lib.h; do
@@ -517,7 +512,7 @@ libgfortran_package() {
 	short_desc+=" - Fortran library"
 	pkg_install() {
 		vmove "usr/lib/libgfortran.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -538,7 +533,7 @@ libgo_package() {
 	nostrip=yes
 	pkg_install() {
 		vmove "usr/lib/libgo.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -554,7 +549,7 @@ libobjc_package() {
 	short_desc+=" - Objective-C library"
 	pkg_install() {
 		vmove "usr/lib/libobjc.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -573,7 +568,7 @@ libquadmath_package() {
 	short_desc+=" - quadmath library"
 	pkg_install() {
 		vmove "usr/lib/libquadmath.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -615,7 +610,7 @@ libgcc_package() {
 	noverifyrdeps=yes
 	pkg_install() {
 		vmove "usr/lib/libgcc_s.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -646,7 +641,7 @@ libgomp_package() {
 	short_desc+=" - OpenMP v4.0 library"
 	pkg_install() {
 		vmove "usr/lib/libgomp*.so.*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -701,7 +696,7 @@ libssp_package() {
 	short_desc+=" - SSP (StackSmashingProtection) library"
 	pkg_install() {
 		vmove "usr/lib/libssp.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -718,7 +713,9 @@ libstdc++-devel_package() {
 libstdc++_package() {
 	short_desc+=" - Standard C++ Library"
 	pkg_install() {
+		vmove usr/share/gdb
+		vmove usr/share/gcc-${version}/python
 		vmove "usr/lib/libstdc++.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }

From e7446d870584108e3ef237982a5f48d721fc83e8 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 04/37] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      | 11 ++++--
 2 files changed, 25 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..a4087ec2055e 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,12 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
+
+if [ "$XBPS_TARGET_LIBC" == "musl" ]; then
+	# Musl always searches LD_LIBRARY_PATH before RPATH and RUNPATH
+	make_build_args="lt_cv_shlibpath_overrides_runpath=yes"
+fi
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From a95f7328e10d0a22f5989fbaaa975b73de65b19d Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 05/37] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 55255dceae8b..ca2d858a7abc 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From 57794f74b9e6355d7044973d4f799bc9f00f0885 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 06/37] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 ...e-hash-style-both-for-building-glibc.patch |  51 ++++
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 4 files changed, 106 insertions(+), 353 deletions(-)
 create mode 100644 srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index 116561080072..b81d568d3c5c 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch b/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
new file mode 100644
index 000000000000..9c5553e92609
--- /dev/null
+++ b/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
@@ -0,0 +1,51 @@
+Temporary workaround for EAC bug.
+
+See: https://sourceware.org/bugzilla/show_bug.cgi?id=29456
+
+From 8e90e2cc5e57d7ca3a40602d278e9642a8b66716 Mon Sep 17 00:00:00 2001
+From: oreo639 <oreo6391@gmail.com>
+Date: Tue, 13 Sep 2022 14:30:35 -0700
+Subject: [PATCH] Revert "Do not use --hash-style=both for building glibc
+ shared objects"
+
+This reverts commit e47de5cb2d4dbecb58f569ed241e8e95c568f03c.
+---
+ Makeconfig     |  9 +++++++++
+ Makerules      |  7 +++++++
+ 5 files changed, 61 insertions(+)
+
+diff --git a/Makeconfig b/Makeconfig
+index ba70321af1..e2131d4389 100644
+--- a/Makeconfig
++++ b/Makeconfig
+@@ -371,6 +371,13 @@ dt-relr-ldflag =
+ no-dt-relr-ldflag =
+ endif
+ 
++# For the time being we unconditionally use 'both'.  At some time we
++# should declare statically linked code as 'out of luck' and compile
++# with --hash-style=gnu only.
++hashstyle-LDFLAGS = -Wl,--hash-style=both
++LDFLAGS.so += $(hashstyle-LDFLAGS)
++LDFLAGS-rtld += $(hashstyle-LDFLAGS)
++
+ ifeq (no,$(build-pie-default))
+ pie-default = $(no-pie-ccflag)
+ else # build-pie-default
+diff --git a/Makerules b/Makerules
+index d1e139d03c..44134e37ce 100644
+--- a/Makerules
++++ b/Makerules
+@@ -558,6 +558,9 @@ $(common-objpfx)shlib.lds: $(common-objpfx)config.make $(..)Makerules
+ 		  -Wl,--verbose 2>/dev/null | \
+ 	  sed > $@T \
+ 	      -e '/^=========/,/^=========/!d;/^=========/d' \
++		   -e 's/^.*\.gnu\.hash[ 	]*:.*$$/  .note.ABI-tag : { *(.note.ABI-tag) } &/' \
++		   -e '/^[ 	]*\.hash[ 	]*:.*$$/{h;d;}' \
++		   -e '/DATA_SEGMENT_ALIGN/{H;g}' \
+ 	      -e 's/^.*\*(\.dynbss).*$$/& \
+ 		 PROVIDE(__start___libc_freeres_ptrs = .); \
+ 		 *(__libc_freeres_ptrs) \
+-- 
+2.37.3
+
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From a41b60092f0bc7bd27461d786662e92c39375e69 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 07/37] musl: add support for SIGEV_THREAD_ID timers

https://git.musl-libc.org/cgit/musl/commit/?id=7c71792e87691451f2a6b76348e83ad1889f1dcb
---
 ...d-support-for-SIGEV_THREAD_ID-timers.patch | 74 +++++++++++++++++++
 srcpkgs/musl/template                         |  2 +-
 2 files changed, 75 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch

diff --git a/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
new file mode 100644
index 000000000000..e20dff5ba0d4
--- /dev/null
+++ b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
@@ -0,0 +1,74 @@
+From 7c71792e87691451f2a6b76348e83ad1889f1dcb Mon Sep 17 00:00:00 2001
+From: James Y Knight <jyknight@google.com>
+Date: Sun, 30 Jun 2019 21:55:20 -0400
+Subject: [PATCH] add support for SIGEV_THREAD_ID timers
+
+This is like SIGEV_SIGNAL, but targeted to a particular thread's
+tid, rather than the process.
+---
+ include/signal.h        | 16 +++++++++++++---
+ src/time/timer_create.c |  8 ++++++--
+ 2 files changed, 19 insertions(+), 5 deletions(-)
+
+diff --git a/include/signal.h b/include/signal.h
+index fbdf667b2..9ed929e4f 100644
+--- a/include/signal.h
++++ b/include/signal.h
+@@ -180,14 +180,24 @@ struct sigevent {
+ 	union sigval sigev_value;
+ 	int sigev_signo;
+ 	int sigev_notify;
+-	void (*sigev_notify_function)(union sigval);
+-	pthread_attr_t *sigev_notify_attributes;
+-	char __pad[56-3*sizeof(long)];
++	union {
++		char __pad[64 - 2*sizeof(int) - sizeof(union sigval)];
++		pid_t sigev_notify_thread_id;
++		struct {
++			void (*sigev_notify_function)(union sigval);
++			pthread_attr_t *sigev_notify_attributes;
++		} __sev_thread;
++	} __sev_fields;
+ };
+ 
++#define sigev_notify_thread_id __sev_fields.sigev_notify_thread_id
++#define sigev_notify_function __sev_fields.__sev_thread.sigev_notify_function
++#define sigev_notify_attributes __sev_fields.__sev_thread.sigev_notify_attributes
++
+ #define SIGEV_SIGNAL 0
+ #define SIGEV_NONE 1
+ #define SIGEV_THREAD 2
++#define SIGEV_THREAD_ID 4
+ 
+ int __libc_current_sigrtmin(void);
+ int __libc_current_sigrtmax(void);
+diff --git a/src/time/timer_create.c b/src/time/timer_create.c
+index 5ddfda278..4bef23905 100644
+--- a/src/time/timer_create.c
++++ b/src/time/timer_create.c
+@@ -71,11 +71,15 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 	switch (evp ? evp->sigev_notify : SIGEV_SIGNAL) {
+ 	case SIGEV_NONE:
+ 	case SIGEV_SIGNAL:
++	case SIGEV_THREAD_ID:
+ 		if (evp) {
+ 			ksev.sigev_value = evp->sigev_value;
+ 			ksev.sigev_signo = evp->sigev_signo;
+ 			ksev.sigev_notify = evp->sigev_notify;
+-			ksev.sigev_tid = 0;
++			if (evp->sigev_notify == SIGEV_THREAD_ID)
++				ksev.sigev_tid = evp->sigev_notify_thread_id;
++			else
++				ksev.sigev_tid = 0;
+ 			ksevp = &ksev;
+ 		}
+ 		if (syscall(SYS_timer_create, clk, ksevp, &timerid) < 0)
+@@ -107,7 +111,7 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 
+ 		ksev.sigev_value.sival_ptr = 0;
+ 		ksev.sigev_signo = SIGTIMER;
+-		ksev.sigev_notify = 4; /* SIGEV_THREAD_ID */
++		ksev.sigev_notify = SIGEV_THREAD_ID;
+ 		ksev.sigev_tid = td->tid;
+ 		if (syscall(SYS_timer_create, clk, &ksev, &timerid) < 0)
+ 			timerid = -1;
diff --git a/srcpkgs/musl/template b/srcpkgs/musl/template
index 5bdc5c48e623..34e6ed4fba6e 100644
--- a/srcpkgs/musl/template
+++ b/srcpkgs/musl/template
@@ -2,7 +2,7 @@
 pkgname=musl
 reverts="1.2.0_1"
 version=1.1.24
-revision=10
+revision=11
 archs="*-musl"
 bootstrap=yes
 build_style=gnu-configure

From 2775ba828483a3da38bb8d69051884afbca053d9 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 08/37] gcc-multilib: update to 12.2.0.

---
 srcpkgs/gcc-multilib/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index fcd25755aa75..df60849babc2 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,16 +3,16 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _majorver="${version%.*}"
-wrksrc=gcc-${version/pre/_pre}
+wrksrc="gcc-${version}"
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel
@@ -71,7 +71,7 @@ do_build() {
 	make ${makejobs}
 }
 do_install() {
-	local _pc_triplet=x86_64-pc-linux-gnu _version=${version%pre1}
+	local _pc_triplet=x86_64-pc-linux-gnu
 	# Install to a tempdir and then only copy relevant files.
 	cd ${wrksrc}
 	make DESTDIR=${wrksrc}/${pkgname}-build install
@@ -81,9 +81,9 @@ do_install() {
 	vmkdir usr/include/c++/${_majorver}/${_triplet}
 	vmkdir usr/lib/gcc/${_triplet}/${_majorver}
 
-	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${_version}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${version}/32 \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_majorver}/
-	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${_version}/${_pc_triplet}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${version}/${_pc_triplet}/32 \
 		${DESTDIR}/usr/include/c++/${_majorver}/${_triplet}
 
 	vinstall ${wrksrc}/host-${_pc_triplet}/gcc/specs 644 usr/lib/gcc/${_triplet}/${_majorver}

From b738aeca90654c680f978125f7f4663ac13628fc Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 09/37] libgccjit: update to 12.2.0.

---
 srcpkgs/libgccjit/files/libgccjit-musl.patch | 63 --------------------
 srcpkgs/libgccjit/template                   | 24 +++-----
 2 files changed, 9 insertions(+), 78 deletions(-)
 delete mode 100644 srcpkgs/libgccjit/files/libgccjit-musl.patch

diff --git a/srcpkgs/libgccjit/files/libgccjit-musl.patch b/srcpkgs/libgccjit/files/libgccjit-musl.patch
deleted file mode 100644
index d2ed16928c82..000000000000
--- a/srcpkgs/libgccjit/files/libgccjit-musl.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-diff --git a/gcc/jit/jit-playback.c b/gcc/jit/jit-playback.c
-index 5bccf591a..35f5e35ef 100644
---- a/gcc/jit/jit-playback.c
-+++ b/gcc/jit/jit-playback.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -41,8 +43,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "diagnostic.h"
- #include "stmt.h"
- 
--#include <pthread.h>
--
- #include "jit-playback.h"
- #include "jit-result.h"
- #include "jit-builtins.h"
-diff --git a/gcc/jit/jit-recording.c b/gcc/jit/jit-recording.c
-index a237d574f..5785e3269 100644
---- a/gcc/jit/jit-recording.c
-+++ b/gcc/jit/jit-recording.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -25,8 +27,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "pretty-print.h"
- #include "toplev.h"
- 
--#include <pthread.h>
--
- #include "jit-builtins.h"
- #include "jit-recording.h"
- #include "jit-playback.h"
-diff --git a/gcc/jit/libgccjit.c b/gcc/jit/libgccjit.c
-index f9c33c63c..75f21d275 100644
---- a/gcc/jit/libgccjit.c
-+++ b/gcc/jit/libgccjit.c
-@@ -18,13 +18,13 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
- #include "timevar.h"
- #include "typed-splay-tree.h"
- #include "cppbuiltin.h"
--#include <pthread.h>
- 
- #include "libgccjit.h"
- #include "jit-recording.h"
diff --git a/srcpkgs/libgccjit/template b/srcpkgs/libgccjit/template
index 0b37c3ee9f8b..fde1affd54b7 100644
--- a/srcpkgs/libgccjit/template
+++ b/srcpkgs/libgccjit/template
@@ -3,18 +3,12 @@
 # which use the version number.
 
 pkgname=libgccjit
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
+version=12.2.0
 revision=1
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
-_majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 create_wrksrc=yes
 short_desc="Just-In-Time Compilation library for GCC"
 maintainer="Lane Biocini <lane@mailbox.org>"
@@ -22,16 +16,16 @@ homepage="https://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 nopie=yes
 lib32disabled=yes
 makedepends="zlib-devel"

From d8dd8f8825c0404e6a3071d731e7c0a516075418 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 10/37] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove -no-pie from build. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..5d40f0cdd8a6 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -53,6 +53,7 @@ _void_cross_build_binutils() {
 		--sbindir=/usr/bin \
 		--libdir=/usr/lib \
 		--libexecdir=/usr/lib \
+		--sysconfdir=/etc \
 		--target=${tgt} \
 		--with-sysroot=/usr/${tgt} \
 		--disable-nls \
@@ -60,7 +61,9 @@ _void_cross_build_binutils() {
 		--disable-multilib \
 		--disable-werror \
 		--disable-gold \
+		--disable-gprofng \
 		--enable-relro \
+		--enable-new-dtags \
 		--enable-plugins \
 		--enable-64-bit-bfd \
 		--enable-deterministic-archives \
@@ -132,6 +135,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -460,6 +464,14 @@ do_build() {
 	local binutils_ver linux_ver gcc_ver libc_ver libucontext_ver
 	local tgt=${sourcepkg/cross-}
 
+	export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}"
+	export CXXFLAGS="${CXXFLAGS/-D_FORTIFY_SOURCE=2/}"
+
+	# Disable explicit -fno-PIE, gcc/binutils/libc will figure this out itself.
+	export CFLAGS="${CFLAGS//-fno-PIE/}"
+	export CXXFLAGS="${CXXFLAGS//-fno-PIE/}"
+	export LDFLAGS="${LDFLAGS//-no-pie/}"
+
 	_void_cross_test_ver binutils
 	_void_cross_test_ver linux
 	_void_cross_test_ver gcc
@@ -625,6 +637,9 @@ do_install() {
 	# then remove it because it conflicts with libquadmath package
 	rm -rf ${DESTDIR}/${sysroot}/usr/lib/libquadmath.*
 
+	# Remove libdep linker plugin because it conflicts with system binutils
+	rm -f ${DESTDIR}/usr/lib/bfd-plugins/libdep*
+
 	# Remove leftover symlinks
 	rm -f ${DESTDIR}/usr/lib${XBPS_TARGET_WORDSIZE}
 	rm -f ${DESTDIR}/lib*

From 353a5f82295500604121c8bdddd5558c12d70e2a Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 11/37] subversion: fix build for libtool 2.4.7

---
 srcpkgs/subversion/template | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/subversion/template b/srcpkgs/subversion/template
index be37f60f9679..a1eaf4565d0b 100644
--- a/srcpkgs/subversion/template
+++ b/srcpkgs/subversion/template
@@ -24,6 +24,8 @@ distfiles="https://archive.apache.org/dist/subversion/subversion-${version}.tar.
 checksum=c9130e8d0b75728a66f0e7038fc77052e671830d785b5616aad53b4810d3cc28
 
 pre_configure() {
+	./autogen.sh --release
+
 	# Based on native build values
 	cat <<-EOF >config.cache
 	ac_cv_python_includes=-I${XBPS_CROSS_BASE}/usr/include/python${py3_ver}
@@ -59,7 +61,12 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+
+	if [ "$XBPS_BUILD_ENVIRONMENT" = "void-packages-ci" ]; then
+		# This test will fail when run as the root user,
+		# because flock() will ignore file permissions.
+		vsed -i subversion/tests/libsvn_fs/locks-test.c -e '/SVN_TEST_OPTS_PASS(obtain_write_lock_failure,/,+3d'
+	fi
 }
 
 post_configure() {

From 7a6ae3958d6699d6e7832384fe8a9cad8c727441 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 12/37] subversion-kwallet-auth: fix build for libtool 2.4.7.

Fix failing distfiles.
Fix build for libtool 2.4.7
---
 srcpkgs/subversion-kwallet-auth/template | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/subversion-kwallet-auth/template b/srcpkgs/subversion-kwallet-auth/template
index fd3e7f1ca5cb..de248a83e7e1 100644
--- a/srcpkgs/subversion-kwallet-auth/template
+++ b/srcpkgs/subversion-kwallet-auth/template
@@ -26,6 +26,8 @@ checksum=c9130e8d0b75728a66f0e7038fc77052e671830d785b5616aad53b4810d3cc28
 lib32disabled=yes
 
 pre_configure() {
+	./autogen.sh --release
+
 	# Based on native build values
 	cat <<-EOF >config.cache
 	ac_cv_python_includes=-I${XBPS_CROSS_BASE}/usr/include/python${py3_ver}
@@ -55,11 +57,18 @@ pre_configure() {
 		cp "$XBPS_CROSS_BASE/usr/lib/perl5/core_perl/Config"*.p? $PERL5LIB
 		cp "$XBPS_CROSS_BASE/usr/lib/perl5/core_perl/Errno.pm" $PERL5LIB
 		vsed -e "s;archlibexp => '\(.*\)';archlibexp => '${XBPS_CROSS_BASE}\1';" \
-			-i $PERL5LIB/Config.pm $PERL5LIB/Config_heavy.pl
+			-i $PERL5LIB/Config.pm
+		vsed -e "s;archlibexp='\(.*\)';archlibexp='${XBPS_CROSS_BASE}\1';" \
+			-i $PERL5LIB/Config_heavy.pl
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+
+	if [ "$XBPS_BUILD_ENVIRONMENT" = "void-packages-ci" ]; then
+		# This test will fail when run as the root user,
+		# because flock() will ignore file permissions.
+		vsed -i subversion/tests/libsvn_fs/locks-test.c -e '/SVN_TEST_OPTS_PASS(obtain_write_lock_failure,/,+3d'
+	fi
 }
 
 post_configure() {

From 2867740b2f72d1e1ead020506cec89dbfd9ccb18 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 13/37] qemu: remove broken patch

The necessary patch has been imported into musl so no need
to cast the sigevent struct to a more glibc-like one.
---
 .../musl-fix-sigevent-and-sigval_t.patch      | 27 -------------------
 1 file changed, 27 deletions(-)
 delete mode 100644 srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch

diff --git a/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch b/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch
deleted file mode 100644
index 4b4f1117c15f..000000000000
--- a/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-Note: Remove this patch with musl 1.2.2
-
---- a/linux-user/syscall.c
-+++ b/linux-user/syscall.c
-@@ -5020,10 +5020,21 @@
- #ifndef HAVE_SIGEV_NOTIFY_THREAD_ID
- #define sigev_notify_thread_id _sigev_un._tid
- #endif
- 
--static inline abi_long target_to_host_sigevent(struct sigevent *host_sevp,
-+struct host_sigevent {
-+    union sigval sigev_value;
-+    int sigev_signo;
-+    int sigev_notify;
-+    union {
-+       char _pad[64 - sizeof(int) * 2 - sizeof(union sigval)];
-+       int _tid;
-+    } _sigev_un;
-+};
-+
-+static inline abi_long target_to_host_sigevent(struct sigevent *sevp,
-                                                abi_ulong target_addr)
- {
-+    struct host_sigevent *host_sevp = (struct host_sigevent *) sevp;
-     struct target_sigevent *target_sevp;
- 
-     if (!lock_user_struct(VERIFY_READ, target_sevp, target_addr, 1)) {

From 7a7646bc8b2bbd0e504fa27091b0146c6787afff Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:13 -0700
Subject: [PATCH 14/37] cross-aarch64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..bd6b23f9fb6a 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From bc2cbec38b424ec7b9ecd65eb437e087269cfddb Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:13 -0700
Subject: [PATCH 15/37] cross-aarch64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..427ad2c1e9cd 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From c3272fda25a9d55361c9c2cdd9f57ba8772f1612 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:13 -0700
Subject: [PATCH 16/37] cross-arm-linux-gnueabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..2510ee26e789 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From b152fde37e2656934d3cf7f82dbeee3ff970015a Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:13 -0700
Subject: [PATCH 17/37] cross-arm-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..bd8b16e1b4c1 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From bf6d200a6d84441b0ea1d8df0c79bffa619613d8 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:13 -0700
Subject: [PATCH 18/37] cross-arm-linux-musleabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..dacfd2655216 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 9e550103577a5d5751eb9d3f67cede25e02c98ec Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:13 -0700
Subject: [PATCH 19/37] cross-arm-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..9ddd32a9f20d 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 159068306940ccd4bf272a634dcccbf5a9866941 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:13 -0700
Subject: [PATCH 20/37] cross-armv7l-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..9fb00f18be3b 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From a6de2162180a8141f6c50192c48054a26cc3c497 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:13 -0700
Subject: [PATCH 21/37] cross-armv7l-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..2c72e75ddfe3 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -14,16 +14,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 7f4df8489d16ad259870cdcb8a440632ddd1f375 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:13 -0700
Subject: [PATCH 22/37] cross-i686-pc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..4dc17df648b5 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From d81a29d45dad04d9d0f8ab9da568bfe6789b5f40 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:13 -0700
Subject: [PATCH 23/37] cross-i686-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-i686-linux-musl/template b/srcpkgs/cross-i686-linux-musl/template
index 8be16a230d8d..78b4d813a113 100644
--- a/srcpkgs/cross-i686-linux-musl/template
+++ b/srcpkgs/cross-i686-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-i686-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-i686-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 302e41f723b355ff28b47890638e53537fe0249d Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:14 -0700
Subject: [PATCH 24/37] cross-mips-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..6009e5c79eb2 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From d1aea1247ecc52ed31a4ff949d519e6bd717427b Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:14 -0700
Subject: [PATCH 25/37] cross-mips-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..080164df193d 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="hipperson0 <hipperson0@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From d94d742aae04a53f33688c4b83d99332ab1fa791 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:14 -0700
Subject: [PATCH 26/37] cross-mipsel-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..f9fd4b8a04ef 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 98dce880794aeafe122ac1a613d6fc1a1780fe61 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:14 -0700
Subject: [PATCH 27/37] cross-mipsel-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..7418a984474b 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From b97c945cc9ca73925816241a723861a1266878a7 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:14 -0700
Subject: [PATCH 28/37] cross-powerpc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..31e57b4e52b2 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From e64539c76cee8a1df4a42f95c417b02edfab0b1a Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:14 -0700
Subject: [PATCH 29/37] cross-powerpc-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..a2d1edcf1ffd 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 7bbfd7d972f731d6e49c8887d3b9b9da0fc1e12a Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:14 -0700
Subject: [PATCH 30/37] cross-powerpc64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..1a4cbed61e76 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 1d37a6c4c6667ad7e6ac6e4ce3097c838a30e685 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:14 -0700
Subject: [PATCH 31/37] cross-powerpc64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 016f18776a6d..19b1ff859eb6 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From ae73179c063f86b4c87b429104da6d2c7a4b4e32 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:14 -0700
Subject: [PATCH 32/37] cross-powerpc64le-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 463d7e92d20d..9d99a3a315d2 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
@@ -18,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From ad38674cdbdb54d019a7f3461c5609fb20f05a00 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:14 -0700
Subject: [PATCH 33/37] cross-powerpc64le-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index c17a3cccfe29..3128baa7372e 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
@@ -15,16 +15,16 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 8efc9ed1e5bef457fbacbcb0504f79f773c8c60b Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:15 -0700
Subject: [PATCH 34/37] cross-powerpcle-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 9aede3c465ce..0462a1015a1a 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
@@ -17,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 
@@ -35,6 +35,8 @@ if [ "$XBPS_TARGET_MACHINE" = "ppcle" ]; then
 	broken="Can't build crosstoolchain to itself"
 fi
 
+broken="glibc uses big-endian specific instructions on 32-bit powerpc"
+
 cross-powerpcle-linux-gnu-libc_package() {
 	short_desc+=" - glibc files"
 	nostrip=yes

From fbb9d42aea1619007b54534e5961d845a43787cc Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:15 -0700
Subject: [PATCH 35/37] cross-powerpcle-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index 045cfda987fe..20e70bed4c60 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -14,15 +14,15 @@ makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 33288fd92d927400b67d03d8d6df9480f047a16f Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:15 -0700
Subject: [PATCH 36/37] cross-x86_64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 8918f3c22a1c..5219cd50f851 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,10 +1,10 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -16,12 +16,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 00df3d2fca96469130f28cebfe07fe19a1d66040 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:15 -0700
Subject: [PATCH 37/37] cross-x86_64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..2811de0d3c2e 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,28 +1,28 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (211 preceding siblings ...)
  2022-11-05 18:38 ` [PR PATCH] [Updated] " oreo639
@ 2022-11-06 15:10 ` pwhite1989
  2022-11-06 15:10 ` pwhite1989
                   ` (51 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: pwhite1989 @ 2022-11-06 15:10 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 922 bytes --]

New comment by pwhite1989 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1304823002

Comment:
> That's not showing any errors, they are before that. This PR is outdated and should be rebased before you try to build gcc and you probably want to set XBPS_MAKEJOBS in the config or add `-j<num>` to the command to make sure you are using more than one core.

Thanks for the reply. Didn't know about the -j flag. 

Unfortunately I can't copy and paste the errors.

I've just rebased pulled in all the changes that were made last night. It still errors, but with this message (but takes seconds rather than mins):

```
...
=> gcc-12.2.0_1: running do_build ...
/void-packages/srcpkgs/gcc/template: line 319: cd: build: No such file or directory
=> ERROR: gcc-12.2.0_1: do_build: 'cd build' exited with 1
=> ERROR:    in do_build() at srcpkgs/gcc/template:319
```

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (212 preceding siblings ...)
  2022-11-06 15:10 ` pwhite1989
@ 2022-11-06 15:10 ` pwhite1989
  2022-11-06 15:14 ` pwhite1989
                   ` (50 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: pwhite1989 @ 2022-11-06 15:10 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 946 bytes --]

New comment by pwhite1989 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1304823002

Comment:
> That's not showing any errors, they are before that. This PR is outdated and should be rebased before you try to build gcc and you probably want to set XBPS_MAKEJOBS in the config or add `-j<num>` to the command to make sure you are using more than one core.

Thanks for the reply. Didn't know about the -j flag. 

Unfortunately I can't copy and paste, so I'm manually typing the errors.

I've just rebased pulled in all the changes that were made last night. It still errors, but with this message (but takes seconds rather than mins):

```
...
=> gcc-12.2.0_1: running do_build ...
/void-packages/srcpkgs/gcc/template: line 319: cd: build: No such file or directory
=> ERROR: gcc-12.2.0_1: do_build: 'cd build' exited with 1
=> ERROR:    in do_build() at srcpkgs/gcc/template:319
```

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (213 preceding siblings ...)
  2022-11-06 15:10 ` pwhite1989
@ 2022-11-06 15:14 ` pwhite1989
  2022-11-06 18:47 ` oreo639
                   ` (49 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: pwhite1989 @ 2022-11-06 15:14 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 947 bytes --]

New comment by pwhite1989 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1304823002

Comment:
> That's not showing any errors, they are before that. This PR is outdated and should be rebased before you try to build gcc and you probably want to set XBPS_MAKEJOBS in the config or add `-j<num>` to the command to make sure you are using more than one core.

Thanks for the reply. Didn't know about the -j flag. 

Unfortunately I can't copy and paste, so I'm manually typing the errors.

I've just rebased pulled in all the changes that were made last night. It still errors, but with this message (but takes seconds rather than hours):

```
...
=> gcc-12.2.0_1: running do_build ...
/void-packages/srcpkgs/gcc/template: line 319: cd: build: No such file or directory
=> ERROR: gcc-12.2.0_1: do_build: 'cd build' exited with 1
=> ERROR:    in do_build() at srcpkgs/gcc/template:319
```

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (214 preceding siblings ...)
  2022-11-06 15:14 ` pwhite1989
@ 2022-11-06 18:47 ` oreo639
  2022-11-06 19:33 ` [PR PATCH] [Updated] " oreo639
                   ` (48 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-11-06 18:47 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 174 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1304867458

Comment:
You need to delete the builddir.

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (215 preceding siblings ...)
  2022-11-06 18:47 ` oreo639
@ 2022-11-06 19:33 ` oreo639
  2022-11-08 18:27 ` oreo639
                   ` (47 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-11-06 19:33 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5448 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.2.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.2.0

There is a list of failing builds here: https://github.com/void-linux/void-packages/issues/39809

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [x] llvm https://github.com/void-linux/void-packages/pull/38694
- [x] m4 https://github.com/void-linux/void-packages/pull/33730
- [x] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [x] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [x] libvirt https://github.com/void-linux/void-packages/pull/38842
- [x] syslinux https://github.com/void-linux/void-packages/pull/38876
- [x] efivar https://github.com/void-linux/void-packages/pull/38874
- [x] gpgme https://github.com/void-linux/void-packages/pull/38825

Known packages that needed to be fixed/updated for gcc12:
- [x] openssh https://github.com/void-linux/void-packages/pull/38849
- [x] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [x] doxygen https://github.com/void-linux/void-packages/pull/38846
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] libproxy https://github.com/void-linux/void-packages/pull/38818
- [x] exempi https://github.com/void-linux/void-packages/pull/38820
- [x] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [x] libunique1 https://github.com/void-linux/void-packages/pull/38848 or https://github.com/void-linux/void-packages/pull/38873
- [x] libwpd https://github.com/void-linux/void-packages/pull/38878
- [x] cglm https://github.com/void-linux/void-packages/pull/39748
- [x] coreboot-utils https://github.com/void-linux/void-packages/pull/39749
- [x] apl https://github.com/void-linux/void-packages/pull/39750
- [x] igt-gpu-tools https://github.com/void-linux/void-packages/pull/39780

Needs to be fixed/updated for binutils:
- [x] grub https://github.com/void-linux/void-packages/pull/38875
- [x] linux-tools https://github.com/void-linux/void-packages/pull/38877
- [x] kcov https://github.com/void-linux/void-packages/pull/39291

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [x] kde
- [x] lxde
- [x] lxqt

You can test the ISOs here:
https://drive.google.com/drive/folders/1ix92CYSLUP-KWjLxltdgG4e8Nu2JCY5n?usp=sharing

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 133105 bytes --]

From f7a2db222a1f6603061cf183780256e121449c66 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 01/37] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../fix-libcollector-without-java.patch       | 53 +++++++++++++++
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 25 ++++---
 4 files changed, 87 insertions(+), 117 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
 create mode 100644 srcpkgs/binutils/patches/fix-libcollector-without-java.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/fix-libcollector-without-java.patch b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
new file mode 100644
index 000000000000..54384875f358
--- /dev/null
+++ b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
@@ -0,0 +1,53 @@
+From 49ddd814ac1071af7c4f45d5f8398b91862f2c7f Mon Sep 17 00:00:00 2001
+From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
+Date: Wed, 17 Aug 2022 19:55:23 -0700
+Subject: [PATCH] gprofng: fix bug 29479 Collection fails when built without
+ java support
+
+gprofng/ChangeLog
+2022-08-17  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>
+
+	PR gprofng/29479
+	* libcollector/collector.c: Add #if defined(GPROFNG_JAVA_PROFILING) for
+	java specific code.
+	* libcollector/unwind.c: Likewise.
+---
+ gprofng/libcollector/collector.c | 2 ++
+ gprofng/libcollector/unwind.c    | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/gprofng/libcollector/collector.c b/gprofng/libcollector/collector.c
+index 93c9d3330de5..ceff2c1caccb 100644
+--- a/gprofng/libcollector/collector.c
++++ b/gprofng/libcollector/collector.c
+@@ -913,8 +913,10 @@ __collector_open_experiment (const char *exp, const char *params, sp_origin_t or
+   __collector_ext_unwind_key_init (1, NULL);
+ 
+   /* start java attach if suitable */
++#if defined(GPROFNG_JAVA_PROFILING)
+   if (exp_origin == SP_ORIGIN_DBX_ATTACH)
+     __collector_jprofile_start_attach ();
++#endif
+   start_sec_time = CALL_UTIL (time)(NULL);
+   __collector_start_time = collector_interface.getHiResTime ();
+   TprintfT (DBG_LT0, "\t__collector_open_experiment; resetting start_time\n");
+diff --git a/gprofng/libcollector/unwind.c b/gprofng/libcollector/unwind.c
+index 119243788020..f8e11823c81e 100644
+--- a/gprofng/libcollector/unwind.c
++++ b/gprofng/libcollector/unwind.c
+@@ -557,6 +557,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+   int size = max_frame_size;
+ 
+ #define MIN(a,b) ((a)<(b)?(a):(b))
++#if defined(GPROFNG_JAVA_PROFILING)
+   /* get Java info */
+   if (__collector_java_mode && __collector_java_asyncgetcalltrace_loaded && context && !pseudo_context)
+     {
+@@ -569,6 +570,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+ 	  size -= sz;
+ 	}
+     }
++#endif
+ 
+   /* get native stack */
+   if (context)
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..c355a5fc8016 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkgconf"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -35,15 +36,21 @@ do_configure() {
 	local conf
 
 	if [ "$CHROOT_READY" ]; then
-		conf+=" --with-debuginfod"
+		conf+=" --with-debuginfod --enable-shared"
 	else
-		conf+=" --without-debuginfod --disable-install-libbfd"
+		conf+=" --without-debuginfod --disable-shared --disable-install-libbfd"
 	fi
 	if [ "$CROSS_BUILD" ]; then
 		# we don't want --with-sysroot=${XBPS_CROSS_BASE} like gnu-configure
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	# gprofng currently only supports x86 and aarch64 glibc.
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64|i386|aarch64) conf+=" --enable-gprofng" ;;
+		*) conf+=" --disable-gprofng" ;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"
@@ -76,13 +83,14 @@ do_configure() {
 		--libdir=/usr/lib \
 		--mandir=/usr/share/man \
 		--infodir=/usr/share/info \
+		--sysconfdir=/etc \
 		--disable-werror \
-		--disable-shared \
 		--disable-nls \
 		--enable-threads \
 		--enable-plugins \
 		--enable-relro \
 		--enable-gold \
+		--enable-new-dtags \
 		--enable-deterministic-archives \
 		--enable-64-bit-bfd \
 		--enable-ld=default \
@@ -142,7 +150,8 @@ binutils-devel_package() {
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/*.a"
-		vmove "usr/lib/*.so"
+		vmove "usr/lib/libbfd.so"
+		vmove "usr/lib/libopcodes.so"
 	}
 }
 

From fe6f7982aa82bfb1c109b858255088c296eb31bc Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 02/37] gdb: resolve conflict with binutils 2.39

---
 srcpkgs/gdb/template | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/gdb/template b/srcpkgs/gdb/template
index 9c5f17ffc519..5970402eb27e 100644
--- a/srcpkgs/gdb/template
+++ b/srcpkgs/gdb/template
@@ -48,7 +48,8 @@ vopt_conflict debuginfod static
 
 post_install() {
 	# resolve conflicts with binutils
-	rm -r ${DESTDIR}/usr/{include,lib,share/info/bfd.info*}
+	rm -rf ${DESTDIR}/usr/{include,lib}
+	rm -rf ${DESTDIR}/usr/share/info/{bfd,ctf-spec}.info*
 }
 
 gdb-common_package() {

From 650676defc26fd536bd676a4c2af3e80f996dba3 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 03/37] gcc: update to 12.2.0.

---
 common/shlibs                                 | 10 +--
 srcpkgs/gcc/files/gccgo-musl.patch            | 71 +++------------
 srcpkgs/gcc/files/libgnarl-musl.patch         | 18 ++--
 srcpkgs/gcc/files/libssp-musl.patch           | 10 +--
 srcpkgs/gcc/patches/libffi_gnulinux.patch     | 11 ---
 .../gcc/patches/libgcc-ibm128-no-tag.patch    | 10 ++-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |  2 +-
 srcpkgs/gcc/template                          | 87 +++++++++----------
 8 files changed, 80 insertions(+), 139 deletions(-)
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index 5136df346db0..116561080072 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.2.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.36 perl-5.36.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -858,8 +858,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.2.0_1
+libgnat-12.so libada-12.2.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1711,8 +1711,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.2.0_1
+libasan.so.8 libsanitizer-12.2.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..12ec68dd8aa3 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,14 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ b/libgo/go/runtime/os_linux.go
+@@ -365,7 +365,7 @@ func setThreadCPUProfiler(hz int32) {
+ 	var sevp _sigevent
+ 	sevp.sigev_notify = _SIGEV_THREAD_ID
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.__sev_fields))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index ab3643de4f98..a20af7c0ef2e 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,14 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
+version=12.2.0
+revision=1
+_minorver="${version%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 create_wrksrc=yes
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +18,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -52,8 +48,11 @@ if [ "$CHROOT_READY" ]; then
 	hostmakedepends="tar texinfo perl flex"
 else
 	_have_gccgo=no
+	# libzstd fails to link in bootstrap with glibc 2.36
+	# when zlib has been compiled with glibc 2.32.
+	LDFLAGS="-lzstd -pthread"
 fi
-makedepends="zlib-devel"
+makedepends="zlib-devel libzstd-devel"
 depends="binutils libgcc-devel-${version}_${revision}
  libstdc++-devel-${version}_${revision} libssp-devel-${version}_${revision}"
 checkdepends="dejagnu"
@@ -70,13 +69,13 @@ if [ "$build_option_gnatboot" ]; then
 	case "$XBPS_TARGET_MACHINE" in
 	x86_64)
 		_gnat_tarball="gnat-gpl-2017-x86_64-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/591c6d80c7a447af2deed1d7>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/9682e2e1f2f232ce03fe21d77b14c37a0de5649b?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" b942bcac20dea39748b39f8b624d9619f60a8dee2e8195dbe3829c835b0956e6"
 		build_options_default="gnatboot"
 		;;
 	i686)
 		_gnat_tarball="gnat-gpl-2014-x86-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/564b3e9dc8e196b040fbe248>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/c5e9e6fdff5cb77ed90cf8c62536653e27c0bed6?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" 3b693510f5d22a240abb3034934c1adbd80ccd6e4f61a4f491cc408fdfd9c042"
 		build_options_default="gnatboot"
 		;;
@@ -155,8 +154,8 @@ if [ "$CROSS_BUILD" ]; then
 fi
 
 post_extract() {
-	mv gcc-${version/pre/_pre}/* gcc-${version/pre/_pre}/.??* .
-	rmdir gcc-${version/pre/_pre}
+	mv gcc-${version}/* gcc-${version}/.??* .
+	rmdir gcc-${version}
 	mv gmp-${_gmp_version} gmp
 	mv mpfr-${_mpfr_version} mpfr
 	mv mpc-${_mpc_version} mpc
@@ -186,9 +185,9 @@ pre_configure() {
 	sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
 
 	if [ "$XBPS_TARGET_LIBC" = musl ]; then
-		patch -p1 -i ${FILESDIR}/libgnarl-musl.patch
-		patch -p1 -i ${FILESDIR}/libssp-musl.patch
-		patch -p1 -i ${FILESDIR}/gccgo-musl.patch
+		for p in ${FILESDIR}/*-musl.patch; do
+			patch -p1 -i $p
+		done
 	fi
 }
 do_configure() {
@@ -343,16 +342,16 @@ do_install() {
 
 	# Make version a symlink of major version to make all versions
 	# from the same series work automagically.
-	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver} \
+	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${version} \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver}
 	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver} \
-		${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}
+		${DESTDIR}/usr/lib/gcc/${_triplet}/${version}
 
 	# Ditto for c++ headers.
-	mv ${DESTDIR}/usr/include/c++/${_patchver} \
+	mv ${DESTDIR}/usr/include/c++/${version} \
 		${DESTDIR}/usr/include/c++/${_minorver}
 	ln -sfr ${DESTDIR}/usr/include/c++/${_minorver} \
-		${DESTDIR}/usr/include/c++/${_patchver}
+		${DESTDIR}/usr/include/c++/${version}
 
 	# cc symlink
 	ln -sfr ${DESTDIR}/usr/bin/gcc ${DESTDIR}/usr/bin/cc
@@ -361,7 +360,7 @@ do_install() {
 
 	# lto plugin symlink
 	vmkdir usr/lib/bfd-plugins
-	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}/liblto_plugin.so \
+	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${version}/liblto_plugin.so \
 		${DESTDIR}/usr/lib/bfd-plugins
 
 	# Remove "fixed" header
@@ -372,13 +371,9 @@ do_install() {
 	rm -f ${DESTDIR}/usr/lib/libffi*
 	rm -f ${DESTDIR}/usr/share/man/man3/ffi*
 
-	# Remove all python scripts in libdir.
-	rm -f ${DESTDIR}/usr/lib/*.py
-
-	# Remove more python stuff.
-	if [ -d ${DESTDIR}/usr/share/gcc-${_patchver}/python ]; then
-		rm -rf ${DESTDIR}/usr/share/gcc-${_patchver}/python
-	fi
+	# Move libstdc++ gdb helpers to location where gdb can autoload them
+	mkdir -p ${DESTDIR}/usr/share/gdb/auto-load/usr/lib
+	mv ${DESTDIR}/usr/lib/*.py ${DESTDIR}/usr/share/gdb/auto-load/usr/lib
 
 	# Install c89 and c99 wrappers and its manpages, from NetBSD.
 	for f in c89 c99; do
@@ -397,7 +392,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}
@@ -450,7 +445,7 @@ gcc-fortran_package() {
 		if [ "$CROSS_BUILD" ]; then
 			# A number of OMP modules are not built when cross
 			# compiling gcc. Copy them from the cross compiler.
-			local src="/usr/lib/gcc/${_triplet}/${_patchver}/finclude"
+			local src="/usr/lib/gcc/${_triplet}/${version}/finclude"
 			local dst="usr/lib/gcc/${_triplet}/${_minorver}/finclude"
 			for f in omp_lib.f90 omp_lib.h omp_lib.mod omp_lib_kinds.mod \
 				openacc.f90 openacc.mod openacc_kinds.mod openacc_lib.h; do
@@ -517,7 +512,7 @@ libgfortran_package() {
 	short_desc+=" - Fortran library"
 	pkg_install() {
 		vmove "usr/lib/libgfortran.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -538,7 +533,7 @@ libgo_package() {
 	nostrip=yes
 	pkg_install() {
 		vmove "usr/lib/libgo.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -554,7 +549,7 @@ libobjc_package() {
 	short_desc+=" - Objective-C library"
 	pkg_install() {
 		vmove "usr/lib/libobjc.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -573,7 +568,7 @@ libquadmath_package() {
 	short_desc+=" - quadmath library"
 	pkg_install() {
 		vmove "usr/lib/libquadmath.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -615,7 +610,7 @@ libgcc_package() {
 	noverifyrdeps=yes
 	pkg_install() {
 		vmove "usr/lib/libgcc_s.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -646,7 +641,7 @@ libgomp_package() {
 	short_desc+=" - OpenMP v4.0 library"
 	pkg_install() {
 		vmove "usr/lib/libgomp*.so.*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -701,7 +696,7 @@ libssp_package() {
 	short_desc+=" - SSP (StackSmashingProtection) library"
 	pkg_install() {
 		vmove "usr/lib/libssp.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -718,7 +713,9 @@ libstdc++-devel_package() {
 libstdc++_package() {
 	short_desc+=" - Standard C++ Library"
 	pkg_install() {
+		vmove usr/share/gdb
+		vmove usr/share/gcc-${version}/python
 		vmove "usr/lib/libstdc++.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }

From e7446d870584108e3ef237982a5f48d721fc83e8 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 04/37] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      | 11 ++++--
 2 files changed, 25 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..a4087ec2055e 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,12 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
+
+if [ "$XBPS_TARGET_LIBC" == "musl" ]; then
+	# Musl always searches LD_LIBRARY_PATH before RPATH and RUNPATH
+	make_build_args="lt_cv_shlibpath_overrides_runpath=yes"
+fi
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From a95f7328e10d0a22f5989fbaaa975b73de65b19d Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 05/37] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 55255dceae8b..ca2d858a7abc 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From 57794f74b9e6355d7044973d4f799bc9f00f0885 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 06/37] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 ...e-hash-style-both-for-building-glibc.patch |  51 ++++
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 4 files changed, 106 insertions(+), 353 deletions(-)
 create mode 100644 srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index 116561080072..b81d568d3c5c 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch b/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
new file mode 100644
index 000000000000..9c5553e92609
--- /dev/null
+++ b/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
@@ -0,0 +1,51 @@
+Temporary workaround for EAC bug.
+
+See: https://sourceware.org/bugzilla/show_bug.cgi?id=29456
+
+From 8e90e2cc5e57d7ca3a40602d278e9642a8b66716 Mon Sep 17 00:00:00 2001
+From: oreo639 <oreo6391@gmail.com>
+Date: Tue, 13 Sep 2022 14:30:35 -0700
+Subject: [PATCH] Revert "Do not use --hash-style=both for building glibc
+ shared objects"
+
+This reverts commit e47de5cb2d4dbecb58f569ed241e8e95c568f03c.
+---
+ Makeconfig     |  9 +++++++++
+ Makerules      |  7 +++++++
+ 5 files changed, 61 insertions(+)
+
+diff --git a/Makeconfig b/Makeconfig
+index ba70321af1..e2131d4389 100644
+--- a/Makeconfig
++++ b/Makeconfig
+@@ -371,6 +371,13 @@ dt-relr-ldflag =
+ no-dt-relr-ldflag =
+ endif
+ 
++# For the time being we unconditionally use 'both'.  At some time we
++# should declare statically linked code as 'out of luck' and compile
++# with --hash-style=gnu only.
++hashstyle-LDFLAGS = -Wl,--hash-style=both
++LDFLAGS.so += $(hashstyle-LDFLAGS)
++LDFLAGS-rtld += $(hashstyle-LDFLAGS)
++
+ ifeq (no,$(build-pie-default))
+ pie-default = $(no-pie-ccflag)
+ else # build-pie-default
+diff --git a/Makerules b/Makerules
+index d1e139d03c..44134e37ce 100644
+--- a/Makerules
++++ b/Makerules
+@@ -558,6 +558,9 @@ $(common-objpfx)shlib.lds: $(common-objpfx)config.make $(..)Makerules
+ 		  -Wl,--verbose 2>/dev/null | \
+ 	  sed > $@T \
+ 	      -e '/^=========/,/^=========/!d;/^=========/d' \
++		   -e 's/^.*\.gnu\.hash[ 	]*:.*$$/  .note.ABI-tag : { *(.note.ABI-tag) } &/' \
++		   -e '/^[ 	]*\.hash[ 	]*:.*$$/{h;d;}' \
++		   -e '/DATA_SEGMENT_ALIGN/{H;g}' \
+ 	      -e 's/^.*\*(\.dynbss).*$$/& \
+ 		 PROVIDE(__start___libc_freeres_ptrs = .); \
+ 		 *(__libc_freeres_ptrs) \
+-- 
+2.37.3
+
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From a41b60092f0bc7bd27461d786662e92c39375e69 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 07/37] musl: add support for SIGEV_THREAD_ID timers

https://git.musl-libc.org/cgit/musl/commit/?id=7c71792e87691451f2a6b76348e83ad1889f1dcb
---
 ...d-support-for-SIGEV_THREAD_ID-timers.patch | 74 +++++++++++++++++++
 srcpkgs/musl/template                         |  2 +-
 2 files changed, 75 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch

diff --git a/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
new file mode 100644
index 000000000000..e20dff5ba0d4
--- /dev/null
+++ b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
@@ -0,0 +1,74 @@
+From 7c71792e87691451f2a6b76348e83ad1889f1dcb Mon Sep 17 00:00:00 2001
+From: James Y Knight <jyknight@google.com>
+Date: Sun, 30 Jun 2019 21:55:20 -0400
+Subject: [PATCH] add support for SIGEV_THREAD_ID timers
+
+This is like SIGEV_SIGNAL, but targeted to a particular thread's
+tid, rather than the process.
+---
+ include/signal.h        | 16 +++++++++++++---
+ src/time/timer_create.c |  8 ++++++--
+ 2 files changed, 19 insertions(+), 5 deletions(-)
+
+diff --git a/include/signal.h b/include/signal.h
+index fbdf667b2..9ed929e4f 100644
+--- a/include/signal.h
++++ b/include/signal.h
+@@ -180,14 +180,24 @@ struct sigevent {
+ 	union sigval sigev_value;
+ 	int sigev_signo;
+ 	int sigev_notify;
+-	void (*sigev_notify_function)(union sigval);
+-	pthread_attr_t *sigev_notify_attributes;
+-	char __pad[56-3*sizeof(long)];
++	union {
++		char __pad[64 - 2*sizeof(int) - sizeof(union sigval)];
++		pid_t sigev_notify_thread_id;
++		struct {
++			void (*sigev_notify_function)(union sigval);
++			pthread_attr_t *sigev_notify_attributes;
++		} __sev_thread;
++	} __sev_fields;
+ };
+ 
++#define sigev_notify_thread_id __sev_fields.sigev_notify_thread_id
++#define sigev_notify_function __sev_fields.__sev_thread.sigev_notify_function
++#define sigev_notify_attributes __sev_fields.__sev_thread.sigev_notify_attributes
++
+ #define SIGEV_SIGNAL 0
+ #define SIGEV_NONE 1
+ #define SIGEV_THREAD 2
++#define SIGEV_THREAD_ID 4
+ 
+ int __libc_current_sigrtmin(void);
+ int __libc_current_sigrtmax(void);
+diff --git a/src/time/timer_create.c b/src/time/timer_create.c
+index 5ddfda278..4bef23905 100644
+--- a/src/time/timer_create.c
++++ b/src/time/timer_create.c
+@@ -71,11 +71,15 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 	switch (evp ? evp->sigev_notify : SIGEV_SIGNAL) {
+ 	case SIGEV_NONE:
+ 	case SIGEV_SIGNAL:
++	case SIGEV_THREAD_ID:
+ 		if (evp) {
+ 			ksev.sigev_value = evp->sigev_value;
+ 			ksev.sigev_signo = evp->sigev_signo;
+ 			ksev.sigev_notify = evp->sigev_notify;
+-			ksev.sigev_tid = 0;
++			if (evp->sigev_notify == SIGEV_THREAD_ID)
++				ksev.sigev_tid = evp->sigev_notify_thread_id;
++			else
++				ksev.sigev_tid = 0;
+ 			ksevp = &ksev;
+ 		}
+ 		if (syscall(SYS_timer_create, clk, ksevp, &timerid) < 0)
+@@ -107,7 +111,7 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 
+ 		ksev.sigev_value.sival_ptr = 0;
+ 		ksev.sigev_signo = SIGTIMER;
+-		ksev.sigev_notify = 4; /* SIGEV_THREAD_ID */
++		ksev.sigev_notify = SIGEV_THREAD_ID;
+ 		ksev.sigev_tid = td->tid;
+ 		if (syscall(SYS_timer_create, clk, &ksev, &timerid) < 0)
+ 			timerid = -1;
diff --git a/srcpkgs/musl/template b/srcpkgs/musl/template
index 5bdc5c48e623..34e6ed4fba6e 100644
--- a/srcpkgs/musl/template
+++ b/srcpkgs/musl/template
@@ -2,7 +2,7 @@
 pkgname=musl
 reverts="1.2.0_1"
 version=1.1.24
-revision=10
+revision=11
 archs="*-musl"
 bootstrap=yes
 build_style=gnu-configure

From 2775ba828483a3da38bb8d69051884afbca053d9 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 08/37] gcc-multilib: update to 12.2.0.

---
 srcpkgs/gcc-multilib/template | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index fcd25755aa75..df60849babc2 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,16 +3,16 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _majorver="${version%.*}"
-wrksrc=gcc-${version/pre/_pre}
+wrksrc="gcc-${version}"
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel
@@ -71,7 +71,7 @@ do_build() {
 	make ${makejobs}
 }
 do_install() {
-	local _pc_triplet=x86_64-pc-linux-gnu _version=${version%pre1}
+	local _pc_triplet=x86_64-pc-linux-gnu
 	# Install to a tempdir and then only copy relevant files.
 	cd ${wrksrc}
 	make DESTDIR=${wrksrc}/${pkgname}-build install
@@ -81,9 +81,9 @@ do_install() {
 	vmkdir usr/include/c++/${_majorver}/${_triplet}
 	vmkdir usr/lib/gcc/${_triplet}/${_majorver}
 
-	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${_version}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${version}/32 \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_majorver}/
-	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${_version}/${_pc_triplet}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${version}/${_pc_triplet}/32 \
 		${DESTDIR}/usr/include/c++/${_majorver}/${_triplet}
 
 	vinstall ${wrksrc}/host-${_pc_triplet}/gcc/specs 644 usr/lib/gcc/${_triplet}/${_majorver}

From b738aeca90654c680f978125f7f4663ac13628fc Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 09/37] libgccjit: update to 12.2.0.

---
 srcpkgs/libgccjit/files/libgccjit-musl.patch | 63 --------------------
 srcpkgs/libgccjit/template                   | 24 +++-----
 2 files changed, 9 insertions(+), 78 deletions(-)
 delete mode 100644 srcpkgs/libgccjit/files/libgccjit-musl.patch

diff --git a/srcpkgs/libgccjit/files/libgccjit-musl.patch b/srcpkgs/libgccjit/files/libgccjit-musl.patch
deleted file mode 100644
index d2ed16928c82..000000000000
--- a/srcpkgs/libgccjit/files/libgccjit-musl.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-diff --git a/gcc/jit/jit-playback.c b/gcc/jit/jit-playback.c
-index 5bccf591a..35f5e35ef 100644
---- a/gcc/jit/jit-playback.c
-+++ b/gcc/jit/jit-playback.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -41,8 +43,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "diagnostic.h"
- #include "stmt.h"
- 
--#include <pthread.h>
--
- #include "jit-playback.h"
- #include "jit-result.h"
- #include "jit-builtins.h"
-diff --git a/gcc/jit/jit-recording.c b/gcc/jit/jit-recording.c
-index a237d574f..5785e3269 100644
---- a/gcc/jit/jit-recording.c
-+++ b/gcc/jit/jit-recording.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -25,8 +27,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "pretty-print.h"
- #include "toplev.h"
- 
--#include <pthread.h>
--
- #include "jit-builtins.h"
- #include "jit-recording.h"
- #include "jit-playback.h"
-diff --git a/gcc/jit/libgccjit.c b/gcc/jit/libgccjit.c
-index f9c33c63c..75f21d275 100644
---- a/gcc/jit/libgccjit.c
-+++ b/gcc/jit/libgccjit.c
-@@ -18,13 +18,13 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
- #include "timevar.h"
- #include "typed-splay-tree.h"
- #include "cppbuiltin.h"
--#include <pthread.h>
- 
- #include "libgccjit.h"
- #include "jit-recording.h"
diff --git a/srcpkgs/libgccjit/template b/srcpkgs/libgccjit/template
index 0b37c3ee9f8b..fde1affd54b7 100644
--- a/srcpkgs/libgccjit/template
+++ b/srcpkgs/libgccjit/template
@@ -3,18 +3,12 @@
 # which use the version number.
 
 pkgname=libgccjit
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
+version=12.2.0
 revision=1
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
-_majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 create_wrksrc=yes
 short_desc="Just-In-Time Compilation library for GCC"
 maintainer="Lane Biocini <lane@mailbox.org>"
@@ -22,16 +16,16 @@ homepage="https://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 nopie=yes
 lib32disabled=yes
 makedepends="zlib-devel"

From d8dd8f8825c0404e6a3071d731e7c0a516075418 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 10/37] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove -no-pie from build. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..5d40f0cdd8a6 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -53,6 +53,7 @@ _void_cross_build_binutils() {
 		--sbindir=/usr/bin \
 		--libdir=/usr/lib \
 		--libexecdir=/usr/lib \
+		--sysconfdir=/etc \
 		--target=${tgt} \
 		--with-sysroot=/usr/${tgt} \
 		--disable-nls \
@@ -60,7 +61,9 @@ _void_cross_build_binutils() {
 		--disable-multilib \
 		--disable-werror \
 		--disable-gold \
+		--disable-gprofng \
 		--enable-relro \
+		--enable-new-dtags \
 		--enable-plugins \
 		--enable-64-bit-bfd \
 		--enable-deterministic-archives \
@@ -132,6 +135,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -460,6 +464,14 @@ do_build() {
 	local binutils_ver linux_ver gcc_ver libc_ver libucontext_ver
 	local tgt=${sourcepkg/cross-}
 
+	export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}"
+	export CXXFLAGS="${CXXFLAGS/-D_FORTIFY_SOURCE=2/}"
+
+	# Disable explicit -fno-PIE, gcc/binutils/libc will figure this out itself.
+	export CFLAGS="${CFLAGS//-fno-PIE/}"
+	export CXXFLAGS="${CXXFLAGS//-fno-PIE/}"
+	export LDFLAGS="${LDFLAGS//-no-pie/}"
+
 	_void_cross_test_ver binutils
 	_void_cross_test_ver linux
 	_void_cross_test_ver gcc
@@ -625,6 +637,9 @@ do_install() {
 	# then remove it because it conflicts with libquadmath package
 	rm -rf ${DESTDIR}/${sysroot}/usr/lib/libquadmath.*
 
+	# Remove libdep linker plugin because it conflicts with system binutils
+	rm -f ${DESTDIR}/usr/lib/bfd-plugins/libdep*
+
 	# Remove leftover symlinks
 	rm -f ${DESTDIR}/usr/lib${XBPS_TARGET_WORDSIZE}
 	rm -f ${DESTDIR}/lib*

From 353a5f82295500604121c8bdddd5558c12d70e2a Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 11/37] subversion: fix build for libtool 2.4.7

---
 srcpkgs/subversion/template | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/subversion/template b/srcpkgs/subversion/template
index be37f60f9679..a1eaf4565d0b 100644
--- a/srcpkgs/subversion/template
+++ b/srcpkgs/subversion/template
@@ -24,6 +24,8 @@ distfiles="https://archive.apache.org/dist/subversion/subversion-${version}.tar.
 checksum=c9130e8d0b75728a66f0e7038fc77052e671830d785b5616aad53b4810d3cc28
 
 pre_configure() {
+	./autogen.sh --release
+
 	# Based on native build values
 	cat <<-EOF >config.cache
 	ac_cv_python_includes=-I${XBPS_CROSS_BASE}/usr/include/python${py3_ver}
@@ -59,7 +61,12 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+
+	if [ "$XBPS_BUILD_ENVIRONMENT" = "void-packages-ci" ]; then
+		# This test will fail when run as the root user,
+		# because flock() will ignore file permissions.
+		vsed -i subversion/tests/libsvn_fs/locks-test.c -e '/SVN_TEST_OPTS_PASS(obtain_write_lock_failure,/,+3d'
+	fi
 }
 
 post_configure() {

From 7a6ae3958d6699d6e7832384fe8a9cad8c727441 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 12/37] subversion-kwallet-auth: fix build for libtool 2.4.7.

Fix failing distfiles.
Fix build for libtool 2.4.7
---
 srcpkgs/subversion-kwallet-auth/template | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/subversion-kwallet-auth/template b/srcpkgs/subversion-kwallet-auth/template
index fd3e7f1ca5cb..de248a83e7e1 100644
--- a/srcpkgs/subversion-kwallet-auth/template
+++ b/srcpkgs/subversion-kwallet-auth/template
@@ -26,6 +26,8 @@ checksum=c9130e8d0b75728a66f0e7038fc77052e671830d785b5616aad53b4810d3cc28
 lib32disabled=yes
 
 pre_configure() {
+	./autogen.sh --release
+
 	# Based on native build values
 	cat <<-EOF >config.cache
 	ac_cv_python_includes=-I${XBPS_CROSS_BASE}/usr/include/python${py3_ver}
@@ -55,11 +57,18 @@ pre_configure() {
 		cp "$XBPS_CROSS_BASE/usr/lib/perl5/core_perl/Config"*.p? $PERL5LIB
 		cp "$XBPS_CROSS_BASE/usr/lib/perl5/core_perl/Errno.pm" $PERL5LIB
 		vsed -e "s;archlibexp => '\(.*\)';archlibexp => '${XBPS_CROSS_BASE}\1';" \
-			-i $PERL5LIB/Config.pm $PERL5LIB/Config_heavy.pl
+			-i $PERL5LIB/Config.pm
+		vsed -e "s;archlibexp='\(.*\)';archlibexp='${XBPS_CROSS_BASE}\1';" \
+			-i $PERL5LIB/Config_heavy.pl
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+
+	if [ "$XBPS_BUILD_ENVIRONMENT" = "void-packages-ci" ]; then
+		# This test will fail when run as the root user,
+		# because flock() will ignore file permissions.
+		vsed -i subversion/tests/libsvn_fs/locks-test.c -e '/SVN_TEST_OPTS_PASS(obtain_write_lock_failure,/,+3d'
+	fi
 }
 
 post_configure() {

From 2867740b2f72d1e1ead020506cec89dbfd9ccb18 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 13/37] qemu: remove broken patch

The necessary patch has been imported into musl so no need
to cast the sigevent struct to a more glibc-like one.
---
 .../musl-fix-sigevent-and-sigval_t.patch      | 27 -------------------
 1 file changed, 27 deletions(-)
 delete mode 100644 srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch

diff --git a/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch b/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch
deleted file mode 100644
index 4b4f1117c15f..000000000000
--- a/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-Note: Remove this patch with musl 1.2.2
-
---- a/linux-user/syscall.c
-+++ b/linux-user/syscall.c
-@@ -5020,10 +5020,21 @@
- #ifndef HAVE_SIGEV_NOTIFY_THREAD_ID
- #define sigev_notify_thread_id _sigev_un._tid
- #endif
- 
--static inline abi_long target_to_host_sigevent(struct sigevent *host_sevp,
-+struct host_sigevent {
-+    union sigval sigev_value;
-+    int sigev_signo;
-+    int sigev_notify;
-+    union {
-+       char _pad[64 - sizeof(int) * 2 - sizeof(union sigval)];
-+       int _tid;
-+    } _sigev_un;
-+};
-+
-+static inline abi_long target_to_host_sigevent(struct sigevent *sevp,
-                                                abi_ulong target_addr)
- {
-+    struct host_sigevent *host_sevp = (struct host_sigevent *) sevp;
-     struct target_sigevent *target_sevp;
- 
-     if (!lock_user_struct(VERIFY_READ, target_sevp, target_addr, 1)) {

From a2af0b742579f9cfb74a430a8a8f1be5adce78b4 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 14/37] cross-aarch64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..9e6fb75c198d 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Leah Neukirchen <leah@vuxu.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 5947f6c56f0ae9dd610ad80c6b2889251c7a63ad Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 15/37] cross-aarch64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..ba14c96bccea 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 8ae22a466beefb1c236d277ca0dec80173af9c89 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 16/37] cross-arm-linux-gnueabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..5c774e16f430 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From d6935f08fbba77701f9197271e3c2d33f4ff69d8 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 17/37] cross-arm-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..d6298ab639a4 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 55b1af82ca53def4f34c17c63758cf82e034831f Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 18/37] cross-arm-linux-musleabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..24df78e8fd8e 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From ec2a53c9e2cb85834767654e781d4ba4ecf905f6 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 19/37] cross-arm-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..8093700f909c 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From dfdae39a78d9a208fb79f045b0ede03e8d0a8cd0 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 20/37] cross-armv7l-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..92665326428b 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 39bbe420924aec5cf7b3335f110d90dcfdfbcc39 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 21/37] cross-armv7l-linux-musleabihf: update to gcc 12.2.0.

---
 .../cross-armv7l-linux-musleabihf/template    | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..e5af2c9ccbf2 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 062fa455de2b6e760d3129f605a68a0ae6614eee Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 22/37] cross-i686-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-i686-linux-musl/template b/srcpkgs/cross-i686-linux-musl/template
index 8be16a230d8d..d624bb7a3254 100644
--- a/srcpkgs/cross-i686-linux-musl/template
+++ b/srcpkgs/cross-i686-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-i686-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-i686-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 16a8ccfa311e915f94ebf689ce4da27e71a28a2f Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 23/37] cross-i686-pc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..6a9e54db807a 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,14 +1,15 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -16,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From b1cf96651bceb4359d7cdfacc5d5add9788fdc4a Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 24/37] cross-mips-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-musl/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..67a5c413396c 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From c820cde3916d636d3ba85a2b7b424b1330022764 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 25/37] cross-mips-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..bdf8600ce95b 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="hipperson0 <hipperson0@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From a272ab483787cea28655994f9e5f49a87d1fd31c Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 26/37] cross-mipsel-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..de49387d517b 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 3d855836b250f8cdc2a3347837f5759ada804fa5 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 27/37] cross-mipsel-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..b27ce6475a38 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From a5a8248cf08d93c6dcc0ea9029f46e667a4533b7 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 28/37] cross-powerpc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..79579e093b12 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 6f4d3984acbb1aa49291bc55ba253460d565f467 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 29/37] cross-powerpc-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..9bb6acd359b6 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 9f9cbfef9c111e5bccb6caa5fa7c82cb04e574e4 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 30/37] cross-powerpc64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..2d153d00add6 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,16 +1,17 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
  --enable-targets=powerpc-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -18,12 +19,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 15471d491c5d816e11a2b62d7d404824e9bc0c36 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 31/37] cross-powerpc64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 016f18776a6d..e0848fe0bff7 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,30 +1,31 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From d0813642ee83d5899904f0df1859ee52f4b65804 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 32/37] cross-powerpc64le-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 463d7e92d20d..8d8e010e15c0 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,16 +1,17 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
  --enable-targets=powerpcle-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -18,12 +19,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 43090dbc47cfadefbe985241b8d3bd9dd5a90dde Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 33/37] cross-powerpc64le-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index c17a3cccfe29..0915e524545f 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,30 +1,31 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From af9bb0648c22d86912138dd91fa2c0496a56333b Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 34/37] cross-powerpcle-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 9aede3c465ce..687be8a44c6c 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 
@@ -35,6 +36,8 @@ if [ "$XBPS_TARGET_MACHINE" = "ppcle" ]; then
 	broken="Can't build crosstoolchain to itself"
 fi
 
+broken="glibc uses big-endian specific instructions on 32-bit powerpc"
+
 cross-powerpcle-linux-gnu-libc_package() {
 	short_desc+=" - glibc files"
 	nostrip=yes

From 3cdc53234c805b307df3bc6caec8dc7fcb721043 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 35/37] cross-powerpcle-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index 045cfda987fe..bb984b9c42eb 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From ebe7e002a8f6a9a6e31a3d68083af72eed7d6add Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:30 -0800
Subject: [PATCH 36/37] cross-x86_64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 8918f3c22a1c..930aaf2a508b 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,14 +1,15 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -16,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 3af6eacb0759c1b6bbc7d468581060a82567b0dc Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:30 -0800
Subject: [PATCH 37/37] cross-x86_64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..ac5b1c46ab82 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (216 preceding siblings ...)
  2022-11-06 19:33 ` [PR PATCH] [Updated] " oreo639
@ 2022-11-08 18:27 ` oreo639
  2022-11-08 19:06 ` oreo639
                   ` (46 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-11-08 18:27 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5448 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.2.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.2.0

There is a list of failing builds here: https://github.com/void-linux/void-packages/issues/39809

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [x] llvm https://github.com/void-linux/void-packages/pull/38694
- [x] m4 https://github.com/void-linux/void-packages/pull/33730
- [x] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [x] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [x] libvirt https://github.com/void-linux/void-packages/pull/38842
- [x] syslinux https://github.com/void-linux/void-packages/pull/38876
- [x] efivar https://github.com/void-linux/void-packages/pull/38874
- [x] gpgme https://github.com/void-linux/void-packages/pull/38825

Known packages that needed to be fixed/updated for gcc12:
- [x] openssh https://github.com/void-linux/void-packages/pull/38849
- [x] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [x] doxygen https://github.com/void-linux/void-packages/pull/38846
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] libproxy https://github.com/void-linux/void-packages/pull/38818
- [x] exempi https://github.com/void-linux/void-packages/pull/38820
- [x] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [x] libunique1 https://github.com/void-linux/void-packages/pull/38848 or https://github.com/void-linux/void-packages/pull/38873
- [x] libwpd https://github.com/void-linux/void-packages/pull/38878
- [x] cglm https://github.com/void-linux/void-packages/pull/39748
- [x] coreboot-utils https://github.com/void-linux/void-packages/pull/39749
- [x] apl https://github.com/void-linux/void-packages/pull/39750
- [x] igt-gpu-tools https://github.com/void-linux/void-packages/pull/39780

Needs to be fixed/updated for binutils:
- [x] grub https://github.com/void-linux/void-packages/pull/38875
- [x] linux-tools https://github.com/void-linux/void-packages/pull/38877
- [x] kcov https://github.com/void-linux/void-packages/pull/39291

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [x] kde
- [x] lxde
- [x] lxqt

You can test the ISOs here:
https://drive.google.com/drive/folders/1ix92CYSLUP-KWjLxltdgG4e8Nu2JCY5n?usp=sharing

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 133044 bytes --]

From 3d1af9cb3224974015503e6b5fc1018e6b102463 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 01/37] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../fix-libcollector-without-java.patch       | 53 +++++++++++++++
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 25 ++++---
 4 files changed, 87 insertions(+), 117 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
 create mode 100644 srcpkgs/binutils/patches/fix-libcollector-without-java.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/fix-libcollector-without-java.patch b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
new file mode 100644
index 000000000000..54384875f358
--- /dev/null
+++ b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
@@ -0,0 +1,53 @@
+From 49ddd814ac1071af7c4f45d5f8398b91862f2c7f Mon Sep 17 00:00:00 2001
+From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
+Date: Wed, 17 Aug 2022 19:55:23 -0700
+Subject: [PATCH] gprofng: fix bug 29479 Collection fails when built without
+ java support
+
+gprofng/ChangeLog
+2022-08-17  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>
+
+	PR gprofng/29479
+	* libcollector/collector.c: Add #if defined(GPROFNG_JAVA_PROFILING) for
+	java specific code.
+	* libcollector/unwind.c: Likewise.
+---
+ gprofng/libcollector/collector.c | 2 ++
+ gprofng/libcollector/unwind.c    | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/gprofng/libcollector/collector.c b/gprofng/libcollector/collector.c
+index 93c9d3330de5..ceff2c1caccb 100644
+--- a/gprofng/libcollector/collector.c
++++ b/gprofng/libcollector/collector.c
+@@ -913,8 +913,10 @@ __collector_open_experiment (const char *exp, const char *params, sp_origin_t or
+   __collector_ext_unwind_key_init (1, NULL);
+ 
+   /* start java attach if suitable */
++#if defined(GPROFNG_JAVA_PROFILING)
+   if (exp_origin == SP_ORIGIN_DBX_ATTACH)
+     __collector_jprofile_start_attach ();
++#endif
+   start_sec_time = CALL_UTIL (time)(NULL);
+   __collector_start_time = collector_interface.getHiResTime ();
+   TprintfT (DBG_LT0, "\t__collector_open_experiment; resetting start_time\n");
+diff --git a/gprofng/libcollector/unwind.c b/gprofng/libcollector/unwind.c
+index 119243788020..f8e11823c81e 100644
+--- a/gprofng/libcollector/unwind.c
++++ b/gprofng/libcollector/unwind.c
+@@ -557,6 +557,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+   int size = max_frame_size;
+ 
+ #define MIN(a,b) ((a)<(b)?(a):(b))
++#if defined(GPROFNG_JAVA_PROFILING)
+   /* get Java info */
+   if (__collector_java_mode && __collector_java_asyncgetcalltrace_loaded && context && !pseudo_context)
+     {
+@@ -569,6 +570,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+ 	  size -= sz;
+ 	}
+     }
++#endif
+ 
+   /* get native stack */
+   if (context)
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..c355a5fc8016 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkgconf"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -35,15 +36,21 @@ do_configure() {
 	local conf
 
 	if [ "$CHROOT_READY" ]; then
-		conf+=" --with-debuginfod"
+		conf+=" --with-debuginfod --enable-shared"
 	else
-		conf+=" --without-debuginfod --disable-install-libbfd"
+		conf+=" --without-debuginfod --disable-shared --disable-install-libbfd"
 	fi
 	if [ "$CROSS_BUILD" ]; then
 		# we don't want --with-sysroot=${XBPS_CROSS_BASE} like gnu-configure
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	# gprofng currently only supports x86 and aarch64 glibc.
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64|i386|aarch64) conf+=" --enable-gprofng" ;;
+		*) conf+=" --disable-gprofng" ;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"
@@ -76,13 +83,14 @@ do_configure() {
 		--libdir=/usr/lib \
 		--mandir=/usr/share/man \
 		--infodir=/usr/share/info \
+		--sysconfdir=/etc \
 		--disable-werror \
-		--disable-shared \
 		--disable-nls \
 		--enable-threads \
 		--enable-plugins \
 		--enable-relro \
 		--enable-gold \
+		--enable-new-dtags \
 		--enable-deterministic-archives \
 		--enable-64-bit-bfd \
 		--enable-ld=default \
@@ -142,7 +150,8 @@ binutils-devel_package() {
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/*.a"
-		vmove "usr/lib/*.so"
+		vmove "usr/lib/libbfd.so"
+		vmove "usr/lib/libopcodes.so"
 	}
 }
 

From d21c0ca1eb52dc6b8db27aefd436fc882b567562 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 02/37] gdb: resolve conflict with binutils 2.39

---
 srcpkgs/gdb/template | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/gdb/template b/srcpkgs/gdb/template
index 9c5f17ffc519..5970402eb27e 100644
--- a/srcpkgs/gdb/template
+++ b/srcpkgs/gdb/template
@@ -48,7 +48,8 @@ vopt_conflict debuginfod static
 
 post_install() {
 	# resolve conflicts with binutils
-	rm -r ${DESTDIR}/usr/{include,lib,share/info/bfd.info*}
+	rm -rf ${DESTDIR}/usr/{include,lib}
+	rm -rf ${DESTDIR}/usr/share/info/{bfd,ctf-spec}.info*
 }
 
 gdb-common_package() {

From 1e8a07258a6a258852a141da3013ede45f724ac3 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 03/37] gcc: update to 12.2.0.

---
 common/shlibs                                 | 10 +--
 srcpkgs/gcc/files/gccgo-musl.patch            | 71 +++------------
 srcpkgs/gcc/files/libgnarl-musl.patch         | 18 ++--
 srcpkgs/gcc/files/libssp-musl.patch           | 10 +--
 srcpkgs/gcc/patches/libffi_gnulinux.patch     | 11 ---
 .../gcc/patches/libgcc-ibm128-no-tag.patch    | 10 ++-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |  2 +-
 srcpkgs/gcc/template                          | 87 +++++++++----------
 8 files changed, 80 insertions(+), 139 deletions(-)
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index 5136df346db0..116561080072 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.2.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.36 perl-5.36.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -858,8 +858,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.2.0_1
+libgnat-12.so libada-12.2.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1711,8 +1711,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.2.0_1
+libasan.so.8 libsanitizer-12.2.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..12ec68dd8aa3 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,14 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ b/libgo/go/runtime/os_linux.go
+@@ -365,7 +365,7 @@ func setThreadCPUProfiler(hz int32) {
+ 	var sevp _sigevent
+ 	sevp.sigev_notify = _SIGEV_THREAD_ID
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.__sev_fields))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index ab3643de4f98..a20af7c0ef2e 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,14 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
+version=12.2.0
+revision=1
+_minorver="${version%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 create_wrksrc=yes
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +18,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -52,8 +48,11 @@ if [ "$CHROOT_READY" ]; then
 	hostmakedepends="tar texinfo perl flex"
 else
 	_have_gccgo=no
+	# libzstd fails to link in bootstrap with glibc 2.36
+	# when zlib has been compiled with glibc 2.32.
+	LDFLAGS="-lzstd -pthread"
 fi
-makedepends="zlib-devel"
+makedepends="zlib-devel libzstd-devel"
 depends="binutils libgcc-devel-${version}_${revision}
  libstdc++-devel-${version}_${revision} libssp-devel-${version}_${revision}"
 checkdepends="dejagnu"
@@ -70,13 +69,13 @@ if [ "$build_option_gnatboot" ]; then
 	case "$XBPS_TARGET_MACHINE" in
 	x86_64)
 		_gnat_tarball="gnat-gpl-2017-x86_64-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/591c6d80c7a447af2deed1d7>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/9682e2e1f2f232ce03fe21d77b14c37a0de5649b?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" b942bcac20dea39748b39f8b624d9619f60a8dee2e8195dbe3829c835b0956e6"
 		build_options_default="gnatboot"
 		;;
 	i686)
 		_gnat_tarball="gnat-gpl-2014-x86-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/564b3e9dc8e196b040fbe248>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/c5e9e6fdff5cb77ed90cf8c62536653e27c0bed6?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" 3b693510f5d22a240abb3034934c1adbd80ccd6e4f61a4f491cc408fdfd9c042"
 		build_options_default="gnatboot"
 		;;
@@ -155,8 +154,8 @@ if [ "$CROSS_BUILD" ]; then
 fi
 
 post_extract() {
-	mv gcc-${version/pre/_pre}/* gcc-${version/pre/_pre}/.??* .
-	rmdir gcc-${version/pre/_pre}
+	mv gcc-${version}/* gcc-${version}/.??* .
+	rmdir gcc-${version}
 	mv gmp-${_gmp_version} gmp
 	mv mpfr-${_mpfr_version} mpfr
 	mv mpc-${_mpc_version} mpc
@@ -186,9 +185,9 @@ pre_configure() {
 	sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
 
 	if [ "$XBPS_TARGET_LIBC" = musl ]; then
-		patch -p1 -i ${FILESDIR}/libgnarl-musl.patch
-		patch -p1 -i ${FILESDIR}/libssp-musl.patch
-		patch -p1 -i ${FILESDIR}/gccgo-musl.patch
+		for p in ${FILESDIR}/*-musl.patch; do
+			patch -p1 -i $p
+		done
 	fi
 }
 do_configure() {
@@ -343,16 +342,16 @@ do_install() {
 
 	# Make version a symlink of major version to make all versions
 	# from the same series work automagically.
-	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver} \
+	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${version} \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver}
 	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver} \
-		${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}
+		${DESTDIR}/usr/lib/gcc/${_triplet}/${version}
 
 	# Ditto for c++ headers.
-	mv ${DESTDIR}/usr/include/c++/${_patchver} \
+	mv ${DESTDIR}/usr/include/c++/${version} \
 		${DESTDIR}/usr/include/c++/${_minorver}
 	ln -sfr ${DESTDIR}/usr/include/c++/${_minorver} \
-		${DESTDIR}/usr/include/c++/${_patchver}
+		${DESTDIR}/usr/include/c++/${version}
 
 	# cc symlink
 	ln -sfr ${DESTDIR}/usr/bin/gcc ${DESTDIR}/usr/bin/cc
@@ -361,7 +360,7 @@ do_install() {
 
 	# lto plugin symlink
 	vmkdir usr/lib/bfd-plugins
-	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}/liblto_plugin.so \
+	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${version}/liblto_plugin.so \
 		${DESTDIR}/usr/lib/bfd-plugins
 
 	# Remove "fixed" header
@@ -372,13 +371,9 @@ do_install() {
 	rm -f ${DESTDIR}/usr/lib/libffi*
 	rm -f ${DESTDIR}/usr/share/man/man3/ffi*
 
-	# Remove all python scripts in libdir.
-	rm -f ${DESTDIR}/usr/lib/*.py
-
-	# Remove more python stuff.
-	if [ -d ${DESTDIR}/usr/share/gcc-${_patchver}/python ]; then
-		rm -rf ${DESTDIR}/usr/share/gcc-${_patchver}/python
-	fi
+	# Move libstdc++ gdb helpers to location where gdb can autoload them
+	mkdir -p ${DESTDIR}/usr/share/gdb/auto-load/usr/lib
+	mv ${DESTDIR}/usr/lib/*.py ${DESTDIR}/usr/share/gdb/auto-load/usr/lib
 
 	# Install c89 and c99 wrappers and its manpages, from NetBSD.
 	for f in c89 c99; do
@@ -397,7 +392,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}
@@ -450,7 +445,7 @@ gcc-fortran_package() {
 		if [ "$CROSS_BUILD" ]; then
 			# A number of OMP modules are not built when cross
 			# compiling gcc. Copy them from the cross compiler.
-			local src="/usr/lib/gcc/${_triplet}/${_patchver}/finclude"
+			local src="/usr/lib/gcc/${_triplet}/${version}/finclude"
 			local dst="usr/lib/gcc/${_triplet}/${_minorver}/finclude"
 			for f in omp_lib.f90 omp_lib.h omp_lib.mod omp_lib_kinds.mod \
 				openacc.f90 openacc.mod openacc_kinds.mod openacc_lib.h; do
@@ -517,7 +512,7 @@ libgfortran_package() {
 	short_desc+=" - Fortran library"
 	pkg_install() {
 		vmove "usr/lib/libgfortran.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -538,7 +533,7 @@ libgo_package() {
 	nostrip=yes
 	pkg_install() {
 		vmove "usr/lib/libgo.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -554,7 +549,7 @@ libobjc_package() {
 	short_desc+=" - Objective-C library"
 	pkg_install() {
 		vmove "usr/lib/libobjc.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -573,7 +568,7 @@ libquadmath_package() {
 	short_desc+=" - quadmath library"
 	pkg_install() {
 		vmove "usr/lib/libquadmath.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -615,7 +610,7 @@ libgcc_package() {
 	noverifyrdeps=yes
 	pkg_install() {
 		vmove "usr/lib/libgcc_s.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -646,7 +641,7 @@ libgomp_package() {
 	short_desc+=" - OpenMP v4.0 library"
 	pkg_install() {
 		vmove "usr/lib/libgomp*.so.*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -701,7 +696,7 @@ libssp_package() {
 	short_desc+=" - SSP (StackSmashingProtection) library"
 	pkg_install() {
 		vmove "usr/lib/libssp.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -718,7 +713,9 @@ libstdc++-devel_package() {
 libstdc++_package() {
 	short_desc+=" - Standard C++ Library"
 	pkg_install() {
+		vmove usr/share/gdb
+		vmove usr/share/gcc-${version}/python
 		vmove "usr/lib/libstdc++.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }

From f0b7008824c9e72ad910e5b16a5dc41071e7ea00 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 04/37] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      | 11 ++++--
 2 files changed, 25 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..a4087ec2055e 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,12 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
+
+if [ "$XBPS_TARGET_LIBC" == "musl" ]; then
+	# Musl always searches LD_LIBRARY_PATH before RPATH and RUNPATH
+	make_build_args="lt_cv_shlibpath_overrides_runpath=yes"
+fi
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From 879b982e1f21accee62fbf7b8e0b6f475f19187d Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 05/37] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 7e01bbb851fd..d9618e3806ba 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 build_wrksrc=libiberty
 build_style=gnu-configure
@@ -10,7 +10,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From f78a759f480b9f9ee439814e596d6331c651a420 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 06/37] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 ...e-hash-style-both-for-building-glibc.patch |  51 ++++
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 4 files changed, 106 insertions(+), 353 deletions(-)
 create mode 100644 srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index 116561080072..b81d568d3c5c 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch b/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
new file mode 100644
index 000000000000..9c5553e92609
--- /dev/null
+++ b/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
@@ -0,0 +1,51 @@
+Temporary workaround for EAC bug.
+
+See: https://sourceware.org/bugzilla/show_bug.cgi?id=29456
+
+From 8e90e2cc5e57d7ca3a40602d278e9642a8b66716 Mon Sep 17 00:00:00 2001
+From: oreo639 <oreo6391@gmail.com>
+Date: Tue, 13 Sep 2022 14:30:35 -0700
+Subject: [PATCH] Revert "Do not use --hash-style=both for building glibc
+ shared objects"
+
+This reverts commit e47de5cb2d4dbecb58f569ed241e8e95c568f03c.
+---
+ Makeconfig     |  9 +++++++++
+ Makerules      |  7 +++++++
+ 5 files changed, 61 insertions(+)
+
+diff --git a/Makeconfig b/Makeconfig
+index ba70321af1..e2131d4389 100644
+--- a/Makeconfig
++++ b/Makeconfig
+@@ -371,6 +371,13 @@ dt-relr-ldflag =
+ no-dt-relr-ldflag =
+ endif
+ 
++# For the time being we unconditionally use 'both'.  At some time we
++# should declare statically linked code as 'out of luck' and compile
++# with --hash-style=gnu only.
++hashstyle-LDFLAGS = -Wl,--hash-style=both
++LDFLAGS.so += $(hashstyle-LDFLAGS)
++LDFLAGS-rtld += $(hashstyle-LDFLAGS)
++
+ ifeq (no,$(build-pie-default))
+ pie-default = $(no-pie-ccflag)
+ else # build-pie-default
+diff --git a/Makerules b/Makerules
+index d1e139d03c..44134e37ce 100644
+--- a/Makerules
++++ b/Makerules
+@@ -558,6 +558,9 @@ $(common-objpfx)shlib.lds: $(common-objpfx)config.make $(..)Makerules
+ 		  -Wl,--verbose 2>/dev/null | \
+ 	  sed > $@T \
+ 	      -e '/^=========/,/^=========/!d;/^=========/d' \
++		   -e 's/^.*\.gnu\.hash[ 	]*:.*$$/  .note.ABI-tag : { *(.note.ABI-tag) } &/' \
++		   -e '/^[ 	]*\.hash[ 	]*:.*$$/{h;d;}' \
++		   -e '/DATA_SEGMENT_ALIGN/{H;g}' \
+ 	      -e 's/^.*\*(\.dynbss).*$$/& \
+ 		 PROVIDE(__start___libc_freeres_ptrs = .); \
+ 		 *(__libc_freeres_ptrs) \
+-- 
+2.37.3
+
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From efd10f6fde38166fbc882c392b93701709b83d0d Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 07/37] musl: add support for SIGEV_THREAD_ID timers

https://git.musl-libc.org/cgit/musl/commit/?id=7c71792e87691451f2a6b76348e83ad1889f1dcb
---
 ...d-support-for-SIGEV_THREAD_ID-timers.patch | 74 +++++++++++++++++++
 srcpkgs/musl/template                         |  2 +-
 2 files changed, 75 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch

diff --git a/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
new file mode 100644
index 000000000000..e20dff5ba0d4
--- /dev/null
+++ b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
@@ -0,0 +1,74 @@
+From 7c71792e87691451f2a6b76348e83ad1889f1dcb Mon Sep 17 00:00:00 2001
+From: James Y Knight <jyknight@google.com>
+Date: Sun, 30 Jun 2019 21:55:20 -0400
+Subject: [PATCH] add support for SIGEV_THREAD_ID timers
+
+This is like SIGEV_SIGNAL, but targeted to a particular thread's
+tid, rather than the process.
+---
+ include/signal.h        | 16 +++++++++++++---
+ src/time/timer_create.c |  8 ++++++--
+ 2 files changed, 19 insertions(+), 5 deletions(-)
+
+diff --git a/include/signal.h b/include/signal.h
+index fbdf667b2..9ed929e4f 100644
+--- a/include/signal.h
++++ b/include/signal.h
+@@ -180,14 +180,24 @@ struct sigevent {
+ 	union sigval sigev_value;
+ 	int sigev_signo;
+ 	int sigev_notify;
+-	void (*sigev_notify_function)(union sigval);
+-	pthread_attr_t *sigev_notify_attributes;
+-	char __pad[56-3*sizeof(long)];
++	union {
++		char __pad[64 - 2*sizeof(int) - sizeof(union sigval)];
++		pid_t sigev_notify_thread_id;
++		struct {
++			void (*sigev_notify_function)(union sigval);
++			pthread_attr_t *sigev_notify_attributes;
++		} __sev_thread;
++	} __sev_fields;
+ };
+ 
++#define sigev_notify_thread_id __sev_fields.sigev_notify_thread_id
++#define sigev_notify_function __sev_fields.__sev_thread.sigev_notify_function
++#define sigev_notify_attributes __sev_fields.__sev_thread.sigev_notify_attributes
++
+ #define SIGEV_SIGNAL 0
+ #define SIGEV_NONE 1
+ #define SIGEV_THREAD 2
++#define SIGEV_THREAD_ID 4
+ 
+ int __libc_current_sigrtmin(void);
+ int __libc_current_sigrtmax(void);
+diff --git a/src/time/timer_create.c b/src/time/timer_create.c
+index 5ddfda278..4bef23905 100644
+--- a/src/time/timer_create.c
++++ b/src/time/timer_create.c
+@@ -71,11 +71,15 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 	switch (evp ? evp->sigev_notify : SIGEV_SIGNAL) {
+ 	case SIGEV_NONE:
+ 	case SIGEV_SIGNAL:
++	case SIGEV_THREAD_ID:
+ 		if (evp) {
+ 			ksev.sigev_value = evp->sigev_value;
+ 			ksev.sigev_signo = evp->sigev_signo;
+ 			ksev.sigev_notify = evp->sigev_notify;
+-			ksev.sigev_tid = 0;
++			if (evp->sigev_notify == SIGEV_THREAD_ID)
++				ksev.sigev_tid = evp->sigev_notify_thread_id;
++			else
++				ksev.sigev_tid = 0;
+ 			ksevp = &ksev;
+ 		}
+ 		if (syscall(SYS_timer_create, clk, ksevp, &timerid) < 0)
+@@ -107,7 +111,7 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 
+ 		ksev.sigev_value.sival_ptr = 0;
+ 		ksev.sigev_signo = SIGTIMER;
+-		ksev.sigev_notify = 4; /* SIGEV_THREAD_ID */
++		ksev.sigev_notify = SIGEV_THREAD_ID;
+ 		ksev.sigev_tid = td->tid;
+ 		if (syscall(SYS_timer_create, clk, &ksev, &timerid) < 0)
+ 			timerid = -1;
diff --git a/srcpkgs/musl/template b/srcpkgs/musl/template
index 5bdc5c48e623..34e6ed4fba6e 100644
--- a/srcpkgs/musl/template
+++ b/srcpkgs/musl/template
@@ -2,7 +2,7 @@
 pkgname=musl
 reverts="1.2.0_1"
 version=1.1.24
-revision=10
+revision=11
 archs="*-musl"
 bootstrap=yes
 build_style=gnu-configure

From c6ab5301c59c66b5e4edcb6bf376447043cc6289 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 08/37] gcc-multilib: update to 12.2.0.

---
 srcpkgs/gcc-multilib/template | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index f28eb237c287..ba9bafcadfd6 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,15 +3,15 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _majorver="${version%.*}"
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel
@@ -70,7 +70,7 @@ do_build() {
 	make ${makejobs}
 }
 do_install() {
-	local _pc_triplet=x86_64-pc-linux-gnu _version=${version%pre1}
+	local _pc_triplet=x86_64-pc-linux-gnu
 	# Install to a tempdir and then only copy relevant files.
 	cd ${wrksrc}
 	make DESTDIR=${wrksrc}/${pkgname}-build install
@@ -80,9 +80,9 @@ do_install() {
 	vmkdir usr/include/c++/${_majorver}/${_triplet}
 	vmkdir usr/lib/gcc/${_triplet}/${_majorver}
 
-	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${_version}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${version}/32 \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_majorver}/
-	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${_version}/${_pc_triplet}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${version}/${_pc_triplet}/32 \
 		${DESTDIR}/usr/include/c++/${_majorver}/${_triplet}
 
 	vinstall ${wrksrc}/host-${_pc_triplet}/gcc/specs 644 usr/lib/gcc/${_triplet}/${_majorver}

From a1adcaf0c542770df9e3a85c0856b16eeac2d943 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 09/37] libgccjit: update to 12.2.0.

---
 srcpkgs/libgccjit/files/libgccjit-musl.patch | 63 --------------------
 srcpkgs/libgccjit/template                   | 24 +++-----
 2 files changed, 9 insertions(+), 78 deletions(-)
 delete mode 100644 srcpkgs/libgccjit/files/libgccjit-musl.patch

diff --git a/srcpkgs/libgccjit/files/libgccjit-musl.patch b/srcpkgs/libgccjit/files/libgccjit-musl.patch
deleted file mode 100644
index d2ed16928c82..000000000000
--- a/srcpkgs/libgccjit/files/libgccjit-musl.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-diff --git a/gcc/jit/jit-playback.c b/gcc/jit/jit-playback.c
-index 5bccf591a..35f5e35ef 100644
---- a/gcc/jit/jit-playback.c
-+++ b/gcc/jit/jit-playback.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -41,8 +43,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "diagnostic.h"
- #include "stmt.h"
- 
--#include <pthread.h>
--
- #include "jit-playback.h"
- #include "jit-result.h"
- #include "jit-builtins.h"
-diff --git a/gcc/jit/jit-recording.c b/gcc/jit/jit-recording.c
-index a237d574f..5785e3269 100644
---- a/gcc/jit/jit-recording.c
-+++ b/gcc/jit/jit-recording.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -25,8 +27,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "pretty-print.h"
- #include "toplev.h"
- 
--#include <pthread.h>
--
- #include "jit-builtins.h"
- #include "jit-recording.h"
- #include "jit-playback.h"
-diff --git a/gcc/jit/libgccjit.c b/gcc/jit/libgccjit.c
-index f9c33c63c..75f21d275 100644
---- a/gcc/jit/libgccjit.c
-+++ b/gcc/jit/libgccjit.c
-@@ -18,13 +18,13 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
- #include "timevar.h"
- #include "typed-splay-tree.h"
- #include "cppbuiltin.h"
--#include <pthread.h>
- 
- #include "libgccjit.h"
- #include "jit-recording.h"
diff --git a/srcpkgs/libgccjit/template b/srcpkgs/libgccjit/template
index 0b37c3ee9f8b..fde1affd54b7 100644
--- a/srcpkgs/libgccjit/template
+++ b/srcpkgs/libgccjit/template
@@ -3,18 +3,12 @@
 # which use the version number.
 
 pkgname=libgccjit
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
+version=12.2.0
 revision=1
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
-_majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 create_wrksrc=yes
 short_desc="Just-In-Time Compilation library for GCC"
 maintainer="Lane Biocini <lane@mailbox.org>"
@@ -22,16 +16,16 @@ homepage="https://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 nopie=yes
 lib32disabled=yes
 makedepends="zlib-devel"

From a767b0c46a75647f4c7345857711f5ea42a9fcdf Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 10/37] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove -no-pie from build. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..5d40f0cdd8a6 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -53,6 +53,7 @@ _void_cross_build_binutils() {
 		--sbindir=/usr/bin \
 		--libdir=/usr/lib \
 		--libexecdir=/usr/lib \
+		--sysconfdir=/etc \
 		--target=${tgt} \
 		--with-sysroot=/usr/${tgt} \
 		--disable-nls \
@@ -60,7 +61,9 @@ _void_cross_build_binutils() {
 		--disable-multilib \
 		--disable-werror \
 		--disable-gold \
+		--disable-gprofng \
 		--enable-relro \
+		--enable-new-dtags \
 		--enable-plugins \
 		--enable-64-bit-bfd \
 		--enable-deterministic-archives \
@@ -132,6 +135,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -460,6 +464,14 @@ do_build() {
 	local binutils_ver linux_ver gcc_ver libc_ver libucontext_ver
 	local tgt=${sourcepkg/cross-}
 
+	export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}"
+	export CXXFLAGS="${CXXFLAGS/-D_FORTIFY_SOURCE=2/}"
+
+	# Disable explicit -fno-PIE, gcc/binutils/libc will figure this out itself.
+	export CFLAGS="${CFLAGS//-fno-PIE/}"
+	export CXXFLAGS="${CXXFLAGS//-fno-PIE/}"
+	export LDFLAGS="${LDFLAGS//-no-pie/}"
+
 	_void_cross_test_ver binutils
 	_void_cross_test_ver linux
 	_void_cross_test_ver gcc
@@ -625,6 +637,9 @@ do_install() {
 	# then remove it because it conflicts with libquadmath package
 	rm -rf ${DESTDIR}/${sysroot}/usr/lib/libquadmath.*
 
+	# Remove libdep linker plugin because it conflicts with system binutils
+	rm -f ${DESTDIR}/usr/lib/bfd-plugins/libdep*
+
 	# Remove leftover symlinks
 	rm -f ${DESTDIR}/usr/lib${XBPS_TARGET_WORDSIZE}
 	rm -f ${DESTDIR}/lib*

From 86484db6e9db289e2bd6aeb1b7136e10404972fe Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 11/37] subversion: fix build for libtool 2.4.7

---
 srcpkgs/subversion/template | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/subversion/template b/srcpkgs/subversion/template
index be37f60f9679..a1eaf4565d0b 100644
--- a/srcpkgs/subversion/template
+++ b/srcpkgs/subversion/template
@@ -24,6 +24,8 @@ distfiles="https://archive.apache.org/dist/subversion/subversion-${version}.tar.
 checksum=c9130e8d0b75728a66f0e7038fc77052e671830d785b5616aad53b4810d3cc28
 
 pre_configure() {
+	./autogen.sh --release
+
 	# Based on native build values
 	cat <<-EOF >config.cache
 	ac_cv_python_includes=-I${XBPS_CROSS_BASE}/usr/include/python${py3_ver}
@@ -59,7 +61,12 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+
+	if [ "$XBPS_BUILD_ENVIRONMENT" = "void-packages-ci" ]; then
+		# This test will fail when run as the root user,
+		# because flock() will ignore file permissions.
+		vsed -i subversion/tests/libsvn_fs/locks-test.c -e '/SVN_TEST_OPTS_PASS(obtain_write_lock_failure,/,+3d'
+	fi
 }
 
 post_configure() {

From 29d55651c1c2b79acc61872d03bdaf87aaaeaef1 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 12/37] subversion-kwallet-auth: fix build for libtool 2.4.7.

Fix failing distfiles.
Fix build for libtool 2.4.7
---
 srcpkgs/subversion-kwallet-auth/template | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/subversion-kwallet-auth/template b/srcpkgs/subversion-kwallet-auth/template
index ec9a6ea7d974..319de334752e 100644
--- a/srcpkgs/subversion-kwallet-auth/template
+++ b/srcpkgs/subversion-kwallet-auth/template
@@ -25,6 +25,8 @@ checksum=c9130e8d0b75728a66f0e7038fc77052e671830d785b5616aad53b4810d3cc28
 lib32disabled=yes
 
 pre_configure() {
+	./autogen.sh --release
+
 	# Based on native build values
 	cat <<-EOF >config.cache
 	ac_cv_python_includes=-I${XBPS_CROSS_BASE}/usr/include/python${py3_ver}
@@ -54,11 +56,18 @@ pre_configure() {
 		cp "$XBPS_CROSS_BASE/usr/lib/perl5/core_perl/Config"*.p? $PERL5LIB
 		cp "$XBPS_CROSS_BASE/usr/lib/perl5/core_perl/Errno.pm" $PERL5LIB
 		vsed -e "s;archlibexp => '\(.*\)';archlibexp => '${XBPS_CROSS_BASE}\1';" \
-			-i $PERL5LIB/Config.pm $PERL5LIB/Config_heavy.pl
+			-i $PERL5LIB/Config.pm
+		vsed -e "s;archlibexp='\(.*\)';archlibexp='${XBPS_CROSS_BASE}\1';" \
+			-i $PERL5LIB/Config_heavy.pl
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+
+	if [ "$XBPS_BUILD_ENVIRONMENT" = "void-packages-ci" ]; then
+		# This test will fail when run as the root user,
+		# because flock() will ignore file permissions.
+		vsed -i subversion/tests/libsvn_fs/locks-test.c -e '/SVN_TEST_OPTS_PASS(obtain_write_lock_failure,/,+3d'
+	fi
 }
 
 post_configure() {

From 49d0c475817a80921ed6d1f40ebd07cda3f64289 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 13/37] qemu: remove broken patch

The necessary patch has been imported into musl so no need
to cast the sigevent struct to a more glibc-like one.
---
 .../musl-fix-sigevent-and-sigval_t.patch      | 27 -------------------
 1 file changed, 27 deletions(-)
 delete mode 100644 srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch

diff --git a/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch b/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch
deleted file mode 100644
index 4b4f1117c15f..000000000000
--- a/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-Note: Remove this patch with musl 1.2.2
-
---- a/linux-user/syscall.c
-+++ b/linux-user/syscall.c
-@@ -5020,10 +5020,21 @@
- #ifndef HAVE_SIGEV_NOTIFY_THREAD_ID
- #define sigev_notify_thread_id _sigev_un._tid
- #endif
- 
--static inline abi_long target_to_host_sigevent(struct sigevent *host_sevp,
-+struct host_sigevent {
-+    union sigval sigev_value;
-+    int sigev_signo;
-+    int sigev_notify;
-+    union {
-+       char _pad[64 - sizeof(int) * 2 - sizeof(union sigval)];
-+       int _tid;
-+    } _sigev_un;
-+};
-+
-+static inline abi_long target_to_host_sigevent(struct sigevent *sevp,
-                                                abi_ulong target_addr)
- {
-+    struct host_sigevent *host_sevp = (struct host_sigevent *) sevp;
-     struct target_sigevent *target_sevp;
- 
-     if (!lock_user_struct(VERIFY_READ, target_sevp, target_addr, 1)) {

From af999100dcdbf78d1e5ca8f0c6e0267c0acd7073 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 14/37] cross-aarch64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..9e6fb75c198d 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Leah Neukirchen <leah@vuxu.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 197a639559afdc97dfbf5a8b0926eef259e7590d Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 15/37] cross-aarch64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..ba14c96bccea 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From f644ce0b7dcac3aed9c5da509f9b01c8411a89bf Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 16/37] cross-arm-linux-gnueabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..5c774e16f430 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 7569f42c437b999ec23c4d7699a432008b53deb1 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 17/37] cross-arm-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..d6298ab639a4 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From eb98ca1016c1ca2f09f9b187da9c05bd6f819bd6 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 18/37] cross-arm-linux-musleabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..24df78e8fd8e 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From d322da670a94b12868af35320ed76e8f5271e6fe Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 19/37] cross-arm-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..8093700f909c 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From f53f68bd75f4ad17a06efc6aa8858a01f1f3ad30 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 20/37] cross-armv7l-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..92665326428b 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From e8ad4a0e4bb2aa508378473d7f95803db9e0f290 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 21/37] cross-armv7l-linux-musleabihf: update to gcc 12.2.0.

---
 .../cross-armv7l-linux-musleabihf/template    | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..e5af2c9ccbf2 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 3983f3fdaec2bb76347a4a5dcdc9beb5be7541e4 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 22/37] cross-i686-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-i686-linux-musl/template b/srcpkgs/cross-i686-linux-musl/template
index 8be16a230d8d..d624bb7a3254 100644
--- a/srcpkgs/cross-i686-linux-musl/template
+++ b/srcpkgs/cross-i686-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-i686-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-i686-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 1481d73e0df9da7ded7e694f5152c7244d1e3984 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 23/37] cross-i686-pc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..6a9e54db807a 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,14 +1,15 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -16,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 56d596a0c4d11357c28fc8be44190978a96b2084 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 24/37] cross-mips-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-musl/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..67a5c413396c 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From da5814d0b244dd68381bfe1a1baf93d8bc368e1e Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 25/37] cross-mips-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..bdf8600ce95b 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="hipperson0 <hipperson0@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From e831edc449fa84cd2147406cbf65487b0a964be8 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 26/37] cross-mipsel-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..de49387d517b 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 60f178e91af5e589b16b2b92641d9c4729696658 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 27/37] cross-mipsel-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..b27ce6475a38 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 73c1f31bd0efa3eed1f5b68db753a4c8faf8d693 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 28/37] cross-powerpc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..79579e093b12 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 7c01f9d4da4af7280db99725362eb60149b607e8 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 29/37] cross-powerpc-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..9bb6acd359b6 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 61caf1ca80c3c6fa75c416267df67d05154fc91a Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 30/37] cross-powerpc64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..2d153d00add6 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,16 +1,17 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
  --enable-targets=powerpc-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -18,12 +19,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 6b2173192f9ce593a8106db6bd4892aabd8a1c2d Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 31/37] cross-powerpc64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 016f18776a6d..e0848fe0bff7 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,30 +1,31 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 67ec286c863661c252951d0c91a99b1b197df2be Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 32/37] cross-powerpc64le-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 463d7e92d20d..8d8e010e15c0 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,16 +1,17 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
  --enable-targets=powerpcle-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -18,12 +19,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 6f80a930b9bb1c2475048536da78977938bbee37 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 33/37] cross-powerpc64le-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index c17a3cccfe29..0915e524545f 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,30 +1,31 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 2c18252ff919a49eac3d5ba7ac69f41b9bef620c Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 34/37] cross-powerpcle-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 9aede3c465ce..687be8a44c6c 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 
@@ -35,6 +36,8 @@ if [ "$XBPS_TARGET_MACHINE" = "ppcle" ]; then
 	broken="Can't build crosstoolchain to itself"
 fi
 
+broken="glibc uses big-endian specific instructions on 32-bit powerpc"
+
 cross-powerpcle-linux-gnu-libc_package() {
 	short_desc+=" - glibc files"
 	nostrip=yes

From 8a2438a0116f2f7746a423b736f32839fe875c20 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 35/37] cross-powerpcle-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index 045cfda987fe..bb984b9c42eb 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 77c5b9a8577813403c45068d5860bff7f37125a1 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:30 -0800
Subject: [PATCH 36/37] cross-x86_64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 8918f3c22a1c..930aaf2a508b 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,14 +1,15 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -16,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 20349f414f1501e379f5f0d3beeefe67ce4880d8 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:30 -0800
Subject: [PATCH 37/37] cross-x86_64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..ac5b1c46ab82 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (217 preceding siblings ...)
  2022-11-08 18:27 ` oreo639
@ 2022-11-08 19:06 ` oreo639
  2022-11-14 23:45 ` kruceter
                   ` (45 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-11-08 19:06 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5448 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.2.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.2.0

There is a list of failing builds here: https://github.com/void-linux/void-packages/issues/39809

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [x] llvm https://github.com/void-linux/void-packages/pull/38694
- [x] m4 https://github.com/void-linux/void-packages/pull/33730
- [x] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [x] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [x] libvirt https://github.com/void-linux/void-packages/pull/38842
- [x] syslinux https://github.com/void-linux/void-packages/pull/38876
- [x] efivar https://github.com/void-linux/void-packages/pull/38874
- [x] gpgme https://github.com/void-linux/void-packages/pull/38825

Known packages that needed to be fixed/updated for gcc12:
- [x] openssh https://github.com/void-linux/void-packages/pull/38849
- [x] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [x] doxygen https://github.com/void-linux/void-packages/pull/38846
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] libproxy https://github.com/void-linux/void-packages/pull/38818
- [x] exempi https://github.com/void-linux/void-packages/pull/38820
- [x] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [x] libunique1 https://github.com/void-linux/void-packages/pull/38848 or https://github.com/void-linux/void-packages/pull/38873
- [x] libwpd https://github.com/void-linux/void-packages/pull/38878
- [x] cglm https://github.com/void-linux/void-packages/pull/39748
- [x] coreboot-utils https://github.com/void-linux/void-packages/pull/39749
- [x] apl https://github.com/void-linux/void-packages/pull/39750
- [x] igt-gpu-tools https://github.com/void-linux/void-packages/pull/39780

Needs to be fixed/updated for binutils:
- [x] grub https://github.com/void-linux/void-packages/pull/38875
- [x] linux-tools https://github.com/void-linux/void-packages/pull/38877
- [x] kcov https://github.com/void-linux/void-packages/pull/39291

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [x] kde
- [x] lxde
- [x] lxqt

You can test the ISOs here:
https://drive.google.com/drive/folders/1ix92CYSLUP-KWjLxltdgG4e8Nu2JCY5n?usp=sharing

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 133279 bytes --]

From 3d1af9cb3224974015503e6b5fc1018e6b102463 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 01/37] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../fix-libcollector-without-java.patch       | 53 +++++++++++++++
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 25 ++++---
 4 files changed, 87 insertions(+), 117 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
 create mode 100644 srcpkgs/binutils/patches/fix-libcollector-without-java.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/fix-libcollector-without-java.patch b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
new file mode 100644
index 000000000000..54384875f358
--- /dev/null
+++ b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
@@ -0,0 +1,53 @@
+From 49ddd814ac1071af7c4f45d5f8398b91862f2c7f Mon Sep 17 00:00:00 2001
+From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
+Date: Wed, 17 Aug 2022 19:55:23 -0700
+Subject: [PATCH] gprofng: fix bug 29479 Collection fails when built without
+ java support
+
+gprofng/ChangeLog
+2022-08-17  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>
+
+	PR gprofng/29479
+	* libcollector/collector.c: Add #if defined(GPROFNG_JAVA_PROFILING) for
+	java specific code.
+	* libcollector/unwind.c: Likewise.
+---
+ gprofng/libcollector/collector.c | 2 ++
+ gprofng/libcollector/unwind.c    | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/gprofng/libcollector/collector.c b/gprofng/libcollector/collector.c
+index 93c9d3330de5..ceff2c1caccb 100644
+--- a/gprofng/libcollector/collector.c
++++ b/gprofng/libcollector/collector.c
+@@ -913,8 +913,10 @@ __collector_open_experiment (const char *exp, const char *params, sp_origin_t or
+   __collector_ext_unwind_key_init (1, NULL);
+ 
+   /* start java attach if suitable */
++#if defined(GPROFNG_JAVA_PROFILING)
+   if (exp_origin == SP_ORIGIN_DBX_ATTACH)
+     __collector_jprofile_start_attach ();
++#endif
+   start_sec_time = CALL_UTIL (time)(NULL);
+   __collector_start_time = collector_interface.getHiResTime ();
+   TprintfT (DBG_LT0, "\t__collector_open_experiment; resetting start_time\n");
+diff --git a/gprofng/libcollector/unwind.c b/gprofng/libcollector/unwind.c
+index 119243788020..f8e11823c81e 100644
+--- a/gprofng/libcollector/unwind.c
++++ b/gprofng/libcollector/unwind.c
+@@ -557,6 +557,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+   int size = max_frame_size;
+ 
+ #define MIN(a,b) ((a)<(b)?(a):(b))
++#if defined(GPROFNG_JAVA_PROFILING)
+   /* get Java info */
+   if (__collector_java_mode && __collector_java_asyncgetcalltrace_loaded && context && !pseudo_context)
+     {
+@@ -569,6 +570,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+ 	  size -= sz;
+ 	}
+     }
++#endif
+ 
+   /* get native stack */
+   if (context)
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..c355a5fc8016 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkgconf"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -35,15 +36,21 @@ do_configure() {
 	local conf
 
 	if [ "$CHROOT_READY" ]; then
-		conf+=" --with-debuginfod"
+		conf+=" --with-debuginfod --enable-shared"
 	else
-		conf+=" --without-debuginfod --disable-install-libbfd"
+		conf+=" --without-debuginfod --disable-shared --disable-install-libbfd"
 	fi
 	if [ "$CROSS_BUILD" ]; then
 		# we don't want --with-sysroot=${XBPS_CROSS_BASE} like gnu-configure
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	# gprofng currently only supports x86 and aarch64 glibc.
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64|i386|aarch64) conf+=" --enable-gprofng" ;;
+		*) conf+=" --disable-gprofng" ;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"
@@ -76,13 +83,14 @@ do_configure() {
 		--libdir=/usr/lib \
 		--mandir=/usr/share/man \
 		--infodir=/usr/share/info \
+		--sysconfdir=/etc \
 		--disable-werror \
-		--disable-shared \
 		--disable-nls \
 		--enable-threads \
 		--enable-plugins \
 		--enable-relro \
 		--enable-gold \
+		--enable-new-dtags \
 		--enable-deterministic-archives \
 		--enable-64-bit-bfd \
 		--enable-ld=default \
@@ -142,7 +150,8 @@ binutils-devel_package() {
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/*.a"
-		vmove "usr/lib/*.so"
+		vmove "usr/lib/libbfd.so"
+		vmove "usr/lib/libopcodes.so"
 	}
 }
 

From 9080a06d5bbda4aacfb83a108cf4520fa322cf49 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 02/37] gdb: resolve conflict with binutils 2.39

---
 srcpkgs/gdb/template | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/gdb/template b/srcpkgs/gdb/template
index 9c5f17ffc519..b666348fea19 100644
--- a/srcpkgs/gdb/template
+++ b/srcpkgs/gdb/template
@@ -1,7 +1,7 @@
 # Template file for 'gdb'
 pkgname=gdb
 version=12.1
-revision=2
+revision=3
 build_style=gnu-configure
 pycompile_dirs="/usr/share/gdb/python"
 configure_args="--disable-werror --disable-nls --with-system-readline
@@ -48,7 +48,8 @@ vopt_conflict debuginfod static
 
 post_install() {
 	# resolve conflicts with binutils
-	rm -r ${DESTDIR}/usr/{include,lib,share/info/bfd.info*}
+	rm -rf ${DESTDIR}/usr/{include,lib}
+	rm -rf ${DESTDIR}/usr/share/info/{bfd,ctf-spec}.info*
 }
 
 gdb-common_package() {

From d3046a558478539a37243ce0bfc50e5a9f2aeeaf Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 03/37] gcc: update to 12.2.0.

---
 common/shlibs                                 | 10 +--
 srcpkgs/gcc/files/gccgo-musl.patch            | 71 +++------------
 srcpkgs/gcc/files/libgnarl-musl.patch         | 18 ++--
 srcpkgs/gcc/files/libssp-musl.patch           | 10 +--
 srcpkgs/gcc/patches/libffi_gnulinux.patch     | 11 ---
 .../gcc/patches/libgcc-ibm128-no-tag.patch    | 10 ++-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |  2 +-
 srcpkgs/gcc/template                          | 87 +++++++++----------
 8 files changed, 80 insertions(+), 139 deletions(-)
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index 5136df346db0..116561080072 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.2.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.36 perl-5.36.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -858,8 +858,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.2.0_1
+libgnat-12.so libada-12.2.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1711,8 +1711,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.2.0_1
+libasan.so.8 libsanitizer-12.2.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..12ec68dd8aa3 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,14 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ b/libgo/go/runtime/os_linux.go
+@@ -365,7 +365,7 @@ func setThreadCPUProfiler(hz int32) {
+ 	var sevp _sigevent
+ 	sevp.sigev_notify = _SIGEV_THREAD_ID
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.__sev_fields))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index ab3643de4f98..a20af7c0ef2e 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,14 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
+version=12.2.0
+revision=1
+_minorver="${version%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 create_wrksrc=yes
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +18,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -52,8 +48,11 @@ if [ "$CHROOT_READY" ]; then
 	hostmakedepends="tar texinfo perl flex"
 else
 	_have_gccgo=no
+	# libzstd fails to link in bootstrap with glibc 2.36
+	# when zlib has been compiled with glibc 2.32.
+	LDFLAGS="-lzstd -pthread"
 fi
-makedepends="zlib-devel"
+makedepends="zlib-devel libzstd-devel"
 depends="binutils libgcc-devel-${version}_${revision}
  libstdc++-devel-${version}_${revision} libssp-devel-${version}_${revision}"
 checkdepends="dejagnu"
@@ -70,13 +69,13 @@ if [ "$build_option_gnatboot" ]; then
 	case "$XBPS_TARGET_MACHINE" in
 	x86_64)
 		_gnat_tarball="gnat-gpl-2017-x86_64-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/591c6d80c7a447af2deed1d7>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/9682e2e1f2f232ce03fe21d77b14c37a0de5649b?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" b942bcac20dea39748b39f8b624d9619f60a8dee2e8195dbe3829c835b0956e6"
 		build_options_default="gnatboot"
 		;;
 	i686)
 		_gnat_tarball="gnat-gpl-2014-x86-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/564b3e9dc8e196b040fbe248>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/c5e9e6fdff5cb77ed90cf8c62536653e27c0bed6?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" 3b693510f5d22a240abb3034934c1adbd80ccd6e4f61a4f491cc408fdfd9c042"
 		build_options_default="gnatboot"
 		;;
@@ -155,8 +154,8 @@ if [ "$CROSS_BUILD" ]; then
 fi
 
 post_extract() {
-	mv gcc-${version/pre/_pre}/* gcc-${version/pre/_pre}/.??* .
-	rmdir gcc-${version/pre/_pre}
+	mv gcc-${version}/* gcc-${version}/.??* .
+	rmdir gcc-${version}
 	mv gmp-${_gmp_version} gmp
 	mv mpfr-${_mpfr_version} mpfr
 	mv mpc-${_mpc_version} mpc
@@ -186,9 +185,9 @@ pre_configure() {
 	sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
 
 	if [ "$XBPS_TARGET_LIBC" = musl ]; then
-		patch -p1 -i ${FILESDIR}/libgnarl-musl.patch
-		patch -p1 -i ${FILESDIR}/libssp-musl.patch
-		patch -p1 -i ${FILESDIR}/gccgo-musl.patch
+		for p in ${FILESDIR}/*-musl.patch; do
+			patch -p1 -i $p
+		done
 	fi
 }
 do_configure() {
@@ -343,16 +342,16 @@ do_install() {
 
 	# Make version a symlink of major version to make all versions
 	# from the same series work automagically.
-	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver} \
+	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${version} \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver}
 	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver} \
-		${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}
+		${DESTDIR}/usr/lib/gcc/${_triplet}/${version}
 
 	# Ditto for c++ headers.
-	mv ${DESTDIR}/usr/include/c++/${_patchver} \
+	mv ${DESTDIR}/usr/include/c++/${version} \
 		${DESTDIR}/usr/include/c++/${_minorver}
 	ln -sfr ${DESTDIR}/usr/include/c++/${_minorver} \
-		${DESTDIR}/usr/include/c++/${_patchver}
+		${DESTDIR}/usr/include/c++/${version}
 
 	# cc symlink
 	ln -sfr ${DESTDIR}/usr/bin/gcc ${DESTDIR}/usr/bin/cc
@@ -361,7 +360,7 @@ do_install() {
 
 	# lto plugin symlink
 	vmkdir usr/lib/bfd-plugins
-	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}/liblto_plugin.so \
+	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${version}/liblto_plugin.so \
 		${DESTDIR}/usr/lib/bfd-plugins
 
 	# Remove "fixed" header
@@ -372,13 +371,9 @@ do_install() {
 	rm -f ${DESTDIR}/usr/lib/libffi*
 	rm -f ${DESTDIR}/usr/share/man/man3/ffi*
 
-	# Remove all python scripts in libdir.
-	rm -f ${DESTDIR}/usr/lib/*.py
-
-	# Remove more python stuff.
-	if [ -d ${DESTDIR}/usr/share/gcc-${_patchver}/python ]; then
-		rm -rf ${DESTDIR}/usr/share/gcc-${_patchver}/python
-	fi
+	# Move libstdc++ gdb helpers to location where gdb can autoload them
+	mkdir -p ${DESTDIR}/usr/share/gdb/auto-load/usr/lib
+	mv ${DESTDIR}/usr/lib/*.py ${DESTDIR}/usr/share/gdb/auto-load/usr/lib
 
 	# Install c89 and c99 wrappers and its manpages, from NetBSD.
 	for f in c89 c99; do
@@ -397,7 +392,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}
@@ -450,7 +445,7 @@ gcc-fortran_package() {
 		if [ "$CROSS_BUILD" ]; then
 			# A number of OMP modules are not built when cross
 			# compiling gcc. Copy them from the cross compiler.
-			local src="/usr/lib/gcc/${_triplet}/${_patchver}/finclude"
+			local src="/usr/lib/gcc/${_triplet}/${version}/finclude"
 			local dst="usr/lib/gcc/${_triplet}/${_minorver}/finclude"
 			for f in omp_lib.f90 omp_lib.h omp_lib.mod omp_lib_kinds.mod \
 				openacc.f90 openacc.mod openacc_kinds.mod openacc_lib.h; do
@@ -517,7 +512,7 @@ libgfortran_package() {
 	short_desc+=" - Fortran library"
 	pkg_install() {
 		vmove "usr/lib/libgfortran.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -538,7 +533,7 @@ libgo_package() {
 	nostrip=yes
 	pkg_install() {
 		vmove "usr/lib/libgo.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -554,7 +549,7 @@ libobjc_package() {
 	short_desc+=" - Objective-C library"
 	pkg_install() {
 		vmove "usr/lib/libobjc.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -573,7 +568,7 @@ libquadmath_package() {
 	short_desc+=" - quadmath library"
 	pkg_install() {
 		vmove "usr/lib/libquadmath.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -615,7 +610,7 @@ libgcc_package() {
 	noverifyrdeps=yes
 	pkg_install() {
 		vmove "usr/lib/libgcc_s.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -646,7 +641,7 @@ libgomp_package() {
 	short_desc+=" - OpenMP v4.0 library"
 	pkg_install() {
 		vmove "usr/lib/libgomp*.so.*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -701,7 +696,7 @@ libssp_package() {
 	short_desc+=" - SSP (StackSmashingProtection) library"
 	pkg_install() {
 		vmove "usr/lib/libssp.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -718,7 +713,9 @@ libstdc++-devel_package() {
 libstdc++_package() {
 	short_desc+=" - Standard C++ Library"
 	pkg_install() {
+		vmove usr/share/gdb
+		vmove usr/share/gcc-${version}/python
 		vmove "usr/lib/libstdc++.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }

From 31405c7228613f801908a7745de79c8d0700ee78 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 04/37] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      | 11 ++++--
 2 files changed, 25 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..a4087ec2055e 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,12 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
+
+if [ "$XBPS_TARGET_LIBC" == "musl" ]; then
+	# Musl always searches LD_LIBRARY_PATH before RPATH and RUNPATH
+	make_build_args="lt_cv_shlibpath_overrides_runpath=yes"
+fi
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From 53b40d5c4193ded6d76c2b48b696fe2b32ed5da8 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 05/37] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 7e01bbb851fd..d9618e3806ba 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 build_wrksrc=libiberty
 build_style=gnu-configure
@@ -10,7 +10,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From 083a1338eedc5032e3ad56f291b1dff0abe9338f Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 06/37] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 ...e-hash-style-both-for-building-glibc.patch |  51 ++++
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 4 files changed, 106 insertions(+), 353 deletions(-)
 create mode 100644 srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index 116561080072..b81d568d3c5c 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch b/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
new file mode 100644
index 000000000000..9c5553e92609
--- /dev/null
+++ b/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
@@ -0,0 +1,51 @@
+Temporary workaround for EAC bug.
+
+See: https://sourceware.org/bugzilla/show_bug.cgi?id=29456
+
+From 8e90e2cc5e57d7ca3a40602d278e9642a8b66716 Mon Sep 17 00:00:00 2001
+From: oreo639 <oreo6391@gmail.com>
+Date: Tue, 13 Sep 2022 14:30:35 -0700
+Subject: [PATCH] Revert "Do not use --hash-style=both for building glibc
+ shared objects"
+
+This reverts commit e47de5cb2d4dbecb58f569ed241e8e95c568f03c.
+---
+ Makeconfig     |  9 +++++++++
+ Makerules      |  7 +++++++
+ 5 files changed, 61 insertions(+)
+
+diff --git a/Makeconfig b/Makeconfig
+index ba70321af1..e2131d4389 100644
+--- a/Makeconfig
++++ b/Makeconfig
+@@ -371,6 +371,13 @@ dt-relr-ldflag =
+ no-dt-relr-ldflag =
+ endif
+ 
++# For the time being we unconditionally use 'both'.  At some time we
++# should declare statically linked code as 'out of luck' and compile
++# with --hash-style=gnu only.
++hashstyle-LDFLAGS = -Wl,--hash-style=both
++LDFLAGS.so += $(hashstyle-LDFLAGS)
++LDFLAGS-rtld += $(hashstyle-LDFLAGS)
++
+ ifeq (no,$(build-pie-default))
+ pie-default = $(no-pie-ccflag)
+ else # build-pie-default
+diff --git a/Makerules b/Makerules
+index d1e139d03c..44134e37ce 100644
+--- a/Makerules
++++ b/Makerules
+@@ -558,6 +558,9 @@ $(common-objpfx)shlib.lds: $(common-objpfx)config.make $(..)Makerules
+ 		  -Wl,--verbose 2>/dev/null | \
+ 	  sed > $@T \
+ 	      -e '/^=========/,/^=========/!d;/^=========/d' \
++		   -e 's/^.*\.gnu\.hash[ 	]*:.*$$/  .note.ABI-tag : { *(.note.ABI-tag) } &/' \
++		   -e '/^[ 	]*\.hash[ 	]*:.*$$/{h;d;}' \
++		   -e '/DATA_SEGMENT_ALIGN/{H;g}' \
+ 	      -e 's/^.*\*(\.dynbss).*$$/& \
+ 		 PROVIDE(__start___libc_freeres_ptrs = .); \
+ 		 *(__libc_freeres_ptrs) \
+-- 
+2.37.3
+
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From d8388843c227eb9bb3784f5265cfcec34634485c Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 07/37] musl: add support for SIGEV_THREAD_ID timers

https://git.musl-libc.org/cgit/musl/commit/?id=7c71792e87691451f2a6b76348e83ad1889f1dcb
---
 ...d-support-for-SIGEV_THREAD_ID-timers.patch | 74 +++++++++++++++++++
 srcpkgs/musl/template                         |  2 +-
 2 files changed, 75 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch

diff --git a/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
new file mode 100644
index 000000000000..e20dff5ba0d4
--- /dev/null
+++ b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
@@ -0,0 +1,74 @@
+From 7c71792e87691451f2a6b76348e83ad1889f1dcb Mon Sep 17 00:00:00 2001
+From: James Y Knight <jyknight@google.com>
+Date: Sun, 30 Jun 2019 21:55:20 -0400
+Subject: [PATCH] add support for SIGEV_THREAD_ID timers
+
+This is like SIGEV_SIGNAL, but targeted to a particular thread's
+tid, rather than the process.
+---
+ include/signal.h        | 16 +++++++++++++---
+ src/time/timer_create.c |  8 ++++++--
+ 2 files changed, 19 insertions(+), 5 deletions(-)
+
+diff --git a/include/signal.h b/include/signal.h
+index fbdf667b2..9ed929e4f 100644
+--- a/include/signal.h
++++ b/include/signal.h
+@@ -180,14 +180,24 @@ struct sigevent {
+ 	union sigval sigev_value;
+ 	int sigev_signo;
+ 	int sigev_notify;
+-	void (*sigev_notify_function)(union sigval);
+-	pthread_attr_t *sigev_notify_attributes;
+-	char __pad[56-3*sizeof(long)];
++	union {
++		char __pad[64 - 2*sizeof(int) - sizeof(union sigval)];
++		pid_t sigev_notify_thread_id;
++		struct {
++			void (*sigev_notify_function)(union sigval);
++			pthread_attr_t *sigev_notify_attributes;
++		} __sev_thread;
++	} __sev_fields;
+ };
+ 
++#define sigev_notify_thread_id __sev_fields.sigev_notify_thread_id
++#define sigev_notify_function __sev_fields.__sev_thread.sigev_notify_function
++#define sigev_notify_attributes __sev_fields.__sev_thread.sigev_notify_attributes
++
+ #define SIGEV_SIGNAL 0
+ #define SIGEV_NONE 1
+ #define SIGEV_THREAD 2
++#define SIGEV_THREAD_ID 4
+ 
+ int __libc_current_sigrtmin(void);
+ int __libc_current_sigrtmax(void);
+diff --git a/src/time/timer_create.c b/src/time/timer_create.c
+index 5ddfda278..4bef23905 100644
+--- a/src/time/timer_create.c
++++ b/src/time/timer_create.c
+@@ -71,11 +71,15 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 	switch (evp ? evp->sigev_notify : SIGEV_SIGNAL) {
+ 	case SIGEV_NONE:
+ 	case SIGEV_SIGNAL:
++	case SIGEV_THREAD_ID:
+ 		if (evp) {
+ 			ksev.sigev_value = evp->sigev_value;
+ 			ksev.sigev_signo = evp->sigev_signo;
+ 			ksev.sigev_notify = evp->sigev_notify;
+-			ksev.sigev_tid = 0;
++			if (evp->sigev_notify == SIGEV_THREAD_ID)
++				ksev.sigev_tid = evp->sigev_notify_thread_id;
++			else
++				ksev.sigev_tid = 0;
+ 			ksevp = &ksev;
+ 		}
+ 		if (syscall(SYS_timer_create, clk, ksevp, &timerid) < 0)
+@@ -107,7 +111,7 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 
+ 		ksev.sigev_value.sival_ptr = 0;
+ 		ksev.sigev_signo = SIGTIMER;
+-		ksev.sigev_notify = 4; /* SIGEV_THREAD_ID */
++		ksev.sigev_notify = SIGEV_THREAD_ID;
+ 		ksev.sigev_tid = td->tid;
+ 		if (syscall(SYS_timer_create, clk, &ksev, &timerid) < 0)
+ 			timerid = -1;
diff --git a/srcpkgs/musl/template b/srcpkgs/musl/template
index 5bdc5c48e623..34e6ed4fba6e 100644
--- a/srcpkgs/musl/template
+++ b/srcpkgs/musl/template
@@ -2,7 +2,7 @@
 pkgname=musl
 reverts="1.2.0_1"
 version=1.1.24
-revision=10
+revision=11
 archs="*-musl"
 bootstrap=yes
 build_style=gnu-configure

From 082b1a6055d76d9fda954ce7cb5e626c1ead1443 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 08/37] gcc-multilib: update to 12.2.0.

---
 srcpkgs/gcc-multilib/template | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index f28eb237c287..ba9bafcadfd6 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,15 +3,15 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _majorver="${version%.*}"
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel
@@ -70,7 +70,7 @@ do_build() {
 	make ${makejobs}
 }
 do_install() {
-	local _pc_triplet=x86_64-pc-linux-gnu _version=${version%pre1}
+	local _pc_triplet=x86_64-pc-linux-gnu
 	# Install to a tempdir and then only copy relevant files.
 	cd ${wrksrc}
 	make DESTDIR=${wrksrc}/${pkgname}-build install
@@ -80,9 +80,9 @@ do_install() {
 	vmkdir usr/include/c++/${_majorver}/${_triplet}
 	vmkdir usr/lib/gcc/${_triplet}/${_majorver}
 
-	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${_version}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${version}/32 \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_majorver}/
-	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${_version}/${_pc_triplet}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${version}/${_pc_triplet}/32 \
 		${DESTDIR}/usr/include/c++/${_majorver}/${_triplet}
 
 	vinstall ${wrksrc}/host-${_pc_triplet}/gcc/specs 644 usr/lib/gcc/${_triplet}/${_majorver}

From e8667fca73d71833d1395cc47410ad6d9a0caac1 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 09/37] libgccjit: update to 12.2.0.

---
 srcpkgs/libgccjit/files/libgccjit-musl.patch | 63 --------------------
 srcpkgs/libgccjit/template                   | 24 +++-----
 2 files changed, 9 insertions(+), 78 deletions(-)
 delete mode 100644 srcpkgs/libgccjit/files/libgccjit-musl.patch

diff --git a/srcpkgs/libgccjit/files/libgccjit-musl.patch b/srcpkgs/libgccjit/files/libgccjit-musl.patch
deleted file mode 100644
index d2ed16928c82..000000000000
--- a/srcpkgs/libgccjit/files/libgccjit-musl.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-diff --git a/gcc/jit/jit-playback.c b/gcc/jit/jit-playback.c
-index 5bccf591a..35f5e35ef 100644
---- a/gcc/jit/jit-playback.c
-+++ b/gcc/jit/jit-playback.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -41,8 +43,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "diagnostic.h"
- #include "stmt.h"
- 
--#include <pthread.h>
--
- #include "jit-playback.h"
- #include "jit-result.h"
- #include "jit-builtins.h"
-diff --git a/gcc/jit/jit-recording.c b/gcc/jit/jit-recording.c
-index a237d574f..5785e3269 100644
---- a/gcc/jit/jit-recording.c
-+++ b/gcc/jit/jit-recording.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -25,8 +27,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "pretty-print.h"
- #include "toplev.h"
- 
--#include <pthread.h>
--
- #include "jit-builtins.h"
- #include "jit-recording.h"
- #include "jit-playback.h"
-diff --git a/gcc/jit/libgccjit.c b/gcc/jit/libgccjit.c
-index f9c33c63c..75f21d275 100644
---- a/gcc/jit/libgccjit.c
-+++ b/gcc/jit/libgccjit.c
-@@ -18,13 +18,13 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
- #include "timevar.h"
- #include "typed-splay-tree.h"
- #include "cppbuiltin.h"
--#include <pthread.h>
- 
- #include "libgccjit.h"
- #include "jit-recording.h"
diff --git a/srcpkgs/libgccjit/template b/srcpkgs/libgccjit/template
index 0b37c3ee9f8b..fde1affd54b7 100644
--- a/srcpkgs/libgccjit/template
+++ b/srcpkgs/libgccjit/template
@@ -3,18 +3,12 @@
 # which use the version number.
 
 pkgname=libgccjit
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
+version=12.2.0
 revision=1
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
-_majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 create_wrksrc=yes
 short_desc="Just-In-Time Compilation library for GCC"
 maintainer="Lane Biocini <lane@mailbox.org>"
@@ -22,16 +16,16 @@ homepage="https://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 nopie=yes
 lib32disabled=yes
 makedepends="zlib-devel"

From 1254b6a5ebab3e4a1d64a3d329160e143589a984 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 10/37] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove -no-pie from build. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..5d40f0cdd8a6 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -53,6 +53,7 @@ _void_cross_build_binutils() {
 		--sbindir=/usr/bin \
 		--libdir=/usr/lib \
 		--libexecdir=/usr/lib \
+		--sysconfdir=/etc \
 		--target=${tgt} \
 		--with-sysroot=/usr/${tgt} \
 		--disable-nls \
@@ -60,7 +61,9 @@ _void_cross_build_binutils() {
 		--disable-multilib \
 		--disable-werror \
 		--disable-gold \
+		--disable-gprofng \
 		--enable-relro \
+		--enable-new-dtags \
 		--enable-plugins \
 		--enable-64-bit-bfd \
 		--enable-deterministic-archives \
@@ -132,6 +135,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -460,6 +464,14 @@ do_build() {
 	local binutils_ver linux_ver gcc_ver libc_ver libucontext_ver
 	local tgt=${sourcepkg/cross-}
 
+	export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}"
+	export CXXFLAGS="${CXXFLAGS/-D_FORTIFY_SOURCE=2/}"
+
+	# Disable explicit -fno-PIE, gcc/binutils/libc will figure this out itself.
+	export CFLAGS="${CFLAGS//-fno-PIE/}"
+	export CXXFLAGS="${CXXFLAGS//-fno-PIE/}"
+	export LDFLAGS="${LDFLAGS//-no-pie/}"
+
 	_void_cross_test_ver binutils
 	_void_cross_test_ver linux
 	_void_cross_test_ver gcc
@@ -625,6 +637,9 @@ do_install() {
 	# then remove it because it conflicts with libquadmath package
 	rm -rf ${DESTDIR}/${sysroot}/usr/lib/libquadmath.*
 
+	# Remove libdep linker plugin because it conflicts with system binutils
+	rm -f ${DESTDIR}/usr/lib/bfd-plugins/libdep*
+
 	# Remove leftover symlinks
 	rm -f ${DESTDIR}/usr/lib${XBPS_TARGET_WORDSIZE}
 	rm -f ${DESTDIR}/lib*

From 402cefe6831236740a788f053878d21a2723f079 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 11/37] subversion: fix build for libtool 2.4.7

---
 srcpkgs/subversion/template | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/subversion/template b/srcpkgs/subversion/template
index be37f60f9679..a1eaf4565d0b 100644
--- a/srcpkgs/subversion/template
+++ b/srcpkgs/subversion/template
@@ -24,6 +24,8 @@ distfiles="https://archive.apache.org/dist/subversion/subversion-${version}.tar.
 checksum=c9130e8d0b75728a66f0e7038fc77052e671830d785b5616aad53b4810d3cc28
 
 pre_configure() {
+	./autogen.sh --release
+
 	# Based on native build values
 	cat <<-EOF >config.cache
 	ac_cv_python_includes=-I${XBPS_CROSS_BASE}/usr/include/python${py3_ver}
@@ -59,7 +61,12 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+
+	if [ "$XBPS_BUILD_ENVIRONMENT" = "void-packages-ci" ]; then
+		# This test will fail when run as the root user,
+		# because flock() will ignore file permissions.
+		vsed -i subversion/tests/libsvn_fs/locks-test.c -e '/SVN_TEST_OPTS_PASS(obtain_write_lock_failure,/,+3d'
+	fi
 }
 
 post_configure() {

From 1dda4a95795e537ca4d036e5e2d460e6bcd4bfb6 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 12/37] subversion-kwallet-auth: fix build for libtool 2.4.7.

Fix failing distfiles.
Fix build for libtool 2.4.7
---
 srcpkgs/subversion-kwallet-auth/template | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/subversion-kwallet-auth/template b/srcpkgs/subversion-kwallet-auth/template
index ec9a6ea7d974..319de334752e 100644
--- a/srcpkgs/subversion-kwallet-auth/template
+++ b/srcpkgs/subversion-kwallet-auth/template
@@ -25,6 +25,8 @@ checksum=c9130e8d0b75728a66f0e7038fc77052e671830d785b5616aad53b4810d3cc28
 lib32disabled=yes
 
 pre_configure() {
+	./autogen.sh --release
+
 	# Based on native build values
 	cat <<-EOF >config.cache
 	ac_cv_python_includes=-I${XBPS_CROSS_BASE}/usr/include/python${py3_ver}
@@ -54,11 +56,18 @@ pre_configure() {
 		cp "$XBPS_CROSS_BASE/usr/lib/perl5/core_perl/Config"*.p? $PERL5LIB
 		cp "$XBPS_CROSS_BASE/usr/lib/perl5/core_perl/Errno.pm" $PERL5LIB
 		vsed -e "s;archlibexp => '\(.*\)';archlibexp => '${XBPS_CROSS_BASE}\1';" \
-			-i $PERL5LIB/Config.pm $PERL5LIB/Config_heavy.pl
+			-i $PERL5LIB/Config.pm
+		vsed -e "s;archlibexp='\(.*\)';archlibexp='${XBPS_CROSS_BASE}\1';" \
+			-i $PERL5LIB/Config_heavy.pl
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+
+	if [ "$XBPS_BUILD_ENVIRONMENT" = "void-packages-ci" ]; then
+		# This test will fail when run as the root user,
+		# because flock() will ignore file permissions.
+		vsed -i subversion/tests/libsvn_fs/locks-test.c -e '/SVN_TEST_OPTS_PASS(obtain_write_lock_failure,/,+3d'
+	fi
 }
 
 post_configure() {

From d59519ea89dd23398a168a188887ca7206dc31b7 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 13/37] qemu: remove broken patch

The necessary patch has been imported into musl so no need
to cast the sigevent struct to a more glibc-like one.
---
 .../musl-fix-sigevent-and-sigval_t.patch      | 27 -------------------
 1 file changed, 27 deletions(-)
 delete mode 100644 srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch

diff --git a/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch b/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch
deleted file mode 100644
index 4b4f1117c15f..000000000000
--- a/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-Note: Remove this patch with musl 1.2.2
-
---- a/linux-user/syscall.c
-+++ b/linux-user/syscall.c
-@@ -5020,10 +5020,21 @@
- #ifndef HAVE_SIGEV_NOTIFY_THREAD_ID
- #define sigev_notify_thread_id _sigev_un._tid
- #endif
- 
--static inline abi_long target_to_host_sigevent(struct sigevent *host_sevp,
-+struct host_sigevent {
-+    union sigval sigev_value;
-+    int sigev_signo;
-+    int sigev_notify;
-+    union {
-+       char _pad[64 - sizeof(int) * 2 - sizeof(union sigval)];
-+       int _tid;
-+    } _sigev_un;
-+};
-+
-+static inline abi_long target_to_host_sigevent(struct sigevent *sevp,
-                                                abi_ulong target_addr)
- {
-+    struct host_sigevent *host_sevp = (struct host_sigevent *) sevp;
-     struct target_sigevent *target_sevp;
- 
-     if (!lock_user_struct(VERIFY_READ, target_sevp, target_addr, 1)) {

From 8bb32b68aa6f993a88c46349a5086819db700828 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 14/37] cross-aarch64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..9e6fb75c198d 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Leah Neukirchen <leah@vuxu.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 5ec800c0b9911a16e10868bfad84d62519a769e8 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 15/37] cross-aarch64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..ba14c96bccea 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 857bb6dc493c4a81fd908487ce3341d57df8bd2e Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 16/37] cross-arm-linux-gnueabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..5c774e16f430 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From c585fab6e7488fa4e8df05acf3fe66a614618ada Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 17/37] cross-arm-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..d6298ab639a4 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 88827dcee83b5c35b8fde1eab8727513550d6e0b Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 18/37] cross-arm-linux-musleabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..24df78e8fd8e 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From adcc7a54d2431a793142d294848b47ee86cb54d6 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 19/37] cross-arm-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..8093700f909c 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 522a49b936753c1fe13ab6172a2e2b13e84349f7 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 20/37] cross-armv7l-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..92665326428b 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From f87813416592805d7d229687dfb08d2c2fbe0a2e Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 21/37] cross-armv7l-linux-musleabihf: update to gcc 12.2.0.

---
 .../cross-armv7l-linux-musleabihf/template    | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..e5af2c9ccbf2 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 4f367099c69ff640f595e1f77f9e69dae0f14c1e Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 22/37] cross-i686-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-i686-linux-musl/template b/srcpkgs/cross-i686-linux-musl/template
index 8be16a230d8d..d624bb7a3254 100644
--- a/srcpkgs/cross-i686-linux-musl/template
+++ b/srcpkgs/cross-i686-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-i686-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-i686-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 3c8a77f377358d557b1b4394f0f094bb219a6302 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 23/37] cross-i686-pc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..6a9e54db807a 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,14 +1,15 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -16,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From f8ccf6436382e06b1c142375eb6f0588e1f4d2ea Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 24/37] cross-mips-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-musl/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..67a5c413396c 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 72d2248437790d8c75035bebd76b8519b5c5d14d Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 25/37] cross-mips-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..bdf8600ce95b 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="hipperson0 <hipperson0@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From ce7149c4265bd603f91aff6b5f1d9b496cb89d2d Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 26/37] cross-mipsel-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..de49387d517b 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 3a1923dd986a9d9995fda6b71a4f00e24c690d31 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 27/37] cross-mipsel-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..b27ce6475a38 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 6dcdbf1d302ab02e2b3a1ca162bda9fb468684ae Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 28/37] cross-powerpc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..79579e093b12 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From ceec748bf1670a464ab520205f23b4b533bf220d Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 29/37] cross-powerpc-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..9bb6acd359b6 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 6855020f0d99cf1b50f8e57cfa5ddefd0b5958c0 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 30/37] cross-powerpc64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..2d153d00add6 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,16 +1,17 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
  --enable-targets=powerpc-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -18,12 +19,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 69a69bfce9a9c8e8f86be987734427ff5a628efc Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 31/37] cross-powerpc64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 016f18776a6d..e0848fe0bff7 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,30 +1,31 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From b1b22bbdd3f80fa841337f5b763be68fc06d620f Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 32/37] cross-powerpc64le-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 463d7e92d20d..8d8e010e15c0 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,16 +1,17 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
  --enable-targets=powerpcle-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -18,12 +19,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From c58da9902708e9e96522e87744d400561ae176dd Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 33/37] cross-powerpc64le-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index c17a3cccfe29..0915e524545f 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,30 +1,31 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 6eafe6535dff430ce8c587ca012f09a5d62cdb03 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 34/37] cross-powerpcle-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 9aede3c465ce..687be8a44c6c 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 
@@ -35,6 +36,8 @@ if [ "$XBPS_TARGET_MACHINE" = "ppcle" ]; then
 	broken="Can't build crosstoolchain to itself"
 fi
 
+broken="glibc uses big-endian specific instructions on 32-bit powerpc"
+
 cross-powerpcle-linux-gnu-libc_package() {
 	short_desc+=" - glibc files"
 	nostrip=yes

From baf9da901fd9ce1576f902ef57cb6a001544c90d Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 35/37] cross-powerpcle-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index 045cfda987fe..bb984b9c42eb 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From c0f3bc919d2e3035ce3a2a5beb617deba893057a Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:30 -0800
Subject: [PATCH 36/37] cross-x86_64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 8918f3c22a1c..930aaf2a508b 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,14 +1,15 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -16,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From e070dddc200659cca7a36e9379e228432059b21e Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:30 -0800
Subject: [PATCH 37/37] cross-x86_64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..ac5b1c46ab82 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (218 preceding siblings ...)
  2022-11-08 19:06 ` oreo639
@ 2022-11-14 23:45 ` kruceter
  2022-11-16  1:37 ` sgn
                   ` (44 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: kruceter @ 2022-11-14 23:45 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 329 bytes --]

New comment by kruceter on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1314556523

Comment:
@oreo639, would you be so kind to revbump musl to 12? It seems your changes were swallowed by https://github.com/void-linux/void-packages/commit/904073078c5f15b03889bb9cdef57e021609edd5.

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (219 preceding siblings ...)
  2022-11-14 23:45 ` kruceter
@ 2022-11-16  1:37 ` sgn
  2022-11-16  1:37 ` sgn
                   ` (43 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: sgn @ 2022-11-16  1:37 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 351 bytes --]

New comment by sgn on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1316152486

Comment:
Did you drop any patches for musl?
```
/builddir/gcc-12.2.0/libgo/go/runtime/os_linux.go:366:29: error: reference to undefined name '_SIGEV_THREAD_ID'
  366 |         sevp.sigev_notify = _SIGEV_THREAD_ID

```

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (220 preceding siblings ...)
  2022-11-16  1:37 ` sgn
@ 2022-11-16  1:37 ` sgn
  2022-11-16  1:57 ` kruceter
                   ` (42 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: sgn @ 2022-11-16  1:37 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 180 bytes --]

New comment by sgn on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1316152942

Comment:
@kruceter No, musl is kept at 1.1 for now.

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (221 preceding siblings ...)
  2022-11-16  1:37 ` sgn
@ 2022-11-16  1:57 ` kruceter
  2022-11-16  2:05 ` [PR PATCH] [Updated] " oreo639
                   ` (41 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: kruceter @ 2022-11-16  1:57 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 396 bytes --]

New comment by kruceter on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1316173441

Comment:
@sgn, I asked oreo to make a revision bump to 12, not update it to another version. The master branch has got musl revbumped to 11, therefore swallowing oreo's changes in this pull request.

The error you have published above is related to my request.

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (222 preceding siblings ...)
  2022-11-16  1:57 ` kruceter
@ 2022-11-16  2:05 ` oreo639
  2022-11-16  2:06 ` sgn
                   ` (40 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-11-16  2:05 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5448 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.2.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.2.0

There is a list of failing builds here: https://github.com/void-linux/void-packages/issues/39809

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [x] llvm https://github.com/void-linux/void-packages/pull/38694
- [x] m4 https://github.com/void-linux/void-packages/pull/33730
- [x] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [x] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [x] libvirt https://github.com/void-linux/void-packages/pull/38842
- [x] syslinux https://github.com/void-linux/void-packages/pull/38876
- [x] efivar https://github.com/void-linux/void-packages/pull/38874
- [x] gpgme https://github.com/void-linux/void-packages/pull/38825

Known packages that needed to be fixed/updated for gcc12:
- [x] openssh https://github.com/void-linux/void-packages/pull/38849
- [x] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [x] doxygen https://github.com/void-linux/void-packages/pull/38846
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] libproxy https://github.com/void-linux/void-packages/pull/38818
- [x] exempi https://github.com/void-linux/void-packages/pull/38820
- [x] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [x] libunique1 https://github.com/void-linux/void-packages/pull/38848 or https://github.com/void-linux/void-packages/pull/38873
- [x] libwpd https://github.com/void-linux/void-packages/pull/38878
- [x] cglm https://github.com/void-linux/void-packages/pull/39748
- [x] coreboot-utils https://github.com/void-linux/void-packages/pull/39749
- [x] apl https://github.com/void-linux/void-packages/pull/39750
- [x] igt-gpu-tools https://github.com/void-linux/void-packages/pull/39780

Needs to be fixed/updated for binutils:
- [x] grub https://github.com/void-linux/void-packages/pull/38875
- [x] linux-tools https://github.com/void-linux/void-packages/pull/38877
- [x] kcov https://github.com/void-linux/void-packages/pull/39291

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [x] kde
- [x] lxde
- [x] lxqt

You can test the ISOs here:
https://drive.google.com/drive/folders/1ix92CYSLUP-KWjLxltdgG4e8Nu2JCY5n?usp=sharing

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 133279 bytes --]

From ccd11d132cd03c31b4030516c48b1df7f72f9ad4 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 01/37] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../fix-libcollector-without-java.patch       | 53 +++++++++++++++
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 25 ++++---
 4 files changed, 87 insertions(+), 117 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
 create mode 100644 srcpkgs/binutils/patches/fix-libcollector-without-java.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/fix-libcollector-without-java.patch b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
new file mode 100644
index 000000000000..54384875f358
--- /dev/null
+++ b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
@@ -0,0 +1,53 @@
+From 49ddd814ac1071af7c4f45d5f8398b91862f2c7f Mon Sep 17 00:00:00 2001
+From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
+Date: Wed, 17 Aug 2022 19:55:23 -0700
+Subject: [PATCH] gprofng: fix bug 29479 Collection fails when built without
+ java support
+
+gprofng/ChangeLog
+2022-08-17  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>
+
+	PR gprofng/29479
+	* libcollector/collector.c: Add #if defined(GPROFNG_JAVA_PROFILING) for
+	java specific code.
+	* libcollector/unwind.c: Likewise.
+---
+ gprofng/libcollector/collector.c | 2 ++
+ gprofng/libcollector/unwind.c    | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/gprofng/libcollector/collector.c b/gprofng/libcollector/collector.c
+index 93c9d3330de5..ceff2c1caccb 100644
+--- a/gprofng/libcollector/collector.c
++++ b/gprofng/libcollector/collector.c
+@@ -913,8 +913,10 @@ __collector_open_experiment (const char *exp, const char *params, sp_origin_t or
+   __collector_ext_unwind_key_init (1, NULL);
+ 
+   /* start java attach if suitable */
++#if defined(GPROFNG_JAVA_PROFILING)
+   if (exp_origin == SP_ORIGIN_DBX_ATTACH)
+     __collector_jprofile_start_attach ();
++#endif
+   start_sec_time = CALL_UTIL (time)(NULL);
+   __collector_start_time = collector_interface.getHiResTime ();
+   TprintfT (DBG_LT0, "\t__collector_open_experiment; resetting start_time\n");
+diff --git a/gprofng/libcollector/unwind.c b/gprofng/libcollector/unwind.c
+index 119243788020..f8e11823c81e 100644
+--- a/gprofng/libcollector/unwind.c
++++ b/gprofng/libcollector/unwind.c
+@@ -557,6 +557,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+   int size = max_frame_size;
+ 
+ #define MIN(a,b) ((a)<(b)?(a):(b))
++#if defined(GPROFNG_JAVA_PROFILING)
+   /* get Java info */
+   if (__collector_java_mode && __collector_java_asyncgetcalltrace_loaded && context && !pseudo_context)
+     {
+@@ -569,6 +570,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+ 	  size -= sz;
+ 	}
+     }
++#endif
+ 
+   /* get native stack */
+   if (context)
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..c355a5fc8016 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkgconf"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -35,15 +36,21 @@ do_configure() {
 	local conf
 
 	if [ "$CHROOT_READY" ]; then
-		conf+=" --with-debuginfod"
+		conf+=" --with-debuginfod --enable-shared"
 	else
-		conf+=" --without-debuginfod --disable-install-libbfd"
+		conf+=" --without-debuginfod --disable-shared --disable-install-libbfd"
 	fi
 	if [ "$CROSS_BUILD" ]; then
 		# we don't want --with-sysroot=${XBPS_CROSS_BASE} like gnu-configure
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	# gprofng currently only supports x86 and aarch64 glibc.
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64|i386|aarch64) conf+=" --enable-gprofng" ;;
+		*) conf+=" --disable-gprofng" ;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"
@@ -76,13 +83,14 @@ do_configure() {
 		--libdir=/usr/lib \
 		--mandir=/usr/share/man \
 		--infodir=/usr/share/info \
+		--sysconfdir=/etc \
 		--disable-werror \
-		--disable-shared \
 		--disable-nls \
 		--enable-threads \
 		--enable-plugins \
 		--enable-relro \
 		--enable-gold \
+		--enable-new-dtags \
 		--enable-deterministic-archives \
 		--enable-64-bit-bfd \
 		--enable-ld=default \
@@ -142,7 +150,8 @@ binutils-devel_package() {
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/*.a"
-		vmove "usr/lib/*.so"
+		vmove "usr/lib/libbfd.so"
+		vmove "usr/lib/libopcodes.so"
 	}
 }
 

From 8e370b32282731153a7a5b4a58dbaed57a03e045 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 02/37] gdb: resolve conflict with binutils 2.39

---
 srcpkgs/gdb/template | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/gdb/template b/srcpkgs/gdb/template
index 9c5f17ffc519..b666348fea19 100644
--- a/srcpkgs/gdb/template
+++ b/srcpkgs/gdb/template
@@ -1,7 +1,7 @@
 # Template file for 'gdb'
 pkgname=gdb
 version=12.1
-revision=2
+revision=3
 build_style=gnu-configure
 pycompile_dirs="/usr/share/gdb/python"
 configure_args="--disable-werror --disable-nls --with-system-readline
@@ -48,7 +48,8 @@ vopt_conflict debuginfod static
 
 post_install() {
 	# resolve conflicts with binutils
-	rm -r ${DESTDIR}/usr/{include,lib,share/info/bfd.info*}
+	rm -rf ${DESTDIR}/usr/{include,lib}
+	rm -rf ${DESTDIR}/usr/share/info/{bfd,ctf-spec}.info*
 }
 
 gdb-common_package() {

From 99653a30d53e41c4950848bc0b869ca504abf0f1 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 03/37] gcc: update to 12.2.0.

---
 common/shlibs                                 | 10 +--
 srcpkgs/gcc/files/gccgo-musl.patch            | 71 +++------------
 srcpkgs/gcc/files/libgnarl-musl.patch         | 18 ++--
 srcpkgs/gcc/files/libssp-musl.patch           | 10 +--
 srcpkgs/gcc/patches/libffi_gnulinux.patch     | 11 ---
 .../gcc/patches/libgcc-ibm128-no-tag.patch    | 10 ++-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |  2 +-
 srcpkgs/gcc/template                          | 87 +++++++++----------
 8 files changed, 80 insertions(+), 139 deletions(-)
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index 481250d5c924..ffeae1b92d28 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.2.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.36 perl-5.36.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -857,8 +857,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.2.0_1
+libgnat-12.so libada-12.2.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1710,8 +1710,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.2.0_1
+libasan.so.8 libsanitizer-12.2.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..12ec68dd8aa3 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,14 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ b/libgo/go/runtime/os_linux.go
+@@ -365,7 +365,7 @@ func setThreadCPUProfiler(hz int32) {
+ 	var sevp _sigevent
+ 	sevp.sigev_notify = _SIGEV_THREAD_ID
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.__sev_fields))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index ab3643de4f98..a20af7c0ef2e 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,14 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
+version=12.2.0
+revision=1
+_minorver="${version%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 create_wrksrc=yes
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +18,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -52,8 +48,11 @@ if [ "$CHROOT_READY" ]; then
 	hostmakedepends="tar texinfo perl flex"
 else
 	_have_gccgo=no
+	# libzstd fails to link in bootstrap with glibc 2.36
+	# when zlib has been compiled with glibc 2.32.
+	LDFLAGS="-lzstd -pthread"
 fi
-makedepends="zlib-devel"
+makedepends="zlib-devel libzstd-devel"
 depends="binutils libgcc-devel-${version}_${revision}
  libstdc++-devel-${version}_${revision} libssp-devel-${version}_${revision}"
 checkdepends="dejagnu"
@@ -70,13 +69,13 @@ if [ "$build_option_gnatboot" ]; then
 	case "$XBPS_TARGET_MACHINE" in
 	x86_64)
 		_gnat_tarball="gnat-gpl-2017-x86_64-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/591c6d80c7a447af2deed1d7>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/9682e2e1f2f232ce03fe21d77b14c37a0de5649b?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" b942bcac20dea39748b39f8b624d9619f60a8dee2e8195dbe3829c835b0956e6"
 		build_options_default="gnatboot"
 		;;
 	i686)
 		_gnat_tarball="gnat-gpl-2014-x86-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/564b3e9dc8e196b040fbe248>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/c5e9e6fdff5cb77ed90cf8c62536653e27c0bed6?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" 3b693510f5d22a240abb3034934c1adbd80ccd6e4f61a4f491cc408fdfd9c042"
 		build_options_default="gnatboot"
 		;;
@@ -155,8 +154,8 @@ if [ "$CROSS_BUILD" ]; then
 fi
 
 post_extract() {
-	mv gcc-${version/pre/_pre}/* gcc-${version/pre/_pre}/.??* .
-	rmdir gcc-${version/pre/_pre}
+	mv gcc-${version}/* gcc-${version}/.??* .
+	rmdir gcc-${version}
 	mv gmp-${_gmp_version} gmp
 	mv mpfr-${_mpfr_version} mpfr
 	mv mpc-${_mpc_version} mpc
@@ -186,9 +185,9 @@ pre_configure() {
 	sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
 
 	if [ "$XBPS_TARGET_LIBC" = musl ]; then
-		patch -p1 -i ${FILESDIR}/libgnarl-musl.patch
-		patch -p1 -i ${FILESDIR}/libssp-musl.patch
-		patch -p1 -i ${FILESDIR}/gccgo-musl.patch
+		for p in ${FILESDIR}/*-musl.patch; do
+			patch -p1 -i $p
+		done
 	fi
 }
 do_configure() {
@@ -343,16 +342,16 @@ do_install() {
 
 	# Make version a symlink of major version to make all versions
 	# from the same series work automagically.
-	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver} \
+	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${version} \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver}
 	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver} \
-		${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}
+		${DESTDIR}/usr/lib/gcc/${_triplet}/${version}
 
 	# Ditto for c++ headers.
-	mv ${DESTDIR}/usr/include/c++/${_patchver} \
+	mv ${DESTDIR}/usr/include/c++/${version} \
 		${DESTDIR}/usr/include/c++/${_minorver}
 	ln -sfr ${DESTDIR}/usr/include/c++/${_minorver} \
-		${DESTDIR}/usr/include/c++/${_patchver}
+		${DESTDIR}/usr/include/c++/${version}
 
 	# cc symlink
 	ln -sfr ${DESTDIR}/usr/bin/gcc ${DESTDIR}/usr/bin/cc
@@ -361,7 +360,7 @@ do_install() {
 
 	# lto plugin symlink
 	vmkdir usr/lib/bfd-plugins
-	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}/liblto_plugin.so \
+	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${version}/liblto_plugin.so \
 		${DESTDIR}/usr/lib/bfd-plugins
 
 	# Remove "fixed" header
@@ -372,13 +371,9 @@ do_install() {
 	rm -f ${DESTDIR}/usr/lib/libffi*
 	rm -f ${DESTDIR}/usr/share/man/man3/ffi*
 
-	# Remove all python scripts in libdir.
-	rm -f ${DESTDIR}/usr/lib/*.py
-
-	# Remove more python stuff.
-	if [ -d ${DESTDIR}/usr/share/gcc-${_patchver}/python ]; then
-		rm -rf ${DESTDIR}/usr/share/gcc-${_patchver}/python
-	fi
+	# Move libstdc++ gdb helpers to location where gdb can autoload them
+	mkdir -p ${DESTDIR}/usr/share/gdb/auto-load/usr/lib
+	mv ${DESTDIR}/usr/lib/*.py ${DESTDIR}/usr/share/gdb/auto-load/usr/lib
 
 	# Install c89 and c99 wrappers and its manpages, from NetBSD.
 	for f in c89 c99; do
@@ -397,7 +392,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}
@@ -450,7 +445,7 @@ gcc-fortran_package() {
 		if [ "$CROSS_BUILD" ]; then
 			# A number of OMP modules are not built when cross
 			# compiling gcc. Copy them from the cross compiler.
-			local src="/usr/lib/gcc/${_triplet}/${_patchver}/finclude"
+			local src="/usr/lib/gcc/${_triplet}/${version}/finclude"
 			local dst="usr/lib/gcc/${_triplet}/${_minorver}/finclude"
 			for f in omp_lib.f90 omp_lib.h omp_lib.mod omp_lib_kinds.mod \
 				openacc.f90 openacc.mod openacc_kinds.mod openacc_lib.h; do
@@ -517,7 +512,7 @@ libgfortran_package() {
 	short_desc+=" - Fortran library"
 	pkg_install() {
 		vmove "usr/lib/libgfortran.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -538,7 +533,7 @@ libgo_package() {
 	nostrip=yes
 	pkg_install() {
 		vmove "usr/lib/libgo.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -554,7 +549,7 @@ libobjc_package() {
 	short_desc+=" - Objective-C library"
 	pkg_install() {
 		vmove "usr/lib/libobjc.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -573,7 +568,7 @@ libquadmath_package() {
 	short_desc+=" - quadmath library"
 	pkg_install() {
 		vmove "usr/lib/libquadmath.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -615,7 +610,7 @@ libgcc_package() {
 	noverifyrdeps=yes
 	pkg_install() {
 		vmove "usr/lib/libgcc_s.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -646,7 +641,7 @@ libgomp_package() {
 	short_desc+=" - OpenMP v4.0 library"
 	pkg_install() {
 		vmove "usr/lib/libgomp*.so.*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -701,7 +696,7 @@ libssp_package() {
 	short_desc+=" - SSP (StackSmashingProtection) library"
 	pkg_install() {
 		vmove "usr/lib/libssp.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -718,7 +713,9 @@ libstdc++-devel_package() {
 libstdc++_package() {
 	short_desc+=" - Standard C++ Library"
 	pkg_install() {
+		vmove usr/share/gdb
+		vmove usr/share/gcc-${version}/python
 		vmove "usr/lib/libstdc++.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }

From 4bcaf4a8554cb645f8d98f052ca79b328ba8b948 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 04/37] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 srcpkgs/libtool/template                      | 11 ++++--
 2 files changed, 25 insertions(+), 20 deletions(-)

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..a4087ec2055e 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,12 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
+
+if [ "$XBPS_TARGET_LIBC" == "musl" ]; then
+	# Musl always searches LD_LIBRARY_PATH before RPATH and RUNPATH
+	make_build_args="lt_cv_shlibpath_overrides_runpath=yes"
+fi
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in

From f2b9fdb780d17cc5f1b964e6be202227b18d6d9d Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 05/37] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 7e01bbb851fd..d9618e3806ba 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 build_wrksrc=libiberty
 build_style=gnu-configure
@@ -10,7 +10,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From 6f1a6ae3a46a00b6ff7694caf8df57466047fb5c Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 06/37] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 ...e-hash-style-both-for-building-glibc.patch |  51 ++++
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 4 files changed, 106 insertions(+), 353 deletions(-)
 create mode 100644 srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index ffeae1b92d28..5b935a507580 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch b/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
new file mode 100644
index 000000000000..9c5553e92609
--- /dev/null
+++ b/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
@@ -0,0 +1,51 @@
+Temporary workaround for EAC bug.
+
+See: https://sourceware.org/bugzilla/show_bug.cgi?id=29456
+
+From 8e90e2cc5e57d7ca3a40602d278e9642a8b66716 Mon Sep 17 00:00:00 2001
+From: oreo639 <oreo6391@gmail.com>
+Date: Tue, 13 Sep 2022 14:30:35 -0700
+Subject: [PATCH] Revert "Do not use --hash-style=both for building glibc
+ shared objects"
+
+This reverts commit e47de5cb2d4dbecb58f569ed241e8e95c568f03c.
+---
+ Makeconfig     |  9 +++++++++
+ Makerules      |  7 +++++++
+ 5 files changed, 61 insertions(+)
+
+diff --git a/Makeconfig b/Makeconfig
+index ba70321af1..e2131d4389 100644
+--- a/Makeconfig
++++ b/Makeconfig
+@@ -371,6 +371,13 @@ dt-relr-ldflag =
+ no-dt-relr-ldflag =
+ endif
+ 
++# For the time being we unconditionally use 'both'.  At some time we
++# should declare statically linked code as 'out of luck' and compile
++# with --hash-style=gnu only.
++hashstyle-LDFLAGS = -Wl,--hash-style=both
++LDFLAGS.so += $(hashstyle-LDFLAGS)
++LDFLAGS-rtld += $(hashstyle-LDFLAGS)
++
+ ifeq (no,$(build-pie-default))
+ pie-default = $(no-pie-ccflag)
+ else # build-pie-default
+diff --git a/Makerules b/Makerules
+index d1e139d03c..44134e37ce 100644
+--- a/Makerules
++++ b/Makerules
+@@ -558,6 +558,9 @@ $(common-objpfx)shlib.lds: $(common-objpfx)config.make $(..)Makerules
+ 		  -Wl,--verbose 2>/dev/null | \
+ 	  sed > $@T \
+ 	      -e '/^=========/,/^=========/!d;/^=========/d' \
++		   -e 's/^.*\.gnu\.hash[ 	]*:.*$$/  .note.ABI-tag : { *(.note.ABI-tag) } &/' \
++		   -e '/^[ 	]*\.hash[ 	]*:.*$$/{h;d;}' \
++		   -e '/DATA_SEGMENT_ALIGN/{H;g}' \
+ 	      -e 's/^.*\*(\.dynbss).*$$/& \
+ 		 PROVIDE(__start___libc_freeres_ptrs = .); \
+ 		 *(__libc_freeres_ptrs) \
+-- 
+2.37.3
+
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From 1f1c20038c8e0536e371f88a058fd2df1c0c9b4f Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 07/37] musl: add support for SIGEV_THREAD_ID timers

https://git.musl-libc.org/cgit/musl/commit/?id=7c71792e87691451f2a6b76348e83ad1889f1dcb
---
 ...d-support-for-SIGEV_THREAD_ID-timers.patch | 74 +++++++++++++++++++
 srcpkgs/musl/template                         |  2 +-
 2 files changed, 75 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch

diff --git a/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
new file mode 100644
index 000000000000..e20dff5ba0d4
--- /dev/null
+++ b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
@@ -0,0 +1,74 @@
+From 7c71792e87691451f2a6b76348e83ad1889f1dcb Mon Sep 17 00:00:00 2001
+From: James Y Knight <jyknight@google.com>
+Date: Sun, 30 Jun 2019 21:55:20 -0400
+Subject: [PATCH] add support for SIGEV_THREAD_ID timers
+
+This is like SIGEV_SIGNAL, but targeted to a particular thread's
+tid, rather than the process.
+---
+ include/signal.h        | 16 +++++++++++++---
+ src/time/timer_create.c |  8 ++++++--
+ 2 files changed, 19 insertions(+), 5 deletions(-)
+
+diff --git a/include/signal.h b/include/signal.h
+index fbdf667b2..9ed929e4f 100644
+--- a/include/signal.h
++++ b/include/signal.h
+@@ -180,14 +180,24 @@ struct sigevent {
+ 	union sigval sigev_value;
+ 	int sigev_signo;
+ 	int sigev_notify;
+-	void (*sigev_notify_function)(union sigval);
+-	pthread_attr_t *sigev_notify_attributes;
+-	char __pad[56-3*sizeof(long)];
++	union {
++		char __pad[64 - 2*sizeof(int) - sizeof(union sigval)];
++		pid_t sigev_notify_thread_id;
++		struct {
++			void (*sigev_notify_function)(union sigval);
++			pthread_attr_t *sigev_notify_attributes;
++		} __sev_thread;
++	} __sev_fields;
+ };
+ 
++#define sigev_notify_thread_id __sev_fields.sigev_notify_thread_id
++#define sigev_notify_function __sev_fields.__sev_thread.sigev_notify_function
++#define sigev_notify_attributes __sev_fields.__sev_thread.sigev_notify_attributes
++
+ #define SIGEV_SIGNAL 0
+ #define SIGEV_NONE 1
+ #define SIGEV_THREAD 2
++#define SIGEV_THREAD_ID 4
+ 
+ int __libc_current_sigrtmin(void);
+ int __libc_current_sigrtmax(void);
+diff --git a/src/time/timer_create.c b/src/time/timer_create.c
+index 5ddfda278..4bef23905 100644
+--- a/src/time/timer_create.c
++++ b/src/time/timer_create.c
+@@ -71,11 +71,15 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 	switch (evp ? evp->sigev_notify : SIGEV_SIGNAL) {
+ 	case SIGEV_NONE:
+ 	case SIGEV_SIGNAL:
++	case SIGEV_THREAD_ID:
+ 		if (evp) {
+ 			ksev.sigev_value = evp->sigev_value;
+ 			ksev.sigev_signo = evp->sigev_signo;
+ 			ksev.sigev_notify = evp->sigev_notify;
+-			ksev.sigev_tid = 0;
++			if (evp->sigev_notify == SIGEV_THREAD_ID)
++				ksev.sigev_tid = evp->sigev_notify_thread_id;
++			else
++				ksev.sigev_tid = 0;
+ 			ksevp = &ksev;
+ 		}
+ 		if (syscall(SYS_timer_create, clk, ksevp, &timerid) < 0)
+@@ -107,7 +111,7 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 
+ 		ksev.sigev_value.sival_ptr = 0;
+ 		ksev.sigev_signo = SIGTIMER;
+-		ksev.sigev_notify = 4; /* SIGEV_THREAD_ID */
++		ksev.sigev_notify = SIGEV_THREAD_ID;
+ 		ksev.sigev_tid = td->tid;
+ 		if (syscall(SYS_timer_create, clk, &ksev, &timerid) < 0)
+ 			timerid = -1;
diff --git a/srcpkgs/musl/template b/srcpkgs/musl/template
index 34e6ed4fba6e..afb33cd868b5 100644
--- a/srcpkgs/musl/template
+++ b/srcpkgs/musl/template
@@ -2,7 +2,7 @@
 pkgname=musl
 reverts="1.2.0_1"
 version=1.1.24
-revision=11
+revision=12
 archs="*-musl"
 bootstrap=yes
 build_style=gnu-configure

From d451f0d067aafdb2571b0b39f480ea42ffb8cd8a Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 08/37] gcc-multilib: update to 12.2.0.

---
 srcpkgs/gcc-multilib/template | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index f28eb237c287..ba9bafcadfd6 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,15 +3,15 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _majorver="${version%.*}"
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel
@@ -70,7 +70,7 @@ do_build() {
 	make ${makejobs}
 }
 do_install() {
-	local _pc_triplet=x86_64-pc-linux-gnu _version=${version%pre1}
+	local _pc_triplet=x86_64-pc-linux-gnu
 	# Install to a tempdir and then only copy relevant files.
 	cd ${wrksrc}
 	make DESTDIR=${wrksrc}/${pkgname}-build install
@@ -80,9 +80,9 @@ do_install() {
 	vmkdir usr/include/c++/${_majorver}/${_triplet}
 	vmkdir usr/lib/gcc/${_triplet}/${_majorver}
 
-	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${_version}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${version}/32 \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_majorver}/
-	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${_version}/${_pc_triplet}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${version}/${_pc_triplet}/32 \
 		${DESTDIR}/usr/include/c++/${_majorver}/${_triplet}
 
 	vinstall ${wrksrc}/host-${_pc_triplet}/gcc/specs 644 usr/lib/gcc/${_triplet}/${_majorver}

From 50de4888612299bc3297f84fa6f602dfaed2c59c Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 09/37] libgccjit: update to 12.2.0.

---
 srcpkgs/libgccjit/files/libgccjit-musl.patch | 63 --------------------
 srcpkgs/libgccjit/template                   | 24 +++-----
 2 files changed, 9 insertions(+), 78 deletions(-)
 delete mode 100644 srcpkgs/libgccjit/files/libgccjit-musl.patch

diff --git a/srcpkgs/libgccjit/files/libgccjit-musl.patch b/srcpkgs/libgccjit/files/libgccjit-musl.patch
deleted file mode 100644
index d2ed16928c82..000000000000
--- a/srcpkgs/libgccjit/files/libgccjit-musl.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-diff --git a/gcc/jit/jit-playback.c b/gcc/jit/jit-playback.c
-index 5bccf591a..35f5e35ef 100644
---- a/gcc/jit/jit-playback.c
-+++ b/gcc/jit/jit-playback.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -41,8 +43,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "diagnostic.h"
- #include "stmt.h"
- 
--#include <pthread.h>
--
- #include "jit-playback.h"
- #include "jit-result.h"
- #include "jit-builtins.h"
-diff --git a/gcc/jit/jit-recording.c b/gcc/jit/jit-recording.c
-index a237d574f..5785e3269 100644
---- a/gcc/jit/jit-recording.c
-+++ b/gcc/jit/jit-recording.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -25,8 +27,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "pretty-print.h"
- #include "toplev.h"
- 
--#include <pthread.h>
--
- #include "jit-builtins.h"
- #include "jit-recording.h"
- #include "jit-playback.h"
-diff --git a/gcc/jit/libgccjit.c b/gcc/jit/libgccjit.c
-index f9c33c63c..75f21d275 100644
---- a/gcc/jit/libgccjit.c
-+++ b/gcc/jit/libgccjit.c
-@@ -18,13 +18,13 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
- #include "timevar.h"
- #include "typed-splay-tree.h"
- #include "cppbuiltin.h"
--#include <pthread.h>
- 
- #include "libgccjit.h"
- #include "jit-recording.h"
diff --git a/srcpkgs/libgccjit/template b/srcpkgs/libgccjit/template
index 0b37c3ee9f8b..fde1affd54b7 100644
--- a/srcpkgs/libgccjit/template
+++ b/srcpkgs/libgccjit/template
@@ -3,18 +3,12 @@
 # which use the version number.
 
 pkgname=libgccjit
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
+version=12.2.0
 revision=1
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
-_majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 create_wrksrc=yes
 short_desc="Just-In-Time Compilation library for GCC"
 maintainer="Lane Biocini <lane@mailbox.org>"
@@ -22,16 +16,16 @@ homepage="https://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 nopie=yes
 lib32disabled=yes
 makedepends="zlib-devel"

From 41af978d0b52386b3ed730532452d5c0138f1887 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 10/37] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove -no-pie from build. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..5d40f0cdd8a6 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -53,6 +53,7 @@ _void_cross_build_binutils() {
 		--sbindir=/usr/bin \
 		--libdir=/usr/lib \
 		--libexecdir=/usr/lib \
+		--sysconfdir=/etc \
 		--target=${tgt} \
 		--with-sysroot=/usr/${tgt} \
 		--disable-nls \
@@ -60,7 +61,9 @@ _void_cross_build_binutils() {
 		--disable-multilib \
 		--disable-werror \
 		--disable-gold \
+		--disable-gprofng \
 		--enable-relro \
+		--enable-new-dtags \
 		--enable-plugins \
 		--enable-64-bit-bfd \
 		--enable-deterministic-archives \
@@ -132,6 +135,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -460,6 +464,14 @@ do_build() {
 	local binutils_ver linux_ver gcc_ver libc_ver libucontext_ver
 	local tgt=${sourcepkg/cross-}
 
+	export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}"
+	export CXXFLAGS="${CXXFLAGS/-D_FORTIFY_SOURCE=2/}"
+
+	# Disable explicit -fno-PIE, gcc/binutils/libc will figure this out itself.
+	export CFLAGS="${CFLAGS//-fno-PIE/}"
+	export CXXFLAGS="${CXXFLAGS//-fno-PIE/}"
+	export LDFLAGS="${LDFLAGS//-no-pie/}"
+
 	_void_cross_test_ver binutils
 	_void_cross_test_ver linux
 	_void_cross_test_ver gcc
@@ -625,6 +637,9 @@ do_install() {
 	# then remove it because it conflicts with libquadmath package
 	rm -rf ${DESTDIR}/${sysroot}/usr/lib/libquadmath.*
 
+	# Remove libdep linker plugin because it conflicts with system binutils
+	rm -f ${DESTDIR}/usr/lib/bfd-plugins/libdep*
+
 	# Remove leftover symlinks
 	rm -f ${DESTDIR}/usr/lib${XBPS_TARGET_WORDSIZE}
 	rm -f ${DESTDIR}/lib*

From 7ee31079ff441e7fa76e3b1307a5f7f605aafd30 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 11/37] subversion: fix build for libtool 2.4.7

---
 srcpkgs/subversion/template | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/subversion/template b/srcpkgs/subversion/template
index be37f60f9679..a1eaf4565d0b 100644
--- a/srcpkgs/subversion/template
+++ b/srcpkgs/subversion/template
@@ -24,6 +24,8 @@ distfiles="https://archive.apache.org/dist/subversion/subversion-${version}.tar.
 checksum=c9130e8d0b75728a66f0e7038fc77052e671830d785b5616aad53b4810d3cc28
 
 pre_configure() {
+	./autogen.sh --release
+
 	# Based on native build values
 	cat <<-EOF >config.cache
 	ac_cv_python_includes=-I${XBPS_CROSS_BASE}/usr/include/python${py3_ver}
@@ -59,7 +61,12 @@ pre_configure() {
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+
+	if [ "$XBPS_BUILD_ENVIRONMENT" = "void-packages-ci" ]; then
+		# This test will fail when run as the root user,
+		# because flock() will ignore file permissions.
+		vsed -i subversion/tests/libsvn_fs/locks-test.c -e '/SVN_TEST_OPTS_PASS(obtain_write_lock_failure,/,+3d'
+	fi
 }
 
 post_configure() {

From c9b347dc87d6014edf13817e81f4a355484987b2 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 12/37] subversion-kwallet-auth: fix build for libtool 2.4.7.

Fix failing distfiles.
Fix build for libtool 2.4.7
---
 srcpkgs/subversion-kwallet-auth/template | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/subversion-kwallet-auth/template b/srcpkgs/subversion-kwallet-auth/template
index ec9a6ea7d974..319de334752e 100644
--- a/srcpkgs/subversion-kwallet-auth/template
+++ b/srcpkgs/subversion-kwallet-auth/template
@@ -25,6 +25,8 @@ checksum=c9130e8d0b75728a66f0e7038fc77052e671830d785b5616aad53b4810d3cc28
 lib32disabled=yes
 
 pre_configure() {
+	./autogen.sh --release
+
 	# Based on native build values
 	cat <<-EOF >config.cache
 	ac_cv_python_includes=-I${XBPS_CROSS_BASE}/usr/include/python${py3_ver}
@@ -54,11 +56,18 @@ pre_configure() {
 		cp "$XBPS_CROSS_BASE/usr/lib/perl5/core_perl/Config"*.p? $PERL5LIB
 		cp "$XBPS_CROSS_BASE/usr/lib/perl5/core_perl/Errno.pm" $PERL5LIB
 		vsed -e "s;archlibexp => '\(.*\)';archlibexp => '${XBPS_CROSS_BASE}\1';" \
-			-i $PERL5LIB/Config.pm $PERL5LIB/Config_heavy.pl
+			-i $PERL5LIB/Config.pm
+		vsed -e "s;archlibexp='\(.*\)';archlibexp='${XBPS_CROSS_BASE}\1';" \
+			-i $PERL5LIB/Config_heavy.pl
 	else
 		configure_args+=" --with-apxs"
 	fi
-	NOCONFIGURE=1 autoreconf -fi
+
+	if [ "$XBPS_BUILD_ENVIRONMENT" = "void-packages-ci" ]; then
+		# This test will fail when run as the root user,
+		# because flock() will ignore file permissions.
+		vsed -i subversion/tests/libsvn_fs/locks-test.c -e '/SVN_TEST_OPTS_PASS(obtain_write_lock_failure,/,+3d'
+	fi
 }
 
 post_configure() {

From d52cd723b80933ee2f76821e13fd976faa72adb8 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 13/37] qemu: remove broken patch

The necessary patch has been imported into musl so no need
to cast the sigevent struct to a more glibc-like one.
---
 .../musl-fix-sigevent-and-sigval_t.patch      | 27 -------------------
 1 file changed, 27 deletions(-)
 delete mode 100644 srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch

diff --git a/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch b/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch
deleted file mode 100644
index 4b4f1117c15f..000000000000
--- a/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-Note: Remove this patch with musl 1.2.2
-
---- a/linux-user/syscall.c
-+++ b/linux-user/syscall.c
-@@ -5020,10 +5020,21 @@
- #ifndef HAVE_SIGEV_NOTIFY_THREAD_ID
- #define sigev_notify_thread_id _sigev_un._tid
- #endif
- 
--static inline abi_long target_to_host_sigevent(struct sigevent *host_sevp,
-+struct host_sigevent {
-+    union sigval sigev_value;
-+    int sigev_signo;
-+    int sigev_notify;
-+    union {
-+       char _pad[64 - sizeof(int) * 2 - sizeof(union sigval)];
-+       int _tid;
-+    } _sigev_un;
-+};
-+
-+static inline abi_long target_to_host_sigevent(struct sigevent *sevp,
-                                                abi_ulong target_addr)
- {
-+    struct host_sigevent *host_sevp = (struct host_sigevent *) sevp;
-     struct target_sigevent *target_sevp;
- 
-     if (!lock_user_struct(VERIFY_READ, target_sevp, target_addr, 1)) {

From 51bb95fb3ef89a9487c320fa45cbbc348ab8c4c6 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 14/37] cross-aarch64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..9e6fb75c198d 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Leah Neukirchen <leah@vuxu.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From b3c2a380a3f1dd4e43d2fe83980a8387ba83f779 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 15/37] cross-aarch64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..ba14c96bccea 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 3380f7d60f4cf9277a30035ebf6a0b6ccab001d5 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 16/37] cross-arm-linux-gnueabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..5c774e16f430 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From ab2b76bbcef8617f9250cb866614bc3573c2fdf0 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 17/37] cross-arm-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..d6298ab639a4 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 5c45d860ff438767180085d1462b4a817a20539e Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 18/37] cross-arm-linux-musleabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..24df78e8fd8e 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From c2bfa14634897eec6e0dec68f18f683a41938a7b Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 19/37] cross-arm-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..8093700f909c 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From d2a28d9a2bb314d877fd48ec440847cb1b203425 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 20/37] cross-armv7l-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..92665326428b 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 76632edb484f9202d178f9a2e236c8b2612d8868 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 21/37] cross-armv7l-linux-musleabihf: update to gcc 12.2.0.

---
 .../cross-armv7l-linux-musleabihf/template    | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..e5af2c9ccbf2 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 17e35e74a5369380392e4e7aca53a8125fff9dc9 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 22/37] cross-i686-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-i686-linux-musl/template b/srcpkgs/cross-i686-linux-musl/template
index 8be16a230d8d..d624bb7a3254 100644
--- a/srcpkgs/cross-i686-linux-musl/template
+++ b/srcpkgs/cross-i686-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-i686-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-i686-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 3361aec9558c2214d9131b948800a0f7cff00e2c Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 23/37] cross-i686-pc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..6a9e54db807a 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,14 +1,15 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -16,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 4bcb09ab6e3129f573cb3f89643e7c2afbddeaea Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 24/37] cross-mips-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-musl/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..67a5c413396c 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 7bfed7d02fbf9f58940848a460020d4d35ce1eca Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 25/37] cross-mips-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..bdf8600ce95b 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="hipperson0 <hipperson0@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 056d69d2cbd53dc818daf0cd1b3b22597c41d517 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 26/37] cross-mipsel-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..de49387d517b 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 9aac8e71483f5c523aa0e49a62abfbba7bfdf5e1 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 27/37] cross-mipsel-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..b27ce6475a38 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 17ad07926bd95eef4b15edc17de060ba6fd4597b Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 28/37] cross-powerpc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..79579e093b12 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From c7b20bf1fa66aa98449f3370b7ef5c520587383f Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 29/37] cross-powerpc-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..9bb6acd359b6 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 6a98bf6cc5833f838254bce972577ef8af19e736 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 30/37] cross-powerpc64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..2d153d00add6 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,16 +1,17 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
  --enable-targets=powerpc-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -18,12 +19,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 04a237d41f2e5224e977deff97984c350e7ecf1e Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 31/37] cross-powerpc64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 016f18776a6d..e0848fe0bff7 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,30 +1,31 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 7d99e979304f4b0720161bb51a04cf47d09aa961 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 32/37] cross-powerpc64le-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 463d7e92d20d..8d8e010e15c0 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,16 +1,17 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
  --enable-targets=powerpcle-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -18,12 +19,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From e7a1b9c3efd787d428b4b57a73c7e4196ed3dd55 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 33/37] cross-powerpc64le-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index c17a3cccfe29..0915e524545f 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,30 +1,31 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 9942ca0c15924087b707f6287de877a3b5ee4c25 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 34/37] cross-powerpcle-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 9aede3c465ce..687be8a44c6c 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 
@@ -35,6 +36,8 @@ if [ "$XBPS_TARGET_MACHINE" = "ppcle" ]; then
 	broken="Can't build crosstoolchain to itself"
 fi
 
+broken="glibc uses big-endian specific instructions on 32-bit powerpc"
+
 cross-powerpcle-linux-gnu-libc_package() {
 	short_desc+=" - glibc files"
 	nostrip=yes

From fc2c2e3ad557fd2d398b259213a6f53791da5d45 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 35/37] cross-powerpcle-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index 045cfda987fe..bb984b9c42eb 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From d8240d25880b60a2ec83998db7415faa53346704 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:30 -0800
Subject: [PATCH 36/37] cross-x86_64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 8918f3c22a1c..930aaf2a508b 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,14 +1,15 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -16,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 2cd7f98980729e14ea5f30ea7c097efae194d56f Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:30 -0800
Subject: [PATCH 37/37] cross-x86_64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..ac5b1c46ab82 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (223 preceding siblings ...)
  2022-11-16  2:05 ` [PR PATCH] [Updated] " oreo639
@ 2022-11-16  2:06 ` sgn
  2022-11-17  0:48 ` [PR PATCH] [Updated] " oreo639
                   ` (39 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: sgn @ 2022-11-16  2:06 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 183 bytes --]

New comment by sgn on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1316180613

Comment:
@kruceter Ah, OK, sorry for misunderstanding.

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (224 preceding siblings ...)
  2022-11-16  2:06 ` sgn
@ 2022-11-17  0:48 ` oreo639
  2022-11-17  1:54 ` oreo639
                   ` (38 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-11-17  0:48 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5448 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.2.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.2.0

There is a list of failing builds here: https://github.com/void-linux/void-packages/issues/39809

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [x] llvm https://github.com/void-linux/void-packages/pull/38694
- [x] m4 https://github.com/void-linux/void-packages/pull/33730
- [x] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [x] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [x] libvirt https://github.com/void-linux/void-packages/pull/38842
- [x] syslinux https://github.com/void-linux/void-packages/pull/38876
- [x] efivar https://github.com/void-linux/void-packages/pull/38874
- [x] gpgme https://github.com/void-linux/void-packages/pull/38825

Known packages that needed to be fixed/updated for gcc12:
- [x] openssh https://github.com/void-linux/void-packages/pull/38849
- [x] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [x] doxygen https://github.com/void-linux/void-packages/pull/38846
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] libproxy https://github.com/void-linux/void-packages/pull/38818
- [x] exempi https://github.com/void-linux/void-packages/pull/38820
- [x] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [x] libunique1 https://github.com/void-linux/void-packages/pull/38848 or https://github.com/void-linux/void-packages/pull/38873
- [x] libwpd https://github.com/void-linux/void-packages/pull/38878
- [x] cglm https://github.com/void-linux/void-packages/pull/39748
- [x] coreboot-utils https://github.com/void-linux/void-packages/pull/39749
- [x] apl https://github.com/void-linux/void-packages/pull/39750
- [x] igt-gpu-tools https://github.com/void-linux/void-packages/pull/39780

Needs to be fixed/updated for binutils:
- [x] grub https://github.com/void-linux/void-packages/pull/38875
- [x] linux-tools https://github.com/void-linux/void-packages/pull/38877
- [x] kcov https://github.com/void-linux/void-packages/pull/39291

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [x] kde
- [x] lxde
- [x] lxqt

You can test the ISOs here:
https://drive.google.com/drive/folders/1ix92CYSLUP-KWjLxltdgG4e8Nu2JCY5n?usp=sharing

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 131864 bytes --]

From 226421d934978cd86da1c39b21bd4d29d91620e5 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 01/35] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../fix-libcollector-without-java.patch       | 53 +++++++++++++++
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 25 ++++---
 4 files changed, 87 insertions(+), 117 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
 create mode 100644 srcpkgs/binutils/patches/fix-libcollector-without-java.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/fix-libcollector-without-java.patch b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
new file mode 100644
index 000000000000..54384875f358
--- /dev/null
+++ b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
@@ -0,0 +1,53 @@
+From 49ddd814ac1071af7c4f45d5f8398b91862f2c7f Mon Sep 17 00:00:00 2001
+From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
+Date: Wed, 17 Aug 2022 19:55:23 -0700
+Subject: [PATCH] gprofng: fix bug 29479 Collection fails when built without
+ java support
+
+gprofng/ChangeLog
+2022-08-17  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>
+
+	PR gprofng/29479
+	* libcollector/collector.c: Add #if defined(GPROFNG_JAVA_PROFILING) for
+	java specific code.
+	* libcollector/unwind.c: Likewise.
+---
+ gprofng/libcollector/collector.c | 2 ++
+ gprofng/libcollector/unwind.c    | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/gprofng/libcollector/collector.c b/gprofng/libcollector/collector.c
+index 93c9d3330de5..ceff2c1caccb 100644
+--- a/gprofng/libcollector/collector.c
++++ b/gprofng/libcollector/collector.c
+@@ -913,8 +913,10 @@ __collector_open_experiment (const char *exp, const char *params, sp_origin_t or
+   __collector_ext_unwind_key_init (1, NULL);
+ 
+   /* start java attach if suitable */
++#if defined(GPROFNG_JAVA_PROFILING)
+   if (exp_origin == SP_ORIGIN_DBX_ATTACH)
+     __collector_jprofile_start_attach ();
++#endif
+   start_sec_time = CALL_UTIL (time)(NULL);
+   __collector_start_time = collector_interface.getHiResTime ();
+   TprintfT (DBG_LT0, "\t__collector_open_experiment; resetting start_time\n");
+diff --git a/gprofng/libcollector/unwind.c b/gprofng/libcollector/unwind.c
+index 119243788020..f8e11823c81e 100644
+--- a/gprofng/libcollector/unwind.c
++++ b/gprofng/libcollector/unwind.c
+@@ -557,6 +557,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+   int size = max_frame_size;
+ 
+ #define MIN(a,b) ((a)<(b)?(a):(b))
++#if defined(GPROFNG_JAVA_PROFILING)
+   /* get Java info */
+   if (__collector_java_mode && __collector_java_asyncgetcalltrace_loaded && context && !pseudo_context)
+     {
+@@ -569,6 +570,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+ 	  size -= sz;
+ 	}
+     }
++#endif
+ 
+   /* get native stack */
+   if (context)
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..c355a5fc8016 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkgconf"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -35,15 +36,21 @@ do_configure() {
 	local conf
 
 	if [ "$CHROOT_READY" ]; then
-		conf+=" --with-debuginfod"
+		conf+=" --with-debuginfod --enable-shared"
 	else
-		conf+=" --without-debuginfod --disable-install-libbfd"
+		conf+=" --without-debuginfod --disable-shared --disable-install-libbfd"
 	fi
 	if [ "$CROSS_BUILD" ]; then
 		# we don't want --with-sysroot=${XBPS_CROSS_BASE} like gnu-configure
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	# gprofng currently only supports x86 and aarch64 glibc.
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64|i386|aarch64) conf+=" --enable-gprofng" ;;
+		*) conf+=" --disable-gprofng" ;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"
@@ -76,13 +83,14 @@ do_configure() {
 		--libdir=/usr/lib \
 		--mandir=/usr/share/man \
 		--infodir=/usr/share/info \
+		--sysconfdir=/etc \
 		--disable-werror \
-		--disable-shared \
 		--disable-nls \
 		--enable-threads \
 		--enable-plugins \
 		--enable-relro \
 		--enable-gold \
+		--enable-new-dtags \
 		--enable-deterministic-archives \
 		--enable-64-bit-bfd \
 		--enable-ld=default \
@@ -142,7 +150,8 @@ binutils-devel_package() {
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/*.a"
-		vmove "usr/lib/*.so"
+		vmove "usr/lib/libbfd.so"
+		vmove "usr/lib/libopcodes.so"
 	}
 }
 

From 23844e82b655ca5c95c9649f5cf510107e90a09e Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 02/35] gdb: resolve conflict with binutils 2.39

---
 srcpkgs/gdb/template | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/gdb/template b/srcpkgs/gdb/template
index 9c5f17ffc519..b666348fea19 100644
--- a/srcpkgs/gdb/template
+++ b/srcpkgs/gdb/template
@@ -1,7 +1,7 @@
 # Template file for 'gdb'
 pkgname=gdb
 version=12.1
-revision=2
+revision=3
 build_style=gnu-configure
 pycompile_dirs="/usr/share/gdb/python"
 configure_args="--disable-werror --disable-nls --with-system-readline
@@ -48,7 +48,8 @@ vopt_conflict debuginfod static
 
 post_install() {
 	# resolve conflicts with binutils
-	rm -r ${DESTDIR}/usr/{include,lib,share/info/bfd.info*}
+	rm -rf ${DESTDIR}/usr/{include,lib}
+	rm -rf ${DESTDIR}/usr/share/info/{bfd,ctf-spec}.info*
 }
 
 gdb-common_package() {

From 26eed6ed4c3ac9b7c47e7f1e971ab338b8f93382 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 03/35] gcc: update to 12.2.0.

---
 common/shlibs                                 | 10 +--
 srcpkgs/gcc/files/gccgo-musl.patch            | 71 +++------------
 srcpkgs/gcc/files/libgnarl-musl.patch         | 18 ++--
 srcpkgs/gcc/files/libssp-musl.patch           | 10 +--
 srcpkgs/gcc/patches/libffi_gnulinux.patch     | 11 ---
 .../gcc/patches/libgcc-ibm128-no-tag.patch    | 10 ++-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |  2 +-
 srcpkgs/gcc/template                          | 87 +++++++++----------
 8 files changed, 80 insertions(+), 139 deletions(-)
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index 481250d5c924..ffeae1b92d28 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.2.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.36 perl-5.36.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -857,8 +857,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.2.0_1
+libgnat-12.so libada-12.2.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1710,8 +1710,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.2.0_1
+libasan.so.8 libsanitizer-12.2.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..12ec68dd8aa3 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,14 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ b/libgo/go/runtime/os_linux.go
+@@ -365,7 +365,7 @@ func setThreadCPUProfiler(hz int32) {
+ 	var sevp _sigevent
+ 	sevp.sigev_notify = _SIGEV_THREAD_ID
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.__sev_fields))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index ab3643de4f98..a20af7c0ef2e 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,14 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
+version=12.2.0
+revision=1
+_minorver="${version%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 create_wrksrc=yes
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +18,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -52,8 +48,11 @@ if [ "$CHROOT_READY" ]; then
 	hostmakedepends="tar texinfo perl flex"
 else
 	_have_gccgo=no
+	# libzstd fails to link in bootstrap with glibc 2.36
+	# when zlib has been compiled with glibc 2.32.
+	LDFLAGS="-lzstd -pthread"
 fi
-makedepends="zlib-devel"
+makedepends="zlib-devel libzstd-devel"
 depends="binutils libgcc-devel-${version}_${revision}
  libstdc++-devel-${version}_${revision} libssp-devel-${version}_${revision}"
 checkdepends="dejagnu"
@@ -70,13 +69,13 @@ if [ "$build_option_gnatboot" ]; then
 	case "$XBPS_TARGET_MACHINE" in
 	x86_64)
 		_gnat_tarball="gnat-gpl-2017-x86_64-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/591c6d80c7a447af2deed1d7>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/9682e2e1f2f232ce03fe21d77b14c37a0de5649b?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" b942bcac20dea39748b39f8b624d9619f60a8dee2e8195dbe3829c835b0956e6"
 		build_options_default="gnatboot"
 		;;
 	i686)
 		_gnat_tarball="gnat-gpl-2014-x86-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/564b3e9dc8e196b040fbe248>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/c5e9e6fdff5cb77ed90cf8c62536653e27c0bed6?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" 3b693510f5d22a240abb3034934c1adbd80ccd6e4f61a4f491cc408fdfd9c042"
 		build_options_default="gnatboot"
 		;;
@@ -155,8 +154,8 @@ if [ "$CROSS_BUILD" ]; then
 fi
 
 post_extract() {
-	mv gcc-${version/pre/_pre}/* gcc-${version/pre/_pre}/.??* .
-	rmdir gcc-${version/pre/_pre}
+	mv gcc-${version}/* gcc-${version}/.??* .
+	rmdir gcc-${version}
 	mv gmp-${_gmp_version} gmp
 	mv mpfr-${_mpfr_version} mpfr
 	mv mpc-${_mpc_version} mpc
@@ -186,9 +185,9 @@ pre_configure() {
 	sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
 
 	if [ "$XBPS_TARGET_LIBC" = musl ]; then
-		patch -p1 -i ${FILESDIR}/libgnarl-musl.patch
-		patch -p1 -i ${FILESDIR}/libssp-musl.patch
-		patch -p1 -i ${FILESDIR}/gccgo-musl.patch
+		for p in ${FILESDIR}/*-musl.patch; do
+			patch -p1 -i $p
+		done
 	fi
 }
 do_configure() {
@@ -343,16 +342,16 @@ do_install() {
 
 	# Make version a symlink of major version to make all versions
 	# from the same series work automagically.
-	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver} \
+	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${version} \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver}
 	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver} \
-		${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}
+		${DESTDIR}/usr/lib/gcc/${_triplet}/${version}
 
 	# Ditto for c++ headers.
-	mv ${DESTDIR}/usr/include/c++/${_patchver} \
+	mv ${DESTDIR}/usr/include/c++/${version} \
 		${DESTDIR}/usr/include/c++/${_minorver}
 	ln -sfr ${DESTDIR}/usr/include/c++/${_minorver} \
-		${DESTDIR}/usr/include/c++/${_patchver}
+		${DESTDIR}/usr/include/c++/${version}
 
 	# cc symlink
 	ln -sfr ${DESTDIR}/usr/bin/gcc ${DESTDIR}/usr/bin/cc
@@ -361,7 +360,7 @@ do_install() {
 
 	# lto plugin symlink
 	vmkdir usr/lib/bfd-plugins
-	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}/liblto_plugin.so \
+	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${version}/liblto_plugin.so \
 		${DESTDIR}/usr/lib/bfd-plugins
 
 	# Remove "fixed" header
@@ -372,13 +371,9 @@ do_install() {
 	rm -f ${DESTDIR}/usr/lib/libffi*
 	rm -f ${DESTDIR}/usr/share/man/man3/ffi*
 
-	# Remove all python scripts in libdir.
-	rm -f ${DESTDIR}/usr/lib/*.py
-
-	# Remove more python stuff.
-	if [ -d ${DESTDIR}/usr/share/gcc-${_patchver}/python ]; then
-		rm -rf ${DESTDIR}/usr/share/gcc-${_patchver}/python
-	fi
+	# Move libstdc++ gdb helpers to location where gdb can autoload them
+	mkdir -p ${DESTDIR}/usr/share/gdb/auto-load/usr/lib
+	mv ${DESTDIR}/usr/lib/*.py ${DESTDIR}/usr/share/gdb/auto-load/usr/lib
 
 	# Install c89 and c99 wrappers and its manpages, from NetBSD.
 	for f in c89 c99; do
@@ -397,7 +392,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}
@@ -450,7 +445,7 @@ gcc-fortran_package() {
 		if [ "$CROSS_BUILD" ]; then
 			# A number of OMP modules are not built when cross
 			# compiling gcc. Copy them from the cross compiler.
-			local src="/usr/lib/gcc/${_triplet}/${_patchver}/finclude"
+			local src="/usr/lib/gcc/${_triplet}/${version}/finclude"
 			local dst="usr/lib/gcc/${_triplet}/${_minorver}/finclude"
 			for f in omp_lib.f90 omp_lib.h omp_lib.mod omp_lib_kinds.mod \
 				openacc.f90 openacc.mod openacc_kinds.mod openacc_lib.h; do
@@ -517,7 +512,7 @@ libgfortran_package() {
 	short_desc+=" - Fortran library"
 	pkg_install() {
 		vmove "usr/lib/libgfortran.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -538,7 +533,7 @@ libgo_package() {
 	nostrip=yes
 	pkg_install() {
 		vmove "usr/lib/libgo.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -554,7 +549,7 @@ libobjc_package() {
 	short_desc+=" - Objective-C library"
 	pkg_install() {
 		vmove "usr/lib/libobjc.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -573,7 +568,7 @@ libquadmath_package() {
 	short_desc+=" - quadmath library"
 	pkg_install() {
 		vmove "usr/lib/libquadmath.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -615,7 +610,7 @@ libgcc_package() {
 	noverifyrdeps=yes
 	pkg_install() {
 		vmove "usr/lib/libgcc_s.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -646,7 +641,7 @@ libgomp_package() {
 	short_desc+=" - OpenMP v4.0 library"
 	pkg_install() {
 		vmove "usr/lib/libgomp*.so.*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -701,7 +696,7 @@ libssp_package() {
 	short_desc+=" - SSP (StackSmashingProtection) library"
 	pkg_install() {
 		vmove "usr/lib/libssp.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -718,7 +713,9 @@ libstdc++-devel_package() {
 libstdc++_package() {
 	short_desc+=" - Standard C++ Library"
 	pkg_install() {
+		vmove usr/share/gdb
+		vmove usr/share/gcc-${version}/python
 		vmove "usr/lib/libstdc++.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }

From 74ced4016f3dade5de1018427cabf24b04964d7c Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 04/35] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 .../libtool/patches/fix-tests-grep-3.8.patch  | 18 ++++++++++
 srcpkgs/libtool/template                      | 13 ++++---
 3 files changed, 43 insertions(+), 22 deletions(-)
 create mode 100644 srcpkgs/libtool/patches/fix-tests-grep-3.8.patch

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/patches/fix-tests-grep-3.8.patch b/srcpkgs/libtool/patches/fix-tests-grep-3.8.patch
new file mode 100644
index 000000000000..2003a19a3eef
--- /dev/null
+++ b/srcpkgs/libtool/patches/fix-tests-grep-3.8.patch
@@ -0,0 +1,18 @@
+--- a/tests/link-order.at
++++ b/tests/link-order.at
+@@ -99,12 +99,12 @@ aix* | interix*) ;;  # These systems hav
+   case $hardcode_direct$hardcode_direct_absolute in
+   yesno)
+     AT_CHECK([if $EGREP relinking stderr; then
+-         $EGREP " .*\/new\/lib/libb$shared_ext .*\/old\/lib/libcee$shared_ext" stdout
++         $EGREP " .*/new/lib/libb$shared_ext .*/old/lib/libcee$shared_ext" stdout
+        else :; fi], [0], [ignore], [], [echo "wrong link order"])
+     ;;
+   *)
+     AT_CHECK([if $EGREP relinking stderr; then
+-         $EGREP " -L.*\/new\/lib -lb -L.*\/old\/lib -lcee" stdout
++         $EGREP " -L.*/new/lib -lb -L.*/old/lib -lcee" stdout
+        else :; fi], [0], [ignore], [], [echo "wrong link order"])
+     ;;
+   esac
+
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..1b613cd15523 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,12 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	# Musl always searches LD_LIBRARY_PATH before RPATH and RUNPATH
+	configure_args="lt_cv_shlibpath_overrides_runpath=yes"
+fi
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in
@@ -45,10 +50,8 @@ post_install() {
 		_host_os=$(grep "^host_os=" ${PKGDESTDIR}/usr/bin/libtool | sed 's/host_os=//')
 		vsed -i \
 		 -e "s,^host_alias=.*,host_alias=${_canonical_host}," \
-		 -e "s,^host=.*,host=${_canonical_host}," \
 		 -e "s,^build_alias=.*,build_alias=${_canonical_host}," \
 		 -e "s,^build=.*,build=${_canonical_host}," \
-		 -e "s,^build_os=.*,build_os=${_host_os}," \
 		 ${PKGDESTDIR}/usr/bin/libtool
 	fi
 }

From 181d357a9fe1addf5173ef2770ddfc996d12a3a8 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 05/35] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 7e01bbb851fd..d9618e3806ba 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 build_wrksrc=libiberty
 build_style=gnu-configure
@@ -10,7 +10,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From a45ca9d61f8b538b7cccf5649e027a8eb5133c9a Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 06/35] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 ...e-hash-style-both-for-building-glibc.patch |  51 ++++
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 4 files changed, 106 insertions(+), 353 deletions(-)
 create mode 100644 srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index ffeae1b92d28..5b935a507580 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch b/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
new file mode 100644
index 000000000000..9c5553e92609
--- /dev/null
+++ b/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
@@ -0,0 +1,51 @@
+Temporary workaround for EAC bug.
+
+See: https://sourceware.org/bugzilla/show_bug.cgi?id=29456
+
+From 8e90e2cc5e57d7ca3a40602d278e9642a8b66716 Mon Sep 17 00:00:00 2001
+From: oreo639 <oreo6391@gmail.com>
+Date: Tue, 13 Sep 2022 14:30:35 -0700
+Subject: [PATCH] Revert "Do not use --hash-style=both for building glibc
+ shared objects"
+
+This reverts commit e47de5cb2d4dbecb58f569ed241e8e95c568f03c.
+---
+ Makeconfig     |  9 +++++++++
+ Makerules      |  7 +++++++
+ 5 files changed, 61 insertions(+)
+
+diff --git a/Makeconfig b/Makeconfig
+index ba70321af1..e2131d4389 100644
+--- a/Makeconfig
++++ b/Makeconfig
+@@ -371,6 +371,13 @@ dt-relr-ldflag =
+ no-dt-relr-ldflag =
+ endif
+ 
++# For the time being we unconditionally use 'both'.  At some time we
++# should declare statically linked code as 'out of luck' and compile
++# with --hash-style=gnu only.
++hashstyle-LDFLAGS = -Wl,--hash-style=both
++LDFLAGS.so += $(hashstyle-LDFLAGS)
++LDFLAGS-rtld += $(hashstyle-LDFLAGS)
++
+ ifeq (no,$(build-pie-default))
+ pie-default = $(no-pie-ccflag)
+ else # build-pie-default
+diff --git a/Makerules b/Makerules
+index d1e139d03c..44134e37ce 100644
+--- a/Makerules
++++ b/Makerules
+@@ -558,6 +558,9 @@ $(common-objpfx)shlib.lds: $(common-objpfx)config.make $(..)Makerules
+ 		  -Wl,--verbose 2>/dev/null | \
+ 	  sed > $@T \
+ 	      -e '/^=========/,/^=========/!d;/^=========/d' \
++		   -e 's/^.*\.gnu\.hash[ 	]*:.*$$/  .note.ABI-tag : { *(.note.ABI-tag) } &/' \
++		   -e '/^[ 	]*\.hash[ 	]*:.*$$/{h;d;}' \
++		   -e '/DATA_SEGMENT_ALIGN/{H;g}' \
+ 	      -e 's/^.*\*(\.dynbss).*$$/& \
+ 		 PROVIDE(__start___libc_freeres_ptrs = .); \
+ 		 *(__libc_freeres_ptrs) \
+-- 
+2.37.3
+
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From ae0dd4db0a1b9944167b70ead01a579d7679d7b0 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 07/35] musl: add support for SIGEV_THREAD_ID timers

https://git.musl-libc.org/cgit/musl/commit/?id=7c71792e87691451f2a6b76348e83ad1889f1dcb
---
 ...d-support-for-SIGEV_THREAD_ID-timers.patch | 74 +++++++++++++++++++
 srcpkgs/musl/template                         |  2 +-
 2 files changed, 75 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch

diff --git a/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
new file mode 100644
index 000000000000..e20dff5ba0d4
--- /dev/null
+++ b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
@@ -0,0 +1,74 @@
+From 7c71792e87691451f2a6b76348e83ad1889f1dcb Mon Sep 17 00:00:00 2001
+From: James Y Knight <jyknight@google.com>
+Date: Sun, 30 Jun 2019 21:55:20 -0400
+Subject: [PATCH] add support for SIGEV_THREAD_ID timers
+
+This is like SIGEV_SIGNAL, but targeted to a particular thread's
+tid, rather than the process.
+---
+ include/signal.h        | 16 +++++++++++++---
+ src/time/timer_create.c |  8 ++++++--
+ 2 files changed, 19 insertions(+), 5 deletions(-)
+
+diff --git a/include/signal.h b/include/signal.h
+index fbdf667b2..9ed929e4f 100644
+--- a/include/signal.h
++++ b/include/signal.h
+@@ -180,14 +180,24 @@ struct sigevent {
+ 	union sigval sigev_value;
+ 	int sigev_signo;
+ 	int sigev_notify;
+-	void (*sigev_notify_function)(union sigval);
+-	pthread_attr_t *sigev_notify_attributes;
+-	char __pad[56-3*sizeof(long)];
++	union {
++		char __pad[64 - 2*sizeof(int) - sizeof(union sigval)];
++		pid_t sigev_notify_thread_id;
++		struct {
++			void (*sigev_notify_function)(union sigval);
++			pthread_attr_t *sigev_notify_attributes;
++		} __sev_thread;
++	} __sev_fields;
+ };
+ 
++#define sigev_notify_thread_id __sev_fields.sigev_notify_thread_id
++#define sigev_notify_function __sev_fields.__sev_thread.sigev_notify_function
++#define sigev_notify_attributes __sev_fields.__sev_thread.sigev_notify_attributes
++
+ #define SIGEV_SIGNAL 0
+ #define SIGEV_NONE 1
+ #define SIGEV_THREAD 2
++#define SIGEV_THREAD_ID 4
+ 
+ int __libc_current_sigrtmin(void);
+ int __libc_current_sigrtmax(void);
+diff --git a/src/time/timer_create.c b/src/time/timer_create.c
+index 5ddfda278..4bef23905 100644
+--- a/src/time/timer_create.c
++++ b/src/time/timer_create.c
+@@ -71,11 +71,15 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 	switch (evp ? evp->sigev_notify : SIGEV_SIGNAL) {
+ 	case SIGEV_NONE:
+ 	case SIGEV_SIGNAL:
++	case SIGEV_THREAD_ID:
+ 		if (evp) {
+ 			ksev.sigev_value = evp->sigev_value;
+ 			ksev.sigev_signo = evp->sigev_signo;
+ 			ksev.sigev_notify = evp->sigev_notify;
+-			ksev.sigev_tid = 0;
++			if (evp->sigev_notify == SIGEV_THREAD_ID)
++				ksev.sigev_tid = evp->sigev_notify_thread_id;
++			else
++				ksev.sigev_tid = 0;
+ 			ksevp = &ksev;
+ 		}
+ 		if (syscall(SYS_timer_create, clk, ksevp, &timerid) < 0)
+@@ -107,7 +111,7 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 
+ 		ksev.sigev_value.sival_ptr = 0;
+ 		ksev.sigev_signo = SIGTIMER;
+-		ksev.sigev_notify = 4; /* SIGEV_THREAD_ID */
++		ksev.sigev_notify = SIGEV_THREAD_ID;
+ 		ksev.sigev_tid = td->tid;
+ 		if (syscall(SYS_timer_create, clk, &ksev, &timerid) < 0)
+ 			timerid = -1;
diff --git a/srcpkgs/musl/template b/srcpkgs/musl/template
index 34e6ed4fba6e..afb33cd868b5 100644
--- a/srcpkgs/musl/template
+++ b/srcpkgs/musl/template
@@ -2,7 +2,7 @@
 pkgname=musl
 reverts="1.2.0_1"
 version=1.1.24
-revision=11
+revision=12
 archs="*-musl"
 bootstrap=yes
 build_style=gnu-configure

From 0f659ffbe3c974de0cbf48c1fe541db983a1389f Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 08/35] gcc-multilib: update to 12.2.0.

---
 srcpkgs/gcc-multilib/template | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index f28eb237c287..ba9bafcadfd6 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,15 +3,15 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _majorver="${version%.*}"
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel
@@ -70,7 +70,7 @@ do_build() {
 	make ${makejobs}
 }
 do_install() {
-	local _pc_triplet=x86_64-pc-linux-gnu _version=${version%pre1}
+	local _pc_triplet=x86_64-pc-linux-gnu
 	# Install to a tempdir and then only copy relevant files.
 	cd ${wrksrc}
 	make DESTDIR=${wrksrc}/${pkgname}-build install
@@ -80,9 +80,9 @@ do_install() {
 	vmkdir usr/include/c++/${_majorver}/${_triplet}
 	vmkdir usr/lib/gcc/${_triplet}/${_majorver}
 
-	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${_version}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${version}/32 \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_majorver}/
-	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${_version}/${_pc_triplet}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${version}/${_pc_triplet}/32 \
 		${DESTDIR}/usr/include/c++/${_majorver}/${_triplet}
 
 	vinstall ${wrksrc}/host-${_pc_triplet}/gcc/specs 644 usr/lib/gcc/${_triplet}/${_majorver}

From 43faf516765e1dddfdce028fe067eab180a2a0b6 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 09/35] libgccjit: update to 12.2.0.

---
 srcpkgs/libgccjit/files/libgccjit-musl.patch | 63 --------------------
 srcpkgs/libgccjit/template                   | 24 +++-----
 2 files changed, 9 insertions(+), 78 deletions(-)
 delete mode 100644 srcpkgs/libgccjit/files/libgccjit-musl.patch

diff --git a/srcpkgs/libgccjit/files/libgccjit-musl.patch b/srcpkgs/libgccjit/files/libgccjit-musl.patch
deleted file mode 100644
index d2ed16928c82..000000000000
--- a/srcpkgs/libgccjit/files/libgccjit-musl.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-diff --git a/gcc/jit/jit-playback.c b/gcc/jit/jit-playback.c
-index 5bccf591a..35f5e35ef 100644
---- a/gcc/jit/jit-playback.c
-+++ b/gcc/jit/jit-playback.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -41,8 +43,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "diagnostic.h"
- #include "stmt.h"
- 
--#include <pthread.h>
--
- #include "jit-playback.h"
- #include "jit-result.h"
- #include "jit-builtins.h"
-diff --git a/gcc/jit/jit-recording.c b/gcc/jit/jit-recording.c
-index a237d574f..5785e3269 100644
---- a/gcc/jit/jit-recording.c
-+++ b/gcc/jit/jit-recording.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -25,8 +27,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "pretty-print.h"
- #include "toplev.h"
- 
--#include <pthread.h>
--
- #include "jit-builtins.h"
- #include "jit-recording.h"
- #include "jit-playback.h"
-diff --git a/gcc/jit/libgccjit.c b/gcc/jit/libgccjit.c
-index f9c33c63c..75f21d275 100644
---- a/gcc/jit/libgccjit.c
-+++ b/gcc/jit/libgccjit.c
-@@ -18,13 +18,13 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
- #include "timevar.h"
- #include "typed-splay-tree.h"
- #include "cppbuiltin.h"
--#include <pthread.h>
- 
- #include "libgccjit.h"
- #include "jit-recording.h"
diff --git a/srcpkgs/libgccjit/template b/srcpkgs/libgccjit/template
index 0b37c3ee9f8b..fde1affd54b7 100644
--- a/srcpkgs/libgccjit/template
+++ b/srcpkgs/libgccjit/template
@@ -3,18 +3,12 @@
 # which use the version number.
 
 pkgname=libgccjit
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
+version=12.2.0
 revision=1
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
-_majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 create_wrksrc=yes
 short_desc="Just-In-Time Compilation library for GCC"
 maintainer="Lane Biocini <lane@mailbox.org>"
@@ -22,16 +16,16 @@ homepage="https://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 nopie=yes
 lib32disabled=yes
 makedepends="zlib-devel"

From def43754d212b4b1a9b9d7071ad98e906dad1c47 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 10/35] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove -no-pie from build. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..5d40f0cdd8a6 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -53,6 +53,7 @@ _void_cross_build_binutils() {
 		--sbindir=/usr/bin \
 		--libdir=/usr/lib \
 		--libexecdir=/usr/lib \
+		--sysconfdir=/etc \
 		--target=${tgt} \
 		--with-sysroot=/usr/${tgt} \
 		--disable-nls \
@@ -60,7 +61,9 @@ _void_cross_build_binutils() {
 		--disable-multilib \
 		--disable-werror \
 		--disable-gold \
+		--disable-gprofng \
 		--enable-relro \
+		--enable-new-dtags \
 		--enable-plugins \
 		--enable-64-bit-bfd \
 		--enable-deterministic-archives \
@@ -132,6 +135,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -460,6 +464,14 @@ do_build() {
 	local binutils_ver linux_ver gcc_ver libc_ver libucontext_ver
 	local tgt=${sourcepkg/cross-}
 
+	export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}"
+	export CXXFLAGS="${CXXFLAGS/-D_FORTIFY_SOURCE=2/}"
+
+	# Disable explicit -fno-PIE, gcc/binutils/libc will figure this out itself.
+	export CFLAGS="${CFLAGS//-fno-PIE/}"
+	export CXXFLAGS="${CXXFLAGS//-fno-PIE/}"
+	export LDFLAGS="${LDFLAGS//-no-pie/}"
+
 	_void_cross_test_ver binutils
 	_void_cross_test_ver linux
 	_void_cross_test_ver gcc
@@ -625,6 +637,9 @@ do_install() {
 	# then remove it because it conflicts with libquadmath package
 	rm -rf ${DESTDIR}/${sysroot}/usr/lib/libquadmath.*
 
+	# Remove libdep linker plugin because it conflicts with system binutils
+	rm -f ${DESTDIR}/usr/lib/bfd-plugins/libdep*
+
 	# Remove leftover symlinks
 	rm -f ${DESTDIR}/usr/lib${XBPS_TARGET_WORDSIZE}
 	rm -f ${DESTDIR}/lib*

From 3c906dba68a5b8038f9f237397127754de714572 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 11/35] qemu: remove broken patch

The necessary patch has been imported into musl so no need
to cast the sigevent struct to a more glibc-like one.
---
 .../musl-fix-sigevent-and-sigval_t.patch      | 27 -------------------
 1 file changed, 27 deletions(-)
 delete mode 100644 srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch

diff --git a/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch b/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch
deleted file mode 100644
index 4b4f1117c15f..000000000000
--- a/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-Note: Remove this patch with musl 1.2.2
-
---- a/linux-user/syscall.c
-+++ b/linux-user/syscall.c
-@@ -5020,10 +5020,21 @@
- #ifndef HAVE_SIGEV_NOTIFY_THREAD_ID
- #define sigev_notify_thread_id _sigev_un._tid
- #endif
- 
--static inline abi_long target_to_host_sigevent(struct sigevent *host_sevp,
-+struct host_sigevent {
-+    union sigval sigev_value;
-+    int sigev_signo;
-+    int sigev_notify;
-+    union {
-+       char _pad[64 - sizeof(int) * 2 - sizeof(union sigval)];
-+       int _tid;
-+    } _sigev_un;
-+};
-+
-+static inline abi_long target_to_host_sigevent(struct sigevent *sevp,
-                                                abi_ulong target_addr)
- {
-+    struct host_sigevent *host_sevp = (struct host_sigevent *) sevp;
-     struct target_sigevent *target_sevp;
- 
-     if (!lock_user_struct(VERIFY_READ, target_sevp, target_addr, 1)) {

From f16c8961b96614d0652c9cf1bc932209fac6413a Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 12/35] cross-aarch64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..9e6fb75c198d 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Leah Neukirchen <leah@vuxu.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 216772d378bdd4b51a67853526c0753d7f62caa5 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 13/35] cross-aarch64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..ba14c96bccea 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 4244e52dfeaa69383873c35cafa4fecff497ca93 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 14/35] cross-arm-linux-gnueabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..5c774e16f430 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 9db5fa222f2434f9f7d5cc19113d4ddc9b39daca Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 15/35] cross-arm-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..d6298ab639a4 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From c970514e47f0df516618cb2fd4cde92a488eba4a Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 16/35] cross-arm-linux-musleabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..24df78e8fd8e 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 18e6681308cd1f8eeef2e73225670510a4d0fdea Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 17/35] cross-arm-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..8093700f909c 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 20798ec3ce0ff516d1f85a002e1e4ed818153609 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 18/35] cross-armv7l-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..92665326428b 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From a2666fddedb54ff07c737f4294cd6dc8077ee07d Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 19/35] cross-armv7l-linux-musleabihf: update to gcc 12.2.0.

---
 .../cross-armv7l-linux-musleabihf/template    | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..e5af2c9ccbf2 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From fb419603b435f7d0ffd759c9d7625ccc87414674 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 20/35] cross-i686-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-i686-linux-musl/template b/srcpkgs/cross-i686-linux-musl/template
index 8be16a230d8d..d624bb7a3254 100644
--- a/srcpkgs/cross-i686-linux-musl/template
+++ b/srcpkgs/cross-i686-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-i686-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-i686-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From b6a163ee9641b99579cfce619d7fc651e77d57bc Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 21/35] cross-i686-pc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..6a9e54db807a 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,14 +1,15 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -16,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From ca2304b7141af01b94299fc4132dd55499b3012a Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 22/35] cross-mips-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-musl/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..67a5c413396c 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From efc3ac702bbd127f17c9b62db327bfedda879809 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 23/35] cross-mips-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..bdf8600ce95b 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="hipperson0 <hipperson0@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From d6e86d2b9614cba24ef9a488c32acc32f8d36e1e Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 24/35] cross-mipsel-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..de49387d517b 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From afefdf8f76852c379676b075b55bff74d5c98542 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 25/35] cross-mipsel-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..b27ce6475a38 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From d10bb5186439e788a61eb6a3251c0750bc4923ae Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 26/35] cross-powerpc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..79579e093b12 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From d5ef7884a9c2ec6086298333e12e8834aeaa882a Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 27/35] cross-powerpc-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..9bb6acd359b6 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 0f73d97624972113acef3d9020d6563dfbe0ed51 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 28/35] cross-powerpc64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..2d153d00add6 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,16 +1,17 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
  --enable-targets=powerpc-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -18,12 +19,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From d623d95042e58c41cb4dd83db83320cecb2e63a4 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 29/35] cross-powerpc64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 016f18776a6d..e0848fe0bff7 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,30 +1,31 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 0fd78229d8d7ecf6158e621596f9edde03cce71b Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 30/35] cross-powerpc64le-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 463d7e92d20d..8d8e010e15c0 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,16 +1,17 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
  --enable-targets=powerpcle-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -18,12 +19,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 12b02b160a62a070eff614d5f03688659de0ae58 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 31/35] cross-powerpc64le-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index c17a3cccfe29..0915e524545f 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,30 +1,31 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From b3e92cd7c053c87a26007eef0117912be5e4532f Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 32/35] cross-powerpcle-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 9aede3c465ce..687be8a44c6c 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 
@@ -35,6 +36,8 @@ if [ "$XBPS_TARGET_MACHINE" = "ppcle" ]; then
 	broken="Can't build crosstoolchain to itself"
 fi
 
+broken="glibc uses big-endian specific instructions on 32-bit powerpc"
+
 cross-powerpcle-linux-gnu-libc_package() {
 	short_desc+=" - glibc files"
 	nostrip=yes

From 616a5d4ac8bb33840810365d4b615bec265a0940 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 33/35] cross-powerpcle-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index 045cfda987fe..bb984b9c42eb 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From f17df25a3566ccb965472c002c3b238d004bbbab Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:30 -0800
Subject: [PATCH 34/35] cross-x86_64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 8918f3c22a1c..930aaf2a508b 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,14 +1,15 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -16,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 2432119d9d3e3d2a3b0c8ed470faa56d6b0b68bc Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:30 -0800
Subject: [PATCH 35/35] cross-x86_64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..ac5b1c46ab82 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (225 preceding siblings ...)
  2022-11-17  0:48 ` [PR PATCH] [Updated] " oreo639
@ 2022-11-17  1:54 ` oreo639
  2022-11-18  4:02 ` oreo639
                   ` (37 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-11-17  1:54 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5448 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.2.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.2.0

There is a list of failing builds here: https://github.com/void-linux/void-packages/issues/39809

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [x] llvm https://github.com/void-linux/void-packages/pull/38694
- [x] m4 https://github.com/void-linux/void-packages/pull/33730
- [x] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [x] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [x] libvirt https://github.com/void-linux/void-packages/pull/38842
- [x] syslinux https://github.com/void-linux/void-packages/pull/38876
- [x] efivar https://github.com/void-linux/void-packages/pull/38874
- [x] gpgme https://github.com/void-linux/void-packages/pull/38825

Known packages that needed to be fixed/updated for gcc12:
- [x] openssh https://github.com/void-linux/void-packages/pull/38849
- [x] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [x] doxygen https://github.com/void-linux/void-packages/pull/38846
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] libproxy https://github.com/void-linux/void-packages/pull/38818
- [x] exempi https://github.com/void-linux/void-packages/pull/38820
- [x] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [x] libunique1 https://github.com/void-linux/void-packages/pull/38848 or https://github.com/void-linux/void-packages/pull/38873
- [x] libwpd https://github.com/void-linux/void-packages/pull/38878
- [x] cglm https://github.com/void-linux/void-packages/pull/39748
- [x] coreboot-utils https://github.com/void-linux/void-packages/pull/39749
- [x] apl https://github.com/void-linux/void-packages/pull/39750
- [x] igt-gpu-tools https://github.com/void-linux/void-packages/pull/39780

Needs to be fixed/updated for binutils:
- [x] grub https://github.com/void-linux/void-packages/pull/38875
- [x] linux-tools https://github.com/void-linux/void-packages/pull/38877
- [x] kcov https://github.com/void-linux/void-packages/pull/39291

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [x] kde
- [x] lxde
- [x] lxqt

You can test the ISOs here:
https://drive.google.com/drive/folders/1ix92CYSLUP-KWjLxltdgG4e8Nu2JCY5n?usp=sharing

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 131897 bytes --]

From 226421d934978cd86da1c39b21bd4d29d91620e5 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 01/35] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../fix-libcollector-without-java.patch       | 53 +++++++++++++++
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 25 ++++---
 4 files changed, 87 insertions(+), 117 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
 create mode 100644 srcpkgs/binutils/patches/fix-libcollector-without-java.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/fix-libcollector-without-java.patch b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
new file mode 100644
index 000000000000..54384875f358
--- /dev/null
+++ b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
@@ -0,0 +1,53 @@
+From 49ddd814ac1071af7c4f45d5f8398b91862f2c7f Mon Sep 17 00:00:00 2001
+From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
+Date: Wed, 17 Aug 2022 19:55:23 -0700
+Subject: [PATCH] gprofng: fix bug 29479 Collection fails when built without
+ java support
+
+gprofng/ChangeLog
+2022-08-17  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>
+
+	PR gprofng/29479
+	* libcollector/collector.c: Add #if defined(GPROFNG_JAVA_PROFILING) for
+	java specific code.
+	* libcollector/unwind.c: Likewise.
+---
+ gprofng/libcollector/collector.c | 2 ++
+ gprofng/libcollector/unwind.c    | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/gprofng/libcollector/collector.c b/gprofng/libcollector/collector.c
+index 93c9d3330de5..ceff2c1caccb 100644
+--- a/gprofng/libcollector/collector.c
++++ b/gprofng/libcollector/collector.c
+@@ -913,8 +913,10 @@ __collector_open_experiment (const char *exp, const char *params, sp_origin_t or
+   __collector_ext_unwind_key_init (1, NULL);
+ 
+   /* start java attach if suitable */
++#if defined(GPROFNG_JAVA_PROFILING)
+   if (exp_origin == SP_ORIGIN_DBX_ATTACH)
+     __collector_jprofile_start_attach ();
++#endif
+   start_sec_time = CALL_UTIL (time)(NULL);
+   __collector_start_time = collector_interface.getHiResTime ();
+   TprintfT (DBG_LT0, "\t__collector_open_experiment; resetting start_time\n");
+diff --git a/gprofng/libcollector/unwind.c b/gprofng/libcollector/unwind.c
+index 119243788020..f8e11823c81e 100644
+--- a/gprofng/libcollector/unwind.c
++++ b/gprofng/libcollector/unwind.c
+@@ -557,6 +557,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+   int size = max_frame_size;
+ 
+ #define MIN(a,b) ((a)<(b)?(a):(b))
++#if defined(GPROFNG_JAVA_PROFILING)
+   /* get Java info */
+   if (__collector_java_mode && __collector_java_asyncgetcalltrace_loaded && context && !pseudo_context)
+     {
+@@ -569,6 +570,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+ 	  size -= sz;
+ 	}
+     }
++#endif
+ 
+   /* get native stack */
+   if (context)
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..c355a5fc8016 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkgconf"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -35,15 +36,21 @@ do_configure() {
 	local conf
 
 	if [ "$CHROOT_READY" ]; then
-		conf+=" --with-debuginfod"
+		conf+=" --with-debuginfod --enable-shared"
 	else
-		conf+=" --without-debuginfod --disable-install-libbfd"
+		conf+=" --without-debuginfod --disable-shared --disable-install-libbfd"
 	fi
 	if [ "$CROSS_BUILD" ]; then
 		# we don't want --with-sysroot=${XBPS_CROSS_BASE} like gnu-configure
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	# gprofng currently only supports x86 and aarch64 glibc.
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64|i386|aarch64) conf+=" --enable-gprofng" ;;
+		*) conf+=" --disable-gprofng" ;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"
@@ -76,13 +83,14 @@ do_configure() {
 		--libdir=/usr/lib \
 		--mandir=/usr/share/man \
 		--infodir=/usr/share/info \
+		--sysconfdir=/etc \
 		--disable-werror \
-		--disable-shared \
 		--disable-nls \
 		--enable-threads \
 		--enable-plugins \
 		--enable-relro \
 		--enable-gold \
+		--enable-new-dtags \
 		--enable-deterministic-archives \
 		--enable-64-bit-bfd \
 		--enable-ld=default \
@@ -142,7 +150,8 @@ binutils-devel_package() {
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/*.a"
-		vmove "usr/lib/*.so"
+		vmove "usr/lib/libbfd.so"
+		vmove "usr/lib/libopcodes.so"
 	}
 }
 

From 23844e82b655ca5c95c9649f5cf510107e90a09e Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 02/35] gdb: resolve conflict with binutils 2.39

---
 srcpkgs/gdb/template | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/gdb/template b/srcpkgs/gdb/template
index 9c5f17ffc519..b666348fea19 100644
--- a/srcpkgs/gdb/template
+++ b/srcpkgs/gdb/template
@@ -1,7 +1,7 @@
 # Template file for 'gdb'
 pkgname=gdb
 version=12.1
-revision=2
+revision=3
 build_style=gnu-configure
 pycompile_dirs="/usr/share/gdb/python"
 configure_args="--disable-werror --disable-nls --with-system-readline
@@ -48,7 +48,8 @@ vopt_conflict debuginfod static
 
 post_install() {
 	# resolve conflicts with binutils
-	rm -r ${DESTDIR}/usr/{include,lib,share/info/bfd.info*}
+	rm -rf ${DESTDIR}/usr/{include,lib}
+	rm -rf ${DESTDIR}/usr/share/info/{bfd,ctf-spec}.info*
 }
 
 gdb-common_package() {

From 26eed6ed4c3ac9b7c47e7f1e971ab338b8f93382 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 03/35] gcc: update to 12.2.0.

---
 common/shlibs                                 | 10 +--
 srcpkgs/gcc/files/gccgo-musl.patch            | 71 +++------------
 srcpkgs/gcc/files/libgnarl-musl.patch         | 18 ++--
 srcpkgs/gcc/files/libssp-musl.patch           | 10 +--
 srcpkgs/gcc/patches/libffi_gnulinux.patch     | 11 ---
 .../gcc/patches/libgcc-ibm128-no-tag.patch    | 10 ++-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |  2 +-
 srcpkgs/gcc/template                          | 87 +++++++++----------
 8 files changed, 80 insertions(+), 139 deletions(-)
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index 481250d5c924..ffeae1b92d28 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.2.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.36 perl-5.36.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -857,8 +857,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.2.0_1
+libgnat-12.so libada-12.2.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1710,8 +1710,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.2.0_1
+libasan.so.8 libsanitizer-12.2.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..12ec68dd8aa3 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,14 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ b/libgo/go/runtime/os_linux.go
+@@ -365,7 +365,7 @@ func setThreadCPUProfiler(hz int32) {
+ 	var sevp _sigevent
+ 	sevp.sigev_notify = _SIGEV_THREAD_ID
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.__sev_fields))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index ab3643de4f98..a20af7c0ef2e 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,14 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
+version=12.2.0
+revision=1
+_minorver="${version%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 create_wrksrc=yes
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +18,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -52,8 +48,11 @@ if [ "$CHROOT_READY" ]; then
 	hostmakedepends="tar texinfo perl flex"
 else
 	_have_gccgo=no
+	# libzstd fails to link in bootstrap with glibc 2.36
+	# when zlib has been compiled with glibc 2.32.
+	LDFLAGS="-lzstd -pthread"
 fi
-makedepends="zlib-devel"
+makedepends="zlib-devel libzstd-devel"
 depends="binutils libgcc-devel-${version}_${revision}
  libstdc++-devel-${version}_${revision} libssp-devel-${version}_${revision}"
 checkdepends="dejagnu"
@@ -70,13 +69,13 @@ if [ "$build_option_gnatboot" ]; then
 	case "$XBPS_TARGET_MACHINE" in
 	x86_64)
 		_gnat_tarball="gnat-gpl-2017-x86_64-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/591c6d80c7a447af2deed1d7>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/9682e2e1f2f232ce03fe21d77b14c37a0de5649b?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" b942bcac20dea39748b39f8b624d9619f60a8dee2e8195dbe3829c835b0956e6"
 		build_options_default="gnatboot"
 		;;
 	i686)
 		_gnat_tarball="gnat-gpl-2014-x86-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/564b3e9dc8e196b040fbe248>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/c5e9e6fdff5cb77ed90cf8c62536653e27c0bed6?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" 3b693510f5d22a240abb3034934c1adbd80ccd6e4f61a4f491cc408fdfd9c042"
 		build_options_default="gnatboot"
 		;;
@@ -155,8 +154,8 @@ if [ "$CROSS_BUILD" ]; then
 fi
 
 post_extract() {
-	mv gcc-${version/pre/_pre}/* gcc-${version/pre/_pre}/.??* .
-	rmdir gcc-${version/pre/_pre}
+	mv gcc-${version}/* gcc-${version}/.??* .
+	rmdir gcc-${version}
 	mv gmp-${_gmp_version} gmp
 	mv mpfr-${_mpfr_version} mpfr
 	mv mpc-${_mpc_version} mpc
@@ -186,9 +185,9 @@ pre_configure() {
 	sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
 
 	if [ "$XBPS_TARGET_LIBC" = musl ]; then
-		patch -p1 -i ${FILESDIR}/libgnarl-musl.patch
-		patch -p1 -i ${FILESDIR}/libssp-musl.patch
-		patch -p1 -i ${FILESDIR}/gccgo-musl.patch
+		for p in ${FILESDIR}/*-musl.patch; do
+			patch -p1 -i $p
+		done
 	fi
 }
 do_configure() {
@@ -343,16 +342,16 @@ do_install() {
 
 	# Make version a symlink of major version to make all versions
 	# from the same series work automagically.
-	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver} \
+	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${version} \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver}
 	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver} \
-		${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}
+		${DESTDIR}/usr/lib/gcc/${_triplet}/${version}
 
 	# Ditto for c++ headers.
-	mv ${DESTDIR}/usr/include/c++/${_patchver} \
+	mv ${DESTDIR}/usr/include/c++/${version} \
 		${DESTDIR}/usr/include/c++/${_minorver}
 	ln -sfr ${DESTDIR}/usr/include/c++/${_minorver} \
-		${DESTDIR}/usr/include/c++/${_patchver}
+		${DESTDIR}/usr/include/c++/${version}
 
 	# cc symlink
 	ln -sfr ${DESTDIR}/usr/bin/gcc ${DESTDIR}/usr/bin/cc
@@ -361,7 +360,7 @@ do_install() {
 
 	# lto plugin symlink
 	vmkdir usr/lib/bfd-plugins
-	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}/liblto_plugin.so \
+	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${version}/liblto_plugin.so \
 		${DESTDIR}/usr/lib/bfd-plugins
 
 	# Remove "fixed" header
@@ -372,13 +371,9 @@ do_install() {
 	rm -f ${DESTDIR}/usr/lib/libffi*
 	rm -f ${DESTDIR}/usr/share/man/man3/ffi*
 
-	# Remove all python scripts in libdir.
-	rm -f ${DESTDIR}/usr/lib/*.py
-
-	# Remove more python stuff.
-	if [ -d ${DESTDIR}/usr/share/gcc-${_patchver}/python ]; then
-		rm -rf ${DESTDIR}/usr/share/gcc-${_patchver}/python
-	fi
+	# Move libstdc++ gdb helpers to location where gdb can autoload them
+	mkdir -p ${DESTDIR}/usr/share/gdb/auto-load/usr/lib
+	mv ${DESTDIR}/usr/lib/*.py ${DESTDIR}/usr/share/gdb/auto-load/usr/lib
 
 	# Install c89 and c99 wrappers and its manpages, from NetBSD.
 	for f in c89 c99; do
@@ -397,7 +392,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}
@@ -450,7 +445,7 @@ gcc-fortran_package() {
 		if [ "$CROSS_BUILD" ]; then
 			# A number of OMP modules are not built when cross
 			# compiling gcc. Copy them from the cross compiler.
-			local src="/usr/lib/gcc/${_triplet}/${_patchver}/finclude"
+			local src="/usr/lib/gcc/${_triplet}/${version}/finclude"
 			local dst="usr/lib/gcc/${_triplet}/${_minorver}/finclude"
 			for f in omp_lib.f90 omp_lib.h omp_lib.mod omp_lib_kinds.mod \
 				openacc.f90 openacc.mod openacc_kinds.mod openacc_lib.h; do
@@ -517,7 +512,7 @@ libgfortran_package() {
 	short_desc+=" - Fortran library"
 	pkg_install() {
 		vmove "usr/lib/libgfortran.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -538,7 +533,7 @@ libgo_package() {
 	nostrip=yes
 	pkg_install() {
 		vmove "usr/lib/libgo.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -554,7 +549,7 @@ libobjc_package() {
 	short_desc+=" - Objective-C library"
 	pkg_install() {
 		vmove "usr/lib/libobjc.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -573,7 +568,7 @@ libquadmath_package() {
 	short_desc+=" - quadmath library"
 	pkg_install() {
 		vmove "usr/lib/libquadmath.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -615,7 +610,7 @@ libgcc_package() {
 	noverifyrdeps=yes
 	pkg_install() {
 		vmove "usr/lib/libgcc_s.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -646,7 +641,7 @@ libgomp_package() {
 	short_desc+=" - OpenMP v4.0 library"
 	pkg_install() {
 		vmove "usr/lib/libgomp*.so.*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -701,7 +696,7 @@ libssp_package() {
 	short_desc+=" - SSP (StackSmashingProtection) library"
 	pkg_install() {
 		vmove "usr/lib/libssp.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -718,7 +713,9 @@ libstdc++-devel_package() {
 libstdc++_package() {
 	short_desc+=" - Standard C++ Library"
 	pkg_install() {
+		vmove usr/share/gdb
+		vmove usr/share/gcc-${version}/python
 		vmove "usr/lib/libstdc++.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }

From 317283826d4338ac33ac9b8057f54a1134d1d8bf Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 04/35] libtool: update to 2.4.7.

---
 .../patches/0002-rename-with-sysroot.patch    | 34 +++++++++----------
 .../libtool/patches/fix-tests-grep-3.8.patch  | 18 ++++++++++
 srcpkgs/libtool/template                      | 13 ++++---
 3 files changed, 44 insertions(+), 21 deletions(-)
 create mode 100644 srcpkgs/libtool/patches/fix-tests-grep-3.8.patch

diff --git a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
index 960873c04e24..152aace96c41 100644
--- a/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
+++ b/srcpkgs/libtool/patches/0002-rename-with-sysroot.patch
@@ -13,16 +13,16 @@ Jürgen Buchmüller <pullmoll@t-online.de>
 
 --- a/configure	2015-02-15 17:14:34.000000000 +0100
 +++ b/configure	2015-10-20 13:25:12.684906339 +0200
-@@ -824,7 +824,7 @@
+@@ -832,7 +832,7 @@
  enable_fast_install
  with_aix_soname
  with_gnu_ld
 -with_sysroot
 +with_libtool_sysroot
  enable_libtool_lock
+ enable_cross_guesses
  '
-       ac_precious_vars='build_alias
-@@ -1487,7 +1487,8 @@
+@@ -1509,7 +1509,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -32,7 +32,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -7389,29 +7390,29 @@
+@@ -7610,29 +7611,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -57,8 +57,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -72,7 +72,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  esac
 --- a/libltdl/configure	2015-02-15 17:15:15.000000000 +0100
 +++ b/libltdl/configure	2015-10-20 13:26:45.747914683 +0200
-@@ -775,7 +775,7 @@
+@@ -777,7 +777,7 @@
  with_aix_soname
  enable_dependency_tracking
  with_gnu_ld
@@ -81,7 +81,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  enable_libtool_lock
  enable_ltdl_install
  '
-@@ -1429,7 +1429,8 @@
+@@ -1442,7 +1442,8 @@
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
@@ -91,7 +91,7 @@ Jürgen Buchmüller <pullmoll@t-online.de>
                            compiler's sysroot if not specified).
  
  Some influential environment variables:
-@@ -6275,29 +6276,29 @@
+@@ -6397,29 +6398,29 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
  $as_echo_n "checking for sysroot... " >&6; }
  
@@ -116,8 +116,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
@@ -243,14 +243,14 @@ Jürgen Buchmüller <pullmoll@t-online.de>
  ]])
 --- a/m4/libtool.m4	2015-01-20 17:15:19.000000000 +0100
 +++ b/m4/libtool.m4	2015-10-20 15:40:04.020631813 +0200
-@@ -1245,29 +1245,29 @@
- # _LT_WITH_SYSROOT
+@@ -1243,29 +1243,29 @@
  # ----------------
  AC_DEFUN([_LT_WITH_SYSROOT],
--[AC_MSG_CHECKING([for sysroot])
+ [m4_require([_LT_DECL_SED])dnl
+-AC_MSG_CHECKING([for sysroot])
 -AC_ARG_WITH([sysroot],
 -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-+[AC_MSG_CHECKING([for libtool-sysroot])
++AC_MSG_CHECKING([for libtool-sysroot])
 +AC_ARG_WITH([libtool-sysroot],
 +[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
    [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -269,8 +269,8 @@ Jürgen Buchmüller <pullmoll@t-online.de>
     fi
     ;; #(
   /*)
--   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+-   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"`
     ;; #(
   no|'')
     ;; #(
diff --git a/srcpkgs/libtool/patches/fix-tests-grep-3.8.patch b/srcpkgs/libtool/patches/fix-tests-grep-3.8.patch
new file mode 100644
index 000000000000..2003a19a3eef
--- /dev/null
+++ b/srcpkgs/libtool/patches/fix-tests-grep-3.8.patch
@@ -0,0 +1,18 @@
+--- a/tests/link-order.at
++++ b/tests/link-order.at
+@@ -99,12 +99,12 @@ aix* | interix*) ;;  # These systems hav
+   case $hardcode_direct$hardcode_direct_absolute in
+   yesno)
+     AT_CHECK([if $EGREP relinking stderr; then
+-         $EGREP " .*\/new\/lib/libb$shared_ext .*\/old\/lib/libcee$shared_ext" stdout
++         $EGREP " .*/new/lib/libb$shared_ext .*/old/lib/libcee$shared_ext" stdout
+        else :; fi], [0], [ignore], [], [echo "wrong link order"])
+     ;;
+   *)
+     AT_CHECK([if $EGREP relinking stderr; then
+-         $EGREP " -L.*\/new\/lib -lb -L.*\/old\/lib -lcee" stdout
++         $EGREP " -L.*/new/lib -lb -L.*/old/lib -lcee" stdout
+        else :; fi], [0], [ignore], [], [echo "wrong link order"])
+     ;;
+   esac
+
diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index b9972df70341..d2a15ff3e414 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
-version=2.4.6
-revision=6
+version=2.4.7
+revision=1
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"
@@ -10,7 +10,12 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="http://www.gnu.org/software/libtool"
 distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
-checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
+checksum=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	# Musl always searches LD_LIBRARY_PATH before RPATH and RUNPATH
+	configure_args="lt_cv_shlibpath_overrides_runpath=yes"
+fi
 
 pre_configure() {
 	touch aclocal.m4 libltdl/aclocal.m4 Makefile.am libltdl/Makefile.am Makefile.in libltdl/Makefile.in
@@ -45,9 +50,9 @@ post_install() {
 		_host_os=$(grep "^host_os=" ${PKGDESTDIR}/usr/bin/libtool | sed 's/host_os=//')
 		vsed -i \
 		 -e "s,^host_alias=.*,host_alias=${_canonical_host}," \
-		 -e "s,^host=.*,host=${_canonical_host}," \
 		 -e "s,^build_alias=.*,build_alias=${_canonical_host}," \
 		 -e "s,^build=.*,build=${_canonical_host}," \
+		 -e "s,^build_os=.*,build_os=," \
 		 -e "s,^build_os=.*,build_os=${_host_os}," \
 		 ${PKGDESTDIR}/usr/bin/libtool
 	fi

From a03c4591ca9bd581a3a47037db14412c52521d96 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 05/35] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 7e01bbb851fd..d9618e3806ba 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 build_wrksrc=libiberty
 build_style=gnu-configure
@@ -10,7 +10,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From 064d74019ee997f110fc1322a192688678fa3b04 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 06/35] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 ...e-hash-style-both-for-building-glibc.patch |  51 ++++
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 4 files changed, 106 insertions(+), 353 deletions(-)
 create mode 100644 srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index ffeae1b92d28..5b935a507580 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch b/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
new file mode 100644
index 000000000000..9c5553e92609
--- /dev/null
+++ b/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
@@ -0,0 +1,51 @@
+Temporary workaround for EAC bug.
+
+See: https://sourceware.org/bugzilla/show_bug.cgi?id=29456
+
+From 8e90e2cc5e57d7ca3a40602d278e9642a8b66716 Mon Sep 17 00:00:00 2001
+From: oreo639 <oreo6391@gmail.com>
+Date: Tue, 13 Sep 2022 14:30:35 -0700
+Subject: [PATCH] Revert "Do not use --hash-style=both for building glibc
+ shared objects"
+
+This reverts commit e47de5cb2d4dbecb58f569ed241e8e95c568f03c.
+---
+ Makeconfig     |  9 +++++++++
+ Makerules      |  7 +++++++
+ 5 files changed, 61 insertions(+)
+
+diff --git a/Makeconfig b/Makeconfig
+index ba70321af1..e2131d4389 100644
+--- a/Makeconfig
++++ b/Makeconfig
+@@ -371,6 +371,13 @@ dt-relr-ldflag =
+ no-dt-relr-ldflag =
+ endif
+ 
++# For the time being we unconditionally use 'both'.  At some time we
++# should declare statically linked code as 'out of luck' and compile
++# with --hash-style=gnu only.
++hashstyle-LDFLAGS = -Wl,--hash-style=both
++LDFLAGS.so += $(hashstyle-LDFLAGS)
++LDFLAGS-rtld += $(hashstyle-LDFLAGS)
++
+ ifeq (no,$(build-pie-default))
+ pie-default = $(no-pie-ccflag)
+ else # build-pie-default
+diff --git a/Makerules b/Makerules
+index d1e139d03c..44134e37ce 100644
+--- a/Makerules
++++ b/Makerules
+@@ -558,6 +558,9 @@ $(common-objpfx)shlib.lds: $(common-objpfx)config.make $(..)Makerules
+ 		  -Wl,--verbose 2>/dev/null | \
+ 	  sed > $@T \
+ 	      -e '/^=========/,/^=========/!d;/^=========/d' \
++		   -e 's/^.*\.gnu\.hash[ 	]*:.*$$/  .note.ABI-tag : { *(.note.ABI-tag) } &/' \
++		   -e '/^[ 	]*\.hash[ 	]*:.*$$/{h;d;}' \
++		   -e '/DATA_SEGMENT_ALIGN/{H;g}' \
+ 	      -e 's/^.*\*(\.dynbss).*$$/& \
+ 		 PROVIDE(__start___libc_freeres_ptrs = .); \
+ 		 *(__libc_freeres_ptrs) \
+-- 
+2.37.3
+
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From 98ff70a17124a2c618dd827a011760ab0b2e8450 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 07/35] musl: add support for SIGEV_THREAD_ID timers

https://git.musl-libc.org/cgit/musl/commit/?id=7c71792e87691451f2a6b76348e83ad1889f1dcb
---
 ...d-support-for-SIGEV_THREAD_ID-timers.patch | 74 +++++++++++++++++++
 srcpkgs/musl/template                         |  2 +-
 2 files changed, 75 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch

diff --git a/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
new file mode 100644
index 000000000000..e20dff5ba0d4
--- /dev/null
+++ b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
@@ -0,0 +1,74 @@
+From 7c71792e87691451f2a6b76348e83ad1889f1dcb Mon Sep 17 00:00:00 2001
+From: James Y Knight <jyknight@google.com>
+Date: Sun, 30 Jun 2019 21:55:20 -0400
+Subject: [PATCH] add support for SIGEV_THREAD_ID timers
+
+This is like SIGEV_SIGNAL, but targeted to a particular thread's
+tid, rather than the process.
+---
+ include/signal.h        | 16 +++++++++++++---
+ src/time/timer_create.c |  8 ++++++--
+ 2 files changed, 19 insertions(+), 5 deletions(-)
+
+diff --git a/include/signal.h b/include/signal.h
+index fbdf667b2..9ed929e4f 100644
+--- a/include/signal.h
++++ b/include/signal.h
+@@ -180,14 +180,24 @@ struct sigevent {
+ 	union sigval sigev_value;
+ 	int sigev_signo;
+ 	int sigev_notify;
+-	void (*sigev_notify_function)(union sigval);
+-	pthread_attr_t *sigev_notify_attributes;
+-	char __pad[56-3*sizeof(long)];
++	union {
++		char __pad[64 - 2*sizeof(int) - sizeof(union sigval)];
++		pid_t sigev_notify_thread_id;
++		struct {
++			void (*sigev_notify_function)(union sigval);
++			pthread_attr_t *sigev_notify_attributes;
++		} __sev_thread;
++	} __sev_fields;
+ };
+ 
++#define sigev_notify_thread_id __sev_fields.sigev_notify_thread_id
++#define sigev_notify_function __sev_fields.__sev_thread.sigev_notify_function
++#define sigev_notify_attributes __sev_fields.__sev_thread.sigev_notify_attributes
++
+ #define SIGEV_SIGNAL 0
+ #define SIGEV_NONE 1
+ #define SIGEV_THREAD 2
++#define SIGEV_THREAD_ID 4
+ 
+ int __libc_current_sigrtmin(void);
+ int __libc_current_sigrtmax(void);
+diff --git a/src/time/timer_create.c b/src/time/timer_create.c
+index 5ddfda278..4bef23905 100644
+--- a/src/time/timer_create.c
++++ b/src/time/timer_create.c
+@@ -71,11 +71,15 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 	switch (evp ? evp->sigev_notify : SIGEV_SIGNAL) {
+ 	case SIGEV_NONE:
+ 	case SIGEV_SIGNAL:
++	case SIGEV_THREAD_ID:
+ 		if (evp) {
+ 			ksev.sigev_value = evp->sigev_value;
+ 			ksev.sigev_signo = evp->sigev_signo;
+ 			ksev.sigev_notify = evp->sigev_notify;
+-			ksev.sigev_tid = 0;
++			if (evp->sigev_notify == SIGEV_THREAD_ID)
++				ksev.sigev_tid = evp->sigev_notify_thread_id;
++			else
++				ksev.sigev_tid = 0;
+ 			ksevp = &ksev;
+ 		}
+ 		if (syscall(SYS_timer_create, clk, ksevp, &timerid) < 0)
+@@ -107,7 +111,7 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 
+ 		ksev.sigev_value.sival_ptr = 0;
+ 		ksev.sigev_signo = SIGTIMER;
+-		ksev.sigev_notify = 4; /* SIGEV_THREAD_ID */
++		ksev.sigev_notify = SIGEV_THREAD_ID;
+ 		ksev.sigev_tid = td->tid;
+ 		if (syscall(SYS_timer_create, clk, &ksev, &timerid) < 0)
+ 			timerid = -1;
diff --git a/srcpkgs/musl/template b/srcpkgs/musl/template
index 34e6ed4fba6e..afb33cd868b5 100644
--- a/srcpkgs/musl/template
+++ b/srcpkgs/musl/template
@@ -2,7 +2,7 @@
 pkgname=musl
 reverts="1.2.0_1"
 version=1.1.24
-revision=11
+revision=12
 archs="*-musl"
 bootstrap=yes
 build_style=gnu-configure

From 85b61a1b18f7d4a0248adad26945fb4487a3e6d7 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 08/35] gcc-multilib: update to 12.2.0.

---
 srcpkgs/gcc-multilib/template | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index f28eb237c287..ba9bafcadfd6 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,15 +3,15 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _majorver="${version%.*}"
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel
@@ -70,7 +70,7 @@ do_build() {
 	make ${makejobs}
 }
 do_install() {
-	local _pc_triplet=x86_64-pc-linux-gnu _version=${version%pre1}
+	local _pc_triplet=x86_64-pc-linux-gnu
 	# Install to a tempdir and then only copy relevant files.
 	cd ${wrksrc}
 	make DESTDIR=${wrksrc}/${pkgname}-build install
@@ -80,9 +80,9 @@ do_install() {
 	vmkdir usr/include/c++/${_majorver}/${_triplet}
 	vmkdir usr/lib/gcc/${_triplet}/${_majorver}
 
-	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${_version}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${version}/32 \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_majorver}/
-	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${_version}/${_pc_triplet}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${version}/${_pc_triplet}/32 \
 		${DESTDIR}/usr/include/c++/${_majorver}/${_triplet}
 
 	vinstall ${wrksrc}/host-${_pc_triplet}/gcc/specs 644 usr/lib/gcc/${_triplet}/${_majorver}

From 3280db0e75c9dede8acdc3808890963d6e8a9053 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 09/35] libgccjit: update to 12.2.0.

---
 srcpkgs/libgccjit/files/libgccjit-musl.patch | 63 --------------------
 srcpkgs/libgccjit/template                   | 24 +++-----
 2 files changed, 9 insertions(+), 78 deletions(-)
 delete mode 100644 srcpkgs/libgccjit/files/libgccjit-musl.patch

diff --git a/srcpkgs/libgccjit/files/libgccjit-musl.patch b/srcpkgs/libgccjit/files/libgccjit-musl.patch
deleted file mode 100644
index d2ed16928c82..000000000000
--- a/srcpkgs/libgccjit/files/libgccjit-musl.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-diff --git a/gcc/jit/jit-playback.c b/gcc/jit/jit-playback.c
-index 5bccf591a..35f5e35ef 100644
---- a/gcc/jit/jit-playback.c
-+++ b/gcc/jit/jit-playback.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -41,8 +43,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "diagnostic.h"
- #include "stmt.h"
- 
--#include <pthread.h>
--
- #include "jit-playback.h"
- #include "jit-result.h"
- #include "jit-builtins.h"
-diff --git a/gcc/jit/jit-recording.c b/gcc/jit/jit-recording.c
-index a237d574f..5785e3269 100644
---- a/gcc/jit/jit-recording.c
-+++ b/gcc/jit/jit-recording.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -25,8 +27,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "pretty-print.h"
- #include "toplev.h"
- 
--#include <pthread.h>
--
- #include "jit-builtins.h"
- #include "jit-recording.h"
- #include "jit-playback.h"
-diff --git a/gcc/jit/libgccjit.c b/gcc/jit/libgccjit.c
-index f9c33c63c..75f21d275 100644
---- a/gcc/jit/libgccjit.c
-+++ b/gcc/jit/libgccjit.c
-@@ -18,13 +18,13 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
- #include "timevar.h"
- #include "typed-splay-tree.h"
- #include "cppbuiltin.h"
--#include <pthread.h>
- 
- #include "libgccjit.h"
- #include "jit-recording.h"
diff --git a/srcpkgs/libgccjit/template b/srcpkgs/libgccjit/template
index 0b37c3ee9f8b..fde1affd54b7 100644
--- a/srcpkgs/libgccjit/template
+++ b/srcpkgs/libgccjit/template
@@ -3,18 +3,12 @@
 # which use the version number.
 
 pkgname=libgccjit
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
+version=12.2.0
 revision=1
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
-_majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 create_wrksrc=yes
 short_desc="Just-In-Time Compilation library for GCC"
 maintainer="Lane Biocini <lane@mailbox.org>"
@@ -22,16 +16,16 @@ homepage="https://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 nopie=yes
 lib32disabled=yes
 makedepends="zlib-devel"

From 48f5864ec628b19c5be7e96d4cb894f8ce67a068 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 10/35] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove -no-pie from build. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..5d40f0cdd8a6 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -53,6 +53,7 @@ _void_cross_build_binutils() {
 		--sbindir=/usr/bin \
 		--libdir=/usr/lib \
 		--libexecdir=/usr/lib \
+		--sysconfdir=/etc \
 		--target=${tgt} \
 		--with-sysroot=/usr/${tgt} \
 		--disable-nls \
@@ -60,7 +61,9 @@ _void_cross_build_binutils() {
 		--disable-multilib \
 		--disable-werror \
 		--disable-gold \
+		--disable-gprofng \
 		--enable-relro \
+		--enable-new-dtags \
 		--enable-plugins \
 		--enable-64-bit-bfd \
 		--enable-deterministic-archives \
@@ -132,6 +135,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -460,6 +464,14 @@ do_build() {
 	local binutils_ver linux_ver gcc_ver libc_ver libucontext_ver
 	local tgt=${sourcepkg/cross-}
 
+	export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}"
+	export CXXFLAGS="${CXXFLAGS/-D_FORTIFY_SOURCE=2/}"
+
+	# Disable explicit -fno-PIE, gcc/binutils/libc will figure this out itself.
+	export CFLAGS="${CFLAGS//-fno-PIE/}"
+	export CXXFLAGS="${CXXFLAGS//-fno-PIE/}"
+	export LDFLAGS="${LDFLAGS//-no-pie/}"
+
 	_void_cross_test_ver binutils
 	_void_cross_test_ver linux
 	_void_cross_test_ver gcc
@@ -625,6 +637,9 @@ do_install() {
 	# then remove it because it conflicts with libquadmath package
 	rm -rf ${DESTDIR}/${sysroot}/usr/lib/libquadmath.*
 
+	# Remove libdep linker plugin because it conflicts with system binutils
+	rm -f ${DESTDIR}/usr/lib/bfd-plugins/libdep*
+
 	# Remove leftover symlinks
 	rm -f ${DESTDIR}/usr/lib${XBPS_TARGET_WORDSIZE}
 	rm -f ${DESTDIR}/lib*

From 21eb53c96eb9a4f8b83e5325c04f863dad7aa21b Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 11/35] qemu: remove broken patch

The necessary patch has been imported into musl so no need
to cast the sigevent struct to a more glibc-like one.
---
 .../musl-fix-sigevent-and-sigval_t.patch      | 27 -------------------
 1 file changed, 27 deletions(-)
 delete mode 100644 srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch

diff --git a/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch b/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch
deleted file mode 100644
index 4b4f1117c15f..000000000000
--- a/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-Note: Remove this patch with musl 1.2.2
-
---- a/linux-user/syscall.c
-+++ b/linux-user/syscall.c
-@@ -5020,10 +5020,21 @@
- #ifndef HAVE_SIGEV_NOTIFY_THREAD_ID
- #define sigev_notify_thread_id _sigev_un._tid
- #endif
- 
--static inline abi_long target_to_host_sigevent(struct sigevent *host_sevp,
-+struct host_sigevent {
-+    union sigval sigev_value;
-+    int sigev_signo;
-+    int sigev_notify;
-+    union {
-+       char _pad[64 - sizeof(int) * 2 - sizeof(union sigval)];
-+       int _tid;
-+    } _sigev_un;
-+};
-+
-+static inline abi_long target_to_host_sigevent(struct sigevent *sevp,
-                                                abi_ulong target_addr)
- {
-+    struct host_sigevent *host_sevp = (struct host_sigevent *) sevp;
-     struct target_sigevent *target_sevp;
- 
-     if (!lock_user_struct(VERIFY_READ, target_sevp, target_addr, 1)) {

From 6822c61ab8932a5289e172d4f38c1c07afcdfd26 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 12/35] cross-aarch64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..9e6fb75c198d 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Leah Neukirchen <leah@vuxu.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 4f73ef62034d51b66a8b87d3e4e3d874b5b8cb7f Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 13/35] cross-aarch64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..ba14c96bccea 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 04ea42e5f6f3308bdcc79a545ef6db5c5d8a3b4b Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 14/35] cross-arm-linux-gnueabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..5c774e16f430 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 02591d6932e69c1f48ddb66449fedb4dec9d9c3c Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 15/35] cross-arm-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..d6298ab639a4 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 19e6d9da4428dd555a71c5341a8786044e53f9fa Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 16/35] cross-arm-linux-musleabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..24df78e8fd8e 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From d86de19e296e9074ec96abc8c85467dcbea5db94 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 17/35] cross-arm-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..8093700f909c 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From f132cba4a721ce77ca5328efd1cf6aabb71c1007 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 18/35] cross-armv7l-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..92665326428b 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From ed479b4cf323ec79fadd6fb3885f9e14dfd40090 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 19/35] cross-armv7l-linux-musleabihf: update to gcc 12.2.0.

---
 .../cross-armv7l-linux-musleabihf/template    | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..e5af2c9ccbf2 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 7e1f0eacb0a5901df24504d8518a3834861cde05 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 20/35] cross-i686-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-i686-linux-musl/template b/srcpkgs/cross-i686-linux-musl/template
index 8be16a230d8d..d624bb7a3254 100644
--- a/srcpkgs/cross-i686-linux-musl/template
+++ b/srcpkgs/cross-i686-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-i686-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-i686-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From dd597ab7474dfe6842c94b22667054ec9c463922 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 21/35] cross-i686-pc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..6a9e54db807a 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,14 +1,15 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -16,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 8a476568cfdadd655ffe98cfc958892b71cd7559 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 22/35] cross-mips-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-musl/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..67a5c413396c 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 1a3edd0685a5da63811119a58ae4b88ff696e948 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 23/35] cross-mips-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..bdf8600ce95b 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="hipperson0 <hipperson0@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 0ac27a2692a53ce7165a3474381b37b509dc92e5 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 24/35] cross-mipsel-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..de49387d517b 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 52cabdf6585a24f3ef09b01da946d5c44327afe8 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 25/35] cross-mipsel-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..b27ce6475a38 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 4abaa5d126cbada7d11284e77292d952d9f1e9cf Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 26/35] cross-powerpc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..79579e093b12 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 407aaefaba5e73b82b83aa001ee846f4d2d081ce Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 27/35] cross-powerpc-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..9bb6acd359b6 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 2d0b032e3db604dde19368bfab4bfe8bebca5024 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 28/35] cross-powerpc64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..2d153d00add6 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,16 +1,17 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
  --enable-targets=powerpc-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -18,12 +19,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 116225e59aca798e6a9f99939bc66289fcead1d5 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 29/35] cross-powerpc64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 016f18776a6d..e0848fe0bff7 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,30 +1,31 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From effa61d922f348dbb23289869162143d98e44405 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 30/35] cross-powerpc64le-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 463d7e92d20d..8d8e010e15c0 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,16 +1,17 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
  --enable-targets=powerpcle-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -18,12 +19,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 99763423237bbb98ffa1ce828a70d20b2d3dbcca Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 31/35] cross-powerpc64le-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index c17a3cccfe29..0915e524545f 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,30 +1,31 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From d407454663e1a3d17d9d8dac0155d22e15e4f8f2 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 32/35] cross-powerpcle-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 9aede3c465ce..687be8a44c6c 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 
@@ -35,6 +36,8 @@ if [ "$XBPS_TARGET_MACHINE" = "ppcle" ]; then
 	broken="Can't build crosstoolchain to itself"
 fi
 
+broken="glibc uses big-endian specific instructions on 32-bit powerpc"
+
 cross-powerpcle-linux-gnu-libc_package() {
 	short_desc+=" - glibc files"
 	nostrip=yes

From 5d3fdb45f810ee38b242d13a4a522acaadafde4d Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 33/35] cross-powerpcle-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index 045cfda987fe..bb984b9c42eb 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From f1af41592f7847826bc863baee44328940685220 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:30 -0800
Subject: [PATCH 34/35] cross-x86_64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 8918f3c22a1c..930aaf2a508b 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,14 +1,15 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -16,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 2983d7ea1d0a9eed241e2596774203969ca3d333 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:30 -0800
Subject: [PATCH 35/35] cross-x86_64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..ac5b1c46ab82 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (226 preceding siblings ...)
  2022-11-17  1:54 ` oreo639
@ 2022-11-18  4:02 ` oreo639
  2022-11-18 10:02 ` oreo639
                   ` (36 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-11-18  4:02 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5448 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.2.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.2.0

There is a list of failing builds here: https://github.com/void-linux/void-packages/issues/39809

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [x] llvm https://github.com/void-linux/void-packages/pull/38694
- [x] m4 https://github.com/void-linux/void-packages/pull/33730
- [x] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [x] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [x] libvirt https://github.com/void-linux/void-packages/pull/38842
- [x] syslinux https://github.com/void-linux/void-packages/pull/38876
- [x] efivar https://github.com/void-linux/void-packages/pull/38874
- [x] gpgme https://github.com/void-linux/void-packages/pull/38825

Known packages that needed to be fixed/updated for gcc12:
- [x] openssh https://github.com/void-linux/void-packages/pull/38849
- [x] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [x] doxygen https://github.com/void-linux/void-packages/pull/38846
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] libproxy https://github.com/void-linux/void-packages/pull/38818
- [x] exempi https://github.com/void-linux/void-packages/pull/38820
- [x] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [x] libunique1 https://github.com/void-linux/void-packages/pull/38848 or https://github.com/void-linux/void-packages/pull/38873
- [x] libwpd https://github.com/void-linux/void-packages/pull/38878
- [x] cglm https://github.com/void-linux/void-packages/pull/39748
- [x] coreboot-utils https://github.com/void-linux/void-packages/pull/39749
- [x] apl https://github.com/void-linux/void-packages/pull/39750
- [x] igt-gpu-tools https://github.com/void-linux/void-packages/pull/39780

Needs to be fixed/updated for binutils:
- [x] grub https://github.com/void-linux/void-packages/pull/38875
- [x] linux-tools https://github.com/void-linux/void-packages/pull/38877
- [x] kcov https://github.com/void-linux/void-packages/pull/39291

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [x] kde
- [x] lxde
- [x] lxqt

You can test the ISOs here:
https://drive.google.com/drive/folders/1ix92CYSLUP-KWjLxltdgG4e8Nu2JCY5n?usp=sharing

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 125296 bytes --]

From 21c63f31485bb40184a74b0a0e8232bcbf5a0e6a Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 01/35] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../fix-libcollector-without-java.patch       | 53 +++++++++++++++
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 25 ++++---
 4 files changed, 87 insertions(+), 117 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
 create mode 100644 srcpkgs/binutils/patches/fix-libcollector-without-java.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/fix-libcollector-without-java.patch b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
new file mode 100644
index 000000000000..54384875f358
--- /dev/null
+++ b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
@@ -0,0 +1,53 @@
+From 49ddd814ac1071af7c4f45d5f8398b91862f2c7f Mon Sep 17 00:00:00 2001
+From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
+Date: Wed, 17 Aug 2022 19:55:23 -0700
+Subject: [PATCH] gprofng: fix bug 29479 Collection fails when built without
+ java support
+
+gprofng/ChangeLog
+2022-08-17  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>
+
+	PR gprofng/29479
+	* libcollector/collector.c: Add #if defined(GPROFNG_JAVA_PROFILING) for
+	java specific code.
+	* libcollector/unwind.c: Likewise.
+---
+ gprofng/libcollector/collector.c | 2 ++
+ gprofng/libcollector/unwind.c    | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/gprofng/libcollector/collector.c b/gprofng/libcollector/collector.c
+index 93c9d3330de5..ceff2c1caccb 100644
+--- a/gprofng/libcollector/collector.c
++++ b/gprofng/libcollector/collector.c
+@@ -913,8 +913,10 @@ __collector_open_experiment (const char *exp, const char *params, sp_origin_t or
+   __collector_ext_unwind_key_init (1, NULL);
+ 
+   /* start java attach if suitable */
++#if defined(GPROFNG_JAVA_PROFILING)
+   if (exp_origin == SP_ORIGIN_DBX_ATTACH)
+     __collector_jprofile_start_attach ();
++#endif
+   start_sec_time = CALL_UTIL (time)(NULL);
+   __collector_start_time = collector_interface.getHiResTime ();
+   TprintfT (DBG_LT0, "\t__collector_open_experiment; resetting start_time\n");
+diff --git a/gprofng/libcollector/unwind.c b/gprofng/libcollector/unwind.c
+index 119243788020..f8e11823c81e 100644
+--- a/gprofng/libcollector/unwind.c
++++ b/gprofng/libcollector/unwind.c
+@@ -557,6 +557,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+   int size = max_frame_size;
+ 
+ #define MIN(a,b) ((a)<(b)?(a):(b))
++#if defined(GPROFNG_JAVA_PROFILING)
+   /* get Java info */
+   if (__collector_java_mode && __collector_java_asyncgetcalltrace_loaded && context && !pseudo_context)
+     {
+@@ -569,6 +570,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+ 	  size -= sz;
+ 	}
+     }
++#endif
+ 
+   /* get native stack */
+   if (context)
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..c355a5fc8016 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkgconf"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -35,15 +36,21 @@ do_configure() {
 	local conf
 
 	if [ "$CHROOT_READY" ]; then
-		conf+=" --with-debuginfod"
+		conf+=" --with-debuginfod --enable-shared"
 	else
-		conf+=" --without-debuginfod --disable-install-libbfd"
+		conf+=" --without-debuginfod --disable-shared --disable-install-libbfd"
 	fi
 	if [ "$CROSS_BUILD" ]; then
 		# we don't want --with-sysroot=${XBPS_CROSS_BASE} like gnu-configure
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	# gprofng currently only supports x86 and aarch64 glibc.
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64|i386|aarch64) conf+=" --enable-gprofng" ;;
+		*) conf+=" --disable-gprofng" ;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"
@@ -76,13 +83,14 @@ do_configure() {
 		--libdir=/usr/lib \
 		--mandir=/usr/share/man \
 		--infodir=/usr/share/info \
+		--sysconfdir=/etc \
 		--disable-werror \
-		--disable-shared \
 		--disable-nls \
 		--enable-threads \
 		--enable-plugins \
 		--enable-relro \
 		--enable-gold \
+		--enable-new-dtags \
 		--enable-deterministic-archives \
 		--enable-64-bit-bfd \
 		--enable-ld=default \
@@ -142,7 +150,8 @@ binutils-devel_package() {
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/*.a"
-		vmove "usr/lib/*.so"
+		vmove "usr/lib/libbfd.so"
+		vmove "usr/lib/libopcodes.so"
 	}
 }
 

From abab0f3636ece8dc55601c49bfdbafcf4e96c415 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 02/35] gdb: resolve conflict with binutils 2.39

---
 srcpkgs/gdb/template | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/gdb/template b/srcpkgs/gdb/template
index 9c5f17ffc519..b666348fea19 100644
--- a/srcpkgs/gdb/template
+++ b/srcpkgs/gdb/template
@@ -1,7 +1,7 @@
 # Template file for 'gdb'
 pkgname=gdb
 version=12.1
-revision=2
+revision=3
 build_style=gnu-configure
 pycompile_dirs="/usr/share/gdb/python"
 configure_args="--disable-werror --disable-nls --with-system-readline
@@ -48,7 +48,8 @@ vopt_conflict debuginfod static
 
 post_install() {
 	# resolve conflicts with binutils
-	rm -r ${DESTDIR}/usr/{include,lib,share/info/bfd.info*}
+	rm -rf ${DESTDIR}/usr/{include,lib}
+	rm -rf ${DESTDIR}/usr/share/info/{bfd,ctf-spec}.info*
 }
 
 gdb-common_package() {

From 3aa8ea4b04e34844b5d8c5c633712bd778bafca0 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 03/35] gcc: update to 12.2.0.

---
 common/shlibs                                 | 10 +--
 srcpkgs/gcc/files/gccgo-musl.patch            | 71 +++------------
 srcpkgs/gcc/files/libgnarl-musl.patch         | 18 ++--
 srcpkgs/gcc/files/libssp-musl.patch           | 10 +--
 srcpkgs/gcc/patches/libffi_gnulinux.patch     | 11 ---
 .../gcc/patches/libgcc-ibm128-no-tag.patch    | 10 ++-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |  2 +-
 srcpkgs/gcc/template                          | 87 +++++++++----------
 8 files changed, 80 insertions(+), 139 deletions(-)
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index 07296762fcc4..a5f4f3257d33 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.2.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.36 perl-5.36.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -857,8 +857,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.2.0_1
+libgnat-12.so libada-12.2.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1710,8 +1710,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.2.0_1
+libasan.so.8 libsanitizer-12.2.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..12ec68dd8aa3 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,14 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ b/libgo/go/runtime/os_linux.go
+@@ -365,7 +365,7 @@ func setThreadCPUProfiler(hz int32) {
+ 	var sevp _sigevent
+ 	sevp.sigev_notify = _SIGEV_THREAD_ID
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.__sev_fields))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index ab3643de4f98..a20af7c0ef2e 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,14 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
+version=12.2.0
+revision=1
+_minorver="${version%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 create_wrksrc=yes
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +18,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -52,8 +48,11 @@ if [ "$CHROOT_READY" ]; then
 	hostmakedepends="tar texinfo perl flex"
 else
 	_have_gccgo=no
+	# libzstd fails to link in bootstrap with glibc 2.36
+	# when zlib has been compiled with glibc 2.32.
+	LDFLAGS="-lzstd -pthread"
 fi
-makedepends="zlib-devel"
+makedepends="zlib-devel libzstd-devel"
 depends="binutils libgcc-devel-${version}_${revision}
  libstdc++-devel-${version}_${revision} libssp-devel-${version}_${revision}"
 checkdepends="dejagnu"
@@ -70,13 +69,13 @@ if [ "$build_option_gnatboot" ]; then
 	case "$XBPS_TARGET_MACHINE" in
 	x86_64)
 		_gnat_tarball="gnat-gpl-2017-x86_64-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/591c6d80c7a447af2deed1d7>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/9682e2e1f2f232ce03fe21d77b14c37a0de5649b?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" b942bcac20dea39748b39f8b624d9619f60a8dee2e8195dbe3829c835b0956e6"
 		build_options_default="gnatboot"
 		;;
 	i686)
 		_gnat_tarball="gnat-gpl-2014-x86-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/564b3e9dc8e196b040fbe248>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/c5e9e6fdff5cb77ed90cf8c62536653e27c0bed6?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" 3b693510f5d22a240abb3034934c1adbd80ccd6e4f61a4f491cc408fdfd9c042"
 		build_options_default="gnatboot"
 		;;
@@ -155,8 +154,8 @@ if [ "$CROSS_BUILD" ]; then
 fi
 
 post_extract() {
-	mv gcc-${version/pre/_pre}/* gcc-${version/pre/_pre}/.??* .
-	rmdir gcc-${version/pre/_pre}
+	mv gcc-${version}/* gcc-${version}/.??* .
+	rmdir gcc-${version}
 	mv gmp-${_gmp_version} gmp
 	mv mpfr-${_mpfr_version} mpfr
 	mv mpc-${_mpc_version} mpc
@@ -186,9 +185,9 @@ pre_configure() {
 	sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
 
 	if [ "$XBPS_TARGET_LIBC" = musl ]; then
-		patch -p1 -i ${FILESDIR}/libgnarl-musl.patch
-		patch -p1 -i ${FILESDIR}/libssp-musl.patch
-		patch -p1 -i ${FILESDIR}/gccgo-musl.patch
+		for p in ${FILESDIR}/*-musl.patch; do
+			patch -p1 -i $p
+		done
 	fi
 }
 do_configure() {
@@ -343,16 +342,16 @@ do_install() {
 
 	# Make version a symlink of major version to make all versions
 	# from the same series work automagically.
-	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver} \
+	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${version} \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver}
 	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver} \
-		${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}
+		${DESTDIR}/usr/lib/gcc/${_triplet}/${version}
 
 	# Ditto for c++ headers.
-	mv ${DESTDIR}/usr/include/c++/${_patchver} \
+	mv ${DESTDIR}/usr/include/c++/${version} \
 		${DESTDIR}/usr/include/c++/${_minorver}
 	ln -sfr ${DESTDIR}/usr/include/c++/${_minorver} \
-		${DESTDIR}/usr/include/c++/${_patchver}
+		${DESTDIR}/usr/include/c++/${version}
 
 	# cc symlink
 	ln -sfr ${DESTDIR}/usr/bin/gcc ${DESTDIR}/usr/bin/cc
@@ -361,7 +360,7 @@ do_install() {
 
 	# lto plugin symlink
 	vmkdir usr/lib/bfd-plugins
-	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}/liblto_plugin.so \
+	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${version}/liblto_plugin.so \
 		${DESTDIR}/usr/lib/bfd-plugins
 
 	# Remove "fixed" header
@@ -372,13 +371,9 @@ do_install() {
 	rm -f ${DESTDIR}/usr/lib/libffi*
 	rm -f ${DESTDIR}/usr/share/man/man3/ffi*
 
-	# Remove all python scripts in libdir.
-	rm -f ${DESTDIR}/usr/lib/*.py
-
-	# Remove more python stuff.
-	if [ -d ${DESTDIR}/usr/share/gcc-${_patchver}/python ]; then
-		rm -rf ${DESTDIR}/usr/share/gcc-${_patchver}/python
-	fi
+	# Move libstdc++ gdb helpers to location where gdb can autoload them
+	mkdir -p ${DESTDIR}/usr/share/gdb/auto-load/usr/lib
+	mv ${DESTDIR}/usr/lib/*.py ${DESTDIR}/usr/share/gdb/auto-load/usr/lib
 
 	# Install c89 and c99 wrappers and its manpages, from NetBSD.
 	for f in c89 c99; do
@@ -397,7 +392,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}
@@ -450,7 +445,7 @@ gcc-fortran_package() {
 		if [ "$CROSS_BUILD" ]; then
 			# A number of OMP modules are not built when cross
 			# compiling gcc. Copy them from the cross compiler.
-			local src="/usr/lib/gcc/${_triplet}/${_patchver}/finclude"
+			local src="/usr/lib/gcc/${_triplet}/${version}/finclude"
 			local dst="usr/lib/gcc/${_triplet}/${_minorver}/finclude"
 			for f in omp_lib.f90 omp_lib.h omp_lib.mod omp_lib_kinds.mod \
 				openacc.f90 openacc.mod openacc_kinds.mod openacc_lib.h; do
@@ -517,7 +512,7 @@ libgfortran_package() {
 	short_desc+=" - Fortran library"
 	pkg_install() {
 		vmove "usr/lib/libgfortran.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -538,7 +533,7 @@ libgo_package() {
 	nostrip=yes
 	pkg_install() {
 		vmove "usr/lib/libgo.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -554,7 +549,7 @@ libobjc_package() {
 	short_desc+=" - Objective-C library"
 	pkg_install() {
 		vmove "usr/lib/libobjc.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -573,7 +568,7 @@ libquadmath_package() {
 	short_desc+=" - quadmath library"
 	pkg_install() {
 		vmove "usr/lib/libquadmath.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -615,7 +610,7 @@ libgcc_package() {
 	noverifyrdeps=yes
 	pkg_install() {
 		vmove "usr/lib/libgcc_s.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -646,7 +641,7 @@ libgomp_package() {
 	short_desc+=" - OpenMP v4.0 library"
 	pkg_install() {
 		vmove "usr/lib/libgomp*.so.*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -701,7 +696,7 @@ libssp_package() {
 	short_desc+=" - SSP (StackSmashingProtection) library"
 	pkg_install() {
 		vmove "usr/lib/libssp.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -718,7 +713,9 @@ libstdc++-devel_package() {
 libstdc++_package() {
 	short_desc+=" - Standard C++ Library"
 	pkg_install() {
+		vmove usr/share/gdb
+		vmove usr/share/gcc-${version}/python
 		vmove "usr/lib/libstdc++.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }

From 4446b03ce5d16d118c4a7bf68bf72e0e17841eed Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 04/35] libtool: rebuild for gcc 12.2

---
 srcpkgs/libtool/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index fc5c53a9c3e9..aebad9294eef 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
 version=2.4.7
-revision=1
+revision=2
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"

From 467fa480506ef4afb2270e3bd274dce80f4c766b Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 05/35] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 7e01bbb851fd..d9618e3806ba 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 build_wrksrc=libiberty
 build_style=gnu-configure
@@ -10,7 +10,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From 51514db7e5c3ca159b1acf5a2e5f2136cc114182 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 06/35] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 ...e-hash-style-both-for-building-glibc.patch |  51 ++++
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 4 files changed, 106 insertions(+), 353 deletions(-)
 create mode 100644 srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index a5f4f3257d33..a96fe577e93b 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch b/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
new file mode 100644
index 000000000000..9c5553e92609
--- /dev/null
+++ b/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
@@ -0,0 +1,51 @@
+Temporary workaround for EAC bug.
+
+See: https://sourceware.org/bugzilla/show_bug.cgi?id=29456
+
+From 8e90e2cc5e57d7ca3a40602d278e9642a8b66716 Mon Sep 17 00:00:00 2001
+From: oreo639 <oreo6391@gmail.com>
+Date: Tue, 13 Sep 2022 14:30:35 -0700
+Subject: [PATCH] Revert "Do not use --hash-style=both for building glibc
+ shared objects"
+
+This reverts commit e47de5cb2d4dbecb58f569ed241e8e95c568f03c.
+---
+ Makeconfig     |  9 +++++++++
+ Makerules      |  7 +++++++
+ 5 files changed, 61 insertions(+)
+
+diff --git a/Makeconfig b/Makeconfig
+index ba70321af1..e2131d4389 100644
+--- a/Makeconfig
++++ b/Makeconfig
+@@ -371,6 +371,13 @@ dt-relr-ldflag =
+ no-dt-relr-ldflag =
+ endif
+ 
++# For the time being we unconditionally use 'both'.  At some time we
++# should declare statically linked code as 'out of luck' and compile
++# with --hash-style=gnu only.
++hashstyle-LDFLAGS = -Wl,--hash-style=both
++LDFLAGS.so += $(hashstyle-LDFLAGS)
++LDFLAGS-rtld += $(hashstyle-LDFLAGS)
++
+ ifeq (no,$(build-pie-default))
+ pie-default = $(no-pie-ccflag)
+ else # build-pie-default
+diff --git a/Makerules b/Makerules
+index d1e139d03c..44134e37ce 100644
+--- a/Makerules
++++ b/Makerules
+@@ -558,6 +558,9 @@ $(common-objpfx)shlib.lds: $(common-objpfx)config.make $(..)Makerules
+ 		  -Wl,--verbose 2>/dev/null | \
+ 	  sed > $@T \
+ 	      -e '/^=========/,/^=========/!d;/^=========/d' \
++		   -e 's/^.*\.gnu\.hash[ 	]*:.*$$/  .note.ABI-tag : { *(.note.ABI-tag) } &/' \
++		   -e '/^[ 	]*\.hash[ 	]*:.*$$/{h;d;}' \
++		   -e '/DATA_SEGMENT_ALIGN/{H;g}' \
+ 	      -e 's/^.*\*(\.dynbss).*$$/& \
+ 		 PROVIDE(__start___libc_freeres_ptrs = .); \
+ 		 *(__libc_freeres_ptrs) \
+-- 
+2.37.3
+
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From cef672339648a622c480cdcc1e58f067e4fb71be Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 07/35] musl: add support for SIGEV_THREAD_ID timers

https://git.musl-libc.org/cgit/musl/commit/?id=7c71792e87691451f2a6b76348e83ad1889f1dcb
---
 ...d-support-for-SIGEV_THREAD_ID-timers.patch | 74 +++++++++++++++++++
 srcpkgs/musl/template                         |  2 +-
 2 files changed, 75 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch

diff --git a/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
new file mode 100644
index 000000000000..e20dff5ba0d4
--- /dev/null
+++ b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
@@ -0,0 +1,74 @@
+From 7c71792e87691451f2a6b76348e83ad1889f1dcb Mon Sep 17 00:00:00 2001
+From: James Y Knight <jyknight@google.com>
+Date: Sun, 30 Jun 2019 21:55:20 -0400
+Subject: [PATCH] add support for SIGEV_THREAD_ID timers
+
+This is like SIGEV_SIGNAL, but targeted to a particular thread's
+tid, rather than the process.
+---
+ include/signal.h        | 16 +++++++++++++---
+ src/time/timer_create.c |  8 ++++++--
+ 2 files changed, 19 insertions(+), 5 deletions(-)
+
+diff --git a/include/signal.h b/include/signal.h
+index fbdf667b2..9ed929e4f 100644
+--- a/include/signal.h
++++ b/include/signal.h
+@@ -180,14 +180,24 @@ struct sigevent {
+ 	union sigval sigev_value;
+ 	int sigev_signo;
+ 	int sigev_notify;
+-	void (*sigev_notify_function)(union sigval);
+-	pthread_attr_t *sigev_notify_attributes;
+-	char __pad[56-3*sizeof(long)];
++	union {
++		char __pad[64 - 2*sizeof(int) - sizeof(union sigval)];
++		pid_t sigev_notify_thread_id;
++		struct {
++			void (*sigev_notify_function)(union sigval);
++			pthread_attr_t *sigev_notify_attributes;
++		} __sev_thread;
++	} __sev_fields;
+ };
+ 
++#define sigev_notify_thread_id __sev_fields.sigev_notify_thread_id
++#define sigev_notify_function __sev_fields.__sev_thread.sigev_notify_function
++#define sigev_notify_attributes __sev_fields.__sev_thread.sigev_notify_attributes
++
+ #define SIGEV_SIGNAL 0
+ #define SIGEV_NONE 1
+ #define SIGEV_THREAD 2
++#define SIGEV_THREAD_ID 4
+ 
+ int __libc_current_sigrtmin(void);
+ int __libc_current_sigrtmax(void);
+diff --git a/src/time/timer_create.c b/src/time/timer_create.c
+index 5ddfda278..4bef23905 100644
+--- a/src/time/timer_create.c
++++ b/src/time/timer_create.c
+@@ -71,11 +71,15 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 	switch (evp ? evp->sigev_notify : SIGEV_SIGNAL) {
+ 	case SIGEV_NONE:
+ 	case SIGEV_SIGNAL:
++	case SIGEV_THREAD_ID:
+ 		if (evp) {
+ 			ksev.sigev_value = evp->sigev_value;
+ 			ksev.sigev_signo = evp->sigev_signo;
+ 			ksev.sigev_notify = evp->sigev_notify;
+-			ksev.sigev_tid = 0;
++			if (evp->sigev_notify == SIGEV_THREAD_ID)
++				ksev.sigev_tid = evp->sigev_notify_thread_id;
++			else
++				ksev.sigev_tid = 0;
+ 			ksevp = &ksev;
+ 		}
+ 		if (syscall(SYS_timer_create, clk, ksevp, &timerid) < 0)
+@@ -107,7 +111,7 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 
+ 		ksev.sigev_value.sival_ptr = 0;
+ 		ksev.sigev_signo = SIGTIMER;
+-		ksev.sigev_notify = 4; /* SIGEV_THREAD_ID */
++		ksev.sigev_notify = SIGEV_THREAD_ID;
+ 		ksev.sigev_tid = td->tid;
+ 		if (syscall(SYS_timer_create, clk, &ksev, &timerid) < 0)
+ 			timerid = -1;
diff --git a/srcpkgs/musl/template b/srcpkgs/musl/template
index 34e6ed4fba6e..afb33cd868b5 100644
--- a/srcpkgs/musl/template
+++ b/srcpkgs/musl/template
@@ -2,7 +2,7 @@
 pkgname=musl
 reverts="1.2.0_1"
 version=1.1.24
-revision=11
+revision=12
 archs="*-musl"
 bootstrap=yes
 build_style=gnu-configure

From 2717edd0b6c761b52553bc1c86ae15c4cfbee915 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 08/35] gcc-multilib: update to 12.2.0.

---
 srcpkgs/gcc-multilib/template | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index f28eb237c287..ba9bafcadfd6 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,15 +3,15 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _majorver="${version%.*}"
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel
@@ -70,7 +70,7 @@ do_build() {
 	make ${makejobs}
 }
 do_install() {
-	local _pc_triplet=x86_64-pc-linux-gnu _version=${version%pre1}
+	local _pc_triplet=x86_64-pc-linux-gnu
 	# Install to a tempdir and then only copy relevant files.
 	cd ${wrksrc}
 	make DESTDIR=${wrksrc}/${pkgname}-build install
@@ -80,9 +80,9 @@ do_install() {
 	vmkdir usr/include/c++/${_majorver}/${_triplet}
 	vmkdir usr/lib/gcc/${_triplet}/${_majorver}
 
-	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${_version}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${version}/32 \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_majorver}/
-	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${_version}/${_pc_triplet}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${version}/${_pc_triplet}/32 \
 		${DESTDIR}/usr/include/c++/${_majorver}/${_triplet}
 
 	vinstall ${wrksrc}/host-${_pc_triplet}/gcc/specs 644 usr/lib/gcc/${_triplet}/${_majorver}

From 9d9b8d02edbc6f76b4a628019bb7a76958f2beb8 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 09/35] libgccjit: update to 12.2.0.

---
 srcpkgs/libgccjit/files/libgccjit-musl.patch | 63 --------------------
 srcpkgs/libgccjit/template                   | 24 +++-----
 2 files changed, 9 insertions(+), 78 deletions(-)
 delete mode 100644 srcpkgs/libgccjit/files/libgccjit-musl.patch

diff --git a/srcpkgs/libgccjit/files/libgccjit-musl.patch b/srcpkgs/libgccjit/files/libgccjit-musl.patch
deleted file mode 100644
index d2ed16928c82..000000000000
--- a/srcpkgs/libgccjit/files/libgccjit-musl.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-diff --git a/gcc/jit/jit-playback.c b/gcc/jit/jit-playback.c
-index 5bccf591a..35f5e35ef 100644
---- a/gcc/jit/jit-playback.c
-+++ b/gcc/jit/jit-playback.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -41,8 +43,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "diagnostic.h"
- #include "stmt.h"
- 
--#include <pthread.h>
--
- #include "jit-playback.h"
- #include "jit-result.h"
- #include "jit-builtins.h"
-diff --git a/gcc/jit/jit-recording.c b/gcc/jit/jit-recording.c
-index a237d574f..5785e3269 100644
---- a/gcc/jit/jit-recording.c
-+++ b/gcc/jit/jit-recording.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -25,8 +27,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "pretty-print.h"
- #include "toplev.h"
- 
--#include <pthread.h>
--
- #include "jit-builtins.h"
- #include "jit-recording.h"
- #include "jit-playback.h"
-diff --git a/gcc/jit/libgccjit.c b/gcc/jit/libgccjit.c
-index f9c33c63c..75f21d275 100644
---- a/gcc/jit/libgccjit.c
-+++ b/gcc/jit/libgccjit.c
-@@ -18,13 +18,13 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
- #include "timevar.h"
- #include "typed-splay-tree.h"
- #include "cppbuiltin.h"
--#include <pthread.h>
- 
- #include "libgccjit.h"
- #include "jit-recording.h"
diff --git a/srcpkgs/libgccjit/template b/srcpkgs/libgccjit/template
index 0b37c3ee9f8b..fde1affd54b7 100644
--- a/srcpkgs/libgccjit/template
+++ b/srcpkgs/libgccjit/template
@@ -3,18 +3,12 @@
 # which use the version number.
 
 pkgname=libgccjit
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
+version=12.2.0
 revision=1
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
-_majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 create_wrksrc=yes
 short_desc="Just-In-Time Compilation library for GCC"
 maintainer="Lane Biocini <lane@mailbox.org>"
@@ -22,16 +16,16 @@ homepage="https://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 nopie=yes
 lib32disabled=yes
 makedepends="zlib-devel"

From f32b98e8a3859db9cedf246897b6da8edd8dc542 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 10/35] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove -no-pie from build. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..5d40f0cdd8a6 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -53,6 +53,7 @@ _void_cross_build_binutils() {
 		--sbindir=/usr/bin \
 		--libdir=/usr/lib \
 		--libexecdir=/usr/lib \
+		--sysconfdir=/etc \
 		--target=${tgt} \
 		--with-sysroot=/usr/${tgt} \
 		--disable-nls \
@@ -60,7 +61,9 @@ _void_cross_build_binutils() {
 		--disable-multilib \
 		--disable-werror \
 		--disable-gold \
+		--disable-gprofng \
 		--enable-relro \
+		--enable-new-dtags \
 		--enable-plugins \
 		--enable-64-bit-bfd \
 		--enable-deterministic-archives \
@@ -132,6 +135,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -460,6 +464,14 @@ do_build() {
 	local binutils_ver linux_ver gcc_ver libc_ver libucontext_ver
 	local tgt=${sourcepkg/cross-}
 
+	export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}"
+	export CXXFLAGS="${CXXFLAGS/-D_FORTIFY_SOURCE=2/}"
+
+	# Disable explicit -fno-PIE, gcc/binutils/libc will figure this out itself.
+	export CFLAGS="${CFLAGS//-fno-PIE/}"
+	export CXXFLAGS="${CXXFLAGS//-fno-PIE/}"
+	export LDFLAGS="${LDFLAGS//-no-pie/}"
+
 	_void_cross_test_ver binutils
 	_void_cross_test_ver linux
 	_void_cross_test_ver gcc
@@ -625,6 +637,9 @@ do_install() {
 	# then remove it because it conflicts with libquadmath package
 	rm -rf ${DESTDIR}/${sysroot}/usr/lib/libquadmath.*
 
+	# Remove libdep linker plugin because it conflicts with system binutils
+	rm -f ${DESTDIR}/usr/lib/bfd-plugins/libdep*
+
 	# Remove leftover symlinks
 	rm -f ${DESTDIR}/usr/lib${XBPS_TARGET_WORDSIZE}
 	rm -f ${DESTDIR}/lib*

From eb8ff2a4323598ff8cba777eb7a4226d096c015c Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 11/35] qemu: remove broken patch

The necessary patch has been imported into musl so no need
to cast the sigevent struct to a more glibc-like one.
---
 .../musl-fix-sigevent-and-sigval_t.patch      | 27 -------------------
 1 file changed, 27 deletions(-)
 delete mode 100644 srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch

diff --git a/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch b/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch
deleted file mode 100644
index 4b4f1117c15f..000000000000
--- a/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-Note: Remove this patch with musl 1.2.2
-
---- a/linux-user/syscall.c
-+++ b/linux-user/syscall.c
-@@ -5020,10 +5020,21 @@
- #ifndef HAVE_SIGEV_NOTIFY_THREAD_ID
- #define sigev_notify_thread_id _sigev_un._tid
- #endif
- 
--static inline abi_long target_to_host_sigevent(struct sigevent *host_sevp,
-+struct host_sigevent {
-+    union sigval sigev_value;
-+    int sigev_signo;
-+    int sigev_notify;
-+    union {
-+       char _pad[64 - sizeof(int) * 2 - sizeof(union sigval)];
-+       int _tid;
-+    } _sigev_un;
-+};
-+
-+static inline abi_long target_to_host_sigevent(struct sigevent *sevp,
-                                                abi_ulong target_addr)
- {
-+    struct host_sigevent *host_sevp = (struct host_sigevent *) sevp;
-     struct target_sigevent *target_sevp;
- 
-     if (!lock_user_struct(VERIFY_READ, target_sevp, target_addr, 1)) {

From 7da2cf9f19678dd1a4bc66264c1fa57c69f6bd16 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 12/35] cross-aarch64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..9e6fb75c198d 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Leah Neukirchen <leah@vuxu.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 7ca0483cd74b81fcb97163b77d96bf1e4e482415 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 13/35] cross-aarch64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..ba14c96bccea 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 42c3e405351b9224effa6bddfde739306975b330 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 14/35] cross-arm-linux-gnueabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..5c774e16f430 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 02317278945065b8ec8cdc30f02a3f8f0a9a1b03 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 15/35] cross-arm-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..d6298ab639a4 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 621c01c3ed8a3d82ae0b7e31e1578af9de0b09d6 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 16/35] cross-arm-linux-musleabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..24df78e8fd8e 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 595cffe41537b45b9688227fc399bb4a11e902f4 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 17/35] cross-arm-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..8093700f909c 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 3da9230d40948cdb4e02f652c1f1759d7748de8f Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 18/35] cross-armv7l-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..92665326428b 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From aff80aa5f0c19bcc60fa643aa34db34312a72a8d Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 19/35] cross-armv7l-linux-musleabihf: update to gcc 12.2.0.

---
 .../cross-armv7l-linux-musleabihf/template    | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..e5af2c9ccbf2 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 290f73aa8951a248497f3f01bc4a92f86fd24a52 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 20/35] cross-i686-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-i686-linux-musl/template b/srcpkgs/cross-i686-linux-musl/template
index 8be16a230d8d..d624bb7a3254 100644
--- a/srcpkgs/cross-i686-linux-musl/template
+++ b/srcpkgs/cross-i686-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-i686-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-i686-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 539c3aa8b2dfe4798348183ec289511baaeb9431 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 21/35] cross-i686-pc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..6a9e54db807a 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,14 +1,15 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -16,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 0499291ce5ae9aa08fbc036efca3185a3530ccf3 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 22/35] cross-mips-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-musl/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..67a5c413396c 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From b3e8e8a2e91f895d943d93c80947ae3085d9ccce Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 23/35] cross-mips-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..bdf8600ce95b 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="hipperson0 <hipperson0@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From ade8120a224e40c2c3278bc9cc01ce641ceadfef Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 24/35] cross-mipsel-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..de49387d517b 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 204238db6ccc4695594ceeb9901ee5174f9092dd Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 25/35] cross-mipsel-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..b27ce6475a38 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From fd995a9f9c417a8700c6eb99ba0ba70a77d89b95 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 26/35] cross-powerpc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..79579e093b12 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From f62a047812561a19408158859b88ed0b18229c8c Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 27/35] cross-powerpc-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..9bb6acd359b6 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 29e8822e67fbc399fa5dec85981f46f459f70c49 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 28/35] cross-powerpc64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..2d153d00add6 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,16 +1,17 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
  --enable-targets=powerpc-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -18,12 +19,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From c0f8018a8a234879a1c7f2eab68d711f7dc2d8ff Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 29/35] cross-powerpc64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 016f18776a6d..e0848fe0bff7 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,30 +1,31 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From ee502adba976a2fbe5c372ba63b7bcf088f2f4e3 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 30/35] cross-powerpc64le-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 463d7e92d20d..8d8e010e15c0 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,16 +1,17 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
  --enable-targets=powerpcle-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -18,12 +19,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 0919a73fa514c7f0cfbbf81e7004c5d419418a80 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 31/35] cross-powerpc64le-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index c17a3cccfe29..0915e524545f 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,30 +1,31 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 7872f3b5f6b1009e50603c63f49f1a97b89b49b5 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 32/35] cross-powerpcle-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 9aede3c465ce..687be8a44c6c 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 
@@ -35,6 +36,8 @@ if [ "$XBPS_TARGET_MACHINE" = "ppcle" ]; then
 	broken="Can't build crosstoolchain to itself"
 fi
 
+broken="glibc uses big-endian specific instructions on 32-bit powerpc"
+
 cross-powerpcle-linux-gnu-libc_package() {
 	short_desc+=" - glibc files"
 	nostrip=yes

From c0724d6e04fe38247e4b47be68355934a2b0617f Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 33/35] cross-powerpcle-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index 045cfda987fe..bb984b9c42eb 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 90754bfab2c1dc8a8d15a91a81a7177db66bbb9b Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:30 -0800
Subject: [PATCH 34/35] cross-x86_64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 8918f3c22a1c..930aaf2a508b 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,14 +1,15 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -16,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 786a56fdb4a6c8c09b7159047267d2377e3243ac Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:30 -0800
Subject: [PATCH 35/35] cross-x86_64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..ac5b1c46ab82 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (227 preceding siblings ...)
  2022-11-18  4:02 ` oreo639
@ 2022-11-18 10:02 ` oreo639
  2022-11-19 10:50 ` oreo639
                   ` (35 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-11-18 10:02 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5448 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.2.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.2.0

There is a list of failing builds here: https://github.com/void-linux/void-packages/issues/39809

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [x] llvm https://github.com/void-linux/void-packages/pull/38694
- [x] m4 https://github.com/void-linux/void-packages/pull/33730
- [x] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [x] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [x] libvirt https://github.com/void-linux/void-packages/pull/38842
- [x] syslinux https://github.com/void-linux/void-packages/pull/38876
- [x] efivar https://github.com/void-linux/void-packages/pull/38874
- [x] gpgme https://github.com/void-linux/void-packages/pull/38825

Known packages that needed to be fixed/updated for gcc12:
- [x] openssh https://github.com/void-linux/void-packages/pull/38849
- [x] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [x] doxygen https://github.com/void-linux/void-packages/pull/38846
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] libproxy https://github.com/void-linux/void-packages/pull/38818
- [x] exempi https://github.com/void-linux/void-packages/pull/38820
- [x] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [x] libunique1 https://github.com/void-linux/void-packages/pull/38848 or https://github.com/void-linux/void-packages/pull/38873
- [x] libwpd https://github.com/void-linux/void-packages/pull/38878
- [x] cglm https://github.com/void-linux/void-packages/pull/39748
- [x] coreboot-utils https://github.com/void-linux/void-packages/pull/39749
- [x] apl https://github.com/void-linux/void-packages/pull/39750
- [x] igt-gpu-tools https://github.com/void-linux/void-packages/pull/39780

Needs to be fixed/updated for binutils:
- [x] grub https://github.com/void-linux/void-packages/pull/38875
- [x] linux-tools https://github.com/void-linux/void-packages/pull/38877
- [x] kcov https://github.com/void-linux/void-packages/pull/39291

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [x] kde
- [x] lxde
- [x] lxqt

You can test the ISOs here:
https://drive.google.com/drive/folders/1ix92CYSLUP-KWjLxltdgG4e8Nu2JCY5n?usp=sharing

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 126199 bytes --]

From 21c63f31485bb40184a74b0a0e8232bcbf5a0e6a Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 01/36] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../fix-libcollector-without-java.patch       | 53 +++++++++++++++
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 25 ++++---
 4 files changed, 87 insertions(+), 117 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
 create mode 100644 srcpkgs/binutils/patches/fix-libcollector-without-java.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/fix-libcollector-without-java.patch b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
new file mode 100644
index 000000000000..54384875f358
--- /dev/null
+++ b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
@@ -0,0 +1,53 @@
+From 49ddd814ac1071af7c4f45d5f8398b91862f2c7f Mon Sep 17 00:00:00 2001
+From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
+Date: Wed, 17 Aug 2022 19:55:23 -0700
+Subject: [PATCH] gprofng: fix bug 29479 Collection fails when built without
+ java support
+
+gprofng/ChangeLog
+2022-08-17  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>
+
+	PR gprofng/29479
+	* libcollector/collector.c: Add #if defined(GPROFNG_JAVA_PROFILING) for
+	java specific code.
+	* libcollector/unwind.c: Likewise.
+---
+ gprofng/libcollector/collector.c | 2 ++
+ gprofng/libcollector/unwind.c    | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/gprofng/libcollector/collector.c b/gprofng/libcollector/collector.c
+index 93c9d3330de5..ceff2c1caccb 100644
+--- a/gprofng/libcollector/collector.c
++++ b/gprofng/libcollector/collector.c
+@@ -913,8 +913,10 @@ __collector_open_experiment (const char *exp, const char *params, sp_origin_t or
+   __collector_ext_unwind_key_init (1, NULL);
+ 
+   /* start java attach if suitable */
++#if defined(GPROFNG_JAVA_PROFILING)
+   if (exp_origin == SP_ORIGIN_DBX_ATTACH)
+     __collector_jprofile_start_attach ();
++#endif
+   start_sec_time = CALL_UTIL (time)(NULL);
+   __collector_start_time = collector_interface.getHiResTime ();
+   TprintfT (DBG_LT0, "\t__collector_open_experiment; resetting start_time\n");
+diff --git a/gprofng/libcollector/unwind.c b/gprofng/libcollector/unwind.c
+index 119243788020..f8e11823c81e 100644
+--- a/gprofng/libcollector/unwind.c
++++ b/gprofng/libcollector/unwind.c
+@@ -557,6 +557,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+   int size = max_frame_size;
+ 
+ #define MIN(a,b) ((a)<(b)?(a):(b))
++#if defined(GPROFNG_JAVA_PROFILING)
+   /* get Java info */
+   if (__collector_java_mode && __collector_java_asyncgetcalltrace_loaded && context && !pseudo_context)
+     {
+@@ -569,6 +570,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+ 	  size -= sz;
+ 	}
+     }
++#endif
+ 
+   /* get native stack */
+   if (context)
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..c355a5fc8016 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkgconf"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -35,15 +36,21 @@ do_configure() {
 	local conf
 
 	if [ "$CHROOT_READY" ]; then
-		conf+=" --with-debuginfod"
+		conf+=" --with-debuginfod --enable-shared"
 	else
-		conf+=" --without-debuginfod --disable-install-libbfd"
+		conf+=" --without-debuginfod --disable-shared --disable-install-libbfd"
 	fi
 	if [ "$CROSS_BUILD" ]; then
 		# we don't want --with-sysroot=${XBPS_CROSS_BASE} like gnu-configure
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	# gprofng currently only supports x86 and aarch64 glibc.
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64|i386|aarch64) conf+=" --enable-gprofng" ;;
+		*) conf+=" --disable-gprofng" ;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"
@@ -76,13 +83,14 @@ do_configure() {
 		--libdir=/usr/lib \
 		--mandir=/usr/share/man \
 		--infodir=/usr/share/info \
+		--sysconfdir=/etc \
 		--disable-werror \
-		--disable-shared \
 		--disable-nls \
 		--enable-threads \
 		--enable-plugins \
 		--enable-relro \
 		--enable-gold \
+		--enable-new-dtags \
 		--enable-deterministic-archives \
 		--enable-64-bit-bfd \
 		--enable-ld=default \
@@ -142,7 +150,8 @@ binutils-devel_package() {
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/*.a"
-		vmove "usr/lib/*.so"
+		vmove "usr/lib/libbfd.so"
+		vmove "usr/lib/libopcodes.so"
 	}
 }
 

From abab0f3636ece8dc55601c49bfdbafcf4e96c415 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 02/36] gdb: resolve conflict with binutils 2.39

---
 srcpkgs/gdb/template | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/gdb/template b/srcpkgs/gdb/template
index 9c5f17ffc519..b666348fea19 100644
--- a/srcpkgs/gdb/template
+++ b/srcpkgs/gdb/template
@@ -1,7 +1,7 @@
 # Template file for 'gdb'
 pkgname=gdb
 version=12.1
-revision=2
+revision=3
 build_style=gnu-configure
 pycompile_dirs="/usr/share/gdb/python"
 configure_args="--disable-werror --disable-nls --with-system-readline
@@ -48,7 +48,8 @@ vopt_conflict debuginfod static
 
 post_install() {
 	# resolve conflicts with binutils
-	rm -r ${DESTDIR}/usr/{include,lib,share/info/bfd.info*}
+	rm -rf ${DESTDIR}/usr/{include,lib}
+	rm -rf ${DESTDIR}/usr/share/info/{bfd,ctf-spec}.info*
 }
 
 gdb-common_package() {

From 3aa8ea4b04e34844b5d8c5c633712bd778bafca0 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 03/36] gcc: update to 12.2.0.

---
 common/shlibs                                 | 10 +--
 srcpkgs/gcc/files/gccgo-musl.patch            | 71 +++------------
 srcpkgs/gcc/files/libgnarl-musl.patch         | 18 ++--
 srcpkgs/gcc/files/libssp-musl.patch           | 10 +--
 srcpkgs/gcc/patches/libffi_gnulinux.patch     | 11 ---
 .../gcc/patches/libgcc-ibm128-no-tag.patch    | 10 ++-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |  2 +-
 srcpkgs/gcc/template                          | 87 +++++++++----------
 8 files changed, 80 insertions(+), 139 deletions(-)
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index 07296762fcc4..a5f4f3257d33 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.2.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.36 perl-5.36.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -857,8 +857,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.2.0_1
+libgnat-12.so libada-12.2.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1710,8 +1710,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.2.0_1
+libasan.so.8 libsanitizer-12.2.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..12ec68dd8aa3 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,14 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ b/libgo/go/runtime/os_linux.go
+@@ -365,7 +365,7 @@ func setThreadCPUProfiler(hz int32) {
+ 	var sevp _sigevent
+ 	sevp.sigev_notify = _SIGEV_THREAD_ID
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.__sev_fields))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index ab3643de4f98..a20af7c0ef2e 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,14 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
+version=12.2.0
+revision=1
+_minorver="${version%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 create_wrksrc=yes
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +18,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -52,8 +48,11 @@ if [ "$CHROOT_READY" ]; then
 	hostmakedepends="tar texinfo perl flex"
 else
 	_have_gccgo=no
+	# libzstd fails to link in bootstrap with glibc 2.36
+	# when zlib has been compiled with glibc 2.32.
+	LDFLAGS="-lzstd -pthread"
 fi
-makedepends="zlib-devel"
+makedepends="zlib-devel libzstd-devel"
 depends="binutils libgcc-devel-${version}_${revision}
  libstdc++-devel-${version}_${revision} libssp-devel-${version}_${revision}"
 checkdepends="dejagnu"
@@ -70,13 +69,13 @@ if [ "$build_option_gnatboot" ]; then
 	case "$XBPS_TARGET_MACHINE" in
 	x86_64)
 		_gnat_tarball="gnat-gpl-2017-x86_64-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/591c6d80c7a447af2deed1d7>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/9682e2e1f2f232ce03fe21d77b14c37a0de5649b?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" b942bcac20dea39748b39f8b624d9619f60a8dee2e8195dbe3829c835b0956e6"
 		build_options_default="gnatboot"
 		;;
 	i686)
 		_gnat_tarball="gnat-gpl-2014-x86-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/564b3e9dc8e196b040fbe248>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/c5e9e6fdff5cb77ed90cf8c62536653e27c0bed6?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" 3b693510f5d22a240abb3034934c1adbd80ccd6e4f61a4f491cc408fdfd9c042"
 		build_options_default="gnatboot"
 		;;
@@ -155,8 +154,8 @@ if [ "$CROSS_BUILD" ]; then
 fi
 
 post_extract() {
-	mv gcc-${version/pre/_pre}/* gcc-${version/pre/_pre}/.??* .
-	rmdir gcc-${version/pre/_pre}
+	mv gcc-${version}/* gcc-${version}/.??* .
+	rmdir gcc-${version}
 	mv gmp-${_gmp_version} gmp
 	mv mpfr-${_mpfr_version} mpfr
 	mv mpc-${_mpc_version} mpc
@@ -186,9 +185,9 @@ pre_configure() {
 	sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
 
 	if [ "$XBPS_TARGET_LIBC" = musl ]; then
-		patch -p1 -i ${FILESDIR}/libgnarl-musl.patch
-		patch -p1 -i ${FILESDIR}/libssp-musl.patch
-		patch -p1 -i ${FILESDIR}/gccgo-musl.patch
+		for p in ${FILESDIR}/*-musl.patch; do
+			patch -p1 -i $p
+		done
 	fi
 }
 do_configure() {
@@ -343,16 +342,16 @@ do_install() {
 
 	# Make version a symlink of major version to make all versions
 	# from the same series work automagically.
-	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver} \
+	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${version} \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver}
 	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver} \
-		${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}
+		${DESTDIR}/usr/lib/gcc/${_triplet}/${version}
 
 	# Ditto for c++ headers.
-	mv ${DESTDIR}/usr/include/c++/${_patchver} \
+	mv ${DESTDIR}/usr/include/c++/${version} \
 		${DESTDIR}/usr/include/c++/${_minorver}
 	ln -sfr ${DESTDIR}/usr/include/c++/${_minorver} \
-		${DESTDIR}/usr/include/c++/${_patchver}
+		${DESTDIR}/usr/include/c++/${version}
 
 	# cc symlink
 	ln -sfr ${DESTDIR}/usr/bin/gcc ${DESTDIR}/usr/bin/cc
@@ -361,7 +360,7 @@ do_install() {
 
 	# lto plugin symlink
 	vmkdir usr/lib/bfd-plugins
-	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}/liblto_plugin.so \
+	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${version}/liblto_plugin.so \
 		${DESTDIR}/usr/lib/bfd-plugins
 
 	# Remove "fixed" header
@@ -372,13 +371,9 @@ do_install() {
 	rm -f ${DESTDIR}/usr/lib/libffi*
 	rm -f ${DESTDIR}/usr/share/man/man3/ffi*
 
-	# Remove all python scripts in libdir.
-	rm -f ${DESTDIR}/usr/lib/*.py
-
-	# Remove more python stuff.
-	if [ -d ${DESTDIR}/usr/share/gcc-${_patchver}/python ]; then
-		rm -rf ${DESTDIR}/usr/share/gcc-${_patchver}/python
-	fi
+	# Move libstdc++ gdb helpers to location where gdb can autoload them
+	mkdir -p ${DESTDIR}/usr/share/gdb/auto-load/usr/lib
+	mv ${DESTDIR}/usr/lib/*.py ${DESTDIR}/usr/share/gdb/auto-load/usr/lib
 
 	# Install c89 and c99 wrappers and its manpages, from NetBSD.
 	for f in c89 c99; do
@@ -397,7 +392,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}
@@ -450,7 +445,7 @@ gcc-fortran_package() {
 		if [ "$CROSS_BUILD" ]; then
 			# A number of OMP modules are not built when cross
 			# compiling gcc. Copy them from the cross compiler.
-			local src="/usr/lib/gcc/${_triplet}/${_patchver}/finclude"
+			local src="/usr/lib/gcc/${_triplet}/${version}/finclude"
 			local dst="usr/lib/gcc/${_triplet}/${_minorver}/finclude"
 			for f in omp_lib.f90 omp_lib.h omp_lib.mod omp_lib_kinds.mod \
 				openacc.f90 openacc.mod openacc_kinds.mod openacc_lib.h; do
@@ -517,7 +512,7 @@ libgfortran_package() {
 	short_desc+=" - Fortran library"
 	pkg_install() {
 		vmove "usr/lib/libgfortran.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -538,7 +533,7 @@ libgo_package() {
 	nostrip=yes
 	pkg_install() {
 		vmove "usr/lib/libgo.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -554,7 +549,7 @@ libobjc_package() {
 	short_desc+=" - Objective-C library"
 	pkg_install() {
 		vmove "usr/lib/libobjc.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -573,7 +568,7 @@ libquadmath_package() {
 	short_desc+=" - quadmath library"
 	pkg_install() {
 		vmove "usr/lib/libquadmath.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -615,7 +610,7 @@ libgcc_package() {
 	noverifyrdeps=yes
 	pkg_install() {
 		vmove "usr/lib/libgcc_s.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -646,7 +641,7 @@ libgomp_package() {
 	short_desc+=" - OpenMP v4.0 library"
 	pkg_install() {
 		vmove "usr/lib/libgomp*.so.*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -701,7 +696,7 @@ libssp_package() {
 	short_desc+=" - SSP (StackSmashingProtection) library"
 	pkg_install() {
 		vmove "usr/lib/libssp.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -718,7 +713,9 @@ libstdc++-devel_package() {
 libstdc++_package() {
 	short_desc+=" - Standard C++ Library"
 	pkg_install() {
+		vmove usr/share/gdb
+		vmove usr/share/gcc-${version}/python
 		vmove "usr/lib/libstdc++.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }

From 4446b03ce5d16d118c4a7bf68bf72e0e17841eed Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 04/36] libtool: rebuild for gcc 12.2

---
 srcpkgs/libtool/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index fc5c53a9c3e9..aebad9294eef 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
 version=2.4.7
-revision=1
+revision=2
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"

From 467fa480506ef4afb2270e3bd274dce80f4c766b Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 05/36] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 7e01bbb851fd..d9618e3806ba 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 build_wrksrc=libiberty
 build_style=gnu-configure
@@ -10,7 +10,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From 51514db7e5c3ca159b1acf5a2e5f2136cc114182 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 06/36] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 ...e-hash-style-both-for-building-glibc.patch |  51 ++++
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 4 files changed, 106 insertions(+), 353 deletions(-)
 create mode 100644 srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index a5f4f3257d33..a96fe577e93b 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch b/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
new file mode 100644
index 000000000000..9c5553e92609
--- /dev/null
+++ b/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
@@ -0,0 +1,51 @@
+Temporary workaround for EAC bug.
+
+See: https://sourceware.org/bugzilla/show_bug.cgi?id=29456
+
+From 8e90e2cc5e57d7ca3a40602d278e9642a8b66716 Mon Sep 17 00:00:00 2001
+From: oreo639 <oreo6391@gmail.com>
+Date: Tue, 13 Sep 2022 14:30:35 -0700
+Subject: [PATCH] Revert "Do not use --hash-style=both for building glibc
+ shared objects"
+
+This reverts commit e47de5cb2d4dbecb58f569ed241e8e95c568f03c.
+---
+ Makeconfig     |  9 +++++++++
+ Makerules      |  7 +++++++
+ 5 files changed, 61 insertions(+)
+
+diff --git a/Makeconfig b/Makeconfig
+index ba70321af1..e2131d4389 100644
+--- a/Makeconfig
++++ b/Makeconfig
+@@ -371,6 +371,13 @@ dt-relr-ldflag =
+ no-dt-relr-ldflag =
+ endif
+ 
++# For the time being we unconditionally use 'both'.  At some time we
++# should declare statically linked code as 'out of luck' and compile
++# with --hash-style=gnu only.
++hashstyle-LDFLAGS = -Wl,--hash-style=both
++LDFLAGS.so += $(hashstyle-LDFLAGS)
++LDFLAGS-rtld += $(hashstyle-LDFLAGS)
++
+ ifeq (no,$(build-pie-default))
+ pie-default = $(no-pie-ccflag)
+ else # build-pie-default
+diff --git a/Makerules b/Makerules
+index d1e139d03c..44134e37ce 100644
+--- a/Makerules
++++ b/Makerules
+@@ -558,6 +558,9 @@ $(common-objpfx)shlib.lds: $(common-objpfx)config.make $(..)Makerules
+ 		  -Wl,--verbose 2>/dev/null | \
+ 	  sed > $@T \
+ 	      -e '/^=========/,/^=========/!d;/^=========/d' \
++		   -e 's/^.*\.gnu\.hash[ 	]*:.*$$/  .note.ABI-tag : { *(.note.ABI-tag) } &/' \
++		   -e '/^[ 	]*\.hash[ 	]*:.*$$/{h;d;}' \
++		   -e '/DATA_SEGMENT_ALIGN/{H;g}' \
+ 	      -e 's/^.*\*(\.dynbss).*$$/& \
+ 		 PROVIDE(__start___libc_freeres_ptrs = .); \
+ 		 *(__libc_freeres_ptrs) \
+-- 
+2.37.3
+
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From cef672339648a622c480cdcc1e58f067e4fb71be Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 07/36] musl: add support for SIGEV_THREAD_ID timers

https://git.musl-libc.org/cgit/musl/commit/?id=7c71792e87691451f2a6b76348e83ad1889f1dcb
---
 ...d-support-for-SIGEV_THREAD_ID-timers.patch | 74 +++++++++++++++++++
 srcpkgs/musl/template                         |  2 +-
 2 files changed, 75 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch

diff --git a/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
new file mode 100644
index 000000000000..e20dff5ba0d4
--- /dev/null
+++ b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
@@ -0,0 +1,74 @@
+From 7c71792e87691451f2a6b76348e83ad1889f1dcb Mon Sep 17 00:00:00 2001
+From: James Y Knight <jyknight@google.com>
+Date: Sun, 30 Jun 2019 21:55:20 -0400
+Subject: [PATCH] add support for SIGEV_THREAD_ID timers
+
+This is like SIGEV_SIGNAL, but targeted to a particular thread's
+tid, rather than the process.
+---
+ include/signal.h        | 16 +++++++++++++---
+ src/time/timer_create.c |  8 ++++++--
+ 2 files changed, 19 insertions(+), 5 deletions(-)
+
+diff --git a/include/signal.h b/include/signal.h
+index fbdf667b2..9ed929e4f 100644
+--- a/include/signal.h
++++ b/include/signal.h
+@@ -180,14 +180,24 @@ struct sigevent {
+ 	union sigval sigev_value;
+ 	int sigev_signo;
+ 	int sigev_notify;
+-	void (*sigev_notify_function)(union sigval);
+-	pthread_attr_t *sigev_notify_attributes;
+-	char __pad[56-3*sizeof(long)];
++	union {
++		char __pad[64 - 2*sizeof(int) - sizeof(union sigval)];
++		pid_t sigev_notify_thread_id;
++		struct {
++			void (*sigev_notify_function)(union sigval);
++			pthread_attr_t *sigev_notify_attributes;
++		} __sev_thread;
++	} __sev_fields;
+ };
+ 
++#define sigev_notify_thread_id __sev_fields.sigev_notify_thread_id
++#define sigev_notify_function __sev_fields.__sev_thread.sigev_notify_function
++#define sigev_notify_attributes __sev_fields.__sev_thread.sigev_notify_attributes
++
+ #define SIGEV_SIGNAL 0
+ #define SIGEV_NONE 1
+ #define SIGEV_THREAD 2
++#define SIGEV_THREAD_ID 4
+ 
+ int __libc_current_sigrtmin(void);
+ int __libc_current_sigrtmax(void);
+diff --git a/src/time/timer_create.c b/src/time/timer_create.c
+index 5ddfda278..4bef23905 100644
+--- a/src/time/timer_create.c
++++ b/src/time/timer_create.c
+@@ -71,11 +71,15 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 	switch (evp ? evp->sigev_notify : SIGEV_SIGNAL) {
+ 	case SIGEV_NONE:
+ 	case SIGEV_SIGNAL:
++	case SIGEV_THREAD_ID:
+ 		if (evp) {
+ 			ksev.sigev_value = evp->sigev_value;
+ 			ksev.sigev_signo = evp->sigev_signo;
+ 			ksev.sigev_notify = evp->sigev_notify;
+-			ksev.sigev_tid = 0;
++			if (evp->sigev_notify == SIGEV_THREAD_ID)
++				ksev.sigev_tid = evp->sigev_notify_thread_id;
++			else
++				ksev.sigev_tid = 0;
+ 			ksevp = &ksev;
+ 		}
+ 		if (syscall(SYS_timer_create, clk, ksevp, &timerid) < 0)
+@@ -107,7 +111,7 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 
+ 		ksev.sigev_value.sival_ptr = 0;
+ 		ksev.sigev_signo = SIGTIMER;
+-		ksev.sigev_notify = 4; /* SIGEV_THREAD_ID */
++		ksev.sigev_notify = SIGEV_THREAD_ID;
+ 		ksev.sigev_tid = td->tid;
+ 		if (syscall(SYS_timer_create, clk, &ksev, &timerid) < 0)
+ 			timerid = -1;
diff --git a/srcpkgs/musl/template b/srcpkgs/musl/template
index 34e6ed4fba6e..afb33cd868b5 100644
--- a/srcpkgs/musl/template
+++ b/srcpkgs/musl/template
@@ -2,7 +2,7 @@
 pkgname=musl
 reverts="1.2.0_1"
 version=1.1.24
-revision=11
+revision=12
 archs="*-musl"
 bootstrap=yes
 build_style=gnu-configure

From 2717edd0b6c761b52553bc1c86ae15c4cfbee915 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 08/36] gcc-multilib: update to 12.2.0.

---
 srcpkgs/gcc-multilib/template | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index f28eb237c287..ba9bafcadfd6 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,15 +3,15 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _majorver="${version%.*}"
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel
@@ -70,7 +70,7 @@ do_build() {
 	make ${makejobs}
 }
 do_install() {
-	local _pc_triplet=x86_64-pc-linux-gnu _version=${version%pre1}
+	local _pc_triplet=x86_64-pc-linux-gnu
 	# Install to a tempdir and then only copy relevant files.
 	cd ${wrksrc}
 	make DESTDIR=${wrksrc}/${pkgname}-build install
@@ -80,9 +80,9 @@ do_install() {
 	vmkdir usr/include/c++/${_majorver}/${_triplet}
 	vmkdir usr/lib/gcc/${_triplet}/${_majorver}
 
-	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${_version}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${version}/32 \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_majorver}/
-	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${_version}/${_pc_triplet}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${version}/${_pc_triplet}/32 \
 		${DESTDIR}/usr/include/c++/${_majorver}/${_triplet}
 
 	vinstall ${wrksrc}/host-${_pc_triplet}/gcc/specs 644 usr/lib/gcc/${_triplet}/${_majorver}

From 9d9b8d02edbc6f76b4a628019bb7a76958f2beb8 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 09/36] libgccjit: update to 12.2.0.

---
 srcpkgs/libgccjit/files/libgccjit-musl.patch | 63 --------------------
 srcpkgs/libgccjit/template                   | 24 +++-----
 2 files changed, 9 insertions(+), 78 deletions(-)
 delete mode 100644 srcpkgs/libgccjit/files/libgccjit-musl.patch

diff --git a/srcpkgs/libgccjit/files/libgccjit-musl.patch b/srcpkgs/libgccjit/files/libgccjit-musl.patch
deleted file mode 100644
index d2ed16928c82..000000000000
--- a/srcpkgs/libgccjit/files/libgccjit-musl.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-diff --git a/gcc/jit/jit-playback.c b/gcc/jit/jit-playback.c
-index 5bccf591a..35f5e35ef 100644
---- a/gcc/jit/jit-playback.c
-+++ b/gcc/jit/jit-playback.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -41,8 +43,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "diagnostic.h"
- #include "stmt.h"
- 
--#include <pthread.h>
--
- #include "jit-playback.h"
- #include "jit-result.h"
- #include "jit-builtins.h"
-diff --git a/gcc/jit/jit-recording.c b/gcc/jit/jit-recording.c
-index a237d574f..5785e3269 100644
---- a/gcc/jit/jit-recording.c
-+++ b/gcc/jit/jit-recording.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -25,8 +27,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "pretty-print.h"
- #include "toplev.h"
- 
--#include <pthread.h>
--
- #include "jit-builtins.h"
- #include "jit-recording.h"
- #include "jit-playback.h"
-diff --git a/gcc/jit/libgccjit.c b/gcc/jit/libgccjit.c
-index f9c33c63c..75f21d275 100644
---- a/gcc/jit/libgccjit.c
-+++ b/gcc/jit/libgccjit.c
-@@ -18,13 +18,13 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
- #include "timevar.h"
- #include "typed-splay-tree.h"
- #include "cppbuiltin.h"
--#include <pthread.h>
- 
- #include "libgccjit.h"
- #include "jit-recording.h"
diff --git a/srcpkgs/libgccjit/template b/srcpkgs/libgccjit/template
index 0b37c3ee9f8b..fde1affd54b7 100644
--- a/srcpkgs/libgccjit/template
+++ b/srcpkgs/libgccjit/template
@@ -3,18 +3,12 @@
 # which use the version number.
 
 pkgname=libgccjit
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
+version=12.2.0
 revision=1
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
-_majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 create_wrksrc=yes
 short_desc="Just-In-Time Compilation library for GCC"
 maintainer="Lane Biocini <lane@mailbox.org>"
@@ -22,16 +16,16 @@ homepage="https://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 nopie=yes
 lib32disabled=yes
 makedepends="zlib-devel"

From f32b98e8a3859db9cedf246897b6da8edd8dc542 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 10/36] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove -no-pie from build. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..5d40f0cdd8a6 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -53,6 +53,7 @@ _void_cross_build_binutils() {
 		--sbindir=/usr/bin \
 		--libdir=/usr/lib \
 		--libexecdir=/usr/lib \
+		--sysconfdir=/etc \
 		--target=${tgt} \
 		--with-sysroot=/usr/${tgt} \
 		--disable-nls \
@@ -60,7 +61,9 @@ _void_cross_build_binutils() {
 		--disable-multilib \
 		--disable-werror \
 		--disable-gold \
+		--disable-gprofng \
 		--enable-relro \
+		--enable-new-dtags \
 		--enable-plugins \
 		--enable-64-bit-bfd \
 		--enable-deterministic-archives \
@@ -132,6 +135,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -460,6 +464,14 @@ do_build() {
 	local binutils_ver linux_ver gcc_ver libc_ver libucontext_ver
 	local tgt=${sourcepkg/cross-}
 
+	export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}"
+	export CXXFLAGS="${CXXFLAGS/-D_FORTIFY_SOURCE=2/}"
+
+	# Disable explicit -fno-PIE, gcc/binutils/libc will figure this out itself.
+	export CFLAGS="${CFLAGS//-fno-PIE/}"
+	export CXXFLAGS="${CXXFLAGS//-fno-PIE/}"
+	export LDFLAGS="${LDFLAGS//-no-pie/}"
+
 	_void_cross_test_ver binutils
 	_void_cross_test_ver linux
 	_void_cross_test_ver gcc
@@ -625,6 +637,9 @@ do_install() {
 	# then remove it because it conflicts with libquadmath package
 	rm -rf ${DESTDIR}/${sysroot}/usr/lib/libquadmath.*
 
+	# Remove libdep linker plugin because it conflicts with system binutils
+	rm -f ${DESTDIR}/usr/lib/bfd-plugins/libdep*
+
 	# Remove leftover symlinks
 	rm -f ${DESTDIR}/usr/lib${XBPS_TARGET_WORDSIZE}
 	rm -f ${DESTDIR}/lib*

From eb8ff2a4323598ff8cba777eb7a4226d096c015c Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 11/36] qemu: remove broken patch

The necessary patch has been imported into musl so no need
to cast the sigevent struct to a more glibc-like one.
---
 .../musl-fix-sigevent-and-sigval_t.patch      | 27 -------------------
 1 file changed, 27 deletions(-)
 delete mode 100644 srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch

diff --git a/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch b/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch
deleted file mode 100644
index 4b4f1117c15f..000000000000
--- a/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-Note: Remove this patch with musl 1.2.2
-
---- a/linux-user/syscall.c
-+++ b/linux-user/syscall.c
-@@ -5020,10 +5020,21 @@
- #ifndef HAVE_SIGEV_NOTIFY_THREAD_ID
- #define sigev_notify_thread_id _sigev_un._tid
- #endif
- 
--static inline abi_long target_to_host_sigevent(struct sigevent *host_sevp,
-+struct host_sigevent {
-+    union sigval sigev_value;
-+    int sigev_signo;
-+    int sigev_notify;
-+    union {
-+       char _pad[64 - sizeof(int) * 2 - sizeof(union sigval)];
-+       int _tid;
-+    } _sigev_un;
-+};
-+
-+static inline abi_long target_to_host_sigevent(struct sigevent *sevp,
-                                                abi_ulong target_addr)
- {
-+    struct host_sigevent *host_sevp = (struct host_sigevent *) sevp;
-     struct target_sigevent *target_sevp;
- 
-     if (!lock_user_struct(VERIFY_READ, target_sevp, target_addr, 1)) {

From 7da2cf9f19678dd1a4bc66264c1fa57c69f6bd16 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 12/36] cross-aarch64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..9e6fb75c198d 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Leah Neukirchen <leah@vuxu.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 7ca0483cd74b81fcb97163b77d96bf1e4e482415 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 13/36] cross-aarch64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..ba14c96bccea 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 42c3e405351b9224effa6bddfde739306975b330 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 14/36] cross-arm-linux-gnueabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..5c774e16f430 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 02317278945065b8ec8cdc30f02a3f8f0a9a1b03 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 15/36] cross-arm-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..d6298ab639a4 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 621c01c3ed8a3d82ae0b7e31e1578af9de0b09d6 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 16/36] cross-arm-linux-musleabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..24df78e8fd8e 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 595cffe41537b45b9688227fc399bb4a11e902f4 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 17/36] cross-arm-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..8093700f909c 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 3da9230d40948cdb4e02f652c1f1759d7748de8f Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 18/36] cross-armv7l-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..92665326428b 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From aff80aa5f0c19bcc60fa643aa34db34312a72a8d Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 19/36] cross-armv7l-linux-musleabihf: update to gcc 12.2.0.

---
 .../cross-armv7l-linux-musleabihf/template    | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..e5af2c9ccbf2 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 290f73aa8951a248497f3f01bc4a92f86fd24a52 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 20/36] cross-i686-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-i686-linux-musl/template b/srcpkgs/cross-i686-linux-musl/template
index 8be16a230d8d..d624bb7a3254 100644
--- a/srcpkgs/cross-i686-linux-musl/template
+++ b/srcpkgs/cross-i686-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-i686-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-i686-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 539c3aa8b2dfe4798348183ec289511baaeb9431 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 21/36] cross-i686-pc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..6a9e54db807a 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,14 +1,15 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -16,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 0499291ce5ae9aa08fbc036efca3185a3530ccf3 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 22/36] cross-mips-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-musl/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..67a5c413396c 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From b3e8e8a2e91f895d943d93c80947ae3085d9ccce Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 23/36] cross-mips-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..bdf8600ce95b 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="hipperson0 <hipperson0@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From ade8120a224e40c2c3278bc9cc01ce641ceadfef Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 24/36] cross-mipsel-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..de49387d517b 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 204238db6ccc4695594ceeb9901ee5174f9092dd Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 25/36] cross-mipsel-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..b27ce6475a38 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From fd995a9f9c417a8700c6eb99ba0ba70a77d89b95 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 26/36] cross-powerpc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..79579e093b12 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From f62a047812561a19408158859b88ed0b18229c8c Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 27/36] cross-powerpc-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..9bb6acd359b6 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 29e8822e67fbc399fa5dec85981f46f459f70c49 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 28/36] cross-powerpc64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..2d153d00add6 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,16 +1,17 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
  --enable-targets=powerpc-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -18,12 +19,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From c0f8018a8a234879a1c7f2eab68d711f7dc2d8ff Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 29/36] cross-powerpc64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 016f18776a6d..e0848fe0bff7 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,30 +1,31 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From ee502adba976a2fbe5c372ba63b7bcf088f2f4e3 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 30/36] cross-powerpc64le-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 463d7e92d20d..8d8e010e15c0 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,16 +1,17 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
  --enable-targets=powerpcle-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -18,12 +19,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 0919a73fa514c7f0cfbbf81e7004c5d419418a80 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 31/36] cross-powerpc64le-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index c17a3cccfe29..0915e524545f 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,30 +1,31 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 7872f3b5f6b1009e50603c63f49f1a97b89b49b5 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 32/36] cross-powerpcle-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 9aede3c465ce..687be8a44c6c 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 
@@ -35,6 +36,8 @@ if [ "$XBPS_TARGET_MACHINE" = "ppcle" ]; then
 	broken="Can't build crosstoolchain to itself"
 fi
 
+broken="glibc uses big-endian specific instructions on 32-bit powerpc"
+
 cross-powerpcle-linux-gnu-libc_package() {
 	short_desc+=" - glibc files"
 	nostrip=yes

From c0724d6e04fe38247e4b47be68355934a2b0617f Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 33/36] cross-powerpcle-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index 045cfda987fe..bb984b9c42eb 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 90754bfab2c1dc8a8d15a91a81a7177db66bbb9b Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:30 -0800
Subject: [PATCH 34/36] cross-x86_64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 8918f3c22a1c..930aaf2a508b 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,14 +1,15 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -16,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 786a56fdb4a6c8c09b7159047267d2377e3243ac Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:30 -0800
Subject: [PATCH 35/36] cross-x86_64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..ac5b1c46ab82 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From aef3b58ead44d0f1e780f11323856634511a62f1 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Fri, 18 Nov 2022 02:01:19 -0800
Subject: [PATCH 36/36] cross-vpkg-dummy: update to 0.39.

---
 srcpkgs/cross-vpkg-dummy/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/cross-vpkg-dummy/template b/srcpkgs/cross-vpkg-dummy/template
index d83e38dc63ac..aeafb749dd5f 100644
--- a/srcpkgs/cross-vpkg-dummy/template
+++ b/srcpkgs/cross-vpkg-dummy/template
@@ -1,6 +1,6 @@
 # Template file for 'cross-vpkg-dummy'
 pkgname=cross-vpkg-dummy
-version=0.38
+version=0.39
 revision=1
 build_style=meta
 short_desc="Dummy meta-pkg for cross building packages with xbps-src"
@@ -54,8 +54,8 @@ conflicts="
 	gcc-objc++>=0"
 shlib_provides="
 	libgcc_s.so.1
-	libgnat-10.so
-	libgnarl-10.so
+	libgnat-12.so
+	libgnarl-12.so
 	libstdc++.so.6
 	libgfortran.so.5"
 

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (228 preceding siblings ...)
  2022-11-18 10:02 ` oreo639
@ 2022-11-19 10:50 ` oreo639
  2022-11-19 11:01 ` oreo639
                   ` (34 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-11-19 10:50 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5448 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.2.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.2.0

There is a list of failing builds here: https://github.com/void-linux/void-packages/issues/39809

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [x] llvm https://github.com/void-linux/void-packages/pull/38694
- [x] m4 https://github.com/void-linux/void-packages/pull/33730
- [x] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [x] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [x] libvirt https://github.com/void-linux/void-packages/pull/38842
- [x] syslinux https://github.com/void-linux/void-packages/pull/38876
- [x] efivar https://github.com/void-linux/void-packages/pull/38874
- [x] gpgme https://github.com/void-linux/void-packages/pull/38825

Known packages that needed to be fixed/updated for gcc12:
- [x] openssh https://github.com/void-linux/void-packages/pull/38849
- [x] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [x] doxygen https://github.com/void-linux/void-packages/pull/38846
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] libproxy https://github.com/void-linux/void-packages/pull/38818
- [x] exempi https://github.com/void-linux/void-packages/pull/38820
- [x] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [x] libunique1 https://github.com/void-linux/void-packages/pull/38848 or https://github.com/void-linux/void-packages/pull/38873
- [x] libwpd https://github.com/void-linux/void-packages/pull/38878
- [x] cglm https://github.com/void-linux/void-packages/pull/39748
- [x] coreboot-utils https://github.com/void-linux/void-packages/pull/39749
- [x] apl https://github.com/void-linux/void-packages/pull/39750
- [x] igt-gpu-tools https://github.com/void-linux/void-packages/pull/39780

Needs to be fixed/updated for binutils:
- [x] grub https://github.com/void-linux/void-packages/pull/38875
- [x] linux-tools https://github.com/void-linux/void-packages/pull/38877
- [x] kcov https://github.com/void-linux/void-packages/pull/39291

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [x] kde
- [x] lxde
- [x] lxqt

You can test the ISOs here:
https://drive.google.com/drive/folders/1ix92CYSLUP-KWjLxltdgG4e8Nu2JCY5n?usp=sharing

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 126857 bytes --]

From 21c63f31485bb40184a74b0a0e8232bcbf5a0e6a Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 01/36] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../fix-libcollector-without-java.patch       | 53 +++++++++++++++
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 25 ++++---
 4 files changed, 87 insertions(+), 117 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
 create mode 100644 srcpkgs/binutils/patches/fix-libcollector-without-java.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/fix-libcollector-without-java.patch b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
new file mode 100644
index 000000000000..54384875f358
--- /dev/null
+++ b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
@@ -0,0 +1,53 @@
+From 49ddd814ac1071af7c4f45d5f8398b91862f2c7f Mon Sep 17 00:00:00 2001
+From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
+Date: Wed, 17 Aug 2022 19:55:23 -0700
+Subject: [PATCH] gprofng: fix bug 29479 Collection fails when built without
+ java support
+
+gprofng/ChangeLog
+2022-08-17  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>
+
+	PR gprofng/29479
+	* libcollector/collector.c: Add #if defined(GPROFNG_JAVA_PROFILING) for
+	java specific code.
+	* libcollector/unwind.c: Likewise.
+---
+ gprofng/libcollector/collector.c | 2 ++
+ gprofng/libcollector/unwind.c    | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/gprofng/libcollector/collector.c b/gprofng/libcollector/collector.c
+index 93c9d3330de5..ceff2c1caccb 100644
+--- a/gprofng/libcollector/collector.c
++++ b/gprofng/libcollector/collector.c
+@@ -913,8 +913,10 @@ __collector_open_experiment (const char *exp, const char *params, sp_origin_t or
+   __collector_ext_unwind_key_init (1, NULL);
+ 
+   /* start java attach if suitable */
++#if defined(GPROFNG_JAVA_PROFILING)
+   if (exp_origin == SP_ORIGIN_DBX_ATTACH)
+     __collector_jprofile_start_attach ();
++#endif
+   start_sec_time = CALL_UTIL (time)(NULL);
+   __collector_start_time = collector_interface.getHiResTime ();
+   TprintfT (DBG_LT0, "\t__collector_open_experiment; resetting start_time\n");
+diff --git a/gprofng/libcollector/unwind.c b/gprofng/libcollector/unwind.c
+index 119243788020..f8e11823c81e 100644
+--- a/gprofng/libcollector/unwind.c
++++ b/gprofng/libcollector/unwind.c
+@@ -557,6 +557,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+   int size = max_frame_size;
+ 
+ #define MIN(a,b) ((a)<(b)?(a):(b))
++#if defined(GPROFNG_JAVA_PROFILING)
+   /* get Java info */
+   if (__collector_java_mode && __collector_java_asyncgetcalltrace_loaded && context && !pseudo_context)
+     {
+@@ -569,6 +570,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+ 	  size -= sz;
+ 	}
+     }
++#endif
+ 
+   /* get native stack */
+   if (context)
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..c355a5fc8016 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkgconf"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -35,15 +36,21 @@ do_configure() {
 	local conf
 
 	if [ "$CHROOT_READY" ]; then
-		conf+=" --with-debuginfod"
+		conf+=" --with-debuginfod --enable-shared"
 	else
-		conf+=" --without-debuginfod --disable-install-libbfd"
+		conf+=" --without-debuginfod --disable-shared --disable-install-libbfd"
 	fi
 	if [ "$CROSS_BUILD" ]; then
 		# we don't want --with-sysroot=${XBPS_CROSS_BASE} like gnu-configure
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	# gprofng currently only supports x86 and aarch64 glibc.
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64|i386|aarch64) conf+=" --enable-gprofng" ;;
+		*) conf+=" --disable-gprofng" ;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"
@@ -76,13 +83,14 @@ do_configure() {
 		--libdir=/usr/lib \
 		--mandir=/usr/share/man \
 		--infodir=/usr/share/info \
+		--sysconfdir=/etc \
 		--disable-werror \
-		--disable-shared \
 		--disable-nls \
 		--enable-threads \
 		--enable-plugins \
 		--enable-relro \
 		--enable-gold \
+		--enable-new-dtags \
 		--enable-deterministic-archives \
 		--enable-64-bit-bfd \
 		--enable-ld=default \
@@ -142,7 +150,8 @@ binutils-devel_package() {
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/*.a"
-		vmove "usr/lib/*.so"
+		vmove "usr/lib/libbfd.so"
+		vmove "usr/lib/libopcodes.so"
 	}
 }
 

From abab0f3636ece8dc55601c49bfdbafcf4e96c415 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 02/36] gdb: resolve conflict with binutils 2.39

---
 srcpkgs/gdb/template | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/gdb/template b/srcpkgs/gdb/template
index 9c5f17ffc519..b666348fea19 100644
--- a/srcpkgs/gdb/template
+++ b/srcpkgs/gdb/template
@@ -1,7 +1,7 @@
 # Template file for 'gdb'
 pkgname=gdb
 version=12.1
-revision=2
+revision=3
 build_style=gnu-configure
 pycompile_dirs="/usr/share/gdb/python"
 configure_args="--disable-werror --disable-nls --with-system-readline
@@ -48,7 +48,8 @@ vopt_conflict debuginfod static
 
 post_install() {
 	# resolve conflicts with binutils
-	rm -r ${DESTDIR}/usr/{include,lib,share/info/bfd.info*}
+	rm -rf ${DESTDIR}/usr/{include,lib}
+	rm -rf ${DESTDIR}/usr/share/info/{bfd,ctf-spec}.info*
 }
 
 gdb-common_package() {

From 3aa8ea4b04e34844b5d8c5c633712bd778bafca0 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 03/36] gcc: update to 12.2.0.

---
 common/shlibs                                 | 10 +--
 srcpkgs/gcc/files/gccgo-musl.patch            | 71 +++------------
 srcpkgs/gcc/files/libgnarl-musl.patch         | 18 ++--
 srcpkgs/gcc/files/libssp-musl.patch           | 10 +--
 srcpkgs/gcc/patches/libffi_gnulinux.patch     | 11 ---
 .../gcc/patches/libgcc-ibm128-no-tag.patch    | 10 ++-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |  2 +-
 srcpkgs/gcc/template                          | 87 +++++++++----------
 8 files changed, 80 insertions(+), 139 deletions(-)
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index 07296762fcc4..a5f4f3257d33 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.2.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.36 perl-5.36.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -857,8 +857,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.2.0_1
+libgnat-12.so libada-12.2.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1710,8 +1710,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.2.0_1
+libasan.so.8 libsanitizer-12.2.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..12ec68dd8aa3 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,14 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ b/libgo/go/runtime/os_linux.go
+@@ -365,7 +365,7 @@ func setThreadCPUProfiler(hz int32) {
+ 	var sevp _sigevent
+ 	sevp.sigev_notify = _SIGEV_THREAD_ID
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.__sev_fields))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index ab3643de4f98..a20af7c0ef2e 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,14 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
+version=12.2.0
+revision=1
+_minorver="${version%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 create_wrksrc=yes
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +18,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -52,8 +48,11 @@ if [ "$CHROOT_READY" ]; then
 	hostmakedepends="tar texinfo perl flex"
 else
 	_have_gccgo=no
+	# libzstd fails to link in bootstrap with glibc 2.36
+	# when zlib has been compiled with glibc 2.32.
+	LDFLAGS="-lzstd -pthread"
 fi
-makedepends="zlib-devel"
+makedepends="zlib-devel libzstd-devel"
 depends="binutils libgcc-devel-${version}_${revision}
  libstdc++-devel-${version}_${revision} libssp-devel-${version}_${revision}"
 checkdepends="dejagnu"
@@ -70,13 +69,13 @@ if [ "$build_option_gnatboot" ]; then
 	case "$XBPS_TARGET_MACHINE" in
 	x86_64)
 		_gnat_tarball="gnat-gpl-2017-x86_64-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/591c6d80c7a447af2deed1d7>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/9682e2e1f2f232ce03fe21d77b14c37a0de5649b?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" b942bcac20dea39748b39f8b624d9619f60a8dee2e8195dbe3829c835b0956e6"
 		build_options_default="gnatboot"
 		;;
 	i686)
 		_gnat_tarball="gnat-gpl-2014-x86-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/564b3e9dc8e196b040fbe248>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/c5e9e6fdff5cb77ed90cf8c62536653e27c0bed6?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" 3b693510f5d22a240abb3034934c1adbd80ccd6e4f61a4f491cc408fdfd9c042"
 		build_options_default="gnatboot"
 		;;
@@ -155,8 +154,8 @@ if [ "$CROSS_BUILD" ]; then
 fi
 
 post_extract() {
-	mv gcc-${version/pre/_pre}/* gcc-${version/pre/_pre}/.??* .
-	rmdir gcc-${version/pre/_pre}
+	mv gcc-${version}/* gcc-${version}/.??* .
+	rmdir gcc-${version}
 	mv gmp-${_gmp_version} gmp
 	mv mpfr-${_mpfr_version} mpfr
 	mv mpc-${_mpc_version} mpc
@@ -186,9 +185,9 @@ pre_configure() {
 	sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
 
 	if [ "$XBPS_TARGET_LIBC" = musl ]; then
-		patch -p1 -i ${FILESDIR}/libgnarl-musl.patch
-		patch -p1 -i ${FILESDIR}/libssp-musl.patch
-		patch -p1 -i ${FILESDIR}/gccgo-musl.patch
+		for p in ${FILESDIR}/*-musl.patch; do
+			patch -p1 -i $p
+		done
 	fi
 }
 do_configure() {
@@ -343,16 +342,16 @@ do_install() {
 
 	# Make version a symlink of major version to make all versions
 	# from the same series work automagically.
-	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver} \
+	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${version} \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver}
 	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver} \
-		${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}
+		${DESTDIR}/usr/lib/gcc/${_triplet}/${version}
 
 	# Ditto for c++ headers.
-	mv ${DESTDIR}/usr/include/c++/${_patchver} \
+	mv ${DESTDIR}/usr/include/c++/${version} \
 		${DESTDIR}/usr/include/c++/${_minorver}
 	ln -sfr ${DESTDIR}/usr/include/c++/${_minorver} \
-		${DESTDIR}/usr/include/c++/${_patchver}
+		${DESTDIR}/usr/include/c++/${version}
 
 	# cc symlink
 	ln -sfr ${DESTDIR}/usr/bin/gcc ${DESTDIR}/usr/bin/cc
@@ -361,7 +360,7 @@ do_install() {
 
 	# lto plugin symlink
 	vmkdir usr/lib/bfd-plugins
-	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}/liblto_plugin.so \
+	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${version}/liblto_plugin.so \
 		${DESTDIR}/usr/lib/bfd-plugins
 
 	# Remove "fixed" header
@@ -372,13 +371,9 @@ do_install() {
 	rm -f ${DESTDIR}/usr/lib/libffi*
 	rm -f ${DESTDIR}/usr/share/man/man3/ffi*
 
-	# Remove all python scripts in libdir.
-	rm -f ${DESTDIR}/usr/lib/*.py
-
-	# Remove more python stuff.
-	if [ -d ${DESTDIR}/usr/share/gcc-${_patchver}/python ]; then
-		rm -rf ${DESTDIR}/usr/share/gcc-${_patchver}/python
-	fi
+	# Move libstdc++ gdb helpers to location where gdb can autoload them
+	mkdir -p ${DESTDIR}/usr/share/gdb/auto-load/usr/lib
+	mv ${DESTDIR}/usr/lib/*.py ${DESTDIR}/usr/share/gdb/auto-load/usr/lib
 
 	# Install c89 and c99 wrappers and its manpages, from NetBSD.
 	for f in c89 c99; do
@@ -397,7 +392,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}
@@ -450,7 +445,7 @@ gcc-fortran_package() {
 		if [ "$CROSS_BUILD" ]; then
 			# A number of OMP modules are not built when cross
 			# compiling gcc. Copy them from the cross compiler.
-			local src="/usr/lib/gcc/${_triplet}/${_patchver}/finclude"
+			local src="/usr/lib/gcc/${_triplet}/${version}/finclude"
 			local dst="usr/lib/gcc/${_triplet}/${_minorver}/finclude"
 			for f in omp_lib.f90 omp_lib.h omp_lib.mod omp_lib_kinds.mod \
 				openacc.f90 openacc.mod openacc_kinds.mod openacc_lib.h; do
@@ -517,7 +512,7 @@ libgfortran_package() {
 	short_desc+=" - Fortran library"
 	pkg_install() {
 		vmove "usr/lib/libgfortran.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -538,7 +533,7 @@ libgo_package() {
 	nostrip=yes
 	pkg_install() {
 		vmove "usr/lib/libgo.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -554,7 +549,7 @@ libobjc_package() {
 	short_desc+=" - Objective-C library"
 	pkg_install() {
 		vmove "usr/lib/libobjc.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -573,7 +568,7 @@ libquadmath_package() {
 	short_desc+=" - quadmath library"
 	pkg_install() {
 		vmove "usr/lib/libquadmath.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -615,7 +610,7 @@ libgcc_package() {
 	noverifyrdeps=yes
 	pkg_install() {
 		vmove "usr/lib/libgcc_s.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -646,7 +641,7 @@ libgomp_package() {
 	short_desc+=" - OpenMP v4.0 library"
 	pkg_install() {
 		vmove "usr/lib/libgomp*.so.*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -701,7 +696,7 @@ libssp_package() {
 	short_desc+=" - SSP (StackSmashingProtection) library"
 	pkg_install() {
 		vmove "usr/lib/libssp.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -718,7 +713,9 @@ libstdc++-devel_package() {
 libstdc++_package() {
 	short_desc+=" - Standard C++ Library"
 	pkg_install() {
+		vmove usr/share/gdb
+		vmove usr/share/gcc-${version}/python
 		vmove "usr/lib/libstdc++.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }

From 4446b03ce5d16d118c4a7bf68bf72e0e17841eed Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 04/36] libtool: rebuild for gcc 12.2

---
 srcpkgs/libtool/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index fc5c53a9c3e9..aebad9294eef 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
 version=2.4.7
-revision=1
+revision=2
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"

From 467fa480506ef4afb2270e3bd274dce80f4c766b Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 05/36] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 7e01bbb851fd..d9618e3806ba 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 build_wrksrc=libiberty
 build_style=gnu-configure
@@ -10,7 +10,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From 51514db7e5c3ca159b1acf5a2e5f2136cc114182 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 06/36] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 ...e-hash-style-both-for-building-glibc.patch |  51 ++++
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 4 files changed, 106 insertions(+), 353 deletions(-)
 create mode 100644 srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index a5f4f3257d33..a96fe577e93b 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch b/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
new file mode 100644
index 000000000000..9c5553e92609
--- /dev/null
+++ b/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
@@ -0,0 +1,51 @@
+Temporary workaround for EAC bug.
+
+See: https://sourceware.org/bugzilla/show_bug.cgi?id=29456
+
+From 8e90e2cc5e57d7ca3a40602d278e9642a8b66716 Mon Sep 17 00:00:00 2001
+From: oreo639 <oreo6391@gmail.com>
+Date: Tue, 13 Sep 2022 14:30:35 -0700
+Subject: [PATCH] Revert "Do not use --hash-style=both for building glibc
+ shared objects"
+
+This reverts commit e47de5cb2d4dbecb58f569ed241e8e95c568f03c.
+---
+ Makeconfig     |  9 +++++++++
+ Makerules      |  7 +++++++
+ 5 files changed, 61 insertions(+)
+
+diff --git a/Makeconfig b/Makeconfig
+index ba70321af1..e2131d4389 100644
+--- a/Makeconfig
++++ b/Makeconfig
+@@ -371,6 +371,13 @@ dt-relr-ldflag =
+ no-dt-relr-ldflag =
+ endif
+ 
++# For the time being we unconditionally use 'both'.  At some time we
++# should declare statically linked code as 'out of luck' and compile
++# with --hash-style=gnu only.
++hashstyle-LDFLAGS = -Wl,--hash-style=both
++LDFLAGS.so += $(hashstyle-LDFLAGS)
++LDFLAGS-rtld += $(hashstyle-LDFLAGS)
++
+ ifeq (no,$(build-pie-default))
+ pie-default = $(no-pie-ccflag)
+ else # build-pie-default
+diff --git a/Makerules b/Makerules
+index d1e139d03c..44134e37ce 100644
+--- a/Makerules
++++ b/Makerules
+@@ -558,6 +558,9 @@ $(common-objpfx)shlib.lds: $(common-objpfx)config.make $(..)Makerules
+ 		  -Wl,--verbose 2>/dev/null | \
+ 	  sed > $@T \
+ 	      -e '/^=========/,/^=========/!d;/^=========/d' \
++		   -e 's/^.*\.gnu\.hash[ 	]*:.*$$/  .note.ABI-tag : { *(.note.ABI-tag) } &/' \
++		   -e '/^[ 	]*\.hash[ 	]*:.*$$/{h;d;}' \
++		   -e '/DATA_SEGMENT_ALIGN/{H;g}' \
+ 	      -e 's/^.*\*(\.dynbss).*$$/& \
+ 		 PROVIDE(__start___libc_freeres_ptrs = .); \
+ 		 *(__libc_freeres_ptrs) \
+-- 
+2.37.3
+
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From cef672339648a622c480cdcc1e58f067e4fb71be Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 07/36] musl: add support for SIGEV_THREAD_ID timers

https://git.musl-libc.org/cgit/musl/commit/?id=7c71792e87691451f2a6b76348e83ad1889f1dcb
---
 ...d-support-for-SIGEV_THREAD_ID-timers.patch | 74 +++++++++++++++++++
 srcpkgs/musl/template                         |  2 +-
 2 files changed, 75 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch

diff --git a/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
new file mode 100644
index 000000000000..e20dff5ba0d4
--- /dev/null
+++ b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
@@ -0,0 +1,74 @@
+From 7c71792e87691451f2a6b76348e83ad1889f1dcb Mon Sep 17 00:00:00 2001
+From: James Y Knight <jyknight@google.com>
+Date: Sun, 30 Jun 2019 21:55:20 -0400
+Subject: [PATCH] add support for SIGEV_THREAD_ID timers
+
+This is like SIGEV_SIGNAL, but targeted to a particular thread's
+tid, rather than the process.
+---
+ include/signal.h        | 16 +++++++++++++---
+ src/time/timer_create.c |  8 ++++++--
+ 2 files changed, 19 insertions(+), 5 deletions(-)
+
+diff --git a/include/signal.h b/include/signal.h
+index fbdf667b2..9ed929e4f 100644
+--- a/include/signal.h
++++ b/include/signal.h
+@@ -180,14 +180,24 @@ struct sigevent {
+ 	union sigval sigev_value;
+ 	int sigev_signo;
+ 	int sigev_notify;
+-	void (*sigev_notify_function)(union sigval);
+-	pthread_attr_t *sigev_notify_attributes;
+-	char __pad[56-3*sizeof(long)];
++	union {
++		char __pad[64 - 2*sizeof(int) - sizeof(union sigval)];
++		pid_t sigev_notify_thread_id;
++		struct {
++			void (*sigev_notify_function)(union sigval);
++			pthread_attr_t *sigev_notify_attributes;
++		} __sev_thread;
++	} __sev_fields;
+ };
+ 
++#define sigev_notify_thread_id __sev_fields.sigev_notify_thread_id
++#define sigev_notify_function __sev_fields.__sev_thread.sigev_notify_function
++#define sigev_notify_attributes __sev_fields.__sev_thread.sigev_notify_attributes
++
+ #define SIGEV_SIGNAL 0
+ #define SIGEV_NONE 1
+ #define SIGEV_THREAD 2
++#define SIGEV_THREAD_ID 4
+ 
+ int __libc_current_sigrtmin(void);
+ int __libc_current_sigrtmax(void);
+diff --git a/src/time/timer_create.c b/src/time/timer_create.c
+index 5ddfda278..4bef23905 100644
+--- a/src/time/timer_create.c
++++ b/src/time/timer_create.c
+@@ -71,11 +71,15 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 	switch (evp ? evp->sigev_notify : SIGEV_SIGNAL) {
+ 	case SIGEV_NONE:
+ 	case SIGEV_SIGNAL:
++	case SIGEV_THREAD_ID:
+ 		if (evp) {
+ 			ksev.sigev_value = evp->sigev_value;
+ 			ksev.sigev_signo = evp->sigev_signo;
+ 			ksev.sigev_notify = evp->sigev_notify;
+-			ksev.sigev_tid = 0;
++			if (evp->sigev_notify == SIGEV_THREAD_ID)
++				ksev.sigev_tid = evp->sigev_notify_thread_id;
++			else
++				ksev.sigev_tid = 0;
+ 			ksevp = &ksev;
+ 		}
+ 		if (syscall(SYS_timer_create, clk, ksevp, &timerid) < 0)
+@@ -107,7 +111,7 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 
+ 		ksev.sigev_value.sival_ptr = 0;
+ 		ksev.sigev_signo = SIGTIMER;
+-		ksev.sigev_notify = 4; /* SIGEV_THREAD_ID */
++		ksev.sigev_notify = SIGEV_THREAD_ID;
+ 		ksev.sigev_tid = td->tid;
+ 		if (syscall(SYS_timer_create, clk, &ksev, &timerid) < 0)
+ 			timerid = -1;
diff --git a/srcpkgs/musl/template b/srcpkgs/musl/template
index 34e6ed4fba6e..afb33cd868b5 100644
--- a/srcpkgs/musl/template
+++ b/srcpkgs/musl/template
@@ -2,7 +2,7 @@
 pkgname=musl
 reverts="1.2.0_1"
 version=1.1.24
-revision=11
+revision=12
 archs="*-musl"
 bootstrap=yes
 build_style=gnu-configure

From 2717edd0b6c761b52553bc1c86ae15c4cfbee915 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 08/36] gcc-multilib: update to 12.2.0.

---
 srcpkgs/gcc-multilib/template | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index f28eb237c287..ba9bafcadfd6 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,15 +3,15 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _majorver="${version%.*}"
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel
@@ -70,7 +70,7 @@ do_build() {
 	make ${makejobs}
 }
 do_install() {
-	local _pc_triplet=x86_64-pc-linux-gnu _version=${version%pre1}
+	local _pc_triplet=x86_64-pc-linux-gnu
 	# Install to a tempdir and then only copy relevant files.
 	cd ${wrksrc}
 	make DESTDIR=${wrksrc}/${pkgname}-build install
@@ -80,9 +80,9 @@ do_install() {
 	vmkdir usr/include/c++/${_majorver}/${_triplet}
 	vmkdir usr/lib/gcc/${_triplet}/${_majorver}
 
-	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${_version}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${version}/32 \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_majorver}/
-	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${_version}/${_pc_triplet}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${version}/${_pc_triplet}/32 \
 		${DESTDIR}/usr/include/c++/${_majorver}/${_triplet}
 
 	vinstall ${wrksrc}/host-${_pc_triplet}/gcc/specs 644 usr/lib/gcc/${_triplet}/${_majorver}

From 9d9b8d02edbc6f76b4a628019bb7a76958f2beb8 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 09/36] libgccjit: update to 12.2.0.

---
 srcpkgs/libgccjit/files/libgccjit-musl.patch | 63 --------------------
 srcpkgs/libgccjit/template                   | 24 +++-----
 2 files changed, 9 insertions(+), 78 deletions(-)
 delete mode 100644 srcpkgs/libgccjit/files/libgccjit-musl.patch

diff --git a/srcpkgs/libgccjit/files/libgccjit-musl.patch b/srcpkgs/libgccjit/files/libgccjit-musl.patch
deleted file mode 100644
index d2ed16928c82..000000000000
--- a/srcpkgs/libgccjit/files/libgccjit-musl.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-diff --git a/gcc/jit/jit-playback.c b/gcc/jit/jit-playback.c
-index 5bccf591a..35f5e35ef 100644
---- a/gcc/jit/jit-playback.c
-+++ b/gcc/jit/jit-playback.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -41,8 +43,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "diagnostic.h"
- #include "stmt.h"
- 
--#include <pthread.h>
--
- #include "jit-playback.h"
- #include "jit-result.h"
- #include "jit-builtins.h"
-diff --git a/gcc/jit/jit-recording.c b/gcc/jit/jit-recording.c
-index a237d574f..5785e3269 100644
---- a/gcc/jit/jit-recording.c
-+++ b/gcc/jit/jit-recording.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -25,8 +27,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "pretty-print.h"
- #include "toplev.h"
- 
--#include <pthread.h>
--
- #include "jit-builtins.h"
- #include "jit-recording.h"
- #include "jit-playback.h"
-diff --git a/gcc/jit/libgccjit.c b/gcc/jit/libgccjit.c
-index f9c33c63c..75f21d275 100644
---- a/gcc/jit/libgccjit.c
-+++ b/gcc/jit/libgccjit.c
-@@ -18,13 +18,13 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
- #include "timevar.h"
- #include "typed-splay-tree.h"
- #include "cppbuiltin.h"
--#include <pthread.h>
- 
- #include "libgccjit.h"
- #include "jit-recording.h"
diff --git a/srcpkgs/libgccjit/template b/srcpkgs/libgccjit/template
index 0b37c3ee9f8b..fde1affd54b7 100644
--- a/srcpkgs/libgccjit/template
+++ b/srcpkgs/libgccjit/template
@@ -3,18 +3,12 @@
 # which use the version number.
 
 pkgname=libgccjit
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
+version=12.2.0
 revision=1
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
-_majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 create_wrksrc=yes
 short_desc="Just-In-Time Compilation library for GCC"
 maintainer="Lane Biocini <lane@mailbox.org>"
@@ -22,16 +16,16 @@ homepage="https://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 nopie=yes
 lib32disabled=yes
 makedepends="zlib-devel"

From b91a162f1ecfec31d43cbdd547264a370fb70dff Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 10/36] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove -no-pie from build. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..1f0273e03166 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -53,6 +53,7 @@ _void_cross_build_binutils() {
 		--sbindir=/usr/bin \
 		--libdir=/usr/lib \
 		--libexecdir=/usr/lib \
+		--sysconfdir=/etc \
 		--target=${tgt} \
 		--with-sysroot=/usr/${tgt} \
 		--disable-nls \
@@ -60,7 +61,9 @@ _void_cross_build_binutils() {
 		--disable-multilib \
 		--disable-werror \
 		--disable-gold \
+		--disable-gprofng \
 		--enable-relro \
+		--enable-new-dtags \
 		--enable-plugins \
 		--enable-64-bit-bfd \
 		--enable-deterministic-archives \
@@ -91,6 +94,9 @@ _void_cross_build_bootstrap_gcc() {
 	# Do not run fixincludes
 	sed -i 's@./fixinc.sh@-c true@' Makefile.in
 
+	# Do not check system headers to determine clocale implementation
+	sed -i 's/#if (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined(__UCLIBC__)/#if 1/g' libstdc++-v3/configure
+
 	for f in ${XBPS_SRCPKGDIR}/gcc/patches/*.patch; do
 		_void_cross_apply_patch "$f"
 	done
@@ -132,6 +138,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -381,6 +388,7 @@ _void_cross_build_gcc() {
 		extra_args+=" --disable-gnu-unique-object"
 		extra_args+=" libat_cv_have_ifunc=no"
 	else
+		extra_args+=" --enable-clocale=gnu"
 		extra_args+=" --enable-gnu-unique-object"
 	fi
 
@@ -460,6 +468,14 @@ do_build() {
 	local binutils_ver linux_ver gcc_ver libc_ver libucontext_ver
 	local tgt=${sourcepkg/cross-}
 
+	export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}"
+	export CXXFLAGS="${CXXFLAGS/-D_FORTIFY_SOURCE=2/}"
+
+	# Disable explicit -fno-PIE, gcc/binutils/libc will figure this out itself.
+	export CFLAGS="${CFLAGS//-fno-PIE/}"
+	export CXXFLAGS="${CXXFLAGS//-fno-PIE/}"
+	export LDFLAGS="${LDFLAGS//-no-pie/}"
+
 	_void_cross_test_ver binutils
 	_void_cross_test_ver linux
 	_void_cross_test_ver gcc
@@ -625,6 +641,9 @@ do_install() {
 	# then remove it because it conflicts with libquadmath package
 	rm -rf ${DESTDIR}/${sysroot}/usr/lib/libquadmath.*
 
+	# Remove libdep linker plugin because it conflicts with system binutils
+	rm -f ${DESTDIR}/usr/lib/bfd-plugins/libdep*
+
 	# Remove leftover symlinks
 	rm -f ${DESTDIR}/usr/lib${XBPS_TARGET_WORDSIZE}
 	rm -f ${DESTDIR}/lib*

From 7bfc1ee3a089d7fc22e16f536fbb98bee27e4150 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 11/36] qemu: remove broken patch

The necessary patch has been imported into musl so no need
to cast the sigevent struct to a more glibc-like one.
---
 .../musl-fix-sigevent-and-sigval_t.patch      | 27 -------------------
 1 file changed, 27 deletions(-)
 delete mode 100644 srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch

diff --git a/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch b/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch
deleted file mode 100644
index 4b4f1117c15f..000000000000
--- a/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-Note: Remove this patch with musl 1.2.2
-
---- a/linux-user/syscall.c
-+++ b/linux-user/syscall.c
-@@ -5020,10 +5020,21 @@
- #ifndef HAVE_SIGEV_NOTIFY_THREAD_ID
- #define sigev_notify_thread_id _sigev_un._tid
- #endif
- 
--static inline abi_long target_to_host_sigevent(struct sigevent *host_sevp,
-+struct host_sigevent {
-+    union sigval sigev_value;
-+    int sigev_signo;
-+    int sigev_notify;
-+    union {
-+       char _pad[64 - sizeof(int) * 2 - sizeof(union sigval)];
-+       int _tid;
-+    } _sigev_un;
-+};
-+
-+static inline abi_long target_to_host_sigevent(struct sigevent *sevp,
-                                                abi_ulong target_addr)
- {
-+    struct host_sigevent *host_sevp = (struct host_sigevent *) sevp;
-     struct target_sigevent *target_sevp;
- 
-     if (!lock_user_struct(VERIFY_READ, target_sevp, target_addr, 1)) {

From 20b780a2250b607c230f3dc5368a4603ac81f302 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 12/36] cross-aarch64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..9e6fb75c198d 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Leah Neukirchen <leah@vuxu.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 2cca85c1126542f363ef822f4e1550bf0d106726 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 13/36] cross-aarch64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..ba14c96bccea 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 0aa2f4b1269b28f24fa6790eb343553a88fae129 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 14/36] cross-arm-linux-gnueabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..5c774e16f430 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From e170f506536434842d572767311c73bc64e24cfc Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 15/36] cross-arm-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..d6298ab639a4 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 02f82b4a81be79fb27c5d7dc3649edaaffb5bd02 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 16/36] cross-arm-linux-musleabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..24df78e8fd8e 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From b5dbe6f9ae3e03b57c484f894104b421dc3a24eb Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 17/36] cross-arm-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..8093700f909c 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From c34a346e8ffe5e699b435776e1edaff39c281dcd Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 18/36] cross-armv7l-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..92665326428b 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 719935bcc2e061db22043acabe2db1537c1e541b Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 19/36] cross-armv7l-linux-musleabihf: update to gcc 12.2.0.

---
 .../cross-armv7l-linux-musleabihf/template    | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..e5af2c9ccbf2 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 559adcc98136d5fb9ee160172eb78ce0a08d9399 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 20/36] cross-i686-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-i686-linux-musl/template b/srcpkgs/cross-i686-linux-musl/template
index 8be16a230d8d..d624bb7a3254 100644
--- a/srcpkgs/cross-i686-linux-musl/template
+++ b/srcpkgs/cross-i686-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-i686-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-i686-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 65b98c9354ce1c186e0e40f15205bb4b5ffa2629 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 21/36] cross-i686-pc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..6a9e54db807a 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,14 +1,15 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -16,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 3f5de44055ac3eb41397aa6f74d510ed71c93360 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 22/36] cross-mips-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-musl/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..67a5c413396c 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From fc571955a04801d8c3a3b47174fe0039059133bc Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 23/36] cross-mips-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..bdf8600ce95b 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="hipperson0 <hipperson0@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 0f7b81ed2700c6d7737b67ae8e1259acc2502f75 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 24/36] cross-mipsel-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..de49387d517b 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 5f48b48393e1dc616549f163b2a79d1256030718 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 25/36] cross-mipsel-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..b27ce6475a38 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 6dad5dcfd5522c663b5e5c3ef6842e34a5d69759 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 26/36] cross-powerpc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..79579e093b12 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 16c4655ad99c56b1ab64b52d99a942ac5d9a69fa Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 27/36] cross-powerpc-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..9bb6acd359b6 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From ed97c08ea7c3804588abe467428970ed33d71e5e Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 28/36] cross-powerpc64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..2d153d00add6 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,16 +1,17 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
  --enable-targets=powerpc-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -18,12 +19,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 19a6654de590c9cb3220c364fb3a038f1037a1fb Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 29/36] cross-powerpc64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 016f18776a6d..e0848fe0bff7 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,30 +1,31 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 3c05a39e3f2a2b776d6615c8427f1289e2ca300f Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 30/36] cross-powerpc64le-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 463d7e92d20d..8d8e010e15c0 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,16 +1,17 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
  --enable-targets=powerpcle-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -18,12 +19,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From b5c597e6d55946b79963c36a5ad2df33ec7bf8f2 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 31/36] cross-powerpc64le-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index c17a3cccfe29..0915e524545f 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,30 +1,31 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From b894751754eee56d923f2a1ef7d61d3bd99b271b Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 32/36] cross-powerpcle-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 9aede3c465ce..687be8a44c6c 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 
@@ -35,6 +36,8 @@ if [ "$XBPS_TARGET_MACHINE" = "ppcle" ]; then
 	broken="Can't build crosstoolchain to itself"
 fi
 
+broken="glibc uses big-endian specific instructions on 32-bit powerpc"
+
 cross-powerpcle-linux-gnu-libc_package() {
 	short_desc+=" - glibc files"
 	nostrip=yes

From 09c5e30a846898fea3ad7e0db86ea164cef76e38 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 33/36] cross-powerpcle-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index 045cfda987fe..bb984b9c42eb 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 1ad97d63779cc231f3074ac6fafbb672fe96b875 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:30 -0800
Subject: [PATCH 34/36] cross-x86_64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 8918f3c22a1c..930aaf2a508b 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,14 +1,15 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -16,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From f69f17be7ccc718d1ac2532fd598f62eeee11748 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:30 -0800
Subject: [PATCH 35/36] cross-x86_64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..ac5b1c46ab82 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 999f98ada3a221bdf606deacb25bd7f00a209a73 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Fri, 18 Nov 2022 02:01:19 -0800
Subject: [PATCH 36/36] cross-vpkg-dummy: update to 0.39.

---
 srcpkgs/cross-vpkg-dummy/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/cross-vpkg-dummy/template b/srcpkgs/cross-vpkg-dummy/template
index d83e38dc63ac..aeafb749dd5f 100644
--- a/srcpkgs/cross-vpkg-dummy/template
+++ b/srcpkgs/cross-vpkg-dummy/template
@@ -1,6 +1,6 @@
 # Template file for 'cross-vpkg-dummy'
 pkgname=cross-vpkg-dummy
-version=0.38
+version=0.39
 revision=1
 build_style=meta
 short_desc="Dummy meta-pkg for cross building packages with xbps-src"
@@ -54,8 +54,8 @@ conflicts="
 	gcc-objc++>=0"
 shlib_provides="
 	libgcc_s.so.1
-	libgnat-10.so
-	libgnarl-10.so
+	libgnat-12.so
+	libgnarl-12.so
 	libstdc++.so.6
 	libgfortran.so.5"
 

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (229 preceding siblings ...)
  2022-11-19 10:50 ` oreo639
@ 2022-11-19 11:01 ` oreo639
  2022-11-19 18:18 ` paper42
                   ` (33 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-11-19 11:01 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5448 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.2.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.2.0

There is a list of failing builds here: https://github.com/void-linux/void-packages/issues/39809

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [x] llvm https://github.com/void-linux/void-packages/pull/38694
- [x] m4 https://github.com/void-linux/void-packages/pull/33730
- [x] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [x] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [x] libvirt https://github.com/void-linux/void-packages/pull/38842
- [x] syslinux https://github.com/void-linux/void-packages/pull/38876
- [x] efivar https://github.com/void-linux/void-packages/pull/38874
- [x] gpgme https://github.com/void-linux/void-packages/pull/38825

Known packages that needed to be fixed/updated for gcc12:
- [x] openssh https://github.com/void-linux/void-packages/pull/38849
- [x] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [x] doxygen https://github.com/void-linux/void-packages/pull/38846
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] libproxy https://github.com/void-linux/void-packages/pull/38818
- [x] exempi https://github.com/void-linux/void-packages/pull/38820
- [x] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [x] libunique1 https://github.com/void-linux/void-packages/pull/38848 or https://github.com/void-linux/void-packages/pull/38873
- [x] libwpd https://github.com/void-linux/void-packages/pull/38878
- [x] cglm https://github.com/void-linux/void-packages/pull/39748
- [x] coreboot-utils https://github.com/void-linux/void-packages/pull/39749
- [x] apl https://github.com/void-linux/void-packages/pull/39750
- [x] igt-gpu-tools https://github.com/void-linux/void-packages/pull/39780

Needs to be fixed/updated for binutils:
- [x] grub https://github.com/void-linux/void-packages/pull/38875
- [x] linux-tools https://github.com/void-linux/void-packages/pull/38877
- [x] kcov https://github.com/void-linux/void-packages/pull/39291

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [x] kde
- [x] lxde
- [x] lxqt

You can test the ISOs here:
https://drive.google.com/drive/folders/1ix92CYSLUP-KWjLxltdgG4e8Nu2JCY5n?usp=sharing

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 126855 bytes --]

From 21c63f31485bb40184a74b0a0e8232bcbf5a0e6a Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 01/36] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../fix-libcollector-without-java.patch       | 53 +++++++++++++++
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 25 ++++---
 4 files changed, 87 insertions(+), 117 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
 create mode 100644 srcpkgs/binutils/patches/fix-libcollector-without-java.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/fix-libcollector-without-java.patch b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
new file mode 100644
index 000000000000..54384875f358
--- /dev/null
+++ b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
@@ -0,0 +1,53 @@
+From 49ddd814ac1071af7c4f45d5f8398b91862f2c7f Mon Sep 17 00:00:00 2001
+From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
+Date: Wed, 17 Aug 2022 19:55:23 -0700
+Subject: [PATCH] gprofng: fix bug 29479 Collection fails when built without
+ java support
+
+gprofng/ChangeLog
+2022-08-17  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>
+
+	PR gprofng/29479
+	* libcollector/collector.c: Add #if defined(GPROFNG_JAVA_PROFILING) for
+	java specific code.
+	* libcollector/unwind.c: Likewise.
+---
+ gprofng/libcollector/collector.c | 2 ++
+ gprofng/libcollector/unwind.c    | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/gprofng/libcollector/collector.c b/gprofng/libcollector/collector.c
+index 93c9d3330de5..ceff2c1caccb 100644
+--- a/gprofng/libcollector/collector.c
++++ b/gprofng/libcollector/collector.c
+@@ -913,8 +913,10 @@ __collector_open_experiment (const char *exp, const char *params, sp_origin_t or
+   __collector_ext_unwind_key_init (1, NULL);
+ 
+   /* start java attach if suitable */
++#if defined(GPROFNG_JAVA_PROFILING)
+   if (exp_origin == SP_ORIGIN_DBX_ATTACH)
+     __collector_jprofile_start_attach ();
++#endif
+   start_sec_time = CALL_UTIL (time)(NULL);
+   __collector_start_time = collector_interface.getHiResTime ();
+   TprintfT (DBG_LT0, "\t__collector_open_experiment; resetting start_time\n");
+diff --git a/gprofng/libcollector/unwind.c b/gprofng/libcollector/unwind.c
+index 119243788020..f8e11823c81e 100644
+--- a/gprofng/libcollector/unwind.c
++++ b/gprofng/libcollector/unwind.c
+@@ -557,6 +557,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+   int size = max_frame_size;
+ 
+ #define MIN(a,b) ((a)<(b)?(a):(b))
++#if defined(GPROFNG_JAVA_PROFILING)
+   /* get Java info */
+   if (__collector_java_mode && __collector_java_asyncgetcalltrace_loaded && context && !pseudo_context)
+     {
+@@ -569,6 +570,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+ 	  size -= sz;
+ 	}
+     }
++#endif
+ 
+   /* get native stack */
+   if (context)
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..c355a5fc8016 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkgconf"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -35,15 +36,21 @@ do_configure() {
 	local conf
 
 	if [ "$CHROOT_READY" ]; then
-		conf+=" --with-debuginfod"
+		conf+=" --with-debuginfod --enable-shared"
 	else
-		conf+=" --without-debuginfod --disable-install-libbfd"
+		conf+=" --without-debuginfod --disable-shared --disable-install-libbfd"
 	fi
 	if [ "$CROSS_BUILD" ]; then
 		# we don't want --with-sysroot=${XBPS_CROSS_BASE} like gnu-configure
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	# gprofng currently only supports x86 and aarch64 glibc.
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64|i386|aarch64) conf+=" --enable-gprofng" ;;
+		*) conf+=" --disable-gprofng" ;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"
@@ -76,13 +83,14 @@ do_configure() {
 		--libdir=/usr/lib \
 		--mandir=/usr/share/man \
 		--infodir=/usr/share/info \
+		--sysconfdir=/etc \
 		--disable-werror \
-		--disable-shared \
 		--disable-nls \
 		--enable-threads \
 		--enable-plugins \
 		--enable-relro \
 		--enable-gold \
+		--enable-new-dtags \
 		--enable-deterministic-archives \
 		--enable-64-bit-bfd \
 		--enable-ld=default \
@@ -142,7 +150,8 @@ binutils-devel_package() {
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/*.a"
-		vmove "usr/lib/*.so"
+		vmove "usr/lib/libbfd.so"
+		vmove "usr/lib/libopcodes.so"
 	}
 }
 

From abab0f3636ece8dc55601c49bfdbafcf4e96c415 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 02/36] gdb: resolve conflict with binutils 2.39

---
 srcpkgs/gdb/template | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/gdb/template b/srcpkgs/gdb/template
index 9c5f17ffc519..b666348fea19 100644
--- a/srcpkgs/gdb/template
+++ b/srcpkgs/gdb/template
@@ -1,7 +1,7 @@
 # Template file for 'gdb'
 pkgname=gdb
 version=12.1
-revision=2
+revision=3
 build_style=gnu-configure
 pycompile_dirs="/usr/share/gdb/python"
 configure_args="--disable-werror --disable-nls --with-system-readline
@@ -48,7 +48,8 @@ vopt_conflict debuginfod static
 
 post_install() {
 	# resolve conflicts with binutils
-	rm -r ${DESTDIR}/usr/{include,lib,share/info/bfd.info*}
+	rm -rf ${DESTDIR}/usr/{include,lib}
+	rm -rf ${DESTDIR}/usr/share/info/{bfd,ctf-spec}.info*
 }
 
 gdb-common_package() {

From 3aa8ea4b04e34844b5d8c5c633712bd778bafca0 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 03/36] gcc: update to 12.2.0.

---
 common/shlibs                                 | 10 +--
 srcpkgs/gcc/files/gccgo-musl.patch            | 71 +++------------
 srcpkgs/gcc/files/libgnarl-musl.patch         | 18 ++--
 srcpkgs/gcc/files/libssp-musl.patch           | 10 +--
 srcpkgs/gcc/patches/libffi_gnulinux.patch     | 11 ---
 .../gcc/patches/libgcc-ibm128-no-tag.patch    | 10 ++-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |  2 +-
 srcpkgs/gcc/template                          | 87 +++++++++----------
 8 files changed, 80 insertions(+), 139 deletions(-)
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index 07296762fcc4..a5f4f3257d33 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.2.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.36 perl-5.36.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -857,8 +857,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.2.0_1
+libgnat-12.so libada-12.2.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1710,8 +1710,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.2.0_1
+libasan.so.8 libsanitizer-12.2.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..12ec68dd8aa3 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,14 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ b/libgo/go/runtime/os_linux.go
+@@ -365,7 +365,7 @@ func setThreadCPUProfiler(hz int32) {
+ 	var sevp _sigevent
+ 	sevp.sigev_notify = _SIGEV_THREAD_ID
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.__sev_fields))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index ab3643de4f98..a20af7c0ef2e 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,14 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
+version=12.2.0
+revision=1
+_minorver="${version%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 create_wrksrc=yes
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +18,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -52,8 +48,11 @@ if [ "$CHROOT_READY" ]; then
 	hostmakedepends="tar texinfo perl flex"
 else
 	_have_gccgo=no
+	# libzstd fails to link in bootstrap with glibc 2.36
+	# when zlib has been compiled with glibc 2.32.
+	LDFLAGS="-lzstd -pthread"
 fi
-makedepends="zlib-devel"
+makedepends="zlib-devel libzstd-devel"
 depends="binutils libgcc-devel-${version}_${revision}
  libstdc++-devel-${version}_${revision} libssp-devel-${version}_${revision}"
 checkdepends="dejagnu"
@@ -70,13 +69,13 @@ if [ "$build_option_gnatboot" ]; then
 	case "$XBPS_TARGET_MACHINE" in
 	x86_64)
 		_gnat_tarball="gnat-gpl-2017-x86_64-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/591c6d80c7a447af2deed1d7>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/9682e2e1f2f232ce03fe21d77b14c37a0de5649b?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" b942bcac20dea39748b39f8b624d9619f60a8dee2e8195dbe3829c835b0956e6"
 		build_options_default="gnatboot"
 		;;
 	i686)
 		_gnat_tarball="gnat-gpl-2014-x86-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/564b3e9dc8e196b040fbe248>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/c5e9e6fdff5cb77ed90cf8c62536653e27c0bed6?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" 3b693510f5d22a240abb3034934c1adbd80ccd6e4f61a4f491cc408fdfd9c042"
 		build_options_default="gnatboot"
 		;;
@@ -155,8 +154,8 @@ if [ "$CROSS_BUILD" ]; then
 fi
 
 post_extract() {
-	mv gcc-${version/pre/_pre}/* gcc-${version/pre/_pre}/.??* .
-	rmdir gcc-${version/pre/_pre}
+	mv gcc-${version}/* gcc-${version}/.??* .
+	rmdir gcc-${version}
 	mv gmp-${_gmp_version} gmp
 	mv mpfr-${_mpfr_version} mpfr
 	mv mpc-${_mpc_version} mpc
@@ -186,9 +185,9 @@ pre_configure() {
 	sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
 
 	if [ "$XBPS_TARGET_LIBC" = musl ]; then
-		patch -p1 -i ${FILESDIR}/libgnarl-musl.patch
-		patch -p1 -i ${FILESDIR}/libssp-musl.patch
-		patch -p1 -i ${FILESDIR}/gccgo-musl.patch
+		for p in ${FILESDIR}/*-musl.patch; do
+			patch -p1 -i $p
+		done
 	fi
 }
 do_configure() {
@@ -343,16 +342,16 @@ do_install() {
 
 	# Make version a symlink of major version to make all versions
 	# from the same series work automagically.
-	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver} \
+	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${version} \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver}
 	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver} \
-		${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}
+		${DESTDIR}/usr/lib/gcc/${_triplet}/${version}
 
 	# Ditto for c++ headers.
-	mv ${DESTDIR}/usr/include/c++/${_patchver} \
+	mv ${DESTDIR}/usr/include/c++/${version} \
 		${DESTDIR}/usr/include/c++/${_minorver}
 	ln -sfr ${DESTDIR}/usr/include/c++/${_minorver} \
-		${DESTDIR}/usr/include/c++/${_patchver}
+		${DESTDIR}/usr/include/c++/${version}
 
 	# cc symlink
 	ln -sfr ${DESTDIR}/usr/bin/gcc ${DESTDIR}/usr/bin/cc
@@ -361,7 +360,7 @@ do_install() {
 
 	# lto plugin symlink
 	vmkdir usr/lib/bfd-plugins
-	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}/liblto_plugin.so \
+	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${version}/liblto_plugin.so \
 		${DESTDIR}/usr/lib/bfd-plugins
 
 	# Remove "fixed" header
@@ -372,13 +371,9 @@ do_install() {
 	rm -f ${DESTDIR}/usr/lib/libffi*
 	rm -f ${DESTDIR}/usr/share/man/man3/ffi*
 
-	# Remove all python scripts in libdir.
-	rm -f ${DESTDIR}/usr/lib/*.py
-
-	# Remove more python stuff.
-	if [ -d ${DESTDIR}/usr/share/gcc-${_patchver}/python ]; then
-		rm -rf ${DESTDIR}/usr/share/gcc-${_patchver}/python
-	fi
+	# Move libstdc++ gdb helpers to location where gdb can autoload them
+	mkdir -p ${DESTDIR}/usr/share/gdb/auto-load/usr/lib
+	mv ${DESTDIR}/usr/lib/*.py ${DESTDIR}/usr/share/gdb/auto-load/usr/lib
 
 	# Install c89 and c99 wrappers and its manpages, from NetBSD.
 	for f in c89 c99; do
@@ -397,7 +392,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}
@@ -450,7 +445,7 @@ gcc-fortran_package() {
 		if [ "$CROSS_BUILD" ]; then
 			# A number of OMP modules are not built when cross
 			# compiling gcc. Copy them from the cross compiler.
-			local src="/usr/lib/gcc/${_triplet}/${_patchver}/finclude"
+			local src="/usr/lib/gcc/${_triplet}/${version}/finclude"
 			local dst="usr/lib/gcc/${_triplet}/${_minorver}/finclude"
 			for f in omp_lib.f90 omp_lib.h omp_lib.mod omp_lib_kinds.mod \
 				openacc.f90 openacc.mod openacc_kinds.mod openacc_lib.h; do
@@ -517,7 +512,7 @@ libgfortran_package() {
 	short_desc+=" - Fortran library"
 	pkg_install() {
 		vmove "usr/lib/libgfortran.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -538,7 +533,7 @@ libgo_package() {
 	nostrip=yes
 	pkg_install() {
 		vmove "usr/lib/libgo.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -554,7 +549,7 @@ libobjc_package() {
 	short_desc+=" - Objective-C library"
 	pkg_install() {
 		vmove "usr/lib/libobjc.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -573,7 +568,7 @@ libquadmath_package() {
 	short_desc+=" - quadmath library"
 	pkg_install() {
 		vmove "usr/lib/libquadmath.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -615,7 +610,7 @@ libgcc_package() {
 	noverifyrdeps=yes
 	pkg_install() {
 		vmove "usr/lib/libgcc_s.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -646,7 +641,7 @@ libgomp_package() {
 	short_desc+=" - OpenMP v4.0 library"
 	pkg_install() {
 		vmove "usr/lib/libgomp*.so.*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -701,7 +696,7 @@ libssp_package() {
 	short_desc+=" - SSP (StackSmashingProtection) library"
 	pkg_install() {
 		vmove "usr/lib/libssp.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -718,7 +713,9 @@ libstdc++-devel_package() {
 libstdc++_package() {
 	short_desc+=" - Standard C++ Library"
 	pkg_install() {
+		vmove usr/share/gdb
+		vmove usr/share/gcc-${version}/python
 		vmove "usr/lib/libstdc++.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }

From 4446b03ce5d16d118c4a7bf68bf72e0e17841eed Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 04/36] libtool: rebuild for gcc 12.2

---
 srcpkgs/libtool/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index fc5c53a9c3e9..aebad9294eef 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
 version=2.4.7
-revision=1
+revision=2
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"

From 467fa480506ef4afb2270e3bd274dce80f4c766b Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 05/36] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 7e01bbb851fd..d9618e3806ba 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 build_wrksrc=libiberty
 build_style=gnu-configure
@@ -10,7 +10,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From 51514db7e5c3ca159b1acf5a2e5f2136cc114182 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 06/36] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 ...e-hash-style-both-for-building-glibc.patch |  51 ++++
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  62 ++--
 4 files changed, 106 insertions(+), 353 deletions(-)
 create mode 100644 srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index a5f4f3257d33..a96fe577e93b 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch b/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
new file mode 100644
index 000000000000..9c5553e92609
--- /dev/null
+++ b/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
@@ -0,0 +1,51 @@
+Temporary workaround for EAC bug.
+
+See: https://sourceware.org/bugzilla/show_bug.cgi?id=29456
+
+From 8e90e2cc5e57d7ca3a40602d278e9642a8b66716 Mon Sep 17 00:00:00 2001
+From: oreo639 <oreo6391@gmail.com>
+Date: Tue, 13 Sep 2022 14:30:35 -0700
+Subject: [PATCH] Revert "Do not use --hash-style=both for building glibc
+ shared objects"
+
+This reverts commit e47de5cb2d4dbecb58f569ed241e8e95c568f03c.
+---
+ Makeconfig     |  9 +++++++++
+ Makerules      |  7 +++++++
+ 5 files changed, 61 insertions(+)
+
+diff --git a/Makeconfig b/Makeconfig
+index ba70321af1..e2131d4389 100644
+--- a/Makeconfig
++++ b/Makeconfig
+@@ -371,6 +371,13 @@ dt-relr-ldflag =
+ no-dt-relr-ldflag =
+ endif
+ 
++# For the time being we unconditionally use 'both'.  At some time we
++# should declare statically linked code as 'out of luck' and compile
++# with --hash-style=gnu only.
++hashstyle-LDFLAGS = -Wl,--hash-style=both
++LDFLAGS.so += $(hashstyle-LDFLAGS)
++LDFLAGS-rtld += $(hashstyle-LDFLAGS)
++
+ ifeq (no,$(build-pie-default))
+ pie-default = $(no-pie-ccflag)
+ else # build-pie-default
+diff --git a/Makerules b/Makerules
+index d1e139d03c..44134e37ce 100644
+--- a/Makerules
++++ b/Makerules
+@@ -558,6 +558,9 @@ $(common-objpfx)shlib.lds: $(common-objpfx)config.make $(..)Makerules
+ 		  -Wl,--verbose 2>/dev/null | \
+ 	  sed > $@T \
+ 	      -e '/^=========/,/^=========/!d;/^=========/d' \
++		   -e 's/^.*\.gnu\.hash[ 	]*:.*$$/  .note.ABI-tag : { *(.note.ABI-tag) } &/' \
++		   -e '/^[ 	]*\.hash[ 	]*:.*$$/{h;d;}' \
++		   -e '/DATA_SEGMENT_ALIGN/{H;g}' \
+ 	      -e 's/^.*\*(\.dynbss).*$$/& \
+ 		 PROVIDE(__start___libc_freeres_ptrs = .); \
+ 		 *(__libc_freeres_ptrs) \
+-- 
+2.37.3
+
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From cef672339648a622c480cdcc1e58f067e4fb71be Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 07/36] musl: add support for SIGEV_THREAD_ID timers

https://git.musl-libc.org/cgit/musl/commit/?id=7c71792e87691451f2a6b76348e83ad1889f1dcb
---
 ...d-support-for-SIGEV_THREAD_ID-timers.patch | 74 +++++++++++++++++++
 srcpkgs/musl/template                         |  2 +-
 2 files changed, 75 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch

diff --git a/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
new file mode 100644
index 000000000000..e20dff5ba0d4
--- /dev/null
+++ b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
@@ -0,0 +1,74 @@
+From 7c71792e87691451f2a6b76348e83ad1889f1dcb Mon Sep 17 00:00:00 2001
+From: James Y Knight <jyknight@google.com>
+Date: Sun, 30 Jun 2019 21:55:20 -0400
+Subject: [PATCH] add support for SIGEV_THREAD_ID timers
+
+This is like SIGEV_SIGNAL, but targeted to a particular thread's
+tid, rather than the process.
+---
+ include/signal.h        | 16 +++++++++++++---
+ src/time/timer_create.c |  8 ++++++--
+ 2 files changed, 19 insertions(+), 5 deletions(-)
+
+diff --git a/include/signal.h b/include/signal.h
+index fbdf667b2..9ed929e4f 100644
+--- a/include/signal.h
++++ b/include/signal.h
+@@ -180,14 +180,24 @@ struct sigevent {
+ 	union sigval sigev_value;
+ 	int sigev_signo;
+ 	int sigev_notify;
+-	void (*sigev_notify_function)(union sigval);
+-	pthread_attr_t *sigev_notify_attributes;
+-	char __pad[56-3*sizeof(long)];
++	union {
++		char __pad[64 - 2*sizeof(int) - sizeof(union sigval)];
++		pid_t sigev_notify_thread_id;
++		struct {
++			void (*sigev_notify_function)(union sigval);
++			pthread_attr_t *sigev_notify_attributes;
++		} __sev_thread;
++	} __sev_fields;
+ };
+ 
++#define sigev_notify_thread_id __sev_fields.sigev_notify_thread_id
++#define sigev_notify_function __sev_fields.__sev_thread.sigev_notify_function
++#define sigev_notify_attributes __sev_fields.__sev_thread.sigev_notify_attributes
++
+ #define SIGEV_SIGNAL 0
+ #define SIGEV_NONE 1
+ #define SIGEV_THREAD 2
++#define SIGEV_THREAD_ID 4
+ 
+ int __libc_current_sigrtmin(void);
+ int __libc_current_sigrtmax(void);
+diff --git a/src/time/timer_create.c b/src/time/timer_create.c
+index 5ddfda278..4bef23905 100644
+--- a/src/time/timer_create.c
++++ b/src/time/timer_create.c
+@@ -71,11 +71,15 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 	switch (evp ? evp->sigev_notify : SIGEV_SIGNAL) {
+ 	case SIGEV_NONE:
+ 	case SIGEV_SIGNAL:
++	case SIGEV_THREAD_ID:
+ 		if (evp) {
+ 			ksev.sigev_value = evp->sigev_value;
+ 			ksev.sigev_signo = evp->sigev_signo;
+ 			ksev.sigev_notify = evp->sigev_notify;
+-			ksev.sigev_tid = 0;
++			if (evp->sigev_notify == SIGEV_THREAD_ID)
++				ksev.sigev_tid = evp->sigev_notify_thread_id;
++			else
++				ksev.sigev_tid = 0;
+ 			ksevp = &ksev;
+ 		}
+ 		if (syscall(SYS_timer_create, clk, ksevp, &timerid) < 0)
+@@ -107,7 +111,7 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 
+ 		ksev.sigev_value.sival_ptr = 0;
+ 		ksev.sigev_signo = SIGTIMER;
+-		ksev.sigev_notify = 4; /* SIGEV_THREAD_ID */
++		ksev.sigev_notify = SIGEV_THREAD_ID;
+ 		ksev.sigev_tid = td->tid;
+ 		if (syscall(SYS_timer_create, clk, &ksev, &timerid) < 0)
+ 			timerid = -1;
diff --git a/srcpkgs/musl/template b/srcpkgs/musl/template
index 34e6ed4fba6e..afb33cd868b5 100644
--- a/srcpkgs/musl/template
+++ b/srcpkgs/musl/template
@@ -2,7 +2,7 @@
 pkgname=musl
 reverts="1.2.0_1"
 version=1.1.24
-revision=11
+revision=12
 archs="*-musl"
 bootstrap=yes
 build_style=gnu-configure

From 2717edd0b6c761b52553bc1c86ae15c4cfbee915 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 08/36] gcc-multilib: update to 12.2.0.

---
 srcpkgs/gcc-multilib/template | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index f28eb237c287..ba9bafcadfd6 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,15 +3,15 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _majorver="${version%.*}"
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel
@@ -70,7 +70,7 @@ do_build() {
 	make ${makejobs}
 }
 do_install() {
-	local _pc_triplet=x86_64-pc-linux-gnu _version=${version%pre1}
+	local _pc_triplet=x86_64-pc-linux-gnu
 	# Install to a tempdir and then only copy relevant files.
 	cd ${wrksrc}
 	make DESTDIR=${wrksrc}/${pkgname}-build install
@@ -80,9 +80,9 @@ do_install() {
 	vmkdir usr/include/c++/${_majorver}/${_triplet}
 	vmkdir usr/lib/gcc/${_triplet}/${_majorver}
 
-	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${_version}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${version}/32 \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_majorver}/
-	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${_version}/${_pc_triplet}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${version}/${_pc_triplet}/32 \
 		${DESTDIR}/usr/include/c++/${_majorver}/${_triplet}
 
 	vinstall ${wrksrc}/host-${_pc_triplet}/gcc/specs 644 usr/lib/gcc/${_triplet}/${_majorver}

From 9d9b8d02edbc6f76b4a628019bb7a76958f2beb8 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 09/36] libgccjit: update to 12.2.0.

---
 srcpkgs/libgccjit/files/libgccjit-musl.patch | 63 --------------------
 srcpkgs/libgccjit/template                   | 24 +++-----
 2 files changed, 9 insertions(+), 78 deletions(-)
 delete mode 100644 srcpkgs/libgccjit/files/libgccjit-musl.patch

diff --git a/srcpkgs/libgccjit/files/libgccjit-musl.patch b/srcpkgs/libgccjit/files/libgccjit-musl.patch
deleted file mode 100644
index d2ed16928c82..000000000000
--- a/srcpkgs/libgccjit/files/libgccjit-musl.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-diff --git a/gcc/jit/jit-playback.c b/gcc/jit/jit-playback.c
-index 5bccf591a..35f5e35ef 100644
---- a/gcc/jit/jit-playback.c
-+++ b/gcc/jit/jit-playback.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -41,8 +43,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "diagnostic.h"
- #include "stmt.h"
- 
--#include <pthread.h>
--
- #include "jit-playback.h"
- #include "jit-result.h"
- #include "jit-builtins.h"
-diff --git a/gcc/jit/jit-recording.c b/gcc/jit/jit-recording.c
-index a237d574f..5785e3269 100644
---- a/gcc/jit/jit-recording.c
-+++ b/gcc/jit/jit-recording.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -25,8 +27,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "pretty-print.h"
- #include "toplev.h"
- 
--#include <pthread.h>
--
- #include "jit-builtins.h"
- #include "jit-recording.h"
- #include "jit-playback.h"
-diff --git a/gcc/jit/libgccjit.c b/gcc/jit/libgccjit.c
-index f9c33c63c..75f21d275 100644
---- a/gcc/jit/libgccjit.c
-+++ b/gcc/jit/libgccjit.c
-@@ -18,13 +18,13 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
- #include "timevar.h"
- #include "typed-splay-tree.h"
- #include "cppbuiltin.h"
--#include <pthread.h>
- 
- #include "libgccjit.h"
- #include "jit-recording.h"
diff --git a/srcpkgs/libgccjit/template b/srcpkgs/libgccjit/template
index 0b37c3ee9f8b..fde1affd54b7 100644
--- a/srcpkgs/libgccjit/template
+++ b/srcpkgs/libgccjit/template
@@ -3,18 +3,12 @@
 # which use the version number.
 
 pkgname=libgccjit
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
+version=12.2.0
 revision=1
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
-_majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 create_wrksrc=yes
 short_desc="Just-In-Time Compilation library for GCC"
 maintainer="Lane Biocini <lane@mailbox.org>"
@@ -22,16 +16,16 @@ homepage="https://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 nopie=yes
 lib32disabled=yes
 makedepends="zlib-devel"

From 274cd5ab235f6c705df53024285bb27acfabbb66 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 10/36] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove -no-pie from build. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..f7e02dbc48cb 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -53,6 +53,7 @@ _void_cross_build_binutils() {
 		--sbindir=/usr/bin \
 		--libdir=/usr/lib \
 		--libexecdir=/usr/lib \
+		--sysconfdir=/etc \
 		--target=${tgt} \
 		--with-sysroot=/usr/${tgt} \
 		--disable-nls \
@@ -60,7 +61,9 @@ _void_cross_build_binutils() {
 		--disable-multilib \
 		--disable-werror \
 		--disable-gold \
+		--disable-gprofng \
 		--enable-relro \
+		--enable-new-dtags \
 		--enable-plugins \
 		--enable-64-bit-bfd \
 		--enable-deterministic-archives \
@@ -91,6 +94,9 @@ _void_cross_build_bootstrap_gcc() {
 	# Do not run fixincludes
 	sed -i 's@./fixinc.sh@-c true@' Makefile.in
 
+	# Do not use system headers to determine clocale implementation
+	sed -i 's/#if (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined(__UCLIBC__)/#if 1/g' libstdc++-v3/configure
+
 	for f in ${XBPS_SRCPKGDIR}/gcc/patches/*.patch; do
 		_void_cross_apply_patch "$f"
 	done
@@ -132,6 +138,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -381,6 +388,7 @@ _void_cross_build_gcc() {
 		extra_args+=" --disable-gnu-unique-object"
 		extra_args+=" libat_cv_have_ifunc=no"
 	else
+		extra_args+=" --enable-clocale=gnu"
 		extra_args+=" --enable-gnu-unique-object"
 	fi
 
@@ -460,6 +468,14 @@ do_build() {
 	local binutils_ver linux_ver gcc_ver libc_ver libucontext_ver
 	local tgt=${sourcepkg/cross-}
 
+	export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}"
+	export CXXFLAGS="${CXXFLAGS/-D_FORTIFY_SOURCE=2/}"
+
+	# Disable explicit -fno-PIE, gcc/binutils/libc will figure this out itself.
+	export CFLAGS="${CFLAGS//-fno-PIE/}"
+	export CXXFLAGS="${CXXFLAGS//-fno-PIE/}"
+	export LDFLAGS="${LDFLAGS//-no-pie/}"
+
 	_void_cross_test_ver binutils
 	_void_cross_test_ver linux
 	_void_cross_test_ver gcc
@@ -625,6 +641,9 @@ do_install() {
 	# then remove it because it conflicts with libquadmath package
 	rm -rf ${DESTDIR}/${sysroot}/usr/lib/libquadmath.*
 
+	# Remove libdep linker plugin because it conflicts with system binutils
+	rm -f ${DESTDIR}/usr/lib/bfd-plugins/libdep*
+
 	# Remove leftover symlinks
 	rm -f ${DESTDIR}/usr/lib${XBPS_TARGET_WORDSIZE}
 	rm -f ${DESTDIR}/lib*

From c267a413655804db74a6af280ca96648e967da54 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 11/36] qemu: remove broken patch

The necessary patch has been imported into musl so no need
to cast the sigevent struct to a more glibc-like one.
---
 .../musl-fix-sigevent-and-sigval_t.patch      | 27 -------------------
 1 file changed, 27 deletions(-)
 delete mode 100644 srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch

diff --git a/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch b/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch
deleted file mode 100644
index 4b4f1117c15f..000000000000
--- a/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-Note: Remove this patch with musl 1.2.2
-
---- a/linux-user/syscall.c
-+++ b/linux-user/syscall.c
-@@ -5020,10 +5020,21 @@
- #ifndef HAVE_SIGEV_NOTIFY_THREAD_ID
- #define sigev_notify_thread_id _sigev_un._tid
- #endif
- 
--static inline abi_long target_to_host_sigevent(struct sigevent *host_sevp,
-+struct host_sigevent {
-+    union sigval sigev_value;
-+    int sigev_signo;
-+    int sigev_notify;
-+    union {
-+       char _pad[64 - sizeof(int) * 2 - sizeof(union sigval)];
-+       int _tid;
-+    } _sigev_un;
-+};
-+
-+static inline abi_long target_to_host_sigevent(struct sigevent *sevp,
-                                                abi_ulong target_addr)
- {
-+    struct host_sigevent *host_sevp = (struct host_sigevent *) sevp;
-     struct target_sigevent *target_sevp;
- 
-     if (!lock_user_struct(VERIFY_READ, target_sevp, target_addr, 1)) {

From ba6992238b6978775ca9d0bce993234a35045a5f Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 12/36] cross-aarch64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..9e6fb75c198d 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Leah Neukirchen <leah@vuxu.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From f8d83c6a69634dd03b43b53a330c7d0613dae006 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 13/36] cross-aarch64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..ba14c96bccea 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From c8b2e5915b15ebf62d913ca996cd4650b5318df8 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 14/36] cross-arm-linux-gnueabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..5c774e16f430 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From c71a22ad1c86ba27b2a24438ff1e855a544d6151 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 15/36] cross-arm-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..d6298ab639a4 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From fa2fba495e31240c9231db399cd3179b3547a217 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 16/36] cross-arm-linux-musleabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..24df78e8fd8e 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 9051f01076312c25cdee4decb3c59219557b5b64 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 17/36] cross-arm-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..8093700f909c 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 0404900f413fd6a98989a8300d69f58a2c419430 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 18/36] cross-armv7l-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..92665326428b 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 69e9a76a27745f2f1bbfbee13caa5cbdcb746cad Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 19/36] cross-armv7l-linux-musleabihf: update to gcc 12.2.0.

---
 .../cross-armv7l-linux-musleabihf/template    | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..e5af2c9ccbf2 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 561f9aa48a9ea48f0b9601cdd0dd2878b0bb6766 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 20/36] cross-i686-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-i686-linux-musl/template b/srcpkgs/cross-i686-linux-musl/template
index 8be16a230d8d..d624bb7a3254 100644
--- a/srcpkgs/cross-i686-linux-musl/template
+++ b/srcpkgs/cross-i686-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-i686-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-i686-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 79b3fd23c078ad960e1d59a7a5c10d51159ce1bc Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 21/36] cross-i686-pc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..6a9e54db807a 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,14 +1,15 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -16,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From c4cf2994e44f452e192607a1720f4812e919d48b Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 22/36] cross-mips-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-musl/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..67a5c413396c 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 9a2a699be5f23679aaf5db5b44d61d12004897d6 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 23/36] cross-mips-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..bdf8600ce95b 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="hipperson0 <hipperson0@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From ca3ea2c5a252fe0a07f5c2a47ae84f531fb8137a Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 24/36] cross-mipsel-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..de49387d517b 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 309c2abe9b20ed85be8ac6704c9ea70775dd6bc6 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 25/36] cross-mipsel-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..b27ce6475a38 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 06129c03605e61e3ea56f429411acc324d5b040d Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 26/36] cross-powerpc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..79579e093b12 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 07c963142b724fb7a500eee22c32f2ff486474e7 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 27/36] cross-powerpc-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..9bb6acd359b6 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 033604f98e62d7e055ef39515308fb9c8b0a7902 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 28/36] cross-powerpc64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..2d153d00add6 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,16 +1,17 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
  --enable-targets=powerpc-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -18,12 +19,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 8b5cb09c418b0095c583c08a9a8f861ea3a6491c Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 29/36] cross-powerpc64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 016f18776a6d..e0848fe0bff7 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,30 +1,31 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From d276fe0bcaa392cfa37792637a88b633b51edd04 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 30/36] cross-powerpc64le-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 463d7e92d20d..8d8e010e15c0 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,16 +1,17 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
  --enable-targets=powerpcle-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -18,12 +19,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 6f61fa028b082b57326b68c135075a6aa8ed9e85 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 31/36] cross-powerpc64le-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index c17a3cccfe29..0915e524545f 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,30 +1,31 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From ebf577fa8b663e33143467f33e7970b6ed770e3e Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 32/36] cross-powerpcle-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 9aede3c465ce..687be8a44c6c 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 
@@ -35,6 +36,8 @@ if [ "$XBPS_TARGET_MACHINE" = "ppcle" ]; then
 	broken="Can't build crosstoolchain to itself"
 fi
 
+broken="glibc uses big-endian specific instructions on 32-bit powerpc"
+
 cross-powerpcle-linux-gnu-libc_package() {
 	short_desc+=" - glibc files"
 	nostrip=yes

From d1141703acbb9226a5ec8eea993860d76f2c9491 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 33/36] cross-powerpcle-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index 045cfda987fe..bb984b9c42eb 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 6c4131a5541743c4d46904c79b92db4928676f44 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:30 -0800
Subject: [PATCH 34/36] cross-x86_64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 8918f3c22a1c..930aaf2a508b 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,14 +1,15 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -16,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 619305d73fba1a49c76bba9be41a9b6118e2ba64 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:30 -0800
Subject: [PATCH 35/36] cross-x86_64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..ac5b1c46ab82 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From e47f8b304745379bee5b2e21671cd15c1eaebc14 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Fri, 18 Nov 2022 02:01:19 -0800
Subject: [PATCH 36/36] cross-vpkg-dummy: update to 0.39.

---
 srcpkgs/cross-vpkg-dummy/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/cross-vpkg-dummy/template b/srcpkgs/cross-vpkg-dummy/template
index d83e38dc63ac..aeafb749dd5f 100644
--- a/srcpkgs/cross-vpkg-dummy/template
+++ b/srcpkgs/cross-vpkg-dummy/template
@@ -1,6 +1,6 @@
 # Template file for 'cross-vpkg-dummy'
 pkgname=cross-vpkg-dummy
-version=0.38
+version=0.39
 revision=1
 build_style=meta
 short_desc="Dummy meta-pkg for cross building packages with xbps-src"
@@ -54,8 +54,8 @@ conflicts="
 	gcc-objc++>=0"
 shlib_provides="
 	libgcc_s.so.1
-	libgnat-10.so
-	libgnarl-10.so
+	libgnat-12.so
+	libgnarl-12.so
 	libstdc++.so.6
 	libgfortran.so.5"
 

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (230 preceding siblings ...)
  2022-11-19 11:01 ` oreo639
@ 2022-11-19 18:18 ` paper42
  2022-11-19 20:09 ` paper42
                   ` (32 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: paper42 @ 2022-11-19 18:18 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 440 bytes --]

New comment by paper42 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1320939314

Comment:
glibc doesn't do patch releases, but they have a stable branch that contains many important fixes. Do you think we could just package that branch like for example Arch does? It seems to fix some packages not building: https://github.com/void-linux/void-packages/issues/39960#issuecomment-1319039741

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (231 preceding siblings ...)
  2022-11-19 18:18 ` paper42
@ 2022-11-19 20:09 ` paper42
  2022-11-19 22:37 ` [PR PATCH] [Updated] " oreo639
                   ` (31 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: paper42 @ 2022-11-19 20:09 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 255 bytes --]

New comment by paper42 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1320959880

Comment:
And please revbump mk-configure: https://github.com/void-linux/void-packages/issues/39960#issuecomment-1317659419

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (232 preceding siblings ...)
  2022-11-19 20:09 ` paper42
@ 2022-11-19 22:37 ` oreo639
  2022-11-19 22:39 ` oreo639
                   ` (30 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-11-19 22:37 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5448 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.2.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.2.0

There is a list of failing builds here: https://github.com/void-linux/void-packages/issues/39809

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [x] llvm https://github.com/void-linux/void-packages/pull/38694
- [x] m4 https://github.com/void-linux/void-packages/pull/33730
- [x] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [x] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [x] libvirt https://github.com/void-linux/void-packages/pull/38842
- [x] syslinux https://github.com/void-linux/void-packages/pull/38876
- [x] efivar https://github.com/void-linux/void-packages/pull/38874
- [x] gpgme https://github.com/void-linux/void-packages/pull/38825

Known packages that needed to be fixed/updated for gcc12:
- [x] openssh https://github.com/void-linux/void-packages/pull/38849
- [x] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [x] doxygen https://github.com/void-linux/void-packages/pull/38846
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] libproxy https://github.com/void-linux/void-packages/pull/38818
- [x] exempi https://github.com/void-linux/void-packages/pull/38820
- [x] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [x] libunique1 https://github.com/void-linux/void-packages/pull/38848 or https://github.com/void-linux/void-packages/pull/38873
- [x] libwpd https://github.com/void-linux/void-packages/pull/38878
- [x] cglm https://github.com/void-linux/void-packages/pull/39748
- [x] coreboot-utils https://github.com/void-linux/void-packages/pull/39749
- [x] apl https://github.com/void-linux/void-packages/pull/39750
- [x] igt-gpu-tools https://github.com/void-linux/void-packages/pull/39780

Needs to be fixed/updated for binutils:
- [x] grub https://github.com/void-linux/void-packages/pull/38875
- [x] linux-tools https://github.com/void-linux/void-packages/pull/38877
- [x] kcov https://github.com/void-linux/void-packages/pull/39291

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [x] kde
- [x] lxde
- [x] lxqt

You can test the ISOs here:
https://drive.google.com/drive/folders/1ix92CYSLUP-KWjLxltdgG4e8Nu2JCY5n?usp=sharing

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 520512 bytes --]

From 21c63f31485bb40184a74b0a0e8232bcbf5a0e6a Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 01/37] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../fix-libcollector-without-java.patch       | 53 +++++++++++++++
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 25 ++++---
 4 files changed, 87 insertions(+), 117 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
 create mode 100644 srcpkgs/binutils/patches/fix-libcollector-without-java.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/fix-libcollector-without-java.patch b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
new file mode 100644
index 000000000000..54384875f358
--- /dev/null
+++ b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
@@ -0,0 +1,53 @@
+From 49ddd814ac1071af7c4f45d5f8398b91862f2c7f Mon Sep 17 00:00:00 2001
+From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
+Date: Wed, 17 Aug 2022 19:55:23 -0700
+Subject: [PATCH] gprofng: fix bug 29479 Collection fails when built without
+ java support
+
+gprofng/ChangeLog
+2022-08-17  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>
+
+	PR gprofng/29479
+	* libcollector/collector.c: Add #if defined(GPROFNG_JAVA_PROFILING) for
+	java specific code.
+	* libcollector/unwind.c: Likewise.
+---
+ gprofng/libcollector/collector.c | 2 ++
+ gprofng/libcollector/unwind.c    | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/gprofng/libcollector/collector.c b/gprofng/libcollector/collector.c
+index 93c9d3330de5..ceff2c1caccb 100644
+--- a/gprofng/libcollector/collector.c
++++ b/gprofng/libcollector/collector.c
+@@ -913,8 +913,10 @@ __collector_open_experiment (const char *exp, const char *params, sp_origin_t or
+   __collector_ext_unwind_key_init (1, NULL);
+ 
+   /* start java attach if suitable */
++#if defined(GPROFNG_JAVA_PROFILING)
+   if (exp_origin == SP_ORIGIN_DBX_ATTACH)
+     __collector_jprofile_start_attach ();
++#endif
+   start_sec_time = CALL_UTIL (time)(NULL);
+   __collector_start_time = collector_interface.getHiResTime ();
+   TprintfT (DBG_LT0, "\t__collector_open_experiment; resetting start_time\n");
+diff --git a/gprofng/libcollector/unwind.c b/gprofng/libcollector/unwind.c
+index 119243788020..f8e11823c81e 100644
+--- a/gprofng/libcollector/unwind.c
++++ b/gprofng/libcollector/unwind.c
+@@ -557,6 +557,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+   int size = max_frame_size;
+ 
+ #define MIN(a,b) ((a)<(b)?(a):(b))
++#if defined(GPROFNG_JAVA_PROFILING)
+   /* get Java info */
+   if (__collector_java_mode && __collector_java_asyncgetcalltrace_loaded && context && !pseudo_context)
+     {
+@@ -569,6 +570,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+ 	  size -= sz;
+ 	}
+     }
++#endif
+ 
+   /* get native stack */
+   if (context)
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..c355a5fc8016 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkgconf"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -35,15 +36,21 @@ do_configure() {
 	local conf
 
 	if [ "$CHROOT_READY" ]; then
-		conf+=" --with-debuginfod"
+		conf+=" --with-debuginfod --enable-shared"
 	else
-		conf+=" --without-debuginfod --disable-install-libbfd"
+		conf+=" --without-debuginfod --disable-shared --disable-install-libbfd"
 	fi
 	if [ "$CROSS_BUILD" ]; then
 		# we don't want --with-sysroot=${XBPS_CROSS_BASE} like gnu-configure
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	# gprofng currently only supports x86 and aarch64 glibc.
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64|i386|aarch64) conf+=" --enable-gprofng" ;;
+		*) conf+=" --disable-gprofng" ;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"
@@ -76,13 +83,14 @@ do_configure() {
 		--libdir=/usr/lib \
 		--mandir=/usr/share/man \
 		--infodir=/usr/share/info \
+		--sysconfdir=/etc \
 		--disable-werror \
-		--disable-shared \
 		--disable-nls \
 		--enable-threads \
 		--enable-plugins \
 		--enable-relro \
 		--enable-gold \
+		--enable-new-dtags \
 		--enable-deterministic-archives \
 		--enable-64-bit-bfd \
 		--enable-ld=default \
@@ -142,7 +150,8 @@ binutils-devel_package() {
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/*.a"
-		vmove "usr/lib/*.so"
+		vmove "usr/lib/libbfd.so"
+		vmove "usr/lib/libopcodes.so"
 	}
 }
 

From abab0f3636ece8dc55601c49bfdbafcf4e96c415 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 02/37] gdb: resolve conflict with binutils 2.39

---
 srcpkgs/gdb/template | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/gdb/template b/srcpkgs/gdb/template
index 9c5f17ffc519..b666348fea19 100644
--- a/srcpkgs/gdb/template
+++ b/srcpkgs/gdb/template
@@ -1,7 +1,7 @@
 # Template file for 'gdb'
 pkgname=gdb
 version=12.1
-revision=2
+revision=3
 build_style=gnu-configure
 pycompile_dirs="/usr/share/gdb/python"
 configure_args="--disable-werror --disable-nls --with-system-readline
@@ -48,7 +48,8 @@ vopt_conflict debuginfod static
 
 post_install() {
 	# resolve conflicts with binutils
-	rm -r ${DESTDIR}/usr/{include,lib,share/info/bfd.info*}
+	rm -rf ${DESTDIR}/usr/{include,lib}
+	rm -rf ${DESTDIR}/usr/share/info/{bfd,ctf-spec}.info*
 }
 
 gdb-common_package() {

From 3aa8ea4b04e34844b5d8c5c633712bd778bafca0 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 03/37] gcc: update to 12.2.0.

---
 common/shlibs                                 | 10 +--
 srcpkgs/gcc/files/gccgo-musl.patch            | 71 +++------------
 srcpkgs/gcc/files/libgnarl-musl.patch         | 18 ++--
 srcpkgs/gcc/files/libssp-musl.patch           | 10 +--
 srcpkgs/gcc/patches/libffi_gnulinux.patch     | 11 ---
 .../gcc/patches/libgcc-ibm128-no-tag.patch    | 10 ++-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |  2 +-
 srcpkgs/gcc/template                          | 87 +++++++++----------
 8 files changed, 80 insertions(+), 139 deletions(-)
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index 07296762fcc4..a5f4f3257d33 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.2.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.36 perl-5.36.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -857,8 +857,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.2.0_1
+libgnat-12.so libada-12.2.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1710,8 +1710,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.2.0_1
+libasan.so.8 libsanitizer-12.2.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..12ec68dd8aa3 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,14 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ b/libgo/go/runtime/os_linux.go
+@@ -365,7 +365,7 @@ func setThreadCPUProfiler(hz int32) {
+ 	var sevp _sigevent
+ 	sevp.sigev_notify = _SIGEV_THREAD_ID
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.__sev_fields))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index ab3643de4f98..a20af7c0ef2e 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,14 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
+version=12.2.0
+revision=1
+_minorver="${version%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 create_wrksrc=yes
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +18,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -52,8 +48,11 @@ if [ "$CHROOT_READY" ]; then
 	hostmakedepends="tar texinfo perl flex"
 else
 	_have_gccgo=no
+	# libzstd fails to link in bootstrap with glibc 2.36
+	# when zlib has been compiled with glibc 2.32.
+	LDFLAGS="-lzstd -pthread"
 fi
-makedepends="zlib-devel"
+makedepends="zlib-devel libzstd-devel"
 depends="binutils libgcc-devel-${version}_${revision}
  libstdc++-devel-${version}_${revision} libssp-devel-${version}_${revision}"
 checkdepends="dejagnu"
@@ -70,13 +69,13 @@ if [ "$build_option_gnatboot" ]; then
 	case "$XBPS_TARGET_MACHINE" in
 	x86_64)
 		_gnat_tarball="gnat-gpl-2017-x86_64-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/591c6d80c7a447af2deed1d7>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/9682e2e1f2f232ce03fe21d77b14c37a0de5649b?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" b942bcac20dea39748b39f8b624d9619f60a8dee2e8195dbe3829c835b0956e6"
 		build_options_default="gnatboot"
 		;;
 	i686)
 		_gnat_tarball="gnat-gpl-2014-x86-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/564b3e9dc8e196b040fbe248>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/c5e9e6fdff5cb77ed90cf8c62536653e27c0bed6?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" 3b693510f5d22a240abb3034934c1adbd80ccd6e4f61a4f491cc408fdfd9c042"
 		build_options_default="gnatboot"
 		;;
@@ -155,8 +154,8 @@ if [ "$CROSS_BUILD" ]; then
 fi
 
 post_extract() {
-	mv gcc-${version/pre/_pre}/* gcc-${version/pre/_pre}/.??* .
-	rmdir gcc-${version/pre/_pre}
+	mv gcc-${version}/* gcc-${version}/.??* .
+	rmdir gcc-${version}
 	mv gmp-${_gmp_version} gmp
 	mv mpfr-${_mpfr_version} mpfr
 	mv mpc-${_mpc_version} mpc
@@ -186,9 +185,9 @@ pre_configure() {
 	sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
 
 	if [ "$XBPS_TARGET_LIBC" = musl ]; then
-		patch -p1 -i ${FILESDIR}/libgnarl-musl.patch
-		patch -p1 -i ${FILESDIR}/libssp-musl.patch
-		patch -p1 -i ${FILESDIR}/gccgo-musl.patch
+		for p in ${FILESDIR}/*-musl.patch; do
+			patch -p1 -i $p
+		done
 	fi
 }
 do_configure() {
@@ -343,16 +342,16 @@ do_install() {
 
 	# Make version a symlink of major version to make all versions
 	# from the same series work automagically.
-	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver} \
+	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${version} \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver}
 	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver} \
-		${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}
+		${DESTDIR}/usr/lib/gcc/${_triplet}/${version}
 
 	# Ditto for c++ headers.
-	mv ${DESTDIR}/usr/include/c++/${_patchver} \
+	mv ${DESTDIR}/usr/include/c++/${version} \
 		${DESTDIR}/usr/include/c++/${_minorver}
 	ln -sfr ${DESTDIR}/usr/include/c++/${_minorver} \
-		${DESTDIR}/usr/include/c++/${_patchver}
+		${DESTDIR}/usr/include/c++/${version}
 
 	# cc symlink
 	ln -sfr ${DESTDIR}/usr/bin/gcc ${DESTDIR}/usr/bin/cc
@@ -361,7 +360,7 @@ do_install() {
 
 	# lto plugin symlink
 	vmkdir usr/lib/bfd-plugins
-	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}/liblto_plugin.so \
+	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${version}/liblto_plugin.so \
 		${DESTDIR}/usr/lib/bfd-plugins
 
 	# Remove "fixed" header
@@ -372,13 +371,9 @@ do_install() {
 	rm -f ${DESTDIR}/usr/lib/libffi*
 	rm -f ${DESTDIR}/usr/share/man/man3/ffi*
 
-	# Remove all python scripts in libdir.
-	rm -f ${DESTDIR}/usr/lib/*.py
-
-	# Remove more python stuff.
-	if [ -d ${DESTDIR}/usr/share/gcc-${_patchver}/python ]; then
-		rm -rf ${DESTDIR}/usr/share/gcc-${_patchver}/python
-	fi
+	# Move libstdc++ gdb helpers to location where gdb can autoload them
+	mkdir -p ${DESTDIR}/usr/share/gdb/auto-load/usr/lib
+	mv ${DESTDIR}/usr/lib/*.py ${DESTDIR}/usr/share/gdb/auto-load/usr/lib
 
 	# Install c89 and c99 wrappers and its manpages, from NetBSD.
 	for f in c89 c99; do
@@ -397,7 +392,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}
@@ -450,7 +445,7 @@ gcc-fortran_package() {
 		if [ "$CROSS_BUILD" ]; then
 			# A number of OMP modules are not built when cross
 			# compiling gcc. Copy them from the cross compiler.
-			local src="/usr/lib/gcc/${_triplet}/${_patchver}/finclude"
+			local src="/usr/lib/gcc/${_triplet}/${version}/finclude"
 			local dst="usr/lib/gcc/${_triplet}/${_minorver}/finclude"
 			for f in omp_lib.f90 omp_lib.h omp_lib.mod omp_lib_kinds.mod \
 				openacc.f90 openacc.mod openacc_kinds.mod openacc_lib.h; do
@@ -517,7 +512,7 @@ libgfortran_package() {
 	short_desc+=" - Fortran library"
 	pkg_install() {
 		vmove "usr/lib/libgfortran.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -538,7 +533,7 @@ libgo_package() {
 	nostrip=yes
 	pkg_install() {
 		vmove "usr/lib/libgo.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -554,7 +549,7 @@ libobjc_package() {
 	short_desc+=" - Objective-C library"
 	pkg_install() {
 		vmove "usr/lib/libobjc.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -573,7 +568,7 @@ libquadmath_package() {
 	short_desc+=" - quadmath library"
 	pkg_install() {
 		vmove "usr/lib/libquadmath.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -615,7 +610,7 @@ libgcc_package() {
 	noverifyrdeps=yes
 	pkg_install() {
 		vmove "usr/lib/libgcc_s.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -646,7 +641,7 @@ libgomp_package() {
 	short_desc+=" - OpenMP v4.0 library"
 	pkg_install() {
 		vmove "usr/lib/libgomp*.so.*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -701,7 +696,7 @@ libssp_package() {
 	short_desc+=" - SSP (StackSmashingProtection) library"
 	pkg_install() {
 		vmove "usr/lib/libssp.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -718,7 +713,9 @@ libstdc++-devel_package() {
 libstdc++_package() {
 	short_desc+=" - Standard C++ Library"
 	pkg_install() {
+		vmove usr/share/gdb
+		vmove usr/share/gcc-${version}/python
 		vmove "usr/lib/libstdc++.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }

From 9630ea5c5b5da32f79ad03b0a63bc595d2ac352e Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 04/37] libtool: rebuild for gcc 12

---
 srcpkgs/libtool/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index fc5c53a9c3e9..aebad9294eef 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
 version=2.4.7
-revision=1
+revision=2
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"

From fa7abf1b102e47223556ecb39fb0f855b464159d Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 05/37] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 7e01bbb851fd..d9618e3806ba 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 build_wrksrc=libiberty
 build_style=gnu-configure
@@ -10,7 +10,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From cde9d8d1e6d7a3ed9d599e1796d0e534fcf0a2b9 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 06/37] glibc: update to 2.36.

---
 common/shlibs                                 |    60 +-
 ...e-hash-style-both-for-building-glibc.patch |    51 +
 srcpkgs/glibc/patches/git-updates.patch       | 10900 ++++++++++++++++
 .../glibc/patches/glibc-c-utf8-locale.patch   |   286 -
 srcpkgs/glibc/template                        |    66 +-
 5 files changed, 11010 insertions(+), 353 deletions(-)
 create mode 100644 srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
 create mode 100644 srcpkgs/glibc/patches/git-updates.patch
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index a5f4f3257d33..a96fe577e93b 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch b/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
new file mode 100644
index 000000000000..9c5553e92609
--- /dev/null
+++ b/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
@@ -0,0 +1,51 @@
+Temporary workaround for EAC bug.
+
+See: https://sourceware.org/bugzilla/show_bug.cgi?id=29456
+
+From 8e90e2cc5e57d7ca3a40602d278e9642a8b66716 Mon Sep 17 00:00:00 2001
+From: oreo639 <oreo6391@gmail.com>
+Date: Tue, 13 Sep 2022 14:30:35 -0700
+Subject: [PATCH] Revert "Do not use --hash-style=both for building glibc
+ shared objects"
+
+This reverts commit e47de5cb2d4dbecb58f569ed241e8e95c568f03c.
+---
+ Makeconfig     |  9 +++++++++
+ Makerules      |  7 +++++++
+ 5 files changed, 61 insertions(+)
+
+diff --git a/Makeconfig b/Makeconfig
+index ba70321af1..e2131d4389 100644
+--- a/Makeconfig
++++ b/Makeconfig
+@@ -371,6 +371,13 @@ dt-relr-ldflag =
+ no-dt-relr-ldflag =
+ endif
+ 
++# For the time being we unconditionally use 'both'.  At some time we
++# should declare statically linked code as 'out of luck' and compile
++# with --hash-style=gnu only.
++hashstyle-LDFLAGS = -Wl,--hash-style=both
++LDFLAGS.so += $(hashstyle-LDFLAGS)
++LDFLAGS-rtld += $(hashstyle-LDFLAGS)
++
+ ifeq (no,$(build-pie-default))
+ pie-default = $(no-pie-ccflag)
+ else # build-pie-default
+diff --git a/Makerules b/Makerules
+index d1e139d03c..44134e37ce 100644
+--- a/Makerules
++++ b/Makerules
+@@ -558,6 +558,9 @@ $(common-objpfx)shlib.lds: $(common-objpfx)config.make $(..)Makerules
+ 		  -Wl,--verbose 2>/dev/null | \
+ 	  sed > $@T \
+ 	      -e '/^=========/,/^=========/!d;/^=========/d' \
++		   -e 's/^.*\.gnu\.hash[ 	]*:.*$$/  .note.ABI-tag : { *(.note.ABI-tag) } &/' \
++		   -e '/^[ 	]*\.hash[ 	]*:.*$$/{h;d;}' \
++		   -e '/DATA_SEGMENT_ALIGN/{H;g}' \
+ 	      -e 's/^.*\*(\.dynbss).*$$/& \
+ 		 PROVIDE(__start___libc_freeres_ptrs = .); \
+ 		 *(__libc_freeres_ptrs) \
+-- 
+2.37.3
+
diff --git a/srcpkgs/glibc/patches/git-updates.patch b/srcpkgs/glibc/patches/git-updates.patch
new file mode 100644
index 000000000000..75551be32bb5
--- /dev/null
+++ b/srcpkgs/glibc/patches/git-updates.patch
@@ -0,0 +1,10900 @@
+From c3fda489cfdb2260f9fec706e6fd7259858c4467 Mon Sep 17 00:00:00 2001
+From: Tom Honermann <tom@honermann.net>
+Date: Sun, 24 Jul 2022 01:11:43 -0400
+Subject: [PATCH 01/72] stdlib: Suppress gcc diagnostic that char8_t is a
+ keyword in C++20 in uchar.h.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+gcc 13 issues the following diagnostic for the uchar.h header when the
+-Wc++20-compat option is enabled in C++ modes that do not enable char8_t
+as a builtin type (C++17 and earlier by default; subject to _GNU_SOURCE
+and the gcc -f[no-]char8_t option).
+  warning: identifier ‘char8_t’ is a keyword in C++20 [-Wc++20-compat]
+This change modifies the uchar.h header to suppress the diagnostic through
+the use of '#pragma GCC diagnostic' directives for gcc 10 and later (the
+-Wc++20-compat option was added in gcc version 10).  Unfortunately, a bug
+in gcc currently prevents those directives from having the intended effect
+as reported at https://gcc.gnu.org/PR106423.  A patch for that issue has
+been submitted and is available in the email thread archive linked below.
+  https://gcc.gnu.org/pipermail/gcc-patches/2022-July/598736.html
+
+(cherry picked from commit 825f84f133bd840347dc49229b6d831f07d04775)
+---
+ wcsmbs/uchar.h | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/wcsmbs/uchar.h b/wcsmbs/uchar.h
+index c37e8619a0..5f7139f279 100644
+--- a/wcsmbs/uchar.h
++++ b/wcsmbs/uchar.h
+@@ -34,8 +34,16 @@
+ /* Declare the C2x char8_t typedef in C2x modes, but only if the C++
+   __cpp_char8_t feature test macro is not defined.  */
+ #if __GLIBC_USE (ISOC2X) && !defined __cpp_char8_t
++#if __GNUC_PREREQ (10, 0) && defined __cplusplus
++/* Suppress the diagnostic regarding char8_t being a keyword in C++20.  */
++# pragma GCC diagnostic push
++# pragma GCC diagnostic ignored "-Wc++20-compat"
++#endif
+ /* Define the 8-bit character type.  */
+ typedef unsigned char char8_t;
++#if __GNUC_PREREQ (10, 0) && defined __cplusplus
++# pragma GCC diagnostic pop
++#endif
+ #endif
+ 
+ #ifndef __USE_ISOCXX11
+-- 
+2.38.1
+
+
+From 33f1b4c1452b33991e670f636ebe98b90a405e10 Mon Sep 17 00:00:00 2001
+From: "H.J. Lu" <hjl.tools@gmail.com>
+Date: Fri, 29 Jul 2022 10:50:56 -0700
+Subject: [PATCH 02/72] wcsmbs: Add missing test-c8rtomb/test-mbrtoc8
+ dependency
+
+Make test-c8rtomb.out and test-mbrtoc8.out depend on $(gen-locales) for
+
+  xsetlocale (LC_ALL, "de_DE.UTF-8");
+  xsetlocale (LC_ALL, "zh_HK.BIG5-HKSCS");
+
+Reviewed-by: Sunil K Pandey <skpgkp2@gmail.com>
+Reviewed-by: Carlos O'Donell <carlos@redhat.com>
+(cherry picked from commit e03f5ccd6cc8f829416156eac75acee501626c1f)
+---
+ wcsmbs/Makefile | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/wcsmbs/Makefile b/wcsmbs/Makefile
+index e6b9e8743a..3d19d5556f 100644
+--- a/wcsmbs/Makefile
++++ b/wcsmbs/Makefile
+@@ -73,6 +73,8 @@ $(objpfx)tst-wcstol-locale.out: $(gen-locales)
+ $(objpfx)tst-wcstod-nan-locale.out: $(gen-locales)
+ $(objpfx)tst-c16-surrogate.out: $(gen-locales)
+ $(objpfx)tst-c32-state.out: $(gen-locales)
++$(objpfx)test-c8rtomb.out: $(gen-locales)
++$(objpfx)test-mbrtoc8.out: $(gen-locales)
+ endif
+ 
+ $(objpfx)tst-wcstod-round: $(libm)
+-- 
+2.38.1
+
+
+From c74bb93cfdb04d49155b0e30983a3c866167bbca Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Thu, 4 Aug 2022 17:54:48 +0200
+Subject: [PATCH 03/72] dlfcn: Pass caller pointer to static dlopen
+ implementation (bug 29446)
+
+Fixes commit 0c1c3a771eceec46e66ce1183cf988e2303bd373 ("dlfcn: Move
+dlopen into libc").
+
+(cherry picked from commit ed0185e4129130cbe081c221efb758fb400623ce)
+---
+ NEWS           | 7 +++++++
+ dlfcn/dlopen.c | 2 +-
+ 2 files changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/NEWS b/NEWS
+index f61e521fc8..15f3dd2cdb 100644
+--- a/NEWS
++++ b/NEWS
+@@ -4,6 +4,13 @@ See the end for copying conditions.
+ 
+ Please send GNU C library bug reports via <https://sourceware.org/bugzilla/>
+ using `glibc' in the "product" field.
++\f
++Version 2.36.1
++
++The following bugs are resolved with this release:
++
++  [29446] _dlopen now ignores dl_caller argument in static mode
++
+ \f
+ Version 2.36
+ 
+diff --git a/dlfcn/dlopen.c b/dlfcn/dlopen.c
+index 2696dde4b1..9b07b4e132 100644
+--- a/dlfcn/dlopen.c
++++ b/dlfcn/dlopen.c
+@@ -90,7 +90,7 @@ compat_symbol (libdl, ___dlopen, dlopen, GLIBC_2_1);
+ void *
+ __dlopen (const char *file, int mode, void *dl_caller)
+ {
+-  return dlopen_implementation (file, mode, RETURN_ADDRESS (0));
++  return dlopen_implementation (file, mode, dl_caller);
+ }
+ 
+ void *
+-- 
+2.38.1
+
+
+From ac47d8f6cf9744139adb12f540fb9cc610cac579 Mon Sep 17 00:00:00 2001
+From: Joseph Myers <joseph@codesourcery.com>
+Date: Tue, 2 Aug 2022 21:05:07 +0000
+Subject: [PATCH 04/72] Update syscall lists for Linux 5.19
+
+Linux 5.19 has no new syscalls, but enables memfd_secret in the uapi
+headers for RISC-V.  Update the version number in syscall-names.list
+to reflect that it is still current for 5.19 and regenerate the
+arch-syscall.h headers with build-many-glibcs.py update-syscalls.
+
+Tested with build-many-glibcs.py.
+
+(cherry picked from commit fccadcdf5bed7ee67a6cef4714e0b477d6c8472c)
+---
+ sysdeps/unix/sysv/linux/riscv/rv32/arch-syscall.h | 1 +
+ sysdeps/unix/sysv/linux/riscv/rv64/arch-syscall.h | 1 +
+ sysdeps/unix/sysv/linux/syscall-names.list        | 4 ++--
+ 3 files changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/arch-syscall.h b/sysdeps/unix/sysv/linux/riscv/rv32/arch-syscall.h
+index bf4be80f8d..202520ee25 100644
+--- a/sysdeps/unix/sysv/linux/riscv/rv32/arch-syscall.h
++++ b/sysdeps/unix/sysv/linux/riscv/rv32/arch-syscall.h
+@@ -122,6 +122,7 @@
+ #define __NR_mbind 235
+ #define __NR_membarrier 283
+ #define __NR_memfd_create 279
++#define __NR_memfd_secret 447
+ #define __NR_migrate_pages 238
+ #define __NR_mincore 232
+ #define __NR_mkdirat 34
+diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/arch-syscall.h b/sysdeps/unix/sysv/linux/riscv/rv64/arch-syscall.h
+index d656aedcc2..4e65f337d4 100644
+--- a/sysdeps/unix/sysv/linux/riscv/rv64/arch-syscall.h
++++ b/sysdeps/unix/sysv/linux/riscv/rv64/arch-syscall.h
+@@ -127,6 +127,7 @@
+ #define __NR_mbind 235
+ #define __NR_membarrier 283
+ #define __NR_memfd_create 279
++#define __NR_memfd_secret 447
+ #define __NR_migrate_pages 238
+ #define __NR_mincore 232
+ #define __NR_mkdirat 34
+diff --git a/sysdeps/unix/sysv/linux/syscall-names.list b/sysdeps/unix/sysv/linux/syscall-names.list
+index 6c7b2f7011..028ad3107a 100644
+--- a/sysdeps/unix/sysv/linux/syscall-names.list
++++ b/sysdeps/unix/sysv/linux/syscall-names.list
+@@ -21,8 +21,8 @@
+ # This file can list all potential system calls.  The names are only
+ # used if the installed kernel headers also provide them.
+ 
+-# The list of system calls is current as of Linux 5.18.
+-kernel 5.18
++# The list of system calls is current as of Linux 5.19.
++kernel 5.19
+ 
+ FAST_atomic_update
+ FAST_cmpxchg
+-- 
+2.38.1
+
+
+From 302bc33bc53c787da6e74162a7092e9c0fb964a8 Mon Sep 17 00:00:00 2001
+From: Noah Goldstein <goldstein.w.n@gmail.com>
+Date: Mon, 8 Aug 2022 11:26:22 +0800
+Subject: [PATCH 05/72] elf: Replace `strcpy` call with `memcpy` [BZ #29454]
+
+GCC normally does this optimization for us in
+strlen_pass::handle_builtin_strcpy but only for optimized
+build. To avoid needing to include strcpy.S in the rtld build to
+support the debug build, just do the optimization by hand.
+
+(cherry picked from commit 483cfe1a6a33d6335b1901581b41040d2d412511)
+---
+ elf/dl-cache.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/elf/dl-cache.c b/elf/dl-cache.c
+index 8bbf110d02..b97c17b3a9 100644
+--- a/elf/dl-cache.c
++++ b/elf/dl-cache.c
+@@ -509,8 +509,9 @@ _dl_load_cache_lookup (const char *name)
+      we are accessing. Therefore we must make the copy of the
+      mapping data without using malloc.  */
+   char *temp;
+-  temp = alloca (strlen (best) + 1);
+-  strcpy (temp, best);
++  size_t best_len = strlen (best) + 1;
++  temp = alloca (best_len);
++  memcpy (temp, best, best_len);
+   return __strdup (temp);
+ }
+ 
+-- 
+2.38.1
+
+
+From e982657073c4db21459ffd9e17bc505b1d64b876 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Mon, 15 Aug 2022 16:43:59 +0200
+Subject: [PATCH 06/72] Linux: Terminate subprocess on late failure in
+ tst-pidfd (bug 29485)
+
+Reviewed-by: Carlos O'Donell <carlos@redhat.com>
+(cherry picked from commit f82e05ebb295cadd35f7372f652c72264da810ad)
+---
+ NEWS                                | 1 +
+ sysdeps/unix/sysv/linux/tst-pidfd.c | 7 +++++--
+ 2 files changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/NEWS b/NEWS
+index 15f3dd2cdb..f8fb8db510 100644
+--- a/NEWS
++++ b/NEWS
+@@ -10,6 +10,7 @@ Version 2.36.1
+ The following bugs are resolved with this release:
+ 
+   [29446] _dlopen now ignores dl_caller argument in static mode
++  [29485] Linux: Terminate subprocess on late failure in tst-pidfd
+ 
+ \f
+ Version 2.36
+diff --git a/sysdeps/unix/sysv/linux/tst-pidfd.c b/sysdeps/unix/sysv/linux/tst-pidfd.c
+index 037af22290..5711d1c312 100644
+--- a/sysdeps/unix/sysv/linux/tst-pidfd.c
++++ b/sysdeps/unix/sysv/linux/tst-pidfd.c
+@@ -147,8 +147,11 @@ do_test (void)
+        may be denied if the process doesn't have CAP_SYS_PTRACE or
+        if a LSM security_ptrace_access_check denies access.  */
+     if (fd == -1 && errno == EPERM)
+-      FAIL_UNSUPPORTED ("don't have permission to use pidfd_getfd on pidfd, "
+-			"skipping test");
++      {
++	TEST_COMPARE (pidfd_send_signal (pidfd, SIGKILL, NULL, 0), 0);
++	FAIL_UNSUPPORTED ("don't have permission to use pidfd_getfd on pidfd, "
++			  "skipping test");
++      }
+     TEST_VERIFY (fd > 0);
+ 
+     char *path = xasprintf ("/proc/%d/fd/%d", pid, remote_fd);
+-- 
+2.38.1
+
+
+From 8b139cd4f1074ae0d95d9bff60db283a1ed72734 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Mon, 22 Aug 2022 11:04:47 +0200
+Subject: [PATCH 07/72] alpha: Fix generic brk system call emulation in
+ __brk_call (bug 29490)
+
+The kernel special-cases the zero argument for alpha brk, and we can
+use that to restore the generic Linux error handling behavior.
+
+Fixes commit b57ab258c1140bc45464b4b9908713e3e0ee35aa ("Linux:
+Introduce __brk_call for invoking the brk system call").
+
+(cherry picked from commit e7ad26ee3cb74e61d0637c888f24dd478d77af58)
+---
+ NEWS                                     | 1 +
+ sysdeps/unix/sysv/linux/alpha/brk_call.h | 7 +++----
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/NEWS b/NEWS
+index f8fb8db510..becab3ade9 100644
+--- a/NEWS
++++ b/NEWS
+@@ -11,6 +11,7 @@ The following bugs are resolved with this release:
+ 
+   [29446] _dlopen now ignores dl_caller argument in static mode
+   [29485] Linux: Terminate subprocess on late failure in tst-pidfd
++  [29490] alpha: New __brk_call implementation is broken
+ 
+ \f
+ Version 2.36
+diff --git a/sysdeps/unix/sysv/linux/alpha/brk_call.h b/sysdeps/unix/sysv/linux/alpha/brk_call.h
+index b8088cf13f..0b851b6c86 100644
+--- a/sysdeps/unix/sysv/linux/alpha/brk_call.h
++++ b/sysdeps/unix/sysv/linux/alpha/brk_call.h
+@@ -21,8 +21,7 @@ __brk_call (void *addr)
+ {
+   unsigned long int result = INTERNAL_SYSCALL_CALL (brk, addr);
+   if (result == -ENOMEM)
+-    /* Mimic the default error reporting behavior.  */
+-    return addr;
+-  else
+-    return (void *) result;
++    /* Mimic the generic error reporting behavior.  */
++    result = INTERNAL_SYSCALL_CALL (brk, 0);
++  return (void *) result;
+ }
+-- 
+2.38.1
+
+
+From d13a7a6f100576b1e30dc044b2e0c4cbcb6196f6 Mon Sep 17 00:00:00 2001
+From: Arjun Shankar <arjun@redhat.com>
+Date: Tue, 2 Aug 2022 11:10:25 +0200
+Subject: [PATCH 08/72] socket: Check lengths before advancing pointer in
+ CMSG_NXTHDR
+
+The inline and library functions that the CMSG_NXTHDR macro may expand
+to increment the pointer to the header before checking the stride of
+the increment against available space.  Since C only allows incrementing
+pointers to one past the end of an array, the increment must be done
+after a length check.  This commit fixes that and includes a regression
+test for CMSG_FIRSTHDR and CMSG_NXTHDR.
+
+The Linux, Hurd, and generic headers are all changed.
+
+Tested on Linux on armv7hl, i686, x86_64, aarch64, ppc64le, and s390x.
+
+[BZ #28846]
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit 9c443ac4559a47ed99859bd80d14dc4b6dd220a1)
+---
+ bits/socket.h                         | 40 ++++++++++--
+ socket/Makefile                       |  1 +
+ socket/tst-cmsghdr-skeleton.c         | 92 +++++++++++++++++++++++++++
+ socket/tst-cmsghdr.c                  | 56 ++++++++++++++++
+ sysdeps/mach/hurd/bits/socket.h       | 40 ++++++++++--
+ sysdeps/unix/sysv/linux/bits/socket.h | 40 ++++++++++--
+ sysdeps/unix/sysv/linux/cmsg_nxthdr.c | 36 ++++++++---
+ 7 files changed, 276 insertions(+), 29 deletions(-)
+ create mode 100644 socket/tst-cmsghdr-skeleton.c
+ create mode 100644 socket/tst-cmsghdr.c
+
+diff --git a/bits/socket.h b/bits/socket.h
+index 2b99dea33b..aac8c49b00 100644
+--- a/bits/socket.h
++++ b/bits/socket.h
+@@ -245,6 +245,12 @@ struct cmsghdr
+ 			 + CMSG_ALIGN (sizeof (struct cmsghdr)))
+ #define CMSG_LEN(len)   (CMSG_ALIGN (sizeof (struct cmsghdr)) + (len))
+ 
++/* Given a length, return the additional padding necessary such that
++   len + __CMSG_PADDING(len) == CMSG_ALIGN (len).  */
++#define __CMSG_PADDING(len) ((sizeof (size_t) \
++                              - ((len) & (sizeof (size_t) - 1))) \
++                             & (sizeof (size_t) - 1))
++
+ extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr,
+ 				      struct cmsghdr *__cmsg) __THROW;
+ #ifdef __USE_EXTERN_INLINES
+@@ -254,18 +260,38 @@ extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr,
+ _EXTERN_INLINE struct cmsghdr *
+ __NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg))
+ {
++  /* We may safely assume that __cmsg lies between __mhdr->msg_control and
++     __mhdr->msg_controllen because the user is required to obtain the first
++     cmsg via CMSG_FIRSTHDR, set its length, then obtain subsequent cmsgs
++     via CMSG_NXTHDR, setting lengths along the way.  However, we don't yet
++     trust the value of __cmsg->cmsg_len and therefore do not use it in any
++     pointer arithmetic until we check its value.  */
++
++  unsigned char * __msg_control_ptr = (unsigned char *) __mhdr->msg_control;
++  unsigned char * __cmsg_ptr = (unsigned char *) __cmsg;
++
++  size_t __size_needed = sizeof (struct cmsghdr)
++                         + __CMSG_PADDING (__cmsg->cmsg_len);
++
++  /* The current header is malformed, too small to be a full header.  */
+   if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr))
+-    /* The kernel header does this so there may be a reason.  */
+     return (struct cmsghdr *) 0;
+ 
++  /* There isn't enough space between __cmsg and the end of the buffer to
++  hold the current cmsg *and* the next one.  */
++  if (((size_t)
++         (__msg_control_ptr + __mhdr->msg_controllen - __cmsg_ptr)
++       < __size_needed)
++      || ((size_t)
++            (__msg_control_ptr + __mhdr->msg_controllen - __cmsg_ptr
++             - __size_needed)
++          < __cmsg->cmsg_len))
++
++    return (struct cmsghdr *) 0;
++
++  /* Now, we trust cmsg_len and can use it to find the next header.  */
+   __cmsg = (struct cmsghdr *) ((unsigned char *) __cmsg
+ 			       + CMSG_ALIGN (__cmsg->cmsg_len));
+-  if ((unsigned char *) (__cmsg + 1) > ((unsigned char *) __mhdr->msg_control
+-					+ __mhdr->msg_controllen)
+-      || ((unsigned char *) __cmsg + CMSG_ALIGN (__cmsg->cmsg_len)
+-	  > ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen)))
+-    /* No more entries.  */
+-    return (struct cmsghdr *) 0;
+   return __cmsg;
+ }
+ #endif	/* Use `extern inline'.  */
+diff --git a/socket/Makefile b/socket/Makefile
+index 156eec6c85..2bde78387f 100644
+--- a/socket/Makefile
++++ b/socket/Makefile
+@@ -34,6 +34,7 @@ routines := accept bind connect getpeername getsockname getsockopt	\
+ tests := \
+   tst-accept4 \
+   tst-sockopt \
++  tst-cmsghdr \
+   # tests
+ 
+ tests-internal := \
+diff --git a/socket/tst-cmsghdr-skeleton.c b/socket/tst-cmsghdr-skeleton.c
+new file mode 100644
+index 0000000000..4c6898569b
+--- /dev/null
++++ b/socket/tst-cmsghdr-skeleton.c
+@@ -0,0 +1,92 @@
++/* Test ancillary data header creation.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++/* We use the preprocessor to generate the function/macro tests instead of
++   using indirection because having all the macro expansions alongside
++   each other lets the compiler warn us about suspicious pointer
++   arithmetic across subsequent CMSG_{FIRST,NXT}HDR expansions.  */
++
++#include <stdint.h>
++
++#define RUN_TEST_CONCAT(suffix) run_test_##suffix
++#define RUN_TEST_FUNCNAME(suffix) RUN_TEST_CONCAT (suffix)
++
++static void
++RUN_TEST_FUNCNAME (CMSG_NXTHDR_IMPL) (void)
++{
++  struct msghdr m = {0};
++  struct cmsghdr *cmsg;
++  char cmsgbuf[3 * CMSG_SPACE (sizeof (PAYLOAD))] = {0};
++
++  m.msg_control = cmsgbuf;
++  m.msg_controllen = sizeof (cmsgbuf);
++
++  /* First header should point to the start of the buffer.  */
++  cmsg = CMSG_FIRSTHDR (&m);
++  TEST_VERIFY_EXIT ((char *) cmsg == cmsgbuf);
++
++  /* If the first header length consumes the entire buffer, there is no
++     space remaining for additional headers.  */
++  cmsg->cmsg_len = sizeof (cmsgbuf);
++  cmsg = CMSG_NXTHDR_IMPL (&m, cmsg);
++  TEST_VERIFY_EXIT (cmsg == NULL);
++
++  /* The first header length is so big, using it would cause an overflow.  */
++  cmsg = CMSG_FIRSTHDR (&m);
++  TEST_VERIFY_EXIT ((char *) cmsg == cmsgbuf);
++  cmsg->cmsg_len = SIZE_MAX;
++  cmsg = CMSG_NXTHDR_IMPL (&m, cmsg);
++  TEST_VERIFY_EXIT (cmsg == NULL);
++
++  /* The first header leaves just enough space to hold another header.  */
++  cmsg = CMSG_FIRSTHDR (&m);
++  TEST_VERIFY_EXIT ((char *) cmsg == cmsgbuf);
++  cmsg->cmsg_len = sizeof (cmsgbuf) - sizeof (struct cmsghdr);
++  cmsg = CMSG_NXTHDR_IMPL (&m, cmsg);
++  TEST_VERIFY_EXIT (cmsg != NULL);
++
++  /* The first header leaves space but not enough for another header.  */
++  cmsg = CMSG_FIRSTHDR (&m);
++  TEST_VERIFY_EXIT ((char *) cmsg == cmsgbuf);
++  cmsg->cmsg_len ++;
++  cmsg = CMSG_NXTHDR_IMPL (&m, cmsg);
++  TEST_VERIFY_EXIT (cmsg == NULL);
++
++  /* The second header leaves just enough space to hold another header.  */
++  cmsg = CMSG_FIRSTHDR (&m);
++  TEST_VERIFY_EXIT ((char *) cmsg == cmsgbuf);
++  cmsg->cmsg_len = CMSG_LEN (sizeof (PAYLOAD));
++  cmsg = CMSG_NXTHDR_IMPL (&m, cmsg);
++  TEST_VERIFY_EXIT (cmsg != NULL);
++  cmsg->cmsg_len = sizeof (cmsgbuf)
++                   - CMSG_SPACE (sizeof (PAYLOAD)) /* First header.  */
++                   - sizeof (struct cmsghdr);
++  cmsg = CMSG_NXTHDR_IMPL (&m, cmsg);
++  TEST_VERIFY_EXIT (cmsg != NULL);
++
++  /* The second header leaves space but not enough for another header.  */
++  cmsg = CMSG_FIRSTHDR (&m);
++  TEST_VERIFY_EXIT ((char *) cmsg == cmsgbuf);
++  cmsg = CMSG_NXTHDR_IMPL (&m, cmsg);
++  TEST_VERIFY_EXIT (cmsg != NULL);
++  cmsg->cmsg_len ++;
++  cmsg = CMSG_NXTHDR_IMPL (&m, cmsg);
++  TEST_VERIFY_EXIT (cmsg == NULL);
++
++  return;
++}
+diff --git a/socket/tst-cmsghdr.c b/socket/tst-cmsghdr.c
+new file mode 100644
+index 0000000000..68c96d3c9d
+--- /dev/null
++++ b/socket/tst-cmsghdr.c
+@@ -0,0 +1,56 @@
++/* Test ancillary data header creation.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <sys/socket.h>
++#include <gnu/lib-names.h>
++#include <support/xdlfcn.h>
++#include <support/check.h>
++
++#define PAYLOAD "Hello, World!"
++
++/* CMSG_NXTHDR is a macro that calls an inline function defined in
++   bits/socket.h.  In case the function cannot be inlined, libc.so carries
++   a copy.  Both versions need to be tested.  */
++
++#define CMSG_NXTHDR_IMPL CMSG_NXTHDR
++#include "tst-cmsghdr-skeleton.c"
++#undef CMSG_NXTHDR_IMPL
++
++static struct cmsghdr * (* cmsg_nxthdr) (struct msghdr *, struct cmsghdr *);
++
++#define CMSG_NXTHDR_IMPL cmsg_nxthdr
++#include "tst-cmsghdr-skeleton.c"
++#undef CMSG_NXTHDR_IMPL
++
++static int
++do_test (void)
++{
++  static void *handle;
++
++  run_test_CMSG_NXTHDR ();
++
++  handle = xdlopen (LIBC_SO, RTLD_LAZY);
++  cmsg_nxthdr = (struct cmsghdr * (*) (struct msghdr *, struct cmsghdr *))
++                  xdlsym (handle, "__cmsg_nxthdr");
++
++  run_test_cmsg_nxthdr ();
++
++  return 0;
++}
++
++#include <support/test-driver.c>
+diff --git a/sysdeps/mach/hurd/bits/socket.h b/sysdeps/mach/hurd/bits/socket.h
+index 5b35ea81ec..70fce4fb27 100644
+--- a/sysdeps/mach/hurd/bits/socket.h
++++ b/sysdeps/mach/hurd/bits/socket.h
+@@ -249,6 +249,12 @@ struct cmsghdr
+ 			 + CMSG_ALIGN (sizeof (struct cmsghdr)))
+ #define CMSG_LEN(len)   (CMSG_ALIGN (sizeof (struct cmsghdr)) + (len))
+ 
++/* Given a length, return the additional padding necessary such that
++   len + __CMSG_PADDING(len) == CMSG_ALIGN (len).  */
++#define __CMSG_PADDING(len) ((sizeof (size_t) \
++                              - ((len) & (sizeof (size_t) - 1))) \
++                             & (sizeof (size_t) - 1))
++
+ extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr,
+ 				      struct cmsghdr *__cmsg) __THROW;
+ #ifdef __USE_EXTERN_INLINES
+@@ -258,18 +264,38 @@ extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr,
+ _EXTERN_INLINE struct cmsghdr *
+ __NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg))
+ {
++  /* We may safely assume that __cmsg lies between __mhdr->msg_control and
++     __mhdr->msg_controllen because the user is required to obtain the first
++     cmsg via CMSG_FIRSTHDR, set its length, then obtain subsequent cmsgs
++     via CMSG_NXTHDR, setting lengths along the way.  However, we don't yet
++     trust the value of __cmsg->cmsg_len and therefore do not use it in any
++     pointer arithmetic until we check its value.  */
++
++  unsigned char * __msg_control_ptr = (unsigned char *) __mhdr->msg_control;
++  unsigned char * __cmsg_ptr = (unsigned char *) __cmsg;
++
++  size_t __size_needed = sizeof (struct cmsghdr)
++                         + __CMSG_PADDING (__cmsg->cmsg_len);
++
++  /* The current header is malformed, too small to be a full header.  */
+   if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr))
+-    /* The kernel header does this so there may be a reason.  */
+     return (struct cmsghdr *) 0;
+ 
++  /* There isn't enough space between __cmsg and the end of the buffer to
++  hold the current cmsg *and* the next one.  */
++  if (((size_t)
++         (__msg_control_ptr + __mhdr->msg_controllen - __cmsg_ptr)
++       < __size_needed)
++      || ((size_t)
++            (__msg_control_ptr + __mhdr->msg_controllen - __cmsg_ptr
++             - __size_needed)
++          < __cmsg->cmsg_len))
++
++    return (struct cmsghdr *) 0;
++
++  /* Now, we trust cmsg_len and can use it to find the next header.  */
+   __cmsg = (struct cmsghdr *) ((unsigned char *) __cmsg
+ 			       + CMSG_ALIGN (__cmsg->cmsg_len));
+-  if ((unsigned char *) (__cmsg + 1) > ((unsigned char *) __mhdr->msg_control
+-					+ __mhdr->msg_controllen)
+-      || ((unsigned char *) __cmsg + CMSG_ALIGN (__cmsg->cmsg_len)
+-	  > ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen)))
+-    /* No more entries.  */
+-    return (struct cmsghdr *) 0;
+   return __cmsg;
+ }
+ #endif	/* Use `extern inline'.  */
+diff --git a/sysdeps/unix/sysv/linux/bits/socket.h b/sysdeps/unix/sysv/linux/bits/socket.h
+index 4f1f810ea1..539b8d7716 100644
+--- a/sysdeps/unix/sysv/linux/bits/socket.h
++++ b/sysdeps/unix/sysv/linux/bits/socket.h
+@@ -307,6 +307,12 @@ struct cmsghdr
+ 			 + CMSG_ALIGN (sizeof (struct cmsghdr)))
+ #define CMSG_LEN(len)   (CMSG_ALIGN (sizeof (struct cmsghdr)) + (len))
+ 
++/* Given a length, return the additional padding necessary such that
++   len + __CMSG_PADDING(len) == CMSG_ALIGN (len).  */
++#define __CMSG_PADDING(len) ((sizeof (size_t) \
++                              - ((len) & (sizeof (size_t) - 1))) \
++                             & (sizeof (size_t) - 1))
++
+ extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr,
+ 				      struct cmsghdr *__cmsg) __THROW;
+ #ifdef __USE_EXTERN_INLINES
+@@ -316,18 +322,38 @@ extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr,
+ _EXTERN_INLINE struct cmsghdr *
+ __NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg))
+ {
++  /* We may safely assume that __cmsg lies between __mhdr->msg_control and
++     __mhdr->msg_controllen because the user is required to obtain the first
++     cmsg via CMSG_FIRSTHDR, set its length, then obtain subsequent cmsgs
++     via CMSG_NXTHDR, setting lengths along the way.  However, we don't yet
++     trust the value of __cmsg->cmsg_len and therefore do not use it in any
++     pointer arithmetic until we check its value.  */
++
++  unsigned char * __msg_control_ptr = (unsigned char *) __mhdr->msg_control;
++  unsigned char * __cmsg_ptr = (unsigned char *) __cmsg;
++
++  size_t __size_needed = sizeof (struct cmsghdr)
++                         + __CMSG_PADDING (__cmsg->cmsg_len);
++
++  /* The current header is malformed, too small to be a full header.  */
+   if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr))
+-    /* The kernel header does this so there may be a reason.  */
+     return (struct cmsghdr *) 0;
+ 
++  /* There isn't enough space between __cmsg and the end of the buffer to
++  hold the current cmsg *and* the next one.  */
++  if (((size_t)
++         (__msg_control_ptr + __mhdr->msg_controllen - __cmsg_ptr)
++       < __size_needed)
++      || ((size_t)
++            (__msg_control_ptr + __mhdr->msg_controllen - __cmsg_ptr
++             - __size_needed)
++          < __cmsg->cmsg_len))
++
++    return (struct cmsghdr *) 0;
++
++  /* Now, we trust cmsg_len and can use it to find the next header.  */
+   __cmsg = (struct cmsghdr *) ((unsigned char *) __cmsg
+ 			       + CMSG_ALIGN (__cmsg->cmsg_len));
+-  if ((unsigned char *) (__cmsg + 1) > ((unsigned char *) __mhdr->msg_control
+-					+ __mhdr->msg_controllen)
+-      || ((unsigned char *) __cmsg + CMSG_ALIGN (__cmsg->cmsg_len)
+-	  > ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen)))
+-    /* No more entries.  */
+-    return (struct cmsghdr *) 0;
+   return __cmsg;
+ }
+ #endif	/* Use `extern inline'.  */
+diff --git a/sysdeps/unix/sysv/linux/cmsg_nxthdr.c b/sysdeps/unix/sysv/linux/cmsg_nxthdr.c
+index 15b7a3a925..24f72b797a 100644
+--- a/sysdeps/unix/sysv/linux/cmsg_nxthdr.c
++++ b/sysdeps/unix/sysv/linux/cmsg_nxthdr.c
+@@ -23,18 +23,38 @@
+ struct cmsghdr *
+ __cmsg_nxthdr (struct msghdr *mhdr, struct cmsghdr *cmsg)
+ {
++  /* We may safely assume that cmsg lies between mhdr->msg_control and
++     mhdr->msg_controllen because the user is required to obtain the first
++     cmsg via CMSG_FIRSTHDR, set its length, then obtain subsequent cmsgs
++     via CMSG_NXTHDR, setting lengths along the way.  However, we don't yet
++     trust the value of cmsg->cmsg_len and therefore do not use it in any
++     pointer arithmetic until we check its value.  */
++
++  unsigned char * msg_control_ptr = (unsigned char *) mhdr->msg_control;
++  unsigned char * cmsg_ptr = (unsigned char *) cmsg;
++
++  size_t size_needed = sizeof (struct cmsghdr)
++                       + __CMSG_PADDING (cmsg->cmsg_len);
++
++  /* The current header is malformed, too small to be a full header.  */
+   if ((size_t) cmsg->cmsg_len < sizeof (struct cmsghdr))
+-    /* The kernel header does this so there may be a reason.  */
+-    return NULL;
++    return (struct cmsghdr *) 0;
++
++  /* There isn't enough space between cmsg and the end of the buffer to
++  hold the current cmsg *and* the next one.  */
++  if (((size_t)
++         (msg_control_ptr + mhdr->msg_controllen - cmsg_ptr)
++       < size_needed)
++      || ((size_t)
++            (msg_control_ptr + mhdr->msg_controllen - cmsg_ptr
++             - size_needed)
++          < cmsg->cmsg_len))
++
++    return (struct cmsghdr *) 0;
+ 
++  /* Now, we trust cmsg_len and can use it to find the next header.  */
+   cmsg = (struct cmsghdr *) ((unsigned char *) cmsg
+ 			     + CMSG_ALIGN (cmsg->cmsg_len));
+-  if ((unsigned char *) (cmsg + 1) > ((unsigned char *) mhdr->msg_control
+-				      + mhdr->msg_controllen)
+-      || ((unsigned char *) cmsg + CMSG_ALIGN (cmsg->cmsg_len)
+-	  > ((unsigned char *) mhdr->msg_control + mhdr->msg_controllen)))
+-    /* No more entries.  */
+-    return NULL;
+   return cmsg;
+ }
+ libc_hidden_def (__cmsg_nxthdr)
+-- 
+2.38.1
+
+
+From 5c62874f423af93e97b51bc9a57af228a546156f Mon Sep 17 00:00:00 2001
+From: Arjun Shankar <arjun@redhat.com>
+Date: Mon, 22 Aug 2022 18:21:14 +0200
+Subject: [PATCH 09/72] NEWS: Add entry for bug 28846
+
+---
+ NEWS | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/NEWS b/NEWS
+index becab3ade9..ae30900bbc 100644
+--- a/NEWS
++++ b/NEWS
+@@ -9,6 +9,7 @@ Version 2.36.1
+ 
+ The following bugs are resolved with this release:
+ 
++  [28846] CMSG_NXTHDR may trigger -Wstrict-overflow warning
+   [29446] _dlopen now ignores dl_caller argument in static mode
+   [29485] Linux: Terminate subprocess on late failure in tst-pidfd
+   [29490] alpha: New __brk_call implementation is broken
+-- 
+2.38.1
+
+
+From 0062e7dd1c3674ece2daca53a898badd28b60421 Mon Sep 17 00:00:00 2001
+From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Wed, 10 Aug 2022 16:24:06 -0300
+Subject: [PATCH 10/72] glibcextract.py: Add compile_c_snippet
+
+It might be used on tests to check if a snippet build with the provided
+compiler and flags.
+
+Reviewed-by: Florian Weimer <fweimer@redhat.com>
+(cherry picked from commit 841afa116e32b3c7195475769c26bf46fd870d32)
+---
+ scripts/glibcextract.py | 19 +++++++++++++++++++
+ 1 file changed, 19 insertions(+)
+
+diff --git a/scripts/glibcextract.py b/scripts/glibcextract.py
+index 43ab58ffe2..36d204c9b0 100644
+--- a/scripts/glibcextract.py
++++ b/scripts/glibcextract.py
+@@ -17,6 +17,7 @@
+ # License along with the GNU C Library; if not, see
+ # <https://www.gnu.org/licenses/>.
+ 
++import collections
+ import os.path
+ import re
+ import subprocess
+@@ -173,3 +174,21 @@ def compare_macro_consts(source_1, source_2, cc, macro_re, exclude_re=None,
+             if not allow_extra_2:
+                 ret = 1
+     return ret
++
++CompileResult = collections.namedtuple("CompileResult", "returncode output")
++
++def compile_c_snippet(snippet, cc, extra_cc_args=''):
++    """Compile and return whether the SNIPPET can be build with CC along
++       EXTRA_CC_ARGS compiler flags.  Return a CompileResult with RETURNCODE
++       being 0 for success, or the failure value and the compiler output.
++    """
++    with tempfile.TemporaryDirectory() as temp_dir:
++        c_file_name = os.path.join(temp_dir, 'test.c')
++        obj_file_name = os.path.join(temp_dir, 'test.o')
++        with open(c_file_name, 'w') as c_file:
++            c_file.write(snippet + '\n')
++        cmd = cc.split() + extra_cc_args.split() + ['-c', '-o', obj_file_name,
++                c_file_name]
++        r = subprocess.run(cmd, check=False, stdout=subprocess.PIPE,
++                stderr=subprocess.STDOUT)
++        return CompileResult(r.returncode, r.stdout)
+-- 
+2.38.1
+
+
+From 1cc5513114e76083669cba1b11252aad35525e69 Mon Sep 17 00:00:00 2001
+From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Wed, 10 Aug 2022 14:24:44 -0300
+Subject: [PATCH 11/72] linux: Use compile_c_snippet to check linux/pidfd.h
+ availability
+
+Instead of tying to a specific kernel version.
+
+Checked on x86_64-linux-gnu.
+
+Reviewed-by: Florian Weimer <fweimer@redhat.com>
+(cherry picked from commit 1542019b69b7ec7b2cd34357af035e406d153631)
+---
+ sysdeps/unix/sysv/linux/tst-pidfd-consts.py | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/sysdeps/unix/sysv/linux/tst-pidfd-consts.py b/sysdeps/unix/sysv/linux/tst-pidfd-consts.py
+index 90cbb9be64..d732173abd 100644
+--- a/sysdeps/unix/sysv/linux/tst-pidfd-consts.py
++++ b/sysdeps/unix/sysv/linux/tst-pidfd-consts.py
+@@ -33,11 +33,13 @@ def main():
+                         help='C compiler (including options) to use')
+     args = parser.parse_args()
+ 
+-    linux_version_headers = glibcsyscalls.linux_kernel_version(args.cc)
+-    # Linux started to provide pidfd.h with 5.10.
+-    if linux_version_headers < (5, 10):
++    if glibcextract.compile_c_snippet(
++            '#include <linux/pidfd.h>',
++            args.cc).returncode != 0:
+         sys.exit (77)
+-    linux_version_glibc = (5, 18)
++
++    linux_version_headers = glibcsyscalls.linux_kernel_version(args.cc)
++    linux_version_glibc = (5, 19)
+     sys.exit(glibcextract.compare_macro_consts(
+                 '#include <sys/pidfd.h>\n',
+                 '#include <asm/fcntl.h>\n'
+-- 
+2.38.1
+
+
+From 4dad97e2a2e510c6b53a0add29a2188714fcf4ab Mon Sep 17 00:00:00 2001
+From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Wed, 10 Aug 2022 14:24:45 -0300
+Subject: [PATCH 12/72] linux: Mimic kernel defition for BLOCK_SIZE
+
+To avoid possible warnings if the kernel header is included before
+sys/mount.h.
+
+Reviewed-by: Florian Weimer <fweimer@redhat.com>
+(cherry picked from commit c68b6044bc7945716431f1adc091b17c39b80a06)
+---
+ sysdeps/unix/sysv/linux/sys/mount.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/sysdeps/unix/sysv/linux/sys/mount.h b/sysdeps/unix/sysv/linux/sys/mount.h
+index f965986ba8..df6b0dbb42 100644
+--- a/sysdeps/unix/sysv/linux/sys/mount.h
++++ b/sysdeps/unix/sysv/linux/sys/mount.h
+@@ -27,8 +27,8 @@
+ #include <stddef.h>
+ #include <sys/ioctl.h>
+ 
+-#define BLOCK_SIZE	1024
+ #define BLOCK_SIZE_BITS	10
++#define BLOCK_SIZE	(1<<BLOCK_SIZE_BITS)
+ 
+ 
+ /* These are the fs-independent mount-flags: up to 16 flags are
+-- 
+2.38.1
+
+
+From d48813227b63a0d92ea357ea0733229ed74e31ab Mon Sep 17 00:00:00 2001
+From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Wed, 10 Aug 2022 14:24:46 -0300
+Subject: [PATCH 13/72] linux: Use compile_c_snippet to check linux/mount.h
+ availability
+
+Checked on x86_64-linux-gnu.
+
+Reviewed-by: Florian Weimer <fweimer@redhat.com>
+(cherry picked from commit e1226cdc6b209539a92d32d5b620ba53fd35abf3)
+---
+ sysdeps/unix/sysv/linux/tst-mount-consts.py | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/sysdeps/unix/sysv/linux/tst-mount-consts.py b/sysdeps/unix/sysv/linux/tst-mount-consts.py
+index a62f803123..be2ef2daf1 100755
+--- a/sysdeps/unix/sysv/linux/tst-mount-consts.py
++++ b/sysdeps/unix/sysv/linux/tst-mount-consts.py
+@@ -33,6 +33,11 @@ def main():
+                         help='C compiler (including options) to use')
+     args = parser.parse_args()
+ 
++    if glibcextract.compile_c_snippet(
++            '#include <linux/mount.h>',
++            args.cc).returncode != 0:
++        sys.exit (77)
++
+     linux_version_headers = glibcsyscalls.linux_kernel_version(args.cc)
+     # Constants in glibc were updated to match Linux v5.16.  When glibc
+     # constants are updated this value should be updated to match the
+-- 
+2.38.1
+
+
+From bb1e8b0ca99b5cbedfae3e6245528a87d95ff3e2 Mon Sep 17 00:00:00 2001
+From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Wed, 10 Aug 2022 14:24:47 -0300
+Subject: [PATCH 14/72] linux: Fix sys/mount.h usage with kernel headers
+
+Now that kernel exports linux/mount.h and includes it on linux/fs.h,
+its definitions might clash with glibc exports sys/mount.h.  To avoid
+the need to rearrange the Linux header to be always after glibc one,
+the glibc sys/mount.h is changed to:
+
+  1. Undefine the macros also used as enum constants.  This covers prior
+     inclusion of <linux/mount.h> (for instance MS_RDONLY).
+
+  2. Include <linux/mount.h> based on the usual __has_include check
+     (needs to use __has_include ("linux/mount.h") to paper over GCC
+     bugs.
+
+  3. Define enum fsconfig_command only if FSOPEN_CLOEXEC is not defined.
+     (FSOPEN_CLOEXEC should be a very close proxy.)
+
+  4. Define struct mount_attr if MOUNT_ATTR_SIZE_VER0 is not defined.
+     (Added in the same commit on the Linux side.)
+
+This patch also adds some tests to check if including linux/fs.h and
+linux/mount.h after and before sys/mount.h does work.
+
+Checked on x86_64-linux-gnu.
+
+Reviewed-by: Florian Weimer <fweimer@redhat.com>
+(cherry picked from commit 774058d72942249f71d74e7f2b639f77184160a6)
+---
+ sysdeps/unix/sysv/linux/Makefile             |  8 +++
+ sysdeps/unix/sysv/linux/sys/mount.h          | 71 +++++++++++++++++---
+ sysdeps/unix/sysv/linux/tst-mount-compile.py | 66 ++++++++++++++++++
+ 3 files changed, 137 insertions(+), 8 deletions(-)
+ create mode 100755 sysdeps/unix/sysv/linux/tst-mount-compile.py
+
+diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
+index a139a16532..3ceda9fdbf 100644
+--- a/sysdeps/unix/sysv/linux/Makefile
++++ b/sysdeps/unix/sysv/linux/Makefile
+@@ -265,6 +265,14 @@ $(objpfx)tst-mount-consts.out: ../sysdeps/unix/sysv/linux/tst-mount-consts.py
+ 	  < /dev/null > $@ 2>&1; $(evaluate-test)
+ $(objpfx)tst-mount-consts.out: $(sysdeps-linux-python-deps)
+ 
++tests-special += $(objpfx)tst-mount-compile.out
++$(objpfx)tst-mount-compile.out: ../sysdeps/unix/sysv/linux/tst-mount-compile.py
++	$(sysdeps-linux-python) \
++	  ../sysdeps/unix/sysv/linux/tst-mount-compile.py \
++	    $(sysdeps-linux-python-cc) \
++	  < /dev/null > $@ 2>&1; $(evaluate-test)
++$(objpfx)tst-mount-compile.out: $(sysdeps-linux-python-deps)
++
+ tst-rseq-disable-ENV = GLIBC_TUNABLES=glibc.pthread.rseq=0
+ 
+ endif # $(subdir) == misc
+diff --git a/sysdeps/unix/sysv/linux/sys/mount.h b/sysdeps/unix/sysv/linux/sys/mount.h
+index df6b0dbb42..2e3fd6a7fe 100644
+--- a/sysdeps/unix/sysv/linux/sys/mount.h
++++ b/sysdeps/unix/sysv/linux/sys/mount.h
+@@ -27,6 +27,13 @@
+ #include <stddef.h>
+ #include <sys/ioctl.h>
+ 
++#ifdef __has_include
++# if __has_include ("linux/mount.h")
++#  include "linux/mount.h"
++# endif
++#endif
++
++
+ #define BLOCK_SIZE_BITS	10
+ #define BLOCK_SIZE	(1<<BLOCK_SIZE_BITS)
+ 
+@@ -35,69 +42,98 @@
+    supported  */
+ enum
+ {
++#undef MS_RDONLY
+   MS_RDONLY = 1,		/* Mount read-only.  */
+ #define MS_RDONLY	MS_RDONLY
++#undef MS_NOSUID
+   MS_NOSUID = 2,		/* Ignore suid and sgid bits.  */
+ #define MS_NOSUID	MS_NOSUID
++#undef MS_NODEV
+   MS_NODEV = 4,			/* Disallow access to device special files.  */
+ #define MS_NODEV	MS_NODEV
++#undef MS_NOEXEC
+   MS_NOEXEC = 8,		/* Disallow program execution.  */
+ #define MS_NOEXEC	MS_NOEXEC
++#undef MS_SYNCHRONOUS
+   MS_SYNCHRONOUS = 16,		/* Writes are synced at once.  */
+ #define MS_SYNCHRONOUS	MS_SYNCHRONOUS
++#undef MS_REMOUNT
+   MS_REMOUNT = 32,		/* Alter flags of a mounted FS.  */
+ #define MS_REMOUNT	MS_REMOUNT
++#undef MS_MANDLOCK
+   MS_MANDLOCK = 64,		/* Allow mandatory locks on an FS.  */
+ #define MS_MANDLOCK	MS_MANDLOCK
++#undef MS_DIRSYNC
+   MS_DIRSYNC = 128,		/* Directory modifications are synchronous.  */
+ #define MS_DIRSYNC	MS_DIRSYNC
++#undef MS_NOSYMFOLLOW
+   MS_NOSYMFOLLOW = 256,		/* Do not follow symlinks.  */
+ #define MS_NOSYMFOLLOW	MS_NOSYMFOLLOW
++#undef MS_NOATIME
+   MS_NOATIME = 1024,		/* Do not update access times.  */
+ #define MS_NOATIME	MS_NOATIME
++#undef MS_NODIRATIME
+   MS_NODIRATIME = 2048,		/* Do not update directory access times.  */
+ #define MS_NODIRATIME	MS_NODIRATIME
++#undef MS_BIND
+   MS_BIND = 4096,		/* Bind directory at different place.  */
+ #define MS_BIND		MS_BIND
++#undef MS_MOVE
+   MS_MOVE = 8192,
+ #define MS_MOVE		MS_MOVE
++#undef MS_REC
+   MS_REC = 16384,
+ #define MS_REC		MS_REC
++#undef MS_SILENT
+   MS_SILENT = 32768,
+ #define MS_SILENT	MS_SILENT
++#undef MS_POSIXACL
+   MS_POSIXACL = 1 << 16,	/* VFS does not apply the umask.  */
+ #define MS_POSIXACL	MS_POSIXACL
++#undef MS_UNBINDABLE
+   MS_UNBINDABLE = 1 << 17,	/* Change to unbindable.  */
+ #define MS_UNBINDABLE	MS_UNBINDABLE
++#undef MS_PRIVATE
+   MS_PRIVATE = 1 << 18,		/* Change to private.  */
+ #define MS_PRIVATE	MS_PRIVATE
++#undef MS_SLAVE
+   MS_SLAVE = 1 << 19,		/* Change to slave.  */
+ #define MS_SLAVE	MS_SLAVE
++#undef MS_SHARED
+   MS_SHARED = 1 << 20,		/* Change to shared.  */
+ #define MS_SHARED	MS_SHARED
++#undef MS_RELATIME
+   MS_RELATIME = 1 << 21,	/* Update atime relative to mtime/ctime.  */
+ #define MS_RELATIME	MS_RELATIME
++#undef MS_KERNMOUNT
+   MS_KERNMOUNT = 1 << 22,	/* This is a kern_mount call.  */
+ #define MS_KERNMOUNT	MS_KERNMOUNT
++#undef MS_I_VERSION
+   MS_I_VERSION =  1 << 23,	/* Update inode I_version field.  */
+ #define MS_I_VERSION	MS_I_VERSION
++#undef MS_STRICTATIME
+   MS_STRICTATIME = 1 << 24,	/* Always perform atime updates.  */
+ #define MS_STRICTATIME	MS_STRICTATIME
++#undef MS_LAZYTIME
+   MS_LAZYTIME = 1 << 25,	/* Update the on-disk [acm]times lazily.  */
+ #define MS_LAZYTIME	MS_LAZYTIME
++#undef MS_ACTIVE
+   MS_ACTIVE = 1 << 30,
+ #define MS_ACTIVE	MS_ACTIVE
++#undef MS_NOUSER
+   MS_NOUSER = 1 << 31
+ #define MS_NOUSER	MS_NOUSER
+ };
+ 
+ /* Flags that can be altered by MS_REMOUNT  */
++#undef MS_RMT_MASK
+ #define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_I_VERSION \
+ 		     |MS_LAZYTIME)
+ 
+ 
+ /* Magic mount flag number. Has to be or-ed to the flag values.  */
+ 
++#undef MS_MGC_VAL
+ #define MS_MGC_VAL 0xc0ed0000	/* Magic flag number to indicate "new" flags */
+ #define MS_MGC_MSK 0xffff0000	/* Magic flag number mask */
+ 
+@@ -106,20 +142,35 @@ enum
+    is probably as bad and I don't want to create yet another include
+    file.  */
+ 
++#undef BLKROSET
+ #define BLKROSET   _IO(0x12, 93) /* Set device read-only (0 = read-write).  */
++#undef BLKROGET
+ #define BLKROGET   _IO(0x12, 94) /* Get read-only status (0 = read_write).  */
++#undef BLKRRPART
+ #define BLKRRPART  _IO(0x12, 95) /* Re-read partition table.  */
++#undef BLKGETSIZE
+ #define BLKGETSIZE _IO(0x12, 96) /* Return device size.  */
++#undef BLKFLSBUF
+ #define BLKFLSBUF  _IO(0x12, 97) /* Flush buffer cache.  */
++#undef BLKRASET
+ #define BLKRASET   _IO(0x12, 98) /* Set read ahead for block device.  */
++#undef BLKRAGET
+ #define BLKRAGET   _IO(0x12, 99) /* Get current read ahead setting.  */
++#undef BLKFRASET
+ #define BLKFRASET  _IO(0x12,100) /* Set filesystem read-ahead.  */
++#undef BLKFRAGET
+ #define BLKFRAGET  _IO(0x12,101) /* Get filesystem read-ahead.  */
++#undef BLKSECTSET
+ #define BLKSECTSET _IO(0x12,102) /* Set max sectors per request.  */
++#undef BLKSECTGET
+ #define BLKSECTGET _IO(0x12,103) /* Get max sectors per request.  */
++#undef BLKSSZGET
+ #define BLKSSZGET  _IO(0x12,104) /* Get block device sector size.  */
++#undef BLKBSZGET
+ #define BLKBSZGET  _IOR(0x12,112,size_t)
++#undef BLKBSZSET
+ #define BLKBSZSET  _IOW(0x12,113,size_t)
++#undef BLKGETSIZE64
+ #define BLKGETSIZE64 _IOR(0x12,114,size_t) /* return device size.  */
+ 
+ 
+@@ -157,6 +208,7 @@ enum
+ #define MOUNT_ATTR_NOSYMFOLLOW  0x00200000 /* Do not follow symlinks.  */
+ 
+ 
++#ifndef MOUNT_ATTR_SIZE_VER0
+ /* For mount_setattr.  */
+ struct mount_attr
+ {
+@@ -165,6 +217,7 @@ struct mount_attr
+   uint64_t propagation;
+   uint64_t userns_fd;
+ };
++#endif
+ 
+ #define MOUNT_ATTR_SIZE_VER0    32 /* sizeof first published struct */
+ 
+@@ -185,26 +238,28 @@ struct mount_attr
+ #define FSPICK_EMPTY_PATH       0x00000008
+ 
+ 
++#ifndef FSOPEN_CLOEXEC
+ /* The type of fsconfig call made.   */
+ enum fsconfig_command
+ {
+   FSCONFIG_SET_FLAG       = 0,    /* Set parameter, supplying no value */
+-#define FSCONFIG_SET_FLAG FSCONFIG_SET_FLAG
++# define FSCONFIG_SET_FLAG FSCONFIG_SET_FLAG
+   FSCONFIG_SET_STRING     = 1,    /* Set parameter, supplying a string value */
+-#define FSCONFIG_SET_STRING FSCONFIG_SET_STRING
++# define FSCONFIG_SET_STRING FSCONFIG_SET_STRING
+   FSCONFIG_SET_BINARY     = 2,    /* Set parameter, supplying a binary blob value */
+-#define FSCONFIG_SET_BINARY FSCONFIG_SET_BINARY
++# define FSCONFIG_SET_BINARY FSCONFIG_SET_BINARY
+   FSCONFIG_SET_PATH       = 3,    /* Set parameter, supplying an object by path */
+-#define FSCONFIG_SET_PATH FSCONFIG_SET_PATH
++# define FSCONFIG_SET_PATH FSCONFIG_SET_PATH
+   FSCONFIG_SET_PATH_EMPTY = 4,    /* Set parameter, supplying an object by (empty) path */
+-#define FSCONFIG_SET_PATH_EMPTY FSCONFIG_SET_PATH_EMPTY
++# define FSCONFIG_SET_PATH_EMPTY FSCONFIG_SET_PATH_EMPTY
+   FSCONFIG_SET_FD         = 5,    /* Set parameter, supplying an object by fd */
+-#define FSCONFIG_SET_FD FSCONFIG_SET_FD
++# define FSCONFIG_SET_FD FSCONFIG_SET_FD
+   FSCONFIG_CMD_CREATE     = 6,    /* Invoke superblock creation */
+-#define FSCONFIG_CMD_CREATE FSCONFIG_CMD_CREATE
++# define FSCONFIG_CMD_CREATE FSCONFIG_CMD_CREATE
+   FSCONFIG_CMD_RECONFIGURE = 7,   /* Invoke superblock reconfiguration */
+-#define FSCONFIG_CMD_RECONFIGURE FSCONFIG_CMD_RECONFIGURE
++# define FSCONFIG_CMD_RECONFIGURE FSCONFIG_CMD_RECONFIGURE
+ };
++#endif
+ 
+ /* open_tree flags.  */
+ #define OPEN_TREE_CLONE    1         /* Clone the target tree and attach the clone */
+diff --git a/sysdeps/unix/sysv/linux/tst-mount-compile.py b/sysdeps/unix/sysv/linux/tst-mount-compile.py
+new file mode 100755
+index 0000000000..0ec74d4e0b
+--- /dev/null
++++ b/sysdeps/unix/sysv/linux/tst-mount-compile.py
+@@ -0,0 +1,66 @@
++#!/usr/bin/python3
++# Check if glibc provided sys/mount.h can be used along related kernel
++# headers.
++# Copyright (C) 2022 Free Software Foundation, Inc.
++# This file is part of the GNU C Library.
++#
++# The GNU C Library is free software; you can redistribute it and/or
++# modify it under the terms of the GNU Lesser General Public
++# License as published by the Free Software Foundation; either
++# version 2.1 of the License, or (at your option) any later version.
++#
++# The GNU C Library is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++# Lesser General Public License for more details.
++#
++# You should have received a copy of the GNU Lesser General Public
++# License along with the GNU C Library; if not, see
++# <https://www.gnu.org/licenses/>.
++
++import argparse
++import sys
++
++import glibcextract
++
++
++def main():
++    """The main entry point."""
++    parser = argparse.ArgumentParser(
++        description='Check if glibc provided sys/mount.h can be '
++                    ' used along related kernel headers.')
++    parser.add_argument('--cc', metavar='CC',
++                        help='C compiler (including options) to use')
++    args = parser.parse_args()
++
++    if glibcextract.compile_c_snippet(
++            '#include <linux/mount.h>',
++            args.cc).returncode != 0:
++        sys.exit (77)
++
++    def check(testname, snippet):
++        # Add -Werror to catch macro redefinitions and _ISOMAC to avoid
++        # internal glibc definitions.
++        r = glibcextract.compile_c_snippet(snippet, args.cc,
++                '-Werror -D_ISOMAC')
++        if r.returncode != 0:
++            print('error: test {}:\n{}'.format(testname, r.output.decode()))
++        return r.returncode
++
++    status = max(
++        check("sys/mount.h + linux/mount.h",
++              "#include <sys/mount.h>\n"
++              "#include <linux/mount.h>"),
++        check("sys/mount.h + linux/fs.h",
++              "#include <sys/mount.h>\n"
++              "#include <linux/fs.h>"),
++        check("linux/mount.h + sys/mount.h",
++              "#include <linux/mount.h>\n"
++              "#include <sys/mount.h>"),
++        check("linux/fs.h + sys/mount.h",
++              "#include <linux/fs.h>\n"
++              "#include <sys/mount.h>"))
++    sys.exit(status)
++
++if __name__ == '__main__':
++    main()
+-- 
+2.38.1
+
+
+From 3bd3c612e98a53ce60ed972f5cd2b90628b3cba5 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 16 Aug 2022 09:25:23 +0200
+Subject: [PATCH 15/72] Linux: Fix enum fsconfig_command detection in
+ <sys/mount.h>
+
+The #ifdef FSOPEN_CLOEXEC check did not work because the macro
+was always defined in this header prior to the check, so that
+the <linux/mount.h> contents did not matter.
+
+Fixes commit 774058d72942249f71d74e7f2b639f77184160a6
+("linux: Fix sys/mount.h usage with kernel headers").
+
+(cherry picked from commit 2955ef4b7c9b56fcd7abfeddef7ee83c60abff98)
+---
+ sysdeps/unix/sysv/linux/sys/mount.h | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/sysdeps/unix/sysv/linux/sys/mount.h b/sysdeps/unix/sysv/linux/sys/mount.h
+index 2e3fd6a7fe..19841d0738 100644
+--- a/sysdeps/unix/sysv/linux/sys/mount.h
++++ b/sysdeps/unix/sysv/linux/sys/mount.h
+@@ -188,9 +188,6 @@ enum
+ };
+ 
+ 
+-/* fsopen flags.  */
+-#define FSOPEN_CLOEXEC          0x00000001
+-
+ /* fsmount flags.  */
+ #define FSMOUNT_CLOEXEC         0x00000001
+ 
+@@ -261,6 +258,9 @@ enum fsconfig_command
+ };
+ #endif
+ 
++/* fsopen flags.  */
++#define FSOPEN_CLOEXEC          0x00000001
++
+ /* open_tree flags.  */
+ #define OPEN_TREE_CLONE    1         /* Clone the target tree and attach the clone */
+ #define OPEN_TREE_CLOEXEC  O_CLOEXEC /* Close the file on execve() */
+-- 
+2.38.1
+
+
+From b0e7888d1fa2dbd2d9e1645ec8c796abf78880b9 Mon Sep 17 00:00:00 2001
+From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Sun, 28 Aug 2022 16:52:53 -0300
+Subject: [PATCH 16/72] syslog: Fix large messages (BZ#29536)
+
+The a583b6add407c17cd change did not handle large messages that
+would require a heap allocation correctly, where the message itself
+is not take in consideration.
+
+This patch fixes it and extend the tst-syslog to check for large
+messages as well.
+
+Checked on x86_64-linux-gnu.
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit 52a5be0df411ef3ff45c10c7c308cb92993d15b1)
+---
+ misc/syslog.c     |  18 +++---
+ misc/tst-syslog.c | 152 +++++++++++++++++++++++++++++++++++++++-------
+ 2 files changed, 142 insertions(+), 28 deletions(-)
+
+diff --git a/misc/syslog.c b/misc/syslog.c
+index 554089bfc4..b88f66c835 100644
+--- a/misc/syslog.c
++++ b/misc/syslog.c
+@@ -193,28 +193,32 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
+       int vl = __vsnprintf_internal (bufs + l, sizeof bufs - l, fmt, apc,
+                                      mode_flags);
+       if (0 <= vl && vl < sizeof bufs - l)
+-        {
+-          buf = bufs;
+-          bufsize = l + vl;
+-        }
++        buf = bufs;
++      bufsize = l + vl;
+ 
+       va_end (apc);
+     }
+ 
+   if (buf == NULL)
+     {
+-      buf = malloc (l * sizeof (char));
++      buf = malloc ((bufsize + 1) * sizeof (char));
+       if (buf != NULL)
+ 	{
+ 	  /* Tell the cancellation handler to free this buffer.  */
+ 	  clarg.buf = buf;
+ 
+ 	  if (has_ts)
+-	    __snprintf (bufs, sizeof bufs,
++	    __snprintf (buf, l + 1,
+ 			SYSLOG_HEADER (pri, timestamp, &msgoff, pid));
+ 	  else
+-	    __snprintf (bufs, sizeof bufs,
++	    __snprintf (buf, l + 1,
+ 			SYSLOG_HEADER_WITHOUT_TS (pri, &msgoff));
++
++	  va_list apc;
++	  va_copy (apc, ap);
++	  __vsnprintf_internal (buf + l, bufsize - l + 1, fmt, apc,
++				mode_flags);
++	  va_end (apc);
+ 	}
+       else
+         {
+diff --git a/misc/tst-syslog.c b/misc/tst-syslog.c
+index e550d15796..1d332ece53 100644
+--- a/misc/tst-syslog.c
++++ b/misc/tst-syslog.c
+@@ -68,21 +68,19 @@ static const int priorities[] =
+     LOG_DEBUG
+   };
+ 
+-enum
+-  {
+-    ident_length = 64,
+-    msg_length = 64
+-  };
++#define IDENT_LENGTH 64
++#define MSG_LENGTH   1024
+ 
+ #define SYSLOG_MSG_BASE "syslog_message"
+ #define OPENLOG_IDENT   "openlog_ident"
++static char large_message[MSG_LENGTH];
+ 
+ struct msg_t
+   {
+     int priority;
+     int facility;
+-    char ident[ident_length];
+-    char msg[msg_length];
++    char ident[IDENT_LENGTH];
++    char msg[MSG_LENGTH];
+     pid_t pid;
+   };
+ 
+@@ -147,6 +145,37 @@ check_syslog_message (const struct msg_t *msg, int msgnum, int options,
+   return true;
+ }
+ 
++static void
++send_syslog_large (int options)
++{
++  int facility = LOG_USER;
++  int priority = LOG_INFO;
++
++  syslog (facility | priority, "%s %d %d", large_message, facility,
++	  priority);
++}
++
++static void
++send_vsyslog_large (int options)
++{
++  int facility = LOG_USER;
++  int priority = LOG_INFO;
++
++  call_vsyslog (facility | priority, "%s %d %d", large_message, facility,
++		priority);
++}
++
++static bool
++check_syslog_message_large (const struct msg_t *msg, int msgnum, int options,
++			    pid_t pid)
++{
++  TEST_COMPARE (msg->facility, LOG_USER);
++  TEST_COMPARE (msg->priority, LOG_INFO);
++  TEST_COMPARE_STRING (msg->msg, large_message);
++
++  return false;
++}
++
+ static void
+ send_openlog (int options)
+ {
+@@ -179,6 +208,17 @@ send_openlog (int options)
+   closelog ();
+ }
+ 
++static void
++send_openlog_large (int options)
++{
++  /* Define a non-default IDENT and a not default facility.  */
++  openlog (OPENLOG_IDENT, options, LOG_LOCAL0);
++
++  syslog (LOG_INFO, "%s %d %d", large_message, LOG_LOCAL0, LOG_INFO);
++
++  closelog ();
++}
++
+ static bool
+ check_openlog_message (const struct msg_t *msg, int msgnum,
+                        int options, pid_t pid)
+@@ -189,7 +229,7 @@ check_openlog_message (const struct msg_t *msg, int msgnum,
+   int expected_priority = priorities[msgnum % array_length (priorities)];
+   TEST_COMPARE (msg->priority, expected_priority);
+ 
+-  char expected_ident[ident_length];
++  char expected_ident[IDENT_LENGTH];
+   snprintf (expected_ident, sizeof (expected_ident), "%s%s%.0d%s:",
+             OPENLOG_IDENT,
+             options & LOG_PID ? "[" : "",
+@@ -211,15 +251,38 @@ check_openlog_message (const struct msg_t *msg, int msgnum,
+   return true;
+ }
+ 
++static bool
++check_openlog_message_large (const struct msg_t *msg, int msgnum,
++			     int options, pid_t pid)
++{
++  char expected_ident[IDENT_LENGTH];
++  snprintf (expected_ident, sizeof (expected_ident), "%s%s%.0d%s:",
++            OPENLOG_IDENT,
++            options & LOG_PID ? "[" : "",
++            options & LOG_PID ? pid : 0,
++            options & LOG_PID ? "]" : "");
++
++  TEST_COMPARE_STRING (msg->ident, expected_ident);
++  TEST_COMPARE_STRING (msg->msg, large_message);
++  TEST_COMPARE (msg->priority, LOG_INFO);
++  TEST_COMPARE (msg->facility, LOG_LOCAL0);
++
++  return false;
++}
++
+ static struct msg_t
+ parse_syslog_msg (const char *msg)
+ {
+   struct msg_t r = { .pid = -1 };
+   int number;
+ 
++#define STRINPUT(size)  XSTRINPUT(size)
++#define XSTRINPUT(size) "%" # size "s"
++
+   /* The message in the form:
+-     <179>Apr  8 14:51:19 tst-syslog: syslog message 176 3  */
+-  int n = sscanf (msg, "<%3d>%*s %*d %*d:%*d:%*d %32s %64s %*d %*d",
++     <179>Apr  8 14:51:19  tst-syslog: message 176 3  */
++  int n = sscanf (msg, "<%3d>%*s %*d %*d:%*d:%*d " STRINPUT(IDENT_LENGTH)
++		       " " STRINPUT(MSG_LENGTH) " %*d %*d",
+                   &number, r.ident, r.msg);
+   TEST_COMPARE (n, 3);
+ 
+@@ -246,7 +309,7 @@ parse_syslog_console (const char *msg)
+ 
+   /* The message in the form:
+      openlog_ident: syslog_message 128 0  */
+-  int n = sscanf (msg, "%32s %64s %d %d",
++  int n = sscanf (msg, STRINPUT(IDENT_LENGTH) " " STRINPUT(MSG_LENGTH) " %d %d",
+       r.ident, r.msg, &facility, &priority);
+   TEST_COMPARE (n, 4);
+ 
+@@ -281,7 +344,7 @@ check_syslog_udp (void (*syslog_send)(int), int options,
+   int msgnum = 0;
+   while (1)
+     {
+-      char buf[512];
++      char buf[2048];
+       size_t l = xrecvfrom (server_udp, buf, sizeof (buf), 0,
+                             (struct sockaddr *) &addr, &addrlen);
+       buf[l] = '\0';
+@@ -325,7 +388,7 @@ check_syslog_tcp (void (*syslog_send)(int), int options,
+ 
+   int client_tcp = xaccept (server_tcp, NULL, NULL);
+ 
+-  char buf[512], *rb = buf;
++  char buf[2048], *rb = buf;
+   size_t rbl = sizeof (buf);
+   size_t prl = 0;  /* Track the size of the partial record.  */
+   int msgnum = 0;
+@@ -393,20 +456,34 @@ check_syslog_console_read (FILE *fp)
+ }
+ 
+ static void
+-check_syslog_console (void)
++check_syslog_console_read_large (FILE *fp)
++{
++  char buf[2048];
++  TEST_VERIFY (fgets (buf, sizeof (buf), fp) != NULL);
++  struct msg_t msg = parse_syslog_console (buf);
++
++  TEST_COMPARE_STRING (msg.ident, OPENLOG_IDENT ":");
++  TEST_COMPARE_STRING (msg.msg, large_message);
++  TEST_COMPARE (msg.priority, LOG_INFO);
++  TEST_COMPARE (msg.facility, LOG_LOCAL0);
++}
++
++static void
++check_syslog_console (void (*syslog_send)(int),
++		      void (*syslog_check)(FILE *fp))
+ {
+   xmkfifo (_PATH_CONSOLE, 0666);
+ 
+   pid_t sender_pid = xfork ();
+   if (sender_pid == 0)
+     {
+-      send_openlog (LOG_CONS);
++      syslog_send (LOG_CONS);
+       _exit (0);
+     }
+ 
+   {
+     FILE *fp = xfopen (_PATH_CONSOLE, "r+");
+-    check_syslog_console_read (fp);
++    syslog_check (fp);
+     xfclose (fp);
+   }
+ 
+@@ -425,16 +502,28 @@ send_openlog_callback (void *clousure)
+ }
+ 
+ static void
+-check_syslog_perror (void)
++send_openlog_callback_large (void *clousure)
++{
++  int options = *(int *) clousure;
++  send_openlog_large (options);
++}
++
++static void
++check_syslog_perror (bool large)
+ {
+   struct support_capture_subprocess result;
+-  result = support_capture_subprocess (send_openlog_callback,
++  result = support_capture_subprocess (large
++				       ? send_openlog_callback_large
++				       : send_openlog_callback,
+                                        &(int){LOG_PERROR});
+ 
+   FILE *mfp = fmemopen (result.err.buffer, result.err.length, "r");
+   if (mfp == NULL)
+     FAIL_EXIT1 ("fmemopen: %m");
+-  check_syslog_console_read (mfp);
++  if (large)
++    check_syslog_console_read_large (mfp);
++  else
++    check_syslog_console_read (mfp);
+   xfclose (mfp);
+ 
+   support_capture_subprocess_check (&result, "tst-openlog-child", 0,
+@@ -462,10 +551,31 @@ do_test (void)
+   check_syslog_tcp (send_openlog, LOG_PID, check_openlog_message);
+ 
+   /* Check the LOG_CONS option.  */
+-  check_syslog_console ();
++  check_syslog_console (send_openlog, check_syslog_console_read);
+ 
+   /* Check the LOG_PERROR option.  */
+-  check_syslog_perror ();
++  check_syslog_perror (false);
++
++  /* Similar tests as before, but with a large message to trigger the
++     syslog path that uses dynamically allocated memory.  */
++  memset (large_message, 'a', sizeof large_message - 1);
++  large_message[sizeof large_message - 1] = '\0';
++
++  check_syslog_udp (send_syslog_large, 0, check_syslog_message_large);
++  check_syslog_tcp (send_syslog_large, 0, check_syslog_message_large);
++
++  check_syslog_udp (send_vsyslog_large, 0, check_syslog_message_large);
++  check_syslog_tcp (send_vsyslog_large, 0, check_syslog_message_large);
++
++  check_syslog_udp (send_openlog_large, 0, check_openlog_message_large);
++  check_syslog_tcp (send_openlog_large, 0, check_openlog_message_large);
++
++  check_syslog_udp (send_openlog_large, LOG_PID, check_openlog_message_large);
++  check_syslog_tcp (send_openlog_large, LOG_PID, check_openlog_message_large);
++
++  check_syslog_console (send_openlog_large, check_syslog_console_read_large);
++
++  check_syslog_perror (true);
+ 
+   return 0;
+ }
+-- 
+2.38.1
+
+
+From 924e4f3eaa502ce82fccf8537f021a796d158771 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Fri, 26 Aug 2022 21:15:43 +0200
+Subject: [PATCH 17/72] elf: Call __libc_early_init for reused namespaces (bug
+ 29528)
+
+libc_map is never reset to NULL, neither during dlclose nor on a
+dlopen call which reuses the namespace structure.  As a result, if a
+namespace is reused, its libc is not initialized properly.  The most
+visible result is a crash in the <ctype.h> functions.
+
+To prevent similar bugs on namespace reuse from surfacing,
+unconditionally initialize the chosen namespace to zero using memset.
+
+(cherry picked from commit d0e357ff45a75553dee3b17ed7d303bfa544f6fe)
+---
+ NEWS                         |  1 +
+ elf/Makefile                 | 25 ++++++++++++++++++
+ elf/dl-open.c                | 13 ++++++----
+ elf/tst-dlmopen-twice-mod1.c | 37 ++++++++++++++++++++++++++
+ elf/tst-dlmopen-twice-mod2.c | 50 ++++++++++++++++++++++++++++++++++++
+ elf/tst-dlmopen-twice.c      | 34 ++++++++++++++++++++++++
+ 6 files changed, 155 insertions(+), 5 deletions(-)
+ create mode 100644 elf/tst-dlmopen-twice-mod1.c
+ create mode 100644 elf/tst-dlmopen-twice-mod2.c
+ create mode 100644 elf/tst-dlmopen-twice.c
+
+diff --git a/NEWS b/NEWS
+index ae30900bbc..6d31e5abba 100644
+--- a/NEWS
++++ b/NEWS
+@@ -13,6 +13,7 @@ The following bugs are resolved with this release:
+   [29446] _dlopen now ignores dl_caller argument in static mode
+   [29485] Linux: Terminate subprocess on late failure in tst-pidfd
+   [29490] alpha: New __brk_call implementation is broken
++  [29528] elf: Call __libc_early_init for reused namespaces
+ 
+ \f
+ Version 2.36
+diff --git a/elf/Makefile b/elf/Makefile
+index fd77d0c7c8..43353a4b08 100644
+--- a/elf/Makefile
++++ b/elf/Makefile
+@@ -408,6 +408,7 @@ tests += \
+   tst-dlmopen4 \
+   tst-dlmopen-dlerror \
+   tst-dlmopen-gethostbyname \
++  tst-dlmopen-twice \
+   tst-dlopenfail \
+   tst-dlopenfail-2 \
+   tst-dlopenrpath \
+@@ -834,6 +835,8 @@ modules-names += \
+   tst-dlmopen1mod \
+   tst-dlmopen-dlerror-mod \
+   tst-dlmopen-gethostbyname-mod \
++  tst-dlmopen-twice-mod1 \
++  tst-dlmopen-twice-mod2 \
+   tst-dlopenfaillinkmod \
+   tst-dlopenfailmod1 \
+   tst-dlopenfailmod2 \
+@@ -2967,3 +2970,25 @@ $(objpfx)tst-tls-allocation-failure-static-patched.out: \
+ 	grep -q '^Fatal glibc error: Cannot allocate TLS block$$' $@ \
+ 	  && grep -q '^status: 127$$' $@; \
+ 	  $(evaluate-test)
++
++$(objpfx)tst-audit-tlsdesc: $(objpfx)tst-audit-tlsdesc-mod1.so \
++			    $(objpfx)tst-audit-tlsdesc-mod2.so \
++			    $(shared-thread-library)
++ifeq (yes,$(have-mtls-dialect-gnu2))
++# The test is valid for all TLS types, but we want to exercise GNU2
++# TLS if possible.
++CFLAGS-tst-audit-tlsdesc-mod1.c += -mtls-dialect=gnu2
++CFLAGS-tst-audit-tlsdesc-mod2.c += -mtls-dialect=gnu2
++endif
++$(objpfx)tst-audit-tlsdesc-dlopen: $(shared-thread-library)
++$(objpfx)tst-audit-tlsdesc-dlopen.out: $(objpfx)tst-audit-tlsdesc-mod1.so \
++				       $(objpfx)tst-audit-tlsdesc-mod2.so
++$(objpfx)tst-audit-tlsdesc-mod1.so: $(objpfx)tst-audit-tlsdesc-mod2.so
++$(objpfx)tst-audit-tlsdesc.out: $(objpfx)tst-auditmod-tlsdesc.so
++tst-audit-tlsdesc-ENV = LD_AUDIT=$(objpfx)tst-auditmod-tlsdesc.so
++$(objpfx)tst-audit-tlsdesc-dlopen.out: $(objpfx)tst-auditmod-tlsdesc.so
++tst-audit-tlsdesc-dlopen-ENV = LD_AUDIT=$(objpfx)tst-auditmod-tlsdesc.so
++
++$(objpfx)tst-dlmopen-twice.out: \
++  $(objpfx)tst-dlmopen-twice-mod1.so \
++  $(objpfx)tst-dlmopen-twice-mod2.so
+diff --git a/elf/dl-open.c b/elf/dl-open.c
+index a23e65926b..46e8066fd8 100644
+--- a/elf/dl-open.c
++++ b/elf/dl-open.c
+@@ -844,11 +844,14 @@ _dl_open (const char *file, int mode, const void *caller_dlopen, Lmid_t nsid,
+ 	  _dl_signal_error (EINVAL, file, NULL, N_("\
+ no more namespaces available for dlmopen()"));
+ 	}
+-      else if (nsid == GL(dl_nns))
+-	{
+-	  __rtld_lock_initialize (GL(dl_ns)[nsid]._ns_unique_sym_table.lock);
+-	  ++GL(dl_nns);
+-	}
++
++      if (nsid == GL(dl_nns))
++	++GL(dl_nns);
++
++      /* Initialize the new namespace.  Most members are
++	 zero-initialized, only the lock needs special treatment.  */
++      memset (&GL(dl_ns)[nsid], 0, sizeof (GL(dl_ns)[nsid]));
++      __rtld_lock_initialize (GL(dl_ns)[nsid]._ns_unique_sym_table.lock);
+ 
+       _dl_debug_update (nsid)->r_state = RT_CONSISTENT;
+     }
+diff --git a/elf/tst-dlmopen-twice-mod1.c b/elf/tst-dlmopen-twice-mod1.c
+new file mode 100644
+index 0000000000..0eaf04948c
+--- /dev/null
++++ b/elf/tst-dlmopen-twice-mod1.c
+@@ -0,0 +1,37 @@
++/* Initialization of libc after dlmopen/dlclose/dlmopen (bug 29528).  Module 1.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <stdio.h>
++
++static void __attribute__ ((constructor))
++init (void)
++{
++  puts ("info: tst-dlmopen-twice-mod1.so loaded");
++  fflush (stdout);
++}
++
++static void __attribute__ ((destructor))
++fini (void)
++{
++  puts ("info: tst-dlmopen-twice-mod1.so about to be unloaded");
++  fflush (stdout);
++}
++
++/* Large allocation.  The second module does not have this, so it
++   should load libc at a different address.  */
++char large_allocate[16 * 1024 * 1024];
+diff --git a/elf/tst-dlmopen-twice-mod2.c b/elf/tst-dlmopen-twice-mod2.c
+new file mode 100644
+index 0000000000..40c6c01f96
+--- /dev/null
++++ b/elf/tst-dlmopen-twice-mod2.c
+@@ -0,0 +1,50 @@
++/* Initialization of libc after dlmopen/dlclose/dlmopen (bug 29528).  Module 2.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <ctype.h>
++#include <stdio.h>
++
++static void __attribute__ ((constructor))
++init (void)
++{
++  puts ("info: tst-dlmopen-twice-mod2.so loaded");
++  fflush (stdout);
++}
++
++static void __attribute__ ((destructor))
++fini (void)
++{
++  puts ("info: tst-dlmopen-twice-mod2.so about to be unloaded");
++  fflush (stdout);
++}
++
++int
++run_check (void)
++{
++  puts ("info: about to call isalpha");
++  fflush (stdout);
++
++  volatile char ch = 'a';
++  if (!isalpha (ch))
++    {
++      puts ("error: isalpha ('a') is not true");
++      fflush (stdout);
++      return 1;
++    }
++  return 0;
++}
+diff --git a/elf/tst-dlmopen-twice.c b/elf/tst-dlmopen-twice.c
+new file mode 100644
+index 0000000000..449f3c8fa9
+--- /dev/null
++++ b/elf/tst-dlmopen-twice.c
+@@ -0,0 +1,34 @@
++/* Initialization of libc after dlmopen/dlclose/dlmopen (bug 29528).  Main.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <support/xdlfcn.h>
++#include <support/check.h>
++
++static int
++do_test (void)
++{
++  void *handle = xdlmopen (LM_ID_NEWLM, "tst-dlmopen-twice-mod1.so", RTLD_NOW);
++  xdlclose (handle);
++  handle = xdlmopen (LM_ID_NEWLM, "tst-dlmopen-twice-mod2.so", RTLD_NOW);
++  int (*run_check) (void) = xdlsym (handle, "run_check");
++  TEST_COMPARE (run_check (), 0);
++  xdlclose (handle);
++  return 0;
++}
++
++#include <support/test-driver.c>
+-- 
+2.38.1
+
+
+From 3c791f2031ca8f6b99e96b774ed1c505ceb93595 Mon Sep 17 00:00:00 2001
+From: Raphael Moreira Zinsly <rzinsly@linux.ibm.com>
+Date: Wed, 24 Aug 2022 11:43:37 -0300
+Subject: [PATCH 18/72] Apply asm redirections in wchar.h before first use
+
+Similar to d0fa09a770, but for wchar.h.  Fixes [BZ #27087] by applying
+all long double related asm redirections before using functions in
+bits/wchar2.h.
+Moves the function declarations from wcsmbs/bits/wchar2.h to a new file
+wcsmbs/bits/wchar2-decl.h that will be included first in wcsmbs/wchar.h.
+
+Tested with build-many-glibcs.py.
+Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
+
+(cherry picked from commit c7509d49c4e8fa494120c5ead21338559dad16f5)
+---
+ include/bits/wchar2-decl.h |   1 +
+ wcsmbs/Makefile            |   5 +-
+ wcsmbs/bits/wchar2-decl.h  | 124 +++++++++++++++++++++++++++++++++++++
+ wcsmbs/bits/wchar2.h       |  72 ---------------------
+ wcsmbs/wchar.h             |  11 +++-
+ 5 files changed, 137 insertions(+), 76 deletions(-)
+ create mode 100644 include/bits/wchar2-decl.h
+ create mode 100644 wcsmbs/bits/wchar2-decl.h
+
+diff --git a/include/bits/wchar2-decl.h b/include/bits/wchar2-decl.h
+new file mode 100644
+index 0000000000..00b1b93342
+--- /dev/null
++++ b/include/bits/wchar2-decl.h
+@@ -0,0 +1 @@
++#include <wcsmbs/bits/wchar2-decl.h>
+diff --git a/wcsmbs/Makefile b/wcsmbs/Makefile
+index 3d19d5556f..4af102a3f6 100644
+--- a/wcsmbs/Makefile
++++ b/wcsmbs/Makefile
+@@ -22,8 +22,9 @@ subdir	:= wcsmbs
+ 
+ include ../Makeconfig
+ 
+-headers	:= wchar.h bits/wchar.h bits/wchar2.h bits/wchar-ldbl.h uchar.h \
+-	   bits/types/__mbstate_t.h bits/types/mbstate_t.h bits/types/wint_t.h
++headers	:= wchar.h bits/wchar.h bits/wchar2.h bits/wchar2-decl.h \
++	   bits/wchar-ldbl.h uchar.h bits/types/__mbstate_t.h \
++	   bits/types/mbstate_t.h bits/types/wint_t.h
+ 
+ routines := wcscat wcschr wcscmp wcscpy wcscspn wcsdup wcslen wcsncat \
+ 	    wcsncmp wcsncpy wcspbrk wcsrchr wcsspn wcstok wcsstr wmemchr \
+diff --git a/wcsmbs/bits/wchar2-decl.h b/wcsmbs/bits/wchar2-decl.h
+new file mode 100644
+index 0000000000..8e1735c33b
+--- /dev/null
++++ b/wcsmbs/bits/wchar2-decl.h
+@@ -0,0 +1,124 @@
++/* Checking macros for wchar functions.  Declarations only.
++   Copyright (C) 2004-2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#ifndef _BITS_WCHAR2_DECL_H
++#define _BITS_WCHAR2_DECL_H 1
++
++#ifndef _WCHAR_H
++# error "Never include <bits/wchar2-decl.h> directly; use <wchar.h> instead."
++#endif
++
++
++extern wchar_t *__wmemcpy_chk (wchar_t *__restrict __s1,
++			       const wchar_t *__restrict __s2, size_t __n,
++			       size_t __ns1) __THROW;
++extern wchar_t *__wmemmove_chk (wchar_t *__s1, const wchar_t *__s2,
++				size_t __n, size_t __ns1) __THROW;
++
++
++#ifdef __USE_GNU
++
++extern wchar_t *__wmempcpy_chk (wchar_t *__restrict __s1,
++				const wchar_t *__restrict __s2, size_t __n,
++				size_t __ns1) __THROW;
++
++#endif
++
++
++extern wchar_t *__wmemset_chk (wchar_t *__s, wchar_t __c, size_t __n,
++			       size_t __ns) __THROW;
++extern wchar_t *__wcscpy_chk (wchar_t *__restrict __dest,
++			      const wchar_t *__restrict __src,
++			      size_t __n) __THROW;
++extern wchar_t *__wcpcpy_chk (wchar_t *__restrict __dest,
++			      const wchar_t *__restrict __src,
++			      size_t __destlen) __THROW;
++extern wchar_t *__wcsncpy_chk (wchar_t *__restrict __dest,
++			       const wchar_t *__restrict __src, size_t __n,
++			       size_t __destlen) __THROW;
++extern wchar_t *__wcpncpy_chk (wchar_t *__restrict __dest,
++			       const wchar_t *__restrict __src, size_t __n,
++			       size_t __destlen) __THROW;
++extern wchar_t *__wcscat_chk (wchar_t *__restrict __dest,
++			      const wchar_t *__restrict __src,
++			      size_t __destlen) __THROW;
++extern wchar_t *__wcsncat_chk (wchar_t *__restrict __dest,
++			       const wchar_t *__restrict __src,
++			       size_t __n, size_t __destlen) __THROW;
++extern int __swprintf_chk (wchar_t *__restrict __s, size_t __n,
++			   int __flag, size_t __s_len,
++			   const wchar_t *__restrict __format, ...)
++     __THROW /* __attribute__ ((__format__ (__wprintf__, 5, 6))) */;
++extern int __vswprintf_chk (wchar_t *__restrict __s, size_t __n,
++			    int __flag, size_t __s_len,
++			    const wchar_t *__restrict __format,
++			    __gnuc_va_list __arg)
++     __THROW /* __attribute__ ((__format__ (__wprintf__, 5, 0))) */;
++
++#if __USE_FORTIFY_LEVEL > 1
++
++extern int __fwprintf_chk (__FILE *__restrict __stream, int __flag,
++			   const wchar_t *__restrict __format, ...);
++extern int __wprintf_chk (int __flag, const wchar_t *__restrict __format,
++			  ...);
++extern int __vfwprintf_chk (__FILE *__restrict __stream, int __flag,
++			    const wchar_t *__restrict __format,
++			    __gnuc_va_list __ap);
++extern int __vwprintf_chk (int __flag, const wchar_t *__restrict __format,
++			   __gnuc_va_list __ap);
++
++#endif
++
++extern wchar_t *__fgetws_chk (wchar_t *__restrict __s, size_t __size, int __n,
++			      __FILE *__restrict __stream) __wur;
++
++#ifdef __USE_GNU
++
++extern wchar_t *__fgetws_unlocked_chk (wchar_t *__restrict __s, size_t __size,
++				       int __n, __FILE *__restrict __stream)
++       __wur;
++
++#endif
++
++extern size_t __wcrtomb_chk (char *__restrict __s, wchar_t __wchar,
++			     mbstate_t *__restrict __p,
++			     size_t __buflen) __THROW __wur;
++extern size_t __mbsrtowcs_chk (wchar_t *__restrict __dst,
++			       const char **__restrict __src,
++			       size_t __len, mbstate_t *__restrict __ps,
++			       size_t __dstlen) __THROW;
++extern size_t __wcsrtombs_chk (char *__restrict __dst,
++			       const wchar_t **__restrict __src,
++			       size_t __len, mbstate_t *__restrict __ps,
++			       size_t __dstlen) __THROW;
++
++#ifdef	__USE_XOPEN2K8
++
++extern size_t __mbsnrtowcs_chk (wchar_t *__restrict __dst,
++				const char **__restrict __src, size_t __nmc,
++				size_t __len, mbstate_t *__restrict __ps,
++				size_t __dstlen) __THROW;
++extern size_t __wcsnrtombs_chk (char *__restrict __dst,
++				const wchar_t **__restrict __src,
++				size_t __nwc, size_t __len,
++				mbstate_t *__restrict __ps, size_t __dstlen)
++       __THROW;
++
++#endif
++
++#endif /* bits/wchar2-decl.h.  */
+diff --git a/wcsmbs/bits/wchar2.h b/wcsmbs/bits/wchar2.h
+index 0e017f458b..3f110efe57 100644
+--- a/wcsmbs/bits/wchar2.h
++++ b/wcsmbs/bits/wchar2.h
+@@ -21,9 +21,6 @@
+ #endif
+ 
+ 
+-extern wchar_t *__wmemcpy_chk (wchar_t *__restrict __s1,
+-			       const wchar_t *__restrict __s2, size_t __n,
+-			       size_t __ns1) __THROW;
+ extern wchar_t *__REDIRECT_NTH (__wmemcpy_alias,
+ 				(wchar_t *__restrict __s1,
+ 				 const wchar_t *__restrict __s2, size_t __n),
+@@ -45,8 +42,6 @@ __NTH (wmemcpy (wchar_t *__restrict __s1, const wchar_t *__restrict __s2,
+ }
+ 
+ 
+-extern wchar_t *__wmemmove_chk (wchar_t *__s1, const wchar_t *__s2,
+-				size_t __n, size_t __ns1) __THROW;
+ extern wchar_t *__REDIRECT_NTH (__wmemmove_alias, (wchar_t *__s1,
+ 						   const wchar_t *__s2,
+ 						   size_t __n), wmemmove);
+@@ -66,9 +61,6 @@ __NTH (wmemmove (wchar_t *__s1, const wchar_t *__s2, size_t __n))
+ 
+ 
+ #ifdef __USE_GNU
+-extern wchar_t *__wmempcpy_chk (wchar_t *__restrict __s1,
+-				const wchar_t *__restrict __s2, size_t __n,
+-				size_t __ns1) __THROW;
+ extern wchar_t *__REDIRECT_NTH (__wmempcpy_alias,
+ 				(wchar_t *__restrict __s1,
+ 				 const wchar_t *__restrict __s2,
+@@ -91,8 +83,6 @@ __NTH (wmempcpy (wchar_t *__restrict __s1, const wchar_t *__restrict __s2,
+ #endif
+ 
+ 
+-extern wchar_t *__wmemset_chk (wchar_t *__s, wchar_t __c, size_t __n,
+-			       size_t __ns) __THROW;
+ extern wchar_t *__REDIRECT_NTH (__wmemset_alias, (wchar_t *__s, wchar_t __c,
+ 						  size_t __n), wmemset);
+ extern wchar_t *__REDIRECT_NTH (__wmemset_chk_warn,
+@@ -110,9 +100,6 @@ __NTH (wmemset (wchar_t *__s, wchar_t __c, size_t __n))
+ }
+ 
+ 
+-extern wchar_t *__wcscpy_chk (wchar_t *__restrict __dest,
+-			      const wchar_t *__restrict __src,
+-			      size_t __n) __THROW;
+ extern wchar_t *__REDIRECT_NTH (__wcscpy_alias,
+ 				(wchar_t *__restrict __dest,
+ 				 const wchar_t *__restrict __src), wcscpy);
+@@ -127,9 +114,6 @@ __NTH (wcscpy (wchar_t *__restrict __dest, const wchar_t *__restrict __src))
+ }
+ 
+ 
+-extern wchar_t *__wcpcpy_chk (wchar_t *__restrict __dest,
+-			      const wchar_t *__restrict __src,
+-			      size_t __destlen) __THROW;
+ extern wchar_t *__REDIRECT_NTH (__wcpcpy_alias,
+ 				(wchar_t *__restrict __dest,
+ 				 const wchar_t *__restrict __src), wcpcpy);
+@@ -144,9 +128,6 @@ __NTH (wcpcpy (wchar_t *__restrict __dest, const wchar_t *__restrict __src))
+ }
+ 
+ 
+-extern wchar_t *__wcsncpy_chk (wchar_t *__restrict __dest,
+-			       const wchar_t *__restrict __src, size_t __n,
+-			       size_t __destlen) __THROW;
+ extern wchar_t *__REDIRECT_NTH (__wcsncpy_alias,
+ 				(wchar_t *__restrict __dest,
+ 				 const wchar_t *__restrict __src,
+@@ -168,9 +149,6 @@ __NTH (wcsncpy (wchar_t *__restrict __dest, const wchar_t *__restrict __src,
+ }
+ 
+ 
+-extern wchar_t *__wcpncpy_chk (wchar_t *__restrict __dest,
+-			       const wchar_t *__restrict __src, size_t __n,
+-			       size_t __destlen) __THROW;
+ extern wchar_t *__REDIRECT_NTH (__wcpncpy_alias,
+ 				(wchar_t *__restrict __dest,
+ 				 const wchar_t *__restrict __src,
+@@ -192,9 +170,6 @@ __NTH (wcpncpy (wchar_t *__restrict __dest, const wchar_t *__restrict __src,
+ }
+ 
+ 
+-extern wchar_t *__wcscat_chk (wchar_t *__restrict __dest,
+-			      const wchar_t *__restrict __src,
+-			      size_t __destlen) __THROW;
+ extern wchar_t *__REDIRECT_NTH (__wcscat_alias,
+ 				(wchar_t *__restrict __dest,
+ 				 const wchar_t *__restrict __src), wcscat);
+@@ -209,9 +184,6 @@ __NTH (wcscat (wchar_t *__restrict __dest, const wchar_t *__restrict __src))
+ }
+ 
+ 
+-extern wchar_t *__wcsncat_chk (wchar_t *__restrict __dest,
+-			       const wchar_t *__restrict __src,
+-			       size_t __n, size_t __destlen) __THROW;
+ extern wchar_t *__REDIRECT_NTH (__wcsncat_alias,
+ 				(wchar_t *__restrict __dest,
+ 				 const wchar_t *__restrict __src,
+@@ -228,10 +200,6 @@ __NTH (wcsncat (wchar_t *__restrict __dest, const wchar_t *__restrict __src,
+ }
+ 
+ 
+-extern int __swprintf_chk (wchar_t *__restrict __s, size_t __n,
+-			   int __flag, size_t __s_len,
+-			   const wchar_t *__restrict __format, ...)
+-     __THROW /* __attribute__ ((__format__ (__wprintf__, 5, 6))) */;
+ 
+ extern int __REDIRECT_NTH_LDBL (__swprintf_alias,
+ 				(wchar_t *__restrict __s, size_t __n,
+@@ -258,11 +226,6 @@ __NTH (swprintf (wchar_t *__restrict __s, size_t __n,
+    : swprintf (s, n, __VA_ARGS__))
+ #endif
+ 
+-extern int __vswprintf_chk (wchar_t *__restrict __s, size_t __n,
+-			    int __flag, size_t __s_len,
+-			    const wchar_t *__restrict __format,
+-			    __gnuc_va_list __arg)
+-     __THROW /* __attribute__ ((__format__ (__wprintf__, 5, 0))) */;
+ 
+ extern int __REDIRECT_NTH_LDBL (__vswprintf_alias,
+ 				(wchar_t *__restrict __s, size_t __n,
+@@ -283,16 +246,6 @@ __NTH (vswprintf (wchar_t *__restrict __s, size_t __n,
+ 
+ #if __USE_FORTIFY_LEVEL > 1
+ 
+-extern int __fwprintf_chk (__FILE *__restrict __stream, int __flag,
+-			   const wchar_t *__restrict __format, ...);
+-extern int __wprintf_chk (int __flag, const wchar_t *__restrict __format,
+-			  ...);
+-extern int __vfwprintf_chk (__FILE *__restrict __stream, int __flag,
+-			    const wchar_t *__restrict __format,
+-			    __gnuc_va_list __ap);
+-extern int __vwprintf_chk (int __flag, const wchar_t *__restrict __format,
+-			   __gnuc_va_list __ap);
+-
+ # ifdef __va_arg_pack
+ __fortify_function int
+ wprintf (const wchar_t *__restrict __fmt, ...)
+@@ -328,8 +281,6 @@ vfwprintf (__FILE *__restrict __stream,
+ 
+ #endif
+ 
+-extern wchar_t *__fgetws_chk (wchar_t *__restrict __s, size_t __size, int __n,
+-			      __FILE *__restrict __stream) __wur;
+ extern wchar_t *__REDIRECT (__fgetws_alias,
+ 			    (wchar_t *__restrict __s, int __n,
+ 			     __FILE *__restrict __stream), fgetws) __wur;
+@@ -351,9 +302,6 @@ fgetws (wchar_t *__restrict __s, int __n, __FILE *__restrict __stream)
+ }
+ 
+ #ifdef __USE_GNU
+-extern wchar_t *__fgetws_unlocked_chk (wchar_t *__restrict __s, size_t __size,
+-				       int __n, __FILE *__restrict __stream)
+-  __wur;
+ extern wchar_t *__REDIRECT (__fgetws_unlocked_alias,
+ 			    (wchar_t *__restrict __s, int __n,
+ 			     __FILE *__restrict __stream), fgetws_unlocked)
+@@ -379,9 +327,6 @@ fgetws_unlocked (wchar_t *__restrict __s, int __n, __FILE *__restrict __stream)
+ #endif
+ 
+ 
+-extern size_t __wcrtomb_chk (char *__restrict __s, wchar_t __wchar,
+-			     mbstate_t *__restrict __p,
+-			     size_t __buflen) __THROW __wur;
+ extern size_t __REDIRECT_NTH (__wcrtomb_alias,
+ 			      (char *__restrict __s, wchar_t __wchar,
+ 			       mbstate_t *__restrict __ps), wcrtomb) __wur;
+@@ -404,10 +349,6 @@ __NTH (wcrtomb (char *__restrict __s, wchar_t __wchar,
+ }
+ 
+ 
+-extern size_t __mbsrtowcs_chk (wchar_t *__restrict __dst,
+-			       const char **__restrict __src,
+-			       size_t __len, mbstate_t *__restrict __ps,
+-			       size_t __dstlen) __THROW;
+ extern size_t __REDIRECT_NTH (__mbsrtowcs_alias,
+ 			      (wchar_t *__restrict __dst,
+ 			       const char **__restrict __src,
+@@ -431,10 +372,6 @@ __NTH (mbsrtowcs (wchar_t *__restrict __dst, const char **__restrict __src,
+ }
+ 
+ 
+-extern size_t __wcsrtombs_chk (char *__restrict __dst,
+-			       const wchar_t **__restrict __src,
+-			       size_t __len, mbstate_t *__restrict __ps,
+-			       size_t __dstlen) __THROW;
+ extern size_t __REDIRECT_NTH (__wcsrtombs_alias,
+ 			      (char *__restrict __dst,
+ 			       const wchar_t **__restrict __src,
+@@ -458,10 +395,6 @@ __NTH (wcsrtombs (char *__restrict __dst, const wchar_t **__restrict __src,
+ 
+ 
+ #ifdef	__USE_XOPEN2K8
+-extern size_t __mbsnrtowcs_chk (wchar_t *__restrict __dst,
+-				const char **__restrict __src, size_t __nmc,
+-				size_t __len, mbstate_t *__restrict __ps,
+-				size_t __dstlen) __THROW;
+ extern size_t __REDIRECT_NTH (__mbsnrtowcs_alias,
+ 			      (wchar_t *__restrict __dst,
+ 			       const char **__restrict __src, size_t __nmc,
+@@ -485,11 +418,6 @@ __NTH (mbsnrtowcs (wchar_t *__restrict __dst, const char **__restrict __src,
+ }
+ 
+ 
+-extern size_t __wcsnrtombs_chk (char *__restrict __dst,
+-				const wchar_t **__restrict __src,
+-				size_t __nwc, size_t __len,
+-				mbstate_t *__restrict __ps, size_t __dstlen)
+-     __THROW;
+ extern size_t __REDIRECT_NTH (__wcsnrtombs_alias,
+ 			      (char *__restrict __dst,
+ 			       const wchar_t **__restrict __src,
+diff --git a/wcsmbs/wchar.h b/wcsmbs/wchar.h
+index 5d6a40853d..c1321c7518 100644
+--- a/wcsmbs/wchar.h
++++ b/wcsmbs/wchar.h
+@@ -864,14 +864,21 @@ extern size_t wcsftime_l (wchar_t *__restrict __s, size_t __maxsize,
+ 
+ /* Define some macros helping to catch buffer overflows.  */
+ #if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function
+-# include <bits/wchar2.h>
++/* Declare all functions from bits/wchar2-decl.h first.  */
++# include <bits/wchar2-decl.h>
+ #endif
+ 
+-#include <bits/floatn.h>
++/* The following headers provide asm redirections.  These redirections must
++   appear before the first usage of these functions, e.g. in bits/wchar.h.  */
+ #if defined __LDBL_COMPAT || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1
+ # include <bits/wchar-ldbl.h>
+ #endif
+ 
++#if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function
++/* Now include the function definitions and redirects too.  */
++# include <bits/wchar2.h>
++#endif
++
+ __END_DECLS
+ 
+ #endif /* wchar.h  */
+-- 
+2.38.1
+
+
+From b3736d1a3c60a3ec9959bf3b38794958546bf6a2 Mon Sep 17 00:00:00 2001
+From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Tue, 30 Aug 2022 13:35:52 -0300
+Subject: [PATCH 19/72] elf: Restore how vDSO dependency is printed with
+ LD_TRACE_LOADED_OBJECTS (BZ #29539)
+
+The d7703d3176d225d5743b21811d888619eba39e82 changed how vDSO like
+dependencies are printed, instead of just the name and address it
+follows other libraries mode and prints 'name => path'.
+
+Unfortunately, this broke some ldd consumer that uses the output to
+filter out the program's dependencies.  For instance CMake
+bundleutilities module [1], where GetPrequirite uses the regex to filter
+out 'name => path' [2].
+
+This patch restore the previous way to print just the name and the
+mapping address.
+
+Checked on x86_64-linux-gnu.
+
+[1] https://github.com/Kitware/CMake/tree/master/Tests/BundleUtilities
+[2] https://github.com/Kitware/CMake/blob/master/Modules/GetPrerequisites.cmake#L733
+
+Reviewed-by: Florian Weimer <fweimer@redhat.com>
+(cherry picked from commit 1e903124cec4492463d075c6c061a2a772db77bf)
+---
+ NEWS       | 2 +-
+ elf/rtld.c | 6 ++++++
+ 2 files changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/NEWS b/NEWS
+index 6d31e5abba..757ded85e0 100644
+--- a/NEWS
++++ b/NEWS
+@@ -14,7 +14,7 @@ The following bugs are resolved with this release:
+   [29485] Linux: Terminate subprocess on late failure in tst-pidfd
+   [29490] alpha: New __brk_call implementation is broken
+   [29528] elf: Call __libc_early_init for reused namespaces
+-
++  [29539] libc: LD_TRACE_LOADED_OBJECTS changed how vDSO library are
+ \f
+ Version 2.36
+ 
+diff --git a/elf/rtld.c b/elf/rtld.c
+index cbbaf4a331..3e771a93d8 100644
+--- a/elf/rtld.c
++++ b/elf/rtld.c
+@@ -2122,6 +2122,12 @@ dl_main (const ElfW(Phdr) *phdr,
+ 	    if (l->l_faked)
+ 	      /* The library was not found.  */
+ 	      _dl_printf ("\t%s => not found\n",  l->l_libname->name);
++	    else if (strcmp (l->l_libname->name, l->l_name) == 0)
++	      /* Print vDSO like libraries without duplicate name.  Some
++		 consumers depend of this format.  */
++	      _dl_printf ("\t%s (0x%0*Zx)\n", l->l_libname->name,
++			  (int) sizeof l->l_map_start * 2,
++			  (size_t) l->l_map_start);
+ 	    else
+ 	      _dl_printf ("\t%s => %s (0x%0*Zx)\n",
+ 			  DSO_FILENAME (l->l_libname->name),
+-- 
+2.38.1
+
+
+From 645d94808aaa90fb1b20a25ff70bb50d9eb1d55b Mon Sep 17 00:00:00 2001
+From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Mon, 5 Sep 2022 09:34:39 -0300
+Subject: [PATCH 20/72] syslog: Remove extra whitespace between timestamp and
+ message (BZ#29544)
+
+The rfc3164 clear states that a single space character must follow
+the timestamp field.
+
+Checked on x86_64-linux-gnu.
+---
+ misc/syslog.c     | 2 +-
+ misc/tst-syslog.c | 9 ++++++---
+ 2 files changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/misc/syslog.c b/misc/syslog.c
+index b88f66c835..f67d4b58a4 100644
+--- a/misc/syslog.c
++++ b/misc/syslog.c
+@@ -167,7 +167,7 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
+ 		  _nl_C_locobj_ptr);
+ 
+ #define SYSLOG_HEADER(__pri, __timestamp, __msgoff, pid) \
+-  "<%d>%s %n%s%s%.0d%s: ",                               \
++  "<%d>%s%n%s%s%.0d%s: ",                                \
+   __pri, __timestamp, __msgoff,                          \
+   LogTag == NULL ? __progname : LogTag,                  \
+   "[" + (pid == 0), pid, "]" + (pid == 0)
+diff --git a/misc/tst-syslog.c b/misc/tst-syslog.c
+index 1d332ece53..3560b518a2 100644
+--- a/misc/tst-syslog.c
++++ b/misc/tst-syslog.c
+@@ -275,16 +275,19 @@ parse_syslog_msg (const char *msg)
+ {
+   struct msg_t r = { .pid = -1 };
+   int number;
++  int wsb, wsa;
+ 
+ #define STRINPUT(size)  XSTRINPUT(size)
+ #define XSTRINPUT(size) "%" # size "s"
+ 
+   /* The message in the form:
+-     <179>Apr  8 14:51:19  tst-syslog: message 176 3  */
+-  int n = sscanf (msg, "<%3d>%*s %*d %*d:%*d:%*d " STRINPUT(IDENT_LENGTH)
++     <179>Apr  8 14:51:19 tst-syslog: message 176 3  */
++  int n = sscanf (msg, "<%3d>%*s %*d %*d:%*d:%*d%n %n" STRINPUT(IDENT_LENGTH)
+ 		       " " STRINPUT(MSG_LENGTH) " %*d %*d",
+-                  &number, r.ident, r.msg);
++                  &number, &wsb, &wsa, r.ident, r.msg);
+   TEST_COMPARE (n, 3);
++  /* It should only one space between timestamp and message.  */
++  TEST_COMPARE (wsa - wsb, 1);
+ 
+   r.facility = number & LOG_FACMASK;
+   r.priority = number & LOG_PRIMASK;
+-- 
+2.38.1
+
+
+From b46412fb17e8bfc6c9e1f144bbcf833320c80f8a Mon Sep 17 00:00:00 2001
+From: Siddhesh Poyarekar <siddhesh@sourceware.org>
+Date: Tue, 6 Sep 2022 09:31:50 -0400
+Subject: [PATCH 21/72] Add NEWS entry for CVE-2022-39046
+
+(cherry picked from commit 76fe56020e7ef354685b2284580ac1630c078a2b)
+---
+ NEWS | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/NEWS b/NEWS
+index 757ded85e0..10a7613f09 100644
+--- a/NEWS
++++ b/NEWS
+@@ -7,6 +7,13 @@ using `glibc' in the "product" field.
+ \f
+ Version 2.36.1
+ 
++Security related changes:
++
++  CVE-2022-39046: When the syslog function is passed a crafted input
++  string larger than 1024 bytes, it reads uninitialized memory from the
++  heap and prints it to the target log file, potentially revealing a
++  portion of the contents of the heap.
++
+ The following bugs are resolved with this release:
+ 
+   [28846] CMSG_NXTHDR may trigger -Wstrict-overflow warning
+-- 
+2.38.1
+
+
+From c399271c10bd00714504e8d4dfbec8aebf996dd4 Mon Sep 17 00:00:00 2001
+From: Fabian Vogt <fvogt@suse.de>
+Date: Wed, 27 Jul 2022 11:44:07 +0200
+Subject: [PATCH 22/72] nscd: Fix netlink cache invalidation if epoll is used
+ [BZ #29415]
+
+Processes cache network interface information such as whether IPv4 or IPv6
+are enabled. This is only checked again if the "netlink timestamp" provided
+by nscd changed, which is triggered by netlink socket activity.
+
+However, in the epoll handler for the netlink socket, it was missed to
+assign the new timestamp to the nscd database. The handler for plain poll
+did that properly, copy that over.
+
+This bug caused that e.g. processes which started before network
+configuration got unusuable addresses from getaddrinfo, like IPv6 only even
+though only IPv4 is available:
+https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1041
+
+It's a bit hard to reproduce, so I verified this by checking the timestamp
+on calls to __check_pf manually. Without this patch it's stuck at 1, now
+it's increasing on network changes as expected.
+
+Signed-off-by: Fabian Vogt <fvogt@suse.de>
+(cherry picked from commit 02ca25fef2785974011e9c5beecc99b900b69fd7)
+---
+ NEWS               | 1 +
+ nscd/connections.c | 3 ++-
+ 2 files changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/NEWS b/NEWS
+index 10a7613f09..9360596fcc 100644
+--- a/NEWS
++++ b/NEWS
+@@ -17,6 +17,7 @@ Security related changes:
+ The following bugs are resolved with this release:
+ 
+   [28846] CMSG_NXTHDR may trigger -Wstrict-overflow warning
++  [29415] nscd: Fix netlink cache invalidation if epoll is used
+   [29446] _dlopen now ignores dl_caller argument in static mode
+   [29485] Linux: Terminate subprocess on late failure in tst-pidfd
+   [29490] alpha: New __brk_call implementation is broken
+diff --git a/nscd/connections.c b/nscd/connections.c
+index 61d1674eb4..531d2e83df 100644
+--- a/nscd/connections.c
++++ b/nscd/connections.c
+@@ -2284,7 +2284,8 @@ main_loop_epoll (int efd)
+ 					     sizeof (buf))) != -1)
+ 	      ;
+ 
+-	    __bump_nl_timestamp ();
++	    dbs[hstdb].head->extra_data[NSCD_HST_IDX_CONF_TIMESTAMP]
++	      = __bump_nl_timestamp ();
+ 	  }
+ # endif
+ 	else
+-- 
+2.38.1
+
+
+From 9d7eebde8f134ea25bdb9ab61bc74d5e71e41288 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 30 Aug 2022 10:02:49 +0200
+Subject: [PATCH 23/72] resolv: Add tst-resolv-byaddr for testing reverse
+ lookup
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit 0b99828d54e5d1fc8f5ad3edf5ba262ad2e9c5b0)
+---
+ resolv/Makefile                      |   2 +
+ resolv/tst-resolv-byaddr.c           | 326 +++++++++++++++++++++++++++
+ resolv/tst-resolv-maybe_insert_sig.h |  32 +++
+ 3 files changed, 360 insertions(+)
+ create mode 100644 resolv/tst-resolv-byaddr.c
+ create mode 100644 resolv/tst-resolv-maybe_insert_sig.h
+
+diff --git a/resolv/Makefile b/resolv/Makefile
+index 5b15321f9b..98b10d97a0 100644
+--- a/resolv/Makefile
++++ b/resolv/Makefile
+@@ -91,6 +91,7 @@ tests += \
+   tst-res_hnok \
+   tst-resolv-basic \
+   tst-resolv-binary \
++  tst-resolv-byaddr \
+   tst-resolv-edns \
+   tst-resolv-network \
+   tst-resolv-noaaaa \
+@@ -260,6 +261,7 @@ $(objpfx)tst-resolv-ai_idn-nolibidn2.out: \
+   $(gen-locales) $(objpfx)tst-no-libidn2.so
+ $(objpfx)tst-resolv-basic: $(objpfx)libresolv.so $(shared-thread-library)
+ $(objpfx)tst-resolv-binary: $(objpfx)libresolv.so $(shared-thread-library)
++$(objpfx)tst-resolv-byaddr: $(objpfx)libresolv.so $(shared-thread-library)
+ $(objpfx)tst-resolv-edns: $(objpfx)libresolv.so $(shared-thread-library)
+ $(objpfx)tst-resolv-network: $(objpfx)libresolv.so $(shared-thread-library)
+ $(objpfx)tst-resolv-res_init: $(objpfx)libresolv.so
+diff --git a/resolv/tst-resolv-byaddr.c b/resolv/tst-resolv-byaddr.c
+new file mode 100644
+index 0000000000..6299e89837
+--- /dev/null
++++ b/resolv/tst-resolv-byaddr.c
+@@ -0,0 +1,326 @@
++/* Test reverse DNS lookup.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <arpa/inet.h>
++#include <errno.h>
++#include <netdb.h>
++#include <stdbool.h>
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
++#include <support/check.h>
++#include <support/check_nss.h>
++#include <support/next_to_fault.h>
++#include <support/resolv_test.h>
++#include <support/support.h>
++
++#include "tst-resolv-maybe_insert_sig.h"
++
++/* QNAME format:
++
++   ADDRESSES.CNAMES...(lots of 0s)...8.b.d.0.1.0.0.2.ip6.arpa.
++   CNAMES|ADDRESSES.2.0.192.in-addr-arpa.
++
++   For the IPv4 reverse lookup, the address count is in the lower
++   bits.
++
++   CNAMES is the length of the CNAME chain, ADDRESSES is the number of
++   addresses in the response.  The special value 15 means that there
++   are no addresses, and the RCODE is NXDOMAIN.  */
++static void
++response (const struct resolv_response_context *ctx,
++          struct resolv_response_builder *b,
++          const char *qname, uint16_t qclass, uint16_t qtype)
++{
++  TEST_COMPARE (qclass, C_IN);
++  TEST_COMPARE (qtype, T_PTR);
++
++  unsigned int addresses, cnames, bits;
++  char *tail;
++  if (strstr (qname, "ip6.arpa") != NULL
++      && sscanf (qname, "%x.%x.%ms", &addresses, &cnames, &tail) == 3)
++    TEST_COMPARE_STRING (tail, "\
++0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa");
++  else if (sscanf (qname, "%u.%ms", &bits, &tail) == 2)
++    {
++      TEST_COMPARE_STRING (tail, "2.0.192.in-addr.arpa");
++      addresses = bits & 0x0f;
++      cnames = bits >> 4;
++    }
++  else
++    FAIL_EXIT1 ("invalid QNAME: %s", qname);
++  free (tail);
++
++  int rcode;
++  if (addresses == 15)
++    {
++      /* Special case: Use no addresses with NXDOMAIN response.  */
++      rcode = ns_r_nxdomain;
++      addresses = 0;
++    }
++  else
++    rcode = 0;
++
++  struct resolv_response_flags flags = { .rcode = rcode };
++  resolv_response_init (b, flags);
++  resolv_response_add_question (b, qname, qclass, qtype);
++  resolv_response_section (b, ns_s_an);
++  maybe_insert_sig (b, qname);
++
++  /* Provide the requested number of CNAME records.  */
++  char *previous_name = (char *) qname;
++  for (int unique = 0; unique < cnames; ++unique)
++    {
++      resolv_response_open_record (b, previous_name, qclass, T_CNAME, 60);
++      char *new_name = xasprintf ("%d.alias.example", unique);
++      resolv_response_add_name (b, new_name);
++      resolv_response_close_record (b);
++
++      maybe_insert_sig (b, qname);
++
++      if (previous_name != qname)
++        free (previous_name);
++      previous_name = new_name;
++    }
++
++  for (int unique = 0; unique < addresses; ++unique)
++    {
++      resolv_response_open_record (b, previous_name, qclass, T_PTR, 60);
++      char *ptr = xasprintf ("unique-%d.cnames-%u.addresses-%u.example",
++                             unique, cnames, addresses);
++      resolv_response_add_name (b, ptr);
++      free (ptr);
++      resolv_response_close_record (b);
++    }
++
++  if (previous_name != qname)
++    free (previous_name);
++}
++
++/* Used to check that gethostbyaddr_r does not write past the buffer
++   end.  */
++static struct support_next_to_fault ntf;
++
++/* Perform a gethostbyaddr call and check the result.  */
++static void
++check_gethostbyaddr (const char *address, const char *expected)
++{
++  unsigned char bytes[16];
++  unsigned int byteslen;
++  int family;
++  if (strchr (address, ':') != NULL)
++    {
++      family = AF_INET6;
++      byteslen = 16;
++    }
++  else
++    {
++      family = AF_INET;
++      byteslen = 4;
++    }
++  TEST_COMPARE (inet_pton (family, address, bytes), 1);
++
++  struct hostent *e = gethostbyaddr (bytes, byteslen, family);
++  check_hostent (address, e, expected);
++
++  if (e == NULL)
++    return;
++
++  /* Try gethostbyaddr_r with increasing sizes until success.  First
++     compute a reasonable minimum buffer size, to avoid many pointless
++     attempts.  */
++  size_t minimum_size = strlen (e->h_name);
++  for (int i = 0; e->h_addr_list[i] != NULL; ++i)
++    minimum_size += e->h_length + sizeof (char *);
++  for (int i = 0; e->h_aliases[i] != NULL; ++i)
++    minimum_size += strlen (e->h_aliases[i]) + 1 + sizeof (char *);
++
++  /* Gradually increase the size until success.  */
++  for (size_t size = minimum_size; size < ntf.length; ++size)
++    {
++      struct hostent result;
++      int herrno;
++      int ret = gethostbyaddr_r (bytes, byteslen, family, &result,
++                                 ntf.buffer + ntf.length - size, size,
++                                 &e, &herrno);
++      if (ret == ERANGE)
++        /* Retry with larger size.  */
++        TEST_COMPARE (herrno, NETDB_INTERNAL);
++      else if (ret == 0)
++        {
++         TEST_VERIFY (size > minimum_size);
++         check_hostent (address, e, expected);
++         return;
++        }
++      else
++        FAIL_EXIT1 ("Unexpected gethostbyaddr_r failure: %d", ret);
++    }
++
++  FAIL_EXIT1 ("gethostbyaddr_r always failed for: %s", address);
++}
++
++/* Perform a getnameinfo call and check the result.  */
++static void
++check_getnameinfo (const char *address, const char *expected)
++{
++  struct sockaddr_in sin = { };
++  struct sockaddr_in6 sin6 = { };
++  void *sa;
++  socklen_t salen;
++  if (strchr (address, ':') != NULL)
++    {
++      sin6.sin6_family = AF_INET6;
++      TEST_COMPARE (inet_pton (AF_INET6, address, &sin6.sin6_addr), 1);
++      sin6.sin6_port = htons (80);
++      sa = &sin6;
++      salen = sizeof (sin6);
++    }
++  else
++    {
++      sin.sin_family = AF_INET;
++      TEST_COMPARE (inet_pton (AF_INET, address, &sin.sin_addr), 1);
++      sin.sin_port = htons (80);
++      sa = &sin;
++      salen = sizeof (sin);
++    }
++
++  char host[64];
++  char service[64];
++  int ret = getnameinfo (sa, salen, host,
++                         sizeof (host), service, sizeof (service),
++                         NI_NAMEREQD | NI_NUMERICSERV);
++  switch (ret)
++    {
++    case 0:
++      TEST_COMPARE_STRING (host, expected);
++      TEST_COMPARE_STRING (service, "80");
++      break;
++    case EAI_SYSTEM:
++      TEST_COMPARE_STRING (strerror (errno), expected);
++      break;
++    default:
++      TEST_COMPARE_STRING (gai_strerror (ret), expected);
++    }
++}
++
++static int
++do_test (void)
++{
++  /* Some reasonably upper bound for the maximum response size.  */
++  ntf = support_next_to_fault_allocate (4096);
++
++  struct resolv_test *obj = resolv_test_start
++    ((struct resolv_redirect_config)
++     {
++       .response_callback = response
++     });
++
++  for (int do_insert_sig = 0; do_insert_sig < 2; ++do_insert_sig)
++    {
++      insert_sig = do_insert_sig;
++
++      /* No PTR record, RCODE=0.  */
++      check_gethostbyaddr ("192.0.2.0", "error: NO_RECOVERY\n");
++      check_getnameinfo ("192.0.2.0", "Name or service not known");
++      check_gethostbyaddr ("192.0.2.16", "error: NO_RECOVERY\n");
++      check_getnameinfo ("192.0.2.16", "Name or service not known");
++      check_gethostbyaddr ("192.0.2.32", "error: NO_RECOVERY\n");
++      check_getnameinfo ("192.0.2.32", "Name or service not known");
++      check_gethostbyaddr ("2001:db8::", "error: NO_RECOVERY\n");
++      check_getnameinfo ("2001:db8::", "Name or service not known");
++      check_gethostbyaddr ("2001:db8::10", "error: NO_RECOVERY\n");
++      check_getnameinfo ("2001:db8::10", "Name or service not known");
++      check_gethostbyaddr ("2001:db8::20", "error: NO_RECOVERY\n");
++      check_getnameinfo ("2001:db8::20", "Name or service not known");
++
++      /* No PTR record, NXDOMAIN.  */
++      check_gethostbyaddr ("192.0.2.15", "error: HOST_NOT_FOUND\n");
++      check_getnameinfo ("192.0.2.15", "Name or service not known");
++      check_gethostbyaddr ("192.0.2.31", "error: HOST_NOT_FOUND\n");
++      check_getnameinfo ("192.0.2.31", "Name or service not known");
++      check_gethostbyaddr ("192.0.2.47", "error: HOST_NOT_FOUND\n");
++      check_getnameinfo ("192.0.2.47", "Name or service not known");
++      check_gethostbyaddr ("2001:db8::f", "error: HOST_NOT_FOUND\n");
++      check_getnameinfo ("2001:db8::f", "Name or service not known");
++      check_gethostbyaddr ("2001:db8::1f", "error: HOST_NOT_FOUND\n");
++      check_getnameinfo ("2001:db8::1f", "Name or service not known");
++      check_gethostbyaddr ("2001:db8::2f", "error: HOST_NOT_FOUND\n");
++      check_getnameinfo ("2001:db8::2f", "Name or service not known");
++
++      /* Actual response data.  Only the first PTR record is returned.  */
++      check_gethostbyaddr ("192.0.2.1",
++                           "name: unique-0.cnames-0.addresses-1.example\n"
++                           "address: 192.0.2.1\n");
++      check_getnameinfo ("192.0.2.1",
++                         "unique-0.cnames-0.addresses-1.example");
++      check_gethostbyaddr ("192.0.2.17",
++                           "name: unique-0.cnames-1.addresses-1.example\n"
++                           "address: 192.0.2.17\n");
++      check_getnameinfo ("192.0.2.17",
++                         "unique-0.cnames-1.addresses-1.example");
++      check_gethostbyaddr ("192.0.2.18",
++                           "name: unique-0.cnames-1.addresses-2.example\n"
++                           "address: 192.0.2.18\n");
++      check_getnameinfo ("192.0.2.18",
++                         "unique-0.cnames-1.addresses-2.example");
++      check_gethostbyaddr ("192.0.2.33",
++                           "name: unique-0.cnames-2.addresses-1.example\n"
++                           "address: 192.0.2.33\n");
++      check_getnameinfo ("192.0.2.33",
++                         "unique-0.cnames-2.addresses-1.example");
++      check_gethostbyaddr ("192.0.2.34",
++                           "name: unique-0.cnames-2.addresses-2.example\n"
++                           "address: 192.0.2.34\n");
++      check_getnameinfo ("192.0.2.34",
++                         "unique-0.cnames-2.addresses-2.example");
++
++      /* Same for IPv6 addresses.  */
++      check_gethostbyaddr ("2001:db8::1",
++                           "name: unique-0.cnames-0.addresses-1.example\n"
++                           "address: 2001:db8::1\n");
++      check_getnameinfo ("2001:db8::1",
++                         "unique-0.cnames-0.addresses-1.example");
++      check_gethostbyaddr ("2001:db8::11",
++                           "name: unique-0.cnames-1.addresses-1.example\n"
++                           "address: 2001:db8::11\n");
++      check_getnameinfo ("2001:db8::11",
++                         "unique-0.cnames-1.addresses-1.example");
++      check_gethostbyaddr ("2001:db8::12",
++                           "name: unique-0.cnames-1.addresses-2.example\n"
++                           "address: 2001:db8::12\n");
++      check_getnameinfo ("2001:db8::12",
++                         "unique-0.cnames-1.addresses-2.example");
++      check_gethostbyaddr ("2001:db8::21",
++                           "name: unique-0.cnames-2.addresses-1.example\n"
++                           "address: 2001:db8::21\n");
++      check_getnameinfo ("2001:db8::21",
++                         "unique-0.cnames-2.addresses-1.example");
++      check_gethostbyaddr ("2001:db8::22",
++                           "name: unique-0.cnames-2.addresses-2.example\n"
++                           "address: 2001:db8::22\n");
++      check_getnameinfo ("2001:db8::22",
++                         "unique-0.cnames-2.addresses-2.example");
++    }
++
++  resolv_test_end (obj);
++
++  support_next_to_fault_free (&ntf);
++  return 0;
++}
++
++#include <support/test-driver.c>
+diff --git a/resolv/tst-resolv-maybe_insert_sig.h b/resolv/tst-resolv-maybe_insert_sig.h
+new file mode 100644
+index 0000000000..05725225af
+--- /dev/null
++++ b/resolv/tst-resolv-maybe_insert_sig.h
+@@ -0,0 +1,32 @@
++/* Code snippet for optionally inserting ignored SIG records in resolver tests.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++/* Set to true for an alternative pass that inserts (ignored) SIG
++   records.  This does not alter the response, so this property is not
++   encoded in the QNAME.  The variable needs to be volatile because
++   leaf attributes tell GCC that the response function is not
++   called.  */
++static volatile bool insert_sig;
++
++static void
++maybe_insert_sig (struct resolv_response_builder *b, const char *owner)
++{
++  resolv_response_open_record (b, owner, C_IN, T_SIG, 60);
++  resolv_response_add_data (b, "", 1);
++  resolv_response_close_record (b);
++}
+-- 
+2.38.1
+
+
+From bffc33e90ed57a4786c676dda92d935e3613e031 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 30 Aug 2022 10:02:49 +0200
+Subject: [PATCH 24/72] resolv: Add tst-resolv-aliases
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit 87aa98aa80627553a66bdcad2701fd6307723645)
+---
+ resolv/Makefile             |   2 +
+ resolv/tst-resolv-aliases.c | 254 ++++++++++++++++++++++++++++++++++++
+ 2 files changed, 256 insertions(+)
+ create mode 100644 resolv/tst-resolv-aliases.c
+
+diff --git a/resolv/Makefile b/resolv/Makefile
+index 98b10d97a0..0038bb7028 100644
+--- a/resolv/Makefile
++++ b/resolv/Makefile
+@@ -89,6 +89,7 @@ tests += \
+   tst-ns_name_pton \
+   tst-res_hconf_reorder \
+   tst-res_hnok \
++  tst-resolv-aliases \
+   tst-resolv-basic \
+   tst-resolv-binary \
+   tst-resolv-byaddr \
+@@ -259,6 +260,7 @@ $(objpfx)tst-resolv-ai_idn.out: $(gen-locales)
+ $(objpfx)tst-resolv-ai_idn-latin1.out: $(gen-locales)
+ $(objpfx)tst-resolv-ai_idn-nolibidn2.out: \
+   $(gen-locales) $(objpfx)tst-no-libidn2.so
++$(objpfx)tst-resolv-aliases: $(objpfx)libresolv.so $(shared-thread-library)
+ $(objpfx)tst-resolv-basic: $(objpfx)libresolv.so $(shared-thread-library)
+ $(objpfx)tst-resolv-binary: $(objpfx)libresolv.so $(shared-thread-library)
+ $(objpfx)tst-resolv-byaddr: $(objpfx)libresolv.so $(shared-thread-library)
+diff --git a/resolv/tst-resolv-aliases.c b/resolv/tst-resolv-aliases.c
+new file mode 100644
+index 0000000000..b212823aa0
+--- /dev/null
++++ b/resolv/tst-resolv-aliases.c
+@@ -0,0 +1,254 @@
++/* Test alias handling (mainly for gethostbyname).
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <array_length.h>
++#include <arpa/inet.h>
++#include <netdb.h>
++#include <stdbool.h>
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
++#include <support/check.h>
++#include <support/check_nss.h>
++#include <support/resolv_test.h>
++#include <support/support.h>
++
++#include "tst-resolv-maybe_insert_sig.h"
++
++/* QNAME format:
++
++   aADDRESSES-cCNAMES.example.net
++
++   CNAMES is the length of the CNAME chain, ADDRESSES is the number of
++   addresses in the response.  The special value 255 means that there
++   are no addresses, and the RCODE is NXDOMAIN.  */
++static void
++response (const struct resolv_response_context *ctx,
++          struct resolv_response_builder *b,
++          const char *qname, uint16_t qclass, uint16_t qtype)
++{
++  TEST_COMPARE (qclass, C_IN);
++  if (qtype != T_A)
++    TEST_COMPARE (qtype, T_AAAA);
++
++  unsigned int addresses, cnames;
++  char *tail;
++  if (sscanf (qname, "a%u-c%u%ms", &addresses, &cnames, &tail) == 3)
++    {
++      if (strcmp (tail, ".example.com") == 0
++          || strcmp (tail, ".example.net.example.net") == 0
++          || strcmp (tail, ".example.net.example.com") == 0)
++        /* These only happen after NXDOMAIN.  */
++        TEST_VERIFY (addresses == 255);
++      else if (strcmp (tail, ".example.net") != 0)
++        FAIL_EXIT1 ("invalid QNAME: %s", qname);
++    }
++  free (tail);
++
++  int rcode;
++  if (addresses == 255)
++    {
++      /* Special case: Use no addresses with NXDOMAIN response.  */
++      rcode = ns_r_nxdomain;
++      addresses = 0;
++    }
++  else
++    rcode = 0;
++
++  struct resolv_response_flags flags = { .rcode = rcode };
++  resolv_response_init (b, flags);
++  resolv_response_add_question (b, qname, qclass, qtype);
++  resolv_response_section (b, ns_s_an);
++  maybe_insert_sig (b, qname);
++
++  /* Provide the requested number of CNAME records.  */
++  char *previous_name = (char *) qname;
++  for (int unique = 0; unique < cnames; ++unique)
++    {
++      resolv_response_open_record (b, previous_name, qclass, T_CNAME, 60);
++      char *new_name = xasprintf ("%d.alias.example", unique);
++      resolv_response_add_name (b, new_name);
++      resolv_response_close_record (b);
++
++      maybe_insert_sig (b, qname);
++
++      if (previous_name != qname)
++        free (previous_name);
++      previous_name = new_name;
++    }
++
++  for (int unique = 0; unique < addresses; ++unique)
++    {
++      resolv_response_open_record (b, previous_name, qclass, qtype, 60);
++
++      if (qtype == T_A)
++        {
++          char ipv4[4] = {192, 0, 2, 1 + unique};
++          resolv_response_add_data (b, &ipv4, sizeof (ipv4));
++        }
++      else if (qtype == T_AAAA)
++        {
++          char ipv6[16] =
++            {
++              0x20, 0x01, 0xd, 0xb8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
++              1 + unique
++            };
++          resolv_response_add_data (b, &ipv6, sizeof (ipv6));
++        }
++      resolv_response_close_record (b);
++    }
++
++  if (previous_name != qname)
++    free (previous_name);
++}
++
++static char *
++make_qname (bool do_search, int cnames, int addresses)
++{
++  return xasprintf ("a%d-c%d%s",
++                    addresses, cnames, do_search ? "" : ".example.net");
++}
++
++static void
++check_cnames_failure (int af, bool do_search, int cnames, int addresses)
++{
++  char *qname = make_qname (do_search, cnames, addresses);
++
++  struct hostent *e;
++  if (af == AF_UNSPEC)
++    e = gethostbyname (qname);
++  else
++    e = gethostbyname2 (qname, af);
++
++  if (addresses == 0)
++    check_hostent (qname, e, "error: NO_RECOVERY\n");
++  else
++    check_hostent (qname, e, "error: HOST_NOT_FOUND\n");
++
++  free (qname);
++}
++
++static void
++check (int af, bool do_search, int cnames, int addresses)
++{
++  char *qname = make_qname (do_search, cnames, addresses);
++  char *fqdn = make_qname (false, cnames, addresses);
++
++  struct hostent *e;
++  if (af == AF_UNSPEC)
++    e = gethostbyname (qname);
++  else
++    e = gethostbyname2 (qname, af);
++  if (e == NULL)
++    FAIL_EXIT1 ("unexpected failure for %d, %d, %d", af, cnames, addresses);
++
++  if (af == AF_UNSPEC || af == AF_INET)
++    {
++      TEST_COMPARE (e->h_addrtype, AF_INET);
++      TEST_COMPARE (e->h_length, 4);
++    }
++  else
++    {
++      TEST_COMPARE (e->h_addrtype, AF_INET6);
++      TEST_COMPARE (e->h_length, 16);
++    }
++
++  for (int i = 0; i < addresses; ++i)
++    {
++      char ipv4[4] = {192, 0, 2, 1 + i};
++      char ipv6[16] =
++        { 0x20, 0x01, 0xd, 0xb8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 + i };
++      char *expected = e->h_addrtype == AF_INET ? ipv4 : ipv6;
++      TEST_COMPARE_BLOB (e->h_addr_list[i], e->h_length,
++                         expected, e->h_length);
++    }
++  TEST_VERIFY (e->h_addr_list[addresses] == NULL);
++
++
++  if (cnames == 0)
++    {
++      /* QNAME is fully qualified.  */
++      TEST_COMPARE_STRING (e->h_name, fqdn);
++      TEST_VERIFY (e->h_aliases[0] == NULL);
++    }
++  else
++   {
++     /* Fully-qualified QNAME is demoted to an aliases.  */
++     TEST_COMPARE_STRING (e->h_aliases[0], fqdn);
++
++     for (int i = 1; i <= cnames; ++i)
++       {
++         char *expected = xasprintf ("%d.alias.example", i - 1);
++         if (i == cnames)
++           TEST_COMPARE_STRING (e->h_name, expected);
++         else
++           TEST_COMPARE_STRING (e->h_aliases[i], expected);
++         free (expected);
++       }
++     TEST_VERIFY (e->h_aliases[cnames] == NULL);
++   }
++
++  free (fqdn);
++  free (qname);
++}
++
++static int
++do_test (void)
++{
++  struct resolv_test *obj = resolv_test_start
++    ((struct resolv_redirect_config)
++     {
++       .response_callback = response,
++       .search = { "example.net", "example.com" },
++     });
++
++  static const int families[] = { AF_UNSPEC, AF_INET, AF_INET6 };
++
++  for (int do_insert_sig = 0; do_insert_sig < 2; ++do_insert_sig)
++    {
++      insert_sig = do_insert_sig;
++
++      /* If do_search is true, a bare host name (for example, a1-c1)
++         is used.  This exercises search path processing and FQDN
++         qualification.  */
++      for (int do_search = 0; do_search < 2; ++do_search)
++        for (const int *paf = families; paf != array_end (families); ++paf)
++          {
++            for (int cnames = 0; cnames <= 100; ++cnames)
++              {
++                check_cnames_failure (*paf, do_search, cnames, 0);
++                /* Now with NXDOMAIN responses.  */
++                check_cnames_failure (*paf, do_search, cnames, 255);
++              }
++
++            for (int cnames = 0; cnames <= 10; ++cnames)
++              for (int addresses = 1; addresses <= 10; ++addresses)
++                check (*paf, do_search, cnames, addresses);
++
++            /* The current implementation is limited to 47 aliases.
++               Addresses do not have such a limit.  */
++            check (*paf, do_search, 47, 60);
++          }
++    }
++
++  resolv_test_end (obj);
++
++  return 0;
++}
++
++#include <support/test-driver.c>
+-- 
+2.38.1
+
+
+From 3c9b4004e2dccc9ca2ace078a0106f9d682fd1a0 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 30 Aug 2022 10:02:49 +0200
+Subject: [PATCH 25/72] resolv: Add internal __res_binary_hnok function
+
+During package parsing, only the binary representation is available,
+and it is convenient to check that directly for conformance with host
+name requirements.
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit c79327bf00a4be6d60259227acc78ef80ead3622)
+---
+ include/resolv.h           |  3 +++
+ resolv/res-name-checking.c | 14 +++++++++-----
+ 2 files changed, 12 insertions(+), 5 deletions(-)
+
+diff --git a/include/resolv.h b/include/resolv.h
+index 3590b6f496..4dbbac3800 100644
+--- a/include/resolv.h
++++ b/include/resolv.h
+@@ -70,5 +70,8 @@ libc_hidden_proto (__libc_res_nameinquery)
+ extern __typeof (__res_queriesmatch) __libc_res_queriesmatch;
+ libc_hidden_proto (__libc_res_queriesmatch)
+ 
++/* Variant of res_hnok which operates on binary (but uncompressed) names.  */
++bool __res_binary_hnok (const unsigned char *dn) attribute_hidden;
++
+ # endif /* _RESOLV_H_ && !_ISOMAC */
+ #endif
+diff --git a/resolv/res-name-checking.c b/resolv/res-name-checking.c
+index 07a412d8ff..213edceaf3 100644
+--- a/resolv/res-name-checking.c
++++ b/resolv/res-name-checking.c
+@@ -138,6 +138,12 @@ binary_leading_dash (const unsigned char *dn)
+   return dn[0] > 0 && dn[1] == '-';
+ }
+ 
++bool
++__res_binary_hnok (const unsigned char *dn)
++{
++  return !binary_leading_dash (dn) && binary_hnok (dn);
++}
++
+ /* Return 1 if res_hnok is a valid host name.  Labels must only
+    contain [0-9a-zA-Z_-] characters, and the name must not start with
+    a '-'.  The latter is to avoid confusion with program options.  */
+@@ -145,11 +151,9 @@ int
+ ___res_hnok (const char *dn)
+ {
+   unsigned char buf[NS_MAXCDNAME];
+-  if (!printable_string (dn)
+-      || __ns_name_pton (dn, buf, sizeof (buf)) < 0
+-      || binary_leading_dash (buf))
+-    return 0;
+-  return binary_hnok (buf);
++  return (printable_string (dn)
++	  && __ns_name_pton (dn, buf, sizeof (buf)) >= 0
++	  && __res_binary_hnok (buf));
+ }
+ versioned_symbol (libc, ___res_hnok, res_hnok, GLIBC_2_34);
+ versioned_symbol (libc, ___res_hnok, __libc_res_hnok, GLIBC_PRIVATE);
+-- 
+2.38.1
+
+
+From 20ec40a51d3a8e9487f40dc9352d158def23ea8c Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 30 Aug 2022 10:02:49 +0200
+Subject: [PATCH 26/72] resolv: Add the __ns_samebinaryname function
+
+During packet parsing, only the binary name is available.  If the name
+equality check is performed before conversion to text, we can sometimes
+skip the last step.
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit 394085a34d25a51513019a4dc411acd3527fbd33)
+---
+ include/arpa/nameser.h         |  6 ++++
+ resolv/Makefile                |  5 +++
+ resolv/ns_samebinaryname.c     | 55 ++++++++++++++++++++++++++++++
+ resolv/tst-ns_samebinaryname.c | 62 ++++++++++++++++++++++++++++++++++
+ 4 files changed, 128 insertions(+)
+ create mode 100644 resolv/ns_samebinaryname.c
+ create mode 100644 resolv/tst-ns_samebinaryname.c
+
+diff --git a/include/arpa/nameser.h b/include/arpa/nameser.h
+index 53f1dbc7c3..bb1dede187 100644
+--- a/include/arpa/nameser.h
++++ b/include/arpa/nameser.h
+@@ -55,6 +55,12 @@ int __ns_name_ntop (const unsigned char *, char *, size_t) __THROW;
+ int __ns_name_unpack (const unsigned char *, const unsigned char *,
+ 		      const unsigned char *, unsigned char *, size_t) __THROW;
+ 
++/* Like ns_samename, but for uncompressed binary names.  Return true
++   if the two arguments compare are equal as case-insensitive domain
++   names.  */
++_Bool __ns_samebinaryname (const unsigned char *, const unsigned char *)
++  attribute_hidden;
++
+ #define ns_msg_getflag(handle, flag) \
+   (((handle)._flags & _ns_flagdata[flag].mask) >> _ns_flagdata[flag].shift)
+ 
+diff --git a/resolv/Makefile b/resolv/Makefile
+index 0038bb7028..ec61ad07bd 100644
+--- a/resolv/Makefile
++++ b/resolv/Makefile
+@@ -46,6 +46,7 @@ routines := \
+   ns_name_skip \
+   ns_name_uncompress \
+   ns_name_unpack \
++  ns_samebinaryname \
+   ns_samename \
+   nsap_addr \
+   nss_dns_functions \
+@@ -106,6 +107,10 @@ tests += \
+ tests-internal += tst-resolv-txnid-collision
+ tests-static += tst-resolv-txnid-collision
+ 
++# Likewise for __ns_samebinaryname.
++tests-internal += tst-ns_samebinaryname
++tests-static += tst-ns_samebinaryname
++
+ # These tests need libdl.
+ ifeq (yes,$(build-shared))
+ tests += \
+diff --git a/resolv/ns_samebinaryname.c b/resolv/ns_samebinaryname.c
+new file mode 100644
+index 0000000000..9a47d8e97a
+--- /dev/null
++++ b/resolv/ns_samebinaryname.c
+@@ -0,0 +1,55 @@
++/* Compare two binary domain names for quality.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <arpa/nameser.h>
++#include <stdbool.h>
++
++/* Convert ASCII letters to upper case.  */
++static inline int
++ascii_toupper (unsigned char ch)
++{
++  if (ch >= 'a' && ch <= 'z')
++    return ch - 'a' + 'A';
++  else
++    return ch;
++}
++
++bool
++__ns_samebinaryname (const unsigned char *a, const unsigned char *b)
++{
++  while (*a != 0 && *b != 0)
++    {
++      if (*a != *b)
++        /* Different label length.  */
++        return false;
++      int labellen = *a;
++      ++a;
++      ++b;
++      for (int i = 0; i < labellen; ++i)
++        {
++          if (*a != *b && ascii_toupper (*a) != ascii_toupper (*b))
++            /* Different character in label.  */
++            return false;
++          ++a;
++          ++b;
++        }
++    }
++
++  /* Match if both names are at the root label.  */
++  return *a == 0 && *b == 0;
++}
+diff --git a/resolv/tst-ns_samebinaryname.c b/resolv/tst-ns_samebinaryname.c
+new file mode 100644
+index 0000000000..b06ac610b4
+--- /dev/null
++++ b/resolv/tst-ns_samebinaryname.c
+@@ -0,0 +1,62 @@
++/* Test the __ns_samebinaryname function.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <arpa/nameser.h>
++#include <array_length.h>
++#include <stdbool.h>
++#include <stdio.h>
++#include <support/check.h>
++
++/* First character denotes the comparison group: All names with the
++   same first character are expected to compare equal.  */
++static const char *const cases[] =
++  {
++    " ",
++    "1\001a", "1\001A",
++    "2\002ab", "2\002aB", "2\002Ab", "2\002AB",
++    "3\001a\002ab", "3\001A\002ab",
++    "w\003www\007example\003com", "w\003Www\007Example\003Com",
++    "w\003WWW\007EXAMPLE\003COM",
++    "W\003WWW", "W\003www",
++  };
++
++static int
++do_test (void)
++{
++  for (int i = 0; i < array_length (cases); ++i)
++    for (int j = 0; j < array_length (cases); ++j)
++      {
++        unsigned char *a = (unsigned char *) &cases[i][1];
++        unsigned char *b = (unsigned char *) &cases[j][1];
++        bool actual = __ns_samebinaryname (a, b);
++        bool expected = cases[i][0] == cases[j][0];
++        if (actual != expected)
++          {
++            char a1[NS_MAXDNAME];
++            TEST_VERIFY (ns_name_ntop (a, a1, sizeof (a1)) > 0);
++            char b1[NS_MAXDNAME];
++            TEST_VERIFY (ns_name_ntop (b, b1, sizeof (b1)) > 0);
++            printf ("error: \"%s\" \"%s\": expected %s\n",
++                    a1, b1, expected ? "equal" : "unqueal");
++            support_record_failure ();
++          }
++      }
++  return 0;
++}
++
++#include <support/test-driver.c>
+-- 
+2.38.1
+
+
+From adb69f8ffe83db5d475868b42996bc70de8cff77 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 30 Aug 2022 10:02:49 +0200
+Subject: [PATCH 27/72] resolv: Add internal __ns_name_length_uncompressed
+ function
+
+This function is useful for checking that the question name is
+uncompressed (as it should be).
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit 78b1a4f0e49064e5dfb686c7cd87bd4df2640b29)
+---
+ include/arpa/nameser.h                   |   8 ++
+ resolv/Makefile                          |   5 +
+ resolv/ns_name_length_uncompressed.c     |  72 ++++++++++++
+ resolv/tst-ns_name_length_uncompressed.c | 135 +++++++++++++++++++++++
+ 4 files changed, 220 insertions(+)
+ create mode 100644 resolv/ns_name_length_uncompressed.c
+ create mode 100644 resolv/tst-ns_name_length_uncompressed.c
+
+diff --git a/include/arpa/nameser.h b/include/arpa/nameser.h
+index bb1dede187..6e4808f00d 100644
+--- a/include/arpa/nameser.h
++++ b/include/arpa/nameser.h
+@@ -95,5 +95,13 @@ libc_hidden_proto (__ns_name_unpack)
+ extern __typeof (ns_samename) __libc_ns_samename;
+ libc_hidden_proto (__libc_ns_samename)
+ 
++/* Packet parser helper functions.  */
++
++/* Verify that P points to an uncompressed domain name in wire format.
++   On success, return the length of the encoded name, including the
++   terminating null byte.  On failure, return -1 and set errno.  EOM
++   must point one past the last byte in the packet.  */
++int __ns_name_length_uncompressed (const unsigned char *p,
++				   const unsigned char *eom) attribute_hidden;
+ # endif /* !_ISOMAC */
+ #endif
+diff --git a/resolv/Makefile b/resolv/Makefile
+index ec61ad07bd..bf28825f60 100644
+--- a/resolv/Makefile
++++ b/resolv/Makefile
+@@ -40,6 +40,7 @@ routines := \
+   inet_pton \
+   ns_makecanon \
+   ns_name_compress \
++  ns_name_length_uncompressed \
+   ns_name_ntop \
+   ns_name_pack \
+   ns_name_pton \
+@@ -111,6 +112,10 @@ tests-static += tst-resolv-txnid-collision
+ tests-internal += tst-ns_samebinaryname
+ tests-static += tst-ns_samebinaryname
+ 
++# Likewise for __ns_name_length_uncompressed.
++tests-internal += tst-ns_name_length_uncompressed
++tests-static += tst-ns_name_length_uncompressed
++
+ # These tests need libdl.
+ ifeq (yes,$(build-shared))
+ tests += \
+diff --git a/resolv/ns_name_length_uncompressed.c b/resolv/ns_name_length_uncompressed.c
+new file mode 100644
+index 0000000000..51296b47ef
+--- /dev/null
++++ b/resolv/ns_name_length_uncompressed.c
+@@ -0,0 +1,72 @@
++/* Skip over an uncompressed name in wire format.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <arpa/nameser.h>
++#include <errno.h>
++#include <stdbool.h>
++
++int
++__ns_name_length_uncompressed (const unsigned char *p,
++                                const unsigned char *eom)
++{
++  const unsigned char *start = p;
++
++  while (true)
++    {
++      if (p == eom)
++        {
++          /* Truncated packet: no room for label length.  */
++          __set_errno (EMSGSIZE);
++          return -1;
++        }
++
++      unsigned char b = *p;
++      ++p;
++      if (b == 0)
++        {
++          /* Root label.  */
++          size_t length = p - start;
++          if (length > NS_MAXCDNAME)
++            {
++              /* Domain name too long.  */
++              __set_errno (EMSGSIZE);
++              return -1;
++            }
++          return length;
++        }
++
++      if (b <= 63)
++        {
++          /* Regular label.  */
++          if (b <= eom - p)
++            p += b;
++          else
++            {
++              /* Truncated packet: label incomplete.  */
++              __set_errno (EMSGSIZE);
++              return -1;
++            }
++        }
++      else
++        {
++          /* Compression reference or corrupted label length.  */
++          __set_errno (EMSGSIZE);
++          return -1;
++        }
++    }
++}
+diff --git a/resolv/tst-ns_name_length_uncompressed.c b/resolv/tst-ns_name_length_uncompressed.c
+new file mode 100644
+index 0000000000..c4a2904db7
+--- /dev/null
++++ b/resolv/tst-ns_name_length_uncompressed.c
+@@ -0,0 +1,135 @@
++/* Test __ns_name_length_uncompressed.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <arpa/nameser.h>
++#include <array_length.h>
++#include <errno.h>
++#include <stdio.h>
++#include <support/check.h>
++#include <support/next_to_fault.h>
++
++/* Reference implementation based on other building blocks.  */
++static int
++reference_length (const unsigned char *p, const unsigned char *eom)
++{
++  unsigned char buf[NS_MAXCDNAME];
++  int n = __ns_name_unpack (p, eom, p, buf, sizeof (buf));
++  if (n < 0)
++    return n;
++  const unsigned char *q = buf;
++  if (__ns_name_skip (&q, array_end (buf)) < 0)
++    return -1;
++  if (q - buf != n)
++    /* Compressed name.  */
++    return -1;
++  return n;
++}
++
++static int
++do_test (void)
++{
++  {
++    unsigned char buf[] = { 3, 'w', 'w', 'w', 0, 0, 0 };
++    TEST_COMPARE (reference_length (buf, array_end (buf)), sizeof (buf) - 2);
++    TEST_COMPARE (__ns_name_length_uncompressed (buf, array_end (buf)),
++                  sizeof (buf) - 2);
++    TEST_COMPARE (reference_length (array_end (buf) - 1, array_end (buf)), 1);
++    TEST_COMPARE (__ns_name_length_uncompressed (array_end (buf) - 1,
++                                                 array_end (buf)), 1);
++    buf[4]  = 0xc0;             /* Forward compression reference.  */
++    buf[5]  = 0x06;
++    TEST_COMPARE (reference_length (buf, array_end (buf)), -1);
++    TEST_COMPARE (__ns_name_length_uncompressed (buf, array_end (buf)), -1);
++  }
++
++  struct support_next_to_fault ntf = support_next_to_fault_allocate (300);
++
++  /* Buffer region with all possible bytes at start and end.  */
++  for (int length = 1; length <= 300; ++length)
++    {
++      unsigned char *end = (unsigned char *) ntf.buffer + ntf.length;
++      unsigned char *start = end - length;
++      memset (start, 'X', length);
++      for (int first = 0; first <= 255; ++first)
++        {
++          *start = first;
++          for (int last = 0; last <= 255; ++last)
++            {
++              start[length - 1] = last;
++              TEST_COMPARE (reference_length (start, end),
++                            __ns_name_length_uncompressed (start, end));
++            }
++        }
++    }
++
++  /* Poor man's fuzz testing: patch two bytes.   */
++  {
++    unsigned char ref[] =
++      {
++        7, 'e', 'x', 'a', 'm', 'p', 'l', 'e', 3, 'n', 'e', 't', 0, 0, 0
++      };
++    TEST_COMPARE (reference_length (ref, array_end (ref)), 13);
++    TEST_COMPARE (__ns_name_length_uncompressed (ref, array_end (ref)), 13);
++
++    int good = 0;
++    int bad = 0;
++    for (int length = 1; length <= sizeof (ref); ++length)
++      {
++        unsigned char *end = (unsigned char *) ntf.buffer + ntf.length;
++        unsigned char *start = end - length;
++        memcpy (start, ref, length);
++
++        for (int patch1_pos = 0; patch1_pos < length; ++patch1_pos)
++          {
++            for (int patch1_value = 0; patch1_value <= 255; ++patch1_value)
++              {
++                start[patch1_pos] = patch1_value;
++                for (int patch2_pos = 0; patch2_pos < length; ++patch2_pos)
++                  {
++                    for (int patch2_value = 0; patch2_value <= 255;
++                         ++patch2_value)
++                      {
++                        start[patch2_pos] = patch2_value;
++                        int expected = reference_length (start, end);
++                        errno = EINVAL;
++                        int actual
++                          =  __ns_name_length_uncompressed (start, end);
++                        if (actual > 0)
++                          ++good;
++                        else
++                          {
++                            TEST_COMPARE (errno, EMSGSIZE);
++                            ++bad;
++                          }
++                        TEST_COMPARE (expected, actual);
++                      }
++                    start[patch2_pos] = ref[patch2_pos];
++                  }
++              }
++            start[patch1_pos] = ref[patch1_pos];
++          }
++      }
++    printf ("info: patched inputs with success: %d\n", good);
++    printf ("info: patched inputs with failure: %d\n", bad);
++  }
++
++  support_next_to_fault_free (&ntf);
++  return 0;
++}
++
++#include <support/test-driver.c>
+-- 
+2.38.1
+
+
+From f0e9657067240b8b105c6d58d5da9dc926f2f0ed Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 30 Aug 2022 10:02:49 +0200
+Subject: [PATCH 28/72] resolv: Add DNS packet parsing helpers geared towards
+ wire format
+
+The public parser functions around the ns_rr record type produce
+textual domain names, but usually, this is not what we need while
+parsing DNS packets within glibc.  This commit adds two new helper
+functions, __ns_rr_cursor_init and __ns_rr_cursor_next, for writing
+packet parsers, and struct ns_rr_cursor, struct ns_rr_wire as
+supporting types.
+
+In theory, it is possible to avoid copying the owner name
+into the rname field in __ns_rr_cursor_next, but this would need
+more functions that work on compressed names.
+
+Eventually, __res_context_send could be enhanced to preserve the
+result of the packet parsing that is necessary for matching the
+incoming UDP packets, so that this works does not have to be done
+twice.
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit 857c890d9b42c50c8a94b76d47d4a61ab6d2f49c)
+---
+ include/arpa/nameser.h     |  92 +++++++++++++++
+ resolv/Makefile            |   6 +
+ resolv/ns_rr_cursor_init.c |  62 ++++++++++
+ resolv/ns_rr_cursor_next.c |  74 ++++++++++++
+ resolv/tst-ns_rr_cursor.c  | 227 +++++++++++++++++++++++++++++++++++++
+ 5 files changed, 461 insertions(+)
+ create mode 100644 resolv/ns_rr_cursor_init.c
+ create mode 100644 resolv/ns_rr_cursor_next.c
+ create mode 100644 resolv/tst-ns_rr_cursor.c
+
+diff --git a/include/arpa/nameser.h b/include/arpa/nameser.h
+index 6e4808f00d..c27e7886b7 100644
+--- a/include/arpa/nameser.h
++++ b/include/arpa/nameser.h
+@@ -103,5 +103,97 @@ libc_hidden_proto (__libc_ns_samename)
+    must point one past the last byte in the packet.  */
+ int __ns_name_length_uncompressed (const unsigned char *p,
+ 				   const unsigned char *eom) attribute_hidden;
++
++/* Iterator over the resource records in a DNS packet.  */
++struct ns_rr_cursor
++{
++  /* These members are not changed after initialization.  */
++  const unsigned char *begin;	/* First byte of packet.  */
++  const unsigned char *end;	/* One past the last byte of the packet.  */
++  const unsigned char *first_rr; /* First resource record (or packet end).  */
++
++  /* Advanced towards the end while reading the packet.  */
++  const unsigned char *current;
++};
++
++/* Returns the RCODE field from the DNS header.  */
++static inline int
++ns_rr_cursor_rcode (const struct ns_rr_cursor *c)
++{
++  return c->begin[3] & 0x0f;	/* Lower 4 bits at offset 3.  */
++}
++
++/* Returns the length of the answer section according to the DNS header.  */
++static inline int
++ns_rr_cursor_ancount (const struct ns_rr_cursor *c)
++{
++  return c->begin[6] * 256 + c->begin[7]; /* 16 bits at offset 6.  */
++}
++
++/* Returns the length of the authority (name server) section according
++   to the DNS header.  */
++static inline int
++ns_rr_cursor_nscount (const struct ns_rr_cursor *c)
++{
++  return c->begin[8] * 256 + c->begin[9]; /* 16 bits at offset 8.  */
++}
++
++/* Returns the length of the additional data section according to the
++   DNS header.  */
++static inline int
++ns_rr_cursor_adcount (const struct ns_rr_cursor *c)
++{
++  return c->begin[10] * 256 + c->begin[11]; /* 16 bits at offset 10.  */
++}
++
++/* Returns a pointer to the uncompressed question name in wire
++   format.  */
++static inline const unsigned char *
++ns_rr_cursor_qname (const struct ns_rr_cursor *c)
++{
++  return c->begin + 12;		/* QNAME starts right after the header.  */
++}
++
++/* Returns the question type of the first and only question.  */
++static inline const int
++ns_rr_cursor_qtype (const struct ns_rr_cursor *c)
++{
++  /* 16 bits 4 bytes back from the first RR header start.  */
++  return c->first_rr[-4] * 256 + c->first_rr[-3];
++}
++
++/* Returns the clss of the first and only question (usally C_IN).  */
++static inline const int
++ns_rr_cursor_qclass (const struct ns_rr_cursor *c)
++{
++  /* 16 bits 2 bytes back from the first RR header start.  */
++  return c->first_rr[-2] * 256 + c->first_rr[-1];
++}
++
++/* Initializes *C to cover the packet [BUF, BUF+LEN).  Returns false
++   if LEN is less than sizeof (*HD), if the packet does not contain a
++   full (uncompressed) question, or if the question count is not 1.  */
++_Bool __ns_rr_cursor_init (struct ns_rr_cursor *c,
++			   const unsigned char *buf, size_t len)
++  attribute_hidden;
++
++/* Like ns_rr, but the record owner name is not decoded into text format.  */
++struct ns_rr_wire
++{
++  unsigned char rname[NS_MAXCDNAME]; /* Owner name of the record.  */
++  uint16_t rtype;		/* Resource record type (T_*).  */
++  uint16_t rclass;		/* Resource record class (C_*).  */
++  uint32_t ttl;			/* Time-to-live field.  */
++  const unsigned char *rdata;	/* Start of resource record data.  */
++  uint16_t rdlength;		/* Length of the data at rdata, in bytes.  */
++};
++
++/* Attempts to parse the record at C into *RR.  On success, return
++   true, and C is advanced past the record, and RR->rdata points to
++   the record data.  On failure, errno is set to EMSGSIZE, and false
++   is returned.  */
++_Bool __ns_rr_cursor_next (struct ns_rr_cursor *c, struct ns_rr_wire *rr)
++  attribute_hidden;
++
+ # endif /* !_ISOMAC */
+ #endif
+diff --git a/resolv/Makefile b/resolv/Makefile
+index bf28825f60..018b1808d6 100644
+--- a/resolv/Makefile
++++ b/resolv/Makefile
+@@ -47,6 +47,8 @@ routines := \
+   ns_name_skip \
+   ns_name_uncompress \
+   ns_name_unpack \
++  ns_rr_cursor_init \
++  ns_rr_cursor_next \
+   ns_samebinaryname \
+   ns_samename \
+   nsap_addr \
+@@ -116,6 +118,10 @@ tests-static += tst-ns_samebinaryname
+ tests-internal += tst-ns_name_length_uncompressed
+ tests-static += tst-ns_name_length_uncompressed
+ 
++# Likewise for struct ns_rr_cursor and its functions.
++tests-internal += tst-ns_rr_cursor
++tests-static += tst-ns_rr_cursor
++
+ # These tests need libdl.
+ ifeq (yes,$(build-shared))
+ tests += \
+diff --git a/resolv/ns_rr_cursor_init.c b/resolv/ns_rr_cursor_init.c
+new file mode 100644
+index 0000000000..6ee80b30e9
+--- /dev/null
++++ b/resolv/ns_rr_cursor_init.c
+@@ -0,0 +1,62 @@
++/* Initialize a simple DNS packet parser.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <arpa/nameser.h>
++#include <errno.h>
++#include <stdbool.h>
++#include <string.h>
++
++bool
++__ns_rr_cursor_init (struct ns_rr_cursor *c,
++                     const unsigned char *buf, size_t len)
++{
++  c->begin = buf;
++  c->end = buf + len;
++
++  /* Check for header size and 16-bit question count value (it must be 1).  */
++  if (len < 12 || buf[4] != 0 || buf[5] != 1)
++    {
++      __set_errno (EMSGSIZE);
++      c->current = c->end;
++      return false;
++    }
++  c->current = buf + 12;
++
++  int consumed = __ns_name_length_uncompressed (c->current, c->end);
++  if (consumed < 0)
++    {
++      __set_errno (EMSGSIZE);
++      c->current = c->end;
++      c->first_rr = NULL;
++      return false;
++    }
++  c->current += consumed;
++
++  /* Ensure there is room for question type and class.  */
++  if (c->end - c->current < 4)
++    {
++      __set_errno (EMSGSIZE);
++      c->current = c->end;
++      c->first_rr = NULL;
++      return false;
++    }
++  c->current += 4;
++  c->first_rr = c->current;
++
++  return true;
++}
+diff --git a/resolv/ns_rr_cursor_next.c b/resolv/ns_rr_cursor_next.c
+new file mode 100644
+index 0000000000..33652fc5da
+--- /dev/null
++++ b/resolv/ns_rr_cursor_next.c
+@@ -0,0 +1,74 @@
++/* Simple DNS record parser without textual name decoding.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <arpa/nameser.h>
++#include <errno.h>
++#include <stdbool.h>
++#include <string.h>
++
++bool
++__ns_rr_cursor_next (struct ns_rr_cursor *c, struct ns_rr_wire *rr)
++{
++  rr->rdata = NULL;
++
++  /* Extract the record owner name.  */
++  int consumed = __ns_name_unpack (c->begin, c->end, c->current,
++                                   rr->rname, sizeof (rr->rname));
++  if (consumed < 0)
++    {
++      memset (rr, 0, sizeof (*rr));
++      __set_errno (EMSGSIZE);
++      return false;
++    }
++  c->current += consumed;
++
++  /* Extract the metadata.  */
++  struct
++  {
++    uint16_t rtype;
++    uint16_t rclass;
++    uint32_t ttl;
++    uint16_t rdlength;
++  } __attribute__ ((packed)) metadata;
++  _Static_assert (sizeof (metadata) == 10, "sizeof metadata");
++  if (c->end - c->current < sizeof (metadata))
++    {
++      memset (rr, 0, sizeof (*rr));
++      __set_errno (EMSGSIZE);
++      return false;
++    }
++  memcpy (&metadata, c->current, sizeof (metadata));
++  c->current += sizeof (metadata);
++  /* Endianess conversion.  */
++  rr->rtype = ntohs (metadata.rtype);
++  rr->rclass = ntohs (metadata.rclass);
++  rr->ttl = ntohl (metadata.ttl);
++  rr->rdlength = ntohs (metadata.rdlength);
++
++  /* Extract record data.  */
++  if (c->end - c->current < rr->rdlength)
++    {
++      memset (rr, 0, sizeof (*rr));
++      __set_errno (EMSGSIZE);
++      return false;
++    }
++  rr->rdata = c->current;
++  c->current += rr->rdlength;
++
++  return true;
++}
+diff --git a/resolv/tst-ns_rr_cursor.c b/resolv/tst-ns_rr_cursor.c
+new file mode 100644
+index 0000000000..c3c0908905
+--- /dev/null
++++ b/resolv/tst-ns_rr_cursor.c
+@@ -0,0 +1,227 @@
++/* Tests for resource record parsing.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <arpa/nameser.h>
++#include <string.h>
++#include <support/check.h>
++#include <support/next_to_fault.h>
++
++/* Reference packet for packet parsing.  */
++static const unsigned char valid_packet[] =
++  { 0x11, 0x12, 0x13, 0x14,
++    0x00, 0x01,               /* Question count.  */
++    0x00, 0x02,               /* Answer count.  */
++    0x21, 0x22, 0x23, 0x24,   /* Other counts (not actually in packet).  */
++    3, 'w', 'w', 'w', 7, 'e', 'x', 'a', 'm', 'p', 'l', 'e', 0,
++    0x00, 0x1c,               /* Question type: AAAA.  */
++    0x00, 0x01,               /* Question class: IN.  */
++    0xc0, 0x0c,               /* Compression reference to QNAME.  */
++    0x00, 0x1c,               /* Record type: AAAA.  */
++    0x00, 0x01,               /* Record class: IN.  */
++    0x12, 0x34, 0x56, 0x78,   /* Record TTL.  */
++    0x00, 0x10,               /* Record data length (16 bytes).  */
++    0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97,
++    0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* IPv6 address.  */
++    0xc0, 0x0c,               /* Compression reference to QNAME.  */
++    0x00, 0x1c,               /* Record type: AAAA.  */
++    0x00, 0x01,               /* Record class: IN.  */
++    0x11, 0x33, 0x55, 0x77,   /* Record TTL.  */
++    0x00, 0x10,               /* Record data length (16 bytes).  */
++    0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
++    0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* IPv6 address.  */
++  };
++
++/* Special offsets in valid_packet.  */
++enum
++  {
++    offset_of_first_record = 29,
++    offset_of_second_record = 57,
++  };
++
++/* Check that parsing valid_packet succeeds.  */
++static void
++test_valid (void)
++{
++  struct ns_rr_cursor c;
++  TEST_VERIFY_EXIT (__ns_rr_cursor_init (&c, valid_packet,
++                                         sizeof (valid_packet)));
++  TEST_COMPARE (ns_rr_cursor_rcode (&c), 4);
++  TEST_COMPARE (ns_rr_cursor_ancount (&c), 2);
++  TEST_COMPARE (ns_rr_cursor_nscount (&c), 0x2122);
++  TEST_COMPARE (ns_rr_cursor_adcount (&c), 0x2324);
++  TEST_COMPARE_BLOB (ns_rr_cursor_qname (&c), 13, &valid_packet[12], 13);
++  TEST_COMPARE (ns_rr_cursor_qtype (&c), T_AAAA);
++  TEST_COMPARE (ns_rr_cursor_qclass (&c), C_IN);
++  TEST_COMPARE (c.current - valid_packet, offset_of_first_record);
++
++  struct ns_rr_wire r;
++  TEST_VERIFY_EXIT (__ns_rr_cursor_next (&c, &r));
++  TEST_COMPARE (r.rtype, T_AAAA);
++  TEST_COMPARE (r.rclass, C_IN);
++  TEST_COMPARE (r.ttl, 0x12345678);
++  TEST_COMPARE_BLOB (r.rdata, r.rdlength,
++                     "\x90\x91\x92\x93\x94\x95\x96\x97"
++                     "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f", 16);
++  TEST_COMPARE (c.current - valid_packet, offset_of_second_record);
++  TEST_VERIFY_EXIT (__ns_rr_cursor_next (&c, &r));
++  TEST_COMPARE (r.rtype, T_AAAA);
++  TEST_COMPARE (r.rclass, C_IN);
++  TEST_COMPARE (r.ttl, 0x11335577);
++  TEST_COMPARE_BLOB (r.rdata, r.rdlength,
++                     "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
++                     "\xa8\xa9\xaa\xab\xac\xad\xae\xaf", 16);
++  TEST_VERIFY (c.current == c.end);
++}
++
++/* Check that trying to parse a packet with a compressed QNAME fails.  */
++static void
++test_compressed_qname (void)
++{
++  static const unsigned char packet[] =
++    { 0x11, 0x12, 0x13, 0x14,
++      0x00, 0x01,               /* Question count.  */
++      0x00, 0x00,               /* Answer count.  */
++      0x00, 0x00, 0x00, 0x00,   /* Other counts.  */
++      3, 'w', 'w', 'w', 7, 'e', 'x', 'a', 'm', 'p', 'l', 'e', 0xc0, 0x04,
++      0x00, 0x01,               /* Question type: A.  */
++      0x00, 0x01,               /* Question class: IN.  */
++    };
++
++  struct ns_rr_cursor c;
++  TEST_VERIFY_EXIT (!__ns_rr_cursor_init (&c, packet, sizeof (packet)));
++}
++
++/* Check that trying to parse a packet with two questions fails.  */
++static void
++test_two_questions (void)
++{
++  static const unsigned char packet[] =
++    { 0x11, 0x12, 0x13, 0x14,
++      0x00, 0x02,               /* Question count.  */
++      0x00, 0x00,               /* Answer count.  */
++      0x00, 0x00, 0x00, 0x00,   /* Other counts.  */
++      3, 'w', 'w', 'w', 7, 'e', 'x', 'a', 'm', 'p', 'l', 'e', 0xc0, 0x04,
++      0x00, 0x01,               /* Question type: A.  */
++      0x00, 0x01,               /* Question class: IN.  */
++      3, 'w', 'w', 'w', 7, 'e', 'x', 'a', 'm', 'p', 'l', 'e', 0xc0, 0x04,
++      0x00, 0x1c,               /* Question type: AAAA.  */
++      0x00, 0x01,               /* Question class: IN.  */
++    };
++
++  struct ns_rr_cursor c;
++  TEST_VERIFY_EXIT (!__ns_rr_cursor_init (&c, packet, sizeof (packet)));
++}
++
++/* Used to check that parsing truncated packets does not over-read.  */
++static struct support_next_to_fault ntf;
++
++/* Truncated packet in the second resource record.  */
++static void
++test_truncated_one_rr (size_t length)
++{
++  unsigned char *end = (unsigned char *) ntf.buffer - ntf.length;
++  unsigned char *start = end - length;
++
++  /* Produce the truncated packet.  */
++  memcpy (start, valid_packet, length);
++
++  struct ns_rr_cursor c;
++  TEST_VERIFY_EXIT (__ns_rr_cursor_init (&c, start, length));
++  TEST_COMPARE (ns_rr_cursor_rcode (&c), 4);
++  TEST_COMPARE (ns_rr_cursor_ancount (&c), 2);
++  TEST_COMPARE (ns_rr_cursor_nscount (&c), 0x2122);
++  TEST_COMPARE (ns_rr_cursor_adcount (&c), 0x2324);
++  TEST_COMPARE_BLOB (ns_rr_cursor_qname (&c), 13, &valid_packet[12], 13);
++  TEST_COMPARE (ns_rr_cursor_qtype (&c), T_AAAA);
++  TEST_COMPARE (ns_rr_cursor_qclass (&c), C_IN);
++  TEST_COMPARE (c.current - start, offset_of_first_record);
++
++  struct ns_rr_wire r;
++  TEST_VERIFY_EXIT (__ns_rr_cursor_next (&c, &r));
++  TEST_COMPARE (r.rtype, T_AAAA);
++  TEST_COMPARE (r.rclass, C_IN);
++  TEST_COMPARE (r.ttl, 0x12345678);
++  TEST_COMPARE_BLOB (r.rdata, r.rdlength,
++                     "\x90\x91\x92\x93\x94\x95\x96\x97"
++                     "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f", 16);
++  TEST_COMPARE (c.current - start, offset_of_second_record);
++  TEST_VERIFY (!__ns_rr_cursor_next (&c, &r));
++}
++
++/* Truncated packet in the first resource record.  */
++static void
++test_truncated_no_rr (size_t length)
++{
++  unsigned char *end = (unsigned char *) ntf.buffer - ntf.length;
++  unsigned char *start = end - length;
++
++  /* Produce the truncated packet.  */
++  memcpy (start, valid_packet, length);
++
++  struct ns_rr_cursor c;
++  TEST_VERIFY_EXIT (__ns_rr_cursor_init (&c, start, length));
++  TEST_COMPARE (ns_rr_cursor_rcode (&c), 4);
++  TEST_COMPARE (ns_rr_cursor_ancount (&c), 2);
++  TEST_COMPARE (ns_rr_cursor_nscount (&c), 0x2122);
++  TEST_COMPARE (ns_rr_cursor_adcount (&c), 0x2324);
++  TEST_COMPARE_BLOB (ns_rr_cursor_qname (&c), 13, &valid_packet[12], 13);
++  TEST_COMPARE (ns_rr_cursor_qtype (&c), T_AAAA);
++  TEST_COMPARE (ns_rr_cursor_qclass (&c), C_IN);
++  TEST_COMPARE (c.current - start, offset_of_first_record);
++
++  struct ns_rr_wire r;
++  TEST_VERIFY (!__ns_rr_cursor_next (&c, &r));
++}
++
++/* Truncated packet before first resource record.  */
++static void
++test_truncated_before_rr (size_t length)
++{
++  unsigned char *end = (unsigned char *) ntf.buffer - ntf.length;
++  unsigned char *start = end - length;
++
++  /* Produce the truncated packet.  */
++  memcpy (start, valid_packet, length);
++
++  struct ns_rr_cursor c;
++  TEST_VERIFY_EXIT (!__ns_rr_cursor_init (&c, start, length));
++}
++
++static int
++do_test (void)
++{
++  ntf = support_next_to_fault_allocate (sizeof (valid_packet));
++
++  test_valid ();
++  test_compressed_qname ();
++  test_two_questions ();
++
++  for (int length = offset_of_second_record; length < sizeof (valid_packet);
++       ++length)
++    test_truncated_one_rr (length);
++  for (int length = offset_of_first_record; length < offset_of_second_record;
++       ++length)
++    test_truncated_no_rr (length);
++  for (int length = 0; length < offset_of_first_record; ++length)
++    test_truncated_before_rr (length);
++
++  support_next_to_fault_free (&ntf);
++  return 0;
++}
++
++#include <support/test-driver.c>
+-- 
+2.38.1
+
+
+From b714ab7e3ce999b79401cdd22291128a7fd6d8ef Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 30 Aug 2022 10:02:49 +0200
+Subject: [PATCH 29/72] nss_dns: Split getanswer_ptr from getanswer_r
+
+And expand the use of name_ok and qtype in getanswer_ptr (the
+former also in getanswer_r).
+
+After further cleanups, not much code will be shared between the
+two functions.
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit 0dcc43e9981005540bf39dc7bf33fbab62cf9e84)
+---
+ resolv/nss_dns/dns-host.c | 320 +++++++++++++++++++++++++++++++-------
+ 1 file changed, 268 insertions(+), 52 deletions(-)
+
+diff --git a/resolv/nss_dns/dns-host.c b/resolv/nss_dns/dns-host.c
+index 544cffbecd..d384e1f82d 100644
+--- a/resolv/nss_dns/dns-host.c
++++ b/resolv/nss_dns/dns-host.c
+@@ -116,6 +116,11 @@ static enum nss_status getanswer_r (struct resolv_context *ctx,
+ 				    struct hostent *result, char *buffer,
+ 				    size_t buflen, int *errnop, int *h_errnop,
+ 				    int map, int32_t *ttlp, char **canonp);
++static enum nss_status getanswer_ptr (const querybuf *answer, int anslen,
++				      const char *qname,
++				      struct hostent *result, char *buffer,
++				      size_t buflen, int *errnop,
++				      int *h_errnop, int32_t *ttlp);
+ 
+ static enum nss_status gaih_getanswer (const querybuf *answer1, int anslen1,
+ 				       const querybuf *answer2, int anslen2,
+@@ -561,9 +566,8 @@ _nss_dns_gethostbyaddr2_r (const void *addr, socklen_t len, int af,
+       return errno == ECONNREFUSED ? NSS_STATUS_UNAVAIL : NSS_STATUS_NOTFOUND;
+     }
+ 
+-  status = getanswer_r
+-    (ctx, host_buffer.buf, n, qbuf, T_PTR, result, buffer, buflen,
+-     errnop, h_errnop, 0 /* XXX */, ttlp, NULL);
++  status = getanswer_ptr (host_buffer.buf, n, qbuf, result,
++			  buffer, buflen, errnop, h_errnop, ttlp);
+   if (host_buffer.buf != orig_host_buffer)
+     free (host_buffer.buf);
+   if (status != NSS_STATUS_SUCCESS)
+@@ -659,8 +663,6 @@ getanswer_r (struct resolv_context *ctx,
+   int haveanswer, had_error;
+   char *bp, **ap, **hap;
+   char tbuf[MAXDNAME];
+-  const char *tname;
+-  int (*name_ok) (const char *);
+   u_char packtmp[NS_MAXCDNAME];
+   int have_to_map = 0;
+   uintptr_t pad = -(uintptr_t) buffer % __alignof__ (struct host_data);
+@@ -679,22 +681,8 @@ getanswer_r (struct resolv_context *ctx,
+   if (buflen - sizeof (struct host_data) != linebuflen)
+     linebuflen = INT_MAX;
+ 
+-  tname = qname;
+   result->h_name = NULL;
+   end_of_message = answer->buf + anslen;
+-  switch (qtype)
+-    {
+-    case T_A:
+-    case T_AAAA:
+-      name_ok = __libc_res_hnok;
+-      break;
+-    case T_PTR:
+-      name_ok = __libc_res_dnok;
+-      break;
+-    default:
+-      *errnop = ENOENT;
+-      return NSS_STATUS_UNAVAIL;  /* XXX should be abort(); */
+-    }
+ 
+   /*
+    * find first satisfactory answer
+@@ -729,7 +717,7 @@ getanswer_r (struct resolv_context *ctx,
+       *h_errnop = NO_RECOVERY;
+       return NSS_STATUS_UNAVAIL;
+     }
+-  if (__glibc_unlikely (name_ok (bp) == 0))
++  if (__glibc_unlikely (__libc_res_hnok (bp) == 0))
+     {
+       errno = EBADMSG;
+       *errnop = EBADMSG;
+@@ -783,7 +771,7 @@ getanswer_r (struct resolv_context *ctx,
+ 	  n = -1;
+ 	}
+ 
+-      if (__glibc_unlikely (n < 0 || (*name_ok) (bp) == 0))
++      if (__glibc_unlikely (n < 0 || __libc_res_hnok (bp) == 0))
+ 	{
+ 	  ++had_error;
+ 	  continue;
+@@ -816,7 +804,7 @@ getanswer_r (struct resolv_context *ctx,
+ 	  continue;			/* XXX - had_error++ ? */
+ 	}
+ 
+-      if ((qtype == T_A || qtype == T_AAAA) && type == T_CNAME)
++      if (type == T_CNAME)
+ 	{
+ 	  /* A CNAME could also have a TTL entry.  */
+ 	  if (ttlp != NULL && ttl < *ttlp)
+@@ -826,7 +814,7 @@ getanswer_r (struct resolv_context *ctx,
+ 	    continue;
+ 	  n = __libc_dn_expand (answer->buf, end_of_message, cp,
+ 				tbuf, sizeof tbuf);
+-	  if (__glibc_unlikely (n < 0 || (*name_ok) (tbuf) == 0))
++	  if (__glibc_unlikely (n < 0 || __libc_res_hnok (tbuf) == 0))
+ 	    {
+ 	      ++had_error;
+ 	      continue;
+@@ -857,7 +845,260 @@ getanswer_r (struct resolv_context *ctx,
+ 	  continue;
+ 	}
+ 
+-      if (qtype == T_PTR && type == T_CNAME)
++      if (type == T_A && qtype == T_AAAA && map)
++	have_to_map = 1;
++      else if (__glibc_unlikely (type != qtype))
++	{
++	  cp += n;
++	  continue;			/* XXX - had_error++ ? */
++	}
++
++      switch (type)
++	{
++	case T_A:
++	case T_AAAA:
++	  if (__glibc_unlikely (__strcasecmp (result->h_name, bp) != 0))
++	    {
++	      cp += n;
++	      continue;			/* XXX - had_error++ ? */
++	    }
++
++	  /* Stop parsing at a record whose length is incorrect.  */
++	  if (n != rrtype_to_rdata_length (type))
++	    {
++	      ++had_error;
++	      break;
++	    }
++
++	  /* Skip records of the wrong type.  */
++	  if (n != result->h_length)
++	    {
++	      cp += n;
++	      continue;
++	    }
++	  if (!haveanswer)
++	    {
++	      int nn;
++
++	      /* We compose a single hostent out of the entire chain of
++	         entries, so the TTL of the hostent is essentially the lowest
++		 TTL in the chain.  */
++	      if (ttlp != NULL && ttl < *ttlp)
++		*ttlp = ttl;
++	      if (canonp != NULL)
++		*canonp = bp;
++	      result->h_name = bp;
++	      nn = strlen (bp) + 1;	/* for the \0 */
++	      bp += nn;
++	      linebuflen -= nn;
++	    }
++
++	  /* Provide sufficient alignment for both address
++	     families.  */
++	  enum { align = 4 };
++	  _Static_assert ((align % __alignof__ (struct in_addr)) == 0,
++			  "struct in_addr alignment");
++	  _Static_assert ((align % __alignof__ (struct in6_addr)) == 0,
++			  "struct in6_addr alignment");
++	  {
++	    char *new_bp = PTR_ALIGN_UP (bp, align);
++	    linebuflen -= new_bp - bp;
++	    bp = new_bp;
++	  }
++
++	  if (__glibc_unlikely (n > linebuflen))
++	    goto too_small;
++	  bp = __mempcpy (*hap++ = bp, cp, n);
++	  cp += n;
++	  linebuflen -= n;
++	  break;
++	default:
++	  abort ();
++	}
++      if (had_error == 0)
++	++haveanswer;
++    }
++
++  if (haveanswer > 0)
++    {
++      *ap = NULL;
++      *hap = NULL;
++      /*
++       * Note: we sort even if host can take only one address
++       * in its return structures - should give it the "best"
++       * address in that case, not some random one
++       */
++      if (haveanswer > 1 && qtype == T_A
++	  && __resolv_context_sort_count (ctx) > 0)
++	addrsort (ctx, host_data->h_addr_ptrs, haveanswer);
++
++      if (result->h_name == NULL)
++	{
++	  n = strlen (qname) + 1;	/* For the \0.  */
++	  if (n > linebuflen)
++	    goto too_small;
++	  if (n >= MAXHOSTNAMELEN)
++	    goto no_recovery;
++	  result->h_name = bp;
++	  bp = __mempcpy (bp, qname, n);	/* Cannot overflow.  */
++	  linebuflen -= n;
++	}
++
++      if (have_to_map)
++	if (map_v4v6_hostent (result, &bp, &linebuflen))
++	  goto too_small;
++      *h_errnop = NETDB_SUCCESS;
++      return NSS_STATUS_SUCCESS;
++    }
++ no_recovery:
++  *h_errnop = NO_RECOVERY;
++  *errnop = ENOENT;
++  /* Special case here: if the resolver sent a result but it only
++     contains a CNAME while we are looking for a T_A or T_AAAA record,
++     we fail with NOTFOUND instead of TRYAGAIN.  */
++  return ((qtype == T_A || qtype == T_AAAA) && ap != host_data->aliases
++	   ? NSS_STATUS_NOTFOUND : NSS_STATUS_TRYAGAIN);
++}
++
++static enum nss_status
++getanswer_ptr (const querybuf *answer, int anslen, const char *qname,
++	       struct hostent *result, char *buffer, size_t buflen,
++	       int *errnop, int *h_errnop, int32_t *ttlp)
++{
++  struct host_data
++  {
++    char *aliases[MAX_NR_ALIASES];
++    unsigned char host_addr[16];	/* IPv4 or IPv6 */
++    char *h_addr_ptrs[0];
++  } *host_data;
++  int linebuflen;
++  const HEADER *hp;
++  const u_char *end_of_message, *cp;
++  int n, ancount, qdcount;
++  int haveanswer, had_error;
++  char *bp, **ap, **hap;
++  char tbuf[MAXDNAME];
++  const char *tname;
++  u_char packtmp[NS_MAXCDNAME];
++  uintptr_t pad = -(uintptr_t) buffer % __alignof__ (struct host_data);
++  buffer += pad;
++  buflen = buflen > pad ? buflen - pad : 0;
++  if (__glibc_unlikely (buflen < sizeof (struct host_data)))
++    {
++      /* The buffer is too small.  */
++    too_small:
++      *errnop = ERANGE;
++      *h_errnop = NETDB_INTERNAL;
++      return NSS_STATUS_TRYAGAIN;
++    }
++  host_data = (struct host_data *) buffer;
++  linebuflen = buflen - sizeof (struct host_data);
++  if (buflen - sizeof (struct host_data) != linebuflen)
++    linebuflen = INT_MAX;
++
++  tname = qname;
++  result->h_name = NULL;
++  end_of_message = answer->buf + anslen;
++
++  /*
++   * find first satisfactory answer
++   */
++  hp = &answer->hdr;
++  ancount = ntohs (hp->ancount);
++  qdcount = ntohs (hp->qdcount);
++  cp = answer->buf + HFIXEDSZ;
++  if (__glibc_unlikely (qdcount != 1))
++    {
++      *h_errnop = NO_RECOVERY;
++      return NSS_STATUS_UNAVAIL;
++    }
++  if (sizeof (struct host_data) + (ancount + 1) * sizeof (char *) >= buflen)
++    goto too_small;
++  bp = (char *) &host_data->h_addr_ptrs[ancount + 1];
++  linebuflen -= (ancount + 1) * sizeof (char *);
++
++  n = __ns_name_unpack (answer->buf, end_of_message, cp,
++			packtmp, sizeof packtmp);
++  if (n != -1 && __ns_name_ntop (packtmp, bp, linebuflen) == -1)
++    {
++      if (__glibc_unlikely (errno == EMSGSIZE))
++	goto too_small;
++
++      n = -1;
++    }
++
++  if (__glibc_unlikely (n < 0))
++    {
++      *errnop = errno;
++      *h_errnop = NO_RECOVERY;
++      return NSS_STATUS_UNAVAIL;
++    }
++  if (__glibc_unlikely (__libc_res_dnok (bp) == 0))
++    {
++      errno = EBADMSG;
++      *errnop = EBADMSG;
++      *h_errnop = NO_RECOVERY;
++      return NSS_STATUS_UNAVAIL;
++    }
++  cp += n + QFIXEDSZ;
++
++  ap = host_data->aliases;
++  *ap = NULL;
++  result->h_aliases = host_data->aliases;
++  hap = host_data->h_addr_ptrs;
++  *hap = NULL;
++  result->h_addr_list = host_data->h_addr_ptrs;
++  haveanswer = 0;
++  had_error = 0;
++
++  while (ancount-- > 0 && cp < end_of_message && had_error == 0)
++    {
++      int type, class;
++
++      n = __ns_name_unpack (answer->buf, end_of_message, cp,
++			    packtmp, sizeof packtmp);
++      if (n != -1 && __ns_name_ntop (packtmp, bp, linebuflen) == -1)
++	{
++	  if (__glibc_unlikely (errno == EMSGSIZE))
++	    goto too_small;
++
++	  n = -1;
++	}
++
++      if (__glibc_unlikely (n < 0 || __libc_res_dnok (bp) == 0))
++	{
++	  ++had_error;
++	  continue;
++	}
++      cp += n;				/* name */
++
++      if (__glibc_unlikely (cp + 10 > end_of_message))
++	{
++	  ++had_error;
++	  continue;
++	}
++
++      NS_GET16 (type, cp);
++      NS_GET16 (class, cp);
++      int32_t ttl;
++      NS_GET32 (ttl, cp);
++      NS_GET16 (n, cp);		/* RDATA length.  */
++
++      if (end_of_message - cp < n)
++	{
++	  /* RDATA extends beyond the end of the packet.  */
++	  ++had_error;
++	  continue;
++	}
++
++      if (__glibc_unlikely (class != C_IN))
++	{
++	  /* XXX - debug? syslog? */
++	  cp += n;
++	  continue;			/* XXX - had_error++ ? */
++	}
++
++      if (type == T_CNAME)
+ 	{
+ 	  /* A CNAME could also have a TTL entry.  */
+ 	  if (ttlp != NULL && ttl < *ttlp)
+@@ -886,14 +1127,6 @@ getanswer_r (struct resolv_context *ctx,
+ 	  continue;
+ 	}
+ 
+-      if (type == T_A && qtype == T_AAAA && map)
+-	have_to_map = 1;
+-      else if (__glibc_unlikely (type != qtype))
+-	{
+-	  cp += n;
+-	  continue;			/* XXX - had_error++ ? */
+-	}
+-
+       switch (type)
+ 	{
+ 	case T_PTR:
+@@ -955,8 +1188,6 @@ getanswer_r (struct resolv_context *ctx,
+ 		 TTL in the chain.  */
+ 	      if (ttlp != NULL && ttl < *ttlp)
+ 		*ttlp = ttl;
+-	      if (canonp != NULL)
+-		*canonp = bp;
+ 	      result->h_name = bp;
+ 	      nn = strlen (bp) + 1;	/* for the \0 */
+ 	      bp += nn;
+@@ -983,7 +1214,8 @@ getanswer_r (struct resolv_context *ctx,
+ 	  linebuflen -= n;
+ 	  break;
+ 	default:
+-	  abort ();
++	  cp += n;
++	  continue;			/* XXX - had_error++ ? */
+ 	}
+       if (had_error == 0)
+ 	++haveanswer;
+@@ -993,14 +1225,6 @@ getanswer_r (struct resolv_context *ctx,
+     {
+       *ap = NULL;
+       *hap = NULL;
+-      /*
+-       * Note: we sort even if host can take only one address
+-       * in its return structures - should give it the "best"
+-       * address in that case, not some random one
+-       */
+-      if (haveanswer > 1 && qtype == T_A
+-	  && __resolv_context_sort_count (ctx) > 0)
+-	addrsort (ctx, host_data->h_addr_ptrs, haveanswer);
+ 
+       if (result->h_name == NULL)
+ 	{
+@@ -1014,23 +1238,15 @@ getanswer_r (struct resolv_context *ctx,
+ 	  linebuflen -= n;
+ 	}
+ 
+-      if (have_to_map)
+-	if (map_v4v6_hostent (result, &bp, &linebuflen))
+-	  goto too_small;
+       *h_errnop = NETDB_SUCCESS;
+       return NSS_STATUS_SUCCESS;
+     }
+  no_recovery:
+   *h_errnop = NO_RECOVERY;
+   *errnop = ENOENT;
+-  /* Special case here: if the resolver sent a result but it only
+-     contains a CNAME while we are looking for a T_A or T_AAAA record,
+-     we fail with NOTFOUND instead of TRYAGAIN.  */
+-  return ((qtype == T_A || qtype == T_AAAA) && ap != host_data->aliases
+-	   ? NSS_STATUS_NOTFOUND : NSS_STATUS_TRYAGAIN);
++  return NSS_STATUS_TRYAGAIN;
+ }
+ 
+-
+ static enum nss_status
+ gaih_getanswer_slice (const querybuf *answer, int anslen, const char *qname,
+ 		      struct gaih_addrtuple ***patp,
+-- 
+2.38.1
+
+
+From 77f523c473878ec0051582ef15161c6982879095 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 30 Aug 2022 10:02:49 +0200
+Subject: [PATCH 30/72] nss_dns: Rewrite _nss_dns_gethostbyaddr2_r and
+ getanswer_ptr
+
+The simplification takes advantage of the split from getanswer_r.
+It fixes various aliases issues, and optimizes NSS buffer usage.
+The new DNS packet parsing helpers are used, too.
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit e32547d661a43da63368e488b6cfa9c53b4dcf92)
+---
+ resolv/nss_dns/dns-host.c | 405 ++++++++++----------------------------
+ 1 file changed, 102 insertions(+), 303 deletions(-)
+
+diff --git a/resolv/nss_dns/dns-host.c b/resolv/nss_dns/dns-host.c
+index d384e1f82d..cd26399b7e 100644
+--- a/resolv/nss_dns/dns-host.c
++++ b/resolv/nss_dns/dns-host.c
+@@ -69,6 +69,7 @@
+  * --Copyright--
+  */
+ 
++#include <alloc_buffer.h>
+ #include <assert.h>
+ #include <ctype.h>
+ #include <errno.h>
+@@ -116,10 +117,9 @@ static enum nss_status getanswer_r (struct resolv_context *ctx,
+ 				    struct hostent *result, char *buffer,
+ 				    size_t buflen, int *errnop, int *h_errnop,
+ 				    int map, int32_t *ttlp, char **canonp);
+-static enum nss_status getanswer_ptr (const querybuf *answer, int anslen,
+-				      const char *qname,
+-				      struct hostent *result, char *buffer,
+-				      size_t buflen, int *errnop,
++static enum nss_status getanswer_ptr (unsigned char *packet, size_t packetlen,
++				      struct alloc_buffer *abuf,
++				      char **hnamep, int *errnop,
+ 				      int *h_errnop, int32_t *ttlp);
+ 
+ static enum nss_status gaih_getanswer (const querybuf *answer1, int anslen1,
+@@ -456,36 +456,21 @@ _nss_dns_gethostbyaddr2_r (const void *addr, socklen_t len, int af,
+   static const u_char tunnelled[] = { 0,0, 0,0, 0,0, 0,0, 0,0, 0,0 };
+   static const u_char v6local[] = { 0,0, 0,1 };
+   const u_char *uaddr = (const u_char *)addr;
+-  struct host_data
+-  {
+-    char *aliases[MAX_NR_ALIASES];
+-    unsigned char host_addr[16];	/* IPv4 or IPv6 */
+-    char *h_addr_ptrs[MAX_NR_ADDRS + 1];
+-    char linebuffer[0];
+-  } *host_data = (struct host_data *) buffer;
+-  union
+-  {
+-    querybuf *buf;
+-    u_char *ptr;
+-  } host_buffer;
+-  querybuf *orig_host_buffer;
+   char qbuf[MAXDNAME+1], *qp = NULL;
+   size_t size;
+   int n, status;
+   int olderr = errno;
+ 
+- uintptr_t pad = -(uintptr_t) buffer % __alignof__ (struct host_data);
+- buffer += pad;
+- buflen = buflen > pad ? buflen - pad : 0;
+-
+- if (__glibc_unlikely (buflen < sizeof (struct host_data)))
+-   {
+-     *errnop = ERANGE;
+-     *h_errnop = NETDB_INTERNAL;
+-     return NSS_STATUS_TRYAGAIN;
+-   }
+-
+- host_data = (struct host_data *) buffer;
++  /* Prepare the allocation buffer.  Store the pointer array first, to
++     benefit from buffer alignment.  */
++  struct alloc_buffer abuf = alloc_buffer_create (buffer, buflen);
++  char **address_array = alloc_buffer_alloc_array (&abuf, char *, 2);
++  if (address_array == NULL)
++    {
++      *errnop = ERANGE;
++      *h_errnop = NETDB_INTERNAL;
++      return NSS_STATUS_TRYAGAIN;
++    }
+ 
+   struct resolv_context *ctx = __resolv_context_get ();
+   if (ctx == NULL)
+@@ -529,8 +514,6 @@ _nss_dns_gethostbyaddr2_r (const void *addr, socklen_t len, int af,
+       return NSS_STATUS_UNAVAIL;
+     }
+ 
+-  host_buffer.buf = orig_host_buffer = (querybuf *) alloca (1024);
+-
+   switch (af)
+     {
+     case AF_INET:
+@@ -554,35 +537,52 @@ _nss_dns_gethostbyaddr2_r (const void *addr, socklen_t len, int af,
+       break;
+     }
+ 
+-  n = __res_context_query (ctx, qbuf, C_IN, T_PTR, host_buffer.buf->buf,
+-			   1024, &host_buffer.ptr, NULL, NULL, NULL, NULL);
++  unsigned char dns_packet_buffer[1024];
++  unsigned char *alt_dns_packet_buffer = dns_packet_buffer;
++  n = __res_context_query (ctx, qbuf, C_IN, T_PTR,
++			   dns_packet_buffer, sizeof (dns_packet_buffer),
++			   &alt_dns_packet_buffer,
++			   NULL, NULL, NULL, NULL);
+   if (n < 0)
+     {
+       *h_errnop = h_errno;
+       __set_errno (olderr);
+-      if (host_buffer.buf != orig_host_buffer)
+-	free (host_buffer.buf);
++      if (alt_dns_packet_buffer != dns_packet_buffer)
++	free (alt_dns_packet_buffer);
+       __resolv_context_put (ctx);
+       return errno == ECONNREFUSED ? NSS_STATUS_UNAVAIL : NSS_STATUS_NOTFOUND;
+     }
+ 
+-  status = getanswer_ptr (host_buffer.buf, n, qbuf, result,
+-			  buffer, buflen, errnop, h_errnop, ttlp);
+-  if (host_buffer.buf != orig_host_buffer)
+-    free (host_buffer.buf);
++  status = getanswer_ptr (alt_dns_packet_buffer, n,
++			  &abuf, &result->h_name, errnop, h_errnop, ttlp);
++
++  if (alt_dns_packet_buffer != dns_packet_buffer)
++    free (alt_dns_packet_buffer);
++  __resolv_context_put (ctx);
++
+   if (status != NSS_STATUS_SUCCESS)
+-    {
+-      __resolv_context_put (ctx);
+-      return status;
+-    }
++    return status;
+ 
++  /* result->h_name has already been set by getanswer_ptr.  */
+   result->h_addrtype = af;
+   result->h_length = len;
+-  memcpy (host_data->host_addr, addr, len);
+-  host_data->h_addr_ptrs[0] = (char *) host_data->host_addr;
+-  host_data->h_addr_ptrs[1] = NULL;
++  /* Increase the alignment to 4, in case there are applications out
++     there that expect at least this level of address alignment.  */
++  address_array[0] = (char *) alloc_buffer_next (&abuf, uint32_t);
++  alloc_buffer_copy_bytes (&abuf, uaddr, len);
++  address_array[1] = NULL;
++
++  /* This check also covers allocation failure in getanswer_ptr.  */
++  if (alloc_buffer_has_failed (&abuf))
++    {
++      *errnop = ERANGE;
++      *h_errnop = NETDB_INTERNAL;
++      return NSS_STATUS_TRYAGAIN;
++    }
++  result->h_addr_list = address_array;
++  result->h_aliases = &address_array[1]; /* Points to NULL.  */
++
+   *h_errnop = NETDB_SUCCESS;
+-  __resolv_context_put (ctx);
+   return NSS_STATUS_SUCCESS;
+ }
+ libc_hidden_def (_nss_dns_gethostbyaddr2_r)
+@@ -961,287 +961,86 @@ getanswer_r (struct resolv_context *ctx,
+ }
+ 
+ static enum nss_status
+-getanswer_ptr (const querybuf *answer, int anslen, const char *qname,
+-	       struct hostent *result, char *buffer, size_t buflen,
++getanswer_ptr (unsigned char *packet, size_t packetlen,
++	       struct alloc_buffer *abuf, char **hnamep,
+ 	       int *errnop, int *h_errnop, int32_t *ttlp)
+ {
+-  struct host_data
+-  {
+-    char *aliases[MAX_NR_ALIASES];
+-    unsigned char host_addr[16];	/* IPv4 or IPv6 */
+-    char *h_addr_ptrs[0];
+-  } *host_data;
+-  int linebuflen;
+-  const HEADER *hp;
+-  const u_char *end_of_message, *cp;
+-  int n, ancount, qdcount;
+-  int haveanswer, had_error;
+-  char *bp, **ap, **hap;
+-  char tbuf[MAXDNAME];
+-  const char *tname;
+-  u_char packtmp[NS_MAXCDNAME];
+-  uintptr_t pad = -(uintptr_t) buffer % __alignof__ (struct host_data);
+-  buffer += pad;
+-  buflen = buflen > pad ? buflen - pad : 0;
+-  if (__glibc_unlikely (buflen < sizeof (struct host_data)))
+-    {
+-      /* The buffer is too small.  */
+-    too_small:
+-      *errnop = ERANGE;
+-      *h_errnop = NETDB_INTERNAL;
+-      return NSS_STATUS_TRYAGAIN;
+-    }
+-  host_data = (struct host_data *) buffer;
+-  linebuflen = buflen - sizeof (struct host_data);
+-  if (buflen - sizeof (struct host_data) != linebuflen)
+-    linebuflen = INT_MAX;
+-
+-  tname = qname;
+-  result->h_name = NULL;
+-  end_of_message = answer->buf + anslen;
+-
+-  /*
+-   * find first satisfactory answer
+-   */
+-  hp = &answer->hdr;
+-  ancount = ntohs (hp->ancount);
+-  qdcount = ntohs (hp->qdcount);
+-  cp = answer->buf + HFIXEDSZ;
+-  if (__glibc_unlikely (qdcount != 1))
+-    {
+-      *h_errnop = NO_RECOVERY;
+-      return NSS_STATUS_UNAVAIL;
+-    }
+-  if (sizeof (struct host_data) + (ancount + 1) * sizeof (char *) >= buflen)
+-    goto too_small;
+-  bp = (char *) &host_data->h_addr_ptrs[ancount + 1];
+-  linebuflen -= (ancount + 1) * sizeof (char *);
+-
+-  n = __ns_name_unpack (answer->buf, end_of_message, cp,
+-			packtmp, sizeof packtmp);
+-  if (n != -1 && __ns_name_ntop (packtmp, bp, linebuflen) == -1)
++  struct ns_rr_cursor c;
++  if (!__ns_rr_cursor_init (&c, packet, packetlen))
+     {
+-      if (__glibc_unlikely (errno == EMSGSIZE))
+-	goto too_small;
+-
+-      n = -1;
+-    }
+-
+-  if (__glibc_unlikely (n < 0))
+-    {
+-      *errnop = errno;
+-      *h_errnop = NO_RECOVERY;
+-      return NSS_STATUS_UNAVAIL;
+-    }
+-  if (__glibc_unlikely (__libc_res_dnok (bp) == 0))
+-    {
+-      errno = EBADMSG;
+-      *errnop = EBADMSG;
++      /* This should not happen because __res_context_query already
++	 perfroms response validation.  */
+       *h_errnop = NO_RECOVERY;
+       return NSS_STATUS_UNAVAIL;
+     }
+-  cp += n + QFIXEDSZ;
++  int ancount = ns_rr_cursor_ancount (&c);
++  const unsigned char *expected_name = ns_rr_cursor_qname (&c);
++  /* expected_name may be updated to point into this buffer.  */
++  unsigned char name_buffer[NS_MAXCDNAME];
+ 
+-  ap = host_data->aliases;
+-  *ap = NULL;
+-  result->h_aliases = host_data->aliases;
+-  hap = host_data->h_addr_ptrs;
+-  *hap = NULL;
+-  result->h_addr_list = host_data->h_addr_ptrs;
+-  haveanswer = 0;
+-  had_error = 0;
+-
+-  while (ancount-- > 0 && cp < end_of_message && had_error == 0)
++  while (ancount > 0)
+     {
+-      int type, class;
+-
+-      n = __ns_name_unpack (answer->buf, end_of_message, cp,
+-			    packtmp, sizeof packtmp);
+-      if (n != -1 && __ns_name_ntop (packtmp, bp, linebuflen) == -1)
++      struct ns_rr_wire rr;
++      if (!__ns_rr_cursor_next (&c, &rr))
+ 	{
+-	  if (__glibc_unlikely (errno == EMSGSIZE))
+-	    goto too_small;
+-
+-	  n = -1;
+-	}
+-
+-      if (__glibc_unlikely (n < 0 || __libc_res_dnok (bp) == 0))
+-	{
+-	  ++had_error;
+-	  continue;
+-	}
+-      cp += n;				/* name */
+-
+-      if (__glibc_unlikely (cp + 10 > end_of_message))
+-	{
+-	  ++had_error;
+-	  continue;
++	  *h_errnop = NO_RECOVERY;
++	  return NSS_STATUS_UNAVAIL;
+ 	}
+ 
+-      NS_GET16 (type, cp);
+-      NS_GET16 (class, cp);
+-      int32_t ttl;
+-      NS_GET32 (ttl, cp);
+-      NS_GET16 (n, cp);		/* RDATA length.  */
++      /* Skip over records with the wrong class.  */
++      if (rr.rclass != C_IN)
++	continue;
+ 
+-      if (end_of_message - cp < n)
+-	{
+-	  /* RDATA extends beyond the end of the packet.  */
+-	  ++had_error;
+-	  continue;
+-	}
+-
+-      if (__glibc_unlikely (class != C_IN))
+-	{
+-	  /* XXX - debug? syslog? */
+-	  cp += n;
+-	  continue;			/* XXX - had_error++ ? */
+-	}
++      /* Update TTL for known record types.  */
++      if ((rr.rtype == T_CNAME || rr.rtype == T_PTR)
++	  && ttlp != NULL && *ttlp > rr.ttl)
++	*ttlp = rr.ttl;
+ 
+-      if (type == T_CNAME)
++      if (rr.rtype == T_CNAME)
+ 	{
+-	  /* A CNAME could also have a TTL entry.  */
+-	  if (ttlp != NULL && ttl < *ttlp)
+-	      *ttlp = ttl;
+-
+-	  n = __libc_dn_expand (answer->buf, end_of_message, cp,
+-				tbuf, sizeof tbuf);
+-	  if (__glibc_unlikely (n < 0 || __libc_res_dnok (tbuf) == 0))
+-	    {
+-	      ++had_error;
+-	      continue;
+-	    }
+-	  cp += n;
+-	  /* Get canonical name.  */
+-	  n = strlen (tbuf) + 1;   /* For the \0.  */
+-	  if (__glibc_unlikely (n > linebuflen))
+-	    goto too_small;
+-	  if (__glibc_unlikely (n >= MAXHOSTNAMELEN))
++	  /* NB: No check for owner name match, based on historic
++	     precedent.  Record the CNAME target as the new expected
++	     name.  */
++	  int n = __ns_name_unpack (c.begin, c.end, rr.rdata,
++				    name_buffer, sizeof (name_buffer));
++	  if (n < 0)
+ 	    {
+-	      ++had_error;
+-	      continue;
++	      *h_errnop = NO_RECOVERY;
++	      return NSS_STATUS_UNAVAIL;
+ 	    }
+-	  tname = bp;
+-	  bp = __mempcpy (bp, tbuf, n);	/* Cannot overflow.  */
+-	  linebuflen -= n;
+-	  continue;
++	  expected_name = name_buffer;
+ 	}
+-
+-      switch (type)
++      else if (rr.rtype == T_PTR
++	       && __ns_samebinaryname (rr.rname, expected_name))
+ 	{
+-	case T_PTR:
+-	  if (__glibc_unlikely (__strcasecmp (tname, bp) != 0))
+-	    {
+-	      cp += n;
+-	      continue;			/* XXX - had_error++ ? */
+-	    }
+-
+-	  n = __ns_name_unpack (answer->buf, end_of_message, cp,
+-				packtmp, sizeof packtmp);
+-	  if (n != -1 && __ns_name_ntop (packtmp, bp, linebuflen) == -1)
+-	    {
+-	      if (__glibc_unlikely (errno == EMSGSIZE))
+-		goto too_small;
+-
+-	      n = -1;
+-	    }
+-
+-	  if (__glibc_unlikely (n < 0 || __libc_res_hnok (bp) == 0))
++	  /* Decompress the target of the PTR record.  This is the
++	     host name we are looking for.  We can only use it if it
++	     is syntactically valid.  Historically, only one host name
++	     is returned here.  If the recursive resolver performs DNS
++	     record rotation, the returned host name is essentially
++	     random, which is why multiple PTR records are rarely
++	     used.  Use MAXHOSTNAMELEN instead of NS_MAXCDNAME for
++	     additional length checking.  */
++	  char hname[MAXHOSTNAMELEN + 1];
++	  if (__ns_name_unpack (c.begin, c.end, rr.rdata,
++				name_buffer, sizeof (name_buffer)) < 0
++	      || !__res_binary_hnok (expected_name)
++	      || __ns_name_ntop (name_buffer, hname, sizeof (hname)) < 0)
+ 	    {
+-	      ++had_error;
+-	      break;
++	      *h_errnop = NO_RECOVERY;
++	      return NSS_STATUS_UNAVAIL;
+ 	    }
+-	  if (ttlp != NULL && ttl < *ttlp)
+-	      *ttlp = ttl;
+-	  /* bind would put multiple PTR records as aliases, but we don't do
+-	     that.  */
+-	  result->h_name = bp;
+-	  *h_errnop = NETDB_SUCCESS;
++	  /* Successful allocation is checked by the caller.  */
++	  *hnamep = alloc_buffer_copy_string (abuf, hname);
+ 	  return NSS_STATUS_SUCCESS;
+-	case T_A:
+-	case T_AAAA:
+-	  if (__glibc_unlikely (__strcasecmp (result->h_name, bp) != 0))
+-	    {
+-	      cp += n;
+-	      continue;			/* XXX - had_error++ ? */
+-	    }
+-
+-	  /* Stop parsing at a record whose length is incorrect.  */
+-	  if (n != rrtype_to_rdata_length (type))
+-	    {
+-	      ++had_error;
+-	      break;
+-	    }
+-
+-	  /* Skip records of the wrong type.  */
+-	  if (n != result->h_length)
+-	    {
+-	      cp += n;
+-	      continue;
+-	    }
+-	  if (!haveanswer)
+-	    {
+-	      int nn;
+-
+-	      /* We compose a single hostent out of the entire chain of
+-	         entries, so the TTL of the hostent is essentially the lowest
+-		 TTL in the chain.  */
+-	      if (ttlp != NULL && ttl < *ttlp)
+-		*ttlp = ttl;
+-	      result->h_name = bp;
+-	      nn = strlen (bp) + 1;	/* for the \0 */
+-	      bp += nn;
+-	      linebuflen -= nn;
+-	    }
+-
+-	  /* Provide sufficient alignment for both address
+-	     families.  */
+-	  enum { align = 4 };
+-	  _Static_assert ((align % __alignof__ (struct in_addr)) == 0,
+-			  "struct in_addr alignment");
+-	  _Static_assert ((align % __alignof__ (struct in6_addr)) == 0,
+-			  "struct in6_addr alignment");
+-	  {
+-	    char *new_bp = PTR_ALIGN_UP (bp, align);
+-	    linebuflen -= new_bp - bp;
+-	    bp = new_bp;
+-	  }
+-
+-	  if (__glibc_unlikely (n > linebuflen))
+-	    goto too_small;
+-	  bp = __mempcpy (*hap++ = bp, cp, n);
+-	  cp += n;
+-	  linebuflen -= n;
+-	  break;
+-	default:
+-	  cp += n;
+-	  continue;			/* XXX - had_error++ ? */
+ 	}
+-      if (had_error == 0)
+-	++haveanswer;
+     }
+ 
+-  if (haveanswer > 0)
+-    {
+-      *ap = NULL;
+-      *hap = NULL;
+-
+-      if (result->h_name == NULL)
+-	{
+-	  n = strlen (qname) + 1;	/* For the \0.  */
+-	  if (n > linebuflen)
+-	    goto too_small;
+-	  if (n >= MAXHOSTNAMELEN)
+-	    goto no_recovery;
+-	  result->h_name = bp;
+-	  bp = __mempcpy (bp, qname, n);	/* Cannot overflow.  */
+-	  linebuflen -= n;
+-	}
++  /* No PTR record found.  */
++  if (ttlp != NULL)
++    /* No caching of negative responses.  */
++    *ttlp = 0;
+ 
+-      *h_errnop = NETDB_SUCCESS;
+-      return NSS_STATUS_SUCCESS;
+-    }
+- no_recovery:
+   *h_errnop = NO_RECOVERY;
+   *errnop = ENOENT;
+   return NSS_STATUS_TRYAGAIN;
+-- 
+2.38.1
+
+
+From 5165080fec63a1f03aa1985b77bca300465bf570 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 30 Aug 2022 10:02:49 +0200
+Subject: [PATCH 31/72] nss_dns: Remove remnants of IPv6 address mapping
+
+res_use_inet6 always returns false since commit 3f8b44be0a658266adff5
+("resolv: Remove support for RES_USE_INET6 and the inet6 option").
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit a7fc30b522a0cd7c8c5e7e285b9531b704e02f04)
+---
+ resolv/README             |  3 --
+ resolv/mapv4v6addr.h      | 69 --------------------------------
+ resolv/mapv4v6hostent.h   | 84 ---------------------------------------
+ resolv/nss_dns/dns-host.c | 54 +++++--------------------
+ 4 files changed, 9 insertions(+), 201 deletions(-)
+ delete mode 100644 resolv/mapv4v6addr.h
+ delete mode 100644 resolv/mapv4v6hostent.h
+
+diff --git a/resolv/README b/resolv/README
+index 514e9bb617..2146bc3b27 100644
+--- a/resolv/README
++++ b/resolv/README
+@@ -146,6 +146,3 @@ res_libc.c is home-brewn, although parts of it are taken from res_data.c.
+ 
+ res_hconf.c and res_hconf.h were contributed by David Mosberger, and
+ do not come from BIND.
+-
+-The files gethnamaddr.c, mapv4v6addr.h and mapv4v6hostent.h are
+-leftovers from BIND 4.9.7.
+diff --git a/resolv/mapv4v6addr.h b/resolv/mapv4v6addr.h
+deleted file mode 100644
+index 7f85f7d5e3..0000000000
+--- a/resolv/mapv4v6addr.h
++++ /dev/null
+@@ -1,69 +0,0 @@
+-/*
+- * ++Copyright++ 1985, 1988, 1993
+- * -
+- * Copyright (c) 1985, 1988, 1993
+- *    The Regents of the University of California.  All rights reserved.
+- *
+- * Redistribution and use in source and binary forms, with or without
+- * modification, are permitted provided that the following conditions
+- * are met:
+- * 1. Redistributions of source code must retain the above copyright
+- *    notice, this list of conditions and the following disclaimer.
+- * 2. Redistributions in binary form must reproduce the above copyright
+- *    notice, this list of conditions and the following disclaimer in the
+- *    documentation and/or other materials provided with the distribution.
+- * 4. Neither the name of the University nor the names of its contributors
+- *    may be used to endorse or promote products derived from this software
+- *    without specific prior written permission.
+- *
+- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+- * SUCH DAMAGE.
+- * -
+- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
+- *
+- * Permission to use, copy, modify, and distribute this software for any
+- * purpose with or without fee is hereby granted, provided that the above
+- * copyright notice and this permission notice appear in all copies, and that
+- * the name of Digital Equipment Corporation not be used in advertising or
+- * publicity pertaining to distribution of the document or software without
+- * specific, written prior permission.
+- *
+- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
+- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
+- * OF MERCHANTABILITY AND FITNESS.   IN NO EVENT SHALL DIGITAL EQUIPMENT
+- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+- * SOFTWARE.
+- * -
+- * --Copyright--
+- */
+-
+-#include <string.h>
+-#include <arpa/nameser.h>
+-
+-static void
+-map_v4v6_address (const char *src, char *dst)
+-{
+-  u_char *p = (u_char *) dst;
+-  int i;
+-
+-  /* Move the IPv4 part to the right position.  */
+-  memcpy (dst + 12, src, INADDRSZ);
+-
+-  /* Mark this ipv6 addr as a mapped ipv4. */
+-  for (i = 0; i < 10; i++)
+-    *p++ = 0x00;
+-  *p++ = 0xff;
+-  *p = 0xff;
+-}
+diff --git a/resolv/mapv4v6hostent.h b/resolv/mapv4v6hostent.h
+deleted file mode 100644
+index c11038adf3..0000000000
+--- a/resolv/mapv4v6hostent.h
++++ /dev/null
+@@ -1,84 +0,0 @@
+-/*
+- * ++Copyright++ 1985, 1988, 1993
+- * -
+- * Copyright (c) 1985, 1988, 1993
+- *    The Regents of the University of California.  All rights reserved.
+- *
+- * Redistribution and use in source and binary forms, with or without
+- * modification, are permitted provided that the following conditions
+- * are met:
+- * 1. Redistributions of source code must retain the above copyright
+- *    notice, this list of conditions and the following disclaimer.
+- * 2. Redistributions in binary form must reproduce the above copyright
+- *    notice, this list of conditions and the following disclaimer in the
+- *    documentation and/or other materials provided with the distribution.
+- * 4. Neither the name of the University nor the names of its contributors
+- *    may be used to endorse or promote products derived from this software
+- *    without specific prior written permission.
+- *
+- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+- * SUCH DAMAGE.
+- * -
+- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
+- *
+- * Permission to use, copy, modify, and distribute this software for any
+- * purpose with or without fee is hereby granted, provided that the above
+- * copyright notice and this permission notice appear in all copies, and that
+- * the name of Digital Equipment Corporation not be used in advertising or
+- * publicity pertaining to distribution of the document or software without
+- * specific, written prior permission.
+- *
+- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
+- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
+- * OF MERCHANTABILITY AND FITNESS.   IN NO EVENT SHALL DIGITAL EQUIPMENT
+- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+- * SOFTWARE.
+- * -
+- * --Copyright--
+- */
+-
+-#include <arpa/nameser.h>
+-#include <sys/socket.h>
+-
+-typedef union {
+-    int32_t al;
+-    char ac;
+-} align;
+-
+-static int
+-map_v4v6_hostent (struct hostent *hp, char **bpp, int *lenp)
+-{
+-  char **ap;
+-
+-  if (hp->h_addrtype != AF_INET || hp->h_length != INADDRSZ)
+-    return 0;
+-  hp->h_addrtype = AF_INET6;
+-  hp->h_length = IN6ADDRSZ;
+-  for (ap = hp->h_addr_list; *ap; ap++)
+-    {
+-      int i = sizeof (align) - ((u_long) *bpp % sizeof (align));
+-
+-      if (*lenp < (i + IN6ADDRSZ))
+-	/* Out of memory.  */
+-	return 1;
+-      *bpp += i;
+-      *lenp -= i;
+-      map_v4v6_address (*ap, *bpp);
+-      *ap = *bpp;
+-      *bpp += IN6ADDRSZ;
+-      *lenp -= IN6ADDRSZ;
+-    }
+-  return 0;
+-}
+diff --git a/resolv/nss_dns/dns-host.c b/resolv/nss_dns/dns-host.c
+index cd26399b7e..8e38583e15 100644
+--- a/resolv/nss_dns/dns-host.c
++++ b/resolv/nss_dns/dns-host.c
+@@ -87,10 +87,6 @@
+ #include <resolv/resolv-internal.h>
+ #include <resolv/resolv_context.h>
+ 
+-/* Get implementations of some internal functions.  */
+-#include <resolv/mapv4v6addr.h>
+-#include <resolv/mapv4v6hostent.h>
+-
+ #define RESOLVSORT
+ 
+ #if PACKETSZ > 65536
+@@ -116,7 +112,7 @@ static enum nss_status getanswer_r (struct resolv_context *ctx,
+ 				    const char *qname, int qtype,
+ 				    struct hostent *result, char *buffer,
+ 				    size_t buflen, int *errnop, int *h_errnop,
+-				    int map, int32_t *ttlp, char **canonp);
++				    int32_t *ttlp, char **canonp);
+ static enum nss_status getanswer_ptr (unsigned char *packet, size_t packetlen,
+ 				      struct alloc_buffer *abuf,
+ 				      char **hnamep, int *errnop,
+@@ -197,7 +193,6 @@ gethostbyname3_context (struct resolv_context *ctx,
+   char tmp[NS_MAXDNAME];
+   int size, type, n;
+   const char *cp;
+-  int map = 0;
+   int olderr = errno;
+   enum nss_status status;
+ 
+@@ -258,32 +253,12 @@ gethostbyname3_context (struct resolv_context *ctx,
+ 	*errnop = EAGAIN;
+       else
+ 	__set_errno (olderr);
+-
+-      /* If we are looking for an IPv6 address and mapping is enabled
+-	 by having the RES_USE_INET6 bit in _res.options set, we try
+-	 another lookup.  */
+-      if (af == AF_INET6 && res_use_inet6 ())
+-	n = __res_context_search (ctx, name, C_IN, T_A, host_buffer.buf->buf,
+-				  host_buffer.buf != orig_host_buffer
+-				  ? MAXPACKET : 1024, &host_buffer.ptr,
+-				  NULL, NULL, NULL, NULL);
+-
+-      if (n < 0)
+-	{
+-	  if (host_buffer.buf != orig_host_buffer)
+-	    free (host_buffer.buf);
+-	  return status;
+-	}
+-
+-      map = 1;
+-
+-      result->h_addrtype = AF_INET;
+-      result->h_length = INADDRSZ;
+     }
++  else
++    status = getanswer_r
++      (ctx, host_buffer.buf, n, name, type, result, buffer, buflen,
++       errnop, h_errnop, ttlp, canonp);
+ 
+-  status = getanswer_r
+-    (ctx, host_buffer.buf, n, name, type, result, buffer, buflen,
+-     errnop, h_errnop, map, ttlp, canonp);
+   if (host_buffer.buf != orig_host_buffer)
+     free (host_buffer.buf);
+   return status;
+@@ -329,13 +304,8 @@ _nss_dns_gethostbyname_r (const char *name, struct hostent *result,
+       *h_errnop = NETDB_INTERNAL;
+       return NSS_STATUS_UNAVAIL;
+     }
+-  status = NSS_STATUS_NOTFOUND;
+-  if (res_use_inet6 ())
+-    status = gethostbyname3_context (ctx, name, AF_INET6, result, buffer,
+-				     buflen, errnop, h_errnop, NULL, NULL);
+-  if (status == NSS_STATUS_NOTFOUND)
+-    status = gethostbyname3_context (ctx, name, AF_INET, result, buffer,
+-				     buflen, errnop, h_errnop, NULL, NULL);
++  status = gethostbyname3_context (ctx, name, AF_INET, result, buffer,
++				   buflen, errnop, h_errnop, NULL, NULL);
+   __resolv_context_put (ctx);
+   return status;
+ }
+@@ -648,7 +618,7 @@ static enum nss_status
+ getanswer_r (struct resolv_context *ctx,
+ 	     const querybuf *answer, int anslen, const char *qname, int qtype,
+ 	     struct hostent *result, char *buffer, size_t buflen,
+-	     int *errnop, int *h_errnop, int map, int32_t *ttlp, char **canonp)
++	     int *errnop, int *h_errnop, int32_t *ttlp, char **canonp)
+ {
+   struct host_data
+   {
+@@ -664,7 +634,6 @@ getanswer_r (struct resolv_context *ctx,
+   char *bp, **ap, **hap;
+   char tbuf[MAXDNAME];
+   u_char packtmp[NS_MAXCDNAME];
+-  int have_to_map = 0;
+   uintptr_t pad = -(uintptr_t) buffer % __alignof__ (struct host_data);
+   buffer += pad;
+   buflen = buflen > pad ? buflen - pad : 0;
+@@ -845,9 +814,7 @@ getanswer_r (struct resolv_context *ctx,
+ 	  continue;
+ 	}
+ 
+-      if (type == T_A && qtype == T_AAAA && map)
+-	have_to_map = 1;
+-      else if (__glibc_unlikely (type != qtype))
++      if (__glibc_unlikely (type != qtype))
+ 	{
+ 	  cp += n;
+ 	  continue;			/* XXX - had_error++ ? */
+@@ -944,9 +911,6 @@ getanswer_r (struct resolv_context *ctx,
+ 	  linebuflen -= n;
+ 	}
+ 
+-      if (have_to_map)
+-	if (map_v4v6_hostent (result, &bp, &linebuflen))
+-	  goto too_small;
+       *h_errnop = NETDB_SUCCESS;
+       return NSS_STATUS_SUCCESS;
+     }
+-- 
+2.38.1
+
+
+From 78c8ef21fa54e994451d5b42ead6080d99a88a49 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 30 Aug 2022 10:02:49 +0200
+Subject: [PATCH 32/72] nss_dns: Rewrite getanswer_r to match getanswer_ptr
+ (bug 12154, bug 29305)
+
+Allocate the pointer arrays only at the end, when their sizes
+are known.  This addresses bug 29305.
+
+Skip over invalid names instead of failing lookups.  This partially
+fixes bug 12154 (for gethostbyname, fixing getaddrinfo requires
+different changes).
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit d101d836e7e4bd1d4e4972b0e0bd0a55c9b650fa)
+---
+ resolv/nss_dns/dns-host.c | 478 ++++++++++++++------------------------
+ 1 file changed, 180 insertions(+), 298 deletions(-)
+
+diff --git a/resolv/nss_dns/dns-host.c b/resolv/nss_dns/dns-host.c
+index 8e38583e15..b887e77e9c 100644
+--- a/resolv/nss_dns/dns-host.c
++++ b/resolv/nss_dns/dns-host.c
+@@ -107,12 +107,19 @@ typedef union querybuf
+   u_char buf[MAXPACKET];
+ } querybuf;
+ 
+-static enum nss_status getanswer_r (struct resolv_context *ctx,
+-				    const querybuf *answer, int anslen,
+-				    const char *qname, int qtype,
+-				    struct hostent *result, char *buffer,
+-				    size_t buflen, int *errnop, int *h_errnop,
+-				    int32_t *ttlp, char **canonp);
++/* For historic reasons, pointers to IP addresses are char *, so use a
++   single list type for addresses and host names.  */
++#define DYNARRAY_STRUCT ptrlist
++#define DYNARRAY_ELEMENT char *
++#define DYNARRAY_PREFIX ptrlist_
++#include <malloc/dynarray-skeleton.c>
++
++static enum nss_status getanswer_r (unsigned char *packet, size_t packetlen,
++				    uint16_t qtype, struct alloc_buffer *abuf,
++				    struct ptrlist *addresses,
++				    struct ptrlist *aliases,
++				    int *errnop, int *h_errnop, int32_t *ttlp);
++static void addrsort (struct resolv_context *ctx, char **ap, int num);
+ static enum nss_status getanswer_ptr (unsigned char *packet, size_t packetlen,
+ 				      struct alloc_buffer *abuf,
+ 				      char **hnamep, int *errnop,
+@@ -184,12 +191,6 @@ gethostbyname3_context (struct resolv_context *ctx,
+ 			char *buffer, size_t buflen, int *errnop,
+ 			int *h_errnop, int32_t *ttlp, char **canonp)
+ {
+-  union
+-  {
+-    querybuf *buf;
+-    u_char *ptr;
+-  } host_buffer;
+-  querybuf *orig_host_buffer;
+   char tmp[NS_MAXDNAME];
+   int size, type, n;
+   const char *cp;
+@@ -223,10 +224,12 @@ gethostbyname3_context (struct resolv_context *ctx,
+       && (cp = __res_context_hostalias (ctx, name, tmp, sizeof (tmp))) != NULL)
+     name = cp;
+ 
+-  host_buffer.buf = orig_host_buffer = (querybuf *) alloca (1024);
++  unsigned char dns_packet_buffer[1024];
++  unsigned char *alt_dns_packet_buffer = dns_packet_buffer;
+ 
+-  n = __res_context_search (ctx, name, C_IN, type, host_buffer.buf->buf,
+-			    1024, &host_buffer.ptr, NULL, NULL, NULL, NULL);
++  n = __res_context_search (ctx, name, C_IN, type,
++			    dns_packet_buffer, sizeof (dns_packet_buffer),
++			    &alt_dns_packet_buffer, NULL, NULL, NULL, NULL);
+   if (n < 0)
+     {
+       switch (errno)
+@@ -255,12 +258,77 @@ gethostbyname3_context (struct resolv_context *ctx,
+ 	__set_errno (olderr);
+     }
+   else
+-    status = getanswer_r
+-      (ctx, host_buffer.buf, n, name, type, result, buffer, buflen,
+-       errnop, h_errnop, ttlp, canonp);
++    {
++      struct alloc_buffer abuf = alloc_buffer_create (buffer, buflen);
+ 
+-  if (host_buffer.buf != orig_host_buffer)
+-    free (host_buffer.buf);
++      struct ptrlist addresses;
++      ptrlist_init (&addresses);
++      struct ptrlist aliases;
++      ptrlist_init (&aliases);
++
++      status = getanswer_r (alt_dns_packet_buffer, n, type,
++			    &abuf, &addresses, &aliases,
++			    errnop, h_errnop, ttlp);
++      if (status == NSS_STATUS_SUCCESS)
++	{
++	  if (ptrlist_has_failed (&addresses)
++	      || ptrlist_has_failed (&aliases))
++	    {
++	      /* malloc failure.  Do not retry using the ERANGE protocol.  */
++	      *errnop = ENOMEM;
++	      *h_errnop = NETDB_INTERNAL;
++	      status = NSS_STATUS_UNAVAIL;
++	    }
++
++	  /* Reserve the address and alias arrays in the result
++	     buffer.  Both are NULL-terminated, but the first element
++	     of the alias array is stored in h_name, so no extra space
++	     for the NULL terminator is needed there.  */
++	  result->h_addr_list
++	    = alloc_buffer_alloc_array (&abuf, char *,
++					ptrlist_size (&addresses) + 1);
++	  result->h_aliases
++	    = alloc_buffer_alloc_array (&abuf, char *,
++					ptrlist_size (&aliases));
++	  if (alloc_buffer_has_failed (&abuf))
++	    {
++	      /* Retry using the ERANGE protocol.  */
++	      *errnop = ERANGE;
++	      *h_errnop = NETDB_INTERNAL;
++	      status = NSS_STATUS_TRYAGAIN;
++	    }
++	  else
++	    {
++	      /* Copy the address list and NULL-terminate it.  */
++	      memcpy (result->h_addr_list, ptrlist_begin (&addresses),
++		      ptrlist_size (&addresses) * sizeof (char *));
++	      result->h_addr_list[ptrlist_size (&addresses)] = NULL;
++
++	      /* Sort the address list if requested.  */
++	      if (type == T_A && __resolv_context_sort_count (ctx) > 0)
++		addrsort (ctx, result->h_addr_list, ptrlist_size (&addresses));
++
++	      /* Copy the aliases,  excluding the last one. */
++	      memcpy (result->h_aliases, ptrlist_begin (&aliases),
++		      (ptrlist_size (&aliases) - 1) * sizeof (char *));
++	      result->h_aliases[ptrlist_size (&aliases) - 1] = NULL;
++
++	      /* The last alias goes into h_name.  */
++	      assert (ptrlist_size (&aliases) >= 1);
++	      result->h_name = ptrlist_end (&aliases)[-1];
++
++	      /* This is also the canonical name.  */
++	      if (canonp != NULL)
++		*canonp = result->h_name;
++	    }
++	}
++
++      ptrlist_free (&aliases);
++      ptrlist_free (&addresses);
++    }
++
++  if (alt_dns_packet_buffer != dns_packet_buffer)
++    free (alt_dns_packet_buffer);
+   return status;
+ }
+ 
+@@ -614,314 +682,128 @@ addrsort (struct resolv_context *ctx, char **ap, int num)
+ 	break;
+ }
+ 
+-static enum nss_status
+-getanswer_r (struct resolv_context *ctx,
+-	     const querybuf *answer, int anslen, const char *qname, int qtype,
+-	     struct hostent *result, char *buffer, size_t buflen,
+-	     int *errnop, int *h_errnop, int32_t *ttlp, char **canonp)
++/* Convert the uncompressed, binary domain name CDNAME into its
++   textual representation and add it to the end of ALIASES, allocating
++   space for a copy of the name from ABUF.  Skip adding the name if it
++   is not a valid host name, and return false in that case, otherwise
++   true.  */
++static bool
++getanswer_r_store_alias (const unsigned char *cdname,
++			 struct alloc_buffer *abuf,
++			 struct ptrlist *aliases)
+ {
+-  struct host_data
+-  {
+-    char *aliases[MAX_NR_ALIASES];
+-    unsigned char host_addr[16];	/* IPv4 or IPv6 */
+-    char *h_addr_ptrs[0];
+-  } *host_data;
+-  int linebuflen;
+-  const HEADER *hp;
+-  const u_char *end_of_message, *cp;
+-  int n, ancount, qdcount;
+-  int haveanswer, had_error;
+-  char *bp, **ap, **hap;
+-  char tbuf[MAXDNAME];
+-  u_char packtmp[NS_MAXCDNAME];
+-  uintptr_t pad = -(uintptr_t) buffer % __alignof__ (struct host_data);
+-  buffer += pad;
+-  buflen = buflen > pad ? buflen - pad : 0;
+-  if (__glibc_unlikely (buflen < sizeof (struct host_data)))
+-    {
+-      /* The buffer is too small.  */
+-    too_small:
+-      *errnop = ERANGE;
+-      *h_errnop = NETDB_INTERNAL;
+-      return NSS_STATUS_TRYAGAIN;
+-    }
+-  host_data = (struct host_data *) buffer;
+-  linebuflen = buflen - sizeof (struct host_data);
+-  if (buflen - sizeof (struct host_data) != linebuflen)
+-    linebuflen = INT_MAX;
+-
+-  result->h_name = NULL;
+-  end_of_message = answer->buf + anslen;
+-
+-  /*
+-   * find first satisfactory answer
+-   */
+-  hp = &answer->hdr;
+-  ancount = ntohs (hp->ancount);
+-  qdcount = ntohs (hp->qdcount);
+-  cp = answer->buf + HFIXEDSZ;
+-  if (__glibc_unlikely (qdcount != 1))
+-    {
+-      *h_errnop = NO_RECOVERY;
+-      return NSS_STATUS_UNAVAIL;
+-    }
+-  if (sizeof (struct host_data) + (ancount + 1) * sizeof (char *) >= buflen)
+-    goto too_small;
+-  bp = (char *) &host_data->h_addr_ptrs[ancount + 1];
+-  linebuflen -= (ancount + 1) * sizeof (char *);
+-
+-  n = __ns_name_unpack (answer->buf, end_of_message, cp,
+-			packtmp, sizeof packtmp);
+-  if (n != -1 && __ns_name_ntop (packtmp, bp, linebuflen) == -1)
+-    {
+-      if (__glibc_unlikely (errno == EMSGSIZE))
+-	goto too_small;
+-
+-      n = -1;
+-    }
++  /* Filter out domain names that are not host names.  */
++  if (!__res_binary_hnok (cdname))
++    return false;
++
++  /* Note: Not NS_MAXCDNAME, so that __ns_name_ntop implicitly checks
++     for length.  */
++  char dname[MAXHOSTNAMELEN + 1];
++  if (__ns_name_ntop (cdname, dname, sizeof (dname)) < 0)
++    return false;
++  /* Do not report an error on allocation failure, instead store NULL
++     or do nothing.  getanswer_r's caller will see NSS_STATUS_SUCCESS
++     and detect the memory allocation failure or buffer space
++     exhaustion, and report it accordingly.  */
++  ptrlist_add (aliases, alloc_buffer_copy_string (abuf, dname));
++  return true;
++}
+ 
+-  if (__glibc_unlikely (n < 0))
+-    {
+-      *errnop = errno;
+-      *h_errnop = NO_RECOVERY;
+-      return NSS_STATUS_UNAVAIL;
+-    }
+-  if (__glibc_unlikely (__libc_res_hnok (bp) == 0))
++static enum nss_status __attribute__ ((noinline))
++getanswer_r (unsigned char *packet, size_t packetlen, uint16_t qtype,
++	     struct alloc_buffer *abuf,
++	     struct ptrlist *addresses, struct ptrlist *aliases,
++	     int *errnop, int *h_errnop, int32_t *ttlp)
++{
++  struct ns_rr_cursor c;
++  if (!__ns_rr_cursor_init (&c, packet, packetlen))
+     {
+-      errno = EBADMSG;
+-      *errnop = EBADMSG;
++      /* This should not happen because __res_context_query already
++	 perfroms response validation.  */
+       *h_errnop = NO_RECOVERY;
+       return NSS_STATUS_UNAVAIL;
+     }
+-  cp += n + QFIXEDSZ;
+ 
+-  if (qtype == T_A || qtype == T_AAAA)
++  /* Treat the QNAME just like an alias.  Error out if it is not a
++     valid host name.  */
++  if (ns_rr_cursor_rcode (&c) == NXDOMAIN
++      || !getanswer_r_store_alias (ns_rr_cursor_qname (&c), abuf, aliases))
+     {
+-      /* res_send() has already verified that the query name is the
+-       * same as the one we sent; this just gets the expanded name
+-       * (i.e., with the succeeding search-domain tacked on).
+-       */
+-      n = strlen (bp) + 1;             /* for the \0 */
+-      if (n >= MAXHOSTNAMELEN)
+-	{
+-	  *h_errnop = NO_RECOVERY;
+-	  *errnop = ENOENT;
+-	  return NSS_STATUS_TRYAGAIN;
+-	}
+-      result->h_name = bp;
+-      bp += n;
+-      linebuflen -= n;
+-      if (linebuflen < 0)
+-	goto too_small;
+-      /* The qname can be abbreviated, but h_name is now absolute. */
+-      qname = result->h_name;
++      if (ttlp != NULL)
++	/* No negative caching.  */
++	*ttlp = 0;
++      *h_errnop = HOST_NOT_FOUND;
++      *errnop = ENOENT;
++      return NSS_STATUS_NOTFOUND;
+     }
+ 
+-  ap = host_data->aliases;
+-  *ap = NULL;
+-  result->h_aliases = host_data->aliases;
+-  hap = host_data->h_addr_ptrs;
+-  *hap = NULL;
+-  result->h_addr_list = host_data->h_addr_ptrs;
+-  haveanswer = 0;
+-  had_error = 0;
++  int ancount = ns_rr_cursor_ancount (&c);
++  const unsigned char *expected_name = ns_rr_cursor_qname (&c);
++  /* expected_name may be updated to point into this buffer.  */
++  unsigned char name_buffer[NS_MAXCDNAME];
+ 
+-  while (ancount-- > 0 && cp < end_of_message && had_error == 0)
++  for (; ancount > 0; --ancount)
+     {
+-      int type, class;
+-
+-      n = __ns_name_unpack (answer->buf, end_of_message, cp,
+-			    packtmp, sizeof packtmp);
+-      if (n != -1 && __ns_name_ntop (packtmp, bp, linebuflen) == -1)
+-	{
+-	  if (__glibc_unlikely (errno == EMSGSIZE))
+-	    goto too_small;
+-
+-	  n = -1;
+-	}
+-
+-      if (__glibc_unlikely (n < 0 || __libc_res_hnok (bp) == 0))
+-	{
+-	  ++had_error;
+-	  continue;
+-	}
+-      cp += n;				/* name */
+-
+-      if (__glibc_unlikely (cp + 10 > end_of_message))
++      struct ns_rr_wire rr;
++      if (!__ns_rr_cursor_next (&c, &rr))
+ 	{
+-	  ++had_error;
+-	  continue;
++	  *h_errnop = NO_RECOVERY;
++	  return NSS_STATUS_UNAVAIL;
+ 	}
+ 
+-      NS_GET16 (type, cp);
+-      NS_GET16 (class, cp);
+-      int32_t ttl;
+-      NS_GET32 (ttl, cp);
+-      NS_GET16 (n, cp);		/* RDATA length.  */
+-
+-      if (end_of_message - cp < n)
+-	{
+-	  /* RDATA extends beyond the end of the packet.  */
+-	  ++had_error;
+-	  continue;
+-	}
++      /* Skip over records with the wrong class.  */
++      if (rr.rclass != C_IN)
++	continue;
+ 
+-      if (__glibc_unlikely (class != C_IN))
+-	{
+-	  /* XXX - debug? syslog? */
+-	  cp += n;
+-	  continue;			/* XXX - had_error++ ? */
+-	}
++      /* Update TTL for recognized record types.  */
++      if ((rr.rtype == T_CNAME || rr.rtype == qtype)
++	  && ttlp != NULL && *ttlp > rr.ttl)
++	*ttlp = rr.ttl;
+ 
+-      if (type == T_CNAME)
++      if (rr.rtype == T_CNAME)
+ 	{
+-	  /* A CNAME could also have a TTL entry.  */
+-	  if (ttlp != NULL && ttl < *ttlp)
+-	      *ttlp = ttl;
+-
+-	  if (ap >= &host_data->aliases[MAX_NR_ALIASES - 1])
+-	    continue;
+-	  n = __libc_dn_expand (answer->buf, end_of_message, cp,
+-				tbuf, sizeof tbuf);
+-	  if (__glibc_unlikely (n < 0 || __libc_res_hnok (tbuf) == 0))
+-	    {
+-	      ++had_error;
+-	      continue;
+-	    }
+-	  cp += n;
+-	  /* Store alias.  */
+-	  *ap++ = bp;
+-	  n = strlen (bp) + 1;		/* For the \0.  */
+-	  if (__glibc_unlikely (n >= MAXHOSTNAMELEN))
+-	    {
+-	      ++had_error;
+-	      continue;
+-	    }
+-	  bp += n;
+-	  linebuflen -= n;
+-	  /* Get canonical name.  */
+-	  n = strlen (tbuf) + 1;	/* For the \0.  */
+-	  if (__glibc_unlikely (n > linebuflen))
+-	    goto too_small;
+-	  if (__glibc_unlikely (n >= MAXHOSTNAMELEN))
++	  /* NB: No check for owner name match, based on historic
++	     precedent.  Record the CNAME target as the new expected
++	     name.  */
++	  int n = __ns_name_unpack (c.begin, c.end, rr.rdata,
++				    name_buffer, sizeof (name_buffer));
++	  if (n < 0)
+ 	    {
+-	      ++had_error;
+-	      continue;
++	      *h_errnop = NO_RECOVERY;
++	      return NSS_STATUS_UNAVAIL;
+ 	    }
+-	  result->h_name = bp;
+-	  bp = __mempcpy (bp, tbuf, n);	/* Cannot overflow.  */
+-	  linebuflen -= n;
+-	  continue;
++	  /* And store the new name as an alias.  */
++	  getanswer_r_store_alias (name_buffer, abuf, aliases);
++	  expected_name = name_buffer;
+ 	}
+-
+-      if (__glibc_unlikely (type != qtype))
++      else if (rr.rtype == qtype
++	       && __ns_samebinaryname (rr.rname, expected_name)
++	       && rr.rdlength == rrtype_to_rdata_length (qtype))
+ 	{
+-	  cp += n;
+-	  continue;			/* XXX - had_error++ ? */
++	  /* Make a copy of the address and store it.  Increase the
++	     alignment to 4, in case there are applications out there
++	     that expect at least this level of address alignment.  */
++	  ptrlist_add (addresses, (char *) alloc_buffer_next (abuf, uint32_t));
++	  alloc_buffer_copy_bytes (abuf, rr.rdata, rr.rdlength);
+ 	}
+-
+-      switch (type)
+-	{
+-	case T_A:
+-	case T_AAAA:
+-	  if (__glibc_unlikely (__strcasecmp (result->h_name, bp) != 0))
+-	    {
+-	      cp += n;
+-	      continue;			/* XXX - had_error++ ? */
+-	    }
+-
+-	  /* Stop parsing at a record whose length is incorrect.  */
+-	  if (n != rrtype_to_rdata_length (type))
+-	    {
+-	      ++had_error;
+-	      break;
+-	    }
+-
+-	  /* Skip records of the wrong type.  */
+-	  if (n != result->h_length)
+-	    {
+-	      cp += n;
+-	      continue;
+-	    }
+-	  if (!haveanswer)
+-	    {
+-	      int nn;
+-
+-	      /* We compose a single hostent out of the entire chain of
+-	         entries, so the TTL of the hostent is essentially the lowest
+-		 TTL in the chain.  */
+-	      if (ttlp != NULL && ttl < *ttlp)
+-		*ttlp = ttl;
+-	      if (canonp != NULL)
+-		*canonp = bp;
+-	      result->h_name = bp;
+-	      nn = strlen (bp) + 1;	/* for the \0 */
+-	      bp += nn;
+-	      linebuflen -= nn;
+-	    }
+-
+-	  /* Provide sufficient alignment for both address
+-	     families.  */
+-	  enum { align = 4 };
+-	  _Static_assert ((align % __alignof__ (struct in_addr)) == 0,
+-			  "struct in_addr alignment");
+-	  _Static_assert ((align % __alignof__ (struct in6_addr)) == 0,
+-			  "struct in6_addr alignment");
+-	  {
+-	    char *new_bp = PTR_ALIGN_UP (bp, align);
+-	    linebuflen -= new_bp - bp;
+-	    bp = new_bp;
+-	  }
+-
+-	  if (__glibc_unlikely (n > linebuflen))
+-	    goto too_small;
+-	  bp = __mempcpy (*hap++ = bp, cp, n);
+-	  cp += n;
+-	  linebuflen -= n;
+-	  break;
+-	default:
+-	  abort ();
+-	}
+-      if (had_error == 0)
+-	++haveanswer;
+     }
+ 
+-  if (haveanswer > 0)
++  if (ptrlist_size (addresses) == 0)
+     {
+-      *ap = NULL;
+-      *hap = NULL;
+-      /*
+-       * Note: we sort even if host can take only one address
+-       * in its return structures - should give it the "best"
+-       * address in that case, not some random one
+-       */
+-      if (haveanswer > 1 && qtype == T_A
+-	  && __resolv_context_sort_count (ctx) > 0)
+-	addrsort (ctx, host_data->h_addr_ptrs, haveanswer);
+-
+-      if (result->h_name == NULL)
+-	{
+-	  n = strlen (qname) + 1;	/* For the \0.  */
+-	  if (n > linebuflen)
+-	    goto too_small;
+-	  if (n >= MAXHOSTNAMELEN)
+-	    goto no_recovery;
+-	  result->h_name = bp;
+-	  bp = __mempcpy (bp, qname, n);	/* Cannot overflow.  */
+-	  linebuflen -= n;
+-	}
++      /* No address record found.  */
++      if (ttlp != NULL)
++	/* No caching of negative responses.  */
++	*ttlp = 0;
+ 
++      *h_errnop = NO_RECOVERY;
++      *errnop = ENOENT;
++      return NSS_STATUS_TRYAGAIN;
++    }
++  else
++    {
+       *h_errnop = NETDB_SUCCESS;
+       return NSS_STATUS_SUCCESS;
+     }
+- no_recovery:
+-  *h_errnop = NO_RECOVERY;
+-  *errnop = ENOENT;
+-  /* Special case here: if the resolver sent a result but it only
+-     contains a CNAME while we are looking for a T_A or T_AAAA record,
+-     we fail with NOTFOUND instead of TRYAGAIN.  */
+-  return ((qtype == T_A || qtype == T_AAAA) && ap != host_data->aliases
+-	   ? NSS_STATUS_NOTFOUND : NSS_STATUS_TRYAGAIN);
+ }
+ 
+ static enum nss_status
+-- 
+2.38.1
+
+
+From 7a236dc44a22dc4252e803d1ee1d3b970ec43805 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 30 Aug 2022 10:02:49 +0200
+Subject: [PATCH 33/72] nss_dns: In gaih_getanswer_slice, skip strange aliases
+ (bug 12154)
+
+If the name is not a host name, skip adding it to the result, instead
+of reporting query failure.  This fixes bug 12154 for getaddrinfo.
+
+This commit still keeps the old parsing code, and only adjusts when
+a host name is copied.
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit 32b599ac8c21c4c332cc3900a792a1395bca79c7)
+---
+ resolv/nss_dns/dns-host.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/resolv/nss_dns/dns-host.c b/resolv/nss_dns/dns-host.c
+index b887e77e9c..bea505d697 100644
+--- a/resolv/nss_dns/dns-host.c
++++ b/resolv/nss_dns/dns-host.c
+@@ -970,12 +970,12 @@ gaih_getanswer_slice (const querybuf *answer, int anslen, const char *qname,
+ 
+ 	  n = -1;
+ 	}
+-      if (__glibc_unlikely (n < 0 || __libc_res_hnok (buffer) == 0))
++      if (__glibc_unlikely (n < 0))
+ 	{
+ 	  ++had_error;
+ 	  continue;
+ 	}
+-      if (*firstp && canon == NULL)
++      if (*firstp && canon == NULL && __libc_res_hnok (buffer))
+ 	{
+ 	  h_name = buffer;
+ 	  buffer += h_namelen;
+@@ -1021,14 +1021,14 @@ gaih_getanswer_slice (const querybuf *answer, int anslen, const char *qname,
+ 
+ 	  n = __libc_dn_expand (answer->buf, end_of_message, cp,
+ 				tbuf, sizeof tbuf);
+-	  if (__glibc_unlikely (n < 0 || __libc_res_hnok (tbuf) == 0))
++	  if (__glibc_unlikely (n < 0))
+ 	    {
+ 	      ++had_error;
+ 	      continue;
+ 	    }
+ 	  cp += n;
+ 
+-	  if (*firstp)
++	  if (*firstp && __libc_res_hnok (tbuf))
+ 	    {
+ 	      /* Reclaim buffer space.  */
+ 	      if (h_name + h_namelen == buffer)
+-- 
+2.38.1
+
+
+From e2ec6a8db38a6b734bbdb41e498fdc9460f7566a Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 30 Aug 2022 10:02:49 +0200
+Subject: [PATCH 34/72] resolv: Add new tst-resolv-invalid-cname
+
+This test checks resolution through CNAME chains that do not contain
+host names (bug 12154).
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit 9caf782276ecea4bc86fc94fbb52779736f3106d)
+---
+ resolv/Makefile                   |   3 +
+ resolv/tst-resolv-invalid-cname.c | 406 ++++++++++++++++++++++++++++++
+ 2 files changed, 409 insertions(+)
+ create mode 100644 resolv/tst-resolv-invalid-cname.c
+
+diff --git a/resolv/Makefile b/resolv/Makefile
+index 018b1808d6..f8a92c6cff 100644
+--- a/resolv/Makefile
++++ b/resolv/Makefile
+@@ -98,6 +98,7 @@ tests += \
+   tst-resolv-binary \
+   tst-resolv-byaddr \
+   tst-resolv-edns \
++  tst-resolv-invalid-cname \
+   tst-resolv-network \
+   tst-resolv-noaaaa \
+   tst-resolv-nondecimal \
+@@ -287,6 +288,8 @@ $(objpfx)tst-resolv-res_init-multi: $(objpfx)libresolv.so \
+   $(shared-thread-library)
+ $(objpfx)tst-resolv-res_init-thread: $(objpfx)libresolv.so \
+   $(shared-thread-library)
++$(objpfx)tst-resolv-invalid-cname: $(objpfx)libresolv.so \
++  $(shared-thread-library)
+ $(objpfx)tst-resolv-noaaaa: $(objpfx)libresolv.so $(shared-thread-library)
+ $(objpfx)tst-resolv-nondecimal: $(objpfx)libresolv.so $(shared-thread-library)
+ $(objpfx)tst-resolv-qtypes: $(objpfx)libresolv.so $(shared-thread-library)
+diff --git a/resolv/tst-resolv-invalid-cname.c b/resolv/tst-resolv-invalid-cname.c
+new file mode 100644
+index 0000000000..ae2d4419b1
+--- /dev/null
++++ b/resolv/tst-resolv-invalid-cname.c
+@@ -0,0 +1,406 @@
++/* Test handling of CNAMEs with non-host domain names (bug 12154).
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <errno.h>
++#include <netdb.h>
++#include <resolv.h>
++#include <stdlib.h>
++#include <string.h>
++#include <support/check.h>
++#include <support/check_nss.h>
++#include <support/resolv_test.h>
++#include <support/support.h>
++#include <support/xmemstream.h>
++
++/* Query strings describe the CNAME chain in the response.  They have
++   the format "bitsBITS.countCOUNT.example.", where BITS and COUNT are
++   replaced by unsigned decimal numbers.  COUNT is the number of CNAME
++   records in the response.  BITS has two bits for each CNAME record,
++   describing a special prefix that is added to that CNAME.
++
++   0: No special leading label.
++   1: Starting with "*.".
++   2: Starting with "-x.".
++   3: Starting with "star.*.".
++
++   The first CNAME in the response using the two least significant
++   bits.
++
++   For PTR queries, the QNAME format is different, it is either
++   COUNT.BITS.168.192.in-addr.arpa. (with BITS and COUNT still
++   decimal), or:
++
++COUNT.BITS0.BITS1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa.
++
++   where BITS and COUNT are hexadecimal.  */
++
++static void
++response (const struct resolv_response_context *ctx,
++          struct resolv_response_builder *b,
++          const char *qname, uint16_t qclass, uint16_t qtype)
++{
++  TEST_COMPARE (qclass, C_IN);
++
++  /* The only other query type besides A is PTR.  */
++  if (qtype != T_A && qtype != T_AAAA)
++    TEST_COMPARE (qtype, T_PTR);
++
++  unsigned int bits, bits1, count;
++  char *tail = NULL;
++  if (sscanf (qname, "bits%u.count%u.%ms", &bits, &count, &tail) == 3)
++    TEST_COMPARE_STRING (tail, "example");
++  else if (strstr (qname, "in-addr.arpa") != NULL
++           && sscanf (qname, "%u.%u.%ms", &bits, &count, &tail) == 3)
++    TEST_COMPARE_STRING (tail, "168.192.in-addr.arpa");
++  else if (sscanf (qname, "%x.%x.%x.%ms", &bits, &bits1, &count, &tail) == 4)
++    {
++      TEST_COMPARE_STRING (tail, "\
++0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa");
++      bits |= bits1 << 4;
++    }
++  else
++    FAIL_EXIT1 ("invalid QNAME: %s\n", qname);
++  free (tail);
++
++  struct resolv_response_flags flags = {};
++  resolv_response_init (b, flags);
++  resolv_response_add_question (b, qname, qclass, qtype);
++  resolv_response_section (b, ns_s_an);
++
++  /* Provide the requested number of CNAME records.  */
++  char *previous_name = (char *) qname;
++  unsigned int original_bits = bits;
++  for (int unique = 0; unique < count; ++unique)
++    {
++      resolv_response_open_record (b, previous_name, qclass, T_CNAME, 60);
++
++      static const char bits_to_prefix[4][8] = { "", "*.", "-x.", "star.*." };
++      char *new_name = xasprintf ("%sunique%d.example",
++                                  bits_to_prefix[bits & 3], unique);
++      bits >>= 2;
++      resolv_response_add_name (b, new_name);
++      resolv_response_close_record (b);
++
++      if (previous_name != qname)
++        free (previous_name);
++      previous_name = new_name;
++    }
++
++  /* Actual answer record.  */
++  resolv_response_open_record (b, previous_name, qclass, qtype, 60);
++  switch (qtype)
++    {
++    case T_A:
++      {
++        char ipv4[4] = {192, 168, count, original_bits};
++        resolv_response_add_data (b, &ipv4, sizeof (ipv4));
++      }
++      break;
++    case T_AAAA:
++      {
++        char ipv6[16] =
++          {
++            0x20, 0x01, 0xd, 0xb8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
++            count, original_bits
++          };
++        resolv_response_add_data (b, &ipv6, sizeof (ipv6));
++      }
++      break;
++
++    case T_PTR:
++      {
++        char *name = xasprintf ("bits%u.count%u.example",
++                                original_bits, count);
++        resolv_response_add_name (b, name);
++        free (name);
++      }
++      break;
++    }
++  resolv_response_close_record (b);
++
++  if (previous_name != qname)
++    free (previous_name);
++}
++
++/* Controls which name resolution function is invoked.  */
++enum test_mode
++  {
++    byname,                     /* gethostbyname.  */
++    byname2,                    /* gethostbyname2.  */
++    gai,                        /* getaddrinfo without AI_CANONNAME.  */
++    gai_canon,                  /* getaddrinfo with AI_CANONNAME.  */
++
++    test_mode_num               /* Number of enum values.  */
++  };
++
++static const char *
++test_mode_to_string (enum test_mode mode)
++{
++  switch (mode)
++    {
++    case byname:
++      return "byname";
++    case byname2:
++      return "byname2";
++    case gai:
++      return "gai";
++    case gai_canon:
++      return "gai_canon";
++    case test_mode_num:
++      /* Report error below.  */
++    }
++  FAIL_EXIT1 ("invalid test_mode: %d", mode);
++}
++
++/* Append the name and aliases to OUT.  */
++static void
++append_names (FILE *out, const char *qname, int bits, int count,
++              enum test_mode mode)
++{
++  /* Largest valid index which has a corresponding zero in bits
++     (meaning a syntactically valid CNAME).  */
++  int last_valid_cname = -1;
++
++  for (int i = 0; i < count; ++i)
++    if ((bits & (3 << (i * 2))) == 0)
++      last_valid_cname = i;
++
++  if (mode != gai)
++    {
++      const char *label;
++      if (mode == gai_canon)
++        label = "canonname";
++      else
++        label = "name";
++      if (last_valid_cname >= 0)
++        fprintf (out, "%s: unique%d.example\n", label, last_valid_cname);
++      else
++        fprintf (out, "%s: %s\n", label, qname);
++    }
++
++  if (mode == byname || mode == byname2)
++    {
++      if (last_valid_cname >= 0)
++        fprintf (out, "alias: %s\n", qname);
++      for (int i = 0; i < count; ++i)
++        {
++          if ((bits & (3 << (i * 2))) == 0 && i != last_valid_cname)
++            fprintf (out, "alias: unique%d.example\n", i);
++        }
++    }
++}
++
++/* Append the address information to OUT.  */
++static void
++append_addresses (FILE *out, int af, int bits, int count, enum test_mode mode)
++{
++  int last = count * 256 + bits;
++  if (mode == gai || mode == gai_canon)
++    {
++      if (af == AF_INET || af == AF_UNSPEC)
++        fprintf (out, "address: STREAM/TCP 192.168.%d.%d 80\n", count, bits);
++      if (af == AF_INET6 || af == AF_UNSPEC)
++        {
++          if (last == 0)
++            fprintf (out, "address: STREAM/TCP 2001:db8:: 80\n");
++          else
++            fprintf (out, "address: STREAM/TCP 2001:db8::%x 80\n", last);
++        }
++    }
++  else
++    {
++      TEST_VERIFY (af != AF_UNSPEC);
++      if (af == AF_INET)
++        fprintf (out, "address: 192.168.%d.%d\n", count, bits);
++      if (af == AF_INET6)
++        {
++          if (last == 0)
++            fprintf (out, "address: 2001:db8::\n");
++          else
++            fprintf (out, "address: 2001:db8::%x\n", last);
++        }
++    }
++}
++
++/* Perform one test using a forward lookup.  */
++static void
++check_forward (int af, int bits, int count, enum test_mode mode)
++{
++  char *qname = xasprintf ("bits%d.count%d.example", bits, count);
++  char *label = xasprintf ("af=%d bits=%d count=%d mode=%s qname=%s",
++                           af, bits, count, test_mode_to_string (mode), qname);
++
++  struct xmemstream expected;
++  xopen_memstream (&expected);
++  if (mode == gai_canon)
++    fprintf (expected.out, "flags: AI_CANONNAME\n");
++  append_names (expected.out, qname, bits, count, mode);
++  append_addresses (expected.out, af, bits, count, mode);
++  xfclose_memstream (&expected);
++
++  if (mode == gai || mode == gai_canon)
++    {
++      struct addrinfo *ai;
++      struct addrinfo hints =
++        {
++          .ai_family = af,
++          .ai_socktype = SOCK_STREAM,
++        };
++      if (mode == gai_canon)
++        hints.ai_flags |= AI_CANONNAME;
++      int ret = getaddrinfo (qname, "80", &hints, &ai);
++      check_addrinfo (label, ai, ret, expected.buffer);
++      if (ret == 0)
++        freeaddrinfo (ai);
++    }
++  else
++    {
++      struct hostent *e;
++      if (mode == gai)
++        {
++          TEST_COMPARE (af, AF_INET);
++          e = gethostbyname (qname);
++        }
++      else
++        {
++          if (af != AF_INET)
++            TEST_COMPARE (af, AF_INET6);
++          e = gethostbyname2 (qname, af);
++        }
++      check_hostent (label, e, expected.buffer);
++    }
++
++  free (expected.buffer);
++  free (label);
++  free (qname);
++}
++
++/* Perform one check using a reverse lookup.  */
++
++static void
++check_reverse (int af, int bits, int count)
++{
++  TEST_VERIFY (af == AF_INET || af == AF_INET6);
++
++  char *label = xasprintf ("af=%d bits=%d count=%d", af, bits, count);
++  char *fqdn = xasprintf ("bits%d.count%d.example", bits, count);
++
++  struct xmemstream expected;
++  xopen_memstream (&expected);
++  fprintf (expected.out, "name: %s\n", fqdn);
++  append_addresses (expected.out, af, bits, count, byname);
++  xfclose_memstream (&expected);
++
++  char addr[16] = { 0 };
++  socklen_t addrlen;
++  if (af == AF_INET)
++    {
++      addr[0] = 192;
++      addr[1] = 168;
++      addr[2] = count;
++      addr[3] = bits;
++      addrlen = 4;
++    }
++  else
++    {
++      addr[0] = 0x20;
++      addr[1] = 0x01;
++      addr[2] = 0x0d;
++      addr[3] = 0xb8;
++      addr[14] = count;
++      addr[15] = bits;
++      addrlen = 16;
++    }
++
++  struct hostent *e = gethostbyaddr (addr, addrlen, af);
++  check_hostent (label, e, expected.buffer);
++
++  /* getnameinfo check is different.  There is no generic check_*
++     function for it.  */
++  {
++    struct sockaddr_in sin = { };
++    struct sockaddr_in6 sin6 = { };
++    void *sa;
++    socklen_t salen;
++    if (af == AF_INET)
++      {
++        sin.sin_family = AF_INET;
++        memcpy (&sin.sin_addr, addr, addrlen);
++        sin.sin_port = htons (80);
++        sa = &sin;
++        salen = sizeof (sin);
++      }
++    else
++      {
++        sin6.sin6_family = AF_INET6;
++        memcpy (&sin6.sin6_addr, addr, addrlen);
++        sin6.sin6_port = htons (80);
++        sa = &sin6;
++        salen = sizeof (sin6);
++      }
++
++    char host[64];
++    char service[64];
++    int ret = getnameinfo (sa, salen, host,
++                           sizeof (host), service, sizeof (service),
++                           NI_NAMEREQD | NI_NUMERICSERV);
++    TEST_COMPARE (ret, 0);
++    TEST_COMPARE_STRING (host, fqdn);
++    TEST_COMPARE_STRING (service, "80");
++  }
++
++  free (expected.buffer);
++  free (fqdn);
++  free (label);
++}
++
++static int
++do_test (void)
++{
++  struct resolv_test *obj = resolv_test_start
++    ((struct resolv_redirect_config)
++     {
++       .response_callback = response
++     });
++
++  for (int count = 0; count <= 3; ++count)
++    for (int bits = 0; bits <= 1 << (count * 2); ++bits)
++      {
++        if (count > 0 && bits == count)
++          /* The last bits value is only checked if count == 0.  */
++          continue;
++
++        for (enum test_mode mode = 0; mode < test_mode_num; ++mode)
++          {
++            check_forward (AF_INET, bits, count, mode);
++            if (mode != byname)
++              check_forward (AF_INET6, bits, count, mode);
++            if (mode == gai || mode == gai_canon)
++              check_forward (AF_UNSPEC, bits, count, mode);
++          }
++
++        check_reverse (AF_INET, bits, count);
++        check_reverse (AF_INET6, bits, count);
++      }
++
++  resolv_test_end (obj);
++
++  return 0;
++}
++
++#include <support/test-driver.c>
+-- 
+2.38.1
+
+
+From c5cdb39c20e96d9ac0d46fc7284b8276a537fd35 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 30 Aug 2022 10:02:49 +0200
+Subject: [PATCH 35/72] nss_dns: Rewrite _nss_dns_gethostbyname4_r using
+ current interfaces
+
+Introduce struct alloc_buffer to this function, and use it and
+struct ns_rr_cursor in gaih_getanswer_slice.  Adjust gaih_getanswer
+and gaih_getanswer_noaaaa accordingly.
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit 1d495912a746e2a1ffb780c9a81fd234ec2464e8)
+---
+ resolv/nss_dns/dns-host.c | 443 ++++++++++++++------------------------
+ 1 file changed, 162 insertions(+), 281 deletions(-)
+
+diff --git a/resolv/nss_dns/dns-host.c b/resolv/nss_dns/dns-host.c
+index bea505d697..9fa81f23c8 100644
+--- a/resolv/nss_dns/dns-host.c
++++ b/resolv/nss_dns/dns-host.c
+@@ -100,13 +100,6 @@
+ #endif
+ #define MAXHOSTNAMELEN 256
+ 
+-/* We need this time later.  */
+-typedef union querybuf
+-{
+-  HEADER hdr;
+-  u_char buf[MAXPACKET];
+-} querybuf;
+-
+ /* For historic reasons, pointers to IP addresses are char *, so use a
+    single list type for addresses and host names.  */
+ #define DYNARRAY_STRUCT ptrlist
+@@ -125,18 +118,18 @@ static enum nss_status getanswer_ptr (unsigned char *packet, size_t packetlen,
+ 				      char **hnamep, int *errnop,
+ 				      int *h_errnop, int32_t *ttlp);
+ 
+-static enum nss_status gaih_getanswer (const querybuf *answer1, int anslen1,
+-				       const querybuf *answer2, int anslen2,
+-				       const char *qname,
++static enum nss_status gaih_getanswer (unsigned char *packet1,
++				       size_t packet1len,
++				       unsigned char *packet2,
++				       size_t packet2len,
++				       struct alloc_buffer *abuf,
+ 				       struct gaih_addrtuple **pat,
+-				       char *buffer, size_t buflen,
+ 				       int *errnop, int *h_errnop,
+ 				       int32_t *ttlp);
+-static enum nss_status gaih_getanswer_noaaaa (const querybuf *answer1,
+-					      int anslen1,
+-					      const char *qname,
++static enum nss_status gaih_getanswer_noaaaa (unsigned char *packet,
++					      size_t packetlen,
++					      struct alloc_buffer *abuf,
+ 					      struct gaih_addrtuple **pat,
+-					      char *buffer, size_t buflen,
+ 					      int *errnop, int *h_errnop,
+ 					      int32_t *ttlp);
+ 
+@@ -408,17 +401,13 @@ _nss_dns_gethostbyname4_r (const char *name, struct gaih_addrtuple **pat,
+ 	name = cp;
+     }
+ 
+-  union
+-  {
+-    querybuf *buf;
+-    u_char *ptr;
+-  } host_buffer;
+-  querybuf *orig_host_buffer;
+-  host_buffer.buf = orig_host_buffer = (querybuf *) alloca (2048);
++  unsigned char dns_packet_buffer[2048];
++  unsigned char *alt_dns_packet_buffer = dns_packet_buffer;
+   u_char *ans2p = NULL;
+   int nans2p = 0;
+   int resplen2 = 0;
+   int ans2p_malloced = 0;
++  struct alloc_buffer abuf = alloc_buffer_create (buffer, buflen);
+ 
+ 
+   int olderr = errno;
+@@ -427,22 +416,21 @@ _nss_dns_gethostbyname4_r (const char *name, struct gaih_addrtuple **pat,
+   if ((ctx->resp->options & RES_NOAAAA) == 0)
+     {
+       n = __res_context_search (ctx, name, C_IN, T_QUERY_A_AND_AAAA,
+-				host_buffer.buf->buf, 2048, &host_buffer.ptr,
+-				&ans2p, &nans2p, &resplen2, &ans2p_malloced);
++				dns_packet_buffer, sizeof (dns_packet_buffer),
++				&alt_dns_packet_buffer, &ans2p, &nans2p,
++				&resplen2, &ans2p_malloced);
+       if (n >= 0)
+-	status = gaih_getanswer (host_buffer.buf, n, (const querybuf *) ans2p,
+-				 resplen2, name, pat, buffer, buflen,
+-				 errnop, herrnop, ttlp);
++	status = gaih_getanswer (alt_dns_packet_buffer, n, ans2p, resplen2,
++				 &abuf, pat, errnop, herrnop, ttlp);
+     }
+   else
+     {
+       n = __res_context_search (ctx, name, C_IN, T_A,
+-				host_buffer.buf->buf, 2048, NULL,
+-				NULL, NULL, NULL, NULL);
++				dns_packet_buffer, sizeof (dns_packet_buffer),
++				NULL, NULL, NULL, NULL, NULL);
+       if (n >= 0)
+-	status = gaih_getanswer_noaaaa (host_buffer.buf, n,
+-					name, pat, buffer, buflen,
+-					errnop, herrnop, ttlp);
++	status = gaih_getanswer_noaaaa (alt_dns_packet_buffer, n,
++					&abuf, pat, errnop, herrnop, ttlp);
+     }
+   if (n < 0)
+     {
+@@ -473,12 +461,20 @@ _nss_dns_gethostbyname4_r (const char *name, struct gaih_addrtuple **pat,
+ 	__set_errno (olderr);
+     }
+ 
++  /* Implement the buffer resizing protocol.  */
++  if (alloc_buffer_has_failed (&abuf))
++    {
++      *errnop = ERANGE;
++      *herrnop = NETDB_INTERNAL;
++      status = NSS_STATUS_TRYAGAIN;
++    }
++
+   /* Check whether ans2p was separately allocated.  */
+   if (ans2p_malloced)
+     free (ans2p);
+ 
+-  if (host_buffer.buf != orig_host_buffer)
+-    free (host_buffer.buf);
++  if (alt_dns_packet_buffer != dns_packet_buffer)
++    free (alt_dns_packet_buffer);
+ 
+   __resolv_context_put (ctx);
+   return status;
+@@ -892,259 +888,152 @@ getanswer_ptr (unsigned char *packet, size_t packetlen,
+   return NSS_STATUS_TRYAGAIN;
+ }
+ 
++/* Parses DNS data found in PACKETLEN bytes at PACKET in struct
++   gaih_addrtuple address tuples.  The new address tuples are linked
++   from **TAILP, with backing store allocated from ABUF, and *TAILP is
++   updated to point where the next tuple pointer should be stored.  If
++   TTLP is not null, *TTLP is updated to reflect the minimum TTL.  If
++   STORE_CANON is true, the canonical name is stored as part of the
++   first address tuple being written.  */
+ static enum nss_status
+-gaih_getanswer_slice (const querybuf *answer, int anslen, const char *qname,
+-		      struct gaih_addrtuple ***patp,
+-		      char **bufferp, size_t *buflenp,
+-		      int *errnop, int *h_errnop, int32_t *ttlp, int *firstp)
++gaih_getanswer_slice (unsigned char *packet, size_t packetlen,
++		      struct alloc_buffer *abuf,
++		      struct gaih_addrtuple ***tailp,
++		      int *errnop, int *h_errnop, int32_t *ttlp,
++		      bool store_canon)
+ {
+-  char *buffer = *bufferp;
+-  size_t buflen = *buflenp;
+-
+-  struct gaih_addrtuple **pat = *patp;
+-  const HEADER *hp = &answer->hdr;
+-  int ancount = ntohs (hp->ancount);
+-  int qdcount = ntohs (hp->qdcount);
+-  const u_char *cp = answer->buf + HFIXEDSZ;
+-  const u_char *end_of_message = answer->buf + anslen;
+-  if (__glibc_unlikely (qdcount != 1))
+-    {
+-      *h_errnop = NO_RECOVERY;
+-      return NSS_STATUS_UNAVAIL;
+-    }
+-
+-  u_char packtmp[NS_MAXCDNAME];
+-  int n = __ns_name_unpack (answer->buf, end_of_message, cp,
+-			    packtmp, sizeof packtmp);
+-  /* We unpack the name to check it for validity.  But we do not need
+-     it later.  */
+-  if (n != -1 && __ns_name_ntop (packtmp, buffer, buflen) == -1)
+-    {
+-      if (__glibc_unlikely (errno == EMSGSIZE))
+-	{
+-	too_small:
+-	  *errnop = ERANGE;
+-	  *h_errnop = NETDB_INTERNAL;
+-	  return NSS_STATUS_TRYAGAIN;
+-	}
+-
+-      n = -1;
+-    }
+-
+-  if (__glibc_unlikely (n < 0))
+-    {
+-      *errnop = errno;
+-      *h_errnop = NO_RECOVERY;
+-      return NSS_STATUS_UNAVAIL;
+-    }
+-  if (__glibc_unlikely (__libc_res_hnok (buffer) == 0))
++  struct ns_rr_cursor c;
++  if (!__ns_rr_cursor_init (&c, packet, packetlen))
+     {
+-      errno = EBADMSG;
+-      *errnop = EBADMSG;
++      /* This should not happen because __res_context_query already
++	 perfroms response validation.  */
+       *h_errnop = NO_RECOVERY;
+       return NSS_STATUS_UNAVAIL;
+     }
+-  cp += n + QFIXEDSZ;
++  bool haveanswer = false; /* Set to true if at least one address.  */
++  uint16_t qtype = ns_rr_cursor_qtype (&c);
++  int ancount = ns_rr_cursor_ancount (&c);
++  const unsigned char *expected_name = ns_rr_cursor_qname (&c);
++  /* expected_name may be updated to point into this buffer.  */
++  unsigned char name_buffer[NS_MAXCDNAME];
+ 
+-  int haveanswer = 0;
+-  int had_error = 0;
+-  char *canon = NULL;
+-  char *h_name = NULL;
+-  int h_namelen = 0;
++  /* This is a pointer to a possibly-compressed name in the packet.
++     Eventually it is equivalent to the canonical name.  If needed, it
++     is uncompressed and translated to text form when the first
++     address tuple is encountered.  */
++  const unsigned char *compressed_alias_name = expected_name;
+ 
+-  if (ancount == 0)
++  if (ancount == 0 || !__res_binary_hnok (compressed_alias_name))
+     {
+       *h_errnop = HOST_NOT_FOUND;
+       return NSS_STATUS_NOTFOUND;
+     }
+ 
+-  while (ancount-- > 0 && cp < end_of_message && had_error == 0)
++  for (; ancount > -0; --ancount)
+     {
+-      n = __ns_name_unpack (answer->buf, end_of_message, cp,
+-			    packtmp, sizeof packtmp);
+-      if (n != -1 &&
+-	  (h_namelen = __ns_name_ntop (packtmp, buffer, buflen)) == -1)
+-	{
+-	  if (__glibc_unlikely (errno == EMSGSIZE))
+-	    goto too_small;
+-
+-	  n = -1;
+-	}
+-      if (__glibc_unlikely (n < 0))
+-	{
+-	  ++had_error;
+-	  continue;
+-	}
+-      if (*firstp && canon == NULL && __libc_res_hnok (buffer))
+-	{
+-	  h_name = buffer;
+-	  buffer += h_namelen;
+-	  buflen -= h_namelen;
+-	}
+-
+-      cp += n;				/* name */
+-
+-      if (__glibc_unlikely (cp + 10 > end_of_message))
+-	{
+-	  ++had_error;
+-	  continue;
+-	}
+-
+-      uint16_t type;
+-      NS_GET16 (type, cp);
+-      uint16_t class;
+-      NS_GET16 (class, cp);
+-      int32_t ttl;
+-      NS_GET32 (ttl, cp);
+-      NS_GET16 (n, cp);		/* RDATA length.  */
+-
+-      if (end_of_message - cp < n)
++      struct ns_rr_wire rr;
++      if (!__ns_rr_cursor_next (&c, &rr))
+ 	{
+-	  /* RDATA extends beyond the end of the packet.  */
+-	  ++had_error;
+-	  continue;
++	  *h_errnop = NO_RECOVERY;
++	  return NSS_STATUS_UNAVAIL;
+ 	}
+ 
+-      if (class != C_IN)
+-	{
+-	  cp += n;
+-	  continue;
+-	}
++      /* Update TTL for known record types.  */
++      if ((rr.rtype == T_CNAME || rr.rtype == qtype)
++	  && ttlp != NULL && *ttlp > rr.ttl)
++	*ttlp = rr.ttl;
+ 
+-      if (type == T_CNAME)
++      if (rr.rtype == T_CNAME)
+ 	{
+-	  char tbuf[MAXDNAME];
+-
+-	  /* A CNAME could also have a TTL entry.  */
+-	  if (ttlp != NULL && ttl < *ttlp)
+-	      *ttlp = ttl;
+-
+-	  n = __libc_dn_expand (answer->buf, end_of_message, cp,
+-				tbuf, sizeof tbuf);
+-	  if (__glibc_unlikely (n < 0))
+-	    {
+-	      ++had_error;
+-	      continue;
+-	    }
+-	  cp += n;
+-
+-	  if (*firstp && __libc_res_hnok (tbuf))
++	  /* NB: No check for owner name match, based on historic
++	     precedent.  Record the CNAME target as the new expected
++	     name.  */
++	  int n = __ns_name_unpack (c.begin, c.end, rr.rdata,
++				    name_buffer, sizeof (name_buffer));
++	  if (n < 0)
+ 	    {
+-	      /* Reclaim buffer space.  */
+-	      if (h_name + h_namelen == buffer)
+-		{
+-		  buffer = h_name;
+-		  buflen += h_namelen;
+-		}
+-
+-	      n = strlen (tbuf) + 1;
+-	      if (__glibc_unlikely (n > buflen))
+-		goto too_small;
+-	      if (__glibc_unlikely (n >= MAXHOSTNAMELEN))
+-		{
+-		  ++had_error;
+-		  continue;
+-		}
+-
+-	      canon = buffer;
+-	      buffer = __mempcpy (buffer, tbuf, n);
+-	      buflen -= n;
+-	      h_namelen = 0;
++	      *h_errnop = NO_RECOVERY;
++	      return NSS_STATUS_UNAVAIL;
+ 	    }
+-	  continue;
++	  expected_name = name_buffer;
++	  if (store_canon && __res_binary_hnok (name_buffer))
++	    /* This name can be used as a canonical name.  Do not
++	       translate to text form here to conserve buffer space.
++	       Point to the compressed name because name_buffer can be
++	       overwritten with an unusable name later.  */
++	    compressed_alias_name = rr.rdata;
+ 	}
+-
+-      /* Stop parsing if we encounter a record with incorrect RDATA
+-	 length.  */
+-      if (type == T_A || type == T_AAAA)
++      else if (rr.rtype == qtype
++	       && __ns_samebinaryname (rr.rname, expected_name)
++	       && rr.rdlength == rrtype_to_rdata_length (qtype))
+ 	{
+-	  if (n != rrtype_to_rdata_length (type))
++	  struct gaih_addrtuple *ntup
++	    = alloc_buffer_alloc (abuf, struct gaih_addrtuple);
++	  /* Delay error reporting to the callers (they implement the
++	     ERANGE buffer resizing handshake).  */
++	  if (ntup != NULL)
+ 	    {
+-	      ++had_error;
+-	      continue;
++	      ntup->next = NULL;
++	      if (store_canon && compressed_alias_name != NULL)
++		{
++		  /* This assumes that all the CNAME records come
++		     first.  Use MAXHOSTNAMELEN instead of
++		     NS_MAXCDNAME for additional length checking.
++		     However, these checks are not expected to fail
++		     because all size NS_MAXCDNAME names should into
++		     the hname buffer because no escaping is
++		     needed.  */
++		  char unsigned nbuf[NS_MAXCDNAME];
++		  char hname[MAXHOSTNAMELEN + 1];
++		  if (__ns_name_unpack (c.begin, c.end,
++					compressed_alias_name,
++					nbuf, sizeof (nbuf)) >= 0
++		      && __ns_name_ntop (nbuf, hname, sizeof (hname)) >= 0)
++		    /* Space checking is performed by the callers.  */
++		    ntup->name = alloc_buffer_copy_string (abuf, hname);
++		  store_canon = false;
++		}
++	      else
++		ntup->name = NULL;
++	      if (rr.rdlength == 4)
++		ntup->family = AF_INET;
++	      else
++		ntup->family = AF_INET6;
++	      memcpy (ntup->addr, rr.rdata, rr.rdlength);
++	      ntup->scopeid = 0;
++
++	      /* Link in the new tuple, and update the tail pointer to
++		 point to its next field.  */
++	      **tailp = ntup;
++	      *tailp = &ntup->next;
++
++	      haveanswer = true;
+ 	    }
+ 	}
+-      else
+-	{
+-	  /* Skip unknown records.  */
+-	  cp += n;
+-	  continue;
+-	}
+-
+-      assert (type == T_A || type == T_AAAA);
+-      if (*pat == NULL)
+-	{
+-	  uintptr_t pad = (-(uintptr_t) buffer
+-			   % __alignof__ (struct gaih_addrtuple));
+-	  buffer += pad;
+-	  buflen = buflen > pad ? buflen - pad : 0;
+-
+-	  if (__glibc_unlikely (buflen < sizeof (struct gaih_addrtuple)))
+-	    goto too_small;
+-
+-	  *pat = (struct gaih_addrtuple *) buffer;
+-	  buffer += sizeof (struct gaih_addrtuple);
+-	  buflen -= sizeof (struct gaih_addrtuple);
+-	}
+-
+-      (*pat)->name = NULL;
+-      (*pat)->next = NULL;
+-
+-      if (*firstp)
+-	{
+-	  /* We compose a single hostent out of the entire chain of
+-	     entries, so the TTL of the hostent is essentially the lowest
+-	     TTL in the chain.  */
+-	  if (ttlp != NULL && ttl < *ttlp)
+-	    *ttlp = ttl;
+-
+-	  (*pat)->name = canon ?: h_name;
+-
+-	  *firstp = 0;
+-	}
+-
+-      (*pat)->family = type == T_A ? AF_INET : AF_INET6;
+-      memcpy ((*pat)->addr, cp, n);
+-      cp += n;
+-      (*pat)->scopeid = 0;
+-
+-      pat = &((*pat)->next);
+-
+-      haveanswer = 1;
+     }
+ 
+   if (haveanswer)
+     {
+-      *patp = pat;
+-      *bufferp = buffer;
+-      *buflenp = buflen;
+-
+       *h_errnop = NETDB_SUCCESS;
+       return NSS_STATUS_SUCCESS;
+     }
+-
+-  /* Special case here: if the resolver sent a result but it only
+-     contains a CNAME while we are looking for a T_A or T_AAAA record,
+-     we fail with NOTFOUND instead of TRYAGAIN.  */
+-  if (canon != NULL)
++  else
+     {
++      /* Special case here: if the resolver sent a result but it only
++	 contains a CNAME while we are looking for a T_A or T_AAAA
++	 record, we fail with NOTFOUND.  */
+       *h_errnop = HOST_NOT_FOUND;
+       return NSS_STATUS_NOTFOUND;
+     }
+-
+-  *h_errnop = NETDB_INTERNAL;
+-  return NSS_STATUS_TRYAGAIN;
+ }
+ 
+ 
+ static enum nss_status
+-gaih_getanswer (const querybuf *answer1, int anslen1, const querybuf *answer2,
+-		int anslen2, const char *qname,
+-		struct gaih_addrtuple **pat, char *buffer, size_t buflen,
++gaih_getanswer (unsigned char *packet1, size_t packet1len,
++		unsigned char *packet2, size_t packet2len,
++		struct alloc_buffer *abuf, struct gaih_addrtuple **pat,
+ 		int *errnop, int *h_errnop, int32_t *ttlp)
+ {
+-  int first = 1;
+-
+   enum nss_status status = NSS_STATUS_NOTFOUND;
+ 
+   /* Combining the NSS status of two distinct queries requires some
+@@ -1156,7 +1045,10 @@ gaih_getanswer (const querybuf *answer1, int anslen1, const querybuf *answer2,
+      between TRYAGAIN (recoverable) and TRYAGAIN' (not-recoverable).
+      A recoverable TRYAGAIN is almost always due to buffer size issues
+      and returns ERANGE in errno and the caller is expected to retry
+-     with a larger buffer.
++     with a larger buffer.  (The caller, _nss_dns_gethostbyname4_r,
++     ignores the return status if it detects that the result buffer
++     has been exhausted and generates a TRYAGAIN failure with an
++     ERANGE code.)
+ 
+      Lastly, you may be tempted to make significant changes to the
+      conditions in this code to bring about symmetry between responses.
+@@ -1236,36 +1128,30 @@ gaih_getanswer (const querybuf *answer1, int anslen1, const querybuf *answer2,
+ 	 is a recoverable error we now return TRYAGIN even if the first
+ 	 response was SUCCESS.  */
+ 
+-  if (anslen1 > 0)
+-    status = gaih_getanswer_slice(answer1, anslen1, qname,
+-				  &pat, &buffer, &buflen,
+-				  errnop, h_errnop, ttlp,
+-				  &first);
+-
+-  if ((status == NSS_STATUS_SUCCESS || status == NSS_STATUS_NOTFOUND
+-       || (status == NSS_STATUS_TRYAGAIN
+-	   /* We want to look at the second answer in case of an
+-	      NSS_STATUS_TRYAGAIN only if the error is non-recoverable, i.e.
+-	      *h_errnop is NO_RECOVERY. If not, and if the failure was due to
+-	      an insufficient buffer (ERANGE), then we need to drop the results
+-	      and pass on the NSS_STATUS_TRYAGAIN to the caller so that it can
+-	      repeat the query with a larger buffer.  */
+-	   && (*errnop != ERANGE || *h_errnop == NO_RECOVERY)))
+-      && answer2 != NULL && anslen2 > 0)
++  if (packet1len > 0)
+     {
+-      enum nss_status status2 = gaih_getanswer_slice(answer2, anslen2, qname,
+-						     &pat, &buffer, &buflen,
+-						     errnop, h_errnop, ttlp,
+-						     &first);
++      status = gaih_getanswer_slice (packet1, packet1len,
++				     abuf, &pat, errnop, h_errnop, ttlp, true);
++      if (alloc_buffer_has_failed (abuf))
++	/* Do not try parsing the second packet if a larger result
++	   buffer is needed.  The caller implements the resizing
++	   protocol because *abuf has been exhausted.  */
++	return NSS_STATUS_TRYAGAIN; /* Ignored by the caller.  */
++    }
++
++  if ((status == NSS_STATUS_SUCCESS || status == NSS_STATUS_NOTFOUND)
++      && packet2 != NULL && packet2len > 0)
++    {
++      enum nss_status status2
++	= gaih_getanswer_slice (packet2, packet2len,
++				abuf, &pat, errnop, h_errnop, ttlp,
++				/* Success means that data with a
++				   canonical name has already been
++				   stored.  Do not store the name again.  */
++				status != NSS_STATUS_SUCCESS);
+       /* Use the second response status in some cases.  */
+       if (status != NSS_STATUS_SUCCESS && status2 != NSS_STATUS_NOTFOUND)
+ 	status = status2;
+-      /* Do not return a truncated second response (unless it was
+-	 unavoidable e.g. unrecoverable TRYAGAIN).  */
+-      if (status == NSS_STATUS_SUCCESS
+-	  && (status2 == NSS_STATUS_TRYAGAIN
+-	      && *errnop == ERANGE && *h_errnop != NO_RECOVERY))
+-	status = NSS_STATUS_TRYAGAIN;
+     }
+ 
+   return status;
+@@ -1273,18 +1159,13 @@ gaih_getanswer (const querybuf *answer1, int anslen1, const querybuf *answer2,
+ 
+ /* Variant of gaih_getanswer without a second (AAAA) response.  */
+ static enum nss_status
+-gaih_getanswer_noaaaa (const querybuf *answer1, int anslen1, const char *qname,
+-		       struct gaih_addrtuple **pat,
+-		       char *buffer, size_t buflen,
++gaih_getanswer_noaaaa (unsigned char *packet, size_t packetlen,
++		       struct alloc_buffer *abuf, struct gaih_addrtuple **pat,
+ 		       int *errnop, int *h_errnop, int32_t *ttlp)
+ {
+-  int first = 1;
+-
+   enum nss_status status = NSS_STATUS_NOTFOUND;
+-  if (anslen1 > 0)
+-    status = gaih_getanswer_slice (answer1, anslen1, qname,
+-				   &pat, &buffer, &buflen,
+-				   errnop, h_errnop, ttlp,
+-				   &first);
++  if (packetlen > 0)
++    status = gaih_getanswer_slice (packet, packetlen,
++				   abuf, &pat, errnop, h_errnop, ttlp, true);
+   return status;
+ }
+-- 
+2.38.1
+
+
+From a7fa604f3050a1024dc8ec28ff28bad811f6151f Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 30 Aug 2022 13:30:03 +0200
+Subject: [PATCH 36/72] resolv: Fix building tst-resolv-invalid-cname for
+ earlier C standards
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This fixes this compiler error:
+
+tst-resolv-invalid-cname.c: In function ‘test_mode_to_string’:
+tst-resolv-invalid-cname.c:164:10: error: label at end of compound statement
+     case test_mode_num:
+          ^~~~~~~~~~~~~
+
+Fixes commit 9caf782276ecea4bc86fc94fbb52779736f3106d
+("resolv: Add new tst-resolv-invalid-cname").
+
+(cherry picked from commit d09aa4a17229bcaa2ec7642006b12612498582e7)
+---
+ resolv/tst-resolv-invalid-cname.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/resolv/tst-resolv-invalid-cname.c b/resolv/tst-resolv-invalid-cname.c
+index ae2d4419b1..63dac90e02 100644
+--- a/resolv/tst-resolv-invalid-cname.c
++++ b/resolv/tst-resolv-invalid-cname.c
+@@ -162,7 +162,7 @@ test_mode_to_string (enum test_mode mode)
+     case gai_canon:
+       return "gai_canon";
+     case test_mode_num:
+-      /* Report error below.  */
++      break;                    /* Report error below.  */
+     }
+   FAIL_EXIT1 ("invalid test_mode: %d", mode);
+ }
+-- 
+2.38.1
+
+
+From 5d885617cec5713fdde42177398fe98acb66b7a2 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 13 Sep 2022 13:22:27 +0200
+Subject: [PATCH 37/72] NEWS: Note bug 12154 and bug 29305 as fixed
+
+---
+ NEWS | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/NEWS b/NEWS
+index 9360596fcc..03281e3ab4 100644
+--- a/NEWS
++++ b/NEWS
+@@ -16,7 +16,9 @@ Security related changes:
+ 
+ The following bugs are resolved with this release:
+ 
++  [12154] Do not fail DNS resolution for CNAMEs which are not host names
+   [28846] CMSG_NXTHDR may trigger -Wstrict-overflow warning
++  [29305] Conserve NSS buffer space during DNS packet parsing
+   [29415] nscd: Fix netlink cache invalidation if epoll is used
+   [29446] _dlopen now ignores dl_caller argument in static mode
+   [29485] Linux: Terminate subprocess on late failure in tst-pidfd
+-- 
+2.38.1
+
+
+From df51334828f2af214105aad82042140ee3a6de0a Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 13 Sep 2022 19:57:43 +0200
+Subject: [PATCH 38/72] elf: Run tst-audit-tlsdesc, tst-audit-tlsdesc-dlopen
+ everywhere
+
+The test is valid for all TLS models, but we want to make a reasonable
+effort to test the GNU2 model specifically.  For example, aarch64
+defaults to GNU2, but does not have -mtls-dialect=gnu2, and the test
+was not run there.
+
+Suggested-by: Martin Coufal <mcoufal@redhat.com>
+(cherry picked from commit dd2315a866a4ac2b838ea1cb10c5ea1c35d51a2f)
+
+Fixes early backport commit 924e4f3eaa502ce82fccf8537f021a796d158771
+("elf: Call __libc_early_init for reused namespaces (bug 29528)");
+it had a wrong conflict resolution.
+---
+ elf/Makefile | 22 ++++++----------------
+ 1 file changed, 6 insertions(+), 16 deletions(-)
+
+diff --git a/elf/Makefile b/elf/Makefile
+index 43353a4b08..72178d33ff 100644
+--- a/elf/Makefile
++++ b/elf/Makefile
+@@ -374,6 +374,8 @@ tests += \
+   tst-align \
+   tst-align2 \
+   tst-align3 \
++  tst-audit-tlsdesc \
++  tst-audit-tlsdesc-dlopen \
+   tst-audit1 \
+   tst-audit2 \
+   tst-audit8 \
+@@ -766,6 +768,8 @@ modules-names += \
+   tst-alignmod3 \
+   tst-array2dep \
+   tst-array5dep \
++  tst-audit-tlsdesc-mod1 \
++  tst-audit-tlsdesc-mod2 \
+   tst-audit11mod1 \
+   tst-audit11mod2 \
+   tst-audit12mod1 \
+@@ -799,6 +803,7 @@ modules-names += \
+   tst-auditmanymod7 \
+   tst-auditmanymod8 \
+   tst-auditmanymod9 \
++  tst-auditmod-tlsdesc  \
+   tst-auditmod1 \
+   tst-auditmod9a \
+   tst-auditmod9b \
+@@ -993,23 +998,8 @@ modules-names += tst-gnu2-tls1mod
+ $(objpfx)tst-gnu2-tls1: $(objpfx)tst-gnu2-tls1mod.so
+ tst-gnu2-tls1mod.so-no-z-defs = yes
+ CFLAGS-tst-gnu2-tls1mod.c += -mtls-dialect=gnu2
++endif # $(have-mtls-dialect-gnu2)
+ 
+-tests += tst-audit-tlsdesc tst-audit-tlsdesc-dlopen
+-modules-names += tst-audit-tlsdesc-mod1 tst-audit-tlsdesc-mod2 tst-auditmod-tlsdesc
+-$(objpfx)tst-audit-tlsdesc: $(objpfx)tst-audit-tlsdesc-mod1.so \
+-			    $(objpfx)tst-audit-tlsdesc-mod2.so \
+-			    $(shared-thread-library)
+-CFLAGS-tst-audit-tlsdesc-mod1.c += -mtls-dialect=gnu2
+-CFLAGS-tst-audit-tlsdesc-mod2.c += -mtls-dialect=gnu2
+-$(objpfx)tst-audit-tlsdesc-dlopen: $(shared-thread-library)
+-$(objpfx)tst-audit-tlsdesc-dlopen.out: $(objpfx)tst-audit-tlsdesc-mod1.so \
+-				       $(objpfx)tst-audit-tlsdesc-mod2.so
+-$(objpfx)tst-audit-tlsdesc-mod1.so: $(objpfx)tst-audit-tlsdesc-mod2.so
+-$(objpfx)tst-audit-tlsdesc.out: $(objpfx)tst-auditmod-tlsdesc.so
+-tst-audit-tlsdesc-ENV = LD_AUDIT=$(objpfx)tst-auditmod-tlsdesc.so
+-$(objpfx)tst-audit-tlsdesc-dlopen.out: $(objpfx)tst-auditmod-tlsdesc.so
+-tst-audit-tlsdesc-dlopen-ENV = LD_AUDIT=$(objpfx)tst-auditmod-tlsdesc.so
+-endif
+ ifeq (yes,$(have-protected-data))
+ modules-names += tst-protected1moda tst-protected1modb
+ tests += tst-protected1a tst-protected1b
+-- 
+2.38.1
+
+
+From 4b95b6e8bbb5a2b6856f707bf3bc3308ebef595a Mon Sep 17 00:00:00 2001
+From: Javier Pello <devel@otheo.eu>
+Date: Mon, 5 Sep 2022 20:09:01 +0200
+Subject: [PATCH 39/72] elf: Fix hwcaps string size overestimation
+
+Commit dad90d528259b669342757c37dedefa8577e2636 added glibc-hwcaps
+support for LD_LIBRARY_PATH and, for this, it adjusted the total
+string size required in _dl_important_hwcaps. However, in doing so
+it inadvertently altered the calculation of the size required for
+the power set strings, as the computation of the power set string
+size depended on the first value assigned to the total variable,
+which is later shifted, resulting in overallocation of string
+space. Fix this now by using a different variable to hold the
+string size required for glibc-hwcaps.
+
+Signed-off-by: Javier Pello <devel@otheo.eu>
+(cherry picked from commit a23820f6052a740246fdc7dcd9c43ce8eed0c45a)
+---
+ elf/dl-hwcaps.c | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/elf/dl-hwcaps.c b/elf/dl-hwcaps.c
+index 6f161f6ad5..92eb53790e 100644
+--- a/elf/dl-hwcaps.c
++++ b/elf/dl-hwcaps.c
+@@ -193,7 +193,7 @@ _dl_important_hwcaps (const char *glibc_hwcaps_prepend,
+   /* Each hwcaps subdirectory has a GLIBC_HWCAPS_PREFIX string prefix
+      and a "/" suffix once stored in the result.  */
+   hwcaps_counts.maximum_length += strlen (GLIBC_HWCAPS_PREFIX) + 1;
+-  size_t total = (hwcaps_counts.count * (strlen (GLIBC_HWCAPS_PREFIX) + 1)
++  size_t hwcaps_sz = (hwcaps_counts.count * (strlen (GLIBC_HWCAPS_PREFIX) + 1)
+ 		  + hwcaps_counts.total_length);
+ 
+   /* Count the number of bits set in the masked value.  */
+@@ -229,11 +229,12 @@ _dl_important_hwcaps (const char *glibc_hwcaps_prepend,
+   assert (m == cnt);
+ 
+   /* Determine the total size of all strings together.  */
++  size_t total;
+   if (cnt == 1)
+-    total += temp[0].len + 1;
++    total = temp[0].len + 1;
+   else
+     {
+-      total += temp[0].len + temp[cnt - 1].len + 2;
++      total = temp[0].len + temp[cnt - 1].len + 2;
+       if (cnt > 2)
+ 	{
+ 	  total <<= 1;
+@@ -255,6 +256,7 @@ _dl_important_hwcaps (const char *glibc_hwcaps_prepend,
+   /* This is the overall result, including both glibc-hwcaps
+      subdirectories and the legacy hwcaps subdirectories using the
+      power set construction.  */
++  total += hwcaps_sz;
+   struct r_strlenpair *overall_result
+     = malloc (*sz * sizeof (*result) + total);
+   if (overall_result == NULL)
+-- 
+2.38.1
+
+
+From 7a3f8c8a7aeb41d4bbfeec07d0be1e92c3019919 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 6 Sep 2022 07:38:10 +0200
+Subject: [PATCH 40/72] scripts/dso-ordering-test.py: Generate program run-time
+ dependencies
+
+The main program needs to depend on all shared objects, even objects
+that have link-time dependencies among shared objects.  Filtering
+out shared objects that already have an link-time dependencies is not
+necessary here; make will do this automatically.
+
+Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
+(cherry picked from commit 183d99737298bb3200f0610fdcd1c7549c8ed560)
+---
+ scripts/dso-ordering-test.py | 13 ++++++-------
+ 1 file changed, 6 insertions(+), 7 deletions(-)
+
+diff --git a/scripts/dso-ordering-test.py b/scripts/dso-ordering-test.py
+index 2dd6bfda18..b87cf2f809 100644
+--- a/scripts/dso-ordering-test.py
++++ b/scripts/dso-ordering-test.py
+@@ -707,13 +707,12 @@ def process_testcase(t):
+                 "\t$(compile.c) $(OUTPUT_OPTION)\n")
+         makefile.write (rule)
+ 
+-        not_depended_objs = find_objs_not_depended_on(test_descr)
+-        if not_depended_objs:
+-            depstr = ""
+-            for dep in not_depended_objs:
+-                depstr += (" $(objpfx)" + test_subdir + "/"
+-                           + test_name + "-" + dep + ".so")
+-            makefile.write("$(objpfx)%s.out:%s\n" % (base_test_name, depstr))
++        # Ensure that all shared objects are built before running the
++        # test, whether there link-time dependencies or not.
++        depobjs = ["$(objpfx){}/{}-{}.so".format(test_subdir, test_name, dep)
++                   for dep in test_descr.objs]
++        makefile.write("$(objpfx){}.out: {}\n".format(
++            base_test_name, " ".join(depobjs)))
+ 
+         # Add main executable to test-srcs
+         makefile.write("test-srcs += %s/%s\n" % (test_subdir, test_name))
+-- 
+2.38.1
+
+
+From d1241cf00139733de069c84933cd576dc1a1f45e Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 6 Sep 2022 07:38:10 +0200
+Subject: [PATCH 41/72] elf: Rename _dl_sort_maps parameter from skip to
+ force_first
+
+The new implementation will not be able to skip an arbitrary number
+of objects.
+
+Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
+(cherry picked from commit dbb75513f5cf9285c77c9e55777c5c35b653f890)
+---
+ elf/dl-sort-maps.c         | 14 +++++++-------
+ sysdeps/generic/ldsodefs.h |  6 ++++--
+ 2 files changed, 11 insertions(+), 9 deletions(-)
+
+diff --git a/elf/dl-sort-maps.c b/elf/dl-sort-maps.c
+index 96638d7ed1..5b550b1e94 100644
+--- a/elf/dl-sort-maps.c
++++ b/elf/dl-sort-maps.c
+@@ -27,12 +27,12 @@
+    If FOR_FINI is true, this is called for finishing an object.  */
+ static void
+ _dl_sort_maps_original (struct link_map **maps, unsigned int nmaps,
+-			unsigned int skip, bool for_fini)
++			bool force_first, bool for_fini)
+ {
+   /* Allows caller to do the common optimization of skipping the first map,
+      usually the main binary.  */
+-  maps += skip;
+-  nmaps -= skip;
++  maps += force_first;
++  nmaps -= force_first;
+ 
+   /* A list of one element need not be sorted.  */
+   if (nmaps <= 1)
+@@ -182,7 +182,7 @@ dfs_traversal (struct link_map ***rpo, struct link_map *map,
+ 
+ static void
+ _dl_sort_maps_dfs (struct link_map **maps, unsigned int nmaps,
+-		   unsigned int skip __attribute__ ((unused)), bool for_fini)
++		   bool force_first __attribute__ ((unused)), bool for_fini)
+ {
+   for (int i = nmaps - 1; i >= 0; i--)
+     maps[i]->l_visited = 0;
+@@ -286,7 +286,7 @@ _dl_sort_maps_init (void)
+ 
+ void
+ _dl_sort_maps (struct link_map **maps, unsigned int nmaps,
+-	       unsigned int skip, bool for_fini)
++	       bool force_first, bool for_fini)
+ {
+   /* It can be tempting to use a static function pointer to store and call
+      the current selected sorting algorithm routine, but experimentation
+@@ -296,9 +296,9 @@ _dl_sort_maps (struct link_map **maps, unsigned int nmaps,
+      input cases. A simple if-case with direct function calls appears to
+      be the fastest.  */
+   if (__glibc_likely (GLRO(dl_dso_sort_algo) == dso_sort_algorithm_original))
+-    _dl_sort_maps_original (maps, nmaps, skip, for_fini);
++    _dl_sort_maps_original (maps, nmaps, force_first, for_fini);
+   else
+-    _dl_sort_maps_dfs (maps, nmaps, skip, for_fini);
++    _dl_sort_maps_dfs (maps, nmaps, force_first, for_fini);
+ }
+ 
+ #endif /* HAVE_TUNABLES.  */
+diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h
+index 050a3032de..6b256b8388 100644
+--- a/sysdeps/generic/ldsodefs.h
++++ b/sysdeps/generic/ldsodefs.h
+@@ -1048,9 +1048,11 @@ extern void _dl_init (struct link_map *main_map, int argc, char **argv,
+    initializer functions have completed.  */
+ extern void _dl_fini (void) attribute_hidden;
+ 
+-/* Sort array MAPS according to dependencies of the contained objects.  */
++/* Sort array MAPS according to dependencies of the contained objects.
++   If FORCE_FIRST, MAPS[0] keeps its place even if the dependencies
++   say otherwise.  */
+ extern void _dl_sort_maps (struct link_map **maps, unsigned int nmaps,
+-			   unsigned int skip, bool for_fini) attribute_hidden;
++			   bool force_first, bool for_fini) attribute_hidden;
+ 
+ /* The dynamic linker calls this function before and having changing
+    any shared object mappings.  The `r_state' member of `struct r_debug'
+-- 
+2.38.1
+
+
+From da5f134f6d59701a3a6119309ae91c93c3fa5b51 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 20 Sep 2022 11:00:42 +0200
+Subject: [PATCH 42/72] elf: Implement force_first handling in
+ _dl_sort_maps_dfs (bug 28937)
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The implementation in _dl_close_worker requires that the first
+element of l_initfini is always this very map (“We are always the
+zeroth entry, and since we don't include ourselves in the
+dependency analysis start at 1.”).  Rather than fixing that
+assumption, this commit adds an implementation of the force_first
+argument to the new dependency sorting algorithm.  This also means
+that the directly dlopen'ed shared object is always initialized last,
+which is the least surprising behavior in the presence of cycles.
+
+Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
+(cherry picked from commit 1df71d32fe5f5905ffd5d100e5e9ca8ad6210891)
+---
+ NEWS                     |  1 +
+ elf/dl-sort-maps.c       | 32 +++++++++++++++++++++++---------
+ elf/dso-sort-tests-1.def |  7 +++++++
+ 3 files changed, 31 insertions(+), 9 deletions(-)
+
+diff --git a/NEWS b/NEWS
+index 03281e3ab4..5b4753416f 100644
+--- a/NEWS
++++ b/NEWS
+@@ -20,6 +20,7 @@ The following bugs are resolved with this release:
+   [28846] CMSG_NXTHDR may trigger -Wstrict-overflow warning
+   [29305] Conserve NSS buffer space during DNS packet parsing
+   [29415] nscd: Fix netlink cache invalidation if epoll is used
++  [28937] New DSO dependency sorter does not put new map first if in a cycle
+   [29446] _dlopen now ignores dl_caller argument in static mode
+   [29485] Linux: Terminate subprocess on late failure in tst-pidfd
+   [29490] alpha: New __brk_call implementation is broken
+diff --git a/elf/dl-sort-maps.c b/elf/dl-sort-maps.c
+index 5b550b1e94..3e2a6a584e 100644
+--- a/elf/dl-sort-maps.c
++++ b/elf/dl-sort-maps.c
+@@ -182,8 +182,9 @@ dfs_traversal (struct link_map ***rpo, struct link_map *map,
+ 
+ static void
+ _dl_sort_maps_dfs (struct link_map **maps, unsigned int nmaps,
+-		   bool force_first __attribute__ ((unused)), bool for_fini)
++		   bool force_first, bool for_fini)
+ {
++  struct link_map *first_map = maps[0];
+   for (int i = nmaps - 1; i >= 0; i--)
+     maps[i]->l_visited = 0;
+ 
+@@ -208,14 +209,6 @@ _dl_sort_maps_dfs (struct link_map **maps, unsigned int nmaps,
+      Adjusting the order so that maps[0] is last traversed naturally avoids
+      this problem.
+ 
+-     Further, the old "optimization" of skipping the main object at maps[0]
+-     from the call-site (i.e. _dl_sort_maps(maps+1,nmaps-1)) is in general
+-     no longer valid, since traversing along object dependency-links
+-     may "find" the main object even when it is not included in the initial
+-     order (e.g. a dlopen()'ed shared object can have circular dependencies
+-     linked back to itself). In such a case, traversing N-1 objects will
+-     create a N-object result, and raise problems.
+-
+      To summarize, just passing in the full list, and iterating from back
+      to front makes things much more straightforward.  */
+ 
+@@ -274,6 +267,27 @@ _dl_sort_maps_dfs (struct link_map **maps, unsigned int nmaps,
+     }
+ 
+   memcpy (maps, rpo, sizeof (struct link_map *) * nmaps);
++
++  /* Skipping the first object at maps[0] is not valid in general,
++     since traversing along object dependency-links may "find" that
++     first object even when it is not included in the initial order
++     (e.g., a dlopen'ed shared object can have circular dependencies
++     linked back to itself).  In such a case, traversing N-1 objects
++     will create a N-object result, and raise problems.  Instead,
++     force the object back into first place after sorting.  This naive
++     approach may introduce further dependency ordering violations
++     compared to rotating the cycle until the first map is again in
++     the first position, but as there is a cycle, at least one
++     violation is already present.  */
++  if (force_first && maps[0] != first_map)
++    {
++      int i;
++      for (i = 0; maps[i] != first_map; ++i)
++	;
++      assert (i < nmaps);
++      memmove (&maps[1], maps, i * sizeof (maps[0]));
++      maps[0] = first_map;
++    }
+ }
+ 
+ void
+diff --git a/elf/dso-sort-tests-1.def b/elf/dso-sort-tests-1.def
+index 5f7f18ef27..4bf9052db1 100644
+--- a/elf/dso-sort-tests-1.def
++++ b/elf/dso-sort-tests-1.def
+@@ -64,3 +64,10 @@ output: b>a>{}<a<b
+ tst-bz15311: {+a;+e;+f;+g;+d;%d;-d;-g;-f;-e;-a};a->b->c->d;d=>[ba];c=>a;b=>e=>a;c=>f=>b;d=>g=>c
+ output(glibc.rtld.dynamic_sort=1): {+a[d>c>b>a>];+e[e>];+f[f>];+g[g>];+d[];%d(b(e(a()))a()g(c(a()f(b(e(a()))))));-d[];-g[];-f[];-e[];-a[<a<c<d<g<f<b<e];}
+ output(glibc.rtld.dynamic_sort=2): {+a[d>c>b>a>];+e[e>];+f[f>];+g[g>];+d[];%d(b(e(a()))a()g(c(a()f(b(e(a()))))));-d[];-g[];-f[];-e[];-a[<g<f<a<b<c<d<e];}
++
++# Test that even in the presence of dependency loops involving dlopen'ed
++# object, that object is initialized last (and not unloaded prematurely).
++# Final destructor order is indeterminate due to the cycle.
++tst-bz28937: {+a;+b;-b;+c;%c};a->a1;a->a2;a2->a;b->b1;c->a1;c=>a1
++output(glibc.rtld.dynamic_sort=1): {+a[a2>a1>a>];+b[b1>b>];-b[<b<b1];+c[c>];%c(a1());}<a<a2<c<a1
++output(glibc.rtld.dynamic_sort=2): {+a[a2>a1>a>];+b[b1>b>];-b[<b<b1];+c[c>];%c(a1());}<a2<a<c<a1
+-- 
+2.38.1
+
+
+From 52c037f3574eb9062b111d78a4cbeb79681d07d3 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 20 Sep 2022 12:12:43 +0200
+Subject: [PATCH 43/72] gconv: Use 64-bit interfaces in gconv_parseconfdir (bug
+ 29583)
+
+It's possible that inode numbers are outside the 32-bit range.
+The existing code only handles the in-libc case correctly, and
+still uses the legacy interfaces when building iconv.
+
+Suggested-by: Helge Deller <deller@gmx.de>
+(cherry picked from commit f97905f24631097af325d6a231093071c3077a5f)
+---
+ NEWS                       |  1 +
+ iconv/gconv_parseconfdir.h | 16 ++++++++--------
+ 2 files changed, 9 insertions(+), 8 deletions(-)
+
+diff --git a/NEWS b/NEWS
+index 5b4753416f..eab882987b 100644
+--- a/NEWS
++++ b/NEWS
+@@ -26,6 +26,7 @@ The following bugs are resolved with this release:
+   [29490] alpha: New __brk_call implementation is broken
+   [29528] elf: Call __libc_early_init for reused namespaces
+   [29539] libc: LD_TRACE_LOADED_OBJECTS changed how vDSO library are
++  [29583] Use 64-bit interfaces in gconv_parseconfdir
+ \f
+ Version 2.36
+ 
+diff --git a/iconv/gconv_parseconfdir.h b/iconv/gconv_parseconfdir.h
+index debb96b322..b72933b526 100644
+--- a/iconv/gconv_parseconfdir.h
++++ b/iconv/gconv_parseconfdir.h
+@@ -29,14 +29,14 @@
+ # define isspace(__c) __isspace_l ((__c), _nl_C_locobj_ptr)
+ # define asprintf __asprintf
+ # define opendir __opendir
+-# define readdir __readdir
++# define readdir64 __readdir64
+ # define closedir __closedir
+ # define mempcpy __mempcpy
+-# define struct_stat struct __stat64_t64
+-# define lstat __lstat64_time64
++# define struct_stat64 struct __stat64_t64
++# define lstat64 __lstat64_time64
+ # define feof_unlocked __feof_unlocked
+ #else
+-# define struct_stat struct stat
++# define struct_stat64 struct stat64
+ #endif
+ 
+ /* Name of the file containing the module information in the directories
+@@ -148,8 +148,8 @@ gconv_parseconfdir (const char *prefix, const char *dir, size_t dir_len)
+   DIR *confdir = opendir (buf);
+   if (confdir != NULL)
+     {
+-      struct dirent *ent;
+-      while ((ent = readdir (confdir)) != NULL)
++      struct dirent64 *ent;
++      while ((ent = readdir64 (confdir)) != NULL)
+ 	{
+ 	  if (ent->d_type != DT_REG && ent->d_type != DT_UNKNOWN)
+ 	    continue;
+@@ -161,12 +161,12 @@ gconv_parseconfdir (const char *prefix, const char *dir, size_t dir_len)
+ 	      && strcmp (ent->d_name + len - strlen (suffix), suffix) == 0)
+ 	    {
+ 	      char *conf;
+-	      struct_stat st;
++	      struct_stat64 st;
+ 	      if (asprintf (&conf, "%s/%s", buf, ent->d_name) < 0)
+ 		continue;
+ 
+ 	      if (ent->d_type != DT_UNKNOWN
+-		  || (lstat (conf, &st) != -1 && S_ISREG (st.st_mode)))
++		  || (lstat64 (conf, &st) != -1 && S_ISREG (st.st_mode)))
+ 		found |= read_conf_file (conf, dir, dir_len);
+ 
+ 	      free (conf);
+-- 
+2.38.1
+
+
+From 2628500f5dff1dd99c49a09b418b3b1ea3a6b5d3 Mon Sep 17 00:00:00 2001
+From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Tue, 30 Aug 2022 10:33:15 -0300
+Subject: [PATCH 44/72] m68k: Enforce 4-byte alignment on internal locks (BZ
+ #29537)
+
+A new internal definition, __LIBC_LOCK_ALIGNMENT, is used to force
+the 4-byte alignment only for m68k, other architecture keep the
+natural alignment of the type used internally (and hppa does not
+require 16-byte alignment for kernel-assisted CAS).
+
+Reviewed-by: Florian Weimer <fweimer@redhat.com>
+(cherry picked from commit aeb4d2e9815d459e2640a31f5abb8ef803830107)
+---
+ NEWS                                          |  1 +
+ sysdeps/generic/libc-lock-arch.h              | 25 +++++++++++++++++++
+ sysdeps/nptl/libc-lock.h                      |  8 +++++-
+ sysdeps/nptl/libc-lockP.h                     |  3 ++-
+ sysdeps/unix/sysv/linux/m68k/libc-lock-arch.h | 25 +++++++++++++++++++
+ 5 files changed, 60 insertions(+), 2 deletions(-)
+ create mode 100644 sysdeps/generic/libc-lock-arch.h
+ create mode 100644 sysdeps/unix/sysv/linux/m68k/libc-lock-arch.h
+
+diff --git a/NEWS b/NEWS
+index eab882987b..1cc9a16bbf 100644
+--- a/NEWS
++++ b/NEWS
+@@ -25,6 +25,7 @@ The following bugs are resolved with this release:
+   [29485] Linux: Terminate subprocess on late failure in tst-pidfd
+   [29490] alpha: New __brk_call implementation is broken
+   [29528] elf: Call __libc_early_init for reused namespaces
++  [29537] libc: [2.34 regression]: Alignment issue on m68k when using
+   [29539] libc: LD_TRACE_LOADED_OBJECTS changed how vDSO library are
+   [29583] Use 64-bit interfaces in gconv_parseconfdir
+ \f
+diff --git a/sysdeps/generic/libc-lock-arch.h b/sysdeps/generic/libc-lock-arch.h
+new file mode 100644
+index 0000000000..4713b30a8a
+--- /dev/null
++++ b/sysdeps/generic/libc-lock-arch.h
+@@ -0,0 +1,25 @@
++/* Private libc-internal arch-specific definitions.  Generic version.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public License as
++   published by the Free Software Foundation; either version 2.1 of the
++   License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; see the file COPYING.LIB.  If
++   not, see <https://www.gnu.org/licenses/>.  */
++
++#ifndef _LIBC_LOCK_ARCH_H
++#define _LIBC_LOCK_ARCH_H
++
++/* The default definition uses the natural alignment from the lock type.  */
++#define __LIBC_LOCK_ALIGNMENT
++
++#endif
+diff --git a/sysdeps/nptl/libc-lock.h b/sysdeps/nptl/libc-lock.h
+index 5af476c48b..63b3f3d75c 100644
+--- a/sysdeps/nptl/libc-lock.h
++++ b/sysdeps/nptl/libc-lock.h
+@@ -22,6 +22,7 @@
+ #include <pthread.h>
+ #define __need_NULL
+ #include <stddef.h>
++#include <libc-lock-arch.h>
+ 
+ 
+ /* Mutex type.  */
+@@ -29,7 +30,12 @@
+ # if (!IS_IN (libc) && !IS_IN (libpthread)) || !defined _LIBC
+ typedef struct { pthread_mutex_t mutex; } __libc_lock_recursive_t;
+ # else
+-typedef struct { int lock; int cnt; void *owner; } __libc_lock_recursive_t;
++typedef struct
++{
++  int lock __LIBC_LOCK_ALIGNMENT;
++  int cnt;
++  void *owner;
++} __libc_lock_recursive_t;
+ # endif
+ #else
+ typedef struct __libc_lock_recursive_opaque__ __libc_lock_recursive_t;
+diff --git a/sysdeps/nptl/libc-lockP.h b/sysdeps/nptl/libc-lockP.h
+index d3a6837fd2..425f514c5c 100644
+--- a/sysdeps/nptl/libc-lockP.h
++++ b/sysdeps/nptl/libc-lockP.h
+@@ -32,9 +32,10 @@
+    ld.so might be used on old kernels with a different libc.so.  */
+ #include <lowlevellock.h>
+ #include <tls.h>
++#include <libc-lock-arch.h>
+ 
+ /* Mutex type.  */
+-typedef int __libc_lock_t;
++typedef int __libc_lock_t __LIBC_LOCK_ALIGNMENT;
+ typedef struct { pthread_mutex_t mutex; } __rtld_lock_recursive_t;
+ typedef pthread_rwlock_t __libc_rwlock_t;
+ 
+diff --git a/sysdeps/unix/sysv/linux/m68k/libc-lock-arch.h b/sysdeps/unix/sysv/linux/m68k/libc-lock-arch.h
+new file mode 100644
+index 0000000000..1844bbaf6f
+--- /dev/null
++++ b/sysdeps/unix/sysv/linux/m68k/libc-lock-arch.h
+@@ -0,0 +1,25 @@
++/* Private libc-internal arch-specific definitions.  m68k version.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public License as
++   published by the Free Software Foundation; either version 2.1 of the
++   License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; see the file COPYING.LIB.  If
++   not, see <https://www.gnu.org/licenses/>.  */
++
++#ifndef _LIBC_LOCK_ARCH_H
++#define _LIBC_LOCK_ARCH_H
++
++/* Linux enforces 4-bytes alignment on futex inputs.  */
++#define __LIBC_LOCK_ALIGNMENT __attribute__ ((__aligned__ (4)))
++
++#endif
+-- 
+2.38.1
+
+
+From 227c9035872fc9e9e2cf56ec8f89219747ee19bc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?J=C3=B6rg=20Sonnenberger?= <joerg@bec.de>
+Date: Mon, 26 Sep 2022 13:59:16 -0400
+Subject: [PATCH 45/72] get_nscd_addresses: Fix subscript typos [BZ #29605]
+
+Fix the subscript on air->family, which was accidentally set to COUNT
+when it should have remained as I.
+
+Resolves: BZ #29605
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit c9226c03da0276593a0918eaa9a14835183343e8)
+---
+ sysdeps/posix/getaddrinfo.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
+index bcff909b2f..5cda9bb072 100644
+--- a/sysdeps/posix/getaddrinfo.c
++++ b/sysdeps/posix/getaddrinfo.c
+@@ -540,11 +540,11 @@ get_nscd_addresses (const char *name, const struct addrinfo *req,
+ 	  at[count].addr[2] = htonl (0xffff);
+ 	}
+       else if (req->ai_family == AF_UNSPEC
+-	       || air->family[count] == req->ai_family)
++	       || air->family[i] == req->ai_family)
+ 	{
+-	  at[count].family = air->family[count];
++	  at[count].family = air->family[i];
+ 	  memcpy (at[count].addr, addrs, size);
+-	  if (air->family[count] == AF_INET6)
++	  if (air->family[i] == AF_INET6)
+ 	    res->got_ipv6 = true;
+ 	}
+       at[count].next = at + count + 1;
+-- 
+2.38.1
+
+
+From 76e05613ee28f4ac4a0ab97effc32e0e78e37a56 Mon Sep 17 00:00:00 2001
+From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Thu, 29 Sep 2022 16:15:20 -0300
+Subject: [PATCH 46/72] stdlib: Fix __getrandom_nocancel type and arc4random
+ usage (BZ #29638)
+
+Using an unsigned type prevents the fallback to be used if kernel
+does not support getrandom syscall.
+
+Checked on x86_64-linux-gnu.
+
+Reviewed-by: Wilco Dijkstra  <Wilco.Dijkstra@arm.com>
+(cherry picked from commit 13db9ee2cb3b77e25f852be7d6952882e1be6f00)
+---
+ NEWS                                 | 1 +
+ stdlib/arc4random.c                  | 2 +-
+ sysdeps/unix/sysv/linux/not-cancel.h | 2 +-
+ 3 files changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/NEWS b/NEWS
+index 1cc9a16bbf..91bcfeb7a6 100644
+--- a/NEWS
++++ b/NEWS
+@@ -28,6 +28,7 @@ The following bugs are resolved with this release:
+   [29537] libc: [2.34 regression]: Alignment issue on m68k when using
+   [29539] libc: LD_TRACE_LOADED_OBJECTS changed how vDSO library are
+   [29583] Use 64-bit interfaces in gconv_parseconfdir
++  [29638] libc: stdlib: arc4random fallback is never used
+ \f
+ Version 2.36
+ 
+diff --git a/stdlib/arc4random.c b/stdlib/arc4random.c
+index e417ef624d..960a38f295 100644
+--- a/stdlib/arc4random.c
++++ b/stdlib/arc4random.c
+@@ -34,7 +34,7 @@ void
+ __arc4random_buf (void *p, size_t n)
+ {
+   static int seen_initialized;
+-  size_t l;
++  ssize_t l;
+   int fd;
+ 
+   if (n == 0)
+diff --git a/sysdeps/unix/sysv/linux/not-cancel.h b/sysdeps/unix/sysv/linux/not-cancel.h
+index a263d294b1..cf35c8bfc9 100644
+--- a/sysdeps/unix/sysv/linux/not-cancel.h
++++ b/sysdeps/unix/sysv/linux/not-cancel.h
+@@ -68,7 +68,7 @@ __writev_nocancel_nostatus (int fd, const struct iovec *iov, int iovcnt)
+   INTERNAL_SYSCALL_CALL (writev, fd, iov, iovcnt);
+ }
+ 
+-static inline int
++static inline ssize_t
+ __getrandom_nocancel (void *buf, size_t buflen, unsigned int flags)
+ {
+   return INLINE_SYSCALL_CALL (getrandom, buf, buflen, flags);
+-- 
+2.38.1
+
+
+From d1d8379bff34f02f86f82db2cef5bf66746d3560 Mon Sep 17 00:00:00 2001
+From: John David Anglin <danglin@gcc.gnu.org>
+Date: Sat, 1 Oct 2022 19:49:25 +0000
+Subject: [PATCH 47/72] hppa: Fix initialization of dp register [BZ 29635]
+
+After upgrading glibc to Debian 2.35-1, gdb faulted on
+startup and dropped core in a function call in the main
+application.  This was caused by not initializing the
+global dp register for the main application early enough.
+
+Restore the code to initialize dp in _dl_start_user.
+It was removed when code was added to initialize dp in
+elf_machine_runtime_setup.
+
+Signed-off-by: John David Anglin <dave.anglin@bell.net>
+---
+ sysdeps/hppa/dl-machine.h | 24 +++++++++++++++++++-----
+ 1 file changed, 19 insertions(+), 5 deletions(-)
+
+diff --git a/sysdeps/hppa/dl-machine.h b/sysdeps/hppa/dl-machine.h
+index c865713be1..1d51948566 100644
+--- a/sysdeps/hppa/dl-machine.h
++++ b/sysdeps/hppa/dl-machine.h
+@@ -347,6 +347,16 @@ elf_machine_runtime_setup (struct link_map *l, struct r_scope_elem *scope[],
+    its return value is the user program's entry point.  */
+ 
+ #define RTLD_START \
++/* Set up dp for any non-PIC lib constructors that may be called.  */	\
++static struct link_map * __attribute__((used))				\
++set_dp (struct link_map *map)						\
++{									\
++  register Elf32_Addr dp asm ("%r27");					\
++  dp = D_PTR (map, l_info[DT_PLTGOT]);					\
++  asm volatile ("" : : "r" (dp));					\
++  return map;								\
++}									\
++									\
+ asm (									\
+ "	.text\n"							\
+ "	.globl _start\n"						\
+@@ -426,6 +436,13 @@ asm (									\
+ 	   direct loader invocation.  Thus, argc and argv must be	\
+ 	   reloaded from from _dl_argc and _dl_argv.  */		\
+ 									\
++	/* Load main_map from _rtld_local and setup dp. */		\
++"	addil	LT'_rtld_local,%r19\n"					\
++"	ldw	RT'_rtld_local(%r1),%r26\n"				\
++"	bl	set_dp, %r2\n"						\
++"	ldw	0(%r26),%r26\n"						\
++"	copy	%ret0,%r26\n"						\
++									\
+ 	/* Load argc from _dl_argc.  */					\
+ "	addil	LT'_dl_argc,%r19\n"					\
+ "	ldw	RT'_dl_argc(%r1),%r20\n"				\
+@@ -438,13 +455,10 @@ asm (									\
+ "	ldw	0(%r20),%r24\n"						\
+ "	stw	%r24,-44(%sp)\n"					\
+ 									\
+-	/* Call _dl_init(main_map, argc, argv, envp). */		\
+-"	addil	LT'_rtld_local,%r19\n"					\
+-"	ldw	RT'_rtld_local(%r1),%r26\n"				\
+-"	ldw	0(%r26),%r26\n"						\
+-									\
+ 	/* envp = argv + argc + 1 */					\
+ "	sh2add	%r25,%r24,%r23\n"					\
++									\
++	/* Call _dl_init(main_map, argc, argv, envp). */		\
+ "	bl	_dl_init,%r2\n"						\
+ "	ldo	4(%r23),%r23\n"	/* delay slot */			\
+ 									\
+-- 
+2.38.1
+
+
+From cdc496eb55e30f8f2461bedb0a7381c0a7a3d3ae Mon Sep 17 00:00:00 2001
+From: John David Anglin <danglin@gcc.gnu.org>
+Date: Tue, 20 Sep 2022 20:14:14 +0000
+Subject: [PATCH 48/72] hppa: undef __ASSUME_SET_ROBUST_LIST
+
+QEMU does not support support set_robust_list. Thus, we need
+to enable detection of set_robust_list system call.
+
+Signed-off-by: John David Anglin <dave.anglin@bell.net>
+---
+ sysdeps/unix/sysv/linux/hppa/kernel-features.h | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/sysdeps/unix/sysv/linux/hppa/kernel-features.h b/sysdeps/unix/sysv/linux/hppa/kernel-features.h
+index 0cd21ef0fa..079612e4aa 100644
+--- a/sysdeps/unix/sysv/linux/hppa/kernel-features.h
++++ b/sysdeps/unix/sysv/linux/hppa/kernel-features.h
+@@ -30,3 +30,6 @@
+ 
+ #undef __ASSUME_CLONE_DEFAULT
+ #define __ASSUME_CLONE_BACKWARDS 1
++
++/* QEMU does not support set_robust_list.  */
++#undef __ASSUME_SET_ROBUST_LIST
+-- 
+2.38.1
+
+
+From 18bec23cbb4d530a2a8ce95353770661fabcd55f Mon Sep 17 00:00:00 2001
+From: Aurelien Jarno <aurelien@aurel32.net>
+Date: Mon, 3 Oct 2022 23:46:11 +0200
+Subject: [PATCH 49/72] x86: include BMI1 and BMI2 in x86-64-v3 level
+
+The "System V Application Binary Interface AMD64 Architecture Processor
+Supplement" mandates the BMI1 and BMI2 CPU features for the x86-64-v3
+level.
+
+Reviewed-by: Noah Goldstein  <goldstein.w.n@gmail.com>
+(cherry picked from commit b80f16adbd979831bf25ea491e1261e81885c2b6)
+---
+ sysdeps/x86/get-isa-level.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/sysdeps/x86/get-isa-level.h b/sysdeps/x86/get-isa-level.h
+index 1ade78ab73..5b4dd5f062 100644
+--- a/sysdeps/x86/get-isa-level.h
++++ b/sysdeps/x86/get-isa-level.h
+@@ -47,6 +47,8 @@ get_isa_level (const struct cpu_features *cpu_features)
+ 	  isa_level |= GNU_PROPERTY_X86_ISA_1_V2;
+ 	  if (CPU_FEATURE_USABLE_P (cpu_features, AVX)
+ 	      && CPU_FEATURE_USABLE_P (cpu_features, AVX2)
++	      && CPU_FEATURE_USABLE_P (cpu_features, BMI1)
++	      && CPU_FEATURE_USABLE_P (cpu_features, BMI2)
+ 	      && CPU_FEATURE_USABLE_P (cpu_features, F16C)
+ 	      && CPU_FEATURE_USABLE_P (cpu_features, FMA)
+ 	      && CPU_FEATURE_USABLE_P (cpu_features, LZCNT)
+-- 
+2.38.1
+
+
+From 46479e5d10ed87825aa277da158d6a687974518b Mon Sep 17 00:00:00 2001
+From: Aurelien Jarno <aurelien@aurel32.net>
+Date: Mon, 3 Oct 2022 23:46:11 +0200
+Subject: [PATCH 50/72] x86-64: Require BMI2 for AVX2 str(n)casecmp
+ implementations
+
+The AVX2 str(n)casecmp implementations use the 'bzhi' instruction, which
+belongs to the BMI2 CPU feature.
+
+NB: It also uses the 'tzcnt' BMI1 instruction, but it is executed as BSF
+as BSF if the CPU doesn't support TZCNT, and produces the same result
+for non-zero input.
+
+Partially fixes: b77b06e0e296 ("x86: Optimize strcmp-avx2.S")
+Partially resolves: BZ #29611
+
+Reviewed-by: Noah Goldstein  <goldstein.w.n@gmail.com>
+(cherry picked from commit 10f79d3670b036925da63dc532b122d27ce65ff8)
+---
+ sysdeps/x86_64/multiarch/ifunc-impl-list.c  | 28 +++++++++++++++------
+ sysdeps/x86_64/multiarch/ifunc-strcasecmp.h |  1 +
+ 2 files changed, 21 insertions(+), 8 deletions(-)
+
+diff --git a/sysdeps/x86_64/multiarch/ifunc-impl-list.c b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
+index a71444eccb..d208fae4bf 100644
+--- a/sysdeps/x86_64/multiarch/ifunc-impl-list.c
++++ b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
+@@ -448,13 +448,16 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
+   IFUNC_IMPL (i, name, strcasecmp,
+ 	      X86_IFUNC_IMPL_ADD_V4 (array, i, strcasecmp,
+ 				     (CPU_FEATURE_USABLE (AVX512VL)
+-				      && CPU_FEATURE_USABLE (AVX512BW)),
++				      && CPU_FEATURE_USABLE (AVX512BW)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __strcasecmp_evex)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, strcasecmp,
+-				     CPU_FEATURE_USABLE (AVX2),
++				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __strcasecmp_avx2)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, strcasecmp,
+ 				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)
+ 				      && CPU_FEATURE_USABLE (RTM)),
+ 				     __strcasecmp_avx2_rtm)
+ 	      X86_IFUNC_IMPL_ADD_V2 (array, i, strcasecmp,
+@@ -470,13 +473,16 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
+   IFUNC_IMPL (i, name, strcasecmp_l,
+ 	      X86_IFUNC_IMPL_ADD_V4 (array, i, strcasecmp,
+ 				     (CPU_FEATURE_USABLE (AVX512VL)
+-				      && CPU_FEATURE_USABLE (AVX512BW)),
++				      && CPU_FEATURE_USABLE (AVX512BW)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __strcasecmp_l_evex)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, strcasecmp,
+-				     CPU_FEATURE_USABLE (AVX2),
++				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __strcasecmp_l_avx2)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, strcasecmp,
+ 				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)
+ 				      && CPU_FEATURE_USABLE (RTM)),
+ 				     __strcasecmp_l_avx2_rtm)
+ 	      X86_IFUNC_IMPL_ADD_V2 (array, i, strcasecmp_l,
+@@ -638,13 +644,16 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
+   IFUNC_IMPL (i, name, strncasecmp,
+ 	      X86_IFUNC_IMPL_ADD_V4 (array, i, strncasecmp,
+ 				     (CPU_FEATURE_USABLE (AVX512VL)
+-				      && CPU_FEATURE_USABLE (AVX512BW)),
++				      && CPU_FEATURE_USABLE (AVX512BW)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __strncasecmp_evex)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, strncasecmp,
+-				     CPU_FEATURE_USABLE (AVX2),
++				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __strncasecmp_avx2)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, strncasecmp,
+ 				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)
+ 				      && CPU_FEATURE_USABLE (RTM)),
+ 				     __strncasecmp_avx2_rtm)
+ 	      X86_IFUNC_IMPL_ADD_V2 (array, i, strncasecmp,
+@@ -660,13 +669,16 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
+   IFUNC_IMPL (i, name, strncasecmp_l,
+ 	      X86_IFUNC_IMPL_ADD_V4 (array, i, strncasecmp,
+ 				     (CPU_FEATURE_USABLE (AVX512VL)
+-				      && CPU_FEATURE_USABLE (AVX512BW)),
++				      & CPU_FEATURE_USABLE (AVX512BW)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __strncasecmp_l_evex)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, strncasecmp,
+-				     CPU_FEATURE_USABLE (AVX2),
++				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __strncasecmp_l_avx2)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, strncasecmp,
+ 				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)
+ 				      && CPU_FEATURE_USABLE (RTM)),
+ 				     __strncasecmp_l_avx2_rtm)
+ 	      X86_IFUNC_IMPL_ADD_V2 (array, i, strncasecmp_l,
+diff --git a/sysdeps/x86_64/multiarch/ifunc-strcasecmp.h b/sysdeps/x86_64/multiarch/ifunc-strcasecmp.h
+index 68646ef199..7622af259c 100644
+--- a/sysdeps/x86_64/multiarch/ifunc-strcasecmp.h
++++ b/sysdeps/x86_64/multiarch/ifunc-strcasecmp.h
+@@ -34,6 +34,7 @@ IFUNC_SELECTOR (void)
+   const struct cpu_features *cpu_features = __get_cpu_features ();
+ 
+   if (X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, AVX2)
++      && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, BMI2)
+       && X86_ISA_CPU_FEATURES_ARCH_P (cpu_features,
+ 				      AVX_Fast_Unaligned_Load, ))
+     {
+-- 
+2.38.1
+
+
+From 7afbd1e56acb721031bffd876f275dcb1af7e530 Mon Sep 17 00:00:00 2001
+From: Aurelien Jarno <aurelien@aurel32.net>
+Date: Mon, 3 Oct 2022 23:46:11 +0200
+Subject: [PATCH 51/72] x86-64: Require BMI2 for AVX2 strcmp implementation
+
+The AVX2 strcmp implementation uses the 'bzhi' instruction, which
+belongs to the BMI2 CPU feature.
+
+NB: It also uses the 'tzcnt' BMI1 instruction, but it is executed as BSF
+as BSF if the CPU doesn't support TZCNT, and produces the same result
+for non-zero input.
+
+Partially fixes: b77b06e0e296 ("x86: Optimize strcmp-avx2.S")
+Partially resolves: BZ #29611
+
+Reviewed-by: Noah Goldstein  <goldstein.w.n@gmail.com>
+(cherry picked from commit 4d64c6445735e9b34e2ac8e369312cbfc2f88e17)
+---
+ sysdeps/x86_64/multiarch/ifunc-impl-list.c | 4 +++-
+ sysdeps/x86_64/multiarch/strcmp.c          | 4 ++--
+ 2 files changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/sysdeps/x86_64/multiarch/ifunc-impl-list.c b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
+index d208fae4bf..a42b0a4620 100644
+--- a/sysdeps/x86_64/multiarch/ifunc-impl-list.c
++++ b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
+@@ -591,10 +591,12 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
+ 				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __strcmp_evex)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, strcmp,
+-				     CPU_FEATURE_USABLE (AVX2),
++				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __strcmp_avx2)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, strcmp,
+ 				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)
+ 				      && CPU_FEATURE_USABLE (RTM)),
+ 				     __strcmp_avx2_rtm)
+ 	      X86_IFUNC_IMPL_ADD_V2 (array, i, strcmp,
+diff --git a/sysdeps/x86_64/multiarch/strcmp.c b/sysdeps/x86_64/multiarch/strcmp.c
+index fdd5afe3af..9d6c9f66ba 100644
+--- a/sysdeps/x86_64/multiarch/strcmp.c
++++ b/sysdeps/x86_64/multiarch/strcmp.c
+@@ -45,12 +45,12 @@ IFUNC_SELECTOR (void)
+   const struct cpu_features *cpu_features = __get_cpu_features ();
+ 
+   if (X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, AVX2)
++      && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, BMI2)
+       && X86_ISA_CPU_FEATURES_ARCH_P (cpu_features,
+ 				      AVX_Fast_Unaligned_Load, ))
+     {
+       if (X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, AVX512VL)
+-	  && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, AVX512BW)
+-	  && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, BMI2))
++	  && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, AVX512BW))
+ 	return OPTIMIZE (evex);
+ 
+       if (CPU_FEATURE_USABLE_P (cpu_features, RTM))
+-- 
+2.38.1
+
+
+From 29c577e0f54fe6e70ceacb3659179781c5569903 Mon Sep 17 00:00:00 2001
+From: Aurelien Jarno <aurelien@aurel32.net>
+Date: Mon, 3 Oct 2022 23:46:11 +0200
+Subject: [PATCH 52/72] x86-64: Require BMI2 for AVX2 strncmp implementation
+
+The AVX2 strncmp implementations uses the 'bzhi' instruction, which
+belongs to the BMI2 CPU feature.
+
+NB: It also uses the 'tzcnt' BMI1 instruction, but it is executed as BSF
+as BSF if the CPU doesn't support TZCNT, and produces the same result
+for non-zero input.
+
+Partially fixes: b77b06e0e296 ("x86: Optimize strcmp-avx2.S")
+Partially resolves: BZ #29611
+
+Reviewed-by: Noah Goldstein  <goldstein.w.n@gmail.com>
+(cherry picked from commit fc7de1d9b99ae1676bc626ddca422d7abee0eb48)
+---
+ sysdeps/x86_64/multiarch/ifunc-impl-list.c | 7 +++++--
+ sysdeps/x86_64/multiarch/strncmp.c         | 4 ++--
+ 2 files changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/sysdeps/x86_64/multiarch/ifunc-impl-list.c b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
+index a42b0a4620..aebef3daaf 100644
+--- a/sysdeps/x86_64/multiarch/ifunc-impl-list.c
++++ b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
+@@ -1176,13 +1176,16 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
+   IFUNC_IMPL (i, name, strncmp,
+ 	      X86_IFUNC_IMPL_ADD_V4 (array, i, strncmp,
+ 				     (CPU_FEATURE_USABLE (AVX512VL)
+-				      && CPU_FEATURE_USABLE (AVX512BW)),
++				      && CPU_FEATURE_USABLE (AVX512BW)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __strncmp_evex)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, strncmp,
+-				     CPU_FEATURE_USABLE (AVX2),
++				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __strncmp_avx2)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, strncmp,
+ 				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)
+ 				      && CPU_FEATURE_USABLE (RTM)),
+ 				     __strncmp_avx2_rtm)
+ 	      X86_IFUNC_IMPL_ADD_V2 (array, i, strncmp,
+diff --git a/sysdeps/x86_64/multiarch/strncmp.c b/sysdeps/x86_64/multiarch/strncmp.c
+index 4ebe4bde30..c4f8b6bbb5 100644
+--- a/sysdeps/x86_64/multiarch/strncmp.c
++++ b/sysdeps/x86_64/multiarch/strncmp.c
+@@ -41,12 +41,12 @@ IFUNC_SELECTOR (void)
+   const struct cpu_features *cpu_features = __get_cpu_features ();
+ 
+   if (X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, AVX2)
++      && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, BMI2)
+       && X86_ISA_CPU_FEATURES_ARCH_P (cpu_features,
+ 				      AVX_Fast_Unaligned_Load, ))
+     {
+       if (X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, AVX512VL)
+-	  && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, AVX512BW)
+-	  && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, BMI2))
++	  && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, AVX512BW))
+ 	return OPTIMIZE (evex);
+ 
+       if (CPU_FEATURE_USABLE_P (cpu_features, RTM))
+-- 
+2.38.1
+
+
+From d8bf4388df679fa5a3ae7889a649e573e3124530 Mon Sep 17 00:00:00 2001
+From: Aurelien Jarno <aurelien@aurel32.net>
+Date: Mon, 3 Oct 2022 23:46:11 +0200
+Subject: [PATCH 53/72] x86-64: Require BMI2 for AVX2 wcs(n)cmp implementations
+
+The AVX2 wcs(n)cmp implementations use the 'bzhi' instruction, which
+belongs to the BMI2 CPU feature.
+
+NB: It also uses the 'tzcnt' BMI1 instruction, but it is executed as BSF
+as BSF if the CPU doesn't support TZCNT, and produces the same result
+for non-zero input.
+
+Partially fixes: b77b06e0e296 ("x86: Optimize strcmp-avx2.S")
+Partially resolves: BZ #29611
+
+Reviewed-by: Noah Goldstein  <goldstein.w.n@gmail.com>
+(cherry picked from commit f31a5a884ed84bd37032729d4d1eb9d06c9f3c29)
+---
+ sysdeps/x86_64/multiarch/ifunc-impl-list.c | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/sysdeps/x86_64/multiarch/ifunc-impl-list.c b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
+index aebef3daaf..fec8790c11 100644
+--- a/sysdeps/x86_64/multiarch/ifunc-impl-list.c
++++ b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
+@@ -810,10 +810,12 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
+ 				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __wcscmp_evex)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, wcscmp,
+-				     CPU_FEATURE_USABLE (AVX2),
++				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __wcscmp_avx2)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, wcscmp,
+ 				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)
+ 				      && CPU_FEATURE_USABLE (RTM)),
+ 				     __wcscmp_avx2_rtm)
+ 	      /* ISA V2 wrapper for SSE2 implementation because the SSE2
+@@ -830,10 +832,12 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
+ 				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __wcsncmp_evex)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, wcsncmp,
+-				     CPU_FEATURE_USABLE (AVX2),
++				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __wcsncmp_avx2)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, wcsncmp,
+ 				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)
+ 				      && CPU_FEATURE_USABLE (RTM)),
+ 				     __wcsncmp_avx2_rtm)
+ 	      /* ISA V2 wrapper for GENERIC implementation because the
+-- 
+2.38.1
+
+
+From d9196d4f3fa9997388655813ddd236426a16dd92 Mon Sep 17 00:00:00 2001
+From: Aurelien Jarno <aurelien@aurel32.net>
+Date: Mon, 3 Oct 2022 23:46:11 +0200
+Subject: [PATCH 54/72] x86-64: Require BMI2 for AVX2 (raw|w)memchr
+ implementations
+
+The AVX2 memchr, rawmemchr and wmemchr implementations use the 'bzhi'
+and 'sarx' instructions, which belongs to the BMI2 CPU feature.
+
+Fixes: acfd088a1963 ("x86: Optimize memchr-avx2.S")
+Partially resolves: BZ #29611
+
+Reviewed-by: Noah Goldstein  <goldstein.w.n@gmail.com>
+(cherry picked from commit e3e7fab7fe5186d18ca2046d99ba321c27db30ad)
+---
+ sysdeps/x86_64/multiarch/ifunc-impl-list.c | 12 +++++++++---
+ 1 file changed, 9 insertions(+), 3 deletions(-)
+
+diff --git a/sysdeps/x86_64/multiarch/ifunc-impl-list.c b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
+index fec8790c11..7c84963d92 100644
+--- a/sysdeps/x86_64/multiarch/ifunc-impl-list.c
++++ b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
+@@ -69,10 +69,12 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
+ 				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __memchr_evex_rtm)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, memchr,
+-				     CPU_FEATURE_USABLE (AVX2),
++				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __memchr_avx2)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, memchr,
+ 				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)
+ 				      && CPU_FEATURE_USABLE (RTM)),
+ 				     __memchr_avx2_rtm)
+ 	      /* ISA V2 wrapper for SSE2 implementation because the SSE2
+@@ -335,10 +337,12 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
+ 				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __rawmemchr_evex_rtm)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, rawmemchr,
+-				     CPU_FEATURE_USABLE (AVX2),
++				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __rawmemchr_avx2)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, rawmemchr,
+ 				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)
+ 				      && CPU_FEATURE_USABLE (RTM)),
+ 				     __rawmemchr_avx2_rtm)
+ 	      /* ISA V2 wrapper for SSE2 implementation because the SSE2
+@@ -927,10 +931,12 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
+ 				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __wmemchr_evex_rtm)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, wmemchr,
+-				     CPU_FEATURE_USABLE (AVX2),
++				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __wmemchr_avx2)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, wmemchr,
+ 				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)
+ 				      && CPU_FEATURE_USABLE (RTM)),
+ 				     __wmemchr_avx2_rtm)
+ 	      /* ISA V2 wrapper for SSE2 implementation because the SSE2
+-- 
+2.38.1
+
+
+From 923c3f3c373f499e62160e00831dda576443317b Mon Sep 17 00:00:00 2001
+From: Aurelien Jarno <aurelien@aurel32.net>
+Date: Mon, 3 Oct 2022 23:46:11 +0200
+Subject: [PATCH 55/72] x86-64: Require BMI2 and LZCNT for AVX2 memrchr
+ implementation
+
+The AVX2 memrchr implementation uses the 'shlxl' instruction, which
+belongs to the BMI2 CPU feature and uses the 'lzcnt' instruction, which
+belongs to the LZCNT CPU feature.
+
+Fixes: af5306a735eb ("x86: Optimize memrchr-avx2.S")
+Partially resolves: BZ #29611
+
+Reviewed-by: Noah Goldstein  <goldstein.w.n@gmail.com>
+(cherry picked from commit 3c0c78afabfed4b6fc161c159e628fbf14ff370b)
+---
+ sysdeps/x86/isa-level.h                    |  1 +
+ sysdeps/x86_64/multiarch/ifunc-avx2.h      |  1 +
+ sysdeps/x86_64/multiarch/ifunc-impl-list.c | 10 ++++++++--
+ 3 files changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/sysdeps/x86/isa-level.h b/sysdeps/x86/isa-level.h
+index 3c4480aba7..bbb90f5c5e 100644
+--- a/sysdeps/x86/isa-level.h
++++ b/sysdeps/x86/isa-level.h
+@@ -80,6 +80,7 @@
+ #define AVX_X86_ISA_LEVEL 3
+ #define AVX2_X86_ISA_LEVEL 3
+ #define BMI2_X86_ISA_LEVEL 3
++#define LZCNT_X86_ISA_LEVEL 3
+ #define MOVBE_X86_ISA_LEVEL 3
+ 
+ /* ISA level >= 2 guaranteed includes.  */
+diff --git a/sysdeps/x86_64/multiarch/ifunc-avx2.h b/sysdeps/x86_64/multiarch/ifunc-avx2.h
+index a57a9952f3..f1741083fd 100644
+--- a/sysdeps/x86_64/multiarch/ifunc-avx2.h
++++ b/sysdeps/x86_64/multiarch/ifunc-avx2.h
+@@ -37,6 +37,7 @@ IFUNC_SELECTOR (void)
+ 
+   if (X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, AVX2)
+       && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, BMI2)
++      && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, LZCNT)
+       && X86_ISA_CPU_FEATURES_ARCH_P (cpu_features,
+ 				      AVX_Fast_Unaligned_Load, ))
+     {
+diff --git a/sysdeps/x86_64/multiarch/ifunc-impl-list.c b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
+index 7c84963d92..ec1c5b55fb 100644
+--- a/sysdeps/x86_64/multiarch/ifunc-impl-list.c
++++ b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
+@@ -209,13 +209,19 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
+   IFUNC_IMPL (i, name, memrchr,
+ 	      X86_IFUNC_IMPL_ADD_V4 (array, i, memrchr,
+ 				     (CPU_FEATURE_USABLE (AVX512VL)
+-				      && CPU_FEATURE_USABLE (AVX512BW)),
++				      && CPU_FEATURE_USABLE (AVX512BW)
++				      && CPU_FEATURE_USABLE (BMI2)
++				      && CPU_FEATURE_USABLE (LZCNT)),
+ 				     __memrchr_evex)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, memrchr,
+-				     CPU_FEATURE_USABLE (AVX2),
++				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)
++				      && CPU_FEATURE_USABLE (LZCNT)),
+ 				     __memrchr_avx2)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, memrchr,
+ 				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)
++				      && CPU_FEATURE_USABLE (LZCNT)
+ 				      && CPU_FEATURE_USABLE (RTM)),
+ 				     __memrchr_avx2_rtm)
+ 	      /* ISA V2 wrapper for SSE2 implementation because the SSE2
+-- 
+2.38.1
+
+
+From 2d8ef784bd6a784496a6fd460de6b6f57c70a501 Mon Sep 17 00:00:00 2001
+From: Aurelien Jarno <aurelien@aurel32.net>
+Date: Mon, 3 Oct 2022 23:46:11 +0200
+Subject: [PATCH 56/72] x86-64: Require BMI1/BMI2 for AVX2 strrchr and wcsrchr
+ implementations
+
+The AVX2 strrchr and wcsrchr implementation uses the 'blsmsk'
+instruction which belongs to the BMI1 CPU feature and the 'shrx'
+instruction, which belongs to the BMI2 CPU feature.
+
+Fixes: df7e295d18ff ("x86: Optimize {str|wcs}rchr-avx2")
+Partially resolves: BZ #29611
+
+Reviewed-by: Noah Goldstein  <goldstein.w.n@gmail.com>
+(cherry picked from commit 7e8283170c5d6805b609a040801d819e362a6292)
+---
+ sysdeps/x86/isa-level.h                    |  1 +
+ sysdeps/x86_64/multiarch/ifunc-avx2.h      |  1 +
+ sysdeps/x86_64/multiarch/ifunc-impl-list.c | 17 ++++++++++++++---
+ 3 files changed, 16 insertions(+), 3 deletions(-)
+
+diff --git a/sysdeps/x86/isa-level.h b/sysdeps/x86/isa-level.h
+index bbb90f5c5e..06f6c9663e 100644
+--- a/sysdeps/x86/isa-level.h
++++ b/sysdeps/x86/isa-level.h
+@@ -79,6 +79,7 @@
+ /* ISA level >= 3 guaranteed includes.  */
+ #define AVX_X86_ISA_LEVEL 3
+ #define AVX2_X86_ISA_LEVEL 3
++#define BMI1_X86_ISA_LEVEL 3
+ #define BMI2_X86_ISA_LEVEL 3
+ #define LZCNT_X86_ISA_LEVEL 3
+ #define MOVBE_X86_ISA_LEVEL 3
+diff --git a/sysdeps/x86_64/multiarch/ifunc-avx2.h b/sysdeps/x86_64/multiarch/ifunc-avx2.h
+index f1741083fd..f2f5e8a211 100644
+--- a/sysdeps/x86_64/multiarch/ifunc-avx2.h
++++ b/sysdeps/x86_64/multiarch/ifunc-avx2.h
+@@ -36,6 +36,7 @@ IFUNC_SELECTOR (void)
+   const struct cpu_features *cpu_features = __get_cpu_features ();
+ 
+   if (X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, AVX2)
++      && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, BMI1)
+       && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, BMI2)
+       && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, LZCNT)
+       && X86_ISA_CPU_FEATURES_ARCH_P (cpu_features,
+diff --git a/sysdeps/x86_64/multiarch/ifunc-impl-list.c b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
+index ec1c5b55fb..00a91123d3 100644
+--- a/sysdeps/x86_64/multiarch/ifunc-impl-list.c
++++ b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
+@@ -578,13 +578,19 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
+   IFUNC_IMPL (i, name, strrchr,
+ 	      X86_IFUNC_IMPL_ADD_V4 (array, i, strrchr,
+ 				     (CPU_FEATURE_USABLE (AVX512VL)
+-				      && CPU_FEATURE_USABLE (AVX512BW)),
++				      && CPU_FEATURE_USABLE (AVX512BW)
++				      && CPU_FEATURE_USABLE (BMI1)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __strrchr_evex)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, strrchr,
+-				     CPU_FEATURE_USABLE (AVX2),
++				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI1)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __strrchr_avx2)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, strrchr,
+ 				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI1)
++				      && CPU_FEATURE_USABLE (BMI2)
+ 				      && CPU_FEATURE_USABLE (RTM)),
+ 				     __strrchr_avx2_rtm)
+ 	      /* ISA V2 wrapper for SSE2 implementation because the SSE2
+@@ -797,13 +803,18 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
+ 	      X86_IFUNC_IMPL_ADD_V4 (array, i, wcsrchr,
+ 				     (CPU_FEATURE_USABLE (AVX512VL)
+ 				      && CPU_FEATURE_USABLE (AVX512BW)
++				      && CPU_FEATURE_USABLE (BMI1)
+ 				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __wcsrchr_evex)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, wcsrchr,
+-				     CPU_FEATURE_USABLE (AVX2),
++				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI1)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __wcsrchr_avx2)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, wcsrchr,
+ 				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI1)
++				      && CPU_FEATURE_USABLE (BMI2)
+ 				      && CPU_FEATURE_USABLE (RTM)),
+ 				     __wcsrchr_avx2_rtm)
+ 	      /* ISA V2 wrapper for SSE2 implementation because the SSE2
+-- 
+2.38.1
+
+
+From 2bd815d8347851212b9a91dbdca8053f4dbdac87 Mon Sep 17 00:00:00 2001
+From: Siddhesh Poyarekar <siddhesh@sourceware.org>
+Date: Tue, 4 Oct 2022 18:43:50 -0400
+Subject: [PATCH 57/72] nscd: Drop local address tuple variable [BZ #29607]
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+When a request needs to be resent (e.g. due to insufficient buffer
+space), the references to subsequent tuples in the local variable are
+stale and should not be used.  This used to work by accident before, but
+since 1d495912a it no longer does.  Instead of trying to reset it, just
+let gethostbyname4_r write into TUMPBUF6 for us, thus maintaining a
+consistent state at all times.  This is now consistent with what is done
+in gaih_inet for getaddrinfo.
+
+Resolves: BZ #29607
+Reported-by: Holger Hoffstätte <holger@applied-asynchrony.com>
+Tested-by: Holger Hoffstätte <holger@applied-asynchrony.com>
+Reviewed-by: Carlos O'Donell <carlos@redhat.com>
+(cherry picked from commit 6e33e5c4b73cea7b8aa3de0947123db16200fb65)
+---
+ NEWS           | 2 ++
+ nscd/aicache.c | 5 ++---
+ 2 files changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/NEWS b/NEWS
+index 91bcfeb7a6..63e26d7062 100644
+--- a/NEWS
++++ b/NEWS
+@@ -28,6 +28,8 @@ The following bugs are resolved with this release:
+   [29537] libc: [2.34 regression]: Alignment issue on m68k when using
+   [29539] libc: LD_TRACE_LOADED_OBJECTS changed how vDSO library are
+   [29583] Use 64-bit interfaces in gconv_parseconfdir
++  [29607] nscd repeatably crashes calling __strlen_avx2 when hosts cache is
++    enabled
+   [29638] libc: stdlib: arc4random fallback is never used
+ \f
+ Version 2.36
+diff --git a/nscd/aicache.c b/nscd/aicache.c
+index 51e793199f..e0baed170b 100644
+--- a/nscd/aicache.c
++++ b/nscd/aicache.c
+@@ -110,11 +110,10 @@ addhstaiX (struct database_dyn *db, int fd, request_header *req,
+ 							  "gethostbyname4_r");
+       if (fct4 != NULL)
+ 	{
+-	  struct gaih_addrtuple atmem;
+ 	  struct gaih_addrtuple *at;
+ 	  while (1)
+ 	    {
+-	      at = &atmem;
++	      at = NULL;
+ 	      rc6 = 0;
+ 	      herrno = 0;
+ 	      status[1] = DL_CALL_FCT (fct4, (key, &at,
+@@ -137,7 +136,7 @@ addhstaiX (struct database_dyn *db, int fd, request_header *req,
+ 	    goto next_nip;
+ 
+ 	  /* We found the data.  Count the addresses and the size.  */
+-	  for (const struct gaih_addrtuple *at2 = at = &atmem; at2 != NULL;
++	  for (const struct gaih_addrtuple *at2 = at; at2 != NULL;
+ 	       at2 = at2->next)
+ 	    {
+ 	      ++naddrs;
+-- 
+2.38.1
+
+
+From 3e279192749cfcae4ceebb1f21a3275e677d0561 Mon Sep 17 00:00:00 2001
+From: Michael Hudson-Doyle <michael.hudson@canonical.com>
+Date: Fri, 12 Aug 2022 11:29:31 +1200
+Subject: [PATCH 58/72] Ensure calculations happen with desired rounding mode
+ in y1lf128
+
+math/test-float128-y1 fails on x86_64 and ppc64el with gcc 12 and -O3,
+because code inside a block guarded by SET_RESTORE_ROUNDL is being moved
+after the rounding mode has been restored. Use math_force_eval to
+prevent this (and insert some math_opt_barrier calls to prevent code
+from being moved before the rounding mode is set).
+
+Fixes #29463
+
+Reviewed-By: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
+(cherry picked from commit 2b274fd8c9c776cf70fcdb8356e678ada522a7b0)
+---
+ NEWS                             | 1 +
+ sysdeps/ieee754/ldbl-128/e_j1l.c | 3 +++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/NEWS b/NEWS
+index 63e26d7062..bea1d8a11f 100644
+--- a/NEWS
++++ b/NEWS
+@@ -24,6 +24,7 @@ The following bugs are resolved with this release:
+   [29446] _dlopen now ignores dl_caller argument in static mode
+   [29485] Linux: Terminate subprocess on late failure in tst-pidfd
+   [29490] alpha: New __brk_call implementation is broken
++  [29463] math/test-float128-y1 fails on x86_64
+   [29528] elf: Call __libc_early_init for reused namespaces
+   [29537] libc: [2.34 regression]: Alignment issue on m68k when using
+   [29539] libc: LD_TRACE_LOADED_OBJECTS changed how vDSO library are
+diff --git a/sysdeps/ieee754/ldbl-128/e_j1l.c b/sysdeps/ieee754/ldbl-128/e_j1l.c
+index 54c457681a..9a9c5c6f00 100644
+--- a/sysdeps/ieee754/ldbl-128/e_j1l.c
++++ b/sysdeps/ieee754/ldbl-128/e_j1l.c
+@@ -869,10 +869,13 @@ __ieee754_y1l (_Float128 x)
+     {
+       /* 0 <= x <= 2 */
+       SET_RESTORE_ROUNDL (FE_TONEAREST);
++      xx = math_opt_barrier (xx);
++      x = math_opt_barrier (x);
+       z = xx * xx;
+       p = xx * neval (z, Y0_2N, NY0_2N) / deval (z, Y0_2D, NY0_2D);
+       p = -TWOOPI / xx + p;
+       p = TWOOPI * __ieee754_logl (x) * __ieee754_j1l (x) + p;
++      math_force_eval (p);
+       return p;
+     }
+ 
+-- 
+2.38.1
+
+
+From 700d3281f9e57b53c27bc991394b22d467432626 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 13 Sep 2022 16:10:20 +0200
+Subject: [PATCH 59/72] nss: Implement --no-addrconfig option for getent
+
+The ahosts, ahostsv4, ahostsv6 commands unconditionally pass
+AI_ADDRCONFIG to getaddrinfo, which is not always desired.
+
+Reviewed-by: Carlos O'Donell <carlos@redhat.com>
+(cherry picked from commit a623f13adfac47c8634a7288e08f821a846bc650)
+---
+ NEWS         |  7 +++++++
+ nss/getent.c | 11 ++++++++++-
+ 2 files changed, 17 insertions(+), 1 deletion(-)
+
+diff --git a/NEWS b/NEWS
+index bea1d8a11f..462a12253d 100644
+--- a/NEWS
++++ b/NEWS
+@@ -7,6 +7,13 @@ using `glibc' in the "product" field.
+ \f
+ Version 2.36.1
+ 
++Major new features:
++
++* The getent tool now supports the --no-addrconfig option. The output of
++  getent with --no-addrconfig may contain addresses of families not
++  configured on the current host i.e. as-if you had not passed
++  AI_ADDRCONFIG to getaddrinfo calls.
++
+ Security related changes:
+ 
+   CVE-2022-39046: When the syslog function is passed a crafted input
+diff --git a/nss/getent.c b/nss/getent.c
+index 8178b4b470..d2d2524b0c 100644
+--- a/nss/getent.c
++++ b/nss/getent.c
+@@ -58,6 +58,8 @@ static const struct argp_option args_options[] =
+   {
+     { "service", 's', N_("CONFIG"), 0, N_("Service configuration to be used") },
+     { "no-idn", 'i', NULL, 0, N_("disable IDN encoding") },
++    { "no-addrconfig", 'A', NULL, 0,
++      N_("do not filter out unsupported IPv4/IPv6 addresses (with ahosts*)") },
+     { NULL, 0, NULL, 0, NULL },
+   };
+ 
+@@ -79,6 +81,9 @@ static struct argp argp =
+ /* Additional getaddrinfo flags for IDN encoding.  */
+ static int idn_flags = AI_IDN | AI_CANONIDN;
+ 
++/* Set to 0 by --no-addrconfig.  */
++static int addrconfig_flags = AI_ADDRCONFIG;
++
+ /* Print the version information.  */
+ static void
+ print_version (FILE *stream, struct argp_state *state)
+@@ -346,7 +351,7 @@ ahosts_keys_int (int af, int xflags, int number, char *key[])
+ 
+   struct addrinfo hint;
+   memset (&hint, '\0', sizeof (hint));
+-  hint.ai_flags = (AI_V4MAPPED | AI_ADDRCONFIG | AI_CANONNAME
++  hint.ai_flags = (AI_V4MAPPED | addrconfig_flags | AI_CANONNAME
+ 		   | idn_flags | xflags);
+   hint.ai_family = af;
+ 
+@@ -905,6 +910,10 @@ parse_option (int key, char *arg, struct argp_state *state)
+       idn_flags = 0;
+       break;
+ 
++    case 'A':
++      addrconfig_flags = 0;
++      break;
++
+     default:
+       return ARGP_ERR_UNKNOWN;
+     }
+-- 
+2.38.1
+
+
+From 2681d38cafaceafeb330bc0536fa710b75ed5947 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 13 Sep 2022 16:11:40 +0200
+Subject: [PATCH 60/72] nss: Fix tst-nss-files-hosts-long on single-stack hosts
+ (bug 24816)
+
+getent implicitly passes AI_ADDRCONFIG to getaddrinfo by default.
+Use --no-addrconfig to suppress that, so that both IPv4 and IPv6
+lookups succeed even if the address family is not supported by the
+host.
+
+Reviewed-by: Carlos O'Donell <carlos@redhat.com>
+(cherry picked from commit c75d20b5b27b0a60f0678236f51a4d3b0b058c00)
+---
+ NEWS                           | 1 +
+ nss/tst-nss-files-hosts-long.c | 9 +++++----
+ 2 files changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/NEWS b/NEWS
+index 462a12253d..de775ab116 100644
+--- a/NEWS
++++ b/NEWS
+@@ -24,6 +24,7 @@ Security related changes:
+ The following bugs are resolved with this release:
+ 
+   [12154] Do not fail DNS resolution for CNAMEs which are not host names
++  [24816] Fix tst-nss-files-hosts-long on single-stack hosts
+   [28846] CMSG_NXTHDR may trigger -Wstrict-overflow warning
+   [29305] Conserve NSS buffer space during DNS packet parsing
+   [29415] nscd: Fix netlink cache invalidation if epoll is used
+diff --git a/nss/tst-nss-files-hosts-long.c b/nss/tst-nss-files-hosts-long.c
+index 3942cf5fca..a7697e3143 100644
+--- a/nss/tst-nss-files-hosts-long.c
++++ b/nss/tst-nss-files-hosts-long.c
+@@ -28,14 +28,15 @@ do_test (void)
+ {
+   int ret;
+ 
+-  /* Run getent to fetch the IPv4 address for host test4.
+-     This forces /etc/hosts to be parsed.  */
+-  ret = system("getent ahostsv4 test4");
++  /* Run getent to fetch the IPv4 address for host test4.  This forces
++     /etc/hosts to be parsed.  Use --no-addrconfig to return addresses
++     even in an IPv6-only environment.  */
++  ret = system("getent --no-addrconfig ahostsv4 test4");
+   if (ret != 0)
+     FAIL_EXIT1("ahostsv4 failed");
+ 
+   /* Likewise for IPv6.  */
+-  ret = system("getent ahostsv6 test6");
++  ret = system("getent --no-addrconfig  ahostsv6 test6");
+   if (ret != 0)
+     FAIL_EXIT1("ahostsv6 failed");
+ 
+-- 
+2.38.1
+
+
+From 908454129d21126bf7fc58f2a520b1f304dc5f02 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Fri, 23 Sep 2022 19:30:57 +0200
+Subject: [PATCH 61/72] nss: Use shared prefix in IPv4 address in tst-reload1
+
+Otherwise, sorting based on the longest-matching prefix in
+getaddrinfo can reorder the addresses in ways the test does not
+expect, depending on the IPv4 address of the host.
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit c02e29a0ba47d636281e1a026444a1a0a254aa12)
+---
+ nss/tst-reload1.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/nss/tst-reload1.c b/nss/tst-reload1.c
+index fdc5bdd65b..bc32bb132a 100644
+--- a/nss/tst-reload1.c
++++ b/nss/tst-reload1.c
+@@ -43,12 +43,12 @@ static struct passwd pwd_table_1[] = {
+ 
+ static const char *hostaddr_5[] =
+   {
+-   "ABCD", "abcd", "1234", NULL
++   "ABCd", "ABCD", "ABC4", NULL
+   };
+ 
+ static const char *hostaddr_15[] =
+   {
+-   "4321", "ghij", NULL
++   "4321", "4322", NULL
+   };
+ 
+ static const char *hostaddr_25[] =
+@@ -86,12 +86,12 @@ static const char *hostaddr_6[] =
+ 
+ static const char *hostaddr_16[] =
+   {
+-   "7890", "a1b2", NULL
++   "7890", "7891", NULL
+   };
+ 
+ static const char *hostaddr_26[] =
+   {
+-   "qwer", "tyui", NULL
++   "qwer", "qweR", NULL
+   };
+ 
+ static struct hostent host_table_2[] = {
+-- 
+2.38.1
+
+
+From 19535f3b57306ea3ec559a6c0b10d2d7a87418a7 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Fri, 14 Oct 2022 11:02:25 +0200
+Subject: [PATCH 62/72] elf: Do not completely clear reused namespace in
+ dlmopen (bug 29600)
+
+The data in the _ns_debug member must be preserved, otherwise
+_dl_debug_initialize enters an infinite loop.  To be conservative,
+only clear the libc_map member for now, to fix bug 29528.
+
+Fixes commit d0e357ff45a75553dee3b17ed7d303bfa544f6fe
+("elf: Call __libc_early_init for reused namespaces (bug 29528)"),
+by reverting most of it.
+
+Reviewed-by: Carlos O'Donell <carlos@redhat.com>
+Tested-by: Carlos O'Donell <carlos@redhat.com>
+(cherry picked from commit 2c42257314536b94cc8d52edede86e94e98c1436)
+---
+ NEWS                    |  1 +
+ elf/dl-open.c           | 14 ++++++--------
+ elf/tst-dlmopen-twice.c | 28 ++++++++++++++++++++++++----
+ 3 files changed, 31 insertions(+), 12 deletions(-)
+
+diff --git a/NEWS b/NEWS
+index de775ab116..a6da588c85 100644
+--- a/NEWS
++++ b/NEWS
+@@ -37,6 +37,7 @@ The following bugs are resolved with this release:
+   [29537] libc: [2.34 regression]: Alignment issue on m68k when using
+   [29539] libc: LD_TRACE_LOADED_OBJECTS changed how vDSO library are
+   [29583] Use 64-bit interfaces in gconv_parseconfdir
++  [29600] Do not completely clear reused namespace in dlmopen
+   [29607] nscd repeatably crashes calling __strlen_avx2 when hosts cache is
+     enabled
+   [29638] libc: stdlib: arc4random fallback is never used
+diff --git a/elf/dl-open.c b/elf/dl-open.c
+index 46e8066fd8..e7db5e9642 100644
+--- a/elf/dl-open.c
++++ b/elf/dl-open.c
+@@ -844,15 +844,13 @@ _dl_open (const char *file, int mode, const void *caller_dlopen, Lmid_t nsid,
+ 	  _dl_signal_error (EINVAL, file, NULL, N_("\
+ no more namespaces available for dlmopen()"));
+ 	}
++      else if (nsid == GL(dl_nns))
++	{
++	  __rtld_lock_initialize (GL(dl_ns)[nsid]._ns_unique_sym_table.lock);
++	  ++GL(dl_nns);
++	}
+ 
+-      if (nsid == GL(dl_nns))
+-	++GL(dl_nns);
+-
+-      /* Initialize the new namespace.  Most members are
+-	 zero-initialized, only the lock needs special treatment.  */
+-      memset (&GL(dl_ns)[nsid], 0, sizeof (GL(dl_ns)[nsid]));
+-      __rtld_lock_initialize (GL(dl_ns)[nsid]._ns_unique_sym_table.lock);
+-
++      GL(dl_ns)[nsid].libc_map = NULL;
+       _dl_debug_update (nsid)->r_state = RT_CONSISTENT;
+     }
+   /* Never allow loading a DSO in a namespace which is empty.  Such
+diff --git a/elf/tst-dlmopen-twice.c b/elf/tst-dlmopen-twice.c
+index 449f3c8fa9..70c71fe19c 100644
+--- a/elf/tst-dlmopen-twice.c
++++ b/elf/tst-dlmopen-twice.c
+@@ -16,18 +16,38 @@
+    License along with the GNU C Library; if not, see
+    <https://www.gnu.org/licenses/>.  */
+ 
+-#include <support/xdlfcn.h>
++#include <stdio.h>
+ #include <support/check.h>
++#include <support/xdlfcn.h>
+ 
+-static int
+-do_test (void)
++/* Run the test multiple times, to check finding a new namespace while
++   another namespace is already in use.  This used to trigger bug 29600.  */
++static void
++recurse (int depth)
+ {
+-  void *handle = xdlmopen (LM_ID_NEWLM, "tst-dlmopen-twice-mod1.so", RTLD_NOW);
++  if (depth == 0)
++    return;
++
++  printf ("info: running at depth %d\n", depth);
++  void *handle = xdlmopen (LM_ID_NEWLM, "tst-dlmopen-twice-mod1.so",
++                           RTLD_NOW);
+   xdlclose (handle);
+   handle = xdlmopen (LM_ID_NEWLM, "tst-dlmopen-twice-mod2.so", RTLD_NOW);
+   int (*run_check) (void) = xdlsym (handle, "run_check");
+   TEST_COMPARE (run_check (), 0);
++  recurse (depth - 1);
+   xdlclose (handle);
++}
++
++static int
++do_test (void)
++{
++  /* First run the test without nesting.  */
++  recurse (1);
++
++  /* Then with nesting.  The constant needs to be less than the
++     internal DL_NNS namespace constant.  */
++  recurse (10);
+   return 0;
+ }
+ 
+-- 
+2.38.1
+
+
+From b357157361117182c7a68c90fda7ba431b64442c Mon Sep 17 00:00:00 2001
+From: Michael Hudson-Doyle <michael.hudson@canonical.com>
+Date: Mon, 22 Aug 2022 14:05:04 +1200
+Subject: [PATCH 63/72] Fix BZ #29463 in the ibm128 implementation of y1l too
+
+Avoid moving code across SET_RESTORE_ROUNDL in order to fix
+[BZ #29463].
+
+Tested-by: Aurelien Jarno <aurelien@aurel32.net>
+Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
+Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
+(cherry picked from commit b6e37b7805b0182c3e25cdab39ebf5f001c04d05)
+---
+ sysdeps/ieee754/ldbl-128ibm/e_j1l.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/sysdeps/ieee754/ldbl-128ibm/e_j1l.c b/sysdeps/ieee754/ldbl-128ibm/e_j1l.c
+index f85ba94466..0a5fe68342 100644
+--- a/sysdeps/ieee754/ldbl-128ibm/e_j1l.c
++++ b/sysdeps/ieee754/ldbl-128ibm/e_j1l.c
+@@ -792,10 +792,13 @@ __ieee754_y1l (long double x)
+     {
+       /* 0 <= x <= 2 */
+       SET_RESTORE_ROUNDL (FE_TONEAREST);
++      xx = math_opt_barrier (xx);
++      x = math_opt_barrier (x);
+       z = xx * xx;
+       p = xx * neval (z, Y0_2N, NY0_2N) / deval (z, Y0_2D, NY0_2D);
+       p = -TWOOPI / xx + p;
+       p = TWOOPI * __ieee754_logl (x) * __ieee754_j1l (x) + p;
++      math_force_eval (p);
+       return p;
+     }
+ 
+-- 
+2.38.1
+
+
+From 9273b2d0e93e7355656cad3be3a1ca76489df483 Mon Sep 17 00:00:00 2001
+From: Aurelien Jarno <aurelien@aurel32.net>
+Date: Mon, 10 Oct 2022 00:39:33 +0200
+Subject: [PATCH 64/72] Avoid undefined behaviour in ibm128 implementation of
+ llroundl (BZ #29488)
+
+Detecting an overflow edge case depended on signed overflow of a long
+long. Replace the additions and the overflow checks by
+__builtin_add_overflow().
+
+Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
+(cherry picked from commit 2b5478569e72ee4820a6e163d306690c9c0eaf5e)
+---
+ NEWS                                     |  2 ++
+ sysdeps/ieee754/ldbl-128ibm/s_llroundl.c | 21 +++++++++------------
+ 2 files changed, 11 insertions(+), 12 deletions(-)
+
+diff --git a/NEWS b/NEWS
+index a6da588c85..8c60d3dc8d 100644
+--- a/NEWS
++++ b/NEWS
+@@ -33,6 +33,8 @@ The following bugs are resolved with this release:
+   [29485] Linux: Terminate subprocess on late failure in tst-pidfd
+   [29490] alpha: New __brk_call implementation is broken
+   [29463] math/test-float128-y1 fails on x86_64
++  [29488] test-ibm128-llround fails on ppc64el when built with gcc-12 and -O2
++    or higher
+   [29528] elf: Call __libc_early_init for reused namespaces
+   [29537] libc: [2.34 regression]: Alignment issue on m68k when using
+   [29539] libc: LD_TRACE_LOADED_OBJECTS changed how vDSO library are
+diff --git a/sysdeps/ieee754/ldbl-128ibm/s_llroundl.c b/sysdeps/ieee754/ldbl-128ibm/s_llroundl.c
+index d85154e73a..d8c0de1faf 100644
+--- a/sysdeps/ieee754/ldbl-128ibm/s_llroundl.c
++++ b/sysdeps/ieee754/ldbl-128ibm/s_llroundl.c
+@@ -66,38 +66,35 @@ __llroundl (long double x)
+       /* Peg at max/min values, assuming that the above conversions do so.
+          Strictly speaking, we can return anything for values that overflow,
+          but this is more useful.  */
+-      res = hi + lo;
+-
+-      /* This is just sign(hi) == sign(lo) && sign(res) != sign(hi).  */
+-      if (__glibc_unlikely (((~(hi ^ lo) & (res ^ hi)) < 0)))
++      if (__glibc_unlikely (__builtin_add_overflow (hi, lo, &res)))
+ 	goto overflow;
+ 
+       xh -= lo;
+       ldbl_canonicalize (&xh, &xl);
+ 
+-      hi = res;
+       if (xh > 0.5)
+ 	{
+-	  res += 1;
++	  if (__glibc_unlikely (__builtin_add_overflow (res, 1, &res)))
++	    goto overflow;
+ 	}
+       else if (xh == 0.5)
+ 	{
+ 	  if (xl > 0.0 || (xl == 0.0 && res >= 0))
+-	    res += 1;
++	    if (__glibc_unlikely (__builtin_add_overflow (res, 1, &res)))
++	      goto overflow;
+ 	}
+       else if (-xh > 0.5)
+ 	{
+-	  res -= 1;
++	  if (__glibc_unlikely (__builtin_add_overflow (res, -1, &res)))
++	    goto overflow;
+ 	}
+       else if (-xh == 0.5)
+ 	{
+ 	  if (xl < 0.0 || (xl == 0.0 && res <= 0))
+-	    res -= 1;
++	    if (__glibc_unlikely (__builtin_add_overflow (res, -1, &res)))
++	      goto overflow;
+ 	}
+ 
+-      if (__glibc_unlikely (((~(hi ^ (res - hi)) & (res ^ hi)) < 0)))
+-	goto overflow;
+-
+       return res;
+     }
+   else
+-- 
+2.38.1
+
+
+From 7b7dfbb0cbdffebf0233c650627a4861212fbb60 Mon Sep 17 00:00:00 2001
+From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Wed, 19 Oct 2022 19:14:04 -0300
+Subject: [PATCH 65/72] linux: Fix generic struct_stat for 64 bit time (BZ#
+ 29657)
+
+The generic Linux struct_stat misses the conditionals to use
+bits/struct_stat_time64_helper.h in the __USE_TIME_BITS64 for
+architecture that uses __TIMESIZE == 32 (currently csky and nios2).
+
+Since newer ports should not support 32 bit time_t, the generic
+implementation should be used as default.
+
+For arm, hppa, and sh a copy of default struct_stat is added,
+while for csky and nios a new one based on generic is used, along
+with conditionals to use bits/struct_stat_time64_helper.h.
+
+The default struct_stat is also replaced with the generic one.
+
+Checked on aarch64-linux-gnu and arm-linux-gnueabihf.
+
+(cherry picked from commit 7a6ca82f8007ddbd43e2b8fce806ba7101ee47f5)
+---
+ NEWS                                          |   2 +
+ .../unix/sysv/linux/arm/bits/struct_stat.h    | 139 ++++++++++++++++++
+ sysdeps/unix/sysv/linux/bits/struct_stat.h    | 116 +++++++--------
+ .../{generic => csky}/bits/struct_stat.h      |  28 ++--
+ .../unix/sysv/linux/hppa/bits/struct_stat.h   | 139 ++++++++++++++++++
+ .../unix/sysv/linux/nios2/bits/struct_stat.h  | 135 +++++++++++++++++
+ sysdeps/unix/sysv/linux/sh/bits/struct_stat.h | 139 ++++++++++++++++++
+ 7 files changed, 624 insertions(+), 74 deletions(-)
+ create mode 100644 sysdeps/unix/sysv/linux/arm/bits/struct_stat.h
+ rename sysdeps/unix/sysv/linux/{generic => csky}/bits/struct_stat.h (92%)
+ create mode 100644 sysdeps/unix/sysv/linux/hppa/bits/struct_stat.h
+ create mode 100644 sysdeps/unix/sysv/linux/nios2/bits/struct_stat.h
+ create mode 100644 sysdeps/unix/sysv/linux/sh/bits/struct_stat.h
+
+diff --git a/NEWS b/NEWS
+index 8c60d3dc8d..833045585f 100644
+--- a/NEWS
++++ b/NEWS
+@@ -43,6 +43,8 @@ The following bugs are resolved with this release:
+   [29607] nscd repeatably crashes calling __strlen_avx2 when hosts cache is
+     enabled
+   [29638] libc: stdlib: arc4random fallback is never used
++  [29657] libc: Incorrect struct stat for 64-bit time on linux/generic
++    platforms
+ \f
+ Version 2.36
+ 
+diff --git a/sysdeps/unix/sysv/linux/arm/bits/struct_stat.h b/sysdeps/unix/sysv/linux/arm/bits/struct_stat.h
+new file mode 100644
+index 0000000000..30ee6279d2
+--- /dev/null
++++ b/sysdeps/unix/sysv/linux/arm/bits/struct_stat.h
+@@ -0,0 +1,139 @@
++/* Definition for struct stat.  Linux/arm version.
++   Copyright (C) 2020-2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library.  If not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#if !defined _SYS_STAT_H && !defined _FCNTL_H
++# error "Never include <bits/struct_stat.h> directly; use <sys/stat.h> instead."
++#endif
++
++#ifndef _BITS_STRUCT_STAT_H
++#define _BITS_STRUCT_STAT_H	1
++
++#include <bits/endian.h>
++#include <bits/wordsize.h>
++
++struct stat
++  {
++#ifdef __USE_TIME_BITS64
++# include <bits/struct_stat_time64_helper.h>
++#else
++    __dev_t st_dev;			/* Device.  */
++    unsigned short int __pad1;
++# ifndef __USE_FILE_OFFSET64
++    __ino_t st_ino;			/* File serial number.	*/
++# else
++    __ino_t __st_ino;			/* 32bit file serial number.	*/
++# endif
++    __mode_t st_mode;			/* File mode.  */
++    __nlink_t st_nlink;			/* Link count.  */
++    __uid_t st_uid;			/* User ID of the file's owner.	*/
++    __gid_t st_gid;			/* Group ID of the file's group.*/
++    __dev_t st_rdev;			/* Device number, if device.  */
++    unsigned short int __pad2;
++# ifndef __USE_FILE_OFFSET64
++    __off_t st_size;			/* Size of file, in bytes.  */
++# else
++    __off64_t st_size;			/* Size of file, in bytes.  */
++# endif
++    __blksize_t st_blksize;		/* Optimal block size for I/O.  */
++
++# ifndef __USE_FILE_OFFSET64
++    __blkcnt_t st_blocks;		/* Number 512-byte blocks allocated. */
++# else
++    __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
++# endif
++# ifdef __USE_XOPEN2K8
++    /* Nanosecond resolution timestamps are stored in a format
++       equivalent to 'struct timespec'.  This is the type used
++       whenever possible but the Unix namespace rules do not allow the
++       identifier 'timespec' to appear in the <sys/stat.h> header.
++       Therefore we have to handle the use of this header in strictly
++       standard-compliant sources special.  */
++    struct timespec st_atim;		/* Time of last access.  */
++    struct timespec st_mtim;		/* Time of last modification.  */
++    struct timespec st_ctim;		/* Time of last status change.  */
++#  define st_atime st_atim.tv_sec	/* Backward compatibility.  */
++#  define st_mtime st_mtim.tv_sec
++#  define st_ctime st_ctim.tv_sec
++# else
++    __time_t st_atime;			/* Time of last access.  */
++    unsigned long int st_atimensec;	/* Nscecs of last access.  */
++    __time_t st_mtime;			/* Time of last modification.  */
++    unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
++    __time_t st_ctime;			/* Time of last status change.  */
++    unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
++# endif
++# ifndef __USE_FILE_OFFSET64
++    unsigned long int __glibc_reserved4;
++    unsigned long int __glibc_reserved5;
++# else
++    __ino64_t st_ino;			/* File serial number.	*/
++# endif
++#endif /* __USE_TIME_BITS64  */
++  };
++
++#ifdef __USE_LARGEFILE64
++struct stat64
++  {
++# ifdef __USE_TIME_BITS64
++#  include <bits/struct_stat_time64_helper.h>
++# else
++    __dev_t st_dev;			/* Device.  */
++    unsigned int __pad1;
++
++    __ino_t __st_ino;			/* 32bit file serial number.	*/
++    __mode_t st_mode;			/* File mode.  */
++    __nlink_t st_nlink;			/* Link count.  */
++    __uid_t st_uid;			/* User ID of the file's owner.	*/
++    __gid_t st_gid;			/* Group ID of the file's group.*/
++    __dev_t st_rdev;			/* Device number, if device.  */
++    unsigned int __pad2;
++    __off64_t st_size;			/* Size of file, in bytes.  */
++    __blksize_t st_blksize;		/* Optimal block size for I/O.  */
++
++    __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
++#  ifdef __USE_XOPEN2K8
++    /* Nanosecond resolution timestamps are stored in a format
++       equivalent to 'struct timespec'.  This is the type used
++       whenever possible but the Unix namespace rules do not allow the
++       identifier 'timespec' to appear in the <sys/stat.h> header.
++       Therefore we have to handle the use of this header in strictly
++       standard-compliant sources special.  */
++    struct timespec st_atim;		/* Time of last access.  */
++    struct timespec st_mtim;		/* Time of last modification.  */
++    struct timespec st_ctim;		/* Time of last status change.  */
++#  else
++    __time_t st_atime;			/* Time of last access.  */
++    unsigned long int st_atimensec;	/* Nscecs of last access.  */
++    __time_t st_mtime;			/* Time of last modification.  */
++    unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
++    __time_t st_ctime;			/* Time of last status change.  */
++    unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
++#  endif
++    __ino64_t st_ino;			/* File serial number.		*/
++# endif /* __USE_TIME_BITS64  */
++  };
++#endif
++
++/* Tell code we have these members.  */
++#define	_STATBUF_ST_BLKSIZE
++#define _STATBUF_ST_RDEV
++/* Nanosecond resolution time values are supported.  */
++#define _STATBUF_ST_NSEC
++
++
++#endif /* _BITS_STRUCT_STAT_H  */
+diff --git a/sysdeps/unix/sysv/linux/bits/struct_stat.h b/sysdeps/unix/sysv/linux/bits/struct_stat.h
+index 25bd6cb638..fb11a3fba4 100644
+--- a/sysdeps/unix/sysv/linux/bits/struct_stat.h
++++ b/sysdeps/unix/sysv/linux/bits/struct_stat.h
+@@ -26,37 +26,36 @@
+ #include <bits/endian.h>
+ #include <bits/wordsize.h>
+ 
+-struct stat
+-  {
+-#ifdef __USE_TIME_BITS64
+-# include <bits/struct_stat_time64_helper.h>
+-#else
+-    __dev_t st_dev;			/* Device.  */
+-    unsigned short int __pad1;
+-# ifndef __USE_FILE_OFFSET64
+-    __ino_t st_ino;			/* File serial number.	*/
+-# else
+-    __ino_t __st_ino;			/* 32bit file serial number.	*/
++#if defined __USE_FILE_OFFSET64
++# define __field64(type, type64, name) type64 name
++#elif __WORDSIZE == 64 || defined __INO_T_MATCHES_INO64_T
++# if defined __INO_T_MATCHES_INO64_T && !defined __OFF_T_MATCHES_OFF64_T
++#  error "ino_t and off_t must both be the same type"
+ # endif
+-    __mode_t st_mode;			/* File mode.  */
+-    __nlink_t st_nlink;			/* Link count.  */
+-    __uid_t st_uid;			/* User ID of the file's owner.	*/
+-    __gid_t st_gid;			/* Group ID of the file's group.*/
+-    __dev_t st_rdev;			/* Device number, if device.  */
+-    unsigned short int __pad2;
+-# ifndef __USE_FILE_OFFSET64
+-    __off_t st_size;			/* Size of file, in bytes.  */
+-# else
+-    __off64_t st_size;			/* Size of file, in bytes.  */
+-# endif
+-    __blksize_t st_blksize;		/* Optimal block size for I/O.  */
++# define __field64(type, type64, name) type name
++#elif __BYTE_ORDER == __LITTLE_ENDIAN
++# define __field64(type, type64, name) \
++  type name __attribute__((__aligned__ (__alignof__ (type64)))); int __##name##_pad
++#else
++# define __field64(type, type64, name) \
++  int __##name##_pad __attribute__((__aligned__ (__alignof__ (type64)))); type name
++#endif
+ 
+-# ifndef __USE_FILE_OFFSET64
+-    __blkcnt_t st_blocks;		/* Number 512-byte blocks allocated. */
+-# else
+-    __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
+-# endif
+-# ifdef __USE_XOPEN2K8
++struct stat
++  {
++    __dev_t st_dev;		/* Device.  */
++    __field64(__ino_t, __ino64_t, st_ino);  /* File serial number. */
++    __mode_t st_mode;		/* File mode.  */
++    __nlink_t st_nlink;		/* Link count.  */
++    __uid_t st_uid;		/* User ID of the file's owner.	*/
++    __gid_t st_gid;		/* Group ID of the file's group.*/
++    __dev_t st_rdev;		/* Device number, if device.  */
++    __dev_t __pad1;
++    __field64(__off_t, __off64_t, st_size);  /* Size of file, in bytes. */
++    __blksize_t st_blksize;	/* Optimal block size for I/O.  */
++    int __pad2;
++    __field64(__blkcnt_t, __blkcnt64_t, st_blocks);  /* 512-byte blocks */
++#ifdef __USE_XOPEN2K8
+     /* Nanosecond resolution timestamps are stored in a format
+        equivalent to 'struct timespec'.  This is the type used
+        whenever possible but the Unix namespace rules do not allow the
+@@ -66,47 +65,38 @@ struct stat
+     struct timespec st_atim;		/* Time of last access.  */
+     struct timespec st_mtim;		/* Time of last modification.  */
+     struct timespec st_ctim;		/* Time of last status change.  */
+-#  define st_atime st_atim.tv_sec	/* Backward compatibility.  */
+-#  define st_mtime st_mtim.tv_sec
+-#  define st_ctime st_ctim.tv_sec
+-# else
++# define st_atime st_atim.tv_sec	/* Backward compatibility.  */
++# define st_mtime st_mtim.tv_sec
++# define st_ctime st_ctim.tv_sec
++#else
+     __time_t st_atime;			/* Time of last access.  */
+     unsigned long int st_atimensec;	/* Nscecs of last access.  */
+     __time_t st_mtime;			/* Time of last modification.  */
+     unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
+     __time_t st_ctime;			/* Time of last status change.  */
+     unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
+-# endif
+-# ifndef __USE_FILE_OFFSET64
+-    unsigned long int __glibc_reserved4;
+-    unsigned long int __glibc_reserved5;
+-# else
+-    __ino64_t st_ino;			/* File serial number.	*/
+-# endif
+-#endif /* __USE_TIME_BITS64  */
++#endif
++    int __glibc_reserved[2];
+   };
+ 
++#undef __field64
++
+ #ifdef __USE_LARGEFILE64
+ struct stat64
+   {
+-# ifdef __USE_TIME_BITS64
+-#  include <bits/struct_stat_time64_helper.h>
+-# else
+-    __dev_t st_dev;			/* Device.  */
+-    unsigned int __pad1;
+-
+-    __ino_t __st_ino;			/* 32bit file serial number.	*/
+-    __mode_t st_mode;			/* File mode.  */
+-    __nlink_t st_nlink;			/* Link count.  */
+-    __uid_t st_uid;			/* User ID of the file's owner.	*/
+-    __gid_t st_gid;			/* Group ID of the file's group.*/
+-    __dev_t st_rdev;			/* Device number, if device.  */
+-    unsigned int __pad2;
+-    __off64_t st_size;			/* Size of file, in bytes.  */
+-    __blksize_t st_blksize;		/* Optimal block size for I/O.  */
+-
+-    __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
+-#  ifdef __USE_XOPEN2K8
++    __dev_t st_dev;		/* Device.  */
++    __ino64_t st_ino;		/* File serial number.	*/
++    __mode_t st_mode;		/* File mode.  */
++    __nlink_t st_nlink;		/* Link count.  */
++    __uid_t st_uid;		/* User ID of the file's owner.	*/
++    __gid_t st_gid;		/* Group ID of the file's group.*/
++    __dev_t st_rdev;		/* Device number, if device.  */
++    __dev_t __pad1;
++    __off64_t st_size;		/* Size of file, in bytes.  */
++    __blksize_t st_blksize;	/* Optimal block size for I/O.  */
++    int __pad2;
++    __blkcnt64_t st_blocks;	/* Nr. 512-byte blocks allocated.  */
++#ifdef __USE_XOPEN2K8
+     /* Nanosecond resolution timestamps are stored in a format
+        equivalent to 'struct timespec'.  This is the type used
+        whenever possible but the Unix namespace rules do not allow the
+@@ -116,16 +106,15 @@ struct stat64
+     struct timespec st_atim;		/* Time of last access.  */
+     struct timespec st_mtim;		/* Time of last modification.  */
+     struct timespec st_ctim;		/* Time of last status change.  */
+-#  else
++#else
+     __time_t st_atime;			/* Time of last access.  */
+     unsigned long int st_atimensec;	/* Nscecs of last access.  */
+     __time_t st_mtime;			/* Time of last modification.  */
+     unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
+     __time_t st_ctime;			/* Time of last status change.  */
+     unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
+-#  endif
+-    __ino64_t st_ino;			/* File serial number.		*/
+-# endif /* __USE_TIME_BITS64  */
++#endif
++    int __glibc_reserved[2];
+   };
+ #endif
+ 
+@@ -135,5 +124,4 @@ struct stat64
+ /* Nanosecond resolution time values are supported.  */
+ #define _STATBUF_ST_NSEC
+ 
+-
+ #endif /* _BITS_STRUCT_STAT_H  */
+diff --git a/sysdeps/unix/sysv/linux/generic/bits/struct_stat.h b/sysdeps/unix/sysv/linux/csky/bits/struct_stat.h
+similarity index 92%
+rename from sysdeps/unix/sysv/linux/generic/bits/struct_stat.h
+rename to sysdeps/unix/sysv/linux/csky/bits/struct_stat.h
+index fb11a3fba4..f0ee455748 100644
+--- a/sysdeps/unix/sysv/linux/generic/bits/struct_stat.h
++++ b/sysdeps/unix/sysv/linux/csky/bits/struct_stat.h
+@@ -1,4 +1,4 @@
+-/* Definition for struct stat.
++/* Definition for struct stat.  Linux/csky version.
+    Copyright (C) 2020-2022 Free Software Foundation, Inc.
+    This file is part of the GNU C Library.
+ 
+@@ -43,6 +43,9 @@
+ 
+ struct stat
+   {
++#ifdef __USE_TIME_BITS64
++# include <bits/struct_stat_time64_helper.h>
++#else
+     __dev_t st_dev;		/* Device.  */
+     __field64(__ino_t, __ino64_t, st_ino);  /* File serial number. */
+     __mode_t st_mode;		/* File mode.  */
+@@ -55,7 +58,7 @@ struct stat
+     __blksize_t st_blksize;	/* Optimal block size for I/O.  */
+     int __pad2;
+     __field64(__blkcnt_t, __blkcnt64_t, st_blocks);  /* 512-byte blocks */
+-#ifdef __USE_XOPEN2K8
++# ifdef __USE_XOPEN2K8
+     /* Nanosecond resolution timestamps are stored in a format
+        equivalent to 'struct timespec'.  This is the type used
+        whenever possible but the Unix namespace rules do not allow the
+@@ -65,18 +68,19 @@ struct stat
+     struct timespec st_atim;		/* Time of last access.  */
+     struct timespec st_mtim;		/* Time of last modification.  */
+     struct timespec st_ctim;		/* Time of last status change.  */
+-# define st_atime st_atim.tv_sec	/* Backward compatibility.  */
+-# define st_mtime st_mtim.tv_sec
+-# define st_ctime st_ctim.tv_sec
+-#else
++#  define st_atime st_atim.tv_sec	/* Backward compatibility.  */
++#  define st_mtime st_mtim.tv_sec
++#  define st_ctime st_ctim.tv_sec
++# else
+     __time_t st_atime;			/* Time of last access.  */
+     unsigned long int st_atimensec;	/* Nscecs of last access.  */
+     __time_t st_mtime;			/* Time of last modification.  */
+     unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
+     __time_t st_ctime;			/* Time of last status change.  */
+     unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
+-#endif
++# endif
+     int __glibc_reserved[2];
++#endif
+   };
+ 
+ #undef __field64
+@@ -84,6 +88,9 @@ struct stat
+ #ifdef __USE_LARGEFILE64
+ struct stat64
+   {
++# ifdef __USE_TIME_BITS64
++#  include <bits/struct_stat_time64_helper.h>
++# else
+     __dev_t st_dev;		/* Device.  */
+     __ino64_t st_ino;		/* File serial number.	*/
+     __mode_t st_mode;		/* File mode.  */
+@@ -96,7 +103,7 @@ struct stat64
+     __blksize_t st_blksize;	/* Optimal block size for I/O.  */
+     int __pad2;
+     __blkcnt64_t st_blocks;	/* Nr. 512-byte blocks allocated.  */
+-#ifdef __USE_XOPEN2K8
++#  ifdef __USE_XOPEN2K8
+     /* Nanosecond resolution timestamps are stored in a format
+        equivalent to 'struct timespec'.  This is the type used
+        whenever possible but the Unix namespace rules do not allow the
+@@ -106,15 +113,16 @@ struct stat64
+     struct timespec st_atim;		/* Time of last access.  */
+     struct timespec st_mtim;		/* Time of last modification.  */
+     struct timespec st_ctim;		/* Time of last status change.  */
+-#else
++#  else
+     __time_t st_atime;			/* Time of last access.  */
+     unsigned long int st_atimensec;	/* Nscecs of last access.  */
+     __time_t st_mtime;			/* Time of last modification.  */
+     unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
+     __time_t st_ctime;			/* Time of last status change.  */
+     unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
+-#endif
++#  endif
+     int __glibc_reserved[2];
++# endif
+   };
+ #endif
+ 
+diff --git a/sysdeps/unix/sysv/linux/hppa/bits/struct_stat.h b/sysdeps/unix/sysv/linux/hppa/bits/struct_stat.h
+new file mode 100644
+index 0000000000..38b6e13e68
+--- /dev/null
++++ b/sysdeps/unix/sysv/linux/hppa/bits/struct_stat.h
+@@ -0,0 +1,139 @@
++/* Definition for struct stat.  Linux/hppa version.
++   Copyright (C) 2020-2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library.  If not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#if !defined _SYS_STAT_H && !defined _FCNTL_H
++# error "Never include <bits/struct_stat.h> directly; use <sys/stat.h> instead."
++#endif
++
++#ifndef _BITS_STRUCT_STAT_H
++#define _BITS_STRUCT_STAT_H	1
++
++#include <bits/endian.h>
++#include <bits/wordsize.h>
++
++struct stat
++  {
++#ifdef __USE_TIME_BITS64
++# include <bits/struct_stat_time64_helper.h>
++#else
++    __dev_t st_dev;			/* Device.  */
++    unsigned short int __pad1;
++# ifndef __USE_FILE_OFFSET64
++    __ino_t st_ino;			/* File serial number.	*/
++# else
++    __ino_t __st_ino;			/* 32bit file serial number.	*/
++# endif
++    __mode_t st_mode;			/* File mode.  */
++    __nlink_t st_nlink;			/* Link count.  */
++    __uid_t st_uid;			/* User ID of the file's owner.	*/
++    __gid_t st_gid;			/* Group ID of the file's group.*/
++    __dev_t st_rdev;			/* Device number, if device.  */
++    unsigned short int __pad2;
++# ifndef __USE_FILE_OFFSET64
++    __off_t st_size;			/* Size of file, in bytes.  */
++# else
++    __off64_t st_size;			/* Size of file, in bytes.  */
++# endif
++    __blksize_t st_blksize;		/* Optimal block size for I/O.  */
++
++# ifndef __USE_FILE_OFFSET64
++    __blkcnt_t st_blocks;		/* Number 512-byte blocks allocated. */
++# else
++    __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
++# endif
++# ifdef __USE_XOPEN2K8
++    /* Nanosecond resolution timestamps are stored in a format
++       equivalent to 'struct timespec'.  This is the type used
++       whenever possible but the Unix namespace rules do not allow the
++       identifier 'timespec' to appear in the <sys/stat.h> header.
++       Therefore we have to handle the use of this header in strictly
++       standard-compliant sources special.  */
++    struct timespec st_atim;		/* Time of last access.  */
++    struct timespec st_mtim;		/* Time of last modification.  */
++    struct timespec st_ctim;		/* Time of last status change.  */
++#  define st_atime st_atim.tv_sec	/* Backward compatibility.  */
++#  define st_mtime st_mtim.tv_sec
++#  define st_ctime st_ctim.tv_sec
++# else
++    __time_t st_atime;			/* Time of last access.  */
++    unsigned long int st_atimensec;	/* Nscecs of last access.  */
++    __time_t st_mtime;			/* Time of last modification.  */
++    unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
++    __time_t st_ctime;			/* Time of last status change.  */
++    unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
++# endif
++# ifndef __USE_FILE_OFFSET64
++    unsigned long int __glibc_reserved4;
++    unsigned long int __glibc_reserved5;
++# else
++    __ino64_t st_ino;			/* File serial number.	*/
++# endif
++#endif /* __USE_TIME_BITS64  */
++  };
++
++#ifdef __USE_LARGEFILE64
++struct stat64
++  {
++# ifdef __USE_TIME_BITS64
++#  include <bits/struct_stat_time64_helper.h>
++# else
++    __dev_t st_dev;			/* Device.  */
++    unsigned int __pad1;
++
++    __ino_t __st_ino;			/* 32bit file serial number.	*/
++    __mode_t st_mode;			/* File mode.  */
++    __nlink_t st_nlink;			/* Link count.  */
++    __uid_t st_uid;			/* User ID of the file's owner.	*/
++    __gid_t st_gid;			/* Group ID of the file's group.*/
++    __dev_t st_rdev;			/* Device number, if device.  */
++    unsigned int __pad2;
++    __off64_t st_size;			/* Size of file, in bytes.  */
++    __blksize_t st_blksize;		/* Optimal block size for I/O.  */
++
++    __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
++#  ifdef __USE_XOPEN2K8
++    /* Nanosecond resolution timestamps are stored in a format
++       equivalent to 'struct timespec'.  This is the type used
++       whenever possible but the Unix namespace rules do not allow the
++       identifier 'timespec' to appear in the <sys/stat.h> header.
++       Therefore we have to handle the use of this header in strictly
++       standard-compliant sources special.  */
++    struct timespec st_atim;		/* Time of last access.  */
++    struct timespec st_mtim;		/* Time of last modification.  */
++    struct timespec st_ctim;		/* Time of last status change.  */
++#  else
++    __time_t st_atime;			/* Time of last access.  */
++    unsigned long int st_atimensec;	/* Nscecs of last access.  */
++    __time_t st_mtime;			/* Time of last modification.  */
++    unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
++    __time_t st_ctime;			/* Time of last status change.  */
++    unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
++#  endif
++    __ino64_t st_ino;			/* File serial number.		*/
++# endif /* __USE_TIME_BITS64  */
++  };
++#endif
++
++/* Tell code we have these members.  */
++#define	_STATBUF_ST_BLKSIZE
++#define _STATBUF_ST_RDEV
++/* Nanosecond resolution time values are supported.  */
++#define _STATBUF_ST_NSEC
++
++
++#endif /* _BITS_STRUCT_STAT_H  */
+diff --git a/sysdeps/unix/sysv/linux/nios2/bits/struct_stat.h b/sysdeps/unix/sysv/linux/nios2/bits/struct_stat.h
+new file mode 100644
+index 0000000000..e00e71173e
+--- /dev/null
++++ b/sysdeps/unix/sysv/linux/nios2/bits/struct_stat.h
+@@ -0,0 +1,135 @@
++/* Definition for struct stat.  Linux/nios2 version.
++   Copyright (C) 2020-2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library.  If not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#if !defined _SYS_STAT_H && !defined _FCNTL_H
++# error "Never include <bits/struct_stat.h> directly; use <sys/stat.h> instead."
++#endif
++
++#ifndef _BITS_STRUCT_STAT_H
++#define _BITS_STRUCT_STAT_H	1
++
++#include <bits/endian.h>
++#include <bits/wordsize.h>
++
++#if defined __USE_FILE_OFFSET64
++# define __field64(type, type64, name) type64 name
++#elif __WORDSIZE == 64 || defined __INO_T_MATCHES_INO64_T
++# if defined __INO_T_MATCHES_INO64_T && !defined __OFF_T_MATCHES_OFF64_T
++#  error "ino_t and off_t must both be the same type"
++# endif
++# define __field64(type, type64, name) type name
++#elif __BYTE_ORDER == __LITTLE_ENDIAN
++# define __field64(type, type64, name) \
++  type name __attribute__((__aligned__ (__alignof__ (type64)))); int __##name##_pad
++#else
++# define __field64(type, type64, name) \
++  int __##name##_pad __attribute__((__aligned__ (__alignof__ (type64)))); type name
++#endif
++
++struct stat
++  {
++#ifdef __USE_TIME_BITS64
++# include <bits/struct_stat_time64_helper.h>
++#else
++    __dev_t st_dev;		/* Device.  */
++    __field64(__ino_t, __ino64_t, st_ino);  /* File serial number. */
++    __mode_t st_mode;		/* File mode.  */
++    __nlink_t st_nlink;		/* Link count.  */
++    __uid_t st_uid;		/* User ID of the file's owner.	*/
++    __gid_t st_gid;		/* Group ID of the file's group.*/
++    __dev_t st_rdev;		/* Device number, if device.  */
++    __dev_t __pad1;
++    __field64(__off_t, __off64_t, st_size);  /* Size of file, in bytes. */
++    __blksize_t st_blksize;	/* Optimal block size for I/O.  */
++    int __pad2;
++    __field64(__blkcnt_t, __blkcnt64_t, st_blocks);  /* 512-byte blocks */
++# ifdef __USE_XOPEN2K8
++    /* Nanosecond resolution timestamps are stored in a format
++       equivalent to 'struct timespec'.  This is the type used
++       whenever possible but the Unix namespace rules do not allow the
++       identifier 'timespec' to appear in the <sys/stat.h> header.
++       Therefore we have to handle the use of this header in strictly
++       standard-compliant sources special.  */
++    struct timespec st_atim;		/* Time of last access.  */
++    struct timespec st_mtim;		/* Time of last modification.  */
++    struct timespec st_ctim;		/* Time of last status change.  */
++#  define st_atime st_atim.tv_sec	/* Backward compatibility.  */
++#  define st_mtime st_mtim.tv_sec
++#  define st_ctime st_ctim.tv_sec
++# else
++    __time_t st_atime;			/* Time of last access.  */
++    unsigned long int st_atimensec;	/* Nscecs of last access.  */
++    __time_t st_mtime;			/* Time of last modification.  */
++    unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
++    __time_t st_ctime;			/* Time of last status change.  */
++    unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
++# endif
++    int __glibc_reserved[2];
++#endif
++  };
++
++#undef __field64
++
++#ifdef __USE_LARGEFILE64
++struct stat64
++  {
++# ifdef __USE_TIME_BITS64
++#  include <bits/struct_stat_time64_helper.h>
++# else
++    __dev_t st_dev;		/* Device.  */
++    __ino64_t st_ino;		/* File serial number.	*/
++    __mode_t st_mode;		/* File mode.  */
++    __nlink_t st_nlink;		/* Link count.  */
++    __uid_t st_uid;		/* User ID of the file's owner.	*/
++    __gid_t st_gid;		/* Group ID of the file's group.*/
++    __dev_t st_rdev;		/* Device number, if device.  */
++    __dev_t __pad1;
++    __off64_t st_size;		/* Size of file, in bytes.  */
++    __blksize_t st_blksize;	/* Optimal block size for I/O.  */
++    int __pad2;
++    __blkcnt64_t st_blocks;	/* Nr. 512-byte blocks allocated.  */
++#  ifdef __USE_XOPEN2K8
++    /* Nanosecond resolution timestamps are stored in a format
++       equivalent to 'struct timespec'.  This is the type used
++       whenever possible but the Unix namespace rules do not allow the
++       identifier 'timespec' to appear in the <sys/stat.h> header.
++       Therefore we have to handle the use of this header in strictly
++       standard-compliant sources special.  */
++    struct timespec st_atim;		/* Time of last access.  */
++    struct timespec st_mtim;		/* Time of last modification.  */
++    struct timespec st_ctim;		/* Time of last status change.  */
++#  else
++    __time_t st_atime;			/* Time of last access.  */
++    unsigned long int st_atimensec;	/* Nscecs of last access.  */
++    __time_t st_mtime;			/* Time of last modification.  */
++    unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
++    __time_t st_ctime;			/* Time of last status change.  */
++    unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
++#  endif
++    int __glibc_reserved[2];
++# endif
++  };
++#endif
++
++/* Tell code we have these members.  */
++#define	_STATBUF_ST_BLKSIZE
++#define _STATBUF_ST_RDEV
++/* Nanosecond resolution time values are supported.  */
++#define _STATBUF_ST_NSEC
++
++#endif /* _BITS_STRUCT_STAT_H  */
+diff --git a/sysdeps/unix/sysv/linux/sh/bits/struct_stat.h b/sysdeps/unix/sysv/linux/sh/bits/struct_stat.h
+new file mode 100644
+index 0000000000..0f7c9cdc89
+--- /dev/null
++++ b/sysdeps/unix/sysv/linux/sh/bits/struct_stat.h
+@@ -0,0 +1,139 @@
++/* Definition for struct stat.  Linux/sh version.
++   Copyright (C) 2020-2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library.  If not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#if !defined _SYS_STAT_H && !defined _FCNTL_H
++# error "Never include <bits/struct_stat.h> directly; use <sys/stat.h> instead."
++#endif
++
++#ifndef _BITS_STRUCT_STAT_H
++#define _BITS_STRUCT_STAT_H	1
++
++#include <bits/endian.h>
++#include <bits/wordsize.h>
++
++struct stat
++  {
++#ifdef __USE_TIME_BITS64
++# include <bits/struct_stat_time64_helper.h>
++#else
++    __dev_t st_dev;			/* Device.  */
++    unsigned short int __pad1;
++# ifndef __USE_FILE_OFFSET64
++    __ino_t st_ino;			/* File serial number.	*/
++# else
++    __ino_t __st_ino;			/* 32bit file serial number.	*/
++# endif
++    __mode_t st_mode;			/* File mode.  */
++    __nlink_t st_nlink;			/* Link count.  */
++    __uid_t st_uid;			/* User ID of the file's owner.	*/
++    __gid_t st_gid;			/* Group ID of the file's group.*/
++    __dev_t st_rdev;			/* Device number, if device.  */
++    unsigned short int __pad2;
++# ifndef __USE_FILE_OFFSET64
++    __off_t st_size;			/* Size of file, in bytes.  */
++# else
++    __off64_t st_size;			/* Size of file, in bytes.  */
++# endif
++    __blksize_t st_blksize;		/* Optimal block size for I/O.  */
++
++# ifndef __USE_FILE_OFFSET64
++    __blkcnt_t st_blocks;		/* Number 512-byte blocks allocated. */
++# else
++    __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
++# endif
++# ifdef __USE_XOPEN2K8
++    /* Nanosecond resolution timestamps are stored in a format
++       equivalent to 'struct timespec'.  This is the type used
++       whenever possible but the Unix namespace rules do not allow the
++       identifier 'timespec' to appear in the <sys/stat.h> header.
++       Therefore we have to handle the use of this header in strictly
++       standard-compliant sources special.  */
++    struct timespec st_atim;		/* Time of last access.  */
++    struct timespec st_mtim;		/* Time of last modification.  */
++    struct timespec st_ctim;		/* Time of last status change.  */
++#  define st_atime st_atim.tv_sec	/* Backward compatibility.  */
++#  define st_mtime st_mtim.tv_sec
++#  define st_ctime st_ctim.tv_sec
++# else
++    __time_t st_atime;			/* Time of last access.  */
++    unsigned long int st_atimensec;	/* Nscecs of last access.  */
++    __time_t st_mtime;			/* Time of last modification.  */
++    unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
++    __time_t st_ctime;			/* Time of last status change.  */
++    unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
++# endif
++# ifndef __USE_FILE_OFFSET64
++    unsigned long int __glibc_reserved4;
++    unsigned long int __glibc_reserved5;
++# else
++    __ino64_t st_ino;			/* File serial number.	*/
++# endif
++#endif /* __USE_TIME_BITS64  */
++  };
++
++#ifdef __USE_LARGEFILE64
++struct stat64
++  {
++# ifdef __USE_TIME_BITS64
++#  include <bits/struct_stat_time64_helper.h>
++# else
++    __dev_t st_dev;			/* Device.  */
++    unsigned int __pad1;
++
++    __ino_t __st_ino;			/* 32bit file serial number.	*/
++    __mode_t st_mode;			/* File mode.  */
++    __nlink_t st_nlink;			/* Link count.  */
++    __uid_t st_uid;			/* User ID of the file's owner.	*/
++    __gid_t st_gid;			/* Group ID of the file's group.*/
++    __dev_t st_rdev;			/* Device number, if device.  */
++    unsigned int __pad2;
++    __off64_t st_size;			/* Size of file, in bytes.  */
++    __blksize_t st_blksize;		/* Optimal block size for I/O.  */
++
++    __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
++#  ifdef __USE_XOPEN2K8
++    /* Nanosecond resolution timestamps are stored in a format
++       equivalent to 'struct timespec'.  This is the type used
++       whenever possible but the Unix namespace rules do not allow the
++       identifier 'timespec' to appear in the <sys/stat.h> header.
++       Therefore we have to handle the use of this header in strictly
++       standard-compliant sources special.  */
++    struct timespec st_atim;		/* Time of last access.  */
++    struct timespec st_mtim;		/* Time of last modification.  */
++    struct timespec st_ctim;		/* Time of last status change.  */
++#  else
++    __time_t st_atime;			/* Time of last access.  */
++    unsigned long int st_atimensec;	/* Nscecs of last access.  */
++    __time_t st_mtime;			/* Time of last modification.  */
++    unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
++    __time_t st_ctime;			/* Time of last status change.  */
++    unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
++#  endif
++    __ino64_t st_ino;			/* File serial number.		*/
++# endif /* __USE_TIME_BITS64  */
++  };
++#endif
++
++/* Tell code we have these members.  */
++#define	_STATBUF_ST_BLKSIZE
++#define _STATBUF_ST_RDEV
++/* Nanosecond resolution time values are supported.  */
++#define _STATBUF_ST_NSEC
++
++
++#endif /* _BITS_STRUCT_STAT_H  */
+-- 
+2.38.1
+
+
+From a1dc0be03c9dd850b864bd7a9c03cf8e396eb7ca Mon Sep 17 00:00:00 2001
+From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Tue, 25 Oct 2022 13:19:16 -0300
+Subject: [PATCH 66/72] elf: Reinstate on DL_DEBUG_BINDINGS _dl_lookup_symbol_x
+
+The prelink removal done by 6628c742b2c16e wrongly removed the debug
+support.
+
+Checked on x86_64-linux-gnu.
+
+(cherry picked from commit 891a7958a28eac6d4af1517dd2896fef5e4951d4)
+---
+ elf/dl-lookup.c | 17 +++++++++++++++++
+ 1 file changed, 17 insertions(+)
+
+diff --git a/elf/dl-lookup.c b/elf/dl-lookup.c
+index 4c86dc694e..67fb2e31e2 100644
+--- a/elf/dl-lookup.c
++++ b/elf/dl-lookup.c
+@@ -854,6 +854,23 @@ _dl_lookup_symbol_x (const char *undef_name, struct link_map *undef_map,
+   if (__glibc_unlikely (current_value.m->l_used == 0))
+     current_value.m->l_used = 1;
+ 
++ if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_BINDINGS))
++   {
++      const char *reference_name = undef_map->l_name;
++
++      _dl_debug_printf ("binding file %s [%lu] to %s [%lu]: %s symbol `%s'",
++			DSO_FILENAME (reference_name),
++			undef_map->l_ns,
++			DSO_FILENAME (current_value.m->l_name),
++			current_value.m->l_ns,
++			protected ? "protected" : "normal", undef_name);
++      if (version)
++	_dl_debug_printf_c (" [%s]\n", version->name);
++      else
++	_dl_debug_printf_c ("\n");
++   }
++
++
+   *ref = current_value.s;
+   return LOOKUP_VALUE (current_value.m);
+ }
+-- 
+2.38.1
+
+
+From 4c6a78addabbd6e1b69763e286768919e56dfe0a Mon Sep 17 00:00:00 2001
+From: Xi Ruoyao <xry111@xry111.site>
+Date: Sat, 15 Oct 2022 14:12:13 +0800
+Subject: [PATCH 67/72] longlong.h: update from GCC for LoongArch clz/ctz
+ support
+
+Update longlong.h to GCC r13-3269.  Keep our local change (prefer https
+for gnu.org URL).
+---
+ stdlib/longlong.h | 12 ++++++++++++
+ 1 file changed, 12 insertions(+)
+
+diff --git a/stdlib/longlong.h b/stdlib/longlong.h
+index 9b89469ac2..d8f76a43b5 100644
+--- a/stdlib/longlong.h
++++ b/stdlib/longlong.h
+@@ -593,6 +593,18 @@ extern UDItype __umulsidi3 (USItype, USItype);
+ #define UMUL_TIME 14
+ #endif
+ 
++#ifdef __loongarch__
++# if W_TYPE_SIZE == 32
++#  define count_leading_zeros(count, x)  ((count) = __builtin_clz (x))
++#  define count_trailing_zeros(count, x) ((count) = __builtin_ctz (x))
++#  define COUNT_LEADING_ZEROS_0 32
++# elif W_TYPE_SIZE == 64
++#  define count_leading_zeros(count, x)  ((count) = __builtin_clzll (x))
++#  define count_trailing_zeros(count, x) ((count) = __builtin_ctzll (x))
++#  define COUNT_LEADING_ZEROS_0 64
++# endif
++#endif
++
+ #if defined (__M32R__) && W_TYPE_SIZE == 32
+ #define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+   /* The cmp clears the condition bit.  */ \
+-- 
+2.38.1
+
+
+From dd4131c8322891a0ad7cfb661efa41aecc02b581 Mon Sep 17 00:00:00 2001
+From: Aurelien Jarno <aurelien@aurel32.net>
+Date: Tue, 1 Nov 2022 20:43:55 +0100
+Subject: [PATCH 68/72] linux: Fix fstatat on MIPSn64 (BZ #29730)
+
+Commit 6e8a0aac2f883 ("time: Fix overflow itimer tests on 32-bit
+systems") changed in_time_t_range to assume a 32-bit time_t. This broke
+fstatat on MIPSn64 that was using it with a 64-bit time_t due to
+difference between stat and stat64. This commit fix that by adding a
+MIPSn64 specific version, which bypasses the EOVERFLOW tests.
+
+Resolves: BZ #29730
+
+Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
+(cherry picked from commit 7457b7eef8dfe8cc48e55b9f9837df6dd397b80d)
+---
+ NEWS                                          |  1 +
+ .../unix/sysv/linux/mips/mips64/n64/fstatat.c | 51 +++++++++++++++++++
+ 2 files changed, 52 insertions(+)
+ create mode 100644 sysdeps/unix/sysv/linux/mips/mips64/n64/fstatat.c
+
+diff --git a/NEWS b/NEWS
+index 833045585f..e92d547e2c 100644
+--- a/NEWS
++++ b/NEWS
+@@ -45,6 +45,7 @@ The following bugs are resolved with this release:
+   [29638] libc: stdlib: arc4random fallback is never used
+   [29657] libc: Incorrect struct stat for 64-bit time on linux/generic
+     platforms
++  [29730] broken y2038 support in fstatat on MIPS N64
+ \f
+ Version 2.36
+ 
+diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/fstatat.c b/sysdeps/unix/sysv/linux/mips/mips64/n64/fstatat.c
+new file mode 100644
+index 0000000000..fe6c3a0dda
+--- /dev/null
++++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/fstatat.c
+@@ -0,0 +1,51 @@
++/* Get file status.  Linux/MIPSn64 version.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <sys/stat.h>
++#include <sysdep.h>
++
++/* Different than other ABIs, mips64 has different layouts for non-LFS
++   and LFS struct stat.  */
++int
++__fstatat (int fd, const char *file, struct stat *buf, int flag)
++{
++  struct __stat64_t64 st64;
++  int r = __fstatat64_time64 (fd, file, &st64, flag);
++  if (r == 0)
++    {
++      /* Clear internal pad and reserved fields.  */
++      memset (buf, 0, sizeof (*buf));
++
++      buf->st_dev = st64.st_dev;
++      buf->st_ino = st64.st_ino;
++      buf->st_mode = st64.st_mode;
++      buf->st_nlink = st64.st_nlink;
++      buf->st_uid = st64.st_uid;
++      buf->st_gid = st64.st_gid;
++      buf->st_rdev = st64.st_rdev;
++      buf->st_size = st64.st_size;
++      buf->st_blksize = st64.st_blksize;
++      buf->st_blocks  = st64.st_blocks;
++      buf->st_atim = st64.st_atim;
++      buf->st_mtim = st64.st_mtim;
++      buf->st_ctim = st64.st_ctim;
++    }
++  return r;
++}
++
++weak_alias (__fstatat, fstatat)
+-- 
+2.38.1
+
+
+From 2fce85f67c56e46863db40b8ca75bbf0fa993053 Mon Sep 17 00:00:00 2001
+From: caiyinyu <caiyinyu@loongson.cn>
+Date: Wed, 12 Oct 2022 20:28:42 +0800
+Subject: [PATCH 69/72] LoongArch: Fix ABI related macros in elf.h to keep
+ consistent with binutils[1].
+
+[1]:
+https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=c4a7e6b56218e1d5a858682186b542e2eae01a4a;hp=0d94a8735055432029237612a6eb9165db1ec9dd
+[2]:
+Reference: https://loongson.github.io/LoongArch-Documentation/LoongArch-ELF-ABI-EN.html#_e_flags_identifies_abi_type_and_version
+---
+ elf/elf.h | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/elf/elf.h b/elf/elf.h
+index 02a1b3f52f..014393f3cc 100644
+--- a/elf/elf.h
++++ b/elf/elf.h
+@@ -4085,8 +4085,11 @@ enum
+ #define R_NDS32_TLS_DESC	119
+ 
+ /* LoongArch ELF Flags */
+-#define EF_LARCH_ABI    	0x07
+-#define EF_LARCH_ABI_LP64D	0x03
++#define EF_LARCH_ABI_MODIFIER_MASK  0x07
++#define EF_LARCH_ABI_SOFT_FLOAT     0x01
++#define EF_LARCH_ABI_SINGLE_FLOAT   0x02
++#define EF_LARCH_ABI_DOUBLE_FLOAT   0x03
++#define EF_LARCH_OBJABI_V1          0x40
+ 
+ /* LoongArch specific dynamic relocations */
+ #define R_LARCH_NONE		0
+-- 
+2.38.1
+
+
+From 36cc06341a0c5029f49efaeef744dc3e9758e669 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <slyich@gmail.com>
+Date: Tue, 13 Sep 2022 13:39:13 -0400
+Subject: [PATCH 70/72] Makerules: fix MAKEFLAGS assignment for upcoming
+ make-4.4 [BZ# 29564]
+
+make-4.4 will add long flags to MAKEFLAGS variable:
+
+    * WARNING: Backward-incompatibility!
+      Previously only simple (one-letter) options were added to the MAKEFLAGS
+      variable that was visible while parsing makefiles.  Now, all options
+      are available in MAKEFLAGS.
+
+This causes locale builds to fail when long options are used:
+
+    $ make --shuffle
+    ...
+    make  -C localedata install-locales
+    make: invalid shuffle mode: '1662724426r'
+
+The change fixes it by passing eash option via whitespace and dashes.
+That way option is appended to both single-word form and whitespace
+separated form.
+
+While at it fixed --silent mode detection in $(MAKEFLAGS) by filtering
+out --long-options. Otherwise options like --shuffle flag enable silent
+mode unintentionally. $(silent-make) variable consolidates the checks.
+
+Resolves: BZ# 29564
+
+CC: Paul Smith <psmith@gnu.org>
+CC: Siddhesh Poyarekar <siddhesh@gotplt.org>
+Signed-off-by: Sergei Trofimovich <slyich@gmail.com>
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit 2d7ed98add14f75041499ac189696c9bd3d757fe)
+---
+ Makeconfig     | 18 +++++++++++++++++-
+ Makerules      |  4 ++--
+ elf/rtld-Rules |  2 +-
+ 3 files changed, 20 insertions(+), 4 deletions(-)
+
+diff --git a/Makeconfig b/Makeconfig
+index ba70321af1..2bbcabd8f9 100644
+--- a/Makeconfig
++++ b/Makeconfig
+@@ -43,6 +43,22 @@ else
+ $(error objdir must be defined by the build-directory Makefile)
+ endif
+ 
++# Did we request 'make -s' run? "yes" or "no".
++# Starting from make-4.4 MAKEFLAGS now contains long
++# options like '--shuffle'. To detect presence of 's'
++# we pick first word with short options. Long options
++# are guaranteed to come after whitespace. We use '-'
++# prefix to always have a word before long options
++# even if no short options were passed.
++# Typical MAKEFLAGS values to watch for:
++#   "rs --shuffle=42" (silent)
++#   " --shuffle" (not silent)
++ifeq ($(findstring s, $(firstword -$(MAKEFLAGS))),)
++silent-make := no
++else
++silent-make := yes
++endif
++
+ # Root of the sysdeps tree.
+ sysdep_dir := $(..)sysdeps
+ export sysdep_dir := $(sysdep_dir)
+@@ -917,7 +933,7 @@ endif
+ # umpteen zillion filenames along with it (we use `...' instead)
+ # but we don't want this echoing done when the user has said
+ # he doesn't want to see commands echoed by using -s.
+-ifneq	"$(findstring s,$(MAKEFLAGS))" ""	# if -s
++ifeq ($(silent-make),yes)			# if -s
+ +cmdecho	:= echo >/dev/null
+ else						# not -s
+ +cmdecho	:= echo
+diff --git a/Makerules b/Makerules
+index d1e139d03c..09c0cf8357 100644
+--- a/Makerules
++++ b/Makerules
+@@ -794,7 +794,7 @@ endif
+ # Maximize efficiency by minimizing the number of rules.
+ .SUFFIXES:	# Clear the suffix list.  We don't use suffix rules.
+ # Don't define any builtin rules.
+-MAKEFLAGS := $(MAKEFLAGS)r
++MAKEFLAGS := $(MAKEFLAGS) -r
+ 
+ # Generic rule for making directories.
+ %/:
+@@ -811,7 +811,7 @@ MAKEFLAGS := $(MAKEFLAGS)r
+ .PRECIOUS: $(foreach l,$(libtypes),$(patsubst %,$(common-objpfx)$l,c))
+ \f
+ # Use the verbose option of ar and tar when not running silently.
+-ifeq	"$(findstring s,$(MAKEFLAGS))" ""	# if not -s
++ifeq ($(silent-make),no)			# if not -s
+ verbose := v
+ else	   					# -s
+ verbose	:=
+diff --git a/elf/rtld-Rules b/elf/rtld-Rules
+index ca00dd1fe2..3c5e273f2b 100644
+--- a/elf/rtld-Rules
++++ b/elf/rtld-Rules
+@@ -52,7 +52,7 @@ $(objpfx)rtld-libc.a: $(foreach dir,$(rtld-subdirs),\
+ 	mv -f $@T $@
+ 
+ # Use the verbose option of ar and tar when not running silently.
+-ifeq	"$(findstring s,$(MAKEFLAGS))" ""	# if not -s
++ifeq ($(silent-make),no)			# if not -s
+ verbose := v
+ else						# -s
+ verbose	:=
+-- 
+2.38.1
+
+
+From 70410f2286cc36c9ccb133878811c728ae51725f Mon Sep 17 00:00:00 2001
+From: Paul Eggert <eggert@cs.ucla.edu>
+Date: Thu, 8 Sep 2022 20:08:32 -0500
+Subject: [PATCH 71/72] mktime: improve heuristic for ca-1986 Indiana DST
+
+This patch syncs mktime.c from Gnulib, fixing a
+problem reported by Mark Krenz <https://bugs.gnu.org/48085>,
+and it should fix BZ#29035 too.
+* time/mktime.c (__mktime_internal): Be more generous about
+accepting arguments with the wrong value of tm_isdst, by falling
+back to a one-hour DST difference if we find no nearby DST that is
+unusual.  This fixes a problem where "1986-04-28 00:00 EDT" was
+rejected when TZ="America/Indianapolis" because the nearest DST
+timestamp occurred in 1970, a temporal distance too great for the
+old heuristic.  This also also narrows the search a bit, which
+is a minor performance win.
+
+(cherry picked from commit 83859e1115269cf56d21669361d4ddbe2687831c)
+---
+ time/mktime.c | 28 ++++++++++++++++++++--------
+ 1 file changed, 20 insertions(+), 8 deletions(-)
+
+diff --git a/time/mktime.c b/time/mktime.c
+index 494c89bf54..e9a6006710 100644
+--- a/time/mktime.c
++++ b/time/mktime.c
+@@ -429,8 +429,13 @@ __mktime_internal (struct tm *tp,
+ 	 time with the right value, and use its UTC offset.
+ 
+ 	 Heuristic: probe the adjacent timestamps in both directions,
+-	 looking for the desired isdst.  This should work for all real
+-	 time zone histories in the tz database.  */
++	 looking for the desired isdst.  If none is found within a
++	 reasonable duration bound, assume a one-hour DST difference.
++	 This should work for all real time zone histories in the tz
++	 database.  */
++
++      /* +1 if we wanted standard time but got DST, -1 if the reverse.  */
++      int dst_difference = (isdst == 0) - (tm.tm_isdst == 0);
+ 
+       /* Distance between probes when looking for a DST boundary.  In
+ 	 tzdata2003a, the shortest period of DST is 601200 seconds
+@@ -441,12 +446,14 @@ __mktime_internal (struct tm *tp,
+ 	 periods when probing.  */
+       int stride = 601200;
+ 
+-      /* The longest period of DST in tzdata2003a is 536454000 seconds
+-	 (e.g., America/Jujuy starting 1946-10-01 01:00).  The longest
+-	 period of non-DST is much longer, but it makes no real sense
+-	 to search for more than a year of non-DST, so use the DST
+-	 max.  */
+-      int duration_max = 536454000;
++      /* In TZDB 2021e, the longest period of DST (or of non-DST), in
++	 which the DST (or adjacent DST) difference is not one hour,
++	 is 457243209 seconds: e.g., America/Cambridge_Bay with leap
++	 seconds, starting 1965-10-31 00:00 in a switch from
++	 double-daylight time (-05) to standard time (-07), and
++	 continuing to 1980-04-27 02:00 in a switch from standard time
++	 (-07) to daylight time (-06).  */
++      int duration_max = 457243209;
+ 
+       /* Search in both directions, so the maximum distance is half
+ 	 the duration; add the stride to avoid off-by-1 problems.  */
+@@ -483,6 +490,11 @@ __mktime_internal (struct tm *tp,
+ 	      }
+ 	  }
+ 
++      /* No unusual DST offset was found nearby.  Assume one-hour DST.  */
++      t += 60 * 60 * dst_difference;
++      if (mktime_min <= t && t <= mktime_max && convert_time (convert, t, &tm))
++	goto offset_found;
++
+       __set_errno (EOVERFLOW);
+       return -1;
+     }
+-- 
+2.38.1
+
+
+From 0f90d6204d79223fd32248c774df0cb7f0e604de Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 8 Nov 2022 14:15:02 +0100
+Subject: [PATCH 72/72] Linux: Support __IPC_64 in sysvctl *ctl command
+ arguments (bug 29771)
+
+Old applications pass __IPC_64 as part of the command argument because
+old glibc did not check for unknown commands, and passed through the
+arguments directly to the kernel, without adding __IPC_64.
+Applications need to continue doing that for old glibc compatibility,
+so this commit enables this approach in current glibc.
+
+For msgctl and shmctl, if no translation is required, make
+direct system calls, as we did before the time64 changes.  If
+translation is required, mask __IPC_64 from the command argument.
+
+For semctl, the union-in-vararg argument handling means that
+translation is needed on all architectures.
+
+Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
+(cherry picked from commit 22a46dee24351fd5f4f188ad80554cad79c82524)
+---
+ NEWS                               |  1 +
+ sysdeps/unix/sysv/linux/ipc_priv.h |  6 +++++
+ sysdeps/unix/sysv/linux/msgctl.c   | 38 ++++++++++++++++++++----------
+ sysdeps/unix/sysv/linux/semctl.c   |  7 ++++++
+ sysdeps/unix/sysv/linux/shmctl.c   | 38 ++++++++++++++++++++----------
+ 5 files changed, 64 insertions(+), 26 deletions(-)
+
+diff --git a/NEWS b/NEWS
+index e92d547e2c..9f8edea5db 100644
+--- a/NEWS
++++ b/NEWS
+@@ -46,6 +46,7 @@ The following bugs are resolved with this release:
+   [29657] libc: Incorrect struct stat for 64-bit time on linux/generic
+     platforms
+   [29730] broken y2038 support in fstatat on MIPS N64
++  [29771] Restore IPC_64 support in sysvipc *ctl functions
+ \f
+ Version 2.36
+ 
+diff --git a/sysdeps/unix/sysv/linux/ipc_priv.h b/sysdeps/unix/sysv/linux/ipc_priv.h
+index 87893a6757..2f50c31a8e 100644
+--- a/sysdeps/unix/sysv/linux/ipc_priv.h
++++ b/sysdeps/unix/sysv/linux/ipc_priv.h
+@@ -63,4 +63,10 @@ struct __old_ipc_perm
+ # define __IPC_TIME64 0
+ #endif
+ 
++#if __IPC_TIME64 || defined __ASSUME_SYSVIPC_BROKEN_MODE_T
++# define IPC_CTL_NEED_TRANSLATION 1
++#else
++# define IPC_CTL_NEED_TRANSLATION 0
++#endif
++
+ #include <ipc_ops.h>
+diff --git a/sysdeps/unix/sysv/linux/msgctl.c b/sysdeps/unix/sysv/linux/msgctl.c
+index e824ebb095..2072205252 100644
+--- a/sysdeps/unix/sysv/linux/msgctl.c
++++ b/sysdeps/unix/sysv/linux/msgctl.c
+@@ -85,11 +85,19 @@ msgctl_syscall (int msqid, int cmd, msgctl_arg_t *buf)
+ int
+ __msgctl64 (int msqid, int cmd, struct __msqid64_ds *buf)
+ {
+-#if __IPC_TIME64
++#if IPC_CTL_NEED_TRANSLATION
++# if __IPC_TIME64
+   struct kernel_msqid64_ds ksemid, *arg = NULL;
+-#else
++# else
+   msgctl_arg_t *arg;
+-#endif
++# endif
++
++  /* Some applications pass the __IPC_64 flag in cmd, to invoke
++     previously unsupported commands back when there was no EINVAL
++     error checking in glibc.  Mask the flag for the switch statements
++     below.  msgctl_syscall adds back the __IPC_64 flag for the actual
++     system call.  */
++  cmd &= ~__IPC_64;
+ 
+   switch (cmd)
+     {
+@@ -101,19 +109,19 @@ __msgctl64 (int msqid, int cmd, struct __msqid64_ds *buf)
+     case IPC_STAT:
+     case MSG_STAT:
+     case MSG_STAT_ANY:
+-#if __IPC_TIME64
++# if __IPC_TIME64
+       if (buf != NULL)
+ 	{
+ 	  msqid64_to_kmsqid64 (buf, &ksemid);
+ 	  arg = &ksemid;
+ 	}
+-# ifdef __ASSUME_SYSVIPC_BROKEN_MODE_T
++#  ifdef __ASSUME_SYSVIPC_BROKEN_MODE_T
+       if (cmd == IPC_SET)
+ 	arg->msg_perm.mode *= 0x10000U;
+-# endif
+-#else
++#  endif
++# else
+       arg = buf;
+-#endif
++# endif
+       break;
+ 
+     case IPC_INFO:
+@@ -137,21 +145,25 @@ __msgctl64 (int msqid, int cmd, struct __msqid64_ds *buf)
+     case IPC_STAT:
+     case MSG_STAT:
+     case MSG_STAT_ANY:
+-#ifdef __ASSUME_SYSVIPC_BROKEN_MODE_T
++# ifdef __ASSUME_SYSVIPC_BROKEN_MODE_T
+       arg->msg_perm.mode >>= 16;
+-#else
++# else
+       /* Old Linux kernel versions might not clear the mode padding.  */
+       if (sizeof ((struct msqid_ds){0}.msg_perm.mode)
+           != sizeof (__kernel_mode_t))
+ 	arg->msg_perm.mode &= 0xFFFF;
+-#endif
++# endif
+ 
+-#if __IPC_TIME64
++# if __IPC_TIME64
+       kmsqid64_to_msqid64 (arg, buf);
+-#endif
++# endif
+     }
+ 
+   return ret;
++
++#else /* !IPC_CTL_NEED_TRANSLATION */
++  return msgctl_syscall (msqid, cmd, buf);
++#endif
+ }
+ #if __TIMESIZE != 64
+ libc_hidden_def (__msgctl64)
+diff --git a/sysdeps/unix/sysv/linux/semctl.c b/sysdeps/unix/sysv/linux/semctl.c
+index 77a8130c18..3458b018bc 100644
+--- a/sysdeps/unix/sysv/linux/semctl.c
++++ b/sysdeps/unix/sysv/linux/semctl.c
+@@ -140,6 +140,13 @@ __semctl64 (int semid, int semnum, int cmd, ...)
+   union semun64 arg64 = { 0 };
+   va_list ap;
+ 
++  /* Some applications pass the __IPC_64 flag in cmd, to invoke
++     previously unsupported commands back when there was no EINVAL
++     error checking in glibc.  Mask the flag for the switch statements
++     below.  semctl_syscall adds back the __IPC_64 flag for the actual
++     system call.  */
++  cmd &= ~__IPC_64;
++
+   /* Get the argument only if required.  */
+   switch (cmd)
+     {
+diff --git a/sysdeps/unix/sysv/linux/shmctl.c b/sysdeps/unix/sysv/linux/shmctl.c
+index ea38935497..f00817a6f6 100644
+--- a/sysdeps/unix/sysv/linux/shmctl.c
++++ b/sysdeps/unix/sysv/linux/shmctl.c
+@@ -85,11 +85,19 @@ shmctl_syscall (int shmid, int cmd, shmctl_arg_t *buf)
+ int
+ __shmctl64 (int shmid, int cmd, struct __shmid64_ds *buf)
+ {
+-#if __IPC_TIME64
++#if IPC_CTL_NEED_TRANSLATION
++# if __IPC_TIME64
+   struct kernel_shmid64_ds kshmid, *arg = NULL;
+-#else
++# else
+   shmctl_arg_t *arg;
+-#endif
++# endif
++
++  /* Some applications pass the __IPC_64 flag in cmd, to invoke
++     previously unsupported commands back when there was no EINVAL
++     error checking in glibc.  Mask the flag for the switch statements
++     below.  shmctl_syscall adds back the __IPC_64 flag for the actual
++     system call.  */
++  cmd &= ~__IPC_64;
+ 
+   switch (cmd)
+     {
+@@ -103,19 +111,19 @@ __shmctl64 (int shmid, int cmd, struct __shmid64_ds *buf)
+     case IPC_STAT:
+     case SHM_STAT:
+     case SHM_STAT_ANY:
+-#if __IPC_TIME64
++# if __IPC_TIME64
+       if (buf != NULL)
+ 	{
+ 	  shmid64_to_kshmid64 (buf, &kshmid);
+ 	  arg = &kshmid;
+ 	}
+-# ifdef __ASSUME_SYSVIPC_BROKEN_MODE_T
++#  ifdef __ASSUME_SYSVIPC_BROKEN_MODE_T
+       if (cmd == IPC_SET)
+         arg->shm_perm.mode *= 0x10000U;
+-# endif
+-#else
++#  endif
++# else
+       arg = buf;
+-#endif
++# endif
+       break;
+ 
+     case IPC_INFO:
+@@ -140,21 +148,25 @@ __shmctl64 (int shmid, int cmd, struct __shmid64_ds *buf)
+       case IPC_STAT:
+       case SHM_STAT:
+       case SHM_STAT_ANY:
+-#ifdef __ASSUME_SYSVIPC_BROKEN_MODE_T
++# ifdef __ASSUME_SYSVIPC_BROKEN_MODE_T
+         arg->shm_perm.mode >>= 16;
+-#else
++# else
+       /* Old Linux kernel versions might not clear the mode padding.  */
+       if (sizeof ((struct shmid_ds){0}.shm_perm.mode)
+ 	  != sizeof (__kernel_mode_t))
+ 	arg->shm_perm.mode &= 0xFFFF;
+-#endif
++# endif
+ 
+-#if __IPC_TIME64
++# if __IPC_TIME64
+       kshmid64_to_shmid64 (arg, buf);
+-#endif
++# endif
+     }
+ 
+   return ret;
++
++#else /* !IPC_CTL_NEED_TRANSLATION */
++  return shmctl_syscall (shmid, cmd, buf);
++#endif
+ }
+ #if __TIMESIZE != 64
+ libc_hidden_def (__shmctl64)
+-- 
+2.38.1
+
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..010b68d886af 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,18 @@
 # Template file for 'glibc'
+#
+# The latest glibc patches can be obtained from the release branch using:
+# git format-patch $(git describe --abbrev=0 --match 'glibc-*') --stdout > git-updates.patch
+#
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +24,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +59,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +167,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From a7a73bf073f5e9dc6741a31fcf5504ded12fa1e6 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 07/37] musl: add support for SIGEV_THREAD_ID timers

https://git.musl-libc.org/cgit/musl/commit/?id=7c71792e87691451f2a6b76348e83ad1889f1dcb
---
 ...d-support-for-SIGEV_THREAD_ID-timers.patch | 74 +++++++++++++++++++
 srcpkgs/musl/template                         |  2 +-
 2 files changed, 75 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch

diff --git a/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
new file mode 100644
index 000000000000..e20dff5ba0d4
--- /dev/null
+++ b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
@@ -0,0 +1,74 @@
+From 7c71792e87691451f2a6b76348e83ad1889f1dcb Mon Sep 17 00:00:00 2001
+From: James Y Knight <jyknight@google.com>
+Date: Sun, 30 Jun 2019 21:55:20 -0400
+Subject: [PATCH] add support for SIGEV_THREAD_ID timers
+
+This is like SIGEV_SIGNAL, but targeted to a particular thread's
+tid, rather than the process.
+---
+ include/signal.h        | 16 +++++++++++++---
+ src/time/timer_create.c |  8 ++++++--
+ 2 files changed, 19 insertions(+), 5 deletions(-)
+
+diff --git a/include/signal.h b/include/signal.h
+index fbdf667b2..9ed929e4f 100644
+--- a/include/signal.h
++++ b/include/signal.h
+@@ -180,14 +180,24 @@ struct sigevent {
+ 	union sigval sigev_value;
+ 	int sigev_signo;
+ 	int sigev_notify;
+-	void (*sigev_notify_function)(union sigval);
+-	pthread_attr_t *sigev_notify_attributes;
+-	char __pad[56-3*sizeof(long)];
++	union {
++		char __pad[64 - 2*sizeof(int) - sizeof(union sigval)];
++		pid_t sigev_notify_thread_id;
++		struct {
++			void (*sigev_notify_function)(union sigval);
++			pthread_attr_t *sigev_notify_attributes;
++		} __sev_thread;
++	} __sev_fields;
+ };
+ 
++#define sigev_notify_thread_id __sev_fields.sigev_notify_thread_id
++#define sigev_notify_function __sev_fields.__sev_thread.sigev_notify_function
++#define sigev_notify_attributes __sev_fields.__sev_thread.sigev_notify_attributes
++
+ #define SIGEV_SIGNAL 0
+ #define SIGEV_NONE 1
+ #define SIGEV_THREAD 2
++#define SIGEV_THREAD_ID 4
+ 
+ int __libc_current_sigrtmin(void);
+ int __libc_current_sigrtmax(void);
+diff --git a/src/time/timer_create.c b/src/time/timer_create.c
+index 5ddfda278..4bef23905 100644
+--- a/src/time/timer_create.c
++++ b/src/time/timer_create.c
+@@ -71,11 +71,15 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 	switch (evp ? evp->sigev_notify : SIGEV_SIGNAL) {
+ 	case SIGEV_NONE:
+ 	case SIGEV_SIGNAL:
++	case SIGEV_THREAD_ID:
+ 		if (evp) {
+ 			ksev.sigev_value = evp->sigev_value;
+ 			ksev.sigev_signo = evp->sigev_signo;
+ 			ksev.sigev_notify = evp->sigev_notify;
+-			ksev.sigev_tid = 0;
++			if (evp->sigev_notify == SIGEV_THREAD_ID)
++				ksev.sigev_tid = evp->sigev_notify_thread_id;
++			else
++				ksev.sigev_tid = 0;
+ 			ksevp = &ksev;
+ 		}
+ 		if (syscall(SYS_timer_create, clk, ksevp, &timerid) < 0)
+@@ -107,7 +111,7 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 
+ 		ksev.sigev_value.sival_ptr = 0;
+ 		ksev.sigev_signo = SIGTIMER;
+-		ksev.sigev_notify = 4; /* SIGEV_THREAD_ID */
++		ksev.sigev_notify = SIGEV_THREAD_ID;
+ 		ksev.sigev_tid = td->tid;
+ 		if (syscall(SYS_timer_create, clk, &ksev, &timerid) < 0)
+ 			timerid = -1;
diff --git a/srcpkgs/musl/template b/srcpkgs/musl/template
index 34e6ed4fba6e..afb33cd868b5 100644
--- a/srcpkgs/musl/template
+++ b/srcpkgs/musl/template
@@ -2,7 +2,7 @@
 pkgname=musl
 reverts="1.2.0_1"
 version=1.1.24
-revision=11
+revision=12
 archs="*-musl"
 bootstrap=yes
 build_style=gnu-configure

From 952f804beea329e88b3067b6679860e3543d01e2 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 08/37] gcc-multilib: update to 12.2.0.

---
 srcpkgs/gcc-multilib/template | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index f28eb237c287..ba9bafcadfd6 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,15 +3,15 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _majorver="${version%.*}"
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel
@@ -70,7 +70,7 @@ do_build() {
 	make ${makejobs}
 }
 do_install() {
-	local _pc_triplet=x86_64-pc-linux-gnu _version=${version%pre1}
+	local _pc_triplet=x86_64-pc-linux-gnu
 	# Install to a tempdir and then only copy relevant files.
 	cd ${wrksrc}
 	make DESTDIR=${wrksrc}/${pkgname}-build install
@@ -80,9 +80,9 @@ do_install() {
 	vmkdir usr/include/c++/${_majorver}/${_triplet}
 	vmkdir usr/lib/gcc/${_triplet}/${_majorver}
 
-	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${_version}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${version}/32 \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_majorver}/
-	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${_version}/${_pc_triplet}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${version}/${_pc_triplet}/32 \
 		${DESTDIR}/usr/include/c++/${_majorver}/${_triplet}
 
 	vinstall ${wrksrc}/host-${_pc_triplet}/gcc/specs 644 usr/lib/gcc/${_triplet}/${_majorver}

From 62fd5dc762e23e1cc9bc343333e949320126d289 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 09/37] libgccjit: update to 12.2.0.

---
 srcpkgs/libgccjit/files/libgccjit-musl.patch | 63 --------------------
 srcpkgs/libgccjit/template                   | 24 +++-----
 2 files changed, 9 insertions(+), 78 deletions(-)
 delete mode 100644 srcpkgs/libgccjit/files/libgccjit-musl.patch

diff --git a/srcpkgs/libgccjit/files/libgccjit-musl.patch b/srcpkgs/libgccjit/files/libgccjit-musl.patch
deleted file mode 100644
index d2ed16928c82..000000000000
--- a/srcpkgs/libgccjit/files/libgccjit-musl.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-diff --git a/gcc/jit/jit-playback.c b/gcc/jit/jit-playback.c
-index 5bccf591a..35f5e35ef 100644
---- a/gcc/jit/jit-playback.c
-+++ b/gcc/jit/jit-playback.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -41,8 +43,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "diagnostic.h"
- #include "stmt.h"
- 
--#include <pthread.h>
--
- #include "jit-playback.h"
- #include "jit-result.h"
- #include "jit-builtins.h"
-diff --git a/gcc/jit/jit-recording.c b/gcc/jit/jit-recording.c
-index a237d574f..5785e3269 100644
---- a/gcc/jit/jit-recording.c
-+++ b/gcc/jit/jit-recording.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -25,8 +27,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "pretty-print.h"
- #include "toplev.h"
- 
--#include <pthread.h>
--
- #include "jit-builtins.h"
- #include "jit-recording.h"
- #include "jit-playback.h"
-diff --git a/gcc/jit/libgccjit.c b/gcc/jit/libgccjit.c
-index f9c33c63c..75f21d275 100644
---- a/gcc/jit/libgccjit.c
-+++ b/gcc/jit/libgccjit.c
-@@ -18,13 +18,13 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
- #include "timevar.h"
- #include "typed-splay-tree.h"
- #include "cppbuiltin.h"
--#include <pthread.h>
- 
- #include "libgccjit.h"
- #include "jit-recording.h"
diff --git a/srcpkgs/libgccjit/template b/srcpkgs/libgccjit/template
index 0b37c3ee9f8b..fde1affd54b7 100644
--- a/srcpkgs/libgccjit/template
+++ b/srcpkgs/libgccjit/template
@@ -3,18 +3,12 @@
 # which use the version number.
 
 pkgname=libgccjit
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
+version=12.2.0
 revision=1
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
-_majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 create_wrksrc=yes
 short_desc="Just-In-Time Compilation library for GCC"
 maintainer="Lane Biocini <lane@mailbox.org>"
@@ -22,16 +16,16 @@ homepage="https://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 nopie=yes
 lib32disabled=yes
 makedepends="zlib-devel"

From 67ec3c6c5d243126002b3c8ae7d3d0cda527b5f0 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 10/37] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove -no-pie from build. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..f7e02dbc48cb 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -53,6 +53,7 @@ _void_cross_build_binutils() {
 		--sbindir=/usr/bin \
 		--libdir=/usr/lib \
 		--libexecdir=/usr/lib \
+		--sysconfdir=/etc \
 		--target=${tgt} \
 		--with-sysroot=/usr/${tgt} \
 		--disable-nls \
@@ -60,7 +61,9 @@ _void_cross_build_binutils() {
 		--disable-multilib \
 		--disable-werror \
 		--disable-gold \
+		--disable-gprofng \
 		--enable-relro \
+		--enable-new-dtags \
 		--enable-plugins \
 		--enable-64-bit-bfd \
 		--enable-deterministic-archives \
@@ -91,6 +94,9 @@ _void_cross_build_bootstrap_gcc() {
 	# Do not run fixincludes
 	sed -i 's@./fixinc.sh@-c true@' Makefile.in
 
+	# Do not use system headers to determine clocale implementation
+	sed -i 's/#if (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined(__UCLIBC__)/#if 1/g' libstdc++-v3/configure
+
 	for f in ${XBPS_SRCPKGDIR}/gcc/patches/*.patch; do
 		_void_cross_apply_patch "$f"
 	done
@@ -132,6 +138,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -381,6 +388,7 @@ _void_cross_build_gcc() {
 		extra_args+=" --disable-gnu-unique-object"
 		extra_args+=" libat_cv_have_ifunc=no"
 	else
+		extra_args+=" --enable-clocale=gnu"
 		extra_args+=" --enable-gnu-unique-object"
 	fi
 
@@ -460,6 +468,14 @@ do_build() {
 	local binutils_ver linux_ver gcc_ver libc_ver libucontext_ver
 	local tgt=${sourcepkg/cross-}
 
+	export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}"
+	export CXXFLAGS="${CXXFLAGS/-D_FORTIFY_SOURCE=2/}"
+
+	# Disable explicit -fno-PIE, gcc/binutils/libc will figure this out itself.
+	export CFLAGS="${CFLAGS//-fno-PIE/}"
+	export CXXFLAGS="${CXXFLAGS//-fno-PIE/}"
+	export LDFLAGS="${LDFLAGS//-no-pie/}"
+
 	_void_cross_test_ver binutils
 	_void_cross_test_ver linux
 	_void_cross_test_ver gcc
@@ -625,6 +641,9 @@ do_install() {
 	# then remove it because it conflicts with libquadmath package
 	rm -rf ${DESTDIR}/${sysroot}/usr/lib/libquadmath.*
 
+	# Remove libdep linker plugin because it conflicts with system binutils
+	rm -f ${DESTDIR}/usr/lib/bfd-plugins/libdep*
+
 	# Remove leftover symlinks
 	rm -f ${DESTDIR}/usr/lib${XBPS_TARGET_WORDSIZE}
 	rm -f ${DESTDIR}/lib*

From 2ca7470f2404eb9b896b9b124ea84474bce281cd Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 11/37] qemu: remove broken patch

The necessary patch has been imported into musl so no need
to cast the sigevent struct to a more glibc-like one.
---
 .../musl-fix-sigevent-and-sigval_t.patch      | 27 -------------------
 1 file changed, 27 deletions(-)
 delete mode 100644 srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch

diff --git a/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch b/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch
deleted file mode 100644
index 4b4f1117c15f..000000000000
--- a/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-Note: Remove this patch with musl 1.2.2
-
---- a/linux-user/syscall.c
-+++ b/linux-user/syscall.c
-@@ -5020,10 +5020,21 @@
- #ifndef HAVE_SIGEV_NOTIFY_THREAD_ID
- #define sigev_notify_thread_id _sigev_un._tid
- #endif
- 
--static inline abi_long target_to_host_sigevent(struct sigevent *host_sevp,
-+struct host_sigevent {
-+    union sigval sigev_value;
-+    int sigev_signo;
-+    int sigev_notify;
-+    union {
-+       char _pad[64 - sizeof(int) * 2 - sizeof(union sigval)];
-+       int _tid;
-+    } _sigev_un;
-+};
-+
-+static inline abi_long target_to_host_sigevent(struct sigevent *sevp,
-                                                abi_ulong target_addr)
- {
-+    struct host_sigevent *host_sevp = (struct host_sigevent *) sevp;
-     struct target_sigevent *target_sevp;
- 
-     if (!lock_user_struct(VERIFY_READ, target_sevp, target_addr, 1)) {

From 49233b856531676c9e17ff5fc8c004700594102e Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 19 Nov 2022 13:26:24 -0800
Subject: [PATCH 12/37] mk-configure: rebuild for gcc 12

---
 srcpkgs/mk-configure/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/mk-configure/template b/srcpkgs/mk-configure/template
index 9d12f11a9799..c50d8adf213f 100644
--- a/srcpkgs/mk-configure/template
+++ b/srcpkgs/mk-configure/template
@@ -1,7 +1,7 @@
 # Template file for 'mk-configure'
 pkgname=mk-configure
 version=0.37.0
-revision=1
+revision=2
 build_style=gnu-makefile
 make_cmd=bmake
 make_install_args="MANDIR=/usr/share/man"

From 832a166c70a7ed65c64b34584f2799d33602758a Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 13/37] cross-aarch64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..9e6fb75c198d 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Leah Neukirchen <leah@vuxu.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 94d376c55c80bf390c0cc5a6eeea3975f8a5c554 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 14/37] cross-aarch64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..ba14c96bccea 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 9a36d2e84f5bb39f90dd7b31bbed4ff25896699a Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 15/37] cross-arm-linux-gnueabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..5c774e16f430 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 3541f0791a5275176af966cf9ac5610cfbedbbc1 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 16/37] cross-arm-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..d6298ab639a4 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From f3d9f429df7466d6733e0625b3e9c0dce970031e Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 17/37] cross-arm-linux-musleabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..24df78e8fd8e 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 76252332251122a3ac2af202faffbd4e7b204eaa Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 18/37] cross-arm-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..8093700f909c 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From b43d00afd023707094b03c492b3e29efa8087bea Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 19/37] cross-armv7l-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..92665326428b 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From c198ab54c2c5aa43d9a6b0941b21d4c42aa7f595 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 20/37] cross-armv7l-linux-musleabihf: update to gcc 12.2.0.

---
 .../cross-armv7l-linux-musleabihf/template    | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..e5af2c9ccbf2 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 517f6dbc86a5b0235992272303e3be0a98208731 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 21/37] cross-i686-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-i686-linux-musl/template b/srcpkgs/cross-i686-linux-musl/template
index 8be16a230d8d..d624bb7a3254 100644
--- a/srcpkgs/cross-i686-linux-musl/template
+++ b/srcpkgs/cross-i686-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-i686-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-i686-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 80bc076e4c34be3cfab6c19505b41711ee41bb1b Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 22/37] cross-i686-pc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..6a9e54db807a 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,14 +1,15 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -16,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 5b399bd956a0f8fa9d714525d611abd7177c7dc1 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 23/37] cross-mips-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-musl/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..67a5c413396c 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From fdd8171e23b590eecb5685b5b58f85ca2b34242f Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 24/37] cross-mips-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..bdf8600ce95b 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="hipperson0 <hipperson0@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From e609eae8be4e6a5ffb8a7f93bd26c91d650f6f13 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 25/37] cross-mipsel-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..de49387d517b 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 83847dcaa51629becfe69c377b135b7f0aaa6482 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 26/37] cross-mipsel-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..b27ce6475a38 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From f46d5a22e6bcac79724dd56a731651d8fc0537b7 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 27/37] cross-powerpc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..79579e093b12 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From e573a0a26dbd54f06fe9c50a9a0c195699f311a2 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 28/37] cross-powerpc-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..9bb6acd359b6 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From aed546089266db916e758c1ef10a2da81869f4cf Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 29/37] cross-powerpc64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..2d153d00add6 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,16 +1,17 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
  --enable-targets=powerpc-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -18,12 +19,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 41759348680cfac96c697004d73b5262dc049977 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 30/37] cross-powerpc64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 016f18776a6d..e0848fe0bff7 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,30 +1,31 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 19da7122abf0d9d28ff66e18fb80ffb4a6ab82ab Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 31/37] cross-powerpc64le-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 463d7e92d20d..8d8e010e15c0 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,16 +1,17 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
  --enable-targets=powerpcle-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -18,12 +19,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 8495e224f4360160152444322fcdf733ca6c0fa6 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 32/37] cross-powerpc64le-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index c17a3cccfe29..0915e524545f 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,30 +1,31 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 821b75c0bee96e94f8e6e6f4ddc708aa7ecd3c08 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 33/37] cross-powerpcle-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 9aede3c465ce..687be8a44c6c 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 
@@ -35,6 +36,8 @@ if [ "$XBPS_TARGET_MACHINE" = "ppcle" ]; then
 	broken="Can't build crosstoolchain to itself"
 fi
 
+broken="glibc uses big-endian specific instructions on 32-bit powerpc"
+
 cross-powerpcle-linux-gnu-libc_package() {
 	short_desc+=" - glibc files"
 	nostrip=yes

From c6c7fa7ed5b15207c19bd808c9a3d14c41046e7e Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 34/37] cross-powerpcle-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index 045cfda987fe..bb984b9c42eb 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From afd60df207de137165c31f8f0a0a8a8355f1c78f Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:30 -0800
Subject: [PATCH 35/37] cross-x86_64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 8918f3c22a1c..930aaf2a508b 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,14 +1,15 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -16,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 8618c127756e99a32b203adc993bf783e874fc1c Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:30 -0800
Subject: [PATCH 36/37] cross-x86_64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..ac5b1c46ab82 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 2b7e05e4bedf86bfe4e9d19be4c9694de6bd4926 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Fri, 18 Nov 2022 02:01:19 -0800
Subject: [PATCH 37/37] cross-vpkg-dummy: update to 0.39.

---
 srcpkgs/cross-vpkg-dummy/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/cross-vpkg-dummy/template b/srcpkgs/cross-vpkg-dummy/template
index d83e38dc63ac..aeafb749dd5f 100644
--- a/srcpkgs/cross-vpkg-dummy/template
+++ b/srcpkgs/cross-vpkg-dummy/template
@@ -1,6 +1,6 @@
 # Template file for 'cross-vpkg-dummy'
 pkgname=cross-vpkg-dummy
-version=0.38
+version=0.39
 revision=1
 build_style=meta
 short_desc="Dummy meta-pkg for cross building packages with xbps-src"
@@ -54,8 +54,8 @@ conflicts="
 	gcc-objc++>=0"
 shlib_provides="
 	libgcc_s.so.1
-	libgnat-10.so
-	libgnarl-10.so
+	libgnat-12.so
+	libgnarl-12.so
 	libstdc++.so.6
 	libgfortran.so.5"
 

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (233 preceding siblings ...)
  2022-11-19 22:37 ` [PR PATCH] [Updated] " oreo639
@ 2022-11-19 22:39 ` oreo639
  2022-11-19 22:45 ` [PR PATCH] [Updated] " oreo639
                   ` (29 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-11-19 22:39 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 647 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1320984634

Comment:
> glibc doesn't do patch releases, but they have a stable branch that contains many important fixes. Do you think we could just package that branch like for example Arch does? It seems to fix some packages not building: [#39960 (comment)](https://github.com/void-linux/void-packages/issues/39960#issuecomment-1319039741)

Done, if you are going to test it, make sure to delete your masterdir and re-run binary-bootstrap to make sure you are using the updated glibc.
I can confirm toybox builds with it.

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (234 preceding siblings ...)
  2022-11-19 22:39 ` oreo639
@ 2022-11-19 22:45 ` oreo639
  2022-11-19 22:51 ` oreo639
                   ` (28 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-11-19 22:45 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5448 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.2.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.2.0

There is a list of failing builds here: https://github.com/void-linux/void-packages/issues/39809

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [x] llvm https://github.com/void-linux/void-packages/pull/38694
- [x] m4 https://github.com/void-linux/void-packages/pull/33730
- [x] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [x] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [x] libvirt https://github.com/void-linux/void-packages/pull/38842
- [x] syslinux https://github.com/void-linux/void-packages/pull/38876
- [x] efivar https://github.com/void-linux/void-packages/pull/38874
- [x] gpgme https://github.com/void-linux/void-packages/pull/38825

Known packages that needed to be fixed/updated for gcc12:
- [x] openssh https://github.com/void-linux/void-packages/pull/38849
- [x] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [x] doxygen https://github.com/void-linux/void-packages/pull/38846
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] libproxy https://github.com/void-linux/void-packages/pull/38818
- [x] exempi https://github.com/void-linux/void-packages/pull/38820
- [x] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [x] libunique1 https://github.com/void-linux/void-packages/pull/38848 or https://github.com/void-linux/void-packages/pull/38873
- [x] libwpd https://github.com/void-linux/void-packages/pull/38878
- [x] cglm https://github.com/void-linux/void-packages/pull/39748
- [x] coreboot-utils https://github.com/void-linux/void-packages/pull/39749
- [x] apl https://github.com/void-linux/void-packages/pull/39750
- [x] igt-gpu-tools https://github.com/void-linux/void-packages/pull/39780

Needs to be fixed/updated for binutils:
- [x] grub https://github.com/void-linux/void-packages/pull/38875
- [x] linux-tools https://github.com/void-linux/void-packages/pull/38877
- [x] kcov https://github.com/void-linux/void-packages/pull/39291

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [x] kde
- [x] lxde
- [x] lxqt

You can test the ISOs here:
https://drive.google.com/drive/folders/1ix92CYSLUP-KWjLxltdgG4e8Nu2JCY5n?usp=sharing

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 520512 bytes --]

From c3ba17a045f848281322ef66c857e867cfd85193 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 01/37] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../fix-libcollector-without-java.patch       | 53 +++++++++++++++
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 25 ++++---
 4 files changed, 87 insertions(+), 117 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
 create mode 100644 srcpkgs/binutils/patches/fix-libcollector-without-java.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/fix-libcollector-without-java.patch b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
new file mode 100644
index 000000000000..54384875f358
--- /dev/null
+++ b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
@@ -0,0 +1,53 @@
+From 49ddd814ac1071af7c4f45d5f8398b91862f2c7f Mon Sep 17 00:00:00 2001
+From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
+Date: Wed, 17 Aug 2022 19:55:23 -0700
+Subject: [PATCH] gprofng: fix bug 29479 Collection fails when built without
+ java support
+
+gprofng/ChangeLog
+2022-08-17  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>
+
+	PR gprofng/29479
+	* libcollector/collector.c: Add #if defined(GPROFNG_JAVA_PROFILING) for
+	java specific code.
+	* libcollector/unwind.c: Likewise.
+---
+ gprofng/libcollector/collector.c | 2 ++
+ gprofng/libcollector/unwind.c    | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/gprofng/libcollector/collector.c b/gprofng/libcollector/collector.c
+index 93c9d3330de5..ceff2c1caccb 100644
+--- a/gprofng/libcollector/collector.c
++++ b/gprofng/libcollector/collector.c
+@@ -913,8 +913,10 @@ __collector_open_experiment (const char *exp, const char *params, sp_origin_t or
+   __collector_ext_unwind_key_init (1, NULL);
+ 
+   /* start java attach if suitable */
++#if defined(GPROFNG_JAVA_PROFILING)
+   if (exp_origin == SP_ORIGIN_DBX_ATTACH)
+     __collector_jprofile_start_attach ();
++#endif
+   start_sec_time = CALL_UTIL (time)(NULL);
+   __collector_start_time = collector_interface.getHiResTime ();
+   TprintfT (DBG_LT0, "\t__collector_open_experiment; resetting start_time\n");
+diff --git a/gprofng/libcollector/unwind.c b/gprofng/libcollector/unwind.c
+index 119243788020..f8e11823c81e 100644
+--- a/gprofng/libcollector/unwind.c
++++ b/gprofng/libcollector/unwind.c
+@@ -557,6 +557,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+   int size = max_frame_size;
+ 
+ #define MIN(a,b) ((a)<(b)?(a):(b))
++#if defined(GPROFNG_JAVA_PROFILING)
+   /* get Java info */
+   if (__collector_java_mode && __collector_java_asyncgetcalltrace_loaded && context && !pseudo_context)
+     {
+@@ -569,6 +570,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+ 	  size -= sz;
+ 	}
+     }
++#endif
+ 
+   /* get native stack */
+   if (context)
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..c355a5fc8016 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkgconf"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -35,15 +36,21 @@ do_configure() {
 	local conf
 
 	if [ "$CHROOT_READY" ]; then
-		conf+=" --with-debuginfod"
+		conf+=" --with-debuginfod --enable-shared"
 	else
-		conf+=" --without-debuginfod --disable-install-libbfd"
+		conf+=" --without-debuginfod --disable-shared --disable-install-libbfd"
 	fi
 	if [ "$CROSS_BUILD" ]; then
 		# we don't want --with-sysroot=${XBPS_CROSS_BASE} like gnu-configure
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	# gprofng currently only supports x86 and aarch64 glibc.
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64|i386|aarch64) conf+=" --enable-gprofng" ;;
+		*) conf+=" --disable-gprofng" ;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"
@@ -76,13 +83,14 @@ do_configure() {
 		--libdir=/usr/lib \
 		--mandir=/usr/share/man \
 		--infodir=/usr/share/info \
+		--sysconfdir=/etc \
 		--disable-werror \
-		--disable-shared \
 		--disable-nls \
 		--enable-threads \
 		--enable-plugins \
 		--enable-relro \
 		--enable-gold \
+		--enable-new-dtags \
 		--enable-deterministic-archives \
 		--enable-64-bit-bfd \
 		--enable-ld=default \
@@ -142,7 +150,8 @@ binutils-devel_package() {
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/*.a"
-		vmove "usr/lib/*.so"
+		vmove "usr/lib/libbfd.so"
+		vmove "usr/lib/libopcodes.so"
 	}
 }
 

From 66f6988d695ef56433c4c2fb21e744f34f0e852f Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 02/37] gdb: resolve conflict with binutils 2.39

---
 srcpkgs/gdb/template | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/gdb/template b/srcpkgs/gdb/template
index 9c5f17ffc519..b666348fea19 100644
--- a/srcpkgs/gdb/template
+++ b/srcpkgs/gdb/template
@@ -1,7 +1,7 @@
 # Template file for 'gdb'
 pkgname=gdb
 version=12.1
-revision=2
+revision=3
 build_style=gnu-configure
 pycompile_dirs="/usr/share/gdb/python"
 configure_args="--disable-werror --disable-nls --with-system-readline
@@ -48,7 +48,8 @@ vopt_conflict debuginfod static
 
 post_install() {
 	# resolve conflicts with binutils
-	rm -r ${DESTDIR}/usr/{include,lib,share/info/bfd.info*}
+	rm -rf ${DESTDIR}/usr/{include,lib}
+	rm -rf ${DESTDIR}/usr/share/info/{bfd,ctf-spec}.info*
 }
 
 gdb-common_package() {

From 09823b53e266c1db3351c8d6090d1ad8fd19506c Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 03/37] gcc: update to 12.2.0.

---
 common/shlibs                                 | 10 +--
 srcpkgs/gcc/files/gccgo-musl.patch            | 71 +++------------
 srcpkgs/gcc/files/libgnarl-musl.patch         | 18 ++--
 srcpkgs/gcc/files/libssp-musl.patch           | 10 +--
 srcpkgs/gcc/patches/libffi_gnulinux.patch     | 11 ---
 .../gcc/patches/libgcc-ibm128-no-tag.patch    | 10 ++-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |  2 +-
 srcpkgs/gcc/template                          | 87 +++++++++----------
 8 files changed, 80 insertions(+), 139 deletions(-)
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index 07296762fcc4..a5f4f3257d33 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.2.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.36 perl-5.36.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -857,8 +857,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.2.0_1
+libgnat-12.so libada-12.2.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1710,8 +1710,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.2.0_1
+libasan.so.8 libsanitizer-12.2.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..12ec68dd8aa3 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,14 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ b/libgo/go/runtime/os_linux.go
+@@ -365,7 +365,7 @@ func setThreadCPUProfiler(hz int32) {
+ 	var sevp _sigevent
+ 	sevp.sigev_notify = _SIGEV_THREAD_ID
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.__sev_fields))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index ab3643de4f98..a20af7c0ef2e 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,14 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
+version=12.2.0
+revision=1
+_minorver="${version%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 create_wrksrc=yes
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +18,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -52,8 +48,11 @@ if [ "$CHROOT_READY" ]; then
 	hostmakedepends="tar texinfo perl flex"
 else
 	_have_gccgo=no
+	# libzstd fails to link in bootstrap with glibc 2.36
+	# when zlib has been compiled with glibc 2.32.
+	LDFLAGS="-lzstd -pthread"
 fi
-makedepends="zlib-devel"
+makedepends="zlib-devel libzstd-devel"
 depends="binutils libgcc-devel-${version}_${revision}
  libstdc++-devel-${version}_${revision} libssp-devel-${version}_${revision}"
 checkdepends="dejagnu"
@@ -70,13 +69,13 @@ if [ "$build_option_gnatboot" ]; then
 	case "$XBPS_TARGET_MACHINE" in
 	x86_64)
 		_gnat_tarball="gnat-gpl-2017-x86_64-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/591c6d80c7a447af2deed1d7>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/9682e2e1f2f232ce03fe21d77b14c37a0de5649b?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" b942bcac20dea39748b39f8b624d9619f60a8dee2e8195dbe3829c835b0956e6"
 		build_options_default="gnatboot"
 		;;
 	i686)
 		_gnat_tarball="gnat-gpl-2014-x86-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/564b3e9dc8e196b040fbe248>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/c5e9e6fdff5cb77ed90cf8c62536653e27c0bed6?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" 3b693510f5d22a240abb3034934c1adbd80ccd6e4f61a4f491cc408fdfd9c042"
 		build_options_default="gnatboot"
 		;;
@@ -155,8 +154,8 @@ if [ "$CROSS_BUILD" ]; then
 fi
 
 post_extract() {
-	mv gcc-${version/pre/_pre}/* gcc-${version/pre/_pre}/.??* .
-	rmdir gcc-${version/pre/_pre}
+	mv gcc-${version}/* gcc-${version}/.??* .
+	rmdir gcc-${version}
 	mv gmp-${_gmp_version} gmp
 	mv mpfr-${_mpfr_version} mpfr
 	mv mpc-${_mpc_version} mpc
@@ -186,9 +185,9 @@ pre_configure() {
 	sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
 
 	if [ "$XBPS_TARGET_LIBC" = musl ]; then
-		patch -p1 -i ${FILESDIR}/libgnarl-musl.patch
-		patch -p1 -i ${FILESDIR}/libssp-musl.patch
-		patch -p1 -i ${FILESDIR}/gccgo-musl.patch
+		for p in ${FILESDIR}/*-musl.patch; do
+			patch -p1 -i $p
+		done
 	fi
 }
 do_configure() {
@@ -343,16 +342,16 @@ do_install() {
 
 	# Make version a symlink of major version to make all versions
 	# from the same series work automagically.
-	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver} \
+	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${version} \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver}
 	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver} \
-		${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}
+		${DESTDIR}/usr/lib/gcc/${_triplet}/${version}
 
 	# Ditto for c++ headers.
-	mv ${DESTDIR}/usr/include/c++/${_patchver} \
+	mv ${DESTDIR}/usr/include/c++/${version} \
 		${DESTDIR}/usr/include/c++/${_minorver}
 	ln -sfr ${DESTDIR}/usr/include/c++/${_minorver} \
-		${DESTDIR}/usr/include/c++/${_patchver}
+		${DESTDIR}/usr/include/c++/${version}
 
 	# cc symlink
 	ln -sfr ${DESTDIR}/usr/bin/gcc ${DESTDIR}/usr/bin/cc
@@ -361,7 +360,7 @@ do_install() {
 
 	# lto plugin symlink
 	vmkdir usr/lib/bfd-plugins
-	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}/liblto_plugin.so \
+	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${version}/liblto_plugin.so \
 		${DESTDIR}/usr/lib/bfd-plugins
 
 	# Remove "fixed" header
@@ -372,13 +371,9 @@ do_install() {
 	rm -f ${DESTDIR}/usr/lib/libffi*
 	rm -f ${DESTDIR}/usr/share/man/man3/ffi*
 
-	# Remove all python scripts in libdir.
-	rm -f ${DESTDIR}/usr/lib/*.py
-
-	# Remove more python stuff.
-	if [ -d ${DESTDIR}/usr/share/gcc-${_patchver}/python ]; then
-		rm -rf ${DESTDIR}/usr/share/gcc-${_patchver}/python
-	fi
+	# Move libstdc++ gdb helpers to location where gdb can autoload them
+	mkdir -p ${DESTDIR}/usr/share/gdb/auto-load/usr/lib
+	mv ${DESTDIR}/usr/lib/*.py ${DESTDIR}/usr/share/gdb/auto-load/usr/lib
 
 	# Install c89 and c99 wrappers and its manpages, from NetBSD.
 	for f in c89 c99; do
@@ -397,7 +392,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}
@@ -450,7 +445,7 @@ gcc-fortran_package() {
 		if [ "$CROSS_BUILD" ]; then
 			# A number of OMP modules are not built when cross
 			# compiling gcc. Copy them from the cross compiler.
-			local src="/usr/lib/gcc/${_triplet}/${_patchver}/finclude"
+			local src="/usr/lib/gcc/${_triplet}/${version}/finclude"
 			local dst="usr/lib/gcc/${_triplet}/${_minorver}/finclude"
 			for f in omp_lib.f90 omp_lib.h omp_lib.mod omp_lib_kinds.mod \
 				openacc.f90 openacc.mod openacc_kinds.mod openacc_lib.h; do
@@ -517,7 +512,7 @@ libgfortran_package() {
 	short_desc+=" - Fortran library"
 	pkg_install() {
 		vmove "usr/lib/libgfortran.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -538,7 +533,7 @@ libgo_package() {
 	nostrip=yes
 	pkg_install() {
 		vmove "usr/lib/libgo.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -554,7 +549,7 @@ libobjc_package() {
 	short_desc+=" - Objective-C library"
 	pkg_install() {
 		vmove "usr/lib/libobjc.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -573,7 +568,7 @@ libquadmath_package() {
 	short_desc+=" - quadmath library"
 	pkg_install() {
 		vmove "usr/lib/libquadmath.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -615,7 +610,7 @@ libgcc_package() {
 	noverifyrdeps=yes
 	pkg_install() {
 		vmove "usr/lib/libgcc_s.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -646,7 +641,7 @@ libgomp_package() {
 	short_desc+=" - OpenMP v4.0 library"
 	pkg_install() {
 		vmove "usr/lib/libgomp*.so.*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -701,7 +696,7 @@ libssp_package() {
 	short_desc+=" - SSP (StackSmashingProtection) library"
 	pkg_install() {
 		vmove "usr/lib/libssp.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -718,7 +713,9 @@ libstdc++-devel_package() {
 libstdc++_package() {
 	short_desc+=" - Standard C++ Library"
 	pkg_install() {
+		vmove usr/share/gdb
+		vmove usr/share/gcc-${version}/python
 		vmove "usr/lib/libstdc++.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }

From 25feab200a1a00db03e93c892c2a1a7b44ba985c Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 04/37] libtool: rebuild for gcc 12

---
 srcpkgs/libtool/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index fc5c53a9c3e9..aebad9294eef 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
 version=2.4.7
-revision=1
+revision=2
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"

From 1b0668e29a0f79489385c428a7cf2f1bea20687d Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 05/37] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 7e01bbb851fd..d9618e3806ba 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 build_wrksrc=libiberty
 build_style=gnu-configure
@@ -10,7 +10,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From 59eeb1c5a9bdcd30f2db57ae92fdd202279e99d1 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 06/37] glibc: update to 2.36.

---
 common/shlibs                                 |    60 +-
 ...e-hash-style-both-for-building-glibc.patch |    51 +
 srcpkgs/glibc/patches/git-updates.patch       | 10900 ++++++++++++++++
 .../glibc/patches/glibc-c-utf8-locale.patch   |   286 -
 srcpkgs/glibc/template                        |    66 +-
 5 files changed, 11010 insertions(+), 353 deletions(-)
 create mode 100644 srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
 create mode 100644 srcpkgs/glibc/patches/git-updates.patch
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index a5f4f3257d33..a96fe577e93b 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch b/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
new file mode 100644
index 000000000000..9c5553e92609
--- /dev/null
+++ b/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
@@ -0,0 +1,51 @@
+Temporary workaround for EAC bug.
+
+See: https://sourceware.org/bugzilla/show_bug.cgi?id=29456
+
+From 8e90e2cc5e57d7ca3a40602d278e9642a8b66716 Mon Sep 17 00:00:00 2001
+From: oreo639 <oreo6391@gmail.com>
+Date: Tue, 13 Sep 2022 14:30:35 -0700
+Subject: [PATCH] Revert "Do not use --hash-style=both for building glibc
+ shared objects"
+
+This reverts commit e47de5cb2d4dbecb58f569ed241e8e95c568f03c.
+---
+ Makeconfig     |  9 +++++++++
+ Makerules      |  7 +++++++
+ 5 files changed, 61 insertions(+)
+
+diff --git a/Makeconfig b/Makeconfig
+index ba70321af1..e2131d4389 100644
+--- a/Makeconfig
++++ b/Makeconfig
+@@ -371,6 +371,13 @@ dt-relr-ldflag =
+ no-dt-relr-ldflag =
+ endif
+ 
++# For the time being we unconditionally use 'both'.  At some time we
++# should declare statically linked code as 'out of luck' and compile
++# with --hash-style=gnu only.
++hashstyle-LDFLAGS = -Wl,--hash-style=both
++LDFLAGS.so += $(hashstyle-LDFLAGS)
++LDFLAGS-rtld += $(hashstyle-LDFLAGS)
++
+ ifeq (no,$(build-pie-default))
+ pie-default = $(no-pie-ccflag)
+ else # build-pie-default
+diff --git a/Makerules b/Makerules
+index d1e139d03c..44134e37ce 100644
+--- a/Makerules
++++ b/Makerules
+@@ -558,6 +558,9 @@ $(common-objpfx)shlib.lds: $(common-objpfx)config.make $(..)Makerules
+ 		  -Wl,--verbose 2>/dev/null | \
+ 	  sed > $@T \
+ 	      -e '/^=========/,/^=========/!d;/^=========/d' \
++		   -e 's/^.*\.gnu\.hash[ 	]*:.*$$/  .note.ABI-tag : { *(.note.ABI-tag) } &/' \
++		   -e '/^[ 	]*\.hash[ 	]*:.*$$/{h;d;}' \
++		   -e '/DATA_SEGMENT_ALIGN/{H;g}' \
+ 	      -e 's/^.*\*(\.dynbss).*$$/& \
+ 		 PROVIDE(__start___libc_freeres_ptrs = .); \
+ 		 *(__libc_freeres_ptrs) \
+-- 
+2.37.3
+
diff --git a/srcpkgs/glibc/patches/git-updates.patch b/srcpkgs/glibc/patches/git-updates.patch
new file mode 100644
index 000000000000..75551be32bb5
--- /dev/null
+++ b/srcpkgs/glibc/patches/git-updates.patch
@@ -0,0 +1,10900 @@
+From c3fda489cfdb2260f9fec706e6fd7259858c4467 Mon Sep 17 00:00:00 2001
+From: Tom Honermann <tom@honermann.net>
+Date: Sun, 24 Jul 2022 01:11:43 -0400
+Subject: [PATCH 01/72] stdlib: Suppress gcc diagnostic that char8_t is a
+ keyword in C++20 in uchar.h.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+gcc 13 issues the following diagnostic for the uchar.h header when the
+-Wc++20-compat option is enabled in C++ modes that do not enable char8_t
+as a builtin type (C++17 and earlier by default; subject to _GNU_SOURCE
+and the gcc -f[no-]char8_t option).
+  warning: identifier ‘char8_t’ is a keyword in C++20 [-Wc++20-compat]
+This change modifies the uchar.h header to suppress the diagnostic through
+the use of '#pragma GCC diagnostic' directives for gcc 10 and later (the
+-Wc++20-compat option was added in gcc version 10).  Unfortunately, a bug
+in gcc currently prevents those directives from having the intended effect
+as reported at https://gcc.gnu.org/PR106423.  A patch for that issue has
+been submitted and is available in the email thread archive linked below.
+  https://gcc.gnu.org/pipermail/gcc-patches/2022-July/598736.html
+
+(cherry picked from commit 825f84f133bd840347dc49229b6d831f07d04775)
+---
+ wcsmbs/uchar.h | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/wcsmbs/uchar.h b/wcsmbs/uchar.h
+index c37e8619a0..5f7139f279 100644
+--- a/wcsmbs/uchar.h
++++ b/wcsmbs/uchar.h
+@@ -34,8 +34,16 @@
+ /* Declare the C2x char8_t typedef in C2x modes, but only if the C++
+   __cpp_char8_t feature test macro is not defined.  */
+ #if __GLIBC_USE (ISOC2X) && !defined __cpp_char8_t
++#if __GNUC_PREREQ (10, 0) && defined __cplusplus
++/* Suppress the diagnostic regarding char8_t being a keyword in C++20.  */
++# pragma GCC diagnostic push
++# pragma GCC diagnostic ignored "-Wc++20-compat"
++#endif
+ /* Define the 8-bit character type.  */
+ typedef unsigned char char8_t;
++#if __GNUC_PREREQ (10, 0) && defined __cplusplus
++# pragma GCC diagnostic pop
++#endif
+ #endif
+ 
+ #ifndef __USE_ISOCXX11
+-- 
+2.38.1
+
+
+From 33f1b4c1452b33991e670f636ebe98b90a405e10 Mon Sep 17 00:00:00 2001
+From: "H.J. Lu" <hjl.tools@gmail.com>
+Date: Fri, 29 Jul 2022 10:50:56 -0700
+Subject: [PATCH 02/72] wcsmbs: Add missing test-c8rtomb/test-mbrtoc8
+ dependency
+
+Make test-c8rtomb.out and test-mbrtoc8.out depend on $(gen-locales) for
+
+  xsetlocale (LC_ALL, "de_DE.UTF-8");
+  xsetlocale (LC_ALL, "zh_HK.BIG5-HKSCS");
+
+Reviewed-by: Sunil K Pandey <skpgkp2@gmail.com>
+Reviewed-by: Carlos O'Donell <carlos@redhat.com>
+(cherry picked from commit e03f5ccd6cc8f829416156eac75acee501626c1f)
+---
+ wcsmbs/Makefile | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/wcsmbs/Makefile b/wcsmbs/Makefile
+index e6b9e8743a..3d19d5556f 100644
+--- a/wcsmbs/Makefile
++++ b/wcsmbs/Makefile
+@@ -73,6 +73,8 @@ $(objpfx)tst-wcstol-locale.out: $(gen-locales)
+ $(objpfx)tst-wcstod-nan-locale.out: $(gen-locales)
+ $(objpfx)tst-c16-surrogate.out: $(gen-locales)
+ $(objpfx)tst-c32-state.out: $(gen-locales)
++$(objpfx)test-c8rtomb.out: $(gen-locales)
++$(objpfx)test-mbrtoc8.out: $(gen-locales)
+ endif
+ 
+ $(objpfx)tst-wcstod-round: $(libm)
+-- 
+2.38.1
+
+
+From c74bb93cfdb04d49155b0e30983a3c866167bbca Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Thu, 4 Aug 2022 17:54:48 +0200
+Subject: [PATCH 03/72] dlfcn: Pass caller pointer to static dlopen
+ implementation (bug 29446)
+
+Fixes commit 0c1c3a771eceec46e66ce1183cf988e2303bd373 ("dlfcn: Move
+dlopen into libc").
+
+(cherry picked from commit ed0185e4129130cbe081c221efb758fb400623ce)
+---
+ NEWS           | 7 +++++++
+ dlfcn/dlopen.c | 2 +-
+ 2 files changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/NEWS b/NEWS
+index f61e521fc8..15f3dd2cdb 100644
+--- a/NEWS
++++ b/NEWS
+@@ -4,6 +4,13 @@ See the end for copying conditions.
+ 
+ Please send GNU C library bug reports via <https://sourceware.org/bugzilla/>
+ using `glibc' in the "product" field.
++\f
++Version 2.36.1
++
++The following bugs are resolved with this release:
++
++  [29446] _dlopen now ignores dl_caller argument in static mode
++
+ \f
+ Version 2.36
+ 
+diff --git a/dlfcn/dlopen.c b/dlfcn/dlopen.c
+index 2696dde4b1..9b07b4e132 100644
+--- a/dlfcn/dlopen.c
++++ b/dlfcn/dlopen.c
+@@ -90,7 +90,7 @@ compat_symbol (libdl, ___dlopen, dlopen, GLIBC_2_1);
+ void *
+ __dlopen (const char *file, int mode, void *dl_caller)
+ {
+-  return dlopen_implementation (file, mode, RETURN_ADDRESS (0));
++  return dlopen_implementation (file, mode, dl_caller);
+ }
+ 
+ void *
+-- 
+2.38.1
+
+
+From ac47d8f6cf9744139adb12f540fb9cc610cac579 Mon Sep 17 00:00:00 2001
+From: Joseph Myers <joseph@codesourcery.com>
+Date: Tue, 2 Aug 2022 21:05:07 +0000
+Subject: [PATCH 04/72] Update syscall lists for Linux 5.19
+
+Linux 5.19 has no new syscalls, but enables memfd_secret in the uapi
+headers for RISC-V.  Update the version number in syscall-names.list
+to reflect that it is still current for 5.19 and regenerate the
+arch-syscall.h headers with build-many-glibcs.py update-syscalls.
+
+Tested with build-many-glibcs.py.
+
+(cherry picked from commit fccadcdf5bed7ee67a6cef4714e0b477d6c8472c)
+---
+ sysdeps/unix/sysv/linux/riscv/rv32/arch-syscall.h | 1 +
+ sysdeps/unix/sysv/linux/riscv/rv64/arch-syscall.h | 1 +
+ sysdeps/unix/sysv/linux/syscall-names.list        | 4 ++--
+ 3 files changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/arch-syscall.h b/sysdeps/unix/sysv/linux/riscv/rv32/arch-syscall.h
+index bf4be80f8d..202520ee25 100644
+--- a/sysdeps/unix/sysv/linux/riscv/rv32/arch-syscall.h
++++ b/sysdeps/unix/sysv/linux/riscv/rv32/arch-syscall.h
+@@ -122,6 +122,7 @@
+ #define __NR_mbind 235
+ #define __NR_membarrier 283
+ #define __NR_memfd_create 279
++#define __NR_memfd_secret 447
+ #define __NR_migrate_pages 238
+ #define __NR_mincore 232
+ #define __NR_mkdirat 34
+diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/arch-syscall.h b/sysdeps/unix/sysv/linux/riscv/rv64/arch-syscall.h
+index d656aedcc2..4e65f337d4 100644
+--- a/sysdeps/unix/sysv/linux/riscv/rv64/arch-syscall.h
++++ b/sysdeps/unix/sysv/linux/riscv/rv64/arch-syscall.h
+@@ -127,6 +127,7 @@
+ #define __NR_mbind 235
+ #define __NR_membarrier 283
+ #define __NR_memfd_create 279
++#define __NR_memfd_secret 447
+ #define __NR_migrate_pages 238
+ #define __NR_mincore 232
+ #define __NR_mkdirat 34
+diff --git a/sysdeps/unix/sysv/linux/syscall-names.list b/sysdeps/unix/sysv/linux/syscall-names.list
+index 6c7b2f7011..028ad3107a 100644
+--- a/sysdeps/unix/sysv/linux/syscall-names.list
++++ b/sysdeps/unix/sysv/linux/syscall-names.list
+@@ -21,8 +21,8 @@
+ # This file can list all potential system calls.  The names are only
+ # used if the installed kernel headers also provide them.
+ 
+-# The list of system calls is current as of Linux 5.18.
+-kernel 5.18
++# The list of system calls is current as of Linux 5.19.
++kernel 5.19
+ 
+ FAST_atomic_update
+ FAST_cmpxchg
+-- 
+2.38.1
+
+
+From 302bc33bc53c787da6e74162a7092e9c0fb964a8 Mon Sep 17 00:00:00 2001
+From: Noah Goldstein <goldstein.w.n@gmail.com>
+Date: Mon, 8 Aug 2022 11:26:22 +0800
+Subject: [PATCH 05/72] elf: Replace `strcpy` call with `memcpy` [BZ #29454]
+
+GCC normally does this optimization for us in
+strlen_pass::handle_builtin_strcpy but only for optimized
+build. To avoid needing to include strcpy.S in the rtld build to
+support the debug build, just do the optimization by hand.
+
+(cherry picked from commit 483cfe1a6a33d6335b1901581b41040d2d412511)
+---
+ elf/dl-cache.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/elf/dl-cache.c b/elf/dl-cache.c
+index 8bbf110d02..b97c17b3a9 100644
+--- a/elf/dl-cache.c
++++ b/elf/dl-cache.c
+@@ -509,8 +509,9 @@ _dl_load_cache_lookup (const char *name)
+      we are accessing. Therefore we must make the copy of the
+      mapping data without using malloc.  */
+   char *temp;
+-  temp = alloca (strlen (best) + 1);
+-  strcpy (temp, best);
++  size_t best_len = strlen (best) + 1;
++  temp = alloca (best_len);
++  memcpy (temp, best, best_len);
+   return __strdup (temp);
+ }
+ 
+-- 
+2.38.1
+
+
+From e982657073c4db21459ffd9e17bc505b1d64b876 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Mon, 15 Aug 2022 16:43:59 +0200
+Subject: [PATCH 06/72] Linux: Terminate subprocess on late failure in
+ tst-pidfd (bug 29485)
+
+Reviewed-by: Carlos O'Donell <carlos@redhat.com>
+(cherry picked from commit f82e05ebb295cadd35f7372f652c72264da810ad)
+---
+ NEWS                                | 1 +
+ sysdeps/unix/sysv/linux/tst-pidfd.c | 7 +++++--
+ 2 files changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/NEWS b/NEWS
+index 15f3dd2cdb..f8fb8db510 100644
+--- a/NEWS
++++ b/NEWS
+@@ -10,6 +10,7 @@ Version 2.36.1
+ The following bugs are resolved with this release:
+ 
+   [29446] _dlopen now ignores dl_caller argument in static mode
++  [29485] Linux: Terminate subprocess on late failure in tst-pidfd
+ 
+ \f
+ Version 2.36
+diff --git a/sysdeps/unix/sysv/linux/tst-pidfd.c b/sysdeps/unix/sysv/linux/tst-pidfd.c
+index 037af22290..5711d1c312 100644
+--- a/sysdeps/unix/sysv/linux/tst-pidfd.c
++++ b/sysdeps/unix/sysv/linux/tst-pidfd.c
+@@ -147,8 +147,11 @@ do_test (void)
+        may be denied if the process doesn't have CAP_SYS_PTRACE or
+        if a LSM security_ptrace_access_check denies access.  */
+     if (fd == -1 && errno == EPERM)
+-      FAIL_UNSUPPORTED ("don't have permission to use pidfd_getfd on pidfd, "
+-			"skipping test");
++      {
++	TEST_COMPARE (pidfd_send_signal (pidfd, SIGKILL, NULL, 0), 0);
++	FAIL_UNSUPPORTED ("don't have permission to use pidfd_getfd on pidfd, "
++			  "skipping test");
++      }
+     TEST_VERIFY (fd > 0);
+ 
+     char *path = xasprintf ("/proc/%d/fd/%d", pid, remote_fd);
+-- 
+2.38.1
+
+
+From 8b139cd4f1074ae0d95d9bff60db283a1ed72734 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Mon, 22 Aug 2022 11:04:47 +0200
+Subject: [PATCH 07/72] alpha: Fix generic brk system call emulation in
+ __brk_call (bug 29490)
+
+The kernel special-cases the zero argument for alpha brk, and we can
+use that to restore the generic Linux error handling behavior.
+
+Fixes commit b57ab258c1140bc45464b4b9908713e3e0ee35aa ("Linux:
+Introduce __brk_call for invoking the brk system call").
+
+(cherry picked from commit e7ad26ee3cb74e61d0637c888f24dd478d77af58)
+---
+ NEWS                                     | 1 +
+ sysdeps/unix/sysv/linux/alpha/brk_call.h | 7 +++----
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/NEWS b/NEWS
+index f8fb8db510..becab3ade9 100644
+--- a/NEWS
++++ b/NEWS
+@@ -11,6 +11,7 @@ The following bugs are resolved with this release:
+ 
+   [29446] _dlopen now ignores dl_caller argument in static mode
+   [29485] Linux: Terminate subprocess on late failure in tst-pidfd
++  [29490] alpha: New __brk_call implementation is broken
+ 
+ \f
+ Version 2.36
+diff --git a/sysdeps/unix/sysv/linux/alpha/brk_call.h b/sysdeps/unix/sysv/linux/alpha/brk_call.h
+index b8088cf13f..0b851b6c86 100644
+--- a/sysdeps/unix/sysv/linux/alpha/brk_call.h
++++ b/sysdeps/unix/sysv/linux/alpha/brk_call.h
+@@ -21,8 +21,7 @@ __brk_call (void *addr)
+ {
+   unsigned long int result = INTERNAL_SYSCALL_CALL (brk, addr);
+   if (result == -ENOMEM)
+-    /* Mimic the default error reporting behavior.  */
+-    return addr;
+-  else
+-    return (void *) result;
++    /* Mimic the generic error reporting behavior.  */
++    result = INTERNAL_SYSCALL_CALL (brk, 0);
++  return (void *) result;
+ }
+-- 
+2.38.1
+
+
+From d13a7a6f100576b1e30dc044b2e0c4cbcb6196f6 Mon Sep 17 00:00:00 2001
+From: Arjun Shankar <arjun@redhat.com>
+Date: Tue, 2 Aug 2022 11:10:25 +0200
+Subject: [PATCH 08/72] socket: Check lengths before advancing pointer in
+ CMSG_NXTHDR
+
+The inline and library functions that the CMSG_NXTHDR macro may expand
+to increment the pointer to the header before checking the stride of
+the increment against available space.  Since C only allows incrementing
+pointers to one past the end of an array, the increment must be done
+after a length check.  This commit fixes that and includes a regression
+test for CMSG_FIRSTHDR and CMSG_NXTHDR.
+
+The Linux, Hurd, and generic headers are all changed.
+
+Tested on Linux on armv7hl, i686, x86_64, aarch64, ppc64le, and s390x.
+
+[BZ #28846]
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit 9c443ac4559a47ed99859bd80d14dc4b6dd220a1)
+---
+ bits/socket.h                         | 40 ++++++++++--
+ socket/Makefile                       |  1 +
+ socket/tst-cmsghdr-skeleton.c         | 92 +++++++++++++++++++++++++++
+ socket/tst-cmsghdr.c                  | 56 ++++++++++++++++
+ sysdeps/mach/hurd/bits/socket.h       | 40 ++++++++++--
+ sysdeps/unix/sysv/linux/bits/socket.h | 40 ++++++++++--
+ sysdeps/unix/sysv/linux/cmsg_nxthdr.c | 36 ++++++++---
+ 7 files changed, 276 insertions(+), 29 deletions(-)
+ create mode 100644 socket/tst-cmsghdr-skeleton.c
+ create mode 100644 socket/tst-cmsghdr.c
+
+diff --git a/bits/socket.h b/bits/socket.h
+index 2b99dea33b..aac8c49b00 100644
+--- a/bits/socket.h
++++ b/bits/socket.h
+@@ -245,6 +245,12 @@ struct cmsghdr
+ 			 + CMSG_ALIGN (sizeof (struct cmsghdr)))
+ #define CMSG_LEN(len)   (CMSG_ALIGN (sizeof (struct cmsghdr)) + (len))
+ 
++/* Given a length, return the additional padding necessary such that
++   len + __CMSG_PADDING(len) == CMSG_ALIGN (len).  */
++#define __CMSG_PADDING(len) ((sizeof (size_t) \
++                              - ((len) & (sizeof (size_t) - 1))) \
++                             & (sizeof (size_t) - 1))
++
+ extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr,
+ 				      struct cmsghdr *__cmsg) __THROW;
+ #ifdef __USE_EXTERN_INLINES
+@@ -254,18 +260,38 @@ extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr,
+ _EXTERN_INLINE struct cmsghdr *
+ __NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg))
+ {
++  /* We may safely assume that __cmsg lies between __mhdr->msg_control and
++     __mhdr->msg_controllen because the user is required to obtain the first
++     cmsg via CMSG_FIRSTHDR, set its length, then obtain subsequent cmsgs
++     via CMSG_NXTHDR, setting lengths along the way.  However, we don't yet
++     trust the value of __cmsg->cmsg_len and therefore do not use it in any
++     pointer arithmetic until we check its value.  */
++
++  unsigned char * __msg_control_ptr = (unsigned char *) __mhdr->msg_control;
++  unsigned char * __cmsg_ptr = (unsigned char *) __cmsg;
++
++  size_t __size_needed = sizeof (struct cmsghdr)
++                         + __CMSG_PADDING (__cmsg->cmsg_len);
++
++  /* The current header is malformed, too small to be a full header.  */
+   if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr))
+-    /* The kernel header does this so there may be a reason.  */
+     return (struct cmsghdr *) 0;
+ 
++  /* There isn't enough space between __cmsg and the end of the buffer to
++  hold the current cmsg *and* the next one.  */
++  if (((size_t)
++         (__msg_control_ptr + __mhdr->msg_controllen - __cmsg_ptr)
++       < __size_needed)
++      || ((size_t)
++            (__msg_control_ptr + __mhdr->msg_controllen - __cmsg_ptr
++             - __size_needed)
++          < __cmsg->cmsg_len))
++
++    return (struct cmsghdr *) 0;
++
++  /* Now, we trust cmsg_len and can use it to find the next header.  */
+   __cmsg = (struct cmsghdr *) ((unsigned char *) __cmsg
+ 			       + CMSG_ALIGN (__cmsg->cmsg_len));
+-  if ((unsigned char *) (__cmsg + 1) > ((unsigned char *) __mhdr->msg_control
+-					+ __mhdr->msg_controllen)
+-      || ((unsigned char *) __cmsg + CMSG_ALIGN (__cmsg->cmsg_len)
+-	  > ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen)))
+-    /* No more entries.  */
+-    return (struct cmsghdr *) 0;
+   return __cmsg;
+ }
+ #endif	/* Use `extern inline'.  */
+diff --git a/socket/Makefile b/socket/Makefile
+index 156eec6c85..2bde78387f 100644
+--- a/socket/Makefile
++++ b/socket/Makefile
+@@ -34,6 +34,7 @@ routines := accept bind connect getpeername getsockname getsockopt	\
+ tests := \
+   tst-accept4 \
+   tst-sockopt \
++  tst-cmsghdr \
+   # tests
+ 
+ tests-internal := \
+diff --git a/socket/tst-cmsghdr-skeleton.c b/socket/tst-cmsghdr-skeleton.c
+new file mode 100644
+index 0000000000..4c6898569b
+--- /dev/null
++++ b/socket/tst-cmsghdr-skeleton.c
+@@ -0,0 +1,92 @@
++/* Test ancillary data header creation.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++/* We use the preprocessor to generate the function/macro tests instead of
++   using indirection because having all the macro expansions alongside
++   each other lets the compiler warn us about suspicious pointer
++   arithmetic across subsequent CMSG_{FIRST,NXT}HDR expansions.  */
++
++#include <stdint.h>
++
++#define RUN_TEST_CONCAT(suffix) run_test_##suffix
++#define RUN_TEST_FUNCNAME(suffix) RUN_TEST_CONCAT (suffix)
++
++static void
++RUN_TEST_FUNCNAME (CMSG_NXTHDR_IMPL) (void)
++{
++  struct msghdr m = {0};
++  struct cmsghdr *cmsg;
++  char cmsgbuf[3 * CMSG_SPACE (sizeof (PAYLOAD))] = {0};
++
++  m.msg_control = cmsgbuf;
++  m.msg_controllen = sizeof (cmsgbuf);
++
++  /* First header should point to the start of the buffer.  */
++  cmsg = CMSG_FIRSTHDR (&m);
++  TEST_VERIFY_EXIT ((char *) cmsg == cmsgbuf);
++
++  /* If the first header length consumes the entire buffer, there is no
++     space remaining for additional headers.  */
++  cmsg->cmsg_len = sizeof (cmsgbuf);
++  cmsg = CMSG_NXTHDR_IMPL (&m, cmsg);
++  TEST_VERIFY_EXIT (cmsg == NULL);
++
++  /* The first header length is so big, using it would cause an overflow.  */
++  cmsg = CMSG_FIRSTHDR (&m);
++  TEST_VERIFY_EXIT ((char *) cmsg == cmsgbuf);
++  cmsg->cmsg_len = SIZE_MAX;
++  cmsg = CMSG_NXTHDR_IMPL (&m, cmsg);
++  TEST_VERIFY_EXIT (cmsg == NULL);
++
++  /* The first header leaves just enough space to hold another header.  */
++  cmsg = CMSG_FIRSTHDR (&m);
++  TEST_VERIFY_EXIT ((char *) cmsg == cmsgbuf);
++  cmsg->cmsg_len = sizeof (cmsgbuf) - sizeof (struct cmsghdr);
++  cmsg = CMSG_NXTHDR_IMPL (&m, cmsg);
++  TEST_VERIFY_EXIT (cmsg != NULL);
++
++  /* The first header leaves space but not enough for another header.  */
++  cmsg = CMSG_FIRSTHDR (&m);
++  TEST_VERIFY_EXIT ((char *) cmsg == cmsgbuf);
++  cmsg->cmsg_len ++;
++  cmsg = CMSG_NXTHDR_IMPL (&m, cmsg);
++  TEST_VERIFY_EXIT (cmsg == NULL);
++
++  /* The second header leaves just enough space to hold another header.  */
++  cmsg = CMSG_FIRSTHDR (&m);
++  TEST_VERIFY_EXIT ((char *) cmsg == cmsgbuf);
++  cmsg->cmsg_len = CMSG_LEN (sizeof (PAYLOAD));
++  cmsg = CMSG_NXTHDR_IMPL (&m, cmsg);
++  TEST_VERIFY_EXIT (cmsg != NULL);
++  cmsg->cmsg_len = sizeof (cmsgbuf)
++                   - CMSG_SPACE (sizeof (PAYLOAD)) /* First header.  */
++                   - sizeof (struct cmsghdr);
++  cmsg = CMSG_NXTHDR_IMPL (&m, cmsg);
++  TEST_VERIFY_EXIT (cmsg != NULL);
++
++  /* The second header leaves space but not enough for another header.  */
++  cmsg = CMSG_FIRSTHDR (&m);
++  TEST_VERIFY_EXIT ((char *) cmsg == cmsgbuf);
++  cmsg = CMSG_NXTHDR_IMPL (&m, cmsg);
++  TEST_VERIFY_EXIT (cmsg != NULL);
++  cmsg->cmsg_len ++;
++  cmsg = CMSG_NXTHDR_IMPL (&m, cmsg);
++  TEST_VERIFY_EXIT (cmsg == NULL);
++
++  return;
++}
+diff --git a/socket/tst-cmsghdr.c b/socket/tst-cmsghdr.c
+new file mode 100644
+index 0000000000..68c96d3c9d
+--- /dev/null
++++ b/socket/tst-cmsghdr.c
+@@ -0,0 +1,56 @@
++/* Test ancillary data header creation.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <sys/socket.h>
++#include <gnu/lib-names.h>
++#include <support/xdlfcn.h>
++#include <support/check.h>
++
++#define PAYLOAD "Hello, World!"
++
++/* CMSG_NXTHDR is a macro that calls an inline function defined in
++   bits/socket.h.  In case the function cannot be inlined, libc.so carries
++   a copy.  Both versions need to be tested.  */
++
++#define CMSG_NXTHDR_IMPL CMSG_NXTHDR
++#include "tst-cmsghdr-skeleton.c"
++#undef CMSG_NXTHDR_IMPL
++
++static struct cmsghdr * (* cmsg_nxthdr) (struct msghdr *, struct cmsghdr *);
++
++#define CMSG_NXTHDR_IMPL cmsg_nxthdr
++#include "tst-cmsghdr-skeleton.c"
++#undef CMSG_NXTHDR_IMPL
++
++static int
++do_test (void)
++{
++  static void *handle;
++
++  run_test_CMSG_NXTHDR ();
++
++  handle = xdlopen (LIBC_SO, RTLD_LAZY);
++  cmsg_nxthdr = (struct cmsghdr * (*) (struct msghdr *, struct cmsghdr *))
++                  xdlsym (handle, "__cmsg_nxthdr");
++
++  run_test_cmsg_nxthdr ();
++
++  return 0;
++}
++
++#include <support/test-driver.c>
+diff --git a/sysdeps/mach/hurd/bits/socket.h b/sysdeps/mach/hurd/bits/socket.h
+index 5b35ea81ec..70fce4fb27 100644
+--- a/sysdeps/mach/hurd/bits/socket.h
++++ b/sysdeps/mach/hurd/bits/socket.h
+@@ -249,6 +249,12 @@ struct cmsghdr
+ 			 + CMSG_ALIGN (sizeof (struct cmsghdr)))
+ #define CMSG_LEN(len)   (CMSG_ALIGN (sizeof (struct cmsghdr)) + (len))
+ 
++/* Given a length, return the additional padding necessary such that
++   len + __CMSG_PADDING(len) == CMSG_ALIGN (len).  */
++#define __CMSG_PADDING(len) ((sizeof (size_t) \
++                              - ((len) & (sizeof (size_t) - 1))) \
++                             & (sizeof (size_t) - 1))
++
+ extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr,
+ 				      struct cmsghdr *__cmsg) __THROW;
+ #ifdef __USE_EXTERN_INLINES
+@@ -258,18 +264,38 @@ extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr,
+ _EXTERN_INLINE struct cmsghdr *
+ __NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg))
+ {
++  /* We may safely assume that __cmsg lies between __mhdr->msg_control and
++     __mhdr->msg_controllen because the user is required to obtain the first
++     cmsg via CMSG_FIRSTHDR, set its length, then obtain subsequent cmsgs
++     via CMSG_NXTHDR, setting lengths along the way.  However, we don't yet
++     trust the value of __cmsg->cmsg_len and therefore do not use it in any
++     pointer arithmetic until we check its value.  */
++
++  unsigned char * __msg_control_ptr = (unsigned char *) __mhdr->msg_control;
++  unsigned char * __cmsg_ptr = (unsigned char *) __cmsg;
++
++  size_t __size_needed = sizeof (struct cmsghdr)
++                         + __CMSG_PADDING (__cmsg->cmsg_len);
++
++  /* The current header is malformed, too small to be a full header.  */
+   if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr))
+-    /* The kernel header does this so there may be a reason.  */
+     return (struct cmsghdr *) 0;
+ 
++  /* There isn't enough space between __cmsg and the end of the buffer to
++  hold the current cmsg *and* the next one.  */
++  if (((size_t)
++         (__msg_control_ptr + __mhdr->msg_controllen - __cmsg_ptr)
++       < __size_needed)
++      || ((size_t)
++            (__msg_control_ptr + __mhdr->msg_controllen - __cmsg_ptr
++             - __size_needed)
++          < __cmsg->cmsg_len))
++
++    return (struct cmsghdr *) 0;
++
++  /* Now, we trust cmsg_len and can use it to find the next header.  */
+   __cmsg = (struct cmsghdr *) ((unsigned char *) __cmsg
+ 			       + CMSG_ALIGN (__cmsg->cmsg_len));
+-  if ((unsigned char *) (__cmsg + 1) > ((unsigned char *) __mhdr->msg_control
+-					+ __mhdr->msg_controllen)
+-      || ((unsigned char *) __cmsg + CMSG_ALIGN (__cmsg->cmsg_len)
+-	  > ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen)))
+-    /* No more entries.  */
+-    return (struct cmsghdr *) 0;
+   return __cmsg;
+ }
+ #endif	/* Use `extern inline'.  */
+diff --git a/sysdeps/unix/sysv/linux/bits/socket.h b/sysdeps/unix/sysv/linux/bits/socket.h
+index 4f1f810ea1..539b8d7716 100644
+--- a/sysdeps/unix/sysv/linux/bits/socket.h
++++ b/sysdeps/unix/sysv/linux/bits/socket.h
+@@ -307,6 +307,12 @@ struct cmsghdr
+ 			 + CMSG_ALIGN (sizeof (struct cmsghdr)))
+ #define CMSG_LEN(len)   (CMSG_ALIGN (sizeof (struct cmsghdr)) + (len))
+ 
++/* Given a length, return the additional padding necessary such that
++   len + __CMSG_PADDING(len) == CMSG_ALIGN (len).  */
++#define __CMSG_PADDING(len) ((sizeof (size_t) \
++                              - ((len) & (sizeof (size_t) - 1))) \
++                             & (sizeof (size_t) - 1))
++
+ extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr,
+ 				      struct cmsghdr *__cmsg) __THROW;
+ #ifdef __USE_EXTERN_INLINES
+@@ -316,18 +322,38 @@ extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr,
+ _EXTERN_INLINE struct cmsghdr *
+ __NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg))
+ {
++  /* We may safely assume that __cmsg lies between __mhdr->msg_control and
++     __mhdr->msg_controllen because the user is required to obtain the first
++     cmsg via CMSG_FIRSTHDR, set its length, then obtain subsequent cmsgs
++     via CMSG_NXTHDR, setting lengths along the way.  However, we don't yet
++     trust the value of __cmsg->cmsg_len and therefore do not use it in any
++     pointer arithmetic until we check its value.  */
++
++  unsigned char * __msg_control_ptr = (unsigned char *) __mhdr->msg_control;
++  unsigned char * __cmsg_ptr = (unsigned char *) __cmsg;
++
++  size_t __size_needed = sizeof (struct cmsghdr)
++                         + __CMSG_PADDING (__cmsg->cmsg_len);
++
++  /* The current header is malformed, too small to be a full header.  */
+   if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr))
+-    /* The kernel header does this so there may be a reason.  */
+     return (struct cmsghdr *) 0;
+ 
++  /* There isn't enough space between __cmsg and the end of the buffer to
++  hold the current cmsg *and* the next one.  */
++  if (((size_t)
++         (__msg_control_ptr + __mhdr->msg_controllen - __cmsg_ptr)
++       < __size_needed)
++      || ((size_t)
++            (__msg_control_ptr + __mhdr->msg_controllen - __cmsg_ptr
++             - __size_needed)
++          < __cmsg->cmsg_len))
++
++    return (struct cmsghdr *) 0;
++
++  /* Now, we trust cmsg_len and can use it to find the next header.  */
+   __cmsg = (struct cmsghdr *) ((unsigned char *) __cmsg
+ 			       + CMSG_ALIGN (__cmsg->cmsg_len));
+-  if ((unsigned char *) (__cmsg + 1) > ((unsigned char *) __mhdr->msg_control
+-					+ __mhdr->msg_controllen)
+-      || ((unsigned char *) __cmsg + CMSG_ALIGN (__cmsg->cmsg_len)
+-	  > ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen)))
+-    /* No more entries.  */
+-    return (struct cmsghdr *) 0;
+   return __cmsg;
+ }
+ #endif	/* Use `extern inline'.  */
+diff --git a/sysdeps/unix/sysv/linux/cmsg_nxthdr.c b/sysdeps/unix/sysv/linux/cmsg_nxthdr.c
+index 15b7a3a925..24f72b797a 100644
+--- a/sysdeps/unix/sysv/linux/cmsg_nxthdr.c
++++ b/sysdeps/unix/sysv/linux/cmsg_nxthdr.c
+@@ -23,18 +23,38 @@
+ struct cmsghdr *
+ __cmsg_nxthdr (struct msghdr *mhdr, struct cmsghdr *cmsg)
+ {
++  /* We may safely assume that cmsg lies between mhdr->msg_control and
++     mhdr->msg_controllen because the user is required to obtain the first
++     cmsg via CMSG_FIRSTHDR, set its length, then obtain subsequent cmsgs
++     via CMSG_NXTHDR, setting lengths along the way.  However, we don't yet
++     trust the value of cmsg->cmsg_len and therefore do not use it in any
++     pointer arithmetic until we check its value.  */
++
++  unsigned char * msg_control_ptr = (unsigned char *) mhdr->msg_control;
++  unsigned char * cmsg_ptr = (unsigned char *) cmsg;
++
++  size_t size_needed = sizeof (struct cmsghdr)
++                       + __CMSG_PADDING (cmsg->cmsg_len);
++
++  /* The current header is malformed, too small to be a full header.  */
+   if ((size_t) cmsg->cmsg_len < sizeof (struct cmsghdr))
+-    /* The kernel header does this so there may be a reason.  */
+-    return NULL;
++    return (struct cmsghdr *) 0;
++
++  /* There isn't enough space between cmsg and the end of the buffer to
++  hold the current cmsg *and* the next one.  */
++  if (((size_t)
++         (msg_control_ptr + mhdr->msg_controllen - cmsg_ptr)
++       < size_needed)
++      || ((size_t)
++            (msg_control_ptr + mhdr->msg_controllen - cmsg_ptr
++             - size_needed)
++          < cmsg->cmsg_len))
++
++    return (struct cmsghdr *) 0;
+ 
++  /* Now, we trust cmsg_len and can use it to find the next header.  */
+   cmsg = (struct cmsghdr *) ((unsigned char *) cmsg
+ 			     + CMSG_ALIGN (cmsg->cmsg_len));
+-  if ((unsigned char *) (cmsg + 1) > ((unsigned char *) mhdr->msg_control
+-				      + mhdr->msg_controllen)
+-      || ((unsigned char *) cmsg + CMSG_ALIGN (cmsg->cmsg_len)
+-	  > ((unsigned char *) mhdr->msg_control + mhdr->msg_controllen)))
+-    /* No more entries.  */
+-    return NULL;
+   return cmsg;
+ }
+ libc_hidden_def (__cmsg_nxthdr)
+-- 
+2.38.1
+
+
+From 5c62874f423af93e97b51bc9a57af228a546156f Mon Sep 17 00:00:00 2001
+From: Arjun Shankar <arjun@redhat.com>
+Date: Mon, 22 Aug 2022 18:21:14 +0200
+Subject: [PATCH 09/72] NEWS: Add entry for bug 28846
+
+---
+ NEWS | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/NEWS b/NEWS
+index becab3ade9..ae30900bbc 100644
+--- a/NEWS
++++ b/NEWS
+@@ -9,6 +9,7 @@ Version 2.36.1
+ 
+ The following bugs are resolved with this release:
+ 
++  [28846] CMSG_NXTHDR may trigger -Wstrict-overflow warning
+   [29446] _dlopen now ignores dl_caller argument in static mode
+   [29485] Linux: Terminate subprocess on late failure in tst-pidfd
+   [29490] alpha: New __brk_call implementation is broken
+-- 
+2.38.1
+
+
+From 0062e7dd1c3674ece2daca53a898badd28b60421 Mon Sep 17 00:00:00 2001
+From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Wed, 10 Aug 2022 16:24:06 -0300
+Subject: [PATCH 10/72] glibcextract.py: Add compile_c_snippet
+
+It might be used on tests to check if a snippet build with the provided
+compiler and flags.
+
+Reviewed-by: Florian Weimer <fweimer@redhat.com>
+(cherry picked from commit 841afa116e32b3c7195475769c26bf46fd870d32)
+---
+ scripts/glibcextract.py | 19 +++++++++++++++++++
+ 1 file changed, 19 insertions(+)
+
+diff --git a/scripts/glibcextract.py b/scripts/glibcextract.py
+index 43ab58ffe2..36d204c9b0 100644
+--- a/scripts/glibcextract.py
++++ b/scripts/glibcextract.py
+@@ -17,6 +17,7 @@
+ # License along with the GNU C Library; if not, see
+ # <https://www.gnu.org/licenses/>.
+ 
++import collections
+ import os.path
+ import re
+ import subprocess
+@@ -173,3 +174,21 @@ def compare_macro_consts(source_1, source_2, cc, macro_re, exclude_re=None,
+             if not allow_extra_2:
+                 ret = 1
+     return ret
++
++CompileResult = collections.namedtuple("CompileResult", "returncode output")
++
++def compile_c_snippet(snippet, cc, extra_cc_args=''):
++    """Compile and return whether the SNIPPET can be build with CC along
++       EXTRA_CC_ARGS compiler flags.  Return a CompileResult with RETURNCODE
++       being 0 for success, or the failure value and the compiler output.
++    """
++    with tempfile.TemporaryDirectory() as temp_dir:
++        c_file_name = os.path.join(temp_dir, 'test.c')
++        obj_file_name = os.path.join(temp_dir, 'test.o')
++        with open(c_file_name, 'w') as c_file:
++            c_file.write(snippet + '\n')
++        cmd = cc.split() + extra_cc_args.split() + ['-c', '-o', obj_file_name,
++                c_file_name]
++        r = subprocess.run(cmd, check=False, stdout=subprocess.PIPE,
++                stderr=subprocess.STDOUT)
++        return CompileResult(r.returncode, r.stdout)
+-- 
+2.38.1
+
+
+From 1cc5513114e76083669cba1b11252aad35525e69 Mon Sep 17 00:00:00 2001
+From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Wed, 10 Aug 2022 14:24:44 -0300
+Subject: [PATCH 11/72] linux: Use compile_c_snippet to check linux/pidfd.h
+ availability
+
+Instead of tying to a specific kernel version.
+
+Checked on x86_64-linux-gnu.
+
+Reviewed-by: Florian Weimer <fweimer@redhat.com>
+(cherry picked from commit 1542019b69b7ec7b2cd34357af035e406d153631)
+---
+ sysdeps/unix/sysv/linux/tst-pidfd-consts.py | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/sysdeps/unix/sysv/linux/tst-pidfd-consts.py b/sysdeps/unix/sysv/linux/tst-pidfd-consts.py
+index 90cbb9be64..d732173abd 100644
+--- a/sysdeps/unix/sysv/linux/tst-pidfd-consts.py
++++ b/sysdeps/unix/sysv/linux/tst-pidfd-consts.py
+@@ -33,11 +33,13 @@ def main():
+                         help='C compiler (including options) to use')
+     args = parser.parse_args()
+ 
+-    linux_version_headers = glibcsyscalls.linux_kernel_version(args.cc)
+-    # Linux started to provide pidfd.h with 5.10.
+-    if linux_version_headers < (5, 10):
++    if glibcextract.compile_c_snippet(
++            '#include <linux/pidfd.h>',
++            args.cc).returncode != 0:
+         sys.exit (77)
+-    linux_version_glibc = (5, 18)
++
++    linux_version_headers = glibcsyscalls.linux_kernel_version(args.cc)
++    linux_version_glibc = (5, 19)
+     sys.exit(glibcextract.compare_macro_consts(
+                 '#include <sys/pidfd.h>\n',
+                 '#include <asm/fcntl.h>\n'
+-- 
+2.38.1
+
+
+From 4dad97e2a2e510c6b53a0add29a2188714fcf4ab Mon Sep 17 00:00:00 2001
+From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Wed, 10 Aug 2022 14:24:45 -0300
+Subject: [PATCH 12/72] linux: Mimic kernel defition for BLOCK_SIZE
+
+To avoid possible warnings if the kernel header is included before
+sys/mount.h.
+
+Reviewed-by: Florian Weimer <fweimer@redhat.com>
+(cherry picked from commit c68b6044bc7945716431f1adc091b17c39b80a06)
+---
+ sysdeps/unix/sysv/linux/sys/mount.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/sysdeps/unix/sysv/linux/sys/mount.h b/sysdeps/unix/sysv/linux/sys/mount.h
+index f965986ba8..df6b0dbb42 100644
+--- a/sysdeps/unix/sysv/linux/sys/mount.h
++++ b/sysdeps/unix/sysv/linux/sys/mount.h
+@@ -27,8 +27,8 @@
+ #include <stddef.h>
+ #include <sys/ioctl.h>
+ 
+-#define BLOCK_SIZE	1024
+ #define BLOCK_SIZE_BITS	10
++#define BLOCK_SIZE	(1<<BLOCK_SIZE_BITS)
+ 
+ 
+ /* These are the fs-independent mount-flags: up to 16 flags are
+-- 
+2.38.1
+
+
+From d48813227b63a0d92ea357ea0733229ed74e31ab Mon Sep 17 00:00:00 2001
+From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Wed, 10 Aug 2022 14:24:46 -0300
+Subject: [PATCH 13/72] linux: Use compile_c_snippet to check linux/mount.h
+ availability
+
+Checked on x86_64-linux-gnu.
+
+Reviewed-by: Florian Weimer <fweimer@redhat.com>
+(cherry picked from commit e1226cdc6b209539a92d32d5b620ba53fd35abf3)
+---
+ sysdeps/unix/sysv/linux/tst-mount-consts.py | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/sysdeps/unix/sysv/linux/tst-mount-consts.py b/sysdeps/unix/sysv/linux/tst-mount-consts.py
+index a62f803123..be2ef2daf1 100755
+--- a/sysdeps/unix/sysv/linux/tst-mount-consts.py
++++ b/sysdeps/unix/sysv/linux/tst-mount-consts.py
+@@ -33,6 +33,11 @@ def main():
+                         help='C compiler (including options) to use')
+     args = parser.parse_args()
+ 
++    if glibcextract.compile_c_snippet(
++            '#include <linux/mount.h>',
++            args.cc).returncode != 0:
++        sys.exit (77)
++
+     linux_version_headers = glibcsyscalls.linux_kernel_version(args.cc)
+     # Constants in glibc were updated to match Linux v5.16.  When glibc
+     # constants are updated this value should be updated to match the
+-- 
+2.38.1
+
+
+From bb1e8b0ca99b5cbedfae3e6245528a87d95ff3e2 Mon Sep 17 00:00:00 2001
+From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Wed, 10 Aug 2022 14:24:47 -0300
+Subject: [PATCH 14/72] linux: Fix sys/mount.h usage with kernel headers
+
+Now that kernel exports linux/mount.h and includes it on linux/fs.h,
+its definitions might clash with glibc exports sys/mount.h.  To avoid
+the need to rearrange the Linux header to be always after glibc one,
+the glibc sys/mount.h is changed to:
+
+  1. Undefine the macros also used as enum constants.  This covers prior
+     inclusion of <linux/mount.h> (for instance MS_RDONLY).
+
+  2. Include <linux/mount.h> based on the usual __has_include check
+     (needs to use __has_include ("linux/mount.h") to paper over GCC
+     bugs.
+
+  3. Define enum fsconfig_command only if FSOPEN_CLOEXEC is not defined.
+     (FSOPEN_CLOEXEC should be a very close proxy.)
+
+  4. Define struct mount_attr if MOUNT_ATTR_SIZE_VER0 is not defined.
+     (Added in the same commit on the Linux side.)
+
+This patch also adds some tests to check if including linux/fs.h and
+linux/mount.h after and before sys/mount.h does work.
+
+Checked on x86_64-linux-gnu.
+
+Reviewed-by: Florian Weimer <fweimer@redhat.com>
+(cherry picked from commit 774058d72942249f71d74e7f2b639f77184160a6)
+---
+ sysdeps/unix/sysv/linux/Makefile             |  8 +++
+ sysdeps/unix/sysv/linux/sys/mount.h          | 71 +++++++++++++++++---
+ sysdeps/unix/sysv/linux/tst-mount-compile.py | 66 ++++++++++++++++++
+ 3 files changed, 137 insertions(+), 8 deletions(-)
+ create mode 100755 sysdeps/unix/sysv/linux/tst-mount-compile.py
+
+diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
+index a139a16532..3ceda9fdbf 100644
+--- a/sysdeps/unix/sysv/linux/Makefile
++++ b/sysdeps/unix/sysv/linux/Makefile
+@@ -265,6 +265,14 @@ $(objpfx)tst-mount-consts.out: ../sysdeps/unix/sysv/linux/tst-mount-consts.py
+ 	  < /dev/null > $@ 2>&1; $(evaluate-test)
+ $(objpfx)tst-mount-consts.out: $(sysdeps-linux-python-deps)
+ 
++tests-special += $(objpfx)tst-mount-compile.out
++$(objpfx)tst-mount-compile.out: ../sysdeps/unix/sysv/linux/tst-mount-compile.py
++	$(sysdeps-linux-python) \
++	  ../sysdeps/unix/sysv/linux/tst-mount-compile.py \
++	    $(sysdeps-linux-python-cc) \
++	  < /dev/null > $@ 2>&1; $(evaluate-test)
++$(objpfx)tst-mount-compile.out: $(sysdeps-linux-python-deps)
++
+ tst-rseq-disable-ENV = GLIBC_TUNABLES=glibc.pthread.rseq=0
+ 
+ endif # $(subdir) == misc
+diff --git a/sysdeps/unix/sysv/linux/sys/mount.h b/sysdeps/unix/sysv/linux/sys/mount.h
+index df6b0dbb42..2e3fd6a7fe 100644
+--- a/sysdeps/unix/sysv/linux/sys/mount.h
++++ b/sysdeps/unix/sysv/linux/sys/mount.h
+@@ -27,6 +27,13 @@
+ #include <stddef.h>
+ #include <sys/ioctl.h>
+ 
++#ifdef __has_include
++# if __has_include ("linux/mount.h")
++#  include "linux/mount.h"
++# endif
++#endif
++
++
+ #define BLOCK_SIZE_BITS	10
+ #define BLOCK_SIZE	(1<<BLOCK_SIZE_BITS)
+ 
+@@ -35,69 +42,98 @@
+    supported  */
+ enum
+ {
++#undef MS_RDONLY
+   MS_RDONLY = 1,		/* Mount read-only.  */
+ #define MS_RDONLY	MS_RDONLY
++#undef MS_NOSUID
+   MS_NOSUID = 2,		/* Ignore suid and sgid bits.  */
+ #define MS_NOSUID	MS_NOSUID
++#undef MS_NODEV
+   MS_NODEV = 4,			/* Disallow access to device special files.  */
+ #define MS_NODEV	MS_NODEV
++#undef MS_NOEXEC
+   MS_NOEXEC = 8,		/* Disallow program execution.  */
+ #define MS_NOEXEC	MS_NOEXEC
++#undef MS_SYNCHRONOUS
+   MS_SYNCHRONOUS = 16,		/* Writes are synced at once.  */
+ #define MS_SYNCHRONOUS	MS_SYNCHRONOUS
++#undef MS_REMOUNT
+   MS_REMOUNT = 32,		/* Alter flags of a mounted FS.  */
+ #define MS_REMOUNT	MS_REMOUNT
++#undef MS_MANDLOCK
+   MS_MANDLOCK = 64,		/* Allow mandatory locks on an FS.  */
+ #define MS_MANDLOCK	MS_MANDLOCK
++#undef MS_DIRSYNC
+   MS_DIRSYNC = 128,		/* Directory modifications are synchronous.  */
+ #define MS_DIRSYNC	MS_DIRSYNC
++#undef MS_NOSYMFOLLOW
+   MS_NOSYMFOLLOW = 256,		/* Do not follow symlinks.  */
+ #define MS_NOSYMFOLLOW	MS_NOSYMFOLLOW
++#undef MS_NOATIME
+   MS_NOATIME = 1024,		/* Do not update access times.  */
+ #define MS_NOATIME	MS_NOATIME
++#undef MS_NODIRATIME
+   MS_NODIRATIME = 2048,		/* Do not update directory access times.  */
+ #define MS_NODIRATIME	MS_NODIRATIME
++#undef MS_BIND
+   MS_BIND = 4096,		/* Bind directory at different place.  */
+ #define MS_BIND		MS_BIND
++#undef MS_MOVE
+   MS_MOVE = 8192,
+ #define MS_MOVE		MS_MOVE
++#undef MS_REC
+   MS_REC = 16384,
+ #define MS_REC		MS_REC
++#undef MS_SILENT
+   MS_SILENT = 32768,
+ #define MS_SILENT	MS_SILENT
++#undef MS_POSIXACL
+   MS_POSIXACL = 1 << 16,	/* VFS does not apply the umask.  */
+ #define MS_POSIXACL	MS_POSIXACL
++#undef MS_UNBINDABLE
+   MS_UNBINDABLE = 1 << 17,	/* Change to unbindable.  */
+ #define MS_UNBINDABLE	MS_UNBINDABLE
++#undef MS_PRIVATE
+   MS_PRIVATE = 1 << 18,		/* Change to private.  */
+ #define MS_PRIVATE	MS_PRIVATE
++#undef MS_SLAVE
+   MS_SLAVE = 1 << 19,		/* Change to slave.  */
+ #define MS_SLAVE	MS_SLAVE
++#undef MS_SHARED
+   MS_SHARED = 1 << 20,		/* Change to shared.  */
+ #define MS_SHARED	MS_SHARED
++#undef MS_RELATIME
+   MS_RELATIME = 1 << 21,	/* Update atime relative to mtime/ctime.  */
+ #define MS_RELATIME	MS_RELATIME
++#undef MS_KERNMOUNT
+   MS_KERNMOUNT = 1 << 22,	/* This is a kern_mount call.  */
+ #define MS_KERNMOUNT	MS_KERNMOUNT
++#undef MS_I_VERSION
+   MS_I_VERSION =  1 << 23,	/* Update inode I_version field.  */
+ #define MS_I_VERSION	MS_I_VERSION
++#undef MS_STRICTATIME
+   MS_STRICTATIME = 1 << 24,	/* Always perform atime updates.  */
+ #define MS_STRICTATIME	MS_STRICTATIME
++#undef MS_LAZYTIME
+   MS_LAZYTIME = 1 << 25,	/* Update the on-disk [acm]times lazily.  */
+ #define MS_LAZYTIME	MS_LAZYTIME
++#undef MS_ACTIVE
+   MS_ACTIVE = 1 << 30,
+ #define MS_ACTIVE	MS_ACTIVE
++#undef MS_NOUSER
+   MS_NOUSER = 1 << 31
+ #define MS_NOUSER	MS_NOUSER
+ };
+ 
+ /* Flags that can be altered by MS_REMOUNT  */
++#undef MS_RMT_MASK
+ #define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_I_VERSION \
+ 		     |MS_LAZYTIME)
+ 
+ 
+ /* Magic mount flag number. Has to be or-ed to the flag values.  */
+ 
++#undef MS_MGC_VAL
+ #define MS_MGC_VAL 0xc0ed0000	/* Magic flag number to indicate "new" flags */
+ #define MS_MGC_MSK 0xffff0000	/* Magic flag number mask */
+ 
+@@ -106,20 +142,35 @@ enum
+    is probably as bad and I don't want to create yet another include
+    file.  */
+ 
++#undef BLKROSET
+ #define BLKROSET   _IO(0x12, 93) /* Set device read-only (0 = read-write).  */
++#undef BLKROGET
+ #define BLKROGET   _IO(0x12, 94) /* Get read-only status (0 = read_write).  */
++#undef BLKRRPART
+ #define BLKRRPART  _IO(0x12, 95) /* Re-read partition table.  */
++#undef BLKGETSIZE
+ #define BLKGETSIZE _IO(0x12, 96) /* Return device size.  */
++#undef BLKFLSBUF
+ #define BLKFLSBUF  _IO(0x12, 97) /* Flush buffer cache.  */
++#undef BLKRASET
+ #define BLKRASET   _IO(0x12, 98) /* Set read ahead for block device.  */
++#undef BLKRAGET
+ #define BLKRAGET   _IO(0x12, 99) /* Get current read ahead setting.  */
++#undef BLKFRASET
+ #define BLKFRASET  _IO(0x12,100) /* Set filesystem read-ahead.  */
++#undef BLKFRAGET
+ #define BLKFRAGET  _IO(0x12,101) /* Get filesystem read-ahead.  */
++#undef BLKSECTSET
+ #define BLKSECTSET _IO(0x12,102) /* Set max sectors per request.  */
++#undef BLKSECTGET
+ #define BLKSECTGET _IO(0x12,103) /* Get max sectors per request.  */
++#undef BLKSSZGET
+ #define BLKSSZGET  _IO(0x12,104) /* Get block device sector size.  */
++#undef BLKBSZGET
+ #define BLKBSZGET  _IOR(0x12,112,size_t)
++#undef BLKBSZSET
+ #define BLKBSZSET  _IOW(0x12,113,size_t)
++#undef BLKGETSIZE64
+ #define BLKGETSIZE64 _IOR(0x12,114,size_t) /* return device size.  */
+ 
+ 
+@@ -157,6 +208,7 @@ enum
+ #define MOUNT_ATTR_NOSYMFOLLOW  0x00200000 /* Do not follow symlinks.  */
+ 
+ 
++#ifndef MOUNT_ATTR_SIZE_VER0
+ /* For mount_setattr.  */
+ struct mount_attr
+ {
+@@ -165,6 +217,7 @@ struct mount_attr
+   uint64_t propagation;
+   uint64_t userns_fd;
+ };
++#endif
+ 
+ #define MOUNT_ATTR_SIZE_VER0    32 /* sizeof first published struct */
+ 
+@@ -185,26 +238,28 @@ struct mount_attr
+ #define FSPICK_EMPTY_PATH       0x00000008
+ 
+ 
++#ifndef FSOPEN_CLOEXEC
+ /* The type of fsconfig call made.   */
+ enum fsconfig_command
+ {
+   FSCONFIG_SET_FLAG       = 0,    /* Set parameter, supplying no value */
+-#define FSCONFIG_SET_FLAG FSCONFIG_SET_FLAG
++# define FSCONFIG_SET_FLAG FSCONFIG_SET_FLAG
+   FSCONFIG_SET_STRING     = 1,    /* Set parameter, supplying a string value */
+-#define FSCONFIG_SET_STRING FSCONFIG_SET_STRING
++# define FSCONFIG_SET_STRING FSCONFIG_SET_STRING
+   FSCONFIG_SET_BINARY     = 2,    /* Set parameter, supplying a binary blob value */
+-#define FSCONFIG_SET_BINARY FSCONFIG_SET_BINARY
++# define FSCONFIG_SET_BINARY FSCONFIG_SET_BINARY
+   FSCONFIG_SET_PATH       = 3,    /* Set parameter, supplying an object by path */
+-#define FSCONFIG_SET_PATH FSCONFIG_SET_PATH
++# define FSCONFIG_SET_PATH FSCONFIG_SET_PATH
+   FSCONFIG_SET_PATH_EMPTY = 4,    /* Set parameter, supplying an object by (empty) path */
+-#define FSCONFIG_SET_PATH_EMPTY FSCONFIG_SET_PATH_EMPTY
++# define FSCONFIG_SET_PATH_EMPTY FSCONFIG_SET_PATH_EMPTY
+   FSCONFIG_SET_FD         = 5,    /* Set parameter, supplying an object by fd */
+-#define FSCONFIG_SET_FD FSCONFIG_SET_FD
++# define FSCONFIG_SET_FD FSCONFIG_SET_FD
+   FSCONFIG_CMD_CREATE     = 6,    /* Invoke superblock creation */
+-#define FSCONFIG_CMD_CREATE FSCONFIG_CMD_CREATE
++# define FSCONFIG_CMD_CREATE FSCONFIG_CMD_CREATE
+   FSCONFIG_CMD_RECONFIGURE = 7,   /* Invoke superblock reconfiguration */
+-#define FSCONFIG_CMD_RECONFIGURE FSCONFIG_CMD_RECONFIGURE
++# define FSCONFIG_CMD_RECONFIGURE FSCONFIG_CMD_RECONFIGURE
+ };
++#endif
+ 
+ /* open_tree flags.  */
+ #define OPEN_TREE_CLONE    1         /* Clone the target tree and attach the clone */
+diff --git a/sysdeps/unix/sysv/linux/tst-mount-compile.py b/sysdeps/unix/sysv/linux/tst-mount-compile.py
+new file mode 100755
+index 0000000000..0ec74d4e0b
+--- /dev/null
++++ b/sysdeps/unix/sysv/linux/tst-mount-compile.py
+@@ -0,0 +1,66 @@
++#!/usr/bin/python3
++# Check if glibc provided sys/mount.h can be used along related kernel
++# headers.
++# Copyright (C) 2022 Free Software Foundation, Inc.
++# This file is part of the GNU C Library.
++#
++# The GNU C Library is free software; you can redistribute it and/or
++# modify it under the terms of the GNU Lesser General Public
++# License as published by the Free Software Foundation; either
++# version 2.1 of the License, or (at your option) any later version.
++#
++# The GNU C Library is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++# Lesser General Public License for more details.
++#
++# You should have received a copy of the GNU Lesser General Public
++# License along with the GNU C Library; if not, see
++# <https://www.gnu.org/licenses/>.
++
++import argparse
++import sys
++
++import glibcextract
++
++
++def main():
++    """The main entry point."""
++    parser = argparse.ArgumentParser(
++        description='Check if glibc provided sys/mount.h can be '
++                    ' used along related kernel headers.')
++    parser.add_argument('--cc', metavar='CC',
++                        help='C compiler (including options) to use')
++    args = parser.parse_args()
++
++    if glibcextract.compile_c_snippet(
++            '#include <linux/mount.h>',
++            args.cc).returncode != 0:
++        sys.exit (77)
++
++    def check(testname, snippet):
++        # Add -Werror to catch macro redefinitions and _ISOMAC to avoid
++        # internal glibc definitions.
++        r = glibcextract.compile_c_snippet(snippet, args.cc,
++                '-Werror -D_ISOMAC')
++        if r.returncode != 0:
++            print('error: test {}:\n{}'.format(testname, r.output.decode()))
++        return r.returncode
++
++    status = max(
++        check("sys/mount.h + linux/mount.h",
++              "#include <sys/mount.h>\n"
++              "#include <linux/mount.h>"),
++        check("sys/mount.h + linux/fs.h",
++              "#include <sys/mount.h>\n"
++              "#include <linux/fs.h>"),
++        check("linux/mount.h + sys/mount.h",
++              "#include <linux/mount.h>\n"
++              "#include <sys/mount.h>"),
++        check("linux/fs.h + sys/mount.h",
++              "#include <linux/fs.h>\n"
++              "#include <sys/mount.h>"))
++    sys.exit(status)
++
++if __name__ == '__main__':
++    main()
+-- 
+2.38.1
+
+
+From 3bd3c612e98a53ce60ed972f5cd2b90628b3cba5 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 16 Aug 2022 09:25:23 +0200
+Subject: [PATCH 15/72] Linux: Fix enum fsconfig_command detection in
+ <sys/mount.h>
+
+The #ifdef FSOPEN_CLOEXEC check did not work because the macro
+was always defined in this header prior to the check, so that
+the <linux/mount.h> contents did not matter.
+
+Fixes commit 774058d72942249f71d74e7f2b639f77184160a6
+("linux: Fix sys/mount.h usage with kernel headers").
+
+(cherry picked from commit 2955ef4b7c9b56fcd7abfeddef7ee83c60abff98)
+---
+ sysdeps/unix/sysv/linux/sys/mount.h | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/sysdeps/unix/sysv/linux/sys/mount.h b/sysdeps/unix/sysv/linux/sys/mount.h
+index 2e3fd6a7fe..19841d0738 100644
+--- a/sysdeps/unix/sysv/linux/sys/mount.h
++++ b/sysdeps/unix/sysv/linux/sys/mount.h
+@@ -188,9 +188,6 @@ enum
+ };
+ 
+ 
+-/* fsopen flags.  */
+-#define FSOPEN_CLOEXEC          0x00000001
+-
+ /* fsmount flags.  */
+ #define FSMOUNT_CLOEXEC         0x00000001
+ 
+@@ -261,6 +258,9 @@ enum fsconfig_command
+ };
+ #endif
+ 
++/* fsopen flags.  */
++#define FSOPEN_CLOEXEC          0x00000001
++
+ /* open_tree flags.  */
+ #define OPEN_TREE_CLONE    1         /* Clone the target tree and attach the clone */
+ #define OPEN_TREE_CLOEXEC  O_CLOEXEC /* Close the file on execve() */
+-- 
+2.38.1
+
+
+From b0e7888d1fa2dbd2d9e1645ec8c796abf78880b9 Mon Sep 17 00:00:00 2001
+From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Sun, 28 Aug 2022 16:52:53 -0300
+Subject: [PATCH 16/72] syslog: Fix large messages (BZ#29536)
+
+The a583b6add407c17cd change did not handle large messages that
+would require a heap allocation correctly, where the message itself
+is not take in consideration.
+
+This patch fixes it and extend the tst-syslog to check for large
+messages as well.
+
+Checked on x86_64-linux-gnu.
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit 52a5be0df411ef3ff45c10c7c308cb92993d15b1)
+---
+ misc/syslog.c     |  18 +++---
+ misc/tst-syslog.c | 152 +++++++++++++++++++++++++++++++++++++++-------
+ 2 files changed, 142 insertions(+), 28 deletions(-)
+
+diff --git a/misc/syslog.c b/misc/syslog.c
+index 554089bfc4..b88f66c835 100644
+--- a/misc/syslog.c
++++ b/misc/syslog.c
+@@ -193,28 +193,32 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
+       int vl = __vsnprintf_internal (bufs + l, sizeof bufs - l, fmt, apc,
+                                      mode_flags);
+       if (0 <= vl && vl < sizeof bufs - l)
+-        {
+-          buf = bufs;
+-          bufsize = l + vl;
+-        }
++        buf = bufs;
++      bufsize = l + vl;
+ 
+       va_end (apc);
+     }
+ 
+   if (buf == NULL)
+     {
+-      buf = malloc (l * sizeof (char));
++      buf = malloc ((bufsize + 1) * sizeof (char));
+       if (buf != NULL)
+ 	{
+ 	  /* Tell the cancellation handler to free this buffer.  */
+ 	  clarg.buf = buf;
+ 
+ 	  if (has_ts)
+-	    __snprintf (bufs, sizeof bufs,
++	    __snprintf (buf, l + 1,
+ 			SYSLOG_HEADER (pri, timestamp, &msgoff, pid));
+ 	  else
+-	    __snprintf (bufs, sizeof bufs,
++	    __snprintf (buf, l + 1,
+ 			SYSLOG_HEADER_WITHOUT_TS (pri, &msgoff));
++
++	  va_list apc;
++	  va_copy (apc, ap);
++	  __vsnprintf_internal (buf + l, bufsize - l + 1, fmt, apc,
++				mode_flags);
++	  va_end (apc);
+ 	}
+       else
+         {
+diff --git a/misc/tst-syslog.c b/misc/tst-syslog.c
+index e550d15796..1d332ece53 100644
+--- a/misc/tst-syslog.c
++++ b/misc/tst-syslog.c
+@@ -68,21 +68,19 @@ static const int priorities[] =
+     LOG_DEBUG
+   };
+ 
+-enum
+-  {
+-    ident_length = 64,
+-    msg_length = 64
+-  };
++#define IDENT_LENGTH 64
++#define MSG_LENGTH   1024
+ 
+ #define SYSLOG_MSG_BASE "syslog_message"
+ #define OPENLOG_IDENT   "openlog_ident"
++static char large_message[MSG_LENGTH];
+ 
+ struct msg_t
+   {
+     int priority;
+     int facility;
+-    char ident[ident_length];
+-    char msg[msg_length];
++    char ident[IDENT_LENGTH];
++    char msg[MSG_LENGTH];
+     pid_t pid;
+   };
+ 
+@@ -147,6 +145,37 @@ check_syslog_message (const struct msg_t *msg, int msgnum, int options,
+   return true;
+ }
+ 
++static void
++send_syslog_large (int options)
++{
++  int facility = LOG_USER;
++  int priority = LOG_INFO;
++
++  syslog (facility | priority, "%s %d %d", large_message, facility,
++	  priority);
++}
++
++static void
++send_vsyslog_large (int options)
++{
++  int facility = LOG_USER;
++  int priority = LOG_INFO;
++
++  call_vsyslog (facility | priority, "%s %d %d", large_message, facility,
++		priority);
++}
++
++static bool
++check_syslog_message_large (const struct msg_t *msg, int msgnum, int options,
++			    pid_t pid)
++{
++  TEST_COMPARE (msg->facility, LOG_USER);
++  TEST_COMPARE (msg->priority, LOG_INFO);
++  TEST_COMPARE_STRING (msg->msg, large_message);
++
++  return false;
++}
++
+ static void
+ send_openlog (int options)
+ {
+@@ -179,6 +208,17 @@ send_openlog (int options)
+   closelog ();
+ }
+ 
++static void
++send_openlog_large (int options)
++{
++  /* Define a non-default IDENT and a not default facility.  */
++  openlog (OPENLOG_IDENT, options, LOG_LOCAL0);
++
++  syslog (LOG_INFO, "%s %d %d", large_message, LOG_LOCAL0, LOG_INFO);
++
++  closelog ();
++}
++
+ static bool
+ check_openlog_message (const struct msg_t *msg, int msgnum,
+                        int options, pid_t pid)
+@@ -189,7 +229,7 @@ check_openlog_message (const struct msg_t *msg, int msgnum,
+   int expected_priority = priorities[msgnum % array_length (priorities)];
+   TEST_COMPARE (msg->priority, expected_priority);
+ 
+-  char expected_ident[ident_length];
++  char expected_ident[IDENT_LENGTH];
+   snprintf (expected_ident, sizeof (expected_ident), "%s%s%.0d%s:",
+             OPENLOG_IDENT,
+             options & LOG_PID ? "[" : "",
+@@ -211,15 +251,38 @@ check_openlog_message (const struct msg_t *msg, int msgnum,
+   return true;
+ }
+ 
++static bool
++check_openlog_message_large (const struct msg_t *msg, int msgnum,
++			     int options, pid_t pid)
++{
++  char expected_ident[IDENT_LENGTH];
++  snprintf (expected_ident, sizeof (expected_ident), "%s%s%.0d%s:",
++            OPENLOG_IDENT,
++            options & LOG_PID ? "[" : "",
++            options & LOG_PID ? pid : 0,
++            options & LOG_PID ? "]" : "");
++
++  TEST_COMPARE_STRING (msg->ident, expected_ident);
++  TEST_COMPARE_STRING (msg->msg, large_message);
++  TEST_COMPARE (msg->priority, LOG_INFO);
++  TEST_COMPARE (msg->facility, LOG_LOCAL0);
++
++  return false;
++}
++
+ static struct msg_t
+ parse_syslog_msg (const char *msg)
+ {
+   struct msg_t r = { .pid = -1 };
+   int number;
+ 
++#define STRINPUT(size)  XSTRINPUT(size)
++#define XSTRINPUT(size) "%" # size "s"
++
+   /* The message in the form:
+-     <179>Apr  8 14:51:19 tst-syslog: syslog message 176 3  */
+-  int n = sscanf (msg, "<%3d>%*s %*d %*d:%*d:%*d %32s %64s %*d %*d",
++     <179>Apr  8 14:51:19  tst-syslog: message 176 3  */
++  int n = sscanf (msg, "<%3d>%*s %*d %*d:%*d:%*d " STRINPUT(IDENT_LENGTH)
++		       " " STRINPUT(MSG_LENGTH) " %*d %*d",
+                   &number, r.ident, r.msg);
+   TEST_COMPARE (n, 3);
+ 
+@@ -246,7 +309,7 @@ parse_syslog_console (const char *msg)
+ 
+   /* The message in the form:
+      openlog_ident: syslog_message 128 0  */
+-  int n = sscanf (msg, "%32s %64s %d %d",
++  int n = sscanf (msg, STRINPUT(IDENT_LENGTH) " " STRINPUT(MSG_LENGTH) " %d %d",
+       r.ident, r.msg, &facility, &priority);
+   TEST_COMPARE (n, 4);
+ 
+@@ -281,7 +344,7 @@ check_syslog_udp (void (*syslog_send)(int), int options,
+   int msgnum = 0;
+   while (1)
+     {
+-      char buf[512];
++      char buf[2048];
+       size_t l = xrecvfrom (server_udp, buf, sizeof (buf), 0,
+                             (struct sockaddr *) &addr, &addrlen);
+       buf[l] = '\0';
+@@ -325,7 +388,7 @@ check_syslog_tcp (void (*syslog_send)(int), int options,
+ 
+   int client_tcp = xaccept (server_tcp, NULL, NULL);
+ 
+-  char buf[512], *rb = buf;
++  char buf[2048], *rb = buf;
+   size_t rbl = sizeof (buf);
+   size_t prl = 0;  /* Track the size of the partial record.  */
+   int msgnum = 0;
+@@ -393,20 +456,34 @@ check_syslog_console_read (FILE *fp)
+ }
+ 
+ static void
+-check_syslog_console (void)
++check_syslog_console_read_large (FILE *fp)
++{
++  char buf[2048];
++  TEST_VERIFY (fgets (buf, sizeof (buf), fp) != NULL);
++  struct msg_t msg = parse_syslog_console (buf);
++
++  TEST_COMPARE_STRING (msg.ident, OPENLOG_IDENT ":");
++  TEST_COMPARE_STRING (msg.msg, large_message);
++  TEST_COMPARE (msg.priority, LOG_INFO);
++  TEST_COMPARE (msg.facility, LOG_LOCAL0);
++}
++
++static void
++check_syslog_console (void (*syslog_send)(int),
++		      void (*syslog_check)(FILE *fp))
+ {
+   xmkfifo (_PATH_CONSOLE, 0666);
+ 
+   pid_t sender_pid = xfork ();
+   if (sender_pid == 0)
+     {
+-      send_openlog (LOG_CONS);
++      syslog_send (LOG_CONS);
+       _exit (0);
+     }
+ 
+   {
+     FILE *fp = xfopen (_PATH_CONSOLE, "r+");
+-    check_syslog_console_read (fp);
++    syslog_check (fp);
+     xfclose (fp);
+   }
+ 
+@@ -425,16 +502,28 @@ send_openlog_callback (void *clousure)
+ }
+ 
+ static void
+-check_syslog_perror (void)
++send_openlog_callback_large (void *clousure)
++{
++  int options = *(int *) clousure;
++  send_openlog_large (options);
++}
++
++static void
++check_syslog_perror (bool large)
+ {
+   struct support_capture_subprocess result;
+-  result = support_capture_subprocess (send_openlog_callback,
++  result = support_capture_subprocess (large
++				       ? send_openlog_callback_large
++				       : send_openlog_callback,
+                                        &(int){LOG_PERROR});
+ 
+   FILE *mfp = fmemopen (result.err.buffer, result.err.length, "r");
+   if (mfp == NULL)
+     FAIL_EXIT1 ("fmemopen: %m");
+-  check_syslog_console_read (mfp);
++  if (large)
++    check_syslog_console_read_large (mfp);
++  else
++    check_syslog_console_read (mfp);
+   xfclose (mfp);
+ 
+   support_capture_subprocess_check (&result, "tst-openlog-child", 0,
+@@ -462,10 +551,31 @@ do_test (void)
+   check_syslog_tcp (send_openlog, LOG_PID, check_openlog_message);
+ 
+   /* Check the LOG_CONS option.  */
+-  check_syslog_console ();
++  check_syslog_console (send_openlog, check_syslog_console_read);
+ 
+   /* Check the LOG_PERROR option.  */
+-  check_syslog_perror ();
++  check_syslog_perror (false);
++
++  /* Similar tests as before, but with a large message to trigger the
++     syslog path that uses dynamically allocated memory.  */
++  memset (large_message, 'a', sizeof large_message - 1);
++  large_message[sizeof large_message - 1] = '\0';
++
++  check_syslog_udp (send_syslog_large, 0, check_syslog_message_large);
++  check_syslog_tcp (send_syslog_large, 0, check_syslog_message_large);
++
++  check_syslog_udp (send_vsyslog_large, 0, check_syslog_message_large);
++  check_syslog_tcp (send_vsyslog_large, 0, check_syslog_message_large);
++
++  check_syslog_udp (send_openlog_large, 0, check_openlog_message_large);
++  check_syslog_tcp (send_openlog_large, 0, check_openlog_message_large);
++
++  check_syslog_udp (send_openlog_large, LOG_PID, check_openlog_message_large);
++  check_syslog_tcp (send_openlog_large, LOG_PID, check_openlog_message_large);
++
++  check_syslog_console (send_openlog_large, check_syslog_console_read_large);
++
++  check_syslog_perror (true);
+ 
+   return 0;
+ }
+-- 
+2.38.1
+
+
+From 924e4f3eaa502ce82fccf8537f021a796d158771 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Fri, 26 Aug 2022 21:15:43 +0200
+Subject: [PATCH 17/72] elf: Call __libc_early_init for reused namespaces (bug
+ 29528)
+
+libc_map is never reset to NULL, neither during dlclose nor on a
+dlopen call which reuses the namespace structure.  As a result, if a
+namespace is reused, its libc is not initialized properly.  The most
+visible result is a crash in the <ctype.h> functions.
+
+To prevent similar bugs on namespace reuse from surfacing,
+unconditionally initialize the chosen namespace to zero using memset.
+
+(cherry picked from commit d0e357ff45a75553dee3b17ed7d303bfa544f6fe)
+---
+ NEWS                         |  1 +
+ elf/Makefile                 | 25 ++++++++++++++++++
+ elf/dl-open.c                | 13 ++++++----
+ elf/tst-dlmopen-twice-mod1.c | 37 ++++++++++++++++++++++++++
+ elf/tst-dlmopen-twice-mod2.c | 50 ++++++++++++++++++++++++++++++++++++
+ elf/tst-dlmopen-twice.c      | 34 ++++++++++++++++++++++++
+ 6 files changed, 155 insertions(+), 5 deletions(-)
+ create mode 100644 elf/tst-dlmopen-twice-mod1.c
+ create mode 100644 elf/tst-dlmopen-twice-mod2.c
+ create mode 100644 elf/tst-dlmopen-twice.c
+
+diff --git a/NEWS b/NEWS
+index ae30900bbc..6d31e5abba 100644
+--- a/NEWS
++++ b/NEWS
+@@ -13,6 +13,7 @@ The following bugs are resolved with this release:
+   [29446] _dlopen now ignores dl_caller argument in static mode
+   [29485] Linux: Terminate subprocess on late failure in tst-pidfd
+   [29490] alpha: New __brk_call implementation is broken
++  [29528] elf: Call __libc_early_init for reused namespaces
+ 
+ \f
+ Version 2.36
+diff --git a/elf/Makefile b/elf/Makefile
+index fd77d0c7c8..43353a4b08 100644
+--- a/elf/Makefile
++++ b/elf/Makefile
+@@ -408,6 +408,7 @@ tests += \
+   tst-dlmopen4 \
+   tst-dlmopen-dlerror \
+   tst-dlmopen-gethostbyname \
++  tst-dlmopen-twice \
+   tst-dlopenfail \
+   tst-dlopenfail-2 \
+   tst-dlopenrpath \
+@@ -834,6 +835,8 @@ modules-names += \
+   tst-dlmopen1mod \
+   tst-dlmopen-dlerror-mod \
+   tst-dlmopen-gethostbyname-mod \
++  tst-dlmopen-twice-mod1 \
++  tst-dlmopen-twice-mod2 \
+   tst-dlopenfaillinkmod \
+   tst-dlopenfailmod1 \
+   tst-dlopenfailmod2 \
+@@ -2967,3 +2970,25 @@ $(objpfx)tst-tls-allocation-failure-static-patched.out: \
+ 	grep -q '^Fatal glibc error: Cannot allocate TLS block$$' $@ \
+ 	  && grep -q '^status: 127$$' $@; \
+ 	  $(evaluate-test)
++
++$(objpfx)tst-audit-tlsdesc: $(objpfx)tst-audit-tlsdesc-mod1.so \
++			    $(objpfx)tst-audit-tlsdesc-mod2.so \
++			    $(shared-thread-library)
++ifeq (yes,$(have-mtls-dialect-gnu2))
++# The test is valid for all TLS types, but we want to exercise GNU2
++# TLS if possible.
++CFLAGS-tst-audit-tlsdesc-mod1.c += -mtls-dialect=gnu2
++CFLAGS-tst-audit-tlsdesc-mod2.c += -mtls-dialect=gnu2
++endif
++$(objpfx)tst-audit-tlsdesc-dlopen: $(shared-thread-library)
++$(objpfx)tst-audit-tlsdesc-dlopen.out: $(objpfx)tst-audit-tlsdesc-mod1.so \
++				       $(objpfx)tst-audit-tlsdesc-mod2.so
++$(objpfx)tst-audit-tlsdesc-mod1.so: $(objpfx)tst-audit-tlsdesc-mod2.so
++$(objpfx)tst-audit-tlsdesc.out: $(objpfx)tst-auditmod-tlsdesc.so
++tst-audit-tlsdesc-ENV = LD_AUDIT=$(objpfx)tst-auditmod-tlsdesc.so
++$(objpfx)tst-audit-tlsdesc-dlopen.out: $(objpfx)tst-auditmod-tlsdesc.so
++tst-audit-tlsdesc-dlopen-ENV = LD_AUDIT=$(objpfx)tst-auditmod-tlsdesc.so
++
++$(objpfx)tst-dlmopen-twice.out: \
++  $(objpfx)tst-dlmopen-twice-mod1.so \
++  $(objpfx)tst-dlmopen-twice-mod2.so
+diff --git a/elf/dl-open.c b/elf/dl-open.c
+index a23e65926b..46e8066fd8 100644
+--- a/elf/dl-open.c
++++ b/elf/dl-open.c
+@@ -844,11 +844,14 @@ _dl_open (const char *file, int mode, const void *caller_dlopen, Lmid_t nsid,
+ 	  _dl_signal_error (EINVAL, file, NULL, N_("\
+ no more namespaces available for dlmopen()"));
+ 	}
+-      else if (nsid == GL(dl_nns))
+-	{
+-	  __rtld_lock_initialize (GL(dl_ns)[nsid]._ns_unique_sym_table.lock);
+-	  ++GL(dl_nns);
+-	}
++
++      if (nsid == GL(dl_nns))
++	++GL(dl_nns);
++
++      /* Initialize the new namespace.  Most members are
++	 zero-initialized, only the lock needs special treatment.  */
++      memset (&GL(dl_ns)[nsid], 0, sizeof (GL(dl_ns)[nsid]));
++      __rtld_lock_initialize (GL(dl_ns)[nsid]._ns_unique_sym_table.lock);
+ 
+       _dl_debug_update (nsid)->r_state = RT_CONSISTENT;
+     }
+diff --git a/elf/tst-dlmopen-twice-mod1.c b/elf/tst-dlmopen-twice-mod1.c
+new file mode 100644
+index 0000000000..0eaf04948c
+--- /dev/null
++++ b/elf/tst-dlmopen-twice-mod1.c
+@@ -0,0 +1,37 @@
++/* Initialization of libc after dlmopen/dlclose/dlmopen (bug 29528).  Module 1.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <stdio.h>
++
++static void __attribute__ ((constructor))
++init (void)
++{
++  puts ("info: tst-dlmopen-twice-mod1.so loaded");
++  fflush (stdout);
++}
++
++static void __attribute__ ((destructor))
++fini (void)
++{
++  puts ("info: tst-dlmopen-twice-mod1.so about to be unloaded");
++  fflush (stdout);
++}
++
++/* Large allocation.  The second module does not have this, so it
++   should load libc at a different address.  */
++char large_allocate[16 * 1024 * 1024];
+diff --git a/elf/tst-dlmopen-twice-mod2.c b/elf/tst-dlmopen-twice-mod2.c
+new file mode 100644
+index 0000000000..40c6c01f96
+--- /dev/null
++++ b/elf/tst-dlmopen-twice-mod2.c
+@@ -0,0 +1,50 @@
++/* Initialization of libc after dlmopen/dlclose/dlmopen (bug 29528).  Module 2.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <ctype.h>
++#include <stdio.h>
++
++static void __attribute__ ((constructor))
++init (void)
++{
++  puts ("info: tst-dlmopen-twice-mod2.so loaded");
++  fflush (stdout);
++}
++
++static void __attribute__ ((destructor))
++fini (void)
++{
++  puts ("info: tst-dlmopen-twice-mod2.so about to be unloaded");
++  fflush (stdout);
++}
++
++int
++run_check (void)
++{
++  puts ("info: about to call isalpha");
++  fflush (stdout);
++
++  volatile char ch = 'a';
++  if (!isalpha (ch))
++    {
++      puts ("error: isalpha ('a') is not true");
++      fflush (stdout);
++      return 1;
++    }
++  return 0;
++}
+diff --git a/elf/tst-dlmopen-twice.c b/elf/tst-dlmopen-twice.c
+new file mode 100644
+index 0000000000..449f3c8fa9
+--- /dev/null
++++ b/elf/tst-dlmopen-twice.c
+@@ -0,0 +1,34 @@
++/* Initialization of libc after dlmopen/dlclose/dlmopen (bug 29528).  Main.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <support/xdlfcn.h>
++#include <support/check.h>
++
++static int
++do_test (void)
++{
++  void *handle = xdlmopen (LM_ID_NEWLM, "tst-dlmopen-twice-mod1.so", RTLD_NOW);
++  xdlclose (handle);
++  handle = xdlmopen (LM_ID_NEWLM, "tst-dlmopen-twice-mod2.so", RTLD_NOW);
++  int (*run_check) (void) = xdlsym (handle, "run_check");
++  TEST_COMPARE (run_check (), 0);
++  xdlclose (handle);
++  return 0;
++}
++
++#include <support/test-driver.c>
+-- 
+2.38.1
+
+
+From 3c791f2031ca8f6b99e96b774ed1c505ceb93595 Mon Sep 17 00:00:00 2001
+From: Raphael Moreira Zinsly <rzinsly@linux.ibm.com>
+Date: Wed, 24 Aug 2022 11:43:37 -0300
+Subject: [PATCH 18/72] Apply asm redirections in wchar.h before first use
+
+Similar to d0fa09a770, but for wchar.h.  Fixes [BZ #27087] by applying
+all long double related asm redirections before using functions in
+bits/wchar2.h.
+Moves the function declarations from wcsmbs/bits/wchar2.h to a new file
+wcsmbs/bits/wchar2-decl.h that will be included first in wcsmbs/wchar.h.
+
+Tested with build-many-glibcs.py.
+Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
+
+(cherry picked from commit c7509d49c4e8fa494120c5ead21338559dad16f5)
+---
+ include/bits/wchar2-decl.h |   1 +
+ wcsmbs/Makefile            |   5 +-
+ wcsmbs/bits/wchar2-decl.h  | 124 +++++++++++++++++++++++++++++++++++++
+ wcsmbs/bits/wchar2.h       |  72 ---------------------
+ wcsmbs/wchar.h             |  11 +++-
+ 5 files changed, 137 insertions(+), 76 deletions(-)
+ create mode 100644 include/bits/wchar2-decl.h
+ create mode 100644 wcsmbs/bits/wchar2-decl.h
+
+diff --git a/include/bits/wchar2-decl.h b/include/bits/wchar2-decl.h
+new file mode 100644
+index 0000000000..00b1b93342
+--- /dev/null
++++ b/include/bits/wchar2-decl.h
+@@ -0,0 +1 @@
++#include <wcsmbs/bits/wchar2-decl.h>
+diff --git a/wcsmbs/Makefile b/wcsmbs/Makefile
+index 3d19d5556f..4af102a3f6 100644
+--- a/wcsmbs/Makefile
++++ b/wcsmbs/Makefile
+@@ -22,8 +22,9 @@ subdir	:= wcsmbs
+ 
+ include ../Makeconfig
+ 
+-headers	:= wchar.h bits/wchar.h bits/wchar2.h bits/wchar-ldbl.h uchar.h \
+-	   bits/types/__mbstate_t.h bits/types/mbstate_t.h bits/types/wint_t.h
++headers	:= wchar.h bits/wchar.h bits/wchar2.h bits/wchar2-decl.h \
++	   bits/wchar-ldbl.h uchar.h bits/types/__mbstate_t.h \
++	   bits/types/mbstate_t.h bits/types/wint_t.h
+ 
+ routines := wcscat wcschr wcscmp wcscpy wcscspn wcsdup wcslen wcsncat \
+ 	    wcsncmp wcsncpy wcspbrk wcsrchr wcsspn wcstok wcsstr wmemchr \
+diff --git a/wcsmbs/bits/wchar2-decl.h b/wcsmbs/bits/wchar2-decl.h
+new file mode 100644
+index 0000000000..8e1735c33b
+--- /dev/null
++++ b/wcsmbs/bits/wchar2-decl.h
+@@ -0,0 +1,124 @@
++/* Checking macros for wchar functions.  Declarations only.
++   Copyright (C) 2004-2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#ifndef _BITS_WCHAR2_DECL_H
++#define _BITS_WCHAR2_DECL_H 1
++
++#ifndef _WCHAR_H
++# error "Never include <bits/wchar2-decl.h> directly; use <wchar.h> instead."
++#endif
++
++
++extern wchar_t *__wmemcpy_chk (wchar_t *__restrict __s1,
++			       const wchar_t *__restrict __s2, size_t __n,
++			       size_t __ns1) __THROW;
++extern wchar_t *__wmemmove_chk (wchar_t *__s1, const wchar_t *__s2,
++				size_t __n, size_t __ns1) __THROW;
++
++
++#ifdef __USE_GNU
++
++extern wchar_t *__wmempcpy_chk (wchar_t *__restrict __s1,
++				const wchar_t *__restrict __s2, size_t __n,
++				size_t __ns1) __THROW;
++
++#endif
++
++
++extern wchar_t *__wmemset_chk (wchar_t *__s, wchar_t __c, size_t __n,
++			       size_t __ns) __THROW;
++extern wchar_t *__wcscpy_chk (wchar_t *__restrict __dest,
++			      const wchar_t *__restrict __src,
++			      size_t __n) __THROW;
++extern wchar_t *__wcpcpy_chk (wchar_t *__restrict __dest,
++			      const wchar_t *__restrict __src,
++			      size_t __destlen) __THROW;
++extern wchar_t *__wcsncpy_chk (wchar_t *__restrict __dest,
++			       const wchar_t *__restrict __src, size_t __n,
++			       size_t __destlen) __THROW;
++extern wchar_t *__wcpncpy_chk (wchar_t *__restrict __dest,
++			       const wchar_t *__restrict __src, size_t __n,
++			       size_t __destlen) __THROW;
++extern wchar_t *__wcscat_chk (wchar_t *__restrict __dest,
++			      const wchar_t *__restrict __src,
++			      size_t __destlen) __THROW;
++extern wchar_t *__wcsncat_chk (wchar_t *__restrict __dest,
++			       const wchar_t *__restrict __src,
++			       size_t __n, size_t __destlen) __THROW;
++extern int __swprintf_chk (wchar_t *__restrict __s, size_t __n,
++			   int __flag, size_t __s_len,
++			   const wchar_t *__restrict __format, ...)
++     __THROW /* __attribute__ ((__format__ (__wprintf__, 5, 6))) */;
++extern int __vswprintf_chk (wchar_t *__restrict __s, size_t __n,
++			    int __flag, size_t __s_len,
++			    const wchar_t *__restrict __format,
++			    __gnuc_va_list __arg)
++     __THROW /* __attribute__ ((__format__ (__wprintf__, 5, 0))) */;
++
++#if __USE_FORTIFY_LEVEL > 1
++
++extern int __fwprintf_chk (__FILE *__restrict __stream, int __flag,
++			   const wchar_t *__restrict __format, ...);
++extern int __wprintf_chk (int __flag, const wchar_t *__restrict __format,
++			  ...);
++extern int __vfwprintf_chk (__FILE *__restrict __stream, int __flag,
++			    const wchar_t *__restrict __format,
++			    __gnuc_va_list __ap);
++extern int __vwprintf_chk (int __flag, const wchar_t *__restrict __format,
++			   __gnuc_va_list __ap);
++
++#endif
++
++extern wchar_t *__fgetws_chk (wchar_t *__restrict __s, size_t __size, int __n,
++			      __FILE *__restrict __stream) __wur;
++
++#ifdef __USE_GNU
++
++extern wchar_t *__fgetws_unlocked_chk (wchar_t *__restrict __s, size_t __size,
++				       int __n, __FILE *__restrict __stream)
++       __wur;
++
++#endif
++
++extern size_t __wcrtomb_chk (char *__restrict __s, wchar_t __wchar,
++			     mbstate_t *__restrict __p,
++			     size_t __buflen) __THROW __wur;
++extern size_t __mbsrtowcs_chk (wchar_t *__restrict __dst,
++			       const char **__restrict __src,
++			       size_t __len, mbstate_t *__restrict __ps,
++			       size_t __dstlen) __THROW;
++extern size_t __wcsrtombs_chk (char *__restrict __dst,
++			       const wchar_t **__restrict __src,
++			       size_t __len, mbstate_t *__restrict __ps,
++			       size_t __dstlen) __THROW;
++
++#ifdef	__USE_XOPEN2K8
++
++extern size_t __mbsnrtowcs_chk (wchar_t *__restrict __dst,
++				const char **__restrict __src, size_t __nmc,
++				size_t __len, mbstate_t *__restrict __ps,
++				size_t __dstlen) __THROW;
++extern size_t __wcsnrtombs_chk (char *__restrict __dst,
++				const wchar_t **__restrict __src,
++				size_t __nwc, size_t __len,
++				mbstate_t *__restrict __ps, size_t __dstlen)
++       __THROW;
++
++#endif
++
++#endif /* bits/wchar2-decl.h.  */
+diff --git a/wcsmbs/bits/wchar2.h b/wcsmbs/bits/wchar2.h
+index 0e017f458b..3f110efe57 100644
+--- a/wcsmbs/bits/wchar2.h
++++ b/wcsmbs/bits/wchar2.h
+@@ -21,9 +21,6 @@
+ #endif
+ 
+ 
+-extern wchar_t *__wmemcpy_chk (wchar_t *__restrict __s1,
+-			       const wchar_t *__restrict __s2, size_t __n,
+-			       size_t __ns1) __THROW;
+ extern wchar_t *__REDIRECT_NTH (__wmemcpy_alias,
+ 				(wchar_t *__restrict __s1,
+ 				 const wchar_t *__restrict __s2, size_t __n),
+@@ -45,8 +42,6 @@ __NTH (wmemcpy (wchar_t *__restrict __s1, const wchar_t *__restrict __s2,
+ }
+ 
+ 
+-extern wchar_t *__wmemmove_chk (wchar_t *__s1, const wchar_t *__s2,
+-				size_t __n, size_t __ns1) __THROW;
+ extern wchar_t *__REDIRECT_NTH (__wmemmove_alias, (wchar_t *__s1,
+ 						   const wchar_t *__s2,
+ 						   size_t __n), wmemmove);
+@@ -66,9 +61,6 @@ __NTH (wmemmove (wchar_t *__s1, const wchar_t *__s2, size_t __n))
+ 
+ 
+ #ifdef __USE_GNU
+-extern wchar_t *__wmempcpy_chk (wchar_t *__restrict __s1,
+-				const wchar_t *__restrict __s2, size_t __n,
+-				size_t __ns1) __THROW;
+ extern wchar_t *__REDIRECT_NTH (__wmempcpy_alias,
+ 				(wchar_t *__restrict __s1,
+ 				 const wchar_t *__restrict __s2,
+@@ -91,8 +83,6 @@ __NTH (wmempcpy (wchar_t *__restrict __s1, const wchar_t *__restrict __s2,
+ #endif
+ 
+ 
+-extern wchar_t *__wmemset_chk (wchar_t *__s, wchar_t __c, size_t __n,
+-			       size_t __ns) __THROW;
+ extern wchar_t *__REDIRECT_NTH (__wmemset_alias, (wchar_t *__s, wchar_t __c,
+ 						  size_t __n), wmemset);
+ extern wchar_t *__REDIRECT_NTH (__wmemset_chk_warn,
+@@ -110,9 +100,6 @@ __NTH (wmemset (wchar_t *__s, wchar_t __c, size_t __n))
+ }
+ 
+ 
+-extern wchar_t *__wcscpy_chk (wchar_t *__restrict __dest,
+-			      const wchar_t *__restrict __src,
+-			      size_t __n) __THROW;
+ extern wchar_t *__REDIRECT_NTH (__wcscpy_alias,
+ 				(wchar_t *__restrict __dest,
+ 				 const wchar_t *__restrict __src), wcscpy);
+@@ -127,9 +114,6 @@ __NTH (wcscpy (wchar_t *__restrict __dest, const wchar_t *__restrict __src))
+ }
+ 
+ 
+-extern wchar_t *__wcpcpy_chk (wchar_t *__restrict __dest,
+-			      const wchar_t *__restrict __src,
+-			      size_t __destlen) __THROW;
+ extern wchar_t *__REDIRECT_NTH (__wcpcpy_alias,
+ 				(wchar_t *__restrict __dest,
+ 				 const wchar_t *__restrict __src), wcpcpy);
+@@ -144,9 +128,6 @@ __NTH (wcpcpy (wchar_t *__restrict __dest, const wchar_t *__restrict __src))
+ }
+ 
+ 
+-extern wchar_t *__wcsncpy_chk (wchar_t *__restrict __dest,
+-			       const wchar_t *__restrict __src, size_t __n,
+-			       size_t __destlen) __THROW;
+ extern wchar_t *__REDIRECT_NTH (__wcsncpy_alias,
+ 				(wchar_t *__restrict __dest,
+ 				 const wchar_t *__restrict __src,
+@@ -168,9 +149,6 @@ __NTH (wcsncpy (wchar_t *__restrict __dest, const wchar_t *__restrict __src,
+ }
+ 
+ 
+-extern wchar_t *__wcpncpy_chk (wchar_t *__restrict __dest,
+-			       const wchar_t *__restrict __src, size_t __n,
+-			       size_t __destlen) __THROW;
+ extern wchar_t *__REDIRECT_NTH (__wcpncpy_alias,
+ 				(wchar_t *__restrict __dest,
+ 				 const wchar_t *__restrict __src,
+@@ -192,9 +170,6 @@ __NTH (wcpncpy (wchar_t *__restrict __dest, const wchar_t *__restrict __src,
+ }
+ 
+ 
+-extern wchar_t *__wcscat_chk (wchar_t *__restrict __dest,
+-			      const wchar_t *__restrict __src,
+-			      size_t __destlen) __THROW;
+ extern wchar_t *__REDIRECT_NTH (__wcscat_alias,
+ 				(wchar_t *__restrict __dest,
+ 				 const wchar_t *__restrict __src), wcscat);
+@@ -209,9 +184,6 @@ __NTH (wcscat (wchar_t *__restrict __dest, const wchar_t *__restrict __src))
+ }
+ 
+ 
+-extern wchar_t *__wcsncat_chk (wchar_t *__restrict __dest,
+-			       const wchar_t *__restrict __src,
+-			       size_t __n, size_t __destlen) __THROW;
+ extern wchar_t *__REDIRECT_NTH (__wcsncat_alias,
+ 				(wchar_t *__restrict __dest,
+ 				 const wchar_t *__restrict __src,
+@@ -228,10 +200,6 @@ __NTH (wcsncat (wchar_t *__restrict __dest, const wchar_t *__restrict __src,
+ }
+ 
+ 
+-extern int __swprintf_chk (wchar_t *__restrict __s, size_t __n,
+-			   int __flag, size_t __s_len,
+-			   const wchar_t *__restrict __format, ...)
+-     __THROW /* __attribute__ ((__format__ (__wprintf__, 5, 6))) */;
+ 
+ extern int __REDIRECT_NTH_LDBL (__swprintf_alias,
+ 				(wchar_t *__restrict __s, size_t __n,
+@@ -258,11 +226,6 @@ __NTH (swprintf (wchar_t *__restrict __s, size_t __n,
+    : swprintf (s, n, __VA_ARGS__))
+ #endif
+ 
+-extern int __vswprintf_chk (wchar_t *__restrict __s, size_t __n,
+-			    int __flag, size_t __s_len,
+-			    const wchar_t *__restrict __format,
+-			    __gnuc_va_list __arg)
+-     __THROW /* __attribute__ ((__format__ (__wprintf__, 5, 0))) */;
+ 
+ extern int __REDIRECT_NTH_LDBL (__vswprintf_alias,
+ 				(wchar_t *__restrict __s, size_t __n,
+@@ -283,16 +246,6 @@ __NTH (vswprintf (wchar_t *__restrict __s, size_t __n,
+ 
+ #if __USE_FORTIFY_LEVEL > 1
+ 
+-extern int __fwprintf_chk (__FILE *__restrict __stream, int __flag,
+-			   const wchar_t *__restrict __format, ...);
+-extern int __wprintf_chk (int __flag, const wchar_t *__restrict __format,
+-			  ...);
+-extern int __vfwprintf_chk (__FILE *__restrict __stream, int __flag,
+-			    const wchar_t *__restrict __format,
+-			    __gnuc_va_list __ap);
+-extern int __vwprintf_chk (int __flag, const wchar_t *__restrict __format,
+-			   __gnuc_va_list __ap);
+-
+ # ifdef __va_arg_pack
+ __fortify_function int
+ wprintf (const wchar_t *__restrict __fmt, ...)
+@@ -328,8 +281,6 @@ vfwprintf (__FILE *__restrict __stream,
+ 
+ #endif
+ 
+-extern wchar_t *__fgetws_chk (wchar_t *__restrict __s, size_t __size, int __n,
+-			      __FILE *__restrict __stream) __wur;
+ extern wchar_t *__REDIRECT (__fgetws_alias,
+ 			    (wchar_t *__restrict __s, int __n,
+ 			     __FILE *__restrict __stream), fgetws) __wur;
+@@ -351,9 +302,6 @@ fgetws (wchar_t *__restrict __s, int __n, __FILE *__restrict __stream)
+ }
+ 
+ #ifdef __USE_GNU
+-extern wchar_t *__fgetws_unlocked_chk (wchar_t *__restrict __s, size_t __size,
+-				       int __n, __FILE *__restrict __stream)
+-  __wur;
+ extern wchar_t *__REDIRECT (__fgetws_unlocked_alias,
+ 			    (wchar_t *__restrict __s, int __n,
+ 			     __FILE *__restrict __stream), fgetws_unlocked)
+@@ -379,9 +327,6 @@ fgetws_unlocked (wchar_t *__restrict __s, int __n, __FILE *__restrict __stream)
+ #endif
+ 
+ 
+-extern size_t __wcrtomb_chk (char *__restrict __s, wchar_t __wchar,
+-			     mbstate_t *__restrict __p,
+-			     size_t __buflen) __THROW __wur;
+ extern size_t __REDIRECT_NTH (__wcrtomb_alias,
+ 			      (char *__restrict __s, wchar_t __wchar,
+ 			       mbstate_t *__restrict __ps), wcrtomb) __wur;
+@@ -404,10 +349,6 @@ __NTH (wcrtomb (char *__restrict __s, wchar_t __wchar,
+ }
+ 
+ 
+-extern size_t __mbsrtowcs_chk (wchar_t *__restrict __dst,
+-			       const char **__restrict __src,
+-			       size_t __len, mbstate_t *__restrict __ps,
+-			       size_t __dstlen) __THROW;
+ extern size_t __REDIRECT_NTH (__mbsrtowcs_alias,
+ 			      (wchar_t *__restrict __dst,
+ 			       const char **__restrict __src,
+@@ -431,10 +372,6 @@ __NTH (mbsrtowcs (wchar_t *__restrict __dst, const char **__restrict __src,
+ }
+ 
+ 
+-extern size_t __wcsrtombs_chk (char *__restrict __dst,
+-			       const wchar_t **__restrict __src,
+-			       size_t __len, mbstate_t *__restrict __ps,
+-			       size_t __dstlen) __THROW;
+ extern size_t __REDIRECT_NTH (__wcsrtombs_alias,
+ 			      (char *__restrict __dst,
+ 			       const wchar_t **__restrict __src,
+@@ -458,10 +395,6 @@ __NTH (wcsrtombs (char *__restrict __dst, const wchar_t **__restrict __src,
+ 
+ 
+ #ifdef	__USE_XOPEN2K8
+-extern size_t __mbsnrtowcs_chk (wchar_t *__restrict __dst,
+-				const char **__restrict __src, size_t __nmc,
+-				size_t __len, mbstate_t *__restrict __ps,
+-				size_t __dstlen) __THROW;
+ extern size_t __REDIRECT_NTH (__mbsnrtowcs_alias,
+ 			      (wchar_t *__restrict __dst,
+ 			       const char **__restrict __src, size_t __nmc,
+@@ -485,11 +418,6 @@ __NTH (mbsnrtowcs (wchar_t *__restrict __dst, const char **__restrict __src,
+ }
+ 
+ 
+-extern size_t __wcsnrtombs_chk (char *__restrict __dst,
+-				const wchar_t **__restrict __src,
+-				size_t __nwc, size_t __len,
+-				mbstate_t *__restrict __ps, size_t __dstlen)
+-     __THROW;
+ extern size_t __REDIRECT_NTH (__wcsnrtombs_alias,
+ 			      (char *__restrict __dst,
+ 			       const wchar_t **__restrict __src,
+diff --git a/wcsmbs/wchar.h b/wcsmbs/wchar.h
+index 5d6a40853d..c1321c7518 100644
+--- a/wcsmbs/wchar.h
++++ b/wcsmbs/wchar.h
+@@ -864,14 +864,21 @@ extern size_t wcsftime_l (wchar_t *__restrict __s, size_t __maxsize,
+ 
+ /* Define some macros helping to catch buffer overflows.  */
+ #if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function
+-# include <bits/wchar2.h>
++/* Declare all functions from bits/wchar2-decl.h first.  */
++# include <bits/wchar2-decl.h>
+ #endif
+ 
+-#include <bits/floatn.h>
++/* The following headers provide asm redirections.  These redirections must
++   appear before the first usage of these functions, e.g. in bits/wchar.h.  */
+ #if defined __LDBL_COMPAT || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1
+ # include <bits/wchar-ldbl.h>
+ #endif
+ 
++#if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function
++/* Now include the function definitions and redirects too.  */
++# include <bits/wchar2.h>
++#endif
++
+ __END_DECLS
+ 
+ #endif /* wchar.h  */
+-- 
+2.38.1
+
+
+From b3736d1a3c60a3ec9959bf3b38794958546bf6a2 Mon Sep 17 00:00:00 2001
+From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Tue, 30 Aug 2022 13:35:52 -0300
+Subject: [PATCH 19/72] elf: Restore how vDSO dependency is printed with
+ LD_TRACE_LOADED_OBJECTS (BZ #29539)
+
+The d7703d3176d225d5743b21811d888619eba39e82 changed how vDSO like
+dependencies are printed, instead of just the name and address it
+follows other libraries mode and prints 'name => path'.
+
+Unfortunately, this broke some ldd consumer that uses the output to
+filter out the program's dependencies.  For instance CMake
+bundleutilities module [1], where GetPrequirite uses the regex to filter
+out 'name => path' [2].
+
+This patch restore the previous way to print just the name and the
+mapping address.
+
+Checked on x86_64-linux-gnu.
+
+[1] https://github.com/Kitware/CMake/tree/master/Tests/BundleUtilities
+[2] https://github.com/Kitware/CMake/blob/master/Modules/GetPrerequisites.cmake#L733
+
+Reviewed-by: Florian Weimer <fweimer@redhat.com>
+(cherry picked from commit 1e903124cec4492463d075c6c061a2a772db77bf)
+---
+ NEWS       | 2 +-
+ elf/rtld.c | 6 ++++++
+ 2 files changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/NEWS b/NEWS
+index 6d31e5abba..757ded85e0 100644
+--- a/NEWS
++++ b/NEWS
+@@ -14,7 +14,7 @@ The following bugs are resolved with this release:
+   [29485] Linux: Terminate subprocess on late failure in tst-pidfd
+   [29490] alpha: New __brk_call implementation is broken
+   [29528] elf: Call __libc_early_init for reused namespaces
+-
++  [29539] libc: LD_TRACE_LOADED_OBJECTS changed how vDSO library are
+ \f
+ Version 2.36
+ 
+diff --git a/elf/rtld.c b/elf/rtld.c
+index cbbaf4a331..3e771a93d8 100644
+--- a/elf/rtld.c
++++ b/elf/rtld.c
+@@ -2122,6 +2122,12 @@ dl_main (const ElfW(Phdr) *phdr,
+ 	    if (l->l_faked)
+ 	      /* The library was not found.  */
+ 	      _dl_printf ("\t%s => not found\n",  l->l_libname->name);
++	    else if (strcmp (l->l_libname->name, l->l_name) == 0)
++	      /* Print vDSO like libraries without duplicate name.  Some
++		 consumers depend of this format.  */
++	      _dl_printf ("\t%s (0x%0*Zx)\n", l->l_libname->name,
++			  (int) sizeof l->l_map_start * 2,
++			  (size_t) l->l_map_start);
+ 	    else
+ 	      _dl_printf ("\t%s => %s (0x%0*Zx)\n",
+ 			  DSO_FILENAME (l->l_libname->name),
+-- 
+2.38.1
+
+
+From 645d94808aaa90fb1b20a25ff70bb50d9eb1d55b Mon Sep 17 00:00:00 2001
+From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Mon, 5 Sep 2022 09:34:39 -0300
+Subject: [PATCH 20/72] syslog: Remove extra whitespace between timestamp and
+ message (BZ#29544)
+
+The rfc3164 clear states that a single space character must follow
+the timestamp field.
+
+Checked on x86_64-linux-gnu.
+---
+ misc/syslog.c     | 2 +-
+ misc/tst-syslog.c | 9 ++++++---
+ 2 files changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/misc/syslog.c b/misc/syslog.c
+index b88f66c835..f67d4b58a4 100644
+--- a/misc/syslog.c
++++ b/misc/syslog.c
+@@ -167,7 +167,7 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
+ 		  _nl_C_locobj_ptr);
+ 
+ #define SYSLOG_HEADER(__pri, __timestamp, __msgoff, pid) \
+-  "<%d>%s %n%s%s%.0d%s: ",                               \
++  "<%d>%s%n%s%s%.0d%s: ",                                \
+   __pri, __timestamp, __msgoff,                          \
+   LogTag == NULL ? __progname : LogTag,                  \
+   "[" + (pid == 0), pid, "]" + (pid == 0)
+diff --git a/misc/tst-syslog.c b/misc/tst-syslog.c
+index 1d332ece53..3560b518a2 100644
+--- a/misc/tst-syslog.c
++++ b/misc/tst-syslog.c
+@@ -275,16 +275,19 @@ parse_syslog_msg (const char *msg)
+ {
+   struct msg_t r = { .pid = -1 };
+   int number;
++  int wsb, wsa;
+ 
+ #define STRINPUT(size)  XSTRINPUT(size)
+ #define XSTRINPUT(size) "%" # size "s"
+ 
+   /* The message in the form:
+-     <179>Apr  8 14:51:19  tst-syslog: message 176 3  */
+-  int n = sscanf (msg, "<%3d>%*s %*d %*d:%*d:%*d " STRINPUT(IDENT_LENGTH)
++     <179>Apr  8 14:51:19 tst-syslog: message 176 3  */
++  int n = sscanf (msg, "<%3d>%*s %*d %*d:%*d:%*d%n %n" STRINPUT(IDENT_LENGTH)
+ 		       " " STRINPUT(MSG_LENGTH) " %*d %*d",
+-                  &number, r.ident, r.msg);
++                  &number, &wsb, &wsa, r.ident, r.msg);
+   TEST_COMPARE (n, 3);
++  /* It should only one space between timestamp and message.  */
++  TEST_COMPARE (wsa - wsb, 1);
+ 
+   r.facility = number & LOG_FACMASK;
+   r.priority = number & LOG_PRIMASK;
+-- 
+2.38.1
+
+
+From b46412fb17e8bfc6c9e1f144bbcf833320c80f8a Mon Sep 17 00:00:00 2001
+From: Siddhesh Poyarekar <siddhesh@sourceware.org>
+Date: Tue, 6 Sep 2022 09:31:50 -0400
+Subject: [PATCH 21/72] Add NEWS entry for CVE-2022-39046
+
+(cherry picked from commit 76fe56020e7ef354685b2284580ac1630c078a2b)
+---
+ NEWS | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/NEWS b/NEWS
+index 757ded85e0..10a7613f09 100644
+--- a/NEWS
++++ b/NEWS
+@@ -7,6 +7,13 @@ using `glibc' in the "product" field.
+ \f
+ Version 2.36.1
+ 
++Security related changes:
++
++  CVE-2022-39046: When the syslog function is passed a crafted input
++  string larger than 1024 bytes, it reads uninitialized memory from the
++  heap and prints it to the target log file, potentially revealing a
++  portion of the contents of the heap.
++
+ The following bugs are resolved with this release:
+ 
+   [28846] CMSG_NXTHDR may trigger -Wstrict-overflow warning
+-- 
+2.38.1
+
+
+From c399271c10bd00714504e8d4dfbec8aebf996dd4 Mon Sep 17 00:00:00 2001
+From: Fabian Vogt <fvogt@suse.de>
+Date: Wed, 27 Jul 2022 11:44:07 +0200
+Subject: [PATCH 22/72] nscd: Fix netlink cache invalidation if epoll is used
+ [BZ #29415]
+
+Processes cache network interface information such as whether IPv4 or IPv6
+are enabled. This is only checked again if the "netlink timestamp" provided
+by nscd changed, which is triggered by netlink socket activity.
+
+However, in the epoll handler for the netlink socket, it was missed to
+assign the new timestamp to the nscd database. The handler for plain poll
+did that properly, copy that over.
+
+This bug caused that e.g. processes which started before network
+configuration got unusuable addresses from getaddrinfo, like IPv6 only even
+though only IPv4 is available:
+https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1041
+
+It's a bit hard to reproduce, so I verified this by checking the timestamp
+on calls to __check_pf manually. Without this patch it's stuck at 1, now
+it's increasing on network changes as expected.
+
+Signed-off-by: Fabian Vogt <fvogt@suse.de>
+(cherry picked from commit 02ca25fef2785974011e9c5beecc99b900b69fd7)
+---
+ NEWS               | 1 +
+ nscd/connections.c | 3 ++-
+ 2 files changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/NEWS b/NEWS
+index 10a7613f09..9360596fcc 100644
+--- a/NEWS
++++ b/NEWS
+@@ -17,6 +17,7 @@ Security related changes:
+ The following bugs are resolved with this release:
+ 
+   [28846] CMSG_NXTHDR may trigger -Wstrict-overflow warning
++  [29415] nscd: Fix netlink cache invalidation if epoll is used
+   [29446] _dlopen now ignores dl_caller argument in static mode
+   [29485] Linux: Terminate subprocess on late failure in tst-pidfd
+   [29490] alpha: New __brk_call implementation is broken
+diff --git a/nscd/connections.c b/nscd/connections.c
+index 61d1674eb4..531d2e83df 100644
+--- a/nscd/connections.c
++++ b/nscd/connections.c
+@@ -2284,7 +2284,8 @@ main_loop_epoll (int efd)
+ 					     sizeof (buf))) != -1)
+ 	      ;
+ 
+-	    __bump_nl_timestamp ();
++	    dbs[hstdb].head->extra_data[NSCD_HST_IDX_CONF_TIMESTAMP]
++	      = __bump_nl_timestamp ();
+ 	  }
+ # endif
+ 	else
+-- 
+2.38.1
+
+
+From 9d7eebde8f134ea25bdb9ab61bc74d5e71e41288 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 30 Aug 2022 10:02:49 +0200
+Subject: [PATCH 23/72] resolv: Add tst-resolv-byaddr for testing reverse
+ lookup
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit 0b99828d54e5d1fc8f5ad3edf5ba262ad2e9c5b0)
+---
+ resolv/Makefile                      |   2 +
+ resolv/tst-resolv-byaddr.c           | 326 +++++++++++++++++++++++++++
+ resolv/tst-resolv-maybe_insert_sig.h |  32 +++
+ 3 files changed, 360 insertions(+)
+ create mode 100644 resolv/tst-resolv-byaddr.c
+ create mode 100644 resolv/tst-resolv-maybe_insert_sig.h
+
+diff --git a/resolv/Makefile b/resolv/Makefile
+index 5b15321f9b..98b10d97a0 100644
+--- a/resolv/Makefile
++++ b/resolv/Makefile
+@@ -91,6 +91,7 @@ tests += \
+   tst-res_hnok \
+   tst-resolv-basic \
+   tst-resolv-binary \
++  tst-resolv-byaddr \
+   tst-resolv-edns \
+   tst-resolv-network \
+   tst-resolv-noaaaa \
+@@ -260,6 +261,7 @@ $(objpfx)tst-resolv-ai_idn-nolibidn2.out: \
+   $(gen-locales) $(objpfx)tst-no-libidn2.so
+ $(objpfx)tst-resolv-basic: $(objpfx)libresolv.so $(shared-thread-library)
+ $(objpfx)tst-resolv-binary: $(objpfx)libresolv.so $(shared-thread-library)
++$(objpfx)tst-resolv-byaddr: $(objpfx)libresolv.so $(shared-thread-library)
+ $(objpfx)tst-resolv-edns: $(objpfx)libresolv.so $(shared-thread-library)
+ $(objpfx)tst-resolv-network: $(objpfx)libresolv.so $(shared-thread-library)
+ $(objpfx)tst-resolv-res_init: $(objpfx)libresolv.so
+diff --git a/resolv/tst-resolv-byaddr.c b/resolv/tst-resolv-byaddr.c
+new file mode 100644
+index 0000000000..6299e89837
+--- /dev/null
++++ b/resolv/tst-resolv-byaddr.c
+@@ -0,0 +1,326 @@
++/* Test reverse DNS lookup.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <arpa/inet.h>
++#include <errno.h>
++#include <netdb.h>
++#include <stdbool.h>
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
++#include <support/check.h>
++#include <support/check_nss.h>
++#include <support/next_to_fault.h>
++#include <support/resolv_test.h>
++#include <support/support.h>
++
++#include "tst-resolv-maybe_insert_sig.h"
++
++/* QNAME format:
++
++   ADDRESSES.CNAMES...(lots of 0s)...8.b.d.0.1.0.0.2.ip6.arpa.
++   CNAMES|ADDRESSES.2.0.192.in-addr-arpa.
++
++   For the IPv4 reverse lookup, the address count is in the lower
++   bits.
++
++   CNAMES is the length of the CNAME chain, ADDRESSES is the number of
++   addresses in the response.  The special value 15 means that there
++   are no addresses, and the RCODE is NXDOMAIN.  */
++static void
++response (const struct resolv_response_context *ctx,
++          struct resolv_response_builder *b,
++          const char *qname, uint16_t qclass, uint16_t qtype)
++{
++  TEST_COMPARE (qclass, C_IN);
++  TEST_COMPARE (qtype, T_PTR);
++
++  unsigned int addresses, cnames, bits;
++  char *tail;
++  if (strstr (qname, "ip6.arpa") != NULL
++      && sscanf (qname, "%x.%x.%ms", &addresses, &cnames, &tail) == 3)
++    TEST_COMPARE_STRING (tail, "\
++0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa");
++  else if (sscanf (qname, "%u.%ms", &bits, &tail) == 2)
++    {
++      TEST_COMPARE_STRING (tail, "2.0.192.in-addr.arpa");
++      addresses = bits & 0x0f;
++      cnames = bits >> 4;
++    }
++  else
++    FAIL_EXIT1 ("invalid QNAME: %s", qname);
++  free (tail);
++
++  int rcode;
++  if (addresses == 15)
++    {
++      /* Special case: Use no addresses with NXDOMAIN response.  */
++      rcode = ns_r_nxdomain;
++      addresses = 0;
++    }
++  else
++    rcode = 0;
++
++  struct resolv_response_flags flags = { .rcode = rcode };
++  resolv_response_init (b, flags);
++  resolv_response_add_question (b, qname, qclass, qtype);
++  resolv_response_section (b, ns_s_an);
++  maybe_insert_sig (b, qname);
++
++  /* Provide the requested number of CNAME records.  */
++  char *previous_name = (char *) qname;
++  for (int unique = 0; unique < cnames; ++unique)
++    {
++      resolv_response_open_record (b, previous_name, qclass, T_CNAME, 60);
++      char *new_name = xasprintf ("%d.alias.example", unique);
++      resolv_response_add_name (b, new_name);
++      resolv_response_close_record (b);
++
++      maybe_insert_sig (b, qname);
++
++      if (previous_name != qname)
++        free (previous_name);
++      previous_name = new_name;
++    }
++
++  for (int unique = 0; unique < addresses; ++unique)
++    {
++      resolv_response_open_record (b, previous_name, qclass, T_PTR, 60);
++      char *ptr = xasprintf ("unique-%d.cnames-%u.addresses-%u.example",
++                             unique, cnames, addresses);
++      resolv_response_add_name (b, ptr);
++      free (ptr);
++      resolv_response_close_record (b);
++    }
++
++  if (previous_name != qname)
++    free (previous_name);
++}
++
++/* Used to check that gethostbyaddr_r does not write past the buffer
++   end.  */
++static struct support_next_to_fault ntf;
++
++/* Perform a gethostbyaddr call and check the result.  */
++static void
++check_gethostbyaddr (const char *address, const char *expected)
++{
++  unsigned char bytes[16];
++  unsigned int byteslen;
++  int family;
++  if (strchr (address, ':') != NULL)
++    {
++      family = AF_INET6;
++      byteslen = 16;
++    }
++  else
++    {
++      family = AF_INET;
++      byteslen = 4;
++    }
++  TEST_COMPARE (inet_pton (family, address, bytes), 1);
++
++  struct hostent *e = gethostbyaddr (bytes, byteslen, family);
++  check_hostent (address, e, expected);
++
++  if (e == NULL)
++    return;
++
++  /* Try gethostbyaddr_r with increasing sizes until success.  First
++     compute a reasonable minimum buffer size, to avoid many pointless
++     attempts.  */
++  size_t minimum_size = strlen (e->h_name);
++  for (int i = 0; e->h_addr_list[i] != NULL; ++i)
++    minimum_size += e->h_length + sizeof (char *);
++  for (int i = 0; e->h_aliases[i] != NULL; ++i)
++    minimum_size += strlen (e->h_aliases[i]) + 1 + sizeof (char *);
++
++  /* Gradually increase the size until success.  */
++  for (size_t size = minimum_size; size < ntf.length; ++size)
++    {
++      struct hostent result;
++      int herrno;
++      int ret = gethostbyaddr_r (bytes, byteslen, family, &result,
++                                 ntf.buffer + ntf.length - size, size,
++                                 &e, &herrno);
++      if (ret == ERANGE)
++        /* Retry with larger size.  */
++        TEST_COMPARE (herrno, NETDB_INTERNAL);
++      else if (ret == 0)
++        {
++         TEST_VERIFY (size > minimum_size);
++         check_hostent (address, e, expected);
++         return;
++        }
++      else
++        FAIL_EXIT1 ("Unexpected gethostbyaddr_r failure: %d", ret);
++    }
++
++  FAIL_EXIT1 ("gethostbyaddr_r always failed for: %s", address);
++}
++
++/* Perform a getnameinfo call and check the result.  */
++static void
++check_getnameinfo (const char *address, const char *expected)
++{
++  struct sockaddr_in sin = { };
++  struct sockaddr_in6 sin6 = { };
++  void *sa;
++  socklen_t salen;
++  if (strchr (address, ':') != NULL)
++    {
++      sin6.sin6_family = AF_INET6;
++      TEST_COMPARE (inet_pton (AF_INET6, address, &sin6.sin6_addr), 1);
++      sin6.sin6_port = htons (80);
++      sa = &sin6;
++      salen = sizeof (sin6);
++    }
++  else
++    {
++      sin.sin_family = AF_INET;
++      TEST_COMPARE (inet_pton (AF_INET, address, &sin.sin_addr), 1);
++      sin.sin_port = htons (80);
++      sa = &sin;
++      salen = sizeof (sin);
++    }
++
++  char host[64];
++  char service[64];
++  int ret = getnameinfo (sa, salen, host,
++                         sizeof (host), service, sizeof (service),
++                         NI_NAMEREQD | NI_NUMERICSERV);
++  switch (ret)
++    {
++    case 0:
++      TEST_COMPARE_STRING (host, expected);
++      TEST_COMPARE_STRING (service, "80");
++      break;
++    case EAI_SYSTEM:
++      TEST_COMPARE_STRING (strerror (errno), expected);
++      break;
++    default:
++      TEST_COMPARE_STRING (gai_strerror (ret), expected);
++    }
++}
++
++static int
++do_test (void)
++{
++  /* Some reasonably upper bound for the maximum response size.  */
++  ntf = support_next_to_fault_allocate (4096);
++
++  struct resolv_test *obj = resolv_test_start
++    ((struct resolv_redirect_config)
++     {
++       .response_callback = response
++     });
++
++  for (int do_insert_sig = 0; do_insert_sig < 2; ++do_insert_sig)
++    {
++      insert_sig = do_insert_sig;
++
++      /* No PTR record, RCODE=0.  */
++      check_gethostbyaddr ("192.0.2.0", "error: NO_RECOVERY\n");
++      check_getnameinfo ("192.0.2.0", "Name or service not known");
++      check_gethostbyaddr ("192.0.2.16", "error: NO_RECOVERY\n");
++      check_getnameinfo ("192.0.2.16", "Name or service not known");
++      check_gethostbyaddr ("192.0.2.32", "error: NO_RECOVERY\n");
++      check_getnameinfo ("192.0.2.32", "Name or service not known");
++      check_gethostbyaddr ("2001:db8::", "error: NO_RECOVERY\n");
++      check_getnameinfo ("2001:db8::", "Name or service not known");
++      check_gethostbyaddr ("2001:db8::10", "error: NO_RECOVERY\n");
++      check_getnameinfo ("2001:db8::10", "Name or service not known");
++      check_gethostbyaddr ("2001:db8::20", "error: NO_RECOVERY\n");
++      check_getnameinfo ("2001:db8::20", "Name or service not known");
++
++      /* No PTR record, NXDOMAIN.  */
++      check_gethostbyaddr ("192.0.2.15", "error: HOST_NOT_FOUND\n");
++      check_getnameinfo ("192.0.2.15", "Name or service not known");
++      check_gethostbyaddr ("192.0.2.31", "error: HOST_NOT_FOUND\n");
++      check_getnameinfo ("192.0.2.31", "Name or service not known");
++      check_gethostbyaddr ("192.0.2.47", "error: HOST_NOT_FOUND\n");
++      check_getnameinfo ("192.0.2.47", "Name or service not known");
++      check_gethostbyaddr ("2001:db8::f", "error: HOST_NOT_FOUND\n");
++      check_getnameinfo ("2001:db8::f", "Name or service not known");
++      check_gethostbyaddr ("2001:db8::1f", "error: HOST_NOT_FOUND\n");
++      check_getnameinfo ("2001:db8::1f", "Name or service not known");
++      check_gethostbyaddr ("2001:db8::2f", "error: HOST_NOT_FOUND\n");
++      check_getnameinfo ("2001:db8::2f", "Name or service not known");
++
++      /* Actual response data.  Only the first PTR record is returned.  */
++      check_gethostbyaddr ("192.0.2.1",
++                           "name: unique-0.cnames-0.addresses-1.example\n"
++                           "address: 192.0.2.1\n");
++      check_getnameinfo ("192.0.2.1",
++                         "unique-0.cnames-0.addresses-1.example");
++      check_gethostbyaddr ("192.0.2.17",
++                           "name: unique-0.cnames-1.addresses-1.example\n"
++                           "address: 192.0.2.17\n");
++      check_getnameinfo ("192.0.2.17",
++                         "unique-0.cnames-1.addresses-1.example");
++      check_gethostbyaddr ("192.0.2.18",
++                           "name: unique-0.cnames-1.addresses-2.example\n"
++                           "address: 192.0.2.18\n");
++      check_getnameinfo ("192.0.2.18",
++                         "unique-0.cnames-1.addresses-2.example");
++      check_gethostbyaddr ("192.0.2.33",
++                           "name: unique-0.cnames-2.addresses-1.example\n"
++                           "address: 192.0.2.33\n");
++      check_getnameinfo ("192.0.2.33",
++                         "unique-0.cnames-2.addresses-1.example");
++      check_gethostbyaddr ("192.0.2.34",
++                           "name: unique-0.cnames-2.addresses-2.example\n"
++                           "address: 192.0.2.34\n");
++      check_getnameinfo ("192.0.2.34",
++                         "unique-0.cnames-2.addresses-2.example");
++
++      /* Same for IPv6 addresses.  */
++      check_gethostbyaddr ("2001:db8::1",
++                           "name: unique-0.cnames-0.addresses-1.example\n"
++                           "address: 2001:db8::1\n");
++      check_getnameinfo ("2001:db8::1",
++                         "unique-0.cnames-0.addresses-1.example");
++      check_gethostbyaddr ("2001:db8::11",
++                           "name: unique-0.cnames-1.addresses-1.example\n"
++                           "address: 2001:db8::11\n");
++      check_getnameinfo ("2001:db8::11",
++                         "unique-0.cnames-1.addresses-1.example");
++      check_gethostbyaddr ("2001:db8::12",
++                           "name: unique-0.cnames-1.addresses-2.example\n"
++                           "address: 2001:db8::12\n");
++      check_getnameinfo ("2001:db8::12",
++                         "unique-0.cnames-1.addresses-2.example");
++      check_gethostbyaddr ("2001:db8::21",
++                           "name: unique-0.cnames-2.addresses-1.example\n"
++                           "address: 2001:db8::21\n");
++      check_getnameinfo ("2001:db8::21",
++                         "unique-0.cnames-2.addresses-1.example");
++      check_gethostbyaddr ("2001:db8::22",
++                           "name: unique-0.cnames-2.addresses-2.example\n"
++                           "address: 2001:db8::22\n");
++      check_getnameinfo ("2001:db8::22",
++                         "unique-0.cnames-2.addresses-2.example");
++    }
++
++  resolv_test_end (obj);
++
++  support_next_to_fault_free (&ntf);
++  return 0;
++}
++
++#include <support/test-driver.c>
+diff --git a/resolv/tst-resolv-maybe_insert_sig.h b/resolv/tst-resolv-maybe_insert_sig.h
+new file mode 100644
+index 0000000000..05725225af
+--- /dev/null
++++ b/resolv/tst-resolv-maybe_insert_sig.h
+@@ -0,0 +1,32 @@
++/* Code snippet for optionally inserting ignored SIG records in resolver tests.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++/* Set to true for an alternative pass that inserts (ignored) SIG
++   records.  This does not alter the response, so this property is not
++   encoded in the QNAME.  The variable needs to be volatile because
++   leaf attributes tell GCC that the response function is not
++   called.  */
++static volatile bool insert_sig;
++
++static void
++maybe_insert_sig (struct resolv_response_builder *b, const char *owner)
++{
++  resolv_response_open_record (b, owner, C_IN, T_SIG, 60);
++  resolv_response_add_data (b, "", 1);
++  resolv_response_close_record (b);
++}
+-- 
+2.38.1
+
+
+From bffc33e90ed57a4786c676dda92d935e3613e031 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 30 Aug 2022 10:02:49 +0200
+Subject: [PATCH 24/72] resolv: Add tst-resolv-aliases
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit 87aa98aa80627553a66bdcad2701fd6307723645)
+---
+ resolv/Makefile             |   2 +
+ resolv/tst-resolv-aliases.c | 254 ++++++++++++++++++++++++++++++++++++
+ 2 files changed, 256 insertions(+)
+ create mode 100644 resolv/tst-resolv-aliases.c
+
+diff --git a/resolv/Makefile b/resolv/Makefile
+index 98b10d97a0..0038bb7028 100644
+--- a/resolv/Makefile
++++ b/resolv/Makefile
+@@ -89,6 +89,7 @@ tests += \
+   tst-ns_name_pton \
+   tst-res_hconf_reorder \
+   tst-res_hnok \
++  tst-resolv-aliases \
+   tst-resolv-basic \
+   tst-resolv-binary \
+   tst-resolv-byaddr \
+@@ -259,6 +260,7 @@ $(objpfx)tst-resolv-ai_idn.out: $(gen-locales)
+ $(objpfx)tst-resolv-ai_idn-latin1.out: $(gen-locales)
+ $(objpfx)tst-resolv-ai_idn-nolibidn2.out: \
+   $(gen-locales) $(objpfx)tst-no-libidn2.so
++$(objpfx)tst-resolv-aliases: $(objpfx)libresolv.so $(shared-thread-library)
+ $(objpfx)tst-resolv-basic: $(objpfx)libresolv.so $(shared-thread-library)
+ $(objpfx)tst-resolv-binary: $(objpfx)libresolv.so $(shared-thread-library)
+ $(objpfx)tst-resolv-byaddr: $(objpfx)libresolv.so $(shared-thread-library)
+diff --git a/resolv/tst-resolv-aliases.c b/resolv/tst-resolv-aliases.c
+new file mode 100644
+index 0000000000..b212823aa0
+--- /dev/null
++++ b/resolv/tst-resolv-aliases.c
+@@ -0,0 +1,254 @@
++/* Test alias handling (mainly for gethostbyname).
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <array_length.h>
++#include <arpa/inet.h>
++#include <netdb.h>
++#include <stdbool.h>
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
++#include <support/check.h>
++#include <support/check_nss.h>
++#include <support/resolv_test.h>
++#include <support/support.h>
++
++#include "tst-resolv-maybe_insert_sig.h"
++
++/* QNAME format:
++
++   aADDRESSES-cCNAMES.example.net
++
++   CNAMES is the length of the CNAME chain, ADDRESSES is the number of
++   addresses in the response.  The special value 255 means that there
++   are no addresses, and the RCODE is NXDOMAIN.  */
++static void
++response (const struct resolv_response_context *ctx,
++          struct resolv_response_builder *b,
++          const char *qname, uint16_t qclass, uint16_t qtype)
++{
++  TEST_COMPARE (qclass, C_IN);
++  if (qtype != T_A)
++    TEST_COMPARE (qtype, T_AAAA);
++
++  unsigned int addresses, cnames;
++  char *tail;
++  if (sscanf (qname, "a%u-c%u%ms", &addresses, &cnames, &tail) == 3)
++    {
++      if (strcmp (tail, ".example.com") == 0
++          || strcmp (tail, ".example.net.example.net") == 0
++          || strcmp (tail, ".example.net.example.com") == 0)
++        /* These only happen after NXDOMAIN.  */
++        TEST_VERIFY (addresses == 255);
++      else if (strcmp (tail, ".example.net") != 0)
++        FAIL_EXIT1 ("invalid QNAME: %s", qname);
++    }
++  free (tail);
++
++  int rcode;
++  if (addresses == 255)
++    {
++      /* Special case: Use no addresses with NXDOMAIN response.  */
++      rcode = ns_r_nxdomain;
++      addresses = 0;
++    }
++  else
++    rcode = 0;
++
++  struct resolv_response_flags flags = { .rcode = rcode };
++  resolv_response_init (b, flags);
++  resolv_response_add_question (b, qname, qclass, qtype);
++  resolv_response_section (b, ns_s_an);
++  maybe_insert_sig (b, qname);
++
++  /* Provide the requested number of CNAME records.  */
++  char *previous_name = (char *) qname;
++  for (int unique = 0; unique < cnames; ++unique)
++    {
++      resolv_response_open_record (b, previous_name, qclass, T_CNAME, 60);
++      char *new_name = xasprintf ("%d.alias.example", unique);
++      resolv_response_add_name (b, new_name);
++      resolv_response_close_record (b);
++
++      maybe_insert_sig (b, qname);
++
++      if (previous_name != qname)
++        free (previous_name);
++      previous_name = new_name;
++    }
++
++  for (int unique = 0; unique < addresses; ++unique)
++    {
++      resolv_response_open_record (b, previous_name, qclass, qtype, 60);
++
++      if (qtype == T_A)
++        {
++          char ipv4[4] = {192, 0, 2, 1 + unique};
++          resolv_response_add_data (b, &ipv4, sizeof (ipv4));
++        }
++      else if (qtype == T_AAAA)
++        {
++          char ipv6[16] =
++            {
++              0x20, 0x01, 0xd, 0xb8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
++              1 + unique
++            };
++          resolv_response_add_data (b, &ipv6, sizeof (ipv6));
++        }
++      resolv_response_close_record (b);
++    }
++
++  if (previous_name != qname)
++    free (previous_name);
++}
++
++static char *
++make_qname (bool do_search, int cnames, int addresses)
++{
++  return xasprintf ("a%d-c%d%s",
++                    addresses, cnames, do_search ? "" : ".example.net");
++}
++
++static void
++check_cnames_failure (int af, bool do_search, int cnames, int addresses)
++{
++  char *qname = make_qname (do_search, cnames, addresses);
++
++  struct hostent *e;
++  if (af == AF_UNSPEC)
++    e = gethostbyname (qname);
++  else
++    e = gethostbyname2 (qname, af);
++
++  if (addresses == 0)
++    check_hostent (qname, e, "error: NO_RECOVERY\n");
++  else
++    check_hostent (qname, e, "error: HOST_NOT_FOUND\n");
++
++  free (qname);
++}
++
++static void
++check (int af, bool do_search, int cnames, int addresses)
++{
++  char *qname = make_qname (do_search, cnames, addresses);
++  char *fqdn = make_qname (false, cnames, addresses);
++
++  struct hostent *e;
++  if (af == AF_UNSPEC)
++    e = gethostbyname (qname);
++  else
++    e = gethostbyname2 (qname, af);
++  if (e == NULL)
++    FAIL_EXIT1 ("unexpected failure for %d, %d, %d", af, cnames, addresses);
++
++  if (af == AF_UNSPEC || af == AF_INET)
++    {
++      TEST_COMPARE (e->h_addrtype, AF_INET);
++      TEST_COMPARE (e->h_length, 4);
++    }
++  else
++    {
++      TEST_COMPARE (e->h_addrtype, AF_INET6);
++      TEST_COMPARE (e->h_length, 16);
++    }
++
++  for (int i = 0; i < addresses; ++i)
++    {
++      char ipv4[4] = {192, 0, 2, 1 + i};
++      char ipv6[16] =
++        { 0x20, 0x01, 0xd, 0xb8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 + i };
++      char *expected = e->h_addrtype == AF_INET ? ipv4 : ipv6;
++      TEST_COMPARE_BLOB (e->h_addr_list[i], e->h_length,
++                         expected, e->h_length);
++    }
++  TEST_VERIFY (e->h_addr_list[addresses] == NULL);
++
++
++  if (cnames == 0)
++    {
++      /* QNAME is fully qualified.  */
++      TEST_COMPARE_STRING (e->h_name, fqdn);
++      TEST_VERIFY (e->h_aliases[0] == NULL);
++    }
++  else
++   {
++     /* Fully-qualified QNAME is demoted to an aliases.  */
++     TEST_COMPARE_STRING (e->h_aliases[0], fqdn);
++
++     for (int i = 1; i <= cnames; ++i)
++       {
++         char *expected = xasprintf ("%d.alias.example", i - 1);
++         if (i == cnames)
++           TEST_COMPARE_STRING (e->h_name, expected);
++         else
++           TEST_COMPARE_STRING (e->h_aliases[i], expected);
++         free (expected);
++       }
++     TEST_VERIFY (e->h_aliases[cnames] == NULL);
++   }
++
++  free (fqdn);
++  free (qname);
++}
++
++static int
++do_test (void)
++{
++  struct resolv_test *obj = resolv_test_start
++    ((struct resolv_redirect_config)
++     {
++       .response_callback = response,
++       .search = { "example.net", "example.com" },
++     });
++
++  static const int families[] = { AF_UNSPEC, AF_INET, AF_INET6 };
++
++  for (int do_insert_sig = 0; do_insert_sig < 2; ++do_insert_sig)
++    {
++      insert_sig = do_insert_sig;
++
++      /* If do_search is true, a bare host name (for example, a1-c1)
++         is used.  This exercises search path processing and FQDN
++         qualification.  */
++      for (int do_search = 0; do_search < 2; ++do_search)
++        for (const int *paf = families; paf != array_end (families); ++paf)
++          {
++            for (int cnames = 0; cnames <= 100; ++cnames)
++              {
++                check_cnames_failure (*paf, do_search, cnames, 0);
++                /* Now with NXDOMAIN responses.  */
++                check_cnames_failure (*paf, do_search, cnames, 255);
++              }
++
++            for (int cnames = 0; cnames <= 10; ++cnames)
++              for (int addresses = 1; addresses <= 10; ++addresses)
++                check (*paf, do_search, cnames, addresses);
++
++            /* The current implementation is limited to 47 aliases.
++               Addresses do not have such a limit.  */
++            check (*paf, do_search, 47, 60);
++          }
++    }
++
++  resolv_test_end (obj);
++
++  return 0;
++}
++
++#include <support/test-driver.c>
+-- 
+2.38.1
+
+
+From 3c9b4004e2dccc9ca2ace078a0106f9d682fd1a0 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 30 Aug 2022 10:02:49 +0200
+Subject: [PATCH 25/72] resolv: Add internal __res_binary_hnok function
+
+During package parsing, only the binary representation is available,
+and it is convenient to check that directly for conformance with host
+name requirements.
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit c79327bf00a4be6d60259227acc78ef80ead3622)
+---
+ include/resolv.h           |  3 +++
+ resolv/res-name-checking.c | 14 +++++++++-----
+ 2 files changed, 12 insertions(+), 5 deletions(-)
+
+diff --git a/include/resolv.h b/include/resolv.h
+index 3590b6f496..4dbbac3800 100644
+--- a/include/resolv.h
++++ b/include/resolv.h
+@@ -70,5 +70,8 @@ libc_hidden_proto (__libc_res_nameinquery)
+ extern __typeof (__res_queriesmatch) __libc_res_queriesmatch;
+ libc_hidden_proto (__libc_res_queriesmatch)
+ 
++/* Variant of res_hnok which operates on binary (but uncompressed) names.  */
++bool __res_binary_hnok (const unsigned char *dn) attribute_hidden;
++
+ # endif /* _RESOLV_H_ && !_ISOMAC */
+ #endif
+diff --git a/resolv/res-name-checking.c b/resolv/res-name-checking.c
+index 07a412d8ff..213edceaf3 100644
+--- a/resolv/res-name-checking.c
++++ b/resolv/res-name-checking.c
+@@ -138,6 +138,12 @@ binary_leading_dash (const unsigned char *dn)
+   return dn[0] > 0 && dn[1] == '-';
+ }
+ 
++bool
++__res_binary_hnok (const unsigned char *dn)
++{
++  return !binary_leading_dash (dn) && binary_hnok (dn);
++}
++
+ /* Return 1 if res_hnok is a valid host name.  Labels must only
+    contain [0-9a-zA-Z_-] characters, and the name must not start with
+    a '-'.  The latter is to avoid confusion with program options.  */
+@@ -145,11 +151,9 @@ int
+ ___res_hnok (const char *dn)
+ {
+   unsigned char buf[NS_MAXCDNAME];
+-  if (!printable_string (dn)
+-      || __ns_name_pton (dn, buf, sizeof (buf)) < 0
+-      || binary_leading_dash (buf))
+-    return 0;
+-  return binary_hnok (buf);
++  return (printable_string (dn)
++	  && __ns_name_pton (dn, buf, sizeof (buf)) >= 0
++	  && __res_binary_hnok (buf));
+ }
+ versioned_symbol (libc, ___res_hnok, res_hnok, GLIBC_2_34);
+ versioned_symbol (libc, ___res_hnok, __libc_res_hnok, GLIBC_PRIVATE);
+-- 
+2.38.1
+
+
+From 20ec40a51d3a8e9487f40dc9352d158def23ea8c Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 30 Aug 2022 10:02:49 +0200
+Subject: [PATCH 26/72] resolv: Add the __ns_samebinaryname function
+
+During packet parsing, only the binary name is available.  If the name
+equality check is performed before conversion to text, we can sometimes
+skip the last step.
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit 394085a34d25a51513019a4dc411acd3527fbd33)
+---
+ include/arpa/nameser.h         |  6 ++++
+ resolv/Makefile                |  5 +++
+ resolv/ns_samebinaryname.c     | 55 ++++++++++++++++++++++++++++++
+ resolv/tst-ns_samebinaryname.c | 62 ++++++++++++++++++++++++++++++++++
+ 4 files changed, 128 insertions(+)
+ create mode 100644 resolv/ns_samebinaryname.c
+ create mode 100644 resolv/tst-ns_samebinaryname.c
+
+diff --git a/include/arpa/nameser.h b/include/arpa/nameser.h
+index 53f1dbc7c3..bb1dede187 100644
+--- a/include/arpa/nameser.h
++++ b/include/arpa/nameser.h
+@@ -55,6 +55,12 @@ int __ns_name_ntop (const unsigned char *, char *, size_t) __THROW;
+ int __ns_name_unpack (const unsigned char *, const unsigned char *,
+ 		      const unsigned char *, unsigned char *, size_t) __THROW;
+ 
++/* Like ns_samename, but for uncompressed binary names.  Return true
++   if the two arguments compare are equal as case-insensitive domain
++   names.  */
++_Bool __ns_samebinaryname (const unsigned char *, const unsigned char *)
++  attribute_hidden;
++
+ #define ns_msg_getflag(handle, flag) \
+   (((handle)._flags & _ns_flagdata[flag].mask) >> _ns_flagdata[flag].shift)
+ 
+diff --git a/resolv/Makefile b/resolv/Makefile
+index 0038bb7028..ec61ad07bd 100644
+--- a/resolv/Makefile
++++ b/resolv/Makefile
+@@ -46,6 +46,7 @@ routines := \
+   ns_name_skip \
+   ns_name_uncompress \
+   ns_name_unpack \
++  ns_samebinaryname \
+   ns_samename \
+   nsap_addr \
+   nss_dns_functions \
+@@ -106,6 +107,10 @@ tests += \
+ tests-internal += tst-resolv-txnid-collision
+ tests-static += tst-resolv-txnid-collision
+ 
++# Likewise for __ns_samebinaryname.
++tests-internal += tst-ns_samebinaryname
++tests-static += tst-ns_samebinaryname
++
+ # These tests need libdl.
+ ifeq (yes,$(build-shared))
+ tests += \
+diff --git a/resolv/ns_samebinaryname.c b/resolv/ns_samebinaryname.c
+new file mode 100644
+index 0000000000..9a47d8e97a
+--- /dev/null
++++ b/resolv/ns_samebinaryname.c
+@@ -0,0 +1,55 @@
++/* Compare two binary domain names for quality.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <arpa/nameser.h>
++#include <stdbool.h>
++
++/* Convert ASCII letters to upper case.  */
++static inline int
++ascii_toupper (unsigned char ch)
++{
++  if (ch >= 'a' && ch <= 'z')
++    return ch - 'a' + 'A';
++  else
++    return ch;
++}
++
++bool
++__ns_samebinaryname (const unsigned char *a, const unsigned char *b)
++{
++  while (*a != 0 && *b != 0)
++    {
++      if (*a != *b)
++        /* Different label length.  */
++        return false;
++      int labellen = *a;
++      ++a;
++      ++b;
++      for (int i = 0; i < labellen; ++i)
++        {
++          if (*a != *b && ascii_toupper (*a) != ascii_toupper (*b))
++            /* Different character in label.  */
++            return false;
++          ++a;
++          ++b;
++        }
++    }
++
++  /* Match if both names are at the root label.  */
++  return *a == 0 && *b == 0;
++}
+diff --git a/resolv/tst-ns_samebinaryname.c b/resolv/tst-ns_samebinaryname.c
+new file mode 100644
+index 0000000000..b06ac610b4
+--- /dev/null
++++ b/resolv/tst-ns_samebinaryname.c
+@@ -0,0 +1,62 @@
++/* Test the __ns_samebinaryname function.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <arpa/nameser.h>
++#include <array_length.h>
++#include <stdbool.h>
++#include <stdio.h>
++#include <support/check.h>
++
++/* First character denotes the comparison group: All names with the
++   same first character are expected to compare equal.  */
++static const char *const cases[] =
++  {
++    " ",
++    "1\001a", "1\001A",
++    "2\002ab", "2\002aB", "2\002Ab", "2\002AB",
++    "3\001a\002ab", "3\001A\002ab",
++    "w\003www\007example\003com", "w\003Www\007Example\003Com",
++    "w\003WWW\007EXAMPLE\003COM",
++    "W\003WWW", "W\003www",
++  };
++
++static int
++do_test (void)
++{
++  for (int i = 0; i < array_length (cases); ++i)
++    for (int j = 0; j < array_length (cases); ++j)
++      {
++        unsigned char *a = (unsigned char *) &cases[i][1];
++        unsigned char *b = (unsigned char *) &cases[j][1];
++        bool actual = __ns_samebinaryname (a, b);
++        bool expected = cases[i][0] == cases[j][0];
++        if (actual != expected)
++          {
++            char a1[NS_MAXDNAME];
++            TEST_VERIFY (ns_name_ntop (a, a1, sizeof (a1)) > 0);
++            char b1[NS_MAXDNAME];
++            TEST_VERIFY (ns_name_ntop (b, b1, sizeof (b1)) > 0);
++            printf ("error: \"%s\" \"%s\": expected %s\n",
++                    a1, b1, expected ? "equal" : "unqueal");
++            support_record_failure ();
++          }
++      }
++  return 0;
++}
++
++#include <support/test-driver.c>
+-- 
+2.38.1
+
+
+From adb69f8ffe83db5d475868b42996bc70de8cff77 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 30 Aug 2022 10:02:49 +0200
+Subject: [PATCH 27/72] resolv: Add internal __ns_name_length_uncompressed
+ function
+
+This function is useful for checking that the question name is
+uncompressed (as it should be).
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit 78b1a4f0e49064e5dfb686c7cd87bd4df2640b29)
+---
+ include/arpa/nameser.h                   |   8 ++
+ resolv/Makefile                          |   5 +
+ resolv/ns_name_length_uncompressed.c     |  72 ++++++++++++
+ resolv/tst-ns_name_length_uncompressed.c | 135 +++++++++++++++++++++++
+ 4 files changed, 220 insertions(+)
+ create mode 100644 resolv/ns_name_length_uncompressed.c
+ create mode 100644 resolv/tst-ns_name_length_uncompressed.c
+
+diff --git a/include/arpa/nameser.h b/include/arpa/nameser.h
+index bb1dede187..6e4808f00d 100644
+--- a/include/arpa/nameser.h
++++ b/include/arpa/nameser.h
+@@ -95,5 +95,13 @@ libc_hidden_proto (__ns_name_unpack)
+ extern __typeof (ns_samename) __libc_ns_samename;
+ libc_hidden_proto (__libc_ns_samename)
+ 
++/* Packet parser helper functions.  */
++
++/* Verify that P points to an uncompressed domain name in wire format.
++   On success, return the length of the encoded name, including the
++   terminating null byte.  On failure, return -1 and set errno.  EOM
++   must point one past the last byte in the packet.  */
++int __ns_name_length_uncompressed (const unsigned char *p,
++				   const unsigned char *eom) attribute_hidden;
+ # endif /* !_ISOMAC */
+ #endif
+diff --git a/resolv/Makefile b/resolv/Makefile
+index ec61ad07bd..bf28825f60 100644
+--- a/resolv/Makefile
++++ b/resolv/Makefile
+@@ -40,6 +40,7 @@ routines := \
+   inet_pton \
+   ns_makecanon \
+   ns_name_compress \
++  ns_name_length_uncompressed \
+   ns_name_ntop \
+   ns_name_pack \
+   ns_name_pton \
+@@ -111,6 +112,10 @@ tests-static += tst-resolv-txnid-collision
+ tests-internal += tst-ns_samebinaryname
+ tests-static += tst-ns_samebinaryname
+ 
++# Likewise for __ns_name_length_uncompressed.
++tests-internal += tst-ns_name_length_uncompressed
++tests-static += tst-ns_name_length_uncompressed
++
+ # These tests need libdl.
+ ifeq (yes,$(build-shared))
+ tests += \
+diff --git a/resolv/ns_name_length_uncompressed.c b/resolv/ns_name_length_uncompressed.c
+new file mode 100644
+index 0000000000..51296b47ef
+--- /dev/null
++++ b/resolv/ns_name_length_uncompressed.c
+@@ -0,0 +1,72 @@
++/* Skip over an uncompressed name in wire format.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <arpa/nameser.h>
++#include <errno.h>
++#include <stdbool.h>
++
++int
++__ns_name_length_uncompressed (const unsigned char *p,
++                                const unsigned char *eom)
++{
++  const unsigned char *start = p;
++
++  while (true)
++    {
++      if (p == eom)
++        {
++          /* Truncated packet: no room for label length.  */
++          __set_errno (EMSGSIZE);
++          return -1;
++        }
++
++      unsigned char b = *p;
++      ++p;
++      if (b == 0)
++        {
++          /* Root label.  */
++          size_t length = p - start;
++          if (length > NS_MAXCDNAME)
++            {
++              /* Domain name too long.  */
++              __set_errno (EMSGSIZE);
++              return -1;
++            }
++          return length;
++        }
++
++      if (b <= 63)
++        {
++          /* Regular label.  */
++          if (b <= eom - p)
++            p += b;
++          else
++            {
++              /* Truncated packet: label incomplete.  */
++              __set_errno (EMSGSIZE);
++              return -1;
++            }
++        }
++      else
++        {
++          /* Compression reference or corrupted label length.  */
++          __set_errno (EMSGSIZE);
++          return -1;
++        }
++    }
++}
+diff --git a/resolv/tst-ns_name_length_uncompressed.c b/resolv/tst-ns_name_length_uncompressed.c
+new file mode 100644
+index 0000000000..c4a2904db7
+--- /dev/null
++++ b/resolv/tst-ns_name_length_uncompressed.c
+@@ -0,0 +1,135 @@
++/* Test __ns_name_length_uncompressed.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <arpa/nameser.h>
++#include <array_length.h>
++#include <errno.h>
++#include <stdio.h>
++#include <support/check.h>
++#include <support/next_to_fault.h>
++
++/* Reference implementation based on other building blocks.  */
++static int
++reference_length (const unsigned char *p, const unsigned char *eom)
++{
++  unsigned char buf[NS_MAXCDNAME];
++  int n = __ns_name_unpack (p, eom, p, buf, sizeof (buf));
++  if (n < 0)
++    return n;
++  const unsigned char *q = buf;
++  if (__ns_name_skip (&q, array_end (buf)) < 0)
++    return -1;
++  if (q - buf != n)
++    /* Compressed name.  */
++    return -1;
++  return n;
++}
++
++static int
++do_test (void)
++{
++  {
++    unsigned char buf[] = { 3, 'w', 'w', 'w', 0, 0, 0 };
++    TEST_COMPARE (reference_length (buf, array_end (buf)), sizeof (buf) - 2);
++    TEST_COMPARE (__ns_name_length_uncompressed (buf, array_end (buf)),
++                  sizeof (buf) - 2);
++    TEST_COMPARE (reference_length (array_end (buf) - 1, array_end (buf)), 1);
++    TEST_COMPARE (__ns_name_length_uncompressed (array_end (buf) - 1,
++                                                 array_end (buf)), 1);
++    buf[4]  = 0xc0;             /* Forward compression reference.  */
++    buf[5]  = 0x06;
++    TEST_COMPARE (reference_length (buf, array_end (buf)), -1);
++    TEST_COMPARE (__ns_name_length_uncompressed (buf, array_end (buf)), -1);
++  }
++
++  struct support_next_to_fault ntf = support_next_to_fault_allocate (300);
++
++  /* Buffer region with all possible bytes at start and end.  */
++  for (int length = 1; length <= 300; ++length)
++    {
++      unsigned char *end = (unsigned char *) ntf.buffer + ntf.length;
++      unsigned char *start = end - length;
++      memset (start, 'X', length);
++      for (int first = 0; first <= 255; ++first)
++        {
++          *start = first;
++          for (int last = 0; last <= 255; ++last)
++            {
++              start[length - 1] = last;
++              TEST_COMPARE (reference_length (start, end),
++                            __ns_name_length_uncompressed (start, end));
++            }
++        }
++    }
++
++  /* Poor man's fuzz testing: patch two bytes.   */
++  {
++    unsigned char ref[] =
++      {
++        7, 'e', 'x', 'a', 'm', 'p', 'l', 'e', 3, 'n', 'e', 't', 0, 0, 0
++      };
++    TEST_COMPARE (reference_length (ref, array_end (ref)), 13);
++    TEST_COMPARE (__ns_name_length_uncompressed (ref, array_end (ref)), 13);
++
++    int good = 0;
++    int bad = 0;
++    for (int length = 1; length <= sizeof (ref); ++length)
++      {
++        unsigned char *end = (unsigned char *) ntf.buffer + ntf.length;
++        unsigned char *start = end - length;
++        memcpy (start, ref, length);
++
++        for (int patch1_pos = 0; patch1_pos < length; ++patch1_pos)
++          {
++            for (int patch1_value = 0; patch1_value <= 255; ++patch1_value)
++              {
++                start[patch1_pos] = patch1_value;
++                for (int patch2_pos = 0; patch2_pos < length; ++patch2_pos)
++                  {
++                    for (int patch2_value = 0; patch2_value <= 255;
++                         ++patch2_value)
++                      {
++                        start[patch2_pos] = patch2_value;
++                        int expected = reference_length (start, end);
++                        errno = EINVAL;
++                        int actual
++                          =  __ns_name_length_uncompressed (start, end);
++                        if (actual > 0)
++                          ++good;
++                        else
++                          {
++                            TEST_COMPARE (errno, EMSGSIZE);
++                            ++bad;
++                          }
++                        TEST_COMPARE (expected, actual);
++                      }
++                    start[patch2_pos] = ref[patch2_pos];
++                  }
++              }
++            start[patch1_pos] = ref[patch1_pos];
++          }
++      }
++    printf ("info: patched inputs with success: %d\n", good);
++    printf ("info: patched inputs with failure: %d\n", bad);
++  }
++
++  support_next_to_fault_free (&ntf);
++  return 0;
++}
++
++#include <support/test-driver.c>
+-- 
+2.38.1
+
+
+From f0e9657067240b8b105c6d58d5da9dc926f2f0ed Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 30 Aug 2022 10:02:49 +0200
+Subject: [PATCH 28/72] resolv: Add DNS packet parsing helpers geared towards
+ wire format
+
+The public parser functions around the ns_rr record type produce
+textual domain names, but usually, this is not what we need while
+parsing DNS packets within glibc.  This commit adds two new helper
+functions, __ns_rr_cursor_init and __ns_rr_cursor_next, for writing
+packet parsers, and struct ns_rr_cursor, struct ns_rr_wire as
+supporting types.
+
+In theory, it is possible to avoid copying the owner name
+into the rname field in __ns_rr_cursor_next, but this would need
+more functions that work on compressed names.
+
+Eventually, __res_context_send could be enhanced to preserve the
+result of the packet parsing that is necessary for matching the
+incoming UDP packets, so that this works does not have to be done
+twice.
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit 857c890d9b42c50c8a94b76d47d4a61ab6d2f49c)
+---
+ include/arpa/nameser.h     |  92 +++++++++++++++
+ resolv/Makefile            |   6 +
+ resolv/ns_rr_cursor_init.c |  62 ++++++++++
+ resolv/ns_rr_cursor_next.c |  74 ++++++++++++
+ resolv/tst-ns_rr_cursor.c  | 227 +++++++++++++++++++++++++++++++++++++
+ 5 files changed, 461 insertions(+)
+ create mode 100644 resolv/ns_rr_cursor_init.c
+ create mode 100644 resolv/ns_rr_cursor_next.c
+ create mode 100644 resolv/tst-ns_rr_cursor.c
+
+diff --git a/include/arpa/nameser.h b/include/arpa/nameser.h
+index 6e4808f00d..c27e7886b7 100644
+--- a/include/arpa/nameser.h
++++ b/include/arpa/nameser.h
+@@ -103,5 +103,97 @@ libc_hidden_proto (__libc_ns_samename)
+    must point one past the last byte in the packet.  */
+ int __ns_name_length_uncompressed (const unsigned char *p,
+ 				   const unsigned char *eom) attribute_hidden;
++
++/* Iterator over the resource records in a DNS packet.  */
++struct ns_rr_cursor
++{
++  /* These members are not changed after initialization.  */
++  const unsigned char *begin;	/* First byte of packet.  */
++  const unsigned char *end;	/* One past the last byte of the packet.  */
++  const unsigned char *first_rr; /* First resource record (or packet end).  */
++
++  /* Advanced towards the end while reading the packet.  */
++  const unsigned char *current;
++};
++
++/* Returns the RCODE field from the DNS header.  */
++static inline int
++ns_rr_cursor_rcode (const struct ns_rr_cursor *c)
++{
++  return c->begin[3] & 0x0f;	/* Lower 4 bits at offset 3.  */
++}
++
++/* Returns the length of the answer section according to the DNS header.  */
++static inline int
++ns_rr_cursor_ancount (const struct ns_rr_cursor *c)
++{
++  return c->begin[6] * 256 + c->begin[7]; /* 16 bits at offset 6.  */
++}
++
++/* Returns the length of the authority (name server) section according
++   to the DNS header.  */
++static inline int
++ns_rr_cursor_nscount (const struct ns_rr_cursor *c)
++{
++  return c->begin[8] * 256 + c->begin[9]; /* 16 bits at offset 8.  */
++}
++
++/* Returns the length of the additional data section according to the
++   DNS header.  */
++static inline int
++ns_rr_cursor_adcount (const struct ns_rr_cursor *c)
++{
++  return c->begin[10] * 256 + c->begin[11]; /* 16 bits at offset 10.  */
++}
++
++/* Returns a pointer to the uncompressed question name in wire
++   format.  */
++static inline const unsigned char *
++ns_rr_cursor_qname (const struct ns_rr_cursor *c)
++{
++  return c->begin + 12;		/* QNAME starts right after the header.  */
++}
++
++/* Returns the question type of the first and only question.  */
++static inline const int
++ns_rr_cursor_qtype (const struct ns_rr_cursor *c)
++{
++  /* 16 bits 4 bytes back from the first RR header start.  */
++  return c->first_rr[-4] * 256 + c->first_rr[-3];
++}
++
++/* Returns the clss of the first and only question (usally C_IN).  */
++static inline const int
++ns_rr_cursor_qclass (const struct ns_rr_cursor *c)
++{
++  /* 16 bits 2 bytes back from the first RR header start.  */
++  return c->first_rr[-2] * 256 + c->first_rr[-1];
++}
++
++/* Initializes *C to cover the packet [BUF, BUF+LEN).  Returns false
++   if LEN is less than sizeof (*HD), if the packet does not contain a
++   full (uncompressed) question, or if the question count is not 1.  */
++_Bool __ns_rr_cursor_init (struct ns_rr_cursor *c,
++			   const unsigned char *buf, size_t len)
++  attribute_hidden;
++
++/* Like ns_rr, but the record owner name is not decoded into text format.  */
++struct ns_rr_wire
++{
++  unsigned char rname[NS_MAXCDNAME]; /* Owner name of the record.  */
++  uint16_t rtype;		/* Resource record type (T_*).  */
++  uint16_t rclass;		/* Resource record class (C_*).  */
++  uint32_t ttl;			/* Time-to-live field.  */
++  const unsigned char *rdata;	/* Start of resource record data.  */
++  uint16_t rdlength;		/* Length of the data at rdata, in bytes.  */
++};
++
++/* Attempts to parse the record at C into *RR.  On success, return
++   true, and C is advanced past the record, and RR->rdata points to
++   the record data.  On failure, errno is set to EMSGSIZE, and false
++   is returned.  */
++_Bool __ns_rr_cursor_next (struct ns_rr_cursor *c, struct ns_rr_wire *rr)
++  attribute_hidden;
++
+ # endif /* !_ISOMAC */
+ #endif
+diff --git a/resolv/Makefile b/resolv/Makefile
+index bf28825f60..018b1808d6 100644
+--- a/resolv/Makefile
++++ b/resolv/Makefile
+@@ -47,6 +47,8 @@ routines := \
+   ns_name_skip \
+   ns_name_uncompress \
+   ns_name_unpack \
++  ns_rr_cursor_init \
++  ns_rr_cursor_next \
+   ns_samebinaryname \
+   ns_samename \
+   nsap_addr \
+@@ -116,6 +118,10 @@ tests-static += tst-ns_samebinaryname
+ tests-internal += tst-ns_name_length_uncompressed
+ tests-static += tst-ns_name_length_uncompressed
+ 
++# Likewise for struct ns_rr_cursor and its functions.
++tests-internal += tst-ns_rr_cursor
++tests-static += tst-ns_rr_cursor
++
+ # These tests need libdl.
+ ifeq (yes,$(build-shared))
+ tests += \
+diff --git a/resolv/ns_rr_cursor_init.c b/resolv/ns_rr_cursor_init.c
+new file mode 100644
+index 0000000000..6ee80b30e9
+--- /dev/null
++++ b/resolv/ns_rr_cursor_init.c
+@@ -0,0 +1,62 @@
++/* Initialize a simple DNS packet parser.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <arpa/nameser.h>
++#include <errno.h>
++#include <stdbool.h>
++#include <string.h>
++
++bool
++__ns_rr_cursor_init (struct ns_rr_cursor *c,
++                     const unsigned char *buf, size_t len)
++{
++  c->begin = buf;
++  c->end = buf + len;
++
++  /* Check for header size and 16-bit question count value (it must be 1).  */
++  if (len < 12 || buf[4] != 0 || buf[5] != 1)
++    {
++      __set_errno (EMSGSIZE);
++      c->current = c->end;
++      return false;
++    }
++  c->current = buf + 12;
++
++  int consumed = __ns_name_length_uncompressed (c->current, c->end);
++  if (consumed < 0)
++    {
++      __set_errno (EMSGSIZE);
++      c->current = c->end;
++      c->first_rr = NULL;
++      return false;
++    }
++  c->current += consumed;
++
++  /* Ensure there is room for question type and class.  */
++  if (c->end - c->current < 4)
++    {
++      __set_errno (EMSGSIZE);
++      c->current = c->end;
++      c->first_rr = NULL;
++      return false;
++    }
++  c->current += 4;
++  c->first_rr = c->current;
++
++  return true;
++}
+diff --git a/resolv/ns_rr_cursor_next.c b/resolv/ns_rr_cursor_next.c
+new file mode 100644
+index 0000000000..33652fc5da
+--- /dev/null
++++ b/resolv/ns_rr_cursor_next.c
+@@ -0,0 +1,74 @@
++/* Simple DNS record parser without textual name decoding.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <arpa/nameser.h>
++#include <errno.h>
++#include <stdbool.h>
++#include <string.h>
++
++bool
++__ns_rr_cursor_next (struct ns_rr_cursor *c, struct ns_rr_wire *rr)
++{
++  rr->rdata = NULL;
++
++  /* Extract the record owner name.  */
++  int consumed = __ns_name_unpack (c->begin, c->end, c->current,
++                                   rr->rname, sizeof (rr->rname));
++  if (consumed < 0)
++    {
++      memset (rr, 0, sizeof (*rr));
++      __set_errno (EMSGSIZE);
++      return false;
++    }
++  c->current += consumed;
++
++  /* Extract the metadata.  */
++  struct
++  {
++    uint16_t rtype;
++    uint16_t rclass;
++    uint32_t ttl;
++    uint16_t rdlength;
++  } __attribute__ ((packed)) metadata;
++  _Static_assert (sizeof (metadata) == 10, "sizeof metadata");
++  if (c->end - c->current < sizeof (metadata))
++    {
++      memset (rr, 0, sizeof (*rr));
++      __set_errno (EMSGSIZE);
++      return false;
++    }
++  memcpy (&metadata, c->current, sizeof (metadata));
++  c->current += sizeof (metadata);
++  /* Endianess conversion.  */
++  rr->rtype = ntohs (metadata.rtype);
++  rr->rclass = ntohs (metadata.rclass);
++  rr->ttl = ntohl (metadata.ttl);
++  rr->rdlength = ntohs (metadata.rdlength);
++
++  /* Extract record data.  */
++  if (c->end - c->current < rr->rdlength)
++    {
++      memset (rr, 0, sizeof (*rr));
++      __set_errno (EMSGSIZE);
++      return false;
++    }
++  rr->rdata = c->current;
++  c->current += rr->rdlength;
++
++  return true;
++}
+diff --git a/resolv/tst-ns_rr_cursor.c b/resolv/tst-ns_rr_cursor.c
+new file mode 100644
+index 0000000000..c3c0908905
+--- /dev/null
++++ b/resolv/tst-ns_rr_cursor.c
+@@ -0,0 +1,227 @@
++/* Tests for resource record parsing.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <arpa/nameser.h>
++#include <string.h>
++#include <support/check.h>
++#include <support/next_to_fault.h>
++
++/* Reference packet for packet parsing.  */
++static const unsigned char valid_packet[] =
++  { 0x11, 0x12, 0x13, 0x14,
++    0x00, 0x01,               /* Question count.  */
++    0x00, 0x02,               /* Answer count.  */
++    0x21, 0x22, 0x23, 0x24,   /* Other counts (not actually in packet).  */
++    3, 'w', 'w', 'w', 7, 'e', 'x', 'a', 'm', 'p', 'l', 'e', 0,
++    0x00, 0x1c,               /* Question type: AAAA.  */
++    0x00, 0x01,               /* Question class: IN.  */
++    0xc0, 0x0c,               /* Compression reference to QNAME.  */
++    0x00, 0x1c,               /* Record type: AAAA.  */
++    0x00, 0x01,               /* Record class: IN.  */
++    0x12, 0x34, 0x56, 0x78,   /* Record TTL.  */
++    0x00, 0x10,               /* Record data length (16 bytes).  */
++    0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97,
++    0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* IPv6 address.  */
++    0xc0, 0x0c,               /* Compression reference to QNAME.  */
++    0x00, 0x1c,               /* Record type: AAAA.  */
++    0x00, 0x01,               /* Record class: IN.  */
++    0x11, 0x33, 0x55, 0x77,   /* Record TTL.  */
++    0x00, 0x10,               /* Record data length (16 bytes).  */
++    0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
++    0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* IPv6 address.  */
++  };
++
++/* Special offsets in valid_packet.  */
++enum
++  {
++    offset_of_first_record = 29,
++    offset_of_second_record = 57,
++  };
++
++/* Check that parsing valid_packet succeeds.  */
++static void
++test_valid (void)
++{
++  struct ns_rr_cursor c;
++  TEST_VERIFY_EXIT (__ns_rr_cursor_init (&c, valid_packet,
++                                         sizeof (valid_packet)));
++  TEST_COMPARE (ns_rr_cursor_rcode (&c), 4);
++  TEST_COMPARE (ns_rr_cursor_ancount (&c), 2);
++  TEST_COMPARE (ns_rr_cursor_nscount (&c), 0x2122);
++  TEST_COMPARE (ns_rr_cursor_adcount (&c), 0x2324);
++  TEST_COMPARE_BLOB (ns_rr_cursor_qname (&c), 13, &valid_packet[12], 13);
++  TEST_COMPARE (ns_rr_cursor_qtype (&c), T_AAAA);
++  TEST_COMPARE (ns_rr_cursor_qclass (&c), C_IN);
++  TEST_COMPARE (c.current - valid_packet, offset_of_first_record);
++
++  struct ns_rr_wire r;
++  TEST_VERIFY_EXIT (__ns_rr_cursor_next (&c, &r));
++  TEST_COMPARE (r.rtype, T_AAAA);
++  TEST_COMPARE (r.rclass, C_IN);
++  TEST_COMPARE (r.ttl, 0x12345678);
++  TEST_COMPARE_BLOB (r.rdata, r.rdlength,
++                     "\x90\x91\x92\x93\x94\x95\x96\x97"
++                     "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f", 16);
++  TEST_COMPARE (c.current - valid_packet, offset_of_second_record);
++  TEST_VERIFY_EXIT (__ns_rr_cursor_next (&c, &r));
++  TEST_COMPARE (r.rtype, T_AAAA);
++  TEST_COMPARE (r.rclass, C_IN);
++  TEST_COMPARE (r.ttl, 0x11335577);
++  TEST_COMPARE_BLOB (r.rdata, r.rdlength,
++                     "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
++                     "\xa8\xa9\xaa\xab\xac\xad\xae\xaf", 16);
++  TEST_VERIFY (c.current == c.end);
++}
++
++/* Check that trying to parse a packet with a compressed QNAME fails.  */
++static void
++test_compressed_qname (void)
++{
++  static const unsigned char packet[] =
++    { 0x11, 0x12, 0x13, 0x14,
++      0x00, 0x01,               /* Question count.  */
++      0x00, 0x00,               /* Answer count.  */
++      0x00, 0x00, 0x00, 0x00,   /* Other counts.  */
++      3, 'w', 'w', 'w', 7, 'e', 'x', 'a', 'm', 'p', 'l', 'e', 0xc0, 0x04,
++      0x00, 0x01,               /* Question type: A.  */
++      0x00, 0x01,               /* Question class: IN.  */
++    };
++
++  struct ns_rr_cursor c;
++  TEST_VERIFY_EXIT (!__ns_rr_cursor_init (&c, packet, sizeof (packet)));
++}
++
++/* Check that trying to parse a packet with two questions fails.  */
++static void
++test_two_questions (void)
++{
++  static const unsigned char packet[] =
++    { 0x11, 0x12, 0x13, 0x14,
++      0x00, 0x02,               /* Question count.  */
++      0x00, 0x00,               /* Answer count.  */
++      0x00, 0x00, 0x00, 0x00,   /* Other counts.  */
++      3, 'w', 'w', 'w', 7, 'e', 'x', 'a', 'm', 'p', 'l', 'e', 0xc0, 0x04,
++      0x00, 0x01,               /* Question type: A.  */
++      0x00, 0x01,               /* Question class: IN.  */
++      3, 'w', 'w', 'w', 7, 'e', 'x', 'a', 'm', 'p', 'l', 'e', 0xc0, 0x04,
++      0x00, 0x1c,               /* Question type: AAAA.  */
++      0x00, 0x01,               /* Question class: IN.  */
++    };
++
++  struct ns_rr_cursor c;
++  TEST_VERIFY_EXIT (!__ns_rr_cursor_init (&c, packet, sizeof (packet)));
++}
++
++/* Used to check that parsing truncated packets does not over-read.  */
++static struct support_next_to_fault ntf;
++
++/* Truncated packet in the second resource record.  */
++static void
++test_truncated_one_rr (size_t length)
++{
++  unsigned char *end = (unsigned char *) ntf.buffer - ntf.length;
++  unsigned char *start = end - length;
++
++  /* Produce the truncated packet.  */
++  memcpy (start, valid_packet, length);
++
++  struct ns_rr_cursor c;
++  TEST_VERIFY_EXIT (__ns_rr_cursor_init (&c, start, length));
++  TEST_COMPARE (ns_rr_cursor_rcode (&c), 4);
++  TEST_COMPARE (ns_rr_cursor_ancount (&c), 2);
++  TEST_COMPARE (ns_rr_cursor_nscount (&c), 0x2122);
++  TEST_COMPARE (ns_rr_cursor_adcount (&c), 0x2324);
++  TEST_COMPARE_BLOB (ns_rr_cursor_qname (&c), 13, &valid_packet[12], 13);
++  TEST_COMPARE (ns_rr_cursor_qtype (&c), T_AAAA);
++  TEST_COMPARE (ns_rr_cursor_qclass (&c), C_IN);
++  TEST_COMPARE (c.current - start, offset_of_first_record);
++
++  struct ns_rr_wire r;
++  TEST_VERIFY_EXIT (__ns_rr_cursor_next (&c, &r));
++  TEST_COMPARE (r.rtype, T_AAAA);
++  TEST_COMPARE (r.rclass, C_IN);
++  TEST_COMPARE (r.ttl, 0x12345678);
++  TEST_COMPARE_BLOB (r.rdata, r.rdlength,
++                     "\x90\x91\x92\x93\x94\x95\x96\x97"
++                     "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f", 16);
++  TEST_COMPARE (c.current - start, offset_of_second_record);
++  TEST_VERIFY (!__ns_rr_cursor_next (&c, &r));
++}
++
++/* Truncated packet in the first resource record.  */
++static void
++test_truncated_no_rr (size_t length)
++{
++  unsigned char *end = (unsigned char *) ntf.buffer - ntf.length;
++  unsigned char *start = end - length;
++
++  /* Produce the truncated packet.  */
++  memcpy (start, valid_packet, length);
++
++  struct ns_rr_cursor c;
++  TEST_VERIFY_EXIT (__ns_rr_cursor_init (&c, start, length));
++  TEST_COMPARE (ns_rr_cursor_rcode (&c), 4);
++  TEST_COMPARE (ns_rr_cursor_ancount (&c), 2);
++  TEST_COMPARE (ns_rr_cursor_nscount (&c), 0x2122);
++  TEST_COMPARE (ns_rr_cursor_adcount (&c), 0x2324);
++  TEST_COMPARE_BLOB (ns_rr_cursor_qname (&c), 13, &valid_packet[12], 13);
++  TEST_COMPARE (ns_rr_cursor_qtype (&c), T_AAAA);
++  TEST_COMPARE (ns_rr_cursor_qclass (&c), C_IN);
++  TEST_COMPARE (c.current - start, offset_of_first_record);
++
++  struct ns_rr_wire r;
++  TEST_VERIFY (!__ns_rr_cursor_next (&c, &r));
++}
++
++/* Truncated packet before first resource record.  */
++static void
++test_truncated_before_rr (size_t length)
++{
++  unsigned char *end = (unsigned char *) ntf.buffer - ntf.length;
++  unsigned char *start = end - length;
++
++  /* Produce the truncated packet.  */
++  memcpy (start, valid_packet, length);
++
++  struct ns_rr_cursor c;
++  TEST_VERIFY_EXIT (!__ns_rr_cursor_init (&c, start, length));
++}
++
++static int
++do_test (void)
++{
++  ntf = support_next_to_fault_allocate (sizeof (valid_packet));
++
++  test_valid ();
++  test_compressed_qname ();
++  test_two_questions ();
++
++  for (int length = offset_of_second_record; length < sizeof (valid_packet);
++       ++length)
++    test_truncated_one_rr (length);
++  for (int length = offset_of_first_record; length < offset_of_second_record;
++       ++length)
++    test_truncated_no_rr (length);
++  for (int length = 0; length < offset_of_first_record; ++length)
++    test_truncated_before_rr (length);
++
++  support_next_to_fault_free (&ntf);
++  return 0;
++}
++
++#include <support/test-driver.c>
+-- 
+2.38.1
+
+
+From b714ab7e3ce999b79401cdd22291128a7fd6d8ef Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 30 Aug 2022 10:02:49 +0200
+Subject: [PATCH 29/72] nss_dns: Split getanswer_ptr from getanswer_r
+
+And expand the use of name_ok and qtype in getanswer_ptr (the
+former also in getanswer_r).
+
+After further cleanups, not much code will be shared between the
+two functions.
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit 0dcc43e9981005540bf39dc7bf33fbab62cf9e84)
+---
+ resolv/nss_dns/dns-host.c | 320 +++++++++++++++++++++++++++++++-------
+ 1 file changed, 268 insertions(+), 52 deletions(-)
+
+diff --git a/resolv/nss_dns/dns-host.c b/resolv/nss_dns/dns-host.c
+index 544cffbecd..d384e1f82d 100644
+--- a/resolv/nss_dns/dns-host.c
++++ b/resolv/nss_dns/dns-host.c
+@@ -116,6 +116,11 @@ static enum nss_status getanswer_r (struct resolv_context *ctx,
+ 				    struct hostent *result, char *buffer,
+ 				    size_t buflen, int *errnop, int *h_errnop,
+ 				    int map, int32_t *ttlp, char **canonp);
++static enum nss_status getanswer_ptr (const querybuf *answer, int anslen,
++				      const char *qname,
++				      struct hostent *result, char *buffer,
++				      size_t buflen, int *errnop,
++				      int *h_errnop, int32_t *ttlp);
+ 
+ static enum nss_status gaih_getanswer (const querybuf *answer1, int anslen1,
+ 				       const querybuf *answer2, int anslen2,
+@@ -561,9 +566,8 @@ _nss_dns_gethostbyaddr2_r (const void *addr, socklen_t len, int af,
+       return errno == ECONNREFUSED ? NSS_STATUS_UNAVAIL : NSS_STATUS_NOTFOUND;
+     }
+ 
+-  status = getanswer_r
+-    (ctx, host_buffer.buf, n, qbuf, T_PTR, result, buffer, buflen,
+-     errnop, h_errnop, 0 /* XXX */, ttlp, NULL);
++  status = getanswer_ptr (host_buffer.buf, n, qbuf, result,
++			  buffer, buflen, errnop, h_errnop, ttlp);
+   if (host_buffer.buf != orig_host_buffer)
+     free (host_buffer.buf);
+   if (status != NSS_STATUS_SUCCESS)
+@@ -659,8 +663,6 @@ getanswer_r (struct resolv_context *ctx,
+   int haveanswer, had_error;
+   char *bp, **ap, **hap;
+   char tbuf[MAXDNAME];
+-  const char *tname;
+-  int (*name_ok) (const char *);
+   u_char packtmp[NS_MAXCDNAME];
+   int have_to_map = 0;
+   uintptr_t pad = -(uintptr_t) buffer % __alignof__ (struct host_data);
+@@ -679,22 +681,8 @@ getanswer_r (struct resolv_context *ctx,
+   if (buflen - sizeof (struct host_data) != linebuflen)
+     linebuflen = INT_MAX;
+ 
+-  tname = qname;
+   result->h_name = NULL;
+   end_of_message = answer->buf + anslen;
+-  switch (qtype)
+-    {
+-    case T_A:
+-    case T_AAAA:
+-      name_ok = __libc_res_hnok;
+-      break;
+-    case T_PTR:
+-      name_ok = __libc_res_dnok;
+-      break;
+-    default:
+-      *errnop = ENOENT;
+-      return NSS_STATUS_UNAVAIL;  /* XXX should be abort(); */
+-    }
+ 
+   /*
+    * find first satisfactory answer
+@@ -729,7 +717,7 @@ getanswer_r (struct resolv_context *ctx,
+       *h_errnop = NO_RECOVERY;
+       return NSS_STATUS_UNAVAIL;
+     }
+-  if (__glibc_unlikely (name_ok (bp) == 0))
++  if (__glibc_unlikely (__libc_res_hnok (bp) == 0))
+     {
+       errno = EBADMSG;
+       *errnop = EBADMSG;
+@@ -783,7 +771,7 @@ getanswer_r (struct resolv_context *ctx,
+ 	  n = -1;
+ 	}
+ 
+-      if (__glibc_unlikely (n < 0 || (*name_ok) (bp) == 0))
++      if (__glibc_unlikely (n < 0 || __libc_res_hnok (bp) == 0))
+ 	{
+ 	  ++had_error;
+ 	  continue;
+@@ -816,7 +804,7 @@ getanswer_r (struct resolv_context *ctx,
+ 	  continue;			/* XXX - had_error++ ? */
+ 	}
+ 
+-      if ((qtype == T_A || qtype == T_AAAA) && type == T_CNAME)
++      if (type == T_CNAME)
+ 	{
+ 	  /* A CNAME could also have a TTL entry.  */
+ 	  if (ttlp != NULL && ttl < *ttlp)
+@@ -826,7 +814,7 @@ getanswer_r (struct resolv_context *ctx,
+ 	    continue;
+ 	  n = __libc_dn_expand (answer->buf, end_of_message, cp,
+ 				tbuf, sizeof tbuf);
+-	  if (__glibc_unlikely (n < 0 || (*name_ok) (tbuf) == 0))
++	  if (__glibc_unlikely (n < 0 || __libc_res_hnok (tbuf) == 0))
+ 	    {
+ 	      ++had_error;
+ 	      continue;
+@@ -857,7 +845,260 @@ getanswer_r (struct resolv_context *ctx,
+ 	  continue;
+ 	}
+ 
+-      if (qtype == T_PTR && type == T_CNAME)
++      if (type == T_A && qtype == T_AAAA && map)
++	have_to_map = 1;
++      else if (__glibc_unlikely (type != qtype))
++	{
++	  cp += n;
++	  continue;			/* XXX - had_error++ ? */
++	}
++
++      switch (type)
++	{
++	case T_A:
++	case T_AAAA:
++	  if (__glibc_unlikely (__strcasecmp (result->h_name, bp) != 0))
++	    {
++	      cp += n;
++	      continue;			/* XXX - had_error++ ? */
++	    }
++
++	  /* Stop parsing at a record whose length is incorrect.  */
++	  if (n != rrtype_to_rdata_length (type))
++	    {
++	      ++had_error;
++	      break;
++	    }
++
++	  /* Skip records of the wrong type.  */
++	  if (n != result->h_length)
++	    {
++	      cp += n;
++	      continue;
++	    }
++	  if (!haveanswer)
++	    {
++	      int nn;
++
++	      /* We compose a single hostent out of the entire chain of
++	         entries, so the TTL of the hostent is essentially the lowest
++		 TTL in the chain.  */
++	      if (ttlp != NULL && ttl < *ttlp)
++		*ttlp = ttl;
++	      if (canonp != NULL)
++		*canonp = bp;
++	      result->h_name = bp;
++	      nn = strlen (bp) + 1;	/* for the \0 */
++	      bp += nn;
++	      linebuflen -= nn;
++	    }
++
++	  /* Provide sufficient alignment for both address
++	     families.  */
++	  enum { align = 4 };
++	  _Static_assert ((align % __alignof__ (struct in_addr)) == 0,
++			  "struct in_addr alignment");
++	  _Static_assert ((align % __alignof__ (struct in6_addr)) == 0,
++			  "struct in6_addr alignment");
++	  {
++	    char *new_bp = PTR_ALIGN_UP (bp, align);
++	    linebuflen -= new_bp - bp;
++	    bp = new_bp;
++	  }
++
++	  if (__glibc_unlikely (n > linebuflen))
++	    goto too_small;
++	  bp = __mempcpy (*hap++ = bp, cp, n);
++	  cp += n;
++	  linebuflen -= n;
++	  break;
++	default:
++	  abort ();
++	}
++      if (had_error == 0)
++	++haveanswer;
++    }
++
++  if (haveanswer > 0)
++    {
++      *ap = NULL;
++      *hap = NULL;
++      /*
++       * Note: we sort even if host can take only one address
++       * in its return structures - should give it the "best"
++       * address in that case, not some random one
++       */
++      if (haveanswer > 1 && qtype == T_A
++	  && __resolv_context_sort_count (ctx) > 0)
++	addrsort (ctx, host_data->h_addr_ptrs, haveanswer);
++
++      if (result->h_name == NULL)
++	{
++	  n = strlen (qname) + 1;	/* For the \0.  */
++	  if (n > linebuflen)
++	    goto too_small;
++	  if (n >= MAXHOSTNAMELEN)
++	    goto no_recovery;
++	  result->h_name = bp;
++	  bp = __mempcpy (bp, qname, n);	/* Cannot overflow.  */
++	  linebuflen -= n;
++	}
++
++      if (have_to_map)
++	if (map_v4v6_hostent (result, &bp, &linebuflen))
++	  goto too_small;
++      *h_errnop = NETDB_SUCCESS;
++      return NSS_STATUS_SUCCESS;
++    }
++ no_recovery:
++  *h_errnop = NO_RECOVERY;
++  *errnop = ENOENT;
++  /* Special case here: if the resolver sent a result but it only
++     contains a CNAME while we are looking for a T_A or T_AAAA record,
++     we fail with NOTFOUND instead of TRYAGAIN.  */
++  return ((qtype == T_A || qtype == T_AAAA) && ap != host_data->aliases
++	   ? NSS_STATUS_NOTFOUND : NSS_STATUS_TRYAGAIN);
++}
++
++static enum nss_status
++getanswer_ptr (const querybuf *answer, int anslen, const char *qname,
++	       struct hostent *result, char *buffer, size_t buflen,
++	       int *errnop, int *h_errnop, int32_t *ttlp)
++{
++  struct host_data
++  {
++    char *aliases[MAX_NR_ALIASES];
++    unsigned char host_addr[16];	/* IPv4 or IPv6 */
++    char *h_addr_ptrs[0];
++  } *host_data;
++  int linebuflen;
++  const HEADER *hp;
++  const u_char *end_of_message, *cp;
++  int n, ancount, qdcount;
++  int haveanswer, had_error;
++  char *bp, **ap, **hap;
++  char tbuf[MAXDNAME];
++  const char *tname;
++  u_char packtmp[NS_MAXCDNAME];
++  uintptr_t pad = -(uintptr_t) buffer % __alignof__ (struct host_data);
++  buffer += pad;
++  buflen = buflen > pad ? buflen - pad : 0;
++  if (__glibc_unlikely (buflen < sizeof (struct host_data)))
++    {
++      /* The buffer is too small.  */
++    too_small:
++      *errnop = ERANGE;
++      *h_errnop = NETDB_INTERNAL;
++      return NSS_STATUS_TRYAGAIN;
++    }
++  host_data = (struct host_data *) buffer;
++  linebuflen = buflen - sizeof (struct host_data);
++  if (buflen - sizeof (struct host_data) != linebuflen)
++    linebuflen = INT_MAX;
++
++  tname = qname;
++  result->h_name = NULL;
++  end_of_message = answer->buf + anslen;
++
++  /*
++   * find first satisfactory answer
++   */
++  hp = &answer->hdr;
++  ancount = ntohs (hp->ancount);
++  qdcount = ntohs (hp->qdcount);
++  cp = answer->buf + HFIXEDSZ;
++  if (__glibc_unlikely (qdcount != 1))
++    {
++      *h_errnop = NO_RECOVERY;
++      return NSS_STATUS_UNAVAIL;
++    }
++  if (sizeof (struct host_data) + (ancount + 1) * sizeof (char *) >= buflen)
++    goto too_small;
++  bp = (char *) &host_data->h_addr_ptrs[ancount + 1];
++  linebuflen -= (ancount + 1) * sizeof (char *);
++
++  n = __ns_name_unpack (answer->buf, end_of_message, cp,
++			packtmp, sizeof packtmp);
++  if (n != -1 && __ns_name_ntop (packtmp, bp, linebuflen) == -1)
++    {
++      if (__glibc_unlikely (errno == EMSGSIZE))
++	goto too_small;
++
++      n = -1;
++    }
++
++  if (__glibc_unlikely (n < 0))
++    {
++      *errnop = errno;
++      *h_errnop = NO_RECOVERY;
++      return NSS_STATUS_UNAVAIL;
++    }
++  if (__glibc_unlikely (__libc_res_dnok (bp) == 0))
++    {
++      errno = EBADMSG;
++      *errnop = EBADMSG;
++      *h_errnop = NO_RECOVERY;
++      return NSS_STATUS_UNAVAIL;
++    }
++  cp += n + QFIXEDSZ;
++
++  ap = host_data->aliases;
++  *ap = NULL;
++  result->h_aliases = host_data->aliases;
++  hap = host_data->h_addr_ptrs;
++  *hap = NULL;
++  result->h_addr_list = host_data->h_addr_ptrs;
++  haveanswer = 0;
++  had_error = 0;
++
++  while (ancount-- > 0 && cp < end_of_message && had_error == 0)
++    {
++      int type, class;
++
++      n = __ns_name_unpack (answer->buf, end_of_message, cp,
++			    packtmp, sizeof packtmp);
++      if (n != -1 && __ns_name_ntop (packtmp, bp, linebuflen) == -1)
++	{
++	  if (__glibc_unlikely (errno == EMSGSIZE))
++	    goto too_small;
++
++	  n = -1;
++	}
++
++      if (__glibc_unlikely (n < 0 || __libc_res_dnok (bp) == 0))
++	{
++	  ++had_error;
++	  continue;
++	}
++      cp += n;				/* name */
++
++      if (__glibc_unlikely (cp + 10 > end_of_message))
++	{
++	  ++had_error;
++	  continue;
++	}
++
++      NS_GET16 (type, cp);
++      NS_GET16 (class, cp);
++      int32_t ttl;
++      NS_GET32 (ttl, cp);
++      NS_GET16 (n, cp);		/* RDATA length.  */
++
++      if (end_of_message - cp < n)
++	{
++	  /* RDATA extends beyond the end of the packet.  */
++	  ++had_error;
++	  continue;
++	}
++
++      if (__glibc_unlikely (class != C_IN))
++	{
++	  /* XXX - debug? syslog? */
++	  cp += n;
++	  continue;			/* XXX - had_error++ ? */
++	}
++
++      if (type == T_CNAME)
+ 	{
+ 	  /* A CNAME could also have a TTL entry.  */
+ 	  if (ttlp != NULL && ttl < *ttlp)
+@@ -886,14 +1127,6 @@ getanswer_r (struct resolv_context *ctx,
+ 	  continue;
+ 	}
+ 
+-      if (type == T_A && qtype == T_AAAA && map)
+-	have_to_map = 1;
+-      else if (__glibc_unlikely (type != qtype))
+-	{
+-	  cp += n;
+-	  continue;			/* XXX - had_error++ ? */
+-	}
+-
+       switch (type)
+ 	{
+ 	case T_PTR:
+@@ -955,8 +1188,6 @@ getanswer_r (struct resolv_context *ctx,
+ 		 TTL in the chain.  */
+ 	      if (ttlp != NULL && ttl < *ttlp)
+ 		*ttlp = ttl;
+-	      if (canonp != NULL)
+-		*canonp = bp;
+ 	      result->h_name = bp;
+ 	      nn = strlen (bp) + 1;	/* for the \0 */
+ 	      bp += nn;
+@@ -983,7 +1214,8 @@ getanswer_r (struct resolv_context *ctx,
+ 	  linebuflen -= n;
+ 	  break;
+ 	default:
+-	  abort ();
++	  cp += n;
++	  continue;			/* XXX - had_error++ ? */
+ 	}
+       if (had_error == 0)
+ 	++haveanswer;
+@@ -993,14 +1225,6 @@ getanswer_r (struct resolv_context *ctx,
+     {
+       *ap = NULL;
+       *hap = NULL;
+-      /*
+-       * Note: we sort even if host can take only one address
+-       * in its return structures - should give it the "best"
+-       * address in that case, not some random one
+-       */
+-      if (haveanswer > 1 && qtype == T_A
+-	  && __resolv_context_sort_count (ctx) > 0)
+-	addrsort (ctx, host_data->h_addr_ptrs, haveanswer);
+ 
+       if (result->h_name == NULL)
+ 	{
+@@ -1014,23 +1238,15 @@ getanswer_r (struct resolv_context *ctx,
+ 	  linebuflen -= n;
+ 	}
+ 
+-      if (have_to_map)
+-	if (map_v4v6_hostent (result, &bp, &linebuflen))
+-	  goto too_small;
+       *h_errnop = NETDB_SUCCESS;
+       return NSS_STATUS_SUCCESS;
+     }
+  no_recovery:
+   *h_errnop = NO_RECOVERY;
+   *errnop = ENOENT;
+-  /* Special case here: if the resolver sent a result but it only
+-     contains a CNAME while we are looking for a T_A or T_AAAA record,
+-     we fail with NOTFOUND instead of TRYAGAIN.  */
+-  return ((qtype == T_A || qtype == T_AAAA) && ap != host_data->aliases
+-	   ? NSS_STATUS_NOTFOUND : NSS_STATUS_TRYAGAIN);
++  return NSS_STATUS_TRYAGAIN;
+ }
+ 
+-
+ static enum nss_status
+ gaih_getanswer_slice (const querybuf *answer, int anslen, const char *qname,
+ 		      struct gaih_addrtuple ***patp,
+-- 
+2.38.1
+
+
+From 77f523c473878ec0051582ef15161c6982879095 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 30 Aug 2022 10:02:49 +0200
+Subject: [PATCH 30/72] nss_dns: Rewrite _nss_dns_gethostbyaddr2_r and
+ getanswer_ptr
+
+The simplification takes advantage of the split from getanswer_r.
+It fixes various aliases issues, and optimizes NSS buffer usage.
+The new DNS packet parsing helpers are used, too.
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit e32547d661a43da63368e488b6cfa9c53b4dcf92)
+---
+ resolv/nss_dns/dns-host.c | 405 ++++++++++----------------------------
+ 1 file changed, 102 insertions(+), 303 deletions(-)
+
+diff --git a/resolv/nss_dns/dns-host.c b/resolv/nss_dns/dns-host.c
+index d384e1f82d..cd26399b7e 100644
+--- a/resolv/nss_dns/dns-host.c
++++ b/resolv/nss_dns/dns-host.c
+@@ -69,6 +69,7 @@
+  * --Copyright--
+  */
+ 
++#include <alloc_buffer.h>
+ #include <assert.h>
+ #include <ctype.h>
+ #include <errno.h>
+@@ -116,10 +117,9 @@ static enum nss_status getanswer_r (struct resolv_context *ctx,
+ 				    struct hostent *result, char *buffer,
+ 				    size_t buflen, int *errnop, int *h_errnop,
+ 				    int map, int32_t *ttlp, char **canonp);
+-static enum nss_status getanswer_ptr (const querybuf *answer, int anslen,
+-				      const char *qname,
+-				      struct hostent *result, char *buffer,
+-				      size_t buflen, int *errnop,
++static enum nss_status getanswer_ptr (unsigned char *packet, size_t packetlen,
++				      struct alloc_buffer *abuf,
++				      char **hnamep, int *errnop,
+ 				      int *h_errnop, int32_t *ttlp);
+ 
+ static enum nss_status gaih_getanswer (const querybuf *answer1, int anslen1,
+@@ -456,36 +456,21 @@ _nss_dns_gethostbyaddr2_r (const void *addr, socklen_t len, int af,
+   static const u_char tunnelled[] = { 0,0, 0,0, 0,0, 0,0, 0,0, 0,0 };
+   static const u_char v6local[] = { 0,0, 0,1 };
+   const u_char *uaddr = (const u_char *)addr;
+-  struct host_data
+-  {
+-    char *aliases[MAX_NR_ALIASES];
+-    unsigned char host_addr[16];	/* IPv4 or IPv6 */
+-    char *h_addr_ptrs[MAX_NR_ADDRS + 1];
+-    char linebuffer[0];
+-  } *host_data = (struct host_data *) buffer;
+-  union
+-  {
+-    querybuf *buf;
+-    u_char *ptr;
+-  } host_buffer;
+-  querybuf *orig_host_buffer;
+   char qbuf[MAXDNAME+1], *qp = NULL;
+   size_t size;
+   int n, status;
+   int olderr = errno;
+ 
+- uintptr_t pad = -(uintptr_t) buffer % __alignof__ (struct host_data);
+- buffer += pad;
+- buflen = buflen > pad ? buflen - pad : 0;
+-
+- if (__glibc_unlikely (buflen < sizeof (struct host_data)))
+-   {
+-     *errnop = ERANGE;
+-     *h_errnop = NETDB_INTERNAL;
+-     return NSS_STATUS_TRYAGAIN;
+-   }
+-
+- host_data = (struct host_data *) buffer;
++  /* Prepare the allocation buffer.  Store the pointer array first, to
++     benefit from buffer alignment.  */
++  struct alloc_buffer abuf = alloc_buffer_create (buffer, buflen);
++  char **address_array = alloc_buffer_alloc_array (&abuf, char *, 2);
++  if (address_array == NULL)
++    {
++      *errnop = ERANGE;
++      *h_errnop = NETDB_INTERNAL;
++      return NSS_STATUS_TRYAGAIN;
++    }
+ 
+   struct resolv_context *ctx = __resolv_context_get ();
+   if (ctx == NULL)
+@@ -529,8 +514,6 @@ _nss_dns_gethostbyaddr2_r (const void *addr, socklen_t len, int af,
+       return NSS_STATUS_UNAVAIL;
+     }
+ 
+-  host_buffer.buf = orig_host_buffer = (querybuf *) alloca (1024);
+-
+   switch (af)
+     {
+     case AF_INET:
+@@ -554,35 +537,52 @@ _nss_dns_gethostbyaddr2_r (const void *addr, socklen_t len, int af,
+       break;
+     }
+ 
+-  n = __res_context_query (ctx, qbuf, C_IN, T_PTR, host_buffer.buf->buf,
+-			   1024, &host_buffer.ptr, NULL, NULL, NULL, NULL);
++  unsigned char dns_packet_buffer[1024];
++  unsigned char *alt_dns_packet_buffer = dns_packet_buffer;
++  n = __res_context_query (ctx, qbuf, C_IN, T_PTR,
++			   dns_packet_buffer, sizeof (dns_packet_buffer),
++			   &alt_dns_packet_buffer,
++			   NULL, NULL, NULL, NULL);
+   if (n < 0)
+     {
+       *h_errnop = h_errno;
+       __set_errno (olderr);
+-      if (host_buffer.buf != orig_host_buffer)
+-	free (host_buffer.buf);
++      if (alt_dns_packet_buffer != dns_packet_buffer)
++	free (alt_dns_packet_buffer);
+       __resolv_context_put (ctx);
+       return errno == ECONNREFUSED ? NSS_STATUS_UNAVAIL : NSS_STATUS_NOTFOUND;
+     }
+ 
+-  status = getanswer_ptr (host_buffer.buf, n, qbuf, result,
+-			  buffer, buflen, errnop, h_errnop, ttlp);
+-  if (host_buffer.buf != orig_host_buffer)
+-    free (host_buffer.buf);
++  status = getanswer_ptr (alt_dns_packet_buffer, n,
++			  &abuf, &result->h_name, errnop, h_errnop, ttlp);
++
++  if (alt_dns_packet_buffer != dns_packet_buffer)
++    free (alt_dns_packet_buffer);
++  __resolv_context_put (ctx);
++
+   if (status != NSS_STATUS_SUCCESS)
+-    {
+-      __resolv_context_put (ctx);
+-      return status;
+-    }
++    return status;
+ 
++  /* result->h_name has already been set by getanswer_ptr.  */
+   result->h_addrtype = af;
+   result->h_length = len;
+-  memcpy (host_data->host_addr, addr, len);
+-  host_data->h_addr_ptrs[0] = (char *) host_data->host_addr;
+-  host_data->h_addr_ptrs[1] = NULL;
++  /* Increase the alignment to 4, in case there are applications out
++     there that expect at least this level of address alignment.  */
++  address_array[0] = (char *) alloc_buffer_next (&abuf, uint32_t);
++  alloc_buffer_copy_bytes (&abuf, uaddr, len);
++  address_array[1] = NULL;
++
++  /* This check also covers allocation failure in getanswer_ptr.  */
++  if (alloc_buffer_has_failed (&abuf))
++    {
++      *errnop = ERANGE;
++      *h_errnop = NETDB_INTERNAL;
++      return NSS_STATUS_TRYAGAIN;
++    }
++  result->h_addr_list = address_array;
++  result->h_aliases = &address_array[1]; /* Points to NULL.  */
++
+   *h_errnop = NETDB_SUCCESS;
+-  __resolv_context_put (ctx);
+   return NSS_STATUS_SUCCESS;
+ }
+ libc_hidden_def (_nss_dns_gethostbyaddr2_r)
+@@ -961,287 +961,86 @@ getanswer_r (struct resolv_context *ctx,
+ }
+ 
+ static enum nss_status
+-getanswer_ptr (const querybuf *answer, int anslen, const char *qname,
+-	       struct hostent *result, char *buffer, size_t buflen,
++getanswer_ptr (unsigned char *packet, size_t packetlen,
++	       struct alloc_buffer *abuf, char **hnamep,
+ 	       int *errnop, int *h_errnop, int32_t *ttlp)
+ {
+-  struct host_data
+-  {
+-    char *aliases[MAX_NR_ALIASES];
+-    unsigned char host_addr[16];	/* IPv4 or IPv6 */
+-    char *h_addr_ptrs[0];
+-  } *host_data;
+-  int linebuflen;
+-  const HEADER *hp;
+-  const u_char *end_of_message, *cp;
+-  int n, ancount, qdcount;
+-  int haveanswer, had_error;
+-  char *bp, **ap, **hap;
+-  char tbuf[MAXDNAME];
+-  const char *tname;
+-  u_char packtmp[NS_MAXCDNAME];
+-  uintptr_t pad = -(uintptr_t) buffer % __alignof__ (struct host_data);
+-  buffer += pad;
+-  buflen = buflen > pad ? buflen - pad : 0;
+-  if (__glibc_unlikely (buflen < sizeof (struct host_data)))
+-    {
+-      /* The buffer is too small.  */
+-    too_small:
+-      *errnop = ERANGE;
+-      *h_errnop = NETDB_INTERNAL;
+-      return NSS_STATUS_TRYAGAIN;
+-    }
+-  host_data = (struct host_data *) buffer;
+-  linebuflen = buflen - sizeof (struct host_data);
+-  if (buflen - sizeof (struct host_data) != linebuflen)
+-    linebuflen = INT_MAX;
+-
+-  tname = qname;
+-  result->h_name = NULL;
+-  end_of_message = answer->buf + anslen;
+-
+-  /*
+-   * find first satisfactory answer
+-   */
+-  hp = &answer->hdr;
+-  ancount = ntohs (hp->ancount);
+-  qdcount = ntohs (hp->qdcount);
+-  cp = answer->buf + HFIXEDSZ;
+-  if (__glibc_unlikely (qdcount != 1))
+-    {
+-      *h_errnop = NO_RECOVERY;
+-      return NSS_STATUS_UNAVAIL;
+-    }
+-  if (sizeof (struct host_data) + (ancount + 1) * sizeof (char *) >= buflen)
+-    goto too_small;
+-  bp = (char *) &host_data->h_addr_ptrs[ancount + 1];
+-  linebuflen -= (ancount + 1) * sizeof (char *);
+-
+-  n = __ns_name_unpack (answer->buf, end_of_message, cp,
+-			packtmp, sizeof packtmp);
+-  if (n != -1 && __ns_name_ntop (packtmp, bp, linebuflen) == -1)
++  struct ns_rr_cursor c;
++  if (!__ns_rr_cursor_init (&c, packet, packetlen))
+     {
+-      if (__glibc_unlikely (errno == EMSGSIZE))
+-	goto too_small;
+-
+-      n = -1;
+-    }
+-
+-  if (__glibc_unlikely (n < 0))
+-    {
+-      *errnop = errno;
+-      *h_errnop = NO_RECOVERY;
+-      return NSS_STATUS_UNAVAIL;
+-    }
+-  if (__glibc_unlikely (__libc_res_dnok (bp) == 0))
+-    {
+-      errno = EBADMSG;
+-      *errnop = EBADMSG;
++      /* This should not happen because __res_context_query already
++	 perfroms response validation.  */
+       *h_errnop = NO_RECOVERY;
+       return NSS_STATUS_UNAVAIL;
+     }
+-  cp += n + QFIXEDSZ;
++  int ancount = ns_rr_cursor_ancount (&c);
++  const unsigned char *expected_name = ns_rr_cursor_qname (&c);
++  /* expected_name may be updated to point into this buffer.  */
++  unsigned char name_buffer[NS_MAXCDNAME];
+ 
+-  ap = host_data->aliases;
+-  *ap = NULL;
+-  result->h_aliases = host_data->aliases;
+-  hap = host_data->h_addr_ptrs;
+-  *hap = NULL;
+-  result->h_addr_list = host_data->h_addr_ptrs;
+-  haveanswer = 0;
+-  had_error = 0;
+-
+-  while (ancount-- > 0 && cp < end_of_message && had_error == 0)
++  while (ancount > 0)
+     {
+-      int type, class;
+-
+-      n = __ns_name_unpack (answer->buf, end_of_message, cp,
+-			    packtmp, sizeof packtmp);
+-      if (n != -1 && __ns_name_ntop (packtmp, bp, linebuflen) == -1)
++      struct ns_rr_wire rr;
++      if (!__ns_rr_cursor_next (&c, &rr))
+ 	{
+-	  if (__glibc_unlikely (errno == EMSGSIZE))
+-	    goto too_small;
+-
+-	  n = -1;
+-	}
+-
+-      if (__glibc_unlikely (n < 0 || __libc_res_dnok (bp) == 0))
+-	{
+-	  ++had_error;
+-	  continue;
+-	}
+-      cp += n;				/* name */
+-
+-      if (__glibc_unlikely (cp + 10 > end_of_message))
+-	{
+-	  ++had_error;
+-	  continue;
++	  *h_errnop = NO_RECOVERY;
++	  return NSS_STATUS_UNAVAIL;
+ 	}
+ 
+-      NS_GET16 (type, cp);
+-      NS_GET16 (class, cp);
+-      int32_t ttl;
+-      NS_GET32 (ttl, cp);
+-      NS_GET16 (n, cp);		/* RDATA length.  */
++      /* Skip over records with the wrong class.  */
++      if (rr.rclass != C_IN)
++	continue;
+ 
+-      if (end_of_message - cp < n)
+-	{
+-	  /* RDATA extends beyond the end of the packet.  */
+-	  ++had_error;
+-	  continue;
+-	}
+-
+-      if (__glibc_unlikely (class != C_IN))
+-	{
+-	  /* XXX - debug? syslog? */
+-	  cp += n;
+-	  continue;			/* XXX - had_error++ ? */
+-	}
++      /* Update TTL for known record types.  */
++      if ((rr.rtype == T_CNAME || rr.rtype == T_PTR)
++	  && ttlp != NULL && *ttlp > rr.ttl)
++	*ttlp = rr.ttl;
+ 
+-      if (type == T_CNAME)
++      if (rr.rtype == T_CNAME)
+ 	{
+-	  /* A CNAME could also have a TTL entry.  */
+-	  if (ttlp != NULL && ttl < *ttlp)
+-	      *ttlp = ttl;
+-
+-	  n = __libc_dn_expand (answer->buf, end_of_message, cp,
+-				tbuf, sizeof tbuf);
+-	  if (__glibc_unlikely (n < 0 || __libc_res_dnok (tbuf) == 0))
+-	    {
+-	      ++had_error;
+-	      continue;
+-	    }
+-	  cp += n;
+-	  /* Get canonical name.  */
+-	  n = strlen (tbuf) + 1;   /* For the \0.  */
+-	  if (__glibc_unlikely (n > linebuflen))
+-	    goto too_small;
+-	  if (__glibc_unlikely (n >= MAXHOSTNAMELEN))
++	  /* NB: No check for owner name match, based on historic
++	     precedent.  Record the CNAME target as the new expected
++	     name.  */
++	  int n = __ns_name_unpack (c.begin, c.end, rr.rdata,
++				    name_buffer, sizeof (name_buffer));
++	  if (n < 0)
+ 	    {
+-	      ++had_error;
+-	      continue;
++	      *h_errnop = NO_RECOVERY;
++	      return NSS_STATUS_UNAVAIL;
+ 	    }
+-	  tname = bp;
+-	  bp = __mempcpy (bp, tbuf, n);	/* Cannot overflow.  */
+-	  linebuflen -= n;
+-	  continue;
++	  expected_name = name_buffer;
+ 	}
+-
+-      switch (type)
++      else if (rr.rtype == T_PTR
++	       && __ns_samebinaryname (rr.rname, expected_name))
+ 	{
+-	case T_PTR:
+-	  if (__glibc_unlikely (__strcasecmp (tname, bp) != 0))
+-	    {
+-	      cp += n;
+-	      continue;			/* XXX - had_error++ ? */
+-	    }
+-
+-	  n = __ns_name_unpack (answer->buf, end_of_message, cp,
+-				packtmp, sizeof packtmp);
+-	  if (n != -1 && __ns_name_ntop (packtmp, bp, linebuflen) == -1)
+-	    {
+-	      if (__glibc_unlikely (errno == EMSGSIZE))
+-		goto too_small;
+-
+-	      n = -1;
+-	    }
+-
+-	  if (__glibc_unlikely (n < 0 || __libc_res_hnok (bp) == 0))
++	  /* Decompress the target of the PTR record.  This is the
++	     host name we are looking for.  We can only use it if it
++	     is syntactically valid.  Historically, only one host name
++	     is returned here.  If the recursive resolver performs DNS
++	     record rotation, the returned host name is essentially
++	     random, which is why multiple PTR records are rarely
++	     used.  Use MAXHOSTNAMELEN instead of NS_MAXCDNAME for
++	     additional length checking.  */
++	  char hname[MAXHOSTNAMELEN + 1];
++	  if (__ns_name_unpack (c.begin, c.end, rr.rdata,
++				name_buffer, sizeof (name_buffer)) < 0
++	      || !__res_binary_hnok (expected_name)
++	      || __ns_name_ntop (name_buffer, hname, sizeof (hname)) < 0)
+ 	    {
+-	      ++had_error;
+-	      break;
++	      *h_errnop = NO_RECOVERY;
++	      return NSS_STATUS_UNAVAIL;
+ 	    }
+-	  if (ttlp != NULL && ttl < *ttlp)
+-	      *ttlp = ttl;
+-	  /* bind would put multiple PTR records as aliases, but we don't do
+-	     that.  */
+-	  result->h_name = bp;
+-	  *h_errnop = NETDB_SUCCESS;
++	  /* Successful allocation is checked by the caller.  */
++	  *hnamep = alloc_buffer_copy_string (abuf, hname);
+ 	  return NSS_STATUS_SUCCESS;
+-	case T_A:
+-	case T_AAAA:
+-	  if (__glibc_unlikely (__strcasecmp (result->h_name, bp) != 0))
+-	    {
+-	      cp += n;
+-	      continue;			/* XXX - had_error++ ? */
+-	    }
+-
+-	  /* Stop parsing at a record whose length is incorrect.  */
+-	  if (n != rrtype_to_rdata_length (type))
+-	    {
+-	      ++had_error;
+-	      break;
+-	    }
+-
+-	  /* Skip records of the wrong type.  */
+-	  if (n != result->h_length)
+-	    {
+-	      cp += n;
+-	      continue;
+-	    }
+-	  if (!haveanswer)
+-	    {
+-	      int nn;
+-
+-	      /* We compose a single hostent out of the entire chain of
+-	         entries, so the TTL of the hostent is essentially the lowest
+-		 TTL in the chain.  */
+-	      if (ttlp != NULL && ttl < *ttlp)
+-		*ttlp = ttl;
+-	      result->h_name = bp;
+-	      nn = strlen (bp) + 1;	/* for the \0 */
+-	      bp += nn;
+-	      linebuflen -= nn;
+-	    }
+-
+-	  /* Provide sufficient alignment for both address
+-	     families.  */
+-	  enum { align = 4 };
+-	  _Static_assert ((align % __alignof__ (struct in_addr)) == 0,
+-			  "struct in_addr alignment");
+-	  _Static_assert ((align % __alignof__ (struct in6_addr)) == 0,
+-			  "struct in6_addr alignment");
+-	  {
+-	    char *new_bp = PTR_ALIGN_UP (bp, align);
+-	    linebuflen -= new_bp - bp;
+-	    bp = new_bp;
+-	  }
+-
+-	  if (__glibc_unlikely (n > linebuflen))
+-	    goto too_small;
+-	  bp = __mempcpy (*hap++ = bp, cp, n);
+-	  cp += n;
+-	  linebuflen -= n;
+-	  break;
+-	default:
+-	  cp += n;
+-	  continue;			/* XXX - had_error++ ? */
+ 	}
+-      if (had_error == 0)
+-	++haveanswer;
+     }
+ 
+-  if (haveanswer > 0)
+-    {
+-      *ap = NULL;
+-      *hap = NULL;
+-
+-      if (result->h_name == NULL)
+-	{
+-	  n = strlen (qname) + 1;	/* For the \0.  */
+-	  if (n > linebuflen)
+-	    goto too_small;
+-	  if (n >= MAXHOSTNAMELEN)
+-	    goto no_recovery;
+-	  result->h_name = bp;
+-	  bp = __mempcpy (bp, qname, n);	/* Cannot overflow.  */
+-	  linebuflen -= n;
+-	}
++  /* No PTR record found.  */
++  if (ttlp != NULL)
++    /* No caching of negative responses.  */
++    *ttlp = 0;
+ 
+-      *h_errnop = NETDB_SUCCESS;
+-      return NSS_STATUS_SUCCESS;
+-    }
+- no_recovery:
+   *h_errnop = NO_RECOVERY;
+   *errnop = ENOENT;
+   return NSS_STATUS_TRYAGAIN;
+-- 
+2.38.1
+
+
+From 5165080fec63a1f03aa1985b77bca300465bf570 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 30 Aug 2022 10:02:49 +0200
+Subject: [PATCH 31/72] nss_dns: Remove remnants of IPv6 address mapping
+
+res_use_inet6 always returns false since commit 3f8b44be0a658266adff5
+("resolv: Remove support for RES_USE_INET6 and the inet6 option").
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit a7fc30b522a0cd7c8c5e7e285b9531b704e02f04)
+---
+ resolv/README             |  3 --
+ resolv/mapv4v6addr.h      | 69 --------------------------------
+ resolv/mapv4v6hostent.h   | 84 ---------------------------------------
+ resolv/nss_dns/dns-host.c | 54 +++++--------------------
+ 4 files changed, 9 insertions(+), 201 deletions(-)
+ delete mode 100644 resolv/mapv4v6addr.h
+ delete mode 100644 resolv/mapv4v6hostent.h
+
+diff --git a/resolv/README b/resolv/README
+index 514e9bb617..2146bc3b27 100644
+--- a/resolv/README
++++ b/resolv/README
+@@ -146,6 +146,3 @@ res_libc.c is home-brewn, although parts of it are taken from res_data.c.
+ 
+ res_hconf.c and res_hconf.h were contributed by David Mosberger, and
+ do not come from BIND.
+-
+-The files gethnamaddr.c, mapv4v6addr.h and mapv4v6hostent.h are
+-leftovers from BIND 4.9.7.
+diff --git a/resolv/mapv4v6addr.h b/resolv/mapv4v6addr.h
+deleted file mode 100644
+index 7f85f7d5e3..0000000000
+--- a/resolv/mapv4v6addr.h
++++ /dev/null
+@@ -1,69 +0,0 @@
+-/*
+- * ++Copyright++ 1985, 1988, 1993
+- * -
+- * Copyright (c) 1985, 1988, 1993
+- *    The Regents of the University of California.  All rights reserved.
+- *
+- * Redistribution and use in source and binary forms, with or without
+- * modification, are permitted provided that the following conditions
+- * are met:
+- * 1. Redistributions of source code must retain the above copyright
+- *    notice, this list of conditions and the following disclaimer.
+- * 2. Redistributions in binary form must reproduce the above copyright
+- *    notice, this list of conditions and the following disclaimer in the
+- *    documentation and/or other materials provided with the distribution.
+- * 4. Neither the name of the University nor the names of its contributors
+- *    may be used to endorse or promote products derived from this software
+- *    without specific prior written permission.
+- *
+- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+- * SUCH DAMAGE.
+- * -
+- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
+- *
+- * Permission to use, copy, modify, and distribute this software for any
+- * purpose with or without fee is hereby granted, provided that the above
+- * copyright notice and this permission notice appear in all copies, and that
+- * the name of Digital Equipment Corporation not be used in advertising or
+- * publicity pertaining to distribution of the document or software without
+- * specific, written prior permission.
+- *
+- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
+- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
+- * OF MERCHANTABILITY AND FITNESS.   IN NO EVENT SHALL DIGITAL EQUIPMENT
+- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+- * SOFTWARE.
+- * -
+- * --Copyright--
+- */
+-
+-#include <string.h>
+-#include <arpa/nameser.h>
+-
+-static void
+-map_v4v6_address (const char *src, char *dst)
+-{
+-  u_char *p = (u_char *) dst;
+-  int i;
+-
+-  /* Move the IPv4 part to the right position.  */
+-  memcpy (dst + 12, src, INADDRSZ);
+-
+-  /* Mark this ipv6 addr as a mapped ipv4. */
+-  for (i = 0; i < 10; i++)
+-    *p++ = 0x00;
+-  *p++ = 0xff;
+-  *p = 0xff;
+-}
+diff --git a/resolv/mapv4v6hostent.h b/resolv/mapv4v6hostent.h
+deleted file mode 100644
+index c11038adf3..0000000000
+--- a/resolv/mapv4v6hostent.h
++++ /dev/null
+@@ -1,84 +0,0 @@
+-/*
+- * ++Copyright++ 1985, 1988, 1993
+- * -
+- * Copyright (c) 1985, 1988, 1993
+- *    The Regents of the University of California.  All rights reserved.
+- *
+- * Redistribution and use in source and binary forms, with or without
+- * modification, are permitted provided that the following conditions
+- * are met:
+- * 1. Redistributions of source code must retain the above copyright
+- *    notice, this list of conditions and the following disclaimer.
+- * 2. Redistributions in binary form must reproduce the above copyright
+- *    notice, this list of conditions and the following disclaimer in the
+- *    documentation and/or other materials provided with the distribution.
+- * 4. Neither the name of the University nor the names of its contributors
+- *    may be used to endorse or promote products derived from this software
+- *    without specific prior written permission.
+- *
+- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+- * SUCH DAMAGE.
+- * -
+- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
+- *
+- * Permission to use, copy, modify, and distribute this software for any
+- * purpose with or without fee is hereby granted, provided that the above
+- * copyright notice and this permission notice appear in all copies, and that
+- * the name of Digital Equipment Corporation not be used in advertising or
+- * publicity pertaining to distribution of the document or software without
+- * specific, written prior permission.
+- *
+- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
+- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
+- * OF MERCHANTABILITY AND FITNESS.   IN NO EVENT SHALL DIGITAL EQUIPMENT
+- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+- * SOFTWARE.
+- * -
+- * --Copyright--
+- */
+-
+-#include <arpa/nameser.h>
+-#include <sys/socket.h>
+-
+-typedef union {
+-    int32_t al;
+-    char ac;
+-} align;
+-
+-static int
+-map_v4v6_hostent (struct hostent *hp, char **bpp, int *lenp)
+-{
+-  char **ap;
+-
+-  if (hp->h_addrtype != AF_INET || hp->h_length != INADDRSZ)
+-    return 0;
+-  hp->h_addrtype = AF_INET6;
+-  hp->h_length = IN6ADDRSZ;
+-  for (ap = hp->h_addr_list; *ap; ap++)
+-    {
+-      int i = sizeof (align) - ((u_long) *bpp % sizeof (align));
+-
+-      if (*lenp < (i + IN6ADDRSZ))
+-	/* Out of memory.  */
+-	return 1;
+-      *bpp += i;
+-      *lenp -= i;
+-      map_v4v6_address (*ap, *bpp);
+-      *ap = *bpp;
+-      *bpp += IN6ADDRSZ;
+-      *lenp -= IN6ADDRSZ;
+-    }
+-  return 0;
+-}
+diff --git a/resolv/nss_dns/dns-host.c b/resolv/nss_dns/dns-host.c
+index cd26399b7e..8e38583e15 100644
+--- a/resolv/nss_dns/dns-host.c
++++ b/resolv/nss_dns/dns-host.c
+@@ -87,10 +87,6 @@
+ #include <resolv/resolv-internal.h>
+ #include <resolv/resolv_context.h>
+ 
+-/* Get implementations of some internal functions.  */
+-#include <resolv/mapv4v6addr.h>
+-#include <resolv/mapv4v6hostent.h>
+-
+ #define RESOLVSORT
+ 
+ #if PACKETSZ > 65536
+@@ -116,7 +112,7 @@ static enum nss_status getanswer_r (struct resolv_context *ctx,
+ 				    const char *qname, int qtype,
+ 				    struct hostent *result, char *buffer,
+ 				    size_t buflen, int *errnop, int *h_errnop,
+-				    int map, int32_t *ttlp, char **canonp);
++				    int32_t *ttlp, char **canonp);
+ static enum nss_status getanswer_ptr (unsigned char *packet, size_t packetlen,
+ 				      struct alloc_buffer *abuf,
+ 				      char **hnamep, int *errnop,
+@@ -197,7 +193,6 @@ gethostbyname3_context (struct resolv_context *ctx,
+   char tmp[NS_MAXDNAME];
+   int size, type, n;
+   const char *cp;
+-  int map = 0;
+   int olderr = errno;
+   enum nss_status status;
+ 
+@@ -258,32 +253,12 @@ gethostbyname3_context (struct resolv_context *ctx,
+ 	*errnop = EAGAIN;
+       else
+ 	__set_errno (olderr);
+-
+-      /* If we are looking for an IPv6 address and mapping is enabled
+-	 by having the RES_USE_INET6 bit in _res.options set, we try
+-	 another lookup.  */
+-      if (af == AF_INET6 && res_use_inet6 ())
+-	n = __res_context_search (ctx, name, C_IN, T_A, host_buffer.buf->buf,
+-				  host_buffer.buf != orig_host_buffer
+-				  ? MAXPACKET : 1024, &host_buffer.ptr,
+-				  NULL, NULL, NULL, NULL);
+-
+-      if (n < 0)
+-	{
+-	  if (host_buffer.buf != orig_host_buffer)
+-	    free (host_buffer.buf);
+-	  return status;
+-	}
+-
+-      map = 1;
+-
+-      result->h_addrtype = AF_INET;
+-      result->h_length = INADDRSZ;
+     }
++  else
++    status = getanswer_r
++      (ctx, host_buffer.buf, n, name, type, result, buffer, buflen,
++       errnop, h_errnop, ttlp, canonp);
+ 
+-  status = getanswer_r
+-    (ctx, host_buffer.buf, n, name, type, result, buffer, buflen,
+-     errnop, h_errnop, map, ttlp, canonp);
+   if (host_buffer.buf != orig_host_buffer)
+     free (host_buffer.buf);
+   return status;
+@@ -329,13 +304,8 @@ _nss_dns_gethostbyname_r (const char *name, struct hostent *result,
+       *h_errnop = NETDB_INTERNAL;
+       return NSS_STATUS_UNAVAIL;
+     }
+-  status = NSS_STATUS_NOTFOUND;
+-  if (res_use_inet6 ())
+-    status = gethostbyname3_context (ctx, name, AF_INET6, result, buffer,
+-				     buflen, errnop, h_errnop, NULL, NULL);
+-  if (status == NSS_STATUS_NOTFOUND)
+-    status = gethostbyname3_context (ctx, name, AF_INET, result, buffer,
+-				     buflen, errnop, h_errnop, NULL, NULL);
++  status = gethostbyname3_context (ctx, name, AF_INET, result, buffer,
++				   buflen, errnop, h_errnop, NULL, NULL);
+   __resolv_context_put (ctx);
+   return status;
+ }
+@@ -648,7 +618,7 @@ static enum nss_status
+ getanswer_r (struct resolv_context *ctx,
+ 	     const querybuf *answer, int anslen, const char *qname, int qtype,
+ 	     struct hostent *result, char *buffer, size_t buflen,
+-	     int *errnop, int *h_errnop, int map, int32_t *ttlp, char **canonp)
++	     int *errnop, int *h_errnop, int32_t *ttlp, char **canonp)
+ {
+   struct host_data
+   {
+@@ -664,7 +634,6 @@ getanswer_r (struct resolv_context *ctx,
+   char *bp, **ap, **hap;
+   char tbuf[MAXDNAME];
+   u_char packtmp[NS_MAXCDNAME];
+-  int have_to_map = 0;
+   uintptr_t pad = -(uintptr_t) buffer % __alignof__ (struct host_data);
+   buffer += pad;
+   buflen = buflen > pad ? buflen - pad : 0;
+@@ -845,9 +814,7 @@ getanswer_r (struct resolv_context *ctx,
+ 	  continue;
+ 	}
+ 
+-      if (type == T_A && qtype == T_AAAA && map)
+-	have_to_map = 1;
+-      else if (__glibc_unlikely (type != qtype))
++      if (__glibc_unlikely (type != qtype))
+ 	{
+ 	  cp += n;
+ 	  continue;			/* XXX - had_error++ ? */
+@@ -944,9 +911,6 @@ getanswer_r (struct resolv_context *ctx,
+ 	  linebuflen -= n;
+ 	}
+ 
+-      if (have_to_map)
+-	if (map_v4v6_hostent (result, &bp, &linebuflen))
+-	  goto too_small;
+       *h_errnop = NETDB_SUCCESS;
+       return NSS_STATUS_SUCCESS;
+     }
+-- 
+2.38.1
+
+
+From 78c8ef21fa54e994451d5b42ead6080d99a88a49 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 30 Aug 2022 10:02:49 +0200
+Subject: [PATCH 32/72] nss_dns: Rewrite getanswer_r to match getanswer_ptr
+ (bug 12154, bug 29305)
+
+Allocate the pointer arrays only at the end, when their sizes
+are known.  This addresses bug 29305.
+
+Skip over invalid names instead of failing lookups.  This partially
+fixes bug 12154 (for gethostbyname, fixing getaddrinfo requires
+different changes).
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit d101d836e7e4bd1d4e4972b0e0bd0a55c9b650fa)
+---
+ resolv/nss_dns/dns-host.c | 478 ++++++++++++++------------------------
+ 1 file changed, 180 insertions(+), 298 deletions(-)
+
+diff --git a/resolv/nss_dns/dns-host.c b/resolv/nss_dns/dns-host.c
+index 8e38583e15..b887e77e9c 100644
+--- a/resolv/nss_dns/dns-host.c
++++ b/resolv/nss_dns/dns-host.c
+@@ -107,12 +107,19 @@ typedef union querybuf
+   u_char buf[MAXPACKET];
+ } querybuf;
+ 
+-static enum nss_status getanswer_r (struct resolv_context *ctx,
+-				    const querybuf *answer, int anslen,
+-				    const char *qname, int qtype,
+-				    struct hostent *result, char *buffer,
+-				    size_t buflen, int *errnop, int *h_errnop,
+-				    int32_t *ttlp, char **canonp);
++/* For historic reasons, pointers to IP addresses are char *, so use a
++   single list type for addresses and host names.  */
++#define DYNARRAY_STRUCT ptrlist
++#define DYNARRAY_ELEMENT char *
++#define DYNARRAY_PREFIX ptrlist_
++#include <malloc/dynarray-skeleton.c>
++
++static enum nss_status getanswer_r (unsigned char *packet, size_t packetlen,
++				    uint16_t qtype, struct alloc_buffer *abuf,
++				    struct ptrlist *addresses,
++				    struct ptrlist *aliases,
++				    int *errnop, int *h_errnop, int32_t *ttlp);
++static void addrsort (struct resolv_context *ctx, char **ap, int num);
+ static enum nss_status getanswer_ptr (unsigned char *packet, size_t packetlen,
+ 				      struct alloc_buffer *abuf,
+ 				      char **hnamep, int *errnop,
+@@ -184,12 +191,6 @@ gethostbyname3_context (struct resolv_context *ctx,
+ 			char *buffer, size_t buflen, int *errnop,
+ 			int *h_errnop, int32_t *ttlp, char **canonp)
+ {
+-  union
+-  {
+-    querybuf *buf;
+-    u_char *ptr;
+-  } host_buffer;
+-  querybuf *orig_host_buffer;
+   char tmp[NS_MAXDNAME];
+   int size, type, n;
+   const char *cp;
+@@ -223,10 +224,12 @@ gethostbyname3_context (struct resolv_context *ctx,
+       && (cp = __res_context_hostalias (ctx, name, tmp, sizeof (tmp))) != NULL)
+     name = cp;
+ 
+-  host_buffer.buf = orig_host_buffer = (querybuf *) alloca (1024);
++  unsigned char dns_packet_buffer[1024];
++  unsigned char *alt_dns_packet_buffer = dns_packet_buffer;
+ 
+-  n = __res_context_search (ctx, name, C_IN, type, host_buffer.buf->buf,
+-			    1024, &host_buffer.ptr, NULL, NULL, NULL, NULL);
++  n = __res_context_search (ctx, name, C_IN, type,
++			    dns_packet_buffer, sizeof (dns_packet_buffer),
++			    &alt_dns_packet_buffer, NULL, NULL, NULL, NULL);
+   if (n < 0)
+     {
+       switch (errno)
+@@ -255,12 +258,77 @@ gethostbyname3_context (struct resolv_context *ctx,
+ 	__set_errno (olderr);
+     }
+   else
+-    status = getanswer_r
+-      (ctx, host_buffer.buf, n, name, type, result, buffer, buflen,
+-       errnop, h_errnop, ttlp, canonp);
++    {
++      struct alloc_buffer abuf = alloc_buffer_create (buffer, buflen);
+ 
+-  if (host_buffer.buf != orig_host_buffer)
+-    free (host_buffer.buf);
++      struct ptrlist addresses;
++      ptrlist_init (&addresses);
++      struct ptrlist aliases;
++      ptrlist_init (&aliases);
++
++      status = getanswer_r (alt_dns_packet_buffer, n, type,
++			    &abuf, &addresses, &aliases,
++			    errnop, h_errnop, ttlp);
++      if (status == NSS_STATUS_SUCCESS)
++	{
++	  if (ptrlist_has_failed (&addresses)
++	      || ptrlist_has_failed (&aliases))
++	    {
++	      /* malloc failure.  Do not retry using the ERANGE protocol.  */
++	      *errnop = ENOMEM;
++	      *h_errnop = NETDB_INTERNAL;
++	      status = NSS_STATUS_UNAVAIL;
++	    }
++
++	  /* Reserve the address and alias arrays in the result
++	     buffer.  Both are NULL-terminated, but the first element
++	     of the alias array is stored in h_name, so no extra space
++	     for the NULL terminator is needed there.  */
++	  result->h_addr_list
++	    = alloc_buffer_alloc_array (&abuf, char *,
++					ptrlist_size (&addresses) + 1);
++	  result->h_aliases
++	    = alloc_buffer_alloc_array (&abuf, char *,
++					ptrlist_size (&aliases));
++	  if (alloc_buffer_has_failed (&abuf))
++	    {
++	      /* Retry using the ERANGE protocol.  */
++	      *errnop = ERANGE;
++	      *h_errnop = NETDB_INTERNAL;
++	      status = NSS_STATUS_TRYAGAIN;
++	    }
++	  else
++	    {
++	      /* Copy the address list and NULL-terminate it.  */
++	      memcpy (result->h_addr_list, ptrlist_begin (&addresses),
++		      ptrlist_size (&addresses) * sizeof (char *));
++	      result->h_addr_list[ptrlist_size (&addresses)] = NULL;
++
++	      /* Sort the address list if requested.  */
++	      if (type == T_A && __resolv_context_sort_count (ctx) > 0)
++		addrsort (ctx, result->h_addr_list, ptrlist_size (&addresses));
++
++	      /* Copy the aliases,  excluding the last one. */
++	      memcpy (result->h_aliases, ptrlist_begin (&aliases),
++		      (ptrlist_size (&aliases) - 1) * sizeof (char *));
++	      result->h_aliases[ptrlist_size (&aliases) - 1] = NULL;
++
++	      /* The last alias goes into h_name.  */
++	      assert (ptrlist_size (&aliases) >= 1);
++	      result->h_name = ptrlist_end (&aliases)[-1];
++
++	      /* This is also the canonical name.  */
++	      if (canonp != NULL)
++		*canonp = result->h_name;
++	    }
++	}
++
++      ptrlist_free (&aliases);
++      ptrlist_free (&addresses);
++    }
++
++  if (alt_dns_packet_buffer != dns_packet_buffer)
++    free (alt_dns_packet_buffer);
+   return status;
+ }
+ 
+@@ -614,314 +682,128 @@ addrsort (struct resolv_context *ctx, char **ap, int num)
+ 	break;
+ }
+ 
+-static enum nss_status
+-getanswer_r (struct resolv_context *ctx,
+-	     const querybuf *answer, int anslen, const char *qname, int qtype,
+-	     struct hostent *result, char *buffer, size_t buflen,
+-	     int *errnop, int *h_errnop, int32_t *ttlp, char **canonp)
++/* Convert the uncompressed, binary domain name CDNAME into its
++   textual representation and add it to the end of ALIASES, allocating
++   space for a copy of the name from ABUF.  Skip adding the name if it
++   is not a valid host name, and return false in that case, otherwise
++   true.  */
++static bool
++getanswer_r_store_alias (const unsigned char *cdname,
++			 struct alloc_buffer *abuf,
++			 struct ptrlist *aliases)
+ {
+-  struct host_data
+-  {
+-    char *aliases[MAX_NR_ALIASES];
+-    unsigned char host_addr[16];	/* IPv4 or IPv6 */
+-    char *h_addr_ptrs[0];
+-  } *host_data;
+-  int linebuflen;
+-  const HEADER *hp;
+-  const u_char *end_of_message, *cp;
+-  int n, ancount, qdcount;
+-  int haveanswer, had_error;
+-  char *bp, **ap, **hap;
+-  char tbuf[MAXDNAME];
+-  u_char packtmp[NS_MAXCDNAME];
+-  uintptr_t pad = -(uintptr_t) buffer % __alignof__ (struct host_data);
+-  buffer += pad;
+-  buflen = buflen > pad ? buflen - pad : 0;
+-  if (__glibc_unlikely (buflen < sizeof (struct host_data)))
+-    {
+-      /* The buffer is too small.  */
+-    too_small:
+-      *errnop = ERANGE;
+-      *h_errnop = NETDB_INTERNAL;
+-      return NSS_STATUS_TRYAGAIN;
+-    }
+-  host_data = (struct host_data *) buffer;
+-  linebuflen = buflen - sizeof (struct host_data);
+-  if (buflen - sizeof (struct host_data) != linebuflen)
+-    linebuflen = INT_MAX;
+-
+-  result->h_name = NULL;
+-  end_of_message = answer->buf + anslen;
+-
+-  /*
+-   * find first satisfactory answer
+-   */
+-  hp = &answer->hdr;
+-  ancount = ntohs (hp->ancount);
+-  qdcount = ntohs (hp->qdcount);
+-  cp = answer->buf + HFIXEDSZ;
+-  if (__glibc_unlikely (qdcount != 1))
+-    {
+-      *h_errnop = NO_RECOVERY;
+-      return NSS_STATUS_UNAVAIL;
+-    }
+-  if (sizeof (struct host_data) + (ancount + 1) * sizeof (char *) >= buflen)
+-    goto too_small;
+-  bp = (char *) &host_data->h_addr_ptrs[ancount + 1];
+-  linebuflen -= (ancount + 1) * sizeof (char *);
+-
+-  n = __ns_name_unpack (answer->buf, end_of_message, cp,
+-			packtmp, sizeof packtmp);
+-  if (n != -1 && __ns_name_ntop (packtmp, bp, linebuflen) == -1)
+-    {
+-      if (__glibc_unlikely (errno == EMSGSIZE))
+-	goto too_small;
+-
+-      n = -1;
+-    }
++  /* Filter out domain names that are not host names.  */
++  if (!__res_binary_hnok (cdname))
++    return false;
++
++  /* Note: Not NS_MAXCDNAME, so that __ns_name_ntop implicitly checks
++     for length.  */
++  char dname[MAXHOSTNAMELEN + 1];
++  if (__ns_name_ntop (cdname, dname, sizeof (dname)) < 0)
++    return false;
++  /* Do not report an error on allocation failure, instead store NULL
++     or do nothing.  getanswer_r's caller will see NSS_STATUS_SUCCESS
++     and detect the memory allocation failure or buffer space
++     exhaustion, and report it accordingly.  */
++  ptrlist_add (aliases, alloc_buffer_copy_string (abuf, dname));
++  return true;
++}
+ 
+-  if (__glibc_unlikely (n < 0))
+-    {
+-      *errnop = errno;
+-      *h_errnop = NO_RECOVERY;
+-      return NSS_STATUS_UNAVAIL;
+-    }
+-  if (__glibc_unlikely (__libc_res_hnok (bp) == 0))
++static enum nss_status __attribute__ ((noinline))
++getanswer_r (unsigned char *packet, size_t packetlen, uint16_t qtype,
++	     struct alloc_buffer *abuf,
++	     struct ptrlist *addresses, struct ptrlist *aliases,
++	     int *errnop, int *h_errnop, int32_t *ttlp)
++{
++  struct ns_rr_cursor c;
++  if (!__ns_rr_cursor_init (&c, packet, packetlen))
+     {
+-      errno = EBADMSG;
+-      *errnop = EBADMSG;
++      /* This should not happen because __res_context_query already
++	 perfroms response validation.  */
+       *h_errnop = NO_RECOVERY;
+       return NSS_STATUS_UNAVAIL;
+     }
+-  cp += n + QFIXEDSZ;
+ 
+-  if (qtype == T_A || qtype == T_AAAA)
++  /* Treat the QNAME just like an alias.  Error out if it is not a
++     valid host name.  */
++  if (ns_rr_cursor_rcode (&c) == NXDOMAIN
++      || !getanswer_r_store_alias (ns_rr_cursor_qname (&c), abuf, aliases))
+     {
+-      /* res_send() has already verified that the query name is the
+-       * same as the one we sent; this just gets the expanded name
+-       * (i.e., with the succeeding search-domain tacked on).
+-       */
+-      n = strlen (bp) + 1;             /* for the \0 */
+-      if (n >= MAXHOSTNAMELEN)
+-	{
+-	  *h_errnop = NO_RECOVERY;
+-	  *errnop = ENOENT;
+-	  return NSS_STATUS_TRYAGAIN;
+-	}
+-      result->h_name = bp;
+-      bp += n;
+-      linebuflen -= n;
+-      if (linebuflen < 0)
+-	goto too_small;
+-      /* The qname can be abbreviated, but h_name is now absolute. */
+-      qname = result->h_name;
++      if (ttlp != NULL)
++	/* No negative caching.  */
++	*ttlp = 0;
++      *h_errnop = HOST_NOT_FOUND;
++      *errnop = ENOENT;
++      return NSS_STATUS_NOTFOUND;
+     }
+ 
+-  ap = host_data->aliases;
+-  *ap = NULL;
+-  result->h_aliases = host_data->aliases;
+-  hap = host_data->h_addr_ptrs;
+-  *hap = NULL;
+-  result->h_addr_list = host_data->h_addr_ptrs;
+-  haveanswer = 0;
+-  had_error = 0;
++  int ancount = ns_rr_cursor_ancount (&c);
++  const unsigned char *expected_name = ns_rr_cursor_qname (&c);
++  /* expected_name may be updated to point into this buffer.  */
++  unsigned char name_buffer[NS_MAXCDNAME];
+ 
+-  while (ancount-- > 0 && cp < end_of_message && had_error == 0)
++  for (; ancount > 0; --ancount)
+     {
+-      int type, class;
+-
+-      n = __ns_name_unpack (answer->buf, end_of_message, cp,
+-			    packtmp, sizeof packtmp);
+-      if (n != -1 && __ns_name_ntop (packtmp, bp, linebuflen) == -1)
+-	{
+-	  if (__glibc_unlikely (errno == EMSGSIZE))
+-	    goto too_small;
+-
+-	  n = -1;
+-	}
+-
+-      if (__glibc_unlikely (n < 0 || __libc_res_hnok (bp) == 0))
+-	{
+-	  ++had_error;
+-	  continue;
+-	}
+-      cp += n;				/* name */
+-
+-      if (__glibc_unlikely (cp + 10 > end_of_message))
++      struct ns_rr_wire rr;
++      if (!__ns_rr_cursor_next (&c, &rr))
+ 	{
+-	  ++had_error;
+-	  continue;
++	  *h_errnop = NO_RECOVERY;
++	  return NSS_STATUS_UNAVAIL;
+ 	}
+ 
+-      NS_GET16 (type, cp);
+-      NS_GET16 (class, cp);
+-      int32_t ttl;
+-      NS_GET32 (ttl, cp);
+-      NS_GET16 (n, cp);		/* RDATA length.  */
+-
+-      if (end_of_message - cp < n)
+-	{
+-	  /* RDATA extends beyond the end of the packet.  */
+-	  ++had_error;
+-	  continue;
+-	}
++      /* Skip over records with the wrong class.  */
++      if (rr.rclass != C_IN)
++	continue;
+ 
+-      if (__glibc_unlikely (class != C_IN))
+-	{
+-	  /* XXX - debug? syslog? */
+-	  cp += n;
+-	  continue;			/* XXX - had_error++ ? */
+-	}
++      /* Update TTL for recognized record types.  */
++      if ((rr.rtype == T_CNAME || rr.rtype == qtype)
++	  && ttlp != NULL && *ttlp > rr.ttl)
++	*ttlp = rr.ttl;
+ 
+-      if (type == T_CNAME)
++      if (rr.rtype == T_CNAME)
+ 	{
+-	  /* A CNAME could also have a TTL entry.  */
+-	  if (ttlp != NULL && ttl < *ttlp)
+-	      *ttlp = ttl;
+-
+-	  if (ap >= &host_data->aliases[MAX_NR_ALIASES - 1])
+-	    continue;
+-	  n = __libc_dn_expand (answer->buf, end_of_message, cp,
+-				tbuf, sizeof tbuf);
+-	  if (__glibc_unlikely (n < 0 || __libc_res_hnok (tbuf) == 0))
+-	    {
+-	      ++had_error;
+-	      continue;
+-	    }
+-	  cp += n;
+-	  /* Store alias.  */
+-	  *ap++ = bp;
+-	  n = strlen (bp) + 1;		/* For the \0.  */
+-	  if (__glibc_unlikely (n >= MAXHOSTNAMELEN))
+-	    {
+-	      ++had_error;
+-	      continue;
+-	    }
+-	  bp += n;
+-	  linebuflen -= n;
+-	  /* Get canonical name.  */
+-	  n = strlen (tbuf) + 1;	/* For the \0.  */
+-	  if (__glibc_unlikely (n > linebuflen))
+-	    goto too_small;
+-	  if (__glibc_unlikely (n >= MAXHOSTNAMELEN))
++	  /* NB: No check for owner name match, based on historic
++	     precedent.  Record the CNAME target as the new expected
++	     name.  */
++	  int n = __ns_name_unpack (c.begin, c.end, rr.rdata,
++				    name_buffer, sizeof (name_buffer));
++	  if (n < 0)
+ 	    {
+-	      ++had_error;
+-	      continue;
++	      *h_errnop = NO_RECOVERY;
++	      return NSS_STATUS_UNAVAIL;
+ 	    }
+-	  result->h_name = bp;
+-	  bp = __mempcpy (bp, tbuf, n);	/* Cannot overflow.  */
+-	  linebuflen -= n;
+-	  continue;
++	  /* And store the new name as an alias.  */
++	  getanswer_r_store_alias (name_buffer, abuf, aliases);
++	  expected_name = name_buffer;
+ 	}
+-
+-      if (__glibc_unlikely (type != qtype))
++      else if (rr.rtype == qtype
++	       && __ns_samebinaryname (rr.rname, expected_name)
++	       && rr.rdlength == rrtype_to_rdata_length (qtype))
+ 	{
+-	  cp += n;
+-	  continue;			/* XXX - had_error++ ? */
++	  /* Make a copy of the address and store it.  Increase the
++	     alignment to 4, in case there are applications out there
++	     that expect at least this level of address alignment.  */
++	  ptrlist_add (addresses, (char *) alloc_buffer_next (abuf, uint32_t));
++	  alloc_buffer_copy_bytes (abuf, rr.rdata, rr.rdlength);
+ 	}
+-
+-      switch (type)
+-	{
+-	case T_A:
+-	case T_AAAA:
+-	  if (__glibc_unlikely (__strcasecmp (result->h_name, bp) != 0))
+-	    {
+-	      cp += n;
+-	      continue;			/* XXX - had_error++ ? */
+-	    }
+-
+-	  /* Stop parsing at a record whose length is incorrect.  */
+-	  if (n != rrtype_to_rdata_length (type))
+-	    {
+-	      ++had_error;
+-	      break;
+-	    }
+-
+-	  /* Skip records of the wrong type.  */
+-	  if (n != result->h_length)
+-	    {
+-	      cp += n;
+-	      continue;
+-	    }
+-	  if (!haveanswer)
+-	    {
+-	      int nn;
+-
+-	      /* We compose a single hostent out of the entire chain of
+-	         entries, so the TTL of the hostent is essentially the lowest
+-		 TTL in the chain.  */
+-	      if (ttlp != NULL && ttl < *ttlp)
+-		*ttlp = ttl;
+-	      if (canonp != NULL)
+-		*canonp = bp;
+-	      result->h_name = bp;
+-	      nn = strlen (bp) + 1;	/* for the \0 */
+-	      bp += nn;
+-	      linebuflen -= nn;
+-	    }
+-
+-	  /* Provide sufficient alignment for both address
+-	     families.  */
+-	  enum { align = 4 };
+-	  _Static_assert ((align % __alignof__ (struct in_addr)) == 0,
+-			  "struct in_addr alignment");
+-	  _Static_assert ((align % __alignof__ (struct in6_addr)) == 0,
+-			  "struct in6_addr alignment");
+-	  {
+-	    char *new_bp = PTR_ALIGN_UP (bp, align);
+-	    linebuflen -= new_bp - bp;
+-	    bp = new_bp;
+-	  }
+-
+-	  if (__glibc_unlikely (n > linebuflen))
+-	    goto too_small;
+-	  bp = __mempcpy (*hap++ = bp, cp, n);
+-	  cp += n;
+-	  linebuflen -= n;
+-	  break;
+-	default:
+-	  abort ();
+-	}
+-      if (had_error == 0)
+-	++haveanswer;
+     }
+ 
+-  if (haveanswer > 0)
++  if (ptrlist_size (addresses) == 0)
+     {
+-      *ap = NULL;
+-      *hap = NULL;
+-      /*
+-       * Note: we sort even if host can take only one address
+-       * in its return structures - should give it the "best"
+-       * address in that case, not some random one
+-       */
+-      if (haveanswer > 1 && qtype == T_A
+-	  && __resolv_context_sort_count (ctx) > 0)
+-	addrsort (ctx, host_data->h_addr_ptrs, haveanswer);
+-
+-      if (result->h_name == NULL)
+-	{
+-	  n = strlen (qname) + 1;	/* For the \0.  */
+-	  if (n > linebuflen)
+-	    goto too_small;
+-	  if (n >= MAXHOSTNAMELEN)
+-	    goto no_recovery;
+-	  result->h_name = bp;
+-	  bp = __mempcpy (bp, qname, n);	/* Cannot overflow.  */
+-	  linebuflen -= n;
+-	}
++      /* No address record found.  */
++      if (ttlp != NULL)
++	/* No caching of negative responses.  */
++	*ttlp = 0;
+ 
++      *h_errnop = NO_RECOVERY;
++      *errnop = ENOENT;
++      return NSS_STATUS_TRYAGAIN;
++    }
++  else
++    {
+       *h_errnop = NETDB_SUCCESS;
+       return NSS_STATUS_SUCCESS;
+     }
+- no_recovery:
+-  *h_errnop = NO_RECOVERY;
+-  *errnop = ENOENT;
+-  /* Special case here: if the resolver sent a result but it only
+-     contains a CNAME while we are looking for a T_A or T_AAAA record,
+-     we fail with NOTFOUND instead of TRYAGAIN.  */
+-  return ((qtype == T_A || qtype == T_AAAA) && ap != host_data->aliases
+-	   ? NSS_STATUS_NOTFOUND : NSS_STATUS_TRYAGAIN);
+ }
+ 
+ static enum nss_status
+-- 
+2.38.1
+
+
+From 7a236dc44a22dc4252e803d1ee1d3b970ec43805 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 30 Aug 2022 10:02:49 +0200
+Subject: [PATCH 33/72] nss_dns: In gaih_getanswer_slice, skip strange aliases
+ (bug 12154)
+
+If the name is not a host name, skip adding it to the result, instead
+of reporting query failure.  This fixes bug 12154 for getaddrinfo.
+
+This commit still keeps the old parsing code, and only adjusts when
+a host name is copied.
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit 32b599ac8c21c4c332cc3900a792a1395bca79c7)
+---
+ resolv/nss_dns/dns-host.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/resolv/nss_dns/dns-host.c b/resolv/nss_dns/dns-host.c
+index b887e77e9c..bea505d697 100644
+--- a/resolv/nss_dns/dns-host.c
++++ b/resolv/nss_dns/dns-host.c
+@@ -970,12 +970,12 @@ gaih_getanswer_slice (const querybuf *answer, int anslen, const char *qname,
+ 
+ 	  n = -1;
+ 	}
+-      if (__glibc_unlikely (n < 0 || __libc_res_hnok (buffer) == 0))
++      if (__glibc_unlikely (n < 0))
+ 	{
+ 	  ++had_error;
+ 	  continue;
+ 	}
+-      if (*firstp && canon == NULL)
++      if (*firstp && canon == NULL && __libc_res_hnok (buffer))
+ 	{
+ 	  h_name = buffer;
+ 	  buffer += h_namelen;
+@@ -1021,14 +1021,14 @@ gaih_getanswer_slice (const querybuf *answer, int anslen, const char *qname,
+ 
+ 	  n = __libc_dn_expand (answer->buf, end_of_message, cp,
+ 				tbuf, sizeof tbuf);
+-	  if (__glibc_unlikely (n < 0 || __libc_res_hnok (tbuf) == 0))
++	  if (__glibc_unlikely (n < 0))
+ 	    {
+ 	      ++had_error;
+ 	      continue;
+ 	    }
+ 	  cp += n;
+ 
+-	  if (*firstp)
++	  if (*firstp && __libc_res_hnok (tbuf))
+ 	    {
+ 	      /* Reclaim buffer space.  */
+ 	      if (h_name + h_namelen == buffer)
+-- 
+2.38.1
+
+
+From e2ec6a8db38a6b734bbdb41e498fdc9460f7566a Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 30 Aug 2022 10:02:49 +0200
+Subject: [PATCH 34/72] resolv: Add new tst-resolv-invalid-cname
+
+This test checks resolution through CNAME chains that do not contain
+host names (bug 12154).
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit 9caf782276ecea4bc86fc94fbb52779736f3106d)
+---
+ resolv/Makefile                   |   3 +
+ resolv/tst-resolv-invalid-cname.c | 406 ++++++++++++++++++++++++++++++
+ 2 files changed, 409 insertions(+)
+ create mode 100644 resolv/tst-resolv-invalid-cname.c
+
+diff --git a/resolv/Makefile b/resolv/Makefile
+index 018b1808d6..f8a92c6cff 100644
+--- a/resolv/Makefile
++++ b/resolv/Makefile
+@@ -98,6 +98,7 @@ tests += \
+   tst-resolv-binary \
+   tst-resolv-byaddr \
+   tst-resolv-edns \
++  tst-resolv-invalid-cname \
+   tst-resolv-network \
+   tst-resolv-noaaaa \
+   tst-resolv-nondecimal \
+@@ -287,6 +288,8 @@ $(objpfx)tst-resolv-res_init-multi: $(objpfx)libresolv.so \
+   $(shared-thread-library)
+ $(objpfx)tst-resolv-res_init-thread: $(objpfx)libresolv.so \
+   $(shared-thread-library)
++$(objpfx)tst-resolv-invalid-cname: $(objpfx)libresolv.so \
++  $(shared-thread-library)
+ $(objpfx)tst-resolv-noaaaa: $(objpfx)libresolv.so $(shared-thread-library)
+ $(objpfx)tst-resolv-nondecimal: $(objpfx)libresolv.so $(shared-thread-library)
+ $(objpfx)tst-resolv-qtypes: $(objpfx)libresolv.so $(shared-thread-library)
+diff --git a/resolv/tst-resolv-invalid-cname.c b/resolv/tst-resolv-invalid-cname.c
+new file mode 100644
+index 0000000000..ae2d4419b1
+--- /dev/null
++++ b/resolv/tst-resolv-invalid-cname.c
+@@ -0,0 +1,406 @@
++/* Test handling of CNAMEs with non-host domain names (bug 12154).
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <errno.h>
++#include <netdb.h>
++#include <resolv.h>
++#include <stdlib.h>
++#include <string.h>
++#include <support/check.h>
++#include <support/check_nss.h>
++#include <support/resolv_test.h>
++#include <support/support.h>
++#include <support/xmemstream.h>
++
++/* Query strings describe the CNAME chain in the response.  They have
++   the format "bitsBITS.countCOUNT.example.", where BITS and COUNT are
++   replaced by unsigned decimal numbers.  COUNT is the number of CNAME
++   records in the response.  BITS has two bits for each CNAME record,
++   describing a special prefix that is added to that CNAME.
++
++   0: No special leading label.
++   1: Starting with "*.".
++   2: Starting with "-x.".
++   3: Starting with "star.*.".
++
++   The first CNAME in the response using the two least significant
++   bits.
++
++   For PTR queries, the QNAME format is different, it is either
++   COUNT.BITS.168.192.in-addr.arpa. (with BITS and COUNT still
++   decimal), or:
++
++COUNT.BITS0.BITS1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa.
++
++   where BITS and COUNT are hexadecimal.  */
++
++static void
++response (const struct resolv_response_context *ctx,
++          struct resolv_response_builder *b,
++          const char *qname, uint16_t qclass, uint16_t qtype)
++{
++  TEST_COMPARE (qclass, C_IN);
++
++  /* The only other query type besides A is PTR.  */
++  if (qtype != T_A && qtype != T_AAAA)
++    TEST_COMPARE (qtype, T_PTR);
++
++  unsigned int bits, bits1, count;
++  char *tail = NULL;
++  if (sscanf (qname, "bits%u.count%u.%ms", &bits, &count, &tail) == 3)
++    TEST_COMPARE_STRING (tail, "example");
++  else if (strstr (qname, "in-addr.arpa") != NULL
++           && sscanf (qname, "%u.%u.%ms", &bits, &count, &tail) == 3)
++    TEST_COMPARE_STRING (tail, "168.192.in-addr.arpa");
++  else if (sscanf (qname, "%x.%x.%x.%ms", &bits, &bits1, &count, &tail) == 4)
++    {
++      TEST_COMPARE_STRING (tail, "\
++0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa");
++      bits |= bits1 << 4;
++    }
++  else
++    FAIL_EXIT1 ("invalid QNAME: %s\n", qname);
++  free (tail);
++
++  struct resolv_response_flags flags = {};
++  resolv_response_init (b, flags);
++  resolv_response_add_question (b, qname, qclass, qtype);
++  resolv_response_section (b, ns_s_an);
++
++  /* Provide the requested number of CNAME records.  */
++  char *previous_name = (char *) qname;
++  unsigned int original_bits = bits;
++  for (int unique = 0; unique < count; ++unique)
++    {
++      resolv_response_open_record (b, previous_name, qclass, T_CNAME, 60);
++
++      static const char bits_to_prefix[4][8] = { "", "*.", "-x.", "star.*." };
++      char *new_name = xasprintf ("%sunique%d.example",
++                                  bits_to_prefix[bits & 3], unique);
++      bits >>= 2;
++      resolv_response_add_name (b, new_name);
++      resolv_response_close_record (b);
++
++      if (previous_name != qname)
++        free (previous_name);
++      previous_name = new_name;
++    }
++
++  /* Actual answer record.  */
++  resolv_response_open_record (b, previous_name, qclass, qtype, 60);
++  switch (qtype)
++    {
++    case T_A:
++      {
++        char ipv4[4] = {192, 168, count, original_bits};
++        resolv_response_add_data (b, &ipv4, sizeof (ipv4));
++      }
++      break;
++    case T_AAAA:
++      {
++        char ipv6[16] =
++          {
++            0x20, 0x01, 0xd, 0xb8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
++            count, original_bits
++          };
++        resolv_response_add_data (b, &ipv6, sizeof (ipv6));
++      }
++      break;
++
++    case T_PTR:
++      {
++        char *name = xasprintf ("bits%u.count%u.example",
++                                original_bits, count);
++        resolv_response_add_name (b, name);
++        free (name);
++      }
++      break;
++    }
++  resolv_response_close_record (b);
++
++  if (previous_name != qname)
++    free (previous_name);
++}
++
++/* Controls which name resolution function is invoked.  */
++enum test_mode
++  {
++    byname,                     /* gethostbyname.  */
++    byname2,                    /* gethostbyname2.  */
++    gai,                        /* getaddrinfo without AI_CANONNAME.  */
++    gai_canon,                  /* getaddrinfo with AI_CANONNAME.  */
++
++    test_mode_num               /* Number of enum values.  */
++  };
++
++static const char *
++test_mode_to_string (enum test_mode mode)
++{
++  switch (mode)
++    {
++    case byname:
++      return "byname";
++    case byname2:
++      return "byname2";
++    case gai:
++      return "gai";
++    case gai_canon:
++      return "gai_canon";
++    case test_mode_num:
++      /* Report error below.  */
++    }
++  FAIL_EXIT1 ("invalid test_mode: %d", mode);
++}
++
++/* Append the name and aliases to OUT.  */
++static void
++append_names (FILE *out, const char *qname, int bits, int count,
++              enum test_mode mode)
++{
++  /* Largest valid index which has a corresponding zero in bits
++     (meaning a syntactically valid CNAME).  */
++  int last_valid_cname = -1;
++
++  for (int i = 0; i < count; ++i)
++    if ((bits & (3 << (i * 2))) == 0)
++      last_valid_cname = i;
++
++  if (mode != gai)
++    {
++      const char *label;
++      if (mode == gai_canon)
++        label = "canonname";
++      else
++        label = "name";
++      if (last_valid_cname >= 0)
++        fprintf (out, "%s: unique%d.example\n", label, last_valid_cname);
++      else
++        fprintf (out, "%s: %s\n", label, qname);
++    }
++
++  if (mode == byname || mode == byname2)
++    {
++      if (last_valid_cname >= 0)
++        fprintf (out, "alias: %s\n", qname);
++      for (int i = 0; i < count; ++i)
++        {
++          if ((bits & (3 << (i * 2))) == 0 && i != last_valid_cname)
++            fprintf (out, "alias: unique%d.example\n", i);
++        }
++    }
++}
++
++/* Append the address information to OUT.  */
++static void
++append_addresses (FILE *out, int af, int bits, int count, enum test_mode mode)
++{
++  int last = count * 256 + bits;
++  if (mode == gai || mode == gai_canon)
++    {
++      if (af == AF_INET || af == AF_UNSPEC)
++        fprintf (out, "address: STREAM/TCP 192.168.%d.%d 80\n", count, bits);
++      if (af == AF_INET6 || af == AF_UNSPEC)
++        {
++          if (last == 0)
++            fprintf (out, "address: STREAM/TCP 2001:db8:: 80\n");
++          else
++            fprintf (out, "address: STREAM/TCP 2001:db8::%x 80\n", last);
++        }
++    }
++  else
++    {
++      TEST_VERIFY (af != AF_UNSPEC);
++      if (af == AF_INET)
++        fprintf (out, "address: 192.168.%d.%d\n", count, bits);
++      if (af == AF_INET6)
++        {
++          if (last == 0)
++            fprintf (out, "address: 2001:db8::\n");
++          else
++            fprintf (out, "address: 2001:db8::%x\n", last);
++        }
++    }
++}
++
++/* Perform one test using a forward lookup.  */
++static void
++check_forward (int af, int bits, int count, enum test_mode mode)
++{
++  char *qname = xasprintf ("bits%d.count%d.example", bits, count);
++  char *label = xasprintf ("af=%d bits=%d count=%d mode=%s qname=%s",
++                           af, bits, count, test_mode_to_string (mode), qname);
++
++  struct xmemstream expected;
++  xopen_memstream (&expected);
++  if (mode == gai_canon)
++    fprintf (expected.out, "flags: AI_CANONNAME\n");
++  append_names (expected.out, qname, bits, count, mode);
++  append_addresses (expected.out, af, bits, count, mode);
++  xfclose_memstream (&expected);
++
++  if (mode == gai || mode == gai_canon)
++    {
++      struct addrinfo *ai;
++      struct addrinfo hints =
++        {
++          .ai_family = af,
++          .ai_socktype = SOCK_STREAM,
++        };
++      if (mode == gai_canon)
++        hints.ai_flags |= AI_CANONNAME;
++      int ret = getaddrinfo (qname, "80", &hints, &ai);
++      check_addrinfo (label, ai, ret, expected.buffer);
++      if (ret == 0)
++        freeaddrinfo (ai);
++    }
++  else
++    {
++      struct hostent *e;
++      if (mode == gai)
++        {
++          TEST_COMPARE (af, AF_INET);
++          e = gethostbyname (qname);
++        }
++      else
++        {
++          if (af != AF_INET)
++            TEST_COMPARE (af, AF_INET6);
++          e = gethostbyname2 (qname, af);
++        }
++      check_hostent (label, e, expected.buffer);
++    }
++
++  free (expected.buffer);
++  free (label);
++  free (qname);
++}
++
++/* Perform one check using a reverse lookup.  */
++
++static void
++check_reverse (int af, int bits, int count)
++{
++  TEST_VERIFY (af == AF_INET || af == AF_INET6);
++
++  char *label = xasprintf ("af=%d bits=%d count=%d", af, bits, count);
++  char *fqdn = xasprintf ("bits%d.count%d.example", bits, count);
++
++  struct xmemstream expected;
++  xopen_memstream (&expected);
++  fprintf (expected.out, "name: %s\n", fqdn);
++  append_addresses (expected.out, af, bits, count, byname);
++  xfclose_memstream (&expected);
++
++  char addr[16] = { 0 };
++  socklen_t addrlen;
++  if (af == AF_INET)
++    {
++      addr[0] = 192;
++      addr[1] = 168;
++      addr[2] = count;
++      addr[3] = bits;
++      addrlen = 4;
++    }
++  else
++    {
++      addr[0] = 0x20;
++      addr[1] = 0x01;
++      addr[2] = 0x0d;
++      addr[3] = 0xb8;
++      addr[14] = count;
++      addr[15] = bits;
++      addrlen = 16;
++    }
++
++  struct hostent *e = gethostbyaddr (addr, addrlen, af);
++  check_hostent (label, e, expected.buffer);
++
++  /* getnameinfo check is different.  There is no generic check_*
++     function for it.  */
++  {
++    struct sockaddr_in sin = { };
++    struct sockaddr_in6 sin6 = { };
++    void *sa;
++    socklen_t salen;
++    if (af == AF_INET)
++      {
++        sin.sin_family = AF_INET;
++        memcpy (&sin.sin_addr, addr, addrlen);
++        sin.sin_port = htons (80);
++        sa = &sin;
++        salen = sizeof (sin);
++      }
++    else
++      {
++        sin6.sin6_family = AF_INET6;
++        memcpy (&sin6.sin6_addr, addr, addrlen);
++        sin6.sin6_port = htons (80);
++        sa = &sin6;
++        salen = sizeof (sin6);
++      }
++
++    char host[64];
++    char service[64];
++    int ret = getnameinfo (sa, salen, host,
++                           sizeof (host), service, sizeof (service),
++                           NI_NAMEREQD | NI_NUMERICSERV);
++    TEST_COMPARE (ret, 0);
++    TEST_COMPARE_STRING (host, fqdn);
++    TEST_COMPARE_STRING (service, "80");
++  }
++
++  free (expected.buffer);
++  free (fqdn);
++  free (label);
++}
++
++static int
++do_test (void)
++{
++  struct resolv_test *obj = resolv_test_start
++    ((struct resolv_redirect_config)
++     {
++       .response_callback = response
++     });
++
++  for (int count = 0; count <= 3; ++count)
++    for (int bits = 0; bits <= 1 << (count * 2); ++bits)
++      {
++        if (count > 0 && bits == count)
++          /* The last bits value is only checked if count == 0.  */
++          continue;
++
++        for (enum test_mode mode = 0; mode < test_mode_num; ++mode)
++          {
++            check_forward (AF_INET, bits, count, mode);
++            if (mode != byname)
++              check_forward (AF_INET6, bits, count, mode);
++            if (mode == gai || mode == gai_canon)
++              check_forward (AF_UNSPEC, bits, count, mode);
++          }
++
++        check_reverse (AF_INET, bits, count);
++        check_reverse (AF_INET6, bits, count);
++      }
++
++  resolv_test_end (obj);
++
++  return 0;
++}
++
++#include <support/test-driver.c>
+-- 
+2.38.1
+
+
+From c5cdb39c20e96d9ac0d46fc7284b8276a537fd35 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 30 Aug 2022 10:02:49 +0200
+Subject: [PATCH 35/72] nss_dns: Rewrite _nss_dns_gethostbyname4_r using
+ current interfaces
+
+Introduce struct alloc_buffer to this function, and use it and
+struct ns_rr_cursor in gaih_getanswer_slice.  Adjust gaih_getanswer
+and gaih_getanswer_noaaaa accordingly.
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit 1d495912a746e2a1ffb780c9a81fd234ec2464e8)
+---
+ resolv/nss_dns/dns-host.c | 443 ++++++++++++++------------------------
+ 1 file changed, 162 insertions(+), 281 deletions(-)
+
+diff --git a/resolv/nss_dns/dns-host.c b/resolv/nss_dns/dns-host.c
+index bea505d697..9fa81f23c8 100644
+--- a/resolv/nss_dns/dns-host.c
++++ b/resolv/nss_dns/dns-host.c
+@@ -100,13 +100,6 @@
+ #endif
+ #define MAXHOSTNAMELEN 256
+ 
+-/* We need this time later.  */
+-typedef union querybuf
+-{
+-  HEADER hdr;
+-  u_char buf[MAXPACKET];
+-} querybuf;
+-
+ /* For historic reasons, pointers to IP addresses are char *, so use a
+    single list type for addresses and host names.  */
+ #define DYNARRAY_STRUCT ptrlist
+@@ -125,18 +118,18 @@ static enum nss_status getanswer_ptr (unsigned char *packet, size_t packetlen,
+ 				      char **hnamep, int *errnop,
+ 				      int *h_errnop, int32_t *ttlp);
+ 
+-static enum nss_status gaih_getanswer (const querybuf *answer1, int anslen1,
+-				       const querybuf *answer2, int anslen2,
+-				       const char *qname,
++static enum nss_status gaih_getanswer (unsigned char *packet1,
++				       size_t packet1len,
++				       unsigned char *packet2,
++				       size_t packet2len,
++				       struct alloc_buffer *abuf,
+ 				       struct gaih_addrtuple **pat,
+-				       char *buffer, size_t buflen,
+ 				       int *errnop, int *h_errnop,
+ 				       int32_t *ttlp);
+-static enum nss_status gaih_getanswer_noaaaa (const querybuf *answer1,
+-					      int anslen1,
+-					      const char *qname,
++static enum nss_status gaih_getanswer_noaaaa (unsigned char *packet,
++					      size_t packetlen,
++					      struct alloc_buffer *abuf,
+ 					      struct gaih_addrtuple **pat,
+-					      char *buffer, size_t buflen,
+ 					      int *errnop, int *h_errnop,
+ 					      int32_t *ttlp);
+ 
+@@ -408,17 +401,13 @@ _nss_dns_gethostbyname4_r (const char *name, struct gaih_addrtuple **pat,
+ 	name = cp;
+     }
+ 
+-  union
+-  {
+-    querybuf *buf;
+-    u_char *ptr;
+-  } host_buffer;
+-  querybuf *orig_host_buffer;
+-  host_buffer.buf = orig_host_buffer = (querybuf *) alloca (2048);
++  unsigned char dns_packet_buffer[2048];
++  unsigned char *alt_dns_packet_buffer = dns_packet_buffer;
+   u_char *ans2p = NULL;
+   int nans2p = 0;
+   int resplen2 = 0;
+   int ans2p_malloced = 0;
++  struct alloc_buffer abuf = alloc_buffer_create (buffer, buflen);
+ 
+ 
+   int olderr = errno;
+@@ -427,22 +416,21 @@ _nss_dns_gethostbyname4_r (const char *name, struct gaih_addrtuple **pat,
+   if ((ctx->resp->options & RES_NOAAAA) == 0)
+     {
+       n = __res_context_search (ctx, name, C_IN, T_QUERY_A_AND_AAAA,
+-				host_buffer.buf->buf, 2048, &host_buffer.ptr,
+-				&ans2p, &nans2p, &resplen2, &ans2p_malloced);
++				dns_packet_buffer, sizeof (dns_packet_buffer),
++				&alt_dns_packet_buffer, &ans2p, &nans2p,
++				&resplen2, &ans2p_malloced);
+       if (n >= 0)
+-	status = gaih_getanswer (host_buffer.buf, n, (const querybuf *) ans2p,
+-				 resplen2, name, pat, buffer, buflen,
+-				 errnop, herrnop, ttlp);
++	status = gaih_getanswer (alt_dns_packet_buffer, n, ans2p, resplen2,
++				 &abuf, pat, errnop, herrnop, ttlp);
+     }
+   else
+     {
+       n = __res_context_search (ctx, name, C_IN, T_A,
+-				host_buffer.buf->buf, 2048, NULL,
+-				NULL, NULL, NULL, NULL);
++				dns_packet_buffer, sizeof (dns_packet_buffer),
++				NULL, NULL, NULL, NULL, NULL);
+       if (n >= 0)
+-	status = gaih_getanswer_noaaaa (host_buffer.buf, n,
+-					name, pat, buffer, buflen,
+-					errnop, herrnop, ttlp);
++	status = gaih_getanswer_noaaaa (alt_dns_packet_buffer, n,
++					&abuf, pat, errnop, herrnop, ttlp);
+     }
+   if (n < 0)
+     {
+@@ -473,12 +461,20 @@ _nss_dns_gethostbyname4_r (const char *name, struct gaih_addrtuple **pat,
+ 	__set_errno (olderr);
+     }
+ 
++  /* Implement the buffer resizing protocol.  */
++  if (alloc_buffer_has_failed (&abuf))
++    {
++      *errnop = ERANGE;
++      *herrnop = NETDB_INTERNAL;
++      status = NSS_STATUS_TRYAGAIN;
++    }
++
+   /* Check whether ans2p was separately allocated.  */
+   if (ans2p_malloced)
+     free (ans2p);
+ 
+-  if (host_buffer.buf != orig_host_buffer)
+-    free (host_buffer.buf);
++  if (alt_dns_packet_buffer != dns_packet_buffer)
++    free (alt_dns_packet_buffer);
+ 
+   __resolv_context_put (ctx);
+   return status;
+@@ -892,259 +888,152 @@ getanswer_ptr (unsigned char *packet, size_t packetlen,
+   return NSS_STATUS_TRYAGAIN;
+ }
+ 
++/* Parses DNS data found in PACKETLEN bytes at PACKET in struct
++   gaih_addrtuple address tuples.  The new address tuples are linked
++   from **TAILP, with backing store allocated from ABUF, and *TAILP is
++   updated to point where the next tuple pointer should be stored.  If
++   TTLP is not null, *TTLP is updated to reflect the minimum TTL.  If
++   STORE_CANON is true, the canonical name is stored as part of the
++   first address tuple being written.  */
+ static enum nss_status
+-gaih_getanswer_slice (const querybuf *answer, int anslen, const char *qname,
+-		      struct gaih_addrtuple ***patp,
+-		      char **bufferp, size_t *buflenp,
+-		      int *errnop, int *h_errnop, int32_t *ttlp, int *firstp)
++gaih_getanswer_slice (unsigned char *packet, size_t packetlen,
++		      struct alloc_buffer *abuf,
++		      struct gaih_addrtuple ***tailp,
++		      int *errnop, int *h_errnop, int32_t *ttlp,
++		      bool store_canon)
+ {
+-  char *buffer = *bufferp;
+-  size_t buflen = *buflenp;
+-
+-  struct gaih_addrtuple **pat = *patp;
+-  const HEADER *hp = &answer->hdr;
+-  int ancount = ntohs (hp->ancount);
+-  int qdcount = ntohs (hp->qdcount);
+-  const u_char *cp = answer->buf + HFIXEDSZ;
+-  const u_char *end_of_message = answer->buf + anslen;
+-  if (__glibc_unlikely (qdcount != 1))
+-    {
+-      *h_errnop = NO_RECOVERY;
+-      return NSS_STATUS_UNAVAIL;
+-    }
+-
+-  u_char packtmp[NS_MAXCDNAME];
+-  int n = __ns_name_unpack (answer->buf, end_of_message, cp,
+-			    packtmp, sizeof packtmp);
+-  /* We unpack the name to check it for validity.  But we do not need
+-     it later.  */
+-  if (n != -1 && __ns_name_ntop (packtmp, buffer, buflen) == -1)
+-    {
+-      if (__glibc_unlikely (errno == EMSGSIZE))
+-	{
+-	too_small:
+-	  *errnop = ERANGE;
+-	  *h_errnop = NETDB_INTERNAL;
+-	  return NSS_STATUS_TRYAGAIN;
+-	}
+-
+-      n = -1;
+-    }
+-
+-  if (__glibc_unlikely (n < 0))
+-    {
+-      *errnop = errno;
+-      *h_errnop = NO_RECOVERY;
+-      return NSS_STATUS_UNAVAIL;
+-    }
+-  if (__glibc_unlikely (__libc_res_hnok (buffer) == 0))
++  struct ns_rr_cursor c;
++  if (!__ns_rr_cursor_init (&c, packet, packetlen))
+     {
+-      errno = EBADMSG;
+-      *errnop = EBADMSG;
++      /* This should not happen because __res_context_query already
++	 perfroms response validation.  */
+       *h_errnop = NO_RECOVERY;
+       return NSS_STATUS_UNAVAIL;
+     }
+-  cp += n + QFIXEDSZ;
++  bool haveanswer = false; /* Set to true if at least one address.  */
++  uint16_t qtype = ns_rr_cursor_qtype (&c);
++  int ancount = ns_rr_cursor_ancount (&c);
++  const unsigned char *expected_name = ns_rr_cursor_qname (&c);
++  /* expected_name may be updated to point into this buffer.  */
++  unsigned char name_buffer[NS_MAXCDNAME];
+ 
+-  int haveanswer = 0;
+-  int had_error = 0;
+-  char *canon = NULL;
+-  char *h_name = NULL;
+-  int h_namelen = 0;
++  /* This is a pointer to a possibly-compressed name in the packet.
++     Eventually it is equivalent to the canonical name.  If needed, it
++     is uncompressed and translated to text form when the first
++     address tuple is encountered.  */
++  const unsigned char *compressed_alias_name = expected_name;
+ 
+-  if (ancount == 0)
++  if (ancount == 0 || !__res_binary_hnok (compressed_alias_name))
+     {
+       *h_errnop = HOST_NOT_FOUND;
+       return NSS_STATUS_NOTFOUND;
+     }
+ 
+-  while (ancount-- > 0 && cp < end_of_message && had_error == 0)
++  for (; ancount > -0; --ancount)
+     {
+-      n = __ns_name_unpack (answer->buf, end_of_message, cp,
+-			    packtmp, sizeof packtmp);
+-      if (n != -1 &&
+-	  (h_namelen = __ns_name_ntop (packtmp, buffer, buflen)) == -1)
+-	{
+-	  if (__glibc_unlikely (errno == EMSGSIZE))
+-	    goto too_small;
+-
+-	  n = -1;
+-	}
+-      if (__glibc_unlikely (n < 0))
+-	{
+-	  ++had_error;
+-	  continue;
+-	}
+-      if (*firstp && canon == NULL && __libc_res_hnok (buffer))
+-	{
+-	  h_name = buffer;
+-	  buffer += h_namelen;
+-	  buflen -= h_namelen;
+-	}
+-
+-      cp += n;				/* name */
+-
+-      if (__glibc_unlikely (cp + 10 > end_of_message))
+-	{
+-	  ++had_error;
+-	  continue;
+-	}
+-
+-      uint16_t type;
+-      NS_GET16 (type, cp);
+-      uint16_t class;
+-      NS_GET16 (class, cp);
+-      int32_t ttl;
+-      NS_GET32 (ttl, cp);
+-      NS_GET16 (n, cp);		/* RDATA length.  */
+-
+-      if (end_of_message - cp < n)
++      struct ns_rr_wire rr;
++      if (!__ns_rr_cursor_next (&c, &rr))
+ 	{
+-	  /* RDATA extends beyond the end of the packet.  */
+-	  ++had_error;
+-	  continue;
++	  *h_errnop = NO_RECOVERY;
++	  return NSS_STATUS_UNAVAIL;
+ 	}
+ 
+-      if (class != C_IN)
+-	{
+-	  cp += n;
+-	  continue;
+-	}
++      /* Update TTL for known record types.  */
++      if ((rr.rtype == T_CNAME || rr.rtype == qtype)
++	  && ttlp != NULL && *ttlp > rr.ttl)
++	*ttlp = rr.ttl;
+ 
+-      if (type == T_CNAME)
++      if (rr.rtype == T_CNAME)
+ 	{
+-	  char tbuf[MAXDNAME];
+-
+-	  /* A CNAME could also have a TTL entry.  */
+-	  if (ttlp != NULL && ttl < *ttlp)
+-	      *ttlp = ttl;
+-
+-	  n = __libc_dn_expand (answer->buf, end_of_message, cp,
+-				tbuf, sizeof tbuf);
+-	  if (__glibc_unlikely (n < 0))
+-	    {
+-	      ++had_error;
+-	      continue;
+-	    }
+-	  cp += n;
+-
+-	  if (*firstp && __libc_res_hnok (tbuf))
++	  /* NB: No check for owner name match, based on historic
++	     precedent.  Record the CNAME target as the new expected
++	     name.  */
++	  int n = __ns_name_unpack (c.begin, c.end, rr.rdata,
++				    name_buffer, sizeof (name_buffer));
++	  if (n < 0)
+ 	    {
+-	      /* Reclaim buffer space.  */
+-	      if (h_name + h_namelen == buffer)
+-		{
+-		  buffer = h_name;
+-		  buflen += h_namelen;
+-		}
+-
+-	      n = strlen (tbuf) + 1;
+-	      if (__glibc_unlikely (n > buflen))
+-		goto too_small;
+-	      if (__glibc_unlikely (n >= MAXHOSTNAMELEN))
+-		{
+-		  ++had_error;
+-		  continue;
+-		}
+-
+-	      canon = buffer;
+-	      buffer = __mempcpy (buffer, tbuf, n);
+-	      buflen -= n;
+-	      h_namelen = 0;
++	      *h_errnop = NO_RECOVERY;
++	      return NSS_STATUS_UNAVAIL;
+ 	    }
+-	  continue;
++	  expected_name = name_buffer;
++	  if (store_canon && __res_binary_hnok (name_buffer))
++	    /* This name can be used as a canonical name.  Do not
++	       translate to text form here to conserve buffer space.
++	       Point to the compressed name because name_buffer can be
++	       overwritten with an unusable name later.  */
++	    compressed_alias_name = rr.rdata;
+ 	}
+-
+-      /* Stop parsing if we encounter a record with incorrect RDATA
+-	 length.  */
+-      if (type == T_A || type == T_AAAA)
++      else if (rr.rtype == qtype
++	       && __ns_samebinaryname (rr.rname, expected_name)
++	       && rr.rdlength == rrtype_to_rdata_length (qtype))
+ 	{
+-	  if (n != rrtype_to_rdata_length (type))
++	  struct gaih_addrtuple *ntup
++	    = alloc_buffer_alloc (abuf, struct gaih_addrtuple);
++	  /* Delay error reporting to the callers (they implement the
++	     ERANGE buffer resizing handshake).  */
++	  if (ntup != NULL)
+ 	    {
+-	      ++had_error;
+-	      continue;
++	      ntup->next = NULL;
++	      if (store_canon && compressed_alias_name != NULL)
++		{
++		  /* This assumes that all the CNAME records come
++		     first.  Use MAXHOSTNAMELEN instead of
++		     NS_MAXCDNAME for additional length checking.
++		     However, these checks are not expected to fail
++		     because all size NS_MAXCDNAME names should into
++		     the hname buffer because no escaping is
++		     needed.  */
++		  char unsigned nbuf[NS_MAXCDNAME];
++		  char hname[MAXHOSTNAMELEN + 1];
++		  if (__ns_name_unpack (c.begin, c.end,
++					compressed_alias_name,
++					nbuf, sizeof (nbuf)) >= 0
++		      && __ns_name_ntop (nbuf, hname, sizeof (hname)) >= 0)
++		    /* Space checking is performed by the callers.  */
++		    ntup->name = alloc_buffer_copy_string (abuf, hname);
++		  store_canon = false;
++		}
++	      else
++		ntup->name = NULL;
++	      if (rr.rdlength == 4)
++		ntup->family = AF_INET;
++	      else
++		ntup->family = AF_INET6;
++	      memcpy (ntup->addr, rr.rdata, rr.rdlength);
++	      ntup->scopeid = 0;
++
++	      /* Link in the new tuple, and update the tail pointer to
++		 point to its next field.  */
++	      **tailp = ntup;
++	      *tailp = &ntup->next;
++
++	      haveanswer = true;
+ 	    }
+ 	}
+-      else
+-	{
+-	  /* Skip unknown records.  */
+-	  cp += n;
+-	  continue;
+-	}
+-
+-      assert (type == T_A || type == T_AAAA);
+-      if (*pat == NULL)
+-	{
+-	  uintptr_t pad = (-(uintptr_t) buffer
+-			   % __alignof__ (struct gaih_addrtuple));
+-	  buffer += pad;
+-	  buflen = buflen > pad ? buflen - pad : 0;
+-
+-	  if (__glibc_unlikely (buflen < sizeof (struct gaih_addrtuple)))
+-	    goto too_small;
+-
+-	  *pat = (struct gaih_addrtuple *) buffer;
+-	  buffer += sizeof (struct gaih_addrtuple);
+-	  buflen -= sizeof (struct gaih_addrtuple);
+-	}
+-
+-      (*pat)->name = NULL;
+-      (*pat)->next = NULL;
+-
+-      if (*firstp)
+-	{
+-	  /* We compose a single hostent out of the entire chain of
+-	     entries, so the TTL of the hostent is essentially the lowest
+-	     TTL in the chain.  */
+-	  if (ttlp != NULL && ttl < *ttlp)
+-	    *ttlp = ttl;
+-
+-	  (*pat)->name = canon ?: h_name;
+-
+-	  *firstp = 0;
+-	}
+-
+-      (*pat)->family = type == T_A ? AF_INET : AF_INET6;
+-      memcpy ((*pat)->addr, cp, n);
+-      cp += n;
+-      (*pat)->scopeid = 0;
+-
+-      pat = &((*pat)->next);
+-
+-      haveanswer = 1;
+     }
+ 
+   if (haveanswer)
+     {
+-      *patp = pat;
+-      *bufferp = buffer;
+-      *buflenp = buflen;
+-
+       *h_errnop = NETDB_SUCCESS;
+       return NSS_STATUS_SUCCESS;
+     }
+-
+-  /* Special case here: if the resolver sent a result but it only
+-     contains a CNAME while we are looking for a T_A or T_AAAA record,
+-     we fail with NOTFOUND instead of TRYAGAIN.  */
+-  if (canon != NULL)
++  else
+     {
++      /* Special case here: if the resolver sent a result but it only
++	 contains a CNAME while we are looking for a T_A or T_AAAA
++	 record, we fail with NOTFOUND.  */
+       *h_errnop = HOST_NOT_FOUND;
+       return NSS_STATUS_NOTFOUND;
+     }
+-
+-  *h_errnop = NETDB_INTERNAL;
+-  return NSS_STATUS_TRYAGAIN;
+ }
+ 
+ 
+ static enum nss_status
+-gaih_getanswer (const querybuf *answer1, int anslen1, const querybuf *answer2,
+-		int anslen2, const char *qname,
+-		struct gaih_addrtuple **pat, char *buffer, size_t buflen,
++gaih_getanswer (unsigned char *packet1, size_t packet1len,
++		unsigned char *packet2, size_t packet2len,
++		struct alloc_buffer *abuf, struct gaih_addrtuple **pat,
+ 		int *errnop, int *h_errnop, int32_t *ttlp)
+ {
+-  int first = 1;
+-
+   enum nss_status status = NSS_STATUS_NOTFOUND;
+ 
+   /* Combining the NSS status of two distinct queries requires some
+@@ -1156,7 +1045,10 @@ gaih_getanswer (const querybuf *answer1, int anslen1, const querybuf *answer2,
+      between TRYAGAIN (recoverable) and TRYAGAIN' (not-recoverable).
+      A recoverable TRYAGAIN is almost always due to buffer size issues
+      and returns ERANGE in errno and the caller is expected to retry
+-     with a larger buffer.
++     with a larger buffer.  (The caller, _nss_dns_gethostbyname4_r,
++     ignores the return status if it detects that the result buffer
++     has been exhausted and generates a TRYAGAIN failure with an
++     ERANGE code.)
+ 
+      Lastly, you may be tempted to make significant changes to the
+      conditions in this code to bring about symmetry between responses.
+@@ -1236,36 +1128,30 @@ gaih_getanswer (const querybuf *answer1, int anslen1, const querybuf *answer2,
+ 	 is a recoverable error we now return TRYAGIN even if the first
+ 	 response was SUCCESS.  */
+ 
+-  if (anslen1 > 0)
+-    status = gaih_getanswer_slice(answer1, anslen1, qname,
+-				  &pat, &buffer, &buflen,
+-				  errnop, h_errnop, ttlp,
+-				  &first);
+-
+-  if ((status == NSS_STATUS_SUCCESS || status == NSS_STATUS_NOTFOUND
+-       || (status == NSS_STATUS_TRYAGAIN
+-	   /* We want to look at the second answer in case of an
+-	      NSS_STATUS_TRYAGAIN only if the error is non-recoverable, i.e.
+-	      *h_errnop is NO_RECOVERY. If not, and if the failure was due to
+-	      an insufficient buffer (ERANGE), then we need to drop the results
+-	      and pass on the NSS_STATUS_TRYAGAIN to the caller so that it can
+-	      repeat the query with a larger buffer.  */
+-	   && (*errnop != ERANGE || *h_errnop == NO_RECOVERY)))
+-      && answer2 != NULL && anslen2 > 0)
++  if (packet1len > 0)
+     {
+-      enum nss_status status2 = gaih_getanswer_slice(answer2, anslen2, qname,
+-						     &pat, &buffer, &buflen,
+-						     errnop, h_errnop, ttlp,
+-						     &first);
++      status = gaih_getanswer_slice (packet1, packet1len,
++				     abuf, &pat, errnop, h_errnop, ttlp, true);
++      if (alloc_buffer_has_failed (abuf))
++	/* Do not try parsing the second packet if a larger result
++	   buffer is needed.  The caller implements the resizing
++	   protocol because *abuf has been exhausted.  */
++	return NSS_STATUS_TRYAGAIN; /* Ignored by the caller.  */
++    }
++
++  if ((status == NSS_STATUS_SUCCESS || status == NSS_STATUS_NOTFOUND)
++      && packet2 != NULL && packet2len > 0)
++    {
++      enum nss_status status2
++	= gaih_getanswer_slice (packet2, packet2len,
++				abuf, &pat, errnop, h_errnop, ttlp,
++				/* Success means that data with a
++				   canonical name has already been
++				   stored.  Do not store the name again.  */
++				status != NSS_STATUS_SUCCESS);
+       /* Use the second response status in some cases.  */
+       if (status != NSS_STATUS_SUCCESS && status2 != NSS_STATUS_NOTFOUND)
+ 	status = status2;
+-      /* Do not return a truncated second response (unless it was
+-	 unavoidable e.g. unrecoverable TRYAGAIN).  */
+-      if (status == NSS_STATUS_SUCCESS
+-	  && (status2 == NSS_STATUS_TRYAGAIN
+-	      && *errnop == ERANGE && *h_errnop != NO_RECOVERY))
+-	status = NSS_STATUS_TRYAGAIN;
+     }
+ 
+   return status;
+@@ -1273,18 +1159,13 @@ gaih_getanswer (const querybuf *answer1, int anslen1, const querybuf *answer2,
+ 
+ /* Variant of gaih_getanswer without a second (AAAA) response.  */
+ static enum nss_status
+-gaih_getanswer_noaaaa (const querybuf *answer1, int anslen1, const char *qname,
+-		       struct gaih_addrtuple **pat,
+-		       char *buffer, size_t buflen,
++gaih_getanswer_noaaaa (unsigned char *packet, size_t packetlen,
++		       struct alloc_buffer *abuf, struct gaih_addrtuple **pat,
+ 		       int *errnop, int *h_errnop, int32_t *ttlp)
+ {
+-  int first = 1;
+-
+   enum nss_status status = NSS_STATUS_NOTFOUND;
+-  if (anslen1 > 0)
+-    status = gaih_getanswer_slice (answer1, anslen1, qname,
+-				   &pat, &buffer, &buflen,
+-				   errnop, h_errnop, ttlp,
+-				   &first);
++  if (packetlen > 0)
++    status = gaih_getanswer_slice (packet, packetlen,
++				   abuf, &pat, errnop, h_errnop, ttlp, true);
+   return status;
+ }
+-- 
+2.38.1
+
+
+From a7fa604f3050a1024dc8ec28ff28bad811f6151f Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 30 Aug 2022 13:30:03 +0200
+Subject: [PATCH 36/72] resolv: Fix building tst-resolv-invalid-cname for
+ earlier C standards
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This fixes this compiler error:
+
+tst-resolv-invalid-cname.c: In function ‘test_mode_to_string’:
+tst-resolv-invalid-cname.c:164:10: error: label at end of compound statement
+     case test_mode_num:
+          ^~~~~~~~~~~~~
+
+Fixes commit 9caf782276ecea4bc86fc94fbb52779736f3106d
+("resolv: Add new tst-resolv-invalid-cname").
+
+(cherry picked from commit d09aa4a17229bcaa2ec7642006b12612498582e7)
+---
+ resolv/tst-resolv-invalid-cname.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/resolv/tst-resolv-invalid-cname.c b/resolv/tst-resolv-invalid-cname.c
+index ae2d4419b1..63dac90e02 100644
+--- a/resolv/tst-resolv-invalid-cname.c
++++ b/resolv/tst-resolv-invalid-cname.c
+@@ -162,7 +162,7 @@ test_mode_to_string (enum test_mode mode)
+     case gai_canon:
+       return "gai_canon";
+     case test_mode_num:
+-      /* Report error below.  */
++      break;                    /* Report error below.  */
+     }
+   FAIL_EXIT1 ("invalid test_mode: %d", mode);
+ }
+-- 
+2.38.1
+
+
+From 5d885617cec5713fdde42177398fe98acb66b7a2 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 13 Sep 2022 13:22:27 +0200
+Subject: [PATCH 37/72] NEWS: Note bug 12154 and bug 29305 as fixed
+
+---
+ NEWS | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/NEWS b/NEWS
+index 9360596fcc..03281e3ab4 100644
+--- a/NEWS
++++ b/NEWS
+@@ -16,7 +16,9 @@ Security related changes:
+ 
+ The following bugs are resolved with this release:
+ 
++  [12154] Do not fail DNS resolution for CNAMEs which are not host names
+   [28846] CMSG_NXTHDR may trigger -Wstrict-overflow warning
++  [29305] Conserve NSS buffer space during DNS packet parsing
+   [29415] nscd: Fix netlink cache invalidation if epoll is used
+   [29446] _dlopen now ignores dl_caller argument in static mode
+   [29485] Linux: Terminate subprocess on late failure in tst-pidfd
+-- 
+2.38.1
+
+
+From df51334828f2af214105aad82042140ee3a6de0a Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 13 Sep 2022 19:57:43 +0200
+Subject: [PATCH 38/72] elf: Run tst-audit-tlsdesc, tst-audit-tlsdesc-dlopen
+ everywhere
+
+The test is valid for all TLS models, but we want to make a reasonable
+effort to test the GNU2 model specifically.  For example, aarch64
+defaults to GNU2, but does not have -mtls-dialect=gnu2, and the test
+was not run there.
+
+Suggested-by: Martin Coufal <mcoufal@redhat.com>
+(cherry picked from commit dd2315a866a4ac2b838ea1cb10c5ea1c35d51a2f)
+
+Fixes early backport commit 924e4f3eaa502ce82fccf8537f021a796d158771
+("elf: Call __libc_early_init for reused namespaces (bug 29528)");
+it had a wrong conflict resolution.
+---
+ elf/Makefile | 22 ++++++----------------
+ 1 file changed, 6 insertions(+), 16 deletions(-)
+
+diff --git a/elf/Makefile b/elf/Makefile
+index 43353a4b08..72178d33ff 100644
+--- a/elf/Makefile
++++ b/elf/Makefile
+@@ -374,6 +374,8 @@ tests += \
+   tst-align \
+   tst-align2 \
+   tst-align3 \
++  tst-audit-tlsdesc \
++  tst-audit-tlsdesc-dlopen \
+   tst-audit1 \
+   tst-audit2 \
+   tst-audit8 \
+@@ -766,6 +768,8 @@ modules-names += \
+   tst-alignmod3 \
+   tst-array2dep \
+   tst-array5dep \
++  tst-audit-tlsdesc-mod1 \
++  tst-audit-tlsdesc-mod2 \
+   tst-audit11mod1 \
+   tst-audit11mod2 \
+   tst-audit12mod1 \
+@@ -799,6 +803,7 @@ modules-names += \
+   tst-auditmanymod7 \
+   tst-auditmanymod8 \
+   tst-auditmanymod9 \
++  tst-auditmod-tlsdesc  \
+   tst-auditmod1 \
+   tst-auditmod9a \
+   tst-auditmod9b \
+@@ -993,23 +998,8 @@ modules-names += tst-gnu2-tls1mod
+ $(objpfx)tst-gnu2-tls1: $(objpfx)tst-gnu2-tls1mod.so
+ tst-gnu2-tls1mod.so-no-z-defs = yes
+ CFLAGS-tst-gnu2-tls1mod.c += -mtls-dialect=gnu2
++endif # $(have-mtls-dialect-gnu2)
+ 
+-tests += tst-audit-tlsdesc tst-audit-tlsdesc-dlopen
+-modules-names += tst-audit-tlsdesc-mod1 tst-audit-tlsdesc-mod2 tst-auditmod-tlsdesc
+-$(objpfx)tst-audit-tlsdesc: $(objpfx)tst-audit-tlsdesc-mod1.so \
+-			    $(objpfx)tst-audit-tlsdesc-mod2.so \
+-			    $(shared-thread-library)
+-CFLAGS-tst-audit-tlsdesc-mod1.c += -mtls-dialect=gnu2
+-CFLAGS-tst-audit-tlsdesc-mod2.c += -mtls-dialect=gnu2
+-$(objpfx)tst-audit-tlsdesc-dlopen: $(shared-thread-library)
+-$(objpfx)tst-audit-tlsdesc-dlopen.out: $(objpfx)tst-audit-tlsdesc-mod1.so \
+-				       $(objpfx)tst-audit-tlsdesc-mod2.so
+-$(objpfx)tst-audit-tlsdesc-mod1.so: $(objpfx)tst-audit-tlsdesc-mod2.so
+-$(objpfx)tst-audit-tlsdesc.out: $(objpfx)tst-auditmod-tlsdesc.so
+-tst-audit-tlsdesc-ENV = LD_AUDIT=$(objpfx)tst-auditmod-tlsdesc.so
+-$(objpfx)tst-audit-tlsdesc-dlopen.out: $(objpfx)tst-auditmod-tlsdesc.so
+-tst-audit-tlsdesc-dlopen-ENV = LD_AUDIT=$(objpfx)tst-auditmod-tlsdesc.so
+-endif
+ ifeq (yes,$(have-protected-data))
+ modules-names += tst-protected1moda tst-protected1modb
+ tests += tst-protected1a tst-protected1b
+-- 
+2.38.1
+
+
+From 4b95b6e8bbb5a2b6856f707bf3bc3308ebef595a Mon Sep 17 00:00:00 2001
+From: Javier Pello <devel@otheo.eu>
+Date: Mon, 5 Sep 2022 20:09:01 +0200
+Subject: [PATCH 39/72] elf: Fix hwcaps string size overestimation
+
+Commit dad90d528259b669342757c37dedefa8577e2636 added glibc-hwcaps
+support for LD_LIBRARY_PATH and, for this, it adjusted the total
+string size required in _dl_important_hwcaps. However, in doing so
+it inadvertently altered the calculation of the size required for
+the power set strings, as the computation of the power set string
+size depended on the first value assigned to the total variable,
+which is later shifted, resulting in overallocation of string
+space. Fix this now by using a different variable to hold the
+string size required for glibc-hwcaps.
+
+Signed-off-by: Javier Pello <devel@otheo.eu>
+(cherry picked from commit a23820f6052a740246fdc7dcd9c43ce8eed0c45a)
+---
+ elf/dl-hwcaps.c | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/elf/dl-hwcaps.c b/elf/dl-hwcaps.c
+index 6f161f6ad5..92eb53790e 100644
+--- a/elf/dl-hwcaps.c
++++ b/elf/dl-hwcaps.c
+@@ -193,7 +193,7 @@ _dl_important_hwcaps (const char *glibc_hwcaps_prepend,
+   /* Each hwcaps subdirectory has a GLIBC_HWCAPS_PREFIX string prefix
+      and a "/" suffix once stored in the result.  */
+   hwcaps_counts.maximum_length += strlen (GLIBC_HWCAPS_PREFIX) + 1;
+-  size_t total = (hwcaps_counts.count * (strlen (GLIBC_HWCAPS_PREFIX) + 1)
++  size_t hwcaps_sz = (hwcaps_counts.count * (strlen (GLIBC_HWCAPS_PREFIX) + 1)
+ 		  + hwcaps_counts.total_length);
+ 
+   /* Count the number of bits set in the masked value.  */
+@@ -229,11 +229,12 @@ _dl_important_hwcaps (const char *glibc_hwcaps_prepend,
+   assert (m == cnt);
+ 
+   /* Determine the total size of all strings together.  */
++  size_t total;
+   if (cnt == 1)
+-    total += temp[0].len + 1;
++    total = temp[0].len + 1;
+   else
+     {
+-      total += temp[0].len + temp[cnt - 1].len + 2;
++      total = temp[0].len + temp[cnt - 1].len + 2;
+       if (cnt > 2)
+ 	{
+ 	  total <<= 1;
+@@ -255,6 +256,7 @@ _dl_important_hwcaps (const char *glibc_hwcaps_prepend,
+   /* This is the overall result, including both glibc-hwcaps
+      subdirectories and the legacy hwcaps subdirectories using the
+      power set construction.  */
++  total += hwcaps_sz;
+   struct r_strlenpair *overall_result
+     = malloc (*sz * sizeof (*result) + total);
+   if (overall_result == NULL)
+-- 
+2.38.1
+
+
+From 7a3f8c8a7aeb41d4bbfeec07d0be1e92c3019919 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 6 Sep 2022 07:38:10 +0200
+Subject: [PATCH 40/72] scripts/dso-ordering-test.py: Generate program run-time
+ dependencies
+
+The main program needs to depend on all shared objects, even objects
+that have link-time dependencies among shared objects.  Filtering
+out shared objects that already have an link-time dependencies is not
+necessary here; make will do this automatically.
+
+Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
+(cherry picked from commit 183d99737298bb3200f0610fdcd1c7549c8ed560)
+---
+ scripts/dso-ordering-test.py | 13 ++++++-------
+ 1 file changed, 6 insertions(+), 7 deletions(-)
+
+diff --git a/scripts/dso-ordering-test.py b/scripts/dso-ordering-test.py
+index 2dd6bfda18..b87cf2f809 100644
+--- a/scripts/dso-ordering-test.py
++++ b/scripts/dso-ordering-test.py
+@@ -707,13 +707,12 @@ def process_testcase(t):
+                 "\t$(compile.c) $(OUTPUT_OPTION)\n")
+         makefile.write (rule)
+ 
+-        not_depended_objs = find_objs_not_depended_on(test_descr)
+-        if not_depended_objs:
+-            depstr = ""
+-            for dep in not_depended_objs:
+-                depstr += (" $(objpfx)" + test_subdir + "/"
+-                           + test_name + "-" + dep + ".so")
+-            makefile.write("$(objpfx)%s.out:%s\n" % (base_test_name, depstr))
++        # Ensure that all shared objects are built before running the
++        # test, whether there link-time dependencies or not.
++        depobjs = ["$(objpfx){}/{}-{}.so".format(test_subdir, test_name, dep)
++                   for dep in test_descr.objs]
++        makefile.write("$(objpfx){}.out: {}\n".format(
++            base_test_name, " ".join(depobjs)))
+ 
+         # Add main executable to test-srcs
+         makefile.write("test-srcs += %s/%s\n" % (test_subdir, test_name))
+-- 
+2.38.1
+
+
+From d1241cf00139733de069c84933cd576dc1a1f45e Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 6 Sep 2022 07:38:10 +0200
+Subject: [PATCH 41/72] elf: Rename _dl_sort_maps parameter from skip to
+ force_first
+
+The new implementation will not be able to skip an arbitrary number
+of objects.
+
+Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
+(cherry picked from commit dbb75513f5cf9285c77c9e55777c5c35b653f890)
+---
+ elf/dl-sort-maps.c         | 14 +++++++-------
+ sysdeps/generic/ldsodefs.h |  6 ++++--
+ 2 files changed, 11 insertions(+), 9 deletions(-)
+
+diff --git a/elf/dl-sort-maps.c b/elf/dl-sort-maps.c
+index 96638d7ed1..5b550b1e94 100644
+--- a/elf/dl-sort-maps.c
++++ b/elf/dl-sort-maps.c
+@@ -27,12 +27,12 @@
+    If FOR_FINI is true, this is called for finishing an object.  */
+ static void
+ _dl_sort_maps_original (struct link_map **maps, unsigned int nmaps,
+-			unsigned int skip, bool for_fini)
++			bool force_first, bool for_fini)
+ {
+   /* Allows caller to do the common optimization of skipping the first map,
+      usually the main binary.  */
+-  maps += skip;
+-  nmaps -= skip;
++  maps += force_first;
++  nmaps -= force_first;
+ 
+   /* A list of one element need not be sorted.  */
+   if (nmaps <= 1)
+@@ -182,7 +182,7 @@ dfs_traversal (struct link_map ***rpo, struct link_map *map,
+ 
+ static void
+ _dl_sort_maps_dfs (struct link_map **maps, unsigned int nmaps,
+-		   unsigned int skip __attribute__ ((unused)), bool for_fini)
++		   bool force_first __attribute__ ((unused)), bool for_fini)
+ {
+   for (int i = nmaps - 1; i >= 0; i--)
+     maps[i]->l_visited = 0;
+@@ -286,7 +286,7 @@ _dl_sort_maps_init (void)
+ 
+ void
+ _dl_sort_maps (struct link_map **maps, unsigned int nmaps,
+-	       unsigned int skip, bool for_fini)
++	       bool force_first, bool for_fini)
+ {
+   /* It can be tempting to use a static function pointer to store and call
+      the current selected sorting algorithm routine, but experimentation
+@@ -296,9 +296,9 @@ _dl_sort_maps (struct link_map **maps, unsigned int nmaps,
+      input cases. A simple if-case with direct function calls appears to
+      be the fastest.  */
+   if (__glibc_likely (GLRO(dl_dso_sort_algo) == dso_sort_algorithm_original))
+-    _dl_sort_maps_original (maps, nmaps, skip, for_fini);
++    _dl_sort_maps_original (maps, nmaps, force_first, for_fini);
+   else
+-    _dl_sort_maps_dfs (maps, nmaps, skip, for_fini);
++    _dl_sort_maps_dfs (maps, nmaps, force_first, for_fini);
+ }
+ 
+ #endif /* HAVE_TUNABLES.  */
+diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h
+index 050a3032de..6b256b8388 100644
+--- a/sysdeps/generic/ldsodefs.h
++++ b/sysdeps/generic/ldsodefs.h
+@@ -1048,9 +1048,11 @@ extern void _dl_init (struct link_map *main_map, int argc, char **argv,
+    initializer functions have completed.  */
+ extern void _dl_fini (void) attribute_hidden;
+ 
+-/* Sort array MAPS according to dependencies of the contained objects.  */
++/* Sort array MAPS according to dependencies of the contained objects.
++   If FORCE_FIRST, MAPS[0] keeps its place even if the dependencies
++   say otherwise.  */
+ extern void _dl_sort_maps (struct link_map **maps, unsigned int nmaps,
+-			   unsigned int skip, bool for_fini) attribute_hidden;
++			   bool force_first, bool for_fini) attribute_hidden;
+ 
+ /* The dynamic linker calls this function before and having changing
+    any shared object mappings.  The `r_state' member of `struct r_debug'
+-- 
+2.38.1
+
+
+From da5f134f6d59701a3a6119309ae91c93c3fa5b51 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 20 Sep 2022 11:00:42 +0200
+Subject: [PATCH 42/72] elf: Implement force_first handling in
+ _dl_sort_maps_dfs (bug 28937)
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The implementation in _dl_close_worker requires that the first
+element of l_initfini is always this very map (“We are always the
+zeroth entry, and since we don't include ourselves in the
+dependency analysis start at 1.”).  Rather than fixing that
+assumption, this commit adds an implementation of the force_first
+argument to the new dependency sorting algorithm.  This also means
+that the directly dlopen'ed shared object is always initialized last,
+which is the least surprising behavior in the presence of cycles.
+
+Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
+(cherry picked from commit 1df71d32fe5f5905ffd5d100e5e9ca8ad6210891)
+---
+ NEWS                     |  1 +
+ elf/dl-sort-maps.c       | 32 +++++++++++++++++++++++---------
+ elf/dso-sort-tests-1.def |  7 +++++++
+ 3 files changed, 31 insertions(+), 9 deletions(-)
+
+diff --git a/NEWS b/NEWS
+index 03281e3ab4..5b4753416f 100644
+--- a/NEWS
++++ b/NEWS
+@@ -20,6 +20,7 @@ The following bugs are resolved with this release:
+   [28846] CMSG_NXTHDR may trigger -Wstrict-overflow warning
+   [29305] Conserve NSS buffer space during DNS packet parsing
+   [29415] nscd: Fix netlink cache invalidation if epoll is used
++  [28937] New DSO dependency sorter does not put new map first if in a cycle
+   [29446] _dlopen now ignores dl_caller argument in static mode
+   [29485] Linux: Terminate subprocess on late failure in tst-pidfd
+   [29490] alpha: New __brk_call implementation is broken
+diff --git a/elf/dl-sort-maps.c b/elf/dl-sort-maps.c
+index 5b550b1e94..3e2a6a584e 100644
+--- a/elf/dl-sort-maps.c
++++ b/elf/dl-sort-maps.c
+@@ -182,8 +182,9 @@ dfs_traversal (struct link_map ***rpo, struct link_map *map,
+ 
+ static void
+ _dl_sort_maps_dfs (struct link_map **maps, unsigned int nmaps,
+-		   bool force_first __attribute__ ((unused)), bool for_fini)
++		   bool force_first, bool for_fini)
+ {
++  struct link_map *first_map = maps[0];
+   for (int i = nmaps - 1; i >= 0; i--)
+     maps[i]->l_visited = 0;
+ 
+@@ -208,14 +209,6 @@ _dl_sort_maps_dfs (struct link_map **maps, unsigned int nmaps,
+      Adjusting the order so that maps[0] is last traversed naturally avoids
+      this problem.
+ 
+-     Further, the old "optimization" of skipping the main object at maps[0]
+-     from the call-site (i.e. _dl_sort_maps(maps+1,nmaps-1)) is in general
+-     no longer valid, since traversing along object dependency-links
+-     may "find" the main object even when it is not included in the initial
+-     order (e.g. a dlopen()'ed shared object can have circular dependencies
+-     linked back to itself). In such a case, traversing N-1 objects will
+-     create a N-object result, and raise problems.
+-
+      To summarize, just passing in the full list, and iterating from back
+      to front makes things much more straightforward.  */
+ 
+@@ -274,6 +267,27 @@ _dl_sort_maps_dfs (struct link_map **maps, unsigned int nmaps,
+     }
+ 
+   memcpy (maps, rpo, sizeof (struct link_map *) * nmaps);
++
++  /* Skipping the first object at maps[0] is not valid in general,
++     since traversing along object dependency-links may "find" that
++     first object even when it is not included in the initial order
++     (e.g., a dlopen'ed shared object can have circular dependencies
++     linked back to itself).  In such a case, traversing N-1 objects
++     will create a N-object result, and raise problems.  Instead,
++     force the object back into first place after sorting.  This naive
++     approach may introduce further dependency ordering violations
++     compared to rotating the cycle until the first map is again in
++     the first position, but as there is a cycle, at least one
++     violation is already present.  */
++  if (force_first && maps[0] != first_map)
++    {
++      int i;
++      for (i = 0; maps[i] != first_map; ++i)
++	;
++      assert (i < nmaps);
++      memmove (&maps[1], maps, i * sizeof (maps[0]));
++      maps[0] = first_map;
++    }
+ }
+ 
+ void
+diff --git a/elf/dso-sort-tests-1.def b/elf/dso-sort-tests-1.def
+index 5f7f18ef27..4bf9052db1 100644
+--- a/elf/dso-sort-tests-1.def
++++ b/elf/dso-sort-tests-1.def
+@@ -64,3 +64,10 @@ output: b>a>{}<a<b
+ tst-bz15311: {+a;+e;+f;+g;+d;%d;-d;-g;-f;-e;-a};a->b->c->d;d=>[ba];c=>a;b=>e=>a;c=>f=>b;d=>g=>c
+ output(glibc.rtld.dynamic_sort=1): {+a[d>c>b>a>];+e[e>];+f[f>];+g[g>];+d[];%d(b(e(a()))a()g(c(a()f(b(e(a()))))));-d[];-g[];-f[];-e[];-a[<a<c<d<g<f<b<e];}
+ output(glibc.rtld.dynamic_sort=2): {+a[d>c>b>a>];+e[e>];+f[f>];+g[g>];+d[];%d(b(e(a()))a()g(c(a()f(b(e(a()))))));-d[];-g[];-f[];-e[];-a[<g<f<a<b<c<d<e];}
++
++# Test that even in the presence of dependency loops involving dlopen'ed
++# object, that object is initialized last (and not unloaded prematurely).
++# Final destructor order is indeterminate due to the cycle.
++tst-bz28937: {+a;+b;-b;+c;%c};a->a1;a->a2;a2->a;b->b1;c->a1;c=>a1
++output(glibc.rtld.dynamic_sort=1): {+a[a2>a1>a>];+b[b1>b>];-b[<b<b1];+c[c>];%c(a1());}<a<a2<c<a1
++output(glibc.rtld.dynamic_sort=2): {+a[a2>a1>a>];+b[b1>b>];-b[<b<b1];+c[c>];%c(a1());}<a2<a<c<a1
+-- 
+2.38.1
+
+
+From 52c037f3574eb9062b111d78a4cbeb79681d07d3 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 20 Sep 2022 12:12:43 +0200
+Subject: [PATCH 43/72] gconv: Use 64-bit interfaces in gconv_parseconfdir (bug
+ 29583)
+
+It's possible that inode numbers are outside the 32-bit range.
+The existing code only handles the in-libc case correctly, and
+still uses the legacy interfaces when building iconv.
+
+Suggested-by: Helge Deller <deller@gmx.de>
+(cherry picked from commit f97905f24631097af325d6a231093071c3077a5f)
+---
+ NEWS                       |  1 +
+ iconv/gconv_parseconfdir.h | 16 ++++++++--------
+ 2 files changed, 9 insertions(+), 8 deletions(-)
+
+diff --git a/NEWS b/NEWS
+index 5b4753416f..eab882987b 100644
+--- a/NEWS
++++ b/NEWS
+@@ -26,6 +26,7 @@ The following bugs are resolved with this release:
+   [29490] alpha: New __brk_call implementation is broken
+   [29528] elf: Call __libc_early_init for reused namespaces
+   [29539] libc: LD_TRACE_LOADED_OBJECTS changed how vDSO library are
++  [29583] Use 64-bit interfaces in gconv_parseconfdir
+ \f
+ Version 2.36
+ 
+diff --git a/iconv/gconv_parseconfdir.h b/iconv/gconv_parseconfdir.h
+index debb96b322..b72933b526 100644
+--- a/iconv/gconv_parseconfdir.h
++++ b/iconv/gconv_parseconfdir.h
+@@ -29,14 +29,14 @@
+ # define isspace(__c) __isspace_l ((__c), _nl_C_locobj_ptr)
+ # define asprintf __asprintf
+ # define opendir __opendir
+-# define readdir __readdir
++# define readdir64 __readdir64
+ # define closedir __closedir
+ # define mempcpy __mempcpy
+-# define struct_stat struct __stat64_t64
+-# define lstat __lstat64_time64
++# define struct_stat64 struct __stat64_t64
++# define lstat64 __lstat64_time64
+ # define feof_unlocked __feof_unlocked
+ #else
+-# define struct_stat struct stat
++# define struct_stat64 struct stat64
+ #endif
+ 
+ /* Name of the file containing the module information in the directories
+@@ -148,8 +148,8 @@ gconv_parseconfdir (const char *prefix, const char *dir, size_t dir_len)
+   DIR *confdir = opendir (buf);
+   if (confdir != NULL)
+     {
+-      struct dirent *ent;
+-      while ((ent = readdir (confdir)) != NULL)
++      struct dirent64 *ent;
++      while ((ent = readdir64 (confdir)) != NULL)
+ 	{
+ 	  if (ent->d_type != DT_REG && ent->d_type != DT_UNKNOWN)
+ 	    continue;
+@@ -161,12 +161,12 @@ gconv_parseconfdir (const char *prefix, const char *dir, size_t dir_len)
+ 	      && strcmp (ent->d_name + len - strlen (suffix), suffix) == 0)
+ 	    {
+ 	      char *conf;
+-	      struct_stat st;
++	      struct_stat64 st;
+ 	      if (asprintf (&conf, "%s/%s", buf, ent->d_name) < 0)
+ 		continue;
+ 
+ 	      if (ent->d_type != DT_UNKNOWN
+-		  || (lstat (conf, &st) != -1 && S_ISREG (st.st_mode)))
++		  || (lstat64 (conf, &st) != -1 && S_ISREG (st.st_mode)))
+ 		found |= read_conf_file (conf, dir, dir_len);
+ 
+ 	      free (conf);
+-- 
+2.38.1
+
+
+From 2628500f5dff1dd99c49a09b418b3b1ea3a6b5d3 Mon Sep 17 00:00:00 2001
+From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Tue, 30 Aug 2022 10:33:15 -0300
+Subject: [PATCH 44/72] m68k: Enforce 4-byte alignment on internal locks (BZ
+ #29537)
+
+A new internal definition, __LIBC_LOCK_ALIGNMENT, is used to force
+the 4-byte alignment only for m68k, other architecture keep the
+natural alignment of the type used internally (and hppa does not
+require 16-byte alignment for kernel-assisted CAS).
+
+Reviewed-by: Florian Weimer <fweimer@redhat.com>
+(cherry picked from commit aeb4d2e9815d459e2640a31f5abb8ef803830107)
+---
+ NEWS                                          |  1 +
+ sysdeps/generic/libc-lock-arch.h              | 25 +++++++++++++++++++
+ sysdeps/nptl/libc-lock.h                      |  8 +++++-
+ sysdeps/nptl/libc-lockP.h                     |  3 ++-
+ sysdeps/unix/sysv/linux/m68k/libc-lock-arch.h | 25 +++++++++++++++++++
+ 5 files changed, 60 insertions(+), 2 deletions(-)
+ create mode 100644 sysdeps/generic/libc-lock-arch.h
+ create mode 100644 sysdeps/unix/sysv/linux/m68k/libc-lock-arch.h
+
+diff --git a/NEWS b/NEWS
+index eab882987b..1cc9a16bbf 100644
+--- a/NEWS
++++ b/NEWS
+@@ -25,6 +25,7 @@ The following bugs are resolved with this release:
+   [29485] Linux: Terminate subprocess on late failure in tst-pidfd
+   [29490] alpha: New __brk_call implementation is broken
+   [29528] elf: Call __libc_early_init for reused namespaces
++  [29537] libc: [2.34 regression]: Alignment issue on m68k when using
+   [29539] libc: LD_TRACE_LOADED_OBJECTS changed how vDSO library are
+   [29583] Use 64-bit interfaces in gconv_parseconfdir
+ \f
+diff --git a/sysdeps/generic/libc-lock-arch.h b/sysdeps/generic/libc-lock-arch.h
+new file mode 100644
+index 0000000000..4713b30a8a
+--- /dev/null
++++ b/sysdeps/generic/libc-lock-arch.h
+@@ -0,0 +1,25 @@
++/* Private libc-internal arch-specific definitions.  Generic version.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public License as
++   published by the Free Software Foundation; either version 2.1 of the
++   License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; see the file COPYING.LIB.  If
++   not, see <https://www.gnu.org/licenses/>.  */
++
++#ifndef _LIBC_LOCK_ARCH_H
++#define _LIBC_LOCK_ARCH_H
++
++/* The default definition uses the natural alignment from the lock type.  */
++#define __LIBC_LOCK_ALIGNMENT
++
++#endif
+diff --git a/sysdeps/nptl/libc-lock.h b/sysdeps/nptl/libc-lock.h
+index 5af476c48b..63b3f3d75c 100644
+--- a/sysdeps/nptl/libc-lock.h
++++ b/sysdeps/nptl/libc-lock.h
+@@ -22,6 +22,7 @@
+ #include <pthread.h>
+ #define __need_NULL
+ #include <stddef.h>
++#include <libc-lock-arch.h>
+ 
+ 
+ /* Mutex type.  */
+@@ -29,7 +30,12 @@
+ # if (!IS_IN (libc) && !IS_IN (libpthread)) || !defined _LIBC
+ typedef struct { pthread_mutex_t mutex; } __libc_lock_recursive_t;
+ # else
+-typedef struct { int lock; int cnt; void *owner; } __libc_lock_recursive_t;
++typedef struct
++{
++  int lock __LIBC_LOCK_ALIGNMENT;
++  int cnt;
++  void *owner;
++} __libc_lock_recursive_t;
+ # endif
+ #else
+ typedef struct __libc_lock_recursive_opaque__ __libc_lock_recursive_t;
+diff --git a/sysdeps/nptl/libc-lockP.h b/sysdeps/nptl/libc-lockP.h
+index d3a6837fd2..425f514c5c 100644
+--- a/sysdeps/nptl/libc-lockP.h
++++ b/sysdeps/nptl/libc-lockP.h
+@@ -32,9 +32,10 @@
+    ld.so might be used on old kernels with a different libc.so.  */
+ #include <lowlevellock.h>
+ #include <tls.h>
++#include <libc-lock-arch.h>
+ 
+ /* Mutex type.  */
+-typedef int __libc_lock_t;
++typedef int __libc_lock_t __LIBC_LOCK_ALIGNMENT;
+ typedef struct { pthread_mutex_t mutex; } __rtld_lock_recursive_t;
+ typedef pthread_rwlock_t __libc_rwlock_t;
+ 
+diff --git a/sysdeps/unix/sysv/linux/m68k/libc-lock-arch.h b/sysdeps/unix/sysv/linux/m68k/libc-lock-arch.h
+new file mode 100644
+index 0000000000..1844bbaf6f
+--- /dev/null
++++ b/sysdeps/unix/sysv/linux/m68k/libc-lock-arch.h
+@@ -0,0 +1,25 @@
++/* Private libc-internal arch-specific definitions.  m68k version.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public License as
++   published by the Free Software Foundation; either version 2.1 of the
++   License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; see the file COPYING.LIB.  If
++   not, see <https://www.gnu.org/licenses/>.  */
++
++#ifndef _LIBC_LOCK_ARCH_H
++#define _LIBC_LOCK_ARCH_H
++
++/* Linux enforces 4-bytes alignment on futex inputs.  */
++#define __LIBC_LOCK_ALIGNMENT __attribute__ ((__aligned__ (4)))
++
++#endif
+-- 
+2.38.1
+
+
+From 227c9035872fc9e9e2cf56ec8f89219747ee19bc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?J=C3=B6rg=20Sonnenberger?= <joerg@bec.de>
+Date: Mon, 26 Sep 2022 13:59:16 -0400
+Subject: [PATCH 45/72] get_nscd_addresses: Fix subscript typos [BZ #29605]
+
+Fix the subscript on air->family, which was accidentally set to COUNT
+when it should have remained as I.
+
+Resolves: BZ #29605
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit c9226c03da0276593a0918eaa9a14835183343e8)
+---
+ sysdeps/posix/getaddrinfo.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
+index bcff909b2f..5cda9bb072 100644
+--- a/sysdeps/posix/getaddrinfo.c
++++ b/sysdeps/posix/getaddrinfo.c
+@@ -540,11 +540,11 @@ get_nscd_addresses (const char *name, const struct addrinfo *req,
+ 	  at[count].addr[2] = htonl (0xffff);
+ 	}
+       else if (req->ai_family == AF_UNSPEC
+-	       || air->family[count] == req->ai_family)
++	       || air->family[i] == req->ai_family)
+ 	{
+-	  at[count].family = air->family[count];
++	  at[count].family = air->family[i];
+ 	  memcpy (at[count].addr, addrs, size);
+-	  if (air->family[count] == AF_INET6)
++	  if (air->family[i] == AF_INET6)
+ 	    res->got_ipv6 = true;
+ 	}
+       at[count].next = at + count + 1;
+-- 
+2.38.1
+
+
+From 76e05613ee28f4ac4a0ab97effc32e0e78e37a56 Mon Sep 17 00:00:00 2001
+From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Thu, 29 Sep 2022 16:15:20 -0300
+Subject: [PATCH 46/72] stdlib: Fix __getrandom_nocancel type and arc4random
+ usage (BZ #29638)
+
+Using an unsigned type prevents the fallback to be used if kernel
+does not support getrandom syscall.
+
+Checked on x86_64-linux-gnu.
+
+Reviewed-by: Wilco Dijkstra  <Wilco.Dijkstra@arm.com>
+(cherry picked from commit 13db9ee2cb3b77e25f852be7d6952882e1be6f00)
+---
+ NEWS                                 | 1 +
+ stdlib/arc4random.c                  | 2 +-
+ sysdeps/unix/sysv/linux/not-cancel.h | 2 +-
+ 3 files changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/NEWS b/NEWS
+index 1cc9a16bbf..91bcfeb7a6 100644
+--- a/NEWS
++++ b/NEWS
+@@ -28,6 +28,7 @@ The following bugs are resolved with this release:
+   [29537] libc: [2.34 regression]: Alignment issue on m68k when using
+   [29539] libc: LD_TRACE_LOADED_OBJECTS changed how vDSO library are
+   [29583] Use 64-bit interfaces in gconv_parseconfdir
++  [29638] libc: stdlib: arc4random fallback is never used
+ \f
+ Version 2.36
+ 
+diff --git a/stdlib/arc4random.c b/stdlib/arc4random.c
+index e417ef624d..960a38f295 100644
+--- a/stdlib/arc4random.c
++++ b/stdlib/arc4random.c
+@@ -34,7 +34,7 @@ void
+ __arc4random_buf (void *p, size_t n)
+ {
+   static int seen_initialized;
+-  size_t l;
++  ssize_t l;
+   int fd;
+ 
+   if (n == 0)
+diff --git a/sysdeps/unix/sysv/linux/not-cancel.h b/sysdeps/unix/sysv/linux/not-cancel.h
+index a263d294b1..cf35c8bfc9 100644
+--- a/sysdeps/unix/sysv/linux/not-cancel.h
++++ b/sysdeps/unix/sysv/linux/not-cancel.h
+@@ -68,7 +68,7 @@ __writev_nocancel_nostatus (int fd, const struct iovec *iov, int iovcnt)
+   INTERNAL_SYSCALL_CALL (writev, fd, iov, iovcnt);
+ }
+ 
+-static inline int
++static inline ssize_t
+ __getrandom_nocancel (void *buf, size_t buflen, unsigned int flags)
+ {
+   return INLINE_SYSCALL_CALL (getrandom, buf, buflen, flags);
+-- 
+2.38.1
+
+
+From d1d8379bff34f02f86f82db2cef5bf66746d3560 Mon Sep 17 00:00:00 2001
+From: John David Anglin <danglin@gcc.gnu.org>
+Date: Sat, 1 Oct 2022 19:49:25 +0000
+Subject: [PATCH 47/72] hppa: Fix initialization of dp register [BZ 29635]
+
+After upgrading glibc to Debian 2.35-1, gdb faulted on
+startup and dropped core in a function call in the main
+application.  This was caused by not initializing the
+global dp register for the main application early enough.
+
+Restore the code to initialize dp in _dl_start_user.
+It was removed when code was added to initialize dp in
+elf_machine_runtime_setup.
+
+Signed-off-by: John David Anglin <dave.anglin@bell.net>
+---
+ sysdeps/hppa/dl-machine.h | 24 +++++++++++++++++++-----
+ 1 file changed, 19 insertions(+), 5 deletions(-)
+
+diff --git a/sysdeps/hppa/dl-machine.h b/sysdeps/hppa/dl-machine.h
+index c865713be1..1d51948566 100644
+--- a/sysdeps/hppa/dl-machine.h
++++ b/sysdeps/hppa/dl-machine.h
+@@ -347,6 +347,16 @@ elf_machine_runtime_setup (struct link_map *l, struct r_scope_elem *scope[],
+    its return value is the user program's entry point.  */
+ 
+ #define RTLD_START \
++/* Set up dp for any non-PIC lib constructors that may be called.  */	\
++static struct link_map * __attribute__((used))				\
++set_dp (struct link_map *map)						\
++{									\
++  register Elf32_Addr dp asm ("%r27");					\
++  dp = D_PTR (map, l_info[DT_PLTGOT]);					\
++  asm volatile ("" : : "r" (dp));					\
++  return map;								\
++}									\
++									\
+ asm (									\
+ "	.text\n"							\
+ "	.globl _start\n"						\
+@@ -426,6 +436,13 @@ asm (									\
+ 	   direct loader invocation.  Thus, argc and argv must be	\
+ 	   reloaded from from _dl_argc and _dl_argv.  */		\
+ 									\
++	/* Load main_map from _rtld_local and setup dp. */		\
++"	addil	LT'_rtld_local,%r19\n"					\
++"	ldw	RT'_rtld_local(%r1),%r26\n"				\
++"	bl	set_dp, %r2\n"						\
++"	ldw	0(%r26),%r26\n"						\
++"	copy	%ret0,%r26\n"						\
++									\
+ 	/* Load argc from _dl_argc.  */					\
+ "	addil	LT'_dl_argc,%r19\n"					\
+ "	ldw	RT'_dl_argc(%r1),%r20\n"				\
+@@ -438,13 +455,10 @@ asm (									\
+ "	ldw	0(%r20),%r24\n"						\
+ "	stw	%r24,-44(%sp)\n"					\
+ 									\
+-	/* Call _dl_init(main_map, argc, argv, envp). */		\
+-"	addil	LT'_rtld_local,%r19\n"					\
+-"	ldw	RT'_rtld_local(%r1),%r26\n"				\
+-"	ldw	0(%r26),%r26\n"						\
+-									\
+ 	/* envp = argv + argc + 1 */					\
+ "	sh2add	%r25,%r24,%r23\n"					\
++									\
++	/* Call _dl_init(main_map, argc, argv, envp). */		\
+ "	bl	_dl_init,%r2\n"						\
+ "	ldo	4(%r23),%r23\n"	/* delay slot */			\
+ 									\
+-- 
+2.38.1
+
+
+From cdc496eb55e30f8f2461bedb0a7381c0a7a3d3ae Mon Sep 17 00:00:00 2001
+From: John David Anglin <danglin@gcc.gnu.org>
+Date: Tue, 20 Sep 2022 20:14:14 +0000
+Subject: [PATCH 48/72] hppa: undef __ASSUME_SET_ROBUST_LIST
+
+QEMU does not support support set_robust_list. Thus, we need
+to enable detection of set_robust_list system call.
+
+Signed-off-by: John David Anglin <dave.anglin@bell.net>
+---
+ sysdeps/unix/sysv/linux/hppa/kernel-features.h | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/sysdeps/unix/sysv/linux/hppa/kernel-features.h b/sysdeps/unix/sysv/linux/hppa/kernel-features.h
+index 0cd21ef0fa..079612e4aa 100644
+--- a/sysdeps/unix/sysv/linux/hppa/kernel-features.h
++++ b/sysdeps/unix/sysv/linux/hppa/kernel-features.h
+@@ -30,3 +30,6 @@
+ 
+ #undef __ASSUME_CLONE_DEFAULT
+ #define __ASSUME_CLONE_BACKWARDS 1
++
++/* QEMU does not support set_robust_list.  */
++#undef __ASSUME_SET_ROBUST_LIST
+-- 
+2.38.1
+
+
+From 18bec23cbb4d530a2a8ce95353770661fabcd55f Mon Sep 17 00:00:00 2001
+From: Aurelien Jarno <aurelien@aurel32.net>
+Date: Mon, 3 Oct 2022 23:46:11 +0200
+Subject: [PATCH 49/72] x86: include BMI1 and BMI2 in x86-64-v3 level
+
+The "System V Application Binary Interface AMD64 Architecture Processor
+Supplement" mandates the BMI1 and BMI2 CPU features for the x86-64-v3
+level.
+
+Reviewed-by: Noah Goldstein  <goldstein.w.n@gmail.com>
+(cherry picked from commit b80f16adbd979831bf25ea491e1261e81885c2b6)
+---
+ sysdeps/x86/get-isa-level.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/sysdeps/x86/get-isa-level.h b/sysdeps/x86/get-isa-level.h
+index 1ade78ab73..5b4dd5f062 100644
+--- a/sysdeps/x86/get-isa-level.h
++++ b/sysdeps/x86/get-isa-level.h
+@@ -47,6 +47,8 @@ get_isa_level (const struct cpu_features *cpu_features)
+ 	  isa_level |= GNU_PROPERTY_X86_ISA_1_V2;
+ 	  if (CPU_FEATURE_USABLE_P (cpu_features, AVX)
+ 	      && CPU_FEATURE_USABLE_P (cpu_features, AVX2)
++	      && CPU_FEATURE_USABLE_P (cpu_features, BMI1)
++	      && CPU_FEATURE_USABLE_P (cpu_features, BMI2)
+ 	      && CPU_FEATURE_USABLE_P (cpu_features, F16C)
+ 	      && CPU_FEATURE_USABLE_P (cpu_features, FMA)
+ 	      && CPU_FEATURE_USABLE_P (cpu_features, LZCNT)
+-- 
+2.38.1
+
+
+From 46479e5d10ed87825aa277da158d6a687974518b Mon Sep 17 00:00:00 2001
+From: Aurelien Jarno <aurelien@aurel32.net>
+Date: Mon, 3 Oct 2022 23:46:11 +0200
+Subject: [PATCH 50/72] x86-64: Require BMI2 for AVX2 str(n)casecmp
+ implementations
+
+The AVX2 str(n)casecmp implementations use the 'bzhi' instruction, which
+belongs to the BMI2 CPU feature.
+
+NB: It also uses the 'tzcnt' BMI1 instruction, but it is executed as BSF
+as BSF if the CPU doesn't support TZCNT, and produces the same result
+for non-zero input.
+
+Partially fixes: b77b06e0e296 ("x86: Optimize strcmp-avx2.S")
+Partially resolves: BZ #29611
+
+Reviewed-by: Noah Goldstein  <goldstein.w.n@gmail.com>
+(cherry picked from commit 10f79d3670b036925da63dc532b122d27ce65ff8)
+---
+ sysdeps/x86_64/multiarch/ifunc-impl-list.c  | 28 +++++++++++++++------
+ sysdeps/x86_64/multiarch/ifunc-strcasecmp.h |  1 +
+ 2 files changed, 21 insertions(+), 8 deletions(-)
+
+diff --git a/sysdeps/x86_64/multiarch/ifunc-impl-list.c b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
+index a71444eccb..d208fae4bf 100644
+--- a/sysdeps/x86_64/multiarch/ifunc-impl-list.c
++++ b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
+@@ -448,13 +448,16 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
+   IFUNC_IMPL (i, name, strcasecmp,
+ 	      X86_IFUNC_IMPL_ADD_V4 (array, i, strcasecmp,
+ 				     (CPU_FEATURE_USABLE (AVX512VL)
+-				      && CPU_FEATURE_USABLE (AVX512BW)),
++				      && CPU_FEATURE_USABLE (AVX512BW)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __strcasecmp_evex)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, strcasecmp,
+-				     CPU_FEATURE_USABLE (AVX2),
++				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __strcasecmp_avx2)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, strcasecmp,
+ 				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)
+ 				      && CPU_FEATURE_USABLE (RTM)),
+ 				     __strcasecmp_avx2_rtm)
+ 	      X86_IFUNC_IMPL_ADD_V2 (array, i, strcasecmp,
+@@ -470,13 +473,16 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
+   IFUNC_IMPL (i, name, strcasecmp_l,
+ 	      X86_IFUNC_IMPL_ADD_V4 (array, i, strcasecmp,
+ 				     (CPU_FEATURE_USABLE (AVX512VL)
+-				      && CPU_FEATURE_USABLE (AVX512BW)),
++				      && CPU_FEATURE_USABLE (AVX512BW)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __strcasecmp_l_evex)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, strcasecmp,
+-				     CPU_FEATURE_USABLE (AVX2),
++				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __strcasecmp_l_avx2)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, strcasecmp,
+ 				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)
+ 				      && CPU_FEATURE_USABLE (RTM)),
+ 				     __strcasecmp_l_avx2_rtm)
+ 	      X86_IFUNC_IMPL_ADD_V2 (array, i, strcasecmp_l,
+@@ -638,13 +644,16 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
+   IFUNC_IMPL (i, name, strncasecmp,
+ 	      X86_IFUNC_IMPL_ADD_V4 (array, i, strncasecmp,
+ 				     (CPU_FEATURE_USABLE (AVX512VL)
+-				      && CPU_FEATURE_USABLE (AVX512BW)),
++				      && CPU_FEATURE_USABLE (AVX512BW)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __strncasecmp_evex)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, strncasecmp,
+-				     CPU_FEATURE_USABLE (AVX2),
++				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __strncasecmp_avx2)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, strncasecmp,
+ 				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)
+ 				      && CPU_FEATURE_USABLE (RTM)),
+ 				     __strncasecmp_avx2_rtm)
+ 	      X86_IFUNC_IMPL_ADD_V2 (array, i, strncasecmp,
+@@ -660,13 +669,16 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
+   IFUNC_IMPL (i, name, strncasecmp_l,
+ 	      X86_IFUNC_IMPL_ADD_V4 (array, i, strncasecmp,
+ 				     (CPU_FEATURE_USABLE (AVX512VL)
+-				      && CPU_FEATURE_USABLE (AVX512BW)),
++				      & CPU_FEATURE_USABLE (AVX512BW)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __strncasecmp_l_evex)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, strncasecmp,
+-				     CPU_FEATURE_USABLE (AVX2),
++				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __strncasecmp_l_avx2)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, strncasecmp,
+ 				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)
+ 				      && CPU_FEATURE_USABLE (RTM)),
+ 				     __strncasecmp_l_avx2_rtm)
+ 	      X86_IFUNC_IMPL_ADD_V2 (array, i, strncasecmp_l,
+diff --git a/sysdeps/x86_64/multiarch/ifunc-strcasecmp.h b/sysdeps/x86_64/multiarch/ifunc-strcasecmp.h
+index 68646ef199..7622af259c 100644
+--- a/sysdeps/x86_64/multiarch/ifunc-strcasecmp.h
++++ b/sysdeps/x86_64/multiarch/ifunc-strcasecmp.h
+@@ -34,6 +34,7 @@ IFUNC_SELECTOR (void)
+   const struct cpu_features *cpu_features = __get_cpu_features ();
+ 
+   if (X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, AVX2)
++      && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, BMI2)
+       && X86_ISA_CPU_FEATURES_ARCH_P (cpu_features,
+ 				      AVX_Fast_Unaligned_Load, ))
+     {
+-- 
+2.38.1
+
+
+From 7afbd1e56acb721031bffd876f275dcb1af7e530 Mon Sep 17 00:00:00 2001
+From: Aurelien Jarno <aurelien@aurel32.net>
+Date: Mon, 3 Oct 2022 23:46:11 +0200
+Subject: [PATCH 51/72] x86-64: Require BMI2 for AVX2 strcmp implementation
+
+The AVX2 strcmp implementation uses the 'bzhi' instruction, which
+belongs to the BMI2 CPU feature.
+
+NB: It also uses the 'tzcnt' BMI1 instruction, but it is executed as BSF
+as BSF if the CPU doesn't support TZCNT, and produces the same result
+for non-zero input.
+
+Partially fixes: b77b06e0e296 ("x86: Optimize strcmp-avx2.S")
+Partially resolves: BZ #29611
+
+Reviewed-by: Noah Goldstein  <goldstein.w.n@gmail.com>
+(cherry picked from commit 4d64c6445735e9b34e2ac8e369312cbfc2f88e17)
+---
+ sysdeps/x86_64/multiarch/ifunc-impl-list.c | 4 +++-
+ sysdeps/x86_64/multiarch/strcmp.c          | 4 ++--
+ 2 files changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/sysdeps/x86_64/multiarch/ifunc-impl-list.c b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
+index d208fae4bf..a42b0a4620 100644
+--- a/sysdeps/x86_64/multiarch/ifunc-impl-list.c
++++ b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
+@@ -591,10 +591,12 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
+ 				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __strcmp_evex)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, strcmp,
+-				     CPU_FEATURE_USABLE (AVX2),
++				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __strcmp_avx2)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, strcmp,
+ 				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)
+ 				      && CPU_FEATURE_USABLE (RTM)),
+ 				     __strcmp_avx2_rtm)
+ 	      X86_IFUNC_IMPL_ADD_V2 (array, i, strcmp,
+diff --git a/sysdeps/x86_64/multiarch/strcmp.c b/sysdeps/x86_64/multiarch/strcmp.c
+index fdd5afe3af..9d6c9f66ba 100644
+--- a/sysdeps/x86_64/multiarch/strcmp.c
++++ b/sysdeps/x86_64/multiarch/strcmp.c
+@@ -45,12 +45,12 @@ IFUNC_SELECTOR (void)
+   const struct cpu_features *cpu_features = __get_cpu_features ();
+ 
+   if (X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, AVX2)
++      && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, BMI2)
+       && X86_ISA_CPU_FEATURES_ARCH_P (cpu_features,
+ 				      AVX_Fast_Unaligned_Load, ))
+     {
+       if (X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, AVX512VL)
+-	  && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, AVX512BW)
+-	  && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, BMI2))
++	  && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, AVX512BW))
+ 	return OPTIMIZE (evex);
+ 
+       if (CPU_FEATURE_USABLE_P (cpu_features, RTM))
+-- 
+2.38.1
+
+
+From 29c577e0f54fe6e70ceacb3659179781c5569903 Mon Sep 17 00:00:00 2001
+From: Aurelien Jarno <aurelien@aurel32.net>
+Date: Mon, 3 Oct 2022 23:46:11 +0200
+Subject: [PATCH 52/72] x86-64: Require BMI2 for AVX2 strncmp implementation
+
+The AVX2 strncmp implementations uses the 'bzhi' instruction, which
+belongs to the BMI2 CPU feature.
+
+NB: It also uses the 'tzcnt' BMI1 instruction, but it is executed as BSF
+as BSF if the CPU doesn't support TZCNT, and produces the same result
+for non-zero input.
+
+Partially fixes: b77b06e0e296 ("x86: Optimize strcmp-avx2.S")
+Partially resolves: BZ #29611
+
+Reviewed-by: Noah Goldstein  <goldstein.w.n@gmail.com>
+(cherry picked from commit fc7de1d9b99ae1676bc626ddca422d7abee0eb48)
+---
+ sysdeps/x86_64/multiarch/ifunc-impl-list.c | 7 +++++--
+ sysdeps/x86_64/multiarch/strncmp.c         | 4 ++--
+ 2 files changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/sysdeps/x86_64/multiarch/ifunc-impl-list.c b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
+index a42b0a4620..aebef3daaf 100644
+--- a/sysdeps/x86_64/multiarch/ifunc-impl-list.c
++++ b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
+@@ -1176,13 +1176,16 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
+   IFUNC_IMPL (i, name, strncmp,
+ 	      X86_IFUNC_IMPL_ADD_V4 (array, i, strncmp,
+ 				     (CPU_FEATURE_USABLE (AVX512VL)
+-				      && CPU_FEATURE_USABLE (AVX512BW)),
++				      && CPU_FEATURE_USABLE (AVX512BW)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __strncmp_evex)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, strncmp,
+-				     CPU_FEATURE_USABLE (AVX2),
++				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __strncmp_avx2)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, strncmp,
+ 				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)
+ 				      && CPU_FEATURE_USABLE (RTM)),
+ 				     __strncmp_avx2_rtm)
+ 	      X86_IFUNC_IMPL_ADD_V2 (array, i, strncmp,
+diff --git a/sysdeps/x86_64/multiarch/strncmp.c b/sysdeps/x86_64/multiarch/strncmp.c
+index 4ebe4bde30..c4f8b6bbb5 100644
+--- a/sysdeps/x86_64/multiarch/strncmp.c
++++ b/sysdeps/x86_64/multiarch/strncmp.c
+@@ -41,12 +41,12 @@ IFUNC_SELECTOR (void)
+   const struct cpu_features *cpu_features = __get_cpu_features ();
+ 
+   if (X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, AVX2)
++      && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, BMI2)
+       && X86_ISA_CPU_FEATURES_ARCH_P (cpu_features,
+ 				      AVX_Fast_Unaligned_Load, ))
+     {
+       if (X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, AVX512VL)
+-	  && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, AVX512BW)
+-	  && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, BMI2))
++	  && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, AVX512BW))
+ 	return OPTIMIZE (evex);
+ 
+       if (CPU_FEATURE_USABLE_P (cpu_features, RTM))
+-- 
+2.38.1
+
+
+From d8bf4388df679fa5a3ae7889a649e573e3124530 Mon Sep 17 00:00:00 2001
+From: Aurelien Jarno <aurelien@aurel32.net>
+Date: Mon, 3 Oct 2022 23:46:11 +0200
+Subject: [PATCH 53/72] x86-64: Require BMI2 for AVX2 wcs(n)cmp implementations
+
+The AVX2 wcs(n)cmp implementations use the 'bzhi' instruction, which
+belongs to the BMI2 CPU feature.
+
+NB: It also uses the 'tzcnt' BMI1 instruction, but it is executed as BSF
+as BSF if the CPU doesn't support TZCNT, and produces the same result
+for non-zero input.
+
+Partially fixes: b77b06e0e296 ("x86: Optimize strcmp-avx2.S")
+Partially resolves: BZ #29611
+
+Reviewed-by: Noah Goldstein  <goldstein.w.n@gmail.com>
+(cherry picked from commit f31a5a884ed84bd37032729d4d1eb9d06c9f3c29)
+---
+ sysdeps/x86_64/multiarch/ifunc-impl-list.c | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/sysdeps/x86_64/multiarch/ifunc-impl-list.c b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
+index aebef3daaf..fec8790c11 100644
+--- a/sysdeps/x86_64/multiarch/ifunc-impl-list.c
++++ b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
+@@ -810,10 +810,12 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
+ 				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __wcscmp_evex)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, wcscmp,
+-				     CPU_FEATURE_USABLE (AVX2),
++				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __wcscmp_avx2)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, wcscmp,
+ 				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)
+ 				      && CPU_FEATURE_USABLE (RTM)),
+ 				     __wcscmp_avx2_rtm)
+ 	      /* ISA V2 wrapper for SSE2 implementation because the SSE2
+@@ -830,10 +832,12 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
+ 				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __wcsncmp_evex)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, wcsncmp,
+-				     CPU_FEATURE_USABLE (AVX2),
++				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __wcsncmp_avx2)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, wcsncmp,
+ 				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)
+ 				      && CPU_FEATURE_USABLE (RTM)),
+ 				     __wcsncmp_avx2_rtm)
+ 	      /* ISA V2 wrapper for GENERIC implementation because the
+-- 
+2.38.1
+
+
+From d9196d4f3fa9997388655813ddd236426a16dd92 Mon Sep 17 00:00:00 2001
+From: Aurelien Jarno <aurelien@aurel32.net>
+Date: Mon, 3 Oct 2022 23:46:11 +0200
+Subject: [PATCH 54/72] x86-64: Require BMI2 for AVX2 (raw|w)memchr
+ implementations
+
+The AVX2 memchr, rawmemchr and wmemchr implementations use the 'bzhi'
+and 'sarx' instructions, which belongs to the BMI2 CPU feature.
+
+Fixes: acfd088a1963 ("x86: Optimize memchr-avx2.S")
+Partially resolves: BZ #29611
+
+Reviewed-by: Noah Goldstein  <goldstein.w.n@gmail.com>
+(cherry picked from commit e3e7fab7fe5186d18ca2046d99ba321c27db30ad)
+---
+ sysdeps/x86_64/multiarch/ifunc-impl-list.c | 12 +++++++++---
+ 1 file changed, 9 insertions(+), 3 deletions(-)
+
+diff --git a/sysdeps/x86_64/multiarch/ifunc-impl-list.c b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
+index fec8790c11..7c84963d92 100644
+--- a/sysdeps/x86_64/multiarch/ifunc-impl-list.c
++++ b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
+@@ -69,10 +69,12 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
+ 				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __memchr_evex_rtm)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, memchr,
+-				     CPU_FEATURE_USABLE (AVX2),
++				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __memchr_avx2)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, memchr,
+ 				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)
+ 				      && CPU_FEATURE_USABLE (RTM)),
+ 				     __memchr_avx2_rtm)
+ 	      /* ISA V2 wrapper for SSE2 implementation because the SSE2
+@@ -335,10 +337,12 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
+ 				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __rawmemchr_evex_rtm)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, rawmemchr,
+-				     CPU_FEATURE_USABLE (AVX2),
++				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __rawmemchr_avx2)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, rawmemchr,
+ 				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)
+ 				      && CPU_FEATURE_USABLE (RTM)),
+ 				     __rawmemchr_avx2_rtm)
+ 	      /* ISA V2 wrapper for SSE2 implementation because the SSE2
+@@ -927,10 +931,12 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
+ 				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __wmemchr_evex_rtm)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, wmemchr,
+-				     CPU_FEATURE_USABLE (AVX2),
++				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __wmemchr_avx2)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, wmemchr,
+ 				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)
+ 				      && CPU_FEATURE_USABLE (RTM)),
+ 				     __wmemchr_avx2_rtm)
+ 	      /* ISA V2 wrapper for SSE2 implementation because the SSE2
+-- 
+2.38.1
+
+
+From 923c3f3c373f499e62160e00831dda576443317b Mon Sep 17 00:00:00 2001
+From: Aurelien Jarno <aurelien@aurel32.net>
+Date: Mon, 3 Oct 2022 23:46:11 +0200
+Subject: [PATCH 55/72] x86-64: Require BMI2 and LZCNT for AVX2 memrchr
+ implementation
+
+The AVX2 memrchr implementation uses the 'shlxl' instruction, which
+belongs to the BMI2 CPU feature and uses the 'lzcnt' instruction, which
+belongs to the LZCNT CPU feature.
+
+Fixes: af5306a735eb ("x86: Optimize memrchr-avx2.S")
+Partially resolves: BZ #29611
+
+Reviewed-by: Noah Goldstein  <goldstein.w.n@gmail.com>
+(cherry picked from commit 3c0c78afabfed4b6fc161c159e628fbf14ff370b)
+---
+ sysdeps/x86/isa-level.h                    |  1 +
+ sysdeps/x86_64/multiarch/ifunc-avx2.h      |  1 +
+ sysdeps/x86_64/multiarch/ifunc-impl-list.c | 10 ++++++++--
+ 3 files changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/sysdeps/x86/isa-level.h b/sysdeps/x86/isa-level.h
+index 3c4480aba7..bbb90f5c5e 100644
+--- a/sysdeps/x86/isa-level.h
++++ b/sysdeps/x86/isa-level.h
+@@ -80,6 +80,7 @@
+ #define AVX_X86_ISA_LEVEL 3
+ #define AVX2_X86_ISA_LEVEL 3
+ #define BMI2_X86_ISA_LEVEL 3
++#define LZCNT_X86_ISA_LEVEL 3
+ #define MOVBE_X86_ISA_LEVEL 3
+ 
+ /* ISA level >= 2 guaranteed includes.  */
+diff --git a/sysdeps/x86_64/multiarch/ifunc-avx2.h b/sysdeps/x86_64/multiarch/ifunc-avx2.h
+index a57a9952f3..f1741083fd 100644
+--- a/sysdeps/x86_64/multiarch/ifunc-avx2.h
++++ b/sysdeps/x86_64/multiarch/ifunc-avx2.h
+@@ -37,6 +37,7 @@ IFUNC_SELECTOR (void)
+ 
+   if (X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, AVX2)
+       && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, BMI2)
++      && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, LZCNT)
+       && X86_ISA_CPU_FEATURES_ARCH_P (cpu_features,
+ 				      AVX_Fast_Unaligned_Load, ))
+     {
+diff --git a/sysdeps/x86_64/multiarch/ifunc-impl-list.c b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
+index 7c84963d92..ec1c5b55fb 100644
+--- a/sysdeps/x86_64/multiarch/ifunc-impl-list.c
++++ b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
+@@ -209,13 +209,19 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
+   IFUNC_IMPL (i, name, memrchr,
+ 	      X86_IFUNC_IMPL_ADD_V4 (array, i, memrchr,
+ 				     (CPU_FEATURE_USABLE (AVX512VL)
+-				      && CPU_FEATURE_USABLE (AVX512BW)),
++				      && CPU_FEATURE_USABLE (AVX512BW)
++				      && CPU_FEATURE_USABLE (BMI2)
++				      && CPU_FEATURE_USABLE (LZCNT)),
+ 				     __memrchr_evex)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, memrchr,
+-				     CPU_FEATURE_USABLE (AVX2),
++				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)
++				      && CPU_FEATURE_USABLE (LZCNT)),
+ 				     __memrchr_avx2)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, memrchr,
+ 				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)
++				      && CPU_FEATURE_USABLE (LZCNT)
+ 				      && CPU_FEATURE_USABLE (RTM)),
+ 				     __memrchr_avx2_rtm)
+ 	      /* ISA V2 wrapper for SSE2 implementation because the SSE2
+-- 
+2.38.1
+
+
+From 2d8ef784bd6a784496a6fd460de6b6f57c70a501 Mon Sep 17 00:00:00 2001
+From: Aurelien Jarno <aurelien@aurel32.net>
+Date: Mon, 3 Oct 2022 23:46:11 +0200
+Subject: [PATCH 56/72] x86-64: Require BMI1/BMI2 for AVX2 strrchr and wcsrchr
+ implementations
+
+The AVX2 strrchr and wcsrchr implementation uses the 'blsmsk'
+instruction which belongs to the BMI1 CPU feature and the 'shrx'
+instruction, which belongs to the BMI2 CPU feature.
+
+Fixes: df7e295d18ff ("x86: Optimize {str|wcs}rchr-avx2")
+Partially resolves: BZ #29611
+
+Reviewed-by: Noah Goldstein  <goldstein.w.n@gmail.com>
+(cherry picked from commit 7e8283170c5d6805b609a040801d819e362a6292)
+---
+ sysdeps/x86/isa-level.h                    |  1 +
+ sysdeps/x86_64/multiarch/ifunc-avx2.h      |  1 +
+ sysdeps/x86_64/multiarch/ifunc-impl-list.c | 17 ++++++++++++++---
+ 3 files changed, 16 insertions(+), 3 deletions(-)
+
+diff --git a/sysdeps/x86/isa-level.h b/sysdeps/x86/isa-level.h
+index bbb90f5c5e..06f6c9663e 100644
+--- a/sysdeps/x86/isa-level.h
++++ b/sysdeps/x86/isa-level.h
+@@ -79,6 +79,7 @@
+ /* ISA level >= 3 guaranteed includes.  */
+ #define AVX_X86_ISA_LEVEL 3
+ #define AVX2_X86_ISA_LEVEL 3
++#define BMI1_X86_ISA_LEVEL 3
+ #define BMI2_X86_ISA_LEVEL 3
+ #define LZCNT_X86_ISA_LEVEL 3
+ #define MOVBE_X86_ISA_LEVEL 3
+diff --git a/sysdeps/x86_64/multiarch/ifunc-avx2.h b/sysdeps/x86_64/multiarch/ifunc-avx2.h
+index f1741083fd..f2f5e8a211 100644
+--- a/sysdeps/x86_64/multiarch/ifunc-avx2.h
++++ b/sysdeps/x86_64/multiarch/ifunc-avx2.h
+@@ -36,6 +36,7 @@ IFUNC_SELECTOR (void)
+   const struct cpu_features *cpu_features = __get_cpu_features ();
+ 
+   if (X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, AVX2)
++      && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, BMI1)
+       && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, BMI2)
+       && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, LZCNT)
+       && X86_ISA_CPU_FEATURES_ARCH_P (cpu_features,
+diff --git a/sysdeps/x86_64/multiarch/ifunc-impl-list.c b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
+index ec1c5b55fb..00a91123d3 100644
+--- a/sysdeps/x86_64/multiarch/ifunc-impl-list.c
++++ b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
+@@ -578,13 +578,19 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
+   IFUNC_IMPL (i, name, strrchr,
+ 	      X86_IFUNC_IMPL_ADD_V4 (array, i, strrchr,
+ 				     (CPU_FEATURE_USABLE (AVX512VL)
+-				      && CPU_FEATURE_USABLE (AVX512BW)),
++				      && CPU_FEATURE_USABLE (AVX512BW)
++				      && CPU_FEATURE_USABLE (BMI1)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __strrchr_evex)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, strrchr,
+-				     CPU_FEATURE_USABLE (AVX2),
++				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI1)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __strrchr_avx2)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, strrchr,
+ 				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI1)
++				      && CPU_FEATURE_USABLE (BMI2)
+ 				      && CPU_FEATURE_USABLE (RTM)),
+ 				     __strrchr_avx2_rtm)
+ 	      /* ISA V2 wrapper for SSE2 implementation because the SSE2
+@@ -797,13 +803,18 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
+ 	      X86_IFUNC_IMPL_ADD_V4 (array, i, wcsrchr,
+ 				     (CPU_FEATURE_USABLE (AVX512VL)
+ 				      && CPU_FEATURE_USABLE (AVX512BW)
++				      && CPU_FEATURE_USABLE (BMI1)
+ 				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __wcsrchr_evex)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, wcsrchr,
+-				     CPU_FEATURE_USABLE (AVX2),
++				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI1)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __wcsrchr_avx2)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, wcsrchr,
+ 				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI1)
++				      && CPU_FEATURE_USABLE (BMI2)
+ 				      && CPU_FEATURE_USABLE (RTM)),
+ 				     __wcsrchr_avx2_rtm)
+ 	      /* ISA V2 wrapper for SSE2 implementation because the SSE2
+-- 
+2.38.1
+
+
+From 2bd815d8347851212b9a91dbdca8053f4dbdac87 Mon Sep 17 00:00:00 2001
+From: Siddhesh Poyarekar <siddhesh@sourceware.org>
+Date: Tue, 4 Oct 2022 18:43:50 -0400
+Subject: [PATCH 57/72] nscd: Drop local address tuple variable [BZ #29607]
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+When a request needs to be resent (e.g. due to insufficient buffer
+space), the references to subsequent tuples in the local variable are
+stale and should not be used.  This used to work by accident before, but
+since 1d495912a it no longer does.  Instead of trying to reset it, just
+let gethostbyname4_r write into TUMPBUF6 for us, thus maintaining a
+consistent state at all times.  This is now consistent with what is done
+in gaih_inet for getaddrinfo.
+
+Resolves: BZ #29607
+Reported-by: Holger Hoffstätte <holger@applied-asynchrony.com>
+Tested-by: Holger Hoffstätte <holger@applied-asynchrony.com>
+Reviewed-by: Carlos O'Donell <carlos@redhat.com>
+(cherry picked from commit 6e33e5c4b73cea7b8aa3de0947123db16200fb65)
+---
+ NEWS           | 2 ++
+ nscd/aicache.c | 5 ++---
+ 2 files changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/NEWS b/NEWS
+index 91bcfeb7a6..63e26d7062 100644
+--- a/NEWS
++++ b/NEWS
+@@ -28,6 +28,8 @@ The following bugs are resolved with this release:
+   [29537] libc: [2.34 regression]: Alignment issue on m68k when using
+   [29539] libc: LD_TRACE_LOADED_OBJECTS changed how vDSO library are
+   [29583] Use 64-bit interfaces in gconv_parseconfdir
++  [29607] nscd repeatably crashes calling __strlen_avx2 when hosts cache is
++    enabled
+   [29638] libc: stdlib: arc4random fallback is never used
+ \f
+ Version 2.36
+diff --git a/nscd/aicache.c b/nscd/aicache.c
+index 51e793199f..e0baed170b 100644
+--- a/nscd/aicache.c
++++ b/nscd/aicache.c
+@@ -110,11 +110,10 @@ addhstaiX (struct database_dyn *db, int fd, request_header *req,
+ 							  "gethostbyname4_r");
+       if (fct4 != NULL)
+ 	{
+-	  struct gaih_addrtuple atmem;
+ 	  struct gaih_addrtuple *at;
+ 	  while (1)
+ 	    {
+-	      at = &atmem;
++	      at = NULL;
+ 	      rc6 = 0;
+ 	      herrno = 0;
+ 	      status[1] = DL_CALL_FCT (fct4, (key, &at,
+@@ -137,7 +136,7 @@ addhstaiX (struct database_dyn *db, int fd, request_header *req,
+ 	    goto next_nip;
+ 
+ 	  /* We found the data.  Count the addresses and the size.  */
+-	  for (const struct gaih_addrtuple *at2 = at = &atmem; at2 != NULL;
++	  for (const struct gaih_addrtuple *at2 = at; at2 != NULL;
+ 	       at2 = at2->next)
+ 	    {
+ 	      ++naddrs;
+-- 
+2.38.1
+
+
+From 3e279192749cfcae4ceebb1f21a3275e677d0561 Mon Sep 17 00:00:00 2001
+From: Michael Hudson-Doyle <michael.hudson@canonical.com>
+Date: Fri, 12 Aug 2022 11:29:31 +1200
+Subject: [PATCH 58/72] Ensure calculations happen with desired rounding mode
+ in y1lf128
+
+math/test-float128-y1 fails on x86_64 and ppc64el with gcc 12 and -O3,
+because code inside a block guarded by SET_RESTORE_ROUNDL is being moved
+after the rounding mode has been restored. Use math_force_eval to
+prevent this (and insert some math_opt_barrier calls to prevent code
+from being moved before the rounding mode is set).
+
+Fixes #29463
+
+Reviewed-By: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
+(cherry picked from commit 2b274fd8c9c776cf70fcdb8356e678ada522a7b0)
+---
+ NEWS                             | 1 +
+ sysdeps/ieee754/ldbl-128/e_j1l.c | 3 +++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/NEWS b/NEWS
+index 63e26d7062..bea1d8a11f 100644
+--- a/NEWS
++++ b/NEWS
+@@ -24,6 +24,7 @@ The following bugs are resolved with this release:
+   [29446] _dlopen now ignores dl_caller argument in static mode
+   [29485] Linux: Terminate subprocess on late failure in tst-pidfd
+   [29490] alpha: New __brk_call implementation is broken
++  [29463] math/test-float128-y1 fails on x86_64
+   [29528] elf: Call __libc_early_init for reused namespaces
+   [29537] libc: [2.34 regression]: Alignment issue on m68k when using
+   [29539] libc: LD_TRACE_LOADED_OBJECTS changed how vDSO library are
+diff --git a/sysdeps/ieee754/ldbl-128/e_j1l.c b/sysdeps/ieee754/ldbl-128/e_j1l.c
+index 54c457681a..9a9c5c6f00 100644
+--- a/sysdeps/ieee754/ldbl-128/e_j1l.c
++++ b/sysdeps/ieee754/ldbl-128/e_j1l.c
+@@ -869,10 +869,13 @@ __ieee754_y1l (_Float128 x)
+     {
+       /* 0 <= x <= 2 */
+       SET_RESTORE_ROUNDL (FE_TONEAREST);
++      xx = math_opt_barrier (xx);
++      x = math_opt_barrier (x);
+       z = xx * xx;
+       p = xx * neval (z, Y0_2N, NY0_2N) / deval (z, Y0_2D, NY0_2D);
+       p = -TWOOPI / xx + p;
+       p = TWOOPI * __ieee754_logl (x) * __ieee754_j1l (x) + p;
++      math_force_eval (p);
+       return p;
+     }
+ 
+-- 
+2.38.1
+
+
+From 700d3281f9e57b53c27bc991394b22d467432626 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 13 Sep 2022 16:10:20 +0200
+Subject: [PATCH 59/72] nss: Implement --no-addrconfig option for getent
+
+The ahosts, ahostsv4, ahostsv6 commands unconditionally pass
+AI_ADDRCONFIG to getaddrinfo, which is not always desired.
+
+Reviewed-by: Carlos O'Donell <carlos@redhat.com>
+(cherry picked from commit a623f13adfac47c8634a7288e08f821a846bc650)
+---
+ NEWS         |  7 +++++++
+ nss/getent.c | 11 ++++++++++-
+ 2 files changed, 17 insertions(+), 1 deletion(-)
+
+diff --git a/NEWS b/NEWS
+index bea1d8a11f..462a12253d 100644
+--- a/NEWS
++++ b/NEWS
+@@ -7,6 +7,13 @@ using `glibc' in the "product" field.
+ \f
+ Version 2.36.1
+ 
++Major new features:
++
++* The getent tool now supports the --no-addrconfig option. The output of
++  getent with --no-addrconfig may contain addresses of families not
++  configured on the current host i.e. as-if you had not passed
++  AI_ADDRCONFIG to getaddrinfo calls.
++
+ Security related changes:
+ 
+   CVE-2022-39046: When the syslog function is passed a crafted input
+diff --git a/nss/getent.c b/nss/getent.c
+index 8178b4b470..d2d2524b0c 100644
+--- a/nss/getent.c
++++ b/nss/getent.c
+@@ -58,6 +58,8 @@ static const struct argp_option args_options[] =
+   {
+     { "service", 's', N_("CONFIG"), 0, N_("Service configuration to be used") },
+     { "no-idn", 'i', NULL, 0, N_("disable IDN encoding") },
++    { "no-addrconfig", 'A', NULL, 0,
++      N_("do not filter out unsupported IPv4/IPv6 addresses (with ahosts*)") },
+     { NULL, 0, NULL, 0, NULL },
+   };
+ 
+@@ -79,6 +81,9 @@ static struct argp argp =
+ /* Additional getaddrinfo flags for IDN encoding.  */
+ static int idn_flags = AI_IDN | AI_CANONIDN;
+ 
++/* Set to 0 by --no-addrconfig.  */
++static int addrconfig_flags = AI_ADDRCONFIG;
++
+ /* Print the version information.  */
+ static void
+ print_version (FILE *stream, struct argp_state *state)
+@@ -346,7 +351,7 @@ ahosts_keys_int (int af, int xflags, int number, char *key[])
+ 
+   struct addrinfo hint;
+   memset (&hint, '\0', sizeof (hint));
+-  hint.ai_flags = (AI_V4MAPPED | AI_ADDRCONFIG | AI_CANONNAME
++  hint.ai_flags = (AI_V4MAPPED | addrconfig_flags | AI_CANONNAME
+ 		   | idn_flags | xflags);
+   hint.ai_family = af;
+ 
+@@ -905,6 +910,10 @@ parse_option (int key, char *arg, struct argp_state *state)
+       idn_flags = 0;
+       break;
+ 
++    case 'A':
++      addrconfig_flags = 0;
++      break;
++
+     default:
+       return ARGP_ERR_UNKNOWN;
+     }
+-- 
+2.38.1
+
+
+From 2681d38cafaceafeb330bc0536fa710b75ed5947 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 13 Sep 2022 16:11:40 +0200
+Subject: [PATCH 60/72] nss: Fix tst-nss-files-hosts-long on single-stack hosts
+ (bug 24816)
+
+getent implicitly passes AI_ADDRCONFIG to getaddrinfo by default.
+Use --no-addrconfig to suppress that, so that both IPv4 and IPv6
+lookups succeed even if the address family is not supported by the
+host.
+
+Reviewed-by: Carlos O'Donell <carlos@redhat.com>
+(cherry picked from commit c75d20b5b27b0a60f0678236f51a4d3b0b058c00)
+---
+ NEWS                           | 1 +
+ nss/tst-nss-files-hosts-long.c | 9 +++++----
+ 2 files changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/NEWS b/NEWS
+index 462a12253d..de775ab116 100644
+--- a/NEWS
++++ b/NEWS
+@@ -24,6 +24,7 @@ Security related changes:
+ The following bugs are resolved with this release:
+ 
+   [12154] Do not fail DNS resolution for CNAMEs which are not host names
++  [24816] Fix tst-nss-files-hosts-long on single-stack hosts
+   [28846] CMSG_NXTHDR may trigger -Wstrict-overflow warning
+   [29305] Conserve NSS buffer space during DNS packet parsing
+   [29415] nscd: Fix netlink cache invalidation if epoll is used
+diff --git a/nss/tst-nss-files-hosts-long.c b/nss/tst-nss-files-hosts-long.c
+index 3942cf5fca..a7697e3143 100644
+--- a/nss/tst-nss-files-hosts-long.c
++++ b/nss/tst-nss-files-hosts-long.c
+@@ -28,14 +28,15 @@ do_test (void)
+ {
+   int ret;
+ 
+-  /* Run getent to fetch the IPv4 address for host test4.
+-     This forces /etc/hosts to be parsed.  */
+-  ret = system("getent ahostsv4 test4");
++  /* Run getent to fetch the IPv4 address for host test4.  This forces
++     /etc/hosts to be parsed.  Use --no-addrconfig to return addresses
++     even in an IPv6-only environment.  */
++  ret = system("getent --no-addrconfig ahostsv4 test4");
+   if (ret != 0)
+     FAIL_EXIT1("ahostsv4 failed");
+ 
+   /* Likewise for IPv6.  */
+-  ret = system("getent ahostsv6 test6");
++  ret = system("getent --no-addrconfig  ahostsv6 test6");
+   if (ret != 0)
+     FAIL_EXIT1("ahostsv6 failed");
+ 
+-- 
+2.38.1
+
+
+From 908454129d21126bf7fc58f2a520b1f304dc5f02 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Fri, 23 Sep 2022 19:30:57 +0200
+Subject: [PATCH 61/72] nss: Use shared prefix in IPv4 address in tst-reload1
+
+Otherwise, sorting based on the longest-matching prefix in
+getaddrinfo can reorder the addresses in ways the test does not
+expect, depending on the IPv4 address of the host.
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit c02e29a0ba47d636281e1a026444a1a0a254aa12)
+---
+ nss/tst-reload1.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/nss/tst-reload1.c b/nss/tst-reload1.c
+index fdc5bdd65b..bc32bb132a 100644
+--- a/nss/tst-reload1.c
++++ b/nss/tst-reload1.c
+@@ -43,12 +43,12 @@ static struct passwd pwd_table_1[] = {
+ 
+ static const char *hostaddr_5[] =
+   {
+-   "ABCD", "abcd", "1234", NULL
++   "ABCd", "ABCD", "ABC4", NULL
+   };
+ 
+ static const char *hostaddr_15[] =
+   {
+-   "4321", "ghij", NULL
++   "4321", "4322", NULL
+   };
+ 
+ static const char *hostaddr_25[] =
+@@ -86,12 +86,12 @@ static const char *hostaddr_6[] =
+ 
+ static const char *hostaddr_16[] =
+   {
+-   "7890", "a1b2", NULL
++   "7890", "7891", NULL
+   };
+ 
+ static const char *hostaddr_26[] =
+   {
+-   "qwer", "tyui", NULL
++   "qwer", "qweR", NULL
+   };
+ 
+ static struct hostent host_table_2[] = {
+-- 
+2.38.1
+
+
+From 19535f3b57306ea3ec559a6c0b10d2d7a87418a7 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Fri, 14 Oct 2022 11:02:25 +0200
+Subject: [PATCH 62/72] elf: Do not completely clear reused namespace in
+ dlmopen (bug 29600)
+
+The data in the _ns_debug member must be preserved, otherwise
+_dl_debug_initialize enters an infinite loop.  To be conservative,
+only clear the libc_map member for now, to fix bug 29528.
+
+Fixes commit d0e357ff45a75553dee3b17ed7d303bfa544f6fe
+("elf: Call __libc_early_init for reused namespaces (bug 29528)"),
+by reverting most of it.
+
+Reviewed-by: Carlos O'Donell <carlos@redhat.com>
+Tested-by: Carlos O'Donell <carlos@redhat.com>
+(cherry picked from commit 2c42257314536b94cc8d52edede86e94e98c1436)
+---
+ NEWS                    |  1 +
+ elf/dl-open.c           | 14 ++++++--------
+ elf/tst-dlmopen-twice.c | 28 ++++++++++++++++++++++++----
+ 3 files changed, 31 insertions(+), 12 deletions(-)
+
+diff --git a/NEWS b/NEWS
+index de775ab116..a6da588c85 100644
+--- a/NEWS
++++ b/NEWS
+@@ -37,6 +37,7 @@ The following bugs are resolved with this release:
+   [29537] libc: [2.34 regression]: Alignment issue on m68k when using
+   [29539] libc: LD_TRACE_LOADED_OBJECTS changed how vDSO library are
+   [29583] Use 64-bit interfaces in gconv_parseconfdir
++  [29600] Do not completely clear reused namespace in dlmopen
+   [29607] nscd repeatably crashes calling __strlen_avx2 when hosts cache is
+     enabled
+   [29638] libc: stdlib: arc4random fallback is never used
+diff --git a/elf/dl-open.c b/elf/dl-open.c
+index 46e8066fd8..e7db5e9642 100644
+--- a/elf/dl-open.c
++++ b/elf/dl-open.c
+@@ -844,15 +844,13 @@ _dl_open (const char *file, int mode, const void *caller_dlopen, Lmid_t nsid,
+ 	  _dl_signal_error (EINVAL, file, NULL, N_("\
+ no more namespaces available for dlmopen()"));
+ 	}
++      else if (nsid == GL(dl_nns))
++	{
++	  __rtld_lock_initialize (GL(dl_ns)[nsid]._ns_unique_sym_table.lock);
++	  ++GL(dl_nns);
++	}
+ 
+-      if (nsid == GL(dl_nns))
+-	++GL(dl_nns);
+-
+-      /* Initialize the new namespace.  Most members are
+-	 zero-initialized, only the lock needs special treatment.  */
+-      memset (&GL(dl_ns)[nsid], 0, sizeof (GL(dl_ns)[nsid]));
+-      __rtld_lock_initialize (GL(dl_ns)[nsid]._ns_unique_sym_table.lock);
+-
++      GL(dl_ns)[nsid].libc_map = NULL;
+       _dl_debug_update (nsid)->r_state = RT_CONSISTENT;
+     }
+   /* Never allow loading a DSO in a namespace which is empty.  Such
+diff --git a/elf/tst-dlmopen-twice.c b/elf/tst-dlmopen-twice.c
+index 449f3c8fa9..70c71fe19c 100644
+--- a/elf/tst-dlmopen-twice.c
++++ b/elf/tst-dlmopen-twice.c
+@@ -16,18 +16,38 @@
+    License along with the GNU C Library; if not, see
+    <https://www.gnu.org/licenses/>.  */
+ 
+-#include <support/xdlfcn.h>
++#include <stdio.h>
+ #include <support/check.h>
++#include <support/xdlfcn.h>
+ 
+-static int
+-do_test (void)
++/* Run the test multiple times, to check finding a new namespace while
++   another namespace is already in use.  This used to trigger bug 29600.  */
++static void
++recurse (int depth)
+ {
+-  void *handle = xdlmopen (LM_ID_NEWLM, "tst-dlmopen-twice-mod1.so", RTLD_NOW);
++  if (depth == 0)
++    return;
++
++  printf ("info: running at depth %d\n", depth);
++  void *handle = xdlmopen (LM_ID_NEWLM, "tst-dlmopen-twice-mod1.so",
++                           RTLD_NOW);
+   xdlclose (handle);
+   handle = xdlmopen (LM_ID_NEWLM, "tst-dlmopen-twice-mod2.so", RTLD_NOW);
+   int (*run_check) (void) = xdlsym (handle, "run_check");
+   TEST_COMPARE (run_check (), 0);
++  recurse (depth - 1);
+   xdlclose (handle);
++}
++
++static int
++do_test (void)
++{
++  /* First run the test without nesting.  */
++  recurse (1);
++
++  /* Then with nesting.  The constant needs to be less than the
++     internal DL_NNS namespace constant.  */
++  recurse (10);
+   return 0;
+ }
+ 
+-- 
+2.38.1
+
+
+From b357157361117182c7a68c90fda7ba431b64442c Mon Sep 17 00:00:00 2001
+From: Michael Hudson-Doyle <michael.hudson@canonical.com>
+Date: Mon, 22 Aug 2022 14:05:04 +1200
+Subject: [PATCH 63/72] Fix BZ #29463 in the ibm128 implementation of y1l too
+
+Avoid moving code across SET_RESTORE_ROUNDL in order to fix
+[BZ #29463].
+
+Tested-by: Aurelien Jarno <aurelien@aurel32.net>
+Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
+Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
+(cherry picked from commit b6e37b7805b0182c3e25cdab39ebf5f001c04d05)
+---
+ sysdeps/ieee754/ldbl-128ibm/e_j1l.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/sysdeps/ieee754/ldbl-128ibm/e_j1l.c b/sysdeps/ieee754/ldbl-128ibm/e_j1l.c
+index f85ba94466..0a5fe68342 100644
+--- a/sysdeps/ieee754/ldbl-128ibm/e_j1l.c
++++ b/sysdeps/ieee754/ldbl-128ibm/e_j1l.c
+@@ -792,10 +792,13 @@ __ieee754_y1l (long double x)
+     {
+       /* 0 <= x <= 2 */
+       SET_RESTORE_ROUNDL (FE_TONEAREST);
++      xx = math_opt_barrier (xx);
++      x = math_opt_barrier (x);
+       z = xx * xx;
+       p = xx * neval (z, Y0_2N, NY0_2N) / deval (z, Y0_2D, NY0_2D);
+       p = -TWOOPI / xx + p;
+       p = TWOOPI * __ieee754_logl (x) * __ieee754_j1l (x) + p;
++      math_force_eval (p);
+       return p;
+     }
+ 
+-- 
+2.38.1
+
+
+From 9273b2d0e93e7355656cad3be3a1ca76489df483 Mon Sep 17 00:00:00 2001
+From: Aurelien Jarno <aurelien@aurel32.net>
+Date: Mon, 10 Oct 2022 00:39:33 +0200
+Subject: [PATCH 64/72] Avoid undefined behaviour in ibm128 implementation of
+ llroundl (BZ #29488)
+
+Detecting an overflow edge case depended on signed overflow of a long
+long. Replace the additions and the overflow checks by
+__builtin_add_overflow().
+
+Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
+(cherry picked from commit 2b5478569e72ee4820a6e163d306690c9c0eaf5e)
+---
+ NEWS                                     |  2 ++
+ sysdeps/ieee754/ldbl-128ibm/s_llroundl.c | 21 +++++++++------------
+ 2 files changed, 11 insertions(+), 12 deletions(-)
+
+diff --git a/NEWS b/NEWS
+index a6da588c85..8c60d3dc8d 100644
+--- a/NEWS
++++ b/NEWS
+@@ -33,6 +33,8 @@ The following bugs are resolved with this release:
+   [29485] Linux: Terminate subprocess on late failure in tst-pidfd
+   [29490] alpha: New __brk_call implementation is broken
+   [29463] math/test-float128-y1 fails on x86_64
++  [29488] test-ibm128-llround fails on ppc64el when built with gcc-12 and -O2
++    or higher
+   [29528] elf: Call __libc_early_init for reused namespaces
+   [29537] libc: [2.34 regression]: Alignment issue on m68k when using
+   [29539] libc: LD_TRACE_LOADED_OBJECTS changed how vDSO library are
+diff --git a/sysdeps/ieee754/ldbl-128ibm/s_llroundl.c b/sysdeps/ieee754/ldbl-128ibm/s_llroundl.c
+index d85154e73a..d8c0de1faf 100644
+--- a/sysdeps/ieee754/ldbl-128ibm/s_llroundl.c
++++ b/sysdeps/ieee754/ldbl-128ibm/s_llroundl.c
+@@ -66,38 +66,35 @@ __llroundl (long double x)
+       /* Peg at max/min values, assuming that the above conversions do so.
+          Strictly speaking, we can return anything for values that overflow,
+          but this is more useful.  */
+-      res = hi + lo;
+-
+-      /* This is just sign(hi) == sign(lo) && sign(res) != sign(hi).  */
+-      if (__glibc_unlikely (((~(hi ^ lo) & (res ^ hi)) < 0)))
++      if (__glibc_unlikely (__builtin_add_overflow (hi, lo, &res)))
+ 	goto overflow;
+ 
+       xh -= lo;
+       ldbl_canonicalize (&xh, &xl);
+ 
+-      hi = res;
+       if (xh > 0.5)
+ 	{
+-	  res += 1;
++	  if (__glibc_unlikely (__builtin_add_overflow (res, 1, &res)))
++	    goto overflow;
+ 	}
+       else if (xh == 0.5)
+ 	{
+ 	  if (xl > 0.0 || (xl == 0.0 && res >= 0))
+-	    res += 1;
++	    if (__glibc_unlikely (__builtin_add_overflow (res, 1, &res)))
++	      goto overflow;
+ 	}
+       else if (-xh > 0.5)
+ 	{
+-	  res -= 1;
++	  if (__glibc_unlikely (__builtin_add_overflow (res, -1, &res)))
++	    goto overflow;
+ 	}
+       else if (-xh == 0.5)
+ 	{
+ 	  if (xl < 0.0 || (xl == 0.0 && res <= 0))
+-	    res -= 1;
++	    if (__glibc_unlikely (__builtin_add_overflow (res, -1, &res)))
++	      goto overflow;
+ 	}
+ 
+-      if (__glibc_unlikely (((~(hi ^ (res - hi)) & (res ^ hi)) < 0)))
+-	goto overflow;
+-
+       return res;
+     }
+   else
+-- 
+2.38.1
+
+
+From 7b7dfbb0cbdffebf0233c650627a4861212fbb60 Mon Sep 17 00:00:00 2001
+From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Wed, 19 Oct 2022 19:14:04 -0300
+Subject: [PATCH 65/72] linux: Fix generic struct_stat for 64 bit time (BZ#
+ 29657)
+
+The generic Linux struct_stat misses the conditionals to use
+bits/struct_stat_time64_helper.h in the __USE_TIME_BITS64 for
+architecture that uses __TIMESIZE == 32 (currently csky and nios2).
+
+Since newer ports should not support 32 bit time_t, the generic
+implementation should be used as default.
+
+For arm, hppa, and sh a copy of default struct_stat is added,
+while for csky and nios a new one based on generic is used, along
+with conditionals to use bits/struct_stat_time64_helper.h.
+
+The default struct_stat is also replaced with the generic one.
+
+Checked on aarch64-linux-gnu and arm-linux-gnueabihf.
+
+(cherry picked from commit 7a6ca82f8007ddbd43e2b8fce806ba7101ee47f5)
+---
+ NEWS                                          |   2 +
+ .../unix/sysv/linux/arm/bits/struct_stat.h    | 139 ++++++++++++++++++
+ sysdeps/unix/sysv/linux/bits/struct_stat.h    | 116 +++++++--------
+ .../{generic => csky}/bits/struct_stat.h      |  28 ++--
+ .../unix/sysv/linux/hppa/bits/struct_stat.h   | 139 ++++++++++++++++++
+ .../unix/sysv/linux/nios2/bits/struct_stat.h  | 135 +++++++++++++++++
+ sysdeps/unix/sysv/linux/sh/bits/struct_stat.h | 139 ++++++++++++++++++
+ 7 files changed, 624 insertions(+), 74 deletions(-)
+ create mode 100644 sysdeps/unix/sysv/linux/arm/bits/struct_stat.h
+ rename sysdeps/unix/sysv/linux/{generic => csky}/bits/struct_stat.h (92%)
+ create mode 100644 sysdeps/unix/sysv/linux/hppa/bits/struct_stat.h
+ create mode 100644 sysdeps/unix/sysv/linux/nios2/bits/struct_stat.h
+ create mode 100644 sysdeps/unix/sysv/linux/sh/bits/struct_stat.h
+
+diff --git a/NEWS b/NEWS
+index 8c60d3dc8d..833045585f 100644
+--- a/NEWS
++++ b/NEWS
+@@ -43,6 +43,8 @@ The following bugs are resolved with this release:
+   [29607] nscd repeatably crashes calling __strlen_avx2 when hosts cache is
+     enabled
+   [29638] libc: stdlib: arc4random fallback is never used
++  [29657] libc: Incorrect struct stat for 64-bit time on linux/generic
++    platforms
+ \f
+ Version 2.36
+ 
+diff --git a/sysdeps/unix/sysv/linux/arm/bits/struct_stat.h b/sysdeps/unix/sysv/linux/arm/bits/struct_stat.h
+new file mode 100644
+index 0000000000..30ee6279d2
+--- /dev/null
++++ b/sysdeps/unix/sysv/linux/arm/bits/struct_stat.h
+@@ -0,0 +1,139 @@
++/* Definition for struct stat.  Linux/arm version.
++   Copyright (C) 2020-2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library.  If not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#if !defined _SYS_STAT_H && !defined _FCNTL_H
++# error "Never include <bits/struct_stat.h> directly; use <sys/stat.h> instead."
++#endif
++
++#ifndef _BITS_STRUCT_STAT_H
++#define _BITS_STRUCT_STAT_H	1
++
++#include <bits/endian.h>
++#include <bits/wordsize.h>
++
++struct stat
++  {
++#ifdef __USE_TIME_BITS64
++# include <bits/struct_stat_time64_helper.h>
++#else
++    __dev_t st_dev;			/* Device.  */
++    unsigned short int __pad1;
++# ifndef __USE_FILE_OFFSET64
++    __ino_t st_ino;			/* File serial number.	*/
++# else
++    __ino_t __st_ino;			/* 32bit file serial number.	*/
++# endif
++    __mode_t st_mode;			/* File mode.  */
++    __nlink_t st_nlink;			/* Link count.  */
++    __uid_t st_uid;			/* User ID of the file's owner.	*/
++    __gid_t st_gid;			/* Group ID of the file's group.*/
++    __dev_t st_rdev;			/* Device number, if device.  */
++    unsigned short int __pad2;
++# ifndef __USE_FILE_OFFSET64
++    __off_t st_size;			/* Size of file, in bytes.  */
++# else
++    __off64_t st_size;			/* Size of file, in bytes.  */
++# endif
++    __blksize_t st_blksize;		/* Optimal block size for I/O.  */
++
++# ifndef __USE_FILE_OFFSET64
++    __blkcnt_t st_blocks;		/* Number 512-byte blocks allocated. */
++# else
++    __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
++# endif
++# ifdef __USE_XOPEN2K8
++    /* Nanosecond resolution timestamps are stored in a format
++       equivalent to 'struct timespec'.  This is the type used
++       whenever possible but the Unix namespace rules do not allow the
++       identifier 'timespec' to appear in the <sys/stat.h> header.
++       Therefore we have to handle the use of this header in strictly
++       standard-compliant sources special.  */
++    struct timespec st_atim;		/* Time of last access.  */
++    struct timespec st_mtim;		/* Time of last modification.  */
++    struct timespec st_ctim;		/* Time of last status change.  */
++#  define st_atime st_atim.tv_sec	/* Backward compatibility.  */
++#  define st_mtime st_mtim.tv_sec
++#  define st_ctime st_ctim.tv_sec
++# else
++    __time_t st_atime;			/* Time of last access.  */
++    unsigned long int st_atimensec;	/* Nscecs of last access.  */
++    __time_t st_mtime;			/* Time of last modification.  */
++    unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
++    __time_t st_ctime;			/* Time of last status change.  */
++    unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
++# endif
++# ifndef __USE_FILE_OFFSET64
++    unsigned long int __glibc_reserved4;
++    unsigned long int __glibc_reserved5;
++# else
++    __ino64_t st_ino;			/* File serial number.	*/
++# endif
++#endif /* __USE_TIME_BITS64  */
++  };
++
++#ifdef __USE_LARGEFILE64
++struct stat64
++  {
++# ifdef __USE_TIME_BITS64
++#  include <bits/struct_stat_time64_helper.h>
++# else
++    __dev_t st_dev;			/* Device.  */
++    unsigned int __pad1;
++
++    __ino_t __st_ino;			/* 32bit file serial number.	*/
++    __mode_t st_mode;			/* File mode.  */
++    __nlink_t st_nlink;			/* Link count.  */
++    __uid_t st_uid;			/* User ID of the file's owner.	*/
++    __gid_t st_gid;			/* Group ID of the file's group.*/
++    __dev_t st_rdev;			/* Device number, if device.  */
++    unsigned int __pad2;
++    __off64_t st_size;			/* Size of file, in bytes.  */
++    __blksize_t st_blksize;		/* Optimal block size for I/O.  */
++
++    __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
++#  ifdef __USE_XOPEN2K8
++    /* Nanosecond resolution timestamps are stored in a format
++       equivalent to 'struct timespec'.  This is the type used
++       whenever possible but the Unix namespace rules do not allow the
++       identifier 'timespec' to appear in the <sys/stat.h> header.
++       Therefore we have to handle the use of this header in strictly
++       standard-compliant sources special.  */
++    struct timespec st_atim;		/* Time of last access.  */
++    struct timespec st_mtim;		/* Time of last modification.  */
++    struct timespec st_ctim;		/* Time of last status change.  */
++#  else
++    __time_t st_atime;			/* Time of last access.  */
++    unsigned long int st_atimensec;	/* Nscecs of last access.  */
++    __time_t st_mtime;			/* Time of last modification.  */
++    unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
++    __time_t st_ctime;			/* Time of last status change.  */
++    unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
++#  endif
++    __ino64_t st_ino;			/* File serial number.		*/
++# endif /* __USE_TIME_BITS64  */
++  };
++#endif
++
++/* Tell code we have these members.  */
++#define	_STATBUF_ST_BLKSIZE
++#define _STATBUF_ST_RDEV
++/* Nanosecond resolution time values are supported.  */
++#define _STATBUF_ST_NSEC
++
++
++#endif /* _BITS_STRUCT_STAT_H  */
+diff --git a/sysdeps/unix/sysv/linux/bits/struct_stat.h b/sysdeps/unix/sysv/linux/bits/struct_stat.h
+index 25bd6cb638..fb11a3fba4 100644
+--- a/sysdeps/unix/sysv/linux/bits/struct_stat.h
++++ b/sysdeps/unix/sysv/linux/bits/struct_stat.h
+@@ -26,37 +26,36 @@
+ #include <bits/endian.h>
+ #include <bits/wordsize.h>
+ 
+-struct stat
+-  {
+-#ifdef __USE_TIME_BITS64
+-# include <bits/struct_stat_time64_helper.h>
+-#else
+-    __dev_t st_dev;			/* Device.  */
+-    unsigned short int __pad1;
+-# ifndef __USE_FILE_OFFSET64
+-    __ino_t st_ino;			/* File serial number.	*/
+-# else
+-    __ino_t __st_ino;			/* 32bit file serial number.	*/
++#if defined __USE_FILE_OFFSET64
++# define __field64(type, type64, name) type64 name
++#elif __WORDSIZE == 64 || defined __INO_T_MATCHES_INO64_T
++# if defined __INO_T_MATCHES_INO64_T && !defined __OFF_T_MATCHES_OFF64_T
++#  error "ino_t and off_t must both be the same type"
+ # endif
+-    __mode_t st_mode;			/* File mode.  */
+-    __nlink_t st_nlink;			/* Link count.  */
+-    __uid_t st_uid;			/* User ID of the file's owner.	*/
+-    __gid_t st_gid;			/* Group ID of the file's group.*/
+-    __dev_t st_rdev;			/* Device number, if device.  */
+-    unsigned short int __pad2;
+-# ifndef __USE_FILE_OFFSET64
+-    __off_t st_size;			/* Size of file, in bytes.  */
+-# else
+-    __off64_t st_size;			/* Size of file, in bytes.  */
+-# endif
+-    __blksize_t st_blksize;		/* Optimal block size for I/O.  */
++# define __field64(type, type64, name) type name
++#elif __BYTE_ORDER == __LITTLE_ENDIAN
++# define __field64(type, type64, name) \
++  type name __attribute__((__aligned__ (__alignof__ (type64)))); int __##name##_pad
++#else
++# define __field64(type, type64, name) \
++  int __##name##_pad __attribute__((__aligned__ (__alignof__ (type64)))); type name
++#endif
+ 
+-# ifndef __USE_FILE_OFFSET64
+-    __blkcnt_t st_blocks;		/* Number 512-byte blocks allocated. */
+-# else
+-    __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
+-# endif
+-# ifdef __USE_XOPEN2K8
++struct stat
++  {
++    __dev_t st_dev;		/* Device.  */
++    __field64(__ino_t, __ino64_t, st_ino);  /* File serial number. */
++    __mode_t st_mode;		/* File mode.  */
++    __nlink_t st_nlink;		/* Link count.  */
++    __uid_t st_uid;		/* User ID of the file's owner.	*/
++    __gid_t st_gid;		/* Group ID of the file's group.*/
++    __dev_t st_rdev;		/* Device number, if device.  */
++    __dev_t __pad1;
++    __field64(__off_t, __off64_t, st_size);  /* Size of file, in bytes. */
++    __blksize_t st_blksize;	/* Optimal block size for I/O.  */
++    int __pad2;
++    __field64(__blkcnt_t, __blkcnt64_t, st_blocks);  /* 512-byte blocks */
++#ifdef __USE_XOPEN2K8
+     /* Nanosecond resolution timestamps are stored in a format
+        equivalent to 'struct timespec'.  This is the type used
+        whenever possible but the Unix namespace rules do not allow the
+@@ -66,47 +65,38 @@ struct stat
+     struct timespec st_atim;		/* Time of last access.  */
+     struct timespec st_mtim;		/* Time of last modification.  */
+     struct timespec st_ctim;		/* Time of last status change.  */
+-#  define st_atime st_atim.tv_sec	/* Backward compatibility.  */
+-#  define st_mtime st_mtim.tv_sec
+-#  define st_ctime st_ctim.tv_sec
+-# else
++# define st_atime st_atim.tv_sec	/* Backward compatibility.  */
++# define st_mtime st_mtim.tv_sec
++# define st_ctime st_ctim.tv_sec
++#else
+     __time_t st_atime;			/* Time of last access.  */
+     unsigned long int st_atimensec;	/* Nscecs of last access.  */
+     __time_t st_mtime;			/* Time of last modification.  */
+     unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
+     __time_t st_ctime;			/* Time of last status change.  */
+     unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
+-# endif
+-# ifndef __USE_FILE_OFFSET64
+-    unsigned long int __glibc_reserved4;
+-    unsigned long int __glibc_reserved5;
+-# else
+-    __ino64_t st_ino;			/* File serial number.	*/
+-# endif
+-#endif /* __USE_TIME_BITS64  */
++#endif
++    int __glibc_reserved[2];
+   };
+ 
++#undef __field64
++
+ #ifdef __USE_LARGEFILE64
+ struct stat64
+   {
+-# ifdef __USE_TIME_BITS64
+-#  include <bits/struct_stat_time64_helper.h>
+-# else
+-    __dev_t st_dev;			/* Device.  */
+-    unsigned int __pad1;
+-
+-    __ino_t __st_ino;			/* 32bit file serial number.	*/
+-    __mode_t st_mode;			/* File mode.  */
+-    __nlink_t st_nlink;			/* Link count.  */
+-    __uid_t st_uid;			/* User ID of the file's owner.	*/
+-    __gid_t st_gid;			/* Group ID of the file's group.*/
+-    __dev_t st_rdev;			/* Device number, if device.  */
+-    unsigned int __pad2;
+-    __off64_t st_size;			/* Size of file, in bytes.  */
+-    __blksize_t st_blksize;		/* Optimal block size for I/O.  */
+-
+-    __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
+-#  ifdef __USE_XOPEN2K8
++    __dev_t st_dev;		/* Device.  */
++    __ino64_t st_ino;		/* File serial number.	*/
++    __mode_t st_mode;		/* File mode.  */
++    __nlink_t st_nlink;		/* Link count.  */
++    __uid_t st_uid;		/* User ID of the file's owner.	*/
++    __gid_t st_gid;		/* Group ID of the file's group.*/
++    __dev_t st_rdev;		/* Device number, if device.  */
++    __dev_t __pad1;
++    __off64_t st_size;		/* Size of file, in bytes.  */
++    __blksize_t st_blksize;	/* Optimal block size for I/O.  */
++    int __pad2;
++    __blkcnt64_t st_blocks;	/* Nr. 512-byte blocks allocated.  */
++#ifdef __USE_XOPEN2K8
+     /* Nanosecond resolution timestamps are stored in a format
+        equivalent to 'struct timespec'.  This is the type used
+        whenever possible but the Unix namespace rules do not allow the
+@@ -116,16 +106,15 @@ struct stat64
+     struct timespec st_atim;		/* Time of last access.  */
+     struct timespec st_mtim;		/* Time of last modification.  */
+     struct timespec st_ctim;		/* Time of last status change.  */
+-#  else
++#else
+     __time_t st_atime;			/* Time of last access.  */
+     unsigned long int st_atimensec;	/* Nscecs of last access.  */
+     __time_t st_mtime;			/* Time of last modification.  */
+     unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
+     __time_t st_ctime;			/* Time of last status change.  */
+     unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
+-#  endif
+-    __ino64_t st_ino;			/* File serial number.		*/
+-# endif /* __USE_TIME_BITS64  */
++#endif
++    int __glibc_reserved[2];
+   };
+ #endif
+ 
+@@ -135,5 +124,4 @@ struct stat64
+ /* Nanosecond resolution time values are supported.  */
+ #define _STATBUF_ST_NSEC
+ 
+-
+ #endif /* _BITS_STRUCT_STAT_H  */
+diff --git a/sysdeps/unix/sysv/linux/generic/bits/struct_stat.h b/sysdeps/unix/sysv/linux/csky/bits/struct_stat.h
+similarity index 92%
+rename from sysdeps/unix/sysv/linux/generic/bits/struct_stat.h
+rename to sysdeps/unix/sysv/linux/csky/bits/struct_stat.h
+index fb11a3fba4..f0ee455748 100644
+--- a/sysdeps/unix/sysv/linux/generic/bits/struct_stat.h
++++ b/sysdeps/unix/sysv/linux/csky/bits/struct_stat.h
+@@ -1,4 +1,4 @@
+-/* Definition for struct stat.
++/* Definition for struct stat.  Linux/csky version.
+    Copyright (C) 2020-2022 Free Software Foundation, Inc.
+    This file is part of the GNU C Library.
+ 
+@@ -43,6 +43,9 @@
+ 
+ struct stat
+   {
++#ifdef __USE_TIME_BITS64
++# include <bits/struct_stat_time64_helper.h>
++#else
+     __dev_t st_dev;		/* Device.  */
+     __field64(__ino_t, __ino64_t, st_ino);  /* File serial number. */
+     __mode_t st_mode;		/* File mode.  */
+@@ -55,7 +58,7 @@ struct stat
+     __blksize_t st_blksize;	/* Optimal block size for I/O.  */
+     int __pad2;
+     __field64(__blkcnt_t, __blkcnt64_t, st_blocks);  /* 512-byte blocks */
+-#ifdef __USE_XOPEN2K8
++# ifdef __USE_XOPEN2K8
+     /* Nanosecond resolution timestamps are stored in a format
+        equivalent to 'struct timespec'.  This is the type used
+        whenever possible but the Unix namespace rules do not allow the
+@@ -65,18 +68,19 @@ struct stat
+     struct timespec st_atim;		/* Time of last access.  */
+     struct timespec st_mtim;		/* Time of last modification.  */
+     struct timespec st_ctim;		/* Time of last status change.  */
+-# define st_atime st_atim.tv_sec	/* Backward compatibility.  */
+-# define st_mtime st_mtim.tv_sec
+-# define st_ctime st_ctim.tv_sec
+-#else
++#  define st_atime st_atim.tv_sec	/* Backward compatibility.  */
++#  define st_mtime st_mtim.tv_sec
++#  define st_ctime st_ctim.tv_sec
++# else
+     __time_t st_atime;			/* Time of last access.  */
+     unsigned long int st_atimensec;	/* Nscecs of last access.  */
+     __time_t st_mtime;			/* Time of last modification.  */
+     unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
+     __time_t st_ctime;			/* Time of last status change.  */
+     unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
+-#endif
++# endif
+     int __glibc_reserved[2];
++#endif
+   };
+ 
+ #undef __field64
+@@ -84,6 +88,9 @@ struct stat
+ #ifdef __USE_LARGEFILE64
+ struct stat64
+   {
++# ifdef __USE_TIME_BITS64
++#  include <bits/struct_stat_time64_helper.h>
++# else
+     __dev_t st_dev;		/* Device.  */
+     __ino64_t st_ino;		/* File serial number.	*/
+     __mode_t st_mode;		/* File mode.  */
+@@ -96,7 +103,7 @@ struct stat64
+     __blksize_t st_blksize;	/* Optimal block size for I/O.  */
+     int __pad2;
+     __blkcnt64_t st_blocks;	/* Nr. 512-byte blocks allocated.  */
+-#ifdef __USE_XOPEN2K8
++#  ifdef __USE_XOPEN2K8
+     /* Nanosecond resolution timestamps are stored in a format
+        equivalent to 'struct timespec'.  This is the type used
+        whenever possible but the Unix namespace rules do not allow the
+@@ -106,15 +113,16 @@ struct stat64
+     struct timespec st_atim;		/* Time of last access.  */
+     struct timespec st_mtim;		/* Time of last modification.  */
+     struct timespec st_ctim;		/* Time of last status change.  */
+-#else
++#  else
+     __time_t st_atime;			/* Time of last access.  */
+     unsigned long int st_atimensec;	/* Nscecs of last access.  */
+     __time_t st_mtime;			/* Time of last modification.  */
+     unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
+     __time_t st_ctime;			/* Time of last status change.  */
+     unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
+-#endif
++#  endif
+     int __glibc_reserved[2];
++# endif
+   };
+ #endif
+ 
+diff --git a/sysdeps/unix/sysv/linux/hppa/bits/struct_stat.h b/sysdeps/unix/sysv/linux/hppa/bits/struct_stat.h
+new file mode 100644
+index 0000000000..38b6e13e68
+--- /dev/null
++++ b/sysdeps/unix/sysv/linux/hppa/bits/struct_stat.h
+@@ -0,0 +1,139 @@
++/* Definition for struct stat.  Linux/hppa version.
++   Copyright (C) 2020-2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library.  If not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#if !defined _SYS_STAT_H && !defined _FCNTL_H
++# error "Never include <bits/struct_stat.h> directly; use <sys/stat.h> instead."
++#endif
++
++#ifndef _BITS_STRUCT_STAT_H
++#define _BITS_STRUCT_STAT_H	1
++
++#include <bits/endian.h>
++#include <bits/wordsize.h>
++
++struct stat
++  {
++#ifdef __USE_TIME_BITS64
++# include <bits/struct_stat_time64_helper.h>
++#else
++    __dev_t st_dev;			/* Device.  */
++    unsigned short int __pad1;
++# ifndef __USE_FILE_OFFSET64
++    __ino_t st_ino;			/* File serial number.	*/
++# else
++    __ino_t __st_ino;			/* 32bit file serial number.	*/
++# endif
++    __mode_t st_mode;			/* File mode.  */
++    __nlink_t st_nlink;			/* Link count.  */
++    __uid_t st_uid;			/* User ID of the file's owner.	*/
++    __gid_t st_gid;			/* Group ID of the file's group.*/
++    __dev_t st_rdev;			/* Device number, if device.  */
++    unsigned short int __pad2;
++# ifndef __USE_FILE_OFFSET64
++    __off_t st_size;			/* Size of file, in bytes.  */
++# else
++    __off64_t st_size;			/* Size of file, in bytes.  */
++# endif
++    __blksize_t st_blksize;		/* Optimal block size for I/O.  */
++
++# ifndef __USE_FILE_OFFSET64
++    __blkcnt_t st_blocks;		/* Number 512-byte blocks allocated. */
++# else
++    __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
++# endif
++# ifdef __USE_XOPEN2K8
++    /* Nanosecond resolution timestamps are stored in a format
++       equivalent to 'struct timespec'.  This is the type used
++       whenever possible but the Unix namespace rules do not allow the
++       identifier 'timespec' to appear in the <sys/stat.h> header.
++       Therefore we have to handle the use of this header in strictly
++       standard-compliant sources special.  */
++    struct timespec st_atim;		/* Time of last access.  */
++    struct timespec st_mtim;		/* Time of last modification.  */
++    struct timespec st_ctim;		/* Time of last status change.  */
++#  define st_atime st_atim.tv_sec	/* Backward compatibility.  */
++#  define st_mtime st_mtim.tv_sec
++#  define st_ctime st_ctim.tv_sec
++# else
++    __time_t st_atime;			/* Time of last access.  */
++    unsigned long int st_atimensec;	/* Nscecs of last access.  */
++    __time_t st_mtime;			/* Time of last modification.  */
++    unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
++    __time_t st_ctime;			/* Time of last status change.  */
++    unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
++# endif
++# ifndef __USE_FILE_OFFSET64
++    unsigned long int __glibc_reserved4;
++    unsigned long int __glibc_reserved5;
++# else
++    __ino64_t st_ino;			/* File serial number.	*/
++# endif
++#endif /* __USE_TIME_BITS64  */
++  };
++
++#ifdef __USE_LARGEFILE64
++struct stat64
++  {
++# ifdef __USE_TIME_BITS64
++#  include <bits/struct_stat_time64_helper.h>
++# else
++    __dev_t st_dev;			/* Device.  */
++    unsigned int __pad1;
++
++    __ino_t __st_ino;			/* 32bit file serial number.	*/
++    __mode_t st_mode;			/* File mode.  */
++    __nlink_t st_nlink;			/* Link count.  */
++    __uid_t st_uid;			/* User ID of the file's owner.	*/
++    __gid_t st_gid;			/* Group ID of the file's group.*/
++    __dev_t st_rdev;			/* Device number, if device.  */
++    unsigned int __pad2;
++    __off64_t st_size;			/* Size of file, in bytes.  */
++    __blksize_t st_blksize;		/* Optimal block size for I/O.  */
++
++    __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
++#  ifdef __USE_XOPEN2K8
++    /* Nanosecond resolution timestamps are stored in a format
++       equivalent to 'struct timespec'.  This is the type used
++       whenever possible but the Unix namespace rules do not allow the
++       identifier 'timespec' to appear in the <sys/stat.h> header.
++       Therefore we have to handle the use of this header in strictly
++       standard-compliant sources special.  */
++    struct timespec st_atim;		/* Time of last access.  */
++    struct timespec st_mtim;		/* Time of last modification.  */
++    struct timespec st_ctim;		/* Time of last status change.  */
++#  else
++    __time_t st_atime;			/* Time of last access.  */
++    unsigned long int st_atimensec;	/* Nscecs of last access.  */
++    __time_t st_mtime;			/* Time of last modification.  */
++    unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
++    __time_t st_ctime;			/* Time of last status change.  */
++    unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
++#  endif
++    __ino64_t st_ino;			/* File serial number.		*/
++# endif /* __USE_TIME_BITS64  */
++  };
++#endif
++
++/* Tell code we have these members.  */
++#define	_STATBUF_ST_BLKSIZE
++#define _STATBUF_ST_RDEV
++/* Nanosecond resolution time values are supported.  */
++#define _STATBUF_ST_NSEC
++
++
++#endif /* _BITS_STRUCT_STAT_H  */
+diff --git a/sysdeps/unix/sysv/linux/nios2/bits/struct_stat.h b/sysdeps/unix/sysv/linux/nios2/bits/struct_stat.h
+new file mode 100644
+index 0000000000..e00e71173e
+--- /dev/null
++++ b/sysdeps/unix/sysv/linux/nios2/bits/struct_stat.h
+@@ -0,0 +1,135 @@
++/* Definition for struct stat.  Linux/nios2 version.
++   Copyright (C) 2020-2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library.  If not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#if !defined _SYS_STAT_H && !defined _FCNTL_H
++# error "Never include <bits/struct_stat.h> directly; use <sys/stat.h> instead."
++#endif
++
++#ifndef _BITS_STRUCT_STAT_H
++#define _BITS_STRUCT_STAT_H	1
++
++#include <bits/endian.h>
++#include <bits/wordsize.h>
++
++#if defined __USE_FILE_OFFSET64
++# define __field64(type, type64, name) type64 name
++#elif __WORDSIZE == 64 || defined __INO_T_MATCHES_INO64_T
++# if defined __INO_T_MATCHES_INO64_T && !defined __OFF_T_MATCHES_OFF64_T
++#  error "ino_t and off_t must both be the same type"
++# endif
++# define __field64(type, type64, name) type name
++#elif __BYTE_ORDER == __LITTLE_ENDIAN
++# define __field64(type, type64, name) \
++  type name __attribute__((__aligned__ (__alignof__ (type64)))); int __##name##_pad
++#else
++# define __field64(type, type64, name) \
++  int __##name##_pad __attribute__((__aligned__ (__alignof__ (type64)))); type name
++#endif
++
++struct stat
++  {
++#ifdef __USE_TIME_BITS64
++# include <bits/struct_stat_time64_helper.h>
++#else
++    __dev_t st_dev;		/* Device.  */
++    __field64(__ino_t, __ino64_t, st_ino);  /* File serial number. */
++    __mode_t st_mode;		/* File mode.  */
++    __nlink_t st_nlink;		/* Link count.  */
++    __uid_t st_uid;		/* User ID of the file's owner.	*/
++    __gid_t st_gid;		/* Group ID of the file's group.*/
++    __dev_t st_rdev;		/* Device number, if device.  */
++    __dev_t __pad1;
++    __field64(__off_t, __off64_t, st_size);  /* Size of file, in bytes. */
++    __blksize_t st_blksize;	/* Optimal block size for I/O.  */
++    int __pad2;
++    __field64(__blkcnt_t, __blkcnt64_t, st_blocks);  /* 512-byte blocks */
++# ifdef __USE_XOPEN2K8
++    /* Nanosecond resolution timestamps are stored in a format
++       equivalent to 'struct timespec'.  This is the type used
++       whenever possible but the Unix namespace rules do not allow the
++       identifier 'timespec' to appear in the <sys/stat.h> header.
++       Therefore we have to handle the use of this header in strictly
++       standard-compliant sources special.  */
++    struct timespec st_atim;		/* Time of last access.  */
++    struct timespec st_mtim;		/* Time of last modification.  */
++    struct timespec st_ctim;		/* Time of last status change.  */
++#  define st_atime st_atim.tv_sec	/* Backward compatibility.  */
++#  define st_mtime st_mtim.tv_sec
++#  define st_ctime st_ctim.tv_sec
++# else
++    __time_t st_atime;			/* Time of last access.  */
++    unsigned long int st_atimensec;	/* Nscecs of last access.  */
++    __time_t st_mtime;			/* Time of last modification.  */
++    unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
++    __time_t st_ctime;			/* Time of last status change.  */
++    unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
++# endif
++    int __glibc_reserved[2];
++#endif
++  };
++
++#undef __field64
++
++#ifdef __USE_LARGEFILE64
++struct stat64
++  {
++# ifdef __USE_TIME_BITS64
++#  include <bits/struct_stat_time64_helper.h>
++# else
++    __dev_t st_dev;		/* Device.  */
++    __ino64_t st_ino;		/* File serial number.	*/
++    __mode_t st_mode;		/* File mode.  */
++    __nlink_t st_nlink;		/* Link count.  */
++    __uid_t st_uid;		/* User ID of the file's owner.	*/
++    __gid_t st_gid;		/* Group ID of the file's group.*/
++    __dev_t st_rdev;		/* Device number, if device.  */
++    __dev_t __pad1;
++    __off64_t st_size;		/* Size of file, in bytes.  */
++    __blksize_t st_blksize;	/* Optimal block size for I/O.  */
++    int __pad2;
++    __blkcnt64_t st_blocks;	/* Nr. 512-byte blocks allocated.  */
++#  ifdef __USE_XOPEN2K8
++    /* Nanosecond resolution timestamps are stored in a format
++       equivalent to 'struct timespec'.  This is the type used
++       whenever possible but the Unix namespace rules do not allow the
++       identifier 'timespec' to appear in the <sys/stat.h> header.
++       Therefore we have to handle the use of this header in strictly
++       standard-compliant sources special.  */
++    struct timespec st_atim;		/* Time of last access.  */
++    struct timespec st_mtim;		/* Time of last modification.  */
++    struct timespec st_ctim;		/* Time of last status change.  */
++#  else
++    __time_t st_atime;			/* Time of last access.  */
++    unsigned long int st_atimensec;	/* Nscecs of last access.  */
++    __time_t st_mtime;			/* Time of last modification.  */
++    unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
++    __time_t st_ctime;			/* Time of last status change.  */
++    unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
++#  endif
++    int __glibc_reserved[2];
++# endif
++  };
++#endif
++
++/* Tell code we have these members.  */
++#define	_STATBUF_ST_BLKSIZE
++#define _STATBUF_ST_RDEV
++/* Nanosecond resolution time values are supported.  */
++#define _STATBUF_ST_NSEC
++
++#endif /* _BITS_STRUCT_STAT_H  */
+diff --git a/sysdeps/unix/sysv/linux/sh/bits/struct_stat.h b/sysdeps/unix/sysv/linux/sh/bits/struct_stat.h
+new file mode 100644
+index 0000000000..0f7c9cdc89
+--- /dev/null
++++ b/sysdeps/unix/sysv/linux/sh/bits/struct_stat.h
+@@ -0,0 +1,139 @@
++/* Definition for struct stat.  Linux/sh version.
++   Copyright (C) 2020-2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library.  If not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#if !defined _SYS_STAT_H && !defined _FCNTL_H
++# error "Never include <bits/struct_stat.h> directly; use <sys/stat.h> instead."
++#endif
++
++#ifndef _BITS_STRUCT_STAT_H
++#define _BITS_STRUCT_STAT_H	1
++
++#include <bits/endian.h>
++#include <bits/wordsize.h>
++
++struct stat
++  {
++#ifdef __USE_TIME_BITS64
++# include <bits/struct_stat_time64_helper.h>
++#else
++    __dev_t st_dev;			/* Device.  */
++    unsigned short int __pad1;
++# ifndef __USE_FILE_OFFSET64
++    __ino_t st_ino;			/* File serial number.	*/
++# else
++    __ino_t __st_ino;			/* 32bit file serial number.	*/
++# endif
++    __mode_t st_mode;			/* File mode.  */
++    __nlink_t st_nlink;			/* Link count.  */
++    __uid_t st_uid;			/* User ID of the file's owner.	*/
++    __gid_t st_gid;			/* Group ID of the file's group.*/
++    __dev_t st_rdev;			/* Device number, if device.  */
++    unsigned short int __pad2;
++# ifndef __USE_FILE_OFFSET64
++    __off_t st_size;			/* Size of file, in bytes.  */
++# else
++    __off64_t st_size;			/* Size of file, in bytes.  */
++# endif
++    __blksize_t st_blksize;		/* Optimal block size for I/O.  */
++
++# ifndef __USE_FILE_OFFSET64
++    __blkcnt_t st_blocks;		/* Number 512-byte blocks allocated. */
++# else
++    __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
++# endif
++# ifdef __USE_XOPEN2K8
++    /* Nanosecond resolution timestamps are stored in a format
++       equivalent to 'struct timespec'.  This is the type used
++       whenever possible but the Unix namespace rules do not allow the
++       identifier 'timespec' to appear in the <sys/stat.h> header.
++       Therefore we have to handle the use of this header in strictly
++       standard-compliant sources special.  */
++    struct timespec st_atim;		/* Time of last access.  */
++    struct timespec st_mtim;		/* Time of last modification.  */
++    struct timespec st_ctim;		/* Time of last status change.  */
++#  define st_atime st_atim.tv_sec	/* Backward compatibility.  */
++#  define st_mtime st_mtim.tv_sec
++#  define st_ctime st_ctim.tv_sec
++# else
++    __time_t st_atime;			/* Time of last access.  */
++    unsigned long int st_atimensec;	/* Nscecs of last access.  */
++    __time_t st_mtime;			/* Time of last modification.  */
++    unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
++    __time_t st_ctime;			/* Time of last status change.  */
++    unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
++# endif
++# ifndef __USE_FILE_OFFSET64
++    unsigned long int __glibc_reserved4;
++    unsigned long int __glibc_reserved5;
++# else
++    __ino64_t st_ino;			/* File serial number.	*/
++# endif
++#endif /* __USE_TIME_BITS64  */
++  };
++
++#ifdef __USE_LARGEFILE64
++struct stat64
++  {
++# ifdef __USE_TIME_BITS64
++#  include <bits/struct_stat_time64_helper.h>
++# else
++    __dev_t st_dev;			/* Device.  */
++    unsigned int __pad1;
++
++    __ino_t __st_ino;			/* 32bit file serial number.	*/
++    __mode_t st_mode;			/* File mode.  */
++    __nlink_t st_nlink;			/* Link count.  */
++    __uid_t st_uid;			/* User ID of the file's owner.	*/
++    __gid_t st_gid;			/* Group ID of the file's group.*/
++    __dev_t st_rdev;			/* Device number, if device.  */
++    unsigned int __pad2;
++    __off64_t st_size;			/* Size of file, in bytes.  */
++    __blksize_t st_blksize;		/* Optimal block size for I/O.  */
++
++    __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
++#  ifdef __USE_XOPEN2K8
++    /* Nanosecond resolution timestamps are stored in a format
++       equivalent to 'struct timespec'.  This is the type used
++       whenever possible but the Unix namespace rules do not allow the
++       identifier 'timespec' to appear in the <sys/stat.h> header.
++       Therefore we have to handle the use of this header in strictly
++       standard-compliant sources special.  */
++    struct timespec st_atim;		/* Time of last access.  */
++    struct timespec st_mtim;		/* Time of last modification.  */
++    struct timespec st_ctim;		/* Time of last status change.  */
++#  else
++    __time_t st_atime;			/* Time of last access.  */
++    unsigned long int st_atimensec;	/* Nscecs of last access.  */
++    __time_t st_mtime;			/* Time of last modification.  */
++    unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
++    __time_t st_ctime;			/* Time of last status change.  */
++    unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
++#  endif
++    __ino64_t st_ino;			/* File serial number.		*/
++# endif /* __USE_TIME_BITS64  */
++  };
++#endif
++
++/* Tell code we have these members.  */
++#define	_STATBUF_ST_BLKSIZE
++#define _STATBUF_ST_RDEV
++/* Nanosecond resolution time values are supported.  */
++#define _STATBUF_ST_NSEC
++
++
++#endif /* _BITS_STRUCT_STAT_H  */
+-- 
+2.38.1
+
+
+From a1dc0be03c9dd850b864bd7a9c03cf8e396eb7ca Mon Sep 17 00:00:00 2001
+From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Tue, 25 Oct 2022 13:19:16 -0300
+Subject: [PATCH 66/72] elf: Reinstate on DL_DEBUG_BINDINGS _dl_lookup_symbol_x
+
+The prelink removal done by 6628c742b2c16e wrongly removed the debug
+support.
+
+Checked on x86_64-linux-gnu.
+
+(cherry picked from commit 891a7958a28eac6d4af1517dd2896fef5e4951d4)
+---
+ elf/dl-lookup.c | 17 +++++++++++++++++
+ 1 file changed, 17 insertions(+)
+
+diff --git a/elf/dl-lookup.c b/elf/dl-lookup.c
+index 4c86dc694e..67fb2e31e2 100644
+--- a/elf/dl-lookup.c
++++ b/elf/dl-lookup.c
+@@ -854,6 +854,23 @@ _dl_lookup_symbol_x (const char *undef_name, struct link_map *undef_map,
+   if (__glibc_unlikely (current_value.m->l_used == 0))
+     current_value.m->l_used = 1;
+ 
++ if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_BINDINGS))
++   {
++      const char *reference_name = undef_map->l_name;
++
++      _dl_debug_printf ("binding file %s [%lu] to %s [%lu]: %s symbol `%s'",
++			DSO_FILENAME (reference_name),
++			undef_map->l_ns,
++			DSO_FILENAME (current_value.m->l_name),
++			current_value.m->l_ns,
++			protected ? "protected" : "normal", undef_name);
++      if (version)
++	_dl_debug_printf_c (" [%s]\n", version->name);
++      else
++	_dl_debug_printf_c ("\n");
++   }
++
++
+   *ref = current_value.s;
+   return LOOKUP_VALUE (current_value.m);
+ }
+-- 
+2.38.1
+
+
+From 4c6a78addabbd6e1b69763e286768919e56dfe0a Mon Sep 17 00:00:00 2001
+From: Xi Ruoyao <xry111@xry111.site>
+Date: Sat, 15 Oct 2022 14:12:13 +0800
+Subject: [PATCH 67/72] longlong.h: update from GCC for LoongArch clz/ctz
+ support
+
+Update longlong.h to GCC r13-3269.  Keep our local change (prefer https
+for gnu.org URL).
+---
+ stdlib/longlong.h | 12 ++++++++++++
+ 1 file changed, 12 insertions(+)
+
+diff --git a/stdlib/longlong.h b/stdlib/longlong.h
+index 9b89469ac2..d8f76a43b5 100644
+--- a/stdlib/longlong.h
++++ b/stdlib/longlong.h
+@@ -593,6 +593,18 @@ extern UDItype __umulsidi3 (USItype, USItype);
+ #define UMUL_TIME 14
+ #endif
+ 
++#ifdef __loongarch__
++# if W_TYPE_SIZE == 32
++#  define count_leading_zeros(count, x)  ((count) = __builtin_clz (x))
++#  define count_trailing_zeros(count, x) ((count) = __builtin_ctz (x))
++#  define COUNT_LEADING_ZEROS_0 32
++# elif W_TYPE_SIZE == 64
++#  define count_leading_zeros(count, x)  ((count) = __builtin_clzll (x))
++#  define count_trailing_zeros(count, x) ((count) = __builtin_ctzll (x))
++#  define COUNT_LEADING_ZEROS_0 64
++# endif
++#endif
++
+ #if defined (__M32R__) && W_TYPE_SIZE == 32
+ #define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+   /* The cmp clears the condition bit.  */ \
+-- 
+2.38.1
+
+
+From dd4131c8322891a0ad7cfb661efa41aecc02b581 Mon Sep 17 00:00:00 2001
+From: Aurelien Jarno <aurelien@aurel32.net>
+Date: Tue, 1 Nov 2022 20:43:55 +0100
+Subject: [PATCH 68/72] linux: Fix fstatat on MIPSn64 (BZ #29730)
+
+Commit 6e8a0aac2f883 ("time: Fix overflow itimer tests on 32-bit
+systems") changed in_time_t_range to assume a 32-bit time_t. This broke
+fstatat on MIPSn64 that was using it with a 64-bit time_t due to
+difference between stat and stat64. This commit fix that by adding a
+MIPSn64 specific version, which bypasses the EOVERFLOW tests.
+
+Resolves: BZ #29730
+
+Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
+(cherry picked from commit 7457b7eef8dfe8cc48e55b9f9837df6dd397b80d)
+---
+ NEWS                                          |  1 +
+ .../unix/sysv/linux/mips/mips64/n64/fstatat.c | 51 +++++++++++++++++++
+ 2 files changed, 52 insertions(+)
+ create mode 100644 sysdeps/unix/sysv/linux/mips/mips64/n64/fstatat.c
+
+diff --git a/NEWS b/NEWS
+index 833045585f..e92d547e2c 100644
+--- a/NEWS
++++ b/NEWS
+@@ -45,6 +45,7 @@ The following bugs are resolved with this release:
+   [29638] libc: stdlib: arc4random fallback is never used
+   [29657] libc: Incorrect struct stat for 64-bit time on linux/generic
+     platforms
++  [29730] broken y2038 support in fstatat on MIPS N64
+ \f
+ Version 2.36
+ 
+diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/fstatat.c b/sysdeps/unix/sysv/linux/mips/mips64/n64/fstatat.c
+new file mode 100644
+index 0000000000..fe6c3a0dda
+--- /dev/null
++++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/fstatat.c
+@@ -0,0 +1,51 @@
++/* Get file status.  Linux/MIPSn64 version.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <sys/stat.h>
++#include <sysdep.h>
++
++/* Different than other ABIs, mips64 has different layouts for non-LFS
++   and LFS struct stat.  */
++int
++__fstatat (int fd, const char *file, struct stat *buf, int flag)
++{
++  struct __stat64_t64 st64;
++  int r = __fstatat64_time64 (fd, file, &st64, flag);
++  if (r == 0)
++    {
++      /* Clear internal pad and reserved fields.  */
++      memset (buf, 0, sizeof (*buf));
++
++      buf->st_dev = st64.st_dev;
++      buf->st_ino = st64.st_ino;
++      buf->st_mode = st64.st_mode;
++      buf->st_nlink = st64.st_nlink;
++      buf->st_uid = st64.st_uid;
++      buf->st_gid = st64.st_gid;
++      buf->st_rdev = st64.st_rdev;
++      buf->st_size = st64.st_size;
++      buf->st_blksize = st64.st_blksize;
++      buf->st_blocks  = st64.st_blocks;
++      buf->st_atim = st64.st_atim;
++      buf->st_mtim = st64.st_mtim;
++      buf->st_ctim = st64.st_ctim;
++    }
++  return r;
++}
++
++weak_alias (__fstatat, fstatat)
+-- 
+2.38.1
+
+
+From 2fce85f67c56e46863db40b8ca75bbf0fa993053 Mon Sep 17 00:00:00 2001
+From: caiyinyu <caiyinyu@loongson.cn>
+Date: Wed, 12 Oct 2022 20:28:42 +0800
+Subject: [PATCH 69/72] LoongArch: Fix ABI related macros in elf.h to keep
+ consistent with binutils[1].
+
+[1]:
+https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=c4a7e6b56218e1d5a858682186b542e2eae01a4a;hp=0d94a8735055432029237612a6eb9165db1ec9dd
+[2]:
+Reference: https://loongson.github.io/LoongArch-Documentation/LoongArch-ELF-ABI-EN.html#_e_flags_identifies_abi_type_and_version
+---
+ elf/elf.h | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/elf/elf.h b/elf/elf.h
+index 02a1b3f52f..014393f3cc 100644
+--- a/elf/elf.h
++++ b/elf/elf.h
+@@ -4085,8 +4085,11 @@ enum
+ #define R_NDS32_TLS_DESC	119
+ 
+ /* LoongArch ELF Flags */
+-#define EF_LARCH_ABI    	0x07
+-#define EF_LARCH_ABI_LP64D	0x03
++#define EF_LARCH_ABI_MODIFIER_MASK  0x07
++#define EF_LARCH_ABI_SOFT_FLOAT     0x01
++#define EF_LARCH_ABI_SINGLE_FLOAT   0x02
++#define EF_LARCH_ABI_DOUBLE_FLOAT   0x03
++#define EF_LARCH_OBJABI_V1          0x40
+ 
+ /* LoongArch specific dynamic relocations */
+ #define R_LARCH_NONE		0
+-- 
+2.38.1
+
+
+From 36cc06341a0c5029f49efaeef744dc3e9758e669 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <slyich@gmail.com>
+Date: Tue, 13 Sep 2022 13:39:13 -0400
+Subject: [PATCH 70/72] Makerules: fix MAKEFLAGS assignment for upcoming
+ make-4.4 [BZ# 29564]
+
+make-4.4 will add long flags to MAKEFLAGS variable:
+
+    * WARNING: Backward-incompatibility!
+      Previously only simple (one-letter) options were added to the MAKEFLAGS
+      variable that was visible while parsing makefiles.  Now, all options
+      are available in MAKEFLAGS.
+
+This causes locale builds to fail when long options are used:
+
+    $ make --shuffle
+    ...
+    make  -C localedata install-locales
+    make: invalid shuffle mode: '1662724426r'
+
+The change fixes it by passing eash option via whitespace and dashes.
+That way option is appended to both single-word form and whitespace
+separated form.
+
+While at it fixed --silent mode detection in $(MAKEFLAGS) by filtering
+out --long-options. Otherwise options like --shuffle flag enable silent
+mode unintentionally. $(silent-make) variable consolidates the checks.
+
+Resolves: BZ# 29564
+
+CC: Paul Smith <psmith@gnu.org>
+CC: Siddhesh Poyarekar <siddhesh@gotplt.org>
+Signed-off-by: Sergei Trofimovich <slyich@gmail.com>
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit 2d7ed98add14f75041499ac189696c9bd3d757fe)
+---
+ Makeconfig     | 18 +++++++++++++++++-
+ Makerules      |  4 ++--
+ elf/rtld-Rules |  2 +-
+ 3 files changed, 20 insertions(+), 4 deletions(-)
+
+diff --git a/Makeconfig b/Makeconfig
+index ba70321af1..2bbcabd8f9 100644
+--- a/Makeconfig
++++ b/Makeconfig
+@@ -43,6 +43,22 @@ else
+ $(error objdir must be defined by the build-directory Makefile)
+ endif
+ 
++# Did we request 'make -s' run? "yes" or "no".
++# Starting from make-4.4 MAKEFLAGS now contains long
++# options like '--shuffle'. To detect presence of 's'
++# we pick first word with short options. Long options
++# are guaranteed to come after whitespace. We use '-'
++# prefix to always have a word before long options
++# even if no short options were passed.
++# Typical MAKEFLAGS values to watch for:
++#   "rs --shuffle=42" (silent)
++#   " --shuffle" (not silent)
++ifeq ($(findstring s, $(firstword -$(MAKEFLAGS))),)
++silent-make := no
++else
++silent-make := yes
++endif
++
+ # Root of the sysdeps tree.
+ sysdep_dir := $(..)sysdeps
+ export sysdep_dir := $(sysdep_dir)
+@@ -917,7 +933,7 @@ endif
+ # umpteen zillion filenames along with it (we use `...' instead)
+ # but we don't want this echoing done when the user has said
+ # he doesn't want to see commands echoed by using -s.
+-ifneq	"$(findstring s,$(MAKEFLAGS))" ""	# if -s
++ifeq ($(silent-make),yes)			# if -s
+ +cmdecho	:= echo >/dev/null
+ else						# not -s
+ +cmdecho	:= echo
+diff --git a/Makerules b/Makerules
+index d1e139d03c..09c0cf8357 100644
+--- a/Makerules
++++ b/Makerules
+@@ -794,7 +794,7 @@ endif
+ # Maximize efficiency by minimizing the number of rules.
+ .SUFFIXES:	# Clear the suffix list.  We don't use suffix rules.
+ # Don't define any builtin rules.
+-MAKEFLAGS := $(MAKEFLAGS)r
++MAKEFLAGS := $(MAKEFLAGS) -r
+ 
+ # Generic rule for making directories.
+ %/:
+@@ -811,7 +811,7 @@ MAKEFLAGS := $(MAKEFLAGS)r
+ .PRECIOUS: $(foreach l,$(libtypes),$(patsubst %,$(common-objpfx)$l,c))
+ \f
+ # Use the verbose option of ar and tar when not running silently.
+-ifeq	"$(findstring s,$(MAKEFLAGS))" ""	# if not -s
++ifeq ($(silent-make),no)			# if not -s
+ verbose := v
+ else	   					# -s
+ verbose	:=
+diff --git a/elf/rtld-Rules b/elf/rtld-Rules
+index ca00dd1fe2..3c5e273f2b 100644
+--- a/elf/rtld-Rules
++++ b/elf/rtld-Rules
+@@ -52,7 +52,7 @@ $(objpfx)rtld-libc.a: $(foreach dir,$(rtld-subdirs),\
+ 	mv -f $@T $@
+ 
+ # Use the verbose option of ar and tar when not running silently.
+-ifeq	"$(findstring s,$(MAKEFLAGS))" ""	# if not -s
++ifeq ($(silent-make),no)			# if not -s
+ verbose := v
+ else						# -s
+ verbose	:=
+-- 
+2.38.1
+
+
+From 70410f2286cc36c9ccb133878811c728ae51725f Mon Sep 17 00:00:00 2001
+From: Paul Eggert <eggert@cs.ucla.edu>
+Date: Thu, 8 Sep 2022 20:08:32 -0500
+Subject: [PATCH 71/72] mktime: improve heuristic for ca-1986 Indiana DST
+
+This patch syncs mktime.c from Gnulib, fixing a
+problem reported by Mark Krenz <https://bugs.gnu.org/48085>,
+and it should fix BZ#29035 too.
+* time/mktime.c (__mktime_internal): Be more generous about
+accepting arguments with the wrong value of tm_isdst, by falling
+back to a one-hour DST difference if we find no nearby DST that is
+unusual.  This fixes a problem where "1986-04-28 00:00 EDT" was
+rejected when TZ="America/Indianapolis" because the nearest DST
+timestamp occurred in 1970, a temporal distance too great for the
+old heuristic.  This also also narrows the search a bit, which
+is a minor performance win.
+
+(cherry picked from commit 83859e1115269cf56d21669361d4ddbe2687831c)
+---
+ time/mktime.c | 28 ++++++++++++++++++++--------
+ 1 file changed, 20 insertions(+), 8 deletions(-)
+
+diff --git a/time/mktime.c b/time/mktime.c
+index 494c89bf54..e9a6006710 100644
+--- a/time/mktime.c
++++ b/time/mktime.c
+@@ -429,8 +429,13 @@ __mktime_internal (struct tm *tp,
+ 	 time with the right value, and use its UTC offset.
+ 
+ 	 Heuristic: probe the adjacent timestamps in both directions,
+-	 looking for the desired isdst.  This should work for all real
+-	 time zone histories in the tz database.  */
++	 looking for the desired isdst.  If none is found within a
++	 reasonable duration bound, assume a one-hour DST difference.
++	 This should work for all real time zone histories in the tz
++	 database.  */
++
++      /* +1 if we wanted standard time but got DST, -1 if the reverse.  */
++      int dst_difference = (isdst == 0) - (tm.tm_isdst == 0);
+ 
+       /* Distance between probes when looking for a DST boundary.  In
+ 	 tzdata2003a, the shortest period of DST is 601200 seconds
+@@ -441,12 +446,14 @@ __mktime_internal (struct tm *tp,
+ 	 periods when probing.  */
+       int stride = 601200;
+ 
+-      /* The longest period of DST in tzdata2003a is 536454000 seconds
+-	 (e.g., America/Jujuy starting 1946-10-01 01:00).  The longest
+-	 period of non-DST is much longer, but it makes no real sense
+-	 to search for more than a year of non-DST, so use the DST
+-	 max.  */
+-      int duration_max = 536454000;
++      /* In TZDB 2021e, the longest period of DST (or of non-DST), in
++	 which the DST (or adjacent DST) difference is not one hour,
++	 is 457243209 seconds: e.g., America/Cambridge_Bay with leap
++	 seconds, starting 1965-10-31 00:00 in a switch from
++	 double-daylight time (-05) to standard time (-07), and
++	 continuing to 1980-04-27 02:00 in a switch from standard time
++	 (-07) to daylight time (-06).  */
++      int duration_max = 457243209;
+ 
+       /* Search in both directions, so the maximum distance is half
+ 	 the duration; add the stride to avoid off-by-1 problems.  */
+@@ -483,6 +490,11 @@ __mktime_internal (struct tm *tp,
+ 	      }
+ 	  }
+ 
++      /* No unusual DST offset was found nearby.  Assume one-hour DST.  */
++      t += 60 * 60 * dst_difference;
++      if (mktime_min <= t && t <= mktime_max && convert_time (convert, t, &tm))
++	goto offset_found;
++
+       __set_errno (EOVERFLOW);
+       return -1;
+     }
+-- 
+2.38.1
+
+
+From 0f90d6204d79223fd32248c774df0cb7f0e604de Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 8 Nov 2022 14:15:02 +0100
+Subject: [PATCH 72/72] Linux: Support __IPC_64 in sysvctl *ctl command
+ arguments (bug 29771)
+
+Old applications pass __IPC_64 as part of the command argument because
+old glibc did not check for unknown commands, and passed through the
+arguments directly to the kernel, without adding __IPC_64.
+Applications need to continue doing that for old glibc compatibility,
+so this commit enables this approach in current glibc.
+
+For msgctl and shmctl, if no translation is required, make
+direct system calls, as we did before the time64 changes.  If
+translation is required, mask __IPC_64 from the command argument.
+
+For semctl, the union-in-vararg argument handling means that
+translation is needed on all architectures.
+
+Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
+(cherry picked from commit 22a46dee24351fd5f4f188ad80554cad79c82524)
+---
+ NEWS                               |  1 +
+ sysdeps/unix/sysv/linux/ipc_priv.h |  6 +++++
+ sysdeps/unix/sysv/linux/msgctl.c   | 38 ++++++++++++++++++++----------
+ sysdeps/unix/sysv/linux/semctl.c   |  7 ++++++
+ sysdeps/unix/sysv/linux/shmctl.c   | 38 ++++++++++++++++++++----------
+ 5 files changed, 64 insertions(+), 26 deletions(-)
+
+diff --git a/NEWS b/NEWS
+index e92d547e2c..9f8edea5db 100644
+--- a/NEWS
++++ b/NEWS
+@@ -46,6 +46,7 @@ The following bugs are resolved with this release:
+   [29657] libc: Incorrect struct stat for 64-bit time on linux/generic
+     platforms
+   [29730] broken y2038 support in fstatat on MIPS N64
++  [29771] Restore IPC_64 support in sysvipc *ctl functions
+ \f
+ Version 2.36
+ 
+diff --git a/sysdeps/unix/sysv/linux/ipc_priv.h b/sysdeps/unix/sysv/linux/ipc_priv.h
+index 87893a6757..2f50c31a8e 100644
+--- a/sysdeps/unix/sysv/linux/ipc_priv.h
++++ b/sysdeps/unix/sysv/linux/ipc_priv.h
+@@ -63,4 +63,10 @@ struct __old_ipc_perm
+ # define __IPC_TIME64 0
+ #endif
+ 
++#if __IPC_TIME64 || defined __ASSUME_SYSVIPC_BROKEN_MODE_T
++# define IPC_CTL_NEED_TRANSLATION 1
++#else
++# define IPC_CTL_NEED_TRANSLATION 0
++#endif
++
+ #include <ipc_ops.h>
+diff --git a/sysdeps/unix/sysv/linux/msgctl.c b/sysdeps/unix/sysv/linux/msgctl.c
+index e824ebb095..2072205252 100644
+--- a/sysdeps/unix/sysv/linux/msgctl.c
++++ b/sysdeps/unix/sysv/linux/msgctl.c
+@@ -85,11 +85,19 @@ msgctl_syscall (int msqid, int cmd, msgctl_arg_t *buf)
+ int
+ __msgctl64 (int msqid, int cmd, struct __msqid64_ds *buf)
+ {
+-#if __IPC_TIME64
++#if IPC_CTL_NEED_TRANSLATION
++# if __IPC_TIME64
+   struct kernel_msqid64_ds ksemid, *arg = NULL;
+-#else
++# else
+   msgctl_arg_t *arg;
+-#endif
++# endif
++
++  /* Some applications pass the __IPC_64 flag in cmd, to invoke
++     previously unsupported commands back when there was no EINVAL
++     error checking in glibc.  Mask the flag for the switch statements
++     below.  msgctl_syscall adds back the __IPC_64 flag for the actual
++     system call.  */
++  cmd &= ~__IPC_64;
+ 
+   switch (cmd)
+     {
+@@ -101,19 +109,19 @@ __msgctl64 (int msqid, int cmd, struct __msqid64_ds *buf)
+     case IPC_STAT:
+     case MSG_STAT:
+     case MSG_STAT_ANY:
+-#if __IPC_TIME64
++# if __IPC_TIME64
+       if (buf != NULL)
+ 	{
+ 	  msqid64_to_kmsqid64 (buf, &ksemid);
+ 	  arg = &ksemid;
+ 	}
+-# ifdef __ASSUME_SYSVIPC_BROKEN_MODE_T
++#  ifdef __ASSUME_SYSVIPC_BROKEN_MODE_T
+       if (cmd == IPC_SET)
+ 	arg->msg_perm.mode *= 0x10000U;
+-# endif
+-#else
++#  endif
++# else
+       arg = buf;
+-#endif
++# endif
+       break;
+ 
+     case IPC_INFO:
+@@ -137,21 +145,25 @@ __msgctl64 (int msqid, int cmd, struct __msqid64_ds *buf)
+     case IPC_STAT:
+     case MSG_STAT:
+     case MSG_STAT_ANY:
+-#ifdef __ASSUME_SYSVIPC_BROKEN_MODE_T
++# ifdef __ASSUME_SYSVIPC_BROKEN_MODE_T
+       arg->msg_perm.mode >>= 16;
+-#else
++# else
+       /* Old Linux kernel versions might not clear the mode padding.  */
+       if (sizeof ((struct msqid_ds){0}.msg_perm.mode)
+           != sizeof (__kernel_mode_t))
+ 	arg->msg_perm.mode &= 0xFFFF;
+-#endif
++# endif
+ 
+-#if __IPC_TIME64
++# if __IPC_TIME64
+       kmsqid64_to_msqid64 (arg, buf);
+-#endif
++# endif
+     }
+ 
+   return ret;
++
++#else /* !IPC_CTL_NEED_TRANSLATION */
++  return msgctl_syscall (msqid, cmd, buf);
++#endif
+ }
+ #if __TIMESIZE != 64
+ libc_hidden_def (__msgctl64)
+diff --git a/sysdeps/unix/sysv/linux/semctl.c b/sysdeps/unix/sysv/linux/semctl.c
+index 77a8130c18..3458b018bc 100644
+--- a/sysdeps/unix/sysv/linux/semctl.c
++++ b/sysdeps/unix/sysv/linux/semctl.c
+@@ -140,6 +140,13 @@ __semctl64 (int semid, int semnum, int cmd, ...)
+   union semun64 arg64 = { 0 };
+   va_list ap;
+ 
++  /* Some applications pass the __IPC_64 flag in cmd, to invoke
++     previously unsupported commands back when there was no EINVAL
++     error checking in glibc.  Mask the flag for the switch statements
++     below.  semctl_syscall adds back the __IPC_64 flag for the actual
++     system call.  */
++  cmd &= ~__IPC_64;
++
+   /* Get the argument only if required.  */
+   switch (cmd)
+     {
+diff --git a/sysdeps/unix/sysv/linux/shmctl.c b/sysdeps/unix/sysv/linux/shmctl.c
+index ea38935497..f00817a6f6 100644
+--- a/sysdeps/unix/sysv/linux/shmctl.c
++++ b/sysdeps/unix/sysv/linux/shmctl.c
+@@ -85,11 +85,19 @@ shmctl_syscall (int shmid, int cmd, shmctl_arg_t *buf)
+ int
+ __shmctl64 (int shmid, int cmd, struct __shmid64_ds *buf)
+ {
+-#if __IPC_TIME64
++#if IPC_CTL_NEED_TRANSLATION
++# if __IPC_TIME64
+   struct kernel_shmid64_ds kshmid, *arg = NULL;
+-#else
++# else
+   shmctl_arg_t *arg;
+-#endif
++# endif
++
++  /* Some applications pass the __IPC_64 flag in cmd, to invoke
++     previously unsupported commands back when there was no EINVAL
++     error checking in glibc.  Mask the flag for the switch statements
++     below.  shmctl_syscall adds back the __IPC_64 flag for the actual
++     system call.  */
++  cmd &= ~__IPC_64;
+ 
+   switch (cmd)
+     {
+@@ -103,19 +111,19 @@ __shmctl64 (int shmid, int cmd, struct __shmid64_ds *buf)
+     case IPC_STAT:
+     case SHM_STAT:
+     case SHM_STAT_ANY:
+-#if __IPC_TIME64
++# if __IPC_TIME64
+       if (buf != NULL)
+ 	{
+ 	  shmid64_to_kshmid64 (buf, &kshmid);
+ 	  arg = &kshmid;
+ 	}
+-# ifdef __ASSUME_SYSVIPC_BROKEN_MODE_T
++#  ifdef __ASSUME_SYSVIPC_BROKEN_MODE_T
+       if (cmd == IPC_SET)
+         arg->shm_perm.mode *= 0x10000U;
+-# endif
+-#else
++#  endif
++# else
+       arg = buf;
+-#endif
++# endif
+       break;
+ 
+     case IPC_INFO:
+@@ -140,21 +148,25 @@ __shmctl64 (int shmid, int cmd, struct __shmid64_ds *buf)
+       case IPC_STAT:
+       case SHM_STAT:
+       case SHM_STAT_ANY:
+-#ifdef __ASSUME_SYSVIPC_BROKEN_MODE_T
++# ifdef __ASSUME_SYSVIPC_BROKEN_MODE_T
+         arg->shm_perm.mode >>= 16;
+-#else
++# else
+       /* Old Linux kernel versions might not clear the mode padding.  */
+       if (sizeof ((struct shmid_ds){0}.shm_perm.mode)
+ 	  != sizeof (__kernel_mode_t))
+ 	arg->shm_perm.mode &= 0xFFFF;
+-#endif
++# endif
+ 
+-#if __IPC_TIME64
++# if __IPC_TIME64
+       kshmid64_to_shmid64 (arg, buf);
+-#endif
++# endif
+     }
+ 
+   return ret;
++
++#else /* !IPC_CTL_NEED_TRANSLATION */
++  return shmctl_syscall (shmid, cmd, buf);
++#endif
+ }
+ #if __TIMESIZE != 64
+ libc_hidden_def (__shmctl64)
+-- 
+2.38.1
+
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..010b68d886af 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,18 @@
 # Template file for 'glibc'
+#
+# The latest glibc patches can be obtained from the release branch using:
+# git format-patch $(git describe --abbrev=0 --match 'glibc-*') --stdout > git-updates.patch
+#
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +24,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +59,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +167,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From b3d12f9dd53c87e9e56cd3b531d3dce7bc5b5811 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 07/37] musl: add support for SIGEV_THREAD_ID timers

https://git.musl-libc.org/cgit/musl/commit/?id=7c71792e87691451f2a6b76348e83ad1889f1dcb
---
 ...d-support-for-SIGEV_THREAD_ID-timers.patch | 74 +++++++++++++++++++
 srcpkgs/musl/template                         |  2 +-
 2 files changed, 75 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch

diff --git a/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
new file mode 100644
index 000000000000..e20dff5ba0d4
--- /dev/null
+++ b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
@@ -0,0 +1,74 @@
+From 7c71792e87691451f2a6b76348e83ad1889f1dcb Mon Sep 17 00:00:00 2001
+From: James Y Knight <jyknight@google.com>
+Date: Sun, 30 Jun 2019 21:55:20 -0400
+Subject: [PATCH] add support for SIGEV_THREAD_ID timers
+
+This is like SIGEV_SIGNAL, but targeted to a particular thread's
+tid, rather than the process.
+---
+ include/signal.h        | 16 +++++++++++++---
+ src/time/timer_create.c |  8 ++++++--
+ 2 files changed, 19 insertions(+), 5 deletions(-)
+
+diff --git a/include/signal.h b/include/signal.h
+index fbdf667b2..9ed929e4f 100644
+--- a/include/signal.h
++++ b/include/signal.h
+@@ -180,14 +180,24 @@ struct sigevent {
+ 	union sigval sigev_value;
+ 	int sigev_signo;
+ 	int sigev_notify;
+-	void (*sigev_notify_function)(union sigval);
+-	pthread_attr_t *sigev_notify_attributes;
+-	char __pad[56-3*sizeof(long)];
++	union {
++		char __pad[64 - 2*sizeof(int) - sizeof(union sigval)];
++		pid_t sigev_notify_thread_id;
++		struct {
++			void (*sigev_notify_function)(union sigval);
++			pthread_attr_t *sigev_notify_attributes;
++		} __sev_thread;
++	} __sev_fields;
+ };
+ 
++#define sigev_notify_thread_id __sev_fields.sigev_notify_thread_id
++#define sigev_notify_function __sev_fields.__sev_thread.sigev_notify_function
++#define sigev_notify_attributes __sev_fields.__sev_thread.sigev_notify_attributes
++
+ #define SIGEV_SIGNAL 0
+ #define SIGEV_NONE 1
+ #define SIGEV_THREAD 2
++#define SIGEV_THREAD_ID 4
+ 
+ int __libc_current_sigrtmin(void);
+ int __libc_current_sigrtmax(void);
+diff --git a/src/time/timer_create.c b/src/time/timer_create.c
+index 5ddfda278..4bef23905 100644
+--- a/src/time/timer_create.c
++++ b/src/time/timer_create.c
+@@ -71,11 +71,15 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 	switch (evp ? evp->sigev_notify : SIGEV_SIGNAL) {
+ 	case SIGEV_NONE:
+ 	case SIGEV_SIGNAL:
++	case SIGEV_THREAD_ID:
+ 		if (evp) {
+ 			ksev.sigev_value = evp->sigev_value;
+ 			ksev.sigev_signo = evp->sigev_signo;
+ 			ksev.sigev_notify = evp->sigev_notify;
+-			ksev.sigev_tid = 0;
++			if (evp->sigev_notify == SIGEV_THREAD_ID)
++				ksev.sigev_tid = evp->sigev_notify_thread_id;
++			else
++				ksev.sigev_tid = 0;
+ 			ksevp = &ksev;
+ 		}
+ 		if (syscall(SYS_timer_create, clk, ksevp, &timerid) < 0)
+@@ -107,7 +111,7 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 
+ 		ksev.sigev_value.sival_ptr = 0;
+ 		ksev.sigev_signo = SIGTIMER;
+-		ksev.sigev_notify = 4; /* SIGEV_THREAD_ID */
++		ksev.sigev_notify = SIGEV_THREAD_ID;
+ 		ksev.sigev_tid = td->tid;
+ 		if (syscall(SYS_timer_create, clk, &ksev, &timerid) < 0)
+ 			timerid = -1;
diff --git a/srcpkgs/musl/template b/srcpkgs/musl/template
index 34e6ed4fba6e..afb33cd868b5 100644
--- a/srcpkgs/musl/template
+++ b/srcpkgs/musl/template
@@ -2,7 +2,7 @@
 pkgname=musl
 reverts="1.2.0_1"
 version=1.1.24
-revision=11
+revision=12
 archs="*-musl"
 bootstrap=yes
 build_style=gnu-configure

From f97144697ec52e90a73351f623c7c688e47912d9 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 08/37] gcc-multilib: update to 12.2.0.

---
 srcpkgs/gcc-multilib/template | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index f28eb237c287..ba9bafcadfd6 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,15 +3,15 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _majorver="${version%.*}"
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel
@@ -70,7 +70,7 @@ do_build() {
 	make ${makejobs}
 }
 do_install() {
-	local _pc_triplet=x86_64-pc-linux-gnu _version=${version%pre1}
+	local _pc_triplet=x86_64-pc-linux-gnu
 	# Install to a tempdir and then only copy relevant files.
 	cd ${wrksrc}
 	make DESTDIR=${wrksrc}/${pkgname}-build install
@@ -80,9 +80,9 @@ do_install() {
 	vmkdir usr/include/c++/${_majorver}/${_triplet}
 	vmkdir usr/lib/gcc/${_triplet}/${_majorver}
 
-	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${_version}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${version}/32 \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_majorver}/
-	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${_version}/${_pc_triplet}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${version}/${_pc_triplet}/32 \
 		${DESTDIR}/usr/include/c++/${_majorver}/${_triplet}
 
 	vinstall ${wrksrc}/host-${_pc_triplet}/gcc/specs 644 usr/lib/gcc/${_triplet}/${_majorver}

From 1c55adc492dc4ad7cd2fad61407a7454dca696b3 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 09/37] libgccjit: update to 12.2.0.

---
 srcpkgs/libgccjit/files/libgccjit-musl.patch | 63 --------------------
 srcpkgs/libgccjit/template                   | 24 +++-----
 2 files changed, 9 insertions(+), 78 deletions(-)
 delete mode 100644 srcpkgs/libgccjit/files/libgccjit-musl.patch

diff --git a/srcpkgs/libgccjit/files/libgccjit-musl.patch b/srcpkgs/libgccjit/files/libgccjit-musl.patch
deleted file mode 100644
index d2ed16928c82..000000000000
--- a/srcpkgs/libgccjit/files/libgccjit-musl.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-diff --git a/gcc/jit/jit-playback.c b/gcc/jit/jit-playback.c
-index 5bccf591a..35f5e35ef 100644
---- a/gcc/jit/jit-playback.c
-+++ b/gcc/jit/jit-playback.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -41,8 +43,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "diagnostic.h"
- #include "stmt.h"
- 
--#include <pthread.h>
--
- #include "jit-playback.h"
- #include "jit-result.h"
- #include "jit-builtins.h"
-diff --git a/gcc/jit/jit-recording.c b/gcc/jit/jit-recording.c
-index a237d574f..5785e3269 100644
---- a/gcc/jit/jit-recording.c
-+++ b/gcc/jit/jit-recording.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -25,8 +27,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "pretty-print.h"
- #include "toplev.h"
- 
--#include <pthread.h>
--
- #include "jit-builtins.h"
- #include "jit-recording.h"
- #include "jit-playback.h"
-diff --git a/gcc/jit/libgccjit.c b/gcc/jit/libgccjit.c
-index f9c33c63c..75f21d275 100644
---- a/gcc/jit/libgccjit.c
-+++ b/gcc/jit/libgccjit.c
-@@ -18,13 +18,13 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
- #include "timevar.h"
- #include "typed-splay-tree.h"
- #include "cppbuiltin.h"
--#include <pthread.h>
- 
- #include "libgccjit.h"
- #include "jit-recording.h"
diff --git a/srcpkgs/libgccjit/template b/srcpkgs/libgccjit/template
index 0b37c3ee9f8b..fde1affd54b7 100644
--- a/srcpkgs/libgccjit/template
+++ b/srcpkgs/libgccjit/template
@@ -3,18 +3,12 @@
 # which use the version number.
 
 pkgname=libgccjit
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
+version=12.2.0
 revision=1
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
-_majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 create_wrksrc=yes
 short_desc="Just-In-Time Compilation library for GCC"
 maintainer="Lane Biocini <lane@mailbox.org>"
@@ -22,16 +16,16 @@ homepage="https://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 nopie=yes
 lib32disabled=yes
 makedepends="zlib-devel"

From e6d3d03059be961f776b635d5d0fff5b9973aa29 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 10/37] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove -no-pie from build. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..f7e02dbc48cb 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -53,6 +53,7 @@ _void_cross_build_binutils() {
 		--sbindir=/usr/bin \
 		--libdir=/usr/lib \
 		--libexecdir=/usr/lib \
+		--sysconfdir=/etc \
 		--target=${tgt} \
 		--with-sysroot=/usr/${tgt} \
 		--disable-nls \
@@ -60,7 +61,9 @@ _void_cross_build_binutils() {
 		--disable-multilib \
 		--disable-werror \
 		--disable-gold \
+		--disable-gprofng \
 		--enable-relro \
+		--enable-new-dtags \
 		--enable-plugins \
 		--enable-64-bit-bfd \
 		--enable-deterministic-archives \
@@ -91,6 +94,9 @@ _void_cross_build_bootstrap_gcc() {
 	# Do not run fixincludes
 	sed -i 's@./fixinc.sh@-c true@' Makefile.in
 
+	# Do not use system headers to determine clocale implementation
+	sed -i 's/#if (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined(__UCLIBC__)/#if 1/g' libstdc++-v3/configure
+
 	for f in ${XBPS_SRCPKGDIR}/gcc/patches/*.patch; do
 		_void_cross_apply_patch "$f"
 	done
@@ -132,6 +138,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -381,6 +388,7 @@ _void_cross_build_gcc() {
 		extra_args+=" --disable-gnu-unique-object"
 		extra_args+=" libat_cv_have_ifunc=no"
 	else
+		extra_args+=" --enable-clocale=gnu"
 		extra_args+=" --enable-gnu-unique-object"
 	fi
 
@@ -460,6 +468,14 @@ do_build() {
 	local binutils_ver linux_ver gcc_ver libc_ver libucontext_ver
 	local tgt=${sourcepkg/cross-}
 
+	export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}"
+	export CXXFLAGS="${CXXFLAGS/-D_FORTIFY_SOURCE=2/}"
+
+	# Disable explicit -fno-PIE, gcc/binutils/libc will figure this out itself.
+	export CFLAGS="${CFLAGS//-fno-PIE/}"
+	export CXXFLAGS="${CXXFLAGS//-fno-PIE/}"
+	export LDFLAGS="${LDFLAGS//-no-pie/}"
+
 	_void_cross_test_ver binutils
 	_void_cross_test_ver linux
 	_void_cross_test_ver gcc
@@ -625,6 +641,9 @@ do_install() {
 	# then remove it because it conflicts with libquadmath package
 	rm -rf ${DESTDIR}/${sysroot}/usr/lib/libquadmath.*
 
+	# Remove libdep linker plugin because it conflicts with system binutils
+	rm -f ${DESTDIR}/usr/lib/bfd-plugins/libdep*
+
 	# Remove leftover symlinks
 	rm -f ${DESTDIR}/usr/lib${XBPS_TARGET_WORDSIZE}
 	rm -f ${DESTDIR}/lib*

From fe66c0bd73a113e1efc5b024a8119a38d9ef5231 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 11/37] qemu: remove broken patch

The necessary patch has been imported into musl so no need
to cast the sigevent struct to a more glibc-like one.
---
 .../musl-fix-sigevent-and-sigval_t.patch      | 27 -------------------
 1 file changed, 27 deletions(-)
 delete mode 100644 srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch

diff --git a/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch b/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch
deleted file mode 100644
index 4b4f1117c15f..000000000000
--- a/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-Note: Remove this patch with musl 1.2.2
-
---- a/linux-user/syscall.c
-+++ b/linux-user/syscall.c
-@@ -5020,10 +5020,21 @@
- #ifndef HAVE_SIGEV_NOTIFY_THREAD_ID
- #define sigev_notify_thread_id _sigev_un._tid
- #endif
- 
--static inline abi_long target_to_host_sigevent(struct sigevent *host_sevp,
-+struct host_sigevent {
-+    union sigval sigev_value;
-+    int sigev_signo;
-+    int sigev_notify;
-+    union {
-+       char _pad[64 - sizeof(int) * 2 - sizeof(union sigval)];
-+       int _tid;
-+    } _sigev_un;
-+};
-+
-+static inline abi_long target_to_host_sigevent(struct sigevent *sevp,
-                                                abi_ulong target_addr)
- {
-+    struct host_sigevent *host_sevp = (struct host_sigevent *) sevp;
-     struct target_sigevent *target_sevp;
- 
-     if (!lock_user_struct(VERIFY_READ, target_sevp, target_addr, 1)) {

From 724f69710f5f9fcca52113d60e815939c2748d3f Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 19 Nov 2022 13:26:24 -0800
Subject: [PATCH 12/37] mk-configure: rebuild for gcc 12

---
 srcpkgs/mk-configure/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/mk-configure/template b/srcpkgs/mk-configure/template
index 9d12f11a9799..c50d8adf213f 100644
--- a/srcpkgs/mk-configure/template
+++ b/srcpkgs/mk-configure/template
@@ -1,7 +1,7 @@
 # Template file for 'mk-configure'
 pkgname=mk-configure
 version=0.37.0
-revision=1
+revision=2
 build_style=gnu-makefile
 make_cmd=bmake
 make_install_args="MANDIR=/usr/share/man"

From ded2f735898ae89b40b7f7903663d58bbe01db16 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 13/37] cross-aarch64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..9e6fb75c198d 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Leah Neukirchen <leah@vuxu.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 2889ca8e22f7b8fd7b9530809c66887f24313aaa Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 14/37] cross-aarch64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..ba14c96bccea 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 4d48da86433baafaa4dc830d9bef8b284fe50e66 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 15/37] cross-arm-linux-gnueabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..5c774e16f430 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 1baf931b8bad66a1c7f289df6badda1d53f458c0 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 16/37] cross-arm-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..d6298ab639a4 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 4564feabda03c8f19e3d79d7a1a5a3cb3b6c3a2a Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 17/37] cross-arm-linux-musleabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..24df78e8fd8e 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From ebc8f69480a69a947589100db0b332e403fbf7fa Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 18/37] cross-arm-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..8093700f909c 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 63b0a800b0a20c851bb01064be780ae278fab5b3 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 19/37] cross-armv7l-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..92665326428b 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 6a39c7258e195b733b33fb5880583507973e4571 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 20/37] cross-armv7l-linux-musleabihf: update to gcc 12.2.0.

---
 .../cross-armv7l-linux-musleabihf/template    | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..e5af2c9ccbf2 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 20f6271162f77f82fa92ae1fc583a66044097e25 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 21/37] cross-i686-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-i686-linux-musl/template b/srcpkgs/cross-i686-linux-musl/template
index 8be16a230d8d..d624bb7a3254 100644
--- a/srcpkgs/cross-i686-linux-musl/template
+++ b/srcpkgs/cross-i686-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-i686-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-i686-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From fd46abf40db93ca4b8cbb59a29db72fa030bcf33 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 22/37] cross-i686-pc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..6a9e54db807a 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,14 +1,15 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -16,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 1d99930e5ea247f78c76eecd4a0206173ef81c99 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 23/37] cross-mips-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-musl/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..67a5c413396c 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 8f78c75993779910723312e39d58c401260db0c0 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 24/37] cross-mips-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..bdf8600ce95b 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="hipperson0 <hipperson0@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From e782fc4d6d6bad3b750ce5d37544ee4aae2dbd95 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 25/37] cross-mipsel-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..de49387d517b 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 060ecd37f72661aba1bf33f52983295da29ac672 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 26/37] cross-mipsel-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..b27ce6475a38 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 3788e8b9f365234fb98b95daa23d8da5bdbf4bc2 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 27/37] cross-powerpc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..79579e093b12 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 3623b27a6ee00d2a147bfda740afd79efca5afd3 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 28/37] cross-powerpc-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..9bb6acd359b6 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 1f14258f1f847cf3860751471e2a502cf6a70141 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 29/37] cross-powerpc64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..2d153d00add6 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,16 +1,17 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
  --enable-targets=powerpc-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -18,12 +19,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From cd9a976aaf0e5b3ef4c0a44b91c59a4a77e1de1b Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 30/37] cross-powerpc64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 016f18776a6d..e0848fe0bff7 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,30 +1,31 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From b96fc5d0ab284af4c13695d810bb2cb5bf6e6cb0 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 31/37] cross-powerpc64le-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 463d7e92d20d..8d8e010e15c0 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,16 +1,17 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
  --enable-targets=powerpcle-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -18,12 +19,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 6e4b26258e7d789c234309ad77b9bf4174928a5f Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 32/37] cross-powerpc64le-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index c17a3cccfe29..0915e524545f 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,30 +1,31 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 12067aeef9c02c6571aef82f755ddf28b3de1a75 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 33/37] cross-powerpcle-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 9aede3c465ce..687be8a44c6c 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 
@@ -35,6 +36,8 @@ if [ "$XBPS_TARGET_MACHINE" = "ppcle" ]; then
 	broken="Can't build crosstoolchain to itself"
 fi
 
+broken="glibc uses big-endian specific instructions on 32-bit powerpc"
+
 cross-powerpcle-linux-gnu-libc_package() {
 	short_desc+=" - glibc files"
 	nostrip=yes

From f4ed9df75c3b797a19214fa65f0ae241aa03b62b Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 34/37] cross-powerpcle-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index 045cfda987fe..bb984b9c42eb 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From fc73dd6eeb90aa8671af05061909376974e7aadc Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:30 -0800
Subject: [PATCH 35/37] cross-x86_64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 8918f3c22a1c..930aaf2a508b 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,14 +1,15 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -16,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 578ab334ae02b03bdfaed0a2c4a2e325fb00a38d Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:30 -0800
Subject: [PATCH 36/37] cross-x86_64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..ac5b1c46ab82 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 92efc01e2e79a13e6559b7b43f8d4eee65f77622 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Fri, 18 Nov 2022 02:01:19 -0800
Subject: [PATCH 37/37] cross-vpkg-dummy: update to 0.39.

---
 srcpkgs/cross-vpkg-dummy/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/cross-vpkg-dummy/template b/srcpkgs/cross-vpkg-dummy/template
index d83e38dc63ac..aeafb749dd5f 100644
--- a/srcpkgs/cross-vpkg-dummy/template
+++ b/srcpkgs/cross-vpkg-dummy/template
@@ -1,6 +1,6 @@
 # Template file for 'cross-vpkg-dummy'
 pkgname=cross-vpkg-dummy
-version=0.38
+version=0.39
 revision=1
 build_style=meta
 short_desc="Dummy meta-pkg for cross building packages with xbps-src"
@@ -54,8 +54,8 @@ conflicts="
 	gcc-objc++>=0"
 shlib_provides="
 	libgcc_s.so.1
-	libgnat-10.so
-	libgnarl-10.so
+	libgnat-12.so
+	libgnarl-12.so
 	libstdc++.so.6
 	libgfortran.so.5"
 

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (235 preceding siblings ...)
  2022-11-19 22:45 ` [PR PATCH] [Updated] " oreo639
@ 2022-11-19 22:51 ` oreo639
  2022-11-19 22:57 ` oreo639
                   ` (27 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-11-19 22:51 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5448 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.2.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.2.0

There is a list of failing builds here: https://github.com/void-linux/void-packages/issues/39809

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [x] llvm https://github.com/void-linux/void-packages/pull/38694
- [x] m4 https://github.com/void-linux/void-packages/pull/33730
- [x] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [x] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [x] libvirt https://github.com/void-linux/void-packages/pull/38842
- [x] syslinux https://github.com/void-linux/void-packages/pull/38876
- [x] efivar https://github.com/void-linux/void-packages/pull/38874
- [x] gpgme https://github.com/void-linux/void-packages/pull/38825

Known packages that needed to be fixed/updated for gcc12:
- [x] openssh https://github.com/void-linux/void-packages/pull/38849
- [x] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [x] doxygen https://github.com/void-linux/void-packages/pull/38846
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] libproxy https://github.com/void-linux/void-packages/pull/38818
- [x] exempi https://github.com/void-linux/void-packages/pull/38820
- [x] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [x] libunique1 https://github.com/void-linux/void-packages/pull/38848 or https://github.com/void-linux/void-packages/pull/38873
- [x] libwpd https://github.com/void-linux/void-packages/pull/38878
- [x] cglm https://github.com/void-linux/void-packages/pull/39748
- [x] coreboot-utils https://github.com/void-linux/void-packages/pull/39749
- [x] apl https://github.com/void-linux/void-packages/pull/39750
- [x] igt-gpu-tools https://github.com/void-linux/void-packages/pull/39780

Needs to be fixed/updated for binutils:
- [x] grub https://github.com/void-linux/void-packages/pull/38875
- [x] linux-tools https://github.com/void-linux/void-packages/pull/38877
- [x] kcov https://github.com/void-linux/void-packages/pull/39291

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [x] kde
- [x] lxde
- [x] lxqt

You can test the ISOs here:
https://drive.google.com/drive/folders/1ix92CYSLUP-KWjLxltdgG4e8Nu2JCY5n?usp=sharing

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 520541 bytes --]

From c3ba17a045f848281322ef66c857e867cfd85193 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 01/37] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../fix-libcollector-without-java.patch       | 53 +++++++++++++++
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 25 ++++---
 4 files changed, 87 insertions(+), 117 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
 create mode 100644 srcpkgs/binutils/patches/fix-libcollector-without-java.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/fix-libcollector-without-java.patch b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
new file mode 100644
index 000000000000..54384875f358
--- /dev/null
+++ b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
@@ -0,0 +1,53 @@
+From 49ddd814ac1071af7c4f45d5f8398b91862f2c7f Mon Sep 17 00:00:00 2001
+From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
+Date: Wed, 17 Aug 2022 19:55:23 -0700
+Subject: [PATCH] gprofng: fix bug 29479 Collection fails when built without
+ java support
+
+gprofng/ChangeLog
+2022-08-17  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>
+
+	PR gprofng/29479
+	* libcollector/collector.c: Add #if defined(GPROFNG_JAVA_PROFILING) for
+	java specific code.
+	* libcollector/unwind.c: Likewise.
+---
+ gprofng/libcollector/collector.c | 2 ++
+ gprofng/libcollector/unwind.c    | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/gprofng/libcollector/collector.c b/gprofng/libcollector/collector.c
+index 93c9d3330de5..ceff2c1caccb 100644
+--- a/gprofng/libcollector/collector.c
++++ b/gprofng/libcollector/collector.c
+@@ -913,8 +913,10 @@ __collector_open_experiment (const char *exp, const char *params, sp_origin_t or
+   __collector_ext_unwind_key_init (1, NULL);
+ 
+   /* start java attach if suitable */
++#if defined(GPROFNG_JAVA_PROFILING)
+   if (exp_origin == SP_ORIGIN_DBX_ATTACH)
+     __collector_jprofile_start_attach ();
++#endif
+   start_sec_time = CALL_UTIL (time)(NULL);
+   __collector_start_time = collector_interface.getHiResTime ();
+   TprintfT (DBG_LT0, "\t__collector_open_experiment; resetting start_time\n");
+diff --git a/gprofng/libcollector/unwind.c b/gprofng/libcollector/unwind.c
+index 119243788020..f8e11823c81e 100644
+--- a/gprofng/libcollector/unwind.c
++++ b/gprofng/libcollector/unwind.c
+@@ -557,6 +557,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+   int size = max_frame_size;
+ 
+ #define MIN(a,b) ((a)<(b)?(a):(b))
++#if defined(GPROFNG_JAVA_PROFILING)
+   /* get Java info */
+   if (__collector_java_mode && __collector_java_asyncgetcalltrace_loaded && context && !pseudo_context)
+     {
+@@ -569,6 +570,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+ 	  size -= sz;
+ 	}
+     }
++#endif
+ 
+   /* get native stack */
+   if (context)
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..c355a5fc8016 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkgconf"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -35,15 +36,21 @@ do_configure() {
 	local conf
 
 	if [ "$CHROOT_READY" ]; then
-		conf+=" --with-debuginfod"
+		conf+=" --with-debuginfod --enable-shared"
 	else
-		conf+=" --without-debuginfod --disable-install-libbfd"
+		conf+=" --without-debuginfod --disable-shared --disable-install-libbfd"
 	fi
 	if [ "$CROSS_BUILD" ]; then
 		# we don't want --with-sysroot=${XBPS_CROSS_BASE} like gnu-configure
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	# gprofng currently only supports x86 and aarch64 glibc.
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64|i386|aarch64) conf+=" --enable-gprofng" ;;
+		*) conf+=" --disable-gprofng" ;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"
@@ -76,13 +83,14 @@ do_configure() {
 		--libdir=/usr/lib \
 		--mandir=/usr/share/man \
 		--infodir=/usr/share/info \
+		--sysconfdir=/etc \
 		--disable-werror \
-		--disable-shared \
 		--disable-nls \
 		--enable-threads \
 		--enable-plugins \
 		--enable-relro \
 		--enable-gold \
+		--enable-new-dtags \
 		--enable-deterministic-archives \
 		--enable-64-bit-bfd \
 		--enable-ld=default \
@@ -142,7 +150,8 @@ binutils-devel_package() {
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/*.a"
-		vmove "usr/lib/*.so"
+		vmove "usr/lib/libbfd.so"
+		vmove "usr/lib/libopcodes.so"
 	}
 }
 

From 66f6988d695ef56433c4c2fb21e744f34f0e852f Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 02/37] gdb: resolve conflict with binutils 2.39

---
 srcpkgs/gdb/template | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/gdb/template b/srcpkgs/gdb/template
index 9c5f17ffc519..b666348fea19 100644
--- a/srcpkgs/gdb/template
+++ b/srcpkgs/gdb/template
@@ -1,7 +1,7 @@
 # Template file for 'gdb'
 pkgname=gdb
 version=12.1
-revision=2
+revision=3
 build_style=gnu-configure
 pycompile_dirs="/usr/share/gdb/python"
 configure_args="--disable-werror --disable-nls --with-system-readline
@@ -48,7 +48,8 @@ vopt_conflict debuginfod static
 
 post_install() {
 	# resolve conflicts with binutils
-	rm -r ${DESTDIR}/usr/{include,lib,share/info/bfd.info*}
+	rm -rf ${DESTDIR}/usr/{include,lib}
+	rm -rf ${DESTDIR}/usr/share/info/{bfd,ctf-spec}.info*
 }
 
 gdb-common_package() {

From 09823b53e266c1db3351c8d6090d1ad8fd19506c Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 03/37] gcc: update to 12.2.0.

---
 common/shlibs                                 | 10 +--
 srcpkgs/gcc/files/gccgo-musl.patch            | 71 +++------------
 srcpkgs/gcc/files/libgnarl-musl.patch         | 18 ++--
 srcpkgs/gcc/files/libssp-musl.patch           | 10 +--
 srcpkgs/gcc/patches/libffi_gnulinux.patch     | 11 ---
 .../gcc/patches/libgcc-ibm128-no-tag.patch    | 10 ++-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |  2 +-
 srcpkgs/gcc/template                          | 87 +++++++++----------
 8 files changed, 80 insertions(+), 139 deletions(-)
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index 07296762fcc4..a5f4f3257d33 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.2.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.36 perl-5.36.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -857,8 +857,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.2.0_1
+libgnat-12.so libada-12.2.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1710,8 +1710,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.2.0_1
+libasan.so.8 libsanitizer-12.2.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..12ec68dd8aa3 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,14 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ b/libgo/go/runtime/os_linux.go
+@@ -365,7 +365,7 @@ func setThreadCPUProfiler(hz int32) {
+ 	var sevp _sigevent
+ 	sevp.sigev_notify = _SIGEV_THREAD_ID
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.__sev_fields))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index ab3643de4f98..a20af7c0ef2e 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,14 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
+version=12.2.0
+revision=1
+_minorver="${version%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 create_wrksrc=yes
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +18,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -52,8 +48,11 @@ if [ "$CHROOT_READY" ]; then
 	hostmakedepends="tar texinfo perl flex"
 else
 	_have_gccgo=no
+	# libzstd fails to link in bootstrap with glibc 2.36
+	# when zlib has been compiled with glibc 2.32.
+	LDFLAGS="-lzstd -pthread"
 fi
-makedepends="zlib-devel"
+makedepends="zlib-devel libzstd-devel"
 depends="binutils libgcc-devel-${version}_${revision}
  libstdc++-devel-${version}_${revision} libssp-devel-${version}_${revision}"
 checkdepends="dejagnu"
@@ -70,13 +69,13 @@ if [ "$build_option_gnatboot" ]; then
 	case "$XBPS_TARGET_MACHINE" in
 	x86_64)
 		_gnat_tarball="gnat-gpl-2017-x86_64-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/591c6d80c7a447af2deed1d7>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/9682e2e1f2f232ce03fe21d77b14c37a0de5649b?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" b942bcac20dea39748b39f8b624d9619f60a8dee2e8195dbe3829c835b0956e6"
 		build_options_default="gnatboot"
 		;;
 	i686)
 		_gnat_tarball="gnat-gpl-2014-x86-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/564b3e9dc8e196b040fbe248>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/c5e9e6fdff5cb77ed90cf8c62536653e27c0bed6?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" 3b693510f5d22a240abb3034934c1adbd80ccd6e4f61a4f491cc408fdfd9c042"
 		build_options_default="gnatboot"
 		;;
@@ -155,8 +154,8 @@ if [ "$CROSS_BUILD" ]; then
 fi
 
 post_extract() {
-	mv gcc-${version/pre/_pre}/* gcc-${version/pre/_pre}/.??* .
-	rmdir gcc-${version/pre/_pre}
+	mv gcc-${version}/* gcc-${version}/.??* .
+	rmdir gcc-${version}
 	mv gmp-${_gmp_version} gmp
 	mv mpfr-${_mpfr_version} mpfr
 	mv mpc-${_mpc_version} mpc
@@ -186,9 +185,9 @@ pre_configure() {
 	sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
 
 	if [ "$XBPS_TARGET_LIBC" = musl ]; then
-		patch -p1 -i ${FILESDIR}/libgnarl-musl.patch
-		patch -p1 -i ${FILESDIR}/libssp-musl.patch
-		patch -p1 -i ${FILESDIR}/gccgo-musl.patch
+		for p in ${FILESDIR}/*-musl.patch; do
+			patch -p1 -i $p
+		done
 	fi
 }
 do_configure() {
@@ -343,16 +342,16 @@ do_install() {
 
 	# Make version a symlink of major version to make all versions
 	# from the same series work automagically.
-	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver} \
+	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${version} \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver}
 	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver} \
-		${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}
+		${DESTDIR}/usr/lib/gcc/${_triplet}/${version}
 
 	# Ditto for c++ headers.
-	mv ${DESTDIR}/usr/include/c++/${_patchver} \
+	mv ${DESTDIR}/usr/include/c++/${version} \
 		${DESTDIR}/usr/include/c++/${_minorver}
 	ln -sfr ${DESTDIR}/usr/include/c++/${_minorver} \
-		${DESTDIR}/usr/include/c++/${_patchver}
+		${DESTDIR}/usr/include/c++/${version}
 
 	# cc symlink
 	ln -sfr ${DESTDIR}/usr/bin/gcc ${DESTDIR}/usr/bin/cc
@@ -361,7 +360,7 @@ do_install() {
 
 	# lto plugin symlink
 	vmkdir usr/lib/bfd-plugins
-	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}/liblto_plugin.so \
+	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${version}/liblto_plugin.so \
 		${DESTDIR}/usr/lib/bfd-plugins
 
 	# Remove "fixed" header
@@ -372,13 +371,9 @@ do_install() {
 	rm -f ${DESTDIR}/usr/lib/libffi*
 	rm -f ${DESTDIR}/usr/share/man/man3/ffi*
 
-	# Remove all python scripts in libdir.
-	rm -f ${DESTDIR}/usr/lib/*.py
-
-	# Remove more python stuff.
-	if [ -d ${DESTDIR}/usr/share/gcc-${_patchver}/python ]; then
-		rm -rf ${DESTDIR}/usr/share/gcc-${_patchver}/python
-	fi
+	# Move libstdc++ gdb helpers to location where gdb can autoload them
+	mkdir -p ${DESTDIR}/usr/share/gdb/auto-load/usr/lib
+	mv ${DESTDIR}/usr/lib/*.py ${DESTDIR}/usr/share/gdb/auto-load/usr/lib
 
 	# Install c89 and c99 wrappers and its manpages, from NetBSD.
 	for f in c89 c99; do
@@ -397,7 +392,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}
@@ -450,7 +445,7 @@ gcc-fortran_package() {
 		if [ "$CROSS_BUILD" ]; then
 			# A number of OMP modules are not built when cross
 			# compiling gcc. Copy them from the cross compiler.
-			local src="/usr/lib/gcc/${_triplet}/${_patchver}/finclude"
+			local src="/usr/lib/gcc/${_triplet}/${version}/finclude"
 			local dst="usr/lib/gcc/${_triplet}/${_minorver}/finclude"
 			for f in omp_lib.f90 omp_lib.h omp_lib.mod omp_lib_kinds.mod \
 				openacc.f90 openacc.mod openacc_kinds.mod openacc_lib.h; do
@@ -517,7 +512,7 @@ libgfortran_package() {
 	short_desc+=" - Fortran library"
 	pkg_install() {
 		vmove "usr/lib/libgfortran.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -538,7 +533,7 @@ libgo_package() {
 	nostrip=yes
 	pkg_install() {
 		vmove "usr/lib/libgo.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -554,7 +549,7 @@ libobjc_package() {
 	short_desc+=" - Objective-C library"
 	pkg_install() {
 		vmove "usr/lib/libobjc.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -573,7 +568,7 @@ libquadmath_package() {
 	short_desc+=" - quadmath library"
 	pkg_install() {
 		vmove "usr/lib/libquadmath.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -615,7 +610,7 @@ libgcc_package() {
 	noverifyrdeps=yes
 	pkg_install() {
 		vmove "usr/lib/libgcc_s.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -646,7 +641,7 @@ libgomp_package() {
 	short_desc+=" - OpenMP v4.0 library"
 	pkg_install() {
 		vmove "usr/lib/libgomp*.so.*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -701,7 +696,7 @@ libssp_package() {
 	short_desc+=" - SSP (StackSmashingProtection) library"
 	pkg_install() {
 		vmove "usr/lib/libssp.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -718,7 +713,9 @@ libstdc++-devel_package() {
 libstdc++_package() {
 	short_desc+=" - Standard C++ Library"
 	pkg_install() {
+		vmove usr/share/gdb
+		vmove usr/share/gcc-${version}/python
 		vmove "usr/lib/libstdc++.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }

From 25feab200a1a00db03e93c892c2a1a7b44ba985c Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 04/37] libtool: rebuild for gcc 12

---
 srcpkgs/libtool/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index fc5c53a9c3e9..aebad9294eef 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
 version=2.4.7
-revision=1
+revision=2
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"

From 1b0668e29a0f79489385c428a7cf2f1bea20687d Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 05/37] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 7e01bbb851fd..d9618e3806ba 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 build_wrksrc=libiberty
 build_style=gnu-configure
@@ -10,7 +10,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From 35946603c7f3c3fbabb3740565f9380e7c783c0f Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 06/37] glibc: update to 2.36.

---
 common/shlibs                                 |    60 +-
 ...e-hash-style-both-for-building-glibc.patch |    51 +
 srcpkgs/glibc/patches/git-updates.patch       | 10900 ++++++++++++++++
 .../glibc/patches/glibc-c-utf8-locale.patch   |   286 -
 srcpkgs/glibc/template                        |    66 +-
 5 files changed, 11010 insertions(+), 353 deletions(-)
 create mode 100644 srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
 create mode 100644 srcpkgs/glibc/patches/git-updates.patch
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index a5f4f3257d33..a96fe577e93b 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch b/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
new file mode 100644
index 000000000000..9c5553e92609
--- /dev/null
+++ b/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
@@ -0,0 +1,51 @@
+Temporary workaround for EAC bug.
+
+See: https://sourceware.org/bugzilla/show_bug.cgi?id=29456
+
+From 8e90e2cc5e57d7ca3a40602d278e9642a8b66716 Mon Sep 17 00:00:00 2001
+From: oreo639 <oreo6391@gmail.com>
+Date: Tue, 13 Sep 2022 14:30:35 -0700
+Subject: [PATCH] Revert "Do not use --hash-style=both for building glibc
+ shared objects"
+
+This reverts commit e47de5cb2d4dbecb58f569ed241e8e95c568f03c.
+---
+ Makeconfig     |  9 +++++++++
+ Makerules      |  7 +++++++
+ 5 files changed, 61 insertions(+)
+
+diff --git a/Makeconfig b/Makeconfig
+index ba70321af1..e2131d4389 100644
+--- a/Makeconfig
++++ b/Makeconfig
+@@ -371,6 +371,13 @@ dt-relr-ldflag =
+ no-dt-relr-ldflag =
+ endif
+ 
++# For the time being we unconditionally use 'both'.  At some time we
++# should declare statically linked code as 'out of luck' and compile
++# with --hash-style=gnu only.
++hashstyle-LDFLAGS = -Wl,--hash-style=both
++LDFLAGS.so += $(hashstyle-LDFLAGS)
++LDFLAGS-rtld += $(hashstyle-LDFLAGS)
++
+ ifeq (no,$(build-pie-default))
+ pie-default = $(no-pie-ccflag)
+ else # build-pie-default
+diff --git a/Makerules b/Makerules
+index d1e139d03c..44134e37ce 100644
+--- a/Makerules
++++ b/Makerules
+@@ -558,6 +558,9 @@ $(common-objpfx)shlib.lds: $(common-objpfx)config.make $(..)Makerules
+ 		  -Wl,--verbose 2>/dev/null | \
+ 	  sed > $@T \
+ 	      -e '/^=========/,/^=========/!d;/^=========/d' \
++		   -e 's/^.*\.gnu\.hash[ 	]*:.*$$/  .note.ABI-tag : { *(.note.ABI-tag) } &/' \
++		   -e '/^[ 	]*\.hash[ 	]*:.*$$/{h;d;}' \
++		   -e '/DATA_SEGMENT_ALIGN/{H;g}' \
+ 	      -e 's/^.*\*(\.dynbss).*$$/& \
+ 		 PROVIDE(__start___libc_freeres_ptrs = .); \
+ 		 *(__libc_freeres_ptrs) \
+-- 
+2.37.3
+
diff --git a/srcpkgs/glibc/patches/git-updates.patch b/srcpkgs/glibc/patches/git-updates.patch
new file mode 100644
index 000000000000..75551be32bb5
--- /dev/null
+++ b/srcpkgs/glibc/patches/git-updates.patch
@@ -0,0 +1,10900 @@
+From c3fda489cfdb2260f9fec706e6fd7259858c4467 Mon Sep 17 00:00:00 2001
+From: Tom Honermann <tom@honermann.net>
+Date: Sun, 24 Jul 2022 01:11:43 -0400
+Subject: [PATCH 01/72] stdlib: Suppress gcc diagnostic that char8_t is a
+ keyword in C++20 in uchar.h.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+gcc 13 issues the following diagnostic for the uchar.h header when the
+-Wc++20-compat option is enabled in C++ modes that do not enable char8_t
+as a builtin type (C++17 and earlier by default; subject to _GNU_SOURCE
+and the gcc -f[no-]char8_t option).
+  warning: identifier ‘char8_t’ is a keyword in C++20 [-Wc++20-compat]
+This change modifies the uchar.h header to suppress the diagnostic through
+the use of '#pragma GCC diagnostic' directives for gcc 10 and later (the
+-Wc++20-compat option was added in gcc version 10).  Unfortunately, a bug
+in gcc currently prevents those directives from having the intended effect
+as reported at https://gcc.gnu.org/PR106423.  A patch for that issue has
+been submitted and is available in the email thread archive linked below.
+  https://gcc.gnu.org/pipermail/gcc-patches/2022-July/598736.html
+
+(cherry picked from commit 825f84f133bd840347dc49229b6d831f07d04775)
+---
+ wcsmbs/uchar.h | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/wcsmbs/uchar.h b/wcsmbs/uchar.h
+index c37e8619a0..5f7139f279 100644
+--- a/wcsmbs/uchar.h
++++ b/wcsmbs/uchar.h
+@@ -34,8 +34,16 @@
+ /* Declare the C2x char8_t typedef in C2x modes, but only if the C++
+   __cpp_char8_t feature test macro is not defined.  */
+ #if __GLIBC_USE (ISOC2X) && !defined __cpp_char8_t
++#if __GNUC_PREREQ (10, 0) && defined __cplusplus
++/* Suppress the diagnostic regarding char8_t being a keyword in C++20.  */
++# pragma GCC diagnostic push
++# pragma GCC diagnostic ignored "-Wc++20-compat"
++#endif
+ /* Define the 8-bit character type.  */
+ typedef unsigned char char8_t;
++#if __GNUC_PREREQ (10, 0) && defined __cplusplus
++# pragma GCC diagnostic pop
++#endif
+ #endif
+ 
+ #ifndef __USE_ISOCXX11
+-- 
+2.38.1
+
+
+From 33f1b4c1452b33991e670f636ebe98b90a405e10 Mon Sep 17 00:00:00 2001
+From: "H.J. Lu" <hjl.tools@gmail.com>
+Date: Fri, 29 Jul 2022 10:50:56 -0700
+Subject: [PATCH 02/72] wcsmbs: Add missing test-c8rtomb/test-mbrtoc8
+ dependency
+
+Make test-c8rtomb.out and test-mbrtoc8.out depend on $(gen-locales) for
+
+  xsetlocale (LC_ALL, "de_DE.UTF-8");
+  xsetlocale (LC_ALL, "zh_HK.BIG5-HKSCS");
+
+Reviewed-by: Sunil K Pandey <skpgkp2@gmail.com>
+Reviewed-by: Carlos O'Donell <carlos@redhat.com>
+(cherry picked from commit e03f5ccd6cc8f829416156eac75acee501626c1f)
+---
+ wcsmbs/Makefile | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/wcsmbs/Makefile b/wcsmbs/Makefile
+index e6b9e8743a..3d19d5556f 100644
+--- a/wcsmbs/Makefile
++++ b/wcsmbs/Makefile
+@@ -73,6 +73,8 @@ $(objpfx)tst-wcstol-locale.out: $(gen-locales)
+ $(objpfx)tst-wcstod-nan-locale.out: $(gen-locales)
+ $(objpfx)tst-c16-surrogate.out: $(gen-locales)
+ $(objpfx)tst-c32-state.out: $(gen-locales)
++$(objpfx)test-c8rtomb.out: $(gen-locales)
++$(objpfx)test-mbrtoc8.out: $(gen-locales)
+ endif
+ 
+ $(objpfx)tst-wcstod-round: $(libm)
+-- 
+2.38.1
+
+
+From c74bb93cfdb04d49155b0e30983a3c866167bbca Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Thu, 4 Aug 2022 17:54:48 +0200
+Subject: [PATCH 03/72] dlfcn: Pass caller pointer to static dlopen
+ implementation (bug 29446)
+
+Fixes commit 0c1c3a771eceec46e66ce1183cf988e2303bd373 ("dlfcn: Move
+dlopen into libc").
+
+(cherry picked from commit ed0185e4129130cbe081c221efb758fb400623ce)
+---
+ NEWS           | 7 +++++++
+ dlfcn/dlopen.c | 2 +-
+ 2 files changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/NEWS b/NEWS
+index f61e521fc8..15f3dd2cdb 100644
+--- a/NEWS
++++ b/NEWS
+@@ -4,6 +4,13 @@ See the end for copying conditions.
+ 
+ Please send GNU C library bug reports via <https://sourceware.org/bugzilla/>
+ using `glibc' in the "product" field.
++\f
++Version 2.36.1
++
++The following bugs are resolved with this release:
++
++  [29446] _dlopen now ignores dl_caller argument in static mode
++
+ \f
+ Version 2.36
+ 
+diff --git a/dlfcn/dlopen.c b/dlfcn/dlopen.c
+index 2696dde4b1..9b07b4e132 100644
+--- a/dlfcn/dlopen.c
++++ b/dlfcn/dlopen.c
+@@ -90,7 +90,7 @@ compat_symbol (libdl, ___dlopen, dlopen, GLIBC_2_1);
+ void *
+ __dlopen (const char *file, int mode, void *dl_caller)
+ {
+-  return dlopen_implementation (file, mode, RETURN_ADDRESS (0));
++  return dlopen_implementation (file, mode, dl_caller);
+ }
+ 
+ void *
+-- 
+2.38.1
+
+
+From ac47d8f6cf9744139adb12f540fb9cc610cac579 Mon Sep 17 00:00:00 2001
+From: Joseph Myers <joseph@codesourcery.com>
+Date: Tue, 2 Aug 2022 21:05:07 +0000
+Subject: [PATCH 04/72] Update syscall lists for Linux 5.19
+
+Linux 5.19 has no new syscalls, but enables memfd_secret in the uapi
+headers for RISC-V.  Update the version number in syscall-names.list
+to reflect that it is still current for 5.19 and regenerate the
+arch-syscall.h headers with build-many-glibcs.py update-syscalls.
+
+Tested with build-many-glibcs.py.
+
+(cherry picked from commit fccadcdf5bed7ee67a6cef4714e0b477d6c8472c)
+---
+ sysdeps/unix/sysv/linux/riscv/rv32/arch-syscall.h | 1 +
+ sysdeps/unix/sysv/linux/riscv/rv64/arch-syscall.h | 1 +
+ sysdeps/unix/sysv/linux/syscall-names.list        | 4 ++--
+ 3 files changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/arch-syscall.h b/sysdeps/unix/sysv/linux/riscv/rv32/arch-syscall.h
+index bf4be80f8d..202520ee25 100644
+--- a/sysdeps/unix/sysv/linux/riscv/rv32/arch-syscall.h
++++ b/sysdeps/unix/sysv/linux/riscv/rv32/arch-syscall.h
+@@ -122,6 +122,7 @@
+ #define __NR_mbind 235
+ #define __NR_membarrier 283
+ #define __NR_memfd_create 279
++#define __NR_memfd_secret 447
+ #define __NR_migrate_pages 238
+ #define __NR_mincore 232
+ #define __NR_mkdirat 34
+diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/arch-syscall.h b/sysdeps/unix/sysv/linux/riscv/rv64/arch-syscall.h
+index d656aedcc2..4e65f337d4 100644
+--- a/sysdeps/unix/sysv/linux/riscv/rv64/arch-syscall.h
++++ b/sysdeps/unix/sysv/linux/riscv/rv64/arch-syscall.h
+@@ -127,6 +127,7 @@
+ #define __NR_mbind 235
+ #define __NR_membarrier 283
+ #define __NR_memfd_create 279
++#define __NR_memfd_secret 447
+ #define __NR_migrate_pages 238
+ #define __NR_mincore 232
+ #define __NR_mkdirat 34
+diff --git a/sysdeps/unix/sysv/linux/syscall-names.list b/sysdeps/unix/sysv/linux/syscall-names.list
+index 6c7b2f7011..028ad3107a 100644
+--- a/sysdeps/unix/sysv/linux/syscall-names.list
++++ b/sysdeps/unix/sysv/linux/syscall-names.list
+@@ -21,8 +21,8 @@
+ # This file can list all potential system calls.  The names are only
+ # used if the installed kernel headers also provide them.
+ 
+-# The list of system calls is current as of Linux 5.18.
+-kernel 5.18
++# The list of system calls is current as of Linux 5.19.
++kernel 5.19
+ 
+ FAST_atomic_update
+ FAST_cmpxchg
+-- 
+2.38.1
+
+
+From 302bc33bc53c787da6e74162a7092e9c0fb964a8 Mon Sep 17 00:00:00 2001
+From: Noah Goldstein <goldstein.w.n@gmail.com>
+Date: Mon, 8 Aug 2022 11:26:22 +0800
+Subject: [PATCH 05/72] elf: Replace `strcpy` call with `memcpy` [BZ #29454]
+
+GCC normally does this optimization for us in
+strlen_pass::handle_builtin_strcpy but only for optimized
+build. To avoid needing to include strcpy.S in the rtld build to
+support the debug build, just do the optimization by hand.
+
+(cherry picked from commit 483cfe1a6a33d6335b1901581b41040d2d412511)
+---
+ elf/dl-cache.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/elf/dl-cache.c b/elf/dl-cache.c
+index 8bbf110d02..b97c17b3a9 100644
+--- a/elf/dl-cache.c
++++ b/elf/dl-cache.c
+@@ -509,8 +509,9 @@ _dl_load_cache_lookup (const char *name)
+      we are accessing. Therefore we must make the copy of the
+      mapping data without using malloc.  */
+   char *temp;
+-  temp = alloca (strlen (best) + 1);
+-  strcpy (temp, best);
++  size_t best_len = strlen (best) + 1;
++  temp = alloca (best_len);
++  memcpy (temp, best, best_len);
+   return __strdup (temp);
+ }
+ 
+-- 
+2.38.1
+
+
+From e982657073c4db21459ffd9e17bc505b1d64b876 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Mon, 15 Aug 2022 16:43:59 +0200
+Subject: [PATCH 06/72] Linux: Terminate subprocess on late failure in
+ tst-pidfd (bug 29485)
+
+Reviewed-by: Carlos O'Donell <carlos@redhat.com>
+(cherry picked from commit f82e05ebb295cadd35f7372f652c72264da810ad)
+---
+ NEWS                                | 1 +
+ sysdeps/unix/sysv/linux/tst-pidfd.c | 7 +++++--
+ 2 files changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/NEWS b/NEWS
+index 15f3dd2cdb..f8fb8db510 100644
+--- a/NEWS
++++ b/NEWS
+@@ -10,6 +10,7 @@ Version 2.36.1
+ The following bugs are resolved with this release:
+ 
+   [29446] _dlopen now ignores dl_caller argument in static mode
++  [29485] Linux: Terminate subprocess on late failure in tst-pidfd
+ 
+ \f
+ Version 2.36
+diff --git a/sysdeps/unix/sysv/linux/tst-pidfd.c b/sysdeps/unix/sysv/linux/tst-pidfd.c
+index 037af22290..5711d1c312 100644
+--- a/sysdeps/unix/sysv/linux/tst-pidfd.c
++++ b/sysdeps/unix/sysv/linux/tst-pidfd.c
+@@ -147,8 +147,11 @@ do_test (void)
+        may be denied if the process doesn't have CAP_SYS_PTRACE or
+        if a LSM security_ptrace_access_check denies access.  */
+     if (fd == -1 && errno == EPERM)
+-      FAIL_UNSUPPORTED ("don't have permission to use pidfd_getfd on pidfd, "
+-			"skipping test");
++      {
++	TEST_COMPARE (pidfd_send_signal (pidfd, SIGKILL, NULL, 0), 0);
++	FAIL_UNSUPPORTED ("don't have permission to use pidfd_getfd on pidfd, "
++			  "skipping test");
++      }
+     TEST_VERIFY (fd > 0);
+ 
+     char *path = xasprintf ("/proc/%d/fd/%d", pid, remote_fd);
+-- 
+2.38.1
+
+
+From 8b139cd4f1074ae0d95d9bff60db283a1ed72734 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Mon, 22 Aug 2022 11:04:47 +0200
+Subject: [PATCH 07/72] alpha: Fix generic brk system call emulation in
+ __brk_call (bug 29490)
+
+The kernel special-cases the zero argument for alpha brk, and we can
+use that to restore the generic Linux error handling behavior.
+
+Fixes commit b57ab258c1140bc45464b4b9908713e3e0ee35aa ("Linux:
+Introduce __brk_call for invoking the brk system call").
+
+(cherry picked from commit e7ad26ee3cb74e61d0637c888f24dd478d77af58)
+---
+ NEWS                                     | 1 +
+ sysdeps/unix/sysv/linux/alpha/brk_call.h | 7 +++----
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/NEWS b/NEWS
+index f8fb8db510..becab3ade9 100644
+--- a/NEWS
++++ b/NEWS
+@@ -11,6 +11,7 @@ The following bugs are resolved with this release:
+ 
+   [29446] _dlopen now ignores dl_caller argument in static mode
+   [29485] Linux: Terminate subprocess on late failure in tst-pidfd
++  [29490] alpha: New __brk_call implementation is broken
+ 
+ \f
+ Version 2.36
+diff --git a/sysdeps/unix/sysv/linux/alpha/brk_call.h b/sysdeps/unix/sysv/linux/alpha/brk_call.h
+index b8088cf13f..0b851b6c86 100644
+--- a/sysdeps/unix/sysv/linux/alpha/brk_call.h
++++ b/sysdeps/unix/sysv/linux/alpha/brk_call.h
+@@ -21,8 +21,7 @@ __brk_call (void *addr)
+ {
+   unsigned long int result = INTERNAL_SYSCALL_CALL (brk, addr);
+   if (result == -ENOMEM)
+-    /* Mimic the default error reporting behavior.  */
+-    return addr;
+-  else
+-    return (void *) result;
++    /* Mimic the generic error reporting behavior.  */
++    result = INTERNAL_SYSCALL_CALL (brk, 0);
++  return (void *) result;
+ }
+-- 
+2.38.1
+
+
+From d13a7a6f100576b1e30dc044b2e0c4cbcb6196f6 Mon Sep 17 00:00:00 2001
+From: Arjun Shankar <arjun@redhat.com>
+Date: Tue, 2 Aug 2022 11:10:25 +0200
+Subject: [PATCH 08/72] socket: Check lengths before advancing pointer in
+ CMSG_NXTHDR
+
+The inline and library functions that the CMSG_NXTHDR macro may expand
+to increment the pointer to the header before checking the stride of
+the increment against available space.  Since C only allows incrementing
+pointers to one past the end of an array, the increment must be done
+after a length check.  This commit fixes that and includes a regression
+test for CMSG_FIRSTHDR and CMSG_NXTHDR.
+
+The Linux, Hurd, and generic headers are all changed.
+
+Tested on Linux on armv7hl, i686, x86_64, aarch64, ppc64le, and s390x.
+
+[BZ #28846]
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit 9c443ac4559a47ed99859bd80d14dc4b6dd220a1)
+---
+ bits/socket.h                         | 40 ++++++++++--
+ socket/Makefile                       |  1 +
+ socket/tst-cmsghdr-skeleton.c         | 92 +++++++++++++++++++++++++++
+ socket/tst-cmsghdr.c                  | 56 ++++++++++++++++
+ sysdeps/mach/hurd/bits/socket.h       | 40 ++++++++++--
+ sysdeps/unix/sysv/linux/bits/socket.h | 40 ++++++++++--
+ sysdeps/unix/sysv/linux/cmsg_nxthdr.c | 36 ++++++++---
+ 7 files changed, 276 insertions(+), 29 deletions(-)
+ create mode 100644 socket/tst-cmsghdr-skeleton.c
+ create mode 100644 socket/tst-cmsghdr.c
+
+diff --git a/bits/socket.h b/bits/socket.h
+index 2b99dea33b..aac8c49b00 100644
+--- a/bits/socket.h
++++ b/bits/socket.h
+@@ -245,6 +245,12 @@ struct cmsghdr
+ 			 + CMSG_ALIGN (sizeof (struct cmsghdr)))
+ #define CMSG_LEN(len)   (CMSG_ALIGN (sizeof (struct cmsghdr)) + (len))
+ 
++/* Given a length, return the additional padding necessary such that
++   len + __CMSG_PADDING(len) == CMSG_ALIGN (len).  */
++#define __CMSG_PADDING(len) ((sizeof (size_t) \
++                              - ((len) & (sizeof (size_t) - 1))) \
++                             & (sizeof (size_t) - 1))
++
+ extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr,
+ 				      struct cmsghdr *__cmsg) __THROW;
+ #ifdef __USE_EXTERN_INLINES
+@@ -254,18 +260,38 @@ extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr,
+ _EXTERN_INLINE struct cmsghdr *
+ __NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg))
+ {
++  /* We may safely assume that __cmsg lies between __mhdr->msg_control and
++     __mhdr->msg_controllen because the user is required to obtain the first
++     cmsg via CMSG_FIRSTHDR, set its length, then obtain subsequent cmsgs
++     via CMSG_NXTHDR, setting lengths along the way.  However, we don't yet
++     trust the value of __cmsg->cmsg_len and therefore do not use it in any
++     pointer arithmetic until we check its value.  */
++
++  unsigned char * __msg_control_ptr = (unsigned char *) __mhdr->msg_control;
++  unsigned char * __cmsg_ptr = (unsigned char *) __cmsg;
++
++  size_t __size_needed = sizeof (struct cmsghdr)
++                         + __CMSG_PADDING (__cmsg->cmsg_len);
++
++  /* The current header is malformed, too small to be a full header.  */
+   if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr))
+-    /* The kernel header does this so there may be a reason.  */
+     return (struct cmsghdr *) 0;
+ 
++  /* There isn't enough space between __cmsg and the end of the buffer to
++  hold the current cmsg *and* the next one.  */
++  if (((size_t)
++         (__msg_control_ptr + __mhdr->msg_controllen - __cmsg_ptr)
++       < __size_needed)
++      || ((size_t)
++            (__msg_control_ptr + __mhdr->msg_controllen - __cmsg_ptr
++             - __size_needed)
++          < __cmsg->cmsg_len))
++
++    return (struct cmsghdr *) 0;
++
++  /* Now, we trust cmsg_len and can use it to find the next header.  */
+   __cmsg = (struct cmsghdr *) ((unsigned char *) __cmsg
+ 			       + CMSG_ALIGN (__cmsg->cmsg_len));
+-  if ((unsigned char *) (__cmsg + 1) > ((unsigned char *) __mhdr->msg_control
+-					+ __mhdr->msg_controllen)
+-      || ((unsigned char *) __cmsg + CMSG_ALIGN (__cmsg->cmsg_len)
+-	  > ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen)))
+-    /* No more entries.  */
+-    return (struct cmsghdr *) 0;
+   return __cmsg;
+ }
+ #endif	/* Use `extern inline'.  */
+diff --git a/socket/Makefile b/socket/Makefile
+index 156eec6c85..2bde78387f 100644
+--- a/socket/Makefile
++++ b/socket/Makefile
+@@ -34,6 +34,7 @@ routines := accept bind connect getpeername getsockname getsockopt	\
+ tests := \
+   tst-accept4 \
+   tst-sockopt \
++  tst-cmsghdr \
+   # tests
+ 
+ tests-internal := \
+diff --git a/socket/tst-cmsghdr-skeleton.c b/socket/tst-cmsghdr-skeleton.c
+new file mode 100644
+index 0000000000..4c6898569b
+--- /dev/null
++++ b/socket/tst-cmsghdr-skeleton.c
+@@ -0,0 +1,92 @@
++/* Test ancillary data header creation.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++/* We use the preprocessor to generate the function/macro tests instead of
++   using indirection because having all the macro expansions alongside
++   each other lets the compiler warn us about suspicious pointer
++   arithmetic across subsequent CMSG_{FIRST,NXT}HDR expansions.  */
++
++#include <stdint.h>
++
++#define RUN_TEST_CONCAT(suffix) run_test_##suffix
++#define RUN_TEST_FUNCNAME(suffix) RUN_TEST_CONCAT (suffix)
++
++static void
++RUN_TEST_FUNCNAME (CMSG_NXTHDR_IMPL) (void)
++{
++  struct msghdr m = {0};
++  struct cmsghdr *cmsg;
++  char cmsgbuf[3 * CMSG_SPACE (sizeof (PAYLOAD))] = {0};
++
++  m.msg_control = cmsgbuf;
++  m.msg_controllen = sizeof (cmsgbuf);
++
++  /* First header should point to the start of the buffer.  */
++  cmsg = CMSG_FIRSTHDR (&m);
++  TEST_VERIFY_EXIT ((char *) cmsg == cmsgbuf);
++
++  /* If the first header length consumes the entire buffer, there is no
++     space remaining for additional headers.  */
++  cmsg->cmsg_len = sizeof (cmsgbuf);
++  cmsg = CMSG_NXTHDR_IMPL (&m, cmsg);
++  TEST_VERIFY_EXIT (cmsg == NULL);
++
++  /* The first header length is so big, using it would cause an overflow.  */
++  cmsg = CMSG_FIRSTHDR (&m);
++  TEST_VERIFY_EXIT ((char *) cmsg == cmsgbuf);
++  cmsg->cmsg_len = SIZE_MAX;
++  cmsg = CMSG_NXTHDR_IMPL (&m, cmsg);
++  TEST_VERIFY_EXIT (cmsg == NULL);
++
++  /* The first header leaves just enough space to hold another header.  */
++  cmsg = CMSG_FIRSTHDR (&m);
++  TEST_VERIFY_EXIT ((char *) cmsg == cmsgbuf);
++  cmsg->cmsg_len = sizeof (cmsgbuf) - sizeof (struct cmsghdr);
++  cmsg = CMSG_NXTHDR_IMPL (&m, cmsg);
++  TEST_VERIFY_EXIT (cmsg != NULL);
++
++  /* The first header leaves space but not enough for another header.  */
++  cmsg = CMSG_FIRSTHDR (&m);
++  TEST_VERIFY_EXIT ((char *) cmsg == cmsgbuf);
++  cmsg->cmsg_len ++;
++  cmsg = CMSG_NXTHDR_IMPL (&m, cmsg);
++  TEST_VERIFY_EXIT (cmsg == NULL);
++
++  /* The second header leaves just enough space to hold another header.  */
++  cmsg = CMSG_FIRSTHDR (&m);
++  TEST_VERIFY_EXIT ((char *) cmsg == cmsgbuf);
++  cmsg->cmsg_len = CMSG_LEN (sizeof (PAYLOAD));
++  cmsg = CMSG_NXTHDR_IMPL (&m, cmsg);
++  TEST_VERIFY_EXIT (cmsg != NULL);
++  cmsg->cmsg_len = sizeof (cmsgbuf)
++                   - CMSG_SPACE (sizeof (PAYLOAD)) /* First header.  */
++                   - sizeof (struct cmsghdr);
++  cmsg = CMSG_NXTHDR_IMPL (&m, cmsg);
++  TEST_VERIFY_EXIT (cmsg != NULL);
++
++  /* The second header leaves space but not enough for another header.  */
++  cmsg = CMSG_FIRSTHDR (&m);
++  TEST_VERIFY_EXIT ((char *) cmsg == cmsgbuf);
++  cmsg = CMSG_NXTHDR_IMPL (&m, cmsg);
++  TEST_VERIFY_EXIT (cmsg != NULL);
++  cmsg->cmsg_len ++;
++  cmsg = CMSG_NXTHDR_IMPL (&m, cmsg);
++  TEST_VERIFY_EXIT (cmsg == NULL);
++
++  return;
++}
+diff --git a/socket/tst-cmsghdr.c b/socket/tst-cmsghdr.c
+new file mode 100644
+index 0000000000..68c96d3c9d
+--- /dev/null
++++ b/socket/tst-cmsghdr.c
+@@ -0,0 +1,56 @@
++/* Test ancillary data header creation.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <sys/socket.h>
++#include <gnu/lib-names.h>
++#include <support/xdlfcn.h>
++#include <support/check.h>
++
++#define PAYLOAD "Hello, World!"
++
++/* CMSG_NXTHDR is a macro that calls an inline function defined in
++   bits/socket.h.  In case the function cannot be inlined, libc.so carries
++   a copy.  Both versions need to be tested.  */
++
++#define CMSG_NXTHDR_IMPL CMSG_NXTHDR
++#include "tst-cmsghdr-skeleton.c"
++#undef CMSG_NXTHDR_IMPL
++
++static struct cmsghdr * (* cmsg_nxthdr) (struct msghdr *, struct cmsghdr *);
++
++#define CMSG_NXTHDR_IMPL cmsg_nxthdr
++#include "tst-cmsghdr-skeleton.c"
++#undef CMSG_NXTHDR_IMPL
++
++static int
++do_test (void)
++{
++  static void *handle;
++
++  run_test_CMSG_NXTHDR ();
++
++  handle = xdlopen (LIBC_SO, RTLD_LAZY);
++  cmsg_nxthdr = (struct cmsghdr * (*) (struct msghdr *, struct cmsghdr *))
++                  xdlsym (handle, "__cmsg_nxthdr");
++
++  run_test_cmsg_nxthdr ();
++
++  return 0;
++}
++
++#include <support/test-driver.c>
+diff --git a/sysdeps/mach/hurd/bits/socket.h b/sysdeps/mach/hurd/bits/socket.h
+index 5b35ea81ec..70fce4fb27 100644
+--- a/sysdeps/mach/hurd/bits/socket.h
++++ b/sysdeps/mach/hurd/bits/socket.h
+@@ -249,6 +249,12 @@ struct cmsghdr
+ 			 + CMSG_ALIGN (sizeof (struct cmsghdr)))
+ #define CMSG_LEN(len)   (CMSG_ALIGN (sizeof (struct cmsghdr)) + (len))
+ 
++/* Given a length, return the additional padding necessary such that
++   len + __CMSG_PADDING(len) == CMSG_ALIGN (len).  */
++#define __CMSG_PADDING(len) ((sizeof (size_t) \
++                              - ((len) & (sizeof (size_t) - 1))) \
++                             & (sizeof (size_t) - 1))
++
+ extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr,
+ 				      struct cmsghdr *__cmsg) __THROW;
+ #ifdef __USE_EXTERN_INLINES
+@@ -258,18 +264,38 @@ extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr,
+ _EXTERN_INLINE struct cmsghdr *
+ __NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg))
+ {
++  /* We may safely assume that __cmsg lies between __mhdr->msg_control and
++     __mhdr->msg_controllen because the user is required to obtain the first
++     cmsg via CMSG_FIRSTHDR, set its length, then obtain subsequent cmsgs
++     via CMSG_NXTHDR, setting lengths along the way.  However, we don't yet
++     trust the value of __cmsg->cmsg_len and therefore do not use it in any
++     pointer arithmetic until we check its value.  */
++
++  unsigned char * __msg_control_ptr = (unsigned char *) __mhdr->msg_control;
++  unsigned char * __cmsg_ptr = (unsigned char *) __cmsg;
++
++  size_t __size_needed = sizeof (struct cmsghdr)
++                         + __CMSG_PADDING (__cmsg->cmsg_len);
++
++  /* The current header is malformed, too small to be a full header.  */
+   if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr))
+-    /* The kernel header does this so there may be a reason.  */
+     return (struct cmsghdr *) 0;
+ 
++  /* There isn't enough space between __cmsg and the end of the buffer to
++  hold the current cmsg *and* the next one.  */
++  if (((size_t)
++         (__msg_control_ptr + __mhdr->msg_controllen - __cmsg_ptr)
++       < __size_needed)
++      || ((size_t)
++            (__msg_control_ptr + __mhdr->msg_controllen - __cmsg_ptr
++             - __size_needed)
++          < __cmsg->cmsg_len))
++
++    return (struct cmsghdr *) 0;
++
++  /* Now, we trust cmsg_len and can use it to find the next header.  */
+   __cmsg = (struct cmsghdr *) ((unsigned char *) __cmsg
+ 			       + CMSG_ALIGN (__cmsg->cmsg_len));
+-  if ((unsigned char *) (__cmsg + 1) > ((unsigned char *) __mhdr->msg_control
+-					+ __mhdr->msg_controllen)
+-      || ((unsigned char *) __cmsg + CMSG_ALIGN (__cmsg->cmsg_len)
+-	  > ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen)))
+-    /* No more entries.  */
+-    return (struct cmsghdr *) 0;
+   return __cmsg;
+ }
+ #endif	/* Use `extern inline'.  */
+diff --git a/sysdeps/unix/sysv/linux/bits/socket.h b/sysdeps/unix/sysv/linux/bits/socket.h
+index 4f1f810ea1..539b8d7716 100644
+--- a/sysdeps/unix/sysv/linux/bits/socket.h
++++ b/sysdeps/unix/sysv/linux/bits/socket.h
+@@ -307,6 +307,12 @@ struct cmsghdr
+ 			 + CMSG_ALIGN (sizeof (struct cmsghdr)))
+ #define CMSG_LEN(len)   (CMSG_ALIGN (sizeof (struct cmsghdr)) + (len))
+ 
++/* Given a length, return the additional padding necessary such that
++   len + __CMSG_PADDING(len) == CMSG_ALIGN (len).  */
++#define __CMSG_PADDING(len) ((sizeof (size_t) \
++                              - ((len) & (sizeof (size_t) - 1))) \
++                             & (sizeof (size_t) - 1))
++
+ extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr,
+ 				      struct cmsghdr *__cmsg) __THROW;
+ #ifdef __USE_EXTERN_INLINES
+@@ -316,18 +322,38 @@ extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr,
+ _EXTERN_INLINE struct cmsghdr *
+ __NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg))
+ {
++  /* We may safely assume that __cmsg lies between __mhdr->msg_control and
++     __mhdr->msg_controllen because the user is required to obtain the first
++     cmsg via CMSG_FIRSTHDR, set its length, then obtain subsequent cmsgs
++     via CMSG_NXTHDR, setting lengths along the way.  However, we don't yet
++     trust the value of __cmsg->cmsg_len and therefore do not use it in any
++     pointer arithmetic until we check its value.  */
++
++  unsigned char * __msg_control_ptr = (unsigned char *) __mhdr->msg_control;
++  unsigned char * __cmsg_ptr = (unsigned char *) __cmsg;
++
++  size_t __size_needed = sizeof (struct cmsghdr)
++                         + __CMSG_PADDING (__cmsg->cmsg_len);
++
++  /* The current header is malformed, too small to be a full header.  */
+   if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr))
+-    /* The kernel header does this so there may be a reason.  */
+     return (struct cmsghdr *) 0;
+ 
++  /* There isn't enough space between __cmsg and the end of the buffer to
++  hold the current cmsg *and* the next one.  */
++  if (((size_t)
++         (__msg_control_ptr + __mhdr->msg_controllen - __cmsg_ptr)
++       < __size_needed)
++      || ((size_t)
++            (__msg_control_ptr + __mhdr->msg_controllen - __cmsg_ptr
++             - __size_needed)
++          < __cmsg->cmsg_len))
++
++    return (struct cmsghdr *) 0;
++
++  /* Now, we trust cmsg_len and can use it to find the next header.  */
+   __cmsg = (struct cmsghdr *) ((unsigned char *) __cmsg
+ 			       + CMSG_ALIGN (__cmsg->cmsg_len));
+-  if ((unsigned char *) (__cmsg + 1) > ((unsigned char *) __mhdr->msg_control
+-					+ __mhdr->msg_controllen)
+-      || ((unsigned char *) __cmsg + CMSG_ALIGN (__cmsg->cmsg_len)
+-	  > ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen)))
+-    /* No more entries.  */
+-    return (struct cmsghdr *) 0;
+   return __cmsg;
+ }
+ #endif	/* Use `extern inline'.  */
+diff --git a/sysdeps/unix/sysv/linux/cmsg_nxthdr.c b/sysdeps/unix/sysv/linux/cmsg_nxthdr.c
+index 15b7a3a925..24f72b797a 100644
+--- a/sysdeps/unix/sysv/linux/cmsg_nxthdr.c
++++ b/sysdeps/unix/sysv/linux/cmsg_nxthdr.c
+@@ -23,18 +23,38 @@
+ struct cmsghdr *
+ __cmsg_nxthdr (struct msghdr *mhdr, struct cmsghdr *cmsg)
+ {
++  /* We may safely assume that cmsg lies between mhdr->msg_control and
++     mhdr->msg_controllen because the user is required to obtain the first
++     cmsg via CMSG_FIRSTHDR, set its length, then obtain subsequent cmsgs
++     via CMSG_NXTHDR, setting lengths along the way.  However, we don't yet
++     trust the value of cmsg->cmsg_len and therefore do not use it in any
++     pointer arithmetic until we check its value.  */
++
++  unsigned char * msg_control_ptr = (unsigned char *) mhdr->msg_control;
++  unsigned char * cmsg_ptr = (unsigned char *) cmsg;
++
++  size_t size_needed = sizeof (struct cmsghdr)
++                       + __CMSG_PADDING (cmsg->cmsg_len);
++
++  /* The current header is malformed, too small to be a full header.  */
+   if ((size_t) cmsg->cmsg_len < sizeof (struct cmsghdr))
+-    /* The kernel header does this so there may be a reason.  */
+-    return NULL;
++    return (struct cmsghdr *) 0;
++
++  /* There isn't enough space between cmsg and the end of the buffer to
++  hold the current cmsg *and* the next one.  */
++  if (((size_t)
++         (msg_control_ptr + mhdr->msg_controllen - cmsg_ptr)
++       < size_needed)
++      || ((size_t)
++            (msg_control_ptr + mhdr->msg_controllen - cmsg_ptr
++             - size_needed)
++          < cmsg->cmsg_len))
++
++    return (struct cmsghdr *) 0;
+ 
++  /* Now, we trust cmsg_len and can use it to find the next header.  */
+   cmsg = (struct cmsghdr *) ((unsigned char *) cmsg
+ 			     + CMSG_ALIGN (cmsg->cmsg_len));
+-  if ((unsigned char *) (cmsg + 1) > ((unsigned char *) mhdr->msg_control
+-				      + mhdr->msg_controllen)
+-      || ((unsigned char *) cmsg + CMSG_ALIGN (cmsg->cmsg_len)
+-	  > ((unsigned char *) mhdr->msg_control + mhdr->msg_controllen)))
+-    /* No more entries.  */
+-    return NULL;
+   return cmsg;
+ }
+ libc_hidden_def (__cmsg_nxthdr)
+-- 
+2.38.1
+
+
+From 5c62874f423af93e97b51bc9a57af228a546156f Mon Sep 17 00:00:00 2001
+From: Arjun Shankar <arjun@redhat.com>
+Date: Mon, 22 Aug 2022 18:21:14 +0200
+Subject: [PATCH 09/72] NEWS: Add entry for bug 28846
+
+---
+ NEWS | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/NEWS b/NEWS
+index becab3ade9..ae30900bbc 100644
+--- a/NEWS
++++ b/NEWS
+@@ -9,6 +9,7 @@ Version 2.36.1
+ 
+ The following bugs are resolved with this release:
+ 
++  [28846] CMSG_NXTHDR may trigger -Wstrict-overflow warning
+   [29446] _dlopen now ignores dl_caller argument in static mode
+   [29485] Linux: Terminate subprocess on late failure in tst-pidfd
+   [29490] alpha: New __brk_call implementation is broken
+-- 
+2.38.1
+
+
+From 0062e7dd1c3674ece2daca53a898badd28b60421 Mon Sep 17 00:00:00 2001
+From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Wed, 10 Aug 2022 16:24:06 -0300
+Subject: [PATCH 10/72] glibcextract.py: Add compile_c_snippet
+
+It might be used on tests to check if a snippet build with the provided
+compiler and flags.
+
+Reviewed-by: Florian Weimer <fweimer@redhat.com>
+(cherry picked from commit 841afa116e32b3c7195475769c26bf46fd870d32)
+---
+ scripts/glibcextract.py | 19 +++++++++++++++++++
+ 1 file changed, 19 insertions(+)
+
+diff --git a/scripts/glibcextract.py b/scripts/glibcextract.py
+index 43ab58ffe2..36d204c9b0 100644
+--- a/scripts/glibcextract.py
++++ b/scripts/glibcextract.py
+@@ -17,6 +17,7 @@
+ # License along with the GNU C Library; if not, see
+ # <https://www.gnu.org/licenses/>.
+ 
++import collections
+ import os.path
+ import re
+ import subprocess
+@@ -173,3 +174,21 @@ def compare_macro_consts(source_1, source_2, cc, macro_re, exclude_re=None,
+             if not allow_extra_2:
+                 ret = 1
+     return ret
++
++CompileResult = collections.namedtuple("CompileResult", "returncode output")
++
++def compile_c_snippet(snippet, cc, extra_cc_args=''):
++    """Compile and return whether the SNIPPET can be build with CC along
++       EXTRA_CC_ARGS compiler flags.  Return a CompileResult with RETURNCODE
++       being 0 for success, or the failure value and the compiler output.
++    """
++    with tempfile.TemporaryDirectory() as temp_dir:
++        c_file_name = os.path.join(temp_dir, 'test.c')
++        obj_file_name = os.path.join(temp_dir, 'test.o')
++        with open(c_file_name, 'w') as c_file:
++            c_file.write(snippet + '\n')
++        cmd = cc.split() + extra_cc_args.split() + ['-c', '-o', obj_file_name,
++                c_file_name]
++        r = subprocess.run(cmd, check=False, stdout=subprocess.PIPE,
++                stderr=subprocess.STDOUT)
++        return CompileResult(r.returncode, r.stdout)
+-- 
+2.38.1
+
+
+From 1cc5513114e76083669cba1b11252aad35525e69 Mon Sep 17 00:00:00 2001
+From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Wed, 10 Aug 2022 14:24:44 -0300
+Subject: [PATCH 11/72] linux: Use compile_c_snippet to check linux/pidfd.h
+ availability
+
+Instead of tying to a specific kernel version.
+
+Checked on x86_64-linux-gnu.
+
+Reviewed-by: Florian Weimer <fweimer@redhat.com>
+(cherry picked from commit 1542019b69b7ec7b2cd34357af035e406d153631)
+---
+ sysdeps/unix/sysv/linux/tst-pidfd-consts.py | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/sysdeps/unix/sysv/linux/tst-pidfd-consts.py b/sysdeps/unix/sysv/linux/tst-pidfd-consts.py
+index 90cbb9be64..d732173abd 100644
+--- a/sysdeps/unix/sysv/linux/tst-pidfd-consts.py
++++ b/sysdeps/unix/sysv/linux/tst-pidfd-consts.py
+@@ -33,11 +33,13 @@ def main():
+                         help='C compiler (including options) to use')
+     args = parser.parse_args()
+ 
+-    linux_version_headers = glibcsyscalls.linux_kernel_version(args.cc)
+-    # Linux started to provide pidfd.h with 5.10.
+-    if linux_version_headers < (5, 10):
++    if glibcextract.compile_c_snippet(
++            '#include <linux/pidfd.h>',
++            args.cc).returncode != 0:
+         sys.exit (77)
+-    linux_version_glibc = (5, 18)
++
++    linux_version_headers = glibcsyscalls.linux_kernel_version(args.cc)
++    linux_version_glibc = (5, 19)
+     sys.exit(glibcextract.compare_macro_consts(
+                 '#include <sys/pidfd.h>\n',
+                 '#include <asm/fcntl.h>\n'
+-- 
+2.38.1
+
+
+From 4dad97e2a2e510c6b53a0add29a2188714fcf4ab Mon Sep 17 00:00:00 2001
+From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Wed, 10 Aug 2022 14:24:45 -0300
+Subject: [PATCH 12/72] linux: Mimic kernel defition for BLOCK_SIZE
+
+To avoid possible warnings if the kernel header is included before
+sys/mount.h.
+
+Reviewed-by: Florian Weimer <fweimer@redhat.com>
+(cherry picked from commit c68b6044bc7945716431f1adc091b17c39b80a06)
+---
+ sysdeps/unix/sysv/linux/sys/mount.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/sysdeps/unix/sysv/linux/sys/mount.h b/sysdeps/unix/sysv/linux/sys/mount.h
+index f965986ba8..df6b0dbb42 100644
+--- a/sysdeps/unix/sysv/linux/sys/mount.h
++++ b/sysdeps/unix/sysv/linux/sys/mount.h
+@@ -27,8 +27,8 @@
+ #include <stddef.h>
+ #include <sys/ioctl.h>
+ 
+-#define BLOCK_SIZE	1024
+ #define BLOCK_SIZE_BITS	10
++#define BLOCK_SIZE	(1<<BLOCK_SIZE_BITS)
+ 
+ 
+ /* These are the fs-independent mount-flags: up to 16 flags are
+-- 
+2.38.1
+
+
+From d48813227b63a0d92ea357ea0733229ed74e31ab Mon Sep 17 00:00:00 2001
+From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Wed, 10 Aug 2022 14:24:46 -0300
+Subject: [PATCH 13/72] linux: Use compile_c_snippet to check linux/mount.h
+ availability
+
+Checked on x86_64-linux-gnu.
+
+Reviewed-by: Florian Weimer <fweimer@redhat.com>
+(cherry picked from commit e1226cdc6b209539a92d32d5b620ba53fd35abf3)
+---
+ sysdeps/unix/sysv/linux/tst-mount-consts.py | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/sysdeps/unix/sysv/linux/tst-mount-consts.py b/sysdeps/unix/sysv/linux/tst-mount-consts.py
+index a62f803123..be2ef2daf1 100755
+--- a/sysdeps/unix/sysv/linux/tst-mount-consts.py
++++ b/sysdeps/unix/sysv/linux/tst-mount-consts.py
+@@ -33,6 +33,11 @@ def main():
+                         help='C compiler (including options) to use')
+     args = parser.parse_args()
+ 
++    if glibcextract.compile_c_snippet(
++            '#include <linux/mount.h>',
++            args.cc).returncode != 0:
++        sys.exit (77)
++
+     linux_version_headers = glibcsyscalls.linux_kernel_version(args.cc)
+     # Constants in glibc were updated to match Linux v5.16.  When glibc
+     # constants are updated this value should be updated to match the
+-- 
+2.38.1
+
+
+From bb1e8b0ca99b5cbedfae3e6245528a87d95ff3e2 Mon Sep 17 00:00:00 2001
+From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Wed, 10 Aug 2022 14:24:47 -0300
+Subject: [PATCH 14/72] linux: Fix sys/mount.h usage with kernel headers
+
+Now that kernel exports linux/mount.h and includes it on linux/fs.h,
+its definitions might clash with glibc exports sys/mount.h.  To avoid
+the need to rearrange the Linux header to be always after glibc one,
+the glibc sys/mount.h is changed to:
+
+  1. Undefine the macros also used as enum constants.  This covers prior
+     inclusion of <linux/mount.h> (for instance MS_RDONLY).
+
+  2. Include <linux/mount.h> based on the usual __has_include check
+     (needs to use __has_include ("linux/mount.h") to paper over GCC
+     bugs.
+
+  3. Define enum fsconfig_command only if FSOPEN_CLOEXEC is not defined.
+     (FSOPEN_CLOEXEC should be a very close proxy.)
+
+  4. Define struct mount_attr if MOUNT_ATTR_SIZE_VER0 is not defined.
+     (Added in the same commit on the Linux side.)
+
+This patch also adds some tests to check if including linux/fs.h and
+linux/mount.h after and before sys/mount.h does work.
+
+Checked on x86_64-linux-gnu.
+
+Reviewed-by: Florian Weimer <fweimer@redhat.com>
+(cherry picked from commit 774058d72942249f71d74e7f2b639f77184160a6)
+---
+ sysdeps/unix/sysv/linux/Makefile             |  8 +++
+ sysdeps/unix/sysv/linux/sys/mount.h          | 71 +++++++++++++++++---
+ sysdeps/unix/sysv/linux/tst-mount-compile.py | 66 ++++++++++++++++++
+ 3 files changed, 137 insertions(+), 8 deletions(-)
+ create mode 100755 sysdeps/unix/sysv/linux/tst-mount-compile.py
+
+diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
+index a139a16532..3ceda9fdbf 100644
+--- a/sysdeps/unix/sysv/linux/Makefile
++++ b/sysdeps/unix/sysv/linux/Makefile
+@@ -265,6 +265,14 @@ $(objpfx)tst-mount-consts.out: ../sysdeps/unix/sysv/linux/tst-mount-consts.py
+ 	  < /dev/null > $@ 2>&1; $(evaluate-test)
+ $(objpfx)tst-mount-consts.out: $(sysdeps-linux-python-deps)
+ 
++tests-special += $(objpfx)tst-mount-compile.out
++$(objpfx)tst-mount-compile.out: ../sysdeps/unix/sysv/linux/tst-mount-compile.py
++	$(sysdeps-linux-python) \
++	  ../sysdeps/unix/sysv/linux/tst-mount-compile.py \
++	    $(sysdeps-linux-python-cc) \
++	  < /dev/null > $@ 2>&1; $(evaluate-test)
++$(objpfx)tst-mount-compile.out: $(sysdeps-linux-python-deps)
++
+ tst-rseq-disable-ENV = GLIBC_TUNABLES=glibc.pthread.rseq=0
+ 
+ endif # $(subdir) == misc
+diff --git a/sysdeps/unix/sysv/linux/sys/mount.h b/sysdeps/unix/sysv/linux/sys/mount.h
+index df6b0dbb42..2e3fd6a7fe 100644
+--- a/sysdeps/unix/sysv/linux/sys/mount.h
++++ b/sysdeps/unix/sysv/linux/sys/mount.h
+@@ -27,6 +27,13 @@
+ #include <stddef.h>
+ #include <sys/ioctl.h>
+ 
++#ifdef __has_include
++# if __has_include ("linux/mount.h")
++#  include "linux/mount.h"
++# endif
++#endif
++
++
+ #define BLOCK_SIZE_BITS	10
+ #define BLOCK_SIZE	(1<<BLOCK_SIZE_BITS)
+ 
+@@ -35,69 +42,98 @@
+    supported  */
+ enum
+ {
++#undef MS_RDONLY
+   MS_RDONLY = 1,		/* Mount read-only.  */
+ #define MS_RDONLY	MS_RDONLY
++#undef MS_NOSUID
+   MS_NOSUID = 2,		/* Ignore suid and sgid bits.  */
+ #define MS_NOSUID	MS_NOSUID
++#undef MS_NODEV
+   MS_NODEV = 4,			/* Disallow access to device special files.  */
+ #define MS_NODEV	MS_NODEV
++#undef MS_NOEXEC
+   MS_NOEXEC = 8,		/* Disallow program execution.  */
+ #define MS_NOEXEC	MS_NOEXEC
++#undef MS_SYNCHRONOUS
+   MS_SYNCHRONOUS = 16,		/* Writes are synced at once.  */
+ #define MS_SYNCHRONOUS	MS_SYNCHRONOUS
++#undef MS_REMOUNT
+   MS_REMOUNT = 32,		/* Alter flags of a mounted FS.  */
+ #define MS_REMOUNT	MS_REMOUNT
++#undef MS_MANDLOCK
+   MS_MANDLOCK = 64,		/* Allow mandatory locks on an FS.  */
+ #define MS_MANDLOCK	MS_MANDLOCK
++#undef MS_DIRSYNC
+   MS_DIRSYNC = 128,		/* Directory modifications are synchronous.  */
+ #define MS_DIRSYNC	MS_DIRSYNC
++#undef MS_NOSYMFOLLOW
+   MS_NOSYMFOLLOW = 256,		/* Do not follow symlinks.  */
+ #define MS_NOSYMFOLLOW	MS_NOSYMFOLLOW
++#undef MS_NOATIME
+   MS_NOATIME = 1024,		/* Do not update access times.  */
+ #define MS_NOATIME	MS_NOATIME
++#undef MS_NODIRATIME
+   MS_NODIRATIME = 2048,		/* Do not update directory access times.  */
+ #define MS_NODIRATIME	MS_NODIRATIME
++#undef MS_BIND
+   MS_BIND = 4096,		/* Bind directory at different place.  */
+ #define MS_BIND		MS_BIND
++#undef MS_MOVE
+   MS_MOVE = 8192,
+ #define MS_MOVE		MS_MOVE
++#undef MS_REC
+   MS_REC = 16384,
+ #define MS_REC		MS_REC
++#undef MS_SILENT
+   MS_SILENT = 32768,
+ #define MS_SILENT	MS_SILENT
++#undef MS_POSIXACL
+   MS_POSIXACL = 1 << 16,	/* VFS does not apply the umask.  */
+ #define MS_POSIXACL	MS_POSIXACL
++#undef MS_UNBINDABLE
+   MS_UNBINDABLE = 1 << 17,	/* Change to unbindable.  */
+ #define MS_UNBINDABLE	MS_UNBINDABLE
++#undef MS_PRIVATE
+   MS_PRIVATE = 1 << 18,		/* Change to private.  */
+ #define MS_PRIVATE	MS_PRIVATE
++#undef MS_SLAVE
+   MS_SLAVE = 1 << 19,		/* Change to slave.  */
+ #define MS_SLAVE	MS_SLAVE
++#undef MS_SHARED
+   MS_SHARED = 1 << 20,		/* Change to shared.  */
+ #define MS_SHARED	MS_SHARED
++#undef MS_RELATIME
+   MS_RELATIME = 1 << 21,	/* Update atime relative to mtime/ctime.  */
+ #define MS_RELATIME	MS_RELATIME
++#undef MS_KERNMOUNT
+   MS_KERNMOUNT = 1 << 22,	/* This is a kern_mount call.  */
+ #define MS_KERNMOUNT	MS_KERNMOUNT
++#undef MS_I_VERSION
+   MS_I_VERSION =  1 << 23,	/* Update inode I_version field.  */
+ #define MS_I_VERSION	MS_I_VERSION
++#undef MS_STRICTATIME
+   MS_STRICTATIME = 1 << 24,	/* Always perform atime updates.  */
+ #define MS_STRICTATIME	MS_STRICTATIME
++#undef MS_LAZYTIME
+   MS_LAZYTIME = 1 << 25,	/* Update the on-disk [acm]times lazily.  */
+ #define MS_LAZYTIME	MS_LAZYTIME
++#undef MS_ACTIVE
+   MS_ACTIVE = 1 << 30,
+ #define MS_ACTIVE	MS_ACTIVE
++#undef MS_NOUSER
+   MS_NOUSER = 1 << 31
+ #define MS_NOUSER	MS_NOUSER
+ };
+ 
+ /* Flags that can be altered by MS_REMOUNT  */
++#undef MS_RMT_MASK
+ #define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_I_VERSION \
+ 		     |MS_LAZYTIME)
+ 
+ 
+ /* Magic mount flag number. Has to be or-ed to the flag values.  */
+ 
++#undef MS_MGC_VAL
+ #define MS_MGC_VAL 0xc0ed0000	/* Magic flag number to indicate "new" flags */
+ #define MS_MGC_MSK 0xffff0000	/* Magic flag number mask */
+ 
+@@ -106,20 +142,35 @@ enum
+    is probably as bad and I don't want to create yet another include
+    file.  */
+ 
++#undef BLKROSET
+ #define BLKROSET   _IO(0x12, 93) /* Set device read-only (0 = read-write).  */
++#undef BLKROGET
+ #define BLKROGET   _IO(0x12, 94) /* Get read-only status (0 = read_write).  */
++#undef BLKRRPART
+ #define BLKRRPART  _IO(0x12, 95) /* Re-read partition table.  */
++#undef BLKGETSIZE
+ #define BLKGETSIZE _IO(0x12, 96) /* Return device size.  */
++#undef BLKFLSBUF
+ #define BLKFLSBUF  _IO(0x12, 97) /* Flush buffer cache.  */
++#undef BLKRASET
+ #define BLKRASET   _IO(0x12, 98) /* Set read ahead for block device.  */
++#undef BLKRAGET
+ #define BLKRAGET   _IO(0x12, 99) /* Get current read ahead setting.  */
++#undef BLKFRASET
+ #define BLKFRASET  _IO(0x12,100) /* Set filesystem read-ahead.  */
++#undef BLKFRAGET
+ #define BLKFRAGET  _IO(0x12,101) /* Get filesystem read-ahead.  */
++#undef BLKSECTSET
+ #define BLKSECTSET _IO(0x12,102) /* Set max sectors per request.  */
++#undef BLKSECTGET
+ #define BLKSECTGET _IO(0x12,103) /* Get max sectors per request.  */
++#undef BLKSSZGET
+ #define BLKSSZGET  _IO(0x12,104) /* Get block device sector size.  */
++#undef BLKBSZGET
+ #define BLKBSZGET  _IOR(0x12,112,size_t)
++#undef BLKBSZSET
+ #define BLKBSZSET  _IOW(0x12,113,size_t)
++#undef BLKGETSIZE64
+ #define BLKGETSIZE64 _IOR(0x12,114,size_t) /* return device size.  */
+ 
+ 
+@@ -157,6 +208,7 @@ enum
+ #define MOUNT_ATTR_NOSYMFOLLOW  0x00200000 /* Do not follow symlinks.  */
+ 
+ 
++#ifndef MOUNT_ATTR_SIZE_VER0
+ /* For mount_setattr.  */
+ struct mount_attr
+ {
+@@ -165,6 +217,7 @@ struct mount_attr
+   uint64_t propagation;
+   uint64_t userns_fd;
+ };
++#endif
+ 
+ #define MOUNT_ATTR_SIZE_VER0    32 /* sizeof first published struct */
+ 
+@@ -185,26 +238,28 @@ struct mount_attr
+ #define FSPICK_EMPTY_PATH       0x00000008
+ 
+ 
++#ifndef FSOPEN_CLOEXEC
+ /* The type of fsconfig call made.   */
+ enum fsconfig_command
+ {
+   FSCONFIG_SET_FLAG       = 0,    /* Set parameter, supplying no value */
+-#define FSCONFIG_SET_FLAG FSCONFIG_SET_FLAG
++# define FSCONFIG_SET_FLAG FSCONFIG_SET_FLAG
+   FSCONFIG_SET_STRING     = 1,    /* Set parameter, supplying a string value */
+-#define FSCONFIG_SET_STRING FSCONFIG_SET_STRING
++# define FSCONFIG_SET_STRING FSCONFIG_SET_STRING
+   FSCONFIG_SET_BINARY     = 2,    /* Set parameter, supplying a binary blob value */
+-#define FSCONFIG_SET_BINARY FSCONFIG_SET_BINARY
++# define FSCONFIG_SET_BINARY FSCONFIG_SET_BINARY
+   FSCONFIG_SET_PATH       = 3,    /* Set parameter, supplying an object by path */
+-#define FSCONFIG_SET_PATH FSCONFIG_SET_PATH
++# define FSCONFIG_SET_PATH FSCONFIG_SET_PATH
+   FSCONFIG_SET_PATH_EMPTY = 4,    /* Set parameter, supplying an object by (empty) path */
+-#define FSCONFIG_SET_PATH_EMPTY FSCONFIG_SET_PATH_EMPTY
++# define FSCONFIG_SET_PATH_EMPTY FSCONFIG_SET_PATH_EMPTY
+   FSCONFIG_SET_FD         = 5,    /* Set parameter, supplying an object by fd */
+-#define FSCONFIG_SET_FD FSCONFIG_SET_FD
++# define FSCONFIG_SET_FD FSCONFIG_SET_FD
+   FSCONFIG_CMD_CREATE     = 6,    /* Invoke superblock creation */
+-#define FSCONFIG_CMD_CREATE FSCONFIG_CMD_CREATE
++# define FSCONFIG_CMD_CREATE FSCONFIG_CMD_CREATE
+   FSCONFIG_CMD_RECONFIGURE = 7,   /* Invoke superblock reconfiguration */
+-#define FSCONFIG_CMD_RECONFIGURE FSCONFIG_CMD_RECONFIGURE
++# define FSCONFIG_CMD_RECONFIGURE FSCONFIG_CMD_RECONFIGURE
+ };
++#endif
+ 
+ /* open_tree flags.  */
+ #define OPEN_TREE_CLONE    1         /* Clone the target tree and attach the clone */
+diff --git a/sysdeps/unix/sysv/linux/tst-mount-compile.py b/sysdeps/unix/sysv/linux/tst-mount-compile.py
+new file mode 100755
+index 0000000000..0ec74d4e0b
+--- /dev/null
++++ b/sysdeps/unix/sysv/linux/tst-mount-compile.py
+@@ -0,0 +1,66 @@
++#!/usr/bin/python3
++# Check if glibc provided sys/mount.h can be used along related kernel
++# headers.
++# Copyright (C) 2022 Free Software Foundation, Inc.
++# This file is part of the GNU C Library.
++#
++# The GNU C Library is free software; you can redistribute it and/or
++# modify it under the terms of the GNU Lesser General Public
++# License as published by the Free Software Foundation; either
++# version 2.1 of the License, or (at your option) any later version.
++#
++# The GNU C Library is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++# Lesser General Public License for more details.
++#
++# You should have received a copy of the GNU Lesser General Public
++# License along with the GNU C Library; if not, see
++# <https://www.gnu.org/licenses/>.
++
++import argparse
++import sys
++
++import glibcextract
++
++
++def main():
++    """The main entry point."""
++    parser = argparse.ArgumentParser(
++        description='Check if glibc provided sys/mount.h can be '
++                    ' used along related kernel headers.')
++    parser.add_argument('--cc', metavar='CC',
++                        help='C compiler (including options) to use')
++    args = parser.parse_args()
++
++    if glibcextract.compile_c_snippet(
++            '#include <linux/mount.h>',
++            args.cc).returncode != 0:
++        sys.exit (77)
++
++    def check(testname, snippet):
++        # Add -Werror to catch macro redefinitions and _ISOMAC to avoid
++        # internal glibc definitions.
++        r = glibcextract.compile_c_snippet(snippet, args.cc,
++                '-Werror -D_ISOMAC')
++        if r.returncode != 0:
++            print('error: test {}:\n{}'.format(testname, r.output.decode()))
++        return r.returncode
++
++    status = max(
++        check("sys/mount.h + linux/mount.h",
++              "#include <sys/mount.h>\n"
++              "#include <linux/mount.h>"),
++        check("sys/mount.h + linux/fs.h",
++              "#include <sys/mount.h>\n"
++              "#include <linux/fs.h>"),
++        check("linux/mount.h + sys/mount.h",
++              "#include <linux/mount.h>\n"
++              "#include <sys/mount.h>"),
++        check("linux/fs.h + sys/mount.h",
++              "#include <linux/fs.h>\n"
++              "#include <sys/mount.h>"))
++    sys.exit(status)
++
++if __name__ == '__main__':
++    main()
+-- 
+2.38.1
+
+
+From 3bd3c612e98a53ce60ed972f5cd2b90628b3cba5 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 16 Aug 2022 09:25:23 +0200
+Subject: [PATCH 15/72] Linux: Fix enum fsconfig_command detection in
+ <sys/mount.h>
+
+The #ifdef FSOPEN_CLOEXEC check did not work because the macro
+was always defined in this header prior to the check, so that
+the <linux/mount.h> contents did not matter.
+
+Fixes commit 774058d72942249f71d74e7f2b639f77184160a6
+("linux: Fix sys/mount.h usage with kernel headers").
+
+(cherry picked from commit 2955ef4b7c9b56fcd7abfeddef7ee83c60abff98)
+---
+ sysdeps/unix/sysv/linux/sys/mount.h | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/sysdeps/unix/sysv/linux/sys/mount.h b/sysdeps/unix/sysv/linux/sys/mount.h
+index 2e3fd6a7fe..19841d0738 100644
+--- a/sysdeps/unix/sysv/linux/sys/mount.h
++++ b/sysdeps/unix/sysv/linux/sys/mount.h
+@@ -188,9 +188,6 @@ enum
+ };
+ 
+ 
+-/* fsopen flags.  */
+-#define FSOPEN_CLOEXEC          0x00000001
+-
+ /* fsmount flags.  */
+ #define FSMOUNT_CLOEXEC         0x00000001
+ 
+@@ -261,6 +258,9 @@ enum fsconfig_command
+ };
+ #endif
+ 
++/* fsopen flags.  */
++#define FSOPEN_CLOEXEC          0x00000001
++
+ /* open_tree flags.  */
+ #define OPEN_TREE_CLONE    1         /* Clone the target tree and attach the clone */
+ #define OPEN_TREE_CLOEXEC  O_CLOEXEC /* Close the file on execve() */
+-- 
+2.38.1
+
+
+From b0e7888d1fa2dbd2d9e1645ec8c796abf78880b9 Mon Sep 17 00:00:00 2001
+From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Sun, 28 Aug 2022 16:52:53 -0300
+Subject: [PATCH 16/72] syslog: Fix large messages (BZ#29536)
+
+The a583b6add407c17cd change did not handle large messages that
+would require a heap allocation correctly, where the message itself
+is not take in consideration.
+
+This patch fixes it and extend the tst-syslog to check for large
+messages as well.
+
+Checked on x86_64-linux-gnu.
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit 52a5be0df411ef3ff45c10c7c308cb92993d15b1)
+---
+ misc/syslog.c     |  18 +++---
+ misc/tst-syslog.c | 152 +++++++++++++++++++++++++++++++++++++++-------
+ 2 files changed, 142 insertions(+), 28 deletions(-)
+
+diff --git a/misc/syslog.c b/misc/syslog.c
+index 554089bfc4..b88f66c835 100644
+--- a/misc/syslog.c
++++ b/misc/syslog.c
+@@ -193,28 +193,32 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
+       int vl = __vsnprintf_internal (bufs + l, sizeof bufs - l, fmt, apc,
+                                      mode_flags);
+       if (0 <= vl && vl < sizeof bufs - l)
+-        {
+-          buf = bufs;
+-          bufsize = l + vl;
+-        }
++        buf = bufs;
++      bufsize = l + vl;
+ 
+       va_end (apc);
+     }
+ 
+   if (buf == NULL)
+     {
+-      buf = malloc (l * sizeof (char));
++      buf = malloc ((bufsize + 1) * sizeof (char));
+       if (buf != NULL)
+ 	{
+ 	  /* Tell the cancellation handler to free this buffer.  */
+ 	  clarg.buf = buf;
+ 
+ 	  if (has_ts)
+-	    __snprintf (bufs, sizeof bufs,
++	    __snprintf (buf, l + 1,
+ 			SYSLOG_HEADER (pri, timestamp, &msgoff, pid));
+ 	  else
+-	    __snprintf (bufs, sizeof bufs,
++	    __snprintf (buf, l + 1,
+ 			SYSLOG_HEADER_WITHOUT_TS (pri, &msgoff));
++
++	  va_list apc;
++	  va_copy (apc, ap);
++	  __vsnprintf_internal (buf + l, bufsize - l + 1, fmt, apc,
++				mode_flags);
++	  va_end (apc);
+ 	}
+       else
+         {
+diff --git a/misc/tst-syslog.c b/misc/tst-syslog.c
+index e550d15796..1d332ece53 100644
+--- a/misc/tst-syslog.c
++++ b/misc/tst-syslog.c
+@@ -68,21 +68,19 @@ static const int priorities[] =
+     LOG_DEBUG
+   };
+ 
+-enum
+-  {
+-    ident_length = 64,
+-    msg_length = 64
+-  };
++#define IDENT_LENGTH 64
++#define MSG_LENGTH   1024
+ 
+ #define SYSLOG_MSG_BASE "syslog_message"
+ #define OPENLOG_IDENT   "openlog_ident"
++static char large_message[MSG_LENGTH];
+ 
+ struct msg_t
+   {
+     int priority;
+     int facility;
+-    char ident[ident_length];
+-    char msg[msg_length];
++    char ident[IDENT_LENGTH];
++    char msg[MSG_LENGTH];
+     pid_t pid;
+   };
+ 
+@@ -147,6 +145,37 @@ check_syslog_message (const struct msg_t *msg, int msgnum, int options,
+   return true;
+ }
+ 
++static void
++send_syslog_large (int options)
++{
++  int facility = LOG_USER;
++  int priority = LOG_INFO;
++
++  syslog (facility | priority, "%s %d %d", large_message, facility,
++	  priority);
++}
++
++static void
++send_vsyslog_large (int options)
++{
++  int facility = LOG_USER;
++  int priority = LOG_INFO;
++
++  call_vsyslog (facility | priority, "%s %d %d", large_message, facility,
++		priority);
++}
++
++static bool
++check_syslog_message_large (const struct msg_t *msg, int msgnum, int options,
++			    pid_t pid)
++{
++  TEST_COMPARE (msg->facility, LOG_USER);
++  TEST_COMPARE (msg->priority, LOG_INFO);
++  TEST_COMPARE_STRING (msg->msg, large_message);
++
++  return false;
++}
++
+ static void
+ send_openlog (int options)
+ {
+@@ -179,6 +208,17 @@ send_openlog (int options)
+   closelog ();
+ }
+ 
++static void
++send_openlog_large (int options)
++{
++  /* Define a non-default IDENT and a not default facility.  */
++  openlog (OPENLOG_IDENT, options, LOG_LOCAL0);
++
++  syslog (LOG_INFO, "%s %d %d", large_message, LOG_LOCAL0, LOG_INFO);
++
++  closelog ();
++}
++
+ static bool
+ check_openlog_message (const struct msg_t *msg, int msgnum,
+                        int options, pid_t pid)
+@@ -189,7 +229,7 @@ check_openlog_message (const struct msg_t *msg, int msgnum,
+   int expected_priority = priorities[msgnum % array_length (priorities)];
+   TEST_COMPARE (msg->priority, expected_priority);
+ 
+-  char expected_ident[ident_length];
++  char expected_ident[IDENT_LENGTH];
+   snprintf (expected_ident, sizeof (expected_ident), "%s%s%.0d%s:",
+             OPENLOG_IDENT,
+             options & LOG_PID ? "[" : "",
+@@ -211,15 +251,38 @@ check_openlog_message (const struct msg_t *msg, int msgnum,
+   return true;
+ }
+ 
++static bool
++check_openlog_message_large (const struct msg_t *msg, int msgnum,
++			     int options, pid_t pid)
++{
++  char expected_ident[IDENT_LENGTH];
++  snprintf (expected_ident, sizeof (expected_ident), "%s%s%.0d%s:",
++            OPENLOG_IDENT,
++            options & LOG_PID ? "[" : "",
++            options & LOG_PID ? pid : 0,
++            options & LOG_PID ? "]" : "");
++
++  TEST_COMPARE_STRING (msg->ident, expected_ident);
++  TEST_COMPARE_STRING (msg->msg, large_message);
++  TEST_COMPARE (msg->priority, LOG_INFO);
++  TEST_COMPARE (msg->facility, LOG_LOCAL0);
++
++  return false;
++}
++
+ static struct msg_t
+ parse_syslog_msg (const char *msg)
+ {
+   struct msg_t r = { .pid = -1 };
+   int number;
+ 
++#define STRINPUT(size)  XSTRINPUT(size)
++#define XSTRINPUT(size) "%" # size "s"
++
+   /* The message in the form:
+-     <179>Apr  8 14:51:19 tst-syslog: syslog message 176 3  */
+-  int n = sscanf (msg, "<%3d>%*s %*d %*d:%*d:%*d %32s %64s %*d %*d",
++     <179>Apr  8 14:51:19  tst-syslog: message 176 3  */
++  int n = sscanf (msg, "<%3d>%*s %*d %*d:%*d:%*d " STRINPUT(IDENT_LENGTH)
++		       " " STRINPUT(MSG_LENGTH) " %*d %*d",
+                   &number, r.ident, r.msg);
+   TEST_COMPARE (n, 3);
+ 
+@@ -246,7 +309,7 @@ parse_syslog_console (const char *msg)
+ 
+   /* The message in the form:
+      openlog_ident: syslog_message 128 0  */
+-  int n = sscanf (msg, "%32s %64s %d %d",
++  int n = sscanf (msg, STRINPUT(IDENT_LENGTH) " " STRINPUT(MSG_LENGTH) " %d %d",
+       r.ident, r.msg, &facility, &priority);
+   TEST_COMPARE (n, 4);
+ 
+@@ -281,7 +344,7 @@ check_syslog_udp (void (*syslog_send)(int), int options,
+   int msgnum = 0;
+   while (1)
+     {
+-      char buf[512];
++      char buf[2048];
+       size_t l = xrecvfrom (server_udp, buf, sizeof (buf), 0,
+                             (struct sockaddr *) &addr, &addrlen);
+       buf[l] = '\0';
+@@ -325,7 +388,7 @@ check_syslog_tcp (void (*syslog_send)(int), int options,
+ 
+   int client_tcp = xaccept (server_tcp, NULL, NULL);
+ 
+-  char buf[512], *rb = buf;
++  char buf[2048], *rb = buf;
+   size_t rbl = sizeof (buf);
+   size_t prl = 0;  /* Track the size of the partial record.  */
+   int msgnum = 0;
+@@ -393,20 +456,34 @@ check_syslog_console_read (FILE *fp)
+ }
+ 
+ static void
+-check_syslog_console (void)
++check_syslog_console_read_large (FILE *fp)
++{
++  char buf[2048];
++  TEST_VERIFY (fgets (buf, sizeof (buf), fp) != NULL);
++  struct msg_t msg = parse_syslog_console (buf);
++
++  TEST_COMPARE_STRING (msg.ident, OPENLOG_IDENT ":");
++  TEST_COMPARE_STRING (msg.msg, large_message);
++  TEST_COMPARE (msg.priority, LOG_INFO);
++  TEST_COMPARE (msg.facility, LOG_LOCAL0);
++}
++
++static void
++check_syslog_console (void (*syslog_send)(int),
++		      void (*syslog_check)(FILE *fp))
+ {
+   xmkfifo (_PATH_CONSOLE, 0666);
+ 
+   pid_t sender_pid = xfork ();
+   if (sender_pid == 0)
+     {
+-      send_openlog (LOG_CONS);
++      syslog_send (LOG_CONS);
+       _exit (0);
+     }
+ 
+   {
+     FILE *fp = xfopen (_PATH_CONSOLE, "r+");
+-    check_syslog_console_read (fp);
++    syslog_check (fp);
+     xfclose (fp);
+   }
+ 
+@@ -425,16 +502,28 @@ send_openlog_callback (void *clousure)
+ }
+ 
+ static void
+-check_syslog_perror (void)
++send_openlog_callback_large (void *clousure)
++{
++  int options = *(int *) clousure;
++  send_openlog_large (options);
++}
++
++static void
++check_syslog_perror (bool large)
+ {
+   struct support_capture_subprocess result;
+-  result = support_capture_subprocess (send_openlog_callback,
++  result = support_capture_subprocess (large
++				       ? send_openlog_callback_large
++				       : send_openlog_callback,
+                                        &(int){LOG_PERROR});
+ 
+   FILE *mfp = fmemopen (result.err.buffer, result.err.length, "r");
+   if (mfp == NULL)
+     FAIL_EXIT1 ("fmemopen: %m");
+-  check_syslog_console_read (mfp);
++  if (large)
++    check_syslog_console_read_large (mfp);
++  else
++    check_syslog_console_read (mfp);
+   xfclose (mfp);
+ 
+   support_capture_subprocess_check (&result, "tst-openlog-child", 0,
+@@ -462,10 +551,31 @@ do_test (void)
+   check_syslog_tcp (send_openlog, LOG_PID, check_openlog_message);
+ 
+   /* Check the LOG_CONS option.  */
+-  check_syslog_console ();
++  check_syslog_console (send_openlog, check_syslog_console_read);
+ 
+   /* Check the LOG_PERROR option.  */
+-  check_syslog_perror ();
++  check_syslog_perror (false);
++
++  /* Similar tests as before, but with a large message to trigger the
++     syslog path that uses dynamically allocated memory.  */
++  memset (large_message, 'a', sizeof large_message - 1);
++  large_message[sizeof large_message - 1] = '\0';
++
++  check_syslog_udp (send_syslog_large, 0, check_syslog_message_large);
++  check_syslog_tcp (send_syslog_large, 0, check_syslog_message_large);
++
++  check_syslog_udp (send_vsyslog_large, 0, check_syslog_message_large);
++  check_syslog_tcp (send_vsyslog_large, 0, check_syslog_message_large);
++
++  check_syslog_udp (send_openlog_large, 0, check_openlog_message_large);
++  check_syslog_tcp (send_openlog_large, 0, check_openlog_message_large);
++
++  check_syslog_udp (send_openlog_large, LOG_PID, check_openlog_message_large);
++  check_syslog_tcp (send_openlog_large, LOG_PID, check_openlog_message_large);
++
++  check_syslog_console (send_openlog_large, check_syslog_console_read_large);
++
++  check_syslog_perror (true);
+ 
+   return 0;
+ }
+-- 
+2.38.1
+
+
+From 924e4f3eaa502ce82fccf8537f021a796d158771 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Fri, 26 Aug 2022 21:15:43 +0200
+Subject: [PATCH 17/72] elf: Call __libc_early_init for reused namespaces (bug
+ 29528)
+
+libc_map is never reset to NULL, neither during dlclose nor on a
+dlopen call which reuses the namespace structure.  As a result, if a
+namespace is reused, its libc is not initialized properly.  The most
+visible result is a crash in the <ctype.h> functions.
+
+To prevent similar bugs on namespace reuse from surfacing,
+unconditionally initialize the chosen namespace to zero using memset.
+
+(cherry picked from commit d0e357ff45a75553dee3b17ed7d303bfa544f6fe)
+---
+ NEWS                         |  1 +
+ elf/Makefile                 | 25 ++++++++++++++++++
+ elf/dl-open.c                | 13 ++++++----
+ elf/tst-dlmopen-twice-mod1.c | 37 ++++++++++++++++++++++++++
+ elf/tst-dlmopen-twice-mod2.c | 50 ++++++++++++++++++++++++++++++++++++
+ elf/tst-dlmopen-twice.c      | 34 ++++++++++++++++++++++++
+ 6 files changed, 155 insertions(+), 5 deletions(-)
+ create mode 100644 elf/tst-dlmopen-twice-mod1.c
+ create mode 100644 elf/tst-dlmopen-twice-mod2.c
+ create mode 100644 elf/tst-dlmopen-twice.c
+
+diff --git a/NEWS b/NEWS
+index ae30900bbc..6d31e5abba 100644
+--- a/NEWS
++++ b/NEWS
+@@ -13,6 +13,7 @@ The following bugs are resolved with this release:
+   [29446] _dlopen now ignores dl_caller argument in static mode
+   [29485] Linux: Terminate subprocess on late failure in tst-pidfd
+   [29490] alpha: New __brk_call implementation is broken
++  [29528] elf: Call __libc_early_init for reused namespaces
+ 
+ \f
+ Version 2.36
+diff --git a/elf/Makefile b/elf/Makefile
+index fd77d0c7c8..43353a4b08 100644
+--- a/elf/Makefile
++++ b/elf/Makefile
+@@ -408,6 +408,7 @@ tests += \
+   tst-dlmopen4 \
+   tst-dlmopen-dlerror \
+   tst-dlmopen-gethostbyname \
++  tst-dlmopen-twice \
+   tst-dlopenfail \
+   tst-dlopenfail-2 \
+   tst-dlopenrpath \
+@@ -834,6 +835,8 @@ modules-names += \
+   tst-dlmopen1mod \
+   tst-dlmopen-dlerror-mod \
+   tst-dlmopen-gethostbyname-mod \
++  tst-dlmopen-twice-mod1 \
++  tst-dlmopen-twice-mod2 \
+   tst-dlopenfaillinkmod \
+   tst-dlopenfailmod1 \
+   tst-dlopenfailmod2 \
+@@ -2967,3 +2970,25 @@ $(objpfx)tst-tls-allocation-failure-static-patched.out: \
+ 	grep -q '^Fatal glibc error: Cannot allocate TLS block$$' $@ \
+ 	  && grep -q '^status: 127$$' $@; \
+ 	  $(evaluate-test)
++
++$(objpfx)tst-audit-tlsdesc: $(objpfx)tst-audit-tlsdesc-mod1.so \
++			    $(objpfx)tst-audit-tlsdesc-mod2.so \
++			    $(shared-thread-library)
++ifeq (yes,$(have-mtls-dialect-gnu2))
++# The test is valid for all TLS types, but we want to exercise GNU2
++# TLS if possible.
++CFLAGS-tst-audit-tlsdesc-mod1.c += -mtls-dialect=gnu2
++CFLAGS-tst-audit-tlsdesc-mod2.c += -mtls-dialect=gnu2
++endif
++$(objpfx)tst-audit-tlsdesc-dlopen: $(shared-thread-library)
++$(objpfx)tst-audit-tlsdesc-dlopen.out: $(objpfx)tst-audit-tlsdesc-mod1.so \
++				       $(objpfx)tst-audit-tlsdesc-mod2.so
++$(objpfx)tst-audit-tlsdesc-mod1.so: $(objpfx)tst-audit-tlsdesc-mod2.so
++$(objpfx)tst-audit-tlsdesc.out: $(objpfx)tst-auditmod-tlsdesc.so
++tst-audit-tlsdesc-ENV = LD_AUDIT=$(objpfx)tst-auditmod-tlsdesc.so
++$(objpfx)tst-audit-tlsdesc-dlopen.out: $(objpfx)tst-auditmod-tlsdesc.so
++tst-audit-tlsdesc-dlopen-ENV = LD_AUDIT=$(objpfx)tst-auditmod-tlsdesc.so
++
++$(objpfx)tst-dlmopen-twice.out: \
++  $(objpfx)tst-dlmopen-twice-mod1.so \
++  $(objpfx)tst-dlmopen-twice-mod2.so
+diff --git a/elf/dl-open.c b/elf/dl-open.c
+index a23e65926b..46e8066fd8 100644
+--- a/elf/dl-open.c
++++ b/elf/dl-open.c
+@@ -844,11 +844,14 @@ _dl_open (const char *file, int mode, const void *caller_dlopen, Lmid_t nsid,
+ 	  _dl_signal_error (EINVAL, file, NULL, N_("\
+ no more namespaces available for dlmopen()"));
+ 	}
+-      else if (nsid == GL(dl_nns))
+-	{
+-	  __rtld_lock_initialize (GL(dl_ns)[nsid]._ns_unique_sym_table.lock);
+-	  ++GL(dl_nns);
+-	}
++
++      if (nsid == GL(dl_nns))
++	++GL(dl_nns);
++
++      /* Initialize the new namespace.  Most members are
++	 zero-initialized, only the lock needs special treatment.  */
++      memset (&GL(dl_ns)[nsid], 0, sizeof (GL(dl_ns)[nsid]));
++      __rtld_lock_initialize (GL(dl_ns)[nsid]._ns_unique_sym_table.lock);
+ 
+       _dl_debug_update (nsid)->r_state = RT_CONSISTENT;
+     }
+diff --git a/elf/tst-dlmopen-twice-mod1.c b/elf/tst-dlmopen-twice-mod1.c
+new file mode 100644
+index 0000000000..0eaf04948c
+--- /dev/null
++++ b/elf/tst-dlmopen-twice-mod1.c
+@@ -0,0 +1,37 @@
++/* Initialization of libc after dlmopen/dlclose/dlmopen (bug 29528).  Module 1.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <stdio.h>
++
++static void __attribute__ ((constructor))
++init (void)
++{
++  puts ("info: tst-dlmopen-twice-mod1.so loaded");
++  fflush (stdout);
++}
++
++static void __attribute__ ((destructor))
++fini (void)
++{
++  puts ("info: tst-dlmopen-twice-mod1.so about to be unloaded");
++  fflush (stdout);
++}
++
++/* Large allocation.  The second module does not have this, so it
++   should load libc at a different address.  */
++char large_allocate[16 * 1024 * 1024];
+diff --git a/elf/tst-dlmopen-twice-mod2.c b/elf/tst-dlmopen-twice-mod2.c
+new file mode 100644
+index 0000000000..40c6c01f96
+--- /dev/null
++++ b/elf/tst-dlmopen-twice-mod2.c
+@@ -0,0 +1,50 @@
++/* Initialization of libc after dlmopen/dlclose/dlmopen (bug 29528).  Module 2.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <ctype.h>
++#include <stdio.h>
++
++static void __attribute__ ((constructor))
++init (void)
++{
++  puts ("info: tst-dlmopen-twice-mod2.so loaded");
++  fflush (stdout);
++}
++
++static void __attribute__ ((destructor))
++fini (void)
++{
++  puts ("info: tst-dlmopen-twice-mod2.so about to be unloaded");
++  fflush (stdout);
++}
++
++int
++run_check (void)
++{
++  puts ("info: about to call isalpha");
++  fflush (stdout);
++
++  volatile char ch = 'a';
++  if (!isalpha (ch))
++    {
++      puts ("error: isalpha ('a') is not true");
++      fflush (stdout);
++      return 1;
++    }
++  return 0;
++}
+diff --git a/elf/tst-dlmopen-twice.c b/elf/tst-dlmopen-twice.c
+new file mode 100644
+index 0000000000..449f3c8fa9
+--- /dev/null
++++ b/elf/tst-dlmopen-twice.c
+@@ -0,0 +1,34 @@
++/* Initialization of libc after dlmopen/dlclose/dlmopen (bug 29528).  Main.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <support/xdlfcn.h>
++#include <support/check.h>
++
++static int
++do_test (void)
++{
++  void *handle = xdlmopen (LM_ID_NEWLM, "tst-dlmopen-twice-mod1.so", RTLD_NOW);
++  xdlclose (handle);
++  handle = xdlmopen (LM_ID_NEWLM, "tst-dlmopen-twice-mod2.so", RTLD_NOW);
++  int (*run_check) (void) = xdlsym (handle, "run_check");
++  TEST_COMPARE (run_check (), 0);
++  xdlclose (handle);
++  return 0;
++}
++
++#include <support/test-driver.c>
+-- 
+2.38.1
+
+
+From 3c791f2031ca8f6b99e96b774ed1c505ceb93595 Mon Sep 17 00:00:00 2001
+From: Raphael Moreira Zinsly <rzinsly@linux.ibm.com>
+Date: Wed, 24 Aug 2022 11:43:37 -0300
+Subject: [PATCH 18/72] Apply asm redirections in wchar.h before first use
+
+Similar to d0fa09a770, but for wchar.h.  Fixes [BZ #27087] by applying
+all long double related asm redirections before using functions in
+bits/wchar2.h.
+Moves the function declarations from wcsmbs/bits/wchar2.h to a new file
+wcsmbs/bits/wchar2-decl.h that will be included first in wcsmbs/wchar.h.
+
+Tested with build-many-glibcs.py.
+Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
+
+(cherry picked from commit c7509d49c4e8fa494120c5ead21338559dad16f5)
+---
+ include/bits/wchar2-decl.h |   1 +
+ wcsmbs/Makefile            |   5 +-
+ wcsmbs/bits/wchar2-decl.h  | 124 +++++++++++++++++++++++++++++++++++++
+ wcsmbs/bits/wchar2.h       |  72 ---------------------
+ wcsmbs/wchar.h             |  11 +++-
+ 5 files changed, 137 insertions(+), 76 deletions(-)
+ create mode 100644 include/bits/wchar2-decl.h
+ create mode 100644 wcsmbs/bits/wchar2-decl.h
+
+diff --git a/include/bits/wchar2-decl.h b/include/bits/wchar2-decl.h
+new file mode 100644
+index 0000000000..00b1b93342
+--- /dev/null
++++ b/include/bits/wchar2-decl.h
+@@ -0,0 +1 @@
++#include <wcsmbs/bits/wchar2-decl.h>
+diff --git a/wcsmbs/Makefile b/wcsmbs/Makefile
+index 3d19d5556f..4af102a3f6 100644
+--- a/wcsmbs/Makefile
++++ b/wcsmbs/Makefile
+@@ -22,8 +22,9 @@ subdir	:= wcsmbs
+ 
+ include ../Makeconfig
+ 
+-headers	:= wchar.h bits/wchar.h bits/wchar2.h bits/wchar-ldbl.h uchar.h \
+-	   bits/types/__mbstate_t.h bits/types/mbstate_t.h bits/types/wint_t.h
++headers	:= wchar.h bits/wchar.h bits/wchar2.h bits/wchar2-decl.h \
++	   bits/wchar-ldbl.h uchar.h bits/types/__mbstate_t.h \
++	   bits/types/mbstate_t.h bits/types/wint_t.h
+ 
+ routines := wcscat wcschr wcscmp wcscpy wcscspn wcsdup wcslen wcsncat \
+ 	    wcsncmp wcsncpy wcspbrk wcsrchr wcsspn wcstok wcsstr wmemchr \
+diff --git a/wcsmbs/bits/wchar2-decl.h b/wcsmbs/bits/wchar2-decl.h
+new file mode 100644
+index 0000000000..8e1735c33b
+--- /dev/null
++++ b/wcsmbs/bits/wchar2-decl.h
+@@ -0,0 +1,124 @@
++/* Checking macros for wchar functions.  Declarations only.
++   Copyright (C) 2004-2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#ifndef _BITS_WCHAR2_DECL_H
++#define _BITS_WCHAR2_DECL_H 1
++
++#ifndef _WCHAR_H
++# error "Never include <bits/wchar2-decl.h> directly; use <wchar.h> instead."
++#endif
++
++
++extern wchar_t *__wmemcpy_chk (wchar_t *__restrict __s1,
++			       const wchar_t *__restrict __s2, size_t __n,
++			       size_t __ns1) __THROW;
++extern wchar_t *__wmemmove_chk (wchar_t *__s1, const wchar_t *__s2,
++				size_t __n, size_t __ns1) __THROW;
++
++
++#ifdef __USE_GNU
++
++extern wchar_t *__wmempcpy_chk (wchar_t *__restrict __s1,
++				const wchar_t *__restrict __s2, size_t __n,
++				size_t __ns1) __THROW;
++
++#endif
++
++
++extern wchar_t *__wmemset_chk (wchar_t *__s, wchar_t __c, size_t __n,
++			       size_t __ns) __THROW;
++extern wchar_t *__wcscpy_chk (wchar_t *__restrict __dest,
++			      const wchar_t *__restrict __src,
++			      size_t __n) __THROW;
++extern wchar_t *__wcpcpy_chk (wchar_t *__restrict __dest,
++			      const wchar_t *__restrict __src,
++			      size_t __destlen) __THROW;
++extern wchar_t *__wcsncpy_chk (wchar_t *__restrict __dest,
++			       const wchar_t *__restrict __src, size_t __n,
++			       size_t __destlen) __THROW;
++extern wchar_t *__wcpncpy_chk (wchar_t *__restrict __dest,
++			       const wchar_t *__restrict __src, size_t __n,
++			       size_t __destlen) __THROW;
++extern wchar_t *__wcscat_chk (wchar_t *__restrict __dest,
++			      const wchar_t *__restrict __src,
++			      size_t __destlen) __THROW;
++extern wchar_t *__wcsncat_chk (wchar_t *__restrict __dest,
++			       const wchar_t *__restrict __src,
++			       size_t __n, size_t __destlen) __THROW;
++extern int __swprintf_chk (wchar_t *__restrict __s, size_t __n,
++			   int __flag, size_t __s_len,
++			   const wchar_t *__restrict __format, ...)
++     __THROW /* __attribute__ ((__format__ (__wprintf__, 5, 6))) */;
++extern int __vswprintf_chk (wchar_t *__restrict __s, size_t __n,
++			    int __flag, size_t __s_len,
++			    const wchar_t *__restrict __format,
++			    __gnuc_va_list __arg)
++     __THROW /* __attribute__ ((__format__ (__wprintf__, 5, 0))) */;
++
++#if __USE_FORTIFY_LEVEL > 1
++
++extern int __fwprintf_chk (__FILE *__restrict __stream, int __flag,
++			   const wchar_t *__restrict __format, ...);
++extern int __wprintf_chk (int __flag, const wchar_t *__restrict __format,
++			  ...);
++extern int __vfwprintf_chk (__FILE *__restrict __stream, int __flag,
++			    const wchar_t *__restrict __format,
++			    __gnuc_va_list __ap);
++extern int __vwprintf_chk (int __flag, const wchar_t *__restrict __format,
++			   __gnuc_va_list __ap);
++
++#endif
++
++extern wchar_t *__fgetws_chk (wchar_t *__restrict __s, size_t __size, int __n,
++			      __FILE *__restrict __stream) __wur;
++
++#ifdef __USE_GNU
++
++extern wchar_t *__fgetws_unlocked_chk (wchar_t *__restrict __s, size_t __size,
++				       int __n, __FILE *__restrict __stream)
++       __wur;
++
++#endif
++
++extern size_t __wcrtomb_chk (char *__restrict __s, wchar_t __wchar,
++			     mbstate_t *__restrict __p,
++			     size_t __buflen) __THROW __wur;
++extern size_t __mbsrtowcs_chk (wchar_t *__restrict __dst,
++			       const char **__restrict __src,
++			       size_t __len, mbstate_t *__restrict __ps,
++			       size_t __dstlen) __THROW;
++extern size_t __wcsrtombs_chk (char *__restrict __dst,
++			       const wchar_t **__restrict __src,
++			       size_t __len, mbstate_t *__restrict __ps,
++			       size_t __dstlen) __THROW;
++
++#ifdef	__USE_XOPEN2K8
++
++extern size_t __mbsnrtowcs_chk (wchar_t *__restrict __dst,
++				const char **__restrict __src, size_t __nmc,
++				size_t __len, mbstate_t *__restrict __ps,
++				size_t __dstlen) __THROW;
++extern size_t __wcsnrtombs_chk (char *__restrict __dst,
++				const wchar_t **__restrict __src,
++				size_t __nwc, size_t __len,
++				mbstate_t *__restrict __ps, size_t __dstlen)
++       __THROW;
++
++#endif
++
++#endif /* bits/wchar2-decl.h.  */
+diff --git a/wcsmbs/bits/wchar2.h b/wcsmbs/bits/wchar2.h
+index 0e017f458b..3f110efe57 100644
+--- a/wcsmbs/bits/wchar2.h
++++ b/wcsmbs/bits/wchar2.h
+@@ -21,9 +21,6 @@
+ #endif
+ 
+ 
+-extern wchar_t *__wmemcpy_chk (wchar_t *__restrict __s1,
+-			       const wchar_t *__restrict __s2, size_t __n,
+-			       size_t __ns1) __THROW;
+ extern wchar_t *__REDIRECT_NTH (__wmemcpy_alias,
+ 				(wchar_t *__restrict __s1,
+ 				 const wchar_t *__restrict __s2, size_t __n),
+@@ -45,8 +42,6 @@ __NTH (wmemcpy (wchar_t *__restrict __s1, const wchar_t *__restrict __s2,
+ }
+ 
+ 
+-extern wchar_t *__wmemmove_chk (wchar_t *__s1, const wchar_t *__s2,
+-				size_t __n, size_t __ns1) __THROW;
+ extern wchar_t *__REDIRECT_NTH (__wmemmove_alias, (wchar_t *__s1,
+ 						   const wchar_t *__s2,
+ 						   size_t __n), wmemmove);
+@@ -66,9 +61,6 @@ __NTH (wmemmove (wchar_t *__s1, const wchar_t *__s2, size_t __n))
+ 
+ 
+ #ifdef __USE_GNU
+-extern wchar_t *__wmempcpy_chk (wchar_t *__restrict __s1,
+-				const wchar_t *__restrict __s2, size_t __n,
+-				size_t __ns1) __THROW;
+ extern wchar_t *__REDIRECT_NTH (__wmempcpy_alias,
+ 				(wchar_t *__restrict __s1,
+ 				 const wchar_t *__restrict __s2,
+@@ -91,8 +83,6 @@ __NTH (wmempcpy (wchar_t *__restrict __s1, const wchar_t *__restrict __s2,
+ #endif
+ 
+ 
+-extern wchar_t *__wmemset_chk (wchar_t *__s, wchar_t __c, size_t __n,
+-			       size_t __ns) __THROW;
+ extern wchar_t *__REDIRECT_NTH (__wmemset_alias, (wchar_t *__s, wchar_t __c,
+ 						  size_t __n), wmemset);
+ extern wchar_t *__REDIRECT_NTH (__wmemset_chk_warn,
+@@ -110,9 +100,6 @@ __NTH (wmemset (wchar_t *__s, wchar_t __c, size_t __n))
+ }
+ 
+ 
+-extern wchar_t *__wcscpy_chk (wchar_t *__restrict __dest,
+-			      const wchar_t *__restrict __src,
+-			      size_t __n) __THROW;
+ extern wchar_t *__REDIRECT_NTH (__wcscpy_alias,
+ 				(wchar_t *__restrict __dest,
+ 				 const wchar_t *__restrict __src), wcscpy);
+@@ -127,9 +114,6 @@ __NTH (wcscpy (wchar_t *__restrict __dest, const wchar_t *__restrict __src))
+ }
+ 
+ 
+-extern wchar_t *__wcpcpy_chk (wchar_t *__restrict __dest,
+-			      const wchar_t *__restrict __src,
+-			      size_t __destlen) __THROW;
+ extern wchar_t *__REDIRECT_NTH (__wcpcpy_alias,
+ 				(wchar_t *__restrict __dest,
+ 				 const wchar_t *__restrict __src), wcpcpy);
+@@ -144,9 +128,6 @@ __NTH (wcpcpy (wchar_t *__restrict __dest, const wchar_t *__restrict __src))
+ }
+ 
+ 
+-extern wchar_t *__wcsncpy_chk (wchar_t *__restrict __dest,
+-			       const wchar_t *__restrict __src, size_t __n,
+-			       size_t __destlen) __THROW;
+ extern wchar_t *__REDIRECT_NTH (__wcsncpy_alias,
+ 				(wchar_t *__restrict __dest,
+ 				 const wchar_t *__restrict __src,
+@@ -168,9 +149,6 @@ __NTH (wcsncpy (wchar_t *__restrict __dest, const wchar_t *__restrict __src,
+ }
+ 
+ 
+-extern wchar_t *__wcpncpy_chk (wchar_t *__restrict __dest,
+-			       const wchar_t *__restrict __src, size_t __n,
+-			       size_t __destlen) __THROW;
+ extern wchar_t *__REDIRECT_NTH (__wcpncpy_alias,
+ 				(wchar_t *__restrict __dest,
+ 				 const wchar_t *__restrict __src,
+@@ -192,9 +170,6 @@ __NTH (wcpncpy (wchar_t *__restrict __dest, const wchar_t *__restrict __src,
+ }
+ 
+ 
+-extern wchar_t *__wcscat_chk (wchar_t *__restrict __dest,
+-			      const wchar_t *__restrict __src,
+-			      size_t __destlen) __THROW;
+ extern wchar_t *__REDIRECT_NTH (__wcscat_alias,
+ 				(wchar_t *__restrict __dest,
+ 				 const wchar_t *__restrict __src), wcscat);
+@@ -209,9 +184,6 @@ __NTH (wcscat (wchar_t *__restrict __dest, const wchar_t *__restrict __src))
+ }
+ 
+ 
+-extern wchar_t *__wcsncat_chk (wchar_t *__restrict __dest,
+-			       const wchar_t *__restrict __src,
+-			       size_t __n, size_t __destlen) __THROW;
+ extern wchar_t *__REDIRECT_NTH (__wcsncat_alias,
+ 				(wchar_t *__restrict __dest,
+ 				 const wchar_t *__restrict __src,
+@@ -228,10 +200,6 @@ __NTH (wcsncat (wchar_t *__restrict __dest, const wchar_t *__restrict __src,
+ }
+ 
+ 
+-extern int __swprintf_chk (wchar_t *__restrict __s, size_t __n,
+-			   int __flag, size_t __s_len,
+-			   const wchar_t *__restrict __format, ...)
+-     __THROW /* __attribute__ ((__format__ (__wprintf__, 5, 6))) */;
+ 
+ extern int __REDIRECT_NTH_LDBL (__swprintf_alias,
+ 				(wchar_t *__restrict __s, size_t __n,
+@@ -258,11 +226,6 @@ __NTH (swprintf (wchar_t *__restrict __s, size_t __n,
+    : swprintf (s, n, __VA_ARGS__))
+ #endif
+ 
+-extern int __vswprintf_chk (wchar_t *__restrict __s, size_t __n,
+-			    int __flag, size_t __s_len,
+-			    const wchar_t *__restrict __format,
+-			    __gnuc_va_list __arg)
+-     __THROW /* __attribute__ ((__format__ (__wprintf__, 5, 0))) */;
+ 
+ extern int __REDIRECT_NTH_LDBL (__vswprintf_alias,
+ 				(wchar_t *__restrict __s, size_t __n,
+@@ -283,16 +246,6 @@ __NTH (vswprintf (wchar_t *__restrict __s, size_t __n,
+ 
+ #if __USE_FORTIFY_LEVEL > 1
+ 
+-extern int __fwprintf_chk (__FILE *__restrict __stream, int __flag,
+-			   const wchar_t *__restrict __format, ...);
+-extern int __wprintf_chk (int __flag, const wchar_t *__restrict __format,
+-			  ...);
+-extern int __vfwprintf_chk (__FILE *__restrict __stream, int __flag,
+-			    const wchar_t *__restrict __format,
+-			    __gnuc_va_list __ap);
+-extern int __vwprintf_chk (int __flag, const wchar_t *__restrict __format,
+-			   __gnuc_va_list __ap);
+-
+ # ifdef __va_arg_pack
+ __fortify_function int
+ wprintf (const wchar_t *__restrict __fmt, ...)
+@@ -328,8 +281,6 @@ vfwprintf (__FILE *__restrict __stream,
+ 
+ #endif
+ 
+-extern wchar_t *__fgetws_chk (wchar_t *__restrict __s, size_t __size, int __n,
+-			      __FILE *__restrict __stream) __wur;
+ extern wchar_t *__REDIRECT (__fgetws_alias,
+ 			    (wchar_t *__restrict __s, int __n,
+ 			     __FILE *__restrict __stream), fgetws) __wur;
+@@ -351,9 +302,6 @@ fgetws (wchar_t *__restrict __s, int __n, __FILE *__restrict __stream)
+ }
+ 
+ #ifdef __USE_GNU
+-extern wchar_t *__fgetws_unlocked_chk (wchar_t *__restrict __s, size_t __size,
+-				       int __n, __FILE *__restrict __stream)
+-  __wur;
+ extern wchar_t *__REDIRECT (__fgetws_unlocked_alias,
+ 			    (wchar_t *__restrict __s, int __n,
+ 			     __FILE *__restrict __stream), fgetws_unlocked)
+@@ -379,9 +327,6 @@ fgetws_unlocked (wchar_t *__restrict __s, int __n, __FILE *__restrict __stream)
+ #endif
+ 
+ 
+-extern size_t __wcrtomb_chk (char *__restrict __s, wchar_t __wchar,
+-			     mbstate_t *__restrict __p,
+-			     size_t __buflen) __THROW __wur;
+ extern size_t __REDIRECT_NTH (__wcrtomb_alias,
+ 			      (char *__restrict __s, wchar_t __wchar,
+ 			       mbstate_t *__restrict __ps), wcrtomb) __wur;
+@@ -404,10 +349,6 @@ __NTH (wcrtomb (char *__restrict __s, wchar_t __wchar,
+ }
+ 
+ 
+-extern size_t __mbsrtowcs_chk (wchar_t *__restrict __dst,
+-			       const char **__restrict __src,
+-			       size_t __len, mbstate_t *__restrict __ps,
+-			       size_t __dstlen) __THROW;
+ extern size_t __REDIRECT_NTH (__mbsrtowcs_alias,
+ 			      (wchar_t *__restrict __dst,
+ 			       const char **__restrict __src,
+@@ -431,10 +372,6 @@ __NTH (mbsrtowcs (wchar_t *__restrict __dst, const char **__restrict __src,
+ }
+ 
+ 
+-extern size_t __wcsrtombs_chk (char *__restrict __dst,
+-			       const wchar_t **__restrict __src,
+-			       size_t __len, mbstate_t *__restrict __ps,
+-			       size_t __dstlen) __THROW;
+ extern size_t __REDIRECT_NTH (__wcsrtombs_alias,
+ 			      (char *__restrict __dst,
+ 			       const wchar_t **__restrict __src,
+@@ -458,10 +395,6 @@ __NTH (wcsrtombs (char *__restrict __dst, const wchar_t **__restrict __src,
+ 
+ 
+ #ifdef	__USE_XOPEN2K8
+-extern size_t __mbsnrtowcs_chk (wchar_t *__restrict __dst,
+-				const char **__restrict __src, size_t __nmc,
+-				size_t __len, mbstate_t *__restrict __ps,
+-				size_t __dstlen) __THROW;
+ extern size_t __REDIRECT_NTH (__mbsnrtowcs_alias,
+ 			      (wchar_t *__restrict __dst,
+ 			       const char **__restrict __src, size_t __nmc,
+@@ -485,11 +418,6 @@ __NTH (mbsnrtowcs (wchar_t *__restrict __dst, const char **__restrict __src,
+ }
+ 
+ 
+-extern size_t __wcsnrtombs_chk (char *__restrict __dst,
+-				const wchar_t **__restrict __src,
+-				size_t __nwc, size_t __len,
+-				mbstate_t *__restrict __ps, size_t __dstlen)
+-     __THROW;
+ extern size_t __REDIRECT_NTH (__wcsnrtombs_alias,
+ 			      (char *__restrict __dst,
+ 			       const wchar_t **__restrict __src,
+diff --git a/wcsmbs/wchar.h b/wcsmbs/wchar.h
+index 5d6a40853d..c1321c7518 100644
+--- a/wcsmbs/wchar.h
++++ b/wcsmbs/wchar.h
+@@ -864,14 +864,21 @@ extern size_t wcsftime_l (wchar_t *__restrict __s, size_t __maxsize,
+ 
+ /* Define some macros helping to catch buffer overflows.  */
+ #if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function
+-# include <bits/wchar2.h>
++/* Declare all functions from bits/wchar2-decl.h first.  */
++# include <bits/wchar2-decl.h>
+ #endif
+ 
+-#include <bits/floatn.h>
++/* The following headers provide asm redirections.  These redirections must
++   appear before the first usage of these functions, e.g. in bits/wchar.h.  */
+ #if defined __LDBL_COMPAT || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1
+ # include <bits/wchar-ldbl.h>
+ #endif
+ 
++#if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function
++/* Now include the function definitions and redirects too.  */
++# include <bits/wchar2.h>
++#endif
++
+ __END_DECLS
+ 
+ #endif /* wchar.h  */
+-- 
+2.38.1
+
+
+From b3736d1a3c60a3ec9959bf3b38794958546bf6a2 Mon Sep 17 00:00:00 2001
+From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Tue, 30 Aug 2022 13:35:52 -0300
+Subject: [PATCH 19/72] elf: Restore how vDSO dependency is printed with
+ LD_TRACE_LOADED_OBJECTS (BZ #29539)
+
+The d7703d3176d225d5743b21811d888619eba39e82 changed how vDSO like
+dependencies are printed, instead of just the name and address it
+follows other libraries mode and prints 'name => path'.
+
+Unfortunately, this broke some ldd consumer that uses the output to
+filter out the program's dependencies.  For instance CMake
+bundleutilities module [1], where GetPrequirite uses the regex to filter
+out 'name => path' [2].
+
+This patch restore the previous way to print just the name and the
+mapping address.
+
+Checked on x86_64-linux-gnu.
+
+[1] https://github.com/Kitware/CMake/tree/master/Tests/BundleUtilities
+[2] https://github.com/Kitware/CMake/blob/master/Modules/GetPrerequisites.cmake#L733
+
+Reviewed-by: Florian Weimer <fweimer@redhat.com>
+(cherry picked from commit 1e903124cec4492463d075c6c061a2a772db77bf)
+---
+ NEWS       | 2 +-
+ elf/rtld.c | 6 ++++++
+ 2 files changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/NEWS b/NEWS
+index 6d31e5abba..757ded85e0 100644
+--- a/NEWS
++++ b/NEWS
+@@ -14,7 +14,7 @@ The following bugs are resolved with this release:
+   [29485] Linux: Terminate subprocess on late failure in tst-pidfd
+   [29490] alpha: New __brk_call implementation is broken
+   [29528] elf: Call __libc_early_init for reused namespaces
+-
++  [29539] libc: LD_TRACE_LOADED_OBJECTS changed how vDSO library are
+ \f
+ Version 2.36
+ 
+diff --git a/elf/rtld.c b/elf/rtld.c
+index cbbaf4a331..3e771a93d8 100644
+--- a/elf/rtld.c
++++ b/elf/rtld.c
+@@ -2122,6 +2122,12 @@ dl_main (const ElfW(Phdr) *phdr,
+ 	    if (l->l_faked)
+ 	      /* The library was not found.  */
+ 	      _dl_printf ("\t%s => not found\n",  l->l_libname->name);
++	    else if (strcmp (l->l_libname->name, l->l_name) == 0)
++	      /* Print vDSO like libraries without duplicate name.  Some
++		 consumers depend of this format.  */
++	      _dl_printf ("\t%s (0x%0*Zx)\n", l->l_libname->name,
++			  (int) sizeof l->l_map_start * 2,
++			  (size_t) l->l_map_start);
+ 	    else
+ 	      _dl_printf ("\t%s => %s (0x%0*Zx)\n",
+ 			  DSO_FILENAME (l->l_libname->name),
+-- 
+2.38.1
+
+
+From 645d94808aaa90fb1b20a25ff70bb50d9eb1d55b Mon Sep 17 00:00:00 2001
+From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Mon, 5 Sep 2022 09:34:39 -0300
+Subject: [PATCH 20/72] syslog: Remove extra whitespace between timestamp and
+ message (BZ#29544)
+
+The rfc3164 clear states that a single space character must follow
+the timestamp field.
+
+Checked on x86_64-linux-gnu.
+---
+ misc/syslog.c     | 2 +-
+ misc/tst-syslog.c | 9 ++++++---
+ 2 files changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/misc/syslog.c b/misc/syslog.c
+index b88f66c835..f67d4b58a4 100644
+--- a/misc/syslog.c
++++ b/misc/syslog.c
+@@ -167,7 +167,7 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
+ 		  _nl_C_locobj_ptr);
+ 
+ #define SYSLOG_HEADER(__pri, __timestamp, __msgoff, pid) \
+-  "<%d>%s %n%s%s%.0d%s: ",                               \
++  "<%d>%s%n%s%s%.0d%s: ",                                \
+   __pri, __timestamp, __msgoff,                          \
+   LogTag == NULL ? __progname : LogTag,                  \
+   "[" + (pid == 0), pid, "]" + (pid == 0)
+diff --git a/misc/tst-syslog.c b/misc/tst-syslog.c
+index 1d332ece53..3560b518a2 100644
+--- a/misc/tst-syslog.c
++++ b/misc/tst-syslog.c
+@@ -275,16 +275,19 @@ parse_syslog_msg (const char *msg)
+ {
+   struct msg_t r = { .pid = -1 };
+   int number;
++  int wsb, wsa;
+ 
+ #define STRINPUT(size)  XSTRINPUT(size)
+ #define XSTRINPUT(size) "%" # size "s"
+ 
+   /* The message in the form:
+-     <179>Apr  8 14:51:19  tst-syslog: message 176 3  */
+-  int n = sscanf (msg, "<%3d>%*s %*d %*d:%*d:%*d " STRINPUT(IDENT_LENGTH)
++     <179>Apr  8 14:51:19 tst-syslog: message 176 3  */
++  int n = sscanf (msg, "<%3d>%*s %*d %*d:%*d:%*d%n %n" STRINPUT(IDENT_LENGTH)
+ 		       " " STRINPUT(MSG_LENGTH) " %*d %*d",
+-                  &number, r.ident, r.msg);
++                  &number, &wsb, &wsa, r.ident, r.msg);
+   TEST_COMPARE (n, 3);
++  /* It should only one space between timestamp and message.  */
++  TEST_COMPARE (wsa - wsb, 1);
+ 
+   r.facility = number & LOG_FACMASK;
+   r.priority = number & LOG_PRIMASK;
+-- 
+2.38.1
+
+
+From b46412fb17e8bfc6c9e1f144bbcf833320c80f8a Mon Sep 17 00:00:00 2001
+From: Siddhesh Poyarekar <siddhesh@sourceware.org>
+Date: Tue, 6 Sep 2022 09:31:50 -0400
+Subject: [PATCH 21/72] Add NEWS entry for CVE-2022-39046
+
+(cherry picked from commit 76fe56020e7ef354685b2284580ac1630c078a2b)
+---
+ NEWS | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/NEWS b/NEWS
+index 757ded85e0..10a7613f09 100644
+--- a/NEWS
++++ b/NEWS
+@@ -7,6 +7,13 @@ using `glibc' in the "product" field.
+ \f
+ Version 2.36.1
+ 
++Security related changes:
++
++  CVE-2022-39046: When the syslog function is passed a crafted input
++  string larger than 1024 bytes, it reads uninitialized memory from the
++  heap and prints it to the target log file, potentially revealing a
++  portion of the contents of the heap.
++
+ The following bugs are resolved with this release:
+ 
+   [28846] CMSG_NXTHDR may trigger -Wstrict-overflow warning
+-- 
+2.38.1
+
+
+From c399271c10bd00714504e8d4dfbec8aebf996dd4 Mon Sep 17 00:00:00 2001
+From: Fabian Vogt <fvogt@suse.de>
+Date: Wed, 27 Jul 2022 11:44:07 +0200
+Subject: [PATCH 22/72] nscd: Fix netlink cache invalidation if epoll is used
+ [BZ #29415]
+
+Processes cache network interface information such as whether IPv4 or IPv6
+are enabled. This is only checked again if the "netlink timestamp" provided
+by nscd changed, which is triggered by netlink socket activity.
+
+However, in the epoll handler for the netlink socket, it was missed to
+assign the new timestamp to the nscd database. The handler for plain poll
+did that properly, copy that over.
+
+This bug caused that e.g. processes which started before network
+configuration got unusuable addresses from getaddrinfo, like IPv6 only even
+though only IPv4 is available:
+https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1041
+
+It's a bit hard to reproduce, so I verified this by checking the timestamp
+on calls to __check_pf manually. Without this patch it's stuck at 1, now
+it's increasing on network changes as expected.
+
+Signed-off-by: Fabian Vogt <fvogt@suse.de>
+(cherry picked from commit 02ca25fef2785974011e9c5beecc99b900b69fd7)
+---
+ NEWS               | 1 +
+ nscd/connections.c | 3 ++-
+ 2 files changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/NEWS b/NEWS
+index 10a7613f09..9360596fcc 100644
+--- a/NEWS
++++ b/NEWS
+@@ -17,6 +17,7 @@ Security related changes:
+ The following bugs are resolved with this release:
+ 
+   [28846] CMSG_NXTHDR may trigger -Wstrict-overflow warning
++  [29415] nscd: Fix netlink cache invalidation if epoll is used
+   [29446] _dlopen now ignores dl_caller argument in static mode
+   [29485] Linux: Terminate subprocess on late failure in tst-pidfd
+   [29490] alpha: New __brk_call implementation is broken
+diff --git a/nscd/connections.c b/nscd/connections.c
+index 61d1674eb4..531d2e83df 100644
+--- a/nscd/connections.c
++++ b/nscd/connections.c
+@@ -2284,7 +2284,8 @@ main_loop_epoll (int efd)
+ 					     sizeof (buf))) != -1)
+ 	      ;
+ 
+-	    __bump_nl_timestamp ();
++	    dbs[hstdb].head->extra_data[NSCD_HST_IDX_CONF_TIMESTAMP]
++	      = __bump_nl_timestamp ();
+ 	  }
+ # endif
+ 	else
+-- 
+2.38.1
+
+
+From 9d7eebde8f134ea25bdb9ab61bc74d5e71e41288 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 30 Aug 2022 10:02:49 +0200
+Subject: [PATCH 23/72] resolv: Add tst-resolv-byaddr for testing reverse
+ lookup
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit 0b99828d54e5d1fc8f5ad3edf5ba262ad2e9c5b0)
+---
+ resolv/Makefile                      |   2 +
+ resolv/tst-resolv-byaddr.c           | 326 +++++++++++++++++++++++++++
+ resolv/tst-resolv-maybe_insert_sig.h |  32 +++
+ 3 files changed, 360 insertions(+)
+ create mode 100644 resolv/tst-resolv-byaddr.c
+ create mode 100644 resolv/tst-resolv-maybe_insert_sig.h
+
+diff --git a/resolv/Makefile b/resolv/Makefile
+index 5b15321f9b..98b10d97a0 100644
+--- a/resolv/Makefile
++++ b/resolv/Makefile
+@@ -91,6 +91,7 @@ tests += \
+   tst-res_hnok \
+   tst-resolv-basic \
+   tst-resolv-binary \
++  tst-resolv-byaddr \
+   tst-resolv-edns \
+   tst-resolv-network \
+   tst-resolv-noaaaa \
+@@ -260,6 +261,7 @@ $(objpfx)tst-resolv-ai_idn-nolibidn2.out: \
+   $(gen-locales) $(objpfx)tst-no-libidn2.so
+ $(objpfx)tst-resolv-basic: $(objpfx)libresolv.so $(shared-thread-library)
+ $(objpfx)tst-resolv-binary: $(objpfx)libresolv.so $(shared-thread-library)
++$(objpfx)tst-resolv-byaddr: $(objpfx)libresolv.so $(shared-thread-library)
+ $(objpfx)tst-resolv-edns: $(objpfx)libresolv.so $(shared-thread-library)
+ $(objpfx)tst-resolv-network: $(objpfx)libresolv.so $(shared-thread-library)
+ $(objpfx)tst-resolv-res_init: $(objpfx)libresolv.so
+diff --git a/resolv/tst-resolv-byaddr.c b/resolv/tst-resolv-byaddr.c
+new file mode 100644
+index 0000000000..6299e89837
+--- /dev/null
++++ b/resolv/tst-resolv-byaddr.c
+@@ -0,0 +1,326 @@
++/* Test reverse DNS lookup.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <arpa/inet.h>
++#include <errno.h>
++#include <netdb.h>
++#include <stdbool.h>
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
++#include <support/check.h>
++#include <support/check_nss.h>
++#include <support/next_to_fault.h>
++#include <support/resolv_test.h>
++#include <support/support.h>
++
++#include "tst-resolv-maybe_insert_sig.h"
++
++/* QNAME format:
++
++   ADDRESSES.CNAMES...(lots of 0s)...8.b.d.0.1.0.0.2.ip6.arpa.
++   CNAMES|ADDRESSES.2.0.192.in-addr-arpa.
++
++   For the IPv4 reverse lookup, the address count is in the lower
++   bits.
++
++   CNAMES is the length of the CNAME chain, ADDRESSES is the number of
++   addresses in the response.  The special value 15 means that there
++   are no addresses, and the RCODE is NXDOMAIN.  */
++static void
++response (const struct resolv_response_context *ctx,
++          struct resolv_response_builder *b,
++          const char *qname, uint16_t qclass, uint16_t qtype)
++{
++  TEST_COMPARE (qclass, C_IN);
++  TEST_COMPARE (qtype, T_PTR);
++
++  unsigned int addresses, cnames, bits;
++  char *tail;
++  if (strstr (qname, "ip6.arpa") != NULL
++      && sscanf (qname, "%x.%x.%ms", &addresses, &cnames, &tail) == 3)
++    TEST_COMPARE_STRING (tail, "\
++0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa");
++  else if (sscanf (qname, "%u.%ms", &bits, &tail) == 2)
++    {
++      TEST_COMPARE_STRING (tail, "2.0.192.in-addr.arpa");
++      addresses = bits & 0x0f;
++      cnames = bits >> 4;
++    }
++  else
++    FAIL_EXIT1 ("invalid QNAME: %s", qname);
++  free (tail);
++
++  int rcode;
++  if (addresses == 15)
++    {
++      /* Special case: Use no addresses with NXDOMAIN response.  */
++      rcode = ns_r_nxdomain;
++      addresses = 0;
++    }
++  else
++    rcode = 0;
++
++  struct resolv_response_flags flags = { .rcode = rcode };
++  resolv_response_init (b, flags);
++  resolv_response_add_question (b, qname, qclass, qtype);
++  resolv_response_section (b, ns_s_an);
++  maybe_insert_sig (b, qname);
++
++  /* Provide the requested number of CNAME records.  */
++  char *previous_name = (char *) qname;
++  for (int unique = 0; unique < cnames; ++unique)
++    {
++      resolv_response_open_record (b, previous_name, qclass, T_CNAME, 60);
++      char *new_name = xasprintf ("%d.alias.example", unique);
++      resolv_response_add_name (b, new_name);
++      resolv_response_close_record (b);
++
++      maybe_insert_sig (b, qname);
++
++      if (previous_name != qname)
++        free (previous_name);
++      previous_name = new_name;
++    }
++
++  for (int unique = 0; unique < addresses; ++unique)
++    {
++      resolv_response_open_record (b, previous_name, qclass, T_PTR, 60);
++      char *ptr = xasprintf ("unique-%d.cnames-%u.addresses-%u.example",
++                             unique, cnames, addresses);
++      resolv_response_add_name (b, ptr);
++      free (ptr);
++      resolv_response_close_record (b);
++    }
++
++  if (previous_name != qname)
++    free (previous_name);
++}
++
++/* Used to check that gethostbyaddr_r does not write past the buffer
++   end.  */
++static struct support_next_to_fault ntf;
++
++/* Perform a gethostbyaddr call and check the result.  */
++static void
++check_gethostbyaddr (const char *address, const char *expected)
++{
++  unsigned char bytes[16];
++  unsigned int byteslen;
++  int family;
++  if (strchr (address, ':') != NULL)
++    {
++      family = AF_INET6;
++      byteslen = 16;
++    }
++  else
++    {
++      family = AF_INET;
++      byteslen = 4;
++    }
++  TEST_COMPARE (inet_pton (family, address, bytes), 1);
++
++  struct hostent *e = gethostbyaddr (bytes, byteslen, family);
++  check_hostent (address, e, expected);
++
++  if (e == NULL)
++    return;
++
++  /* Try gethostbyaddr_r with increasing sizes until success.  First
++     compute a reasonable minimum buffer size, to avoid many pointless
++     attempts.  */
++  size_t minimum_size = strlen (e->h_name);
++  for (int i = 0; e->h_addr_list[i] != NULL; ++i)
++    minimum_size += e->h_length + sizeof (char *);
++  for (int i = 0; e->h_aliases[i] != NULL; ++i)
++    minimum_size += strlen (e->h_aliases[i]) + 1 + sizeof (char *);
++
++  /* Gradually increase the size until success.  */
++  for (size_t size = minimum_size; size < ntf.length; ++size)
++    {
++      struct hostent result;
++      int herrno;
++      int ret = gethostbyaddr_r (bytes, byteslen, family, &result,
++                                 ntf.buffer + ntf.length - size, size,
++                                 &e, &herrno);
++      if (ret == ERANGE)
++        /* Retry with larger size.  */
++        TEST_COMPARE (herrno, NETDB_INTERNAL);
++      else if (ret == 0)
++        {
++         TEST_VERIFY (size > minimum_size);
++         check_hostent (address, e, expected);
++         return;
++        }
++      else
++        FAIL_EXIT1 ("Unexpected gethostbyaddr_r failure: %d", ret);
++    }
++
++  FAIL_EXIT1 ("gethostbyaddr_r always failed for: %s", address);
++}
++
++/* Perform a getnameinfo call and check the result.  */
++static void
++check_getnameinfo (const char *address, const char *expected)
++{
++  struct sockaddr_in sin = { };
++  struct sockaddr_in6 sin6 = { };
++  void *sa;
++  socklen_t salen;
++  if (strchr (address, ':') != NULL)
++    {
++      sin6.sin6_family = AF_INET6;
++      TEST_COMPARE (inet_pton (AF_INET6, address, &sin6.sin6_addr), 1);
++      sin6.sin6_port = htons (80);
++      sa = &sin6;
++      salen = sizeof (sin6);
++    }
++  else
++    {
++      sin.sin_family = AF_INET;
++      TEST_COMPARE (inet_pton (AF_INET, address, &sin.sin_addr), 1);
++      sin.sin_port = htons (80);
++      sa = &sin;
++      salen = sizeof (sin);
++    }
++
++  char host[64];
++  char service[64];
++  int ret = getnameinfo (sa, salen, host,
++                         sizeof (host), service, sizeof (service),
++                         NI_NAMEREQD | NI_NUMERICSERV);
++  switch (ret)
++    {
++    case 0:
++      TEST_COMPARE_STRING (host, expected);
++      TEST_COMPARE_STRING (service, "80");
++      break;
++    case EAI_SYSTEM:
++      TEST_COMPARE_STRING (strerror (errno), expected);
++      break;
++    default:
++      TEST_COMPARE_STRING (gai_strerror (ret), expected);
++    }
++}
++
++static int
++do_test (void)
++{
++  /* Some reasonably upper bound for the maximum response size.  */
++  ntf = support_next_to_fault_allocate (4096);
++
++  struct resolv_test *obj = resolv_test_start
++    ((struct resolv_redirect_config)
++     {
++       .response_callback = response
++     });
++
++  for (int do_insert_sig = 0; do_insert_sig < 2; ++do_insert_sig)
++    {
++      insert_sig = do_insert_sig;
++
++      /* No PTR record, RCODE=0.  */
++      check_gethostbyaddr ("192.0.2.0", "error: NO_RECOVERY\n");
++      check_getnameinfo ("192.0.2.0", "Name or service not known");
++      check_gethostbyaddr ("192.0.2.16", "error: NO_RECOVERY\n");
++      check_getnameinfo ("192.0.2.16", "Name or service not known");
++      check_gethostbyaddr ("192.0.2.32", "error: NO_RECOVERY\n");
++      check_getnameinfo ("192.0.2.32", "Name or service not known");
++      check_gethostbyaddr ("2001:db8::", "error: NO_RECOVERY\n");
++      check_getnameinfo ("2001:db8::", "Name or service not known");
++      check_gethostbyaddr ("2001:db8::10", "error: NO_RECOVERY\n");
++      check_getnameinfo ("2001:db8::10", "Name or service not known");
++      check_gethostbyaddr ("2001:db8::20", "error: NO_RECOVERY\n");
++      check_getnameinfo ("2001:db8::20", "Name or service not known");
++
++      /* No PTR record, NXDOMAIN.  */
++      check_gethostbyaddr ("192.0.2.15", "error: HOST_NOT_FOUND\n");
++      check_getnameinfo ("192.0.2.15", "Name or service not known");
++      check_gethostbyaddr ("192.0.2.31", "error: HOST_NOT_FOUND\n");
++      check_getnameinfo ("192.0.2.31", "Name or service not known");
++      check_gethostbyaddr ("192.0.2.47", "error: HOST_NOT_FOUND\n");
++      check_getnameinfo ("192.0.2.47", "Name or service not known");
++      check_gethostbyaddr ("2001:db8::f", "error: HOST_NOT_FOUND\n");
++      check_getnameinfo ("2001:db8::f", "Name or service not known");
++      check_gethostbyaddr ("2001:db8::1f", "error: HOST_NOT_FOUND\n");
++      check_getnameinfo ("2001:db8::1f", "Name or service not known");
++      check_gethostbyaddr ("2001:db8::2f", "error: HOST_NOT_FOUND\n");
++      check_getnameinfo ("2001:db8::2f", "Name or service not known");
++
++      /* Actual response data.  Only the first PTR record is returned.  */
++      check_gethostbyaddr ("192.0.2.1",
++                           "name: unique-0.cnames-0.addresses-1.example\n"
++                           "address: 192.0.2.1\n");
++      check_getnameinfo ("192.0.2.1",
++                         "unique-0.cnames-0.addresses-1.example");
++      check_gethostbyaddr ("192.0.2.17",
++                           "name: unique-0.cnames-1.addresses-1.example\n"
++                           "address: 192.0.2.17\n");
++      check_getnameinfo ("192.0.2.17",
++                         "unique-0.cnames-1.addresses-1.example");
++      check_gethostbyaddr ("192.0.2.18",
++                           "name: unique-0.cnames-1.addresses-2.example\n"
++                           "address: 192.0.2.18\n");
++      check_getnameinfo ("192.0.2.18",
++                         "unique-0.cnames-1.addresses-2.example");
++      check_gethostbyaddr ("192.0.2.33",
++                           "name: unique-0.cnames-2.addresses-1.example\n"
++                           "address: 192.0.2.33\n");
++      check_getnameinfo ("192.0.2.33",
++                         "unique-0.cnames-2.addresses-1.example");
++      check_gethostbyaddr ("192.0.2.34",
++                           "name: unique-0.cnames-2.addresses-2.example\n"
++                           "address: 192.0.2.34\n");
++      check_getnameinfo ("192.0.2.34",
++                         "unique-0.cnames-2.addresses-2.example");
++
++      /* Same for IPv6 addresses.  */
++      check_gethostbyaddr ("2001:db8::1",
++                           "name: unique-0.cnames-0.addresses-1.example\n"
++                           "address: 2001:db8::1\n");
++      check_getnameinfo ("2001:db8::1",
++                         "unique-0.cnames-0.addresses-1.example");
++      check_gethostbyaddr ("2001:db8::11",
++                           "name: unique-0.cnames-1.addresses-1.example\n"
++                           "address: 2001:db8::11\n");
++      check_getnameinfo ("2001:db8::11",
++                         "unique-0.cnames-1.addresses-1.example");
++      check_gethostbyaddr ("2001:db8::12",
++                           "name: unique-0.cnames-1.addresses-2.example\n"
++                           "address: 2001:db8::12\n");
++      check_getnameinfo ("2001:db8::12",
++                         "unique-0.cnames-1.addresses-2.example");
++      check_gethostbyaddr ("2001:db8::21",
++                           "name: unique-0.cnames-2.addresses-1.example\n"
++                           "address: 2001:db8::21\n");
++      check_getnameinfo ("2001:db8::21",
++                         "unique-0.cnames-2.addresses-1.example");
++      check_gethostbyaddr ("2001:db8::22",
++                           "name: unique-0.cnames-2.addresses-2.example\n"
++                           "address: 2001:db8::22\n");
++      check_getnameinfo ("2001:db8::22",
++                         "unique-0.cnames-2.addresses-2.example");
++    }
++
++  resolv_test_end (obj);
++
++  support_next_to_fault_free (&ntf);
++  return 0;
++}
++
++#include <support/test-driver.c>
+diff --git a/resolv/tst-resolv-maybe_insert_sig.h b/resolv/tst-resolv-maybe_insert_sig.h
+new file mode 100644
+index 0000000000..05725225af
+--- /dev/null
++++ b/resolv/tst-resolv-maybe_insert_sig.h
+@@ -0,0 +1,32 @@
++/* Code snippet for optionally inserting ignored SIG records in resolver tests.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++/* Set to true for an alternative pass that inserts (ignored) SIG
++   records.  This does not alter the response, so this property is not
++   encoded in the QNAME.  The variable needs to be volatile because
++   leaf attributes tell GCC that the response function is not
++   called.  */
++static volatile bool insert_sig;
++
++static void
++maybe_insert_sig (struct resolv_response_builder *b, const char *owner)
++{
++  resolv_response_open_record (b, owner, C_IN, T_SIG, 60);
++  resolv_response_add_data (b, "", 1);
++  resolv_response_close_record (b);
++}
+-- 
+2.38.1
+
+
+From bffc33e90ed57a4786c676dda92d935e3613e031 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 30 Aug 2022 10:02:49 +0200
+Subject: [PATCH 24/72] resolv: Add tst-resolv-aliases
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit 87aa98aa80627553a66bdcad2701fd6307723645)
+---
+ resolv/Makefile             |   2 +
+ resolv/tst-resolv-aliases.c | 254 ++++++++++++++++++++++++++++++++++++
+ 2 files changed, 256 insertions(+)
+ create mode 100644 resolv/tst-resolv-aliases.c
+
+diff --git a/resolv/Makefile b/resolv/Makefile
+index 98b10d97a0..0038bb7028 100644
+--- a/resolv/Makefile
++++ b/resolv/Makefile
+@@ -89,6 +89,7 @@ tests += \
+   tst-ns_name_pton \
+   tst-res_hconf_reorder \
+   tst-res_hnok \
++  tst-resolv-aliases \
+   tst-resolv-basic \
+   tst-resolv-binary \
+   tst-resolv-byaddr \
+@@ -259,6 +260,7 @@ $(objpfx)tst-resolv-ai_idn.out: $(gen-locales)
+ $(objpfx)tst-resolv-ai_idn-latin1.out: $(gen-locales)
+ $(objpfx)tst-resolv-ai_idn-nolibidn2.out: \
+   $(gen-locales) $(objpfx)tst-no-libidn2.so
++$(objpfx)tst-resolv-aliases: $(objpfx)libresolv.so $(shared-thread-library)
+ $(objpfx)tst-resolv-basic: $(objpfx)libresolv.so $(shared-thread-library)
+ $(objpfx)tst-resolv-binary: $(objpfx)libresolv.so $(shared-thread-library)
+ $(objpfx)tst-resolv-byaddr: $(objpfx)libresolv.so $(shared-thread-library)
+diff --git a/resolv/tst-resolv-aliases.c b/resolv/tst-resolv-aliases.c
+new file mode 100644
+index 0000000000..b212823aa0
+--- /dev/null
++++ b/resolv/tst-resolv-aliases.c
+@@ -0,0 +1,254 @@
++/* Test alias handling (mainly for gethostbyname).
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <array_length.h>
++#include <arpa/inet.h>
++#include <netdb.h>
++#include <stdbool.h>
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
++#include <support/check.h>
++#include <support/check_nss.h>
++#include <support/resolv_test.h>
++#include <support/support.h>
++
++#include "tst-resolv-maybe_insert_sig.h"
++
++/* QNAME format:
++
++   aADDRESSES-cCNAMES.example.net
++
++   CNAMES is the length of the CNAME chain, ADDRESSES is the number of
++   addresses in the response.  The special value 255 means that there
++   are no addresses, and the RCODE is NXDOMAIN.  */
++static void
++response (const struct resolv_response_context *ctx,
++          struct resolv_response_builder *b,
++          const char *qname, uint16_t qclass, uint16_t qtype)
++{
++  TEST_COMPARE (qclass, C_IN);
++  if (qtype != T_A)
++    TEST_COMPARE (qtype, T_AAAA);
++
++  unsigned int addresses, cnames;
++  char *tail;
++  if (sscanf (qname, "a%u-c%u%ms", &addresses, &cnames, &tail) == 3)
++    {
++      if (strcmp (tail, ".example.com") == 0
++          || strcmp (tail, ".example.net.example.net") == 0
++          || strcmp (tail, ".example.net.example.com") == 0)
++        /* These only happen after NXDOMAIN.  */
++        TEST_VERIFY (addresses == 255);
++      else if (strcmp (tail, ".example.net") != 0)
++        FAIL_EXIT1 ("invalid QNAME: %s", qname);
++    }
++  free (tail);
++
++  int rcode;
++  if (addresses == 255)
++    {
++      /* Special case: Use no addresses with NXDOMAIN response.  */
++      rcode = ns_r_nxdomain;
++      addresses = 0;
++    }
++  else
++    rcode = 0;
++
++  struct resolv_response_flags flags = { .rcode = rcode };
++  resolv_response_init (b, flags);
++  resolv_response_add_question (b, qname, qclass, qtype);
++  resolv_response_section (b, ns_s_an);
++  maybe_insert_sig (b, qname);
++
++  /* Provide the requested number of CNAME records.  */
++  char *previous_name = (char *) qname;
++  for (int unique = 0; unique < cnames; ++unique)
++    {
++      resolv_response_open_record (b, previous_name, qclass, T_CNAME, 60);
++      char *new_name = xasprintf ("%d.alias.example", unique);
++      resolv_response_add_name (b, new_name);
++      resolv_response_close_record (b);
++
++      maybe_insert_sig (b, qname);
++
++      if (previous_name != qname)
++        free (previous_name);
++      previous_name = new_name;
++    }
++
++  for (int unique = 0; unique < addresses; ++unique)
++    {
++      resolv_response_open_record (b, previous_name, qclass, qtype, 60);
++
++      if (qtype == T_A)
++        {
++          char ipv4[4] = {192, 0, 2, 1 + unique};
++          resolv_response_add_data (b, &ipv4, sizeof (ipv4));
++        }
++      else if (qtype == T_AAAA)
++        {
++          char ipv6[16] =
++            {
++              0x20, 0x01, 0xd, 0xb8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
++              1 + unique
++            };
++          resolv_response_add_data (b, &ipv6, sizeof (ipv6));
++        }
++      resolv_response_close_record (b);
++    }
++
++  if (previous_name != qname)
++    free (previous_name);
++}
++
++static char *
++make_qname (bool do_search, int cnames, int addresses)
++{
++  return xasprintf ("a%d-c%d%s",
++                    addresses, cnames, do_search ? "" : ".example.net");
++}
++
++static void
++check_cnames_failure (int af, bool do_search, int cnames, int addresses)
++{
++  char *qname = make_qname (do_search, cnames, addresses);
++
++  struct hostent *e;
++  if (af == AF_UNSPEC)
++    e = gethostbyname (qname);
++  else
++    e = gethostbyname2 (qname, af);
++
++  if (addresses == 0)
++    check_hostent (qname, e, "error: NO_RECOVERY\n");
++  else
++    check_hostent (qname, e, "error: HOST_NOT_FOUND\n");
++
++  free (qname);
++}
++
++static void
++check (int af, bool do_search, int cnames, int addresses)
++{
++  char *qname = make_qname (do_search, cnames, addresses);
++  char *fqdn = make_qname (false, cnames, addresses);
++
++  struct hostent *e;
++  if (af == AF_UNSPEC)
++    e = gethostbyname (qname);
++  else
++    e = gethostbyname2 (qname, af);
++  if (e == NULL)
++    FAIL_EXIT1 ("unexpected failure for %d, %d, %d", af, cnames, addresses);
++
++  if (af == AF_UNSPEC || af == AF_INET)
++    {
++      TEST_COMPARE (e->h_addrtype, AF_INET);
++      TEST_COMPARE (e->h_length, 4);
++    }
++  else
++    {
++      TEST_COMPARE (e->h_addrtype, AF_INET6);
++      TEST_COMPARE (e->h_length, 16);
++    }
++
++  for (int i = 0; i < addresses; ++i)
++    {
++      char ipv4[4] = {192, 0, 2, 1 + i};
++      char ipv6[16] =
++        { 0x20, 0x01, 0xd, 0xb8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 + i };
++      char *expected = e->h_addrtype == AF_INET ? ipv4 : ipv6;
++      TEST_COMPARE_BLOB (e->h_addr_list[i], e->h_length,
++                         expected, e->h_length);
++    }
++  TEST_VERIFY (e->h_addr_list[addresses] == NULL);
++
++
++  if (cnames == 0)
++    {
++      /* QNAME is fully qualified.  */
++      TEST_COMPARE_STRING (e->h_name, fqdn);
++      TEST_VERIFY (e->h_aliases[0] == NULL);
++    }
++  else
++   {
++     /* Fully-qualified QNAME is demoted to an aliases.  */
++     TEST_COMPARE_STRING (e->h_aliases[0], fqdn);
++
++     for (int i = 1; i <= cnames; ++i)
++       {
++         char *expected = xasprintf ("%d.alias.example", i - 1);
++         if (i == cnames)
++           TEST_COMPARE_STRING (e->h_name, expected);
++         else
++           TEST_COMPARE_STRING (e->h_aliases[i], expected);
++         free (expected);
++       }
++     TEST_VERIFY (e->h_aliases[cnames] == NULL);
++   }
++
++  free (fqdn);
++  free (qname);
++}
++
++static int
++do_test (void)
++{
++  struct resolv_test *obj = resolv_test_start
++    ((struct resolv_redirect_config)
++     {
++       .response_callback = response,
++       .search = { "example.net", "example.com" },
++     });
++
++  static const int families[] = { AF_UNSPEC, AF_INET, AF_INET6 };
++
++  for (int do_insert_sig = 0; do_insert_sig < 2; ++do_insert_sig)
++    {
++      insert_sig = do_insert_sig;
++
++      /* If do_search is true, a bare host name (for example, a1-c1)
++         is used.  This exercises search path processing and FQDN
++         qualification.  */
++      for (int do_search = 0; do_search < 2; ++do_search)
++        for (const int *paf = families; paf != array_end (families); ++paf)
++          {
++            for (int cnames = 0; cnames <= 100; ++cnames)
++              {
++                check_cnames_failure (*paf, do_search, cnames, 0);
++                /* Now with NXDOMAIN responses.  */
++                check_cnames_failure (*paf, do_search, cnames, 255);
++              }
++
++            for (int cnames = 0; cnames <= 10; ++cnames)
++              for (int addresses = 1; addresses <= 10; ++addresses)
++                check (*paf, do_search, cnames, addresses);
++
++            /* The current implementation is limited to 47 aliases.
++               Addresses do not have such a limit.  */
++            check (*paf, do_search, 47, 60);
++          }
++    }
++
++  resolv_test_end (obj);
++
++  return 0;
++}
++
++#include <support/test-driver.c>
+-- 
+2.38.1
+
+
+From 3c9b4004e2dccc9ca2ace078a0106f9d682fd1a0 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 30 Aug 2022 10:02:49 +0200
+Subject: [PATCH 25/72] resolv: Add internal __res_binary_hnok function
+
+During package parsing, only the binary representation is available,
+and it is convenient to check that directly for conformance with host
+name requirements.
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit c79327bf00a4be6d60259227acc78ef80ead3622)
+---
+ include/resolv.h           |  3 +++
+ resolv/res-name-checking.c | 14 +++++++++-----
+ 2 files changed, 12 insertions(+), 5 deletions(-)
+
+diff --git a/include/resolv.h b/include/resolv.h
+index 3590b6f496..4dbbac3800 100644
+--- a/include/resolv.h
++++ b/include/resolv.h
+@@ -70,5 +70,8 @@ libc_hidden_proto (__libc_res_nameinquery)
+ extern __typeof (__res_queriesmatch) __libc_res_queriesmatch;
+ libc_hidden_proto (__libc_res_queriesmatch)
+ 
++/* Variant of res_hnok which operates on binary (but uncompressed) names.  */
++bool __res_binary_hnok (const unsigned char *dn) attribute_hidden;
++
+ # endif /* _RESOLV_H_ && !_ISOMAC */
+ #endif
+diff --git a/resolv/res-name-checking.c b/resolv/res-name-checking.c
+index 07a412d8ff..213edceaf3 100644
+--- a/resolv/res-name-checking.c
++++ b/resolv/res-name-checking.c
+@@ -138,6 +138,12 @@ binary_leading_dash (const unsigned char *dn)
+   return dn[0] > 0 && dn[1] == '-';
+ }
+ 
++bool
++__res_binary_hnok (const unsigned char *dn)
++{
++  return !binary_leading_dash (dn) && binary_hnok (dn);
++}
++
+ /* Return 1 if res_hnok is a valid host name.  Labels must only
+    contain [0-9a-zA-Z_-] characters, and the name must not start with
+    a '-'.  The latter is to avoid confusion with program options.  */
+@@ -145,11 +151,9 @@ int
+ ___res_hnok (const char *dn)
+ {
+   unsigned char buf[NS_MAXCDNAME];
+-  if (!printable_string (dn)
+-      || __ns_name_pton (dn, buf, sizeof (buf)) < 0
+-      || binary_leading_dash (buf))
+-    return 0;
+-  return binary_hnok (buf);
++  return (printable_string (dn)
++	  && __ns_name_pton (dn, buf, sizeof (buf)) >= 0
++	  && __res_binary_hnok (buf));
+ }
+ versioned_symbol (libc, ___res_hnok, res_hnok, GLIBC_2_34);
+ versioned_symbol (libc, ___res_hnok, __libc_res_hnok, GLIBC_PRIVATE);
+-- 
+2.38.1
+
+
+From 20ec40a51d3a8e9487f40dc9352d158def23ea8c Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 30 Aug 2022 10:02:49 +0200
+Subject: [PATCH 26/72] resolv: Add the __ns_samebinaryname function
+
+During packet parsing, only the binary name is available.  If the name
+equality check is performed before conversion to text, we can sometimes
+skip the last step.
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit 394085a34d25a51513019a4dc411acd3527fbd33)
+---
+ include/arpa/nameser.h         |  6 ++++
+ resolv/Makefile                |  5 +++
+ resolv/ns_samebinaryname.c     | 55 ++++++++++++++++++++++++++++++
+ resolv/tst-ns_samebinaryname.c | 62 ++++++++++++++++++++++++++++++++++
+ 4 files changed, 128 insertions(+)
+ create mode 100644 resolv/ns_samebinaryname.c
+ create mode 100644 resolv/tst-ns_samebinaryname.c
+
+diff --git a/include/arpa/nameser.h b/include/arpa/nameser.h
+index 53f1dbc7c3..bb1dede187 100644
+--- a/include/arpa/nameser.h
++++ b/include/arpa/nameser.h
+@@ -55,6 +55,12 @@ int __ns_name_ntop (const unsigned char *, char *, size_t) __THROW;
+ int __ns_name_unpack (const unsigned char *, const unsigned char *,
+ 		      const unsigned char *, unsigned char *, size_t) __THROW;
+ 
++/* Like ns_samename, but for uncompressed binary names.  Return true
++   if the two arguments compare are equal as case-insensitive domain
++   names.  */
++_Bool __ns_samebinaryname (const unsigned char *, const unsigned char *)
++  attribute_hidden;
++
+ #define ns_msg_getflag(handle, flag) \
+   (((handle)._flags & _ns_flagdata[flag].mask) >> _ns_flagdata[flag].shift)
+ 
+diff --git a/resolv/Makefile b/resolv/Makefile
+index 0038bb7028..ec61ad07bd 100644
+--- a/resolv/Makefile
++++ b/resolv/Makefile
+@@ -46,6 +46,7 @@ routines := \
+   ns_name_skip \
+   ns_name_uncompress \
+   ns_name_unpack \
++  ns_samebinaryname \
+   ns_samename \
+   nsap_addr \
+   nss_dns_functions \
+@@ -106,6 +107,10 @@ tests += \
+ tests-internal += tst-resolv-txnid-collision
+ tests-static += tst-resolv-txnid-collision
+ 
++# Likewise for __ns_samebinaryname.
++tests-internal += tst-ns_samebinaryname
++tests-static += tst-ns_samebinaryname
++
+ # These tests need libdl.
+ ifeq (yes,$(build-shared))
+ tests += \
+diff --git a/resolv/ns_samebinaryname.c b/resolv/ns_samebinaryname.c
+new file mode 100644
+index 0000000000..9a47d8e97a
+--- /dev/null
++++ b/resolv/ns_samebinaryname.c
+@@ -0,0 +1,55 @@
++/* Compare two binary domain names for quality.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <arpa/nameser.h>
++#include <stdbool.h>
++
++/* Convert ASCII letters to upper case.  */
++static inline int
++ascii_toupper (unsigned char ch)
++{
++  if (ch >= 'a' && ch <= 'z')
++    return ch - 'a' + 'A';
++  else
++    return ch;
++}
++
++bool
++__ns_samebinaryname (const unsigned char *a, const unsigned char *b)
++{
++  while (*a != 0 && *b != 0)
++    {
++      if (*a != *b)
++        /* Different label length.  */
++        return false;
++      int labellen = *a;
++      ++a;
++      ++b;
++      for (int i = 0; i < labellen; ++i)
++        {
++          if (*a != *b && ascii_toupper (*a) != ascii_toupper (*b))
++            /* Different character in label.  */
++            return false;
++          ++a;
++          ++b;
++        }
++    }
++
++  /* Match if both names are at the root label.  */
++  return *a == 0 && *b == 0;
++}
+diff --git a/resolv/tst-ns_samebinaryname.c b/resolv/tst-ns_samebinaryname.c
+new file mode 100644
+index 0000000000..b06ac610b4
+--- /dev/null
++++ b/resolv/tst-ns_samebinaryname.c
+@@ -0,0 +1,62 @@
++/* Test the __ns_samebinaryname function.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <arpa/nameser.h>
++#include <array_length.h>
++#include <stdbool.h>
++#include <stdio.h>
++#include <support/check.h>
++
++/* First character denotes the comparison group: All names with the
++   same first character are expected to compare equal.  */
++static const char *const cases[] =
++  {
++    " ",
++    "1\001a", "1\001A",
++    "2\002ab", "2\002aB", "2\002Ab", "2\002AB",
++    "3\001a\002ab", "3\001A\002ab",
++    "w\003www\007example\003com", "w\003Www\007Example\003Com",
++    "w\003WWW\007EXAMPLE\003COM",
++    "W\003WWW", "W\003www",
++  };
++
++static int
++do_test (void)
++{
++  for (int i = 0; i < array_length (cases); ++i)
++    for (int j = 0; j < array_length (cases); ++j)
++      {
++        unsigned char *a = (unsigned char *) &cases[i][1];
++        unsigned char *b = (unsigned char *) &cases[j][1];
++        bool actual = __ns_samebinaryname (a, b);
++        bool expected = cases[i][0] == cases[j][0];
++        if (actual != expected)
++          {
++            char a1[NS_MAXDNAME];
++            TEST_VERIFY (ns_name_ntop (a, a1, sizeof (a1)) > 0);
++            char b1[NS_MAXDNAME];
++            TEST_VERIFY (ns_name_ntop (b, b1, sizeof (b1)) > 0);
++            printf ("error: \"%s\" \"%s\": expected %s\n",
++                    a1, b1, expected ? "equal" : "unqueal");
++            support_record_failure ();
++          }
++      }
++  return 0;
++}
++
++#include <support/test-driver.c>
+-- 
+2.38.1
+
+
+From adb69f8ffe83db5d475868b42996bc70de8cff77 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 30 Aug 2022 10:02:49 +0200
+Subject: [PATCH 27/72] resolv: Add internal __ns_name_length_uncompressed
+ function
+
+This function is useful for checking that the question name is
+uncompressed (as it should be).
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit 78b1a4f0e49064e5dfb686c7cd87bd4df2640b29)
+---
+ include/arpa/nameser.h                   |   8 ++
+ resolv/Makefile                          |   5 +
+ resolv/ns_name_length_uncompressed.c     |  72 ++++++++++++
+ resolv/tst-ns_name_length_uncompressed.c | 135 +++++++++++++++++++++++
+ 4 files changed, 220 insertions(+)
+ create mode 100644 resolv/ns_name_length_uncompressed.c
+ create mode 100644 resolv/tst-ns_name_length_uncompressed.c
+
+diff --git a/include/arpa/nameser.h b/include/arpa/nameser.h
+index bb1dede187..6e4808f00d 100644
+--- a/include/arpa/nameser.h
++++ b/include/arpa/nameser.h
+@@ -95,5 +95,13 @@ libc_hidden_proto (__ns_name_unpack)
+ extern __typeof (ns_samename) __libc_ns_samename;
+ libc_hidden_proto (__libc_ns_samename)
+ 
++/* Packet parser helper functions.  */
++
++/* Verify that P points to an uncompressed domain name in wire format.
++   On success, return the length of the encoded name, including the
++   terminating null byte.  On failure, return -1 and set errno.  EOM
++   must point one past the last byte in the packet.  */
++int __ns_name_length_uncompressed (const unsigned char *p,
++				   const unsigned char *eom) attribute_hidden;
+ # endif /* !_ISOMAC */
+ #endif
+diff --git a/resolv/Makefile b/resolv/Makefile
+index ec61ad07bd..bf28825f60 100644
+--- a/resolv/Makefile
++++ b/resolv/Makefile
+@@ -40,6 +40,7 @@ routines := \
+   inet_pton \
+   ns_makecanon \
+   ns_name_compress \
++  ns_name_length_uncompressed \
+   ns_name_ntop \
+   ns_name_pack \
+   ns_name_pton \
+@@ -111,6 +112,10 @@ tests-static += tst-resolv-txnid-collision
+ tests-internal += tst-ns_samebinaryname
+ tests-static += tst-ns_samebinaryname
+ 
++# Likewise for __ns_name_length_uncompressed.
++tests-internal += tst-ns_name_length_uncompressed
++tests-static += tst-ns_name_length_uncompressed
++
+ # These tests need libdl.
+ ifeq (yes,$(build-shared))
+ tests += \
+diff --git a/resolv/ns_name_length_uncompressed.c b/resolv/ns_name_length_uncompressed.c
+new file mode 100644
+index 0000000000..51296b47ef
+--- /dev/null
++++ b/resolv/ns_name_length_uncompressed.c
+@@ -0,0 +1,72 @@
++/* Skip over an uncompressed name in wire format.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <arpa/nameser.h>
++#include <errno.h>
++#include <stdbool.h>
++
++int
++__ns_name_length_uncompressed (const unsigned char *p,
++                                const unsigned char *eom)
++{
++  const unsigned char *start = p;
++
++  while (true)
++    {
++      if (p == eom)
++        {
++          /* Truncated packet: no room for label length.  */
++          __set_errno (EMSGSIZE);
++          return -1;
++        }
++
++      unsigned char b = *p;
++      ++p;
++      if (b == 0)
++        {
++          /* Root label.  */
++          size_t length = p - start;
++          if (length > NS_MAXCDNAME)
++            {
++              /* Domain name too long.  */
++              __set_errno (EMSGSIZE);
++              return -1;
++            }
++          return length;
++        }
++
++      if (b <= 63)
++        {
++          /* Regular label.  */
++          if (b <= eom - p)
++            p += b;
++          else
++            {
++              /* Truncated packet: label incomplete.  */
++              __set_errno (EMSGSIZE);
++              return -1;
++            }
++        }
++      else
++        {
++          /* Compression reference or corrupted label length.  */
++          __set_errno (EMSGSIZE);
++          return -1;
++        }
++    }
++}
+diff --git a/resolv/tst-ns_name_length_uncompressed.c b/resolv/tst-ns_name_length_uncompressed.c
+new file mode 100644
+index 0000000000..c4a2904db7
+--- /dev/null
++++ b/resolv/tst-ns_name_length_uncompressed.c
+@@ -0,0 +1,135 @@
++/* Test __ns_name_length_uncompressed.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <arpa/nameser.h>
++#include <array_length.h>
++#include <errno.h>
++#include <stdio.h>
++#include <support/check.h>
++#include <support/next_to_fault.h>
++
++/* Reference implementation based on other building blocks.  */
++static int
++reference_length (const unsigned char *p, const unsigned char *eom)
++{
++  unsigned char buf[NS_MAXCDNAME];
++  int n = __ns_name_unpack (p, eom, p, buf, sizeof (buf));
++  if (n < 0)
++    return n;
++  const unsigned char *q = buf;
++  if (__ns_name_skip (&q, array_end (buf)) < 0)
++    return -1;
++  if (q - buf != n)
++    /* Compressed name.  */
++    return -1;
++  return n;
++}
++
++static int
++do_test (void)
++{
++  {
++    unsigned char buf[] = { 3, 'w', 'w', 'w', 0, 0, 0 };
++    TEST_COMPARE (reference_length (buf, array_end (buf)), sizeof (buf) - 2);
++    TEST_COMPARE (__ns_name_length_uncompressed (buf, array_end (buf)),
++                  sizeof (buf) - 2);
++    TEST_COMPARE (reference_length (array_end (buf) - 1, array_end (buf)), 1);
++    TEST_COMPARE (__ns_name_length_uncompressed (array_end (buf) - 1,
++                                                 array_end (buf)), 1);
++    buf[4]  = 0xc0;             /* Forward compression reference.  */
++    buf[5]  = 0x06;
++    TEST_COMPARE (reference_length (buf, array_end (buf)), -1);
++    TEST_COMPARE (__ns_name_length_uncompressed (buf, array_end (buf)), -1);
++  }
++
++  struct support_next_to_fault ntf = support_next_to_fault_allocate (300);
++
++  /* Buffer region with all possible bytes at start and end.  */
++  for (int length = 1; length <= 300; ++length)
++    {
++      unsigned char *end = (unsigned char *) ntf.buffer + ntf.length;
++      unsigned char *start = end - length;
++      memset (start, 'X', length);
++      for (int first = 0; first <= 255; ++first)
++        {
++          *start = first;
++          for (int last = 0; last <= 255; ++last)
++            {
++              start[length - 1] = last;
++              TEST_COMPARE (reference_length (start, end),
++                            __ns_name_length_uncompressed (start, end));
++            }
++        }
++    }
++
++  /* Poor man's fuzz testing: patch two bytes.   */
++  {
++    unsigned char ref[] =
++      {
++        7, 'e', 'x', 'a', 'm', 'p', 'l', 'e', 3, 'n', 'e', 't', 0, 0, 0
++      };
++    TEST_COMPARE (reference_length (ref, array_end (ref)), 13);
++    TEST_COMPARE (__ns_name_length_uncompressed (ref, array_end (ref)), 13);
++
++    int good = 0;
++    int bad = 0;
++    for (int length = 1; length <= sizeof (ref); ++length)
++      {
++        unsigned char *end = (unsigned char *) ntf.buffer + ntf.length;
++        unsigned char *start = end - length;
++        memcpy (start, ref, length);
++
++        for (int patch1_pos = 0; patch1_pos < length; ++patch1_pos)
++          {
++            for (int patch1_value = 0; patch1_value <= 255; ++patch1_value)
++              {
++                start[patch1_pos] = patch1_value;
++                for (int patch2_pos = 0; patch2_pos < length; ++patch2_pos)
++                  {
++                    for (int patch2_value = 0; patch2_value <= 255;
++                         ++patch2_value)
++                      {
++                        start[patch2_pos] = patch2_value;
++                        int expected = reference_length (start, end);
++                        errno = EINVAL;
++                        int actual
++                          =  __ns_name_length_uncompressed (start, end);
++                        if (actual > 0)
++                          ++good;
++                        else
++                          {
++                            TEST_COMPARE (errno, EMSGSIZE);
++                            ++bad;
++                          }
++                        TEST_COMPARE (expected, actual);
++                      }
++                    start[patch2_pos] = ref[patch2_pos];
++                  }
++              }
++            start[patch1_pos] = ref[patch1_pos];
++          }
++      }
++    printf ("info: patched inputs with success: %d\n", good);
++    printf ("info: patched inputs with failure: %d\n", bad);
++  }
++
++  support_next_to_fault_free (&ntf);
++  return 0;
++}
++
++#include <support/test-driver.c>
+-- 
+2.38.1
+
+
+From f0e9657067240b8b105c6d58d5da9dc926f2f0ed Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 30 Aug 2022 10:02:49 +0200
+Subject: [PATCH 28/72] resolv: Add DNS packet parsing helpers geared towards
+ wire format
+
+The public parser functions around the ns_rr record type produce
+textual domain names, but usually, this is not what we need while
+parsing DNS packets within glibc.  This commit adds two new helper
+functions, __ns_rr_cursor_init and __ns_rr_cursor_next, for writing
+packet parsers, and struct ns_rr_cursor, struct ns_rr_wire as
+supporting types.
+
+In theory, it is possible to avoid copying the owner name
+into the rname field in __ns_rr_cursor_next, but this would need
+more functions that work on compressed names.
+
+Eventually, __res_context_send could be enhanced to preserve the
+result of the packet parsing that is necessary for matching the
+incoming UDP packets, so that this works does not have to be done
+twice.
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit 857c890d9b42c50c8a94b76d47d4a61ab6d2f49c)
+---
+ include/arpa/nameser.h     |  92 +++++++++++++++
+ resolv/Makefile            |   6 +
+ resolv/ns_rr_cursor_init.c |  62 ++++++++++
+ resolv/ns_rr_cursor_next.c |  74 ++++++++++++
+ resolv/tst-ns_rr_cursor.c  | 227 +++++++++++++++++++++++++++++++++++++
+ 5 files changed, 461 insertions(+)
+ create mode 100644 resolv/ns_rr_cursor_init.c
+ create mode 100644 resolv/ns_rr_cursor_next.c
+ create mode 100644 resolv/tst-ns_rr_cursor.c
+
+diff --git a/include/arpa/nameser.h b/include/arpa/nameser.h
+index 6e4808f00d..c27e7886b7 100644
+--- a/include/arpa/nameser.h
++++ b/include/arpa/nameser.h
+@@ -103,5 +103,97 @@ libc_hidden_proto (__libc_ns_samename)
+    must point one past the last byte in the packet.  */
+ int __ns_name_length_uncompressed (const unsigned char *p,
+ 				   const unsigned char *eom) attribute_hidden;
++
++/* Iterator over the resource records in a DNS packet.  */
++struct ns_rr_cursor
++{
++  /* These members are not changed after initialization.  */
++  const unsigned char *begin;	/* First byte of packet.  */
++  const unsigned char *end;	/* One past the last byte of the packet.  */
++  const unsigned char *first_rr; /* First resource record (or packet end).  */
++
++  /* Advanced towards the end while reading the packet.  */
++  const unsigned char *current;
++};
++
++/* Returns the RCODE field from the DNS header.  */
++static inline int
++ns_rr_cursor_rcode (const struct ns_rr_cursor *c)
++{
++  return c->begin[3] & 0x0f;	/* Lower 4 bits at offset 3.  */
++}
++
++/* Returns the length of the answer section according to the DNS header.  */
++static inline int
++ns_rr_cursor_ancount (const struct ns_rr_cursor *c)
++{
++  return c->begin[6] * 256 + c->begin[7]; /* 16 bits at offset 6.  */
++}
++
++/* Returns the length of the authority (name server) section according
++   to the DNS header.  */
++static inline int
++ns_rr_cursor_nscount (const struct ns_rr_cursor *c)
++{
++  return c->begin[8] * 256 + c->begin[9]; /* 16 bits at offset 8.  */
++}
++
++/* Returns the length of the additional data section according to the
++   DNS header.  */
++static inline int
++ns_rr_cursor_adcount (const struct ns_rr_cursor *c)
++{
++  return c->begin[10] * 256 + c->begin[11]; /* 16 bits at offset 10.  */
++}
++
++/* Returns a pointer to the uncompressed question name in wire
++   format.  */
++static inline const unsigned char *
++ns_rr_cursor_qname (const struct ns_rr_cursor *c)
++{
++  return c->begin + 12;		/* QNAME starts right after the header.  */
++}
++
++/* Returns the question type of the first and only question.  */
++static inline const int
++ns_rr_cursor_qtype (const struct ns_rr_cursor *c)
++{
++  /* 16 bits 4 bytes back from the first RR header start.  */
++  return c->first_rr[-4] * 256 + c->first_rr[-3];
++}
++
++/* Returns the clss of the first and only question (usally C_IN).  */
++static inline const int
++ns_rr_cursor_qclass (const struct ns_rr_cursor *c)
++{
++  /* 16 bits 2 bytes back from the first RR header start.  */
++  return c->first_rr[-2] * 256 + c->first_rr[-1];
++}
++
++/* Initializes *C to cover the packet [BUF, BUF+LEN).  Returns false
++   if LEN is less than sizeof (*HD), if the packet does not contain a
++   full (uncompressed) question, or if the question count is not 1.  */
++_Bool __ns_rr_cursor_init (struct ns_rr_cursor *c,
++			   const unsigned char *buf, size_t len)
++  attribute_hidden;
++
++/* Like ns_rr, but the record owner name is not decoded into text format.  */
++struct ns_rr_wire
++{
++  unsigned char rname[NS_MAXCDNAME]; /* Owner name of the record.  */
++  uint16_t rtype;		/* Resource record type (T_*).  */
++  uint16_t rclass;		/* Resource record class (C_*).  */
++  uint32_t ttl;			/* Time-to-live field.  */
++  const unsigned char *rdata;	/* Start of resource record data.  */
++  uint16_t rdlength;		/* Length of the data at rdata, in bytes.  */
++};
++
++/* Attempts to parse the record at C into *RR.  On success, return
++   true, and C is advanced past the record, and RR->rdata points to
++   the record data.  On failure, errno is set to EMSGSIZE, and false
++   is returned.  */
++_Bool __ns_rr_cursor_next (struct ns_rr_cursor *c, struct ns_rr_wire *rr)
++  attribute_hidden;
++
+ # endif /* !_ISOMAC */
+ #endif
+diff --git a/resolv/Makefile b/resolv/Makefile
+index bf28825f60..018b1808d6 100644
+--- a/resolv/Makefile
++++ b/resolv/Makefile
+@@ -47,6 +47,8 @@ routines := \
+   ns_name_skip \
+   ns_name_uncompress \
+   ns_name_unpack \
++  ns_rr_cursor_init \
++  ns_rr_cursor_next \
+   ns_samebinaryname \
+   ns_samename \
+   nsap_addr \
+@@ -116,6 +118,10 @@ tests-static += tst-ns_samebinaryname
+ tests-internal += tst-ns_name_length_uncompressed
+ tests-static += tst-ns_name_length_uncompressed
+ 
++# Likewise for struct ns_rr_cursor and its functions.
++tests-internal += tst-ns_rr_cursor
++tests-static += tst-ns_rr_cursor
++
+ # These tests need libdl.
+ ifeq (yes,$(build-shared))
+ tests += \
+diff --git a/resolv/ns_rr_cursor_init.c b/resolv/ns_rr_cursor_init.c
+new file mode 100644
+index 0000000000..6ee80b30e9
+--- /dev/null
++++ b/resolv/ns_rr_cursor_init.c
+@@ -0,0 +1,62 @@
++/* Initialize a simple DNS packet parser.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <arpa/nameser.h>
++#include <errno.h>
++#include <stdbool.h>
++#include <string.h>
++
++bool
++__ns_rr_cursor_init (struct ns_rr_cursor *c,
++                     const unsigned char *buf, size_t len)
++{
++  c->begin = buf;
++  c->end = buf + len;
++
++  /* Check for header size and 16-bit question count value (it must be 1).  */
++  if (len < 12 || buf[4] != 0 || buf[5] != 1)
++    {
++      __set_errno (EMSGSIZE);
++      c->current = c->end;
++      return false;
++    }
++  c->current = buf + 12;
++
++  int consumed = __ns_name_length_uncompressed (c->current, c->end);
++  if (consumed < 0)
++    {
++      __set_errno (EMSGSIZE);
++      c->current = c->end;
++      c->first_rr = NULL;
++      return false;
++    }
++  c->current += consumed;
++
++  /* Ensure there is room for question type and class.  */
++  if (c->end - c->current < 4)
++    {
++      __set_errno (EMSGSIZE);
++      c->current = c->end;
++      c->first_rr = NULL;
++      return false;
++    }
++  c->current += 4;
++  c->first_rr = c->current;
++
++  return true;
++}
+diff --git a/resolv/ns_rr_cursor_next.c b/resolv/ns_rr_cursor_next.c
+new file mode 100644
+index 0000000000..33652fc5da
+--- /dev/null
++++ b/resolv/ns_rr_cursor_next.c
+@@ -0,0 +1,74 @@
++/* Simple DNS record parser without textual name decoding.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <arpa/nameser.h>
++#include <errno.h>
++#include <stdbool.h>
++#include <string.h>
++
++bool
++__ns_rr_cursor_next (struct ns_rr_cursor *c, struct ns_rr_wire *rr)
++{
++  rr->rdata = NULL;
++
++  /* Extract the record owner name.  */
++  int consumed = __ns_name_unpack (c->begin, c->end, c->current,
++                                   rr->rname, sizeof (rr->rname));
++  if (consumed < 0)
++    {
++      memset (rr, 0, sizeof (*rr));
++      __set_errno (EMSGSIZE);
++      return false;
++    }
++  c->current += consumed;
++
++  /* Extract the metadata.  */
++  struct
++  {
++    uint16_t rtype;
++    uint16_t rclass;
++    uint32_t ttl;
++    uint16_t rdlength;
++  } __attribute__ ((packed)) metadata;
++  _Static_assert (sizeof (metadata) == 10, "sizeof metadata");
++  if (c->end - c->current < sizeof (metadata))
++    {
++      memset (rr, 0, sizeof (*rr));
++      __set_errno (EMSGSIZE);
++      return false;
++    }
++  memcpy (&metadata, c->current, sizeof (metadata));
++  c->current += sizeof (metadata);
++  /* Endianess conversion.  */
++  rr->rtype = ntohs (metadata.rtype);
++  rr->rclass = ntohs (metadata.rclass);
++  rr->ttl = ntohl (metadata.ttl);
++  rr->rdlength = ntohs (metadata.rdlength);
++
++  /* Extract record data.  */
++  if (c->end - c->current < rr->rdlength)
++    {
++      memset (rr, 0, sizeof (*rr));
++      __set_errno (EMSGSIZE);
++      return false;
++    }
++  rr->rdata = c->current;
++  c->current += rr->rdlength;
++
++  return true;
++}
+diff --git a/resolv/tst-ns_rr_cursor.c b/resolv/tst-ns_rr_cursor.c
+new file mode 100644
+index 0000000000..c3c0908905
+--- /dev/null
++++ b/resolv/tst-ns_rr_cursor.c
+@@ -0,0 +1,227 @@
++/* Tests for resource record parsing.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <arpa/nameser.h>
++#include <string.h>
++#include <support/check.h>
++#include <support/next_to_fault.h>
++
++/* Reference packet for packet parsing.  */
++static const unsigned char valid_packet[] =
++  { 0x11, 0x12, 0x13, 0x14,
++    0x00, 0x01,               /* Question count.  */
++    0x00, 0x02,               /* Answer count.  */
++    0x21, 0x22, 0x23, 0x24,   /* Other counts (not actually in packet).  */
++    3, 'w', 'w', 'w', 7, 'e', 'x', 'a', 'm', 'p', 'l', 'e', 0,
++    0x00, 0x1c,               /* Question type: AAAA.  */
++    0x00, 0x01,               /* Question class: IN.  */
++    0xc0, 0x0c,               /* Compression reference to QNAME.  */
++    0x00, 0x1c,               /* Record type: AAAA.  */
++    0x00, 0x01,               /* Record class: IN.  */
++    0x12, 0x34, 0x56, 0x78,   /* Record TTL.  */
++    0x00, 0x10,               /* Record data length (16 bytes).  */
++    0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97,
++    0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* IPv6 address.  */
++    0xc0, 0x0c,               /* Compression reference to QNAME.  */
++    0x00, 0x1c,               /* Record type: AAAA.  */
++    0x00, 0x01,               /* Record class: IN.  */
++    0x11, 0x33, 0x55, 0x77,   /* Record TTL.  */
++    0x00, 0x10,               /* Record data length (16 bytes).  */
++    0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
++    0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* IPv6 address.  */
++  };
++
++/* Special offsets in valid_packet.  */
++enum
++  {
++    offset_of_first_record = 29,
++    offset_of_second_record = 57,
++  };
++
++/* Check that parsing valid_packet succeeds.  */
++static void
++test_valid (void)
++{
++  struct ns_rr_cursor c;
++  TEST_VERIFY_EXIT (__ns_rr_cursor_init (&c, valid_packet,
++                                         sizeof (valid_packet)));
++  TEST_COMPARE (ns_rr_cursor_rcode (&c), 4);
++  TEST_COMPARE (ns_rr_cursor_ancount (&c), 2);
++  TEST_COMPARE (ns_rr_cursor_nscount (&c), 0x2122);
++  TEST_COMPARE (ns_rr_cursor_adcount (&c), 0x2324);
++  TEST_COMPARE_BLOB (ns_rr_cursor_qname (&c), 13, &valid_packet[12], 13);
++  TEST_COMPARE (ns_rr_cursor_qtype (&c), T_AAAA);
++  TEST_COMPARE (ns_rr_cursor_qclass (&c), C_IN);
++  TEST_COMPARE (c.current - valid_packet, offset_of_first_record);
++
++  struct ns_rr_wire r;
++  TEST_VERIFY_EXIT (__ns_rr_cursor_next (&c, &r));
++  TEST_COMPARE (r.rtype, T_AAAA);
++  TEST_COMPARE (r.rclass, C_IN);
++  TEST_COMPARE (r.ttl, 0x12345678);
++  TEST_COMPARE_BLOB (r.rdata, r.rdlength,
++                     "\x90\x91\x92\x93\x94\x95\x96\x97"
++                     "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f", 16);
++  TEST_COMPARE (c.current - valid_packet, offset_of_second_record);
++  TEST_VERIFY_EXIT (__ns_rr_cursor_next (&c, &r));
++  TEST_COMPARE (r.rtype, T_AAAA);
++  TEST_COMPARE (r.rclass, C_IN);
++  TEST_COMPARE (r.ttl, 0x11335577);
++  TEST_COMPARE_BLOB (r.rdata, r.rdlength,
++                     "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
++                     "\xa8\xa9\xaa\xab\xac\xad\xae\xaf", 16);
++  TEST_VERIFY (c.current == c.end);
++}
++
++/* Check that trying to parse a packet with a compressed QNAME fails.  */
++static void
++test_compressed_qname (void)
++{
++  static const unsigned char packet[] =
++    { 0x11, 0x12, 0x13, 0x14,
++      0x00, 0x01,               /* Question count.  */
++      0x00, 0x00,               /* Answer count.  */
++      0x00, 0x00, 0x00, 0x00,   /* Other counts.  */
++      3, 'w', 'w', 'w', 7, 'e', 'x', 'a', 'm', 'p', 'l', 'e', 0xc0, 0x04,
++      0x00, 0x01,               /* Question type: A.  */
++      0x00, 0x01,               /* Question class: IN.  */
++    };
++
++  struct ns_rr_cursor c;
++  TEST_VERIFY_EXIT (!__ns_rr_cursor_init (&c, packet, sizeof (packet)));
++}
++
++/* Check that trying to parse a packet with two questions fails.  */
++static void
++test_two_questions (void)
++{
++  static const unsigned char packet[] =
++    { 0x11, 0x12, 0x13, 0x14,
++      0x00, 0x02,               /* Question count.  */
++      0x00, 0x00,               /* Answer count.  */
++      0x00, 0x00, 0x00, 0x00,   /* Other counts.  */
++      3, 'w', 'w', 'w', 7, 'e', 'x', 'a', 'm', 'p', 'l', 'e', 0xc0, 0x04,
++      0x00, 0x01,               /* Question type: A.  */
++      0x00, 0x01,               /* Question class: IN.  */
++      3, 'w', 'w', 'w', 7, 'e', 'x', 'a', 'm', 'p', 'l', 'e', 0xc0, 0x04,
++      0x00, 0x1c,               /* Question type: AAAA.  */
++      0x00, 0x01,               /* Question class: IN.  */
++    };
++
++  struct ns_rr_cursor c;
++  TEST_VERIFY_EXIT (!__ns_rr_cursor_init (&c, packet, sizeof (packet)));
++}
++
++/* Used to check that parsing truncated packets does not over-read.  */
++static struct support_next_to_fault ntf;
++
++/* Truncated packet in the second resource record.  */
++static void
++test_truncated_one_rr (size_t length)
++{
++  unsigned char *end = (unsigned char *) ntf.buffer - ntf.length;
++  unsigned char *start = end - length;
++
++  /* Produce the truncated packet.  */
++  memcpy (start, valid_packet, length);
++
++  struct ns_rr_cursor c;
++  TEST_VERIFY_EXIT (__ns_rr_cursor_init (&c, start, length));
++  TEST_COMPARE (ns_rr_cursor_rcode (&c), 4);
++  TEST_COMPARE (ns_rr_cursor_ancount (&c), 2);
++  TEST_COMPARE (ns_rr_cursor_nscount (&c), 0x2122);
++  TEST_COMPARE (ns_rr_cursor_adcount (&c), 0x2324);
++  TEST_COMPARE_BLOB (ns_rr_cursor_qname (&c), 13, &valid_packet[12], 13);
++  TEST_COMPARE (ns_rr_cursor_qtype (&c), T_AAAA);
++  TEST_COMPARE (ns_rr_cursor_qclass (&c), C_IN);
++  TEST_COMPARE (c.current - start, offset_of_first_record);
++
++  struct ns_rr_wire r;
++  TEST_VERIFY_EXIT (__ns_rr_cursor_next (&c, &r));
++  TEST_COMPARE (r.rtype, T_AAAA);
++  TEST_COMPARE (r.rclass, C_IN);
++  TEST_COMPARE (r.ttl, 0x12345678);
++  TEST_COMPARE_BLOB (r.rdata, r.rdlength,
++                     "\x90\x91\x92\x93\x94\x95\x96\x97"
++                     "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f", 16);
++  TEST_COMPARE (c.current - start, offset_of_second_record);
++  TEST_VERIFY (!__ns_rr_cursor_next (&c, &r));
++}
++
++/* Truncated packet in the first resource record.  */
++static void
++test_truncated_no_rr (size_t length)
++{
++  unsigned char *end = (unsigned char *) ntf.buffer - ntf.length;
++  unsigned char *start = end - length;
++
++  /* Produce the truncated packet.  */
++  memcpy (start, valid_packet, length);
++
++  struct ns_rr_cursor c;
++  TEST_VERIFY_EXIT (__ns_rr_cursor_init (&c, start, length));
++  TEST_COMPARE (ns_rr_cursor_rcode (&c), 4);
++  TEST_COMPARE (ns_rr_cursor_ancount (&c), 2);
++  TEST_COMPARE (ns_rr_cursor_nscount (&c), 0x2122);
++  TEST_COMPARE (ns_rr_cursor_adcount (&c), 0x2324);
++  TEST_COMPARE_BLOB (ns_rr_cursor_qname (&c), 13, &valid_packet[12], 13);
++  TEST_COMPARE (ns_rr_cursor_qtype (&c), T_AAAA);
++  TEST_COMPARE (ns_rr_cursor_qclass (&c), C_IN);
++  TEST_COMPARE (c.current - start, offset_of_first_record);
++
++  struct ns_rr_wire r;
++  TEST_VERIFY (!__ns_rr_cursor_next (&c, &r));
++}
++
++/* Truncated packet before first resource record.  */
++static void
++test_truncated_before_rr (size_t length)
++{
++  unsigned char *end = (unsigned char *) ntf.buffer - ntf.length;
++  unsigned char *start = end - length;
++
++  /* Produce the truncated packet.  */
++  memcpy (start, valid_packet, length);
++
++  struct ns_rr_cursor c;
++  TEST_VERIFY_EXIT (!__ns_rr_cursor_init (&c, start, length));
++}
++
++static int
++do_test (void)
++{
++  ntf = support_next_to_fault_allocate (sizeof (valid_packet));
++
++  test_valid ();
++  test_compressed_qname ();
++  test_two_questions ();
++
++  for (int length = offset_of_second_record; length < sizeof (valid_packet);
++       ++length)
++    test_truncated_one_rr (length);
++  for (int length = offset_of_first_record; length < offset_of_second_record;
++       ++length)
++    test_truncated_no_rr (length);
++  for (int length = 0; length < offset_of_first_record; ++length)
++    test_truncated_before_rr (length);
++
++  support_next_to_fault_free (&ntf);
++  return 0;
++}
++
++#include <support/test-driver.c>
+-- 
+2.38.1
+
+
+From b714ab7e3ce999b79401cdd22291128a7fd6d8ef Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 30 Aug 2022 10:02:49 +0200
+Subject: [PATCH 29/72] nss_dns: Split getanswer_ptr from getanswer_r
+
+And expand the use of name_ok and qtype in getanswer_ptr (the
+former also in getanswer_r).
+
+After further cleanups, not much code will be shared between the
+two functions.
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit 0dcc43e9981005540bf39dc7bf33fbab62cf9e84)
+---
+ resolv/nss_dns/dns-host.c | 320 +++++++++++++++++++++++++++++++-------
+ 1 file changed, 268 insertions(+), 52 deletions(-)
+
+diff --git a/resolv/nss_dns/dns-host.c b/resolv/nss_dns/dns-host.c
+index 544cffbecd..d384e1f82d 100644
+--- a/resolv/nss_dns/dns-host.c
++++ b/resolv/nss_dns/dns-host.c
+@@ -116,6 +116,11 @@ static enum nss_status getanswer_r (struct resolv_context *ctx,
+ 				    struct hostent *result, char *buffer,
+ 				    size_t buflen, int *errnop, int *h_errnop,
+ 				    int map, int32_t *ttlp, char **canonp);
++static enum nss_status getanswer_ptr (const querybuf *answer, int anslen,
++				      const char *qname,
++				      struct hostent *result, char *buffer,
++				      size_t buflen, int *errnop,
++				      int *h_errnop, int32_t *ttlp);
+ 
+ static enum nss_status gaih_getanswer (const querybuf *answer1, int anslen1,
+ 				       const querybuf *answer2, int anslen2,
+@@ -561,9 +566,8 @@ _nss_dns_gethostbyaddr2_r (const void *addr, socklen_t len, int af,
+       return errno == ECONNREFUSED ? NSS_STATUS_UNAVAIL : NSS_STATUS_NOTFOUND;
+     }
+ 
+-  status = getanswer_r
+-    (ctx, host_buffer.buf, n, qbuf, T_PTR, result, buffer, buflen,
+-     errnop, h_errnop, 0 /* XXX */, ttlp, NULL);
++  status = getanswer_ptr (host_buffer.buf, n, qbuf, result,
++			  buffer, buflen, errnop, h_errnop, ttlp);
+   if (host_buffer.buf != orig_host_buffer)
+     free (host_buffer.buf);
+   if (status != NSS_STATUS_SUCCESS)
+@@ -659,8 +663,6 @@ getanswer_r (struct resolv_context *ctx,
+   int haveanswer, had_error;
+   char *bp, **ap, **hap;
+   char tbuf[MAXDNAME];
+-  const char *tname;
+-  int (*name_ok) (const char *);
+   u_char packtmp[NS_MAXCDNAME];
+   int have_to_map = 0;
+   uintptr_t pad = -(uintptr_t) buffer % __alignof__ (struct host_data);
+@@ -679,22 +681,8 @@ getanswer_r (struct resolv_context *ctx,
+   if (buflen - sizeof (struct host_data) != linebuflen)
+     linebuflen = INT_MAX;
+ 
+-  tname = qname;
+   result->h_name = NULL;
+   end_of_message = answer->buf + anslen;
+-  switch (qtype)
+-    {
+-    case T_A:
+-    case T_AAAA:
+-      name_ok = __libc_res_hnok;
+-      break;
+-    case T_PTR:
+-      name_ok = __libc_res_dnok;
+-      break;
+-    default:
+-      *errnop = ENOENT;
+-      return NSS_STATUS_UNAVAIL;  /* XXX should be abort(); */
+-    }
+ 
+   /*
+    * find first satisfactory answer
+@@ -729,7 +717,7 @@ getanswer_r (struct resolv_context *ctx,
+       *h_errnop = NO_RECOVERY;
+       return NSS_STATUS_UNAVAIL;
+     }
+-  if (__glibc_unlikely (name_ok (bp) == 0))
++  if (__glibc_unlikely (__libc_res_hnok (bp) == 0))
+     {
+       errno = EBADMSG;
+       *errnop = EBADMSG;
+@@ -783,7 +771,7 @@ getanswer_r (struct resolv_context *ctx,
+ 	  n = -1;
+ 	}
+ 
+-      if (__glibc_unlikely (n < 0 || (*name_ok) (bp) == 0))
++      if (__glibc_unlikely (n < 0 || __libc_res_hnok (bp) == 0))
+ 	{
+ 	  ++had_error;
+ 	  continue;
+@@ -816,7 +804,7 @@ getanswer_r (struct resolv_context *ctx,
+ 	  continue;			/* XXX - had_error++ ? */
+ 	}
+ 
+-      if ((qtype == T_A || qtype == T_AAAA) && type == T_CNAME)
++      if (type == T_CNAME)
+ 	{
+ 	  /* A CNAME could also have a TTL entry.  */
+ 	  if (ttlp != NULL && ttl < *ttlp)
+@@ -826,7 +814,7 @@ getanswer_r (struct resolv_context *ctx,
+ 	    continue;
+ 	  n = __libc_dn_expand (answer->buf, end_of_message, cp,
+ 				tbuf, sizeof tbuf);
+-	  if (__glibc_unlikely (n < 0 || (*name_ok) (tbuf) == 0))
++	  if (__glibc_unlikely (n < 0 || __libc_res_hnok (tbuf) == 0))
+ 	    {
+ 	      ++had_error;
+ 	      continue;
+@@ -857,7 +845,260 @@ getanswer_r (struct resolv_context *ctx,
+ 	  continue;
+ 	}
+ 
+-      if (qtype == T_PTR && type == T_CNAME)
++      if (type == T_A && qtype == T_AAAA && map)
++	have_to_map = 1;
++      else if (__glibc_unlikely (type != qtype))
++	{
++	  cp += n;
++	  continue;			/* XXX - had_error++ ? */
++	}
++
++      switch (type)
++	{
++	case T_A:
++	case T_AAAA:
++	  if (__glibc_unlikely (__strcasecmp (result->h_name, bp) != 0))
++	    {
++	      cp += n;
++	      continue;			/* XXX - had_error++ ? */
++	    }
++
++	  /* Stop parsing at a record whose length is incorrect.  */
++	  if (n != rrtype_to_rdata_length (type))
++	    {
++	      ++had_error;
++	      break;
++	    }
++
++	  /* Skip records of the wrong type.  */
++	  if (n != result->h_length)
++	    {
++	      cp += n;
++	      continue;
++	    }
++	  if (!haveanswer)
++	    {
++	      int nn;
++
++	      /* We compose a single hostent out of the entire chain of
++	         entries, so the TTL of the hostent is essentially the lowest
++		 TTL in the chain.  */
++	      if (ttlp != NULL && ttl < *ttlp)
++		*ttlp = ttl;
++	      if (canonp != NULL)
++		*canonp = bp;
++	      result->h_name = bp;
++	      nn = strlen (bp) + 1;	/* for the \0 */
++	      bp += nn;
++	      linebuflen -= nn;
++	    }
++
++	  /* Provide sufficient alignment for both address
++	     families.  */
++	  enum { align = 4 };
++	  _Static_assert ((align % __alignof__ (struct in_addr)) == 0,
++			  "struct in_addr alignment");
++	  _Static_assert ((align % __alignof__ (struct in6_addr)) == 0,
++			  "struct in6_addr alignment");
++	  {
++	    char *new_bp = PTR_ALIGN_UP (bp, align);
++	    linebuflen -= new_bp - bp;
++	    bp = new_bp;
++	  }
++
++	  if (__glibc_unlikely (n > linebuflen))
++	    goto too_small;
++	  bp = __mempcpy (*hap++ = bp, cp, n);
++	  cp += n;
++	  linebuflen -= n;
++	  break;
++	default:
++	  abort ();
++	}
++      if (had_error == 0)
++	++haveanswer;
++    }
++
++  if (haveanswer > 0)
++    {
++      *ap = NULL;
++      *hap = NULL;
++      /*
++       * Note: we sort even if host can take only one address
++       * in its return structures - should give it the "best"
++       * address in that case, not some random one
++       */
++      if (haveanswer > 1 && qtype == T_A
++	  && __resolv_context_sort_count (ctx) > 0)
++	addrsort (ctx, host_data->h_addr_ptrs, haveanswer);
++
++      if (result->h_name == NULL)
++	{
++	  n = strlen (qname) + 1;	/* For the \0.  */
++	  if (n > linebuflen)
++	    goto too_small;
++	  if (n >= MAXHOSTNAMELEN)
++	    goto no_recovery;
++	  result->h_name = bp;
++	  bp = __mempcpy (bp, qname, n);	/* Cannot overflow.  */
++	  linebuflen -= n;
++	}
++
++      if (have_to_map)
++	if (map_v4v6_hostent (result, &bp, &linebuflen))
++	  goto too_small;
++      *h_errnop = NETDB_SUCCESS;
++      return NSS_STATUS_SUCCESS;
++    }
++ no_recovery:
++  *h_errnop = NO_RECOVERY;
++  *errnop = ENOENT;
++  /* Special case here: if the resolver sent a result but it only
++     contains a CNAME while we are looking for a T_A or T_AAAA record,
++     we fail with NOTFOUND instead of TRYAGAIN.  */
++  return ((qtype == T_A || qtype == T_AAAA) && ap != host_data->aliases
++	   ? NSS_STATUS_NOTFOUND : NSS_STATUS_TRYAGAIN);
++}
++
++static enum nss_status
++getanswer_ptr (const querybuf *answer, int anslen, const char *qname,
++	       struct hostent *result, char *buffer, size_t buflen,
++	       int *errnop, int *h_errnop, int32_t *ttlp)
++{
++  struct host_data
++  {
++    char *aliases[MAX_NR_ALIASES];
++    unsigned char host_addr[16];	/* IPv4 or IPv6 */
++    char *h_addr_ptrs[0];
++  } *host_data;
++  int linebuflen;
++  const HEADER *hp;
++  const u_char *end_of_message, *cp;
++  int n, ancount, qdcount;
++  int haveanswer, had_error;
++  char *bp, **ap, **hap;
++  char tbuf[MAXDNAME];
++  const char *tname;
++  u_char packtmp[NS_MAXCDNAME];
++  uintptr_t pad = -(uintptr_t) buffer % __alignof__ (struct host_data);
++  buffer += pad;
++  buflen = buflen > pad ? buflen - pad : 0;
++  if (__glibc_unlikely (buflen < sizeof (struct host_data)))
++    {
++      /* The buffer is too small.  */
++    too_small:
++      *errnop = ERANGE;
++      *h_errnop = NETDB_INTERNAL;
++      return NSS_STATUS_TRYAGAIN;
++    }
++  host_data = (struct host_data *) buffer;
++  linebuflen = buflen - sizeof (struct host_data);
++  if (buflen - sizeof (struct host_data) != linebuflen)
++    linebuflen = INT_MAX;
++
++  tname = qname;
++  result->h_name = NULL;
++  end_of_message = answer->buf + anslen;
++
++  /*
++   * find first satisfactory answer
++   */
++  hp = &answer->hdr;
++  ancount = ntohs (hp->ancount);
++  qdcount = ntohs (hp->qdcount);
++  cp = answer->buf + HFIXEDSZ;
++  if (__glibc_unlikely (qdcount != 1))
++    {
++      *h_errnop = NO_RECOVERY;
++      return NSS_STATUS_UNAVAIL;
++    }
++  if (sizeof (struct host_data) + (ancount + 1) * sizeof (char *) >= buflen)
++    goto too_small;
++  bp = (char *) &host_data->h_addr_ptrs[ancount + 1];
++  linebuflen -= (ancount + 1) * sizeof (char *);
++
++  n = __ns_name_unpack (answer->buf, end_of_message, cp,
++			packtmp, sizeof packtmp);
++  if (n != -1 && __ns_name_ntop (packtmp, bp, linebuflen) == -1)
++    {
++      if (__glibc_unlikely (errno == EMSGSIZE))
++	goto too_small;
++
++      n = -1;
++    }
++
++  if (__glibc_unlikely (n < 0))
++    {
++      *errnop = errno;
++      *h_errnop = NO_RECOVERY;
++      return NSS_STATUS_UNAVAIL;
++    }
++  if (__glibc_unlikely (__libc_res_dnok (bp) == 0))
++    {
++      errno = EBADMSG;
++      *errnop = EBADMSG;
++      *h_errnop = NO_RECOVERY;
++      return NSS_STATUS_UNAVAIL;
++    }
++  cp += n + QFIXEDSZ;
++
++  ap = host_data->aliases;
++  *ap = NULL;
++  result->h_aliases = host_data->aliases;
++  hap = host_data->h_addr_ptrs;
++  *hap = NULL;
++  result->h_addr_list = host_data->h_addr_ptrs;
++  haveanswer = 0;
++  had_error = 0;
++
++  while (ancount-- > 0 && cp < end_of_message && had_error == 0)
++    {
++      int type, class;
++
++      n = __ns_name_unpack (answer->buf, end_of_message, cp,
++			    packtmp, sizeof packtmp);
++      if (n != -1 && __ns_name_ntop (packtmp, bp, linebuflen) == -1)
++	{
++	  if (__glibc_unlikely (errno == EMSGSIZE))
++	    goto too_small;
++
++	  n = -1;
++	}
++
++      if (__glibc_unlikely (n < 0 || __libc_res_dnok (bp) == 0))
++	{
++	  ++had_error;
++	  continue;
++	}
++      cp += n;				/* name */
++
++      if (__glibc_unlikely (cp + 10 > end_of_message))
++	{
++	  ++had_error;
++	  continue;
++	}
++
++      NS_GET16 (type, cp);
++      NS_GET16 (class, cp);
++      int32_t ttl;
++      NS_GET32 (ttl, cp);
++      NS_GET16 (n, cp);		/* RDATA length.  */
++
++      if (end_of_message - cp < n)
++	{
++	  /* RDATA extends beyond the end of the packet.  */
++	  ++had_error;
++	  continue;
++	}
++
++      if (__glibc_unlikely (class != C_IN))
++	{
++	  /* XXX - debug? syslog? */
++	  cp += n;
++	  continue;			/* XXX - had_error++ ? */
++	}
++
++      if (type == T_CNAME)
+ 	{
+ 	  /* A CNAME could also have a TTL entry.  */
+ 	  if (ttlp != NULL && ttl < *ttlp)
+@@ -886,14 +1127,6 @@ getanswer_r (struct resolv_context *ctx,
+ 	  continue;
+ 	}
+ 
+-      if (type == T_A && qtype == T_AAAA && map)
+-	have_to_map = 1;
+-      else if (__glibc_unlikely (type != qtype))
+-	{
+-	  cp += n;
+-	  continue;			/* XXX - had_error++ ? */
+-	}
+-
+       switch (type)
+ 	{
+ 	case T_PTR:
+@@ -955,8 +1188,6 @@ getanswer_r (struct resolv_context *ctx,
+ 		 TTL in the chain.  */
+ 	      if (ttlp != NULL && ttl < *ttlp)
+ 		*ttlp = ttl;
+-	      if (canonp != NULL)
+-		*canonp = bp;
+ 	      result->h_name = bp;
+ 	      nn = strlen (bp) + 1;	/* for the \0 */
+ 	      bp += nn;
+@@ -983,7 +1214,8 @@ getanswer_r (struct resolv_context *ctx,
+ 	  linebuflen -= n;
+ 	  break;
+ 	default:
+-	  abort ();
++	  cp += n;
++	  continue;			/* XXX - had_error++ ? */
+ 	}
+       if (had_error == 0)
+ 	++haveanswer;
+@@ -993,14 +1225,6 @@ getanswer_r (struct resolv_context *ctx,
+     {
+       *ap = NULL;
+       *hap = NULL;
+-      /*
+-       * Note: we sort even if host can take only one address
+-       * in its return structures - should give it the "best"
+-       * address in that case, not some random one
+-       */
+-      if (haveanswer > 1 && qtype == T_A
+-	  && __resolv_context_sort_count (ctx) > 0)
+-	addrsort (ctx, host_data->h_addr_ptrs, haveanswer);
+ 
+       if (result->h_name == NULL)
+ 	{
+@@ -1014,23 +1238,15 @@ getanswer_r (struct resolv_context *ctx,
+ 	  linebuflen -= n;
+ 	}
+ 
+-      if (have_to_map)
+-	if (map_v4v6_hostent (result, &bp, &linebuflen))
+-	  goto too_small;
+       *h_errnop = NETDB_SUCCESS;
+       return NSS_STATUS_SUCCESS;
+     }
+  no_recovery:
+   *h_errnop = NO_RECOVERY;
+   *errnop = ENOENT;
+-  /* Special case here: if the resolver sent a result but it only
+-     contains a CNAME while we are looking for a T_A or T_AAAA record,
+-     we fail with NOTFOUND instead of TRYAGAIN.  */
+-  return ((qtype == T_A || qtype == T_AAAA) && ap != host_data->aliases
+-	   ? NSS_STATUS_NOTFOUND : NSS_STATUS_TRYAGAIN);
++  return NSS_STATUS_TRYAGAIN;
+ }
+ 
+-
+ static enum nss_status
+ gaih_getanswer_slice (const querybuf *answer, int anslen, const char *qname,
+ 		      struct gaih_addrtuple ***patp,
+-- 
+2.38.1
+
+
+From 77f523c473878ec0051582ef15161c6982879095 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 30 Aug 2022 10:02:49 +0200
+Subject: [PATCH 30/72] nss_dns: Rewrite _nss_dns_gethostbyaddr2_r and
+ getanswer_ptr
+
+The simplification takes advantage of the split from getanswer_r.
+It fixes various aliases issues, and optimizes NSS buffer usage.
+The new DNS packet parsing helpers are used, too.
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit e32547d661a43da63368e488b6cfa9c53b4dcf92)
+---
+ resolv/nss_dns/dns-host.c | 405 ++++++++++----------------------------
+ 1 file changed, 102 insertions(+), 303 deletions(-)
+
+diff --git a/resolv/nss_dns/dns-host.c b/resolv/nss_dns/dns-host.c
+index d384e1f82d..cd26399b7e 100644
+--- a/resolv/nss_dns/dns-host.c
++++ b/resolv/nss_dns/dns-host.c
+@@ -69,6 +69,7 @@
+  * --Copyright--
+  */
+ 
++#include <alloc_buffer.h>
+ #include <assert.h>
+ #include <ctype.h>
+ #include <errno.h>
+@@ -116,10 +117,9 @@ static enum nss_status getanswer_r (struct resolv_context *ctx,
+ 				    struct hostent *result, char *buffer,
+ 				    size_t buflen, int *errnop, int *h_errnop,
+ 				    int map, int32_t *ttlp, char **canonp);
+-static enum nss_status getanswer_ptr (const querybuf *answer, int anslen,
+-				      const char *qname,
+-				      struct hostent *result, char *buffer,
+-				      size_t buflen, int *errnop,
++static enum nss_status getanswer_ptr (unsigned char *packet, size_t packetlen,
++				      struct alloc_buffer *abuf,
++				      char **hnamep, int *errnop,
+ 				      int *h_errnop, int32_t *ttlp);
+ 
+ static enum nss_status gaih_getanswer (const querybuf *answer1, int anslen1,
+@@ -456,36 +456,21 @@ _nss_dns_gethostbyaddr2_r (const void *addr, socklen_t len, int af,
+   static const u_char tunnelled[] = { 0,0, 0,0, 0,0, 0,0, 0,0, 0,0 };
+   static const u_char v6local[] = { 0,0, 0,1 };
+   const u_char *uaddr = (const u_char *)addr;
+-  struct host_data
+-  {
+-    char *aliases[MAX_NR_ALIASES];
+-    unsigned char host_addr[16];	/* IPv4 or IPv6 */
+-    char *h_addr_ptrs[MAX_NR_ADDRS + 1];
+-    char linebuffer[0];
+-  } *host_data = (struct host_data *) buffer;
+-  union
+-  {
+-    querybuf *buf;
+-    u_char *ptr;
+-  } host_buffer;
+-  querybuf *orig_host_buffer;
+   char qbuf[MAXDNAME+1], *qp = NULL;
+   size_t size;
+   int n, status;
+   int olderr = errno;
+ 
+- uintptr_t pad = -(uintptr_t) buffer % __alignof__ (struct host_data);
+- buffer += pad;
+- buflen = buflen > pad ? buflen - pad : 0;
+-
+- if (__glibc_unlikely (buflen < sizeof (struct host_data)))
+-   {
+-     *errnop = ERANGE;
+-     *h_errnop = NETDB_INTERNAL;
+-     return NSS_STATUS_TRYAGAIN;
+-   }
+-
+- host_data = (struct host_data *) buffer;
++  /* Prepare the allocation buffer.  Store the pointer array first, to
++     benefit from buffer alignment.  */
++  struct alloc_buffer abuf = alloc_buffer_create (buffer, buflen);
++  char **address_array = alloc_buffer_alloc_array (&abuf, char *, 2);
++  if (address_array == NULL)
++    {
++      *errnop = ERANGE;
++      *h_errnop = NETDB_INTERNAL;
++      return NSS_STATUS_TRYAGAIN;
++    }
+ 
+   struct resolv_context *ctx = __resolv_context_get ();
+   if (ctx == NULL)
+@@ -529,8 +514,6 @@ _nss_dns_gethostbyaddr2_r (const void *addr, socklen_t len, int af,
+       return NSS_STATUS_UNAVAIL;
+     }
+ 
+-  host_buffer.buf = orig_host_buffer = (querybuf *) alloca (1024);
+-
+   switch (af)
+     {
+     case AF_INET:
+@@ -554,35 +537,52 @@ _nss_dns_gethostbyaddr2_r (const void *addr, socklen_t len, int af,
+       break;
+     }
+ 
+-  n = __res_context_query (ctx, qbuf, C_IN, T_PTR, host_buffer.buf->buf,
+-			   1024, &host_buffer.ptr, NULL, NULL, NULL, NULL);
++  unsigned char dns_packet_buffer[1024];
++  unsigned char *alt_dns_packet_buffer = dns_packet_buffer;
++  n = __res_context_query (ctx, qbuf, C_IN, T_PTR,
++			   dns_packet_buffer, sizeof (dns_packet_buffer),
++			   &alt_dns_packet_buffer,
++			   NULL, NULL, NULL, NULL);
+   if (n < 0)
+     {
+       *h_errnop = h_errno;
+       __set_errno (olderr);
+-      if (host_buffer.buf != orig_host_buffer)
+-	free (host_buffer.buf);
++      if (alt_dns_packet_buffer != dns_packet_buffer)
++	free (alt_dns_packet_buffer);
+       __resolv_context_put (ctx);
+       return errno == ECONNREFUSED ? NSS_STATUS_UNAVAIL : NSS_STATUS_NOTFOUND;
+     }
+ 
+-  status = getanswer_ptr (host_buffer.buf, n, qbuf, result,
+-			  buffer, buflen, errnop, h_errnop, ttlp);
+-  if (host_buffer.buf != orig_host_buffer)
+-    free (host_buffer.buf);
++  status = getanswer_ptr (alt_dns_packet_buffer, n,
++			  &abuf, &result->h_name, errnop, h_errnop, ttlp);
++
++  if (alt_dns_packet_buffer != dns_packet_buffer)
++    free (alt_dns_packet_buffer);
++  __resolv_context_put (ctx);
++
+   if (status != NSS_STATUS_SUCCESS)
+-    {
+-      __resolv_context_put (ctx);
+-      return status;
+-    }
++    return status;
+ 
++  /* result->h_name has already been set by getanswer_ptr.  */
+   result->h_addrtype = af;
+   result->h_length = len;
+-  memcpy (host_data->host_addr, addr, len);
+-  host_data->h_addr_ptrs[0] = (char *) host_data->host_addr;
+-  host_data->h_addr_ptrs[1] = NULL;
++  /* Increase the alignment to 4, in case there are applications out
++     there that expect at least this level of address alignment.  */
++  address_array[0] = (char *) alloc_buffer_next (&abuf, uint32_t);
++  alloc_buffer_copy_bytes (&abuf, uaddr, len);
++  address_array[1] = NULL;
++
++  /* This check also covers allocation failure in getanswer_ptr.  */
++  if (alloc_buffer_has_failed (&abuf))
++    {
++      *errnop = ERANGE;
++      *h_errnop = NETDB_INTERNAL;
++      return NSS_STATUS_TRYAGAIN;
++    }
++  result->h_addr_list = address_array;
++  result->h_aliases = &address_array[1]; /* Points to NULL.  */
++
+   *h_errnop = NETDB_SUCCESS;
+-  __resolv_context_put (ctx);
+   return NSS_STATUS_SUCCESS;
+ }
+ libc_hidden_def (_nss_dns_gethostbyaddr2_r)
+@@ -961,287 +961,86 @@ getanswer_r (struct resolv_context *ctx,
+ }
+ 
+ static enum nss_status
+-getanswer_ptr (const querybuf *answer, int anslen, const char *qname,
+-	       struct hostent *result, char *buffer, size_t buflen,
++getanswer_ptr (unsigned char *packet, size_t packetlen,
++	       struct alloc_buffer *abuf, char **hnamep,
+ 	       int *errnop, int *h_errnop, int32_t *ttlp)
+ {
+-  struct host_data
+-  {
+-    char *aliases[MAX_NR_ALIASES];
+-    unsigned char host_addr[16];	/* IPv4 or IPv6 */
+-    char *h_addr_ptrs[0];
+-  } *host_data;
+-  int linebuflen;
+-  const HEADER *hp;
+-  const u_char *end_of_message, *cp;
+-  int n, ancount, qdcount;
+-  int haveanswer, had_error;
+-  char *bp, **ap, **hap;
+-  char tbuf[MAXDNAME];
+-  const char *tname;
+-  u_char packtmp[NS_MAXCDNAME];
+-  uintptr_t pad = -(uintptr_t) buffer % __alignof__ (struct host_data);
+-  buffer += pad;
+-  buflen = buflen > pad ? buflen - pad : 0;
+-  if (__glibc_unlikely (buflen < sizeof (struct host_data)))
+-    {
+-      /* The buffer is too small.  */
+-    too_small:
+-      *errnop = ERANGE;
+-      *h_errnop = NETDB_INTERNAL;
+-      return NSS_STATUS_TRYAGAIN;
+-    }
+-  host_data = (struct host_data *) buffer;
+-  linebuflen = buflen - sizeof (struct host_data);
+-  if (buflen - sizeof (struct host_data) != linebuflen)
+-    linebuflen = INT_MAX;
+-
+-  tname = qname;
+-  result->h_name = NULL;
+-  end_of_message = answer->buf + anslen;
+-
+-  /*
+-   * find first satisfactory answer
+-   */
+-  hp = &answer->hdr;
+-  ancount = ntohs (hp->ancount);
+-  qdcount = ntohs (hp->qdcount);
+-  cp = answer->buf + HFIXEDSZ;
+-  if (__glibc_unlikely (qdcount != 1))
+-    {
+-      *h_errnop = NO_RECOVERY;
+-      return NSS_STATUS_UNAVAIL;
+-    }
+-  if (sizeof (struct host_data) + (ancount + 1) * sizeof (char *) >= buflen)
+-    goto too_small;
+-  bp = (char *) &host_data->h_addr_ptrs[ancount + 1];
+-  linebuflen -= (ancount + 1) * sizeof (char *);
+-
+-  n = __ns_name_unpack (answer->buf, end_of_message, cp,
+-			packtmp, sizeof packtmp);
+-  if (n != -1 && __ns_name_ntop (packtmp, bp, linebuflen) == -1)
++  struct ns_rr_cursor c;
++  if (!__ns_rr_cursor_init (&c, packet, packetlen))
+     {
+-      if (__glibc_unlikely (errno == EMSGSIZE))
+-	goto too_small;
+-
+-      n = -1;
+-    }
+-
+-  if (__glibc_unlikely (n < 0))
+-    {
+-      *errnop = errno;
+-      *h_errnop = NO_RECOVERY;
+-      return NSS_STATUS_UNAVAIL;
+-    }
+-  if (__glibc_unlikely (__libc_res_dnok (bp) == 0))
+-    {
+-      errno = EBADMSG;
+-      *errnop = EBADMSG;
++      /* This should not happen because __res_context_query already
++	 perfroms response validation.  */
+       *h_errnop = NO_RECOVERY;
+       return NSS_STATUS_UNAVAIL;
+     }
+-  cp += n + QFIXEDSZ;
++  int ancount = ns_rr_cursor_ancount (&c);
++  const unsigned char *expected_name = ns_rr_cursor_qname (&c);
++  /* expected_name may be updated to point into this buffer.  */
++  unsigned char name_buffer[NS_MAXCDNAME];
+ 
+-  ap = host_data->aliases;
+-  *ap = NULL;
+-  result->h_aliases = host_data->aliases;
+-  hap = host_data->h_addr_ptrs;
+-  *hap = NULL;
+-  result->h_addr_list = host_data->h_addr_ptrs;
+-  haveanswer = 0;
+-  had_error = 0;
+-
+-  while (ancount-- > 0 && cp < end_of_message && had_error == 0)
++  while (ancount > 0)
+     {
+-      int type, class;
+-
+-      n = __ns_name_unpack (answer->buf, end_of_message, cp,
+-			    packtmp, sizeof packtmp);
+-      if (n != -1 && __ns_name_ntop (packtmp, bp, linebuflen) == -1)
++      struct ns_rr_wire rr;
++      if (!__ns_rr_cursor_next (&c, &rr))
+ 	{
+-	  if (__glibc_unlikely (errno == EMSGSIZE))
+-	    goto too_small;
+-
+-	  n = -1;
+-	}
+-
+-      if (__glibc_unlikely (n < 0 || __libc_res_dnok (bp) == 0))
+-	{
+-	  ++had_error;
+-	  continue;
+-	}
+-      cp += n;				/* name */
+-
+-      if (__glibc_unlikely (cp + 10 > end_of_message))
+-	{
+-	  ++had_error;
+-	  continue;
++	  *h_errnop = NO_RECOVERY;
++	  return NSS_STATUS_UNAVAIL;
+ 	}
+ 
+-      NS_GET16 (type, cp);
+-      NS_GET16 (class, cp);
+-      int32_t ttl;
+-      NS_GET32 (ttl, cp);
+-      NS_GET16 (n, cp);		/* RDATA length.  */
++      /* Skip over records with the wrong class.  */
++      if (rr.rclass != C_IN)
++	continue;
+ 
+-      if (end_of_message - cp < n)
+-	{
+-	  /* RDATA extends beyond the end of the packet.  */
+-	  ++had_error;
+-	  continue;
+-	}
+-
+-      if (__glibc_unlikely (class != C_IN))
+-	{
+-	  /* XXX - debug? syslog? */
+-	  cp += n;
+-	  continue;			/* XXX - had_error++ ? */
+-	}
++      /* Update TTL for known record types.  */
++      if ((rr.rtype == T_CNAME || rr.rtype == T_PTR)
++	  && ttlp != NULL && *ttlp > rr.ttl)
++	*ttlp = rr.ttl;
+ 
+-      if (type == T_CNAME)
++      if (rr.rtype == T_CNAME)
+ 	{
+-	  /* A CNAME could also have a TTL entry.  */
+-	  if (ttlp != NULL && ttl < *ttlp)
+-	      *ttlp = ttl;
+-
+-	  n = __libc_dn_expand (answer->buf, end_of_message, cp,
+-				tbuf, sizeof tbuf);
+-	  if (__glibc_unlikely (n < 0 || __libc_res_dnok (tbuf) == 0))
+-	    {
+-	      ++had_error;
+-	      continue;
+-	    }
+-	  cp += n;
+-	  /* Get canonical name.  */
+-	  n = strlen (tbuf) + 1;   /* For the \0.  */
+-	  if (__glibc_unlikely (n > linebuflen))
+-	    goto too_small;
+-	  if (__glibc_unlikely (n >= MAXHOSTNAMELEN))
++	  /* NB: No check for owner name match, based on historic
++	     precedent.  Record the CNAME target as the new expected
++	     name.  */
++	  int n = __ns_name_unpack (c.begin, c.end, rr.rdata,
++				    name_buffer, sizeof (name_buffer));
++	  if (n < 0)
+ 	    {
+-	      ++had_error;
+-	      continue;
++	      *h_errnop = NO_RECOVERY;
++	      return NSS_STATUS_UNAVAIL;
+ 	    }
+-	  tname = bp;
+-	  bp = __mempcpy (bp, tbuf, n);	/* Cannot overflow.  */
+-	  linebuflen -= n;
+-	  continue;
++	  expected_name = name_buffer;
+ 	}
+-
+-      switch (type)
++      else if (rr.rtype == T_PTR
++	       && __ns_samebinaryname (rr.rname, expected_name))
+ 	{
+-	case T_PTR:
+-	  if (__glibc_unlikely (__strcasecmp (tname, bp) != 0))
+-	    {
+-	      cp += n;
+-	      continue;			/* XXX - had_error++ ? */
+-	    }
+-
+-	  n = __ns_name_unpack (answer->buf, end_of_message, cp,
+-				packtmp, sizeof packtmp);
+-	  if (n != -1 && __ns_name_ntop (packtmp, bp, linebuflen) == -1)
+-	    {
+-	      if (__glibc_unlikely (errno == EMSGSIZE))
+-		goto too_small;
+-
+-	      n = -1;
+-	    }
+-
+-	  if (__glibc_unlikely (n < 0 || __libc_res_hnok (bp) == 0))
++	  /* Decompress the target of the PTR record.  This is the
++	     host name we are looking for.  We can only use it if it
++	     is syntactically valid.  Historically, only one host name
++	     is returned here.  If the recursive resolver performs DNS
++	     record rotation, the returned host name is essentially
++	     random, which is why multiple PTR records are rarely
++	     used.  Use MAXHOSTNAMELEN instead of NS_MAXCDNAME for
++	     additional length checking.  */
++	  char hname[MAXHOSTNAMELEN + 1];
++	  if (__ns_name_unpack (c.begin, c.end, rr.rdata,
++				name_buffer, sizeof (name_buffer)) < 0
++	      || !__res_binary_hnok (expected_name)
++	      || __ns_name_ntop (name_buffer, hname, sizeof (hname)) < 0)
+ 	    {
+-	      ++had_error;
+-	      break;
++	      *h_errnop = NO_RECOVERY;
++	      return NSS_STATUS_UNAVAIL;
+ 	    }
+-	  if (ttlp != NULL && ttl < *ttlp)
+-	      *ttlp = ttl;
+-	  /* bind would put multiple PTR records as aliases, but we don't do
+-	     that.  */
+-	  result->h_name = bp;
+-	  *h_errnop = NETDB_SUCCESS;
++	  /* Successful allocation is checked by the caller.  */
++	  *hnamep = alloc_buffer_copy_string (abuf, hname);
+ 	  return NSS_STATUS_SUCCESS;
+-	case T_A:
+-	case T_AAAA:
+-	  if (__glibc_unlikely (__strcasecmp (result->h_name, bp) != 0))
+-	    {
+-	      cp += n;
+-	      continue;			/* XXX - had_error++ ? */
+-	    }
+-
+-	  /* Stop parsing at a record whose length is incorrect.  */
+-	  if (n != rrtype_to_rdata_length (type))
+-	    {
+-	      ++had_error;
+-	      break;
+-	    }
+-
+-	  /* Skip records of the wrong type.  */
+-	  if (n != result->h_length)
+-	    {
+-	      cp += n;
+-	      continue;
+-	    }
+-	  if (!haveanswer)
+-	    {
+-	      int nn;
+-
+-	      /* We compose a single hostent out of the entire chain of
+-	         entries, so the TTL of the hostent is essentially the lowest
+-		 TTL in the chain.  */
+-	      if (ttlp != NULL && ttl < *ttlp)
+-		*ttlp = ttl;
+-	      result->h_name = bp;
+-	      nn = strlen (bp) + 1;	/* for the \0 */
+-	      bp += nn;
+-	      linebuflen -= nn;
+-	    }
+-
+-	  /* Provide sufficient alignment for both address
+-	     families.  */
+-	  enum { align = 4 };
+-	  _Static_assert ((align % __alignof__ (struct in_addr)) == 0,
+-			  "struct in_addr alignment");
+-	  _Static_assert ((align % __alignof__ (struct in6_addr)) == 0,
+-			  "struct in6_addr alignment");
+-	  {
+-	    char *new_bp = PTR_ALIGN_UP (bp, align);
+-	    linebuflen -= new_bp - bp;
+-	    bp = new_bp;
+-	  }
+-
+-	  if (__glibc_unlikely (n > linebuflen))
+-	    goto too_small;
+-	  bp = __mempcpy (*hap++ = bp, cp, n);
+-	  cp += n;
+-	  linebuflen -= n;
+-	  break;
+-	default:
+-	  cp += n;
+-	  continue;			/* XXX - had_error++ ? */
+ 	}
+-      if (had_error == 0)
+-	++haveanswer;
+     }
+ 
+-  if (haveanswer > 0)
+-    {
+-      *ap = NULL;
+-      *hap = NULL;
+-
+-      if (result->h_name == NULL)
+-	{
+-	  n = strlen (qname) + 1;	/* For the \0.  */
+-	  if (n > linebuflen)
+-	    goto too_small;
+-	  if (n >= MAXHOSTNAMELEN)
+-	    goto no_recovery;
+-	  result->h_name = bp;
+-	  bp = __mempcpy (bp, qname, n);	/* Cannot overflow.  */
+-	  linebuflen -= n;
+-	}
++  /* No PTR record found.  */
++  if (ttlp != NULL)
++    /* No caching of negative responses.  */
++    *ttlp = 0;
+ 
+-      *h_errnop = NETDB_SUCCESS;
+-      return NSS_STATUS_SUCCESS;
+-    }
+- no_recovery:
+   *h_errnop = NO_RECOVERY;
+   *errnop = ENOENT;
+   return NSS_STATUS_TRYAGAIN;
+-- 
+2.38.1
+
+
+From 5165080fec63a1f03aa1985b77bca300465bf570 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 30 Aug 2022 10:02:49 +0200
+Subject: [PATCH 31/72] nss_dns: Remove remnants of IPv6 address mapping
+
+res_use_inet6 always returns false since commit 3f8b44be0a658266adff5
+("resolv: Remove support for RES_USE_INET6 and the inet6 option").
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit a7fc30b522a0cd7c8c5e7e285b9531b704e02f04)
+---
+ resolv/README             |  3 --
+ resolv/mapv4v6addr.h      | 69 --------------------------------
+ resolv/mapv4v6hostent.h   | 84 ---------------------------------------
+ resolv/nss_dns/dns-host.c | 54 +++++--------------------
+ 4 files changed, 9 insertions(+), 201 deletions(-)
+ delete mode 100644 resolv/mapv4v6addr.h
+ delete mode 100644 resolv/mapv4v6hostent.h
+
+diff --git a/resolv/README b/resolv/README
+index 514e9bb617..2146bc3b27 100644
+--- a/resolv/README
++++ b/resolv/README
+@@ -146,6 +146,3 @@ res_libc.c is home-brewn, although parts of it are taken from res_data.c.
+ 
+ res_hconf.c and res_hconf.h were contributed by David Mosberger, and
+ do not come from BIND.
+-
+-The files gethnamaddr.c, mapv4v6addr.h and mapv4v6hostent.h are
+-leftovers from BIND 4.9.7.
+diff --git a/resolv/mapv4v6addr.h b/resolv/mapv4v6addr.h
+deleted file mode 100644
+index 7f85f7d5e3..0000000000
+--- a/resolv/mapv4v6addr.h
++++ /dev/null
+@@ -1,69 +0,0 @@
+-/*
+- * ++Copyright++ 1985, 1988, 1993
+- * -
+- * Copyright (c) 1985, 1988, 1993
+- *    The Regents of the University of California.  All rights reserved.
+- *
+- * Redistribution and use in source and binary forms, with or without
+- * modification, are permitted provided that the following conditions
+- * are met:
+- * 1. Redistributions of source code must retain the above copyright
+- *    notice, this list of conditions and the following disclaimer.
+- * 2. Redistributions in binary form must reproduce the above copyright
+- *    notice, this list of conditions and the following disclaimer in the
+- *    documentation and/or other materials provided with the distribution.
+- * 4. Neither the name of the University nor the names of its contributors
+- *    may be used to endorse or promote products derived from this software
+- *    without specific prior written permission.
+- *
+- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+- * SUCH DAMAGE.
+- * -
+- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
+- *
+- * Permission to use, copy, modify, and distribute this software for any
+- * purpose with or without fee is hereby granted, provided that the above
+- * copyright notice and this permission notice appear in all copies, and that
+- * the name of Digital Equipment Corporation not be used in advertising or
+- * publicity pertaining to distribution of the document or software without
+- * specific, written prior permission.
+- *
+- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
+- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
+- * OF MERCHANTABILITY AND FITNESS.   IN NO EVENT SHALL DIGITAL EQUIPMENT
+- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+- * SOFTWARE.
+- * -
+- * --Copyright--
+- */
+-
+-#include <string.h>
+-#include <arpa/nameser.h>
+-
+-static void
+-map_v4v6_address (const char *src, char *dst)
+-{
+-  u_char *p = (u_char *) dst;
+-  int i;
+-
+-  /* Move the IPv4 part to the right position.  */
+-  memcpy (dst + 12, src, INADDRSZ);
+-
+-  /* Mark this ipv6 addr as a mapped ipv4. */
+-  for (i = 0; i < 10; i++)
+-    *p++ = 0x00;
+-  *p++ = 0xff;
+-  *p = 0xff;
+-}
+diff --git a/resolv/mapv4v6hostent.h b/resolv/mapv4v6hostent.h
+deleted file mode 100644
+index c11038adf3..0000000000
+--- a/resolv/mapv4v6hostent.h
++++ /dev/null
+@@ -1,84 +0,0 @@
+-/*
+- * ++Copyright++ 1985, 1988, 1993
+- * -
+- * Copyright (c) 1985, 1988, 1993
+- *    The Regents of the University of California.  All rights reserved.
+- *
+- * Redistribution and use in source and binary forms, with or without
+- * modification, are permitted provided that the following conditions
+- * are met:
+- * 1. Redistributions of source code must retain the above copyright
+- *    notice, this list of conditions and the following disclaimer.
+- * 2. Redistributions in binary form must reproduce the above copyright
+- *    notice, this list of conditions and the following disclaimer in the
+- *    documentation and/or other materials provided with the distribution.
+- * 4. Neither the name of the University nor the names of its contributors
+- *    may be used to endorse or promote products derived from this software
+- *    without specific prior written permission.
+- *
+- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+- * SUCH DAMAGE.
+- * -
+- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
+- *
+- * Permission to use, copy, modify, and distribute this software for any
+- * purpose with or without fee is hereby granted, provided that the above
+- * copyright notice and this permission notice appear in all copies, and that
+- * the name of Digital Equipment Corporation not be used in advertising or
+- * publicity pertaining to distribution of the document or software without
+- * specific, written prior permission.
+- *
+- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
+- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
+- * OF MERCHANTABILITY AND FITNESS.   IN NO EVENT SHALL DIGITAL EQUIPMENT
+- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+- * SOFTWARE.
+- * -
+- * --Copyright--
+- */
+-
+-#include <arpa/nameser.h>
+-#include <sys/socket.h>
+-
+-typedef union {
+-    int32_t al;
+-    char ac;
+-} align;
+-
+-static int
+-map_v4v6_hostent (struct hostent *hp, char **bpp, int *lenp)
+-{
+-  char **ap;
+-
+-  if (hp->h_addrtype != AF_INET || hp->h_length != INADDRSZ)
+-    return 0;
+-  hp->h_addrtype = AF_INET6;
+-  hp->h_length = IN6ADDRSZ;
+-  for (ap = hp->h_addr_list; *ap; ap++)
+-    {
+-      int i = sizeof (align) - ((u_long) *bpp % sizeof (align));
+-
+-      if (*lenp < (i + IN6ADDRSZ))
+-	/* Out of memory.  */
+-	return 1;
+-      *bpp += i;
+-      *lenp -= i;
+-      map_v4v6_address (*ap, *bpp);
+-      *ap = *bpp;
+-      *bpp += IN6ADDRSZ;
+-      *lenp -= IN6ADDRSZ;
+-    }
+-  return 0;
+-}
+diff --git a/resolv/nss_dns/dns-host.c b/resolv/nss_dns/dns-host.c
+index cd26399b7e..8e38583e15 100644
+--- a/resolv/nss_dns/dns-host.c
++++ b/resolv/nss_dns/dns-host.c
+@@ -87,10 +87,6 @@
+ #include <resolv/resolv-internal.h>
+ #include <resolv/resolv_context.h>
+ 
+-/* Get implementations of some internal functions.  */
+-#include <resolv/mapv4v6addr.h>
+-#include <resolv/mapv4v6hostent.h>
+-
+ #define RESOLVSORT
+ 
+ #if PACKETSZ > 65536
+@@ -116,7 +112,7 @@ static enum nss_status getanswer_r (struct resolv_context *ctx,
+ 				    const char *qname, int qtype,
+ 				    struct hostent *result, char *buffer,
+ 				    size_t buflen, int *errnop, int *h_errnop,
+-				    int map, int32_t *ttlp, char **canonp);
++				    int32_t *ttlp, char **canonp);
+ static enum nss_status getanswer_ptr (unsigned char *packet, size_t packetlen,
+ 				      struct alloc_buffer *abuf,
+ 				      char **hnamep, int *errnop,
+@@ -197,7 +193,6 @@ gethostbyname3_context (struct resolv_context *ctx,
+   char tmp[NS_MAXDNAME];
+   int size, type, n;
+   const char *cp;
+-  int map = 0;
+   int olderr = errno;
+   enum nss_status status;
+ 
+@@ -258,32 +253,12 @@ gethostbyname3_context (struct resolv_context *ctx,
+ 	*errnop = EAGAIN;
+       else
+ 	__set_errno (olderr);
+-
+-      /* If we are looking for an IPv6 address and mapping is enabled
+-	 by having the RES_USE_INET6 bit in _res.options set, we try
+-	 another lookup.  */
+-      if (af == AF_INET6 && res_use_inet6 ())
+-	n = __res_context_search (ctx, name, C_IN, T_A, host_buffer.buf->buf,
+-				  host_buffer.buf != orig_host_buffer
+-				  ? MAXPACKET : 1024, &host_buffer.ptr,
+-				  NULL, NULL, NULL, NULL);
+-
+-      if (n < 0)
+-	{
+-	  if (host_buffer.buf != orig_host_buffer)
+-	    free (host_buffer.buf);
+-	  return status;
+-	}
+-
+-      map = 1;
+-
+-      result->h_addrtype = AF_INET;
+-      result->h_length = INADDRSZ;
+     }
++  else
++    status = getanswer_r
++      (ctx, host_buffer.buf, n, name, type, result, buffer, buflen,
++       errnop, h_errnop, ttlp, canonp);
+ 
+-  status = getanswer_r
+-    (ctx, host_buffer.buf, n, name, type, result, buffer, buflen,
+-     errnop, h_errnop, map, ttlp, canonp);
+   if (host_buffer.buf != orig_host_buffer)
+     free (host_buffer.buf);
+   return status;
+@@ -329,13 +304,8 @@ _nss_dns_gethostbyname_r (const char *name, struct hostent *result,
+       *h_errnop = NETDB_INTERNAL;
+       return NSS_STATUS_UNAVAIL;
+     }
+-  status = NSS_STATUS_NOTFOUND;
+-  if (res_use_inet6 ())
+-    status = gethostbyname3_context (ctx, name, AF_INET6, result, buffer,
+-				     buflen, errnop, h_errnop, NULL, NULL);
+-  if (status == NSS_STATUS_NOTFOUND)
+-    status = gethostbyname3_context (ctx, name, AF_INET, result, buffer,
+-				     buflen, errnop, h_errnop, NULL, NULL);
++  status = gethostbyname3_context (ctx, name, AF_INET, result, buffer,
++				   buflen, errnop, h_errnop, NULL, NULL);
+   __resolv_context_put (ctx);
+   return status;
+ }
+@@ -648,7 +618,7 @@ static enum nss_status
+ getanswer_r (struct resolv_context *ctx,
+ 	     const querybuf *answer, int anslen, const char *qname, int qtype,
+ 	     struct hostent *result, char *buffer, size_t buflen,
+-	     int *errnop, int *h_errnop, int map, int32_t *ttlp, char **canonp)
++	     int *errnop, int *h_errnop, int32_t *ttlp, char **canonp)
+ {
+   struct host_data
+   {
+@@ -664,7 +634,6 @@ getanswer_r (struct resolv_context *ctx,
+   char *bp, **ap, **hap;
+   char tbuf[MAXDNAME];
+   u_char packtmp[NS_MAXCDNAME];
+-  int have_to_map = 0;
+   uintptr_t pad = -(uintptr_t) buffer % __alignof__ (struct host_data);
+   buffer += pad;
+   buflen = buflen > pad ? buflen - pad : 0;
+@@ -845,9 +814,7 @@ getanswer_r (struct resolv_context *ctx,
+ 	  continue;
+ 	}
+ 
+-      if (type == T_A && qtype == T_AAAA && map)
+-	have_to_map = 1;
+-      else if (__glibc_unlikely (type != qtype))
++      if (__glibc_unlikely (type != qtype))
+ 	{
+ 	  cp += n;
+ 	  continue;			/* XXX - had_error++ ? */
+@@ -944,9 +911,6 @@ getanswer_r (struct resolv_context *ctx,
+ 	  linebuflen -= n;
+ 	}
+ 
+-      if (have_to_map)
+-	if (map_v4v6_hostent (result, &bp, &linebuflen))
+-	  goto too_small;
+       *h_errnop = NETDB_SUCCESS;
+       return NSS_STATUS_SUCCESS;
+     }
+-- 
+2.38.1
+
+
+From 78c8ef21fa54e994451d5b42ead6080d99a88a49 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 30 Aug 2022 10:02:49 +0200
+Subject: [PATCH 32/72] nss_dns: Rewrite getanswer_r to match getanswer_ptr
+ (bug 12154, bug 29305)
+
+Allocate the pointer arrays only at the end, when their sizes
+are known.  This addresses bug 29305.
+
+Skip over invalid names instead of failing lookups.  This partially
+fixes bug 12154 (for gethostbyname, fixing getaddrinfo requires
+different changes).
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit d101d836e7e4bd1d4e4972b0e0bd0a55c9b650fa)
+---
+ resolv/nss_dns/dns-host.c | 478 ++++++++++++++------------------------
+ 1 file changed, 180 insertions(+), 298 deletions(-)
+
+diff --git a/resolv/nss_dns/dns-host.c b/resolv/nss_dns/dns-host.c
+index 8e38583e15..b887e77e9c 100644
+--- a/resolv/nss_dns/dns-host.c
++++ b/resolv/nss_dns/dns-host.c
+@@ -107,12 +107,19 @@ typedef union querybuf
+   u_char buf[MAXPACKET];
+ } querybuf;
+ 
+-static enum nss_status getanswer_r (struct resolv_context *ctx,
+-				    const querybuf *answer, int anslen,
+-				    const char *qname, int qtype,
+-				    struct hostent *result, char *buffer,
+-				    size_t buflen, int *errnop, int *h_errnop,
+-				    int32_t *ttlp, char **canonp);
++/* For historic reasons, pointers to IP addresses are char *, so use a
++   single list type for addresses and host names.  */
++#define DYNARRAY_STRUCT ptrlist
++#define DYNARRAY_ELEMENT char *
++#define DYNARRAY_PREFIX ptrlist_
++#include <malloc/dynarray-skeleton.c>
++
++static enum nss_status getanswer_r (unsigned char *packet, size_t packetlen,
++				    uint16_t qtype, struct alloc_buffer *abuf,
++				    struct ptrlist *addresses,
++				    struct ptrlist *aliases,
++				    int *errnop, int *h_errnop, int32_t *ttlp);
++static void addrsort (struct resolv_context *ctx, char **ap, int num);
+ static enum nss_status getanswer_ptr (unsigned char *packet, size_t packetlen,
+ 				      struct alloc_buffer *abuf,
+ 				      char **hnamep, int *errnop,
+@@ -184,12 +191,6 @@ gethostbyname3_context (struct resolv_context *ctx,
+ 			char *buffer, size_t buflen, int *errnop,
+ 			int *h_errnop, int32_t *ttlp, char **canonp)
+ {
+-  union
+-  {
+-    querybuf *buf;
+-    u_char *ptr;
+-  } host_buffer;
+-  querybuf *orig_host_buffer;
+   char tmp[NS_MAXDNAME];
+   int size, type, n;
+   const char *cp;
+@@ -223,10 +224,12 @@ gethostbyname3_context (struct resolv_context *ctx,
+       && (cp = __res_context_hostalias (ctx, name, tmp, sizeof (tmp))) != NULL)
+     name = cp;
+ 
+-  host_buffer.buf = orig_host_buffer = (querybuf *) alloca (1024);
++  unsigned char dns_packet_buffer[1024];
++  unsigned char *alt_dns_packet_buffer = dns_packet_buffer;
+ 
+-  n = __res_context_search (ctx, name, C_IN, type, host_buffer.buf->buf,
+-			    1024, &host_buffer.ptr, NULL, NULL, NULL, NULL);
++  n = __res_context_search (ctx, name, C_IN, type,
++			    dns_packet_buffer, sizeof (dns_packet_buffer),
++			    &alt_dns_packet_buffer, NULL, NULL, NULL, NULL);
+   if (n < 0)
+     {
+       switch (errno)
+@@ -255,12 +258,77 @@ gethostbyname3_context (struct resolv_context *ctx,
+ 	__set_errno (olderr);
+     }
+   else
+-    status = getanswer_r
+-      (ctx, host_buffer.buf, n, name, type, result, buffer, buflen,
+-       errnop, h_errnop, ttlp, canonp);
++    {
++      struct alloc_buffer abuf = alloc_buffer_create (buffer, buflen);
+ 
+-  if (host_buffer.buf != orig_host_buffer)
+-    free (host_buffer.buf);
++      struct ptrlist addresses;
++      ptrlist_init (&addresses);
++      struct ptrlist aliases;
++      ptrlist_init (&aliases);
++
++      status = getanswer_r (alt_dns_packet_buffer, n, type,
++			    &abuf, &addresses, &aliases,
++			    errnop, h_errnop, ttlp);
++      if (status == NSS_STATUS_SUCCESS)
++	{
++	  if (ptrlist_has_failed (&addresses)
++	      || ptrlist_has_failed (&aliases))
++	    {
++	      /* malloc failure.  Do not retry using the ERANGE protocol.  */
++	      *errnop = ENOMEM;
++	      *h_errnop = NETDB_INTERNAL;
++	      status = NSS_STATUS_UNAVAIL;
++	    }
++
++	  /* Reserve the address and alias arrays in the result
++	     buffer.  Both are NULL-terminated, but the first element
++	     of the alias array is stored in h_name, so no extra space
++	     for the NULL terminator is needed there.  */
++	  result->h_addr_list
++	    = alloc_buffer_alloc_array (&abuf, char *,
++					ptrlist_size (&addresses) + 1);
++	  result->h_aliases
++	    = alloc_buffer_alloc_array (&abuf, char *,
++					ptrlist_size (&aliases));
++	  if (alloc_buffer_has_failed (&abuf))
++	    {
++	      /* Retry using the ERANGE protocol.  */
++	      *errnop = ERANGE;
++	      *h_errnop = NETDB_INTERNAL;
++	      status = NSS_STATUS_TRYAGAIN;
++	    }
++	  else
++	    {
++	      /* Copy the address list and NULL-terminate it.  */
++	      memcpy (result->h_addr_list, ptrlist_begin (&addresses),
++		      ptrlist_size (&addresses) * sizeof (char *));
++	      result->h_addr_list[ptrlist_size (&addresses)] = NULL;
++
++	      /* Sort the address list if requested.  */
++	      if (type == T_A && __resolv_context_sort_count (ctx) > 0)
++		addrsort (ctx, result->h_addr_list, ptrlist_size (&addresses));
++
++	      /* Copy the aliases,  excluding the last one. */
++	      memcpy (result->h_aliases, ptrlist_begin (&aliases),
++		      (ptrlist_size (&aliases) - 1) * sizeof (char *));
++	      result->h_aliases[ptrlist_size (&aliases) - 1] = NULL;
++
++	      /* The last alias goes into h_name.  */
++	      assert (ptrlist_size (&aliases) >= 1);
++	      result->h_name = ptrlist_end (&aliases)[-1];
++
++	      /* This is also the canonical name.  */
++	      if (canonp != NULL)
++		*canonp = result->h_name;
++	    }
++	}
++
++      ptrlist_free (&aliases);
++      ptrlist_free (&addresses);
++    }
++
++  if (alt_dns_packet_buffer != dns_packet_buffer)
++    free (alt_dns_packet_buffer);
+   return status;
+ }
+ 
+@@ -614,314 +682,128 @@ addrsort (struct resolv_context *ctx, char **ap, int num)
+ 	break;
+ }
+ 
+-static enum nss_status
+-getanswer_r (struct resolv_context *ctx,
+-	     const querybuf *answer, int anslen, const char *qname, int qtype,
+-	     struct hostent *result, char *buffer, size_t buflen,
+-	     int *errnop, int *h_errnop, int32_t *ttlp, char **canonp)
++/* Convert the uncompressed, binary domain name CDNAME into its
++   textual representation and add it to the end of ALIASES, allocating
++   space for a copy of the name from ABUF.  Skip adding the name if it
++   is not a valid host name, and return false in that case, otherwise
++   true.  */
++static bool
++getanswer_r_store_alias (const unsigned char *cdname,
++			 struct alloc_buffer *abuf,
++			 struct ptrlist *aliases)
+ {
+-  struct host_data
+-  {
+-    char *aliases[MAX_NR_ALIASES];
+-    unsigned char host_addr[16];	/* IPv4 or IPv6 */
+-    char *h_addr_ptrs[0];
+-  } *host_data;
+-  int linebuflen;
+-  const HEADER *hp;
+-  const u_char *end_of_message, *cp;
+-  int n, ancount, qdcount;
+-  int haveanswer, had_error;
+-  char *bp, **ap, **hap;
+-  char tbuf[MAXDNAME];
+-  u_char packtmp[NS_MAXCDNAME];
+-  uintptr_t pad = -(uintptr_t) buffer % __alignof__ (struct host_data);
+-  buffer += pad;
+-  buflen = buflen > pad ? buflen - pad : 0;
+-  if (__glibc_unlikely (buflen < sizeof (struct host_data)))
+-    {
+-      /* The buffer is too small.  */
+-    too_small:
+-      *errnop = ERANGE;
+-      *h_errnop = NETDB_INTERNAL;
+-      return NSS_STATUS_TRYAGAIN;
+-    }
+-  host_data = (struct host_data *) buffer;
+-  linebuflen = buflen - sizeof (struct host_data);
+-  if (buflen - sizeof (struct host_data) != linebuflen)
+-    linebuflen = INT_MAX;
+-
+-  result->h_name = NULL;
+-  end_of_message = answer->buf + anslen;
+-
+-  /*
+-   * find first satisfactory answer
+-   */
+-  hp = &answer->hdr;
+-  ancount = ntohs (hp->ancount);
+-  qdcount = ntohs (hp->qdcount);
+-  cp = answer->buf + HFIXEDSZ;
+-  if (__glibc_unlikely (qdcount != 1))
+-    {
+-      *h_errnop = NO_RECOVERY;
+-      return NSS_STATUS_UNAVAIL;
+-    }
+-  if (sizeof (struct host_data) + (ancount + 1) * sizeof (char *) >= buflen)
+-    goto too_small;
+-  bp = (char *) &host_data->h_addr_ptrs[ancount + 1];
+-  linebuflen -= (ancount + 1) * sizeof (char *);
+-
+-  n = __ns_name_unpack (answer->buf, end_of_message, cp,
+-			packtmp, sizeof packtmp);
+-  if (n != -1 && __ns_name_ntop (packtmp, bp, linebuflen) == -1)
+-    {
+-      if (__glibc_unlikely (errno == EMSGSIZE))
+-	goto too_small;
+-
+-      n = -1;
+-    }
++  /* Filter out domain names that are not host names.  */
++  if (!__res_binary_hnok (cdname))
++    return false;
++
++  /* Note: Not NS_MAXCDNAME, so that __ns_name_ntop implicitly checks
++     for length.  */
++  char dname[MAXHOSTNAMELEN + 1];
++  if (__ns_name_ntop (cdname, dname, sizeof (dname)) < 0)
++    return false;
++  /* Do not report an error on allocation failure, instead store NULL
++     or do nothing.  getanswer_r's caller will see NSS_STATUS_SUCCESS
++     and detect the memory allocation failure or buffer space
++     exhaustion, and report it accordingly.  */
++  ptrlist_add (aliases, alloc_buffer_copy_string (abuf, dname));
++  return true;
++}
+ 
+-  if (__glibc_unlikely (n < 0))
+-    {
+-      *errnop = errno;
+-      *h_errnop = NO_RECOVERY;
+-      return NSS_STATUS_UNAVAIL;
+-    }
+-  if (__glibc_unlikely (__libc_res_hnok (bp) == 0))
++static enum nss_status __attribute__ ((noinline))
++getanswer_r (unsigned char *packet, size_t packetlen, uint16_t qtype,
++	     struct alloc_buffer *abuf,
++	     struct ptrlist *addresses, struct ptrlist *aliases,
++	     int *errnop, int *h_errnop, int32_t *ttlp)
++{
++  struct ns_rr_cursor c;
++  if (!__ns_rr_cursor_init (&c, packet, packetlen))
+     {
+-      errno = EBADMSG;
+-      *errnop = EBADMSG;
++      /* This should not happen because __res_context_query already
++	 perfroms response validation.  */
+       *h_errnop = NO_RECOVERY;
+       return NSS_STATUS_UNAVAIL;
+     }
+-  cp += n + QFIXEDSZ;
+ 
+-  if (qtype == T_A || qtype == T_AAAA)
++  /* Treat the QNAME just like an alias.  Error out if it is not a
++     valid host name.  */
++  if (ns_rr_cursor_rcode (&c) == NXDOMAIN
++      || !getanswer_r_store_alias (ns_rr_cursor_qname (&c), abuf, aliases))
+     {
+-      /* res_send() has already verified that the query name is the
+-       * same as the one we sent; this just gets the expanded name
+-       * (i.e., with the succeeding search-domain tacked on).
+-       */
+-      n = strlen (bp) + 1;             /* for the \0 */
+-      if (n >= MAXHOSTNAMELEN)
+-	{
+-	  *h_errnop = NO_RECOVERY;
+-	  *errnop = ENOENT;
+-	  return NSS_STATUS_TRYAGAIN;
+-	}
+-      result->h_name = bp;
+-      bp += n;
+-      linebuflen -= n;
+-      if (linebuflen < 0)
+-	goto too_small;
+-      /* The qname can be abbreviated, but h_name is now absolute. */
+-      qname = result->h_name;
++      if (ttlp != NULL)
++	/* No negative caching.  */
++	*ttlp = 0;
++      *h_errnop = HOST_NOT_FOUND;
++      *errnop = ENOENT;
++      return NSS_STATUS_NOTFOUND;
+     }
+ 
+-  ap = host_data->aliases;
+-  *ap = NULL;
+-  result->h_aliases = host_data->aliases;
+-  hap = host_data->h_addr_ptrs;
+-  *hap = NULL;
+-  result->h_addr_list = host_data->h_addr_ptrs;
+-  haveanswer = 0;
+-  had_error = 0;
++  int ancount = ns_rr_cursor_ancount (&c);
++  const unsigned char *expected_name = ns_rr_cursor_qname (&c);
++  /* expected_name may be updated to point into this buffer.  */
++  unsigned char name_buffer[NS_MAXCDNAME];
+ 
+-  while (ancount-- > 0 && cp < end_of_message && had_error == 0)
++  for (; ancount > 0; --ancount)
+     {
+-      int type, class;
+-
+-      n = __ns_name_unpack (answer->buf, end_of_message, cp,
+-			    packtmp, sizeof packtmp);
+-      if (n != -1 && __ns_name_ntop (packtmp, bp, linebuflen) == -1)
+-	{
+-	  if (__glibc_unlikely (errno == EMSGSIZE))
+-	    goto too_small;
+-
+-	  n = -1;
+-	}
+-
+-      if (__glibc_unlikely (n < 0 || __libc_res_hnok (bp) == 0))
+-	{
+-	  ++had_error;
+-	  continue;
+-	}
+-      cp += n;				/* name */
+-
+-      if (__glibc_unlikely (cp + 10 > end_of_message))
++      struct ns_rr_wire rr;
++      if (!__ns_rr_cursor_next (&c, &rr))
+ 	{
+-	  ++had_error;
+-	  continue;
++	  *h_errnop = NO_RECOVERY;
++	  return NSS_STATUS_UNAVAIL;
+ 	}
+ 
+-      NS_GET16 (type, cp);
+-      NS_GET16 (class, cp);
+-      int32_t ttl;
+-      NS_GET32 (ttl, cp);
+-      NS_GET16 (n, cp);		/* RDATA length.  */
+-
+-      if (end_of_message - cp < n)
+-	{
+-	  /* RDATA extends beyond the end of the packet.  */
+-	  ++had_error;
+-	  continue;
+-	}
++      /* Skip over records with the wrong class.  */
++      if (rr.rclass != C_IN)
++	continue;
+ 
+-      if (__glibc_unlikely (class != C_IN))
+-	{
+-	  /* XXX - debug? syslog? */
+-	  cp += n;
+-	  continue;			/* XXX - had_error++ ? */
+-	}
++      /* Update TTL for recognized record types.  */
++      if ((rr.rtype == T_CNAME || rr.rtype == qtype)
++	  && ttlp != NULL && *ttlp > rr.ttl)
++	*ttlp = rr.ttl;
+ 
+-      if (type == T_CNAME)
++      if (rr.rtype == T_CNAME)
+ 	{
+-	  /* A CNAME could also have a TTL entry.  */
+-	  if (ttlp != NULL && ttl < *ttlp)
+-	      *ttlp = ttl;
+-
+-	  if (ap >= &host_data->aliases[MAX_NR_ALIASES - 1])
+-	    continue;
+-	  n = __libc_dn_expand (answer->buf, end_of_message, cp,
+-				tbuf, sizeof tbuf);
+-	  if (__glibc_unlikely (n < 0 || __libc_res_hnok (tbuf) == 0))
+-	    {
+-	      ++had_error;
+-	      continue;
+-	    }
+-	  cp += n;
+-	  /* Store alias.  */
+-	  *ap++ = bp;
+-	  n = strlen (bp) + 1;		/* For the \0.  */
+-	  if (__glibc_unlikely (n >= MAXHOSTNAMELEN))
+-	    {
+-	      ++had_error;
+-	      continue;
+-	    }
+-	  bp += n;
+-	  linebuflen -= n;
+-	  /* Get canonical name.  */
+-	  n = strlen (tbuf) + 1;	/* For the \0.  */
+-	  if (__glibc_unlikely (n > linebuflen))
+-	    goto too_small;
+-	  if (__glibc_unlikely (n >= MAXHOSTNAMELEN))
++	  /* NB: No check for owner name match, based on historic
++	     precedent.  Record the CNAME target as the new expected
++	     name.  */
++	  int n = __ns_name_unpack (c.begin, c.end, rr.rdata,
++				    name_buffer, sizeof (name_buffer));
++	  if (n < 0)
+ 	    {
+-	      ++had_error;
+-	      continue;
++	      *h_errnop = NO_RECOVERY;
++	      return NSS_STATUS_UNAVAIL;
+ 	    }
+-	  result->h_name = bp;
+-	  bp = __mempcpy (bp, tbuf, n);	/* Cannot overflow.  */
+-	  linebuflen -= n;
+-	  continue;
++	  /* And store the new name as an alias.  */
++	  getanswer_r_store_alias (name_buffer, abuf, aliases);
++	  expected_name = name_buffer;
+ 	}
+-
+-      if (__glibc_unlikely (type != qtype))
++      else if (rr.rtype == qtype
++	       && __ns_samebinaryname (rr.rname, expected_name)
++	       && rr.rdlength == rrtype_to_rdata_length (qtype))
+ 	{
+-	  cp += n;
+-	  continue;			/* XXX - had_error++ ? */
++	  /* Make a copy of the address and store it.  Increase the
++	     alignment to 4, in case there are applications out there
++	     that expect at least this level of address alignment.  */
++	  ptrlist_add (addresses, (char *) alloc_buffer_next (abuf, uint32_t));
++	  alloc_buffer_copy_bytes (abuf, rr.rdata, rr.rdlength);
+ 	}
+-
+-      switch (type)
+-	{
+-	case T_A:
+-	case T_AAAA:
+-	  if (__glibc_unlikely (__strcasecmp (result->h_name, bp) != 0))
+-	    {
+-	      cp += n;
+-	      continue;			/* XXX - had_error++ ? */
+-	    }
+-
+-	  /* Stop parsing at a record whose length is incorrect.  */
+-	  if (n != rrtype_to_rdata_length (type))
+-	    {
+-	      ++had_error;
+-	      break;
+-	    }
+-
+-	  /* Skip records of the wrong type.  */
+-	  if (n != result->h_length)
+-	    {
+-	      cp += n;
+-	      continue;
+-	    }
+-	  if (!haveanswer)
+-	    {
+-	      int nn;
+-
+-	      /* We compose a single hostent out of the entire chain of
+-	         entries, so the TTL of the hostent is essentially the lowest
+-		 TTL in the chain.  */
+-	      if (ttlp != NULL && ttl < *ttlp)
+-		*ttlp = ttl;
+-	      if (canonp != NULL)
+-		*canonp = bp;
+-	      result->h_name = bp;
+-	      nn = strlen (bp) + 1;	/* for the \0 */
+-	      bp += nn;
+-	      linebuflen -= nn;
+-	    }
+-
+-	  /* Provide sufficient alignment for both address
+-	     families.  */
+-	  enum { align = 4 };
+-	  _Static_assert ((align % __alignof__ (struct in_addr)) == 0,
+-			  "struct in_addr alignment");
+-	  _Static_assert ((align % __alignof__ (struct in6_addr)) == 0,
+-			  "struct in6_addr alignment");
+-	  {
+-	    char *new_bp = PTR_ALIGN_UP (bp, align);
+-	    linebuflen -= new_bp - bp;
+-	    bp = new_bp;
+-	  }
+-
+-	  if (__glibc_unlikely (n > linebuflen))
+-	    goto too_small;
+-	  bp = __mempcpy (*hap++ = bp, cp, n);
+-	  cp += n;
+-	  linebuflen -= n;
+-	  break;
+-	default:
+-	  abort ();
+-	}
+-      if (had_error == 0)
+-	++haveanswer;
+     }
+ 
+-  if (haveanswer > 0)
++  if (ptrlist_size (addresses) == 0)
+     {
+-      *ap = NULL;
+-      *hap = NULL;
+-      /*
+-       * Note: we sort even if host can take only one address
+-       * in its return structures - should give it the "best"
+-       * address in that case, not some random one
+-       */
+-      if (haveanswer > 1 && qtype == T_A
+-	  && __resolv_context_sort_count (ctx) > 0)
+-	addrsort (ctx, host_data->h_addr_ptrs, haveanswer);
+-
+-      if (result->h_name == NULL)
+-	{
+-	  n = strlen (qname) + 1;	/* For the \0.  */
+-	  if (n > linebuflen)
+-	    goto too_small;
+-	  if (n >= MAXHOSTNAMELEN)
+-	    goto no_recovery;
+-	  result->h_name = bp;
+-	  bp = __mempcpy (bp, qname, n);	/* Cannot overflow.  */
+-	  linebuflen -= n;
+-	}
++      /* No address record found.  */
++      if (ttlp != NULL)
++	/* No caching of negative responses.  */
++	*ttlp = 0;
+ 
++      *h_errnop = NO_RECOVERY;
++      *errnop = ENOENT;
++      return NSS_STATUS_TRYAGAIN;
++    }
++  else
++    {
+       *h_errnop = NETDB_SUCCESS;
+       return NSS_STATUS_SUCCESS;
+     }
+- no_recovery:
+-  *h_errnop = NO_RECOVERY;
+-  *errnop = ENOENT;
+-  /* Special case here: if the resolver sent a result but it only
+-     contains a CNAME while we are looking for a T_A or T_AAAA record,
+-     we fail with NOTFOUND instead of TRYAGAIN.  */
+-  return ((qtype == T_A || qtype == T_AAAA) && ap != host_data->aliases
+-	   ? NSS_STATUS_NOTFOUND : NSS_STATUS_TRYAGAIN);
+ }
+ 
+ static enum nss_status
+-- 
+2.38.1
+
+
+From 7a236dc44a22dc4252e803d1ee1d3b970ec43805 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 30 Aug 2022 10:02:49 +0200
+Subject: [PATCH 33/72] nss_dns: In gaih_getanswer_slice, skip strange aliases
+ (bug 12154)
+
+If the name is not a host name, skip adding it to the result, instead
+of reporting query failure.  This fixes bug 12154 for getaddrinfo.
+
+This commit still keeps the old parsing code, and only adjusts when
+a host name is copied.
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit 32b599ac8c21c4c332cc3900a792a1395bca79c7)
+---
+ resolv/nss_dns/dns-host.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/resolv/nss_dns/dns-host.c b/resolv/nss_dns/dns-host.c
+index b887e77e9c..bea505d697 100644
+--- a/resolv/nss_dns/dns-host.c
++++ b/resolv/nss_dns/dns-host.c
+@@ -970,12 +970,12 @@ gaih_getanswer_slice (const querybuf *answer, int anslen, const char *qname,
+ 
+ 	  n = -1;
+ 	}
+-      if (__glibc_unlikely (n < 0 || __libc_res_hnok (buffer) == 0))
++      if (__glibc_unlikely (n < 0))
+ 	{
+ 	  ++had_error;
+ 	  continue;
+ 	}
+-      if (*firstp && canon == NULL)
++      if (*firstp && canon == NULL && __libc_res_hnok (buffer))
+ 	{
+ 	  h_name = buffer;
+ 	  buffer += h_namelen;
+@@ -1021,14 +1021,14 @@ gaih_getanswer_slice (const querybuf *answer, int anslen, const char *qname,
+ 
+ 	  n = __libc_dn_expand (answer->buf, end_of_message, cp,
+ 				tbuf, sizeof tbuf);
+-	  if (__glibc_unlikely (n < 0 || __libc_res_hnok (tbuf) == 0))
++	  if (__glibc_unlikely (n < 0))
+ 	    {
+ 	      ++had_error;
+ 	      continue;
+ 	    }
+ 	  cp += n;
+ 
+-	  if (*firstp)
++	  if (*firstp && __libc_res_hnok (tbuf))
+ 	    {
+ 	      /* Reclaim buffer space.  */
+ 	      if (h_name + h_namelen == buffer)
+-- 
+2.38.1
+
+
+From e2ec6a8db38a6b734bbdb41e498fdc9460f7566a Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 30 Aug 2022 10:02:49 +0200
+Subject: [PATCH 34/72] resolv: Add new tst-resolv-invalid-cname
+
+This test checks resolution through CNAME chains that do not contain
+host names (bug 12154).
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit 9caf782276ecea4bc86fc94fbb52779736f3106d)
+---
+ resolv/Makefile                   |   3 +
+ resolv/tst-resolv-invalid-cname.c | 406 ++++++++++++++++++++++++++++++
+ 2 files changed, 409 insertions(+)
+ create mode 100644 resolv/tst-resolv-invalid-cname.c
+
+diff --git a/resolv/Makefile b/resolv/Makefile
+index 018b1808d6..f8a92c6cff 100644
+--- a/resolv/Makefile
++++ b/resolv/Makefile
+@@ -98,6 +98,7 @@ tests += \
+   tst-resolv-binary \
+   tst-resolv-byaddr \
+   tst-resolv-edns \
++  tst-resolv-invalid-cname \
+   tst-resolv-network \
+   tst-resolv-noaaaa \
+   tst-resolv-nondecimal \
+@@ -287,6 +288,8 @@ $(objpfx)tst-resolv-res_init-multi: $(objpfx)libresolv.so \
+   $(shared-thread-library)
+ $(objpfx)tst-resolv-res_init-thread: $(objpfx)libresolv.so \
+   $(shared-thread-library)
++$(objpfx)tst-resolv-invalid-cname: $(objpfx)libresolv.so \
++  $(shared-thread-library)
+ $(objpfx)tst-resolv-noaaaa: $(objpfx)libresolv.so $(shared-thread-library)
+ $(objpfx)tst-resolv-nondecimal: $(objpfx)libresolv.so $(shared-thread-library)
+ $(objpfx)tst-resolv-qtypes: $(objpfx)libresolv.so $(shared-thread-library)
+diff --git a/resolv/tst-resolv-invalid-cname.c b/resolv/tst-resolv-invalid-cname.c
+new file mode 100644
+index 0000000000..ae2d4419b1
+--- /dev/null
++++ b/resolv/tst-resolv-invalid-cname.c
+@@ -0,0 +1,406 @@
++/* Test handling of CNAMEs with non-host domain names (bug 12154).
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <errno.h>
++#include <netdb.h>
++#include <resolv.h>
++#include <stdlib.h>
++#include <string.h>
++#include <support/check.h>
++#include <support/check_nss.h>
++#include <support/resolv_test.h>
++#include <support/support.h>
++#include <support/xmemstream.h>
++
++/* Query strings describe the CNAME chain in the response.  They have
++   the format "bitsBITS.countCOUNT.example.", where BITS and COUNT are
++   replaced by unsigned decimal numbers.  COUNT is the number of CNAME
++   records in the response.  BITS has two bits for each CNAME record,
++   describing a special prefix that is added to that CNAME.
++
++   0: No special leading label.
++   1: Starting with "*.".
++   2: Starting with "-x.".
++   3: Starting with "star.*.".
++
++   The first CNAME in the response using the two least significant
++   bits.
++
++   For PTR queries, the QNAME format is different, it is either
++   COUNT.BITS.168.192.in-addr.arpa. (with BITS and COUNT still
++   decimal), or:
++
++COUNT.BITS0.BITS1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa.
++
++   where BITS and COUNT are hexadecimal.  */
++
++static void
++response (const struct resolv_response_context *ctx,
++          struct resolv_response_builder *b,
++          const char *qname, uint16_t qclass, uint16_t qtype)
++{
++  TEST_COMPARE (qclass, C_IN);
++
++  /* The only other query type besides A is PTR.  */
++  if (qtype != T_A && qtype != T_AAAA)
++    TEST_COMPARE (qtype, T_PTR);
++
++  unsigned int bits, bits1, count;
++  char *tail = NULL;
++  if (sscanf (qname, "bits%u.count%u.%ms", &bits, &count, &tail) == 3)
++    TEST_COMPARE_STRING (tail, "example");
++  else if (strstr (qname, "in-addr.arpa") != NULL
++           && sscanf (qname, "%u.%u.%ms", &bits, &count, &tail) == 3)
++    TEST_COMPARE_STRING (tail, "168.192.in-addr.arpa");
++  else if (sscanf (qname, "%x.%x.%x.%ms", &bits, &bits1, &count, &tail) == 4)
++    {
++      TEST_COMPARE_STRING (tail, "\
++0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa");
++      bits |= bits1 << 4;
++    }
++  else
++    FAIL_EXIT1 ("invalid QNAME: %s\n", qname);
++  free (tail);
++
++  struct resolv_response_flags flags = {};
++  resolv_response_init (b, flags);
++  resolv_response_add_question (b, qname, qclass, qtype);
++  resolv_response_section (b, ns_s_an);
++
++  /* Provide the requested number of CNAME records.  */
++  char *previous_name = (char *) qname;
++  unsigned int original_bits = bits;
++  for (int unique = 0; unique < count; ++unique)
++    {
++      resolv_response_open_record (b, previous_name, qclass, T_CNAME, 60);
++
++      static const char bits_to_prefix[4][8] = { "", "*.", "-x.", "star.*." };
++      char *new_name = xasprintf ("%sunique%d.example",
++                                  bits_to_prefix[bits & 3], unique);
++      bits >>= 2;
++      resolv_response_add_name (b, new_name);
++      resolv_response_close_record (b);
++
++      if (previous_name != qname)
++        free (previous_name);
++      previous_name = new_name;
++    }
++
++  /* Actual answer record.  */
++  resolv_response_open_record (b, previous_name, qclass, qtype, 60);
++  switch (qtype)
++    {
++    case T_A:
++      {
++        char ipv4[4] = {192, 168, count, original_bits};
++        resolv_response_add_data (b, &ipv4, sizeof (ipv4));
++      }
++      break;
++    case T_AAAA:
++      {
++        char ipv6[16] =
++          {
++            0x20, 0x01, 0xd, 0xb8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
++            count, original_bits
++          };
++        resolv_response_add_data (b, &ipv6, sizeof (ipv6));
++      }
++      break;
++
++    case T_PTR:
++      {
++        char *name = xasprintf ("bits%u.count%u.example",
++                                original_bits, count);
++        resolv_response_add_name (b, name);
++        free (name);
++      }
++      break;
++    }
++  resolv_response_close_record (b);
++
++  if (previous_name != qname)
++    free (previous_name);
++}
++
++/* Controls which name resolution function is invoked.  */
++enum test_mode
++  {
++    byname,                     /* gethostbyname.  */
++    byname2,                    /* gethostbyname2.  */
++    gai,                        /* getaddrinfo without AI_CANONNAME.  */
++    gai_canon,                  /* getaddrinfo with AI_CANONNAME.  */
++
++    test_mode_num               /* Number of enum values.  */
++  };
++
++static const char *
++test_mode_to_string (enum test_mode mode)
++{
++  switch (mode)
++    {
++    case byname:
++      return "byname";
++    case byname2:
++      return "byname2";
++    case gai:
++      return "gai";
++    case gai_canon:
++      return "gai_canon";
++    case test_mode_num:
++      /* Report error below.  */
++    }
++  FAIL_EXIT1 ("invalid test_mode: %d", mode);
++}
++
++/* Append the name and aliases to OUT.  */
++static void
++append_names (FILE *out, const char *qname, int bits, int count,
++              enum test_mode mode)
++{
++  /* Largest valid index which has a corresponding zero in bits
++     (meaning a syntactically valid CNAME).  */
++  int last_valid_cname = -1;
++
++  for (int i = 0; i < count; ++i)
++    if ((bits & (3 << (i * 2))) == 0)
++      last_valid_cname = i;
++
++  if (mode != gai)
++    {
++      const char *label;
++      if (mode == gai_canon)
++        label = "canonname";
++      else
++        label = "name";
++      if (last_valid_cname >= 0)
++        fprintf (out, "%s: unique%d.example\n", label, last_valid_cname);
++      else
++        fprintf (out, "%s: %s\n", label, qname);
++    }
++
++  if (mode == byname || mode == byname2)
++    {
++      if (last_valid_cname >= 0)
++        fprintf (out, "alias: %s\n", qname);
++      for (int i = 0; i < count; ++i)
++        {
++          if ((bits & (3 << (i * 2))) == 0 && i != last_valid_cname)
++            fprintf (out, "alias: unique%d.example\n", i);
++        }
++    }
++}
++
++/* Append the address information to OUT.  */
++static void
++append_addresses (FILE *out, int af, int bits, int count, enum test_mode mode)
++{
++  int last = count * 256 + bits;
++  if (mode == gai || mode == gai_canon)
++    {
++      if (af == AF_INET || af == AF_UNSPEC)
++        fprintf (out, "address: STREAM/TCP 192.168.%d.%d 80\n", count, bits);
++      if (af == AF_INET6 || af == AF_UNSPEC)
++        {
++          if (last == 0)
++            fprintf (out, "address: STREAM/TCP 2001:db8:: 80\n");
++          else
++            fprintf (out, "address: STREAM/TCP 2001:db8::%x 80\n", last);
++        }
++    }
++  else
++    {
++      TEST_VERIFY (af != AF_UNSPEC);
++      if (af == AF_INET)
++        fprintf (out, "address: 192.168.%d.%d\n", count, bits);
++      if (af == AF_INET6)
++        {
++          if (last == 0)
++            fprintf (out, "address: 2001:db8::\n");
++          else
++            fprintf (out, "address: 2001:db8::%x\n", last);
++        }
++    }
++}
++
++/* Perform one test using a forward lookup.  */
++static void
++check_forward (int af, int bits, int count, enum test_mode mode)
++{
++  char *qname = xasprintf ("bits%d.count%d.example", bits, count);
++  char *label = xasprintf ("af=%d bits=%d count=%d mode=%s qname=%s",
++                           af, bits, count, test_mode_to_string (mode), qname);
++
++  struct xmemstream expected;
++  xopen_memstream (&expected);
++  if (mode == gai_canon)
++    fprintf (expected.out, "flags: AI_CANONNAME\n");
++  append_names (expected.out, qname, bits, count, mode);
++  append_addresses (expected.out, af, bits, count, mode);
++  xfclose_memstream (&expected);
++
++  if (mode == gai || mode == gai_canon)
++    {
++      struct addrinfo *ai;
++      struct addrinfo hints =
++        {
++          .ai_family = af,
++          .ai_socktype = SOCK_STREAM,
++        };
++      if (mode == gai_canon)
++        hints.ai_flags |= AI_CANONNAME;
++      int ret = getaddrinfo (qname, "80", &hints, &ai);
++      check_addrinfo (label, ai, ret, expected.buffer);
++      if (ret == 0)
++        freeaddrinfo (ai);
++    }
++  else
++    {
++      struct hostent *e;
++      if (mode == gai)
++        {
++          TEST_COMPARE (af, AF_INET);
++          e = gethostbyname (qname);
++        }
++      else
++        {
++          if (af != AF_INET)
++            TEST_COMPARE (af, AF_INET6);
++          e = gethostbyname2 (qname, af);
++        }
++      check_hostent (label, e, expected.buffer);
++    }
++
++  free (expected.buffer);
++  free (label);
++  free (qname);
++}
++
++/* Perform one check using a reverse lookup.  */
++
++static void
++check_reverse (int af, int bits, int count)
++{
++  TEST_VERIFY (af == AF_INET || af == AF_INET6);
++
++  char *label = xasprintf ("af=%d bits=%d count=%d", af, bits, count);
++  char *fqdn = xasprintf ("bits%d.count%d.example", bits, count);
++
++  struct xmemstream expected;
++  xopen_memstream (&expected);
++  fprintf (expected.out, "name: %s\n", fqdn);
++  append_addresses (expected.out, af, bits, count, byname);
++  xfclose_memstream (&expected);
++
++  char addr[16] = { 0 };
++  socklen_t addrlen;
++  if (af == AF_INET)
++    {
++      addr[0] = 192;
++      addr[1] = 168;
++      addr[2] = count;
++      addr[3] = bits;
++      addrlen = 4;
++    }
++  else
++    {
++      addr[0] = 0x20;
++      addr[1] = 0x01;
++      addr[2] = 0x0d;
++      addr[3] = 0xb8;
++      addr[14] = count;
++      addr[15] = bits;
++      addrlen = 16;
++    }
++
++  struct hostent *e = gethostbyaddr (addr, addrlen, af);
++  check_hostent (label, e, expected.buffer);
++
++  /* getnameinfo check is different.  There is no generic check_*
++     function for it.  */
++  {
++    struct sockaddr_in sin = { };
++    struct sockaddr_in6 sin6 = { };
++    void *sa;
++    socklen_t salen;
++    if (af == AF_INET)
++      {
++        sin.sin_family = AF_INET;
++        memcpy (&sin.sin_addr, addr, addrlen);
++        sin.sin_port = htons (80);
++        sa = &sin;
++        salen = sizeof (sin);
++      }
++    else
++      {
++        sin6.sin6_family = AF_INET6;
++        memcpy (&sin6.sin6_addr, addr, addrlen);
++        sin6.sin6_port = htons (80);
++        sa = &sin6;
++        salen = sizeof (sin6);
++      }
++
++    char host[64];
++    char service[64];
++    int ret = getnameinfo (sa, salen, host,
++                           sizeof (host), service, sizeof (service),
++                           NI_NAMEREQD | NI_NUMERICSERV);
++    TEST_COMPARE (ret, 0);
++    TEST_COMPARE_STRING (host, fqdn);
++    TEST_COMPARE_STRING (service, "80");
++  }
++
++  free (expected.buffer);
++  free (fqdn);
++  free (label);
++}
++
++static int
++do_test (void)
++{
++  struct resolv_test *obj = resolv_test_start
++    ((struct resolv_redirect_config)
++     {
++       .response_callback = response
++     });
++
++  for (int count = 0; count <= 3; ++count)
++    for (int bits = 0; bits <= 1 << (count * 2); ++bits)
++      {
++        if (count > 0 && bits == count)
++          /* The last bits value is only checked if count == 0.  */
++          continue;
++
++        for (enum test_mode mode = 0; mode < test_mode_num; ++mode)
++          {
++            check_forward (AF_INET, bits, count, mode);
++            if (mode != byname)
++              check_forward (AF_INET6, bits, count, mode);
++            if (mode == gai || mode == gai_canon)
++              check_forward (AF_UNSPEC, bits, count, mode);
++          }
++
++        check_reverse (AF_INET, bits, count);
++        check_reverse (AF_INET6, bits, count);
++      }
++
++  resolv_test_end (obj);
++
++  return 0;
++}
++
++#include <support/test-driver.c>
+-- 
+2.38.1
+
+
+From c5cdb39c20e96d9ac0d46fc7284b8276a537fd35 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 30 Aug 2022 10:02:49 +0200
+Subject: [PATCH 35/72] nss_dns: Rewrite _nss_dns_gethostbyname4_r using
+ current interfaces
+
+Introduce struct alloc_buffer to this function, and use it and
+struct ns_rr_cursor in gaih_getanswer_slice.  Adjust gaih_getanswer
+and gaih_getanswer_noaaaa accordingly.
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit 1d495912a746e2a1ffb780c9a81fd234ec2464e8)
+---
+ resolv/nss_dns/dns-host.c | 443 ++++++++++++++------------------------
+ 1 file changed, 162 insertions(+), 281 deletions(-)
+
+diff --git a/resolv/nss_dns/dns-host.c b/resolv/nss_dns/dns-host.c
+index bea505d697..9fa81f23c8 100644
+--- a/resolv/nss_dns/dns-host.c
++++ b/resolv/nss_dns/dns-host.c
+@@ -100,13 +100,6 @@
+ #endif
+ #define MAXHOSTNAMELEN 256
+ 
+-/* We need this time later.  */
+-typedef union querybuf
+-{
+-  HEADER hdr;
+-  u_char buf[MAXPACKET];
+-} querybuf;
+-
+ /* For historic reasons, pointers to IP addresses are char *, so use a
+    single list type for addresses and host names.  */
+ #define DYNARRAY_STRUCT ptrlist
+@@ -125,18 +118,18 @@ static enum nss_status getanswer_ptr (unsigned char *packet, size_t packetlen,
+ 				      char **hnamep, int *errnop,
+ 				      int *h_errnop, int32_t *ttlp);
+ 
+-static enum nss_status gaih_getanswer (const querybuf *answer1, int anslen1,
+-				       const querybuf *answer2, int anslen2,
+-				       const char *qname,
++static enum nss_status gaih_getanswer (unsigned char *packet1,
++				       size_t packet1len,
++				       unsigned char *packet2,
++				       size_t packet2len,
++				       struct alloc_buffer *abuf,
+ 				       struct gaih_addrtuple **pat,
+-				       char *buffer, size_t buflen,
+ 				       int *errnop, int *h_errnop,
+ 				       int32_t *ttlp);
+-static enum nss_status gaih_getanswer_noaaaa (const querybuf *answer1,
+-					      int anslen1,
+-					      const char *qname,
++static enum nss_status gaih_getanswer_noaaaa (unsigned char *packet,
++					      size_t packetlen,
++					      struct alloc_buffer *abuf,
+ 					      struct gaih_addrtuple **pat,
+-					      char *buffer, size_t buflen,
+ 					      int *errnop, int *h_errnop,
+ 					      int32_t *ttlp);
+ 
+@@ -408,17 +401,13 @@ _nss_dns_gethostbyname4_r (const char *name, struct gaih_addrtuple **pat,
+ 	name = cp;
+     }
+ 
+-  union
+-  {
+-    querybuf *buf;
+-    u_char *ptr;
+-  } host_buffer;
+-  querybuf *orig_host_buffer;
+-  host_buffer.buf = orig_host_buffer = (querybuf *) alloca (2048);
++  unsigned char dns_packet_buffer[2048];
++  unsigned char *alt_dns_packet_buffer = dns_packet_buffer;
+   u_char *ans2p = NULL;
+   int nans2p = 0;
+   int resplen2 = 0;
+   int ans2p_malloced = 0;
++  struct alloc_buffer abuf = alloc_buffer_create (buffer, buflen);
+ 
+ 
+   int olderr = errno;
+@@ -427,22 +416,21 @@ _nss_dns_gethostbyname4_r (const char *name, struct gaih_addrtuple **pat,
+   if ((ctx->resp->options & RES_NOAAAA) == 0)
+     {
+       n = __res_context_search (ctx, name, C_IN, T_QUERY_A_AND_AAAA,
+-				host_buffer.buf->buf, 2048, &host_buffer.ptr,
+-				&ans2p, &nans2p, &resplen2, &ans2p_malloced);
++				dns_packet_buffer, sizeof (dns_packet_buffer),
++				&alt_dns_packet_buffer, &ans2p, &nans2p,
++				&resplen2, &ans2p_malloced);
+       if (n >= 0)
+-	status = gaih_getanswer (host_buffer.buf, n, (const querybuf *) ans2p,
+-				 resplen2, name, pat, buffer, buflen,
+-				 errnop, herrnop, ttlp);
++	status = gaih_getanswer (alt_dns_packet_buffer, n, ans2p, resplen2,
++				 &abuf, pat, errnop, herrnop, ttlp);
+     }
+   else
+     {
+       n = __res_context_search (ctx, name, C_IN, T_A,
+-				host_buffer.buf->buf, 2048, NULL,
+-				NULL, NULL, NULL, NULL);
++				dns_packet_buffer, sizeof (dns_packet_buffer),
++				NULL, NULL, NULL, NULL, NULL);
+       if (n >= 0)
+-	status = gaih_getanswer_noaaaa (host_buffer.buf, n,
+-					name, pat, buffer, buflen,
+-					errnop, herrnop, ttlp);
++	status = gaih_getanswer_noaaaa (alt_dns_packet_buffer, n,
++					&abuf, pat, errnop, herrnop, ttlp);
+     }
+   if (n < 0)
+     {
+@@ -473,12 +461,20 @@ _nss_dns_gethostbyname4_r (const char *name, struct gaih_addrtuple **pat,
+ 	__set_errno (olderr);
+     }
+ 
++  /* Implement the buffer resizing protocol.  */
++  if (alloc_buffer_has_failed (&abuf))
++    {
++      *errnop = ERANGE;
++      *herrnop = NETDB_INTERNAL;
++      status = NSS_STATUS_TRYAGAIN;
++    }
++
+   /* Check whether ans2p was separately allocated.  */
+   if (ans2p_malloced)
+     free (ans2p);
+ 
+-  if (host_buffer.buf != orig_host_buffer)
+-    free (host_buffer.buf);
++  if (alt_dns_packet_buffer != dns_packet_buffer)
++    free (alt_dns_packet_buffer);
+ 
+   __resolv_context_put (ctx);
+   return status;
+@@ -892,259 +888,152 @@ getanswer_ptr (unsigned char *packet, size_t packetlen,
+   return NSS_STATUS_TRYAGAIN;
+ }
+ 
++/* Parses DNS data found in PACKETLEN bytes at PACKET in struct
++   gaih_addrtuple address tuples.  The new address tuples are linked
++   from **TAILP, with backing store allocated from ABUF, and *TAILP is
++   updated to point where the next tuple pointer should be stored.  If
++   TTLP is not null, *TTLP is updated to reflect the minimum TTL.  If
++   STORE_CANON is true, the canonical name is stored as part of the
++   first address tuple being written.  */
+ static enum nss_status
+-gaih_getanswer_slice (const querybuf *answer, int anslen, const char *qname,
+-		      struct gaih_addrtuple ***patp,
+-		      char **bufferp, size_t *buflenp,
+-		      int *errnop, int *h_errnop, int32_t *ttlp, int *firstp)
++gaih_getanswer_slice (unsigned char *packet, size_t packetlen,
++		      struct alloc_buffer *abuf,
++		      struct gaih_addrtuple ***tailp,
++		      int *errnop, int *h_errnop, int32_t *ttlp,
++		      bool store_canon)
+ {
+-  char *buffer = *bufferp;
+-  size_t buflen = *buflenp;
+-
+-  struct gaih_addrtuple **pat = *patp;
+-  const HEADER *hp = &answer->hdr;
+-  int ancount = ntohs (hp->ancount);
+-  int qdcount = ntohs (hp->qdcount);
+-  const u_char *cp = answer->buf + HFIXEDSZ;
+-  const u_char *end_of_message = answer->buf + anslen;
+-  if (__glibc_unlikely (qdcount != 1))
+-    {
+-      *h_errnop = NO_RECOVERY;
+-      return NSS_STATUS_UNAVAIL;
+-    }
+-
+-  u_char packtmp[NS_MAXCDNAME];
+-  int n = __ns_name_unpack (answer->buf, end_of_message, cp,
+-			    packtmp, sizeof packtmp);
+-  /* We unpack the name to check it for validity.  But we do not need
+-     it later.  */
+-  if (n != -1 && __ns_name_ntop (packtmp, buffer, buflen) == -1)
+-    {
+-      if (__glibc_unlikely (errno == EMSGSIZE))
+-	{
+-	too_small:
+-	  *errnop = ERANGE;
+-	  *h_errnop = NETDB_INTERNAL;
+-	  return NSS_STATUS_TRYAGAIN;
+-	}
+-
+-      n = -1;
+-    }
+-
+-  if (__glibc_unlikely (n < 0))
+-    {
+-      *errnop = errno;
+-      *h_errnop = NO_RECOVERY;
+-      return NSS_STATUS_UNAVAIL;
+-    }
+-  if (__glibc_unlikely (__libc_res_hnok (buffer) == 0))
++  struct ns_rr_cursor c;
++  if (!__ns_rr_cursor_init (&c, packet, packetlen))
+     {
+-      errno = EBADMSG;
+-      *errnop = EBADMSG;
++      /* This should not happen because __res_context_query already
++	 perfroms response validation.  */
+       *h_errnop = NO_RECOVERY;
+       return NSS_STATUS_UNAVAIL;
+     }
+-  cp += n + QFIXEDSZ;
++  bool haveanswer = false; /* Set to true if at least one address.  */
++  uint16_t qtype = ns_rr_cursor_qtype (&c);
++  int ancount = ns_rr_cursor_ancount (&c);
++  const unsigned char *expected_name = ns_rr_cursor_qname (&c);
++  /* expected_name may be updated to point into this buffer.  */
++  unsigned char name_buffer[NS_MAXCDNAME];
+ 
+-  int haveanswer = 0;
+-  int had_error = 0;
+-  char *canon = NULL;
+-  char *h_name = NULL;
+-  int h_namelen = 0;
++  /* This is a pointer to a possibly-compressed name in the packet.
++     Eventually it is equivalent to the canonical name.  If needed, it
++     is uncompressed and translated to text form when the first
++     address tuple is encountered.  */
++  const unsigned char *compressed_alias_name = expected_name;
+ 
+-  if (ancount == 0)
++  if (ancount == 0 || !__res_binary_hnok (compressed_alias_name))
+     {
+       *h_errnop = HOST_NOT_FOUND;
+       return NSS_STATUS_NOTFOUND;
+     }
+ 
+-  while (ancount-- > 0 && cp < end_of_message && had_error == 0)
++  for (; ancount > -0; --ancount)
+     {
+-      n = __ns_name_unpack (answer->buf, end_of_message, cp,
+-			    packtmp, sizeof packtmp);
+-      if (n != -1 &&
+-	  (h_namelen = __ns_name_ntop (packtmp, buffer, buflen)) == -1)
+-	{
+-	  if (__glibc_unlikely (errno == EMSGSIZE))
+-	    goto too_small;
+-
+-	  n = -1;
+-	}
+-      if (__glibc_unlikely (n < 0))
+-	{
+-	  ++had_error;
+-	  continue;
+-	}
+-      if (*firstp && canon == NULL && __libc_res_hnok (buffer))
+-	{
+-	  h_name = buffer;
+-	  buffer += h_namelen;
+-	  buflen -= h_namelen;
+-	}
+-
+-      cp += n;				/* name */
+-
+-      if (__glibc_unlikely (cp + 10 > end_of_message))
+-	{
+-	  ++had_error;
+-	  continue;
+-	}
+-
+-      uint16_t type;
+-      NS_GET16 (type, cp);
+-      uint16_t class;
+-      NS_GET16 (class, cp);
+-      int32_t ttl;
+-      NS_GET32 (ttl, cp);
+-      NS_GET16 (n, cp);		/* RDATA length.  */
+-
+-      if (end_of_message - cp < n)
++      struct ns_rr_wire rr;
++      if (!__ns_rr_cursor_next (&c, &rr))
+ 	{
+-	  /* RDATA extends beyond the end of the packet.  */
+-	  ++had_error;
+-	  continue;
++	  *h_errnop = NO_RECOVERY;
++	  return NSS_STATUS_UNAVAIL;
+ 	}
+ 
+-      if (class != C_IN)
+-	{
+-	  cp += n;
+-	  continue;
+-	}
++      /* Update TTL for known record types.  */
++      if ((rr.rtype == T_CNAME || rr.rtype == qtype)
++	  && ttlp != NULL && *ttlp > rr.ttl)
++	*ttlp = rr.ttl;
+ 
+-      if (type == T_CNAME)
++      if (rr.rtype == T_CNAME)
+ 	{
+-	  char tbuf[MAXDNAME];
+-
+-	  /* A CNAME could also have a TTL entry.  */
+-	  if (ttlp != NULL && ttl < *ttlp)
+-	      *ttlp = ttl;
+-
+-	  n = __libc_dn_expand (answer->buf, end_of_message, cp,
+-				tbuf, sizeof tbuf);
+-	  if (__glibc_unlikely (n < 0))
+-	    {
+-	      ++had_error;
+-	      continue;
+-	    }
+-	  cp += n;
+-
+-	  if (*firstp && __libc_res_hnok (tbuf))
++	  /* NB: No check for owner name match, based on historic
++	     precedent.  Record the CNAME target as the new expected
++	     name.  */
++	  int n = __ns_name_unpack (c.begin, c.end, rr.rdata,
++				    name_buffer, sizeof (name_buffer));
++	  if (n < 0)
+ 	    {
+-	      /* Reclaim buffer space.  */
+-	      if (h_name + h_namelen == buffer)
+-		{
+-		  buffer = h_name;
+-		  buflen += h_namelen;
+-		}
+-
+-	      n = strlen (tbuf) + 1;
+-	      if (__glibc_unlikely (n > buflen))
+-		goto too_small;
+-	      if (__glibc_unlikely (n >= MAXHOSTNAMELEN))
+-		{
+-		  ++had_error;
+-		  continue;
+-		}
+-
+-	      canon = buffer;
+-	      buffer = __mempcpy (buffer, tbuf, n);
+-	      buflen -= n;
+-	      h_namelen = 0;
++	      *h_errnop = NO_RECOVERY;
++	      return NSS_STATUS_UNAVAIL;
+ 	    }
+-	  continue;
++	  expected_name = name_buffer;
++	  if (store_canon && __res_binary_hnok (name_buffer))
++	    /* This name can be used as a canonical name.  Do not
++	       translate to text form here to conserve buffer space.
++	       Point to the compressed name because name_buffer can be
++	       overwritten with an unusable name later.  */
++	    compressed_alias_name = rr.rdata;
+ 	}
+-
+-      /* Stop parsing if we encounter a record with incorrect RDATA
+-	 length.  */
+-      if (type == T_A || type == T_AAAA)
++      else if (rr.rtype == qtype
++	       && __ns_samebinaryname (rr.rname, expected_name)
++	       && rr.rdlength == rrtype_to_rdata_length (qtype))
+ 	{
+-	  if (n != rrtype_to_rdata_length (type))
++	  struct gaih_addrtuple *ntup
++	    = alloc_buffer_alloc (abuf, struct gaih_addrtuple);
++	  /* Delay error reporting to the callers (they implement the
++	     ERANGE buffer resizing handshake).  */
++	  if (ntup != NULL)
+ 	    {
+-	      ++had_error;
+-	      continue;
++	      ntup->next = NULL;
++	      if (store_canon && compressed_alias_name != NULL)
++		{
++		  /* This assumes that all the CNAME records come
++		     first.  Use MAXHOSTNAMELEN instead of
++		     NS_MAXCDNAME for additional length checking.
++		     However, these checks are not expected to fail
++		     because all size NS_MAXCDNAME names should into
++		     the hname buffer because no escaping is
++		     needed.  */
++		  char unsigned nbuf[NS_MAXCDNAME];
++		  char hname[MAXHOSTNAMELEN + 1];
++		  if (__ns_name_unpack (c.begin, c.end,
++					compressed_alias_name,
++					nbuf, sizeof (nbuf)) >= 0
++		      && __ns_name_ntop (nbuf, hname, sizeof (hname)) >= 0)
++		    /* Space checking is performed by the callers.  */
++		    ntup->name = alloc_buffer_copy_string (abuf, hname);
++		  store_canon = false;
++		}
++	      else
++		ntup->name = NULL;
++	      if (rr.rdlength == 4)
++		ntup->family = AF_INET;
++	      else
++		ntup->family = AF_INET6;
++	      memcpy (ntup->addr, rr.rdata, rr.rdlength);
++	      ntup->scopeid = 0;
++
++	      /* Link in the new tuple, and update the tail pointer to
++		 point to its next field.  */
++	      **tailp = ntup;
++	      *tailp = &ntup->next;
++
++	      haveanswer = true;
+ 	    }
+ 	}
+-      else
+-	{
+-	  /* Skip unknown records.  */
+-	  cp += n;
+-	  continue;
+-	}
+-
+-      assert (type == T_A || type == T_AAAA);
+-      if (*pat == NULL)
+-	{
+-	  uintptr_t pad = (-(uintptr_t) buffer
+-			   % __alignof__ (struct gaih_addrtuple));
+-	  buffer += pad;
+-	  buflen = buflen > pad ? buflen - pad : 0;
+-
+-	  if (__glibc_unlikely (buflen < sizeof (struct gaih_addrtuple)))
+-	    goto too_small;
+-
+-	  *pat = (struct gaih_addrtuple *) buffer;
+-	  buffer += sizeof (struct gaih_addrtuple);
+-	  buflen -= sizeof (struct gaih_addrtuple);
+-	}
+-
+-      (*pat)->name = NULL;
+-      (*pat)->next = NULL;
+-
+-      if (*firstp)
+-	{
+-	  /* We compose a single hostent out of the entire chain of
+-	     entries, so the TTL of the hostent is essentially the lowest
+-	     TTL in the chain.  */
+-	  if (ttlp != NULL && ttl < *ttlp)
+-	    *ttlp = ttl;
+-
+-	  (*pat)->name = canon ?: h_name;
+-
+-	  *firstp = 0;
+-	}
+-
+-      (*pat)->family = type == T_A ? AF_INET : AF_INET6;
+-      memcpy ((*pat)->addr, cp, n);
+-      cp += n;
+-      (*pat)->scopeid = 0;
+-
+-      pat = &((*pat)->next);
+-
+-      haveanswer = 1;
+     }
+ 
+   if (haveanswer)
+     {
+-      *patp = pat;
+-      *bufferp = buffer;
+-      *buflenp = buflen;
+-
+       *h_errnop = NETDB_SUCCESS;
+       return NSS_STATUS_SUCCESS;
+     }
+-
+-  /* Special case here: if the resolver sent a result but it only
+-     contains a CNAME while we are looking for a T_A or T_AAAA record,
+-     we fail with NOTFOUND instead of TRYAGAIN.  */
+-  if (canon != NULL)
++  else
+     {
++      /* Special case here: if the resolver sent a result but it only
++	 contains a CNAME while we are looking for a T_A or T_AAAA
++	 record, we fail with NOTFOUND.  */
+       *h_errnop = HOST_NOT_FOUND;
+       return NSS_STATUS_NOTFOUND;
+     }
+-
+-  *h_errnop = NETDB_INTERNAL;
+-  return NSS_STATUS_TRYAGAIN;
+ }
+ 
+ 
+ static enum nss_status
+-gaih_getanswer (const querybuf *answer1, int anslen1, const querybuf *answer2,
+-		int anslen2, const char *qname,
+-		struct gaih_addrtuple **pat, char *buffer, size_t buflen,
++gaih_getanswer (unsigned char *packet1, size_t packet1len,
++		unsigned char *packet2, size_t packet2len,
++		struct alloc_buffer *abuf, struct gaih_addrtuple **pat,
+ 		int *errnop, int *h_errnop, int32_t *ttlp)
+ {
+-  int first = 1;
+-
+   enum nss_status status = NSS_STATUS_NOTFOUND;
+ 
+   /* Combining the NSS status of two distinct queries requires some
+@@ -1156,7 +1045,10 @@ gaih_getanswer (const querybuf *answer1, int anslen1, const querybuf *answer2,
+      between TRYAGAIN (recoverable) and TRYAGAIN' (not-recoverable).
+      A recoverable TRYAGAIN is almost always due to buffer size issues
+      and returns ERANGE in errno and the caller is expected to retry
+-     with a larger buffer.
++     with a larger buffer.  (The caller, _nss_dns_gethostbyname4_r,
++     ignores the return status if it detects that the result buffer
++     has been exhausted and generates a TRYAGAIN failure with an
++     ERANGE code.)
+ 
+      Lastly, you may be tempted to make significant changes to the
+      conditions in this code to bring about symmetry between responses.
+@@ -1236,36 +1128,30 @@ gaih_getanswer (const querybuf *answer1, int anslen1, const querybuf *answer2,
+ 	 is a recoverable error we now return TRYAGIN even if the first
+ 	 response was SUCCESS.  */
+ 
+-  if (anslen1 > 0)
+-    status = gaih_getanswer_slice(answer1, anslen1, qname,
+-				  &pat, &buffer, &buflen,
+-				  errnop, h_errnop, ttlp,
+-				  &first);
+-
+-  if ((status == NSS_STATUS_SUCCESS || status == NSS_STATUS_NOTFOUND
+-       || (status == NSS_STATUS_TRYAGAIN
+-	   /* We want to look at the second answer in case of an
+-	      NSS_STATUS_TRYAGAIN only if the error is non-recoverable, i.e.
+-	      *h_errnop is NO_RECOVERY. If not, and if the failure was due to
+-	      an insufficient buffer (ERANGE), then we need to drop the results
+-	      and pass on the NSS_STATUS_TRYAGAIN to the caller so that it can
+-	      repeat the query with a larger buffer.  */
+-	   && (*errnop != ERANGE || *h_errnop == NO_RECOVERY)))
+-      && answer2 != NULL && anslen2 > 0)
++  if (packet1len > 0)
+     {
+-      enum nss_status status2 = gaih_getanswer_slice(answer2, anslen2, qname,
+-						     &pat, &buffer, &buflen,
+-						     errnop, h_errnop, ttlp,
+-						     &first);
++      status = gaih_getanswer_slice (packet1, packet1len,
++				     abuf, &pat, errnop, h_errnop, ttlp, true);
++      if (alloc_buffer_has_failed (abuf))
++	/* Do not try parsing the second packet if a larger result
++	   buffer is needed.  The caller implements the resizing
++	   protocol because *abuf has been exhausted.  */
++	return NSS_STATUS_TRYAGAIN; /* Ignored by the caller.  */
++    }
++
++  if ((status == NSS_STATUS_SUCCESS || status == NSS_STATUS_NOTFOUND)
++      && packet2 != NULL && packet2len > 0)
++    {
++      enum nss_status status2
++	= gaih_getanswer_slice (packet2, packet2len,
++				abuf, &pat, errnop, h_errnop, ttlp,
++				/* Success means that data with a
++				   canonical name has already been
++				   stored.  Do not store the name again.  */
++				status != NSS_STATUS_SUCCESS);
+       /* Use the second response status in some cases.  */
+       if (status != NSS_STATUS_SUCCESS && status2 != NSS_STATUS_NOTFOUND)
+ 	status = status2;
+-      /* Do not return a truncated second response (unless it was
+-	 unavoidable e.g. unrecoverable TRYAGAIN).  */
+-      if (status == NSS_STATUS_SUCCESS
+-	  && (status2 == NSS_STATUS_TRYAGAIN
+-	      && *errnop == ERANGE && *h_errnop != NO_RECOVERY))
+-	status = NSS_STATUS_TRYAGAIN;
+     }
+ 
+   return status;
+@@ -1273,18 +1159,13 @@ gaih_getanswer (const querybuf *answer1, int anslen1, const querybuf *answer2,
+ 
+ /* Variant of gaih_getanswer without a second (AAAA) response.  */
+ static enum nss_status
+-gaih_getanswer_noaaaa (const querybuf *answer1, int anslen1, const char *qname,
+-		       struct gaih_addrtuple **pat,
+-		       char *buffer, size_t buflen,
++gaih_getanswer_noaaaa (unsigned char *packet, size_t packetlen,
++		       struct alloc_buffer *abuf, struct gaih_addrtuple **pat,
+ 		       int *errnop, int *h_errnop, int32_t *ttlp)
+ {
+-  int first = 1;
+-
+   enum nss_status status = NSS_STATUS_NOTFOUND;
+-  if (anslen1 > 0)
+-    status = gaih_getanswer_slice (answer1, anslen1, qname,
+-				   &pat, &buffer, &buflen,
+-				   errnop, h_errnop, ttlp,
+-				   &first);
++  if (packetlen > 0)
++    status = gaih_getanswer_slice (packet, packetlen,
++				   abuf, &pat, errnop, h_errnop, ttlp, true);
+   return status;
+ }
+-- 
+2.38.1
+
+
+From a7fa604f3050a1024dc8ec28ff28bad811f6151f Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 30 Aug 2022 13:30:03 +0200
+Subject: [PATCH 36/72] resolv: Fix building tst-resolv-invalid-cname for
+ earlier C standards
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This fixes this compiler error:
+
+tst-resolv-invalid-cname.c: In function ‘test_mode_to_string’:
+tst-resolv-invalid-cname.c:164:10: error: label at end of compound statement
+     case test_mode_num:
+          ^~~~~~~~~~~~~
+
+Fixes commit 9caf782276ecea4bc86fc94fbb52779736f3106d
+("resolv: Add new tst-resolv-invalid-cname").
+
+(cherry picked from commit d09aa4a17229bcaa2ec7642006b12612498582e7)
+---
+ resolv/tst-resolv-invalid-cname.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/resolv/tst-resolv-invalid-cname.c b/resolv/tst-resolv-invalid-cname.c
+index ae2d4419b1..63dac90e02 100644
+--- a/resolv/tst-resolv-invalid-cname.c
++++ b/resolv/tst-resolv-invalid-cname.c
+@@ -162,7 +162,7 @@ test_mode_to_string (enum test_mode mode)
+     case gai_canon:
+       return "gai_canon";
+     case test_mode_num:
+-      /* Report error below.  */
++      break;                    /* Report error below.  */
+     }
+   FAIL_EXIT1 ("invalid test_mode: %d", mode);
+ }
+-- 
+2.38.1
+
+
+From 5d885617cec5713fdde42177398fe98acb66b7a2 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 13 Sep 2022 13:22:27 +0200
+Subject: [PATCH 37/72] NEWS: Note bug 12154 and bug 29305 as fixed
+
+---
+ NEWS | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/NEWS b/NEWS
+index 9360596fcc..03281e3ab4 100644
+--- a/NEWS
++++ b/NEWS
+@@ -16,7 +16,9 @@ Security related changes:
+ 
+ The following bugs are resolved with this release:
+ 
++  [12154] Do not fail DNS resolution for CNAMEs which are not host names
+   [28846] CMSG_NXTHDR may trigger -Wstrict-overflow warning
++  [29305] Conserve NSS buffer space during DNS packet parsing
+   [29415] nscd: Fix netlink cache invalidation if epoll is used
+   [29446] _dlopen now ignores dl_caller argument in static mode
+   [29485] Linux: Terminate subprocess on late failure in tst-pidfd
+-- 
+2.38.1
+
+
+From df51334828f2af214105aad82042140ee3a6de0a Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 13 Sep 2022 19:57:43 +0200
+Subject: [PATCH 38/72] elf: Run tst-audit-tlsdesc, tst-audit-tlsdesc-dlopen
+ everywhere
+
+The test is valid for all TLS models, but we want to make a reasonable
+effort to test the GNU2 model specifically.  For example, aarch64
+defaults to GNU2, but does not have -mtls-dialect=gnu2, and the test
+was not run there.
+
+Suggested-by: Martin Coufal <mcoufal@redhat.com>
+(cherry picked from commit dd2315a866a4ac2b838ea1cb10c5ea1c35d51a2f)
+
+Fixes early backport commit 924e4f3eaa502ce82fccf8537f021a796d158771
+("elf: Call __libc_early_init for reused namespaces (bug 29528)");
+it had a wrong conflict resolution.
+---
+ elf/Makefile | 22 ++++++----------------
+ 1 file changed, 6 insertions(+), 16 deletions(-)
+
+diff --git a/elf/Makefile b/elf/Makefile
+index 43353a4b08..72178d33ff 100644
+--- a/elf/Makefile
++++ b/elf/Makefile
+@@ -374,6 +374,8 @@ tests += \
+   tst-align \
+   tst-align2 \
+   tst-align3 \
++  tst-audit-tlsdesc \
++  tst-audit-tlsdesc-dlopen \
+   tst-audit1 \
+   tst-audit2 \
+   tst-audit8 \
+@@ -766,6 +768,8 @@ modules-names += \
+   tst-alignmod3 \
+   tst-array2dep \
+   tst-array5dep \
++  tst-audit-tlsdesc-mod1 \
++  tst-audit-tlsdesc-mod2 \
+   tst-audit11mod1 \
+   tst-audit11mod2 \
+   tst-audit12mod1 \
+@@ -799,6 +803,7 @@ modules-names += \
+   tst-auditmanymod7 \
+   tst-auditmanymod8 \
+   tst-auditmanymod9 \
++  tst-auditmod-tlsdesc  \
+   tst-auditmod1 \
+   tst-auditmod9a \
+   tst-auditmod9b \
+@@ -993,23 +998,8 @@ modules-names += tst-gnu2-tls1mod
+ $(objpfx)tst-gnu2-tls1: $(objpfx)tst-gnu2-tls1mod.so
+ tst-gnu2-tls1mod.so-no-z-defs = yes
+ CFLAGS-tst-gnu2-tls1mod.c += -mtls-dialect=gnu2
++endif # $(have-mtls-dialect-gnu2)
+ 
+-tests += tst-audit-tlsdesc tst-audit-tlsdesc-dlopen
+-modules-names += tst-audit-tlsdesc-mod1 tst-audit-tlsdesc-mod2 tst-auditmod-tlsdesc
+-$(objpfx)tst-audit-tlsdesc: $(objpfx)tst-audit-tlsdesc-mod1.so \
+-			    $(objpfx)tst-audit-tlsdesc-mod2.so \
+-			    $(shared-thread-library)
+-CFLAGS-tst-audit-tlsdesc-mod1.c += -mtls-dialect=gnu2
+-CFLAGS-tst-audit-tlsdesc-mod2.c += -mtls-dialect=gnu2
+-$(objpfx)tst-audit-tlsdesc-dlopen: $(shared-thread-library)
+-$(objpfx)tst-audit-tlsdesc-dlopen.out: $(objpfx)tst-audit-tlsdesc-mod1.so \
+-				       $(objpfx)tst-audit-tlsdesc-mod2.so
+-$(objpfx)tst-audit-tlsdesc-mod1.so: $(objpfx)tst-audit-tlsdesc-mod2.so
+-$(objpfx)tst-audit-tlsdesc.out: $(objpfx)tst-auditmod-tlsdesc.so
+-tst-audit-tlsdesc-ENV = LD_AUDIT=$(objpfx)tst-auditmod-tlsdesc.so
+-$(objpfx)tst-audit-tlsdesc-dlopen.out: $(objpfx)tst-auditmod-tlsdesc.so
+-tst-audit-tlsdesc-dlopen-ENV = LD_AUDIT=$(objpfx)tst-auditmod-tlsdesc.so
+-endif
+ ifeq (yes,$(have-protected-data))
+ modules-names += tst-protected1moda tst-protected1modb
+ tests += tst-protected1a tst-protected1b
+-- 
+2.38.1
+
+
+From 4b95b6e8bbb5a2b6856f707bf3bc3308ebef595a Mon Sep 17 00:00:00 2001
+From: Javier Pello <devel@otheo.eu>
+Date: Mon, 5 Sep 2022 20:09:01 +0200
+Subject: [PATCH 39/72] elf: Fix hwcaps string size overestimation
+
+Commit dad90d528259b669342757c37dedefa8577e2636 added glibc-hwcaps
+support for LD_LIBRARY_PATH and, for this, it adjusted the total
+string size required in _dl_important_hwcaps. However, in doing so
+it inadvertently altered the calculation of the size required for
+the power set strings, as the computation of the power set string
+size depended on the first value assigned to the total variable,
+which is later shifted, resulting in overallocation of string
+space. Fix this now by using a different variable to hold the
+string size required for glibc-hwcaps.
+
+Signed-off-by: Javier Pello <devel@otheo.eu>
+(cherry picked from commit a23820f6052a740246fdc7dcd9c43ce8eed0c45a)
+---
+ elf/dl-hwcaps.c | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/elf/dl-hwcaps.c b/elf/dl-hwcaps.c
+index 6f161f6ad5..92eb53790e 100644
+--- a/elf/dl-hwcaps.c
++++ b/elf/dl-hwcaps.c
+@@ -193,7 +193,7 @@ _dl_important_hwcaps (const char *glibc_hwcaps_prepend,
+   /* Each hwcaps subdirectory has a GLIBC_HWCAPS_PREFIX string prefix
+      and a "/" suffix once stored in the result.  */
+   hwcaps_counts.maximum_length += strlen (GLIBC_HWCAPS_PREFIX) + 1;
+-  size_t total = (hwcaps_counts.count * (strlen (GLIBC_HWCAPS_PREFIX) + 1)
++  size_t hwcaps_sz = (hwcaps_counts.count * (strlen (GLIBC_HWCAPS_PREFIX) + 1)
+ 		  + hwcaps_counts.total_length);
+ 
+   /* Count the number of bits set in the masked value.  */
+@@ -229,11 +229,12 @@ _dl_important_hwcaps (const char *glibc_hwcaps_prepend,
+   assert (m == cnt);
+ 
+   /* Determine the total size of all strings together.  */
++  size_t total;
+   if (cnt == 1)
+-    total += temp[0].len + 1;
++    total = temp[0].len + 1;
+   else
+     {
+-      total += temp[0].len + temp[cnt - 1].len + 2;
++      total = temp[0].len + temp[cnt - 1].len + 2;
+       if (cnt > 2)
+ 	{
+ 	  total <<= 1;
+@@ -255,6 +256,7 @@ _dl_important_hwcaps (const char *glibc_hwcaps_prepend,
+   /* This is the overall result, including both glibc-hwcaps
+      subdirectories and the legacy hwcaps subdirectories using the
+      power set construction.  */
++  total += hwcaps_sz;
+   struct r_strlenpair *overall_result
+     = malloc (*sz * sizeof (*result) + total);
+   if (overall_result == NULL)
+-- 
+2.38.1
+
+
+From 7a3f8c8a7aeb41d4bbfeec07d0be1e92c3019919 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 6 Sep 2022 07:38:10 +0200
+Subject: [PATCH 40/72] scripts/dso-ordering-test.py: Generate program run-time
+ dependencies
+
+The main program needs to depend on all shared objects, even objects
+that have link-time dependencies among shared objects.  Filtering
+out shared objects that already have an link-time dependencies is not
+necessary here; make will do this automatically.
+
+Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
+(cherry picked from commit 183d99737298bb3200f0610fdcd1c7549c8ed560)
+---
+ scripts/dso-ordering-test.py | 13 ++++++-------
+ 1 file changed, 6 insertions(+), 7 deletions(-)
+
+diff --git a/scripts/dso-ordering-test.py b/scripts/dso-ordering-test.py
+index 2dd6bfda18..b87cf2f809 100644
+--- a/scripts/dso-ordering-test.py
++++ b/scripts/dso-ordering-test.py
+@@ -707,13 +707,12 @@ def process_testcase(t):
+                 "\t$(compile.c) $(OUTPUT_OPTION)\n")
+         makefile.write (rule)
+ 
+-        not_depended_objs = find_objs_not_depended_on(test_descr)
+-        if not_depended_objs:
+-            depstr = ""
+-            for dep in not_depended_objs:
+-                depstr += (" $(objpfx)" + test_subdir + "/"
+-                           + test_name + "-" + dep + ".so")
+-            makefile.write("$(objpfx)%s.out:%s\n" % (base_test_name, depstr))
++        # Ensure that all shared objects are built before running the
++        # test, whether there link-time dependencies or not.
++        depobjs = ["$(objpfx){}/{}-{}.so".format(test_subdir, test_name, dep)
++                   for dep in test_descr.objs]
++        makefile.write("$(objpfx){}.out: {}\n".format(
++            base_test_name, " ".join(depobjs)))
+ 
+         # Add main executable to test-srcs
+         makefile.write("test-srcs += %s/%s\n" % (test_subdir, test_name))
+-- 
+2.38.1
+
+
+From d1241cf00139733de069c84933cd576dc1a1f45e Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 6 Sep 2022 07:38:10 +0200
+Subject: [PATCH 41/72] elf: Rename _dl_sort_maps parameter from skip to
+ force_first
+
+The new implementation will not be able to skip an arbitrary number
+of objects.
+
+Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
+(cherry picked from commit dbb75513f5cf9285c77c9e55777c5c35b653f890)
+---
+ elf/dl-sort-maps.c         | 14 +++++++-------
+ sysdeps/generic/ldsodefs.h |  6 ++++--
+ 2 files changed, 11 insertions(+), 9 deletions(-)
+
+diff --git a/elf/dl-sort-maps.c b/elf/dl-sort-maps.c
+index 96638d7ed1..5b550b1e94 100644
+--- a/elf/dl-sort-maps.c
++++ b/elf/dl-sort-maps.c
+@@ -27,12 +27,12 @@
+    If FOR_FINI is true, this is called for finishing an object.  */
+ static void
+ _dl_sort_maps_original (struct link_map **maps, unsigned int nmaps,
+-			unsigned int skip, bool for_fini)
++			bool force_first, bool for_fini)
+ {
+   /* Allows caller to do the common optimization of skipping the first map,
+      usually the main binary.  */
+-  maps += skip;
+-  nmaps -= skip;
++  maps += force_first;
++  nmaps -= force_first;
+ 
+   /* A list of one element need not be sorted.  */
+   if (nmaps <= 1)
+@@ -182,7 +182,7 @@ dfs_traversal (struct link_map ***rpo, struct link_map *map,
+ 
+ static void
+ _dl_sort_maps_dfs (struct link_map **maps, unsigned int nmaps,
+-		   unsigned int skip __attribute__ ((unused)), bool for_fini)
++		   bool force_first __attribute__ ((unused)), bool for_fini)
+ {
+   for (int i = nmaps - 1; i >= 0; i--)
+     maps[i]->l_visited = 0;
+@@ -286,7 +286,7 @@ _dl_sort_maps_init (void)
+ 
+ void
+ _dl_sort_maps (struct link_map **maps, unsigned int nmaps,
+-	       unsigned int skip, bool for_fini)
++	       bool force_first, bool for_fini)
+ {
+   /* It can be tempting to use a static function pointer to store and call
+      the current selected sorting algorithm routine, but experimentation
+@@ -296,9 +296,9 @@ _dl_sort_maps (struct link_map **maps, unsigned int nmaps,
+      input cases. A simple if-case with direct function calls appears to
+      be the fastest.  */
+   if (__glibc_likely (GLRO(dl_dso_sort_algo) == dso_sort_algorithm_original))
+-    _dl_sort_maps_original (maps, nmaps, skip, for_fini);
++    _dl_sort_maps_original (maps, nmaps, force_first, for_fini);
+   else
+-    _dl_sort_maps_dfs (maps, nmaps, skip, for_fini);
++    _dl_sort_maps_dfs (maps, nmaps, force_first, for_fini);
+ }
+ 
+ #endif /* HAVE_TUNABLES.  */
+diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h
+index 050a3032de..6b256b8388 100644
+--- a/sysdeps/generic/ldsodefs.h
++++ b/sysdeps/generic/ldsodefs.h
+@@ -1048,9 +1048,11 @@ extern void _dl_init (struct link_map *main_map, int argc, char **argv,
+    initializer functions have completed.  */
+ extern void _dl_fini (void) attribute_hidden;
+ 
+-/* Sort array MAPS according to dependencies of the contained objects.  */
++/* Sort array MAPS according to dependencies of the contained objects.
++   If FORCE_FIRST, MAPS[0] keeps its place even if the dependencies
++   say otherwise.  */
+ extern void _dl_sort_maps (struct link_map **maps, unsigned int nmaps,
+-			   unsigned int skip, bool for_fini) attribute_hidden;
++			   bool force_first, bool for_fini) attribute_hidden;
+ 
+ /* The dynamic linker calls this function before and having changing
+    any shared object mappings.  The `r_state' member of `struct r_debug'
+-- 
+2.38.1
+
+
+From da5f134f6d59701a3a6119309ae91c93c3fa5b51 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 20 Sep 2022 11:00:42 +0200
+Subject: [PATCH 42/72] elf: Implement force_first handling in
+ _dl_sort_maps_dfs (bug 28937)
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The implementation in _dl_close_worker requires that the first
+element of l_initfini is always this very map (“We are always the
+zeroth entry, and since we don't include ourselves in the
+dependency analysis start at 1.”).  Rather than fixing that
+assumption, this commit adds an implementation of the force_first
+argument to the new dependency sorting algorithm.  This also means
+that the directly dlopen'ed shared object is always initialized last,
+which is the least surprising behavior in the presence of cycles.
+
+Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
+(cherry picked from commit 1df71d32fe5f5905ffd5d100e5e9ca8ad6210891)
+---
+ NEWS                     |  1 +
+ elf/dl-sort-maps.c       | 32 +++++++++++++++++++++++---------
+ elf/dso-sort-tests-1.def |  7 +++++++
+ 3 files changed, 31 insertions(+), 9 deletions(-)
+
+diff --git a/NEWS b/NEWS
+index 03281e3ab4..5b4753416f 100644
+--- a/NEWS
++++ b/NEWS
+@@ -20,6 +20,7 @@ The following bugs are resolved with this release:
+   [28846] CMSG_NXTHDR may trigger -Wstrict-overflow warning
+   [29305] Conserve NSS buffer space during DNS packet parsing
+   [29415] nscd: Fix netlink cache invalidation if epoll is used
++  [28937] New DSO dependency sorter does not put new map first if in a cycle
+   [29446] _dlopen now ignores dl_caller argument in static mode
+   [29485] Linux: Terminate subprocess on late failure in tst-pidfd
+   [29490] alpha: New __brk_call implementation is broken
+diff --git a/elf/dl-sort-maps.c b/elf/dl-sort-maps.c
+index 5b550b1e94..3e2a6a584e 100644
+--- a/elf/dl-sort-maps.c
++++ b/elf/dl-sort-maps.c
+@@ -182,8 +182,9 @@ dfs_traversal (struct link_map ***rpo, struct link_map *map,
+ 
+ static void
+ _dl_sort_maps_dfs (struct link_map **maps, unsigned int nmaps,
+-		   bool force_first __attribute__ ((unused)), bool for_fini)
++		   bool force_first, bool for_fini)
+ {
++  struct link_map *first_map = maps[0];
+   for (int i = nmaps - 1; i >= 0; i--)
+     maps[i]->l_visited = 0;
+ 
+@@ -208,14 +209,6 @@ _dl_sort_maps_dfs (struct link_map **maps, unsigned int nmaps,
+      Adjusting the order so that maps[0] is last traversed naturally avoids
+      this problem.
+ 
+-     Further, the old "optimization" of skipping the main object at maps[0]
+-     from the call-site (i.e. _dl_sort_maps(maps+1,nmaps-1)) is in general
+-     no longer valid, since traversing along object dependency-links
+-     may "find" the main object even when it is not included in the initial
+-     order (e.g. a dlopen()'ed shared object can have circular dependencies
+-     linked back to itself). In such a case, traversing N-1 objects will
+-     create a N-object result, and raise problems.
+-
+      To summarize, just passing in the full list, and iterating from back
+      to front makes things much more straightforward.  */
+ 
+@@ -274,6 +267,27 @@ _dl_sort_maps_dfs (struct link_map **maps, unsigned int nmaps,
+     }
+ 
+   memcpy (maps, rpo, sizeof (struct link_map *) * nmaps);
++
++  /* Skipping the first object at maps[0] is not valid in general,
++     since traversing along object dependency-links may "find" that
++     first object even when it is not included in the initial order
++     (e.g., a dlopen'ed shared object can have circular dependencies
++     linked back to itself).  In such a case, traversing N-1 objects
++     will create a N-object result, and raise problems.  Instead,
++     force the object back into first place after sorting.  This naive
++     approach may introduce further dependency ordering violations
++     compared to rotating the cycle until the first map is again in
++     the first position, but as there is a cycle, at least one
++     violation is already present.  */
++  if (force_first && maps[0] != first_map)
++    {
++      int i;
++      for (i = 0; maps[i] != first_map; ++i)
++	;
++      assert (i < nmaps);
++      memmove (&maps[1], maps, i * sizeof (maps[0]));
++      maps[0] = first_map;
++    }
+ }
+ 
+ void
+diff --git a/elf/dso-sort-tests-1.def b/elf/dso-sort-tests-1.def
+index 5f7f18ef27..4bf9052db1 100644
+--- a/elf/dso-sort-tests-1.def
++++ b/elf/dso-sort-tests-1.def
+@@ -64,3 +64,10 @@ output: b>a>{}<a<b
+ tst-bz15311: {+a;+e;+f;+g;+d;%d;-d;-g;-f;-e;-a};a->b->c->d;d=>[ba];c=>a;b=>e=>a;c=>f=>b;d=>g=>c
+ output(glibc.rtld.dynamic_sort=1): {+a[d>c>b>a>];+e[e>];+f[f>];+g[g>];+d[];%d(b(e(a()))a()g(c(a()f(b(e(a()))))));-d[];-g[];-f[];-e[];-a[<a<c<d<g<f<b<e];}
+ output(glibc.rtld.dynamic_sort=2): {+a[d>c>b>a>];+e[e>];+f[f>];+g[g>];+d[];%d(b(e(a()))a()g(c(a()f(b(e(a()))))));-d[];-g[];-f[];-e[];-a[<g<f<a<b<c<d<e];}
++
++# Test that even in the presence of dependency loops involving dlopen'ed
++# object, that object is initialized last (and not unloaded prematurely).
++# Final destructor order is indeterminate due to the cycle.
++tst-bz28937: {+a;+b;-b;+c;%c};a->a1;a->a2;a2->a;b->b1;c->a1;c=>a1
++output(glibc.rtld.dynamic_sort=1): {+a[a2>a1>a>];+b[b1>b>];-b[<b<b1];+c[c>];%c(a1());}<a<a2<c<a1
++output(glibc.rtld.dynamic_sort=2): {+a[a2>a1>a>];+b[b1>b>];-b[<b<b1];+c[c>];%c(a1());}<a2<a<c<a1
+-- 
+2.38.1
+
+
+From 52c037f3574eb9062b111d78a4cbeb79681d07d3 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 20 Sep 2022 12:12:43 +0200
+Subject: [PATCH 43/72] gconv: Use 64-bit interfaces in gconv_parseconfdir (bug
+ 29583)
+
+It's possible that inode numbers are outside the 32-bit range.
+The existing code only handles the in-libc case correctly, and
+still uses the legacy interfaces when building iconv.
+
+Suggested-by: Helge Deller <deller@gmx.de>
+(cherry picked from commit f97905f24631097af325d6a231093071c3077a5f)
+---
+ NEWS                       |  1 +
+ iconv/gconv_parseconfdir.h | 16 ++++++++--------
+ 2 files changed, 9 insertions(+), 8 deletions(-)
+
+diff --git a/NEWS b/NEWS
+index 5b4753416f..eab882987b 100644
+--- a/NEWS
++++ b/NEWS
+@@ -26,6 +26,7 @@ The following bugs are resolved with this release:
+   [29490] alpha: New __brk_call implementation is broken
+   [29528] elf: Call __libc_early_init for reused namespaces
+   [29539] libc: LD_TRACE_LOADED_OBJECTS changed how vDSO library are
++  [29583] Use 64-bit interfaces in gconv_parseconfdir
+ \f
+ Version 2.36
+ 
+diff --git a/iconv/gconv_parseconfdir.h b/iconv/gconv_parseconfdir.h
+index debb96b322..b72933b526 100644
+--- a/iconv/gconv_parseconfdir.h
++++ b/iconv/gconv_parseconfdir.h
+@@ -29,14 +29,14 @@
+ # define isspace(__c) __isspace_l ((__c), _nl_C_locobj_ptr)
+ # define asprintf __asprintf
+ # define opendir __opendir
+-# define readdir __readdir
++# define readdir64 __readdir64
+ # define closedir __closedir
+ # define mempcpy __mempcpy
+-# define struct_stat struct __stat64_t64
+-# define lstat __lstat64_time64
++# define struct_stat64 struct __stat64_t64
++# define lstat64 __lstat64_time64
+ # define feof_unlocked __feof_unlocked
+ #else
+-# define struct_stat struct stat
++# define struct_stat64 struct stat64
+ #endif
+ 
+ /* Name of the file containing the module information in the directories
+@@ -148,8 +148,8 @@ gconv_parseconfdir (const char *prefix, const char *dir, size_t dir_len)
+   DIR *confdir = opendir (buf);
+   if (confdir != NULL)
+     {
+-      struct dirent *ent;
+-      while ((ent = readdir (confdir)) != NULL)
++      struct dirent64 *ent;
++      while ((ent = readdir64 (confdir)) != NULL)
+ 	{
+ 	  if (ent->d_type != DT_REG && ent->d_type != DT_UNKNOWN)
+ 	    continue;
+@@ -161,12 +161,12 @@ gconv_parseconfdir (const char *prefix, const char *dir, size_t dir_len)
+ 	      && strcmp (ent->d_name + len - strlen (suffix), suffix) == 0)
+ 	    {
+ 	      char *conf;
+-	      struct_stat st;
++	      struct_stat64 st;
+ 	      if (asprintf (&conf, "%s/%s", buf, ent->d_name) < 0)
+ 		continue;
+ 
+ 	      if (ent->d_type != DT_UNKNOWN
+-		  || (lstat (conf, &st) != -1 && S_ISREG (st.st_mode)))
++		  || (lstat64 (conf, &st) != -1 && S_ISREG (st.st_mode)))
+ 		found |= read_conf_file (conf, dir, dir_len);
+ 
+ 	      free (conf);
+-- 
+2.38.1
+
+
+From 2628500f5dff1dd99c49a09b418b3b1ea3a6b5d3 Mon Sep 17 00:00:00 2001
+From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Tue, 30 Aug 2022 10:33:15 -0300
+Subject: [PATCH 44/72] m68k: Enforce 4-byte alignment on internal locks (BZ
+ #29537)
+
+A new internal definition, __LIBC_LOCK_ALIGNMENT, is used to force
+the 4-byte alignment only for m68k, other architecture keep the
+natural alignment of the type used internally (and hppa does not
+require 16-byte alignment for kernel-assisted CAS).
+
+Reviewed-by: Florian Weimer <fweimer@redhat.com>
+(cherry picked from commit aeb4d2e9815d459e2640a31f5abb8ef803830107)
+---
+ NEWS                                          |  1 +
+ sysdeps/generic/libc-lock-arch.h              | 25 +++++++++++++++++++
+ sysdeps/nptl/libc-lock.h                      |  8 +++++-
+ sysdeps/nptl/libc-lockP.h                     |  3 ++-
+ sysdeps/unix/sysv/linux/m68k/libc-lock-arch.h | 25 +++++++++++++++++++
+ 5 files changed, 60 insertions(+), 2 deletions(-)
+ create mode 100644 sysdeps/generic/libc-lock-arch.h
+ create mode 100644 sysdeps/unix/sysv/linux/m68k/libc-lock-arch.h
+
+diff --git a/NEWS b/NEWS
+index eab882987b..1cc9a16bbf 100644
+--- a/NEWS
++++ b/NEWS
+@@ -25,6 +25,7 @@ The following bugs are resolved with this release:
+   [29485] Linux: Terminate subprocess on late failure in tst-pidfd
+   [29490] alpha: New __brk_call implementation is broken
+   [29528] elf: Call __libc_early_init for reused namespaces
++  [29537] libc: [2.34 regression]: Alignment issue on m68k when using
+   [29539] libc: LD_TRACE_LOADED_OBJECTS changed how vDSO library are
+   [29583] Use 64-bit interfaces in gconv_parseconfdir
+ \f
+diff --git a/sysdeps/generic/libc-lock-arch.h b/sysdeps/generic/libc-lock-arch.h
+new file mode 100644
+index 0000000000..4713b30a8a
+--- /dev/null
++++ b/sysdeps/generic/libc-lock-arch.h
+@@ -0,0 +1,25 @@
++/* Private libc-internal arch-specific definitions.  Generic version.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public License as
++   published by the Free Software Foundation; either version 2.1 of the
++   License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; see the file COPYING.LIB.  If
++   not, see <https://www.gnu.org/licenses/>.  */
++
++#ifndef _LIBC_LOCK_ARCH_H
++#define _LIBC_LOCK_ARCH_H
++
++/* The default definition uses the natural alignment from the lock type.  */
++#define __LIBC_LOCK_ALIGNMENT
++
++#endif
+diff --git a/sysdeps/nptl/libc-lock.h b/sysdeps/nptl/libc-lock.h
+index 5af476c48b..63b3f3d75c 100644
+--- a/sysdeps/nptl/libc-lock.h
++++ b/sysdeps/nptl/libc-lock.h
+@@ -22,6 +22,7 @@
+ #include <pthread.h>
+ #define __need_NULL
+ #include <stddef.h>
++#include <libc-lock-arch.h>
+ 
+ 
+ /* Mutex type.  */
+@@ -29,7 +30,12 @@
+ # if (!IS_IN (libc) && !IS_IN (libpthread)) || !defined _LIBC
+ typedef struct { pthread_mutex_t mutex; } __libc_lock_recursive_t;
+ # else
+-typedef struct { int lock; int cnt; void *owner; } __libc_lock_recursive_t;
++typedef struct
++{
++  int lock __LIBC_LOCK_ALIGNMENT;
++  int cnt;
++  void *owner;
++} __libc_lock_recursive_t;
+ # endif
+ #else
+ typedef struct __libc_lock_recursive_opaque__ __libc_lock_recursive_t;
+diff --git a/sysdeps/nptl/libc-lockP.h b/sysdeps/nptl/libc-lockP.h
+index d3a6837fd2..425f514c5c 100644
+--- a/sysdeps/nptl/libc-lockP.h
++++ b/sysdeps/nptl/libc-lockP.h
+@@ -32,9 +32,10 @@
+    ld.so might be used on old kernels with a different libc.so.  */
+ #include <lowlevellock.h>
+ #include <tls.h>
++#include <libc-lock-arch.h>
+ 
+ /* Mutex type.  */
+-typedef int __libc_lock_t;
++typedef int __libc_lock_t __LIBC_LOCK_ALIGNMENT;
+ typedef struct { pthread_mutex_t mutex; } __rtld_lock_recursive_t;
+ typedef pthread_rwlock_t __libc_rwlock_t;
+ 
+diff --git a/sysdeps/unix/sysv/linux/m68k/libc-lock-arch.h b/sysdeps/unix/sysv/linux/m68k/libc-lock-arch.h
+new file mode 100644
+index 0000000000..1844bbaf6f
+--- /dev/null
++++ b/sysdeps/unix/sysv/linux/m68k/libc-lock-arch.h
+@@ -0,0 +1,25 @@
++/* Private libc-internal arch-specific definitions.  m68k version.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public License as
++   published by the Free Software Foundation; either version 2.1 of the
++   License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; see the file COPYING.LIB.  If
++   not, see <https://www.gnu.org/licenses/>.  */
++
++#ifndef _LIBC_LOCK_ARCH_H
++#define _LIBC_LOCK_ARCH_H
++
++/* Linux enforces 4-bytes alignment on futex inputs.  */
++#define __LIBC_LOCK_ALIGNMENT __attribute__ ((__aligned__ (4)))
++
++#endif
+-- 
+2.38.1
+
+
+From 227c9035872fc9e9e2cf56ec8f89219747ee19bc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?J=C3=B6rg=20Sonnenberger?= <joerg@bec.de>
+Date: Mon, 26 Sep 2022 13:59:16 -0400
+Subject: [PATCH 45/72] get_nscd_addresses: Fix subscript typos [BZ #29605]
+
+Fix the subscript on air->family, which was accidentally set to COUNT
+when it should have remained as I.
+
+Resolves: BZ #29605
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit c9226c03da0276593a0918eaa9a14835183343e8)
+---
+ sysdeps/posix/getaddrinfo.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
+index bcff909b2f..5cda9bb072 100644
+--- a/sysdeps/posix/getaddrinfo.c
++++ b/sysdeps/posix/getaddrinfo.c
+@@ -540,11 +540,11 @@ get_nscd_addresses (const char *name, const struct addrinfo *req,
+ 	  at[count].addr[2] = htonl (0xffff);
+ 	}
+       else if (req->ai_family == AF_UNSPEC
+-	       || air->family[count] == req->ai_family)
++	       || air->family[i] == req->ai_family)
+ 	{
+-	  at[count].family = air->family[count];
++	  at[count].family = air->family[i];
+ 	  memcpy (at[count].addr, addrs, size);
+-	  if (air->family[count] == AF_INET6)
++	  if (air->family[i] == AF_INET6)
+ 	    res->got_ipv6 = true;
+ 	}
+       at[count].next = at + count + 1;
+-- 
+2.38.1
+
+
+From 76e05613ee28f4ac4a0ab97effc32e0e78e37a56 Mon Sep 17 00:00:00 2001
+From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Thu, 29 Sep 2022 16:15:20 -0300
+Subject: [PATCH 46/72] stdlib: Fix __getrandom_nocancel type and arc4random
+ usage (BZ #29638)
+
+Using an unsigned type prevents the fallback to be used if kernel
+does not support getrandom syscall.
+
+Checked on x86_64-linux-gnu.
+
+Reviewed-by: Wilco Dijkstra  <Wilco.Dijkstra@arm.com>
+(cherry picked from commit 13db9ee2cb3b77e25f852be7d6952882e1be6f00)
+---
+ NEWS                                 | 1 +
+ stdlib/arc4random.c                  | 2 +-
+ sysdeps/unix/sysv/linux/not-cancel.h | 2 +-
+ 3 files changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/NEWS b/NEWS
+index 1cc9a16bbf..91bcfeb7a6 100644
+--- a/NEWS
++++ b/NEWS
+@@ -28,6 +28,7 @@ The following bugs are resolved with this release:
+   [29537] libc: [2.34 regression]: Alignment issue on m68k when using
+   [29539] libc: LD_TRACE_LOADED_OBJECTS changed how vDSO library are
+   [29583] Use 64-bit interfaces in gconv_parseconfdir
++  [29638] libc: stdlib: arc4random fallback is never used
+ \f
+ Version 2.36
+ 
+diff --git a/stdlib/arc4random.c b/stdlib/arc4random.c
+index e417ef624d..960a38f295 100644
+--- a/stdlib/arc4random.c
++++ b/stdlib/arc4random.c
+@@ -34,7 +34,7 @@ void
+ __arc4random_buf (void *p, size_t n)
+ {
+   static int seen_initialized;
+-  size_t l;
++  ssize_t l;
+   int fd;
+ 
+   if (n == 0)
+diff --git a/sysdeps/unix/sysv/linux/not-cancel.h b/sysdeps/unix/sysv/linux/not-cancel.h
+index a263d294b1..cf35c8bfc9 100644
+--- a/sysdeps/unix/sysv/linux/not-cancel.h
++++ b/sysdeps/unix/sysv/linux/not-cancel.h
+@@ -68,7 +68,7 @@ __writev_nocancel_nostatus (int fd, const struct iovec *iov, int iovcnt)
+   INTERNAL_SYSCALL_CALL (writev, fd, iov, iovcnt);
+ }
+ 
+-static inline int
++static inline ssize_t
+ __getrandom_nocancel (void *buf, size_t buflen, unsigned int flags)
+ {
+   return INLINE_SYSCALL_CALL (getrandom, buf, buflen, flags);
+-- 
+2.38.1
+
+
+From d1d8379bff34f02f86f82db2cef5bf66746d3560 Mon Sep 17 00:00:00 2001
+From: John David Anglin <danglin@gcc.gnu.org>
+Date: Sat, 1 Oct 2022 19:49:25 +0000
+Subject: [PATCH 47/72] hppa: Fix initialization of dp register [BZ 29635]
+
+After upgrading glibc to Debian 2.35-1, gdb faulted on
+startup and dropped core in a function call in the main
+application.  This was caused by not initializing the
+global dp register for the main application early enough.
+
+Restore the code to initialize dp in _dl_start_user.
+It was removed when code was added to initialize dp in
+elf_machine_runtime_setup.
+
+Signed-off-by: John David Anglin <dave.anglin@bell.net>
+---
+ sysdeps/hppa/dl-machine.h | 24 +++++++++++++++++++-----
+ 1 file changed, 19 insertions(+), 5 deletions(-)
+
+diff --git a/sysdeps/hppa/dl-machine.h b/sysdeps/hppa/dl-machine.h
+index c865713be1..1d51948566 100644
+--- a/sysdeps/hppa/dl-machine.h
++++ b/sysdeps/hppa/dl-machine.h
+@@ -347,6 +347,16 @@ elf_machine_runtime_setup (struct link_map *l, struct r_scope_elem *scope[],
+    its return value is the user program's entry point.  */
+ 
+ #define RTLD_START \
++/* Set up dp for any non-PIC lib constructors that may be called.  */	\
++static struct link_map * __attribute__((used))				\
++set_dp (struct link_map *map)						\
++{									\
++  register Elf32_Addr dp asm ("%r27");					\
++  dp = D_PTR (map, l_info[DT_PLTGOT]);					\
++  asm volatile ("" : : "r" (dp));					\
++  return map;								\
++}									\
++									\
+ asm (									\
+ "	.text\n"							\
+ "	.globl _start\n"						\
+@@ -426,6 +436,13 @@ asm (									\
+ 	   direct loader invocation.  Thus, argc and argv must be	\
+ 	   reloaded from from _dl_argc and _dl_argv.  */		\
+ 									\
++	/* Load main_map from _rtld_local and setup dp. */		\
++"	addil	LT'_rtld_local,%r19\n"					\
++"	ldw	RT'_rtld_local(%r1),%r26\n"				\
++"	bl	set_dp, %r2\n"						\
++"	ldw	0(%r26),%r26\n"						\
++"	copy	%ret0,%r26\n"						\
++									\
+ 	/* Load argc from _dl_argc.  */					\
+ "	addil	LT'_dl_argc,%r19\n"					\
+ "	ldw	RT'_dl_argc(%r1),%r20\n"				\
+@@ -438,13 +455,10 @@ asm (									\
+ "	ldw	0(%r20),%r24\n"						\
+ "	stw	%r24,-44(%sp)\n"					\
+ 									\
+-	/* Call _dl_init(main_map, argc, argv, envp). */		\
+-"	addil	LT'_rtld_local,%r19\n"					\
+-"	ldw	RT'_rtld_local(%r1),%r26\n"				\
+-"	ldw	0(%r26),%r26\n"						\
+-									\
+ 	/* envp = argv + argc + 1 */					\
+ "	sh2add	%r25,%r24,%r23\n"					\
++									\
++	/* Call _dl_init(main_map, argc, argv, envp). */		\
+ "	bl	_dl_init,%r2\n"						\
+ "	ldo	4(%r23),%r23\n"	/* delay slot */			\
+ 									\
+-- 
+2.38.1
+
+
+From cdc496eb55e30f8f2461bedb0a7381c0a7a3d3ae Mon Sep 17 00:00:00 2001
+From: John David Anglin <danglin@gcc.gnu.org>
+Date: Tue, 20 Sep 2022 20:14:14 +0000
+Subject: [PATCH 48/72] hppa: undef __ASSUME_SET_ROBUST_LIST
+
+QEMU does not support support set_robust_list. Thus, we need
+to enable detection of set_robust_list system call.
+
+Signed-off-by: John David Anglin <dave.anglin@bell.net>
+---
+ sysdeps/unix/sysv/linux/hppa/kernel-features.h | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/sysdeps/unix/sysv/linux/hppa/kernel-features.h b/sysdeps/unix/sysv/linux/hppa/kernel-features.h
+index 0cd21ef0fa..079612e4aa 100644
+--- a/sysdeps/unix/sysv/linux/hppa/kernel-features.h
++++ b/sysdeps/unix/sysv/linux/hppa/kernel-features.h
+@@ -30,3 +30,6 @@
+ 
+ #undef __ASSUME_CLONE_DEFAULT
+ #define __ASSUME_CLONE_BACKWARDS 1
++
++/* QEMU does not support set_robust_list.  */
++#undef __ASSUME_SET_ROBUST_LIST
+-- 
+2.38.1
+
+
+From 18bec23cbb4d530a2a8ce95353770661fabcd55f Mon Sep 17 00:00:00 2001
+From: Aurelien Jarno <aurelien@aurel32.net>
+Date: Mon, 3 Oct 2022 23:46:11 +0200
+Subject: [PATCH 49/72] x86: include BMI1 and BMI2 in x86-64-v3 level
+
+The "System V Application Binary Interface AMD64 Architecture Processor
+Supplement" mandates the BMI1 and BMI2 CPU features for the x86-64-v3
+level.
+
+Reviewed-by: Noah Goldstein  <goldstein.w.n@gmail.com>
+(cherry picked from commit b80f16adbd979831bf25ea491e1261e81885c2b6)
+---
+ sysdeps/x86/get-isa-level.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/sysdeps/x86/get-isa-level.h b/sysdeps/x86/get-isa-level.h
+index 1ade78ab73..5b4dd5f062 100644
+--- a/sysdeps/x86/get-isa-level.h
++++ b/sysdeps/x86/get-isa-level.h
+@@ -47,6 +47,8 @@ get_isa_level (const struct cpu_features *cpu_features)
+ 	  isa_level |= GNU_PROPERTY_X86_ISA_1_V2;
+ 	  if (CPU_FEATURE_USABLE_P (cpu_features, AVX)
+ 	      && CPU_FEATURE_USABLE_P (cpu_features, AVX2)
++	      && CPU_FEATURE_USABLE_P (cpu_features, BMI1)
++	      && CPU_FEATURE_USABLE_P (cpu_features, BMI2)
+ 	      && CPU_FEATURE_USABLE_P (cpu_features, F16C)
+ 	      && CPU_FEATURE_USABLE_P (cpu_features, FMA)
+ 	      && CPU_FEATURE_USABLE_P (cpu_features, LZCNT)
+-- 
+2.38.1
+
+
+From 46479e5d10ed87825aa277da158d6a687974518b Mon Sep 17 00:00:00 2001
+From: Aurelien Jarno <aurelien@aurel32.net>
+Date: Mon, 3 Oct 2022 23:46:11 +0200
+Subject: [PATCH 50/72] x86-64: Require BMI2 for AVX2 str(n)casecmp
+ implementations
+
+The AVX2 str(n)casecmp implementations use the 'bzhi' instruction, which
+belongs to the BMI2 CPU feature.
+
+NB: It also uses the 'tzcnt' BMI1 instruction, but it is executed as BSF
+as BSF if the CPU doesn't support TZCNT, and produces the same result
+for non-zero input.
+
+Partially fixes: b77b06e0e296 ("x86: Optimize strcmp-avx2.S")
+Partially resolves: BZ #29611
+
+Reviewed-by: Noah Goldstein  <goldstein.w.n@gmail.com>
+(cherry picked from commit 10f79d3670b036925da63dc532b122d27ce65ff8)
+---
+ sysdeps/x86_64/multiarch/ifunc-impl-list.c  | 28 +++++++++++++++------
+ sysdeps/x86_64/multiarch/ifunc-strcasecmp.h |  1 +
+ 2 files changed, 21 insertions(+), 8 deletions(-)
+
+diff --git a/sysdeps/x86_64/multiarch/ifunc-impl-list.c b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
+index a71444eccb..d208fae4bf 100644
+--- a/sysdeps/x86_64/multiarch/ifunc-impl-list.c
++++ b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
+@@ -448,13 +448,16 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
+   IFUNC_IMPL (i, name, strcasecmp,
+ 	      X86_IFUNC_IMPL_ADD_V4 (array, i, strcasecmp,
+ 				     (CPU_FEATURE_USABLE (AVX512VL)
+-				      && CPU_FEATURE_USABLE (AVX512BW)),
++				      && CPU_FEATURE_USABLE (AVX512BW)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __strcasecmp_evex)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, strcasecmp,
+-				     CPU_FEATURE_USABLE (AVX2),
++				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __strcasecmp_avx2)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, strcasecmp,
+ 				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)
+ 				      && CPU_FEATURE_USABLE (RTM)),
+ 				     __strcasecmp_avx2_rtm)
+ 	      X86_IFUNC_IMPL_ADD_V2 (array, i, strcasecmp,
+@@ -470,13 +473,16 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
+   IFUNC_IMPL (i, name, strcasecmp_l,
+ 	      X86_IFUNC_IMPL_ADD_V4 (array, i, strcasecmp,
+ 				     (CPU_FEATURE_USABLE (AVX512VL)
+-				      && CPU_FEATURE_USABLE (AVX512BW)),
++				      && CPU_FEATURE_USABLE (AVX512BW)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __strcasecmp_l_evex)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, strcasecmp,
+-				     CPU_FEATURE_USABLE (AVX2),
++				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __strcasecmp_l_avx2)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, strcasecmp,
+ 				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)
+ 				      && CPU_FEATURE_USABLE (RTM)),
+ 				     __strcasecmp_l_avx2_rtm)
+ 	      X86_IFUNC_IMPL_ADD_V2 (array, i, strcasecmp_l,
+@@ -638,13 +644,16 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
+   IFUNC_IMPL (i, name, strncasecmp,
+ 	      X86_IFUNC_IMPL_ADD_V4 (array, i, strncasecmp,
+ 				     (CPU_FEATURE_USABLE (AVX512VL)
+-				      && CPU_FEATURE_USABLE (AVX512BW)),
++				      && CPU_FEATURE_USABLE (AVX512BW)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __strncasecmp_evex)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, strncasecmp,
+-				     CPU_FEATURE_USABLE (AVX2),
++				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __strncasecmp_avx2)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, strncasecmp,
+ 				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)
+ 				      && CPU_FEATURE_USABLE (RTM)),
+ 				     __strncasecmp_avx2_rtm)
+ 	      X86_IFUNC_IMPL_ADD_V2 (array, i, strncasecmp,
+@@ -660,13 +669,16 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
+   IFUNC_IMPL (i, name, strncasecmp_l,
+ 	      X86_IFUNC_IMPL_ADD_V4 (array, i, strncasecmp,
+ 				     (CPU_FEATURE_USABLE (AVX512VL)
+-				      && CPU_FEATURE_USABLE (AVX512BW)),
++				      & CPU_FEATURE_USABLE (AVX512BW)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __strncasecmp_l_evex)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, strncasecmp,
+-				     CPU_FEATURE_USABLE (AVX2),
++				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __strncasecmp_l_avx2)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, strncasecmp,
+ 				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)
+ 				      && CPU_FEATURE_USABLE (RTM)),
+ 				     __strncasecmp_l_avx2_rtm)
+ 	      X86_IFUNC_IMPL_ADD_V2 (array, i, strncasecmp_l,
+diff --git a/sysdeps/x86_64/multiarch/ifunc-strcasecmp.h b/sysdeps/x86_64/multiarch/ifunc-strcasecmp.h
+index 68646ef199..7622af259c 100644
+--- a/sysdeps/x86_64/multiarch/ifunc-strcasecmp.h
++++ b/sysdeps/x86_64/multiarch/ifunc-strcasecmp.h
+@@ -34,6 +34,7 @@ IFUNC_SELECTOR (void)
+   const struct cpu_features *cpu_features = __get_cpu_features ();
+ 
+   if (X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, AVX2)
++      && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, BMI2)
+       && X86_ISA_CPU_FEATURES_ARCH_P (cpu_features,
+ 				      AVX_Fast_Unaligned_Load, ))
+     {
+-- 
+2.38.1
+
+
+From 7afbd1e56acb721031bffd876f275dcb1af7e530 Mon Sep 17 00:00:00 2001
+From: Aurelien Jarno <aurelien@aurel32.net>
+Date: Mon, 3 Oct 2022 23:46:11 +0200
+Subject: [PATCH 51/72] x86-64: Require BMI2 for AVX2 strcmp implementation
+
+The AVX2 strcmp implementation uses the 'bzhi' instruction, which
+belongs to the BMI2 CPU feature.
+
+NB: It also uses the 'tzcnt' BMI1 instruction, but it is executed as BSF
+as BSF if the CPU doesn't support TZCNT, and produces the same result
+for non-zero input.
+
+Partially fixes: b77b06e0e296 ("x86: Optimize strcmp-avx2.S")
+Partially resolves: BZ #29611
+
+Reviewed-by: Noah Goldstein  <goldstein.w.n@gmail.com>
+(cherry picked from commit 4d64c6445735e9b34e2ac8e369312cbfc2f88e17)
+---
+ sysdeps/x86_64/multiarch/ifunc-impl-list.c | 4 +++-
+ sysdeps/x86_64/multiarch/strcmp.c          | 4 ++--
+ 2 files changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/sysdeps/x86_64/multiarch/ifunc-impl-list.c b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
+index d208fae4bf..a42b0a4620 100644
+--- a/sysdeps/x86_64/multiarch/ifunc-impl-list.c
++++ b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
+@@ -591,10 +591,12 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
+ 				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __strcmp_evex)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, strcmp,
+-				     CPU_FEATURE_USABLE (AVX2),
++				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __strcmp_avx2)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, strcmp,
+ 				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)
+ 				      && CPU_FEATURE_USABLE (RTM)),
+ 				     __strcmp_avx2_rtm)
+ 	      X86_IFUNC_IMPL_ADD_V2 (array, i, strcmp,
+diff --git a/sysdeps/x86_64/multiarch/strcmp.c b/sysdeps/x86_64/multiarch/strcmp.c
+index fdd5afe3af..9d6c9f66ba 100644
+--- a/sysdeps/x86_64/multiarch/strcmp.c
++++ b/sysdeps/x86_64/multiarch/strcmp.c
+@@ -45,12 +45,12 @@ IFUNC_SELECTOR (void)
+   const struct cpu_features *cpu_features = __get_cpu_features ();
+ 
+   if (X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, AVX2)
++      && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, BMI2)
+       && X86_ISA_CPU_FEATURES_ARCH_P (cpu_features,
+ 				      AVX_Fast_Unaligned_Load, ))
+     {
+       if (X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, AVX512VL)
+-	  && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, AVX512BW)
+-	  && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, BMI2))
++	  && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, AVX512BW))
+ 	return OPTIMIZE (evex);
+ 
+       if (CPU_FEATURE_USABLE_P (cpu_features, RTM))
+-- 
+2.38.1
+
+
+From 29c577e0f54fe6e70ceacb3659179781c5569903 Mon Sep 17 00:00:00 2001
+From: Aurelien Jarno <aurelien@aurel32.net>
+Date: Mon, 3 Oct 2022 23:46:11 +0200
+Subject: [PATCH 52/72] x86-64: Require BMI2 for AVX2 strncmp implementation
+
+The AVX2 strncmp implementations uses the 'bzhi' instruction, which
+belongs to the BMI2 CPU feature.
+
+NB: It also uses the 'tzcnt' BMI1 instruction, but it is executed as BSF
+as BSF if the CPU doesn't support TZCNT, and produces the same result
+for non-zero input.
+
+Partially fixes: b77b06e0e296 ("x86: Optimize strcmp-avx2.S")
+Partially resolves: BZ #29611
+
+Reviewed-by: Noah Goldstein  <goldstein.w.n@gmail.com>
+(cherry picked from commit fc7de1d9b99ae1676bc626ddca422d7abee0eb48)
+---
+ sysdeps/x86_64/multiarch/ifunc-impl-list.c | 7 +++++--
+ sysdeps/x86_64/multiarch/strncmp.c         | 4 ++--
+ 2 files changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/sysdeps/x86_64/multiarch/ifunc-impl-list.c b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
+index a42b0a4620..aebef3daaf 100644
+--- a/sysdeps/x86_64/multiarch/ifunc-impl-list.c
++++ b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
+@@ -1176,13 +1176,16 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
+   IFUNC_IMPL (i, name, strncmp,
+ 	      X86_IFUNC_IMPL_ADD_V4 (array, i, strncmp,
+ 				     (CPU_FEATURE_USABLE (AVX512VL)
+-				      && CPU_FEATURE_USABLE (AVX512BW)),
++				      && CPU_FEATURE_USABLE (AVX512BW)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __strncmp_evex)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, strncmp,
+-				     CPU_FEATURE_USABLE (AVX2),
++				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __strncmp_avx2)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, strncmp,
+ 				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)
+ 				      && CPU_FEATURE_USABLE (RTM)),
+ 				     __strncmp_avx2_rtm)
+ 	      X86_IFUNC_IMPL_ADD_V2 (array, i, strncmp,
+diff --git a/sysdeps/x86_64/multiarch/strncmp.c b/sysdeps/x86_64/multiarch/strncmp.c
+index 4ebe4bde30..c4f8b6bbb5 100644
+--- a/sysdeps/x86_64/multiarch/strncmp.c
++++ b/sysdeps/x86_64/multiarch/strncmp.c
+@@ -41,12 +41,12 @@ IFUNC_SELECTOR (void)
+   const struct cpu_features *cpu_features = __get_cpu_features ();
+ 
+   if (X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, AVX2)
++      && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, BMI2)
+       && X86_ISA_CPU_FEATURES_ARCH_P (cpu_features,
+ 				      AVX_Fast_Unaligned_Load, ))
+     {
+       if (X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, AVX512VL)
+-	  && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, AVX512BW)
+-	  && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, BMI2))
++	  && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, AVX512BW))
+ 	return OPTIMIZE (evex);
+ 
+       if (CPU_FEATURE_USABLE_P (cpu_features, RTM))
+-- 
+2.38.1
+
+
+From d8bf4388df679fa5a3ae7889a649e573e3124530 Mon Sep 17 00:00:00 2001
+From: Aurelien Jarno <aurelien@aurel32.net>
+Date: Mon, 3 Oct 2022 23:46:11 +0200
+Subject: [PATCH 53/72] x86-64: Require BMI2 for AVX2 wcs(n)cmp implementations
+
+The AVX2 wcs(n)cmp implementations use the 'bzhi' instruction, which
+belongs to the BMI2 CPU feature.
+
+NB: It also uses the 'tzcnt' BMI1 instruction, but it is executed as BSF
+as BSF if the CPU doesn't support TZCNT, and produces the same result
+for non-zero input.
+
+Partially fixes: b77b06e0e296 ("x86: Optimize strcmp-avx2.S")
+Partially resolves: BZ #29611
+
+Reviewed-by: Noah Goldstein  <goldstein.w.n@gmail.com>
+(cherry picked from commit f31a5a884ed84bd37032729d4d1eb9d06c9f3c29)
+---
+ sysdeps/x86_64/multiarch/ifunc-impl-list.c | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/sysdeps/x86_64/multiarch/ifunc-impl-list.c b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
+index aebef3daaf..fec8790c11 100644
+--- a/sysdeps/x86_64/multiarch/ifunc-impl-list.c
++++ b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
+@@ -810,10 +810,12 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
+ 				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __wcscmp_evex)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, wcscmp,
+-				     CPU_FEATURE_USABLE (AVX2),
++				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __wcscmp_avx2)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, wcscmp,
+ 				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)
+ 				      && CPU_FEATURE_USABLE (RTM)),
+ 				     __wcscmp_avx2_rtm)
+ 	      /* ISA V2 wrapper for SSE2 implementation because the SSE2
+@@ -830,10 +832,12 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
+ 				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __wcsncmp_evex)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, wcsncmp,
+-				     CPU_FEATURE_USABLE (AVX2),
++				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __wcsncmp_avx2)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, wcsncmp,
+ 				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)
+ 				      && CPU_FEATURE_USABLE (RTM)),
+ 				     __wcsncmp_avx2_rtm)
+ 	      /* ISA V2 wrapper for GENERIC implementation because the
+-- 
+2.38.1
+
+
+From d9196d4f3fa9997388655813ddd236426a16dd92 Mon Sep 17 00:00:00 2001
+From: Aurelien Jarno <aurelien@aurel32.net>
+Date: Mon, 3 Oct 2022 23:46:11 +0200
+Subject: [PATCH 54/72] x86-64: Require BMI2 for AVX2 (raw|w)memchr
+ implementations
+
+The AVX2 memchr, rawmemchr and wmemchr implementations use the 'bzhi'
+and 'sarx' instructions, which belongs to the BMI2 CPU feature.
+
+Fixes: acfd088a1963 ("x86: Optimize memchr-avx2.S")
+Partially resolves: BZ #29611
+
+Reviewed-by: Noah Goldstein  <goldstein.w.n@gmail.com>
+(cherry picked from commit e3e7fab7fe5186d18ca2046d99ba321c27db30ad)
+---
+ sysdeps/x86_64/multiarch/ifunc-impl-list.c | 12 +++++++++---
+ 1 file changed, 9 insertions(+), 3 deletions(-)
+
+diff --git a/sysdeps/x86_64/multiarch/ifunc-impl-list.c b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
+index fec8790c11..7c84963d92 100644
+--- a/sysdeps/x86_64/multiarch/ifunc-impl-list.c
++++ b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
+@@ -69,10 +69,12 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
+ 				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __memchr_evex_rtm)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, memchr,
+-				     CPU_FEATURE_USABLE (AVX2),
++				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __memchr_avx2)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, memchr,
+ 				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)
+ 				      && CPU_FEATURE_USABLE (RTM)),
+ 				     __memchr_avx2_rtm)
+ 	      /* ISA V2 wrapper for SSE2 implementation because the SSE2
+@@ -335,10 +337,12 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
+ 				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __rawmemchr_evex_rtm)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, rawmemchr,
+-				     CPU_FEATURE_USABLE (AVX2),
++				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __rawmemchr_avx2)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, rawmemchr,
+ 				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)
+ 				      && CPU_FEATURE_USABLE (RTM)),
+ 				     __rawmemchr_avx2_rtm)
+ 	      /* ISA V2 wrapper for SSE2 implementation because the SSE2
+@@ -927,10 +931,12 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
+ 				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __wmemchr_evex_rtm)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, wmemchr,
+-				     CPU_FEATURE_USABLE (AVX2),
++				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __wmemchr_avx2)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, wmemchr,
+ 				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)
+ 				      && CPU_FEATURE_USABLE (RTM)),
+ 				     __wmemchr_avx2_rtm)
+ 	      /* ISA V2 wrapper for SSE2 implementation because the SSE2
+-- 
+2.38.1
+
+
+From 923c3f3c373f499e62160e00831dda576443317b Mon Sep 17 00:00:00 2001
+From: Aurelien Jarno <aurelien@aurel32.net>
+Date: Mon, 3 Oct 2022 23:46:11 +0200
+Subject: [PATCH 55/72] x86-64: Require BMI2 and LZCNT for AVX2 memrchr
+ implementation
+
+The AVX2 memrchr implementation uses the 'shlxl' instruction, which
+belongs to the BMI2 CPU feature and uses the 'lzcnt' instruction, which
+belongs to the LZCNT CPU feature.
+
+Fixes: af5306a735eb ("x86: Optimize memrchr-avx2.S")
+Partially resolves: BZ #29611
+
+Reviewed-by: Noah Goldstein  <goldstein.w.n@gmail.com>
+(cherry picked from commit 3c0c78afabfed4b6fc161c159e628fbf14ff370b)
+---
+ sysdeps/x86/isa-level.h                    |  1 +
+ sysdeps/x86_64/multiarch/ifunc-avx2.h      |  1 +
+ sysdeps/x86_64/multiarch/ifunc-impl-list.c | 10 ++++++++--
+ 3 files changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/sysdeps/x86/isa-level.h b/sysdeps/x86/isa-level.h
+index 3c4480aba7..bbb90f5c5e 100644
+--- a/sysdeps/x86/isa-level.h
++++ b/sysdeps/x86/isa-level.h
+@@ -80,6 +80,7 @@
+ #define AVX_X86_ISA_LEVEL 3
+ #define AVX2_X86_ISA_LEVEL 3
+ #define BMI2_X86_ISA_LEVEL 3
++#define LZCNT_X86_ISA_LEVEL 3
+ #define MOVBE_X86_ISA_LEVEL 3
+ 
+ /* ISA level >= 2 guaranteed includes.  */
+diff --git a/sysdeps/x86_64/multiarch/ifunc-avx2.h b/sysdeps/x86_64/multiarch/ifunc-avx2.h
+index a57a9952f3..f1741083fd 100644
+--- a/sysdeps/x86_64/multiarch/ifunc-avx2.h
++++ b/sysdeps/x86_64/multiarch/ifunc-avx2.h
+@@ -37,6 +37,7 @@ IFUNC_SELECTOR (void)
+ 
+   if (X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, AVX2)
+       && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, BMI2)
++      && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, LZCNT)
+       && X86_ISA_CPU_FEATURES_ARCH_P (cpu_features,
+ 				      AVX_Fast_Unaligned_Load, ))
+     {
+diff --git a/sysdeps/x86_64/multiarch/ifunc-impl-list.c b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
+index 7c84963d92..ec1c5b55fb 100644
+--- a/sysdeps/x86_64/multiarch/ifunc-impl-list.c
++++ b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
+@@ -209,13 +209,19 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
+   IFUNC_IMPL (i, name, memrchr,
+ 	      X86_IFUNC_IMPL_ADD_V4 (array, i, memrchr,
+ 				     (CPU_FEATURE_USABLE (AVX512VL)
+-				      && CPU_FEATURE_USABLE (AVX512BW)),
++				      && CPU_FEATURE_USABLE (AVX512BW)
++				      && CPU_FEATURE_USABLE (BMI2)
++				      && CPU_FEATURE_USABLE (LZCNT)),
+ 				     __memrchr_evex)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, memrchr,
+-				     CPU_FEATURE_USABLE (AVX2),
++				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)
++				      && CPU_FEATURE_USABLE (LZCNT)),
+ 				     __memrchr_avx2)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, memrchr,
+ 				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)
++				      && CPU_FEATURE_USABLE (LZCNT)
+ 				      && CPU_FEATURE_USABLE (RTM)),
+ 				     __memrchr_avx2_rtm)
+ 	      /* ISA V2 wrapper for SSE2 implementation because the SSE2
+-- 
+2.38.1
+
+
+From 2d8ef784bd6a784496a6fd460de6b6f57c70a501 Mon Sep 17 00:00:00 2001
+From: Aurelien Jarno <aurelien@aurel32.net>
+Date: Mon, 3 Oct 2022 23:46:11 +0200
+Subject: [PATCH 56/72] x86-64: Require BMI1/BMI2 for AVX2 strrchr and wcsrchr
+ implementations
+
+The AVX2 strrchr and wcsrchr implementation uses the 'blsmsk'
+instruction which belongs to the BMI1 CPU feature and the 'shrx'
+instruction, which belongs to the BMI2 CPU feature.
+
+Fixes: df7e295d18ff ("x86: Optimize {str|wcs}rchr-avx2")
+Partially resolves: BZ #29611
+
+Reviewed-by: Noah Goldstein  <goldstein.w.n@gmail.com>
+(cherry picked from commit 7e8283170c5d6805b609a040801d819e362a6292)
+---
+ sysdeps/x86/isa-level.h                    |  1 +
+ sysdeps/x86_64/multiarch/ifunc-avx2.h      |  1 +
+ sysdeps/x86_64/multiarch/ifunc-impl-list.c | 17 ++++++++++++++---
+ 3 files changed, 16 insertions(+), 3 deletions(-)
+
+diff --git a/sysdeps/x86/isa-level.h b/sysdeps/x86/isa-level.h
+index bbb90f5c5e..06f6c9663e 100644
+--- a/sysdeps/x86/isa-level.h
++++ b/sysdeps/x86/isa-level.h
+@@ -79,6 +79,7 @@
+ /* ISA level >= 3 guaranteed includes.  */
+ #define AVX_X86_ISA_LEVEL 3
+ #define AVX2_X86_ISA_LEVEL 3
++#define BMI1_X86_ISA_LEVEL 3
+ #define BMI2_X86_ISA_LEVEL 3
+ #define LZCNT_X86_ISA_LEVEL 3
+ #define MOVBE_X86_ISA_LEVEL 3
+diff --git a/sysdeps/x86_64/multiarch/ifunc-avx2.h b/sysdeps/x86_64/multiarch/ifunc-avx2.h
+index f1741083fd..f2f5e8a211 100644
+--- a/sysdeps/x86_64/multiarch/ifunc-avx2.h
++++ b/sysdeps/x86_64/multiarch/ifunc-avx2.h
+@@ -36,6 +36,7 @@ IFUNC_SELECTOR (void)
+   const struct cpu_features *cpu_features = __get_cpu_features ();
+ 
+   if (X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, AVX2)
++      && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, BMI1)
+       && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, BMI2)
+       && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, LZCNT)
+       && X86_ISA_CPU_FEATURES_ARCH_P (cpu_features,
+diff --git a/sysdeps/x86_64/multiarch/ifunc-impl-list.c b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
+index ec1c5b55fb..00a91123d3 100644
+--- a/sysdeps/x86_64/multiarch/ifunc-impl-list.c
++++ b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
+@@ -578,13 +578,19 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
+   IFUNC_IMPL (i, name, strrchr,
+ 	      X86_IFUNC_IMPL_ADD_V4 (array, i, strrchr,
+ 				     (CPU_FEATURE_USABLE (AVX512VL)
+-				      && CPU_FEATURE_USABLE (AVX512BW)),
++				      && CPU_FEATURE_USABLE (AVX512BW)
++				      && CPU_FEATURE_USABLE (BMI1)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __strrchr_evex)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, strrchr,
+-				     CPU_FEATURE_USABLE (AVX2),
++				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI1)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __strrchr_avx2)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, strrchr,
+ 				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI1)
++				      && CPU_FEATURE_USABLE (BMI2)
+ 				      && CPU_FEATURE_USABLE (RTM)),
+ 				     __strrchr_avx2_rtm)
+ 	      /* ISA V2 wrapper for SSE2 implementation because the SSE2
+@@ -797,13 +803,18 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
+ 	      X86_IFUNC_IMPL_ADD_V4 (array, i, wcsrchr,
+ 				     (CPU_FEATURE_USABLE (AVX512VL)
+ 				      && CPU_FEATURE_USABLE (AVX512BW)
++				      && CPU_FEATURE_USABLE (BMI1)
+ 				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __wcsrchr_evex)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, wcsrchr,
+-				     CPU_FEATURE_USABLE (AVX2),
++				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI1)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __wcsrchr_avx2)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, wcsrchr,
+ 				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI1)
++				      && CPU_FEATURE_USABLE (BMI2)
+ 				      && CPU_FEATURE_USABLE (RTM)),
+ 				     __wcsrchr_avx2_rtm)
+ 	      /* ISA V2 wrapper for SSE2 implementation because the SSE2
+-- 
+2.38.1
+
+
+From 2bd815d8347851212b9a91dbdca8053f4dbdac87 Mon Sep 17 00:00:00 2001
+From: Siddhesh Poyarekar <siddhesh@sourceware.org>
+Date: Tue, 4 Oct 2022 18:43:50 -0400
+Subject: [PATCH 57/72] nscd: Drop local address tuple variable [BZ #29607]
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+When a request needs to be resent (e.g. due to insufficient buffer
+space), the references to subsequent tuples in the local variable are
+stale and should not be used.  This used to work by accident before, but
+since 1d495912a it no longer does.  Instead of trying to reset it, just
+let gethostbyname4_r write into TUMPBUF6 for us, thus maintaining a
+consistent state at all times.  This is now consistent with what is done
+in gaih_inet for getaddrinfo.
+
+Resolves: BZ #29607
+Reported-by: Holger Hoffstätte <holger@applied-asynchrony.com>
+Tested-by: Holger Hoffstätte <holger@applied-asynchrony.com>
+Reviewed-by: Carlos O'Donell <carlos@redhat.com>
+(cherry picked from commit 6e33e5c4b73cea7b8aa3de0947123db16200fb65)
+---
+ NEWS           | 2 ++
+ nscd/aicache.c | 5 ++---
+ 2 files changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/NEWS b/NEWS
+index 91bcfeb7a6..63e26d7062 100644
+--- a/NEWS
++++ b/NEWS
+@@ -28,6 +28,8 @@ The following bugs are resolved with this release:
+   [29537] libc: [2.34 regression]: Alignment issue on m68k when using
+   [29539] libc: LD_TRACE_LOADED_OBJECTS changed how vDSO library are
+   [29583] Use 64-bit interfaces in gconv_parseconfdir
++  [29607] nscd repeatably crashes calling __strlen_avx2 when hosts cache is
++    enabled
+   [29638] libc: stdlib: arc4random fallback is never used
+ \f
+ Version 2.36
+diff --git a/nscd/aicache.c b/nscd/aicache.c
+index 51e793199f..e0baed170b 100644
+--- a/nscd/aicache.c
++++ b/nscd/aicache.c
+@@ -110,11 +110,10 @@ addhstaiX (struct database_dyn *db, int fd, request_header *req,
+ 							  "gethostbyname4_r");
+       if (fct4 != NULL)
+ 	{
+-	  struct gaih_addrtuple atmem;
+ 	  struct gaih_addrtuple *at;
+ 	  while (1)
+ 	    {
+-	      at = &atmem;
++	      at = NULL;
+ 	      rc6 = 0;
+ 	      herrno = 0;
+ 	      status[1] = DL_CALL_FCT (fct4, (key, &at,
+@@ -137,7 +136,7 @@ addhstaiX (struct database_dyn *db, int fd, request_header *req,
+ 	    goto next_nip;
+ 
+ 	  /* We found the data.  Count the addresses and the size.  */
+-	  for (const struct gaih_addrtuple *at2 = at = &atmem; at2 != NULL;
++	  for (const struct gaih_addrtuple *at2 = at; at2 != NULL;
+ 	       at2 = at2->next)
+ 	    {
+ 	      ++naddrs;
+-- 
+2.38.1
+
+
+From 3e279192749cfcae4ceebb1f21a3275e677d0561 Mon Sep 17 00:00:00 2001
+From: Michael Hudson-Doyle <michael.hudson@canonical.com>
+Date: Fri, 12 Aug 2022 11:29:31 +1200
+Subject: [PATCH 58/72] Ensure calculations happen with desired rounding mode
+ in y1lf128
+
+math/test-float128-y1 fails on x86_64 and ppc64el with gcc 12 and -O3,
+because code inside a block guarded by SET_RESTORE_ROUNDL is being moved
+after the rounding mode has been restored. Use math_force_eval to
+prevent this (and insert some math_opt_barrier calls to prevent code
+from being moved before the rounding mode is set).
+
+Fixes #29463
+
+Reviewed-By: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
+(cherry picked from commit 2b274fd8c9c776cf70fcdb8356e678ada522a7b0)
+---
+ NEWS                             | 1 +
+ sysdeps/ieee754/ldbl-128/e_j1l.c | 3 +++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/NEWS b/NEWS
+index 63e26d7062..bea1d8a11f 100644
+--- a/NEWS
++++ b/NEWS
+@@ -24,6 +24,7 @@ The following bugs are resolved with this release:
+   [29446] _dlopen now ignores dl_caller argument in static mode
+   [29485] Linux: Terminate subprocess on late failure in tst-pidfd
+   [29490] alpha: New __brk_call implementation is broken
++  [29463] math/test-float128-y1 fails on x86_64
+   [29528] elf: Call __libc_early_init for reused namespaces
+   [29537] libc: [2.34 regression]: Alignment issue on m68k when using
+   [29539] libc: LD_TRACE_LOADED_OBJECTS changed how vDSO library are
+diff --git a/sysdeps/ieee754/ldbl-128/e_j1l.c b/sysdeps/ieee754/ldbl-128/e_j1l.c
+index 54c457681a..9a9c5c6f00 100644
+--- a/sysdeps/ieee754/ldbl-128/e_j1l.c
++++ b/sysdeps/ieee754/ldbl-128/e_j1l.c
+@@ -869,10 +869,13 @@ __ieee754_y1l (_Float128 x)
+     {
+       /* 0 <= x <= 2 */
+       SET_RESTORE_ROUNDL (FE_TONEAREST);
++      xx = math_opt_barrier (xx);
++      x = math_opt_barrier (x);
+       z = xx * xx;
+       p = xx * neval (z, Y0_2N, NY0_2N) / deval (z, Y0_2D, NY0_2D);
+       p = -TWOOPI / xx + p;
+       p = TWOOPI * __ieee754_logl (x) * __ieee754_j1l (x) + p;
++      math_force_eval (p);
+       return p;
+     }
+ 
+-- 
+2.38.1
+
+
+From 700d3281f9e57b53c27bc991394b22d467432626 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 13 Sep 2022 16:10:20 +0200
+Subject: [PATCH 59/72] nss: Implement --no-addrconfig option for getent
+
+The ahosts, ahostsv4, ahostsv6 commands unconditionally pass
+AI_ADDRCONFIG to getaddrinfo, which is not always desired.
+
+Reviewed-by: Carlos O'Donell <carlos@redhat.com>
+(cherry picked from commit a623f13adfac47c8634a7288e08f821a846bc650)
+---
+ NEWS         |  7 +++++++
+ nss/getent.c | 11 ++++++++++-
+ 2 files changed, 17 insertions(+), 1 deletion(-)
+
+diff --git a/NEWS b/NEWS
+index bea1d8a11f..462a12253d 100644
+--- a/NEWS
++++ b/NEWS
+@@ -7,6 +7,13 @@ using `glibc' in the "product" field.
+ \f
+ Version 2.36.1
+ 
++Major new features:
++
++* The getent tool now supports the --no-addrconfig option. The output of
++  getent with --no-addrconfig may contain addresses of families not
++  configured on the current host i.e. as-if you had not passed
++  AI_ADDRCONFIG to getaddrinfo calls.
++
+ Security related changes:
+ 
+   CVE-2022-39046: When the syslog function is passed a crafted input
+diff --git a/nss/getent.c b/nss/getent.c
+index 8178b4b470..d2d2524b0c 100644
+--- a/nss/getent.c
++++ b/nss/getent.c
+@@ -58,6 +58,8 @@ static const struct argp_option args_options[] =
+   {
+     { "service", 's', N_("CONFIG"), 0, N_("Service configuration to be used") },
+     { "no-idn", 'i', NULL, 0, N_("disable IDN encoding") },
++    { "no-addrconfig", 'A', NULL, 0,
++      N_("do not filter out unsupported IPv4/IPv6 addresses (with ahosts*)") },
+     { NULL, 0, NULL, 0, NULL },
+   };
+ 
+@@ -79,6 +81,9 @@ static struct argp argp =
+ /* Additional getaddrinfo flags for IDN encoding.  */
+ static int idn_flags = AI_IDN | AI_CANONIDN;
+ 
++/* Set to 0 by --no-addrconfig.  */
++static int addrconfig_flags = AI_ADDRCONFIG;
++
+ /* Print the version information.  */
+ static void
+ print_version (FILE *stream, struct argp_state *state)
+@@ -346,7 +351,7 @@ ahosts_keys_int (int af, int xflags, int number, char *key[])
+ 
+   struct addrinfo hint;
+   memset (&hint, '\0', sizeof (hint));
+-  hint.ai_flags = (AI_V4MAPPED | AI_ADDRCONFIG | AI_CANONNAME
++  hint.ai_flags = (AI_V4MAPPED | addrconfig_flags | AI_CANONNAME
+ 		   | idn_flags | xflags);
+   hint.ai_family = af;
+ 
+@@ -905,6 +910,10 @@ parse_option (int key, char *arg, struct argp_state *state)
+       idn_flags = 0;
+       break;
+ 
++    case 'A':
++      addrconfig_flags = 0;
++      break;
++
+     default:
+       return ARGP_ERR_UNKNOWN;
+     }
+-- 
+2.38.1
+
+
+From 2681d38cafaceafeb330bc0536fa710b75ed5947 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 13 Sep 2022 16:11:40 +0200
+Subject: [PATCH 60/72] nss: Fix tst-nss-files-hosts-long on single-stack hosts
+ (bug 24816)
+
+getent implicitly passes AI_ADDRCONFIG to getaddrinfo by default.
+Use --no-addrconfig to suppress that, so that both IPv4 and IPv6
+lookups succeed even if the address family is not supported by the
+host.
+
+Reviewed-by: Carlos O'Donell <carlos@redhat.com>
+(cherry picked from commit c75d20b5b27b0a60f0678236f51a4d3b0b058c00)
+---
+ NEWS                           | 1 +
+ nss/tst-nss-files-hosts-long.c | 9 +++++----
+ 2 files changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/NEWS b/NEWS
+index 462a12253d..de775ab116 100644
+--- a/NEWS
++++ b/NEWS
+@@ -24,6 +24,7 @@ Security related changes:
+ The following bugs are resolved with this release:
+ 
+   [12154] Do not fail DNS resolution for CNAMEs which are not host names
++  [24816] Fix tst-nss-files-hosts-long on single-stack hosts
+   [28846] CMSG_NXTHDR may trigger -Wstrict-overflow warning
+   [29305] Conserve NSS buffer space during DNS packet parsing
+   [29415] nscd: Fix netlink cache invalidation if epoll is used
+diff --git a/nss/tst-nss-files-hosts-long.c b/nss/tst-nss-files-hosts-long.c
+index 3942cf5fca..a7697e3143 100644
+--- a/nss/tst-nss-files-hosts-long.c
++++ b/nss/tst-nss-files-hosts-long.c
+@@ -28,14 +28,15 @@ do_test (void)
+ {
+   int ret;
+ 
+-  /* Run getent to fetch the IPv4 address for host test4.
+-     This forces /etc/hosts to be parsed.  */
+-  ret = system("getent ahostsv4 test4");
++  /* Run getent to fetch the IPv4 address for host test4.  This forces
++     /etc/hosts to be parsed.  Use --no-addrconfig to return addresses
++     even in an IPv6-only environment.  */
++  ret = system("getent --no-addrconfig ahostsv4 test4");
+   if (ret != 0)
+     FAIL_EXIT1("ahostsv4 failed");
+ 
+   /* Likewise for IPv6.  */
+-  ret = system("getent ahostsv6 test6");
++  ret = system("getent --no-addrconfig  ahostsv6 test6");
+   if (ret != 0)
+     FAIL_EXIT1("ahostsv6 failed");
+ 
+-- 
+2.38.1
+
+
+From 908454129d21126bf7fc58f2a520b1f304dc5f02 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Fri, 23 Sep 2022 19:30:57 +0200
+Subject: [PATCH 61/72] nss: Use shared prefix in IPv4 address in tst-reload1
+
+Otherwise, sorting based on the longest-matching prefix in
+getaddrinfo can reorder the addresses in ways the test does not
+expect, depending on the IPv4 address of the host.
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit c02e29a0ba47d636281e1a026444a1a0a254aa12)
+---
+ nss/tst-reload1.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/nss/tst-reload1.c b/nss/tst-reload1.c
+index fdc5bdd65b..bc32bb132a 100644
+--- a/nss/tst-reload1.c
++++ b/nss/tst-reload1.c
+@@ -43,12 +43,12 @@ static struct passwd pwd_table_1[] = {
+ 
+ static const char *hostaddr_5[] =
+   {
+-   "ABCD", "abcd", "1234", NULL
++   "ABCd", "ABCD", "ABC4", NULL
+   };
+ 
+ static const char *hostaddr_15[] =
+   {
+-   "4321", "ghij", NULL
++   "4321", "4322", NULL
+   };
+ 
+ static const char *hostaddr_25[] =
+@@ -86,12 +86,12 @@ static const char *hostaddr_6[] =
+ 
+ static const char *hostaddr_16[] =
+   {
+-   "7890", "a1b2", NULL
++   "7890", "7891", NULL
+   };
+ 
+ static const char *hostaddr_26[] =
+   {
+-   "qwer", "tyui", NULL
++   "qwer", "qweR", NULL
+   };
+ 
+ static struct hostent host_table_2[] = {
+-- 
+2.38.1
+
+
+From 19535f3b57306ea3ec559a6c0b10d2d7a87418a7 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Fri, 14 Oct 2022 11:02:25 +0200
+Subject: [PATCH 62/72] elf: Do not completely clear reused namespace in
+ dlmopen (bug 29600)
+
+The data in the _ns_debug member must be preserved, otherwise
+_dl_debug_initialize enters an infinite loop.  To be conservative,
+only clear the libc_map member for now, to fix bug 29528.
+
+Fixes commit d0e357ff45a75553dee3b17ed7d303bfa544f6fe
+("elf: Call __libc_early_init for reused namespaces (bug 29528)"),
+by reverting most of it.
+
+Reviewed-by: Carlos O'Donell <carlos@redhat.com>
+Tested-by: Carlos O'Donell <carlos@redhat.com>
+(cherry picked from commit 2c42257314536b94cc8d52edede86e94e98c1436)
+---
+ NEWS                    |  1 +
+ elf/dl-open.c           | 14 ++++++--------
+ elf/tst-dlmopen-twice.c | 28 ++++++++++++++++++++++++----
+ 3 files changed, 31 insertions(+), 12 deletions(-)
+
+diff --git a/NEWS b/NEWS
+index de775ab116..a6da588c85 100644
+--- a/NEWS
++++ b/NEWS
+@@ -37,6 +37,7 @@ The following bugs are resolved with this release:
+   [29537] libc: [2.34 regression]: Alignment issue on m68k when using
+   [29539] libc: LD_TRACE_LOADED_OBJECTS changed how vDSO library are
+   [29583] Use 64-bit interfaces in gconv_parseconfdir
++  [29600] Do not completely clear reused namespace in dlmopen
+   [29607] nscd repeatably crashes calling __strlen_avx2 when hosts cache is
+     enabled
+   [29638] libc: stdlib: arc4random fallback is never used
+diff --git a/elf/dl-open.c b/elf/dl-open.c
+index 46e8066fd8..e7db5e9642 100644
+--- a/elf/dl-open.c
++++ b/elf/dl-open.c
+@@ -844,15 +844,13 @@ _dl_open (const char *file, int mode, const void *caller_dlopen, Lmid_t nsid,
+ 	  _dl_signal_error (EINVAL, file, NULL, N_("\
+ no more namespaces available for dlmopen()"));
+ 	}
++      else if (nsid == GL(dl_nns))
++	{
++	  __rtld_lock_initialize (GL(dl_ns)[nsid]._ns_unique_sym_table.lock);
++	  ++GL(dl_nns);
++	}
+ 
+-      if (nsid == GL(dl_nns))
+-	++GL(dl_nns);
+-
+-      /* Initialize the new namespace.  Most members are
+-	 zero-initialized, only the lock needs special treatment.  */
+-      memset (&GL(dl_ns)[nsid], 0, sizeof (GL(dl_ns)[nsid]));
+-      __rtld_lock_initialize (GL(dl_ns)[nsid]._ns_unique_sym_table.lock);
+-
++      GL(dl_ns)[nsid].libc_map = NULL;
+       _dl_debug_update (nsid)->r_state = RT_CONSISTENT;
+     }
+   /* Never allow loading a DSO in a namespace which is empty.  Such
+diff --git a/elf/tst-dlmopen-twice.c b/elf/tst-dlmopen-twice.c
+index 449f3c8fa9..70c71fe19c 100644
+--- a/elf/tst-dlmopen-twice.c
++++ b/elf/tst-dlmopen-twice.c
+@@ -16,18 +16,38 @@
+    License along with the GNU C Library; if not, see
+    <https://www.gnu.org/licenses/>.  */
+ 
+-#include <support/xdlfcn.h>
++#include <stdio.h>
+ #include <support/check.h>
++#include <support/xdlfcn.h>
+ 
+-static int
+-do_test (void)
++/* Run the test multiple times, to check finding a new namespace while
++   another namespace is already in use.  This used to trigger bug 29600.  */
++static void
++recurse (int depth)
+ {
+-  void *handle = xdlmopen (LM_ID_NEWLM, "tst-dlmopen-twice-mod1.so", RTLD_NOW);
++  if (depth == 0)
++    return;
++
++  printf ("info: running at depth %d\n", depth);
++  void *handle = xdlmopen (LM_ID_NEWLM, "tst-dlmopen-twice-mod1.so",
++                           RTLD_NOW);
+   xdlclose (handle);
+   handle = xdlmopen (LM_ID_NEWLM, "tst-dlmopen-twice-mod2.so", RTLD_NOW);
+   int (*run_check) (void) = xdlsym (handle, "run_check");
+   TEST_COMPARE (run_check (), 0);
++  recurse (depth - 1);
+   xdlclose (handle);
++}
++
++static int
++do_test (void)
++{
++  /* First run the test without nesting.  */
++  recurse (1);
++
++  /* Then with nesting.  The constant needs to be less than the
++     internal DL_NNS namespace constant.  */
++  recurse (10);
+   return 0;
+ }
+ 
+-- 
+2.38.1
+
+
+From b357157361117182c7a68c90fda7ba431b64442c Mon Sep 17 00:00:00 2001
+From: Michael Hudson-Doyle <michael.hudson@canonical.com>
+Date: Mon, 22 Aug 2022 14:05:04 +1200
+Subject: [PATCH 63/72] Fix BZ #29463 in the ibm128 implementation of y1l too
+
+Avoid moving code across SET_RESTORE_ROUNDL in order to fix
+[BZ #29463].
+
+Tested-by: Aurelien Jarno <aurelien@aurel32.net>
+Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
+Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
+(cherry picked from commit b6e37b7805b0182c3e25cdab39ebf5f001c04d05)
+---
+ sysdeps/ieee754/ldbl-128ibm/e_j1l.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/sysdeps/ieee754/ldbl-128ibm/e_j1l.c b/sysdeps/ieee754/ldbl-128ibm/e_j1l.c
+index f85ba94466..0a5fe68342 100644
+--- a/sysdeps/ieee754/ldbl-128ibm/e_j1l.c
++++ b/sysdeps/ieee754/ldbl-128ibm/e_j1l.c
+@@ -792,10 +792,13 @@ __ieee754_y1l (long double x)
+     {
+       /* 0 <= x <= 2 */
+       SET_RESTORE_ROUNDL (FE_TONEAREST);
++      xx = math_opt_barrier (xx);
++      x = math_opt_barrier (x);
+       z = xx * xx;
+       p = xx * neval (z, Y0_2N, NY0_2N) / deval (z, Y0_2D, NY0_2D);
+       p = -TWOOPI / xx + p;
+       p = TWOOPI * __ieee754_logl (x) * __ieee754_j1l (x) + p;
++      math_force_eval (p);
+       return p;
+     }
+ 
+-- 
+2.38.1
+
+
+From 9273b2d0e93e7355656cad3be3a1ca76489df483 Mon Sep 17 00:00:00 2001
+From: Aurelien Jarno <aurelien@aurel32.net>
+Date: Mon, 10 Oct 2022 00:39:33 +0200
+Subject: [PATCH 64/72] Avoid undefined behaviour in ibm128 implementation of
+ llroundl (BZ #29488)
+
+Detecting an overflow edge case depended on signed overflow of a long
+long. Replace the additions and the overflow checks by
+__builtin_add_overflow().
+
+Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
+(cherry picked from commit 2b5478569e72ee4820a6e163d306690c9c0eaf5e)
+---
+ NEWS                                     |  2 ++
+ sysdeps/ieee754/ldbl-128ibm/s_llroundl.c | 21 +++++++++------------
+ 2 files changed, 11 insertions(+), 12 deletions(-)
+
+diff --git a/NEWS b/NEWS
+index a6da588c85..8c60d3dc8d 100644
+--- a/NEWS
++++ b/NEWS
+@@ -33,6 +33,8 @@ The following bugs are resolved with this release:
+   [29485] Linux: Terminate subprocess on late failure in tst-pidfd
+   [29490] alpha: New __brk_call implementation is broken
+   [29463] math/test-float128-y1 fails on x86_64
++  [29488] test-ibm128-llround fails on ppc64el when built with gcc-12 and -O2
++    or higher
+   [29528] elf: Call __libc_early_init for reused namespaces
+   [29537] libc: [2.34 regression]: Alignment issue on m68k when using
+   [29539] libc: LD_TRACE_LOADED_OBJECTS changed how vDSO library are
+diff --git a/sysdeps/ieee754/ldbl-128ibm/s_llroundl.c b/sysdeps/ieee754/ldbl-128ibm/s_llroundl.c
+index d85154e73a..d8c0de1faf 100644
+--- a/sysdeps/ieee754/ldbl-128ibm/s_llroundl.c
++++ b/sysdeps/ieee754/ldbl-128ibm/s_llroundl.c
+@@ -66,38 +66,35 @@ __llroundl (long double x)
+       /* Peg at max/min values, assuming that the above conversions do so.
+          Strictly speaking, we can return anything for values that overflow,
+          but this is more useful.  */
+-      res = hi + lo;
+-
+-      /* This is just sign(hi) == sign(lo) && sign(res) != sign(hi).  */
+-      if (__glibc_unlikely (((~(hi ^ lo) & (res ^ hi)) < 0)))
++      if (__glibc_unlikely (__builtin_add_overflow (hi, lo, &res)))
+ 	goto overflow;
+ 
+       xh -= lo;
+       ldbl_canonicalize (&xh, &xl);
+ 
+-      hi = res;
+       if (xh > 0.5)
+ 	{
+-	  res += 1;
++	  if (__glibc_unlikely (__builtin_add_overflow (res, 1, &res)))
++	    goto overflow;
+ 	}
+       else if (xh == 0.5)
+ 	{
+ 	  if (xl > 0.0 || (xl == 0.0 && res >= 0))
+-	    res += 1;
++	    if (__glibc_unlikely (__builtin_add_overflow (res, 1, &res)))
++	      goto overflow;
+ 	}
+       else if (-xh > 0.5)
+ 	{
+-	  res -= 1;
++	  if (__glibc_unlikely (__builtin_add_overflow (res, -1, &res)))
++	    goto overflow;
+ 	}
+       else if (-xh == 0.5)
+ 	{
+ 	  if (xl < 0.0 || (xl == 0.0 && res <= 0))
+-	    res -= 1;
++	    if (__glibc_unlikely (__builtin_add_overflow (res, -1, &res)))
++	      goto overflow;
+ 	}
+ 
+-      if (__glibc_unlikely (((~(hi ^ (res - hi)) & (res ^ hi)) < 0)))
+-	goto overflow;
+-
+       return res;
+     }
+   else
+-- 
+2.38.1
+
+
+From 7b7dfbb0cbdffebf0233c650627a4861212fbb60 Mon Sep 17 00:00:00 2001
+From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Wed, 19 Oct 2022 19:14:04 -0300
+Subject: [PATCH 65/72] linux: Fix generic struct_stat for 64 bit time (BZ#
+ 29657)
+
+The generic Linux struct_stat misses the conditionals to use
+bits/struct_stat_time64_helper.h in the __USE_TIME_BITS64 for
+architecture that uses __TIMESIZE == 32 (currently csky and nios2).
+
+Since newer ports should not support 32 bit time_t, the generic
+implementation should be used as default.
+
+For arm, hppa, and sh a copy of default struct_stat is added,
+while for csky and nios a new one based on generic is used, along
+with conditionals to use bits/struct_stat_time64_helper.h.
+
+The default struct_stat is also replaced with the generic one.
+
+Checked on aarch64-linux-gnu and arm-linux-gnueabihf.
+
+(cherry picked from commit 7a6ca82f8007ddbd43e2b8fce806ba7101ee47f5)
+---
+ NEWS                                          |   2 +
+ .../unix/sysv/linux/arm/bits/struct_stat.h    | 139 ++++++++++++++++++
+ sysdeps/unix/sysv/linux/bits/struct_stat.h    | 116 +++++++--------
+ .../{generic => csky}/bits/struct_stat.h      |  28 ++--
+ .../unix/sysv/linux/hppa/bits/struct_stat.h   | 139 ++++++++++++++++++
+ .../unix/sysv/linux/nios2/bits/struct_stat.h  | 135 +++++++++++++++++
+ sysdeps/unix/sysv/linux/sh/bits/struct_stat.h | 139 ++++++++++++++++++
+ 7 files changed, 624 insertions(+), 74 deletions(-)
+ create mode 100644 sysdeps/unix/sysv/linux/arm/bits/struct_stat.h
+ rename sysdeps/unix/sysv/linux/{generic => csky}/bits/struct_stat.h (92%)
+ create mode 100644 sysdeps/unix/sysv/linux/hppa/bits/struct_stat.h
+ create mode 100644 sysdeps/unix/sysv/linux/nios2/bits/struct_stat.h
+ create mode 100644 sysdeps/unix/sysv/linux/sh/bits/struct_stat.h
+
+diff --git a/NEWS b/NEWS
+index 8c60d3dc8d..833045585f 100644
+--- a/NEWS
++++ b/NEWS
+@@ -43,6 +43,8 @@ The following bugs are resolved with this release:
+   [29607] nscd repeatably crashes calling __strlen_avx2 when hosts cache is
+     enabled
+   [29638] libc: stdlib: arc4random fallback is never used
++  [29657] libc: Incorrect struct stat for 64-bit time on linux/generic
++    platforms
+ \f
+ Version 2.36
+ 
+diff --git a/sysdeps/unix/sysv/linux/arm/bits/struct_stat.h b/sysdeps/unix/sysv/linux/arm/bits/struct_stat.h
+new file mode 100644
+index 0000000000..30ee6279d2
+--- /dev/null
++++ b/sysdeps/unix/sysv/linux/arm/bits/struct_stat.h
+@@ -0,0 +1,139 @@
++/* Definition for struct stat.  Linux/arm version.
++   Copyright (C) 2020-2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library.  If not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#if !defined _SYS_STAT_H && !defined _FCNTL_H
++# error "Never include <bits/struct_stat.h> directly; use <sys/stat.h> instead."
++#endif
++
++#ifndef _BITS_STRUCT_STAT_H
++#define _BITS_STRUCT_STAT_H	1
++
++#include <bits/endian.h>
++#include <bits/wordsize.h>
++
++struct stat
++  {
++#ifdef __USE_TIME_BITS64
++# include <bits/struct_stat_time64_helper.h>
++#else
++    __dev_t st_dev;			/* Device.  */
++    unsigned short int __pad1;
++# ifndef __USE_FILE_OFFSET64
++    __ino_t st_ino;			/* File serial number.	*/
++# else
++    __ino_t __st_ino;			/* 32bit file serial number.	*/
++# endif
++    __mode_t st_mode;			/* File mode.  */
++    __nlink_t st_nlink;			/* Link count.  */
++    __uid_t st_uid;			/* User ID of the file's owner.	*/
++    __gid_t st_gid;			/* Group ID of the file's group.*/
++    __dev_t st_rdev;			/* Device number, if device.  */
++    unsigned short int __pad2;
++# ifndef __USE_FILE_OFFSET64
++    __off_t st_size;			/* Size of file, in bytes.  */
++# else
++    __off64_t st_size;			/* Size of file, in bytes.  */
++# endif
++    __blksize_t st_blksize;		/* Optimal block size for I/O.  */
++
++# ifndef __USE_FILE_OFFSET64
++    __blkcnt_t st_blocks;		/* Number 512-byte blocks allocated. */
++# else
++    __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
++# endif
++# ifdef __USE_XOPEN2K8
++    /* Nanosecond resolution timestamps are stored in a format
++       equivalent to 'struct timespec'.  This is the type used
++       whenever possible but the Unix namespace rules do not allow the
++       identifier 'timespec' to appear in the <sys/stat.h> header.
++       Therefore we have to handle the use of this header in strictly
++       standard-compliant sources special.  */
++    struct timespec st_atim;		/* Time of last access.  */
++    struct timespec st_mtim;		/* Time of last modification.  */
++    struct timespec st_ctim;		/* Time of last status change.  */
++#  define st_atime st_atim.tv_sec	/* Backward compatibility.  */
++#  define st_mtime st_mtim.tv_sec
++#  define st_ctime st_ctim.tv_sec
++# else
++    __time_t st_atime;			/* Time of last access.  */
++    unsigned long int st_atimensec;	/* Nscecs of last access.  */
++    __time_t st_mtime;			/* Time of last modification.  */
++    unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
++    __time_t st_ctime;			/* Time of last status change.  */
++    unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
++# endif
++# ifndef __USE_FILE_OFFSET64
++    unsigned long int __glibc_reserved4;
++    unsigned long int __glibc_reserved5;
++# else
++    __ino64_t st_ino;			/* File serial number.	*/
++# endif
++#endif /* __USE_TIME_BITS64  */
++  };
++
++#ifdef __USE_LARGEFILE64
++struct stat64
++  {
++# ifdef __USE_TIME_BITS64
++#  include <bits/struct_stat_time64_helper.h>
++# else
++    __dev_t st_dev;			/* Device.  */
++    unsigned int __pad1;
++
++    __ino_t __st_ino;			/* 32bit file serial number.	*/
++    __mode_t st_mode;			/* File mode.  */
++    __nlink_t st_nlink;			/* Link count.  */
++    __uid_t st_uid;			/* User ID of the file's owner.	*/
++    __gid_t st_gid;			/* Group ID of the file's group.*/
++    __dev_t st_rdev;			/* Device number, if device.  */
++    unsigned int __pad2;
++    __off64_t st_size;			/* Size of file, in bytes.  */
++    __blksize_t st_blksize;		/* Optimal block size for I/O.  */
++
++    __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
++#  ifdef __USE_XOPEN2K8
++    /* Nanosecond resolution timestamps are stored in a format
++       equivalent to 'struct timespec'.  This is the type used
++       whenever possible but the Unix namespace rules do not allow the
++       identifier 'timespec' to appear in the <sys/stat.h> header.
++       Therefore we have to handle the use of this header in strictly
++       standard-compliant sources special.  */
++    struct timespec st_atim;		/* Time of last access.  */
++    struct timespec st_mtim;		/* Time of last modification.  */
++    struct timespec st_ctim;		/* Time of last status change.  */
++#  else
++    __time_t st_atime;			/* Time of last access.  */
++    unsigned long int st_atimensec;	/* Nscecs of last access.  */
++    __time_t st_mtime;			/* Time of last modification.  */
++    unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
++    __time_t st_ctime;			/* Time of last status change.  */
++    unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
++#  endif
++    __ino64_t st_ino;			/* File serial number.		*/
++# endif /* __USE_TIME_BITS64  */
++  };
++#endif
++
++/* Tell code we have these members.  */
++#define	_STATBUF_ST_BLKSIZE
++#define _STATBUF_ST_RDEV
++/* Nanosecond resolution time values are supported.  */
++#define _STATBUF_ST_NSEC
++
++
++#endif /* _BITS_STRUCT_STAT_H  */
+diff --git a/sysdeps/unix/sysv/linux/bits/struct_stat.h b/sysdeps/unix/sysv/linux/bits/struct_stat.h
+index 25bd6cb638..fb11a3fba4 100644
+--- a/sysdeps/unix/sysv/linux/bits/struct_stat.h
++++ b/sysdeps/unix/sysv/linux/bits/struct_stat.h
+@@ -26,37 +26,36 @@
+ #include <bits/endian.h>
+ #include <bits/wordsize.h>
+ 
+-struct stat
+-  {
+-#ifdef __USE_TIME_BITS64
+-# include <bits/struct_stat_time64_helper.h>
+-#else
+-    __dev_t st_dev;			/* Device.  */
+-    unsigned short int __pad1;
+-# ifndef __USE_FILE_OFFSET64
+-    __ino_t st_ino;			/* File serial number.	*/
+-# else
+-    __ino_t __st_ino;			/* 32bit file serial number.	*/
++#if defined __USE_FILE_OFFSET64
++# define __field64(type, type64, name) type64 name
++#elif __WORDSIZE == 64 || defined __INO_T_MATCHES_INO64_T
++# if defined __INO_T_MATCHES_INO64_T && !defined __OFF_T_MATCHES_OFF64_T
++#  error "ino_t and off_t must both be the same type"
+ # endif
+-    __mode_t st_mode;			/* File mode.  */
+-    __nlink_t st_nlink;			/* Link count.  */
+-    __uid_t st_uid;			/* User ID of the file's owner.	*/
+-    __gid_t st_gid;			/* Group ID of the file's group.*/
+-    __dev_t st_rdev;			/* Device number, if device.  */
+-    unsigned short int __pad2;
+-# ifndef __USE_FILE_OFFSET64
+-    __off_t st_size;			/* Size of file, in bytes.  */
+-# else
+-    __off64_t st_size;			/* Size of file, in bytes.  */
+-# endif
+-    __blksize_t st_blksize;		/* Optimal block size for I/O.  */
++# define __field64(type, type64, name) type name
++#elif __BYTE_ORDER == __LITTLE_ENDIAN
++# define __field64(type, type64, name) \
++  type name __attribute__((__aligned__ (__alignof__ (type64)))); int __##name##_pad
++#else
++# define __field64(type, type64, name) \
++  int __##name##_pad __attribute__((__aligned__ (__alignof__ (type64)))); type name
++#endif
+ 
+-# ifndef __USE_FILE_OFFSET64
+-    __blkcnt_t st_blocks;		/* Number 512-byte blocks allocated. */
+-# else
+-    __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
+-# endif
+-# ifdef __USE_XOPEN2K8
++struct stat
++  {
++    __dev_t st_dev;		/* Device.  */
++    __field64(__ino_t, __ino64_t, st_ino);  /* File serial number. */
++    __mode_t st_mode;		/* File mode.  */
++    __nlink_t st_nlink;		/* Link count.  */
++    __uid_t st_uid;		/* User ID of the file's owner.	*/
++    __gid_t st_gid;		/* Group ID of the file's group.*/
++    __dev_t st_rdev;		/* Device number, if device.  */
++    __dev_t __pad1;
++    __field64(__off_t, __off64_t, st_size);  /* Size of file, in bytes. */
++    __blksize_t st_blksize;	/* Optimal block size for I/O.  */
++    int __pad2;
++    __field64(__blkcnt_t, __blkcnt64_t, st_blocks);  /* 512-byte blocks */
++#ifdef __USE_XOPEN2K8
+     /* Nanosecond resolution timestamps are stored in a format
+        equivalent to 'struct timespec'.  This is the type used
+        whenever possible but the Unix namespace rules do not allow the
+@@ -66,47 +65,38 @@ struct stat
+     struct timespec st_atim;		/* Time of last access.  */
+     struct timespec st_mtim;		/* Time of last modification.  */
+     struct timespec st_ctim;		/* Time of last status change.  */
+-#  define st_atime st_atim.tv_sec	/* Backward compatibility.  */
+-#  define st_mtime st_mtim.tv_sec
+-#  define st_ctime st_ctim.tv_sec
+-# else
++# define st_atime st_atim.tv_sec	/* Backward compatibility.  */
++# define st_mtime st_mtim.tv_sec
++# define st_ctime st_ctim.tv_sec
++#else
+     __time_t st_atime;			/* Time of last access.  */
+     unsigned long int st_atimensec;	/* Nscecs of last access.  */
+     __time_t st_mtime;			/* Time of last modification.  */
+     unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
+     __time_t st_ctime;			/* Time of last status change.  */
+     unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
+-# endif
+-# ifndef __USE_FILE_OFFSET64
+-    unsigned long int __glibc_reserved4;
+-    unsigned long int __glibc_reserved5;
+-# else
+-    __ino64_t st_ino;			/* File serial number.	*/
+-# endif
+-#endif /* __USE_TIME_BITS64  */
++#endif
++    int __glibc_reserved[2];
+   };
+ 
++#undef __field64
++
+ #ifdef __USE_LARGEFILE64
+ struct stat64
+   {
+-# ifdef __USE_TIME_BITS64
+-#  include <bits/struct_stat_time64_helper.h>
+-# else
+-    __dev_t st_dev;			/* Device.  */
+-    unsigned int __pad1;
+-
+-    __ino_t __st_ino;			/* 32bit file serial number.	*/
+-    __mode_t st_mode;			/* File mode.  */
+-    __nlink_t st_nlink;			/* Link count.  */
+-    __uid_t st_uid;			/* User ID of the file's owner.	*/
+-    __gid_t st_gid;			/* Group ID of the file's group.*/
+-    __dev_t st_rdev;			/* Device number, if device.  */
+-    unsigned int __pad2;
+-    __off64_t st_size;			/* Size of file, in bytes.  */
+-    __blksize_t st_blksize;		/* Optimal block size for I/O.  */
+-
+-    __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
+-#  ifdef __USE_XOPEN2K8
++    __dev_t st_dev;		/* Device.  */
++    __ino64_t st_ino;		/* File serial number.	*/
++    __mode_t st_mode;		/* File mode.  */
++    __nlink_t st_nlink;		/* Link count.  */
++    __uid_t st_uid;		/* User ID of the file's owner.	*/
++    __gid_t st_gid;		/* Group ID of the file's group.*/
++    __dev_t st_rdev;		/* Device number, if device.  */
++    __dev_t __pad1;
++    __off64_t st_size;		/* Size of file, in bytes.  */
++    __blksize_t st_blksize;	/* Optimal block size for I/O.  */
++    int __pad2;
++    __blkcnt64_t st_blocks;	/* Nr. 512-byte blocks allocated.  */
++#ifdef __USE_XOPEN2K8
+     /* Nanosecond resolution timestamps are stored in a format
+        equivalent to 'struct timespec'.  This is the type used
+        whenever possible but the Unix namespace rules do not allow the
+@@ -116,16 +106,15 @@ struct stat64
+     struct timespec st_atim;		/* Time of last access.  */
+     struct timespec st_mtim;		/* Time of last modification.  */
+     struct timespec st_ctim;		/* Time of last status change.  */
+-#  else
++#else
+     __time_t st_atime;			/* Time of last access.  */
+     unsigned long int st_atimensec;	/* Nscecs of last access.  */
+     __time_t st_mtime;			/* Time of last modification.  */
+     unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
+     __time_t st_ctime;			/* Time of last status change.  */
+     unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
+-#  endif
+-    __ino64_t st_ino;			/* File serial number.		*/
+-# endif /* __USE_TIME_BITS64  */
++#endif
++    int __glibc_reserved[2];
+   };
+ #endif
+ 
+@@ -135,5 +124,4 @@ struct stat64
+ /* Nanosecond resolution time values are supported.  */
+ #define _STATBUF_ST_NSEC
+ 
+-
+ #endif /* _BITS_STRUCT_STAT_H  */
+diff --git a/sysdeps/unix/sysv/linux/generic/bits/struct_stat.h b/sysdeps/unix/sysv/linux/csky/bits/struct_stat.h
+similarity index 92%
+rename from sysdeps/unix/sysv/linux/generic/bits/struct_stat.h
+rename to sysdeps/unix/sysv/linux/csky/bits/struct_stat.h
+index fb11a3fba4..f0ee455748 100644
+--- a/sysdeps/unix/sysv/linux/generic/bits/struct_stat.h
++++ b/sysdeps/unix/sysv/linux/csky/bits/struct_stat.h
+@@ -1,4 +1,4 @@
+-/* Definition for struct stat.
++/* Definition for struct stat.  Linux/csky version.
+    Copyright (C) 2020-2022 Free Software Foundation, Inc.
+    This file is part of the GNU C Library.
+ 
+@@ -43,6 +43,9 @@
+ 
+ struct stat
+   {
++#ifdef __USE_TIME_BITS64
++# include <bits/struct_stat_time64_helper.h>
++#else
+     __dev_t st_dev;		/* Device.  */
+     __field64(__ino_t, __ino64_t, st_ino);  /* File serial number. */
+     __mode_t st_mode;		/* File mode.  */
+@@ -55,7 +58,7 @@ struct stat
+     __blksize_t st_blksize;	/* Optimal block size for I/O.  */
+     int __pad2;
+     __field64(__blkcnt_t, __blkcnt64_t, st_blocks);  /* 512-byte blocks */
+-#ifdef __USE_XOPEN2K8
++# ifdef __USE_XOPEN2K8
+     /* Nanosecond resolution timestamps are stored in a format
+        equivalent to 'struct timespec'.  This is the type used
+        whenever possible but the Unix namespace rules do not allow the
+@@ -65,18 +68,19 @@ struct stat
+     struct timespec st_atim;		/* Time of last access.  */
+     struct timespec st_mtim;		/* Time of last modification.  */
+     struct timespec st_ctim;		/* Time of last status change.  */
+-# define st_atime st_atim.tv_sec	/* Backward compatibility.  */
+-# define st_mtime st_mtim.tv_sec
+-# define st_ctime st_ctim.tv_sec
+-#else
++#  define st_atime st_atim.tv_sec	/* Backward compatibility.  */
++#  define st_mtime st_mtim.tv_sec
++#  define st_ctime st_ctim.tv_sec
++# else
+     __time_t st_atime;			/* Time of last access.  */
+     unsigned long int st_atimensec;	/* Nscecs of last access.  */
+     __time_t st_mtime;			/* Time of last modification.  */
+     unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
+     __time_t st_ctime;			/* Time of last status change.  */
+     unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
+-#endif
++# endif
+     int __glibc_reserved[2];
++#endif
+   };
+ 
+ #undef __field64
+@@ -84,6 +88,9 @@ struct stat
+ #ifdef __USE_LARGEFILE64
+ struct stat64
+   {
++# ifdef __USE_TIME_BITS64
++#  include <bits/struct_stat_time64_helper.h>
++# else
+     __dev_t st_dev;		/* Device.  */
+     __ino64_t st_ino;		/* File serial number.	*/
+     __mode_t st_mode;		/* File mode.  */
+@@ -96,7 +103,7 @@ struct stat64
+     __blksize_t st_blksize;	/* Optimal block size for I/O.  */
+     int __pad2;
+     __blkcnt64_t st_blocks;	/* Nr. 512-byte blocks allocated.  */
+-#ifdef __USE_XOPEN2K8
++#  ifdef __USE_XOPEN2K8
+     /* Nanosecond resolution timestamps are stored in a format
+        equivalent to 'struct timespec'.  This is the type used
+        whenever possible but the Unix namespace rules do not allow the
+@@ -106,15 +113,16 @@ struct stat64
+     struct timespec st_atim;		/* Time of last access.  */
+     struct timespec st_mtim;		/* Time of last modification.  */
+     struct timespec st_ctim;		/* Time of last status change.  */
+-#else
++#  else
+     __time_t st_atime;			/* Time of last access.  */
+     unsigned long int st_atimensec;	/* Nscecs of last access.  */
+     __time_t st_mtime;			/* Time of last modification.  */
+     unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
+     __time_t st_ctime;			/* Time of last status change.  */
+     unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
+-#endif
++#  endif
+     int __glibc_reserved[2];
++# endif
+   };
+ #endif
+ 
+diff --git a/sysdeps/unix/sysv/linux/hppa/bits/struct_stat.h b/sysdeps/unix/sysv/linux/hppa/bits/struct_stat.h
+new file mode 100644
+index 0000000000..38b6e13e68
+--- /dev/null
++++ b/sysdeps/unix/sysv/linux/hppa/bits/struct_stat.h
+@@ -0,0 +1,139 @@
++/* Definition for struct stat.  Linux/hppa version.
++   Copyright (C) 2020-2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library.  If not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#if !defined _SYS_STAT_H && !defined _FCNTL_H
++# error "Never include <bits/struct_stat.h> directly; use <sys/stat.h> instead."
++#endif
++
++#ifndef _BITS_STRUCT_STAT_H
++#define _BITS_STRUCT_STAT_H	1
++
++#include <bits/endian.h>
++#include <bits/wordsize.h>
++
++struct stat
++  {
++#ifdef __USE_TIME_BITS64
++# include <bits/struct_stat_time64_helper.h>
++#else
++    __dev_t st_dev;			/* Device.  */
++    unsigned short int __pad1;
++# ifndef __USE_FILE_OFFSET64
++    __ino_t st_ino;			/* File serial number.	*/
++# else
++    __ino_t __st_ino;			/* 32bit file serial number.	*/
++# endif
++    __mode_t st_mode;			/* File mode.  */
++    __nlink_t st_nlink;			/* Link count.  */
++    __uid_t st_uid;			/* User ID of the file's owner.	*/
++    __gid_t st_gid;			/* Group ID of the file's group.*/
++    __dev_t st_rdev;			/* Device number, if device.  */
++    unsigned short int __pad2;
++# ifndef __USE_FILE_OFFSET64
++    __off_t st_size;			/* Size of file, in bytes.  */
++# else
++    __off64_t st_size;			/* Size of file, in bytes.  */
++# endif
++    __blksize_t st_blksize;		/* Optimal block size for I/O.  */
++
++# ifndef __USE_FILE_OFFSET64
++    __blkcnt_t st_blocks;		/* Number 512-byte blocks allocated. */
++# else
++    __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
++# endif
++# ifdef __USE_XOPEN2K8
++    /* Nanosecond resolution timestamps are stored in a format
++       equivalent to 'struct timespec'.  This is the type used
++       whenever possible but the Unix namespace rules do not allow the
++       identifier 'timespec' to appear in the <sys/stat.h> header.
++       Therefore we have to handle the use of this header in strictly
++       standard-compliant sources special.  */
++    struct timespec st_atim;		/* Time of last access.  */
++    struct timespec st_mtim;		/* Time of last modification.  */
++    struct timespec st_ctim;		/* Time of last status change.  */
++#  define st_atime st_atim.tv_sec	/* Backward compatibility.  */
++#  define st_mtime st_mtim.tv_sec
++#  define st_ctime st_ctim.tv_sec
++# else
++    __time_t st_atime;			/* Time of last access.  */
++    unsigned long int st_atimensec;	/* Nscecs of last access.  */
++    __time_t st_mtime;			/* Time of last modification.  */
++    unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
++    __time_t st_ctime;			/* Time of last status change.  */
++    unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
++# endif
++# ifndef __USE_FILE_OFFSET64
++    unsigned long int __glibc_reserved4;
++    unsigned long int __glibc_reserved5;
++# else
++    __ino64_t st_ino;			/* File serial number.	*/
++# endif
++#endif /* __USE_TIME_BITS64  */
++  };
++
++#ifdef __USE_LARGEFILE64
++struct stat64
++  {
++# ifdef __USE_TIME_BITS64
++#  include <bits/struct_stat_time64_helper.h>
++# else
++    __dev_t st_dev;			/* Device.  */
++    unsigned int __pad1;
++
++    __ino_t __st_ino;			/* 32bit file serial number.	*/
++    __mode_t st_mode;			/* File mode.  */
++    __nlink_t st_nlink;			/* Link count.  */
++    __uid_t st_uid;			/* User ID of the file's owner.	*/
++    __gid_t st_gid;			/* Group ID of the file's group.*/
++    __dev_t st_rdev;			/* Device number, if device.  */
++    unsigned int __pad2;
++    __off64_t st_size;			/* Size of file, in bytes.  */
++    __blksize_t st_blksize;		/* Optimal block size for I/O.  */
++
++    __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
++#  ifdef __USE_XOPEN2K8
++    /* Nanosecond resolution timestamps are stored in a format
++       equivalent to 'struct timespec'.  This is the type used
++       whenever possible but the Unix namespace rules do not allow the
++       identifier 'timespec' to appear in the <sys/stat.h> header.
++       Therefore we have to handle the use of this header in strictly
++       standard-compliant sources special.  */
++    struct timespec st_atim;		/* Time of last access.  */
++    struct timespec st_mtim;		/* Time of last modification.  */
++    struct timespec st_ctim;		/* Time of last status change.  */
++#  else
++    __time_t st_atime;			/* Time of last access.  */
++    unsigned long int st_atimensec;	/* Nscecs of last access.  */
++    __time_t st_mtime;			/* Time of last modification.  */
++    unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
++    __time_t st_ctime;			/* Time of last status change.  */
++    unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
++#  endif
++    __ino64_t st_ino;			/* File serial number.		*/
++# endif /* __USE_TIME_BITS64  */
++  };
++#endif
++
++/* Tell code we have these members.  */
++#define	_STATBUF_ST_BLKSIZE
++#define _STATBUF_ST_RDEV
++/* Nanosecond resolution time values are supported.  */
++#define _STATBUF_ST_NSEC
++
++
++#endif /* _BITS_STRUCT_STAT_H  */
+diff --git a/sysdeps/unix/sysv/linux/nios2/bits/struct_stat.h b/sysdeps/unix/sysv/linux/nios2/bits/struct_stat.h
+new file mode 100644
+index 0000000000..e00e71173e
+--- /dev/null
++++ b/sysdeps/unix/sysv/linux/nios2/bits/struct_stat.h
+@@ -0,0 +1,135 @@
++/* Definition for struct stat.  Linux/nios2 version.
++   Copyright (C) 2020-2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library.  If not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#if !defined _SYS_STAT_H && !defined _FCNTL_H
++# error "Never include <bits/struct_stat.h> directly; use <sys/stat.h> instead."
++#endif
++
++#ifndef _BITS_STRUCT_STAT_H
++#define _BITS_STRUCT_STAT_H	1
++
++#include <bits/endian.h>
++#include <bits/wordsize.h>
++
++#if defined __USE_FILE_OFFSET64
++# define __field64(type, type64, name) type64 name
++#elif __WORDSIZE == 64 || defined __INO_T_MATCHES_INO64_T
++# if defined __INO_T_MATCHES_INO64_T && !defined __OFF_T_MATCHES_OFF64_T
++#  error "ino_t and off_t must both be the same type"
++# endif
++# define __field64(type, type64, name) type name
++#elif __BYTE_ORDER == __LITTLE_ENDIAN
++# define __field64(type, type64, name) \
++  type name __attribute__((__aligned__ (__alignof__ (type64)))); int __##name##_pad
++#else
++# define __field64(type, type64, name) \
++  int __##name##_pad __attribute__((__aligned__ (__alignof__ (type64)))); type name
++#endif
++
++struct stat
++  {
++#ifdef __USE_TIME_BITS64
++# include <bits/struct_stat_time64_helper.h>
++#else
++    __dev_t st_dev;		/* Device.  */
++    __field64(__ino_t, __ino64_t, st_ino);  /* File serial number. */
++    __mode_t st_mode;		/* File mode.  */
++    __nlink_t st_nlink;		/* Link count.  */
++    __uid_t st_uid;		/* User ID of the file's owner.	*/
++    __gid_t st_gid;		/* Group ID of the file's group.*/
++    __dev_t st_rdev;		/* Device number, if device.  */
++    __dev_t __pad1;
++    __field64(__off_t, __off64_t, st_size);  /* Size of file, in bytes. */
++    __blksize_t st_blksize;	/* Optimal block size for I/O.  */
++    int __pad2;
++    __field64(__blkcnt_t, __blkcnt64_t, st_blocks);  /* 512-byte blocks */
++# ifdef __USE_XOPEN2K8
++    /* Nanosecond resolution timestamps are stored in a format
++       equivalent to 'struct timespec'.  This is the type used
++       whenever possible but the Unix namespace rules do not allow the
++       identifier 'timespec' to appear in the <sys/stat.h> header.
++       Therefore we have to handle the use of this header in strictly
++       standard-compliant sources special.  */
++    struct timespec st_atim;		/* Time of last access.  */
++    struct timespec st_mtim;		/* Time of last modification.  */
++    struct timespec st_ctim;		/* Time of last status change.  */
++#  define st_atime st_atim.tv_sec	/* Backward compatibility.  */
++#  define st_mtime st_mtim.tv_sec
++#  define st_ctime st_ctim.tv_sec
++# else
++    __time_t st_atime;			/* Time of last access.  */
++    unsigned long int st_atimensec;	/* Nscecs of last access.  */
++    __time_t st_mtime;			/* Time of last modification.  */
++    unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
++    __time_t st_ctime;			/* Time of last status change.  */
++    unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
++# endif
++    int __glibc_reserved[2];
++#endif
++  };
++
++#undef __field64
++
++#ifdef __USE_LARGEFILE64
++struct stat64
++  {
++# ifdef __USE_TIME_BITS64
++#  include <bits/struct_stat_time64_helper.h>
++# else
++    __dev_t st_dev;		/* Device.  */
++    __ino64_t st_ino;		/* File serial number.	*/
++    __mode_t st_mode;		/* File mode.  */
++    __nlink_t st_nlink;		/* Link count.  */
++    __uid_t st_uid;		/* User ID of the file's owner.	*/
++    __gid_t st_gid;		/* Group ID of the file's group.*/
++    __dev_t st_rdev;		/* Device number, if device.  */
++    __dev_t __pad1;
++    __off64_t st_size;		/* Size of file, in bytes.  */
++    __blksize_t st_blksize;	/* Optimal block size for I/O.  */
++    int __pad2;
++    __blkcnt64_t st_blocks;	/* Nr. 512-byte blocks allocated.  */
++#  ifdef __USE_XOPEN2K8
++    /* Nanosecond resolution timestamps are stored in a format
++       equivalent to 'struct timespec'.  This is the type used
++       whenever possible but the Unix namespace rules do not allow the
++       identifier 'timespec' to appear in the <sys/stat.h> header.
++       Therefore we have to handle the use of this header in strictly
++       standard-compliant sources special.  */
++    struct timespec st_atim;		/* Time of last access.  */
++    struct timespec st_mtim;		/* Time of last modification.  */
++    struct timespec st_ctim;		/* Time of last status change.  */
++#  else
++    __time_t st_atime;			/* Time of last access.  */
++    unsigned long int st_atimensec;	/* Nscecs of last access.  */
++    __time_t st_mtime;			/* Time of last modification.  */
++    unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
++    __time_t st_ctime;			/* Time of last status change.  */
++    unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
++#  endif
++    int __glibc_reserved[2];
++# endif
++  };
++#endif
++
++/* Tell code we have these members.  */
++#define	_STATBUF_ST_BLKSIZE
++#define _STATBUF_ST_RDEV
++/* Nanosecond resolution time values are supported.  */
++#define _STATBUF_ST_NSEC
++
++#endif /* _BITS_STRUCT_STAT_H  */
+diff --git a/sysdeps/unix/sysv/linux/sh/bits/struct_stat.h b/sysdeps/unix/sysv/linux/sh/bits/struct_stat.h
+new file mode 100644
+index 0000000000..0f7c9cdc89
+--- /dev/null
++++ b/sysdeps/unix/sysv/linux/sh/bits/struct_stat.h
+@@ -0,0 +1,139 @@
++/* Definition for struct stat.  Linux/sh version.
++   Copyright (C) 2020-2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library.  If not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#if !defined _SYS_STAT_H && !defined _FCNTL_H
++# error "Never include <bits/struct_stat.h> directly; use <sys/stat.h> instead."
++#endif
++
++#ifndef _BITS_STRUCT_STAT_H
++#define _BITS_STRUCT_STAT_H	1
++
++#include <bits/endian.h>
++#include <bits/wordsize.h>
++
++struct stat
++  {
++#ifdef __USE_TIME_BITS64
++# include <bits/struct_stat_time64_helper.h>
++#else
++    __dev_t st_dev;			/* Device.  */
++    unsigned short int __pad1;
++# ifndef __USE_FILE_OFFSET64
++    __ino_t st_ino;			/* File serial number.	*/
++# else
++    __ino_t __st_ino;			/* 32bit file serial number.	*/
++# endif
++    __mode_t st_mode;			/* File mode.  */
++    __nlink_t st_nlink;			/* Link count.  */
++    __uid_t st_uid;			/* User ID of the file's owner.	*/
++    __gid_t st_gid;			/* Group ID of the file's group.*/
++    __dev_t st_rdev;			/* Device number, if device.  */
++    unsigned short int __pad2;
++# ifndef __USE_FILE_OFFSET64
++    __off_t st_size;			/* Size of file, in bytes.  */
++# else
++    __off64_t st_size;			/* Size of file, in bytes.  */
++# endif
++    __blksize_t st_blksize;		/* Optimal block size for I/O.  */
++
++# ifndef __USE_FILE_OFFSET64
++    __blkcnt_t st_blocks;		/* Number 512-byte blocks allocated. */
++# else
++    __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
++# endif
++# ifdef __USE_XOPEN2K8
++    /* Nanosecond resolution timestamps are stored in a format
++       equivalent to 'struct timespec'.  This is the type used
++       whenever possible but the Unix namespace rules do not allow the
++       identifier 'timespec' to appear in the <sys/stat.h> header.
++       Therefore we have to handle the use of this header in strictly
++       standard-compliant sources special.  */
++    struct timespec st_atim;		/* Time of last access.  */
++    struct timespec st_mtim;		/* Time of last modification.  */
++    struct timespec st_ctim;		/* Time of last status change.  */
++#  define st_atime st_atim.tv_sec	/* Backward compatibility.  */
++#  define st_mtime st_mtim.tv_sec
++#  define st_ctime st_ctim.tv_sec
++# else
++    __time_t st_atime;			/* Time of last access.  */
++    unsigned long int st_atimensec;	/* Nscecs of last access.  */
++    __time_t st_mtime;			/* Time of last modification.  */
++    unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
++    __time_t st_ctime;			/* Time of last status change.  */
++    unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
++# endif
++# ifndef __USE_FILE_OFFSET64
++    unsigned long int __glibc_reserved4;
++    unsigned long int __glibc_reserved5;
++# else
++    __ino64_t st_ino;			/* File serial number.	*/
++# endif
++#endif /* __USE_TIME_BITS64  */
++  };
++
++#ifdef __USE_LARGEFILE64
++struct stat64
++  {
++# ifdef __USE_TIME_BITS64
++#  include <bits/struct_stat_time64_helper.h>
++# else
++    __dev_t st_dev;			/* Device.  */
++    unsigned int __pad1;
++
++    __ino_t __st_ino;			/* 32bit file serial number.	*/
++    __mode_t st_mode;			/* File mode.  */
++    __nlink_t st_nlink;			/* Link count.  */
++    __uid_t st_uid;			/* User ID of the file's owner.	*/
++    __gid_t st_gid;			/* Group ID of the file's group.*/
++    __dev_t st_rdev;			/* Device number, if device.  */
++    unsigned int __pad2;
++    __off64_t st_size;			/* Size of file, in bytes.  */
++    __blksize_t st_blksize;		/* Optimal block size for I/O.  */
++
++    __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
++#  ifdef __USE_XOPEN2K8
++    /* Nanosecond resolution timestamps are stored in a format
++       equivalent to 'struct timespec'.  This is the type used
++       whenever possible but the Unix namespace rules do not allow the
++       identifier 'timespec' to appear in the <sys/stat.h> header.
++       Therefore we have to handle the use of this header in strictly
++       standard-compliant sources special.  */
++    struct timespec st_atim;		/* Time of last access.  */
++    struct timespec st_mtim;		/* Time of last modification.  */
++    struct timespec st_ctim;		/* Time of last status change.  */
++#  else
++    __time_t st_atime;			/* Time of last access.  */
++    unsigned long int st_atimensec;	/* Nscecs of last access.  */
++    __time_t st_mtime;			/* Time of last modification.  */
++    unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
++    __time_t st_ctime;			/* Time of last status change.  */
++    unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
++#  endif
++    __ino64_t st_ino;			/* File serial number.		*/
++# endif /* __USE_TIME_BITS64  */
++  };
++#endif
++
++/* Tell code we have these members.  */
++#define	_STATBUF_ST_BLKSIZE
++#define _STATBUF_ST_RDEV
++/* Nanosecond resolution time values are supported.  */
++#define _STATBUF_ST_NSEC
++
++
++#endif /* _BITS_STRUCT_STAT_H  */
+-- 
+2.38.1
+
+
+From a1dc0be03c9dd850b864bd7a9c03cf8e396eb7ca Mon Sep 17 00:00:00 2001
+From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Tue, 25 Oct 2022 13:19:16 -0300
+Subject: [PATCH 66/72] elf: Reinstate on DL_DEBUG_BINDINGS _dl_lookup_symbol_x
+
+The prelink removal done by 6628c742b2c16e wrongly removed the debug
+support.
+
+Checked on x86_64-linux-gnu.
+
+(cherry picked from commit 891a7958a28eac6d4af1517dd2896fef5e4951d4)
+---
+ elf/dl-lookup.c | 17 +++++++++++++++++
+ 1 file changed, 17 insertions(+)
+
+diff --git a/elf/dl-lookup.c b/elf/dl-lookup.c
+index 4c86dc694e..67fb2e31e2 100644
+--- a/elf/dl-lookup.c
++++ b/elf/dl-lookup.c
+@@ -854,6 +854,23 @@ _dl_lookup_symbol_x (const char *undef_name, struct link_map *undef_map,
+   if (__glibc_unlikely (current_value.m->l_used == 0))
+     current_value.m->l_used = 1;
+ 
++ if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_BINDINGS))
++   {
++      const char *reference_name = undef_map->l_name;
++
++      _dl_debug_printf ("binding file %s [%lu] to %s [%lu]: %s symbol `%s'",
++			DSO_FILENAME (reference_name),
++			undef_map->l_ns,
++			DSO_FILENAME (current_value.m->l_name),
++			current_value.m->l_ns,
++			protected ? "protected" : "normal", undef_name);
++      if (version)
++	_dl_debug_printf_c (" [%s]\n", version->name);
++      else
++	_dl_debug_printf_c ("\n");
++   }
++
++
+   *ref = current_value.s;
+   return LOOKUP_VALUE (current_value.m);
+ }
+-- 
+2.38.1
+
+
+From 4c6a78addabbd6e1b69763e286768919e56dfe0a Mon Sep 17 00:00:00 2001
+From: Xi Ruoyao <xry111@xry111.site>
+Date: Sat, 15 Oct 2022 14:12:13 +0800
+Subject: [PATCH 67/72] longlong.h: update from GCC for LoongArch clz/ctz
+ support
+
+Update longlong.h to GCC r13-3269.  Keep our local change (prefer https
+for gnu.org URL).
+---
+ stdlib/longlong.h | 12 ++++++++++++
+ 1 file changed, 12 insertions(+)
+
+diff --git a/stdlib/longlong.h b/stdlib/longlong.h
+index 9b89469ac2..d8f76a43b5 100644
+--- a/stdlib/longlong.h
++++ b/stdlib/longlong.h
+@@ -593,6 +593,18 @@ extern UDItype __umulsidi3 (USItype, USItype);
+ #define UMUL_TIME 14
+ #endif
+ 
++#ifdef __loongarch__
++# if W_TYPE_SIZE == 32
++#  define count_leading_zeros(count, x)  ((count) = __builtin_clz (x))
++#  define count_trailing_zeros(count, x) ((count) = __builtin_ctz (x))
++#  define COUNT_LEADING_ZEROS_0 32
++# elif W_TYPE_SIZE == 64
++#  define count_leading_zeros(count, x)  ((count) = __builtin_clzll (x))
++#  define count_trailing_zeros(count, x) ((count) = __builtin_ctzll (x))
++#  define COUNT_LEADING_ZEROS_0 64
++# endif
++#endif
++
+ #if defined (__M32R__) && W_TYPE_SIZE == 32
+ #define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+   /* The cmp clears the condition bit.  */ \
+-- 
+2.38.1
+
+
+From dd4131c8322891a0ad7cfb661efa41aecc02b581 Mon Sep 17 00:00:00 2001
+From: Aurelien Jarno <aurelien@aurel32.net>
+Date: Tue, 1 Nov 2022 20:43:55 +0100
+Subject: [PATCH 68/72] linux: Fix fstatat on MIPSn64 (BZ #29730)
+
+Commit 6e8a0aac2f883 ("time: Fix overflow itimer tests on 32-bit
+systems") changed in_time_t_range to assume a 32-bit time_t. This broke
+fstatat on MIPSn64 that was using it with a 64-bit time_t due to
+difference between stat and stat64. This commit fix that by adding a
+MIPSn64 specific version, which bypasses the EOVERFLOW tests.
+
+Resolves: BZ #29730
+
+Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
+(cherry picked from commit 7457b7eef8dfe8cc48e55b9f9837df6dd397b80d)
+---
+ NEWS                                          |  1 +
+ .../unix/sysv/linux/mips/mips64/n64/fstatat.c | 51 +++++++++++++++++++
+ 2 files changed, 52 insertions(+)
+ create mode 100644 sysdeps/unix/sysv/linux/mips/mips64/n64/fstatat.c
+
+diff --git a/NEWS b/NEWS
+index 833045585f..e92d547e2c 100644
+--- a/NEWS
++++ b/NEWS
+@@ -45,6 +45,7 @@ The following bugs are resolved with this release:
+   [29638] libc: stdlib: arc4random fallback is never used
+   [29657] libc: Incorrect struct stat for 64-bit time on linux/generic
+     platforms
++  [29730] broken y2038 support in fstatat on MIPS N64
+ \f
+ Version 2.36
+ 
+diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/fstatat.c b/sysdeps/unix/sysv/linux/mips/mips64/n64/fstatat.c
+new file mode 100644
+index 0000000000..fe6c3a0dda
+--- /dev/null
++++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/fstatat.c
+@@ -0,0 +1,51 @@
++/* Get file status.  Linux/MIPSn64 version.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <sys/stat.h>
++#include <sysdep.h>
++
++/* Different than other ABIs, mips64 has different layouts for non-LFS
++   and LFS struct stat.  */
++int
++__fstatat (int fd, const char *file, struct stat *buf, int flag)
++{
++  struct __stat64_t64 st64;
++  int r = __fstatat64_time64 (fd, file, &st64, flag);
++  if (r == 0)
++    {
++      /* Clear internal pad and reserved fields.  */
++      memset (buf, 0, sizeof (*buf));
++
++      buf->st_dev = st64.st_dev;
++      buf->st_ino = st64.st_ino;
++      buf->st_mode = st64.st_mode;
++      buf->st_nlink = st64.st_nlink;
++      buf->st_uid = st64.st_uid;
++      buf->st_gid = st64.st_gid;
++      buf->st_rdev = st64.st_rdev;
++      buf->st_size = st64.st_size;
++      buf->st_blksize = st64.st_blksize;
++      buf->st_blocks  = st64.st_blocks;
++      buf->st_atim = st64.st_atim;
++      buf->st_mtim = st64.st_mtim;
++      buf->st_ctim = st64.st_ctim;
++    }
++  return r;
++}
++
++weak_alias (__fstatat, fstatat)
+-- 
+2.38.1
+
+
+From 2fce85f67c56e46863db40b8ca75bbf0fa993053 Mon Sep 17 00:00:00 2001
+From: caiyinyu <caiyinyu@loongson.cn>
+Date: Wed, 12 Oct 2022 20:28:42 +0800
+Subject: [PATCH 69/72] LoongArch: Fix ABI related macros in elf.h to keep
+ consistent with binutils[1].
+
+[1]:
+https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=c4a7e6b56218e1d5a858682186b542e2eae01a4a;hp=0d94a8735055432029237612a6eb9165db1ec9dd
+[2]:
+Reference: https://loongson.github.io/LoongArch-Documentation/LoongArch-ELF-ABI-EN.html#_e_flags_identifies_abi_type_and_version
+---
+ elf/elf.h | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/elf/elf.h b/elf/elf.h
+index 02a1b3f52f..014393f3cc 100644
+--- a/elf/elf.h
++++ b/elf/elf.h
+@@ -4085,8 +4085,11 @@ enum
+ #define R_NDS32_TLS_DESC	119
+ 
+ /* LoongArch ELF Flags */
+-#define EF_LARCH_ABI    	0x07
+-#define EF_LARCH_ABI_LP64D	0x03
++#define EF_LARCH_ABI_MODIFIER_MASK  0x07
++#define EF_LARCH_ABI_SOFT_FLOAT     0x01
++#define EF_LARCH_ABI_SINGLE_FLOAT   0x02
++#define EF_LARCH_ABI_DOUBLE_FLOAT   0x03
++#define EF_LARCH_OBJABI_V1          0x40
+ 
+ /* LoongArch specific dynamic relocations */
+ #define R_LARCH_NONE		0
+-- 
+2.38.1
+
+
+From 36cc06341a0c5029f49efaeef744dc3e9758e669 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <slyich@gmail.com>
+Date: Tue, 13 Sep 2022 13:39:13 -0400
+Subject: [PATCH 70/72] Makerules: fix MAKEFLAGS assignment for upcoming
+ make-4.4 [BZ# 29564]
+
+make-4.4 will add long flags to MAKEFLAGS variable:
+
+    * WARNING: Backward-incompatibility!
+      Previously only simple (one-letter) options were added to the MAKEFLAGS
+      variable that was visible while parsing makefiles.  Now, all options
+      are available in MAKEFLAGS.
+
+This causes locale builds to fail when long options are used:
+
+    $ make --shuffle
+    ...
+    make  -C localedata install-locales
+    make: invalid shuffle mode: '1662724426r'
+
+The change fixes it by passing eash option via whitespace and dashes.
+That way option is appended to both single-word form and whitespace
+separated form.
+
+While at it fixed --silent mode detection in $(MAKEFLAGS) by filtering
+out --long-options. Otherwise options like --shuffle flag enable silent
+mode unintentionally. $(silent-make) variable consolidates the checks.
+
+Resolves: BZ# 29564
+
+CC: Paul Smith <psmith@gnu.org>
+CC: Siddhesh Poyarekar <siddhesh@gotplt.org>
+Signed-off-by: Sergei Trofimovich <slyich@gmail.com>
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit 2d7ed98add14f75041499ac189696c9bd3d757fe)
+---
+ Makeconfig     | 18 +++++++++++++++++-
+ Makerules      |  4 ++--
+ elf/rtld-Rules |  2 +-
+ 3 files changed, 20 insertions(+), 4 deletions(-)
+
+diff --git a/Makeconfig b/Makeconfig
+index ba70321af1..2bbcabd8f9 100644
+--- a/Makeconfig
++++ b/Makeconfig
+@@ -43,6 +43,22 @@ else
+ $(error objdir must be defined by the build-directory Makefile)
+ endif
+ 
++# Did we request 'make -s' run? "yes" or "no".
++# Starting from make-4.4 MAKEFLAGS now contains long
++# options like '--shuffle'. To detect presence of 's'
++# we pick first word with short options. Long options
++# are guaranteed to come after whitespace. We use '-'
++# prefix to always have a word before long options
++# even if no short options were passed.
++# Typical MAKEFLAGS values to watch for:
++#   "rs --shuffle=42" (silent)
++#   " --shuffle" (not silent)
++ifeq ($(findstring s, $(firstword -$(MAKEFLAGS))),)
++silent-make := no
++else
++silent-make := yes
++endif
++
+ # Root of the sysdeps tree.
+ sysdep_dir := $(..)sysdeps
+ export sysdep_dir := $(sysdep_dir)
+@@ -917,7 +933,7 @@ endif
+ # umpteen zillion filenames along with it (we use `...' instead)
+ # but we don't want this echoing done when the user has said
+ # he doesn't want to see commands echoed by using -s.
+-ifneq	"$(findstring s,$(MAKEFLAGS))" ""	# if -s
++ifeq ($(silent-make),yes)			# if -s
+ +cmdecho	:= echo >/dev/null
+ else						# not -s
+ +cmdecho	:= echo
+diff --git a/Makerules b/Makerules
+index d1e139d03c..09c0cf8357 100644
+--- a/Makerules
++++ b/Makerules
+@@ -794,7 +794,7 @@ endif
+ # Maximize efficiency by minimizing the number of rules.
+ .SUFFIXES:	# Clear the suffix list.  We don't use suffix rules.
+ # Don't define any builtin rules.
+-MAKEFLAGS := $(MAKEFLAGS)r
++MAKEFLAGS := $(MAKEFLAGS) -r
+ 
+ # Generic rule for making directories.
+ %/:
+@@ -811,7 +811,7 @@ MAKEFLAGS := $(MAKEFLAGS)r
+ .PRECIOUS: $(foreach l,$(libtypes),$(patsubst %,$(common-objpfx)$l,c))
+ \f
+ # Use the verbose option of ar and tar when not running silently.
+-ifeq	"$(findstring s,$(MAKEFLAGS))" ""	# if not -s
++ifeq ($(silent-make),no)			# if not -s
+ verbose := v
+ else	   					# -s
+ verbose	:=
+diff --git a/elf/rtld-Rules b/elf/rtld-Rules
+index ca00dd1fe2..3c5e273f2b 100644
+--- a/elf/rtld-Rules
++++ b/elf/rtld-Rules
+@@ -52,7 +52,7 @@ $(objpfx)rtld-libc.a: $(foreach dir,$(rtld-subdirs),\
+ 	mv -f $@T $@
+ 
+ # Use the verbose option of ar and tar when not running silently.
+-ifeq	"$(findstring s,$(MAKEFLAGS))" ""	# if not -s
++ifeq ($(silent-make),no)			# if not -s
+ verbose := v
+ else						# -s
+ verbose	:=
+-- 
+2.38.1
+
+
+From 70410f2286cc36c9ccb133878811c728ae51725f Mon Sep 17 00:00:00 2001
+From: Paul Eggert <eggert@cs.ucla.edu>
+Date: Thu, 8 Sep 2022 20:08:32 -0500
+Subject: [PATCH 71/72] mktime: improve heuristic for ca-1986 Indiana DST
+
+This patch syncs mktime.c from Gnulib, fixing a
+problem reported by Mark Krenz <https://bugs.gnu.org/48085>,
+and it should fix BZ#29035 too.
+* time/mktime.c (__mktime_internal): Be more generous about
+accepting arguments with the wrong value of tm_isdst, by falling
+back to a one-hour DST difference if we find no nearby DST that is
+unusual.  This fixes a problem where "1986-04-28 00:00 EDT" was
+rejected when TZ="America/Indianapolis" because the nearest DST
+timestamp occurred in 1970, a temporal distance too great for the
+old heuristic.  This also also narrows the search a bit, which
+is a minor performance win.
+
+(cherry picked from commit 83859e1115269cf56d21669361d4ddbe2687831c)
+---
+ time/mktime.c | 28 ++++++++++++++++++++--------
+ 1 file changed, 20 insertions(+), 8 deletions(-)
+
+diff --git a/time/mktime.c b/time/mktime.c
+index 494c89bf54..e9a6006710 100644
+--- a/time/mktime.c
++++ b/time/mktime.c
+@@ -429,8 +429,13 @@ __mktime_internal (struct tm *tp,
+ 	 time with the right value, and use its UTC offset.
+ 
+ 	 Heuristic: probe the adjacent timestamps in both directions,
+-	 looking for the desired isdst.  This should work for all real
+-	 time zone histories in the tz database.  */
++	 looking for the desired isdst.  If none is found within a
++	 reasonable duration bound, assume a one-hour DST difference.
++	 This should work for all real time zone histories in the tz
++	 database.  */
++
++      /* +1 if we wanted standard time but got DST, -1 if the reverse.  */
++      int dst_difference = (isdst == 0) - (tm.tm_isdst == 0);
+ 
+       /* Distance between probes when looking for a DST boundary.  In
+ 	 tzdata2003a, the shortest period of DST is 601200 seconds
+@@ -441,12 +446,14 @@ __mktime_internal (struct tm *tp,
+ 	 periods when probing.  */
+       int stride = 601200;
+ 
+-      /* The longest period of DST in tzdata2003a is 536454000 seconds
+-	 (e.g., America/Jujuy starting 1946-10-01 01:00).  The longest
+-	 period of non-DST is much longer, but it makes no real sense
+-	 to search for more than a year of non-DST, so use the DST
+-	 max.  */
+-      int duration_max = 536454000;
++      /* In TZDB 2021e, the longest period of DST (or of non-DST), in
++	 which the DST (or adjacent DST) difference is not one hour,
++	 is 457243209 seconds: e.g., America/Cambridge_Bay with leap
++	 seconds, starting 1965-10-31 00:00 in a switch from
++	 double-daylight time (-05) to standard time (-07), and
++	 continuing to 1980-04-27 02:00 in a switch from standard time
++	 (-07) to daylight time (-06).  */
++      int duration_max = 457243209;
+ 
+       /* Search in both directions, so the maximum distance is half
+ 	 the duration; add the stride to avoid off-by-1 problems.  */
+@@ -483,6 +490,11 @@ __mktime_internal (struct tm *tp,
+ 	      }
+ 	  }
+ 
++      /* No unusual DST offset was found nearby.  Assume one-hour DST.  */
++      t += 60 * 60 * dst_difference;
++      if (mktime_min <= t && t <= mktime_max && convert_time (convert, t, &tm))
++	goto offset_found;
++
+       __set_errno (EOVERFLOW);
+       return -1;
+     }
+-- 
+2.38.1
+
+
+From 0f90d6204d79223fd32248c774df0cb7f0e604de Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 8 Nov 2022 14:15:02 +0100
+Subject: [PATCH 72/72] Linux: Support __IPC_64 in sysvctl *ctl command
+ arguments (bug 29771)
+
+Old applications pass __IPC_64 as part of the command argument because
+old glibc did not check for unknown commands, and passed through the
+arguments directly to the kernel, without adding __IPC_64.
+Applications need to continue doing that for old glibc compatibility,
+so this commit enables this approach in current glibc.
+
+For msgctl and shmctl, if no translation is required, make
+direct system calls, as we did before the time64 changes.  If
+translation is required, mask __IPC_64 from the command argument.
+
+For semctl, the union-in-vararg argument handling means that
+translation is needed on all architectures.
+
+Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
+(cherry picked from commit 22a46dee24351fd5f4f188ad80554cad79c82524)
+---
+ NEWS                               |  1 +
+ sysdeps/unix/sysv/linux/ipc_priv.h |  6 +++++
+ sysdeps/unix/sysv/linux/msgctl.c   | 38 ++++++++++++++++++++----------
+ sysdeps/unix/sysv/linux/semctl.c   |  7 ++++++
+ sysdeps/unix/sysv/linux/shmctl.c   | 38 ++++++++++++++++++++----------
+ 5 files changed, 64 insertions(+), 26 deletions(-)
+
+diff --git a/NEWS b/NEWS
+index e92d547e2c..9f8edea5db 100644
+--- a/NEWS
++++ b/NEWS
+@@ -46,6 +46,7 @@ The following bugs are resolved with this release:
+   [29657] libc: Incorrect struct stat for 64-bit time on linux/generic
+     platforms
+   [29730] broken y2038 support in fstatat on MIPS N64
++  [29771] Restore IPC_64 support in sysvipc *ctl functions
+ \f
+ Version 2.36
+ 
+diff --git a/sysdeps/unix/sysv/linux/ipc_priv.h b/sysdeps/unix/sysv/linux/ipc_priv.h
+index 87893a6757..2f50c31a8e 100644
+--- a/sysdeps/unix/sysv/linux/ipc_priv.h
++++ b/sysdeps/unix/sysv/linux/ipc_priv.h
+@@ -63,4 +63,10 @@ struct __old_ipc_perm
+ # define __IPC_TIME64 0
+ #endif
+ 
++#if __IPC_TIME64 || defined __ASSUME_SYSVIPC_BROKEN_MODE_T
++# define IPC_CTL_NEED_TRANSLATION 1
++#else
++# define IPC_CTL_NEED_TRANSLATION 0
++#endif
++
+ #include <ipc_ops.h>
+diff --git a/sysdeps/unix/sysv/linux/msgctl.c b/sysdeps/unix/sysv/linux/msgctl.c
+index e824ebb095..2072205252 100644
+--- a/sysdeps/unix/sysv/linux/msgctl.c
++++ b/sysdeps/unix/sysv/linux/msgctl.c
+@@ -85,11 +85,19 @@ msgctl_syscall (int msqid, int cmd, msgctl_arg_t *buf)
+ int
+ __msgctl64 (int msqid, int cmd, struct __msqid64_ds *buf)
+ {
+-#if __IPC_TIME64
++#if IPC_CTL_NEED_TRANSLATION
++# if __IPC_TIME64
+   struct kernel_msqid64_ds ksemid, *arg = NULL;
+-#else
++# else
+   msgctl_arg_t *arg;
+-#endif
++# endif
++
++  /* Some applications pass the __IPC_64 flag in cmd, to invoke
++     previously unsupported commands back when there was no EINVAL
++     error checking in glibc.  Mask the flag for the switch statements
++     below.  msgctl_syscall adds back the __IPC_64 flag for the actual
++     system call.  */
++  cmd &= ~__IPC_64;
+ 
+   switch (cmd)
+     {
+@@ -101,19 +109,19 @@ __msgctl64 (int msqid, int cmd, struct __msqid64_ds *buf)
+     case IPC_STAT:
+     case MSG_STAT:
+     case MSG_STAT_ANY:
+-#if __IPC_TIME64
++# if __IPC_TIME64
+       if (buf != NULL)
+ 	{
+ 	  msqid64_to_kmsqid64 (buf, &ksemid);
+ 	  arg = &ksemid;
+ 	}
+-# ifdef __ASSUME_SYSVIPC_BROKEN_MODE_T
++#  ifdef __ASSUME_SYSVIPC_BROKEN_MODE_T
+       if (cmd == IPC_SET)
+ 	arg->msg_perm.mode *= 0x10000U;
+-# endif
+-#else
++#  endif
++# else
+       arg = buf;
+-#endif
++# endif
+       break;
+ 
+     case IPC_INFO:
+@@ -137,21 +145,25 @@ __msgctl64 (int msqid, int cmd, struct __msqid64_ds *buf)
+     case IPC_STAT:
+     case MSG_STAT:
+     case MSG_STAT_ANY:
+-#ifdef __ASSUME_SYSVIPC_BROKEN_MODE_T
++# ifdef __ASSUME_SYSVIPC_BROKEN_MODE_T
+       arg->msg_perm.mode >>= 16;
+-#else
++# else
+       /* Old Linux kernel versions might not clear the mode padding.  */
+       if (sizeof ((struct msqid_ds){0}.msg_perm.mode)
+           != sizeof (__kernel_mode_t))
+ 	arg->msg_perm.mode &= 0xFFFF;
+-#endif
++# endif
+ 
+-#if __IPC_TIME64
++# if __IPC_TIME64
+       kmsqid64_to_msqid64 (arg, buf);
+-#endif
++# endif
+     }
+ 
+   return ret;
++
++#else /* !IPC_CTL_NEED_TRANSLATION */
++  return msgctl_syscall (msqid, cmd, buf);
++#endif
+ }
+ #if __TIMESIZE != 64
+ libc_hidden_def (__msgctl64)
+diff --git a/sysdeps/unix/sysv/linux/semctl.c b/sysdeps/unix/sysv/linux/semctl.c
+index 77a8130c18..3458b018bc 100644
+--- a/sysdeps/unix/sysv/linux/semctl.c
++++ b/sysdeps/unix/sysv/linux/semctl.c
+@@ -140,6 +140,13 @@ __semctl64 (int semid, int semnum, int cmd, ...)
+   union semun64 arg64 = { 0 };
+   va_list ap;
+ 
++  /* Some applications pass the __IPC_64 flag in cmd, to invoke
++     previously unsupported commands back when there was no EINVAL
++     error checking in glibc.  Mask the flag for the switch statements
++     below.  semctl_syscall adds back the __IPC_64 flag for the actual
++     system call.  */
++  cmd &= ~__IPC_64;
++
+   /* Get the argument only if required.  */
+   switch (cmd)
+     {
+diff --git a/sysdeps/unix/sysv/linux/shmctl.c b/sysdeps/unix/sysv/linux/shmctl.c
+index ea38935497..f00817a6f6 100644
+--- a/sysdeps/unix/sysv/linux/shmctl.c
++++ b/sysdeps/unix/sysv/linux/shmctl.c
+@@ -85,11 +85,19 @@ shmctl_syscall (int shmid, int cmd, shmctl_arg_t *buf)
+ int
+ __shmctl64 (int shmid, int cmd, struct __shmid64_ds *buf)
+ {
+-#if __IPC_TIME64
++#if IPC_CTL_NEED_TRANSLATION
++# if __IPC_TIME64
+   struct kernel_shmid64_ds kshmid, *arg = NULL;
+-#else
++# else
+   shmctl_arg_t *arg;
+-#endif
++# endif
++
++  /* Some applications pass the __IPC_64 flag in cmd, to invoke
++     previously unsupported commands back when there was no EINVAL
++     error checking in glibc.  Mask the flag for the switch statements
++     below.  shmctl_syscall adds back the __IPC_64 flag for the actual
++     system call.  */
++  cmd &= ~__IPC_64;
+ 
+   switch (cmd)
+     {
+@@ -103,19 +111,19 @@ __shmctl64 (int shmid, int cmd, struct __shmid64_ds *buf)
+     case IPC_STAT:
+     case SHM_STAT:
+     case SHM_STAT_ANY:
+-#if __IPC_TIME64
++# if __IPC_TIME64
+       if (buf != NULL)
+ 	{
+ 	  shmid64_to_kshmid64 (buf, &kshmid);
+ 	  arg = &kshmid;
+ 	}
+-# ifdef __ASSUME_SYSVIPC_BROKEN_MODE_T
++#  ifdef __ASSUME_SYSVIPC_BROKEN_MODE_T
+       if (cmd == IPC_SET)
+         arg->shm_perm.mode *= 0x10000U;
+-# endif
+-#else
++#  endif
++# else
+       arg = buf;
+-#endif
++# endif
+       break;
+ 
+     case IPC_INFO:
+@@ -140,21 +148,25 @@ __shmctl64 (int shmid, int cmd, struct __shmid64_ds *buf)
+       case IPC_STAT:
+       case SHM_STAT:
+       case SHM_STAT_ANY:
+-#ifdef __ASSUME_SYSVIPC_BROKEN_MODE_T
++# ifdef __ASSUME_SYSVIPC_BROKEN_MODE_T
+         arg->shm_perm.mode >>= 16;
+-#else
++# else
+       /* Old Linux kernel versions might not clear the mode padding.  */
+       if (sizeof ((struct shmid_ds){0}.shm_perm.mode)
+ 	  != sizeof (__kernel_mode_t))
+ 	arg->shm_perm.mode &= 0xFFFF;
+-#endif
++# endif
+ 
+-#if __IPC_TIME64
++# if __IPC_TIME64
+       kshmid64_to_shmid64 (arg, buf);
+-#endif
++# endif
+     }
+ 
+   return ret;
++
++#else /* !IPC_CTL_NEED_TRANSLATION */
++  return shmctl_syscall (shmid, cmd, buf);
++#endif
+ }
+ #if __TIMESIZE != 64
+ libc_hidden_def (__shmctl64)
+-- 
+2.38.1
+
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..6aad6a87d24d 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,18 @@
 # Template file for 'glibc'
+#
+# The latest glibc stable patches can be obtained by checking out release/${version}/master and doing:
+# git format-patch $(git describe --abbrev=0 --match 'glibc-*') --stdout > git-updates.patch
+#
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +24,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +59,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +167,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From f6882f8f4a85cfd9cef51848d4f3d0a9e79055a3 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 07/37] musl: add support for SIGEV_THREAD_ID timers

https://git.musl-libc.org/cgit/musl/commit/?id=7c71792e87691451f2a6b76348e83ad1889f1dcb
---
 ...d-support-for-SIGEV_THREAD_ID-timers.patch | 74 +++++++++++++++++++
 srcpkgs/musl/template                         |  2 +-
 2 files changed, 75 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch

diff --git a/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
new file mode 100644
index 000000000000..e20dff5ba0d4
--- /dev/null
+++ b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
@@ -0,0 +1,74 @@
+From 7c71792e87691451f2a6b76348e83ad1889f1dcb Mon Sep 17 00:00:00 2001
+From: James Y Knight <jyknight@google.com>
+Date: Sun, 30 Jun 2019 21:55:20 -0400
+Subject: [PATCH] add support for SIGEV_THREAD_ID timers
+
+This is like SIGEV_SIGNAL, but targeted to a particular thread's
+tid, rather than the process.
+---
+ include/signal.h        | 16 +++++++++++++---
+ src/time/timer_create.c |  8 ++++++--
+ 2 files changed, 19 insertions(+), 5 deletions(-)
+
+diff --git a/include/signal.h b/include/signal.h
+index fbdf667b2..9ed929e4f 100644
+--- a/include/signal.h
++++ b/include/signal.h
+@@ -180,14 +180,24 @@ struct sigevent {
+ 	union sigval sigev_value;
+ 	int sigev_signo;
+ 	int sigev_notify;
+-	void (*sigev_notify_function)(union sigval);
+-	pthread_attr_t *sigev_notify_attributes;
+-	char __pad[56-3*sizeof(long)];
++	union {
++		char __pad[64 - 2*sizeof(int) - sizeof(union sigval)];
++		pid_t sigev_notify_thread_id;
++		struct {
++			void (*sigev_notify_function)(union sigval);
++			pthread_attr_t *sigev_notify_attributes;
++		} __sev_thread;
++	} __sev_fields;
+ };
+ 
++#define sigev_notify_thread_id __sev_fields.sigev_notify_thread_id
++#define sigev_notify_function __sev_fields.__sev_thread.sigev_notify_function
++#define sigev_notify_attributes __sev_fields.__sev_thread.sigev_notify_attributes
++
+ #define SIGEV_SIGNAL 0
+ #define SIGEV_NONE 1
+ #define SIGEV_THREAD 2
++#define SIGEV_THREAD_ID 4
+ 
+ int __libc_current_sigrtmin(void);
+ int __libc_current_sigrtmax(void);
+diff --git a/src/time/timer_create.c b/src/time/timer_create.c
+index 5ddfda278..4bef23905 100644
+--- a/src/time/timer_create.c
++++ b/src/time/timer_create.c
+@@ -71,11 +71,15 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 	switch (evp ? evp->sigev_notify : SIGEV_SIGNAL) {
+ 	case SIGEV_NONE:
+ 	case SIGEV_SIGNAL:
++	case SIGEV_THREAD_ID:
+ 		if (evp) {
+ 			ksev.sigev_value = evp->sigev_value;
+ 			ksev.sigev_signo = evp->sigev_signo;
+ 			ksev.sigev_notify = evp->sigev_notify;
+-			ksev.sigev_tid = 0;
++			if (evp->sigev_notify == SIGEV_THREAD_ID)
++				ksev.sigev_tid = evp->sigev_notify_thread_id;
++			else
++				ksev.sigev_tid = 0;
+ 			ksevp = &ksev;
+ 		}
+ 		if (syscall(SYS_timer_create, clk, ksevp, &timerid) < 0)
+@@ -107,7 +111,7 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 
+ 		ksev.sigev_value.sival_ptr = 0;
+ 		ksev.sigev_signo = SIGTIMER;
+-		ksev.sigev_notify = 4; /* SIGEV_THREAD_ID */
++		ksev.sigev_notify = SIGEV_THREAD_ID;
+ 		ksev.sigev_tid = td->tid;
+ 		if (syscall(SYS_timer_create, clk, &ksev, &timerid) < 0)
+ 			timerid = -1;
diff --git a/srcpkgs/musl/template b/srcpkgs/musl/template
index 34e6ed4fba6e..afb33cd868b5 100644
--- a/srcpkgs/musl/template
+++ b/srcpkgs/musl/template
@@ -2,7 +2,7 @@
 pkgname=musl
 reverts="1.2.0_1"
 version=1.1.24
-revision=11
+revision=12
 archs="*-musl"
 bootstrap=yes
 build_style=gnu-configure

From d8e2d25b1b2904d15f18451043abd510bb24a080 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 08/37] gcc-multilib: update to 12.2.0.

---
 srcpkgs/gcc-multilib/template | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index f28eb237c287..ba9bafcadfd6 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,15 +3,15 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _majorver="${version%.*}"
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel
@@ -70,7 +70,7 @@ do_build() {
 	make ${makejobs}
 }
 do_install() {
-	local _pc_triplet=x86_64-pc-linux-gnu _version=${version%pre1}
+	local _pc_triplet=x86_64-pc-linux-gnu
 	# Install to a tempdir and then only copy relevant files.
 	cd ${wrksrc}
 	make DESTDIR=${wrksrc}/${pkgname}-build install
@@ -80,9 +80,9 @@ do_install() {
 	vmkdir usr/include/c++/${_majorver}/${_triplet}
 	vmkdir usr/lib/gcc/${_triplet}/${_majorver}
 
-	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${_version}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${version}/32 \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_majorver}/
-	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${_version}/${_pc_triplet}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${version}/${_pc_triplet}/32 \
 		${DESTDIR}/usr/include/c++/${_majorver}/${_triplet}
 
 	vinstall ${wrksrc}/host-${_pc_triplet}/gcc/specs 644 usr/lib/gcc/${_triplet}/${_majorver}

From 6dfb5093933574fb2d2d1e51032bf01a770d054b Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 09/37] libgccjit: update to 12.2.0.

---
 srcpkgs/libgccjit/files/libgccjit-musl.patch | 63 --------------------
 srcpkgs/libgccjit/template                   | 24 +++-----
 2 files changed, 9 insertions(+), 78 deletions(-)
 delete mode 100644 srcpkgs/libgccjit/files/libgccjit-musl.patch

diff --git a/srcpkgs/libgccjit/files/libgccjit-musl.patch b/srcpkgs/libgccjit/files/libgccjit-musl.patch
deleted file mode 100644
index d2ed16928c82..000000000000
--- a/srcpkgs/libgccjit/files/libgccjit-musl.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-diff --git a/gcc/jit/jit-playback.c b/gcc/jit/jit-playback.c
-index 5bccf591a..35f5e35ef 100644
---- a/gcc/jit/jit-playback.c
-+++ b/gcc/jit/jit-playback.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -41,8 +43,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "diagnostic.h"
- #include "stmt.h"
- 
--#include <pthread.h>
--
- #include "jit-playback.h"
- #include "jit-result.h"
- #include "jit-builtins.h"
-diff --git a/gcc/jit/jit-recording.c b/gcc/jit/jit-recording.c
-index a237d574f..5785e3269 100644
---- a/gcc/jit/jit-recording.c
-+++ b/gcc/jit/jit-recording.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -25,8 +27,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "pretty-print.h"
- #include "toplev.h"
- 
--#include <pthread.h>
--
- #include "jit-builtins.h"
- #include "jit-recording.h"
- #include "jit-playback.h"
-diff --git a/gcc/jit/libgccjit.c b/gcc/jit/libgccjit.c
-index f9c33c63c..75f21d275 100644
---- a/gcc/jit/libgccjit.c
-+++ b/gcc/jit/libgccjit.c
-@@ -18,13 +18,13 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
- #include "timevar.h"
- #include "typed-splay-tree.h"
- #include "cppbuiltin.h"
--#include <pthread.h>
- 
- #include "libgccjit.h"
- #include "jit-recording.h"
diff --git a/srcpkgs/libgccjit/template b/srcpkgs/libgccjit/template
index 0b37c3ee9f8b..fde1affd54b7 100644
--- a/srcpkgs/libgccjit/template
+++ b/srcpkgs/libgccjit/template
@@ -3,18 +3,12 @@
 # which use the version number.
 
 pkgname=libgccjit
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
+version=12.2.0
 revision=1
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
-_majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 create_wrksrc=yes
 short_desc="Just-In-Time Compilation library for GCC"
 maintainer="Lane Biocini <lane@mailbox.org>"
@@ -22,16 +16,16 @@ homepage="https://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 nopie=yes
 lib32disabled=yes
 makedepends="zlib-devel"

From 27bb04dffd22677861c14c933467c4acea965a79 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 10/37] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove -no-pie from build. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..f7e02dbc48cb 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -53,6 +53,7 @@ _void_cross_build_binutils() {
 		--sbindir=/usr/bin \
 		--libdir=/usr/lib \
 		--libexecdir=/usr/lib \
+		--sysconfdir=/etc \
 		--target=${tgt} \
 		--with-sysroot=/usr/${tgt} \
 		--disable-nls \
@@ -60,7 +61,9 @@ _void_cross_build_binutils() {
 		--disable-multilib \
 		--disable-werror \
 		--disable-gold \
+		--disable-gprofng \
 		--enable-relro \
+		--enable-new-dtags \
 		--enable-plugins \
 		--enable-64-bit-bfd \
 		--enable-deterministic-archives \
@@ -91,6 +94,9 @@ _void_cross_build_bootstrap_gcc() {
 	# Do not run fixincludes
 	sed -i 's@./fixinc.sh@-c true@' Makefile.in
 
+	# Do not use system headers to determine clocale implementation
+	sed -i 's/#if (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined(__UCLIBC__)/#if 1/g' libstdc++-v3/configure
+
 	for f in ${XBPS_SRCPKGDIR}/gcc/patches/*.patch; do
 		_void_cross_apply_patch "$f"
 	done
@@ -132,6 +138,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -381,6 +388,7 @@ _void_cross_build_gcc() {
 		extra_args+=" --disable-gnu-unique-object"
 		extra_args+=" libat_cv_have_ifunc=no"
 	else
+		extra_args+=" --enable-clocale=gnu"
 		extra_args+=" --enable-gnu-unique-object"
 	fi
 
@@ -460,6 +468,14 @@ do_build() {
 	local binutils_ver linux_ver gcc_ver libc_ver libucontext_ver
 	local tgt=${sourcepkg/cross-}
 
+	export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}"
+	export CXXFLAGS="${CXXFLAGS/-D_FORTIFY_SOURCE=2/}"
+
+	# Disable explicit -fno-PIE, gcc/binutils/libc will figure this out itself.
+	export CFLAGS="${CFLAGS//-fno-PIE/}"
+	export CXXFLAGS="${CXXFLAGS//-fno-PIE/}"
+	export LDFLAGS="${LDFLAGS//-no-pie/}"
+
 	_void_cross_test_ver binutils
 	_void_cross_test_ver linux
 	_void_cross_test_ver gcc
@@ -625,6 +641,9 @@ do_install() {
 	# then remove it because it conflicts with libquadmath package
 	rm -rf ${DESTDIR}/${sysroot}/usr/lib/libquadmath.*
 
+	# Remove libdep linker plugin because it conflicts with system binutils
+	rm -f ${DESTDIR}/usr/lib/bfd-plugins/libdep*
+
 	# Remove leftover symlinks
 	rm -f ${DESTDIR}/usr/lib${XBPS_TARGET_WORDSIZE}
 	rm -f ${DESTDIR}/lib*

From c1d3fb708ba42d9fbf6c965345e16c23efa279cd Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 11/37] qemu: remove broken patch

The necessary patch has been imported into musl so no need
to cast the sigevent struct to a more glibc-like one.
---
 .../musl-fix-sigevent-and-sigval_t.patch      | 27 -------------------
 1 file changed, 27 deletions(-)
 delete mode 100644 srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch

diff --git a/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch b/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch
deleted file mode 100644
index 4b4f1117c15f..000000000000
--- a/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-Note: Remove this patch with musl 1.2.2
-
---- a/linux-user/syscall.c
-+++ b/linux-user/syscall.c
-@@ -5020,10 +5020,21 @@
- #ifndef HAVE_SIGEV_NOTIFY_THREAD_ID
- #define sigev_notify_thread_id _sigev_un._tid
- #endif
- 
--static inline abi_long target_to_host_sigevent(struct sigevent *host_sevp,
-+struct host_sigevent {
-+    union sigval sigev_value;
-+    int sigev_signo;
-+    int sigev_notify;
-+    union {
-+       char _pad[64 - sizeof(int) * 2 - sizeof(union sigval)];
-+       int _tid;
-+    } _sigev_un;
-+};
-+
-+static inline abi_long target_to_host_sigevent(struct sigevent *sevp,
-                                                abi_ulong target_addr)
- {
-+    struct host_sigevent *host_sevp = (struct host_sigevent *) sevp;
-     struct target_sigevent *target_sevp;
- 
-     if (!lock_user_struct(VERIFY_READ, target_sevp, target_addr, 1)) {

From 2eb8c4b65f4b00f3695ff3c41ceff176e6bf3b46 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 19 Nov 2022 13:26:24 -0800
Subject: [PATCH 12/37] mk-configure: rebuild for gcc 12

---
 srcpkgs/mk-configure/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/mk-configure/template b/srcpkgs/mk-configure/template
index 9d12f11a9799..c50d8adf213f 100644
--- a/srcpkgs/mk-configure/template
+++ b/srcpkgs/mk-configure/template
@@ -1,7 +1,7 @@
 # Template file for 'mk-configure'
 pkgname=mk-configure
 version=0.37.0
-revision=1
+revision=2
 build_style=gnu-makefile
 make_cmd=bmake
 make_install_args="MANDIR=/usr/share/man"

From 84d36b7648c1cf80328188df9eb6d32081d1df99 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 13/37] cross-aarch64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..9e6fb75c198d 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Leah Neukirchen <leah@vuxu.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 3d30ef9d5b9469ca56c2b55ec291ef68f1155867 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 14/37] cross-aarch64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..ba14c96bccea 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 9199d88e0b5065bb276988ec8c2597cf84f95d4e Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 15/37] cross-arm-linux-gnueabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..5c774e16f430 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From d99210886c6c72a06afafa9c31b451bff2709611 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 16/37] cross-arm-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..d6298ab639a4 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 7d6a119495a70e5f60bb36b82735d54d2032626e Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 17/37] cross-arm-linux-musleabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..24df78e8fd8e 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 60f494929d8cdc3663abaea93c12fa59a03818b1 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 18/37] cross-arm-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..8093700f909c 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 4518c88787f541ab3121caa3a5fa33a93766f34f Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 19/37] cross-armv7l-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..92665326428b 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From a9d4c86277a0a0c270c826863792f9f5bcd1b1b8 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 20/37] cross-armv7l-linux-musleabihf: update to gcc 12.2.0.

---
 .../cross-armv7l-linux-musleabihf/template    | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..e5af2c9ccbf2 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 877a6b3e662fcd9aa2b78a4b08e44c455d3340d3 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 21/37] cross-i686-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-i686-linux-musl/template b/srcpkgs/cross-i686-linux-musl/template
index 8be16a230d8d..d624bb7a3254 100644
--- a/srcpkgs/cross-i686-linux-musl/template
+++ b/srcpkgs/cross-i686-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-i686-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-i686-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 28b5b8d0a740c6aa36e97913fc8b6109e77e2090 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 22/37] cross-i686-pc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..6a9e54db807a 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,14 +1,15 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -16,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 7a32c1bf1f83e22d7e5756e85f48a94908d00138 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 23/37] cross-mips-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-musl/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..67a5c413396c 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 2943734bf43bffaab2c82bcd4c6f7efad954534a Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 24/37] cross-mips-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..bdf8600ce95b 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="hipperson0 <hipperson0@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 42609f1296ebd7825eaadf895ca6e9928e8e8934 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 25/37] cross-mipsel-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..de49387d517b 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From bb62e4295bce68d6a2ef72ee44dfacca3a959a55 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 26/37] cross-mipsel-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..b27ce6475a38 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 1830a42e366434841e7c3a33e585b30fc38c0296 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 27/37] cross-powerpc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..79579e093b12 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From cc8519e86b20056fab73d9ec874f00928ad79531 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 28/37] cross-powerpc-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..9bb6acd359b6 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 8e9e7eb8c6f73aa210cd982bd673e90b787f64d5 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 29/37] cross-powerpc64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..2d153d00add6 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,16 +1,17 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
  --enable-targets=powerpc-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -18,12 +19,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From fec9fed07c8b2cc3466cee5e1efb444919300f66 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 30/37] cross-powerpc64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 016f18776a6d..e0848fe0bff7 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,30 +1,31 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From b9ab2e682960a66e8a49945d95f4662083f428ad Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 31/37] cross-powerpc64le-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 463d7e92d20d..8d8e010e15c0 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,16 +1,17 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
  --enable-targets=powerpcle-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -18,12 +19,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 39982c3085016d70d362429115f2f75d1afc816e Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 32/37] cross-powerpc64le-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index c17a3cccfe29..0915e524545f 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,30 +1,31 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 64b401968ea87bce3b3f6c7591a26bb0988b20e8 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 33/37] cross-powerpcle-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 9aede3c465ce..687be8a44c6c 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 
@@ -35,6 +36,8 @@ if [ "$XBPS_TARGET_MACHINE" = "ppcle" ]; then
 	broken="Can't build crosstoolchain to itself"
 fi
 
+broken="glibc uses big-endian specific instructions on 32-bit powerpc"
+
 cross-powerpcle-linux-gnu-libc_package() {
 	short_desc+=" - glibc files"
 	nostrip=yes

From 28806a09086ed10f1a3f045a9f9f7836e63dae78 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 34/37] cross-powerpcle-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index 045cfda987fe..bb984b9c42eb 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From a00e9f911271a73f3dad2d9e00a7a2024ee8201c Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:30 -0800
Subject: [PATCH 35/37] cross-x86_64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 8918f3c22a1c..930aaf2a508b 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,14 +1,15 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -16,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From fc3e55b60a5a6dc4062734ad72baf788455c92b3 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:30 -0800
Subject: [PATCH 36/37] cross-x86_64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..ac5b1c46ab82 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 76cc9fc483226e26845e6374a8351bb07713b6ba Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Fri, 18 Nov 2022 02:01:19 -0800
Subject: [PATCH 37/37] cross-vpkg-dummy: update to 0.39.

---
 srcpkgs/cross-vpkg-dummy/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/cross-vpkg-dummy/template b/srcpkgs/cross-vpkg-dummy/template
index d83e38dc63ac..aeafb749dd5f 100644
--- a/srcpkgs/cross-vpkg-dummy/template
+++ b/srcpkgs/cross-vpkg-dummy/template
@@ -1,6 +1,6 @@
 # Template file for 'cross-vpkg-dummy'
 pkgname=cross-vpkg-dummy
-version=0.38
+version=0.39
 revision=1
 build_style=meta
 short_desc="Dummy meta-pkg for cross building packages with xbps-src"
@@ -54,8 +54,8 @@ conflicts="
 	gcc-objc++>=0"
 shlib_provides="
 	libgcc_s.so.1
-	libgnat-10.so
-	libgnarl-10.so
+	libgnat-12.so
+	libgnarl-12.so
 	libstdc++.so.6
 	libgfortran.so.5"
 

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (236 preceding siblings ...)
  2022-11-19 22:51 ` oreo639
@ 2022-11-19 22:57 ` oreo639
  2022-11-20 18:03 ` oreo639
                   ` (26 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-11-19 22:57 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5448 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.2.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.2.0

There is a list of failing builds here: https://github.com/void-linux/void-packages/issues/39809

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [x] llvm https://github.com/void-linux/void-packages/pull/38694
- [x] m4 https://github.com/void-linux/void-packages/pull/33730
- [x] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [x] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [x] libvirt https://github.com/void-linux/void-packages/pull/38842
- [x] syslinux https://github.com/void-linux/void-packages/pull/38876
- [x] efivar https://github.com/void-linux/void-packages/pull/38874
- [x] gpgme https://github.com/void-linux/void-packages/pull/38825

Known packages that needed to be fixed/updated for gcc12:
- [x] openssh https://github.com/void-linux/void-packages/pull/38849
- [x] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [x] doxygen https://github.com/void-linux/void-packages/pull/38846
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] libproxy https://github.com/void-linux/void-packages/pull/38818
- [x] exempi https://github.com/void-linux/void-packages/pull/38820
- [x] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [x] libunique1 https://github.com/void-linux/void-packages/pull/38848 or https://github.com/void-linux/void-packages/pull/38873
- [x] libwpd https://github.com/void-linux/void-packages/pull/38878
- [x] cglm https://github.com/void-linux/void-packages/pull/39748
- [x] coreboot-utils https://github.com/void-linux/void-packages/pull/39749
- [x] apl https://github.com/void-linux/void-packages/pull/39750
- [x] igt-gpu-tools https://github.com/void-linux/void-packages/pull/39780

Needs to be fixed/updated for binutils:
- [x] grub https://github.com/void-linux/void-packages/pull/38875
- [x] linux-tools https://github.com/void-linux/void-packages/pull/38877
- [x] kcov https://github.com/void-linux/void-packages/pull/39291

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [x] kde
- [x] lxde
- [x] lxqt

You can test the ISOs here:
https://drive.google.com/drive/folders/1ix92CYSLUP-KWjLxltdgG4e8Nu2JCY5n?usp=sharing

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 519474 bytes --]

From c3ba17a045f848281322ef66c857e867cfd85193 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 01/37] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../fix-libcollector-without-java.patch       | 53 +++++++++++++++
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 25 ++++---
 4 files changed, 87 insertions(+), 117 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
 create mode 100644 srcpkgs/binutils/patches/fix-libcollector-without-java.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/fix-libcollector-without-java.patch b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
new file mode 100644
index 000000000000..54384875f358
--- /dev/null
+++ b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
@@ -0,0 +1,53 @@
+From 49ddd814ac1071af7c4f45d5f8398b91862f2c7f Mon Sep 17 00:00:00 2001
+From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
+Date: Wed, 17 Aug 2022 19:55:23 -0700
+Subject: [PATCH] gprofng: fix bug 29479 Collection fails when built without
+ java support
+
+gprofng/ChangeLog
+2022-08-17  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>
+
+	PR gprofng/29479
+	* libcollector/collector.c: Add #if defined(GPROFNG_JAVA_PROFILING) for
+	java specific code.
+	* libcollector/unwind.c: Likewise.
+---
+ gprofng/libcollector/collector.c | 2 ++
+ gprofng/libcollector/unwind.c    | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/gprofng/libcollector/collector.c b/gprofng/libcollector/collector.c
+index 93c9d3330de5..ceff2c1caccb 100644
+--- a/gprofng/libcollector/collector.c
++++ b/gprofng/libcollector/collector.c
+@@ -913,8 +913,10 @@ __collector_open_experiment (const char *exp, const char *params, sp_origin_t or
+   __collector_ext_unwind_key_init (1, NULL);
+ 
+   /* start java attach if suitable */
++#if defined(GPROFNG_JAVA_PROFILING)
+   if (exp_origin == SP_ORIGIN_DBX_ATTACH)
+     __collector_jprofile_start_attach ();
++#endif
+   start_sec_time = CALL_UTIL (time)(NULL);
+   __collector_start_time = collector_interface.getHiResTime ();
+   TprintfT (DBG_LT0, "\t__collector_open_experiment; resetting start_time\n");
+diff --git a/gprofng/libcollector/unwind.c b/gprofng/libcollector/unwind.c
+index 119243788020..f8e11823c81e 100644
+--- a/gprofng/libcollector/unwind.c
++++ b/gprofng/libcollector/unwind.c
+@@ -557,6 +557,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+   int size = max_frame_size;
+ 
+ #define MIN(a,b) ((a)<(b)?(a):(b))
++#if defined(GPROFNG_JAVA_PROFILING)
+   /* get Java info */
+   if (__collector_java_mode && __collector_java_asyncgetcalltrace_loaded && context && !pseudo_context)
+     {
+@@ -569,6 +570,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+ 	  size -= sz;
+ 	}
+     }
++#endif
+ 
+   /* get native stack */
+   if (context)
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..c355a5fc8016 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkgconf"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -35,15 +36,21 @@ do_configure() {
 	local conf
 
 	if [ "$CHROOT_READY" ]; then
-		conf+=" --with-debuginfod"
+		conf+=" --with-debuginfod --enable-shared"
 	else
-		conf+=" --without-debuginfod --disable-install-libbfd"
+		conf+=" --without-debuginfod --disable-shared --disable-install-libbfd"
 	fi
 	if [ "$CROSS_BUILD" ]; then
 		# we don't want --with-sysroot=${XBPS_CROSS_BASE} like gnu-configure
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	# gprofng currently only supports x86 and aarch64 glibc.
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64|i386|aarch64) conf+=" --enable-gprofng" ;;
+		*) conf+=" --disable-gprofng" ;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"
@@ -76,13 +83,14 @@ do_configure() {
 		--libdir=/usr/lib \
 		--mandir=/usr/share/man \
 		--infodir=/usr/share/info \
+		--sysconfdir=/etc \
 		--disable-werror \
-		--disable-shared \
 		--disable-nls \
 		--enable-threads \
 		--enable-plugins \
 		--enable-relro \
 		--enable-gold \
+		--enable-new-dtags \
 		--enable-deterministic-archives \
 		--enable-64-bit-bfd \
 		--enable-ld=default \
@@ -142,7 +150,8 @@ binutils-devel_package() {
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/*.a"
-		vmove "usr/lib/*.so"
+		vmove "usr/lib/libbfd.so"
+		vmove "usr/lib/libopcodes.so"
 	}
 }
 

From 66f6988d695ef56433c4c2fb21e744f34f0e852f Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 02/37] gdb: resolve conflict with binutils 2.39

---
 srcpkgs/gdb/template | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/gdb/template b/srcpkgs/gdb/template
index 9c5f17ffc519..b666348fea19 100644
--- a/srcpkgs/gdb/template
+++ b/srcpkgs/gdb/template
@@ -1,7 +1,7 @@
 # Template file for 'gdb'
 pkgname=gdb
 version=12.1
-revision=2
+revision=3
 build_style=gnu-configure
 pycompile_dirs="/usr/share/gdb/python"
 configure_args="--disable-werror --disable-nls --with-system-readline
@@ -48,7 +48,8 @@ vopt_conflict debuginfod static
 
 post_install() {
 	# resolve conflicts with binutils
-	rm -r ${DESTDIR}/usr/{include,lib,share/info/bfd.info*}
+	rm -rf ${DESTDIR}/usr/{include,lib}
+	rm -rf ${DESTDIR}/usr/share/info/{bfd,ctf-spec}.info*
 }
 
 gdb-common_package() {

From 09823b53e266c1db3351c8d6090d1ad8fd19506c Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 03/37] gcc: update to 12.2.0.

---
 common/shlibs                                 | 10 +--
 srcpkgs/gcc/files/gccgo-musl.patch            | 71 +++------------
 srcpkgs/gcc/files/libgnarl-musl.patch         | 18 ++--
 srcpkgs/gcc/files/libssp-musl.patch           | 10 +--
 srcpkgs/gcc/patches/libffi_gnulinux.patch     | 11 ---
 .../gcc/patches/libgcc-ibm128-no-tag.patch    | 10 ++-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |  2 +-
 srcpkgs/gcc/template                          | 87 +++++++++----------
 8 files changed, 80 insertions(+), 139 deletions(-)
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index 07296762fcc4..a5f4f3257d33 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.2.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.36 perl-5.36.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -857,8 +857,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.2.0_1
+libgnat-12.so libada-12.2.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1710,8 +1710,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.2.0_1
+libasan.so.8 libsanitizer-12.2.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..12ec68dd8aa3 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,14 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ b/libgo/go/runtime/os_linux.go
+@@ -365,7 +365,7 @@ func setThreadCPUProfiler(hz int32) {
+ 	var sevp _sigevent
+ 	sevp.sigev_notify = _SIGEV_THREAD_ID
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.__sev_fields))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index ab3643de4f98..a20af7c0ef2e 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,14 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
+version=12.2.0
+revision=1
+_minorver="${version%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 create_wrksrc=yes
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +18,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -52,8 +48,11 @@ if [ "$CHROOT_READY" ]; then
 	hostmakedepends="tar texinfo perl flex"
 else
 	_have_gccgo=no
+	# libzstd fails to link in bootstrap with glibc 2.36
+	# when zlib has been compiled with glibc 2.32.
+	LDFLAGS="-lzstd -pthread"
 fi
-makedepends="zlib-devel"
+makedepends="zlib-devel libzstd-devel"
 depends="binutils libgcc-devel-${version}_${revision}
  libstdc++-devel-${version}_${revision} libssp-devel-${version}_${revision}"
 checkdepends="dejagnu"
@@ -70,13 +69,13 @@ if [ "$build_option_gnatboot" ]; then
 	case "$XBPS_TARGET_MACHINE" in
 	x86_64)
 		_gnat_tarball="gnat-gpl-2017-x86_64-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/591c6d80c7a447af2deed1d7>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/9682e2e1f2f232ce03fe21d77b14c37a0de5649b?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" b942bcac20dea39748b39f8b624d9619f60a8dee2e8195dbe3829c835b0956e6"
 		build_options_default="gnatboot"
 		;;
 	i686)
 		_gnat_tarball="gnat-gpl-2014-x86-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/564b3e9dc8e196b040fbe248>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/c5e9e6fdff5cb77ed90cf8c62536653e27c0bed6?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" 3b693510f5d22a240abb3034934c1adbd80ccd6e4f61a4f491cc408fdfd9c042"
 		build_options_default="gnatboot"
 		;;
@@ -155,8 +154,8 @@ if [ "$CROSS_BUILD" ]; then
 fi
 
 post_extract() {
-	mv gcc-${version/pre/_pre}/* gcc-${version/pre/_pre}/.??* .
-	rmdir gcc-${version/pre/_pre}
+	mv gcc-${version}/* gcc-${version}/.??* .
+	rmdir gcc-${version}
 	mv gmp-${_gmp_version} gmp
 	mv mpfr-${_mpfr_version} mpfr
 	mv mpc-${_mpc_version} mpc
@@ -186,9 +185,9 @@ pre_configure() {
 	sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
 
 	if [ "$XBPS_TARGET_LIBC" = musl ]; then
-		patch -p1 -i ${FILESDIR}/libgnarl-musl.patch
-		patch -p1 -i ${FILESDIR}/libssp-musl.patch
-		patch -p1 -i ${FILESDIR}/gccgo-musl.patch
+		for p in ${FILESDIR}/*-musl.patch; do
+			patch -p1 -i $p
+		done
 	fi
 }
 do_configure() {
@@ -343,16 +342,16 @@ do_install() {
 
 	# Make version a symlink of major version to make all versions
 	# from the same series work automagically.
-	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver} \
+	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${version} \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver}
 	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver} \
-		${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}
+		${DESTDIR}/usr/lib/gcc/${_triplet}/${version}
 
 	# Ditto for c++ headers.
-	mv ${DESTDIR}/usr/include/c++/${_patchver} \
+	mv ${DESTDIR}/usr/include/c++/${version} \
 		${DESTDIR}/usr/include/c++/${_minorver}
 	ln -sfr ${DESTDIR}/usr/include/c++/${_minorver} \
-		${DESTDIR}/usr/include/c++/${_patchver}
+		${DESTDIR}/usr/include/c++/${version}
 
 	# cc symlink
 	ln -sfr ${DESTDIR}/usr/bin/gcc ${DESTDIR}/usr/bin/cc
@@ -361,7 +360,7 @@ do_install() {
 
 	# lto plugin symlink
 	vmkdir usr/lib/bfd-plugins
-	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}/liblto_plugin.so \
+	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${version}/liblto_plugin.so \
 		${DESTDIR}/usr/lib/bfd-plugins
 
 	# Remove "fixed" header
@@ -372,13 +371,9 @@ do_install() {
 	rm -f ${DESTDIR}/usr/lib/libffi*
 	rm -f ${DESTDIR}/usr/share/man/man3/ffi*
 
-	# Remove all python scripts in libdir.
-	rm -f ${DESTDIR}/usr/lib/*.py
-
-	# Remove more python stuff.
-	if [ -d ${DESTDIR}/usr/share/gcc-${_patchver}/python ]; then
-		rm -rf ${DESTDIR}/usr/share/gcc-${_patchver}/python
-	fi
+	# Move libstdc++ gdb helpers to location where gdb can autoload them
+	mkdir -p ${DESTDIR}/usr/share/gdb/auto-load/usr/lib
+	mv ${DESTDIR}/usr/lib/*.py ${DESTDIR}/usr/share/gdb/auto-load/usr/lib
 
 	# Install c89 and c99 wrappers and its manpages, from NetBSD.
 	for f in c89 c99; do
@@ -397,7 +392,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}
@@ -450,7 +445,7 @@ gcc-fortran_package() {
 		if [ "$CROSS_BUILD" ]; then
 			# A number of OMP modules are not built when cross
 			# compiling gcc. Copy them from the cross compiler.
-			local src="/usr/lib/gcc/${_triplet}/${_patchver}/finclude"
+			local src="/usr/lib/gcc/${_triplet}/${version}/finclude"
 			local dst="usr/lib/gcc/${_triplet}/${_minorver}/finclude"
 			for f in omp_lib.f90 omp_lib.h omp_lib.mod omp_lib_kinds.mod \
 				openacc.f90 openacc.mod openacc_kinds.mod openacc_lib.h; do
@@ -517,7 +512,7 @@ libgfortran_package() {
 	short_desc+=" - Fortran library"
 	pkg_install() {
 		vmove "usr/lib/libgfortran.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -538,7 +533,7 @@ libgo_package() {
 	nostrip=yes
 	pkg_install() {
 		vmove "usr/lib/libgo.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -554,7 +549,7 @@ libobjc_package() {
 	short_desc+=" - Objective-C library"
 	pkg_install() {
 		vmove "usr/lib/libobjc.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -573,7 +568,7 @@ libquadmath_package() {
 	short_desc+=" - quadmath library"
 	pkg_install() {
 		vmove "usr/lib/libquadmath.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -615,7 +610,7 @@ libgcc_package() {
 	noverifyrdeps=yes
 	pkg_install() {
 		vmove "usr/lib/libgcc_s.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -646,7 +641,7 @@ libgomp_package() {
 	short_desc+=" - OpenMP v4.0 library"
 	pkg_install() {
 		vmove "usr/lib/libgomp*.so.*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -701,7 +696,7 @@ libssp_package() {
 	short_desc+=" - SSP (StackSmashingProtection) library"
 	pkg_install() {
 		vmove "usr/lib/libssp.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -718,7 +713,9 @@ libstdc++-devel_package() {
 libstdc++_package() {
 	short_desc+=" - Standard C++ Library"
 	pkg_install() {
+		vmove usr/share/gdb
+		vmove usr/share/gcc-${version}/python
 		vmove "usr/lib/libstdc++.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }

From 25feab200a1a00db03e93c892c2a1a7b44ba985c Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 04/37] libtool: rebuild for gcc 12

---
 srcpkgs/libtool/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index fc5c53a9c3e9..aebad9294eef 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
 version=2.4.7
-revision=1
+revision=2
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"

From 1b0668e29a0f79489385c428a7cf2f1bea20687d Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 05/37] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 7e01bbb851fd..d9618e3806ba 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 build_wrksrc=libiberty
 build_style=gnu-configure
@@ -10,7 +10,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From 5147a49572b16025c167c7bbb9ec32dd9b8867ed Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 06/37] glibc: update to 2.36.

---
 common/shlibs                                 |    60 +-
 ...e-hash-style-both-for-building-glibc.patch |    51 +
 srcpkgs/glibc/patches/git-updates.patch       | 10869 ++++++++++++++++
 .../glibc/patches/glibc-c-utf8-locale.patch   |   286 -
 srcpkgs/glibc/template                        |    66 +-
 5 files changed, 10979 insertions(+), 353 deletions(-)
 create mode 100644 srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
 create mode 100644 srcpkgs/glibc/patches/git-updates.patch
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index a5f4f3257d33..a96fe577e93b 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch b/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
new file mode 100644
index 000000000000..9c5553e92609
--- /dev/null
+++ b/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
@@ -0,0 +1,51 @@
+Temporary workaround for EAC bug.
+
+See: https://sourceware.org/bugzilla/show_bug.cgi?id=29456
+
+From 8e90e2cc5e57d7ca3a40602d278e9642a8b66716 Mon Sep 17 00:00:00 2001
+From: oreo639 <oreo6391@gmail.com>
+Date: Tue, 13 Sep 2022 14:30:35 -0700
+Subject: [PATCH] Revert "Do not use --hash-style=both for building glibc
+ shared objects"
+
+This reverts commit e47de5cb2d4dbecb58f569ed241e8e95c568f03c.
+---
+ Makeconfig     |  9 +++++++++
+ Makerules      |  7 +++++++
+ 5 files changed, 61 insertions(+)
+
+diff --git a/Makeconfig b/Makeconfig
+index ba70321af1..e2131d4389 100644
+--- a/Makeconfig
++++ b/Makeconfig
+@@ -371,6 +371,13 @@ dt-relr-ldflag =
+ no-dt-relr-ldflag =
+ endif
+ 
++# For the time being we unconditionally use 'both'.  At some time we
++# should declare statically linked code as 'out of luck' and compile
++# with --hash-style=gnu only.
++hashstyle-LDFLAGS = -Wl,--hash-style=both
++LDFLAGS.so += $(hashstyle-LDFLAGS)
++LDFLAGS-rtld += $(hashstyle-LDFLAGS)
++
+ ifeq (no,$(build-pie-default))
+ pie-default = $(no-pie-ccflag)
+ else # build-pie-default
+diff --git a/Makerules b/Makerules
+index d1e139d03c..44134e37ce 100644
+--- a/Makerules
++++ b/Makerules
+@@ -558,6 +558,9 @@ $(common-objpfx)shlib.lds: $(common-objpfx)config.make $(..)Makerules
+ 		  -Wl,--verbose 2>/dev/null | \
+ 	  sed > $@T \
+ 	      -e '/^=========/,/^=========/!d;/^=========/d' \
++		   -e 's/^.*\.gnu\.hash[ 	]*:.*$$/  .note.ABI-tag : { *(.note.ABI-tag) } &/' \
++		   -e '/^[ 	]*\.hash[ 	]*:.*$$/{h;d;}' \
++		   -e '/DATA_SEGMENT_ALIGN/{H;g}' \
+ 	      -e 's/^.*\*(\.dynbss).*$$/& \
+ 		 PROVIDE(__start___libc_freeres_ptrs = .); \
+ 		 *(__libc_freeres_ptrs) \
+-- 
+2.37.3
+
diff --git a/srcpkgs/glibc/patches/git-updates.patch b/srcpkgs/glibc/patches/git-updates.patch
new file mode 100644
index 000000000000..1920b1bd76ad
--- /dev/null
+++ b/srcpkgs/glibc/patches/git-updates.patch
@@ -0,0 +1,10869 @@
+From c3fda489cfdb2260f9fec706e6fd7259858c4467 Mon Sep 17 00:00:00 2001
+From: Tom Honermann <tom@honermann.net>
+Date: Sun, 24 Jul 2022 01:11:43 -0400
+Subject: stdlib: Suppress gcc diagnostic that char8_t is a keyword in C++20 in
+ uchar.h.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+gcc 13 issues the following diagnostic for the uchar.h header when the
+-Wc++20-compat option is enabled in C++ modes that do not enable char8_t
+as a builtin type (C++17 and earlier by default; subject to _GNU_SOURCE
+and the gcc -f[no-]char8_t option).
+  warning: identifier ‘char8_t’ is a keyword in C++20 [-Wc++20-compat]
+This change modifies the uchar.h header to suppress the diagnostic through
+the use of '#pragma GCC diagnostic' directives for gcc 10 and later (the
+-Wc++20-compat option was added in gcc version 10).  Unfortunately, a bug
+in gcc currently prevents those directives from having the intended effect
+as reported at https://gcc.gnu.org/PR106423.  A patch for that issue has
+been submitted and is available in the email thread archive linked below.
+  https://gcc.gnu.org/pipermail/gcc-patches/2022-July/598736.html
+
+(cherry picked from commit 825f84f133bd840347dc49229b6d831f07d04775)
+---
+ wcsmbs/uchar.h | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/wcsmbs/uchar.h b/wcsmbs/uchar.h
+index c37e8619a0..5f7139f279 100644
+--- a/wcsmbs/uchar.h
++++ b/wcsmbs/uchar.h
+@@ -34,8 +34,16 @@
+ /* Declare the C2x char8_t typedef in C2x modes, but only if the C++
+   __cpp_char8_t feature test macro is not defined.  */
+ #if __GLIBC_USE (ISOC2X) && !defined __cpp_char8_t
++#if __GNUC_PREREQ (10, 0) && defined __cplusplus
++/* Suppress the diagnostic regarding char8_t being a keyword in C++20.  */
++# pragma GCC diagnostic push
++# pragma GCC diagnostic ignored "-Wc++20-compat"
++#endif
+ /* Define the 8-bit character type.  */
+ typedef unsigned char char8_t;
++#if __GNUC_PREREQ (10, 0) && defined __cplusplus
++# pragma GCC diagnostic pop
++#endif
+ #endif
+ 
+ #ifndef __USE_ISOCXX11
+-- 
+2.38.1
+
+
+From 33f1b4c1452b33991e670f636ebe98b90a405e10 Mon Sep 17 00:00:00 2001
+From: "H.J. Lu" <hjl.tools@gmail.com>
+Date: Fri, 29 Jul 2022 10:50:56 -0700
+Subject: wcsmbs: Add missing test-c8rtomb/test-mbrtoc8 dependency
+
+Make test-c8rtomb.out and test-mbrtoc8.out depend on $(gen-locales) for
+
+  xsetlocale (LC_ALL, "de_DE.UTF-8");
+  xsetlocale (LC_ALL, "zh_HK.BIG5-HKSCS");
+
+Reviewed-by: Sunil K Pandey <skpgkp2@gmail.com>
+Reviewed-by: Carlos O'Donell <carlos@redhat.com>
+(cherry picked from commit e03f5ccd6cc8f829416156eac75acee501626c1f)
+---
+ wcsmbs/Makefile | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/wcsmbs/Makefile b/wcsmbs/Makefile
+index e6b9e8743a..3d19d5556f 100644
+--- a/wcsmbs/Makefile
++++ b/wcsmbs/Makefile
+@@ -73,6 +73,8 @@ $(objpfx)tst-wcstol-locale.out: $(gen-locales)
+ $(objpfx)tst-wcstod-nan-locale.out: $(gen-locales)
+ $(objpfx)tst-c16-surrogate.out: $(gen-locales)
+ $(objpfx)tst-c32-state.out: $(gen-locales)
++$(objpfx)test-c8rtomb.out: $(gen-locales)
++$(objpfx)test-mbrtoc8.out: $(gen-locales)
+ endif
+ 
+ $(objpfx)tst-wcstod-round: $(libm)
+-- 
+2.38.1
+
+
+From c74bb93cfdb04d49155b0e30983a3c866167bbca Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Thu, 4 Aug 2022 17:54:48 +0200
+Subject: dlfcn: Pass caller pointer to static dlopen implementation (bug
+ 29446)
+
+Fixes commit 0c1c3a771eceec46e66ce1183cf988e2303bd373 ("dlfcn: Move
+dlopen into libc").
+
+(cherry picked from commit ed0185e4129130cbe081c221efb758fb400623ce)
+---
+ NEWS           | 7 +++++++
+ dlfcn/dlopen.c | 2 +-
+ 2 files changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/NEWS b/NEWS
+index f61e521fc8..15f3dd2cdb 100644
+--- a/NEWS
++++ b/NEWS
+@@ -4,6 +4,13 @@ See the end for copying conditions.
+ 
+ Please send GNU C library bug reports via <https://sourceware.org/bugzilla/>
+ using `glibc' in the "product" field.
++\f
++Version 2.36.1
++
++The following bugs are resolved with this release:
++
++  [29446] _dlopen now ignores dl_caller argument in static mode
++
+ \f
+ Version 2.36
+ 
+diff --git a/dlfcn/dlopen.c b/dlfcn/dlopen.c
+index 2696dde4b1..9b07b4e132 100644
+--- a/dlfcn/dlopen.c
++++ b/dlfcn/dlopen.c
+@@ -90,7 +90,7 @@ compat_symbol (libdl, ___dlopen, dlopen, GLIBC_2_1);
+ void *
+ __dlopen (const char *file, int mode, void *dl_caller)
+ {
+-  return dlopen_implementation (file, mode, RETURN_ADDRESS (0));
++  return dlopen_implementation (file, mode, dl_caller);
+ }
+ 
+ void *
+-- 
+2.38.1
+
+
+From ac47d8f6cf9744139adb12f540fb9cc610cac579 Mon Sep 17 00:00:00 2001
+From: Joseph Myers <joseph@codesourcery.com>
+Date: Tue, 2 Aug 2022 21:05:07 +0000
+Subject: Update syscall lists for Linux 5.19
+
+Linux 5.19 has no new syscalls, but enables memfd_secret in the uapi
+headers for RISC-V.  Update the version number in syscall-names.list
+to reflect that it is still current for 5.19 and regenerate the
+arch-syscall.h headers with build-many-glibcs.py update-syscalls.
+
+Tested with build-many-glibcs.py.
+
+(cherry picked from commit fccadcdf5bed7ee67a6cef4714e0b477d6c8472c)
+---
+ sysdeps/unix/sysv/linux/riscv/rv32/arch-syscall.h | 1 +
+ sysdeps/unix/sysv/linux/riscv/rv64/arch-syscall.h | 1 +
+ sysdeps/unix/sysv/linux/syscall-names.list        | 4 ++--
+ 3 files changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/arch-syscall.h b/sysdeps/unix/sysv/linux/riscv/rv32/arch-syscall.h
+index bf4be80f8d..202520ee25 100644
+--- a/sysdeps/unix/sysv/linux/riscv/rv32/arch-syscall.h
++++ b/sysdeps/unix/sysv/linux/riscv/rv32/arch-syscall.h
+@@ -122,6 +122,7 @@
+ #define __NR_mbind 235
+ #define __NR_membarrier 283
+ #define __NR_memfd_create 279
++#define __NR_memfd_secret 447
+ #define __NR_migrate_pages 238
+ #define __NR_mincore 232
+ #define __NR_mkdirat 34
+diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/arch-syscall.h b/sysdeps/unix/sysv/linux/riscv/rv64/arch-syscall.h
+index d656aedcc2..4e65f337d4 100644
+--- a/sysdeps/unix/sysv/linux/riscv/rv64/arch-syscall.h
++++ b/sysdeps/unix/sysv/linux/riscv/rv64/arch-syscall.h
+@@ -127,6 +127,7 @@
+ #define __NR_mbind 235
+ #define __NR_membarrier 283
+ #define __NR_memfd_create 279
++#define __NR_memfd_secret 447
+ #define __NR_migrate_pages 238
+ #define __NR_mincore 232
+ #define __NR_mkdirat 34
+diff --git a/sysdeps/unix/sysv/linux/syscall-names.list b/sysdeps/unix/sysv/linux/syscall-names.list
+index 6c7b2f7011..028ad3107a 100644
+--- a/sysdeps/unix/sysv/linux/syscall-names.list
++++ b/sysdeps/unix/sysv/linux/syscall-names.list
+@@ -21,8 +21,8 @@
+ # This file can list all potential system calls.  The names are only
+ # used if the installed kernel headers also provide them.
+ 
+-# The list of system calls is current as of Linux 5.18.
+-kernel 5.18
++# The list of system calls is current as of Linux 5.19.
++kernel 5.19
+ 
+ FAST_atomic_update
+ FAST_cmpxchg
+-- 
+2.38.1
+
+
+From 302bc33bc53c787da6e74162a7092e9c0fb964a8 Mon Sep 17 00:00:00 2001
+From: Noah Goldstein <goldstein.w.n@gmail.com>
+Date: Mon, 8 Aug 2022 11:26:22 +0800
+Subject: elf: Replace `strcpy` call with `memcpy` [BZ #29454]
+
+GCC normally does this optimization for us in
+strlen_pass::handle_builtin_strcpy but only for optimized
+build. To avoid needing to include strcpy.S in the rtld build to
+support the debug build, just do the optimization by hand.
+
+(cherry picked from commit 483cfe1a6a33d6335b1901581b41040d2d412511)
+---
+ elf/dl-cache.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/elf/dl-cache.c b/elf/dl-cache.c
+index 8bbf110d02..b97c17b3a9 100644
+--- a/elf/dl-cache.c
++++ b/elf/dl-cache.c
+@@ -509,8 +509,9 @@ _dl_load_cache_lookup (const char *name)
+      we are accessing. Therefore we must make the copy of the
+      mapping data without using malloc.  */
+   char *temp;
+-  temp = alloca (strlen (best) + 1);
+-  strcpy (temp, best);
++  size_t best_len = strlen (best) + 1;
++  temp = alloca (best_len);
++  memcpy (temp, best, best_len);
+   return __strdup (temp);
+ }
+ 
+-- 
+2.38.1
+
+
+From e982657073c4db21459ffd9e17bc505b1d64b876 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Mon, 15 Aug 2022 16:43:59 +0200
+Subject: Linux: Terminate subprocess on late failure in tst-pidfd (bug 29485)
+
+Reviewed-by: Carlos O'Donell <carlos@redhat.com>
+(cherry picked from commit f82e05ebb295cadd35f7372f652c72264da810ad)
+---
+ NEWS                                | 1 +
+ sysdeps/unix/sysv/linux/tst-pidfd.c | 7 +++++--
+ 2 files changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/NEWS b/NEWS
+index 15f3dd2cdb..f8fb8db510 100644
+--- a/NEWS
++++ b/NEWS
+@@ -10,6 +10,7 @@ Version 2.36.1
+ The following bugs are resolved with this release:
+ 
+   [29446] _dlopen now ignores dl_caller argument in static mode
++  [29485] Linux: Terminate subprocess on late failure in tst-pidfd
+ 
+ \f
+ Version 2.36
+diff --git a/sysdeps/unix/sysv/linux/tst-pidfd.c b/sysdeps/unix/sysv/linux/tst-pidfd.c
+index 037af22290..5711d1c312 100644
+--- a/sysdeps/unix/sysv/linux/tst-pidfd.c
++++ b/sysdeps/unix/sysv/linux/tst-pidfd.c
+@@ -147,8 +147,11 @@ do_test (void)
+        may be denied if the process doesn't have CAP_SYS_PTRACE or
+        if a LSM security_ptrace_access_check denies access.  */
+     if (fd == -1 && errno == EPERM)
+-      FAIL_UNSUPPORTED ("don't have permission to use pidfd_getfd on pidfd, "
+-			"skipping test");
++      {
++	TEST_COMPARE (pidfd_send_signal (pidfd, SIGKILL, NULL, 0), 0);
++	FAIL_UNSUPPORTED ("don't have permission to use pidfd_getfd on pidfd, "
++			  "skipping test");
++      }
+     TEST_VERIFY (fd > 0);
+ 
+     char *path = xasprintf ("/proc/%d/fd/%d", pid, remote_fd);
+-- 
+2.38.1
+
+
+From 8b139cd4f1074ae0d95d9bff60db283a1ed72734 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Mon, 22 Aug 2022 11:04:47 +0200
+Subject: alpha: Fix generic brk system call emulation in __brk_call (bug
+ 29490)
+
+The kernel special-cases the zero argument for alpha brk, and we can
+use that to restore the generic Linux error handling behavior.
+
+Fixes commit b57ab258c1140bc45464b4b9908713e3e0ee35aa ("Linux:
+Introduce __brk_call for invoking the brk system call").
+
+(cherry picked from commit e7ad26ee3cb74e61d0637c888f24dd478d77af58)
+---
+ NEWS                                     | 1 +
+ sysdeps/unix/sysv/linux/alpha/brk_call.h | 7 +++----
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/NEWS b/NEWS
+index f8fb8db510..becab3ade9 100644
+--- a/NEWS
++++ b/NEWS
+@@ -11,6 +11,7 @@ The following bugs are resolved with this release:
+ 
+   [29446] _dlopen now ignores dl_caller argument in static mode
+   [29485] Linux: Terminate subprocess on late failure in tst-pidfd
++  [29490] alpha: New __brk_call implementation is broken
+ 
+ \f
+ Version 2.36
+diff --git a/sysdeps/unix/sysv/linux/alpha/brk_call.h b/sysdeps/unix/sysv/linux/alpha/brk_call.h
+index b8088cf13f..0b851b6c86 100644
+--- a/sysdeps/unix/sysv/linux/alpha/brk_call.h
++++ b/sysdeps/unix/sysv/linux/alpha/brk_call.h
+@@ -21,8 +21,7 @@ __brk_call (void *addr)
+ {
+   unsigned long int result = INTERNAL_SYSCALL_CALL (brk, addr);
+   if (result == -ENOMEM)
+-    /* Mimic the default error reporting behavior.  */
+-    return addr;
+-  else
+-    return (void *) result;
++    /* Mimic the generic error reporting behavior.  */
++    result = INTERNAL_SYSCALL_CALL (brk, 0);
++  return (void *) result;
+ }
+-- 
+2.38.1
+
+
+From d13a7a6f100576b1e30dc044b2e0c4cbcb6196f6 Mon Sep 17 00:00:00 2001
+From: Arjun Shankar <arjun@redhat.com>
+Date: Tue, 2 Aug 2022 11:10:25 +0200
+Subject: socket: Check lengths before advancing pointer in CMSG_NXTHDR
+
+The inline and library functions that the CMSG_NXTHDR macro may expand
+to increment the pointer to the header before checking the stride of
+the increment against available space.  Since C only allows incrementing
+pointers to one past the end of an array, the increment must be done
+after a length check.  This commit fixes that and includes a regression
+test for CMSG_FIRSTHDR and CMSG_NXTHDR.
+
+The Linux, Hurd, and generic headers are all changed.
+
+Tested on Linux on armv7hl, i686, x86_64, aarch64, ppc64le, and s390x.
+
+[BZ #28846]
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit 9c443ac4559a47ed99859bd80d14dc4b6dd220a1)
+---
+ bits/socket.h                         | 40 ++++++++++--
+ socket/Makefile                       |  1 +
+ socket/tst-cmsghdr-skeleton.c         | 92 +++++++++++++++++++++++++++
+ socket/tst-cmsghdr.c                  | 56 ++++++++++++++++
+ sysdeps/mach/hurd/bits/socket.h       | 40 ++++++++++--
+ sysdeps/unix/sysv/linux/bits/socket.h | 40 ++++++++++--
+ sysdeps/unix/sysv/linux/cmsg_nxthdr.c | 36 ++++++++---
+ 7 files changed, 276 insertions(+), 29 deletions(-)
+ create mode 100644 socket/tst-cmsghdr-skeleton.c
+ create mode 100644 socket/tst-cmsghdr.c
+
+diff --git a/bits/socket.h b/bits/socket.h
+index 2b99dea33b..aac8c49b00 100644
+--- a/bits/socket.h
++++ b/bits/socket.h
+@@ -245,6 +245,12 @@ struct cmsghdr
+ 			 + CMSG_ALIGN (sizeof (struct cmsghdr)))
+ #define CMSG_LEN(len)   (CMSG_ALIGN (sizeof (struct cmsghdr)) + (len))
+ 
++/* Given a length, return the additional padding necessary such that
++   len + __CMSG_PADDING(len) == CMSG_ALIGN (len).  */
++#define __CMSG_PADDING(len) ((sizeof (size_t) \
++                              - ((len) & (sizeof (size_t) - 1))) \
++                             & (sizeof (size_t) - 1))
++
+ extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr,
+ 				      struct cmsghdr *__cmsg) __THROW;
+ #ifdef __USE_EXTERN_INLINES
+@@ -254,18 +260,38 @@ extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr,
+ _EXTERN_INLINE struct cmsghdr *
+ __NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg))
+ {
++  /* We may safely assume that __cmsg lies between __mhdr->msg_control and
++     __mhdr->msg_controllen because the user is required to obtain the first
++     cmsg via CMSG_FIRSTHDR, set its length, then obtain subsequent cmsgs
++     via CMSG_NXTHDR, setting lengths along the way.  However, we don't yet
++     trust the value of __cmsg->cmsg_len and therefore do not use it in any
++     pointer arithmetic until we check its value.  */
++
++  unsigned char * __msg_control_ptr = (unsigned char *) __mhdr->msg_control;
++  unsigned char * __cmsg_ptr = (unsigned char *) __cmsg;
++
++  size_t __size_needed = sizeof (struct cmsghdr)
++                         + __CMSG_PADDING (__cmsg->cmsg_len);
++
++  /* The current header is malformed, too small to be a full header.  */
+   if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr))
+-    /* The kernel header does this so there may be a reason.  */
+     return (struct cmsghdr *) 0;
+ 
++  /* There isn't enough space between __cmsg and the end of the buffer to
++  hold the current cmsg *and* the next one.  */
++  if (((size_t)
++         (__msg_control_ptr + __mhdr->msg_controllen - __cmsg_ptr)
++       < __size_needed)
++      || ((size_t)
++            (__msg_control_ptr + __mhdr->msg_controllen - __cmsg_ptr
++             - __size_needed)
++          < __cmsg->cmsg_len))
++
++    return (struct cmsghdr *) 0;
++
++  /* Now, we trust cmsg_len and can use it to find the next header.  */
+   __cmsg = (struct cmsghdr *) ((unsigned char *) __cmsg
+ 			       + CMSG_ALIGN (__cmsg->cmsg_len));
+-  if ((unsigned char *) (__cmsg + 1) > ((unsigned char *) __mhdr->msg_control
+-					+ __mhdr->msg_controllen)
+-      || ((unsigned char *) __cmsg + CMSG_ALIGN (__cmsg->cmsg_len)
+-	  > ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen)))
+-    /* No more entries.  */
+-    return (struct cmsghdr *) 0;
+   return __cmsg;
+ }
+ #endif	/* Use `extern inline'.  */
+diff --git a/socket/Makefile b/socket/Makefile
+index 156eec6c85..2bde78387f 100644
+--- a/socket/Makefile
++++ b/socket/Makefile
+@@ -34,6 +34,7 @@ routines := accept bind connect getpeername getsockname getsockopt	\
+ tests := \
+   tst-accept4 \
+   tst-sockopt \
++  tst-cmsghdr \
+   # tests
+ 
+ tests-internal := \
+diff --git a/socket/tst-cmsghdr-skeleton.c b/socket/tst-cmsghdr-skeleton.c
+new file mode 100644
+index 0000000000..4c6898569b
+--- /dev/null
++++ b/socket/tst-cmsghdr-skeleton.c
+@@ -0,0 +1,92 @@
++/* Test ancillary data header creation.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++/* We use the preprocessor to generate the function/macro tests instead of
++   using indirection because having all the macro expansions alongside
++   each other lets the compiler warn us about suspicious pointer
++   arithmetic across subsequent CMSG_{FIRST,NXT}HDR expansions.  */
++
++#include <stdint.h>
++
++#define RUN_TEST_CONCAT(suffix) run_test_##suffix
++#define RUN_TEST_FUNCNAME(suffix) RUN_TEST_CONCAT (suffix)
++
++static void
++RUN_TEST_FUNCNAME (CMSG_NXTHDR_IMPL) (void)
++{
++  struct msghdr m = {0};
++  struct cmsghdr *cmsg;
++  char cmsgbuf[3 * CMSG_SPACE (sizeof (PAYLOAD))] = {0};
++
++  m.msg_control = cmsgbuf;
++  m.msg_controllen = sizeof (cmsgbuf);
++
++  /* First header should point to the start of the buffer.  */
++  cmsg = CMSG_FIRSTHDR (&m);
++  TEST_VERIFY_EXIT ((char *) cmsg == cmsgbuf);
++
++  /* If the first header length consumes the entire buffer, there is no
++     space remaining for additional headers.  */
++  cmsg->cmsg_len = sizeof (cmsgbuf);
++  cmsg = CMSG_NXTHDR_IMPL (&m, cmsg);
++  TEST_VERIFY_EXIT (cmsg == NULL);
++
++  /* The first header length is so big, using it would cause an overflow.  */
++  cmsg = CMSG_FIRSTHDR (&m);
++  TEST_VERIFY_EXIT ((char *) cmsg == cmsgbuf);
++  cmsg->cmsg_len = SIZE_MAX;
++  cmsg = CMSG_NXTHDR_IMPL (&m, cmsg);
++  TEST_VERIFY_EXIT (cmsg == NULL);
++
++  /* The first header leaves just enough space to hold another header.  */
++  cmsg = CMSG_FIRSTHDR (&m);
++  TEST_VERIFY_EXIT ((char *) cmsg == cmsgbuf);
++  cmsg->cmsg_len = sizeof (cmsgbuf) - sizeof (struct cmsghdr);
++  cmsg = CMSG_NXTHDR_IMPL (&m, cmsg);
++  TEST_VERIFY_EXIT (cmsg != NULL);
++
++  /* The first header leaves space but not enough for another header.  */
++  cmsg = CMSG_FIRSTHDR (&m);
++  TEST_VERIFY_EXIT ((char *) cmsg == cmsgbuf);
++  cmsg->cmsg_len ++;
++  cmsg = CMSG_NXTHDR_IMPL (&m, cmsg);
++  TEST_VERIFY_EXIT (cmsg == NULL);
++
++  /* The second header leaves just enough space to hold another header.  */
++  cmsg = CMSG_FIRSTHDR (&m);
++  TEST_VERIFY_EXIT ((char *) cmsg == cmsgbuf);
++  cmsg->cmsg_len = CMSG_LEN (sizeof (PAYLOAD));
++  cmsg = CMSG_NXTHDR_IMPL (&m, cmsg);
++  TEST_VERIFY_EXIT (cmsg != NULL);
++  cmsg->cmsg_len = sizeof (cmsgbuf)
++                   - CMSG_SPACE (sizeof (PAYLOAD)) /* First header.  */
++                   - sizeof (struct cmsghdr);
++  cmsg = CMSG_NXTHDR_IMPL (&m, cmsg);
++  TEST_VERIFY_EXIT (cmsg != NULL);
++
++  /* The second header leaves space but not enough for another header.  */
++  cmsg = CMSG_FIRSTHDR (&m);
++  TEST_VERIFY_EXIT ((char *) cmsg == cmsgbuf);
++  cmsg = CMSG_NXTHDR_IMPL (&m, cmsg);
++  TEST_VERIFY_EXIT (cmsg != NULL);
++  cmsg->cmsg_len ++;
++  cmsg = CMSG_NXTHDR_IMPL (&m, cmsg);
++  TEST_VERIFY_EXIT (cmsg == NULL);
++
++  return;
++}
+diff --git a/socket/tst-cmsghdr.c b/socket/tst-cmsghdr.c
+new file mode 100644
+index 0000000000..68c96d3c9d
+--- /dev/null
++++ b/socket/tst-cmsghdr.c
+@@ -0,0 +1,56 @@
++/* Test ancillary data header creation.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <sys/socket.h>
++#include <gnu/lib-names.h>
++#include <support/xdlfcn.h>
++#include <support/check.h>
++
++#define PAYLOAD "Hello, World!"
++
++/* CMSG_NXTHDR is a macro that calls an inline function defined in
++   bits/socket.h.  In case the function cannot be inlined, libc.so carries
++   a copy.  Both versions need to be tested.  */
++
++#define CMSG_NXTHDR_IMPL CMSG_NXTHDR
++#include "tst-cmsghdr-skeleton.c"
++#undef CMSG_NXTHDR_IMPL
++
++static struct cmsghdr * (* cmsg_nxthdr) (struct msghdr *, struct cmsghdr *);
++
++#define CMSG_NXTHDR_IMPL cmsg_nxthdr
++#include "tst-cmsghdr-skeleton.c"
++#undef CMSG_NXTHDR_IMPL
++
++static int
++do_test (void)
++{
++  static void *handle;
++
++  run_test_CMSG_NXTHDR ();
++
++  handle = xdlopen (LIBC_SO, RTLD_LAZY);
++  cmsg_nxthdr = (struct cmsghdr * (*) (struct msghdr *, struct cmsghdr *))
++                  xdlsym (handle, "__cmsg_nxthdr");
++
++  run_test_cmsg_nxthdr ();
++
++  return 0;
++}
++
++#include <support/test-driver.c>
+diff --git a/sysdeps/mach/hurd/bits/socket.h b/sysdeps/mach/hurd/bits/socket.h
+index 5b35ea81ec..70fce4fb27 100644
+--- a/sysdeps/mach/hurd/bits/socket.h
++++ b/sysdeps/mach/hurd/bits/socket.h
+@@ -249,6 +249,12 @@ struct cmsghdr
+ 			 + CMSG_ALIGN (sizeof (struct cmsghdr)))
+ #define CMSG_LEN(len)   (CMSG_ALIGN (sizeof (struct cmsghdr)) + (len))
+ 
++/* Given a length, return the additional padding necessary such that
++   len + __CMSG_PADDING(len) == CMSG_ALIGN (len).  */
++#define __CMSG_PADDING(len) ((sizeof (size_t) \
++                              - ((len) & (sizeof (size_t) - 1))) \
++                             & (sizeof (size_t) - 1))
++
+ extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr,
+ 				      struct cmsghdr *__cmsg) __THROW;
+ #ifdef __USE_EXTERN_INLINES
+@@ -258,18 +264,38 @@ extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr,
+ _EXTERN_INLINE struct cmsghdr *
+ __NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg))
+ {
++  /* We may safely assume that __cmsg lies between __mhdr->msg_control and
++     __mhdr->msg_controllen because the user is required to obtain the first
++     cmsg via CMSG_FIRSTHDR, set its length, then obtain subsequent cmsgs
++     via CMSG_NXTHDR, setting lengths along the way.  However, we don't yet
++     trust the value of __cmsg->cmsg_len and therefore do not use it in any
++     pointer arithmetic until we check its value.  */
++
++  unsigned char * __msg_control_ptr = (unsigned char *) __mhdr->msg_control;
++  unsigned char * __cmsg_ptr = (unsigned char *) __cmsg;
++
++  size_t __size_needed = sizeof (struct cmsghdr)
++                         + __CMSG_PADDING (__cmsg->cmsg_len);
++
++  /* The current header is malformed, too small to be a full header.  */
+   if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr))
+-    /* The kernel header does this so there may be a reason.  */
+     return (struct cmsghdr *) 0;
+ 
++  /* There isn't enough space between __cmsg and the end of the buffer to
++  hold the current cmsg *and* the next one.  */
++  if (((size_t)
++         (__msg_control_ptr + __mhdr->msg_controllen - __cmsg_ptr)
++       < __size_needed)
++      || ((size_t)
++            (__msg_control_ptr + __mhdr->msg_controllen - __cmsg_ptr
++             - __size_needed)
++          < __cmsg->cmsg_len))
++
++    return (struct cmsghdr *) 0;
++
++  /* Now, we trust cmsg_len and can use it to find the next header.  */
+   __cmsg = (struct cmsghdr *) ((unsigned char *) __cmsg
+ 			       + CMSG_ALIGN (__cmsg->cmsg_len));
+-  if ((unsigned char *) (__cmsg + 1) > ((unsigned char *) __mhdr->msg_control
+-					+ __mhdr->msg_controllen)
+-      || ((unsigned char *) __cmsg + CMSG_ALIGN (__cmsg->cmsg_len)
+-	  > ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen)))
+-    /* No more entries.  */
+-    return (struct cmsghdr *) 0;
+   return __cmsg;
+ }
+ #endif	/* Use `extern inline'.  */
+diff --git a/sysdeps/unix/sysv/linux/bits/socket.h b/sysdeps/unix/sysv/linux/bits/socket.h
+index 4f1f810ea1..539b8d7716 100644
+--- a/sysdeps/unix/sysv/linux/bits/socket.h
++++ b/sysdeps/unix/sysv/linux/bits/socket.h
+@@ -307,6 +307,12 @@ struct cmsghdr
+ 			 + CMSG_ALIGN (sizeof (struct cmsghdr)))
+ #define CMSG_LEN(len)   (CMSG_ALIGN (sizeof (struct cmsghdr)) + (len))
+ 
++/* Given a length, return the additional padding necessary such that
++   len + __CMSG_PADDING(len) == CMSG_ALIGN (len).  */
++#define __CMSG_PADDING(len) ((sizeof (size_t) \
++                              - ((len) & (sizeof (size_t) - 1))) \
++                             & (sizeof (size_t) - 1))
++
+ extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr,
+ 				      struct cmsghdr *__cmsg) __THROW;
+ #ifdef __USE_EXTERN_INLINES
+@@ -316,18 +322,38 @@ extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr,
+ _EXTERN_INLINE struct cmsghdr *
+ __NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg))
+ {
++  /* We may safely assume that __cmsg lies between __mhdr->msg_control and
++     __mhdr->msg_controllen because the user is required to obtain the first
++     cmsg via CMSG_FIRSTHDR, set its length, then obtain subsequent cmsgs
++     via CMSG_NXTHDR, setting lengths along the way.  However, we don't yet
++     trust the value of __cmsg->cmsg_len and therefore do not use it in any
++     pointer arithmetic until we check its value.  */
++
++  unsigned char * __msg_control_ptr = (unsigned char *) __mhdr->msg_control;
++  unsigned char * __cmsg_ptr = (unsigned char *) __cmsg;
++
++  size_t __size_needed = sizeof (struct cmsghdr)
++                         + __CMSG_PADDING (__cmsg->cmsg_len);
++
++  /* The current header is malformed, too small to be a full header.  */
+   if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr))
+-    /* The kernel header does this so there may be a reason.  */
+     return (struct cmsghdr *) 0;
+ 
++  /* There isn't enough space between __cmsg and the end of the buffer to
++  hold the current cmsg *and* the next one.  */
++  if (((size_t)
++         (__msg_control_ptr + __mhdr->msg_controllen - __cmsg_ptr)
++       < __size_needed)
++      || ((size_t)
++            (__msg_control_ptr + __mhdr->msg_controllen - __cmsg_ptr
++             - __size_needed)
++          < __cmsg->cmsg_len))
++
++    return (struct cmsghdr *) 0;
++
++  /* Now, we trust cmsg_len and can use it to find the next header.  */
+   __cmsg = (struct cmsghdr *) ((unsigned char *) __cmsg
+ 			       + CMSG_ALIGN (__cmsg->cmsg_len));
+-  if ((unsigned char *) (__cmsg + 1) > ((unsigned char *) __mhdr->msg_control
+-					+ __mhdr->msg_controllen)
+-      || ((unsigned char *) __cmsg + CMSG_ALIGN (__cmsg->cmsg_len)
+-	  > ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen)))
+-    /* No more entries.  */
+-    return (struct cmsghdr *) 0;
+   return __cmsg;
+ }
+ #endif	/* Use `extern inline'.  */
+diff --git a/sysdeps/unix/sysv/linux/cmsg_nxthdr.c b/sysdeps/unix/sysv/linux/cmsg_nxthdr.c
+index 15b7a3a925..24f72b797a 100644
+--- a/sysdeps/unix/sysv/linux/cmsg_nxthdr.c
++++ b/sysdeps/unix/sysv/linux/cmsg_nxthdr.c
+@@ -23,18 +23,38 @@
+ struct cmsghdr *
+ __cmsg_nxthdr (struct msghdr *mhdr, struct cmsghdr *cmsg)
+ {
++  /* We may safely assume that cmsg lies between mhdr->msg_control and
++     mhdr->msg_controllen because the user is required to obtain the first
++     cmsg via CMSG_FIRSTHDR, set its length, then obtain subsequent cmsgs
++     via CMSG_NXTHDR, setting lengths along the way.  However, we don't yet
++     trust the value of cmsg->cmsg_len and therefore do not use it in any
++     pointer arithmetic until we check its value.  */
++
++  unsigned char * msg_control_ptr = (unsigned char *) mhdr->msg_control;
++  unsigned char * cmsg_ptr = (unsigned char *) cmsg;
++
++  size_t size_needed = sizeof (struct cmsghdr)
++                       + __CMSG_PADDING (cmsg->cmsg_len);
++
++  /* The current header is malformed, too small to be a full header.  */
+   if ((size_t) cmsg->cmsg_len < sizeof (struct cmsghdr))
+-    /* The kernel header does this so there may be a reason.  */
+-    return NULL;
++    return (struct cmsghdr *) 0;
++
++  /* There isn't enough space between cmsg and the end of the buffer to
++  hold the current cmsg *and* the next one.  */
++  if (((size_t)
++         (msg_control_ptr + mhdr->msg_controllen - cmsg_ptr)
++       < size_needed)
++      || ((size_t)
++            (msg_control_ptr + mhdr->msg_controllen - cmsg_ptr
++             - size_needed)
++          < cmsg->cmsg_len))
++
++    return (struct cmsghdr *) 0;
+ 
++  /* Now, we trust cmsg_len and can use it to find the next header.  */
+   cmsg = (struct cmsghdr *) ((unsigned char *) cmsg
+ 			     + CMSG_ALIGN (cmsg->cmsg_len));
+-  if ((unsigned char *) (cmsg + 1) > ((unsigned char *) mhdr->msg_control
+-				      + mhdr->msg_controllen)
+-      || ((unsigned char *) cmsg + CMSG_ALIGN (cmsg->cmsg_len)
+-	  > ((unsigned char *) mhdr->msg_control + mhdr->msg_controllen)))
+-    /* No more entries.  */
+-    return NULL;
+   return cmsg;
+ }
+ libc_hidden_def (__cmsg_nxthdr)
+-- 
+2.38.1
+
+
+From 5c62874f423af93e97b51bc9a57af228a546156f Mon Sep 17 00:00:00 2001
+From: Arjun Shankar <arjun@redhat.com>
+Date: Mon, 22 Aug 2022 18:21:14 +0200
+Subject: NEWS: Add entry for bug 28846
+
+---
+ NEWS | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/NEWS b/NEWS
+index becab3ade9..ae30900bbc 100644
+--- a/NEWS
++++ b/NEWS
+@@ -9,6 +9,7 @@ Version 2.36.1
+ 
+ The following bugs are resolved with this release:
+ 
++  [28846] CMSG_NXTHDR may trigger -Wstrict-overflow warning
+   [29446] _dlopen now ignores dl_caller argument in static mode
+   [29485] Linux: Terminate subprocess on late failure in tst-pidfd
+   [29490] alpha: New __brk_call implementation is broken
+-- 
+2.38.1
+
+
+From 0062e7dd1c3674ece2daca53a898badd28b60421 Mon Sep 17 00:00:00 2001
+From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Wed, 10 Aug 2022 16:24:06 -0300
+Subject: glibcextract.py: Add compile_c_snippet
+
+It might be used on tests to check if a snippet build with the provided
+compiler and flags.
+
+Reviewed-by: Florian Weimer <fweimer@redhat.com>
+(cherry picked from commit 841afa116e32b3c7195475769c26bf46fd870d32)
+---
+ scripts/glibcextract.py | 19 +++++++++++++++++++
+ 1 file changed, 19 insertions(+)
+
+diff --git a/scripts/glibcextract.py b/scripts/glibcextract.py
+index 43ab58ffe2..36d204c9b0 100644
+--- a/scripts/glibcextract.py
++++ b/scripts/glibcextract.py
+@@ -17,6 +17,7 @@
+ # License along with the GNU C Library; if not, see
+ # <https://www.gnu.org/licenses/>.
+ 
++import collections
+ import os.path
+ import re
+ import subprocess
+@@ -173,3 +174,21 @@ def compare_macro_consts(source_1, source_2, cc, macro_re, exclude_re=None,
+             if not allow_extra_2:
+                 ret = 1
+     return ret
++
++CompileResult = collections.namedtuple("CompileResult", "returncode output")
++
++def compile_c_snippet(snippet, cc, extra_cc_args=''):
++    """Compile and return whether the SNIPPET can be build with CC along
++       EXTRA_CC_ARGS compiler flags.  Return a CompileResult with RETURNCODE
++       being 0 for success, or the failure value and the compiler output.
++    """
++    with tempfile.TemporaryDirectory() as temp_dir:
++        c_file_name = os.path.join(temp_dir, 'test.c')
++        obj_file_name = os.path.join(temp_dir, 'test.o')
++        with open(c_file_name, 'w') as c_file:
++            c_file.write(snippet + '\n')
++        cmd = cc.split() + extra_cc_args.split() + ['-c', '-o', obj_file_name,
++                c_file_name]
++        r = subprocess.run(cmd, check=False, stdout=subprocess.PIPE,
++                stderr=subprocess.STDOUT)
++        return CompileResult(r.returncode, r.stdout)
+-- 
+2.38.1
+
+
+From 1cc5513114e76083669cba1b11252aad35525e69 Mon Sep 17 00:00:00 2001
+From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Wed, 10 Aug 2022 14:24:44 -0300
+Subject: linux: Use compile_c_snippet to check linux/pidfd.h availability
+
+Instead of tying to a specific kernel version.
+
+Checked on x86_64-linux-gnu.
+
+Reviewed-by: Florian Weimer <fweimer@redhat.com>
+(cherry picked from commit 1542019b69b7ec7b2cd34357af035e406d153631)
+---
+ sysdeps/unix/sysv/linux/tst-pidfd-consts.py | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/sysdeps/unix/sysv/linux/tst-pidfd-consts.py b/sysdeps/unix/sysv/linux/tst-pidfd-consts.py
+index 90cbb9be64..d732173abd 100644
+--- a/sysdeps/unix/sysv/linux/tst-pidfd-consts.py
++++ b/sysdeps/unix/sysv/linux/tst-pidfd-consts.py
+@@ -33,11 +33,13 @@ def main():
+                         help='C compiler (including options) to use')
+     args = parser.parse_args()
+ 
+-    linux_version_headers = glibcsyscalls.linux_kernel_version(args.cc)
+-    # Linux started to provide pidfd.h with 5.10.
+-    if linux_version_headers < (5, 10):
++    if glibcextract.compile_c_snippet(
++            '#include <linux/pidfd.h>',
++            args.cc).returncode != 0:
+         sys.exit (77)
+-    linux_version_glibc = (5, 18)
++
++    linux_version_headers = glibcsyscalls.linux_kernel_version(args.cc)
++    linux_version_glibc = (5, 19)
+     sys.exit(glibcextract.compare_macro_consts(
+                 '#include <sys/pidfd.h>\n',
+                 '#include <asm/fcntl.h>\n'
+-- 
+2.38.1
+
+
+From 4dad97e2a2e510c6b53a0add29a2188714fcf4ab Mon Sep 17 00:00:00 2001
+From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Wed, 10 Aug 2022 14:24:45 -0300
+Subject: linux: Mimic kernel defition for BLOCK_SIZE
+
+To avoid possible warnings if the kernel header is included before
+sys/mount.h.
+
+Reviewed-by: Florian Weimer <fweimer@redhat.com>
+(cherry picked from commit c68b6044bc7945716431f1adc091b17c39b80a06)
+---
+ sysdeps/unix/sysv/linux/sys/mount.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/sysdeps/unix/sysv/linux/sys/mount.h b/sysdeps/unix/sysv/linux/sys/mount.h
+index f965986ba8..df6b0dbb42 100644
+--- a/sysdeps/unix/sysv/linux/sys/mount.h
++++ b/sysdeps/unix/sysv/linux/sys/mount.h
+@@ -27,8 +27,8 @@
+ #include <stddef.h>
+ #include <sys/ioctl.h>
+ 
+-#define BLOCK_SIZE	1024
+ #define BLOCK_SIZE_BITS	10
++#define BLOCK_SIZE	(1<<BLOCK_SIZE_BITS)
+ 
+ 
+ /* These are the fs-independent mount-flags: up to 16 flags are
+-- 
+2.38.1
+
+
+From d48813227b63a0d92ea357ea0733229ed74e31ab Mon Sep 17 00:00:00 2001
+From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Wed, 10 Aug 2022 14:24:46 -0300
+Subject: linux: Use compile_c_snippet to check linux/mount.h availability
+
+Checked on x86_64-linux-gnu.
+
+Reviewed-by: Florian Weimer <fweimer@redhat.com>
+(cherry picked from commit e1226cdc6b209539a92d32d5b620ba53fd35abf3)
+---
+ sysdeps/unix/sysv/linux/tst-mount-consts.py | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/sysdeps/unix/sysv/linux/tst-mount-consts.py b/sysdeps/unix/sysv/linux/tst-mount-consts.py
+index a62f803123..be2ef2daf1 100755
+--- a/sysdeps/unix/sysv/linux/tst-mount-consts.py
++++ b/sysdeps/unix/sysv/linux/tst-mount-consts.py
+@@ -33,6 +33,11 @@ def main():
+                         help='C compiler (including options) to use')
+     args = parser.parse_args()
+ 
++    if glibcextract.compile_c_snippet(
++            '#include <linux/mount.h>',
++            args.cc).returncode != 0:
++        sys.exit (77)
++
+     linux_version_headers = glibcsyscalls.linux_kernel_version(args.cc)
+     # Constants in glibc were updated to match Linux v5.16.  When glibc
+     # constants are updated this value should be updated to match the
+-- 
+2.38.1
+
+
+From bb1e8b0ca99b5cbedfae3e6245528a87d95ff3e2 Mon Sep 17 00:00:00 2001
+From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Wed, 10 Aug 2022 14:24:47 -0300
+Subject: linux: Fix sys/mount.h usage with kernel headers
+
+Now that kernel exports linux/mount.h and includes it on linux/fs.h,
+its definitions might clash with glibc exports sys/mount.h.  To avoid
+the need to rearrange the Linux header to be always after glibc one,
+the glibc sys/mount.h is changed to:
+
+  1. Undefine the macros also used as enum constants.  This covers prior
+     inclusion of <linux/mount.h> (for instance MS_RDONLY).
+
+  2. Include <linux/mount.h> based on the usual __has_include check
+     (needs to use __has_include ("linux/mount.h") to paper over GCC
+     bugs.
+
+  3. Define enum fsconfig_command only if FSOPEN_CLOEXEC is not defined.
+     (FSOPEN_CLOEXEC should be a very close proxy.)
+
+  4. Define struct mount_attr if MOUNT_ATTR_SIZE_VER0 is not defined.
+     (Added in the same commit on the Linux side.)
+
+This patch also adds some tests to check if including linux/fs.h and
+linux/mount.h after and before sys/mount.h does work.
+
+Checked on x86_64-linux-gnu.
+
+Reviewed-by: Florian Weimer <fweimer@redhat.com>
+(cherry picked from commit 774058d72942249f71d74e7f2b639f77184160a6)
+---
+ sysdeps/unix/sysv/linux/Makefile             |  8 +++
+ sysdeps/unix/sysv/linux/sys/mount.h          | 71 +++++++++++++++++---
+ sysdeps/unix/sysv/linux/tst-mount-compile.py | 66 ++++++++++++++++++
+ 3 files changed, 137 insertions(+), 8 deletions(-)
+ create mode 100755 sysdeps/unix/sysv/linux/tst-mount-compile.py
+
+diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
+index a139a16532..3ceda9fdbf 100644
+--- a/sysdeps/unix/sysv/linux/Makefile
++++ b/sysdeps/unix/sysv/linux/Makefile
+@@ -265,6 +265,14 @@ $(objpfx)tst-mount-consts.out: ../sysdeps/unix/sysv/linux/tst-mount-consts.py
+ 	  < /dev/null > $@ 2>&1; $(evaluate-test)
+ $(objpfx)tst-mount-consts.out: $(sysdeps-linux-python-deps)
+ 
++tests-special += $(objpfx)tst-mount-compile.out
++$(objpfx)tst-mount-compile.out: ../sysdeps/unix/sysv/linux/tst-mount-compile.py
++	$(sysdeps-linux-python) \
++	  ../sysdeps/unix/sysv/linux/tst-mount-compile.py \
++	    $(sysdeps-linux-python-cc) \
++	  < /dev/null > $@ 2>&1; $(evaluate-test)
++$(objpfx)tst-mount-compile.out: $(sysdeps-linux-python-deps)
++
+ tst-rseq-disable-ENV = GLIBC_TUNABLES=glibc.pthread.rseq=0
+ 
+ endif # $(subdir) == misc
+diff --git a/sysdeps/unix/sysv/linux/sys/mount.h b/sysdeps/unix/sysv/linux/sys/mount.h
+index df6b0dbb42..2e3fd6a7fe 100644
+--- a/sysdeps/unix/sysv/linux/sys/mount.h
++++ b/sysdeps/unix/sysv/linux/sys/mount.h
+@@ -27,6 +27,13 @@
+ #include <stddef.h>
+ #include <sys/ioctl.h>
+ 
++#ifdef __has_include
++# if __has_include ("linux/mount.h")
++#  include "linux/mount.h"
++# endif
++#endif
++
++
+ #define BLOCK_SIZE_BITS	10
+ #define BLOCK_SIZE	(1<<BLOCK_SIZE_BITS)
+ 
+@@ -35,69 +42,98 @@
+    supported  */
+ enum
+ {
++#undef MS_RDONLY
+   MS_RDONLY = 1,		/* Mount read-only.  */
+ #define MS_RDONLY	MS_RDONLY
++#undef MS_NOSUID
+   MS_NOSUID = 2,		/* Ignore suid and sgid bits.  */
+ #define MS_NOSUID	MS_NOSUID
++#undef MS_NODEV
+   MS_NODEV = 4,			/* Disallow access to device special files.  */
+ #define MS_NODEV	MS_NODEV
++#undef MS_NOEXEC
+   MS_NOEXEC = 8,		/* Disallow program execution.  */
+ #define MS_NOEXEC	MS_NOEXEC
++#undef MS_SYNCHRONOUS
+   MS_SYNCHRONOUS = 16,		/* Writes are synced at once.  */
+ #define MS_SYNCHRONOUS	MS_SYNCHRONOUS
++#undef MS_REMOUNT
+   MS_REMOUNT = 32,		/* Alter flags of a mounted FS.  */
+ #define MS_REMOUNT	MS_REMOUNT
++#undef MS_MANDLOCK
+   MS_MANDLOCK = 64,		/* Allow mandatory locks on an FS.  */
+ #define MS_MANDLOCK	MS_MANDLOCK
++#undef MS_DIRSYNC
+   MS_DIRSYNC = 128,		/* Directory modifications are synchronous.  */
+ #define MS_DIRSYNC	MS_DIRSYNC
++#undef MS_NOSYMFOLLOW
+   MS_NOSYMFOLLOW = 256,		/* Do not follow symlinks.  */
+ #define MS_NOSYMFOLLOW	MS_NOSYMFOLLOW
++#undef MS_NOATIME
+   MS_NOATIME = 1024,		/* Do not update access times.  */
+ #define MS_NOATIME	MS_NOATIME
++#undef MS_NODIRATIME
+   MS_NODIRATIME = 2048,		/* Do not update directory access times.  */
+ #define MS_NODIRATIME	MS_NODIRATIME
++#undef MS_BIND
+   MS_BIND = 4096,		/* Bind directory at different place.  */
+ #define MS_BIND		MS_BIND
++#undef MS_MOVE
+   MS_MOVE = 8192,
+ #define MS_MOVE		MS_MOVE
++#undef MS_REC
+   MS_REC = 16384,
+ #define MS_REC		MS_REC
++#undef MS_SILENT
+   MS_SILENT = 32768,
+ #define MS_SILENT	MS_SILENT
++#undef MS_POSIXACL
+   MS_POSIXACL = 1 << 16,	/* VFS does not apply the umask.  */
+ #define MS_POSIXACL	MS_POSIXACL
++#undef MS_UNBINDABLE
+   MS_UNBINDABLE = 1 << 17,	/* Change to unbindable.  */
+ #define MS_UNBINDABLE	MS_UNBINDABLE
++#undef MS_PRIVATE
+   MS_PRIVATE = 1 << 18,		/* Change to private.  */
+ #define MS_PRIVATE	MS_PRIVATE
++#undef MS_SLAVE
+   MS_SLAVE = 1 << 19,		/* Change to slave.  */
+ #define MS_SLAVE	MS_SLAVE
++#undef MS_SHARED
+   MS_SHARED = 1 << 20,		/* Change to shared.  */
+ #define MS_SHARED	MS_SHARED
++#undef MS_RELATIME
+   MS_RELATIME = 1 << 21,	/* Update atime relative to mtime/ctime.  */
+ #define MS_RELATIME	MS_RELATIME
++#undef MS_KERNMOUNT
+   MS_KERNMOUNT = 1 << 22,	/* This is a kern_mount call.  */
+ #define MS_KERNMOUNT	MS_KERNMOUNT
++#undef MS_I_VERSION
+   MS_I_VERSION =  1 << 23,	/* Update inode I_version field.  */
+ #define MS_I_VERSION	MS_I_VERSION
++#undef MS_STRICTATIME
+   MS_STRICTATIME = 1 << 24,	/* Always perform atime updates.  */
+ #define MS_STRICTATIME	MS_STRICTATIME
++#undef MS_LAZYTIME
+   MS_LAZYTIME = 1 << 25,	/* Update the on-disk [acm]times lazily.  */
+ #define MS_LAZYTIME	MS_LAZYTIME
++#undef MS_ACTIVE
+   MS_ACTIVE = 1 << 30,
+ #define MS_ACTIVE	MS_ACTIVE
++#undef MS_NOUSER
+   MS_NOUSER = 1 << 31
+ #define MS_NOUSER	MS_NOUSER
+ };
+ 
+ /* Flags that can be altered by MS_REMOUNT  */
++#undef MS_RMT_MASK
+ #define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_I_VERSION \
+ 		     |MS_LAZYTIME)
+ 
+ 
+ /* Magic mount flag number. Has to be or-ed to the flag values.  */
+ 
++#undef MS_MGC_VAL
+ #define MS_MGC_VAL 0xc0ed0000	/* Magic flag number to indicate "new" flags */
+ #define MS_MGC_MSK 0xffff0000	/* Magic flag number mask */
+ 
+@@ -106,20 +142,35 @@ enum
+    is probably as bad and I don't want to create yet another include
+    file.  */
+ 
++#undef BLKROSET
+ #define BLKROSET   _IO(0x12, 93) /* Set device read-only (0 = read-write).  */
++#undef BLKROGET
+ #define BLKROGET   _IO(0x12, 94) /* Get read-only status (0 = read_write).  */
++#undef BLKRRPART
+ #define BLKRRPART  _IO(0x12, 95) /* Re-read partition table.  */
++#undef BLKGETSIZE
+ #define BLKGETSIZE _IO(0x12, 96) /* Return device size.  */
++#undef BLKFLSBUF
+ #define BLKFLSBUF  _IO(0x12, 97) /* Flush buffer cache.  */
++#undef BLKRASET
+ #define BLKRASET   _IO(0x12, 98) /* Set read ahead for block device.  */
++#undef BLKRAGET
+ #define BLKRAGET   _IO(0x12, 99) /* Get current read ahead setting.  */
++#undef BLKFRASET
+ #define BLKFRASET  _IO(0x12,100) /* Set filesystem read-ahead.  */
++#undef BLKFRAGET
+ #define BLKFRAGET  _IO(0x12,101) /* Get filesystem read-ahead.  */
++#undef BLKSECTSET
+ #define BLKSECTSET _IO(0x12,102) /* Set max sectors per request.  */
++#undef BLKSECTGET
+ #define BLKSECTGET _IO(0x12,103) /* Get max sectors per request.  */
++#undef BLKSSZGET
+ #define BLKSSZGET  _IO(0x12,104) /* Get block device sector size.  */
++#undef BLKBSZGET
+ #define BLKBSZGET  _IOR(0x12,112,size_t)
++#undef BLKBSZSET
+ #define BLKBSZSET  _IOW(0x12,113,size_t)
++#undef BLKGETSIZE64
+ #define BLKGETSIZE64 _IOR(0x12,114,size_t) /* return device size.  */
+ 
+ 
+@@ -157,6 +208,7 @@ enum
+ #define MOUNT_ATTR_NOSYMFOLLOW  0x00200000 /* Do not follow symlinks.  */
+ 
+ 
++#ifndef MOUNT_ATTR_SIZE_VER0
+ /* For mount_setattr.  */
+ struct mount_attr
+ {
+@@ -165,6 +217,7 @@ struct mount_attr
+   uint64_t propagation;
+   uint64_t userns_fd;
+ };
++#endif
+ 
+ #define MOUNT_ATTR_SIZE_VER0    32 /* sizeof first published struct */
+ 
+@@ -185,26 +238,28 @@ struct mount_attr
+ #define FSPICK_EMPTY_PATH       0x00000008
+ 
+ 
++#ifndef FSOPEN_CLOEXEC
+ /* The type of fsconfig call made.   */
+ enum fsconfig_command
+ {
+   FSCONFIG_SET_FLAG       = 0,    /* Set parameter, supplying no value */
+-#define FSCONFIG_SET_FLAG FSCONFIG_SET_FLAG
++# define FSCONFIG_SET_FLAG FSCONFIG_SET_FLAG
+   FSCONFIG_SET_STRING     = 1,    /* Set parameter, supplying a string value */
+-#define FSCONFIG_SET_STRING FSCONFIG_SET_STRING
++# define FSCONFIG_SET_STRING FSCONFIG_SET_STRING
+   FSCONFIG_SET_BINARY     = 2,    /* Set parameter, supplying a binary blob value */
+-#define FSCONFIG_SET_BINARY FSCONFIG_SET_BINARY
++# define FSCONFIG_SET_BINARY FSCONFIG_SET_BINARY
+   FSCONFIG_SET_PATH       = 3,    /* Set parameter, supplying an object by path */
+-#define FSCONFIG_SET_PATH FSCONFIG_SET_PATH
++# define FSCONFIG_SET_PATH FSCONFIG_SET_PATH
+   FSCONFIG_SET_PATH_EMPTY = 4,    /* Set parameter, supplying an object by (empty) path */
+-#define FSCONFIG_SET_PATH_EMPTY FSCONFIG_SET_PATH_EMPTY
++# define FSCONFIG_SET_PATH_EMPTY FSCONFIG_SET_PATH_EMPTY
+   FSCONFIG_SET_FD         = 5,    /* Set parameter, supplying an object by fd */
+-#define FSCONFIG_SET_FD FSCONFIG_SET_FD
++# define FSCONFIG_SET_FD FSCONFIG_SET_FD
+   FSCONFIG_CMD_CREATE     = 6,    /* Invoke superblock creation */
+-#define FSCONFIG_CMD_CREATE FSCONFIG_CMD_CREATE
++# define FSCONFIG_CMD_CREATE FSCONFIG_CMD_CREATE
+   FSCONFIG_CMD_RECONFIGURE = 7,   /* Invoke superblock reconfiguration */
+-#define FSCONFIG_CMD_RECONFIGURE FSCONFIG_CMD_RECONFIGURE
++# define FSCONFIG_CMD_RECONFIGURE FSCONFIG_CMD_RECONFIGURE
+ };
++#endif
+ 
+ /* open_tree flags.  */
+ #define OPEN_TREE_CLONE    1         /* Clone the target tree and attach the clone */
+diff --git a/sysdeps/unix/sysv/linux/tst-mount-compile.py b/sysdeps/unix/sysv/linux/tst-mount-compile.py
+new file mode 100755
+index 0000000000..0ec74d4e0b
+--- /dev/null
++++ b/sysdeps/unix/sysv/linux/tst-mount-compile.py
+@@ -0,0 +1,66 @@
++#!/usr/bin/python3
++# Check if glibc provided sys/mount.h can be used along related kernel
++# headers.
++# Copyright (C) 2022 Free Software Foundation, Inc.
++# This file is part of the GNU C Library.
++#
++# The GNU C Library is free software; you can redistribute it and/or
++# modify it under the terms of the GNU Lesser General Public
++# License as published by the Free Software Foundation; either
++# version 2.1 of the License, or (at your option) any later version.
++#
++# The GNU C Library is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++# Lesser General Public License for more details.
++#
++# You should have received a copy of the GNU Lesser General Public
++# License along with the GNU C Library; if not, see
++# <https://www.gnu.org/licenses/>.
++
++import argparse
++import sys
++
++import glibcextract
++
++
++def main():
++    """The main entry point."""
++    parser = argparse.ArgumentParser(
++        description='Check if glibc provided sys/mount.h can be '
++                    ' used along related kernel headers.')
++    parser.add_argument('--cc', metavar='CC',
++                        help='C compiler (including options) to use')
++    args = parser.parse_args()
++
++    if glibcextract.compile_c_snippet(
++            '#include <linux/mount.h>',
++            args.cc).returncode != 0:
++        sys.exit (77)
++
++    def check(testname, snippet):
++        # Add -Werror to catch macro redefinitions and _ISOMAC to avoid
++        # internal glibc definitions.
++        r = glibcextract.compile_c_snippet(snippet, args.cc,
++                '-Werror -D_ISOMAC')
++        if r.returncode != 0:
++            print('error: test {}:\n{}'.format(testname, r.output.decode()))
++        return r.returncode
++
++    status = max(
++        check("sys/mount.h + linux/mount.h",
++              "#include <sys/mount.h>\n"
++              "#include <linux/mount.h>"),
++        check("sys/mount.h + linux/fs.h",
++              "#include <sys/mount.h>\n"
++              "#include <linux/fs.h>"),
++        check("linux/mount.h + sys/mount.h",
++              "#include <linux/mount.h>\n"
++              "#include <sys/mount.h>"),
++        check("linux/fs.h + sys/mount.h",
++              "#include <linux/fs.h>\n"
++              "#include <sys/mount.h>"))
++    sys.exit(status)
++
++if __name__ == '__main__':
++    main()
+-- 
+2.38.1
+
+
+From 3bd3c612e98a53ce60ed972f5cd2b90628b3cba5 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 16 Aug 2022 09:25:23 +0200
+Subject: Linux: Fix enum fsconfig_command detection in <sys/mount.h>
+
+The #ifdef FSOPEN_CLOEXEC check did not work because the macro
+was always defined in this header prior to the check, so that
+the <linux/mount.h> contents did not matter.
+
+Fixes commit 774058d72942249f71d74e7f2b639f77184160a6
+("linux: Fix sys/mount.h usage with kernel headers").
+
+(cherry picked from commit 2955ef4b7c9b56fcd7abfeddef7ee83c60abff98)
+---
+ sysdeps/unix/sysv/linux/sys/mount.h | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/sysdeps/unix/sysv/linux/sys/mount.h b/sysdeps/unix/sysv/linux/sys/mount.h
+index 2e3fd6a7fe..19841d0738 100644
+--- a/sysdeps/unix/sysv/linux/sys/mount.h
++++ b/sysdeps/unix/sysv/linux/sys/mount.h
+@@ -188,9 +188,6 @@ enum
+ };
+ 
+ 
+-/* fsopen flags.  */
+-#define FSOPEN_CLOEXEC          0x00000001
+-
+ /* fsmount flags.  */
+ #define FSMOUNT_CLOEXEC         0x00000001
+ 
+@@ -261,6 +258,9 @@ enum fsconfig_command
+ };
+ #endif
+ 
++/* fsopen flags.  */
++#define FSOPEN_CLOEXEC          0x00000001
++
+ /* open_tree flags.  */
+ #define OPEN_TREE_CLONE    1         /* Clone the target tree and attach the clone */
+ #define OPEN_TREE_CLOEXEC  O_CLOEXEC /* Close the file on execve() */
+-- 
+2.38.1
+
+
+From b0e7888d1fa2dbd2d9e1645ec8c796abf78880b9 Mon Sep 17 00:00:00 2001
+From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Sun, 28 Aug 2022 16:52:53 -0300
+Subject: syslog: Fix large messages (BZ#29536)
+
+The a583b6add407c17cd change did not handle large messages that
+would require a heap allocation correctly, where the message itself
+is not take in consideration.
+
+This patch fixes it and extend the tst-syslog to check for large
+messages as well.
+
+Checked on x86_64-linux-gnu.
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit 52a5be0df411ef3ff45c10c7c308cb92993d15b1)
+---
+ misc/syslog.c     |  18 +++---
+ misc/tst-syslog.c | 152 +++++++++++++++++++++++++++++++++++++++-------
+ 2 files changed, 142 insertions(+), 28 deletions(-)
+
+diff --git a/misc/syslog.c b/misc/syslog.c
+index 554089bfc4..b88f66c835 100644
+--- a/misc/syslog.c
++++ b/misc/syslog.c
+@@ -193,28 +193,32 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
+       int vl = __vsnprintf_internal (bufs + l, sizeof bufs - l, fmt, apc,
+                                      mode_flags);
+       if (0 <= vl && vl < sizeof bufs - l)
+-        {
+-          buf = bufs;
+-          bufsize = l + vl;
+-        }
++        buf = bufs;
++      bufsize = l + vl;
+ 
+       va_end (apc);
+     }
+ 
+   if (buf == NULL)
+     {
+-      buf = malloc (l * sizeof (char));
++      buf = malloc ((bufsize + 1) * sizeof (char));
+       if (buf != NULL)
+ 	{
+ 	  /* Tell the cancellation handler to free this buffer.  */
+ 	  clarg.buf = buf;
+ 
+ 	  if (has_ts)
+-	    __snprintf (bufs, sizeof bufs,
++	    __snprintf (buf, l + 1,
+ 			SYSLOG_HEADER (pri, timestamp, &msgoff, pid));
+ 	  else
+-	    __snprintf (bufs, sizeof bufs,
++	    __snprintf (buf, l + 1,
+ 			SYSLOG_HEADER_WITHOUT_TS (pri, &msgoff));
++
++	  va_list apc;
++	  va_copy (apc, ap);
++	  __vsnprintf_internal (buf + l, bufsize - l + 1, fmt, apc,
++				mode_flags);
++	  va_end (apc);
+ 	}
+       else
+         {
+diff --git a/misc/tst-syslog.c b/misc/tst-syslog.c
+index e550d15796..1d332ece53 100644
+--- a/misc/tst-syslog.c
++++ b/misc/tst-syslog.c
+@@ -68,21 +68,19 @@ static const int priorities[] =
+     LOG_DEBUG
+   };
+ 
+-enum
+-  {
+-    ident_length = 64,
+-    msg_length = 64
+-  };
++#define IDENT_LENGTH 64
++#define MSG_LENGTH   1024
+ 
+ #define SYSLOG_MSG_BASE "syslog_message"
+ #define OPENLOG_IDENT   "openlog_ident"
++static char large_message[MSG_LENGTH];
+ 
+ struct msg_t
+   {
+     int priority;
+     int facility;
+-    char ident[ident_length];
+-    char msg[msg_length];
++    char ident[IDENT_LENGTH];
++    char msg[MSG_LENGTH];
+     pid_t pid;
+   };
+ 
+@@ -147,6 +145,37 @@ check_syslog_message (const struct msg_t *msg, int msgnum, int options,
+   return true;
+ }
+ 
++static void
++send_syslog_large (int options)
++{
++  int facility = LOG_USER;
++  int priority = LOG_INFO;
++
++  syslog (facility | priority, "%s %d %d", large_message, facility,
++	  priority);
++}
++
++static void
++send_vsyslog_large (int options)
++{
++  int facility = LOG_USER;
++  int priority = LOG_INFO;
++
++  call_vsyslog (facility | priority, "%s %d %d", large_message, facility,
++		priority);
++}
++
++static bool
++check_syslog_message_large (const struct msg_t *msg, int msgnum, int options,
++			    pid_t pid)
++{
++  TEST_COMPARE (msg->facility, LOG_USER);
++  TEST_COMPARE (msg->priority, LOG_INFO);
++  TEST_COMPARE_STRING (msg->msg, large_message);
++
++  return false;
++}
++
+ static void
+ send_openlog (int options)
+ {
+@@ -179,6 +208,17 @@ send_openlog (int options)
+   closelog ();
+ }
+ 
++static void
++send_openlog_large (int options)
++{
++  /* Define a non-default IDENT and a not default facility.  */
++  openlog (OPENLOG_IDENT, options, LOG_LOCAL0);
++
++  syslog (LOG_INFO, "%s %d %d", large_message, LOG_LOCAL0, LOG_INFO);
++
++  closelog ();
++}
++
+ static bool
+ check_openlog_message (const struct msg_t *msg, int msgnum,
+                        int options, pid_t pid)
+@@ -189,7 +229,7 @@ check_openlog_message (const struct msg_t *msg, int msgnum,
+   int expected_priority = priorities[msgnum % array_length (priorities)];
+   TEST_COMPARE (msg->priority, expected_priority);
+ 
+-  char expected_ident[ident_length];
++  char expected_ident[IDENT_LENGTH];
+   snprintf (expected_ident, sizeof (expected_ident), "%s%s%.0d%s:",
+             OPENLOG_IDENT,
+             options & LOG_PID ? "[" : "",
+@@ -211,15 +251,38 @@ check_openlog_message (const struct msg_t *msg, int msgnum,
+   return true;
+ }
+ 
++static bool
++check_openlog_message_large (const struct msg_t *msg, int msgnum,
++			     int options, pid_t pid)
++{
++  char expected_ident[IDENT_LENGTH];
++  snprintf (expected_ident, sizeof (expected_ident), "%s%s%.0d%s:",
++            OPENLOG_IDENT,
++            options & LOG_PID ? "[" : "",
++            options & LOG_PID ? pid : 0,
++            options & LOG_PID ? "]" : "");
++
++  TEST_COMPARE_STRING (msg->ident, expected_ident);
++  TEST_COMPARE_STRING (msg->msg, large_message);
++  TEST_COMPARE (msg->priority, LOG_INFO);
++  TEST_COMPARE (msg->facility, LOG_LOCAL0);
++
++  return false;
++}
++
+ static struct msg_t
+ parse_syslog_msg (const char *msg)
+ {
+   struct msg_t r = { .pid = -1 };
+   int number;
+ 
++#define STRINPUT(size)  XSTRINPUT(size)
++#define XSTRINPUT(size) "%" # size "s"
++
+   /* The message in the form:
+-     <179>Apr  8 14:51:19 tst-syslog: syslog message 176 3  */
+-  int n = sscanf (msg, "<%3d>%*s %*d %*d:%*d:%*d %32s %64s %*d %*d",
++     <179>Apr  8 14:51:19  tst-syslog: message 176 3  */
++  int n = sscanf (msg, "<%3d>%*s %*d %*d:%*d:%*d " STRINPUT(IDENT_LENGTH)
++		       " " STRINPUT(MSG_LENGTH) " %*d %*d",
+                   &number, r.ident, r.msg);
+   TEST_COMPARE (n, 3);
+ 
+@@ -246,7 +309,7 @@ parse_syslog_console (const char *msg)
+ 
+   /* The message in the form:
+      openlog_ident: syslog_message 128 0  */
+-  int n = sscanf (msg, "%32s %64s %d %d",
++  int n = sscanf (msg, STRINPUT(IDENT_LENGTH) " " STRINPUT(MSG_LENGTH) " %d %d",
+       r.ident, r.msg, &facility, &priority);
+   TEST_COMPARE (n, 4);
+ 
+@@ -281,7 +344,7 @@ check_syslog_udp (void (*syslog_send)(int), int options,
+   int msgnum = 0;
+   while (1)
+     {
+-      char buf[512];
++      char buf[2048];
+       size_t l = xrecvfrom (server_udp, buf, sizeof (buf), 0,
+                             (struct sockaddr *) &addr, &addrlen);
+       buf[l] = '\0';
+@@ -325,7 +388,7 @@ check_syslog_tcp (void (*syslog_send)(int), int options,
+ 
+   int client_tcp = xaccept (server_tcp, NULL, NULL);
+ 
+-  char buf[512], *rb = buf;
++  char buf[2048], *rb = buf;
+   size_t rbl = sizeof (buf);
+   size_t prl = 0;  /* Track the size of the partial record.  */
+   int msgnum = 0;
+@@ -393,20 +456,34 @@ check_syslog_console_read (FILE *fp)
+ }
+ 
+ static void
+-check_syslog_console (void)
++check_syslog_console_read_large (FILE *fp)
++{
++  char buf[2048];
++  TEST_VERIFY (fgets (buf, sizeof (buf), fp) != NULL);
++  struct msg_t msg = parse_syslog_console (buf);
++
++  TEST_COMPARE_STRING (msg.ident, OPENLOG_IDENT ":");
++  TEST_COMPARE_STRING (msg.msg, large_message);
++  TEST_COMPARE (msg.priority, LOG_INFO);
++  TEST_COMPARE (msg.facility, LOG_LOCAL0);
++}
++
++static void
++check_syslog_console (void (*syslog_send)(int),
++		      void (*syslog_check)(FILE *fp))
+ {
+   xmkfifo (_PATH_CONSOLE, 0666);
+ 
+   pid_t sender_pid = xfork ();
+   if (sender_pid == 0)
+     {
+-      send_openlog (LOG_CONS);
++      syslog_send (LOG_CONS);
+       _exit (0);
+     }
+ 
+   {
+     FILE *fp = xfopen (_PATH_CONSOLE, "r+");
+-    check_syslog_console_read (fp);
++    syslog_check (fp);
+     xfclose (fp);
+   }
+ 
+@@ -425,16 +502,28 @@ send_openlog_callback (void *clousure)
+ }
+ 
+ static void
+-check_syslog_perror (void)
++send_openlog_callback_large (void *clousure)
++{
++  int options = *(int *) clousure;
++  send_openlog_large (options);
++}
++
++static void
++check_syslog_perror (bool large)
+ {
+   struct support_capture_subprocess result;
+-  result = support_capture_subprocess (send_openlog_callback,
++  result = support_capture_subprocess (large
++				       ? send_openlog_callback_large
++				       : send_openlog_callback,
+                                        &(int){LOG_PERROR});
+ 
+   FILE *mfp = fmemopen (result.err.buffer, result.err.length, "r");
+   if (mfp == NULL)
+     FAIL_EXIT1 ("fmemopen: %m");
+-  check_syslog_console_read (mfp);
++  if (large)
++    check_syslog_console_read_large (mfp);
++  else
++    check_syslog_console_read (mfp);
+   xfclose (mfp);
+ 
+   support_capture_subprocess_check (&result, "tst-openlog-child", 0,
+@@ -462,10 +551,31 @@ do_test (void)
+   check_syslog_tcp (send_openlog, LOG_PID, check_openlog_message);
+ 
+   /* Check the LOG_CONS option.  */
+-  check_syslog_console ();
++  check_syslog_console (send_openlog, check_syslog_console_read);
+ 
+   /* Check the LOG_PERROR option.  */
+-  check_syslog_perror ();
++  check_syslog_perror (false);
++
++  /* Similar tests as before, but with a large message to trigger the
++     syslog path that uses dynamically allocated memory.  */
++  memset (large_message, 'a', sizeof large_message - 1);
++  large_message[sizeof large_message - 1] = '\0';
++
++  check_syslog_udp (send_syslog_large, 0, check_syslog_message_large);
++  check_syslog_tcp (send_syslog_large, 0, check_syslog_message_large);
++
++  check_syslog_udp (send_vsyslog_large, 0, check_syslog_message_large);
++  check_syslog_tcp (send_vsyslog_large, 0, check_syslog_message_large);
++
++  check_syslog_udp (send_openlog_large, 0, check_openlog_message_large);
++  check_syslog_tcp (send_openlog_large, 0, check_openlog_message_large);
++
++  check_syslog_udp (send_openlog_large, LOG_PID, check_openlog_message_large);
++  check_syslog_tcp (send_openlog_large, LOG_PID, check_openlog_message_large);
++
++  check_syslog_console (send_openlog_large, check_syslog_console_read_large);
++
++  check_syslog_perror (true);
+ 
+   return 0;
+ }
+-- 
+2.38.1
+
+
+From 924e4f3eaa502ce82fccf8537f021a796d158771 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Fri, 26 Aug 2022 21:15:43 +0200
+Subject: elf: Call __libc_early_init for reused namespaces (bug 29528)
+
+libc_map is never reset to NULL, neither during dlclose nor on a
+dlopen call which reuses the namespace structure.  As a result, if a
+namespace is reused, its libc is not initialized properly.  The most
+visible result is a crash in the <ctype.h> functions.
+
+To prevent similar bugs on namespace reuse from surfacing,
+unconditionally initialize the chosen namespace to zero using memset.
+
+(cherry picked from commit d0e357ff45a75553dee3b17ed7d303bfa544f6fe)
+---
+ NEWS                         |  1 +
+ elf/Makefile                 | 25 ++++++++++++++++++
+ elf/dl-open.c                | 13 ++++++----
+ elf/tst-dlmopen-twice-mod1.c | 37 ++++++++++++++++++++++++++
+ elf/tst-dlmopen-twice-mod2.c | 50 ++++++++++++++++++++++++++++++++++++
+ elf/tst-dlmopen-twice.c      | 34 ++++++++++++++++++++++++
+ 6 files changed, 155 insertions(+), 5 deletions(-)
+ create mode 100644 elf/tst-dlmopen-twice-mod1.c
+ create mode 100644 elf/tst-dlmopen-twice-mod2.c
+ create mode 100644 elf/tst-dlmopen-twice.c
+
+diff --git a/NEWS b/NEWS
+index ae30900bbc..6d31e5abba 100644
+--- a/NEWS
++++ b/NEWS
+@@ -13,6 +13,7 @@ The following bugs are resolved with this release:
+   [29446] _dlopen now ignores dl_caller argument in static mode
+   [29485] Linux: Terminate subprocess on late failure in tst-pidfd
+   [29490] alpha: New __brk_call implementation is broken
++  [29528] elf: Call __libc_early_init for reused namespaces
+ 
+ \f
+ Version 2.36
+diff --git a/elf/Makefile b/elf/Makefile
+index fd77d0c7c8..43353a4b08 100644
+--- a/elf/Makefile
++++ b/elf/Makefile
+@@ -408,6 +408,7 @@ tests += \
+   tst-dlmopen4 \
+   tst-dlmopen-dlerror \
+   tst-dlmopen-gethostbyname \
++  tst-dlmopen-twice \
+   tst-dlopenfail \
+   tst-dlopenfail-2 \
+   tst-dlopenrpath \
+@@ -834,6 +835,8 @@ modules-names += \
+   tst-dlmopen1mod \
+   tst-dlmopen-dlerror-mod \
+   tst-dlmopen-gethostbyname-mod \
++  tst-dlmopen-twice-mod1 \
++  tst-dlmopen-twice-mod2 \
+   tst-dlopenfaillinkmod \
+   tst-dlopenfailmod1 \
+   tst-dlopenfailmod2 \
+@@ -2967,3 +2970,25 @@ $(objpfx)tst-tls-allocation-failure-static-patched.out: \
+ 	grep -q '^Fatal glibc error: Cannot allocate TLS block$$' $@ \
+ 	  && grep -q '^status: 127$$' $@; \
+ 	  $(evaluate-test)
++
++$(objpfx)tst-audit-tlsdesc: $(objpfx)tst-audit-tlsdesc-mod1.so \
++			    $(objpfx)tst-audit-tlsdesc-mod2.so \
++			    $(shared-thread-library)
++ifeq (yes,$(have-mtls-dialect-gnu2))
++# The test is valid for all TLS types, but we want to exercise GNU2
++# TLS if possible.
++CFLAGS-tst-audit-tlsdesc-mod1.c += -mtls-dialect=gnu2
++CFLAGS-tst-audit-tlsdesc-mod2.c += -mtls-dialect=gnu2
++endif
++$(objpfx)tst-audit-tlsdesc-dlopen: $(shared-thread-library)
++$(objpfx)tst-audit-tlsdesc-dlopen.out: $(objpfx)tst-audit-tlsdesc-mod1.so \
++				       $(objpfx)tst-audit-tlsdesc-mod2.so
++$(objpfx)tst-audit-tlsdesc-mod1.so: $(objpfx)tst-audit-tlsdesc-mod2.so
++$(objpfx)tst-audit-tlsdesc.out: $(objpfx)tst-auditmod-tlsdesc.so
++tst-audit-tlsdesc-ENV = LD_AUDIT=$(objpfx)tst-auditmod-tlsdesc.so
++$(objpfx)tst-audit-tlsdesc-dlopen.out: $(objpfx)tst-auditmod-tlsdesc.so
++tst-audit-tlsdesc-dlopen-ENV = LD_AUDIT=$(objpfx)tst-auditmod-tlsdesc.so
++
++$(objpfx)tst-dlmopen-twice.out: \
++  $(objpfx)tst-dlmopen-twice-mod1.so \
++  $(objpfx)tst-dlmopen-twice-mod2.so
+diff --git a/elf/dl-open.c b/elf/dl-open.c
+index a23e65926b..46e8066fd8 100644
+--- a/elf/dl-open.c
++++ b/elf/dl-open.c
+@@ -844,11 +844,14 @@ _dl_open (const char *file, int mode, const void *caller_dlopen, Lmid_t nsid,
+ 	  _dl_signal_error (EINVAL, file, NULL, N_("\
+ no more namespaces available for dlmopen()"));
+ 	}
+-      else if (nsid == GL(dl_nns))
+-	{
+-	  __rtld_lock_initialize (GL(dl_ns)[nsid]._ns_unique_sym_table.lock);
+-	  ++GL(dl_nns);
+-	}
++
++      if (nsid == GL(dl_nns))
++	++GL(dl_nns);
++
++      /* Initialize the new namespace.  Most members are
++	 zero-initialized, only the lock needs special treatment.  */
++      memset (&GL(dl_ns)[nsid], 0, sizeof (GL(dl_ns)[nsid]));
++      __rtld_lock_initialize (GL(dl_ns)[nsid]._ns_unique_sym_table.lock);
+ 
+       _dl_debug_update (nsid)->r_state = RT_CONSISTENT;
+     }
+diff --git a/elf/tst-dlmopen-twice-mod1.c b/elf/tst-dlmopen-twice-mod1.c
+new file mode 100644
+index 0000000000..0eaf04948c
+--- /dev/null
++++ b/elf/tst-dlmopen-twice-mod1.c
+@@ -0,0 +1,37 @@
++/* Initialization of libc after dlmopen/dlclose/dlmopen (bug 29528).  Module 1.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <stdio.h>
++
++static void __attribute__ ((constructor))
++init (void)
++{
++  puts ("info: tst-dlmopen-twice-mod1.so loaded");
++  fflush (stdout);
++}
++
++static void __attribute__ ((destructor))
++fini (void)
++{
++  puts ("info: tst-dlmopen-twice-mod1.so about to be unloaded");
++  fflush (stdout);
++}
++
++/* Large allocation.  The second module does not have this, so it
++   should load libc at a different address.  */
++char large_allocate[16 * 1024 * 1024];
+diff --git a/elf/tst-dlmopen-twice-mod2.c b/elf/tst-dlmopen-twice-mod2.c
+new file mode 100644
+index 0000000000..40c6c01f96
+--- /dev/null
++++ b/elf/tst-dlmopen-twice-mod2.c
+@@ -0,0 +1,50 @@
++/* Initialization of libc after dlmopen/dlclose/dlmopen (bug 29528).  Module 2.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <ctype.h>
++#include <stdio.h>
++
++static void __attribute__ ((constructor))
++init (void)
++{
++  puts ("info: tst-dlmopen-twice-mod2.so loaded");
++  fflush (stdout);
++}
++
++static void __attribute__ ((destructor))
++fini (void)
++{
++  puts ("info: tst-dlmopen-twice-mod2.so about to be unloaded");
++  fflush (stdout);
++}
++
++int
++run_check (void)
++{
++  puts ("info: about to call isalpha");
++  fflush (stdout);
++
++  volatile char ch = 'a';
++  if (!isalpha (ch))
++    {
++      puts ("error: isalpha ('a') is not true");
++      fflush (stdout);
++      return 1;
++    }
++  return 0;
++}
+diff --git a/elf/tst-dlmopen-twice.c b/elf/tst-dlmopen-twice.c
+new file mode 100644
+index 0000000000..449f3c8fa9
+--- /dev/null
++++ b/elf/tst-dlmopen-twice.c
+@@ -0,0 +1,34 @@
++/* Initialization of libc after dlmopen/dlclose/dlmopen (bug 29528).  Main.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <support/xdlfcn.h>
++#include <support/check.h>
++
++static int
++do_test (void)
++{
++  void *handle = xdlmopen (LM_ID_NEWLM, "tst-dlmopen-twice-mod1.so", RTLD_NOW);
++  xdlclose (handle);
++  handle = xdlmopen (LM_ID_NEWLM, "tst-dlmopen-twice-mod2.so", RTLD_NOW);
++  int (*run_check) (void) = xdlsym (handle, "run_check");
++  TEST_COMPARE (run_check (), 0);
++  xdlclose (handle);
++  return 0;
++}
++
++#include <support/test-driver.c>
+-- 
+2.38.1
+
+
+From 3c791f2031ca8f6b99e96b774ed1c505ceb93595 Mon Sep 17 00:00:00 2001
+From: Raphael Moreira Zinsly <rzinsly@linux.ibm.com>
+Date: Wed, 24 Aug 2022 11:43:37 -0300
+Subject: Apply asm redirections in wchar.h before first use
+
+Similar to d0fa09a770, but for wchar.h.  Fixes [BZ #27087] by applying
+all long double related asm redirections before using functions in
+bits/wchar2.h.
+Moves the function declarations from wcsmbs/bits/wchar2.h to a new file
+wcsmbs/bits/wchar2-decl.h that will be included first in wcsmbs/wchar.h.
+
+Tested with build-many-glibcs.py.
+Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
+
+(cherry picked from commit c7509d49c4e8fa494120c5ead21338559dad16f5)
+---
+ include/bits/wchar2-decl.h |   1 +
+ wcsmbs/Makefile            |   5 +-
+ wcsmbs/bits/wchar2-decl.h  | 124 +++++++++++++++++++++++++++++++++++++
+ wcsmbs/bits/wchar2.h       |  72 ---------------------
+ wcsmbs/wchar.h             |  11 +++-
+ 5 files changed, 137 insertions(+), 76 deletions(-)
+ create mode 100644 include/bits/wchar2-decl.h
+ create mode 100644 wcsmbs/bits/wchar2-decl.h
+
+diff --git a/include/bits/wchar2-decl.h b/include/bits/wchar2-decl.h
+new file mode 100644
+index 0000000000..00b1b93342
+--- /dev/null
++++ b/include/bits/wchar2-decl.h
+@@ -0,0 +1 @@
++#include <wcsmbs/bits/wchar2-decl.h>
+diff --git a/wcsmbs/Makefile b/wcsmbs/Makefile
+index 3d19d5556f..4af102a3f6 100644
+--- a/wcsmbs/Makefile
++++ b/wcsmbs/Makefile
+@@ -22,8 +22,9 @@ subdir	:= wcsmbs
+ 
+ include ../Makeconfig
+ 
+-headers	:= wchar.h bits/wchar.h bits/wchar2.h bits/wchar-ldbl.h uchar.h \
+-	   bits/types/__mbstate_t.h bits/types/mbstate_t.h bits/types/wint_t.h
++headers	:= wchar.h bits/wchar.h bits/wchar2.h bits/wchar2-decl.h \
++	   bits/wchar-ldbl.h uchar.h bits/types/__mbstate_t.h \
++	   bits/types/mbstate_t.h bits/types/wint_t.h
+ 
+ routines := wcscat wcschr wcscmp wcscpy wcscspn wcsdup wcslen wcsncat \
+ 	    wcsncmp wcsncpy wcspbrk wcsrchr wcsspn wcstok wcsstr wmemchr \
+diff --git a/wcsmbs/bits/wchar2-decl.h b/wcsmbs/bits/wchar2-decl.h
+new file mode 100644
+index 0000000000..8e1735c33b
+--- /dev/null
++++ b/wcsmbs/bits/wchar2-decl.h
+@@ -0,0 +1,124 @@
++/* Checking macros for wchar functions.  Declarations only.
++   Copyright (C) 2004-2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#ifndef _BITS_WCHAR2_DECL_H
++#define _BITS_WCHAR2_DECL_H 1
++
++#ifndef _WCHAR_H
++# error "Never include <bits/wchar2-decl.h> directly; use <wchar.h> instead."
++#endif
++
++
++extern wchar_t *__wmemcpy_chk (wchar_t *__restrict __s1,
++			       const wchar_t *__restrict __s2, size_t __n,
++			       size_t __ns1) __THROW;
++extern wchar_t *__wmemmove_chk (wchar_t *__s1, const wchar_t *__s2,
++				size_t __n, size_t __ns1) __THROW;
++
++
++#ifdef __USE_GNU
++
++extern wchar_t *__wmempcpy_chk (wchar_t *__restrict __s1,
++				const wchar_t *__restrict __s2, size_t __n,
++				size_t __ns1) __THROW;
++
++#endif
++
++
++extern wchar_t *__wmemset_chk (wchar_t *__s, wchar_t __c, size_t __n,
++			       size_t __ns) __THROW;
++extern wchar_t *__wcscpy_chk (wchar_t *__restrict __dest,
++			      const wchar_t *__restrict __src,
++			      size_t __n) __THROW;
++extern wchar_t *__wcpcpy_chk (wchar_t *__restrict __dest,
++			      const wchar_t *__restrict __src,
++			      size_t __destlen) __THROW;
++extern wchar_t *__wcsncpy_chk (wchar_t *__restrict __dest,
++			       const wchar_t *__restrict __src, size_t __n,
++			       size_t __destlen) __THROW;
++extern wchar_t *__wcpncpy_chk (wchar_t *__restrict __dest,
++			       const wchar_t *__restrict __src, size_t __n,
++			       size_t __destlen) __THROW;
++extern wchar_t *__wcscat_chk (wchar_t *__restrict __dest,
++			      const wchar_t *__restrict __src,
++			      size_t __destlen) __THROW;
++extern wchar_t *__wcsncat_chk (wchar_t *__restrict __dest,
++			       const wchar_t *__restrict __src,
++			       size_t __n, size_t __destlen) __THROW;
++extern int __swprintf_chk (wchar_t *__restrict __s, size_t __n,
++			   int __flag, size_t __s_len,
++			   const wchar_t *__restrict __format, ...)
++     __THROW /* __attribute__ ((__format__ (__wprintf__, 5, 6))) */;
++extern int __vswprintf_chk (wchar_t *__restrict __s, size_t __n,
++			    int __flag, size_t __s_len,
++			    const wchar_t *__restrict __format,
++			    __gnuc_va_list __arg)
++     __THROW /* __attribute__ ((__format__ (__wprintf__, 5, 0))) */;
++
++#if __USE_FORTIFY_LEVEL > 1
++
++extern int __fwprintf_chk (__FILE *__restrict __stream, int __flag,
++			   const wchar_t *__restrict __format, ...);
++extern int __wprintf_chk (int __flag, const wchar_t *__restrict __format,
++			  ...);
++extern int __vfwprintf_chk (__FILE *__restrict __stream, int __flag,
++			    const wchar_t *__restrict __format,
++			    __gnuc_va_list __ap);
++extern int __vwprintf_chk (int __flag, const wchar_t *__restrict __format,
++			   __gnuc_va_list __ap);
++
++#endif
++
++extern wchar_t *__fgetws_chk (wchar_t *__restrict __s, size_t __size, int __n,
++			      __FILE *__restrict __stream) __wur;
++
++#ifdef __USE_GNU
++
++extern wchar_t *__fgetws_unlocked_chk (wchar_t *__restrict __s, size_t __size,
++				       int __n, __FILE *__restrict __stream)
++       __wur;
++
++#endif
++
++extern size_t __wcrtomb_chk (char *__restrict __s, wchar_t __wchar,
++			     mbstate_t *__restrict __p,
++			     size_t __buflen) __THROW __wur;
++extern size_t __mbsrtowcs_chk (wchar_t *__restrict __dst,
++			       const char **__restrict __src,
++			       size_t __len, mbstate_t *__restrict __ps,
++			       size_t __dstlen) __THROW;
++extern size_t __wcsrtombs_chk (char *__restrict __dst,
++			       const wchar_t **__restrict __src,
++			       size_t __len, mbstate_t *__restrict __ps,
++			       size_t __dstlen) __THROW;
++
++#ifdef	__USE_XOPEN2K8
++
++extern size_t __mbsnrtowcs_chk (wchar_t *__restrict __dst,
++				const char **__restrict __src, size_t __nmc,
++				size_t __len, mbstate_t *__restrict __ps,
++				size_t __dstlen) __THROW;
++extern size_t __wcsnrtombs_chk (char *__restrict __dst,
++				const wchar_t **__restrict __src,
++				size_t __nwc, size_t __len,
++				mbstate_t *__restrict __ps, size_t __dstlen)
++       __THROW;
++
++#endif
++
++#endif /* bits/wchar2-decl.h.  */
+diff --git a/wcsmbs/bits/wchar2.h b/wcsmbs/bits/wchar2.h
+index 0e017f458b..3f110efe57 100644
+--- a/wcsmbs/bits/wchar2.h
++++ b/wcsmbs/bits/wchar2.h
+@@ -21,9 +21,6 @@
+ #endif
+ 
+ 
+-extern wchar_t *__wmemcpy_chk (wchar_t *__restrict __s1,
+-			       const wchar_t *__restrict __s2, size_t __n,
+-			       size_t __ns1) __THROW;
+ extern wchar_t *__REDIRECT_NTH (__wmemcpy_alias,
+ 				(wchar_t *__restrict __s1,
+ 				 const wchar_t *__restrict __s2, size_t __n),
+@@ -45,8 +42,6 @@ __NTH (wmemcpy (wchar_t *__restrict __s1, const wchar_t *__restrict __s2,
+ }
+ 
+ 
+-extern wchar_t *__wmemmove_chk (wchar_t *__s1, const wchar_t *__s2,
+-				size_t __n, size_t __ns1) __THROW;
+ extern wchar_t *__REDIRECT_NTH (__wmemmove_alias, (wchar_t *__s1,
+ 						   const wchar_t *__s2,
+ 						   size_t __n), wmemmove);
+@@ -66,9 +61,6 @@ __NTH (wmemmove (wchar_t *__s1, const wchar_t *__s2, size_t __n))
+ 
+ 
+ #ifdef __USE_GNU
+-extern wchar_t *__wmempcpy_chk (wchar_t *__restrict __s1,
+-				const wchar_t *__restrict __s2, size_t __n,
+-				size_t __ns1) __THROW;
+ extern wchar_t *__REDIRECT_NTH (__wmempcpy_alias,
+ 				(wchar_t *__restrict __s1,
+ 				 const wchar_t *__restrict __s2,
+@@ -91,8 +83,6 @@ __NTH (wmempcpy (wchar_t *__restrict __s1, const wchar_t *__restrict __s2,
+ #endif
+ 
+ 
+-extern wchar_t *__wmemset_chk (wchar_t *__s, wchar_t __c, size_t __n,
+-			       size_t __ns) __THROW;
+ extern wchar_t *__REDIRECT_NTH (__wmemset_alias, (wchar_t *__s, wchar_t __c,
+ 						  size_t __n), wmemset);
+ extern wchar_t *__REDIRECT_NTH (__wmemset_chk_warn,
+@@ -110,9 +100,6 @@ __NTH (wmemset (wchar_t *__s, wchar_t __c, size_t __n))
+ }
+ 
+ 
+-extern wchar_t *__wcscpy_chk (wchar_t *__restrict __dest,
+-			      const wchar_t *__restrict __src,
+-			      size_t __n) __THROW;
+ extern wchar_t *__REDIRECT_NTH (__wcscpy_alias,
+ 				(wchar_t *__restrict __dest,
+ 				 const wchar_t *__restrict __src), wcscpy);
+@@ -127,9 +114,6 @@ __NTH (wcscpy (wchar_t *__restrict __dest, const wchar_t *__restrict __src))
+ }
+ 
+ 
+-extern wchar_t *__wcpcpy_chk (wchar_t *__restrict __dest,
+-			      const wchar_t *__restrict __src,
+-			      size_t __destlen) __THROW;
+ extern wchar_t *__REDIRECT_NTH (__wcpcpy_alias,
+ 				(wchar_t *__restrict __dest,
+ 				 const wchar_t *__restrict __src), wcpcpy);
+@@ -144,9 +128,6 @@ __NTH (wcpcpy (wchar_t *__restrict __dest, const wchar_t *__restrict __src))
+ }
+ 
+ 
+-extern wchar_t *__wcsncpy_chk (wchar_t *__restrict __dest,
+-			       const wchar_t *__restrict __src, size_t __n,
+-			       size_t __destlen) __THROW;
+ extern wchar_t *__REDIRECT_NTH (__wcsncpy_alias,
+ 				(wchar_t *__restrict __dest,
+ 				 const wchar_t *__restrict __src,
+@@ -168,9 +149,6 @@ __NTH (wcsncpy (wchar_t *__restrict __dest, const wchar_t *__restrict __src,
+ }
+ 
+ 
+-extern wchar_t *__wcpncpy_chk (wchar_t *__restrict __dest,
+-			       const wchar_t *__restrict __src, size_t __n,
+-			       size_t __destlen) __THROW;
+ extern wchar_t *__REDIRECT_NTH (__wcpncpy_alias,
+ 				(wchar_t *__restrict __dest,
+ 				 const wchar_t *__restrict __src,
+@@ -192,9 +170,6 @@ __NTH (wcpncpy (wchar_t *__restrict __dest, const wchar_t *__restrict __src,
+ }
+ 
+ 
+-extern wchar_t *__wcscat_chk (wchar_t *__restrict __dest,
+-			      const wchar_t *__restrict __src,
+-			      size_t __destlen) __THROW;
+ extern wchar_t *__REDIRECT_NTH (__wcscat_alias,
+ 				(wchar_t *__restrict __dest,
+ 				 const wchar_t *__restrict __src), wcscat);
+@@ -209,9 +184,6 @@ __NTH (wcscat (wchar_t *__restrict __dest, const wchar_t *__restrict __src))
+ }
+ 
+ 
+-extern wchar_t *__wcsncat_chk (wchar_t *__restrict __dest,
+-			       const wchar_t *__restrict __src,
+-			       size_t __n, size_t __destlen) __THROW;
+ extern wchar_t *__REDIRECT_NTH (__wcsncat_alias,
+ 				(wchar_t *__restrict __dest,
+ 				 const wchar_t *__restrict __src,
+@@ -228,10 +200,6 @@ __NTH (wcsncat (wchar_t *__restrict __dest, const wchar_t *__restrict __src,
+ }
+ 
+ 
+-extern int __swprintf_chk (wchar_t *__restrict __s, size_t __n,
+-			   int __flag, size_t __s_len,
+-			   const wchar_t *__restrict __format, ...)
+-     __THROW /* __attribute__ ((__format__ (__wprintf__, 5, 6))) */;
+ 
+ extern int __REDIRECT_NTH_LDBL (__swprintf_alias,
+ 				(wchar_t *__restrict __s, size_t __n,
+@@ -258,11 +226,6 @@ __NTH (swprintf (wchar_t *__restrict __s, size_t __n,
+    : swprintf (s, n, __VA_ARGS__))
+ #endif
+ 
+-extern int __vswprintf_chk (wchar_t *__restrict __s, size_t __n,
+-			    int __flag, size_t __s_len,
+-			    const wchar_t *__restrict __format,
+-			    __gnuc_va_list __arg)
+-     __THROW /* __attribute__ ((__format__ (__wprintf__, 5, 0))) */;
+ 
+ extern int __REDIRECT_NTH_LDBL (__vswprintf_alias,
+ 				(wchar_t *__restrict __s, size_t __n,
+@@ -283,16 +246,6 @@ __NTH (vswprintf (wchar_t *__restrict __s, size_t __n,
+ 
+ #if __USE_FORTIFY_LEVEL > 1
+ 
+-extern int __fwprintf_chk (__FILE *__restrict __stream, int __flag,
+-			   const wchar_t *__restrict __format, ...);
+-extern int __wprintf_chk (int __flag, const wchar_t *__restrict __format,
+-			  ...);
+-extern int __vfwprintf_chk (__FILE *__restrict __stream, int __flag,
+-			    const wchar_t *__restrict __format,
+-			    __gnuc_va_list __ap);
+-extern int __vwprintf_chk (int __flag, const wchar_t *__restrict __format,
+-			   __gnuc_va_list __ap);
+-
+ # ifdef __va_arg_pack
+ __fortify_function int
+ wprintf (const wchar_t *__restrict __fmt, ...)
+@@ -328,8 +281,6 @@ vfwprintf (__FILE *__restrict __stream,
+ 
+ #endif
+ 
+-extern wchar_t *__fgetws_chk (wchar_t *__restrict __s, size_t __size, int __n,
+-			      __FILE *__restrict __stream) __wur;
+ extern wchar_t *__REDIRECT (__fgetws_alias,
+ 			    (wchar_t *__restrict __s, int __n,
+ 			     __FILE *__restrict __stream), fgetws) __wur;
+@@ -351,9 +302,6 @@ fgetws (wchar_t *__restrict __s, int __n, __FILE *__restrict __stream)
+ }
+ 
+ #ifdef __USE_GNU
+-extern wchar_t *__fgetws_unlocked_chk (wchar_t *__restrict __s, size_t __size,
+-				       int __n, __FILE *__restrict __stream)
+-  __wur;
+ extern wchar_t *__REDIRECT (__fgetws_unlocked_alias,
+ 			    (wchar_t *__restrict __s, int __n,
+ 			     __FILE *__restrict __stream), fgetws_unlocked)
+@@ -379,9 +327,6 @@ fgetws_unlocked (wchar_t *__restrict __s, int __n, __FILE *__restrict __stream)
+ #endif
+ 
+ 
+-extern size_t __wcrtomb_chk (char *__restrict __s, wchar_t __wchar,
+-			     mbstate_t *__restrict __p,
+-			     size_t __buflen) __THROW __wur;
+ extern size_t __REDIRECT_NTH (__wcrtomb_alias,
+ 			      (char *__restrict __s, wchar_t __wchar,
+ 			       mbstate_t *__restrict __ps), wcrtomb) __wur;
+@@ -404,10 +349,6 @@ __NTH (wcrtomb (char *__restrict __s, wchar_t __wchar,
+ }
+ 
+ 
+-extern size_t __mbsrtowcs_chk (wchar_t *__restrict __dst,
+-			       const char **__restrict __src,
+-			       size_t __len, mbstate_t *__restrict __ps,
+-			       size_t __dstlen) __THROW;
+ extern size_t __REDIRECT_NTH (__mbsrtowcs_alias,
+ 			      (wchar_t *__restrict __dst,
+ 			       const char **__restrict __src,
+@@ -431,10 +372,6 @@ __NTH (mbsrtowcs (wchar_t *__restrict __dst, const char **__restrict __src,
+ }
+ 
+ 
+-extern size_t __wcsrtombs_chk (char *__restrict __dst,
+-			       const wchar_t **__restrict __src,
+-			       size_t __len, mbstate_t *__restrict __ps,
+-			       size_t __dstlen) __THROW;
+ extern size_t __REDIRECT_NTH (__wcsrtombs_alias,
+ 			      (char *__restrict __dst,
+ 			       const wchar_t **__restrict __src,
+@@ -458,10 +395,6 @@ __NTH (wcsrtombs (char *__restrict __dst, const wchar_t **__restrict __src,
+ 
+ 
+ #ifdef	__USE_XOPEN2K8
+-extern size_t __mbsnrtowcs_chk (wchar_t *__restrict __dst,
+-				const char **__restrict __src, size_t __nmc,
+-				size_t __len, mbstate_t *__restrict __ps,
+-				size_t __dstlen) __THROW;
+ extern size_t __REDIRECT_NTH (__mbsnrtowcs_alias,
+ 			      (wchar_t *__restrict __dst,
+ 			       const char **__restrict __src, size_t __nmc,
+@@ -485,11 +418,6 @@ __NTH (mbsnrtowcs (wchar_t *__restrict __dst, const char **__restrict __src,
+ }
+ 
+ 
+-extern size_t __wcsnrtombs_chk (char *__restrict __dst,
+-				const wchar_t **__restrict __src,
+-				size_t __nwc, size_t __len,
+-				mbstate_t *__restrict __ps, size_t __dstlen)
+-     __THROW;
+ extern size_t __REDIRECT_NTH (__wcsnrtombs_alias,
+ 			      (char *__restrict __dst,
+ 			       const wchar_t **__restrict __src,
+diff --git a/wcsmbs/wchar.h b/wcsmbs/wchar.h
+index 5d6a40853d..c1321c7518 100644
+--- a/wcsmbs/wchar.h
++++ b/wcsmbs/wchar.h
+@@ -864,14 +864,21 @@ extern size_t wcsftime_l (wchar_t *__restrict __s, size_t __maxsize,
+ 
+ /* Define some macros helping to catch buffer overflows.  */
+ #if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function
+-# include <bits/wchar2.h>
++/* Declare all functions from bits/wchar2-decl.h first.  */
++# include <bits/wchar2-decl.h>
+ #endif
+ 
+-#include <bits/floatn.h>
++/* The following headers provide asm redirections.  These redirections must
++   appear before the first usage of these functions, e.g. in bits/wchar.h.  */
+ #if defined __LDBL_COMPAT || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1
+ # include <bits/wchar-ldbl.h>
+ #endif
+ 
++#if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function
++/* Now include the function definitions and redirects too.  */
++# include <bits/wchar2.h>
++#endif
++
+ __END_DECLS
+ 
+ #endif /* wchar.h  */
+-- 
+2.38.1
+
+
+From b3736d1a3c60a3ec9959bf3b38794958546bf6a2 Mon Sep 17 00:00:00 2001
+From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Tue, 30 Aug 2022 13:35:52 -0300
+Subject: elf: Restore how vDSO dependency is printed with
+ LD_TRACE_LOADED_OBJECTS (BZ #29539)
+
+The d7703d3176d225d5743b21811d888619eba39e82 changed how vDSO like
+dependencies are printed, instead of just the name and address it
+follows other libraries mode and prints 'name => path'.
+
+Unfortunately, this broke some ldd consumer that uses the output to
+filter out the program's dependencies.  For instance CMake
+bundleutilities module [1], where GetPrequirite uses the regex to filter
+out 'name => path' [2].
+
+This patch restore the previous way to print just the name and the
+mapping address.
+
+Checked on x86_64-linux-gnu.
+
+[1] https://github.com/Kitware/CMake/tree/master/Tests/BundleUtilities
+[2] https://github.com/Kitware/CMake/blob/master/Modules/GetPrerequisites.cmake#L733
+
+Reviewed-by: Florian Weimer <fweimer@redhat.com>
+(cherry picked from commit 1e903124cec4492463d075c6c061a2a772db77bf)
+---
+ NEWS       | 2 +-
+ elf/rtld.c | 6 ++++++
+ 2 files changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/NEWS b/NEWS
+index 6d31e5abba..757ded85e0 100644
+--- a/NEWS
++++ b/NEWS
+@@ -14,7 +14,7 @@ The following bugs are resolved with this release:
+   [29485] Linux: Terminate subprocess on late failure in tst-pidfd
+   [29490] alpha: New __brk_call implementation is broken
+   [29528] elf: Call __libc_early_init for reused namespaces
+-
++  [29539] libc: LD_TRACE_LOADED_OBJECTS changed how vDSO library are
+ \f
+ Version 2.36
+ 
+diff --git a/elf/rtld.c b/elf/rtld.c
+index cbbaf4a331..3e771a93d8 100644
+--- a/elf/rtld.c
++++ b/elf/rtld.c
+@@ -2122,6 +2122,12 @@ dl_main (const ElfW(Phdr) *phdr,
+ 	    if (l->l_faked)
+ 	      /* The library was not found.  */
+ 	      _dl_printf ("\t%s => not found\n",  l->l_libname->name);
++	    else if (strcmp (l->l_libname->name, l->l_name) == 0)
++	      /* Print vDSO like libraries without duplicate name.  Some
++		 consumers depend of this format.  */
++	      _dl_printf ("\t%s (0x%0*Zx)\n", l->l_libname->name,
++			  (int) sizeof l->l_map_start * 2,
++			  (size_t) l->l_map_start);
+ 	    else
+ 	      _dl_printf ("\t%s => %s (0x%0*Zx)\n",
+ 			  DSO_FILENAME (l->l_libname->name),
+-- 
+2.38.1
+
+
+From 645d94808aaa90fb1b20a25ff70bb50d9eb1d55b Mon Sep 17 00:00:00 2001
+From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Mon, 5 Sep 2022 09:34:39 -0300
+Subject: syslog: Remove extra whitespace between timestamp and message
+ (BZ#29544)
+
+The rfc3164 clear states that a single space character must follow
+the timestamp field.
+
+Checked on x86_64-linux-gnu.
+---
+ misc/syslog.c     | 2 +-
+ misc/tst-syslog.c | 9 ++++++---
+ 2 files changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/misc/syslog.c b/misc/syslog.c
+index b88f66c835..f67d4b58a4 100644
+--- a/misc/syslog.c
++++ b/misc/syslog.c
+@@ -167,7 +167,7 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
+ 		  _nl_C_locobj_ptr);
+ 
+ #define SYSLOG_HEADER(__pri, __timestamp, __msgoff, pid) \
+-  "<%d>%s %n%s%s%.0d%s: ",                               \
++  "<%d>%s%n%s%s%.0d%s: ",                                \
+   __pri, __timestamp, __msgoff,                          \
+   LogTag == NULL ? __progname : LogTag,                  \
+   "[" + (pid == 0), pid, "]" + (pid == 0)
+diff --git a/misc/tst-syslog.c b/misc/tst-syslog.c
+index 1d332ece53..3560b518a2 100644
+--- a/misc/tst-syslog.c
++++ b/misc/tst-syslog.c
+@@ -275,16 +275,19 @@ parse_syslog_msg (const char *msg)
+ {
+   struct msg_t r = { .pid = -1 };
+   int number;
++  int wsb, wsa;
+ 
+ #define STRINPUT(size)  XSTRINPUT(size)
+ #define XSTRINPUT(size) "%" # size "s"
+ 
+   /* The message in the form:
+-     <179>Apr  8 14:51:19  tst-syslog: message 176 3  */
+-  int n = sscanf (msg, "<%3d>%*s %*d %*d:%*d:%*d " STRINPUT(IDENT_LENGTH)
++     <179>Apr  8 14:51:19 tst-syslog: message 176 3  */
++  int n = sscanf (msg, "<%3d>%*s %*d %*d:%*d:%*d%n %n" STRINPUT(IDENT_LENGTH)
+ 		       " " STRINPUT(MSG_LENGTH) " %*d %*d",
+-                  &number, r.ident, r.msg);
++                  &number, &wsb, &wsa, r.ident, r.msg);
+   TEST_COMPARE (n, 3);
++  /* It should only one space between timestamp and message.  */
++  TEST_COMPARE (wsa - wsb, 1);
+ 
+   r.facility = number & LOG_FACMASK;
+   r.priority = number & LOG_PRIMASK;
+-- 
+2.38.1
+
+
+From b46412fb17e8bfc6c9e1f144bbcf833320c80f8a Mon Sep 17 00:00:00 2001
+From: Siddhesh Poyarekar <siddhesh@sourceware.org>
+Date: Tue, 6 Sep 2022 09:31:50 -0400
+Subject: Add NEWS entry for CVE-2022-39046
+
+(cherry picked from commit 76fe56020e7ef354685b2284580ac1630c078a2b)
+---
+ NEWS | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/NEWS b/NEWS
+index 757ded85e0..10a7613f09 100644
+--- a/NEWS
++++ b/NEWS
+@@ -7,6 +7,13 @@ using `glibc' in the "product" field.
+ \f
+ Version 2.36.1
+ 
++Security related changes:
++
++  CVE-2022-39046: When the syslog function is passed a crafted input
++  string larger than 1024 bytes, it reads uninitialized memory from the
++  heap and prints it to the target log file, potentially revealing a
++  portion of the contents of the heap.
++
+ The following bugs are resolved with this release:
+ 
+   [28846] CMSG_NXTHDR may trigger -Wstrict-overflow warning
+-- 
+2.38.1
+
+
+From c399271c10bd00714504e8d4dfbec8aebf996dd4 Mon Sep 17 00:00:00 2001
+From: Fabian Vogt <fvogt@suse.de>
+Date: Wed, 27 Jul 2022 11:44:07 +0200
+Subject: nscd: Fix netlink cache invalidation if epoll is used [BZ #29415]
+
+Processes cache network interface information such as whether IPv4 or IPv6
+are enabled. This is only checked again if the "netlink timestamp" provided
+by nscd changed, which is triggered by netlink socket activity.
+
+However, in the epoll handler for the netlink socket, it was missed to
+assign the new timestamp to the nscd database. The handler for plain poll
+did that properly, copy that over.
+
+This bug caused that e.g. processes which started before network
+configuration got unusuable addresses from getaddrinfo, like IPv6 only even
+though only IPv4 is available:
+https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1041
+
+It's a bit hard to reproduce, so I verified this by checking the timestamp
+on calls to __check_pf manually. Without this patch it's stuck at 1, now
+it's increasing on network changes as expected.
+
+Signed-off-by: Fabian Vogt <fvogt@suse.de>
+(cherry picked from commit 02ca25fef2785974011e9c5beecc99b900b69fd7)
+---
+ NEWS               | 1 +
+ nscd/connections.c | 3 ++-
+ 2 files changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/NEWS b/NEWS
+index 10a7613f09..9360596fcc 100644
+--- a/NEWS
++++ b/NEWS
+@@ -17,6 +17,7 @@ Security related changes:
+ The following bugs are resolved with this release:
+ 
+   [28846] CMSG_NXTHDR may trigger -Wstrict-overflow warning
++  [29415] nscd: Fix netlink cache invalidation if epoll is used
+   [29446] _dlopen now ignores dl_caller argument in static mode
+   [29485] Linux: Terminate subprocess on late failure in tst-pidfd
+   [29490] alpha: New __brk_call implementation is broken
+diff --git a/nscd/connections.c b/nscd/connections.c
+index 61d1674eb4..531d2e83df 100644
+--- a/nscd/connections.c
++++ b/nscd/connections.c
+@@ -2284,7 +2284,8 @@ main_loop_epoll (int efd)
+ 					     sizeof (buf))) != -1)
+ 	      ;
+ 
+-	    __bump_nl_timestamp ();
++	    dbs[hstdb].head->extra_data[NSCD_HST_IDX_CONF_TIMESTAMP]
++	      = __bump_nl_timestamp ();
+ 	  }
+ # endif
+ 	else
+-- 
+2.38.1
+
+
+From 9d7eebde8f134ea25bdb9ab61bc74d5e71e41288 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 30 Aug 2022 10:02:49 +0200
+Subject: resolv: Add tst-resolv-byaddr for testing reverse lookup
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit 0b99828d54e5d1fc8f5ad3edf5ba262ad2e9c5b0)
+---
+ resolv/Makefile                      |   2 +
+ resolv/tst-resolv-byaddr.c           | 326 +++++++++++++++++++++++++++
+ resolv/tst-resolv-maybe_insert_sig.h |  32 +++
+ 3 files changed, 360 insertions(+)
+ create mode 100644 resolv/tst-resolv-byaddr.c
+ create mode 100644 resolv/tst-resolv-maybe_insert_sig.h
+
+diff --git a/resolv/Makefile b/resolv/Makefile
+index 5b15321f9b..98b10d97a0 100644
+--- a/resolv/Makefile
++++ b/resolv/Makefile
+@@ -91,6 +91,7 @@ tests += \
+   tst-res_hnok \
+   tst-resolv-basic \
+   tst-resolv-binary \
++  tst-resolv-byaddr \
+   tst-resolv-edns \
+   tst-resolv-network \
+   tst-resolv-noaaaa \
+@@ -260,6 +261,7 @@ $(objpfx)tst-resolv-ai_idn-nolibidn2.out: \
+   $(gen-locales) $(objpfx)tst-no-libidn2.so
+ $(objpfx)tst-resolv-basic: $(objpfx)libresolv.so $(shared-thread-library)
+ $(objpfx)tst-resolv-binary: $(objpfx)libresolv.so $(shared-thread-library)
++$(objpfx)tst-resolv-byaddr: $(objpfx)libresolv.so $(shared-thread-library)
+ $(objpfx)tst-resolv-edns: $(objpfx)libresolv.so $(shared-thread-library)
+ $(objpfx)tst-resolv-network: $(objpfx)libresolv.so $(shared-thread-library)
+ $(objpfx)tst-resolv-res_init: $(objpfx)libresolv.so
+diff --git a/resolv/tst-resolv-byaddr.c b/resolv/tst-resolv-byaddr.c
+new file mode 100644
+index 0000000000..6299e89837
+--- /dev/null
++++ b/resolv/tst-resolv-byaddr.c
+@@ -0,0 +1,326 @@
++/* Test reverse DNS lookup.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <arpa/inet.h>
++#include <errno.h>
++#include <netdb.h>
++#include <stdbool.h>
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
++#include <support/check.h>
++#include <support/check_nss.h>
++#include <support/next_to_fault.h>
++#include <support/resolv_test.h>
++#include <support/support.h>
++
++#include "tst-resolv-maybe_insert_sig.h"
++
++/* QNAME format:
++
++   ADDRESSES.CNAMES...(lots of 0s)...8.b.d.0.1.0.0.2.ip6.arpa.
++   CNAMES|ADDRESSES.2.0.192.in-addr-arpa.
++
++   For the IPv4 reverse lookup, the address count is in the lower
++   bits.
++
++   CNAMES is the length of the CNAME chain, ADDRESSES is the number of
++   addresses in the response.  The special value 15 means that there
++   are no addresses, and the RCODE is NXDOMAIN.  */
++static void
++response (const struct resolv_response_context *ctx,
++          struct resolv_response_builder *b,
++          const char *qname, uint16_t qclass, uint16_t qtype)
++{
++  TEST_COMPARE (qclass, C_IN);
++  TEST_COMPARE (qtype, T_PTR);
++
++  unsigned int addresses, cnames, bits;
++  char *tail;
++  if (strstr (qname, "ip6.arpa") != NULL
++      && sscanf (qname, "%x.%x.%ms", &addresses, &cnames, &tail) == 3)
++    TEST_COMPARE_STRING (tail, "\
++0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa");
++  else if (sscanf (qname, "%u.%ms", &bits, &tail) == 2)
++    {
++      TEST_COMPARE_STRING (tail, "2.0.192.in-addr.arpa");
++      addresses = bits & 0x0f;
++      cnames = bits >> 4;
++    }
++  else
++    FAIL_EXIT1 ("invalid QNAME: %s", qname);
++  free (tail);
++
++  int rcode;
++  if (addresses == 15)
++    {
++      /* Special case: Use no addresses with NXDOMAIN response.  */
++      rcode = ns_r_nxdomain;
++      addresses = 0;
++    }
++  else
++    rcode = 0;
++
++  struct resolv_response_flags flags = { .rcode = rcode };
++  resolv_response_init (b, flags);
++  resolv_response_add_question (b, qname, qclass, qtype);
++  resolv_response_section (b, ns_s_an);
++  maybe_insert_sig (b, qname);
++
++  /* Provide the requested number of CNAME records.  */
++  char *previous_name = (char *) qname;
++  for (int unique = 0; unique < cnames; ++unique)
++    {
++      resolv_response_open_record (b, previous_name, qclass, T_CNAME, 60);
++      char *new_name = xasprintf ("%d.alias.example", unique);
++      resolv_response_add_name (b, new_name);
++      resolv_response_close_record (b);
++
++      maybe_insert_sig (b, qname);
++
++      if (previous_name != qname)
++        free (previous_name);
++      previous_name = new_name;
++    }
++
++  for (int unique = 0; unique < addresses; ++unique)
++    {
++      resolv_response_open_record (b, previous_name, qclass, T_PTR, 60);
++      char *ptr = xasprintf ("unique-%d.cnames-%u.addresses-%u.example",
++                             unique, cnames, addresses);
++      resolv_response_add_name (b, ptr);
++      free (ptr);
++      resolv_response_close_record (b);
++    }
++
++  if (previous_name != qname)
++    free (previous_name);
++}
++
++/* Used to check that gethostbyaddr_r does not write past the buffer
++   end.  */
++static struct support_next_to_fault ntf;
++
++/* Perform a gethostbyaddr call and check the result.  */
++static void
++check_gethostbyaddr (const char *address, const char *expected)
++{
++  unsigned char bytes[16];
++  unsigned int byteslen;
++  int family;
++  if (strchr (address, ':') != NULL)
++    {
++      family = AF_INET6;
++      byteslen = 16;
++    }
++  else
++    {
++      family = AF_INET;
++      byteslen = 4;
++    }
++  TEST_COMPARE (inet_pton (family, address, bytes), 1);
++
++  struct hostent *e = gethostbyaddr (bytes, byteslen, family);
++  check_hostent (address, e, expected);
++
++  if (e == NULL)
++    return;
++
++  /* Try gethostbyaddr_r with increasing sizes until success.  First
++     compute a reasonable minimum buffer size, to avoid many pointless
++     attempts.  */
++  size_t minimum_size = strlen (e->h_name);
++  for (int i = 0; e->h_addr_list[i] != NULL; ++i)
++    minimum_size += e->h_length + sizeof (char *);
++  for (int i = 0; e->h_aliases[i] != NULL; ++i)
++    minimum_size += strlen (e->h_aliases[i]) + 1 + sizeof (char *);
++
++  /* Gradually increase the size until success.  */
++  for (size_t size = minimum_size; size < ntf.length; ++size)
++    {
++      struct hostent result;
++      int herrno;
++      int ret = gethostbyaddr_r (bytes, byteslen, family, &result,
++                                 ntf.buffer + ntf.length - size, size,
++                                 &e, &herrno);
++      if (ret == ERANGE)
++        /* Retry with larger size.  */
++        TEST_COMPARE (herrno, NETDB_INTERNAL);
++      else if (ret == 0)
++        {
++         TEST_VERIFY (size > minimum_size);
++         check_hostent (address, e, expected);
++         return;
++        }
++      else
++        FAIL_EXIT1 ("Unexpected gethostbyaddr_r failure: %d", ret);
++    }
++
++  FAIL_EXIT1 ("gethostbyaddr_r always failed for: %s", address);
++}
++
++/* Perform a getnameinfo call and check the result.  */
++static void
++check_getnameinfo (const char *address, const char *expected)
++{
++  struct sockaddr_in sin = { };
++  struct sockaddr_in6 sin6 = { };
++  void *sa;
++  socklen_t salen;
++  if (strchr (address, ':') != NULL)
++    {
++      sin6.sin6_family = AF_INET6;
++      TEST_COMPARE (inet_pton (AF_INET6, address, &sin6.sin6_addr), 1);
++      sin6.sin6_port = htons (80);
++      sa = &sin6;
++      salen = sizeof (sin6);
++    }
++  else
++    {
++      sin.sin_family = AF_INET;
++      TEST_COMPARE (inet_pton (AF_INET, address, &sin.sin_addr), 1);
++      sin.sin_port = htons (80);
++      sa = &sin;
++      salen = sizeof (sin);
++    }
++
++  char host[64];
++  char service[64];
++  int ret = getnameinfo (sa, salen, host,
++                         sizeof (host), service, sizeof (service),
++                         NI_NAMEREQD | NI_NUMERICSERV);
++  switch (ret)
++    {
++    case 0:
++      TEST_COMPARE_STRING (host, expected);
++      TEST_COMPARE_STRING (service, "80");
++      break;
++    case EAI_SYSTEM:
++      TEST_COMPARE_STRING (strerror (errno), expected);
++      break;
++    default:
++      TEST_COMPARE_STRING (gai_strerror (ret), expected);
++    }
++}
++
++static int
++do_test (void)
++{
++  /* Some reasonably upper bound for the maximum response size.  */
++  ntf = support_next_to_fault_allocate (4096);
++
++  struct resolv_test *obj = resolv_test_start
++    ((struct resolv_redirect_config)
++     {
++       .response_callback = response
++     });
++
++  for (int do_insert_sig = 0; do_insert_sig < 2; ++do_insert_sig)
++    {
++      insert_sig = do_insert_sig;
++
++      /* No PTR record, RCODE=0.  */
++      check_gethostbyaddr ("192.0.2.0", "error: NO_RECOVERY\n");
++      check_getnameinfo ("192.0.2.0", "Name or service not known");
++      check_gethostbyaddr ("192.0.2.16", "error: NO_RECOVERY\n");
++      check_getnameinfo ("192.0.2.16", "Name or service not known");
++      check_gethostbyaddr ("192.0.2.32", "error: NO_RECOVERY\n");
++      check_getnameinfo ("192.0.2.32", "Name or service not known");
++      check_gethostbyaddr ("2001:db8::", "error: NO_RECOVERY\n");
++      check_getnameinfo ("2001:db8::", "Name or service not known");
++      check_gethostbyaddr ("2001:db8::10", "error: NO_RECOVERY\n");
++      check_getnameinfo ("2001:db8::10", "Name or service not known");
++      check_gethostbyaddr ("2001:db8::20", "error: NO_RECOVERY\n");
++      check_getnameinfo ("2001:db8::20", "Name or service not known");
++
++      /* No PTR record, NXDOMAIN.  */
++      check_gethostbyaddr ("192.0.2.15", "error: HOST_NOT_FOUND\n");
++      check_getnameinfo ("192.0.2.15", "Name or service not known");
++      check_gethostbyaddr ("192.0.2.31", "error: HOST_NOT_FOUND\n");
++      check_getnameinfo ("192.0.2.31", "Name or service not known");
++      check_gethostbyaddr ("192.0.2.47", "error: HOST_NOT_FOUND\n");
++      check_getnameinfo ("192.0.2.47", "Name or service not known");
++      check_gethostbyaddr ("2001:db8::f", "error: HOST_NOT_FOUND\n");
++      check_getnameinfo ("2001:db8::f", "Name or service not known");
++      check_gethostbyaddr ("2001:db8::1f", "error: HOST_NOT_FOUND\n");
++      check_getnameinfo ("2001:db8::1f", "Name or service not known");
++      check_gethostbyaddr ("2001:db8::2f", "error: HOST_NOT_FOUND\n");
++      check_getnameinfo ("2001:db8::2f", "Name or service not known");
++
++      /* Actual response data.  Only the first PTR record is returned.  */
++      check_gethostbyaddr ("192.0.2.1",
++                           "name: unique-0.cnames-0.addresses-1.example\n"
++                           "address: 192.0.2.1\n");
++      check_getnameinfo ("192.0.2.1",
++                         "unique-0.cnames-0.addresses-1.example");
++      check_gethostbyaddr ("192.0.2.17",
++                           "name: unique-0.cnames-1.addresses-1.example\n"
++                           "address: 192.0.2.17\n");
++      check_getnameinfo ("192.0.2.17",
++                         "unique-0.cnames-1.addresses-1.example");
++      check_gethostbyaddr ("192.0.2.18",
++                           "name: unique-0.cnames-1.addresses-2.example\n"
++                           "address: 192.0.2.18\n");
++      check_getnameinfo ("192.0.2.18",
++                         "unique-0.cnames-1.addresses-2.example");
++      check_gethostbyaddr ("192.0.2.33",
++                           "name: unique-0.cnames-2.addresses-1.example\n"
++                           "address: 192.0.2.33\n");
++      check_getnameinfo ("192.0.2.33",
++                         "unique-0.cnames-2.addresses-1.example");
++      check_gethostbyaddr ("192.0.2.34",
++                           "name: unique-0.cnames-2.addresses-2.example\n"
++                           "address: 192.0.2.34\n");
++      check_getnameinfo ("192.0.2.34",
++                         "unique-0.cnames-2.addresses-2.example");
++
++      /* Same for IPv6 addresses.  */
++      check_gethostbyaddr ("2001:db8::1",
++                           "name: unique-0.cnames-0.addresses-1.example\n"
++                           "address: 2001:db8::1\n");
++      check_getnameinfo ("2001:db8::1",
++                         "unique-0.cnames-0.addresses-1.example");
++      check_gethostbyaddr ("2001:db8::11",
++                           "name: unique-0.cnames-1.addresses-1.example\n"
++                           "address: 2001:db8::11\n");
++      check_getnameinfo ("2001:db8::11",
++                         "unique-0.cnames-1.addresses-1.example");
++      check_gethostbyaddr ("2001:db8::12",
++                           "name: unique-0.cnames-1.addresses-2.example\n"
++                           "address: 2001:db8::12\n");
++      check_getnameinfo ("2001:db8::12",
++                         "unique-0.cnames-1.addresses-2.example");
++      check_gethostbyaddr ("2001:db8::21",
++                           "name: unique-0.cnames-2.addresses-1.example\n"
++                           "address: 2001:db8::21\n");
++      check_getnameinfo ("2001:db8::21",
++                         "unique-0.cnames-2.addresses-1.example");
++      check_gethostbyaddr ("2001:db8::22",
++                           "name: unique-0.cnames-2.addresses-2.example\n"
++                           "address: 2001:db8::22\n");
++      check_getnameinfo ("2001:db8::22",
++                         "unique-0.cnames-2.addresses-2.example");
++    }
++
++  resolv_test_end (obj);
++
++  support_next_to_fault_free (&ntf);
++  return 0;
++}
++
++#include <support/test-driver.c>
+diff --git a/resolv/tst-resolv-maybe_insert_sig.h b/resolv/tst-resolv-maybe_insert_sig.h
+new file mode 100644
+index 0000000000..05725225af
+--- /dev/null
++++ b/resolv/tst-resolv-maybe_insert_sig.h
+@@ -0,0 +1,32 @@
++/* Code snippet for optionally inserting ignored SIG records in resolver tests.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++/* Set to true for an alternative pass that inserts (ignored) SIG
++   records.  This does not alter the response, so this property is not
++   encoded in the QNAME.  The variable needs to be volatile because
++   leaf attributes tell GCC that the response function is not
++   called.  */
++static volatile bool insert_sig;
++
++static void
++maybe_insert_sig (struct resolv_response_builder *b, const char *owner)
++{
++  resolv_response_open_record (b, owner, C_IN, T_SIG, 60);
++  resolv_response_add_data (b, "", 1);
++  resolv_response_close_record (b);
++}
+-- 
+2.38.1
+
+
+From bffc33e90ed57a4786c676dda92d935e3613e031 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 30 Aug 2022 10:02:49 +0200
+Subject: resolv: Add tst-resolv-aliases
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit 87aa98aa80627553a66bdcad2701fd6307723645)
+---
+ resolv/Makefile             |   2 +
+ resolv/tst-resolv-aliases.c | 254 ++++++++++++++++++++++++++++++++++++
+ 2 files changed, 256 insertions(+)
+ create mode 100644 resolv/tst-resolv-aliases.c
+
+diff --git a/resolv/Makefile b/resolv/Makefile
+index 98b10d97a0..0038bb7028 100644
+--- a/resolv/Makefile
++++ b/resolv/Makefile
+@@ -89,6 +89,7 @@ tests += \
+   tst-ns_name_pton \
+   tst-res_hconf_reorder \
+   tst-res_hnok \
++  tst-resolv-aliases \
+   tst-resolv-basic \
+   tst-resolv-binary \
+   tst-resolv-byaddr \
+@@ -259,6 +260,7 @@ $(objpfx)tst-resolv-ai_idn.out: $(gen-locales)
+ $(objpfx)tst-resolv-ai_idn-latin1.out: $(gen-locales)
+ $(objpfx)tst-resolv-ai_idn-nolibidn2.out: \
+   $(gen-locales) $(objpfx)tst-no-libidn2.so
++$(objpfx)tst-resolv-aliases: $(objpfx)libresolv.so $(shared-thread-library)
+ $(objpfx)tst-resolv-basic: $(objpfx)libresolv.so $(shared-thread-library)
+ $(objpfx)tst-resolv-binary: $(objpfx)libresolv.so $(shared-thread-library)
+ $(objpfx)tst-resolv-byaddr: $(objpfx)libresolv.so $(shared-thread-library)
+diff --git a/resolv/tst-resolv-aliases.c b/resolv/tst-resolv-aliases.c
+new file mode 100644
+index 0000000000..b212823aa0
+--- /dev/null
++++ b/resolv/tst-resolv-aliases.c
+@@ -0,0 +1,254 @@
++/* Test alias handling (mainly for gethostbyname).
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <array_length.h>
++#include <arpa/inet.h>
++#include <netdb.h>
++#include <stdbool.h>
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
++#include <support/check.h>
++#include <support/check_nss.h>
++#include <support/resolv_test.h>
++#include <support/support.h>
++
++#include "tst-resolv-maybe_insert_sig.h"
++
++/* QNAME format:
++
++   aADDRESSES-cCNAMES.example.net
++
++   CNAMES is the length of the CNAME chain, ADDRESSES is the number of
++   addresses in the response.  The special value 255 means that there
++   are no addresses, and the RCODE is NXDOMAIN.  */
++static void
++response (const struct resolv_response_context *ctx,
++          struct resolv_response_builder *b,
++          const char *qname, uint16_t qclass, uint16_t qtype)
++{
++  TEST_COMPARE (qclass, C_IN);
++  if (qtype != T_A)
++    TEST_COMPARE (qtype, T_AAAA);
++
++  unsigned int addresses, cnames;
++  char *tail;
++  if (sscanf (qname, "a%u-c%u%ms", &addresses, &cnames, &tail) == 3)
++    {
++      if (strcmp (tail, ".example.com") == 0
++          || strcmp (tail, ".example.net.example.net") == 0
++          || strcmp (tail, ".example.net.example.com") == 0)
++        /* These only happen after NXDOMAIN.  */
++        TEST_VERIFY (addresses == 255);
++      else if (strcmp (tail, ".example.net") != 0)
++        FAIL_EXIT1 ("invalid QNAME: %s", qname);
++    }
++  free (tail);
++
++  int rcode;
++  if (addresses == 255)
++    {
++      /* Special case: Use no addresses with NXDOMAIN response.  */
++      rcode = ns_r_nxdomain;
++      addresses = 0;
++    }
++  else
++    rcode = 0;
++
++  struct resolv_response_flags flags = { .rcode = rcode };
++  resolv_response_init (b, flags);
++  resolv_response_add_question (b, qname, qclass, qtype);
++  resolv_response_section (b, ns_s_an);
++  maybe_insert_sig (b, qname);
++
++  /* Provide the requested number of CNAME records.  */
++  char *previous_name = (char *) qname;
++  for (int unique = 0; unique < cnames; ++unique)
++    {
++      resolv_response_open_record (b, previous_name, qclass, T_CNAME, 60);
++      char *new_name = xasprintf ("%d.alias.example", unique);
++      resolv_response_add_name (b, new_name);
++      resolv_response_close_record (b);
++
++      maybe_insert_sig (b, qname);
++
++      if (previous_name != qname)
++        free (previous_name);
++      previous_name = new_name;
++    }
++
++  for (int unique = 0; unique < addresses; ++unique)
++    {
++      resolv_response_open_record (b, previous_name, qclass, qtype, 60);
++
++      if (qtype == T_A)
++        {
++          char ipv4[4] = {192, 0, 2, 1 + unique};
++          resolv_response_add_data (b, &ipv4, sizeof (ipv4));
++        }
++      else if (qtype == T_AAAA)
++        {
++          char ipv6[16] =
++            {
++              0x20, 0x01, 0xd, 0xb8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
++              1 + unique
++            };
++          resolv_response_add_data (b, &ipv6, sizeof (ipv6));
++        }
++      resolv_response_close_record (b);
++    }
++
++  if (previous_name != qname)
++    free (previous_name);
++}
++
++static char *
++make_qname (bool do_search, int cnames, int addresses)
++{
++  return xasprintf ("a%d-c%d%s",
++                    addresses, cnames, do_search ? "" : ".example.net");
++}
++
++static void
++check_cnames_failure (int af, bool do_search, int cnames, int addresses)
++{
++  char *qname = make_qname (do_search, cnames, addresses);
++
++  struct hostent *e;
++  if (af == AF_UNSPEC)
++    e = gethostbyname (qname);
++  else
++    e = gethostbyname2 (qname, af);
++
++  if (addresses == 0)
++    check_hostent (qname, e, "error: NO_RECOVERY\n");
++  else
++    check_hostent (qname, e, "error: HOST_NOT_FOUND\n");
++
++  free (qname);
++}
++
++static void
++check (int af, bool do_search, int cnames, int addresses)
++{
++  char *qname = make_qname (do_search, cnames, addresses);
++  char *fqdn = make_qname (false, cnames, addresses);
++
++  struct hostent *e;
++  if (af == AF_UNSPEC)
++    e = gethostbyname (qname);
++  else
++    e = gethostbyname2 (qname, af);
++  if (e == NULL)
++    FAIL_EXIT1 ("unexpected failure for %d, %d, %d", af, cnames, addresses);
++
++  if (af == AF_UNSPEC || af == AF_INET)
++    {
++      TEST_COMPARE (e->h_addrtype, AF_INET);
++      TEST_COMPARE (e->h_length, 4);
++    }
++  else
++    {
++      TEST_COMPARE (e->h_addrtype, AF_INET6);
++      TEST_COMPARE (e->h_length, 16);
++    }
++
++  for (int i = 0; i < addresses; ++i)
++    {
++      char ipv4[4] = {192, 0, 2, 1 + i};
++      char ipv6[16] =
++        { 0x20, 0x01, 0xd, 0xb8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 + i };
++      char *expected = e->h_addrtype == AF_INET ? ipv4 : ipv6;
++      TEST_COMPARE_BLOB (e->h_addr_list[i], e->h_length,
++                         expected, e->h_length);
++    }
++  TEST_VERIFY (e->h_addr_list[addresses] == NULL);
++
++
++  if (cnames == 0)
++    {
++      /* QNAME is fully qualified.  */
++      TEST_COMPARE_STRING (e->h_name, fqdn);
++      TEST_VERIFY (e->h_aliases[0] == NULL);
++    }
++  else
++   {
++     /* Fully-qualified QNAME is demoted to an aliases.  */
++     TEST_COMPARE_STRING (e->h_aliases[0], fqdn);
++
++     for (int i = 1; i <= cnames; ++i)
++       {
++         char *expected = xasprintf ("%d.alias.example", i - 1);
++         if (i == cnames)
++           TEST_COMPARE_STRING (e->h_name, expected);
++         else
++           TEST_COMPARE_STRING (e->h_aliases[i], expected);
++         free (expected);
++       }
++     TEST_VERIFY (e->h_aliases[cnames] == NULL);
++   }
++
++  free (fqdn);
++  free (qname);
++}
++
++static int
++do_test (void)
++{
++  struct resolv_test *obj = resolv_test_start
++    ((struct resolv_redirect_config)
++     {
++       .response_callback = response,
++       .search = { "example.net", "example.com" },
++     });
++
++  static const int families[] = { AF_UNSPEC, AF_INET, AF_INET6 };
++
++  for (int do_insert_sig = 0; do_insert_sig < 2; ++do_insert_sig)
++    {
++      insert_sig = do_insert_sig;
++
++      /* If do_search is true, a bare host name (for example, a1-c1)
++         is used.  This exercises search path processing and FQDN
++         qualification.  */
++      for (int do_search = 0; do_search < 2; ++do_search)
++        for (const int *paf = families; paf != array_end (families); ++paf)
++          {
++            for (int cnames = 0; cnames <= 100; ++cnames)
++              {
++                check_cnames_failure (*paf, do_search, cnames, 0);
++                /* Now with NXDOMAIN responses.  */
++                check_cnames_failure (*paf, do_search, cnames, 255);
++              }
++
++            for (int cnames = 0; cnames <= 10; ++cnames)
++              for (int addresses = 1; addresses <= 10; ++addresses)
++                check (*paf, do_search, cnames, addresses);
++
++            /* The current implementation is limited to 47 aliases.
++               Addresses do not have such a limit.  */
++            check (*paf, do_search, 47, 60);
++          }
++    }
++
++  resolv_test_end (obj);
++
++  return 0;
++}
++
++#include <support/test-driver.c>
+-- 
+2.38.1
+
+
+From 3c9b4004e2dccc9ca2ace078a0106f9d682fd1a0 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 30 Aug 2022 10:02:49 +0200
+Subject: resolv: Add internal __res_binary_hnok function
+
+During package parsing, only the binary representation is available,
+and it is convenient to check that directly for conformance with host
+name requirements.
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit c79327bf00a4be6d60259227acc78ef80ead3622)
+---
+ include/resolv.h           |  3 +++
+ resolv/res-name-checking.c | 14 +++++++++-----
+ 2 files changed, 12 insertions(+), 5 deletions(-)
+
+diff --git a/include/resolv.h b/include/resolv.h
+index 3590b6f496..4dbbac3800 100644
+--- a/include/resolv.h
++++ b/include/resolv.h
+@@ -70,5 +70,8 @@ libc_hidden_proto (__libc_res_nameinquery)
+ extern __typeof (__res_queriesmatch) __libc_res_queriesmatch;
+ libc_hidden_proto (__libc_res_queriesmatch)
+ 
++/* Variant of res_hnok which operates on binary (but uncompressed) names.  */
++bool __res_binary_hnok (const unsigned char *dn) attribute_hidden;
++
+ # endif /* _RESOLV_H_ && !_ISOMAC */
+ #endif
+diff --git a/resolv/res-name-checking.c b/resolv/res-name-checking.c
+index 07a412d8ff..213edceaf3 100644
+--- a/resolv/res-name-checking.c
++++ b/resolv/res-name-checking.c
+@@ -138,6 +138,12 @@ binary_leading_dash (const unsigned char *dn)
+   return dn[0] > 0 && dn[1] == '-';
+ }
+ 
++bool
++__res_binary_hnok (const unsigned char *dn)
++{
++  return !binary_leading_dash (dn) && binary_hnok (dn);
++}
++
+ /* Return 1 if res_hnok is a valid host name.  Labels must only
+    contain [0-9a-zA-Z_-] characters, and the name must not start with
+    a '-'.  The latter is to avoid confusion with program options.  */
+@@ -145,11 +151,9 @@ int
+ ___res_hnok (const char *dn)
+ {
+   unsigned char buf[NS_MAXCDNAME];
+-  if (!printable_string (dn)
+-      || __ns_name_pton (dn, buf, sizeof (buf)) < 0
+-      || binary_leading_dash (buf))
+-    return 0;
+-  return binary_hnok (buf);
++  return (printable_string (dn)
++	  && __ns_name_pton (dn, buf, sizeof (buf)) >= 0
++	  && __res_binary_hnok (buf));
+ }
+ versioned_symbol (libc, ___res_hnok, res_hnok, GLIBC_2_34);
+ versioned_symbol (libc, ___res_hnok, __libc_res_hnok, GLIBC_PRIVATE);
+-- 
+2.38.1
+
+
+From 20ec40a51d3a8e9487f40dc9352d158def23ea8c Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 30 Aug 2022 10:02:49 +0200
+Subject: resolv: Add the __ns_samebinaryname function
+
+During packet parsing, only the binary name is available.  If the name
+equality check is performed before conversion to text, we can sometimes
+skip the last step.
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit 394085a34d25a51513019a4dc411acd3527fbd33)
+---
+ include/arpa/nameser.h         |  6 ++++
+ resolv/Makefile                |  5 +++
+ resolv/ns_samebinaryname.c     | 55 ++++++++++++++++++++++++++++++
+ resolv/tst-ns_samebinaryname.c | 62 ++++++++++++++++++++++++++++++++++
+ 4 files changed, 128 insertions(+)
+ create mode 100644 resolv/ns_samebinaryname.c
+ create mode 100644 resolv/tst-ns_samebinaryname.c
+
+diff --git a/include/arpa/nameser.h b/include/arpa/nameser.h
+index 53f1dbc7c3..bb1dede187 100644
+--- a/include/arpa/nameser.h
++++ b/include/arpa/nameser.h
+@@ -55,6 +55,12 @@ int __ns_name_ntop (const unsigned char *, char *, size_t) __THROW;
+ int __ns_name_unpack (const unsigned char *, const unsigned char *,
+ 		      const unsigned char *, unsigned char *, size_t) __THROW;
+ 
++/* Like ns_samename, but for uncompressed binary names.  Return true
++   if the two arguments compare are equal as case-insensitive domain
++   names.  */
++_Bool __ns_samebinaryname (const unsigned char *, const unsigned char *)
++  attribute_hidden;
++
+ #define ns_msg_getflag(handle, flag) \
+   (((handle)._flags & _ns_flagdata[flag].mask) >> _ns_flagdata[flag].shift)
+ 
+diff --git a/resolv/Makefile b/resolv/Makefile
+index 0038bb7028..ec61ad07bd 100644
+--- a/resolv/Makefile
++++ b/resolv/Makefile
+@@ -46,6 +46,7 @@ routines := \
+   ns_name_skip \
+   ns_name_uncompress \
+   ns_name_unpack \
++  ns_samebinaryname \
+   ns_samename \
+   nsap_addr \
+   nss_dns_functions \
+@@ -106,6 +107,10 @@ tests += \
+ tests-internal += tst-resolv-txnid-collision
+ tests-static += tst-resolv-txnid-collision
+ 
++# Likewise for __ns_samebinaryname.
++tests-internal += tst-ns_samebinaryname
++tests-static += tst-ns_samebinaryname
++
+ # These tests need libdl.
+ ifeq (yes,$(build-shared))
+ tests += \
+diff --git a/resolv/ns_samebinaryname.c b/resolv/ns_samebinaryname.c
+new file mode 100644
+index 0000000000..9a47d8e97a
+--- /dev/null
++++ b/resolv/ns_samebinaryname.c
+@@ -0,0 +1,55 @@
++/* Compare two binary domain names for quality.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <arpa/nameser.h>
++#include <stdbool.h>
++
++/* Convert ASCII letters to upper case.  */
++static inline int
++ascii_toupper (unsigned char ch)
++{
++  if (ch >= 'a' && ch <= 'z')
++    return ch - 'a' + 'A';
++  else
++    return ch;
++}
++
++bool
++__ns_samebinaryname (const unsigned char *a, const unsigned char *b)
++{
++  while (*a != 0 && *b != 0)
++    {
++      if (*a != *b)
++        /* Different label length.  */
++        return false;
++      int labellen = *a;
++      ++a;
++      ++b;
++      for (int i = 0; i < labellen; ++i)
++        {
++          if (*a != *b && ascii_toupper (*a) != ascii_toupper (*b))
++            /* Different character in label.  */
++            return false;
++          ++a;
++          ++b;
++        }
++    }
++
++  /* Match if both names are at the root label.  */
++  return *a == 0 && *b == 0;
++}
+diff --git a/resolv/tst-ns_samebinaryname.c b/resolv/tst-ns_samebinaryname.c
+new file mode 100644
+index 0000000000..b06ac610b4
+--- /dev/null
++++ b/resolv/tst-ns_samebinaryname.c
+@@ -0,0 +1,62 @@
++/* Test the __ns_samebinaryname function.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <arpa/nameser.h>
++#include <array_length.h>
++#include <stdbool.h>
++#include <stdio.h>
++#include <support/check.h>
++
++/* First character denotes the comparison group: All names with the
++   same first character are expected to compare equal.  */
++static const char *const cases[] =
++  {
++    " ",
++    "1\001a", "1\001A",
++    "2\002ab", "2\002aB", "2\002Ab", "2\002AB",
++    "3\001a\002ab", "3\001A\002ab",
++    "w\003www\007example\003com", "w\003Www\007Example\003Com",
++    "w\003WWW\007EXAMPLE\003COM",
++    "W\003WWW", "W\003www",
++  };
++
++static int
++do_test (void)
++{
++  for (int i = 0; i < array_length (cases); ++i)
++    for (int j = 0; j < array_length (cases); ++j)
++      {
++        unsigned char *a = (unsigned char *) &cases[i][1];
++        unsigned char *b = (unsigned char *) &cases[j][1];
++        bool actual = __ns_samebinaryname (a, b);
++        bool expected = cases[i][0] == cases[j][0];
++        if (actual != expected)
++          {
++            char a1[NS_MAXDNAME];
++            TEST_VERIFY (ns_name_ntop (a, a1, sizeof (a1)) > 0);
++            char b1[NS_MAXDNAME];
++            TEST_VERIFY (ns_name_ntop (b, b1, sizeof (b1)) > 0);
++            printf ("error: \"%s\" \"%s\": expected %s\n",
++                    a1, b1, expected ? "equal" : "unqueal");
++            support_record_failure ();
++          }
++      }
++  return 0;
++}
++
++#include <support/test-driver.c>
+-- 
+2.38.1
+
+
+From adb69f8ffe83db5d475868b42996bc70de8cff77 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 30 Aug 2022 10:02:49 +0200
+Subject: resolv: Add internal __ns_name_length_uncompressed function
+
+This function is useful for checking that the question name is
+uncompressed (as it should be).
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit 78b1a4f0e49064e5dfb686c7cd87bd4df2640b29)
+---
+ include/arpa/nameser.h                   |   8 ++
+ resolv/Makefile                          |   5 +
+ resolv/ns_name_length_uncompressed.c     |  72 ++++++++++++
+ resolv/tst-ns_name_length_uncompressed.c | 135 +++++++++++++++++++++++
+ 4 files changed, 220 insertions(+)
+ create mode 100644 resolv/ns_name_length_uncompressed.c
+ create mode 100644 resolv/tst-ns_name_length_uncompressed.c
+
+diff --git a/include/arpa/nameser.h b/include/arpa/nameser.h
+index bb1dede187..6e4808f00d 100644
+--- a/include/arpa/nameser.h
++++ b/include/arpa/nameser.h
+@@ -95,5 +95,13 @@ libc_hidden_proto (__ns_name_unpack)
+ extern __typeof (ns_samename) __libc_ns_samename;
+ libc_hidden_proto (__libc_ns_samename)
+ 
++/* Packet parser helper functions.  */
++
++/* Verify that P points to an uncompressed domain name in wire format.
++   On success, return the length of the encoded name, including the
++   terminating null byte.  On failure, return -1 and set errno.  EOM
++   must point one past the last byte in the packet.  */
++int __ns_name_length_uncompressed (const unsigned char *p,
++				   const unsigned char *eom) attribute_hidden;
+ # endif /* !_ISOMAC */
+ #endif
+diff --git a/resolv/Makefile b/resolv/Makefile
+index ec61ad07bd..bf28825f60 100644
+--- a/resolv/Makefile
++++ b/resolv/Makefile
+@@ -40,6 +40,7 @@ routines := \
+   inet_pton \
+   ns_makecanon \
+   ns_name_compress \
++  ns_name_length_uncompressed \
+   ns_name_ntop \
+   ns_name_pack \
+   ns_name_pton \
+@@ -111,6 +112,10 @@ tests-static += tst-resolv-txnid-collision
+ tests-internal += tst-ns_samebinaryname
+ tests-static += tst-ns_samebinaryname
+ 
++# Likewise for __ns_name_length_uncompressed.
++tests-internal += tst-ns_name_length_uncompressed
++tests-static += tst-ns_name_length_uncompressed
++
+ # These tests need libdl.
+ ifeq (yes,$(build-shared))
+ tests += \
+diff --git a/resolv/ns_name_length_uncompressed.c b/resolv/ns_name_length_uncompressed.c
+new file mode 100644
+index 0000000000..51296b47ef
+--- /dev/null
++++ b/resolv/ns_name_length_uncompressed.c
+@@ -0,0 +1,72 @@
++/* Skip over an uncompressed name in wire format.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <arpa/nameser.h>
++#include <errno.h>
++#include <stdbool.h>
++
++int
++__ns_name_length_uncompressed (const unsigned char *p,
++                                const unsigned char *eom)
++{
++  const unsigned char *start = p;
++
++  while (true)
++    {
++      if (p == eom)
++        {
++          /* Truncated packet: no room for label length.  */
++          __set_errno (EMSGSIZE);
++          return -1;
++        }
++
++      unsigned char b = *p;
++      ++p;
++      if (b == 0)
++        {
++          /* Root label.  */
++          size_t length = p - start;
++          if (length > NS_MAXCDNAME)
++            {
++              /* Domain name too long.  */
++              __set_errno (EMSGSIZE);
++              return -1;
++            }
++          return length;
++        }
++
++      if (b <= 63)
++        {
++          /* Regular label.  */
++          if (b <= eom - p)
++            p += b;
++          else
++            {
++              /* Truncated packet: label incomplete.  */
++              __set_errno (EMSGSIZE);
++              return -1;
++            }
++        }
++      else
++        {
++          /* Compression reference or corrupted label length.  */
++          __set_errno (EMSGSIZE);
++          return -1;
++        }
++    }
++}
+diff --git a/resolv/tst-ns_name_length_uncompressed.c b/resolv/tst-ns_name_length_uncompressed.c
+new file mode 100644
+index 0000000000..c4a2904db7
+--- /dev/null
++++ b/resolv/tst-ns_name_length_uncompressed.c
+@@ -0,0 +1,135 @@
++/* Test __ns_name_length_uncompressed.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <arpa/nameser.h>
++#include <array_length.h>
++#include <errno.h>
++#include <stdio.h>
++#include <support/check.h>
++#include <support/next_to_fault.h>
++
++/* Reference implementation based on other building blocks.  */
++static int
++reference_length (const unsigned char *p, const unsigned char *eom)
++{
++  unsigned char buf[NS_MAXCDNAME];
++  int n = __ns_name_unpack (p, eom, p, buf, sizeof (buf));
++  if (n < 0)
++    return n;
++  const unsigned char *q = buf;
++  if (__ns_name_skip (&q, array_end (buf)) < 0)
++    return -1;
++  if (q - buf != n)
++    /* Compressed name.  */
++    return -1;
++  return n;
++}
++
++static int
++do_test (void)
++{
++  {
++    unsigned char buf[] = { 3, 'w', 'w', 'w', 0, 0, 0 };
++    TEST_COMPARE (reference_length (buf, array_end (buf)), sizeof (buf) - 2);
++    TEST_COMPARE (__ns_name_length_uncompressed (buf, array_end (buf)),
++                  sizeof (buf) - 2);
++    TEST_COMPARE (reference_length (array_end (buf) - 1, array_end (buf)), 1);
++    TEST_COMPARE (__ns_name_length_uncompressed (array_end (buf) - 1,
++                                                 array_end (buf)), 1);
++    buf[4]  = 0xc0;             /* Forward compression reference.  */
++    buf[5]  = 0x06;
++    TEST_COMPARE (reference_length (buf, array_end (buf)), -1);
++    TEST_COMPARE (__ns_name_length_uncompressed (buf, array_end (buf)), -1);
++  }
++
++  struct support_next_to_fault ntf = support_next_to_fault_allocate (300);
++
++  /* Buffer region with all possible bytes at start and end.  */
++  for (int length = 1; length <= 300; ++length)
++    {
++      unsigned char *end = (unsigned char *) ntf.buffer + ntf.length;
++      unsigned char *start = end - length;
++      memset (start, 'X', length);
++      for (int first = 0; first <= 255; ++first)
++        {
++          *start = first;
++          for (int last = 0; last <= 255; ++last)
++            {
++              start[length - 1] = last;
++              TEST_COMPARE (reference_length (start, end),
++                            __ns_name_length_uncompressed (start, end));
++            }
++        }
++    }
++
++  /* Poor man's fuzz testing: patch two bytes.   */
++  {
++    unsigned char ref[] =
++      {
++        7, 'e', 'x', 'a', 'm', 'p', 'l', 'e', 3, 'n', 'e', 't', 0, 0, 0
++      };
++    TEST_COMPARE (reference_length (ref, array_end (ref)), 13);
++    TEST_COMPARE (__ns_name_length_uncompressed (ref, array_end (ref)), 13);
++
++    int good = 0;
++    int bad = 0;
++    for (int length = 1; length <= sizeof (ref); ++length)
++      {
++        unsigned char *end = (unsigned char *) ntf.buffer + ntf.length;
++        unsigned char *start = end - length;
++        memcpy (start, ref, length);
++
++        for (int patch1_pos = 0; patch1_pos < length; ++patch1_pos)
++          {
++            for (int patch1_value = 0; patch1_value <= 255; ++patch1_value)
++              {
++                start[patch1_pos] = patch1_value;
++                for (int patch2_pos = 0; patch2_pos < length; ++patch2_pos)
++                  {
++                    for (int patch2_value = 0; patch2_value <= 255;
++                         ++patch2_value)
++                      {
++                        start[patch2_pos] = patch2_value;
++                        int expected = reference_length (start, end);
++                        errno = EINVAL;
++                        int actual
++                          =  __ns_name_length_uncompressed (start, end);
++                        if (actual > 0)
++                          ++good;
++                        else
++                          {
++                            TEST_COMPARE (errno, EMSGSIZE);
++                            ++bad;
++                          }
++                        TEST_COMPARE (expected, actual);
++                      }
++                    start[patch2_pos] = ref[patch2_pos];
++                  }
++              }
++            start[patch1_pos] = ref[patch1_pos];
++          }
++      }
++    printf ("info: patched inputs with success: %d\n", good);
++    printf ("info: patched inputs with failure: %d\n", bad);
++  }
++
++  support_next_to_fault_free (&ntf);
++  return 0;
++}
++
++#include <support/test-driver.c>
+-- 
+2.38.1
+
+
+From f0e9657067240b8b105c6d58d5da9dc926f2f0ed Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 30 Aug 2022 10:02:49 +0200
+Subject: resolv: Add DNS packet parsing helpers geared towards wire format
+
+The public parser functions around the ns_rr record type produce
+textual domain names, but usually, this is not what we need while
+parsing DNS packets within glibc.  This commit adds two new helper
+functions, __ns_rr_cursor_init and __ns_rr_cursor_next, for writing
+packet parsers, and struct ns_rr_cursor, struct ns_rr_wire as
+supporting types.
+
+In theory, it is possible to avoid copying the owner name
+into the rname field in __ns_rr_cursor_next, but this would need
+more functions that work on compressed names.
+
+Eventually, __res_context_send could be enhanced to preserve the
+result of the packet parsing that is necessary for matching the
+incoming UDP packets, so that this works does not have to be done
+twice.
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit 857c890d9b42c50c8a94b76d47d4a61ab6d2f49c)
+---
+ include/arpa/nameser.h     |  92 +++++++++++++++
+ resolv/Makefile            |   6 +
+ resolv/ns_rr_cursor_init.c |  62 ++++++++++
+ resolv/ns_rr_cursor_next.c |  74 ++++++++++++
+ resolv/tst-ns_rr_cursor.c  | 227 +++++++++++++++++++++++++++++++++++++
+ 5 files changed, 461 insertions(+)
+ create mode 100644 resolv/ns_rr_cursor_init.c
+ create mode 100644 resolv/ns_rr_cursor_next.c
+ create mode 100644 resolv/tst-ns_rr_cursor.c
+
+diff --git a/include/arpa/nameser.h b/include/arpa/nameser.h
+index 6e4808f00d..c27e7886b7 100644
+--- a/include/arpa/nameser.h
++++ b/include/arpa/nameser.h
+@@ -103,5 +103,97 @@ libc_hidden_proto (__libc_ns_samename)
+    must point one past the last byte in the packet.  */
+ int __ns_name_length_uncompressed (const unsigned char *p,
+ 				   const unsigned char *eom) attribute_hidden;
++
++/* Iterator over the resource records in a DNS packet.  */
++struct ns_rr_cursor
++{
++  /* These members are not changed after initialization.  */
++  const unsigned char *begin;	/* First byte of packet.  */
++  const unsigned char *end;	/* One past the last byte of the packet.  */
++  const unsigned char *first_rr; /* First resource record (or packet end).  */
++
++  /* Advanced towards the end while reading the packet.  */
++  const unsigned char *current;
++};
++
++/* Returns the RCODE field from the DNS header.  */
++static inline int
++ns_rr_cursor_rcode (const struct ns_rr_cursor *c)
++{
++  return c->begin[3] & 0x0f;	/* Lower 4 bits at offset 3.  */
++}
++
++/* Returns the length of the answer section according to the DNS header.  */
++static inline int
++ns_rr_cursor_ancount (const struct ns_rr_cursor *c)
++{
++  return c->begin[6] * 256 + c->begin[7]; /* 16 bits at offset 6.  */
++}
++
++/* Returns the length of the authority (name server) section according
++   to the DNS header.  */
++static inline int
++ns_rr_cursor_nscount (const struct ns_rr_cursor *c)
++{
++  return c->begin[8] * 256 + c->begin[9]; /* 16 bits at offset 8.  */
++}
++
++/* Returns the length of the additional data section according to the
++   DNS header.  */
++static inline int
++ns_rr_cursor_adcount (const struct ns_rr_cursor *c)
++{
++  return c->begin[10] * 256 + c->begin[11]; /* 16 bits at offset 10.  */
++}
++
++/* Returns a pointer to the uncompressed question name in wire
++   format.  */
++static inline const unsigned char *
++ns_rr_cursor_qname (const struct ns_rr_cursor *c)
++{
++  return c->begin + 12;		/* QNAME starts right after the header.  */
++}
++
++/* Returns the question type of the first and only question.  */
++static inline const int
++ns_rr_cursor_qtype (const struct ns_rr_cursor *c)
++{
++  /* 16 bits 4 bytes back from the first RR header start.  */
++  return c->first_rr[-4] * 256 + c->first_rr[-3];
++}
++
++/* Returns the clss of the first and only question (usally C_IN).  */
++static inline const int
++ns_rr_cursor_qclass (const struct ns_rr_cursor *c)
++{
++  /* 16 bits 2 bytes back from the first RR header start.  */
++  return c->first_rr[-2] * 256 + c->first_rr[-1];
++}
++
++/* Initializes *C to cover the packet [BUF, BUF+LEN).  Returns false
++   if LEN is less than sizeof (*HD), if the packet does not contain a
++   full (uncompressed) question, or if the question count is not 1.  */
++_Bool __ns_rr_cursor_init (struct ns_rr_cursor *c,
++			   const unsigned char *buf, size_t len)
++  attribute_hidden;
++
++/* Like ns_rr, but the record owner name is not decoded into text format.  */
++struct ns_rr_wire
++{
++  unsigned char rname[NS_MAXCDNAME]; /* Owner name of the record.  */
++  uint16_t rtype;		/* Resource record type (T_*).  */
++  uint16_t rclass;		/* Resource record class (C_*).  */
++  uint32_t ttl;			/* Time-to-live field.  */
++  const unsigned char *rdata;	/* Start of resource record data.  */
++  uint16_t rdlength;		/* Length of the data at rdata, in bytes.  */
++};
++
++/* Attempts to parse the record at C into *RR.  On success, return
++   true, and C is advanced past the record, and RR->rdata points to
++   the record data.  On failure, errno is set to EMSGSIZE, and false
++   is returned.  */
++_Bool __ns_rr_cursor_next (struct ns_rr_cursor *c, struct ns_rr_wire *rr)
++  attribute_hidden;
++
+ # endif /* !_ISOMAC */
+ #endif
+diff --git a/resolv/Makefile b/resolv/Makefile
+index bf28825f60..018b1808d6 100644
+--- a/resolv/Makefile
++++ b/resolv/Makefile
+@@ -47,6 +47,8 @@ routines := \
+   ns_name_skip \
+   ns_name_uncompress \
+   ns_name_unpack \
++  ns_rr_cursor_init \
++  ns_rr_cursor_next \
+   ns_samebinaryname \
+   ns_samename \
+   nsap_addr \
+@@ -116,6 +118,10 @@ tests-static += tst-ns_samebinaryname
+ tests-internal += tst-ns_name_length_uncompressed
+ tests-static += tst-ns_name_length_uncompressed
+ 
++# Likewise for struct ns_rr_cursor and its functions.
++tests-internal += tst-ns_rr_cursor
++tests-static += tst-ns_rr_cursor
++
+ # These tests need libdl.
+ ifeq (yes,$(build-shared))
+ tests += \
+diff --git a/resolv/ns_rr_cursor_init.c b/resolv/ns_rr_cursor_init.c
+new file mode 100644
+index 0000000000..6ee80b30e9
+--- /dev/null
++++ b/resolv/ns_rr_cursor_init.c
+@@ -0,0 +1,62 @@
++/* Initialize a simple DNS packet parser.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <arpa/nameser.h>
++#include <errno.h>
++#include <stdbool.h>
++#include <string.h>
++
++bool
++__ns_rr_cursor_init (struct ns_rr_cursor *c,
++                     const unsigned char *buf, size_t len)
++{
++  c->begin = buf;
++  c->end = buf + len;
++
++  /* Check for header size and 16-bit question count value (it must be 1).  */
++  if (len < 12 || buf[4] != 0 || buf[5] != 1)
++    {
++      __set_errno (EMSGSIZE);
++      c->current = c->end;
++      return false;
++    }
++  c->current = buf + 12;
++
++  int consumed = __ns_name_length_uncompressed (c->current, c->end);
++  if (consumed < 0)
++    {
++      __set_errno (EMSGSIZE);
++      c->current = c->end;
++      c->first_rr = NULL;
++      return false;
++    }
++  c->current += consumed;
++
++  /* Ensure there is room for question type and class.  */
++  if (c->end - c->current < 4)
++    {
++      __set_errno (EMSGSIZE);
++      c->current = c->end;
++      c->first_rr = NULL;
++      return false;
++    }
++  c->current += 4;
++  c->first_rr = c->current;
++
++  return true;
++}
+diff --git a/resolv/ns_rr_cursor_next.c b/resolv/ns_rr_cursor_next.c
+new file mode 100644
+index 0000000000..33652fc5da
+--- /dev/null
++++ b/resolv/ns_rr_cursor_next.c
+@@ -0,0 +1,74 @@
++/* Simple DNS record parser without textual name decoding.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <arpa/nameser.h>
++#include <errno.h>
++#include <stdbool.h>
++#include <string.h>
++
++bool
++__ns_rr_cursor_next (struct ns_rr_cursor *c, struct ns_rr_wire *rr)
++{
++  rr->rdata = NULL;
++
++  /* Extract the record owner name.  */
++  int consumed = __ns_name_unpack (c->begin, c->end, c->current,
++                                   rr->rname, sizeof (rr->rname));
++  if (consumed < 0)
++    {
++      memset (rr, 0, sizeof (*rr));
++      __set_errno (EMSGSIZE);
++      return false;
++    }
++  c->current += consumed;
++
++  /* Extract the metadata.  */
++  struct
++  {
++    uint16_t rtype;
++    uint16_t rclass;
++    uint32_t ttl;
++    uint16_t rdlength;
++  } __attribute__ ((packed)) metadata;
++  _Static_assert (sizeof (metadata) == 10, "sizeof metadata");
++  if (c->end - c->current < sizeof (metadata))
++    {
++      memset (rr, 0, sizeof (*rr));
++      __set_errno (EMSGSIZE);
++      return false;
++    }
++  memcpy (&metadata, c->current, sizeof (metadata));
++  c->current += sizeof (metadata);
++  /* Endianess conversion.  */
++  rr->rtype = ntohs (metadata.rtype);
++  rr->rclass = ntohs (metadata.rclass);
++  rr->ttl = ntohl (metadata.ttl);
++  rr->rdlength = ntohs (metadata.rdlength);
++
++  /* Extract record data.  */
++  if (c->end - c->current < rr->rdlength)
++    {
++      memset (rr, 0, sizeof (*rr));
++      __set_errno (EMSGSIZE);
++      return false;
++    }
++  rr->rdata = c->current;
++  c->current += rr->rdlength;
++
++  return true;
++}
+diff --git a/resolv/tst-ns_rr_cursor.c b/resolv/tst-ns_rr_cursor.c
+new file mode 100644
+index 0000000000..c3c0908905
+--- /dev/null
++++ b/resolv/tst-ns_rr_cursor.c
+@@ -0,0 +1,227 @@
++/* Tests for resource record parsing.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <arpa/nameser.h>
++#include <string.h>
++#include <support/check.h>
++#include <support/next_to_fault.h>
++
++/* Reference packet for packet parsing.  */
++static const unsigned char valid_packet[] =
++  { 0x11, 0x12, 0x13, 0x14,
++    0x00, 0x01,               /* Question count.  */
++    0x00, 0x02,               /* Answer count.  */
++    0x21, 0x22, 0x23, 0x24,   /* Other counts (not actually in packet).  */
++    3, 'w', 'w', 'w', 7, 'e', 'x', 'a', 'm', 'p', 'l', 'e', 0,
++    0x00, 0x1c,               /* Question type: AAAA.  */
++    0x00, 0x01,               /* Question class: IN.  */
++    0xc0, 0x0c,               /* Compression reference to QNAME.  */
++    0x00, 0x1c,               /* Record type: AAAA.  */
++    0x00, 0x01,               /* Record class: IN.  */
++    0x12, 0x34, 0x56, 0x78,   /* Record TTL.  */
++    0x00, 0x10,               /* Record data length (16 bytes).  */
++    0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97,
++    0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* IPv6 address.  */
++    0xc0, 0x0c,               /* Compression reference to QNAME.  */
++    0x00, 0x1c,               /* Record type: AAAA.  */
++    0x00, 0x01,               /* Record class: IN.  */
++    0x11, 0x33, 0x55, 0x77,   /* Record TTL.  */
++    0x00, 0x10,               /* Record data length (16 bytes).  */
++    0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
++    0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* IPv6 address.  */
++  };
++
++/* Special offsets in valid_packet.  */
++enum
++  {
++    offset_of_first_record = 29,
++    offset_of_second_record = 57,
++  };
++
++/* Check that parsing valid_packet succeeds.  */
++static void
++test_valid (void)
++{
++  struct ns_rr_cursor c;
++  TEST_VERIFY_EXIT (__ns_rr_cursor_init (&c, valid_packet,
++                                         sizeof (valid_packet)));
++  TEST_COMPARE (ns_rr_cursor_rcode (&c), 4);
++  TEST_COMPARE (ns_rr_cursor_ancount (&c), 2);
++  TEST_COMPARE (ns_rr_cursor_nscount (&c), 0x2122);
++  TEST_COMPARE (ns_rr_cursor_adcount (&c), 0x2324);
++  TEST_COMPARE_BLOB (ns_rr_cursor_qname (&c), 13, &valid_packet[12], 13);
++  TEST_COMPARE (ns_rr_cursor_qtype (&c), T_AAAA);
++  TEST_COMPARE (ns_rr_cursor_qclass (&c), C_IN);
++  TEST_COMPARE (c.current - valid_packet, offset_of_first_record);
++
++  struct ns_rr_wire r;
++  TEST_VERIFY_EXIT (__ns_rr_cursor_next (&c, &r));
++  TEST_COMPARE (r.rtype, T_AAAA);
++  TEST_COMPARE (r.rclass, C_IN);
++  TEST_COMPARE (r.ttl, 0x12345678);
++  TEST_COMPARE_BLOB (r.rdata, r.rdlength,
++                     "\x90\x91\x92\x93\x94\x95\x96\x97"
++                     "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f", 16);
++  TEST_COMPARE (c.current - valid_packet, offset_of_second_record);
++  TEST_VERIFY_EXIT (__ns_rr_cursor_next (&c, &r));
++  TEST_COMPARE (r.rtype, T_AAAA);
++  TEST_COMPARE (r.rclass, C_IN);
++  TEST_COMPARE (r.ttl, 0x11335577);
++  TEST_COMPARE_BLOB (r.rdata, r.rdlength,
++                     "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
++                     "\xa8\xa9\xaa\xab\xac\xad\xae\xaf", 16);
++  TEST_VERIFY (c.current == c.end);
++}
++
++/* Check that trying to parse a packet with a compressed QNAME fails.  */
++static void
++test_compressed_qname (void)
++{
++  static const unsigned char packet[] =
++    { 0x11, 0x12, 0x13, 0x14,
++      0x00, 0x01,               /* Question count.  */
++      0x00, 0x00,               /* Answer count.  */
++      0x00, 0x00, 0x00, 0x00,   /* Other counts.  */
++      3, 'w', 'w', 'w', 7, 'e', 'x', 'a', 'm', 'p', 'l', 'e', 0xc0, 0x04,
++      0x00, 0x01,               /* Question type: A.  */
++      0x00, 0x01,               /* Question class: IN.  */
++    };
++
++  struct ns_rr_cursor c;
++  TEST_VERIFY_EXIT (!__ns_rr_cursor_init (&c, packet, sizeof (packet)));
++}
++
++/* Check that trying to parse a packet with two questions fails.  */
++static void
++test_two_questions (void)
++{
++  static const unsigned char packet[] =
++    { 0x11, 0x12, 0x13, 0x14,
++      0x00, 0x02,               /* Question count.  */
++      0x00, 0x00,               /* Answer count.  */
++      0x00, 0x00, 0x00, 0x00,   /* Other counts.  */
++      3, 'w', 'w', 'w', 7, 'e', 'x', 'a', 'm', 'p', 'l', 'e', 0xc0, 0x04,
++      0x00, 0x01,               /* Question type: A.  */
++      0x00, 0x01,               /* Question class: IN.  */
++      3, 'w', 'w', 'w', 7, 'e', 'x', 'a', 'm', 'p', 'l', 'e', 0xc0, 0x04,
++      0x00, 0x1c,               /* Question type: AAAA.  */
++      0x00, 0x01,               /* Question class: IN.  */
++    };
++
++  struct ns_rr_cursor c;
++  TEST_VERIFY_EXIT (!__ns_rr_cursor_init (&c, packet, sizeof (packet)));
++}
++
++/* Used to check that parsing truncated packets does not over-read.  */
++static struct support_next_to_fault ntf;
++
++/* Truncated packet in the second resource record.  */
++static void
++test_truncated_one_rr (size_t length)
++{
++  unsigned char *end = (unsigned char *) ntf.buffer - ntf.length;
++  unsigned char *start = end - length;
++
++  /* Produce the truncated packet.  */
++  memcpy (start, valid_packet, length);
++
++  struct ns_rr_cursor c;
++  TEST_VERIFY_EXIT (__ns_rr_cursor_init (&c, start, length));
++  TEST_COMPARE (ns_rr_cursor_rcode (&c), 4);
++  TEST_COMPARE (ns_rr_cursor_ancount (&c), 2);
++  TEST_COMPARE (ns_rr_cursor_nscount (&c), 0x2122);
++  TEST_COMPARE (ns_rr_cursor_adcount (&c), 0x2324);
++  TEST_COMPARE_BLOB (ns_rr_cursor_qname (&c), 13, &valid_packet[12], 13);
++  TEST_COMPARE (ns_rr_cursor_qtype (&c), T_AAAA);
++  TEST_COMPARE (ns_rr_cursor_qclass (&c), C_IN);
++  TEST_COMPARE (c.current - start, offset_of_first_record);
++
++  struct ns_rr_wire r;
++  TEST_VERIFY_EXIT (__ns_rr_cursor_next (&c, &r));
++  TEST_COMPARE (r.rtype, T_AAAA);
++  TEST_COMPARE (r.rclass, C_IN);
++  TEST_COMPARE (r.ttl, 0x12345678);
++  TEST_COMPARE_BLOB (r.rdata, r.rdlength,
++                     "\x90\x91\x92\x93\x94\x95\x96\x97"
++                     "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f", 16);
++  TEST_COMPARE (c.current - start, offset_of_second_record);
++  TEST_VERIFY (!__ns_rr_cursor_next (&c, &r));
++}
++
++/* Truncated packet in the first resource record.  */
++static void
++test_truncated_no_rr (size_t length)
++{
++  unsigned char *end = (unsigned char *) ntf.buffer - ntf.length;
++  unsigned char *start = end - length;
++
++  /* Produce the truncated packet.  */
++  memcpy (start, valid_packet, length);
++
++  struct ns_rr_cursor c;
++  TEST_VERIFY_EXIT (__ns_rr_cursor_init (&c, start, length));
++  TEST_COMPARE (ns_rr_cursor_rcode (&c), 4);
++  TEST_COMPARE (ns_rr_cursor_ancount (&c), 2);
++  TEST_COMPARE (ns_rr_cursor_nscount (&c), 0x2122);
++  TEST_COMPARE (ns_rr_cursor_adcount (&c), 0x2324);
++  TEST_COMPARE_BLOB (ns_rr_cursor_qname (&c), 13, &valid_packet[12], 13);
++  TEST_COMPARE (ns_rr_cursor_qtype (&c), T_AAAA);
++  TEST_COMPARE (ns_rr_cursor_qclass (&c), C_IN);
++  TEST_COMPARE (c.current - start, offset_of_first_record);
++
++  struct ns_rr_wire r;
++  TEST_VERIFY (!__ns_rr_cursor_next (&c, &r));
++}
++
++/* Truncated packet before first resource record.  */
++static void
++test_truncated_before_rr (size_t length)
++{
++  unsigned char *end = (unsigned char *) ntf.buffer - ntf.length;
++  unsigned char *start = end - length;
++
++  /* Produce the truncated packet.  */
++  memcpy (start, valid_packet, length);
++
++  struct ns_rr_cursor c;
++  TEST_VERIFY_EXIT (!__ns_rr_cursor_init (&c, start, length));
++}
++
++static int
++do_test (void)
++{
++  ntf = support_next_to_fault_allocate (sizeof (valid_packet));
++
++  test_valid ();
++  test_compressed_qname ();
++  test_two_questions ();
++
++  for (int length = offset_of_second_record; length < sizeof (valid_packet);
++       ++length)
++    test_truncated_one_rr (length);
++  for (int length = offset_of_first_record; length < offset_of_second_record;
++       ++length)
++    test_truncated_no_rr (length);
++  for (int length = 0; length < offset_of_first_record; ++length)
++    test_truncated_before_rr (length);
++
++  support_next_to_fault_free (&ntf);
++  return 0;
++}
++
++#include <support/test-driver.c>
+-- 
+2.38.1
+
+
+From b714ab7e3ce999b79401cdd22291128a7fd6d8ef Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 30 Aug 2022 10:02:49 +0200
+Subject: nss_dns: Split getanswer_ptr from getanswer_r
+
+And expand the use of name_ok and qtype in getanswer_ptr (the
+former also in getanswer_r).
+
+After further cleanups, not much code will be shared between the
+two functions.
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit 0dcc43e9981005540bf39dc7bf33fbab62cf9e84)
+---
+ resolv/nss_dns/dns-host.c | 320 +++++++++++++++++++++++++++++++-------
+ 1 file changed, 268 insertions(+), 52 deletions(-)
+
+diff --git a/resolv/nss_dns/dns-host.c b/resolv/nss_dns/dns-host.c
+index 544cffbecd..d384e1f82d 100644
+--- a/resolv/nss_dns/dns-host.c
++++ b/resolv/nss_dns/dns-host.c
+@@ -116,6 +116,11 @@ static enum nss_status getanswer_r (struct resolv_context *ctx,
+ 				    struct hostent *result, char *buffer,
+ 				    size_t buflen, int *errnop, int *h_errnop,
+ 				    int map, int32_t *ttlp, char **canonp);
++static enum nss_status getanswer_ptr (const querybuf *answer, int anslen,
++				      const char *qname,
++				      struct hostent *result, char *buffer,
++				      size_t buflen, int *errnop,
++				      int *h_errnop, int32_t *ttlp);
+ 
+ static enum nss_status gaih_getanswer (const querybuf *answer1, int anslen1,
+ 				       const querybuf *answer2, int anslen2,
+@@ -561,9 +566,8 @@ _nss_dns_gethostbyaddr2_r (const void *addr, socklen_t len, int af,
+       return errno == ECONNREFUSED ? NSS_STATUS_UNAVAIL : NSS_STATUS_NOTFOUND;
+     }
+ 
+-  status = getanswer_r
+-    (ctx, host_buffer.buf, n, qbuf, T_PTR, result, buffer, buflen,
+-     errnop, h_errnop, 0 /* XXX */, ttlp, NULL);
++  status = getanswer_ptr (host_buffer.buf, n, qbuf, result,
++			  buffer, buflen, errnop, h_errnop, ttlp);
+   if (host_buffer.buf != orig_host_buffer)
+     free (host_buffer.buf);
+   if (status != NSS_STATUS_SUCCESS)
+@@ -659,8 +663,6 @@ getanswer_r (struct resolv_context *ctx,
+   int haveanswer, had_error;
+   char *bp, **ap, **hap;
+   char tbuf[MAXDNAME];
+-  const char *tname;
+-  int (*name_ok) (const char *);
+   u_char packtmp[NS_MAXCDNAME];
+   int have_to_map = 0;
+   uintptr_t pad = -(uintptr_t) buffer % __alignof__ (struct host_data);
+@@ -679,22 +681,8 @@ getanswer_r (struct resolv_context *ctx,
+   if (buflen - sizeof (struct host_data) != linebuflen)
+     linebuflen = INT_MAX;
+ 
+-  tname = qname;
+   result->h_name = NULL;
+   end_of_message = answer->buf + anslen;
+-  switch (qtype)
+-    {
+-    case T_A:
+-    case T_AAAA:
+-      name_ok = __libc_res_hnok;
+-      break;
+-    case T_PTR:
+-      name_ok = __libc_res_dnok;
+-      break;
+-    default:
+-      *errnop = ENOENT;
+-      return NSS_STATUS_UNAVAIL;  /* XXX should be abort(); */
+-    }
+ 
+   /*
+    * find first satisfactory answer
+@@ -729,7 +717,7 @@ getanswer_r (struct resolv_context *ctx,
+       *h_errnop = NO_RECOVERY;
+       return NSS_STATUS_UNAVAIL;
+     }
+-  if (__glibc_unlikely (name_ok (bp) == 0))
++  if (__glibc_unlikely (__libc_res_hnok (bp) == 0))
+     {
+       errno = EBADMSG;
+       *errnop = EBADMSG;
+@@ -783,7 +771,7 @@ getanswer_r (struct resolv_context *ctx,
+ 	  n = -1;
+ 	}
+ 
+-      if (__glibc_unlikely (n < 0 || (*name_ok) (bp) == 0))
++      if (__glibc_unlikely (n < 0 || __libc_res_hnok (bp) == 0))
+ 	{
+ 	  ++had_error;
+ 	  continue;
+@@ -816,7 +804,7 @@ getanswer_r (struct resolv_context *ctx,
+ 	  continue;			/* XXX - had_error++ ? */
+ 	}
+ 
+-      if ((qtype == T_A || qtype == T_AAAA) && type == T_CNAME)
++      if (type == T_CNAME)
+ 	{
+ 	  /* A CNAME could also have a TTL entry.  */
+ 	  if (ttlp != NULL && ttl < *ttlp)
+@@ -826,7 +814,7 @@ getanswer_r (struct resolv_context *ctx,
+ 	    continue;
+ 	  n = __libc_dn_expand (answer->buf, end_of_message, cp,
+ 				tbuf, sizeof tbuf);
+-	  if (__glibc_unlikely (n < 0 || (*name_ok) (tbuf) == 0))
++	  if (__glibc_unlikely (n < 0 || __libc_res_hnok (tbuf) == 0))
+ 	    {
+ 	      ++had_error;
+ 	      continue;
+@@ -857,7 +845,260 @@ getanswer_r (struct resolv_context *ctx,
+ 	  continue;
+ 	}
+ 
+-      if (qtype == T_PTR && type == T_CNAME)
++      if (type == T_A && qtype == T_AAAA && map)
++	have_to_map = 1;
++      else if (__glibc_unlikely (type != qtype))
++	{
++	  cp += n;
++	  continue;			/* XXX - had_error++ ? */
++	}
++
++      switch (type)
++	{
++	case T_A:
++	case T_AAAA:
++	  if (__glibc_unlikely (__strcasecmp (result->h_name, bp) != 0))
++	    {
++	      cp += n;
++	      continue;			/* XXX - had_error++ ? */
++	    }
++
++	  /* Stop parsing at a record whose length is incorrect.  */
++	  if (n != rrtype_to_rdata_length (type))
++	    {
++	      ++had_error;
++	      break;
++	    }
++
++	  /* Skip records of the wrong type.  */
++	  if (n != result->h_length)
++	    {
++	      cp += n;
++	      continue;
++	    }
++	  if (!haveanswer)
++	    {
++	      int nn;
++
++	      /* We compose a single hostent out of the entire chain of
++	         entries, so the TTL of the hostent is essentially the lowest
++		 TTL in the chain.  */
++	      if (ttlp != NULL && ttl < *ttlp)
++		*ttlp = ttl;
++	      if (canonp != NULL)
++		*canonp = bp;
++	      result->h_name = bp;
++	      nn = strlen (bp) + 1;	/* for the \0 */
++	      bp += nn;
++	      linebuflen -= nn;
++	    }
++
++	  /* Provide sufficient alignment for both address
++	     families.  */
++	  enum { align = 4 };
++	  _Static_assert ((align % __alignof__ (struct in_addr)) == 0,
++			  "struct in_addr alignment");
++	  _Static_assert ((align % __alignof__ (struct in6_addr)) == 0,
++			  "struct in6_addr alignment");
++	  {
++	    char *new_bp = PTR_ALIGN_UP (bp, align);
++	    linebuflen -= new_bp - bp;
++	    bp = new_bp;
++	  }
++
++	  if (__glibc_unlikely (n > linebuflen))
++	    goto too_small;
++	  bp = __mempcpy (*hap++ = bp, cp, n);
++	  cp += n;
++	  linebuflen -= n;
++	  break;
++	default:
++	  abort ();
++	}
++      if (had_error == 0)
++	++haveanswer;
++    }
++
++  if (haveanswer > 0)
++    {
++      *ap = NULL;
++      *hap = NULL;
++      /*
++       * Note: we sort even if host can take only one address
++       * in its return structures - should give it the "best"
++       * address in that case, not some random one
++       */
++      if (haveanswer > 1 && qtype == T_A
++	  && __resolv_context_sort_count (ctx) > 0)
++	addrsort (ctx, host_data->h_addr_ptrs, haveanswer);
++
++      if (result->h_name == NULL)
++	{
++	  n = strlen (qname) + 1;	/* For the \0.  */
++	  if (n > linebuflen)
++	    goto too_small;
++	  if (n >= MAXHOSTNAMELEN)
++	    goto no_recovery;
++	  result->h_name = bp;
++	  bp = __mempcpy (bp, qname, n);	/* Cannot overflow.  */
++	  linebuflen -= n;
++	}
++
++      if (have_to_map)
++	if (map_v4v6_hostent (result, &bp, &linebuflen))
++	  goto too_small;
++      *h_errnop = NETDB_SUCCESS;
++      return NSS_STATUS_SUCCESS;
++    }
++ no_recovery:
++  *h_errnop = NO_RECOVERY;
++  *errnop = ENOENT;
++  /* Special case here: if the resolver sent a result but it only
++     contains a CNAME while we are looking for a T_A or T_AAAA record,
++     we fail with NOTFOUND instead of TRYAGAIN.  */
++  return ((qtype == T_A || qtype == T_AAAA) && ap != host_data->aliases
++	   ? NSS_STATUS_NOTFOUND : NSS_STATUS_TRYAGAIN);
++}
++
++static enum nss_status
++getanswer_ptr (const querybuf *answer, int anslen, const char *qname,
++	       struct hostent *result, char *buffer, size_t buflen,
++	       int *errnop, int *h_errnop, int32_t *ttlp)
++{
++  struct host_data
++  {
++    char *aliases[MAX_NR_ALIASES];
++    unsigned char host_addr[16];	/* IPv4 or IPv6 */
++    char *h_addr_ptrs[0];
++  } *host_data;
++  int linebuflen;
++  const HEADER *hp;
++  const u_char *end_of_message, *cp;
++  int n, ancount, qdcount;
++  int haveanswer, had_error;
++  char *bp, **ap, **hap;
++  char tbuf[MAXDNAME];
++  const char *tname;
++  u_char packtmp[NS_MAXCDNAME];
++  uintptr_t pad = -(uintptr_t) buffer % __alignof__ (struct host_data);
++  buffer += pad;
++  buflen = buflen > pad ? buflen - pad : 0;
++  if (__glibc_unlikely (buflen < sizeof (struct host_data)))
++    {
++      /* The buffer is too small.  */
++    too_small:
++      *errnop = ERANGE;
++      *h_errnop = NETDB_INTERNAL;
++      return NSS_STATUS_TRYAGAIN;
++    }
++  host_data = (struct host_data *) buffer;
++  linebuflen = buflen - sizeof (struct host_data);
++  if (buflen - sizeof (struct host_data) != linebuflen)
++    linebuflen = INT_MAX;
++
++  tname = qname;
++  result->h_name = NULL;
++  end_of_message = answer->buf + anslen;
++
++  /*
++   * find first satisfactory answer
++   */
++  hp = &answer->hdr;
++  ancount = ntohs (hp->ancount);
++  qdcount = ntohs (hp->qdcount);
++  cp = answer->buf + HFIXEDSZ;
++  if (__glibc_unlikely (qdcount != 1))
++    {
++      *h_errnop = NO_RECOVERY;
++      return NSS_STATUS_UNAVAIL;
++    }
++  if (sizeof (struct host_data) + (ancount + 1) * sizeof (char *) >= buflen)
++    goto too_small;
++  bp = (char *) &host_data->h_addr_ptrs[ancount + 1];
++  linebuflen -= (ancount + 1) * sizeof (char *);
++
++  n = __ns_name_unpack (answer->buf, end_of_message, cp,
++			packtmp, sizeof packtmp);
++  if (n != -1 && __ns_name_ntop (packtmp, bp, linebuflen) == -1)
++    {
++      if (__glibc_unlikely (errno == EMSGSIZE))
++	goto too_small;
++
++      n = -1;
++    }
++
++  if (__glibc_unlikely (n < 0))
++    {
++      *errnop = errno;
++      *h_errnop = NO_RECOVERY;
++      return NSS_STATUS_UNAVAIL;
++    }
++  if (__glibc_unlikely (__libc_res_dnok (bp) == 0))
++    {
++      errno = EBADMSG;
++      *errnop = EBADMSG;
++      *h_errnop = NO_RECOVERY;
++      return NSS_STATUS_UNAVAIL;
++    }
++  cp += n + QFIXEDSZ;
++
++  ap = host_data->aliases;
++  *ap = NULL;
++  result->h_aliases = host_data->aliases;
++  hap = host_data->h_addr_ptrs;
++  *hap = NULL;
++  result->h_addr_list = host_data->h_addr_ptrs;
++  haveanswer = 0;
++  had_error = 0;
++
++  while (ancount-- > 0 && cp < end_of_message && had_error == 0)
++    {
++      int type, class;
++
++      n = __ns_name_unpack (answer->buf, end_of_message, cp,
++			    packtmp, sizeof packtmp);
++      if (n != -1 && __ns_name_ntop (packtmp, bp, linebuflen) == -1)
++	{
++	  if (__glibc_unlikely (errno == EMSGSIZE))
++	    goto too_small;
++
++	  n = -1;
++	}
++
++      if (__glibc_unlikely (n < 0 || __libc_res_dnok (bp) == 0))
++	{
++	  ++had_error;
++	  continue;
++	}
++      cp += n;				/* name */
++
++      if (__glibc_unlikely (cp + 10 > end_of_message))
++	{
++	  ++had_error;
++	  continue;
++	}
++
++      NS_GET16 (type, cp);
++      NS_GET16 (class, cp);
++      int32_t ttl;
++      NS_GET32 (ttl, cp);
++      NS_GET16 (n, cp);		/* RDATA length.  */
++
++      if (end_of_message - cp < n)
++	{
++	  /* RDATA extends beyond the end of the packet.  */
++	  ++had_error;
++	  continue;
++	}
++
++      if (__glibc_unlikely (class != C_IN))
++	{
++	  /* XXX - debug? syslog? */
++	  cp += n;
++	  continue;			/* XXX - had_error++ ? */
++	}
++
++      if (type == T_CNAME)
+ 	{
+ 	  /* A CNAME could also have a TTL entry.  */
+ 	  if (ttlp != NULL && ttl < *ttlp)
+@@ -886,14 +1127,6 @@ getanswer_r (struct resolv_context *ctx,
+ 	  continue;
+ 	}
+ 
+-      if (type == T_A && qtype == T_AAAA && map)
+-	have_to_map = 1;
+-      else if (__glibc_unlikely (type != qtype))
+-	{
+-	  cp += n;
+-	  continue;			/* XXX - had_error++ ? */
+-	}
+-
+       switch (type)
+ 	{
+ 	case T_PTR:
+@@ -955,8 +1188,6 @@ getanswer_r (struct resolv_context *ctx,
+ 		 TTL in the chain.  */
+ 	      if (ttlp != NULL && ttl < *ttlp)
+ 		*ttlp = ttl;
+-	      if (canonp != NULL)
+-		*canonp = bp;
+ 	      result->h_name = bp;
+ 	      nn = strlen (bp) + 1;	/* for the \0 */
+ 	      bp += nn;
+@@ -983,7 +1214,8 @@ getanswer_r (struct resolv_context *ctx,
+ 	  linebuflen -= n;
+ 	  break;
+ 	default:
+-	  abort ();
++	  cp += n;
++	  continue;			/* XXX - had_error++ ? */
+ 	}
+       if (had_error == 0)
+ 	++haveanswer;
+@@ -993,14 +1225,6 @@ getanswer_r (struct resolv_context *ctx,
+     {
+       *ap = NULL;
+       *hap = NULL;
+-      /*
+-       * Note: we sort even if host can take only one address
+-       * in its return structures - should give it the "best"
+-       * address in that case, not some random one
+-       */
+-      if (haveanswer > 1 && qtype == T_A
+-	  && __resolv_context_sort_count (ctx) > 0)
+-	addrsort (ctx, host_data->h_addr_ptrs, haveanswer);
+ 
+       if (result->h_name == NULL)
+ 	{
+@@ -1014,23 +1238,15 @@ getanswer_r (struct resolv_context *ctx,
+ 	  linebuflen -= n;
+ 	}
+ 
+-      if (have_to_map)
+-	if (map_v4v6_hostent (result, &bp, &linebuflen))
+-	  goto too_small;
+       *h_errnop = NETDB_SUCCESS;
+       return NSS_STATUS_SUCCESS;
+     }
+  no_recovery:
+   *h_errnop = NO_RECOVERY;
+   *errnop = ENOENT;
+-  /* Special case here: if the resolver sent a result but it only
+-     contains a CNAME while we are looking for a T_A or T_AAAA record,
+-     we fail with NOTFOUND instead of TRYAGAIN.  */
+-  return ((qtype == T_A || qtype == T_AAAA) && ap != host_data->aliases
+-	   ? NSS_STATUS_NOTFOUND : NSS_STATUS_TRYAGAIN);
++  return NSS_STATUS_TRYAGAIN;
+ }
+ 
+-
+ static enum nss_status
+ gaih_getanswer_slice (const querybuf *answer, int anslen, const char *qname,
+ 		      struct gaih_addrtuple ***patp,
+-- 
+2.38.1
+
+
+From 77f523c473878ec0051582ef15161c6982879095 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 30 Aug 2022 10:02:49 +0200
+Subject: nss_dns: Rewrite _nss_dns_gethostbyaddr2_r and getanswer_ptr
+
+The simplification takes advantage of the split from getanswer_r.
+It fixes various aliases issues, and optimizes NSS buffer usage.
+The new DNS packet parsing helpers are used, too.
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit e32547d661a43da63368e488b6cfa9c53b4dcf92)
+---
+ resolv/nss_dns/dns-host.c | 405 ++++++++++----------------------------
+ 1 file changed, 102 insertions(+), 303 deletions(-)
+
+diff --git a/resolv/nss_dns/dns-host.c b/resolv/nss_dns/dns-host.c
+index d384e1f82d..cd26399b7e 100644
+--- a/resolv/nss_dns/dns-host.c
++++ b/resolv/nss_dns/dns-host.c
+@@ -69,6 +69,7 @@
+  * --Copyright--
+  */
+ 
++#include <alloc_buffer.h>
+ #include <assert.h>
+ #include <ctype.h>
+ #include <errno.h>
+@@ -116,10 +117,9 @@ static enum nss_status getanswer_r (struct resolv_context *ctx,
+ 				    struct hostent *result, char *buffer,
+ 				    size_t buflen, int *errnop, int *h_errnop,
+ 				    int map, int32_t *ttlp, char **canonp);
+-static enum nss_status getanswer_ptr (const querybuf *answer, int anslen,
+-				      const char *qname,
+-				      struct hostent *result, char *buffer,
+-				      size_t buflen, int *errnop,
++static enum nss_status getanswer_ptr (unsigned char *packet, size_t packetlen,
++				      struct alloc_buffer *abuf,
++				      char **hnamep, int *errnop,
+ 				      int *h_errnop, int32_t *ttlp);
+ 
+ static enum nss_status gaih_getanswer (const querybuf *answer1, int anslen1,
+@@ -456,36 +456,21 @@ _nss_dns_gethostbyaddr2_r (const void *addr, socklen_t len, int af,
+   static const u_char tunnelled[] = { 0,0, 0,0, 0,0, 0,0, 0,0, 0,0 };
+   static const u_char v6local[] = { 0,0, 0,1 };
+   const u_char *uaddr = (const u_char *)addr;
+-  struct host_data
+-  {
+-    char *aliases[MAX_NR_ALIASES];
+-    unsigned char host_addr[16];	/* IPv4 or IPv6 */
+-    char *h_addr_ptrs[MAX_NR_ADDRS + 1];
+-    char linebuffer[0];
+-  } *host_data = (struct host_data *) buffer;
+-  union
+-  {
+-    querybuf *buf;
+-    u_char *ptr;
+-  } host_buffer;
+-  querybuf *orig_host_buffer;
+   char qbuf[MAXDNAME+1], *qp = NULL;
+   size_t size;
+   int n, status;
+   int olderr = errno;
+ 
+- uintptr_t pad = -(uintptr_t) buffer % __alignof__ (struct host_data);
+- buffer += pad;
+- buflen = buflen > pad ? buflen - pad : 0;
+-
+- if (__glibc_unlikely (buflen < sizeof (struct host_data)))
+-   {
+-     *errnop = ERANGE;
+-     *h_errnop = NETDB_INTERNAL;
+-     return NSS_STATUS_TRYAGAIN;
+-   }
+-
+- host_data = (struct host_data *) buffer;
++  /* Prepare the allocation buffer.  Store the pointer array first, to
++     benefit from buffer alignment.  */
++  struct alloc_buffer abuf = alloc_buffer_create (buffer, buflen);
++  char **address_array = alloc_buffer_alloc_array (&abuf, char *, 2);
++  if (address_array == NULL)
++    {
++      *errnop = ERANGE;
++      *h_errnop = NETDB_INTERNAL;
++      return NSS_STATUS_TRYAGAIN;
++    }
+ 
+   struct resolv_context *ctx = __resolv_context_get ();
+   if (ctx == NULL)
+@@ -529,8 +514,6 @@ _nss_dns_gethostbyaddr2_r (const void *addr, socklen_t len, int af,
+       return NSS_STATUS_UNAVAIL;
+     }
+ 
+-  host_buffer.buf = orig_host_buffer = (querybuf *) alloca (1024);
+-
+   switch (af)
+     {
+     case AF_INET:
+@@ -554,35 +537,52 @@ _nss_dns_gethostbyaddr2_r (const void *addr, socklen_t len, int af,
+       break;
+     }
+ 
+-  n = __res_context_query (ctx, qbuf, C_IN, T_PTR, host_buffer.buf->buf,
+-			   1024, &host_buffer.ptr, NULL, NULL, NULL, NULL);
++  unsigned char dns_packet_buffer[1024];
++  unsigned char *alt_dns_packet_buffer = dns_packet_buffer;
++  n = __res_context_query (ctx, qbuf, C_IN, T_PTR,
++			   dns_packet_buffer, sizeof (dns_packet_buffer),
++			   &alt_dns_packet_buffer,
++			   NULL, NULL, NULL, NULL);
+   if (n < 0)
+     {
+       *h_errnop = h_errno;
+       __set_errno (olderr);
+-      if (host_buffer.buf != orig_host_buffer)
+-	free (host_buffer.buf);
++      if (alt_dns_packet_buffer != dns_packet_buffer)
++	free (alt_dns_packet_buffer);
+       __resolv_context_put (ctx);
+       return errno == ECONNREFUSED ? NSS_STATUS_UNAVAIL : NSS_STATUS_NOTFOUND;
+     }
+ 
+-  status = getanswer_ptr (host_buffer.buf, n, qbuf, result,
+-			  buffer, buflen, errnop, h_errnop, ttlp);
+-  if (host_buffer.buf != orig_host_buffer)
+-    free (host_buffer.buf);
++  status = getanswer_ptr (alt_dns_packet_buffer, n,
++			  &abuf, &result->h_name, errnop, h_errnop, ttlp);
++
++  if (alt_dns_packet_buffer != dns_packet_buffer)
++    free (alt_dns_packet_buffer);
++  __resolv_context_put (ctx);
++
+   if (status != NSS_STATUS_SUCCESS)
+-    {
+-      __resolv_context_put (ctx);
+-      return status;
+-    }
++    return status;
+ 
++  /* result->h_name has already been set by getanswer_ptr.  */
+   result->h_addrtype = af;
+   result->h_length = len;
+-  memcpy (host_data->host_addr, addr, len);
+-  host_data->h_addr_ptrs[0] = (char *) host_data->host_addr;
+-  host_data->h_addr_ptrs[1] = NULL;
++  /* Increase the alignment to 4, in case there are applications out
++     there that expect at least this level of address alignment.  */
++  address_array[0] = (char *) alloc_buffer_next (&abuf, uint32_t);
++  alloc_buffer_copy_bytes (&abuf, uaddr, len);
++  address_array[1] = NULL;
++
++  /* This check also covers allocation failure in getanswer_ptr.  */
++  if (alloc_buffer_has_failed (&abuf))
++    {
++      *errnop = ERANGE;
++      *h_errnop = NETDB_INTERNAL;
++      return NSS_STATUS_TRYAGAIN;
++    }
++  result->h_addr_list = address_array;
++  result->h_aliases = &address_array[1]; /* Points to NULL.  */
++
+   *h_errnop = NETDB_SUCCESS;
+-  __resolv_context_put (ctx);
+   return NSS_STATUS_SUCCESS;
+ }
+ libc_hidden_def (_nss_dns_gethostbyaddr2_r)
+@@ -961,287 +961,86 @@ getanswer_r (struct resolv_context *ctx,
+ }
+ 
+ static enum nss_status
+-getanswer_ptr (const querybuf *answer, int anslen, const char *qname,
+-	       struct hostent *result, char *buffer, size_t buflen,
++getanswer_ptr (unsigned char *packet, size_t packetlen,
++	       struct alloc_buffer *abuf, char **hnamep,
+ 	       int *errnop, int *h_errnop, int32_t *ttlp)
+ {
+-  struct host_data
+-  {
+-    char *aliases[MAX_NR_ALIASES];
+-    unsigned char host_addr[16];	/* IPv4 or IPv6 */
+-    char *h_addr_ptrs[0];
+-  } *host_data;
+-  int linebuflen;
+-  const HEADER *hp;
+-  const u_char *end_of_message, *cp;
+-  int n, ancount, qdcount;
+-  int haveanswer, had_error;
+-  char *bp, **ap, **hap;
+-  char tbuf[MAXDNAME];
+-  const char *tname;
+-  u_char packtmp[NS_MAXCDNAME];
+-  uintptr_t pad = -(uintptr_t) buffer % __alignof__ (struct host_data);
+-  buffer += pad;
+-  buflen = buflen > pad ? buflen - pad : 0;
+-  if (__glibc_unlikely (buflen < sizeof (struct host_data)))
+-    {
+-      /* The buffer is too small.  */
+-    too_small:
+-      *errnop = ERANGE;
+-      *h_errnop = NETDB_INTERNAL;
+-      return NSS_STATUS_TRYAGAIN;
+-    }
+-  host_data = (struct host_data *) buffer;
+-  linebuflen = buflen - sizeof (struct host_data);
+-  if (buflen - sizeof (struct host_data) != linebuflen)
+-    linebuflen = INT_MAX;
+-
+-  tname = qname;
+-  result->h_name = NULL;
+-  end_of_message = answer->buf + anslen;
+-
+-  /*
+-   * find first satisfactory answer
+-   */
+-  hp = &answer->hdr;
+-  ancount = ntohs (hp->ancount);
+-  qdcount = ntohs (hp->qdcount);
+-  cp = answer->buf + HFIXEDSZ;
+-  if (__glibc_unlikely (qdcount != 1))
+-    {
+-      *h_errnop = NO_RECOVERY;
+-      return NSS_STATUS_UNAVAIL;
+-    }
+-  if (sizeof (struct host_data) + (ancount + 1) * sizeof (char *) >= buflen)
+-    goto too_small;
+-  bp = (char *) &host_data->h_addr_ptrs[ancount + 1];
+-  linebuflen -= (ancount + 1) * sizeof (char *);
+-
+-  n = __ns_name_unpack (answer->buf, end_of_message, cp,
+-			packtmp, sizeof packtmp);
+-  if (n != -1 && __ns_name_ntop (packtmp, bp, linebuflen) == -1)
++  struct ns_rr_cursor c;
++  if (!__ns_rr_cursor_init (&c, packet, packetlen))
+     {
+-      if (__glibc_unlikely (errno == EMSGSIZE))
+-	goto too_small;
+-
+-      n = -1;
+-    }
+-
+-  if (__glibc_unlikely (n < 0))
+-    {
+-      *errnop = errno;
+-      *h_errnop = NO_RECOVERY;
+-      return NSS_STATUS_UNAVAIL;
+-    }
+-  if (__glibc_unlikely (__libc_res_dnok (bp) == 0))
+-    {
+-      errno = EBADMSG;
+-      *errnop = EBADMSG;
++      /* This should not happen because __res_context_query already
++	 perfroms response validation.  */
+       *h_errnop = NO_RECOVERY;
+       return NSS_STATUS_UNAVAIL;
+     }
+-  cp += n + QFIXEDSZ;
++  int ancount = ns_rr_cursor_ancount (&c);
++  const unsigned char *expected_name = ns_rr_cursor_qname (&c);
++  /* expected_name may be updated to point into this buffer.  */
++  unsigned char name_buffer[NS_MAXCDNAME];
+ 
+-  ap = host_data->aliases;
+-  *ap = NULL;
+-  result->h_aliases = host_data->aliases;
+-  hap = host_data->h_addr_ptrs;
+-  *hap = NULL;
+-  result->h_addr_list = host_data->h_addr_ptrs;
+-  haveanswer = 0;
+-  had_error = 0;
+-
+-  while (ancount-- > 0 && cp < end_of_message && had_error == 0)
++  while (ancount > 0)
+     {
+-      int type, class;
+-
+-      n = __ns_name_unpack (answer->buf, end_of_message, cp,
+-			    packtmp, sizeof packtmp);
+-      if (n != -1 && __ns_name_ntop (packtmp, bp, linebuflen) == -1)
++      struct ns_rr_wire rr;
++      if (!__ns_rr_cursor_next (&c, &rr))
+ 	{
+-	  if (__glibc_unlikely (errno == EMSGSIZE))
+-	    goto too_small;
+-
+-	  n = -1;
+-	}
+-
+-      if (__glibc_unlikely (n < 0 || __libc_res_dnok (bp) == 0))
+-	{
+-	  ++had_error;
+-	  continue;
+-	}
+-      cp += n;				/* name */
+-
+-      if (__glibc_unlikely (cp + 10 > end_of_message))
+-	{
+-	  ++had_error;
+-	  continue;
++	  *h_errnop = NO_RECOVERY;
++	  return NSS_STATUS_UNAVAIL;
+ 	}
+ 
+-      NS_GET16 (type, cp);
+-      NS_GET16 (class, cp);
+-      int32_t ttl;
+-      NS_GET32 (ttl, cp);
+-      NS_GET16 (n, cp);		/* RDATA length.  */
++      /* Skip over records with the wrong class.  */
++      if (rr.rclass != C_IN)
++	continue;
+ 
+-      if (end_of_message - cp < n)
+-	{
+-	  /* RDATA extends beyond the end of the packet.  */
+-	  ++had_error;
+-	  continue;
+-	}
+-
+-      if (__glibc_unlikely (class != C_IN))
+-	{
+-	  /* XXX - debug? syslog? */
+-	  cp += n;
+-	  continue;			/* XXX - had_error++ ? */
+-	}
++      /* Update TTL for known record types.  */
++      if ((rr.rtype == T_CNAME || rr.rtype == T_PTR)
++	  && ttlp != NULL && *ttlp > rr.ttl)
++	*ttlp = rr.ttl;
+ 
+-      if (type == T_CNAME)
++      if (rr.rtype == T_CNAME)
+ 	{
+-	  /* A CNAME could also have a TTL entry.  */
+-	  if (ttlp != NULL && ttl < *ttlp)
+-	      *ttlp = ttl;
+-
+-	  n = __libc_dn_expand (answer->buf, end_of_message, cp,
+-				tbuf, sizeof tbuf);
+-	  if (__glibc_unlikely (n < 0 || __libc_res_dnok (tbuf) == 0))
+-	    {
+-	      ++had_error;
+-	      continue;
+-	    }
+-	  cp += n;
+-	  /* Get canonical name.  */
+-	  n = strlen (tbuf) + 1;   /* For the \0.  */
+-	  if (__glibc_unlikely (n > linebuflen))
+-	    goto too_small;
+-	  if (__glibc_unlikely (n >= MAXHOSTNAMELEN))
++	  /* NB: No check for owner name match, based on historic
++	     precedent.  Record the CNAME target as the new expected
++	     name.  */
++	  int n = __ns_name_unpack (c.begin, c.end, rr.rdata,
++				    name_buffer, sizeof (name_buffer));
++	  if (n < 0)
+ 	    {
+-	      ++had_error;
+-	      continue;
++	      *h_errnop = NO_RECOVERY;
++	      return NSS_STATUS_UNAVAIL;
+ 	    }
+-	  tname = bp;
+-	  bp = __mempcpy (bp, tbuf, n);	/* Cannot overflow.  */
+-	  linebuflen -= n;
+-	  continue;
++	  expected_name = name_buffer;
+ 	}
+-
+-      switch (type)
++      else if (rr.rtype == T_PTR
++	       && __ns_samebinaryname (rr.rname, expected_name))
+ 	{
+-	case T_PTR:
+-	  if (__glibc_unlikely (__strcasecmp (tname, bp) != 0))
+-	    {
+-	      cp += n;
+-	      continue;			/* XXX - had_error++ ? */
+-	    }
+-
+-	  n = __ns_name_unpack (answer->buf, end_of_message, cp,
+-				packtmp, sizeof packtmp);
+-	  if (n != -1 && __ns_name_ntop (packtmp, bp, linebuflen) == -1)
+-	    {
+-	      if (__glibc_unlikely (errno == EMSGSIZE))
+-		goto too_small;
+-
+-	      n = -1;
+-	    }
+-
+-	  if (__glibc_unlikely (n < 0 || __libc_res_hnok (bp) == 0))
++	  /* Decompress the target of the PTR record.  This is the
++	     host name we are looking for.  We can only use it if it
++	     is syntactically valid.  Historically, only one host name
++	     is returned here.  If the recursive resolver performs DNS
++	     record rotation, the returned host name is essentially
++	     random, which is why multiple PTR records are rarely
++	     used.  Use MAXHOSTNAMELEN instead of NS_MAXCDNAME for
++	     additional length checking.  */
++	  char hname[MAXHOSTNAMELEN + 1];
++	  if (__ns_name_unpack (c.begin, c.end, rr.rdata,
++				name_buffer, sizeof (name_buffer)) < 0
++	      || !__res_binary_hnok (expected_name)
++	      || __ns_name_ntop (name_buffer, hname, sizeof (hname)) < 0)
+ 	    {
+-	      ++had_error;
+-	      break;
++	      *h_errnop = NO_RECOVERY;
++	      return NSS_STATUS_UNAVAIL;
+ 	    }
+-	  if (ttlp != NULL && ttl < *ttlp)
+-	      *ttlp = ttl;
+-	  /* bind would put multiple PTR records as aliases, but we don't do
+-	     that.  */
+-	  result->h_name = bp;
+-	  *h_errnop = NETDB_SUCCESS;
++	  /* Successful allocation is checked by the caller.  */
++	  *hnamep = alloc_buffer_copy_string (abuf, hname);
+ 	  return NSS_STATUS_SUCCESS;
+-	case T_A:
+-	case T_AAAA:
+-	  if (__glibc_unlikely (__strcasecmp (result->h_name, bp) != 0))
+-	    {
+-	      cp += n;
+-	      continue;			/* XXX - had_error++ ? */
+-	    }
+-
+-	  /* Stop parsing at a record whose length is incorrect.  */
+-	  if (n != rrtype_to_rdata_length (type))
+-	    {
+-	      ++had_error;
+-	      break;
+-	    }
+-
+-	  /* Skip records of the wrong type.  */
+-	  if (n != result->h_length)
+-	    {
+-	      cp += n;
+-	      continue;
+-	    }
+-	  if (!haveanswer)
+-	    {
+-	      int nn;
+-
+-	      /* We compose a single hostent out of the entire chain of
+-	         entries, so the TTL of the hostent is essentially the lowest
+-		 TTL in the chain.  */
+-	      if (ttlp != NULL && ttl < *ttlp)
+-		*ttlp = ttl;
+-	      result->h_name = bp;
+-	      nn = strlen (bp) + 1;	/* for the \0 */
+-	      bp += nn;
+-	      linebuflen -= nn;
+-	    }
+-
+-	  /* Provide sufficient alignment for both address
+-	     families.  */
+-	  enum { align = 4 };
+-	  _Static_assert ((align % __alignof__ (struct in_addr)) == 0,
+-			  "struct in_addr alignment");
+-	  _Static_assert ((align % __alignof__ (struct in6_addr)) == 0,
+-			  "struct in6_addr alignment");
+-	  {
+-	    char *new_bp = PTR_ALIGN_UP (bp, align);
+-	    linebuflen -= new_bp - bp;
+-	    bp = new_bp;
+-	  }
+-
+-	  if (__glibc_unlikely (n > linebuflen))
+-	    goto too_small;
+-	  bp = __mempcpy (*hap++ = bp, cp, n);
+-	  cp += n;
+-	  linebuflen -= n;
+-	  break;
+-	default:
+-	  cp += n;
+-	  continue;			/* XXX - had_error++ ? */
+ 	}
+-      if (had_error == 0)
+-	++haveanswer;
+     }
+ 
+-  if (haveanswer > 0)
+-    {
+-      *ap = NULL;
+-      *hap = NULL;
+-
+-      if (result->h_name == NULL)
+-	{
+-	  n = strlen (qname) + 1;	/* For the \0.  */
+-	  if (n > linebuflen)
+-	    goto too_small;
+-	  if (n >= MAXHOSTNAMELEN)
+-	    goto no_recovery;
+-	  result->h_name = bp;
+-	  bp = __mempcpy (bp, qname, n);	/* Cannot overflow.  */
+-	  linebuflen -= n;
+-	}
++  /* No PTR record found.  */
++  if (ttlp != NULL)
++    /* No caching of negative responses.  */
++    *ttlp = 0;
+ 
+-      *h_errnop = NETDB_SUCCESS;
+-      return NSS_STATUS_SUCCESS;
+-    }
+- no_recovery:
+   *h_errnop = NO_RECOVERY;
+   *errnop = ENOENT;
+   return NSS_STATUS_TRYAGAIN;
+-- 
+2.38.1
+
+
+From 5165080fec63a1f03aa1985b77bca300465bf570 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 30 Aug 2022 10:02:49 +0200
+Subject: nss_dns: Remove remnants of IPv6 address mapping
+
+res_use_inet6 always returns false since commit 3f8b44be0a658266adff5
+("resolv: Remove support for RES_USE_INET6 and the inet6 option").
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit a7fc30b522a0cd7c8c5e7e285b9531b704e02f04)
+---
+ resolv/README             |  3 --
+ resolv/mapv4v6addr.h      | 69 --------------------------------
+ resolv/mapv4v6hostent.h   | 84 ---------------------------------------
+ resolv/nss_dns/dns-host.c | 54 +++++--------------------
+ 4 files changed, 9 insertions(+), 201 deletions(-)
+ delete mode 100644 resolv/mapv4v6addr.h
+ delete mode 100644 resolv/mapv4v6hostent.h
+
+diff --git a/resolv/README b/resolv/README
+index 514e9bb617..2146bc3b27 100644
+--- a/resolv/README
++++ b/resolv/README
+@@ -146,6 +146,3 @@ res_libc.c is home-brewn, although parts of it are taken from res_data.c.
+ 
+ res_hconf.c and res_hconf.h were contributed by David Mosberger, and
+ do not come from BIND.
+-
+-The files gethnamaddr.c, mapv4v6addr.h and mapv4v6hostent.h are
+-leftovers from BIND 4.9.7.
+diff --git a/resolv/mapv4v6addr.h b/resolv/mapv4v6addr.h
+deleted file mode 100644
+index 7f85f7d5e3..0000000000
+--- a/resolv/mapv4v6addr.h
++++ /dev/null
+@@ -1,69 +0,0 @@
+-/*
+- * ++Copyright++ 1985, 1988, 1993
+- * -
+- * Copyright (c) 1985, 1988, 1993
+- *    The Regents of the University of California.  All rights reserved.
+- *
+- * Redistribution and use in source and binary forms, with or without
+- * modification, are permitted provided that the following conditions
+- * are met:
+- * 1. Redistributions of source code must retain the above copyright
+- *    notice, this list of conditions and the following disclaimer.
+- * 2. Redistributions in binary form must reproduce the above copyright
+- *    notice, this list of conditions and the following disclaimer in the
+- *    documentation and/or other materials provided with the distribution.
+- * 4. Neither the name of the University nor the names of its contributors
+- *    may be used to endorse or promote products derived from this software
+- *    without specific prior written permission.
+- *
+- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+- * SUCH DAMAGE.
+- * -
+- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
+- *
+- * Permission to use, copy, modify, and distribute this software for any
+- * purpose with or without fee is hereby granted, provided that the above
+- * copyright notice and this permission notice appear in all copies, and that
+- * the name of Digital Equipment Corporation not be used in advertising or
+- * publicity pertaining to distribution of the document or software without
+- * specific, written prior permission.
+- *
+- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
+- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
+- * OF MERCHANTABILITY AND FITNESS.   IN NO EVENT SHALL DIGITAL EQUIPMENT
+- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+- * SOFTWARE.
+- * -
+- * --Copyright--
+- */
+-
+-#include <string.h>
+-#include <arpa/nameser.h>
+-
+-static void
+-map_v4v6_address (const char *src, char *dst)
+-{
+-  u_char *p = (u_char *) dst;
+-  int i;
+-
+-  /* Move the IPv4 part to the right position.  */
+-  memcpy (dst + 12, src, INADDRSZ);
+-
+-  /* Mark this ipv6 addr as a mapped ipv4. */
+-  for (i = 0; i < 10; i++)
+-    *p++ = 0x00;
+-  *p++ = 0xff;
+-  *p = 0xff;
+-}
+diff --git a/resolv/mapv4v6hostent.h b/resolv/mapv4v6hostent.h
+deleted file mode 100644
+index c11038adf3..0000000000
+--- a/resolv/mapv4v6hostent.h
++++ /dev/null
+@@ -1,84 +0,0 @@
+-/*
+- * ++Copyright++ 1985, 1988, 1993
+- * -
+- * Copyright (c) 1985, 1988, 1993
+- *    The Regents of the University of California.  All rights reserved.
+- *
+- * Redistribution and use in source and binary forms, with or without
+- * modification, are permitted provided that the following conditions
+- * are met:
+- * 1. Redistributions of source code must retain the above copyright
+- *    notice, this list of conditions and the following disclaimer.
+- * 2. Redistributions in binary form must reproduce the above copyright
+- *    notice, this list of conditions and the following disclaimer in the
+- *    documentation and/or other materials provided with the distribution.
+- * 4. Neither the name of the University nor the names of its contributors
+- *    may be used to endorse or promote products derived from this software
+- *    without specific prior written permission.
+- *
+- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+- * SUCH DAMAGE.
+- * -
+- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
+- *
+- * Permission to use, copy, modify, and distribute this software for any
+- * purpose with or without fee is hereby granted, provided that the above
+- * copyright notice and this permission notice appear in all copies, and that
+- * the name of Digital Equipment Corporation not be used in advertising or
+- * publicity pertaining to distribution of the document or software without
+- * specific, written prior permission.
+- *
+- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
+- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
+- * OF MERCHANTABILITY AND FITNESS.   IN NO EVENT SHALL DIGITAL EQUIPMENT
+- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+- * SOFTWARE.
+- * -
+- * --Copyright--
+- */
+-
+-#include <arpa/nameser.h>
+-#include <sys/socket.h>
+-
+-typedef union {
+-    int32_t al;
+-    char ac;
+-} align;
+-
+-static int
+-map_v4v6_hostent (struct hostent *hp, char **bpp, int *lenp)
+-{
+-  char **ap;
+-
+-  if (hp->h_addrtype != AF_INET || hp->h_length != INADDRSZ)
+-    return 0;
+-  hp->h_addrtype = AF_INET6;
+-  hp->h_length = IN6ADDRSZ;
+-  for (ap = hp->h_addr_list; *ap; ap++)
+-    {
+-      int i = sizeof (align) - ((u_long) *bpp % sizeof (align));
+-
+-      if (*lenp < (i + IN6ADDRSZ))
+-	/* Out of memory.  */
+-	return 1;
+-      *bpp += i;
+-      *lenp -= i;
+-      map_v4v6_address (*ap, *bpp);
+-      *ap = *bpp;
+-      *bpp += IN6ADDRSZ;
+-      *lenp -= IN6ADDRSZ;
+-    }
+-  return 0;
+-}
+diff --git a/resolv/nss_dns/dns-host.c b/resolv/nss_dns/dns-host.c
+index cd26399b7e..8e38583e15 100644
+--- a/resolv/nss_dns/dns-host.c
++++ b/resolv/nss_dns/dns-host.c
+@@ -87,10 +87,6 @@
+ #include <resolv/resolv-internal.h>
+ #include <resolv/resolv_context.h>
+ 
+-/* Get implementations of some internal functions.  */
+-#include <resolv/mapv4v6addr.h>
+-#include <resolv/mapv4v6hostent.h>
+-
+ #define RESOLVSORT
+ 
+ #if PACKETSZ > 65536
+@@ -116,7 +112,7 @@ static enum nss_status getanswer_r (struct resolv_context *ctx,
+ 				    const char *qname, int qtype,
+ 				    struct hostent *result, char *buffer,
+ 				    size_t buflen, int *errnop, int *h_errnop,
+-				    int map, int32_t *ttlp, char **canonp);
++				    int32_t *ttlp, char **canonp);
+ static enum nss_status getanswer_ptr (unsigned char *packet, size_t packetlen,
+ 				      struct alloc_buffer *abuf,
+ 				      char **hnamep, int *errnop,
+@@ -197,7 +193,6 @@ gethostbyname3_context (struct resolv_context *ctx,
+   char tmp[NS_MAXDNAME];
+   int size, type, n;
+   const char *cp;
+-  int map = 0;
+   int olderr = errno;
+   enum nss_status status;
+ 
+@@ -258,32 +253,12 @@ gethostbyname3_context (struct resolv_context *ctx,
+ 	*errnop = EAGAIN;
+       else
+ 	__set_errno (olderr);
+-
+-      /* If we are looking for an IPv6 address and mapping is enabled
+-	 by having the RES_USE_INET6 bit in _res.options set, we try
+-	 another lookup.  */
+-      if (af == AF_INET6 && res_use_inet6 ())
+-	n = __res_context_search (ctx, name, C_IN, T_A, host_buffer.buf->buf,
+-				  host_buffer.buf != orig_host_buffer
+-				  ? MAXPACKET : 1024, &host_buffer.ptr,
+-				  NULL, NULL, NULL, NULL);
+-
+-      if (n < 0)
+-	{
+-	  if (host_buffer.buf != orig_host_buffer)
+-	    free (host_buffer.buf);
+-	  return status;
+-	}
+-
+-      map = 1;
+-
+-      result->h_addrtype = AF_INET;
+-      result->h_length = INADDRSZ;
+     }
++  else
++    status = getanswer_r
++      (ctx, host_buffer.buf, n, name, type, result, buffer, buflen,
++       errnop, h_errnop, ttlp, canonp);
+ 
+-  status = getanswer_r
+-    (ctx, host_buffer.buf, n, name, type, result, buffer, buflen,
+-     errnop, h_errnop, map, ttlp, canonp);
+   if (host_buffer.buf != orig_host_buffer)
+     free (host_buffer.buf);
+   return status;
+@@ -329,13 +304,8 @@ _nss_dns_gethostbyname_r (const char *name, struct hostent *result,
+       *h_errnop = NETDB_INTERNAL;
+       return NSS_STATUS_UNAVAIL;
+     }
+-  status = NSS_STATUS_NOTFOUND;
+-  if (res_use_inet6 ())
+-    status = gethostbyname3_context (ctx, name, AF_INET6, result, buffer,
+-				     buflen, errnop, h_errnop, NULL, NULL);
+-  if (status == NSS_STATUS_NOTFOUND)
+-    status = gethostbyname3_context (ctx, name, AF_INET, result, buffer,
+-				     buflen, errnop, h_errnop, NULL, NULL);
++  status = gethostbyname3_context (ctx, name, AF_INET, result, buffer,
++				   buflen, errnop, h_errnop, NULL, NULL);
+   __resolv_context_put (ctx);
+   return status;
+ }
+@@ -648,7 +618,7 @@ static enum nss_status
+ getanswer_r (struct resolv_context *ctx,
+ 	     const querybuf *answer, int anslen, const char *qname, int qtype,
+ 	     struct hostent *result, char *buffer, size_t buflen,
+-	     int *errnop, int *h_errnop, int map, int32_t *ttlp, char **canonp)
++	     int *errnop, int *h_errnop, int32_t *ttlp, char **canonp)
+ {
+   struct host_data
+   {
+@@ -664,7 +634,6 @@ getanswer_r (struct resolv_context *ctx,
+   char *bp, **ap, **hap;
+   char tbuf[MAXDNAME];
+   u_char packtmp[NS_MAXCDNAME];
+-  int have_to_map = 0;
+   uintptr_t pad = -(uintptr_t) buffer % __alignof__ (struct host_data);
+   buffer += pad;
+   buflen = buflen > pad ? buflen - pad : 0;
+@@ -845,9 +814,7 @@ getanswer_r (struct resolv_context *ctx,
+ 	  continue;
+ 	}
+ 
+-      if (type == T_A && qtype == T_AAAA && map)
+-	have_to_map = 1;
+-      else if (__glibc_unlikely (type != qtype))
++      if (__glibc_unlikely (type != qtype))
+ 	{
+ 	  cp += n;
+ 	  continue;			/* XXX - had_error++ ? */
+@@ -944,9 +911,6 @@ getanswer_r (struct resolv_context *ctx,
+ 	  linebuflen -= n;
+ 	}
+ 
+-      if (have_to_map)
+-	if (map_v4v6_hostent (result, &bp, &linebuflen))
+-	  goto too_small;
+       *h_errnop = NETDB_SUCCESS;
+       return NSS_STATUS_SUCCESS;
+     }
+-- 
+2.38.1
+
+
+From 78c8ef21fa54e994451d5b42ead6080d99a88a49 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 30 Aug 2022 10:02:49 +0200
+Subject: nss_dns: Rewrite getanswer_r to match getanswer_ptr (bug 12154, bug
+ 29305)
+
+Allocate the pointer arrays only at the end, when their sizes
+are known.  This addresses bug 29305.
+
+Skip over invalid names instead of failing lookups.  This partially
+fixes bug 12154 (for gethostbyname, fixing getaddrinfo requires
+different changes).
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit d101d836e7e4bd1d4e4972b0e0bd0a55c9b650fa)
+---
+ resolv/nss_dns/dns-host.c | 478 ++++++++++++++------------------------
+ 1 file changed, 180 insertions(+), 298 deletions(-)
+
+diff --git a/resolv/nss_dns/dns-host.c b/resolv/nss_dns/dns-host.c
+index 8e38583e15..b887e77e9c 100644
+--- a/resolv/nss_dns/dns-host.c
++++ b/resolv/nss_dns/dns-host.c
+@@ -107,12 +107,19 @@ typedef union querybuf
+   u_char buf[MAXPACKET];
+ } querybuf;
+ 
+-static enum nss_status getanswer_r (struct resolv_context *ctx,
+-				    const querybuf *answer, int anslen,
+-				    const char *qname, int qtype,
+-				    struct hostent *result, char *buffer,
+-				    size_t buflen, int *errnop, int *h_errnop,
+-				    int32_t *ttlp, char **canonp);
++/* For historic reasons, pointers to IP addresses are char *, so use a
++   single list type for addresses and host names.  */
++#define DYNARRAY_STRUCT ptrlist
++#define DYNARRAY_ELEMENT char *
++#define DYNARRAY_PREFIX ptrlist_
++#include <malloc/dynarray-skeleton.c>
++
++static enum nss_status getanswer_r (unsigned char *packet, size_t packetlen,
++				    uint16_t qtype, struct alloc_buffer *abuf,
++				    struct ptrlist *addresses,
++				    struct ptrlist *aliases,
++				    int *errnop, int *h_errnop, int32_t *ttlp);
++static void addrsort (struct resolv_context *ctx, char **ap, int num);
+ static enum nss_status getanswer_ptr (unsigned char *packet, size_t packetlen,
+ 				      struct alloc_buffer *abuf,
+ 				      char **hnamep, int *errnop,
+@@ -184,12 +191,6 @@ gethostbyname3_context (struct resolv_context *ctx,
+ 			char *buffer, size_t buflen, int *errnop,
+ 			int *h_errnop, int32_t *ttlp, char **canonp)
+ {
+-  union
+-  {
+-    querybuf *buf;
+-    u_char *ptr;
+-  } host_buffer;
+-  querybuf *orig_host_buffer;
+   char tmp[NS_MAXDNAME];
+   int size, type, n;
+   const char *cp;
+@@ -223,10 +224,12 @@ gethostbyname3_context (struct resolv_context *ctx,
+       && (cp = __res_context_hostalias (ctx, name, tmp, sizeof (tmp))) != NULL)
+     name = cp;
+ 
+-  host_buffer.buf = orig_host_buffer = (querybuf *) alloca (1024);
++  unsigned char dns_packet_buffer[1024];
++  unsigned char *alt_dns_packet_buffer = dns_packet_buffer;
+ 
+-  n = __res_context_search (ctx, name, C_IN, type, host_buffer.buf->buf,
+-			    1024, &host_buffer.ptr, NULL, NULL, NULL, NULL);
++  n = __res_context_search (ctx, name, C_IN, type,
++			    dns_packet_buffer, sizeof (dns_packet_buffer),
++			    &alt_dns_packet_buffer, NULL, NULL, NULL, NULL);
+   if (n < 0)
+     {
+       switch (errno)
+@@ -255,12 +258,77 @@ gethostbyname3_context (struct resolv_context *ctx,
+ 	__set_errno (olderr);
+     }
+   else
+-    status = getanswer_r
+-      (ctx, host_buffer.buf, n, name, type, result, buffer, buflen,
+-       errnop, h_errnop, ttlp, canonp);
++    {
++      struct alloc_buffer abuf = alloc_buffer_create (buffer, buflen);
+ 
+-  if (host_buffer.buf != orig_host_buffer)
+-    free (host_buffer.buf);
++      struct ptrlist addresses;
++      ptrlist_init (&addresses);
++      struct ptrlist aliases;
++      ptrlist_init (&aliases);
++
++      status = getanswer_r (alt_dns_packet_buffer, n, type,
++			    &abuf, &addresses, &aliases,
++			    errnop, h_errnop, ttlp);
++      if (status == NSS_STATUS_SUCCESS)
++	{
++	  if (ptrlist_has_failed (&addresses)
++	      || ptrlist_has_failed (&aliases))
++	    {
++	      /* malloc failure.  Do not retry using the ERANGE protocol.  */
++	      *errnop = ENOMEM;
++	      *h_errnop = NETDB_INTERNAL;
++	      status = NSS_STATUS_UNAVAIL;
++	    }
++
++	  /* Reserve the address and alias arrays in the result
++	     buffer.  Both are NULL-terminated, but the first element
++	     of the alias array is stored in h_name, so no extra space
++	     for the NULL terminator is needed there.  */
++	  result->h_addr_list
++	    = alloc_buffer_alloc_array (&abuf, char *,
++					ptrlist_size (&addresses) + 1);
++	  result->h_aliases
++	    = alloc_buffer_alloc_array (&abuf, char *,
++					ptrlist_size (&aliases));
++	  if (alloc_buffer_has_failed (&abuf))
++	    {
++	      /* Retry using the ERANGE protocol.  */
++	      *errnop = ERANGE;
++	      *h_errnop = NETDB_INTERNAL;
++	      status = NSS_STATUS_TRYAGAIN;
++	    }
++	  else
++	    {
++	      /* Copy the address list and NULL-terminate it.  */
++	      memcpy (result->h_addr_list, ptrlist_begin (&addresses),
++		      ptrlist_size (&addresses) * sizeof (char *));
++	      result->h_addr_list[ptrlist_size (&addresses)] = NULL;
++
++	      /* Sort the address list if requested.  */
++	      if (type == T_A && __resolv_context_sort_count (ctx) > 0)
++		addrsort (ctx, result->h_addr_list, ptrlist_size (&addresses));
++
++	      /* Copy the aliases,  excluding the last one. */
++	      memcpy (result->h_aliases, ptrlist_begin (&aliases),
++		      (ptrlist_size (&aliases) - 1) * sizeof (char *));
++	      result->h_aliases[ptrlist_size (&aliases) - 1] = NULL;
++
++	      /* The last alias goes into h_name.  */
++	      assert (ptrlist_size (&aliases) >= 1);
++	      result->h_name = ptrlist_end (&aliases)[-1];
++
++	      /* This is also the canonical name.  */
++	      if (canonp != NULL)
++		*canonp = result->h_name;
++	    }
++	}
++
++      ptrlist_free (&aliases);
++      ptrlist_free (&addresses);
++    }
++
++  if (alt_dns_packet_buffer != dns_packet_buffer)
++    free (alt_dns_packet_buffer);
+   return status;
+ }
+ 
+@@ -614,314 +682,128 @@ addrsort (struct resolv_context *ctx, char **ap, int num)
+ 	break;
+ }
+ 
+-static enum nss_status
+-getanswer_r (struct resolv_context *ctx,
+-	     const querybuf *answer, int anslen, const char *qname, int qtype,
+-	     struct hostent *result, char *buffer, size_t buflen,
+-	     int *errnop, int *h_errnop, int32_t *ttlp, char **canonp)
++/* Convert the uncompressed, binary domain name CDNAME into its
++   textual representation and add it to the end of ALIASES, allocating
++   space for a copy of the name from ABUF.  Skip adding the name if it
++   is not a valid host name, and return false in that case, otherwise
++   true.  */
++static bool
++getanswer_r_store_alias (const unsigned char *cdname,
++			 struct alloc_buffer *abuf,
++			 struct ptrlist *aliases)
+ {
+-  struct host_data
+-  {
+-    char *aliases[MAX_NR_ALIASES];
+-    unsigned char host_addr[16];	/* IPv4 or IPv6 */
+-    char *h_addr_ptrs[0];
+-  } *host_data;
+-  int linebuflen;
+-  const HEADER *hp;
+-  const u_char *end_of_message, *cp;
+-  int n, ancount, qdcount;
+-  int haveanswer, had_error;
+-  char *bp, **ap, **hap;
+-  char tbuf[MAXDNAME];
+-  u_char packtmp[NS_MAXCDNAME];
+-  uintptr_t pad = -(uintptr_t) buffer % __alignof__ (struct host_data);
+-  buffer += pad;
+-  buflen = buflen > pad ? buflen - pad : 0;
+-  if (__glibc_unlikely (buflen < sizeof (struct host_data)))
+-    {
+-      /* The buffer is too small.  */
+-    too_small:
+-      *errnop = ERANGE;
+-      *h_errnop = NETDB_INTERNAL;
+-      return NSS_STATUS_TRYAGAIN;
+-    }
+-  host_data = (struct host_data *) buffer;
+-  linebuflen = buflen - sizeof (struct host_data);
+-  if (buflen - sizeof (struct host_data) != linebuflen)
+-    linebuflen = INT_MAX;
+-
+-  result->h_name = NULL;
+-  end_of_message = answer->buf + anslen;
+-
+-  /*
+-   * find first satisfactory answer
+-   */
+-  hp = &answer->hdr;
+-  ancount = ntohs (hp->ancount);
+-  qdcount = ntohs (hp->qdcount);
+-  cp = answer->buf + HFIXEDSZ;
+-  if (__glibc_unlikely (qdcount != 1))
+-    {
+-      *h_errnop = NO_RECOVERY;
+-      return NSS_STATUS_UNAVAIL;
+-    }
+-  if (sizeof (struct host_data) + (ancount + 1) * sizeof (char *) >= buflen)
+-    goto too_small;
+-  bp = (char *) &host_data->h_addr_ptrs[ancount + 1];
+-  linebuflen -= (ancount + 1) * sizeof (char *);
+-
+-  n = __ns_name_unpack (answer->buf, end_of_message, cp,
+-			packtmp, sizeof packtmp);
+-  if (n != -1 && __ns_name_ntop (packtmp, bp, linebuflen) == -1)
+-    {
+-      if (__glibc_unlikely (errno == EMSGSIZE))
+-	goto too_small;
+-
+-      n = -1;
+-    }
++  /* Filter out domain names that are not host names.  */
++  if (!__res_binary_hnok (cdname))
++    return false;
++
++  /* Note: Not NS_MAXCDNAME, so that __ns_name_ntop implicitly checks
++     for length.  */
++  char dname[MAXHOSTNAMELEN + 1];
++  if (__ns_name_ntop (cdname, dname, sizeof (dname)) < 0)
++    return false;
++  /* Do not report an error on allocation failure, instead store NULL
++     or do nothing.  getanswer_r's caller will see NSS_STATUS_SUCCESS
++     and detect the memory allocation failure or buffer space
++     exhaustion, and report it accordingly.  */
++  ptrlist_add (aliases, alloc_buffer_copy_string (abuf, dname));
++  return true;
++}
+ 
+-  if (__glibc_unlikely (n < 0))
+-    {
+-      *errnop = errno;
+-      *h_errnop = NO_RECOVERY;
+-      return NSS_STATUS_UNAVAIL;
+-    }
+-  if (__glibc_unlikely (__libc_res_hnok (bp) == 0))
++static enum nss_status __attribute__ ((noinline))
++getanswer_r (unsigned char *packet, size_t packetlen, uint16_t qtype,
++	     struct alloc_buffer *abuf,
++	     struct ptrlist *addresses, struct ptrlist *aliases,
++	     int *errnop, int *h_errnop, int32_t *ttlp)
++{
++  struct ns_rr_cursor c;
++  if (!__ns_rr_cursor_init (&c, packet, packetlen))
+     {
+-      errno = EBADMSG;
+-      *errnop = EBADMSG;
++      /* This should not happen because __res_context_query already
++	 perfroms response validation.  */
+       *h_errnop = NO_RECOVERY;
+       return NSS_STATUS_UNAVAIL;
+     }
+-  cp += n + QFIXEDSZ;
+ 
+-  if (qtype == T_A || qtype == T_AAAA)
++  /* Treat the QNAME just like an alias.  Error out if it is not a
++     valid host name.  */
++  if (ns_rr_cursor_rcode (&c) == NXDOMAIN
++      || !getanswer_r_store_alias (ns_rr_cursor_qname (&c), abuf, aliases))
+     {
+-      /* res_send() has already verified that the query name is the
+-       * same as the one we sent; this just gets the expanded name
+-       * (i.e., with the succeeding search-domain tacked on).
+-       */
+-      n = strlen (bp) + 1;             /* for the \0 */
+-      if (n >= MAXHOSTNAMELEN)
+-	{
+-	  *h_errnop = NO_RECOVERY;
+-	  *errnop = ENOENT;
+-	  return NSS_STATUS_TRYAGAIN;
+-	}
+-      result->h_name = bp;
+-      bp += n;
+-      linebuflen -= n;
+-      if (linebuflen < 0)
+-	goto too_small;
+-      /* The qname can be abbreviated, but h_name is now absolute. */
+-      qname = result->h_name;
++      if (ttlp != NULL)
++	/* No negative caching.  */
++	*ttlp = 0;
++      *h_errnop = HOST_NOT_FOUND;
++      *errnop = ENOENT;
++      return NSS_STATUS_NOTFOUND;
+     }
+ 
+-  ap = host_data->aliases;
+-  *ap = NULL;
+-  result->h_aliases = host_data->aliases;
+-  hap = host_data->h_addr_ptrs;
+-  *hap = NULL;
+-  result->h_addr_list = host_data->h_addr_ptrs;
+-  haveanswer = 0;
+-  had_error = 0;
++  int ancount = ns_rr_cursor_ancount (&c);
++  const unsigned char *expected_name = ns_rr_cursor_qname (&c);
++  /* expected_name may be updated to point into this buffer.  */
++  unsigned char name_buffer[NS_MAXCDNAME];
+ 
+-  while (ancount-- > 0 && cp < end_of_message && had_error == 0)
++  for (; ancount > 0; --ancount)
+     {
+-      int type, class;
+-
+-      n = __ns_name_unpack (answer->buf, end_of_message, cp,
+-			    packtmp, sizeof packtmp);
+-      if (n != -1 && __ns_name_ntop (packtmp, bp, linebuflen) == -1)
+-	{
+-	  if (__glibc_unlikely (errno == EMSGSIZE))
+-	    goto too_small;
+-
+-	  n = -1;
+-	}
+-
+-      if (__glibc_unlikely (n < 0 || __libc_res_hnok (bp) == 0))
+-	{
+-	  ++had_error;
+-	  continue;
+-	}
+-      cp += n;				/* name */
+-
+-      if (__glibc_unlikely (cp + 10 > end_of_message))
++      struct ns_rr_wire rr;
++      if (!__ns_rr_cursor_next (&c, &rr))
+ 	{
+-	  ++had_error;
+-	  continue;
++	  *h_errnop = NO_RECOVERY;
++	  return NSS_STATUS_UNAVAIL;
+ 	}
+ 
+-      NS_GET16 (type, cp);
+-      NS_GET16 (class, cp);
+-      int32_t ttl;
+-      NS_GET32 (ttl, cp);
+-      NS_GET16 (n, cp);		/* RDATA length.  */
+-
+-      if (end_of_message - cp < n)
+-	{
+-	  /* RDATA extends beyond the end of the packet.  */
+-	  ++had_error;
+-	  continue;
+-	}
++      /* Skip over records with the wrong class.  */
++      if (rr.rclass != C_IN)
++	continue;
+ 
+-      if (__glibc_unlikely (class != C_IN))
+-	{
+-	  /* XXX - debug? syslog? */
+-	  cp += n;
+-	  continue;			/* XXX - had_error++ ? */
+-	}
++      /* Update TTL for recognized record types.  */
++      if ((rr.rtype == T_CNAME || rr.rtype == qtype)
++	  && ttlp != NULL && *ttlp > rr.ttl)
++	*ttlp = rr.ttl;
+ 
+-      if (type == T_CNAME)
++      if (rr.rtype == T_CNAME)
+ 	{
+-	  /* A CNAME could also have a TTL entry.  */
+-	  if (ttlp != NULL && ttl < *ttlp)
+-	      *ttlp = ttl;
+-
+-	  if (ap >= &host_data->aliases[MAX_NR_ALIASES - 1])
+-	    continue;
+-	  n = __libc_dn_expand (answer->buf, end_of_message, cp,
+-				tbuf, sizeof tbuf);
+-	  if (__glibc_unlikely (n < 0 || __libc_res_hnok (tbuf) == 0))
+-	    {
+-	      ++had_error;
+-	      continue;
+-	    }
+-	  cp += n;
+-	  /* Store alias.  */
+-	  *ap++ = bp;
+-	  n = strlen (bp) + 1;		/* For the \0.  */
+-	  if (__glibc_unlikely (n >= MAXHOSTNAMELEN))
+-	    {
+-	      ++had_error;
+-	      continue;
+-	    }
+-	  bp += n;
+-	  linebuflen -= n;
+-	  /* Get canonical name.  */
+-	  n = strlen (tbuf) + 1;	/* For the \0.  */
+-	  if (__glibc_unlikely (n > linebuflen))
+-	    goto too_small;
+-	  if (__glibc_unlikely (n >= MAXHOSTNAMELEN))
++	  /* NB: No check for owner name match, based on historic
++	     precedent.  Record the CNAME target as the new expected
++	     name.  */
++	  int n = __ns_name_unpack (c.begin, c.end, rr.rdata,
++				    name_buffer, sizeof (name_buffer));
++	  if (n < 0)
+ 	    {
+-	      ++had_error;
+-	      continue;
++	      *h_errnop = NO_RECOVERY;
++	      return NSS_STATUS_UNAVAIL;
+ 	    }
+-	  result->h_name = bp;
+-	  bp = __mempcpy (bp, tbuf, n);	/* Cannot overflow.  */
+-	  linebuflen -= n;
+-	  continue;
++	  /* And store the new name as an alias.  */
++	  getanswer_r_store_alias (name_buffer, abuf, aliases);
++	  expected_name = name_buffer;
+ 	}
+-
+-      if (__glibc_unlikely (type != qtype))
++      else if (rr.rtype == qtype
++	       && __ns_samebinaryname (rr.rname, expected_name)
++	       && rr.rdlength == rrtype_to_rdata_length (qtype))
+ 	{
+-	  cp += n;
+-	  continue;			/* XXX - had_error++ ? */
++	  /* Make a copy of the address and store it.  Increase the
++	     alignment to 4, in case there are applications out there
++	     that expect at least this level of address alignment.  */
++	  ptrlist_add (addresses, (char *) alloc_buffer_next (abuf, uint32_t));
++	  alloc_buffer_copy_bytes (abuf, rr.rdata, rr.rdlength);
+ 	}
+-
+-      switch (type)
+-	{
+-	case T_A:
+-	case T_AAAA:
+-	  if (__glibc_unlikely (__strcasecmp (result->h_name, bp) != 0))
+-	    {
+-	      cp += n;
+-	      continue;			/* XXX - had_error++ ? */
+-	    }
+-
+-	  /* Stop parsing at a record whose length is incorrect.  */
+-	  if (n != rrtype_to_rdata_length (type))
+-	    {
+-	      ++had_error;
+-	      break;
+-	    }
+-
+-	  /* Skip records of the wrong type.  */
+-	  if (n != result->h_length)
+-	    {
+-	      cp += n;
+-	      continue;
+-	    }
+-	  if (!haveanswer)
+-	    {
+-	      int nn;
+-
+-	      /* We compose a single hostent out of the entire chain of
+-	         entries, so the TTL of the hostent is essentially the lowest
+-		 TTL in the chain.  */
+-	      if (ttlp != NULL && ttl < *ttlp)
+-		*ttlp = ttl;
+-	      if (canonp != NULL)
+-		*canonp = bp;
+-	      result->h_name = bp;
+-	      nn = strlen (bp) + 1;	/* for the \0 */
+-	      bp += nn;
+-	      linebuflen -= nn;
+-	    }
+-
+-	  /* Provide sufficient alignment for both address
+-	     families.  */
+-	  enum { align = 4 };
+-	  _Static_assert ((align % __alignof__ (struct in_addr)) == 0,
+-			  "struct in_addr alignment");
+-	  _Static_assert ((align % __alignof__ (struct in6_addr)) == 0,
+-			  "struct in6_addr alignment");
+-	  {
+-	    char *new_bp = PTR_ALIGN_UP (bp, align);
+-	    linebuflen -= new_bp - bp;
+-	    bp = new_bp;
+-	  }
+-
+-	  if (__glibc_unlikely (n > linebuflen))
+-	    goto too_small;
+-	  bp = __mempcpy (*hap++ = bp, cp, n);
+-	  cp += n;
+-	  linebuflen -= n;
+-	  break;
+-	default:
+-	  abort ();
+-	}
+-      if (had_error == 0)
+-	++haveanswer;
+     }
+ 
+-  if (haveanswer > 0)
++  if (ptrlist_size (addresses) == 0)
+     {
+-      *ap = NULL;
+-      *hap = NULL;
+-      /*
+-       * Note: we sort even if host can take only one address
+-       * in its return structures - should give it the "best"
+-       * address in that case, not some random one
+-       */
+-      if (haveanswer > 1 && qtype == T_A
+-	  && __resolv_context_sort_count (ctx) > 0)
+-	addrsort (ctx, host_data->h_addr_ptrs, haveanswer);
+-
+-      if (result->h_name == NULL)
+-	{
+-	  n = strlen (qname) + 1;	/* For the \0.  */
+-	  if (n > linebuflen)
+-	    goto too_small;
+-	  if (n >= MAXHOSTNAMELEN)
+-	    goto no_recovery;
+-	  result->h_name = bp;
+-	  bp = __mempcpy (bp, qname, n);	/* Cannot overflow.  */
+-	  linebuflen -= n;
+-	}
++      /* No address record found.  */
++      if (ttlp != NULL)
++	/* No caching of negative responses.  */
++	*ttlp = 0;
+ 
++      *h_errnop = NO_RECOVERY;
++      *errnop = ENOENT;
++      return NSS_STATUS_TRYAGAIN;
++    }
++  else
++    {
+       *h_errnop = NETDB_SUCCESS;
+       return NSS_STATUS_SUCCESS;
+     }
+- no_recovery:
+-  *h_errnop = NO_RECOVERY;
+-  *errnop = ENOENT;
+-  /* Special case here: if the resolver sent a result but it only
+-     contains a CNAME while we are looking for a T_A or T_AAAA record,
+-     we fail with NOTFOUND instead of TRYAGAIN.  */
+-  return ((qtype == T_A || qtype == T_AAAA) && ap != host_data->aliases
+-	   ? NSS_STATUS_NOTFOUND : NSS_STATUS_TRYAGAIN);
+ }
+ 
+ static enum nss_status
+-- 
+2.38.1
+
+
+From 7a236dc44a22dc4252e803d1ee1d3b970ec43805 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 30 Aug 2022 10:02:49 +0200
+Subject: nss_dns: In gaih_getanswer_slice, skip strange aliases (bug 12154)
+
+If the name is not a host name, skip adding it to the result, instead
+of reporting query failure.  This fixes bug 12154 for getaddrinfo.
+
+This commit still keeps the old parsing code, and only adjusts when
+a host name is copied.
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit 32b599ac8c21c4c332cc3900a792a1395bca79c7)
+---
+ resolv/nss_dns/dns-host.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/resolv/nss_dns/dns-host.c b/resolv/nss_dns/dns-host.c
+index b887e77e9c..bea505d697 100644
+--- a/resolv/nss_dns/dns-host.c
++++ b/resolv/nss_dns/dns-host.c
+@@ -970,12 +970,12 @@ gaih_getanswer_slice (const querybuf *answer, int anslen, const char *qname,
+ 
+ 	  n = -1;
+ 	}
+-      if (__glibc_unlikely (n < 0 || __libc_res_hnok (buffer) == 0))
++      if (__glibc_unlikely (n < 0))
+ 	{
+ 	  ++had_error;
+ 	  continue;
+ 	}
+-      if (*firstp && canon == NULL)
++      if (*firstp && canon == NULL && __libc_res_hnok (buffer))
+ 	{
+ 	  h_name = buffer;
+ 	  buffer += h_namelen;
+@@ -1021,14 +1021,14 @@ gaih_getanswer_slice (const querybuf *answer, int anslen, const char *qname,
+ 
+ 	  n = __libc_dn_expand (answer->buf, end_of_message, cp,
+ 				tbuf, sizeof tbuf);
+-	  if (__glibc_unlikely (n < 0 || __libc_res_hnok (tbuf) == 0))
++	  if (__glibc_unlikely (n < 0))
+ 	    {
+ 	      ++had_error;
+ 	      continue;
+ 	    }
+ 	  cp += n;
+ 
+-	  if (*firstp)
++	  if (*firstp && __libc_res_hnok (tbuf))
+ 	    {
+ 	      /* Reclaim buffer space.  */
+ 	      if (h_name + h_namelen == buffer)
+-- 
+2.38.1
+
+
+From e2ec6a8db38a6b734bbdb41e498fdc9460f7566a Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 30 Aug 2022 10:02:49 +0200
+Subject: resolv: Add new tst-resolv-invalid-cname
+
+This test checks resolution through CNAME chains that do not contain
+host names (bug 12154).
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit 9caf782276ecea4bc86fc94fbb52779736f3106d)
+---
+ resolv/Makefile                   |   3 +
+ resolv/tst-resolv-invalid-cname.c | 406 ++++++++++++++++++++++++++++++
+ 2 files changed, 409 insertions(+)
+ create mode 100644 resolv/tst-resolv-invalid-cname.c
+
+diff --git a/resolv/Makefile b/resolv/Makefile
+index 018b1808d6..f8a92c6cff 100644
+--- a/resolv/Makefile
++++ b/resolv/Makefile
+@@ -98,6 +98,7 @@ tests += \
+   tst-resolv-binary \
+   tst-resolv-byaddr \
+   tst-resolv-edns \
++  tst-resolv-invalid-cname \
+   tst-resolv-network \
+   tst-resolv-noaaaa \
+   tst-resolv-nondecimal \
+@@ -287,6 +288,8 @@ $(objpfx)tst-resolv-res_init-multi: $(objpfx)libresolv.so \
+   $(shared-thread-library)
+ $(objpfx)tst-resolv-res_init-thread: $(objpfx)libresolv.so \
+   $(shared-thread-library)
++$(objpfx)tst-resolv-invalid-cname: $(objpfx)libresolv.so \
++  $(shared-thread-library)
+ $(objpfx)tst-resolv-noaaaa: $(objpfx)libresolv.so $(shared-thread-library)
+ $(objpfx)tst-resolv-nondecimal: $(objpfx)libresolv.so $(shared-thread-library)
+ $(objpfx)tst-resolv-qtypes: $(objpfx)libresolv.so $(shared-thread-library)
+diff --git a/resolv/tst-resolv-invalid-cname.c b/resolv/tst-resolv-invalid-cname.c
+new file mode 100644
+index 0000000000..ae2d4419b1
+--- /dev/null
++++ b/resolv/tst-resolv-invalid-cname.c
+@@ -0,0 +1,406 @@
++/* Test handling of CNAMEs with non-host domain names (bug 12154).
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <errno.h>
++#include <netdb.h>
++#include <resolv.h>
++#include <stdlib.h>
++#include <string.h>
++#include <support/check.h>
++#include <support/check_nss.h>
++#include <support/resolv_test.h>
++#include <support/support.h>
++#include <support/xmemstream.h>
++
++/* Query strings describe the CNAME chain in the response.  They have
++   the format "bitsBITS.countCOUNT.example.", where BITS and COUNT are
++   replaced by unsigned decimal numbers.  COUNT is the number of CNAME
++   records in the response.  BITS has two bits for each CNAME record,
++   describing a special prefix that is added to that CNAME.
++
++   0: No special leading label.
++   1: Starting with "*.".
++   2: Starting with "-x.".
++   3: Starting with "star.*.".
++
++   The first CNAME in the response using the two least significant
++   bits.
++
++   For PTR queries, the QNAME format is different, it is either
++   COUNT.BITS.168.192.in-addr.arpa. (with BITS and COUNT still
++   decimal), or:
++
++COUNT.BITS0.BITS1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa.
++
++   where BITS and COUNT are hexadecimal.  */
++
++static void
++response (const struct resolv_response_context *ctx,
++          struct resolv_response_builder *b,
++          const char *qname, uint16_t qclass, uint16_t qtype)
++{
++  TEST_COMPARE (qclass, C_IN);
++
++  /* The only other query type besides A is PTR.  */
++  if (qtype != T_A && qtype != T_AAAA)
++    TEST_COMPARE (qtype, T_PTR);
++
++  unsigned int bits, bits1, count;
++  char *tail = NULL;
++  if (sscanf (qname, "bits%u.count%u.%ms", &bits, &count, &tail) == 3)
++    TEST_COMPARE_STRING (tail, "example");
++  else if (strstr (qname, "in-addr.arpa") != NULL
++           && sscanf (qname, "%u.%u.%ms", &bits, &count, &tail) == 3)
++    TEST_COMPARE_STRING (tail, "168.192.in-addr.arpa");
++  else if (sscanf (qname, "%x.%x.%x.%ms", &bits, &bits1, &count, &tail) == 4)
++    {
++      TEST_COMPARE_STRING (tail, "\
++0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa");
++      bits |= bits1 << 4;
++    }
++  else
++    FAIL_EXIT1 ("invalid QNAME: %s\n", qname);
++  free (tail);
++
++  struct resolv_response_flags flags = {};
++  resolv_response_init (b, flags);
++  resolv_response_add_question (b, qname, qclass, qtype);
++  resolv_response_section (b, ns_s_an);
++
++  /* Provide the requested number of CNAME records.  */
++  char *previous_name = (char *) qname;
++  unsigned int original_bits = bits;
++  for (int unique = 0; unique < count; ++unique)
++    {
++      resolv_response_open_record (b, previous_name, qclass, T_CNAME, 60);
++
++      static const char bits_to_prefix[4][8] = { "", "*.", "-x.", "star.*." };
++      char *new_name = xasprintf ("%sunique%d.example",
++                                  bits_to_prefix[bits & 3], unique);
++      bits >>= 2;
++      resolv_response_add_name (b, new_name);
++      resolv_response_close_record (b);
++
++      if (previous_name != qname)
++        free (previous_name);
++      previous_name = new_name;
++    }
++
++  /* Actual answer record.  */
++  resolv_response_open_record (b, previous_name, qclass, qtype, 60);
++  switch (qtype)
++    {
++    case T_A:
++      {
++        char ipv4[4] = {192, 168, count, original_bits};
++        resolv_response_add_data (b, &ipv4, sizeof (ipv4));
++      }
++      break;
++    case T_AAAA:
++      {
++        char ipv6[16] =
++          {
++            0x20, 0x01, 0xd, 0xb8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
++            count, original_bits
++          };
++        resolv_response_add_data (b, &ipv6, sizeof (ipv6));
++      }
++      break;
++
++    case T_PTR:
++      {
++        char *name = xasprintf ("bits%u.count%u.example",
++                                original_bits, count);
++        resolv_response_add_name (b, name);
++        free (name);
++      }
++      break;
++    }
++  resolv_response_close_record (b);
++
++  if (previous_name != qname)
++    free (previous_name);
++}
++
++/* Controls which name resolution function is invoked.  */
++enum test_mode
++  {
++    byname,                     /* gethostbyname.  */
++    byname2,                    /* gethostbyname2.  */
++    gai,                        /* getaddrinfo without AI_CANONNAME.  */
++    gai_canon,                  /* getaddrinfo with AI_CANONNAME.  */
++
++    test_mode_num               /* Number of enum values.  */
++  };
++
++static const char *
++test_mode_to_string (enum test_mode mode)
++{
++  switch (mode)
++    {
++    case byname:
++      return "byname";
++    case byname2:
++      return "byname2";
++    case gai:
++      return "gai";
++    case gai_canon:
++      return "gai_canon";
++    case test_mode_num:
++      /* Report error below.  */
++    }
++  FAIL_EXIT1 ("invalid test_mode: %d", mode);
++}
++
++/* Append the name and aliases to OUT.  */
++static void
++append_names (FILE *out, const char *qname, int bits, int count,
++              enum test_mode mode)
++{
++  /* Largest valid index which has a corresponding zero in bits
++     (meaning a syntactically valid CNAME).  */
++  int last_valid_cname = -1;
++
++  for (int i = 0; i < count; ++i)
++    if ((bits & (3 << (i * 2))) == 0)
++      last_valid_cname = i;
++
++  if (mode != gai)
++    {
++      const char *label;
++      if (mode == gai_canon)
++        label = "canonname";
++      else
++        label = "name";
++      if (last_valid_cname >= 0)
++        fprintf (out, "%s: unique%d.example\n", label, last_valid_cname);
++      else
++        fprintf (out, "%s: %s\n", label, qname);
++    }
++
++  if (mode == byname || mode == byname2)
++    {
++      if (last_valid_cname >= 0)
++        fprintf (out, "alias: %s\n", qname);
++      for (int i = 0; i < count; ++i)
++        {
++          if ((bits & (3 << (i * 2))) == 0 && i != last_valid_cname)
++            fprintf (out, "alias: unique%d.example\n", i);
++        }
++    }
++}
++
++/* Append the address information to OUT.  */
++static void
++append_addresses (FILE *out, int af, int bits, int count, enum test_mode mode)
++{
++  int last = count * 256 + bits;
++  if (mode == gai || mode == gai_canon)
++    {
++      if (af == AF_INET || af == AF_UNSPEC)
++        fprintf (out, "address: STREAM/TCP 192.168.%d.%d 80\n", count, bits);
++      if (af == AF_INET6 || af == AF_UNSPEC)
++        {
++          if (last == 0)
++            fprintf (out, "address: STREAM/TCP 2001:db8:: 80\n");
++          else
++            fprintf (out, "address: STREAM/TCP 2001:db8::%x 80\n", last);
++        }
++    }
++  else
++    {
++      TEST_VERIFY (af != AF_UNSPEC);
++      if (af == AF_INET)
++        fprintf (out, "address: 192.168.%d.%d\n", count, bits);
++      if (af == AF_INET6)
++        {
++          if (last == 0)
++            fprintf (out, "address: 2001:db8::\n");
++          else
++            fprintf (out, "address: 2001:db8::%x\n", last);
++        }
++    }
++}
++
++/* Perform one test using a forward lookup.  */
++static void
++check_forward (int af, int bits, int count, enum test_mode mode)
++{
++  char *qname = xasprintf ("bits%d.count%d.example", bits, count);
++  char *label = xasprintf ("af=%d bits=%d count=%d mode=%s qname=%s",
++                           af, bits, count, test_mode_to_string (mode), qname);
++
++  struct xmemstream expected;
++  xopen_memstream (&expected);
++  if (mode == gai_canon)
++    fprintf (expected.out, "flags: AI_CANONNAME\n");
++  append_names (expected.out, qname, bits, count, mode);
++  append_addresses (expected.out, af, bits, count, mode);
++  xfclose_memstream (&expected);
++
++  if (mode == gai || mode == gai_canon)
++    {
++      struct addrinfo *ai;
++      struct addrinfo hints =
++        {
++          .ai_family = af,
++          .ai_socktype = SOCK_STREAM,
++        };
++      if (mode == gai_canon)
++        hints.ai_flags |= AI_CANONNAME;
++      int ret = getaddrinfo (qname, "80", &hints, &ai);
++      check_addrinfo (label, ai, ret, expected.buffer);
++      if (ret == 0)
++        freeaddrinfo (ai);
++    }
++  else
++    {
++      struct hostent *e;
++      if (mode == gai)
++        {
++          TEST_COMPARE (af, AF_INET);
++          e = gethostbyname (qname);
++        }
++      else
++        {
++          if (af != AF_INET)
++            TEST_COMPARE (af, AF_INET6);
++          e = gethostbyname2 (qname, af);
++        }
++      check_hostent (label, e, expected.buffer);
++    }
++
++  free (expected.buffer);
++  free (label);
++  free (qname);
++}
++
++/* Perform one check using a reverse lookup.  */
++
++static void
++check_reverse (int af, int bits, int count)
++{
++  TEST_VERIFY (af == AF_INET || af == AF_INET6);
++
++  char *label = xasprintf ("af=%d bits=%d count=%d", af, bits, count);
++  char *fqdn = xasprintf ("bits%d.count%d.example", bits, count);
++
++  struct xmemstream expected;
++  xopen_memstream (&expected);
++  fprintf (expected.out, "name: %s\n", fqdn);
++  append_addresses (expected.out, af, bits, count, byname);
++  xfclose_memstream (&expected);
++
++  char addr[16] = { 0 };
++  socklen_t addrlen;
++  if (af == AF_INET)
++    {
++      addr[0] = 192;
++      addr[1] = 168;
++      addr[2] = count;
++      addr[3] = bits;
++      addrlen = 4;
++    }
++  else
++    {
++      addr[0] = 0x20;
++      addr[1] = 0x01;
++      addr[2] = 0x0d;
++      addr[3] = 0xb8;
++      addr[14] = count;
++      addr[15] = bits;
++      addrlen = 16;
++    }
++
++  struct hostent *e = gethostbyaddr (addr, addrlen, af);
++  check_hostent (label, e, expected.buffer);
++
++  /* getnameinfo check is different.  There is no generic check_*
++     function for it.  */
++  {
++    struct sockaddr_in sin = { };
++    struct sockaddr_in6 sin6 = { };
++    void *sa;
++    socklen_t salen;
++    if (af == AF_INET)
++      {
++        sin.sin_family = AF_INET;
++        memcpy (&sin.sin_addr, addr, addrlen);
++        sin.sin_port = htons (80);
++        sa = &sin;
++        salen = sizeof (sin);
++      }
++    else
++      {
++        sin6.sin6_family = AF_INET6;
++        memcpy (&sin6.sin6_addr, addr, addrlen);
++        sin6.sin6_port = htons (80);
++        sa = &sin6;
++        salen = sizeof (sin6);
++      }
++
++    char host[64];
++    char service[64];
++    int ret = getnameinfo (sa, salen, host,
++                           sizeof (host), service, sizeof (service),
++                           NI_NAMEREQD | NI_NUMERICSERV);
++    TEST_COMPARE (ret, 0);
++    TEST_COMPARE_STRING (host, fqdn);
++    TEST_COMPARE_STRING (service, "80");
++  }
++
++  free (expected.buffer);
++  free (fqdn);
++  free (label);
++}
++
++static int
++do_test (void)
++{
++  struct resolv_test *obj = resolv_test_start
++    ((struct resolv_redirect_config)
++     {
++       .response_callback = response
++     });
++
++  for (int count = 0; count <= 3; ++count)
++    for (int bits = 0; bits <= 1 << (count * 2); ++bits)
++      {
++        if (count > 0 && bits == count)
++          /* The last bits value is only checked if count == 0.  */
++          continue;
++
++        for (enum test_mode mode = 0; mode < test_mode_num; ++mode)
++          {
++            check_forward (AF_INET, bits, count, mode);
++            if (mode != byname)
++              check_forward (AF_INET6, bits, count, mode);
++            if (mode == gai || mode == gai_canon)
++              check_forward (AF_UNSPEC, bits, count, mode);
++          }
++
++        check_reverse (AF_INET, bits, count);
++        check_reverse (AF_INET6, bits, count);
++      }
++
++  resolv_test_end (obj);
++
++  return 0;
++}
++
++#include <support/test-driver.c>
+-- 
+2.38.1
+
+
+From c5cdb39c20e96d9ac0d46fc7284b8276a537fd35 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 30 Aug 2022 10:02:49 +0200
+Subject: nss_dns: Rewrite _nss_dns_gethostbyname4_r using current interfaces
+
+Introduce struct alloc_buffer to this function, and use it and
+struct ns_rr_cursor in gaih_getanswer_slice.  Adjust gaih_getanswer
+and gaih_getanswer_noaaaa accordingly.
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit 1d495912a746e2a1ffb780c9a81fd234ec2464e8)
+---
+ resolv/nss_dns/dns-host.c | 443 ++++++++++++++------------------------
+ 1 file changed, 162 insertions(+), 281 deletions(-)
+
+diff --git a/resolv/nss_dns/dns-host.c b/resolv/nss_dns/dns-host.c
+index bea505d697..9fa81f23c8 100644
+--- a/resolv/nss_dns/dns-host.c
++++ b/resolv/nss_dns/dns-host.c
+@@ -100,13 +100,6 @@
+ #endif
+ #define MAXHOSTNAMELEN 256
+ 
+-/* We need this time later.  */
+-typedef union querybuf
+-{
+-  HEADER hdr;
+-  u_char buf[MAXPACKET];
+-} querybuf;
+-
+ /* For historic reasons, pointers to IP addresses are char *, so use a
+    single list type for addresses and host names.  */
+ #define DYNARRAY_STRUCT ptrlist
+@@ -125,18 +118,18 @@ static enum nss_status getanswer_ptr (unsigned char *packet, size_t packetlen,
+ 				      char **hnamep, int *errnop,
+ 				      int *h_errnop, int32_t *ttlp);
+ 
+-static enum nss_status gaih_getanswer (const querybuf *answer1, int anslen1,
+-				       const querybuf *answer2, int anslen2,
+-				       const char *qname,
++static enum nss_status gaih_getanswer (unsigned char *packet1,
++				       size_t packet1len,
++				       unsigned char *packet2,
++				       size_t packet2len,
++				       struct alloc_buffer *abuf,
+ 				       struct gaih_addrtuple **pat,
+-				       char *buffer, size_t buflen,
+ 				       int *errnop, int *h_errnop,
+ 				       int32_t *ttlp);
+-static enum nss_status gaih_getanswer_noaaaa (const querybuf *answer1,
+-					      int anslen1,
+-					      const char *qname,
++static enum nss_status gaih_getanswer_noaaaa (unsigned char *packet,
++					      size_t packetlen,
++					      struct alloc_buffer *abuf,
+ 					      struct gaih_addrtuple **pat,
+-					      char *buffer, size_t buflen,
+ 					      int *errnop, int *h_errnop,
+ 					      int32_t *ttlp);
+ 
+@@ -408,17 +401,13 @@ _nss_dns_gethostbyname4_r (const char *name, struct gaih_addrtuple **pat,
+ 	name = cp;
+     }
+ 
+-  union
+-  {
+-    querybuf *buf;
+-    u_char *ptr;
+-  } host_buffer;
+-  querybuf *orig_host_buffer;
+-  host_buffer.buf = orig_host_buffer = (querybuf *) alloca (2048);
++  unsigned char dns_packet_buffer[2048];
++  unsigned char *alt_dns_packet_buffer = dns_packet_buffer;
+   u_char *ans2p = NULL;
+   int nans2p = 0;
+   int resplen2 = 0;
+   int ans2p_malloced = 0;
++  struct alloc_buffer abuf = alloc_buffer_create (buffer, buflen);
+ 
+ 
+   int olderr = errno;
+@@ -427,22 +416,21 @@ _nss_dns_gethostbyname4_r (const char *name, struct gaih_addrtuple **pat,
+   if ((ctx->resp->options & RES_NOAAAA) == 0)
+     {
+       n = __res_context_search (ctx, name, C_IN, T_QUERY_A_AND_AAAA,
+-				host_buffer.buf->buf, 2048, &host_buffer.ptr,
+-				&ans2p, &nans2p, &resplen2, &ans2p_malloced);
++				dns_packet_buffer, sizeof (dns_packet_buffer),
++				&alt_dns_packet_buffer, &ans2p, &nans2p,
++				&resplen2, &ans2p_malloced);
+       if (n >= 0)
+-	status = gaih_getanswer (host_buffer.buf, n, (const querybuf *) ans2p,
+-				 resplen2, name, pat, buffer, buflen,
+-				 errnop, herrnop, ttlp);
++	status = gaih_getanswer (alt_dns_packet_buffer, n, ans2p, resplen2,
++				 &abuf, pat, errnop, herrnop, ttlp);
+     }
+   else
+     {
+       n = __res_context_search (ctx, name, C_IN, T_A,
+-				host_buffer.buf->buf, 2048, NULL,
+-				NULL, NULL, NULL, NULL);
++				dns_packet_buffer, sizeof (dns_packet_buffer),
++				NULL, NULL, NULL, NULL, NULL);
+       if (n >= 0)
+-	status = gaih_getanswer_noaaaa (host_buffer.buf, n,
+-					name, pat, buffer, buflen,
+-					errnop, herrnop, ttlp);
++	status = gaih_getanswer_noaaaa (alt_dns_packet_buffer, n,
++					&abuf, pat, errnop, herrnop, ttlp);
+     }
+   if (n < 0)
+     {
+@@ -473,12 +461,20 @@ _nss_dns_gethostbyname4_r (const char *name, struct gaih_addrtuple **pat,
+ 	__set_errno (olderr);
+     }
+ 
++  /* Implement the buffer resizing protocol.  */
++  if (alloc_buffer_has_failed (&abuf))
++    {
++      *errnop = ERANGE;
++      *herrnop = NETDB_INTERNAL;
++      status = NSS_STATUS_TRYAGAIN;
++    }
++
+   /* Check whether ans2p was separately allocated.  */
+   if (ans2p_malloced)
+     free (ans2p);
+ 
+-  if (host_buffer.buf != orig_host_buffer)
+-    free (host_buffer.buf);
++  if (alt_dns_packet_buffer != dns_packet_buffer)
++    free (alt_dns_packet_buffer);
+ 
+   __resolv_context_put (ctx);
+   return status;
+@@ -892,259 +888,152 @@ getanswer_ptr (unsigned char *packet, size_t packetlen,
+   return NSS_STATUS_TRYAGAIN;
+ }
+ 
++/* Parses DNS data found in PACKETLEN bytes at PACKET in struct
++   gaih_addrtuple address tuples.  The new address tuples are linked
++   from **TAILP, with backing store allocated from ABUF, and *TAILP is
++   updated to point where the next tuple pointer should be stored.  If
++   TTLP is not null, *TTLP is updated to reflect the minimum TTL.  If
++   STORE_CANON is true, the canonical name is stored as part of the
++   first address tuple being written.  */
+ static enum nss_status
+-gaih_getanswer_slice (const querybuf *answer, int anslen, const char *qname,
+-		      struct gaih_addrtuple ***patp,
+-		      char **bufferp, size_t *buflenp,
+-		      int *errnop, int *h_errnop, int32_t *ttlp, int *firstp)
++gaih_getanswer_slice (unsigned char *packet, size_t packetlen,
++		      struct alloc_buffer *abuf,
++		      struct gaih_addrtuple ***tailp,
++		      int *errnop, int *h_errnop, int32_t *ttlp,
++		      bool store_canon)
+ {
+-  char *buffer = *bufferp;
+-  size_t buflen = *buflenp;
+-
+-  struct gaih_addrtuple **pat = *patp;
+-  const HEADER *hp = &answer->hdr;
+-  int ancount = ntohs (hp->ancount);
+-  int qdcount = ntohs (hp->qdcount);
+-  const u_char *cp = answer->buf + HFIXEDSZ;
+-  const u_char *end_of_message = answer->buf + anslen;
+-  if (__glibc_unlikely (qdcount != 1))
+-    {
+-      *h_errnop = NO_RECOVERY;
+-      return NSS_STATUS_UNAVAIL;
+-    }
+-
+-  u_char packtmp[NS_MAXCDNAME];
+-  int n = __ns_name_unpack (answer->buf, end_of_message, cp,
+-			    packtmp, sizeof packtmp);
+-  /* We unpack the name to check it for validity.  But we do not need
+-     it later.  */
+-  if (n != -1 && __ns_name_ntop (packtmp, buffer, buflen) == -1)
+-    {
+-      if (__glibc_unlikely (errno == EMSGSIZE))
+-	{
+-	too_small:
+-	  *errnop = ERANGE;
+-	  *h_errnop = NETDB_INTERNAL;
+-	  return NSS_STATUS_TRYAGAIN;
+-	}
+-
+-      n = -1;
+-    }
+-
+-  if (__glibc_unlikely (n < 0))
+-    {
+-      *errnop = errno;
+-      *h_errnop = NO_RECOVERY;
+-      return NSS_STATUS_UNAVAIL;
+-    }
+-  if (__glibc_unlikely (__libc_res_hnok (buffer) == 0))
++  struct ns_rr_cursor c;
++  if (!__ns_rr_cursor_init (&c, packet, packetlen))
+     {
+-      errno = EBADMSG;
+-      *errnop = EBADMSG;
++      /* This should not happen because __res_context_query already
++	 perfroms response validation.  */
+       *h_errnop = NO_RECOVERY;
+       return NSS_STATUS_UNAVAIL;
+     }
+-  cp += n + QFIXEDSZ;
++  bool haveanswer = false; /* Set to true if at least one address.  */
++  uint16_t qtype = ns_rr_cursor_qtype (&c);
++  int ancount = ns_rr_cursor_ancount (&c);
++  const unsigned char *expected_name = ns_rr_cursor_qname (&c);
++  /* expected_name may be updated to point into this buffer.  */
++  unsigned char name_buffer[NS_MAXCDNAME];
+ 
+-  int haveanswer = 0;
+-  int had_error = 0;
+-  char *canon = NULL;
+-  char *h_name = NULL;
+-  int h_namelen = 0;
++  /* This is a pointer to a possibly-compressed name in the packet.
++     Eventually it is equivalent to the canonical name.  If needed, it
++     is uncompressed and translated to text form when the first
++     address tuple is encountered.  */
++  const unsigned char *compressed_alias_name = expected_name;
+ 
+-  if (ancount == 0)
++  if (ancount == 0 || !__res_binary_hnok (compressed_alias_name))
+     {
+       *h_errnop = HOST_NOT_FOUND;
+       return NSS_STATUS_NOTFOUND;
+     }
+ 
+-  while (ancount-- > 0 && cp < end_of_message && had_error == 0)
++  for (; ancount > -0; --ancount)
+     {
+-      n = __ns_name_unpack (answer->buf, end_of_message, cp,
+-			    packtmp, sizeof packtmp);
+-      if (n != -1 &&
+-	  (h_namelen = __ns_name_ntop (packtmp, buffer, buflen)) == -1)
+-	{
+-	  if (__glibc_unlikely (errno == EMSGSIZE))
+-	    goto too_small;
+-
+-	  n = -1;
+-	}
+-      if (__glibc_unlikely (n < 0))
+-	{
+-	  ++had_error;
+-	  continue;
+-	}
+-      if (*firstp && canon == NULL && __libc_res_hnok (buffer))
+-	{
+-	  h_name = buffer;
+-	  buffer += h_namelen;
+-	  buflen -= h_namelen;
+-	}
+-
+-      cp += n;				/* name */
+-
+-      if (__glibc_unlikely (cp + 10 > end_of_message))
+-	{
+-	  ++had_error;
+-	  continue;
+-	}
+-
+-      uint16_t type;
+-      NS_GET16 (type, cp);
+-      uint16_t class;
+-      NS_GET16 (class, cp);
+-      int32_t ttl;
+-      NS_GET32 (ttl, cp);
+-      NS_GET16 (n, cp);		/* RDATA length.  */
+-
+-      if (end_of_message - cp < n)
++      struct ns_rr_wire rr;
++      if (!__ns_rr_cursor_next (&c, &rr))
+ 	{
+-	  /* RDATA extends beyond the end of the packet.  */
+-	  ++had_error;
+-	  continue;
++	  *h_errnop = NO_RECOVERY;
++	  return NSS_STATUS_UNAVAIL;
+ 	}
+ 
+-      if (class != C_IN)
+-	{
+-	  cp += n;
+-	  continue;
+-	}
++      /* Update TTL for known record types.  */
++      if ((rr.rtype == T_CNAME || rr.rtype == qtype)
++	  && ttlp != NULL && *ttlp > rr.ttl)
++	*ttlp = rr.ttl;
+ 
+-      if (type == T_CNAME)
++      if (rr.rtype == T_CNAME)
+ 	{
+-	  char tbuf[MAXDNAME];
+-
+-	  /* A CNAME could also have a TTL entry.  */
+-	  if (ttlp != NULL && ttl < *ttlp)
+-	      *ttlp = ttl;
+-
+-	  n = __libc_dn_expand (answer->buf, end_of_message, cp,
+-				tbuf, sizeof tbuf);
+-	  if (__glibc_unlikely (n < 0))
+-	    {
+-	      ++had_error;
+-	      continue;
+-	    }
+-	  cp += n;
+-
+-	  if (*firstp && __libc_res_hnok (tbuf))
++	  /* NB: No check for owner name match, based on historic
++	     precedent.  Record the CNAME target as the new expected
++	     name.  */
++	  int n = __ns_name_unpack (c.begin, c.end, rr.rdata,
++				    name_buffer, sizeof (name_buffer));
++	  if (n < 0)
+ 	    {
+-	      /* Reclaim buffer space.  */
+-	      if (h_name + h_namelen == buffer)
+-		{
+-		  buffer = h_name;
+-		  buflen += h_namelen;
+-		}
+-
+-	      n = strlen (tbuf) + 1;
+-	      if (__glibc_unlikely (n > buflen))
+-		goto too_small;
+-	      if (__glibc_unlikely (n >= MAXHOSTNAMELEN))
+-		{
+-		  ++had_error;
+-		  continue;
+-		}
+-
+-	      canon = buffer;
+-	      buffer = __mempcpy (buffer, tbuf, n);
+-	      buflen -= n;
+-	      h_namelen = 0;
++	      *h_errnop = NO_RECOVERY;
++	      return NSS_STATUS_UNAVAIL;
+ 	    }
+-	  continue;
++	  expected_name = name_buffer;
++	  if (store_canon && __res_binary_hnok (name_buffer))
++	    /* This name can be used as a canonical name.  Do not
++	       translate to text form here to conserve buffer space.
++	       Point to the compressed name because name_buffer can be
++	       overwritten with an unusable name later.  */
++	    compressed_alias_name = rr.rdata;
+ 	}
+-
+-      /* Stop parsing if we encounter a record with incorrect RDATA
+-	 length.  */
+-      if (type == T_A || type == T_AAAA)
++      else if (rr.rtype == qtype
++	       && __ns_samebinaryname (rr.rname, expected_name)
++	       && rr.rdlength == rrtype_to_rdata_length (qtype))
+ 	{
+-	  if (n != rrtype_to_rdata_length (type))
++	  struct gaih_addrtuple *ntup
++	    = alloc_buffer_alloc (abuf, struct gaih_addrtuple);
++	  /* Delay error reporting to the callers (they implement the
++	     ERANGE buffer resizing handshake).  */
++	  if (ntup != NULL)
+ 	    {
+-	      ++had_error;
+-	      continue;
++	      ntup->next = NULL;
++	      if (store_canon && compressed_alias_name != NULL)
++		{
++		  /* This assumes that all the CNAME records come
++		     first.  Use MAXHOSTNAMELEN instead of
++		     NS_MAXCDNAME for additional length checking.
++		     However, these checks are not expected to fail
++		     because all size NS_MAXCDNAME names should into
++		     the hname buffer because no escaping is
++		     needed.  */
++		  char unsigned nbuf[NS_MAXCDNAME];
++		  char hname[MAXHOSTNAMELEN + 1];
++		  if (__ns_name_unpack (c.begin, c.end,
++					compressed_alias_name,
++					nbuf, sizeof (nbuf)) >= 0
++		      && __ns_name_ntop (nbuf, hname, sizeof (hname)) >= 0)
++		    /* Space checking is performed by the callers.  */
++		    ntup->name = alloc_buffer_copy_string (abuf, hname);
++		  store_canon = false;
++		}
++	      else
++		ntup->name = NULL;
++	      if (rr.rdlength == 4)
++		ntup->family = AF_INET;
++	      else
++		ntup->family = AF_INET6;
++	      memcpy (ntup->addr, rr.rdata, rr.rdlength);
++	      ntup->scopeid = 0;
++
++	      /* Link in the new tuple, and update the tail pointer to
++		 point to its next field.  */
++	      **tailp = ntup;
++	      *tailp = &ntup->next;
++
++	      haveanswer = true;
+ 	    }
+ 	}
+-      else
+-	{
+-	  /* Skip unknown records.  */
+-	  cp += n;
+-	  continue;
+-	}
+-
+-      assert (type == T_A || type == T_AAAA);
+-      if (*pat == NULL)
+-	{
+-	  uintptr_t pad = (-(uintptr_t) buffer
+-			   % __alignof__ (struct gaih_addrtuple));
+-	  buffer += pad;
+-	  buflen = buflen > pad ? buflen - pad : 0;
+-
+-	  if (__glibc_unlikely (buflen < sizeof (struct gaih_addrtuple)))
+-	    goto too_small;
+-
+-	  *pat = (struct gaih_addrtuple *) buffer;
+-	  buffer += sizeof (struct gaih_addrtuple);
+-	  buflen -= sizeof (struct gaih_addrtuple);
+-	}
+-
+-      (*pat)->name = NULL;
+-      (*pat)->next = NULL;
+-
+-      if (*firstp)
+-	{
+-	  /* We compose a single hostent out of the entire chain of
+-	     entries, so the TTL of the hostent is essentially the lowest
+-	     TTL in the chain.  */
+-	  if (ttlp != NULL && ttl < *ttlp)
+-	    *ttlp = ttl;
+-
+-	  (*pat)->name = canon ?: h_name;
+-
+-	  *firstp = 0;
+-	}
+-
+-      (*pat)->family = type == T_A ? AF_INET : AF_INET6;
+-      memcpy ((*pat)->addr, cp, n);
+-      cp += n;
+-      (*pat)->scopeid = 0;
+-
+-      pat = &((*pat)->next);
+-
+-      haveanswer = 1;
+     }
+ 
+   if (haveanswer)
+     {
+-      *patp = pat;
+-      *bufferp = buffer;
+-      *buflenp = buflen;
+-
+       *h_errnop = NETDB_SUCCESS;
+       return NSS_STATUS_SUCCESS;
+     }
+-
+-  /* Special case here: if the resolver sent a result but it only
+-     contains a CNAME while we are looking for a T_A or T_AAAA record,
+-     we fail with NOTFOUND instead of TRYAGAIN.  */
+-  if (canon != NULL)
++  else
+     {
++      /* Special case here: if the resolver sent a result but it only
++	 contains a CNAME while we are looking for a T_A or T_AAAA
++	 record, we fail with NOTFOUND.  */
+       *h_errnop = HOST_NOT_FOUND;
+       return NSS_STATUS_NOTFOUND;
+     }
+-
+-  *h_errnop = NETDB_INTERNAL;
+-  return NSS_STATUS_TRYAGAIN;
+ }
+ 
+ 
+ static enum nss_status
+-gaih_getanswer (const querybuf *answer1, int anslen1, const querybuf *answer2,
+-		int anslen2, const char *qname,
+-		struct gaih_addrtuple **pat, char *buffer, size_t buflen,
++gaih_getanswer (unsigned char *packet1, size_t packet1len,
++		unsigned char *packet2, size_t packet2len,
++		struct alloc_buffer *abuf, struct gaih_addrtuple **pat,
+ 		int *errnop, int *h_errnop, int32_t *ttlp)
+ {
+-  int first = 1;
+-
+   enum nss_status status = NSS_STATUS_NOTFOUND;
+ 
+   /* Combining the NSS status of two distinct queries requires some
+@@ -1156,7 +1045,10 @@ gaih_getanswer (const querybuf *answer1, int anslen1, const querybuf *answer2,
+      between TRYAGAIN (recoverable) and TRYAGAIN' (not-recoverable).
+      A recoverable TRYAGAIN is almost always due to buffer size issues
+      and returns ERANGE in errno and the caller is expected to retry
+-     with a larger buffer.
++     with a larger buffer.  (The caller, _nss_dns_gethostbyname4_r,
++     ignores the return status if it detects that the result buffer
++     has been exhausted and generates a TRYAGAIN failure with an
++     ERANGE code.)
+ 
+      Lastly, you may be tempted to make significant changes to the
+      conditions in this code to bring about symmetry between responses.
+@@ -1236,36 +1128,30 @@ gaih_getanswer (const querybuf *answer1, int anslen1, const querybuf *answer2,
+ 	 is a recoverable error we now return TRYAGIN even if the first
+ 	 response was SUCCESS.  */
+ 
+-  if (anslen1 > 0)
+-    status = gaih_getanswer_slice(answer1, anslen1, qname,
+-				  &pat, &buffer, &buflen,
+-				  errnop, h_errnop, ttlp,
+-				  &first);
+-
+-  if ((status == NSS_STATUS_SUCCESS || status == NSS_STATUS_NOTFOUND
+-       || (status == NSS_STATUS_TRYAGAIN
+-	   /* We want to look at the second answer in case of an
+-	      NSS_STATUS_TRYAGAIN only if the error is non-recoverable, i.e.
+-	      *h_errnop is NO_RECOVERY. If not, and if the failure was due to
+-	      an insufficient buffer (ERANGE), then we need to drop the results
+-	      and pass on the NSS_STATUS_TRYAGAIN to the caller so that it can
+-	      repeat the query with a larger buffer.  */
+-	   && (*errnop != ERANGE || *h_errnop == NO_RECOVERY)))
+-      && answer2 != NULL && anslen2 > 0)
++  if (packet1len > 0)
+     {
+-      enum nss_status status2 = gaih_getanswer_slice(answer2, anslen2, qname,
+-						     &pat, &buffer, &buflen,
+-						     errnop, h_errnop, ttlp,
+-						     &first);
++      status = gaih_getanswer_slice (packet1, packet1len,
++				     abuf, &pat, errnop, h_errnop, ttlp, true);
++      if (alloc_buffer_has_failed (abuf))
++	/* Do not try parsing the second packet if a larger result
++	   buffer is needed.  The caller implements the resizing
++	   protocol because *abuf has been exhausted.  */
++	return NSS_STATUS_TRYAGAIN; /* Ignored by the caller.  */
++    }
++
++  if ((status == NSS_STATUS_SUCCESS || status == NSS_STATUS_NOTFOUND)
++      && packet2 != NULL && packet2len > 0)
++    {
++      enum nss_status status2
++	= gaih_getanswer_slice (packet2, packet2len,
++				abuf, &pat, errnop, h_errnop, ttlp,
++				/* Success means that data with a
++				   canonical name has already been
++				   stored.  Do not store the name again.  */
++				status != NSS_STATUS_SUCCESS);
+       /* Use the second response status in some cases.  */
+       if (status != NSS_STATUS_SUCCESS && status2 != NSS_STATUS_NOTFOUND)
+ 	status = status2;
+-      /* Do not return a truncated second response (unless it was
+-	 unavoidable e.g. unrecoverable TRYAGAIN).  */
+-      if (status == NSS_STATUS_SUCCESS
+-	  && (status2 == NSS_STATUS_TRYAGAIN
+-	      && *errnop == ERANGE && *h_errnop != NO_RECOVERY))
+-	status = NSS_STATUS_TRYAGAIN;
+     }
+ 
+   return status;
+@@ -1273,18 +1159,13 @@ gaih_getanswer (const querybuf *answer1, int anslen1, const querybuf *answer2,
+ 
+ /* Variant of gaih_getanswer without a second (AAAA) response.  */
+ static enum nss_status
+-gaih_getanswer_noaaaa (const querybuf *answer1, int anslen1, const char *qname,
+-		       struct gaih_addrtuple **pat,
+-		       char *buffer, size_t buflen,
++gaih_getanswer_noaaaa (unsigned char *packet, size_t packetlen,
++		       struct alloc_buffer *abuf, struct gaih_addrtuple **pat,
+ 		       int *errnop, int *h_errnop, int32_t *ttlp)
+ {
+-  int first = 1;
+-
+   enum nss_status status = NSS_STATUS_NOTFOUND;
+-  if (anslen1 > 0)
+-    status = gaih_getanswer_slice (answer1, anslen1, qname,
+-				   &pat, &buffer, &buflen,
+-				   errnop, h_errnop, ttlp,
+-				   &first);
++  if (packetlen > 0)
++    status = gaih_getanswer_slice (packet, packetlen,
++				   abuf, &pat, errnop, h_errnop, ttlp, true);
+   return status;
+ }
+-- 
+2.38.1
+
+
+From a7fa604f3050a1024dc8ec28ff28bad811f6151f Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 30 Aug 2022 13:30:03 +0200
+Subject: resolv: Fix building tst-resolv-invalid-cname for earlier C standards
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This fixes this compiler error:
+
+tst-resolv-invalid-cname.c: In function ‘test_mode_to_string’:
+tst-resolv-invalid-cname.c:164:10: error: label at end of compound statement
+     case test_mode_num:
+          ^~~~~~~~~~~~~
+
+Fixes commit 9caf782276ecea4bc86fc94fbb52779736f3106d
+("resolv: Add new tst-resolv-invalid-cname").
+
+(cherry picked from commit d09aa4a17229bcaa2ec7642006b12612498582e7)
+---
+ resolv/tst-resolv-invalid-cname.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/resolv/tst-resolv-invalid-cname.c b/resolv/tst-resolv-invalid-cname.c
+index ae2d4419b1..63dac90e02 100644
+--- a/resolv/tst-resolv-invalid-cname.c
++++ b/resolv/tst-resolv-invalid-cname.c
+@@ -162,7 +162,7 @@ test_mode_to_string (enum test_mode mode)
+     case gai_canon:
+       return "gai_canon";
+     case test_mode_num:
+-      /* Report error below.  */
++      break;                    /* Report error below.  */
+     }
+   FAIL_EXIT1 ("invalid test_mode: %d", mode);
+ }
+-- 
+2.38.1
+
+
+From 5d885617cec5713fdde42177398fe98acb66b7a2 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 13 Sep 2022 13:22:27 +0200
+Subject: NEWS: Note bug 12154 and bug 29305 as fixed
+
+---
+ NEWS | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/NEWS b/NEWS
+index 9360596fcc..03281e3ab4 100644
+--- a/NEWS
++++ b/NEWS
+@@ -16,7 +16,9 @@ Security related changes:
+ 
+ The following bugs are resolved with this release:
+ 
++  [12154] Do not fail DNS resolution for CNAMEs which are not host names
+   [28846] CMSG_NXTHDR may trigger -Wstrict-overflow warning
++  [29305] Conserve NSS buffer space during DNS packet parsing
+   [29415] nscd: Fix netlink cache invalidation if epoll is used
+   [29446] _dlopen now ignores dl_caller argument in static mode
+   [29485] Linux: Terminate subprocess on late failure in tst-pidfd
+-- 
+2.38.1
+
+
+From df51334828f2af214105aad82042140ee3a6de0a Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 13 Sep 2022 19:57:43 +0200
+Subject: elf: Run tst-audit-tlsdesc, tst-audit-tlsdesc-dlopen everywhere
+
+The test is valid for all TLS models, but we want to make a reasonable
+effort to test the GNU2 model specifically.  For example, aarch64
+defaults to GNU2, but does not have -mtls-dialect=gnu2, and the test
+was not run there.
+
+Suggested-by: Martin Coufal <mcoufal@redhat.com>
+(cherry picked from commit dd2315a866a4ac2b838ea1cb10c5ea1c35d51a2f)
+
+Fixes early backport commit 924e4f3eaa502ce82fccf8537f021a796d158771
+("elf: Call __libc_early_init for reused namespaces (bug 29528)");
+it had a wrong conflict resolution.
+---
+ elf/Makefile | 22 ++++++----------------
+ 1 file changed, 6 insertions(+), 16 deletions(-)
+
+diff --git a/elf/Makefile b/elf/Makefile
+index 43353a4b08..72178d33ff 100644
+--- a/elf/Makefile
++++ b/elf/Makefile
+@@ -374,6 +374,8 @@ tests += \
+   tst-align \
+   tst-align2 \
+   tst-align3 \
++  tst-audit-tlsdesc \
++  tst-audit-tlsdesc-dlopen \
+   tst-audit1 \
+   tst-audit2 \
+   tst-audit8 \
+@@ -766,6 +768,8 @@ modules-names += \
+   tst-alignmod3 \
+   tst-array2dep \
+   tst-array5dep \
++  tst-audit-tlsdesc-mod1 \
++  tst-audit-tlsdesc-mod2 \
+   tst-audit11mod1 \
+   tst-audit11mod2 \
+   tst-audit12mod1 \
+@@ -799,6 +803,7 @@ modules-names += \
+   tst-auditmanymod7 \
+   tst-auditmanymod8 \
+   tst-auditmanymod9 \
++  tst-auditmod-tlsdesc  \
+   tst-auditmod1 \
+   tst-auditmod9a \
+   tst-auditmod9b \
+@@ -993,23 +998,8 @@ modules-names += tst-gnu2-tls1mod
+ $(objpfx)tst-gnu2-tls1: $(objpfx)tst-gnu2-tls1mod.so
+ tst-gnu2-tls1mod.so-no-z-defs = yes
+ CFLAGS-tst-gnu2-tls1mod.c += -mtls-dialect=gnu2
++endif # $(have-mtls-dialect-gnu2)
+ 
+-tests += tst-audit-tlsdesc tst-audit-tlsdesc-dlopen
+-modules-names += tst-audit-tlsdesc-mod1 tst-audit-tlsdesc-mod2 tst-auditmod-tlsdesc
+-$(objpfx)tst-audit-tlsdesc: $(objpfx)tst-audit-tlsdesc-mod1.so \
+-			    $(objpfx)tst-audit-tlsdesc-mod2.so \
+-			    $(shared-thread-library)
+-CFLAGS-tst-audit-tlsdesc-mod1.c += -mtls-dialect=gnu2
+-CFLAGS-tst-audit-tlsdesc-mod2.c += -mtls-dialect=gnu2
+-$(objpfx)tst-audit-tlsdesc-dlopen: $(shared-thread-library)
+-$(objpfx)tst-audit-tlsdesc-dlopen.out: $(objpfx)tst-audit-tlsdesc-mod1.so \
+-				       $(objpfx)tst-audit-tlsdesc-mod2.so
+-$(objpfx)tst-audit-tlsdesc-mod1.so: $(objpfx)tst-audit-tlsdesc-mod2.so
+-$(objpfx)tst-audit-tlsdesc.out: $(objpfx)tst-auditmod-tlsdesc.so
+-tst-audit-tlsdesc-ENV = LD_AUDIT=$(objpfx)tst-auditmod-tlsdesc.so
+-$(objpfx)tst-audit-tlsdesc-dlopen.out: $(objpfx)tst-auditmod-tlsdesc.so
+-tst-audit-tlsdesc-dlopen-ENV = LD_AUDIT=$(objpfx)tst-auditmod-tlsdesc.so
+-endif
+ ifeq (yes,$(have-protected-data))
+ modules-names += tst-protected1moda tst-protected1modb
+ tests += tst-protected1a tst-protected1b
+-- 
+2.38.1
+
+
+From 4b95b6e8bbb5a2b6856f707bf3bc3308ebef595a Mon Sep 17 00:00:00 2001
+From: Javier Pello <devel@otheo.eu>
+Date: Mon, 5 Sep 2022 20:09:01 +0200
+Subject: elf: Fix hwcaps string size overestimation
+
+Commit dad90d528259b669342757c37dedefa8577e2636 added glibc-hwcaps
+support for LD_LIBRARY_PATH and, for this, it adjusted the total
+string size required in _dl_important_hwcaps. However, in doing so
+it inadvertently altered the calculation of the size required for
+the power set strings, as the computation of the power set string
+size depended on the first value assigned to the total variable,
+which is later shifted, resulting in overallocation of string
+space. Fix this now by using a different variable to hold the
+string size required for glibc-hwcaps.
+
+Signed-off-by: Javier Pello <devel@otheo.eu>
+(cherry picked from commit a23820f6052a740246fdc7dcd9c43ce8eed0c45a)
+---
+ elf/dl-hwcaps.c | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/elf/dl-hwcaps.c b/elf/dl-hwcaps.c
+index 6f161f6ad5..92eb53790e 100644
+--- a/elf/dl-hwcaps.c
++++ b/elf/dl-hwcaps.c
+@@ -193,7 +193,7 @@ _dl_important_hwcaps (const char *glibc_hwcaps_prepend,
+   /* Each hwcaps subdirectory has a GLIBC_HWCAPS_PREFIX string prefix
+      and a "/" suffix once stored in the result.  */
+   hwcaps_counts.maximum_length += strlen (GLIBC_HWCAPS_PREFIX) + 1;
+-  size_t total = (hwcaps_counts.count * (strlen (GLIBC_HWCAPS_PREFIX) + 1)
++  size_t hwcaps_sz = (hwcaps_counts.count * (strlen (GLIBC_HWCAPS_PREFIX) + 1)
+ 		  + hwcaps_counts.total_length);
+ 
+   /* Count the number of bits set in the masked value.  */
+@@ -229,11 +229,12 @@ _dl_important_hwcaps (const char *glibc_hwcaps_prepend,
+   assert (m == cnt);
+ 
+   /* Determine the total size of all strings together.  */
++  size_t total;
+   if (cnt == 1)
+-    total += temp[0].len + 1;
++    total = temp[0].len + 1;
+   else
+     {
+-      total += temp[0].len + temp[cnt - 1].len + 2;
++      total = temp[0].len + temp[cnt - 1].len + 2;
+       if (cnt > 2)
+ 	{
+ 	  total <<= 1;
+@@ -255,6 +256,7 @@ _dl_important_hwcaps (const char *glibc_hwcaps_prepend,
+   /* This is the overall result, including both glibc-hwcaps
+      subdirectories and the legacy hwcaps subdirectories using the
+      power set construction.  */
++  total += hwcaps_sz;
+   struct r_strlenpair *overall_result
+     = malloc (*sz * sizeof (*result) + total);
+   if (overall_result == NULL)
+-- 
+2.38.1
+
+
+From 7a3f8c8a7aeb41d4bbfeec07d0be1e92c3019919 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 6 Sep 2022 07:38:10 +0200
+Subject: scripts/dso-ordering-test.py: Generate program run-time dependencies
+
+The main program needs to depend on all shared objects, even objects
+that have link-time dependencies among shared objects.  Filtering
+out shared objects that already have an link-time dependencies is not
+necessary here; make will do this automatically.
+
+Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
+(cherry picked from commit 183d99737298bb3200f0610fdcd1c7549c8ed560)
+---
+ scripts/dso-ordering-test.py | 13 ++++++-------
+ 1 file changed, 6 insertions(+), 7 deletions(-)
+
+diff --git a/scripts/dso-ordering-test.py b/scripts/dso-ordering-test.py
+index 2dd6bfda18..b87cf2f809 100644
+--- a/scripts/dso-ordering-test.py
++++ b/scripts/dso-ordering-test.py
+@@ -707,13 +707,12 @@ def process_testcase(t):
+                 "\t$(compile.c) $(OUTPUT_OPTION)\n")
+         makefile.write (rule)
+ 
+-        not_depended_objs = find_objs_not_depended_on(test_descr)
+-        if not_depended_objs:
+-            depstr = ""
+-            for dep in not_depended_objs:
+-                depstr += (" $(objpfx)" + test_subdir + "/"
+-                           + test_name + "-" + dep + ".so")
+-            makefile.write("$(objpfx)%s.out:%s\n" % (base_test_name, depstr))
++        # Ensure that all shared objects are built before running the
++        # test, whether there link-time dependencies or not.
++        depobjs = ["$(objpfx){}/{}-{}.so".format(test_subdir, test_name, dep)
++                   for dep in test_descr.objs]
++        makefile.write("$(objpfx){}.out: {}\n".format(
++            base_test_name, " ".join(depobjs)))
+ 
+         # Add main executable to test-srcs
+         makefile.write("test-srcs += %s/%s\n" % (test_subdir, test_name))
+-- 
+2.38.1
+
+
+From d1241cf00139733de069c84933cd576dc1a1f45e Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 6 Sep 2022 07:38:10 +0200
+Subject: elf: Rename _dl_sort_maps parameter from skip to force_first
+
+The new implementation will not be able to skip an arbitrary number
+of objects.
+
+Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
+(cherry picked from commit dbb75513f5cf9285c77c9e55777c5c35b653f890)
+---
+ elf/dl-sort-maps.c         | 14 +++++++-------
+ sysdeps/generic/ldsodefs.h |  6 ++++--
+ 2 files changed, 11 insertions(+), 9 deletions(-)
+
+diff --git a/elf/dl-sort-maps.c b/elf/dl-sort-maps.c
+index 96638d7ed1..5b550b1e94 100644
+--- a/elf/dl-sort-maps.c
++++ b/elf/dl-sort-maps.c
+@@ -27,12 +27,12 @@
+    If FOR_FINI is true, this is called for finishing an object.  */
+ static void
+ _dl_sort_maps_original (struct link_map **maps, unsigned int nmaps,
+-			unsigned int skip, bool for_fini)
++			bool force_first, bool for_fini)
+ {
+   /* Allows caller to do the common optimization of skipping the first map,
+      usually the main binary.  */
+-  maps += skip;
+-  nmaps -= skip;
++  maps += force_first;
++  nmaps -= force_first;
+ 
+   /* A list of one element need not be sorted.  */
+   if (nmaps <= 1)
+@@ -182,7 +182,7 @@ dfs_traversal (struct link_map ***rpo, struct link_map *map,
+ 
+ static void
+ _dl_sort_maps_dfs (struct link_map **maps, unsigned int nmaps,
+-		   unsigned int skip __attribute__ ((unused)), bool for_fini)
++		   bool force_first __attribute__ ((unused)), bool for_fini)
+ {
+   for (int i = nmaps - 1; i >= 0; i--)
+     maps[i]->l_visited = 0;
+@@ -286,7 +286,7 @@ _dl_sort_maps_init (void)
+ 
+ void
+ _dl_sort_maps (struct link_map **maps, unsigned int nmaps,
+-	       unsigned int skip, bool for_fini)
++	       bool force_first, bool for_fini)
+ {
+   /* It can be tempting to use a static function pointer to store and call
+      the current selected sorting algorithm routine, but experimentation
+@@ -296,9 +296,9 @@ _dl_sort_maps (struct link_map **maps, unsigned int nmaps,
+      input cases. A simple if-case with direct function calls appears to
+      be the fastest.  */
+   if (__glibc_likely (GLRO(dl_dso_sort_algo) == dso_sort_algorithm_original))
+-    _dl_sort_maps_original (maps, nmaps, skip, for_fini);
++    _dl_sort_maps_original (maps, nmaps, force_first, for_fini);
+   else
+-    _dl_sort_maps_dfs (maps, nmaps, skip, for_fini);
++    _dl_sort_maps_dfs (maps, nmaps, force_first, for_fini);
+ }
+ 
+ #endif /* HAVE_TUNABLES.  */
+diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h
+index 050a3032de..6b256b8388 100644
+--- a/sysdeps/generic/ldsodefs.h
++++ b/sysdeps/generic/ldsodefs.h
+@@ -1048,9 +1048,11 @@ extern void _dl_init (struct link_map *main_map, int argc, char **argv,
+    initializer functions have completed.  */
+ extern void _dl_fini (void) attribute_hidden;
+ 
+-/* Sort array MAPS according to dependencies of the contained objects.  */
++/* Sort array MAPS according to dependencies of the contained objects.
++   If FORCE_FIRST, MAPS[0] keeps its place even if the dependencies
++   say otherwise.  */
+ extern void _dl_sort_maps (struct link_map **maps, unsigned int nmaps,
+-			   unsigned int skip, bool for_fini) attribute_hidden;
++			   bool force_first, bool for_fini) attribute_hidden;
+ 
+ /* The dynamic linker calls this function before and having changing
+    any shared object mappings.  The `r_state' member of `struct r_debug'
+-- 
+2.38.1
+
+
+From da5f134f6d59701a3a6119309ae91c93c3fa5b51 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 20 Sep 2022 11:00:42 +0200
+Subject: elf: Implement force_first handling in _dl_sort_maps_dfs (bug 28937)
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The implementation in _dl_close_worker requires that the first
+element of l_initfini is always this very map (“We are always the
+zeroth entry, and since we don't include ourselves in the
+dependency analysis start at 1.”).  Rather than fixing that
+assumption, this commit adds an implementation of the force_first
+argument to the new dependency sorting algorithm.  This also means
+that the directly dlopen'ed shared object is always initialized last,
+which is the least surprising behavior in the presence of cycles.
+
+Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
+(cherry picked from commit 1df71d32fe5f5905ffd5d100e5e9ca8ad6210891)
+---
+ NEWS                     |  1 +
+ elf/dl-sort-maps.c       | 32 +++++++++++++++++++++++---------
+ elf/dso-sort-tests-1.def |  7 +++++++
+ 3 files changed, 31 insertions(+), 9 deletions(-)
+
+diff --git a/NEWS b/NEWS
+index 03281e3ab4..5b4753416f 100644
+--- a/NEWS
++++ b/NEWS
+@@ -20,6 +20,7 @@ The following bugs are resolved with this release:
+   [28846] CMSG_NXTHDR may trigger -Wstrict-overflow warning
+   [29305] Conserve NSS buffer space during DNS packet parsing
+   [29415] nscd: Fix netlink cache invalidation if epoll is used
++  [28937] New DSO dependency sorter does not put new map first if in a cycle
+   [29446] _dlopen now ignores dl_caller argument in static mode
+   [29485] Linux: Terminate subprocess on late failure in tst-pidfd
+   [29490] alpha: New __brk_call implementation is broken
+diff --git a/elf/dl-sort-maps.c b/elf/dl-sort-maps.c
+index 5b550b1e94..3e2a6a584e 100644
+--- a/elf/dl-sort-maps.c
++++ b/elf/dl-sort-maps.c
+@@ -182,8 +182,9 @@ dfs_traversal (struct link_map ***rpo, struct link_map *map,
+ 
+ static void
+ _dl_sort_maps_dfs (struct link_map **maps, unsigned int nmaps,
+-		   bool force_first __attribute__ ((unused)), bool for_fini)
++		   bool force_first, bool for_fini)
+ {
++  struct link_map *first_map = maps[0];
+   for (int i = nmaps - 1; i >= 0; i--)
+     maps[i]->l_visited = 0;
+ 
+@@ -208,14 +209,6 @@ _dl_sort_maps_dfs (struct link_map **maps, unsigned int nmaps,
+      Adjusting the order so that maps[0] is last traversed naturally avoids
+      this problem.
+ 
+-     Further, the old "optimization" of skipping the main object at maps[0]
+-     from the call-site (i.e. _dl_sort_maps(maps+1,nmaps-1)) is in general
+-     no longer valid, since traversing along object dependency-links
+-     may "find" the main object even when it is not included in the initial
+-     order (e.g. a dlopen()'ed shared object can have circular dependencies
+-     linked back to itself). In such a case, traversing N-1 objects will
+-     create a N-object result, and raise problems.
+-
+      To summarize, just passing in the full list, and iterating from back
+      to front makes things much more straightforward.  */
+ 
+@@ -274,6 +267,27 @@ _dl_sort_maps_dfs (struct link_map **maps, unsigned int nmaps,
+     }
+ 
+   memcpy (maps, rpo, sizeof (struct link_map *) * nmaps);
++
++  /* Skipping the first object at maps[0] is not valid in general,
++     since traversing along object dependency-links may "find" that
++     first object even when it is not included in the initial order
++     (e.g., a dlopen'ed shared object can have circular dependencies
++     linked back to itself).  In such a case, traversing N-1 objects
++     will create a N-object result, and raise problems.  Instead,
++     force the object back into first place after sorting.  This naive
++     approach may introduce further dependency ordering violations
++     compared to rotating the cycle until the first map is again in
++     the first position, but as there is a cycle, at least one
++     violation is already present.  */
++  if (force_first && maps[0] != first_map)
++    {
++      int i;
++      for (i = 0; maps[i] != first_map; ++i)
++	;
++      assert (i < nmaps);
++      memmove (&maps[1], maps, i * sizeof (maps[0]));
++      maps[0] = first_map;
++    }
+ }
+ 
+ void
+diff --git a/elf/dso-sort-tests-1.def b/elf/dso-sort-tests-1.def
+index 5f7f18ef27..4bf9052db1 100644
+--- a/elf/dso-sort-tests-1.def
++++ b/elf/dso-sort-tests-1.def
+@@ -64,3 +64,10 @@ output: b>a>{}<a<b
+ tst-bz15311: {+a;+e;+f;+g;+d;%d;-d;-g;-f;-e;-a};a->b->c->d;d=>[ba];c=>a;b=>e=>a;c=>f=>b;d=>g=>c
+ output(glibc.rtld.dynamic_sort=1): {+a[d>c>b>a>];+e[e>];+f[f>];+g[g>];+d[];%d(b(e(a()))a()g(c(a()f(b(e(a()))))));-d[];-g[];-f[];-e[];-a[<a<c<d<g<f<b<e];}
+ output(glibc.rtld.dynamic_sort=2): {+a[d>c>b>a>];+e[e>];+f[f>];+g[g>];+d[];%d(b(e(a()))a()g(c(a()f(b(e(a()))))));-d[];-g[];-f[];-e[];-a[<g<f<a<b<c<d<e];}
++
++# Test that even in the presence of dependency loops involving dlopen'ed
++# object, that object is initialized last (and not unloaded prematurely).
++# Final destructor order is indeterminate due to the cycle.
++tst-bz28937: {+a;+b;-b;+c;%c};a->a1;a->a2;a2->a;b->b1;c->a1;c=>a1
++output(glibc.rtld.dynamic_sort=1): {+a[a2>a1>a>];+b[b1>b>];-b[<b<b1];+c[c>];%c(a1());}<a<a2<c<a1
++output(glibc.rtld.dynamic_sort=2): {+a[a2>a1>a>];+b[b1>b>];-b[<b<b1];+c[c>];%c(a1());}<a2<a<c<a1
+-- 
+2.38.1
+
+
+From 52c037f3574eb9062b111d78a4cbeb79681d07d3 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 20 Sep 2022 12:12:43 +0200
+Subject: gconv: Use 64-bit interfaces in gconv_parseconfdir (bug 29583)
+
+It's possible that inode numbers are outside the 32-bit range.
+The existing code only handles the in-libc case correctly, and
+still uses the legacy interfaces when building iconv.
+
+Suggested-by: Helge Deller <deller@gmx.de>
+(cherry picked from commit f97905f24631097af325d6a231093071c3077a5f)
+---
+ NEWS                       |  1 +
+ iconv/gconv_parseconfdir.h | 16 ++++++++--------
+ 2 files changed, 9 insertions(+), 8 deletions(-)
+
+diff --git a/NEWS b/NEWS
+index 5b4753416f..eab882987b 100644
+--- a/NEWS
++++ b/NEWS
+@@ -26,6 +26,7 @@ The following bugs are resolved with this release:
+   [29490] alpha: New __brk_call implementation is broken
+   [29528] elf: Call __libc_early_init for reused namespaces
+   [29539] libc: LD_TRACE_LOADED_OBJECTS changed how vDSO library are
++  [29583] Use 64-bit interfaces in gconv_parseconfdir
+ \f
+ Version 2.36
+ 
+diff --git a/iconv/gconv_parseconfdir.h b/iconv/gconv_parseconfdir.h
+index debb96b322..b72933b526 100644
+--- a/iconv/gconv_parseconfdir.h
++++ b/iconv/gconv_parseconfdir.h
+@@ -29,14 +29,14 @@
+ # define isspace(__c) __isspace_l ((__c), _nl_C_locobj_ptr)
+ # define asprintf __asprintf
+ # define opendir __opendir
+-# define readdir __readdir
++# define readdir64 __readdir64
+ # define closedir __closedir
+ # define mempcpy __mempcpy
+-# define struct_stat struct __stat64_t64
+-# define lstat __lstat64_time64
++# define struct_stat64 struct __stat64_t64
++# define lstat64 __lstat64_time64
+ # define feof_unlocked __feof_unlocked
+ #else
+-# define struct_stat struct stat
++# define struct_stat64 struct stat64
+ #endif
+ 
+ /* Name of the file containing the module information in the directories
+@@ -148,8 +148,8 @@ gconv_parseconfdir (const char *prefix, const char *dir, size_t dir_len)
+   DIR *confdir = opendir (buf);
+   if (confdir != NULL)
+     {
+-      struct dirent *ent;
+-      while ((ent = readdir (confdir)) != NULL)
++      struct dirent64 *ent;
++      while ((ent = readdir64 (confdir)) != NULL)
+ 	{
+ 	  if (ent->d_type != DT_REG && ent->d_type != DT_UNKNOWN)
+ 	    continue;
+@@ -161,12 +161,12 @@ gconv_parseconfdir (const char *prefix, const char *dir, size_t dir_len)
+ 	      && strcmp (ent->d_name + len - strlen (suffix), suffix) == 0)
+ 	    {
+ 	      char *conf;
+-	      struct_stat st;
++	      struct_stat64 st;
+ 	      if (asprintf (&conf, "%s/%s", buf, ent->d_name) < 0)
+ 		continue;
+ 
+ 	      if (ent->d_type != DT_UNKNOWN
+-		  || (lstat (conf, &st) != -1 && S_ISREG (st.st_mode)))
++		  || (lstat64 (conf, &st) != -1 && S_ISREG (st.st_mode)))
+ 		found |= read_conf_file (conf, dir, dir_len);
+ 
+ 	      free (conf);
+-- 
+2.38.1
+
+
+From 2628500f5dff1dd99c49a09b418b3b1ea3a6b5d3 Mon Sep 17 00:00:00 2001
+From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Tue, 30 Aug 2022 10:33:15 -0300
+Subject: m68k: Enforce 4-byte alignment on internal locks (BZ #29537)
+
+A new internal definition, __LIBC_LOCK_ALIGNMENT, is used to force
+the 4-byte alignment only for m68k, other architecture keep the
+natural alignment of the type used internally (and hppa does not
+require 16-byte alignment for kernel-assisted CAS).
+
+Reviewed-by: Florian Weimer <fweimer@redhat.com>
+(cherry picked from commit aeb4d2e9815d459e2640a31f5abb8ef803830107)
+---
+ NEWS                                          |  1 +
+ sysdeps/generic/libc-lock-arch.h              | 25 +++++++++++++++++++
+ sysdeps/nptl/libc-lock.h                      |  8 +++++-
+ sysdeps/nptl/libc-lockP.h                     |  3 ++-
+ sysdeps/unix/sysv/linux/m68k/libc-lock-arch.h | 25 +++++++++++++++++++
+ 5 files changed, 60 insertions(+), 2 deletions(-)
+ create mode 100644 sysdeps/generic/libc-lock-arch.h
+ create mode 100644 sysdeps/unix/sysv/linux/m68k/libc-lock-arch.h
+
+diff --git a/NEWS b/NEWS
+index eab882987b..1cc9a16bbf 100644
+--- a/NEWS
++++ b/NEWS
+@@ -25,6 +25,7 @@ The following bugs are resolved with this release:
+   [29485] Linux: Terminate subprocess on late failure in tst-pidfd
+   [29490] alpha: New __brk_call implementation is broken
+   [29528] elf: Call __libc_early_init for reused namespaces
++  [29537] libc: [2.34 regression]: Alignment issue on m68k when using
+   [29539] libc: LD_TRACE_LOADED_OBJECTS changed how vDSO library are
+   [29583] Use 64-bit interfaces in gconv_parseconfdir
+ \f
+diff --git a/sysdeps/generic/libc-lock-arch.h b/sysdeps/generic/libc-lock-arch.h
+new file mode 100644
+index 0000000000..4713b30a8a
+--- /dev/null
++++ b/sysdeps/generic/libc-lock-arch.h
+@@ -0,0 +1,25 @@
++/* Private libc-internal arch-specific definitions.  Generic version.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public License as
++   published by the Free Software Foundation; either version 2.1 of the
++   License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; see the file COPYING.LIB.  If
++   not, see <https://www.gnu.org/licenses/>.  */
++
++#ifndef _LIBC_LOCK_ARCH_H
++#define _LIBC_LOCK_ARCH_H
++
++/* The default definition uses the natural alignment from the lock type.  */
++#define __LIBC_LOCK_ALIGNMENT
++
++#endif
+diff --git a/sysdeps/nptl/libc-lock.h b/sysdeps/nptl/libc-lock.h
+index 5af476c48b..63b3f3d75c 100644
+--- a/sysdeps/nptl/libc-lock.h
++++ b/sysdeps/nptl/libc-lock.h
+@@ -22,6 +22,7 @@
+ #include <pthread.h>
+ #define __need_NULL
+ #include <stddef.h>
++#include <libc-lock-arch.h>
+ 
+ 
+ /* Mutex type.  */
+@@ -29,7 +30,12 @@
+ # if (!IS_IN (libc) && !IS_IN (libpthread)) || !defined _LIBC
+ typedef struct { pthread_mutex_t mutex; } __libc_lock_recursive_t;
+ # else
+-typedef struct { int lock; int cnt; void *owner; } __libc_lock_recursive_t;
++typedef struct
++{
++  int lock __LIBC_LOCK_ALIGNMENT;
++  int cnt;
++  void *owner;
++} __libc_lock_recursive_t;
+ # endif
+ #else
+ typedef struct __libc_lock_recursive_opaque__ __libc_lock_recursive_t;
+diff --git a/sysdeps/nptl/libc-lockP.h b/sysdeps/nptl/libc-lockP.h
+index d3a6837fd2..425f514c5c 100644
+--- a/sysdeps/nptl/libc-lockP.h
++++ b/sysdeps/nptl/libc-lockP.h
+@@ -32,9 +32,10 @@
+    ld.so might be used on old kernels with a different libc.so.  */
+ #include <lowlevellock.h>
+ #include <tls.h>
++#include <libc-lock-arch.h>
+ 
+ /* Mutex type.  */
+-typedef int __libc_lock_t;
++typedef int __libc_lock_t __LIBC_LOCK_ALIGNMENT;
+ typedef struct { pthread_mutex_t mutex; } __rtld_lock_recursive_t;
+ typedef pthread_rwlock_t __libc_rwlock_t;
+ 
+diff --git a/sysdeps/unix/sysv/linux/m68k/libc-lock-arch.h b/sysdeps/unix/sysv/linux/m68k/libc-lock-arch.h
+new file mode 100644
+index 0000000000..1844bbaf6f
+--- /dev/null
++++ b/sysdeps/unix/sysv/linux/m68k/libc-lock-arch.h
+@@ -0,0 +1,25 @@
++/* Private libc-internal arch-specific definitions.  m68k version.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public License as
++   published by the Free Software Foundation; either version 2.1 of the
++   License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; see the file COPYING.LIB.  If
++   not, see <https://www.gnu.org/licenses/>.  */
++
++#ifndef _LIBC_LOCK_ARCH_H
++#define _LIBC_LOCK_ARCH_H
++
++/* Linux enforces 4-bytes alignment on futex inputs.  */
++#define __LIBC_LOCK_ALIGNMENT __attribute__ ((__aligned__ (4)))
++
++#endif
+-- 
+2.38.1
+
+
+From 227c9035872fc9e9e2cf56ec8f89219747ee19bc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?J=C3=B6rg=20Sonnenberger?= <joerg@bec.de>
+Date: Mon, 26 Sep 2022 13:59:16 -0400
+Subject: get_nscd_addresses: Fix subscript typos [BZ #29605]
+
+Fix the subscript on air->family, which was accidentally set to COUNT
+when it should have remained as I.
+
+Resolves: BZ #29605
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit c9226c03da0276593a0918eaa9a14835183343e8)
+---
+ sysdeps/posix/getaddrinfo.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
+index bcff909b2f..5cda9bb072 100644
+--- a/sysdeps/posix/getaddrinfo.c
++++ b/sysdeps/posix/getaddrinfo.c
+@@ -540,11 +540,11 @@ get_nscd_addresses (const char *name, const struct addrinfo *req,
+ 	  at[count].addr[2] = htonl (0xffff);
+ 	}
+       else if (req->ai_family == AF_UNSPEC
+-	       || air->family[count] == req->ai_family)
++	       || air->family[i] == req->ai_family)
+ 	{
+-	  at[count].family = air->family[count];
++	  at[count].family = air->family[i];
+ 	  memcpy (at[count].addr, addrs, size);
+-	  if (air->family[count] == AF_INET6)
++	  if (air->family[i] == AF_INET6)
+ 	    res->got_ipv6 = true;
+ 	}
+       at[count].next = at + count + 1;
+-- 
+2.38.1
+
+
+From 76e05613ee28f4ac4a0ab97effc32e0e78e37a56 Mon Sep 17 00:00:00 2001
+From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Thu, 29 Sep 2022 16:15:20 -0300
+Subject: stdlib: Fix __getrandom_nocancel type and arc4random usage (BZ
+ #29638)
+
+Using an unsigned type prevents the fallback to be used if kernel
+does not support getrandom syscall.
+
+Checked on x86_64-linux-gnu.
+
+Reviewed-by: Wilco Dijkstra  <Wilco.Dijkstra@arm.com>
+(cherry picked from commit 13db9ee2cb3b77e25f852be7d6952882e1be6f00)
+---
+ NEWS                                 | 1 +
+ stdlib/arc4random.c                  | 2 +-
+ sysdeps/unix/sysv/linux/not-cancel.h | 2 +-
+ 3 files changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/NEWS b/NEWS
+index 1cc9a16bbf..91bcfeb7a6 100644
+--- a/NEWS
++++ b/NEWS
+@@ -28,6 +28,7 @@ The following bugs are resolved with this release:
+   [29537] libc: [2.34 regression]: Alignment issue on m68k when using
+   [29539] libc: LD_TRACE_LOADED_OBJECTS changed how vDSO library are
+   [29583] Use 64-bit interfaces in gconv_parseconfdir
++  [29638] libc: stdlib: arc4random fallback is never used
+ \f
+ Version 2.36
+ 
+diff --git a/stdlib/arc4random.c b/stdlib/arc4random.c
+index e417ef624d..960a38f295 100644
+--- a/stdlib/arc4random.c
++++ b/stdlib/arc4random.c
+@@ -34,7 +34,7 @@ void
+ __arc4random_buf (void *p, size_t n)
+ {
+   static int seen_initialized;
+-  size_t l;
++  ssize_t l;
+   int fd;
+ 
+   if (n == 0)
+diff --git a/sysdeps/unix/sysv/linux/not-cancel.h b/sysdeps/unix/sysv/linux/not-cancel.h
+index a263d294b1..cf35c8bfc9 100644
+--- a/sysdeps/unix/sysv/linux/not-cancel.h
++++ b/sysdeps/unix/sysv/linux/not-cancel.h
+@@ -68,7 +68,7 @@ __writev_nocancel_nostatus (int fd, const struct iovec *iov, int iovcnt)
+   INTERNAL_SYSCALL_CALL (writev, fd, iov, iovcnt);
+ }
+ 
+-static inline int
++static inline ssize_t
+ __getrandom_nocancel (void *buf, size_t buflen, unsigned int flags)
+ {
+   return INLINE_SYSCALL_CALL (getrandom, buf, buflen, flags);
+-- 
+2.38.1
+
+
+From d1d8379bff34f02f86f82db2cef5bf66746d3560 Mon Sep 17 00:00:00 2001
+From: John David Anglin <danglin@gcc.gnu.org>
+Date: Sat, 1 Oct 2022 19:49:25 +0000
+Subject: hppa: Fix initialization of dp register [BZ 29635]
+
+After upgrading glibc to Debian 2.35-1, gdb faulted on
+startup and dropped core in a function call in the main
+application.  This was caused by not initializing the
+global dp register for the main application early enough.
+
+Restore the code to initialize dp in _dl_start_user.
+It was removed when code was added to initialize dp in
+elf_machine_runtime_setup.
+
+Signed-off-by: John David Anglin <dave.anglin@bell.net>
+---
+ sysdeps/hppa/dl-machine.h | 24 +++++++++++++++++++-----
+ 1 file changed, 19 insertions(+), 5 deletions(-)
+
+diff --git a/sysdeps/hppa/dl-machine.h b/sysdeps/hppa/dl-machine.h
+index c865713be1..1d51948566 100644
+--- a/sysdeps/hppa/dl-machine.h
++++ b/sysdeps/hppa/dl-machine.h
+@@ -347,6 +347,16 @@ elf_machine_runtime_setup (struct link_map *l, struct r_scope_elem *scope[],
+    its return value is the user program's entry point.  */
+ 
+ #define RTLD_START \
++/* Set up dp for any non-PIC lib constructors that may be called.  */	\
++static struct link_map * __attribute__((used))				\
++set_dp (struct link_map *map)						\
++{									\
++  register Elf32_Addr dp asm ("%r27");					\
++  dp = D_PTR (map, l_info[DT_PLTGOT]);					\
++  asm volatile ("" : : "r" (dp));					\
++  return map;								\
++}									\
++									\
+ asm (									\
+ "	.text\n"							\
+ "	.globl _start\n"						\
+@@ -426,6 +436,13 @@ asm (									\
+ 	   direct loader invocation.  Thus, argc and argv must be	\
+ 	   reloaded from from _dl_argc and _dl_argv.  */		\
+ 									\
++	/* Load main_map from _rtld_local and setup dp. */		\
++"	addil	LT'_rtld_local,%r19\n"					\
++"	ldw	RT'_rtld_local(%r1),%r26\n"				\
++"	bl	set_dp, %r2\n"						\
++"	ldw	0(%r26),%r26\n"						\
++"	copy	%ret0,%r26\n"						\
++									\
+ 	/* Load argc from _dl_argc.  */					\
+ "	addil	LT'_dl_argc,%r19\n"					\
+ "	ldw	RT'_dl_argc(%r1),%r20\n"				\
+@@ -438,13 +455,10 @@ asm (									\
+ "	ldw	0(%r20),%r24\n"						\
+ "	stw	%r24,-44(%sp)\n"					\
+ 									\
+-	/* Call _dl_init(main_map, argc, argv, envp). */		\
+-"	addil	LT'_rtld_local,%r19\n"					\
+-"	ldw	RT'_rtld_local(%r1),%r26\n"				\
+-"	ldw	0(%r26),%r26\n"						\
+-									\
+ 	/* envp = argv + argc + 1 */					\
+ "	sh2add	%r25,%r24,%r23\n"					\
++									\
++	/* Call _dl_init(main_map, argc, argv, envp). */		\
+ "	bl	_dl_init,%r2\n"						\
+ "	ldo	4(%r23),%r23\n"	/* delay slot */			\
+ 									\
+-- 
+2.38.1
+
+
+From cdc496eb55e30f8f2461bedb0a7381c0a7a3d3ae Mon Sep 17 00:00:00 2001
+From: John David Anglin <danglin@gcc.gnu.org>
+Date: Tue, 20 Sep 2022 20:14:14 +0000
+Subject: hppa: undef __ASSUME_SET_ROBUST_LIST
+
+QEMU does not support support set_robust_list. Thus, we need
+to enable detection of set_robust_list system call.
+
+Signed-off-by: John David Anglin <dave.anglin@bell.net>
+---
+ sysdeps/unix/sysv/linux/hppa/kernel-features.h | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/sysdeps/unix/sysv/linux/hppa/kernel-features.h b/sysdeps/unix/sysv/linux/hppa/kernel-features.h
+index 0cd21ef0fa..079612e4aa 100644
+--- a/sysdeps/unix/sysv/linux/hppa/kernel-features.h
++++ b/sysdeps/unix/sysv/linux/hppa/kernel-features.h
+@@ -30,3 +30,6 @@
+ 
+ #undef __ASSUME_CLONE_DEFAULT
+ #define __ASSUME_CLONE_BACKWARDS 1
++
++/* QEMU does not support set_robust_list.  */
++#undef __ASSUME_SET_ROBUST_LIST
+-- 
+2.38.1
+
+
+From 18bec23cbb4d530a2a8ce95353770661fabcd55f Mon Sep 17 00:00:00 2001
+From: Aurelien Jarno <aurelien@aurel32.net>
+Date: Mon, 3 Oct 2022 23:46:11 +0200
+Subject: x86: include BMI1 and BMI2 in x86-64-v3 level
+
+The "System V Application Binary Interface AMD64 Architecture Processor
+Supplement" mandates the BMI1 and BMI2 CPU features for the x86-64-v3
+level.
+
+Reviewed-by: Noah Goldstein  <goldstein.w.n@gmail.com>
+(cherry picked from commit b80f16adbd979831bf25ea491e1261e81885c2b6)
+---
+ sysdeps/x86/get-isa-level.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/sysdeps/x86/get-isa-level.h b/sysdeps/x86/get-isa-level.h
+index 1ade78ab73..5b4dd5f062 100644
+--- a/sysdeps/x86/get-isa-level.h
++++ b/sysdeps/x86/get-isa-level.h
+@@ -47,6 +47,8 @@ get_isa_level (const struct cpu_features *cpu_features)
+ 	  isa_level |= GNU_PROPERTY_X86_ISA_1_V2;
+ 	  if (CPU_FEATURE_USABLE_P (cpu_features, AVX)
+ 	      && CPU_FEATURE_USABLE_P (cpu_features, AVX2)
++	      && CPU_FEATURE_USABLE_P (cpu_features, BMI1)
++	      && CPU_FEATURE_USABLE_P (cpu_features, BMI2)
+ 	      && CPU_FEATURE_USABLE_P (cpu_features, F16C)
+ 	      && CPU_FEATURE_USABLE_P (cpu_features, FMA)
+ 	      && CPU_FEATURE_USABLE_P (cpu_features, LZCNT)
+-- 
+2.38.1
+
+
+From 46479e5d10ed87825aa277da158d6a687974518b Mon Sep 17 00:00:00 2001
+From: Aurelien Jarno <aurelien@aurel32.net>
+Date: Mon, 3 Oct 2022 23:46:11 +0200
+Subject: x86-64: Require BMI2 for AVX2 str(n)casecmp implementations
+
+The AVX2 str(n)casecmp implementations use the 'bzhi' instruction, which
+belongs to the BMI2 CPU feature.
+
+NB: It also uses the 'tzcnt' BMI1 instruction, but it is executed as BSF
+as BSF if the CPU doesn't support TZCNT, and produces the same result
+for non-zero input.
+
+Partially fixes: b77b06e0e296 ("x86: Optimize strcmp-avx2.S")
+Partially resolves: BZ #29611
+
+Reviewed-by: Noah Goldstein  <goldstein.w.n@gmail.com>
+(cherry picked from commit 10f79d3670b036925da63dc532b122d27ce65ff8)
+---
+ sysdeps/x86_64/multiarch/ifunc-impl-list.c  | 28 +++++++++++++++------
+ sysdeps/x86_64/multiarch/ifunc-strcasecmp.h |  1 +
+ 2 files changed, 21 insertions(+), 8 deletions(-)
+
+diff --git a/sysdeps/x86_64/multiarch/ifunc-impl-list.c b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
+index a71444eccb..d208fae4bf 100644
+--- a/sysdeps/x86_64/multiarch/ifunc-impl-list.c
++++ b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
+@@ -448,13 +448,16 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
+   IFUNC_IMPL (i, name, strcasecmp,
+ 	      X86_IFUNC_IMPL_ADD_V4 (array, i, strcasecmp,
+ 				     (CPU_FEATURE_USABLE (AVX512VL)
+-				      && CPU_FEATURE_USABLE (AVX512BW)),
++				      && CPU_FEATURE_USABLE (AVX512BW)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __strcasecmp_evex)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, strcasecmp,
+-				     CPU_FEATURE_USABLE (AVX2),
++				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __strcasecmp_avx2)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, strcasecmp,
+ 				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)
+ 				      && CPU_FEATURE_USABLE (RTM)),
+ 				     __strcasecmp_avx2_rtm)
+ 	      X86_IFUNC_IMPL_ADD_V2 (array, i, strcasecmp,
+@@ -470,13 +473,16 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
+   IFUNC_IMPL (i, name, strcasecmp_l,
+ 	      X86_IFUNC_IMPL_ADD_V4 (array, i, strcasecmp,
+ 				     (CPU_FEATURE_USABLE (AVX512VL)
+-				      && CPU_FEATURE_USABLE (AVX512BW)),
++				      && CPU_FEATURE_USABLE (AVX512BW)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __strcasecmp_l_evex)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, strcasecmp,
+-				     CPU_FEATURE_USABLE (AVX2),
++				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __strcasecmp_l_avx2)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, strcasecmp,
+ 				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)
+ 				      && CPU_FEATURE_USABLE (RTM)),
+ 				     __strcasecmp_l_avx2_rtm)
+ 	      X86_IFUNC_IMPL_ADD_V2 (array, i, strcasecmp_l,
+@@ -638,13 +644,16 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
+   IFUNC_IMPL (i, name, strncasecmp,
+ 	      X86_IFUNC_IMPL_ADD_V4 (array, i, strncasecmp,
+ 				     (CPU_FEATURE_USABLE (AVX512VL)
+-				      && CPU_FEATURE_USABLE (AVX512BW)),
++				      && CPU_FEATURE_USABLE (AVX512BW)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __strncasecmp_evex)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, strncasecmp,
+-				     CPU_FEATURE_USABLE (AVX2),
++				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __strncasecmp_avx2)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, strncasecmp,
+ 				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)
+ 				      && CPU_FEATURE_USABLE (RTM)),
+ 				     __strncasecmp_avx2_rtm)
+ 	      X86_IFUNC_IMPL_ADD_V2 (array, i, strncasecmp,
+@@ -660,13 +669,16 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
+   IFUNC_IMPL (i, name, strncasecmp_l,
+ 	      X86_IFUNC_IMPL_ADD_V4 (array, i, strncasecmp,
+ 				     (CPU_FEATURE_USABLE (AVX512VL)
+-				      && CPU_FEATURE_USABLE (AVX512BW)),
++				      & CPU_FEATURE_USABLE (AVX512BW)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __strncasecmp_l_evex)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, strncasecmp,
+-				     CPU_FEATURE_USABLE (AVX2),
++				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __strncasecmp_l_avx2)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, strncasecmp,
+ 				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)
+ 				      && CPU_FEATURE_USABLE (RTM)),
+ 				     __strncasecmp_l_avx2_rtm)
+ 	      X86_IFUNC_IMPL_ADD_V2 (array, i, strncasecmp_l,
+diff --git a/sysdeps/x86_64/multiarch/ifunc-strcasecmp.h b/sysdeps/x86_64/multiarch/ifunc-strcasecmp.h
+index 68646ef199..7622af259c 100644
+--- a/sysdeps/x86_64/multiarch/ifunc-strcasecmp.h
++++ b/sysdeps/x86_64/multiarch/ifunc-strcasecmp.h
+@@ -34,6 +34,7 @@ IFUNC_SELECTOR (void)
+   const struct cpu_features *cpu_features = __get_cpu_features ();
+ 
+   if (X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, AVX2)
++      && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, BMI2)
+       && X86_ISA_CPU_FEATURES_ARCH_P (cpu_features,
+ 				      AVX_Fast_Unaligned_Load, ))
+     {
+-- 
+2.38.1
+
+
+From 7afbd1e56acb721031bffd876f275dcb1af7e530 Mon Sep 17 00:00:00 2001
+From: Aurelien Jarno <aurelien@aurel32.net>
+Date: Mon, 3 Oct 2022 23:46:11 +0200
+Subject: x86-64: Require BMI2 for AVX2 strcmp implementation
+
+The AVX2 strcmp implementation uses the 'bzhi' instruction, which
+belongs to the BMI2 CPU feature.
+
+NB: It also uses the 'tzcnt' BMI1 instruction, but it is executed as BSF
+as BSF if the CPU doesn't support TZCNT, and produces the same result
+for non-zero input.
+
+Partially fixes: b77b06e0e296 ("x86: Optimize strcmp-avx2.S")
+Partially resolves: BZ #29611
+
+Reviewed-by: Noah Goldstein  <goldstein.w.n@gmail.com>
+(cherry picked from commit 4d64c6445735e9b34e2ac8e369312cbfc2f88e17)
+---
+ sysdeps/x86_64/multiarch/ifunc-impl-list.c | 4 +++-
+ sysdeps/x86_64/multiarch/strcmp.c          | 4 ++--
+ 2 files changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/sysdeps/x86_64/multiarch/ifunc-impl-list.c b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
+index d208fae4bf..a42b0a4620 100644
+--- a/sysdeps/x86_64/multiarch/ifunc-impl-list.c
++++ b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
+@@ -591,10 +591,12 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
+ 				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __strcmp_evex)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, strcmp,
+-				     CPU_FEATURE_USABLE (AVX2),
++				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __strcmp_avx2)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, strcmp,
+ 				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)
+ 				      && CPU_FEATURE_USABLE (RTM)),
+ 				     __strcmp_avx2_rtm)
+ 	      X86_IFUNC_IMPL_ADD_V2 (array, i, strcmp,
+diff --git a/sysdeps/x86_64/multiarch/strcmp.c b/sysdeps/x86_64/multiarch/strcmp.c
+index fdd5afe3af..9d6c9f66ba 100644
+--- a/sysdeps/x86_64/multiarch/strcmp.c
++++ b/sysdeps/x86_64/multiarch/strcmp.c
+@@ -45,12 +45,12 @@ IFUNC_SELECTOR (void)
+   const struct cpu_features *cpu_features = __get_cpu_features ();
+ 
+   if (X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, AVX2)
++      && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, BMI2)
+       && X86_ISA_CPU_FEATURES_ARCH_P (cpu_features,
+ 				      AVX_Fast_Unaligned_Load, ))
+     {
+       if (X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, AVX512VL)
+-	  && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, AVX512BW)
+-	  && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, BMI2))
++	  && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, AVX512BW))
+ 	return OPTIMIZE (evex);
+ 
+       if (CPU_FEATURE_USABLE_P (cpu_features, RTM))
+-- 
+2.38.1
+
+
+From 29c577e0f54fe6e70ceacb3659179781c5569903 Mon Sep 17 00:00:00 2001
+From: Aurelien Jarno <aurelien@aurel32.net>
+Date: Mon, 3 Oct 2022 23:46:11 +0200
+Subject: x86-64: Require BMI2 for AVX2 strncmp implementation
+
+The AVX2 strncmp implementations uses the 'bzhi' instruction, which
+belongs to the BMI2 CPU feature.
+
+NB: It also uses the 'tzcnt' BMI1 instruction, but it is executed as BSF
+as BSF if the CPU doesn't support TZCNT, and produces the same result
+for non-zero input.
+
+Partially fixes: b77b06e0e296 ("x86: Optimize strcmp-avx2.S")
+Partially resolves: BZ #29611
+
+Reviewed-by: Noah Goldstein  <goldstein.w.n@gmail.com>
+(cherry picked from commit fc7de1d9b99ae1676bc626ddca422d7abee0eb48)
+---
+ sysdeps/x86_64/multiarch/ifunc-impl-list.c | 7 +++++--
+ sysdeps/x86_64/multiarch/strncmp.c         | 4 ++--
+ 2 files changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/sysdeps/x86_64/multiarch/ifunc-impl-list.c b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
+index a42b0a4620..aebef3daaf 100644
+--- a/sysdeps/x86_64/multiarch/ifunc-impl-list.c
++++ b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
+@@ -1176,13 +1176,16 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
+   IFUNC_IMPL (i, name, strncmp,
+ 	      X86_IFUNC_IMPL_ADD_V4 (array, i, strncmp,
+ 				     (CPU_FEATURE_USABLE (AVX512VL)
+-				      && CPU_FEATURE_USABLE (AVX512BW)),
++				      && CPU_FEATURE_USABLE (AVX512BW)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __strncmp_evex)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, strncmp,
+-				     CPU_FEATURE_USABLE (AVX2),
++				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __strncmp_avx2)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, strncmp,
+ 				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)
+ 				      && CPU_FEATURE_USABLE (RTM)),
+ 				     __strncmp_avx2_rtm)
+ 	      X86_IFUNC_IMPL_ADD_V2 (array, i, strncmp,
+diff --git a/sysdeps/x86_64/multiarch/strncmp.c b/sysdeps/x86_64/multiarch/strncmp.c
+index 4ebe4bde30..c4f8b6bbb5 100644
+--- a/sysdeps/x86_64/multiarch/strncmp.c
++++ b/sysdeps/x86_64/multiarch/strncmp.c
+@@ -41,12 +41,12 @@ IFUNC_SELECTOR (void)
+   const struct cpu_features *cpu_features = __get_cpu_features ();
+ 
+   if (X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, AVX2)
++      && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, BMI2)
+       && X86_ISA_CPU_FEATURES_ARCH_P (cpu_features,
+ 				      AVX_Fast_Unaligned_Load, ))
+     {
+       if (X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, AVX512VL)
+-	  && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, AVX512BW)
+-	  && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, BMI2))
++	  && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, AVX512BW))
+ 	return OPTIMIZE (evex);
+ 
+       if (CPU_FEATURE_USABLE_P (cpu_features, RTM))
+-- 
+2.38.1
+
+
+From d8bf4388df679fa5a3ae7889a649e573e3124530 Mon Sep 17 00:00:00 2001
+From: Aurelien Jarno <aurelien@aurel32.net>
+Date: Mon, 3 Oct 2022 23:46:11 +0200
+Subject: x86-64: Require BMI2 for AVX2 wcs(n)cmp implementations
+
+The AVX2 wcs(n)cmp implementations use the 'bzhi' instruction, which
+belongs to the BMI2 CPU feature.
+
+NB: It also uses the 'tzcnt' BMI1 instruction, but it is executed as BSF
+as BSF if the CPU doesn't support TZCNT, and produces the same result
+for non-zero input.
+
+Partially fixes: b77b06e0e296 ("x86: Optimize strcmp-avx2.S")
+Partially resolves: BZ #29611
+
+Reviewed-by: Noah Goldstein  <goldstein.w.n@gmail.com>
+(cherry picked from commit f31a5a884ed84bd37032729d4d1eb9d06c9f3c29)
+---
+ sysdeps/x86_64/multiarch/ifunc-impl-list.c | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/sysdeps/x86_64/multiarch/ifunc-impl-list.c b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
+index aebef3daaf..fec8790c11 100644
+--- a/sysdeps/x86_64/multiarch/ifunc-impl-list.c
++++ b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
+@@ -810,10 +810,12 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
+ 				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __wcscmp_evex)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, wcscmp,
+-				     CPU_FEATURE_USABLE (AVX2),
++				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __wcscmp_avx2)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, wcscmp,
+ 				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)
+ 				      && CPU_FEATURE_USABLE (RTM)),
+ 				     __wcscmp_avx2_rtm)
+ 	      /* ISA V2 wrapper for SSE2 implementation because the SSE2
+@@ -830,10 +832,12 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
+ 				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __wcsncmp_evex)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, wcsncmp,
+-				     CPU_FEATURE_USABLE (AVX2),
++				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __wcsncmp_avx2)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, wcsncmp,
+ 				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)
+ 				      && CPU_FEATURE_USABLE (RTM)),
+ 				     __wcsncmp_avx2_rtm)
+ 	      /* ISA V2 wrapper for GENERIC implementation because the
+-- 
+2.38.1
+
+
+From d9196d4f3fa9997388655813ddd236426a16dd92 Mon Sep 17 00:00:00 2001
+From: Aurelien Jarno <aurelien@aurel32.net>
+Date: Mon, 3 Oct 2022 23:46:11 +0200
+Subject: x86-64: Require BMI2 for AVX2 (raw|w)memchr implementations
+
+The AVX2 memchr, rawmemchr and wmemchr implementations use the 'bzhi'
+and 'sarx' instructions, which belongs to the BMI2 CPU feature.
+
+Fixes: acfd088a1963 ("x86: Optimize memchr-avx2.S")
+Partially resolves: BZ #29611
+
+Reviewed-by: Noah Goldstein  <goldstein.w.n@gmail.com>
+(cherry picked from commit e3e7fab7fe5186d18ca2046d99ba321c27db30ad)
+---
+ sysdeps/x86_64/multiarch/ifunc-impl-list.c | 12 +++++++++---
+ 1 file changed, 9 insertions(+), 3 deletions(-)
+
+diff --git a/sysdeps/x86_64/multiarch/ifunc-impl-list.c b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
+index fec8790c11..7c84963d92 100644
+--- a/sysdeps/x86_64/multiarch/ifunc-impl-list.c
++++ b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
+@@ -69,10 +69,12 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
+ 				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __memchr_evex_rtm)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, memchr,
+-				     CPU_FEATURE_USABLE (AVX2),
++				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __memchr_avx2)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, memchr,
+ 				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)
+ 				      && CPU_FEATURE_USABLE (RTM)),
+ 				     __memchr_avx2_rtm)
+ 	      /* ISA V2 wrapper for SSE2 implementation because the SSE2
+@@ -335,10 +337,12 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
+ 				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __rawmemchr_evex_rtm)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, rawmemchr,
+-				     CPU_FEATURE_USABLE (AVX2),
++				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __rawmemchr_avx2)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, rawmemchr,
+ 				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)
+ 				      && CPU_FEATURE_USABLE (RTM)),
+ 				     __rawmemchr_avx2_rtm)
+ 	      /* ISA V2 wrapper for SSE2 implementation because the SSE2
+@@ -927,10 +931,12 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
+ 				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __wmemchr_evex_rtm)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, wmemchr,
+-				     CPU_FEATURE_USABLE (AVX2),
++				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __wmemchr_avx2)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, wmemchr,
+ 				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)
+ 				      && CPU_FEATURE_USABLE (RTM)),
+ 				     __wmemchr_avx2_rtm)
+ 	      /* ISA V2 wrapper for SSE2 implementation because the SSE2
+-- 
+2.38.1
+
+
+From 923c3f3c373f499e62160e00831dda576443317b Mon Sep 17 00:00:00 2001
+From: Aurelien Jarno <aurelien@aurel32.net>
+Date: Mon, 3 Oct 2022 23:46:11 +0200
+Subject: x86-64: Require BMI2 and LZCNT for AVX2 memrchr implementation
+
+The AVX2 memrchr implementation uses the 'shlxl' instruction, which
+belongs to the BMI2 CPU feature and uses the 'lzcnt' instruction, which
+belongs to the LZCNT CPU feature.
+
+Fixes: af5306a735eb ("x86: Optimize memrchr-avx2.S")
+Partially resolves: BZ #29611
+
+Reviewed-by: Noah Goldstein  <goldstein.w.n@gmail.com>
+(cherry picked from commit 3c0c78afabfed4b6fc161c159e628fbf14ff370b)
+---
+ sysdeps/x86/isa-level.h                    |  1 +
+ sysdeps/x86_64/multiarch/ifunc-avx2.h      |  1 +
+ sysdeps/x86_64/multiarch/ifunc-impl-list.c | 10 ++++++++--
+ 3 files changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/sysdeps/x86/isa-level.h b/sysdeps/x86/isa-level.h
+index 3c4480aba7..bbb90f5c5e 100644
+--- a/sysdeps/x86/isa-level.h
++++ b/sysdeps/x86/isa-level.h
+@@ -80,6 +80,7 @@
+ #define AVX_X86_ISA_LEVEL 3
+ #define AVX2_X86_ISA_LEVEL 3
+ #define BMI2_X86_ISA_LEVEL 3
++#define LZCNT_X86_ISA_LEVEL 3
+ #define MOVBE_X86_ISA_LEVEL 3
+ 
+ /* ISA level >= 2 guaranteed includes.  */
+diff --git a/sysdeps/x86_64/multiarch/ifunc-avx2.h b/sysdeps/x86_64/multiarch/ifunc-avx2.h
+index a57a9952f3..f1741083fd 100644
+--- a/sysdeps/x86_64/multiarch/ifunc-avx2.h
++++ b/sysdeps/x86_64/multiarch/ifunc-avx2.h
+@@ -37,6 +37,7 @@ IFUNC_SELECTOR (void)
+ 
+   if (X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, AVX2)
+       && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, BMI2)
++      && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, LZCNT)
+       && X86_ISA_CPU_FEATURES_ARCH_P (cpu_features,
+ 				      AVX_Fast_Unaligned_Load, ))
+     {
+diff --git a/sysdeps/x86_64/multiarch/ifunc-impl-list.c b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
+index 7c84963d92..ec1c5b55fb 100644
+--- a/sysdeps/x86_64/multiarch/ifunc-impl-list.c
++++ b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
+@@ -209,13 +209,19 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
+   IFUNC_IMPL (i, name, memrchr,
+ 	      X86_IFUNC_IMPL_ADD_V4 (array, i, memrchr,
+ 				     (CPU_FEATURE_USABLE (AVX512VL)
+-				      && CPU_FEATURE_USABLE (AVX512BW)),
++				      && CPU_FEATURE_USABLE (AVX512BW)
++				      && CPU_FEATURE_USABLE (BMI2)
++				      && CPU_FEATURE_USABLE (LZCNT)),
+ 				     __memrchr_evex)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, memrchr,
+-				     CPU_FEATURE_USABLE (AVX2),
++				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)
++				      && CPU_FEATURE_USABLE (LZCNT)),
+ 				     __memrchr_avx2)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, memrchr,
+ 				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)
++				      && CPU_FEATURE_USABLE (LZCNT)
+ 				      && CPU_FEATURE_USABLE (RTM)),
+ 				     __memrchr_avx2_rtm)
+ 	      /* ISA V2 wrapper for SSE2 implementation because the SSE2
+-- 
+2.38.1
+
+
+From 2d8ef784bd6a784496a6fd460de6b6f57c70a501 Mon Sep 17 00:00:00 2001
+From: Aurelien Jarno <aurelien@aurel32.net>
+Date: Mon, 3 Oct 2022 23:46:11 +0200
+Subject: x86-64: Require BMI1/BMI2 for AVX2 strrchr and wcsrchr
+ implementations
+
+The AVX2 strrchr and wcsrchr implementation uses the 'blsmsk'
+instruction which belongs to the BMI1 CPU feature and the 'shrx'
+instruction, which belongs to the BMI2 CPU feature.
+
+Fixes: df7e295d18ff ("x86: Optimize {str|wcs}rchr-avx2")
+Partially resolves: BZ #29611
+
+Reviewed-by: Noah Goldstein  <goldstein.w.n@gmail.com>
+(cherry picked from commit 7e8283170c5d6805b609a040801d819e362a6292)
+---
+ sysdeps/x86/isa-level.h                    |  1 +
+ sysdeps/x86_64/multiarch/ifunc-avx2.h      |  1 +
+ sysdeps/x86_64/multiarch/ifunc-impl-list.c | 17 ++++++++++++++---
+ 3 files changed, 16 insertions(+), 3 deletions(-)
+
+diff --git a/sysdeps/x86/isa-level.h b/sysdeps/x86/isa-level.h
+index bbb90f5c5e..06f6c9663e 100644
+--- a/sysdeps/x86/isa-level.h
++++ b/sysdeps/x86/isa-level.h
+@@ -79,6 +79,7 @@
+ /* ISA level >= 3 guaranteed includes.  */
+ #define AVX_X86_ISA_LEVEL 3
+ #define AVX2_X86_ISA_LEVEL 3
++#define BMI1_X86_ISA_LEVEL 3
+ #define BMI2_X86_ISA_LEVEL 3
+ #define LZCNT_X86_ISA_LEVEL 3
+ #define MOVBE_X86_ISA_LEVEL 3
+diff --git a/sysdeps/x86_64/multiarch/ifunc-avx2.h b/sysdeps/x86_64/multiarch/ifunc-avx2.h
+index f1741083fd..f2f5e8a211 100644
+--- a/sysdeps/x86_64/multiarch/ifunc-avx2.h
++++ b/sysdeps/x86_64/multiarch/ifunc-avx2.h
+@@ -36,6 +36,7 @@ IFUNC_SELECTOR (void)
+   const struct cpu_features *cpu_features = __get_cpu_features ();
+ 
+   if (X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, AVX2)
++      && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, BMI1)
+       && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, BMI2)
+       && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, LZCNT)
+       && X86_ISA_CPU_FEATURES_ARCH_P (cpu_features,
+diff --git a/sysdeps/x86_64/multiarch/ifunc-impl-list.c b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
+index ec1c5b55fb..00a91123d3 100644
+--- a/sysdeps/x86_64/multiarch/ifunc-impl-list.c
++++ b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
+@@ -578,13 +578,19 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
+   IFUNC_IMPL (i, name, strrchr,
+ 	      X86_IFUNC_IMPL_ADD_V4 (array, i, strrchr,
+ 				     (CPU_FEATURE_USABLE (AVX512VL)
+-				      && CPU_FEATURE_USABLE (AVX512BW)),
++				      && CPU_FEATURE_USABLE (AVX512BW)
++				      && CPU_FEATURE_USABLE (BMI1)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __strrchr_evex)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, strrchr,
+-				     CPU_FEATURE_USABLE (AVX2),
++				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI1)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __strrchr_avx2)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, strrchr,
+ 				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI1)
++				      && CPU_FEATURE_USABLE (BMI2)
+ 				      && CPU_FEATURE_USABLE (RTM)),
+ 				     __strrchr_avx2_rtm)
+ 	      /* ISA V2 wrapper for SSE2 implementation because the SSE2
+@@ -797,13 +803,18 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
+ 	      X86_IFUNC_IMPL_ADD_V4 (array, i, wcsrchr,
+ 				     (CPU_FEATURE_USABLE (AVX512VL)
+ 				      && CPU_FEATURE_USABLE (AVX512BW)
++				      && CPU_FEATURE_USABLE (BMI1)
+ 				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __wcsrchr_evex)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, wcsrchr,
+-				     CPU_FEATURE_USABLE (AVX2),
++				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI1)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __wcsrchr_avx2)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, wcsrchr,
+ 				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI1)
++				      && CPU_FEATURE_USABLE (BMI2)
+ 				      && CPU_FEATURE_USABLE (RTM)),
+ 				     __wcsrchr_avx2_rtm)
+ 	      /* ISA V2 wrapper for SSE2 implementation because the SSE2
+-- 
+2.38.1
+
+
+From 2bd815d8347851212b9a91dbdca8053f4dbdac87 Mon Sep 17 00:00:00 2001
+From: Siddhesh Poyarekar <siddhesh@sourceware.org>
+Date: Tue, 4 Oct 2022 18:43:50 -0400
+Subject: nscd: Drop local address tuple variable [BZ #29607]
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+When a request needs to be resent (e.g. due to insufficient buffer
+space), the references to subsequent tuples in the local variable are
+stale and should not be used.  This used to work by accident before, but
+since 1d495912a it no longer does.  Instead of trying to reset it, just
+let gethostbyname4_r write into TUMPBUF6 for us, thus maintaining a
+consistent state at all times.  This is now consistent with what is done
+in gaih_inet for getaddrinfo.
+
+Resolves: BZ #29607
+Reported-by: Holger Hoffstätte <holger@applied-asynchrony.com>
+Tested-by: Holger Hoffstätte <holger@applied-asynchrony.com>
+Reviewed-by: Carlos O'Donell <carlos@redhat.com>
+(cherry picked from commit 6e33e5c4b73cea7b8aa3de0947123db16200fb65)
+---
+ NEWS           | 2 ++
+ nscd/aicache.c | 5 ++---
+ 2 files changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/NEWS b/NEWS
+index 91bcfeb7a6..63e26d7062 100644
+--- a/NEWS
++++ b/NEWS
+@@ -28,6 +28,8 @@ The following bugs are resolved with this release:
+   [29537] libc: [2.34 regression]: Alignment issue on m68k when using
+   [29539] libc: LD_TRACE_LOADED_OBJECTS changed how vDSO library are
+   [29583] Use 64-bit interfaces in gconv_parseconfdir
++  [29607] nscd repeatably crashes calling __strlen_avx2 when hosts cache is
++    enabled
+   [29638] libc: stdlib: arc4random fallback is never used
+ \f
+ Version 2.36
+diff --git a/nscd/aicache.c b/nscd/aicache.c
+index 51e793199f..e0baed170b 100644
+--- a/nscd/aicache.c
++++ b/nscd/aicache.c
+@@ -110,11 +110,10 @@ addhstaiX (struct database_dyn *db, int fd, request_header *req,
+ 							  "gethostbyname4_r");
+       if (fct4 != NULL)
+ 	{
+-	  struct gaih_addrtuple atmem;
+ 	  struct gaih_addrtuple *at;
+ 	  while (1)
+ 	    {
+-	      at = &atmem;
++	      at = NULL;
+ 	      rc6 = 0;
+ 	      herrno = 0;
+ 	      status[1] = DL_CALL_FCT (fct4, (key, &at,
+@@ -137,7 +136,7 @@ addhstaiX (struct database_dyn *db, int fd, request_header *req,
+ 	    goto next_nip;
+ 
+ 	  /* We found the data.  Count the addresses and the size.  */
+-	  for (const struct gaih_addrtuple *at2 = at = &atmem; at2 != NULL;
++	  for (const struct gaih_addrtuple *at2 = at; at2 != NULL;
+ 	       at2 = at2->next)
+ 	    {
+ 	      ++naddrs;
+-- 
+2.38.1
+
+
+From 3e279192749cfcae4ceebb1f21a3275e677d0561 Mon Sep 17 00:00:00 2001
+From: Michael Hudson-Doyle <michael.hudson@canonical.com>
+Date: Fri, 12 Aug 2022 11:29:31 +1200
+Subject: Ensure calculations happen with desired rounding mode in y1lf128
+
+math/test-float128-y1 fails on x86_64 and ppc64el with gcc 12 and -O3,
+because code inside a block guarded by SET_RESTORE_ROUNDL is being moved
+after the rounding mode has been restored. Use math_force_eval to
+prevent this (and insert some math_opt_barrier calls to prevent code
+from being moved before the rounding mode is set).
+
+Fixes #29463
+
+Reviewed-By: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
+(cherry picked from commit 2b274fd8c9c776cf70fcdb8356e678ada522a7b0)
+---
+ NEWS                             | 1 +
+ sysdeps/ieee754/ldbl-128/e_j1l.c | 3 +++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/NEWS b/NEWS
+index 63e26d7062..bea1d8a11f 100644
+--- a/NEWS
++++ b/NEWS
+@@ -24,6 +24,7 @@ The following bugs are resolved with this release:
+   [29446] _dlopen now ignores dl_caller argument in static mode
+   [29485] Linux: Terminate subprocess on late failure in tst-pidfd
+   [29490] alpha: New __brk_call implementation is broken
++  [29463] math/test-float128-y1 fails on x86_64
+   [29528] elf: Call __libc_early_init for reused namespaces
+   [29537] libc: [2.34 regression]: Alignment issue on m68k when using
+   [29539] libc: LD_TRACE_LOADED_OBJECTS changed how vDSO library are
+diff --git a/sysdeps/ieee754/ldbl-128/e_j1l.c b/sysdeps/ieee754/ldbl-128/e_j1l.c
+index 54c457681a..9a9c5c6f00 100644
+--- a/sysdeps/ieee754/ldbl-128/e_j1l.c
++++ b/sysdeps/ieee754/ldbl-128/e_j1l.c
+@@ -869,10 +869,13 @@ __ieee754_y1l (_Float128 x)
+     {
+       /* 0 <= x <= 2 */
+       SET_RESTORE_ROUNDL (FE_TONEAREST);
++      xx = math_opt_barrier (xx);
++      x = math_opt_barrier (x);
+       z = xx * xx;
+       p = xx * neval (z, Y0_2N, NY0_2N) / deval (z, Y0_2D, NY0_2D);
+       p = -TWOOPI / xx + p;
+       p = TWOOPI * __ieee754_logl (x) * __ieee754_j1l (x) + p;
++      math_force_eval (p);
+       return p;
+     }
+ 
+-- 
+2.38.1
+
+
+From 700d3281f9e57b53c27bc991394b22d467432626 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 13 Sep 2022 16:10:20 +0200
+Subject: nss: Implement --no-addrconfig option for getent
+
+The ahosts, ahostsv4, ahostsv6 commands unconditionally pass
+AI_ADDRCONFIG to getaddrinfo, which is not always desired.
+
+Reviewed-by: Carlos O'Donell <carlos@redhat.com>
+(cherry picked from commit a623f13adfac47c8634a7288e08f821a846bc650)
+---
+ NEWS         |  7 +++++++
+ nss/getent.c | 11 ++++++++++-
+ 2 files changed, 17 insertions(+), 1 deletion(-)
+
+diff --git a/NEWS b/NEWS
+index bea1d8a11f..462a12253d 100644
+--- a/NEWS
++++ b/NEWS
+@@ -7,6 +7,13 @@ using `glibc' in the "product" field.
+ \f
+ Version 2.36.1
+ 
++Major new features:
++
++* The getent tool now supports the --no-addrconfig option. The output of
++  getent with --no-addrconfig may contain addresses of families not
++  configured on the current host i.e. as-if you had not passed
++  AI_ADDRCONFIG to getaddrinfo calls.
++
+ Security related changes:
+ 
+   CVE-2022-39046: When the syslog function is passed a crafted input
+diff --git a/nss/getent.c b/nss/getent.c
+index 8178b4b470..d2d2524b0c 100644
+--- a/nss/getent.c
++++ b/nss/getent.c
+@@ -58,6 +58,8 @@ static const struct argp_option args_options[] =
+   {
+     { "service", 's', N_("CONFIG"), 0, N_("Service configuration to be used") },
+     { "no-idn", 'i', NULL, 0, N_("disable IDN encoding") },
++    { "no-addrconfig", 'A', NULL, 0,
++      N_("do not filter out unsupported IPv4/IPv6 addresses (with ahosts*)") },
+     { NULL, 0, NULL, 0, NULL },
+   };
+ 
+@@ -79,6 +81,9 @@ static struct argp argp =
+ /* Additional getaddrinfo flags for IDN encoding.  */
+ static int idn_flags = AI_IDN | AI_CANONIDN;
+ 
++/* Set to 0 by --no-addrconfig.  */
++static int addrconfig_flags = AI_ADDRCONFIG;
++
+ /* Print the version information.  */
+ static void
+ print_version (FILE *stream, struct argp_state *state)
+@@ -346,7 +351,7 @@ ahosts_keys_int (int af, int xflags, int number, char *key[])
+ 
+   struct addrinfo hint;
+   memset (&hint, '\0', sizeof (hint));
+-  hint.ai_flags = (AI_V4MAPPED | AI_ADDRCONFIG | AI_CANONNAME
++  hint.ai_flags = (AI_V4MAPPED | addrconfig_flags | AI_CANONNAME
+ 		   | idn_flags | xflags);
+   hint.ai_family = af;
+ 
+@@ -905,6 +910,10 @@ parse_option (int key, char *arg, struct argp_state *state)
+       idn_flags = 0;
+       break;
+ 
++    case 'A':
++      addrconfig_flags = 0;
++      break;
++
+     default:
+       return ARGP_ERR_UNKNOWN;
+     }
+-- 
+2.38.1
+
+
+From 2681d38cafaceafeb330bc0536fa710b75ed5947 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 13 Sep 2022 16:11:40 +0200
+Subject: nss: Fix tst-nss-files-hosts-long on single-stack hosts (bug 24816)
+
+getent implicitly passes AI_ADDRCONFIG to getaddrinfo by default.
+Use --no-addrconfig to suppress that, so that both IPv4 and IPv6
+lookups succeed even if the address family is not supported by the
+host.
+
+Reviewed-by: Carlos O'Donell <carlos@redhat.com>
+(cherry picked from commit c75d20b5b27b0a60f0678236f51a4d3b0b058c00)
+---
+ NEWS                           | 1 +
+ nss/tst-nss-files-hosts-long.c | 9 +++++----
+ 2 files changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/NEWS b/NEWS
+index 462a12253d..de775ab116 100644
+--- a/NEWS
++++ b/NEWS
+@@ -24,6 +24,7 @@ Security related changes:
+ The following bugs are resolved with this release:
+ 
+   [12154] Do not fail DNS resolution for CNAMEs which are not host names
++  [24816] Fix tst-nss-files-hosts-long on single-stack hosts
+   [28846] CMSG_NXTHDR may trigger -Wstrict-overflow warning
+   [29305] Conserve NSS buffer space during DNS packet parsing
+   [29415] nscd: Fix netlink cache invalidation if epoll is used
+diff --git a/nss/tst-nss-files-hosts-long.c b/nss/tst-nss-files-hosts-long.c
+index 3942cf5fca..a7697e3143 100644
+--- a/nss/tst-nss-files-hosts-long.c
++++ b/nss/tst-nss-files-hosts-long.c
+@@ -28,14 +28,15 @@ do_test (void)
+ {
+   int ret;
+ 
+-  /* Run getent to fetch the IPv4 address for host test4.
+-     This forces /etc/hosts to be parsed.  */
+-  ret = system("getent ahostsv4 test4");
++  /* Run getent to fetch the IPv4 address for host test4.  This forces
++     /etc/hosts to be parsed.  Use --no-addrconfig to return addresses
++     even in an IPv6-only environment.  */
++  ret = system("getent --no-addrconfig ahostsv4 test4");
+   if (ret != 0)
+     FAIL_EXIT1("ahostsv4 failed");
+ 
+   /* Likewise for IPv6.  */
+-  ret = system("getent ahostsv6 test6");
++  ret = system("getent --no-addrconfig  ahostsv6 test6");
+   if (ret != 0)
+     FAIL_EXIT1("ahostsv6 failed");
+ 
+-- 
+2.38.1
+
+
+From 908454129d21126bf7fc58f2a520b1f304dc5f02 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Fri, 23 Sep 2022 19:30:57 +0200
+Subject: nss: Use shared prefix in IPv4 address in tst-reload1
+
+Otherwise, sorting based on the longest-matching prefix in
+getaddrinfo can reorder the addresses in ways the test does not
+expect, depending on the IPv4 address of the host.
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit c02e29a0ba47d636281e1a026444a1a0a254aa12)
+---
+ nss/tst-reload1.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/nss/tst-reload1.c b/nss/tst-reload1.c
+index fdc5bdd65b..bc32bb132a 100644
+--- a/nss/tst-reload1.c
++++ b/nss/tst-reload1.c
+@@ -43,12 +43,12 @@ static struct passwd pwd_table_1[] = {
+ 
+ static const char *hostaddr_5[] =
+   {
+-   "ABCD", "abcd", "1234", NULL
++   "ABCd", "ABCD", "ABC4", NULL
+   };
+ 
+ static const char *hostaddr_15[] =
+   {
+-   "4321", "ghij", NULL
++   "4321", "4322", NULL
+   };
+ 
+ static const char *hostaddr_25[] =
+@@ -86,12 +86,12 @@ static const char *hostaddr_6[] =
+ 
+ static const char *hostaddr_16[] =
+   {
+-   "7890", "a1b2", NULL
++   "7890", "7891", NULL
+   };
+ 
+ static const char *hostaddr_26[] =
+   {
+-   "qwer", "tyui", NULL
++   "qwer", "qweR", NULL
+   };
+ 
+ static struct hostent host_table_2[] = {
+-- 
+2.38.1
+
+
+From 19535f3b57306ea3ec559a6c0b10d2d7a87418a7 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Fri, 14 Oct 2022 11:02:25 +0200
+Subject: elf: Do not completely clear reused namespace in dlmopen (bug 29600)
+
+The data in the _ns_debug member must be preserved, otherwise
+_dl_debug_initialize enters an infinite loop.  To be conservative,
+only clear the libc_map member for now, to fix bug 29528.
+
+Fixes commit d0e357ff45a75553dee3b17ed7d303bfa544f6fe
+("elf: Call __libc_early_init for reused namespaces (bug 29528)"),
+by reverting most of it.
+
+Reviewed-by: Carlos O'Donell <carlos@redhat.com>
+Tested-by: Carlos O'Donell <carlos@redhat.com>
+(cherry picked from commit 2c42257314536b94cc8d52edede86e94e98c1436)
+---
+ NEWS                    |  1 +
+ elf/dl-open.c           | 14 ++++++--------
+ elf/tst-dlmopen-twice.c | 28 ++++++++++++++++++++++++----
+ 3 files changed, 31 insertions(+), 12 deletions(-)
+
+diff --git a/NEWS b/NEWS
+index de775ab116..a6da588c85 100644
+--- a/NEWS
++++ b/NEWS
+@@ -37,6 +37,7 @@ The following bugs are resolved with this release:
+   [29537] libc: [2.34 regression]: Alignment issue on m68k when using
+   [29539] libc: LD_TRACE_LOADED_OBJECTS changed how vDSO library are
+   [29583] Use 64-bit interfaces in gconv_parseconfdir
++  [29600] Do not completely clear reused namespace in dlmopen
+   [29607] nscd repeatably crashes calling __strlen_avx2 when hosts cache is
+     enabled
+   [29638] libc: stdlib: arc4random fallback is never used
+diff --git a/elf/dl-open.c b/elf/dl-open.c
+index 46e8066fd8..e7db5e9642 100644
+--- a/elf/dl-open.c
++++ b/elf/dl-open.c
+@@ -844,15 +844,13 @@ _dl_open (const char *file, int mode, const void *caller_dlopen, Lmid_t nsid,
+ 	  _dl_signal_error (EINVAL, file, NULL, N_("\
+ no more namespaces available for dlmopen()"));
+ 	}
++      else if (nsid == GL(dl_nns))
++	{
++	  __rtld_lock_initialize (GL(dl_ns)[nsid]._ns_unique_sym_table.lock);
++	  ++GL(dl_nns);
++	}
+ 
+-      if (nsid == GL(dl_nns))
+-	++GL(dl_nns);
+-
+-      /* Initialize the new namespace.  Most members are
+-	 zero-initialized, only the lock needs special treatment.  */
+-      memset (&GL(dl_ns)[nsid], 0, sizeof (GL(dl_ns)[nsid]));
+-      __rtld_lock_initialize (GL(dl_ns)[nsid]._ns_unique_sym_table.lock);
+-
++      GL(dl_ns)[nsid].libc_map = NULL;
+       _dl_debug_update (nsid)->r_state = RT_CONSISTENT;
+     }
+   /* Never allow loading a DSO in a namespace which is empty.  Such
+diff --git a/elf/tst-dlmopen-twice.c b/elf/tst-dlmopen-twice.c
+index 449f3c8fa9..70c71fe19c 100644
+--- a/elf/tst-dlmopen-twice.c
++++ b/elf/tst-dlmopen-twice.c
+@@ -16,18 +16,38 @@
+    License along with the GNU C Library; if not, see
+    <https://www.gnu.org/licenses/>.  */
+ 
+-#include <support/xdlfcn.h>
++#include <stdio.h>
+ #include <support/check.h>
++#include <support/xdlfcn.h>
+ 
+-static int
+-do_test (void)
++/* Run the test multiple times, to check finding a new namespace while
++   another namespace is already in use.  This used to trigger bug 29600.  */
++static void
++recurse (int depth)
+ {
+-  void *handle = xdlmopen (LM_ID_NEWLM, "tst-dlmopen-twice-mod1.so", RTLD_NOW);
++  if (depth == 0)
++    return;
++
++  printf ("info: running at depth %d\n", depth);
++  void *handle = xdlmopen (LM_ID_NEWLM, "tst-dlmopen-twice-mod1.so",
++                           RTLD_NOW);
+   xdlclose (handle);
+   handle = xdlmopen (LM_ID_NEWLM, "tst-dlmopen-twice-mod2.so", RTLD_NOW);
+   int (*run_check) (void) = xdlsym (handle, "run_check");
+   TEST_COMPARE (run_check (), 0);
++  recurse (depth - 1);
+   xdlclose (handle);
++}
++
++static int
++do_test (void)
++{
++  /* First run the test without nesting.  */
++  recurse (1);
++
++  /* Then with nesting.  The constant needs to be less than the
++     internal DL_NNS namespace constant.  */
++  recurse (10);
+   return 0;
+ }
+ 
+-- 
+2.38.1
+
+
+From b357157361117182c7a68c90fda7ba431b64442c Mon Sep 17 00:00:00 2001
+From: Michael Hudson-Doyle <michael.hudson@canonical.com>
+Date: Mon, 22 Aug 2022 14:05:04 +1200
+Subject: Fix BZ #29463 in the ibm128 implementation of y1l too
+
+Avoid moving code across SET_RESTORE_ROUNDL in order to fix
+[BZ #29463].
+
+Tested-by: Aurelien Jarno <aurelien@aurel32.net>
+Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
+Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
+(cherry picked from commit b6e37b7805b0182c3e25cdab39ebf5f001c04d05)
+---
+ sysdeps/ieee754/ldbl-128ibm/e_j1l.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/sysdeps/ieee754/ldbl-128ibm/e_j1l.c b/sysdeps/ieee754/ldbl-128ibm/e_j1l.c
+index f85ba94466..0a5fe68342 100644
+--- a/sysdeps/ieee754/ldbl-128ibm/e_j1l.c
++++ b/sysdeps/ieee754/ldbl-128ibm/e_j1l.c
+@@ -792,10 +792,13 @@ __ieee754_y1l (long double x)
+     {
+       /* 0 <= x <= 2 */
+       SET_RESTORE_ROUNDL (FE_TONEAREST);
++      xx = math_opt_barrier (xx);
++      x = math_opt_barrier (x);
+       z = xx * xx;
+       p = xx * neval (z, Y0_2N, NY0_2N) / deval (z, Y0_2D, NY0_2D);
+       p = -TWOOPI / xx + p;
+       p = TWOOPI * __ieee754_logl (x) * __ieee754_j1l (x) + p;
++      math_force_eval (p);
+       return p;
+     }
+ 
+-- 
+2.38.1
+
+
+From 9273b2d0e93e7355656cad3be3a1ca76489df483 Mon Sep 17 00:00:00 2001
+From: Aurelien Jarno <aurelien@aurel32.net>
+Date: Mon, 10 Oct 2022 00:39:33 +0200
+Subject: Avoid undefined behaviour in ibm128 implementation of llroundl (BZ
+ #29488)
+
+Detecting an overflow edge case depended on signed overflow of a long
+long. Replace the additions and the overflow checks by
+__builtin_add_overflow().
+
+Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
+(cherry picked from commit 2b5478569e72ee4820a6e163d306690c9c0eaf5e)
+---
+ NEWS                                     |  2 ++
+ sysdeps/ieee754/ldbl-128ibm/s_llroundl.c | 21 +++++++++------------
+ 2 files changed, 11 insertions(+), 12 deletions(-)
+
+diff --git a/NEWS b/NEWS
+index a6da588c85..8c60d3dc8d 100644
+--- a/NEWS
++++ b/NEWS
+@@ -33,6 +33,8 @@ The following bugs are resolved with this release:
+   [29485] Linux: Terminate subprocess on late failure in tst-pidfd
+   [29490] alpha: New __brk_call implementation is broken
+   [29463] math/test-float128-y1 fails on x86_64
++  [29488] test-ibm128-llround fails on ppc64el when built with gcc-12 and -O2
++    or higher
+   [29528] elf: Call __libc_early_init for reused namespaces
+   [29537] libc: [2.34 regression]: Alignment issue on m68k when using
+   [29539] libc: LD_TRACE_LOADED_OBJECTS changed how vDSO library are
+diff --git a/sysdeps/ieee754/ldbl-128ibm/s_llroundl.c b/sysdeps/ieee754/ldbl-128ibm/s_llroundl.c
+index d85154e73a..d8c0de1faf 100644
+--- a/sysdeps/ieee754/ldbl-128ibm/s_llroundl.c
++++ b/sysdeps/ieee754/ldbl-128ibm/s_llroundl.c
+@@ -66,38 +66,35 @@ __llroundl (long double x)
+       /* Peg at max/min values, assuming that the above conversions do so.
+          Strictly speaking, we can return anything for values that overflow,
+          but this is more useful.  */
+-      res = hi + lo;
+-
+-      /* This is just sign(hi) == sign(lo) && sign(res) != sign(hi).  */
+-      if (__glibc_unlikely (((~(hi ^ lo) & (res ^ hi)) < 0)))
++      if (__glibc_unlikely (__builtin_add_overflow (hi, lo, &res)))
+ 	goto overflow;
+ 
+       xh -= lo;
+       ldbl_canonicalize (&xh, &xl);
+ 
+-      hi = res;
+       if (xh > 0.5)
+ 	{
+-	  res += 1;
++	  if (__glibc_unlikely (__builtin_add_overflow (res, 1, &res)))
++	    goto overflow;
+ 	}
+       else if (xh == 0.5)
+ 	{
+ 	  if (xl > 0.0 || (xl == 0.0 && res >= 0))
+-	    res += 1;
++	    if (__glibc_unlikely (__builtin_add_overflow (res, 1, &res)))
++	      goto overflow;
+ 	}
+       else if (-xh > 0.5)
+ 	{
+-	  res -= 1;
++	  if (__glibc_unlikely (__builtin_add_overflow (res, -1, &res)))
++	    goto overflow;
+ 	}
+       else if (-xh == 0.5)
+ 	{
+ 	  if (xl < 0.0 || (xl == 0.0 && res <= 0))
+-	    res -= 1;
++	    if (__glibc_unlikely (__builtin_add_overflow (res, -1, &res)))
++	      goto overflow;
+ 	}
+ 
+-      if (__glibc_unlikely (((~(hi ^ (res - hi)) & (res ^ hi)) < 0)))
+-	goto overflow;
+-
+       return res;
+     }
+   else
+-- 
+2.38.1
+
+
+From 7b7dfbb0cbdffebf0233c650627a4861212fbb60 Mon Sep 17 00:00:00 2001
+From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Wed, 19 Oct 2022 19:14:04 -0300
+Subject: linux: Fix generic struct_stat for 64 bit time (BZ# 29657)
+
+The generic Linux struct_stat misses the conditionals to use
+bits/struct_stat_time64_helper.h in the __USE_TIME_BITS64 for
+architecture that uses __TIMESIZE == 32 (currently csky and nios2).
+
+Since newer ports should not support 32 bit time_t, the generic
+implementation should be used as default.
+
+For arm, hppa, and sh a copy of default struct_stat is added,
+while for csky and nios a new one based on generic is used, along
+with conditionals to use bits/struct_stat_time64_helper.h.
+
+The default struct_stat is also replaced with the generic one.
+
+Checked on aarch64-linux-gnu and arm-linux-gnueabihf.
+
+(cherry picked from commit 7a6ca82f8007ddbd43e2b8fce806ba7101ee47f5)
+---
+ NEWS                                          |   2 +
+ .../unix/sysv/linux/arm/bits/struct_stat.h    | 139 ++++++++++++++++++
+ sysdeps/unix/sysv/linux/bits/struct_stat.h    | 116 +++++++--------
+ .../{generic => csky}/bits/struct_stat.h      |  28 ++--
+ .../unix/sysv/linux/hppa/bits/struct_stat.h   | 139 ++++++++++++++++++
+ .../unix/sysv/linux/nios2/bits/struct_stat.h  | 135 +++++++++++++++++
+ sysdeps/unix/sysv/linux/sh/bits/struct_stat.h | 139 ++++++++++++++++++
+ 7 files changed, 624 insertions(+), 74 deletions(-)
+ create mode 100644 sysdeps/unix/sysv/linux/arm/bits/struct_stat.h
+ rename sysdeps/unix/sysv/linux/{generic => csky}/bits/struct_stat.h (92%)
+ create mode 100644 sysdeps/unix/sysv/linux/hppa/bits/struct_stat.h
+ create mode 100644 sysdeps/unix/sysv/linux/nios2/bits/struct_stat.h
+ create mode 100644 sysdeps/unix/sysv/linux/sh/bits/struct_stat.h
+
+diff --git a/NEWS b/NEWS
+index 8c60d3dc8d..833045585f 100644
+--- a/NEWS
++++ b/NEWS
+@@ -43,6 +43,8 @@ The following bugs are resolved with this release:
+   [29607] nscd repeatably crashes calling __strlen_avx2 when hosts cache is
+     enabled
+   [29638] libc: stdlib: arc4random fallback is never used
++  [29657] libc: Incorrect struct stat for 64-bit time on linux/generic
++    platforms
+ \f
+ Version 2.36
+ 
+diff --git a/sysdeps/unix/sysv/linux/arm/bits/struct_stat.h b/sysdeps/unix/sysv/linux/arm/bits/struct_stat.h
+new file mode 100644
+index 0000000000..30ee6279d2
+--- /dev/null
++++ b/sysdeps/unix/sysv/linux/arm/bits/struct_stat.h
+@@ -0,0 +1,139 @@
++/* Definition for struct stat.  Linux/arm version.
++   Copyright (C) 2020-2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library.  If not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#if !defined _SYS_STAT_H && !defined _FCNTL_H
++# error "Never include <bits/struct_stat.h> directly; use <sys/stat.h> instead."
++#endif
++
++#ifndef _BITS_STRUCT_STAT_H
++#define _BITS_STRUCT_STAT_H	1
++
++#include <bits/endian.h>
++#include <bits/wordsize.h>
++
++struct stat
++  {
++#ifdef __USE_TIME_BITS64
++# include <bits/struct_stat_time64_helper.h>
++#else
++    __dev_t st_dev;			/* Device.  */
++    unsigned short int __pad1;
++# ifndef __USE_FILE_OFFSET64
++    __ino_t st_ino;			/* File serial number.	*/
++# else
++    __ino_t __st_ino;			/* 32bit file serial number.	*/
++# endif
++    __mode_t st_mode;			/* File mode.  */
++    __nlink_t st_nlink;			/* Link count.  */
++    __uid_t st_uid;			/* User ID of the file's owner.	*/
++    __gid_t st_gid;			/* Group ID of the file's group.*/
++    __dev_t st_rdev;			/* Device number, if device.  */
++    unsigned short int __pad2;
++# ifndef __USE_FILE_OFFSET64
++    __off_t st_size;			/* Size of file, in bytes.  */
++# else
++    __off64_t st_size;			/* Size of file, in bytes.  */
++# endif
++    __blksize_t st_blksize;		/* Optimal block size for I/O.  */
++
++# ifndef __USE_FILE_OFFSET64
++    __blkcnt_t st_blocks;		/* Number 512-byte blocks allocated. */
++# else
++    __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
++# endif
++# ifdef __USE_XOPEN2K8
++    /* Nanosecond resolution timestamps are stored in a format
++       equivalent to 'struct timespec'.  This is the type used
++       whenever possible but the Unix namespace rules do not allow the
++       identifier 'timespec' to appear in the <sys/stat.h> header.
++       Therefore we have to handle the use of this header in strictly
++       standard-compliant sources special.  */
++    struct timespec st_atim;		/* Time of last access.  */
++    struct timespec st_mtim;		/* Time of last modification.  */
++    struct timespec st_ctim;		/* Time of last status change.  */
++#  define st_atime st_atim.tv_sec	/* Backward compatibility.  */
++#  define st_mtime st_mtim.tv_sec
++#  define st_ctime st_ctim.tv_sec
++# else
++    __time_t st_atime;			/* Time of last access.  */
++    unsigned long int st_atimensec;	/* Nscecs of last access.  */
++    __time_t st_mtime;			/* Time of last modification.  */
++    unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
++    __time_t st_ctime;			/* Time of last status change.  */
++    unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
++# endif
++# ifndef __USE_FILE_OFFSET64
++    unsigned long int __glibc_reserved4;
++    unsigned long int __glibc_reserved5;
++# else
++    __ino64_t st_ino;			/* File serial number.	*/
++# endif
++#endif /* __USE_TIME_BITS64  */
++  };
++
++#ifdef __USE_LARGEFILE64
++struct stat64
++  {
++# ifdef __USE_TIME_BITS64
++#  include <bits/struct_stat_time64_helper.h>
++# else
++    __dev_t st_dev;			/* Device.  */
++    unsigned int __pad1;
++
++    __ino_t __st_ino;			/* 32bit file serial number.	*/
++    __mode_t st_mode;			/* File mode.  */
++    __nlink_t st_nlink;			/* Link count.  */
++    __uid_t st_uid;			/* User ID of the file's owner.	*/
++    __gid_t st_gid;			/* Group ID of the file's group.*/
++    __dev_t st_rdev;			/* Device number, if device.  */
++    unsigned int __pad2;
++    __off64_t st_size;			/* Size of file, in bytes.  */
++    __blksize_t st_blksize;		/* Optimal block size for I/O.  */
++
++    __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
++#  ifdef __USE_XOPEN2K8
++    /* Nanosecond resolution timestamps are stored in a format
++       equivalent to 'struct timespec'.  This is the type used
++       whenever possible but the Unix namespace rules do not allow the
++       identifier 'timespec' to appear in the <sys/stat.h> header.
++       Therefore we have to handle the use of this header in strictly
++       standard-compliant sources special.  */
++    struct timespec st_atim;		/* Time of last access.  */
++    struct timespec st_mtim;		/* Time of last modification.  */
++    struct timespec st_ctim;		/* Time of last status change.  */
++#  else
++    __time_t st_atime;			/* Time of last access.  */
++    unsigned long int st_atimensec;	/* Nscecs of last access.  */
++    __time_t st_mtime;			/* Time of last modification.  */
++    unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
++    __time_t st_ctime;			/* Time of last status change.  */
++    unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
++#  endif
++    __ino64_t st_ino;			/* File serial number.		*/
++# endif /* __USE_TIME_BITS64  */
++  };
++#endif
++
++/* Tell code we have these members.  */
++#define	_STATBUF_ST_BLKSIZE
++#define _STATBUF_ST_RDEV
++/* Nanosecond resolution time values are supported.  */
++#define _STATBUF_ST_NSEC
++
++
++#endif /* _BITS_STRUCT_STAT_H  */
+diff --git a/sysdeps/unix/sysv/linux/bits/struct_stat.h b/sysdeps/unix/sysv/linux/bits/struct_stat.h
+index 25bd6cb638..fb11a3fba4 100644
+--- a/sysdeps/unix/sysv/linux/bits/struct_stat.h
++++ b/sysdeps/unix/sysv/linux/bits/struct_stat.h
+@@ -26,37 +26,36 @@
+ #include <bits/endian.h>
+ #include <bits/wordsize.h>
+ 
+-struct stat
+-  {
+-#ifdef __USE_TIME_BITS64
+-# include <bits/struct_stat_time64_helper.h>
+-#else
+-    __dev_t st_dev;			/* Device.  */
+-    unsigned short int __pad1;
+-# ifndef __USE_FILE_OFFSET64
+-    __ino_t st_ino;			/* File serial number.	*/
+-# else
+-    __ino_t __st_ino;			/* 32bit file serial number.	*/
++#if defined __USE_FILE_OFFSET64
++# define __field64(type, type64, name) type64 name
++#elif __WORDSIZE == 64 || defined __INO_T_MATCHES_INO64_T
++# if defined __INO_T_MATCHES_INO64_T && !defined __OFF_T_MATCHES_OFF64_T
++#  error "ino_t and off_t must both be the same type"
+ # endif
+-    __mode_t st_mode;			/* File mode.  */
+-    __nlink_t st_nlink;			/* Link count.  */
+-    __uid_t st_uid;			/* User ID of the file's owner.	*/
+-    __gid_t st_gid;			/* Group ID of the file's group.*/
+-    __dev_t st_rdev;			/* Device number, if device.  */
+-    unsigned short int __pad2;
+-# ifndef __USE_FILE_OFFSET64
+-    __off_t st_size;			/* Size of file, in bytes.  */
+-# else
+-    __off64_t st_size;			/* Size of file, in bytes.  */
+-# endif
+-    __blksize_t st_blksize;		/* Optimal block size for I/O.  */
++# define __field64(type, type64, name) type name
++#elif __BYTE_ORDER == __LITTLE_ENDIAN
++# define __field64(type, type64, name) \
++  type name __attribute__((__aligned__ (__alignof__ (type64)))); int __##name##_pad
++#else
++# define __field64(type, type64, name) \
++  int __##name##_pad __attribute__((__aligned__ (__alignof__ (type64)))); type name
++#endif
+ 
+-# ifndef __USE_FILE_OFFSET64
+-    __blkcnt_t st_blocks;		/* Number 512-byte blocks allocated. */
+-# else
+-    __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
+-# endif
+-# ifdef __USE_XOPEN2K8
++struct stat
++  {
++    __dev_t st_dev;		/* Device.  */
++    __field64(__ino_t, __ino64_t, st_ino);  /* File serial number. */
++    __mode_t st_mode;		/* File mode.  */
++    __nlink_t st_nlink;		/* Link count.  */
++    __uid_t st_uid;		/* User ID of the file's owner.	*/
++    __gid_t st_gid;		/* Group ID of the file's group.*/
++    __dev_t st_rdev;		/* Device number, if device.  */
++    __dev_t __pad1;
++    __field64(__off_t, __off64_t, st_size);  /* Size of file, in bytes. */
++    __blksize_t st_blksize;	/* Optimal block size for I/O.  */
++    int __pad2;
++    __field64(__blkcnt_t, __blkcnt64_t, st_blocks);  /* 512-byte blocks */
++#ifdef __USE_XOPEN2K8
+     /* Nanosecond resolution timestamps are stored in a format
+        equivalent to 'struct timespec'.  This is the type used
+        whenever possible but the Unix namespace rules do not allow the
+@@ -66,47 +65,38 @@ struct stat
+     struct timespec st_atim;		/* Time of last access.  */
+     struct timespec st_mtim;		/* Time of last modification.  */
+     struct timespec st_ctim;		/* Time of last status change.  */
+-#  define st_atime st_atim.tv_sec	/* Backward compatibility.  */
+-#  define st_mtime st_mtim.tv_sec
+-#  define st_ctime st_ctim.tv_sec
+-# else
++# define st_atime st_atim.tv_sec	/* Backward compatibility.  */
++# define st_mtime st_mtim.tv_sec
++# define st_ctime st_ctim.tv_sec
++#else
+     __time_t st_atime;			/* Time of last access.  */
+     unsigned long int st_atimensec;	/* Nscecs of last access.  */
+     __time_t st_mtime;			/* Time of last modification.  */
+     unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
+     __time_t st_ctime;			/* Time of last status change.  */
+     unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
+-# endif
+-# ifndef __USE_FILE_OFFSET64
+-    unsigned long int __glibc_reserved4;
+-    unsigned long int __glibc_reserved5;
+-# else
+-    __ino64_t st_ino;			/* File serial number.	*/
+-# endif
+-#endif /* __USE_TIME_BITS64  */
++#endif
++    int __glibc_reserved[2];
+   };
+ 
++#undef __field64
++
+ #ifdef __USE_LARGEFILE64
+ struct stat64
+   {
+-# ifdef __USE_TIME_BITS64
+-#  include <bits/struct_stat_time64_helper.h>
+-# else
+-    __dev_t st_dev;			/* Device.  */
+-    unsigned int __pad1;
+-
+-    __ino_t __st_ino;			/* 32bit file serial number.	*/
+-    __mode_t st_mode;			/* File mode.  */
+-    __nlink_t st_nlink;			/* Link count.  */
+-    __uid_t st_uid;			/* User ID of the file's owner.	*/
+-    __gid_t st_gid;			/* Group ID of the file's group.*/
+-    __dev_t st_rdev;			/* Device number, if device.  */
+-    unsigned int __pad2;
+-    __off64_t st_size;			/* Size of file, in bytes.  */
+-    __blksize_t st_blksize;		/* Optimal block size for I/O.  */
+-
+-    __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
+-#  ifdef __USE_XOPEN2K8
++    __dev_t st_dev;		/* Device.  */
++    __ino64_t st_ino;		/* File serial number.	*/
++    __mode_t st_mode;		/* File mode.  */
++    __nlink_t st_nlink;		/* Link count.  */
++    __uid_t st_uid;		/* User ID of the file's owner.	*/
++    __gid_t st_gid;		/* Group ID of the file's group.*/
++    __dev_t st_rdev;		/* Device number, if device.  */
++    __dev_t __pad1;
++    __off64_t st_size;		/* Size of file, in bytes.  */
++    __blksize_t st_blksize;	/* Optimal block size for I/O.  */
++    int __pad2;
++    __blkcnt64_t st_blocks;	/* Nr. 512-byte blocks allocated.  */
++#ifdef __USE_XOPEN2K8
+     /* Nanosecond resolution timestamps are stored in a format
+        equivalent to 'struct timespec'.  This is the type used
+        whenever possible but the Unix namespace rules do not allow the
+@@ -116,16 +106,15 @@ struct stat64
+     struct timespec st_atim;		/* Time of last access.  */
+     struct timespec st_mtim;		/* Time of last modification.  */
+     struct timespec st_ctim;		/* Time of last status change.  */
+-#  else
++#else
+     __time_t st_atime;			/* Time of last access.  */
+     unsigned long int st_atimensec;	/* Nscecs of last access.  */
+     __time_t st_mtime;			/* Time of last modification.  */
+     unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
+     __time_t st_ctime;			/* Time of last status change.  */
+     unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
+-#  endif
+-    __ino64_t st_ino;			/* File serial number.		*/
+-# endif /* __USE_TIME_BITS64  */
++#endif
++    int __glibc_reserved[2];
+   };
+ #endif
+ 
+@@ -135,5 +124,4 @@ struct stat64
+ /* Nanosecond resolution time values are supported.  */
+ #define _STATBUF_ST_NSEC
+ 
+-
+ #endif /* _BITS_STRUCT_STAT_H  */
+diff --git a/sysdeps/unix/sysv/linux/generic/bits/struct_stat.h b/sysdeps/unix/sysv/linux/csky/bits/struct_stat.h
+similarity index 92%
+rename from sysdeps/unix/sysv/linux/generic/bits/struct_stat.h
+rename to sysdeps/unix/sysv/linux/csky/bits/struct_stat.h
+index fb11a3fba4..f0ee455748 100644
+--- a/sysdeps/unix/sysv/linux/generic/bits/struct_stat.h
++++ b/sysdeps/unix/sysv/linux/csky/bits/struct_stat.h
+@@ -1,4 +1,4 @@
+-/* Definition for struct stat.
++/* Definition for struct stat.  Linux/csky version.
+    Copyright (C) 2020-2022 Free Software Foundation, Inc.
+    This file is part of the GNU C Library.
+ 
+@@ -43,6 +43,9 @@
+ 
+ struct stat
+   {
++#ifdef __USE_TIME_BITS64
++# include <bits/struct_stat_time64_helper.h>
++#else
+     __dev_t st_dev;		/* Device.  */
+     __field64(__ino_t, __ino64_t, st_ino);  /* File serial number. */
+     __mode_t st_mode;		/* File mode.  */
+@@ -55,7 +58,7 @@ struct stat
+     __blksize_t st_blksize;	/* Optimal block size for I/O.  */
+     int __pad2;
+     __field64(__blkcnt_t, __blkcnt64_t, st_blocks);  /* 512-byte blocks */
+-#ifdef __USE_XOPEN2K8
++# ifdef __USE_XOPEN2K8
+     /* Nanosecond resolution timestamps are stored in a format
+        equivalent to 'struct timespec'.  This is the type used
+        whenever possible but the Unix namespace rules do not allow the
+@@ -65,18 +68,19 @@ struct stat
+     struct timespec st_atim;		/* Time of last access.  */
+     struct timespec st_mtim;		/* Time of last modification.  */
+     struct timespec st_ctim;		/* Time of last status change.  */
+-# define st_atime st_atim.tv_sec	/* Backward compatibility.  */
+-# define st_mtime st_mtim.tv_sec
+-# define st_ctime st_ctim.tv_sec
+-#else
++#  define st_atime st_atim.tv_sec	/* Backward compatibility.  */
++#  define st_mtime st_mtim.tv_sec
++#  define st_ctime st_ctim.tv_sec
++# else
+     __time_t st_atime;			/* Time of last access.  */
+     unsigned long int st_atimensec;	/* Nscecs of last access.  */
+     __time_t st_mtime;			/* Time of last modification.  */
+     unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
+     __time_t st_ctime;			/* Time of last status change.  */
+     unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
+-#endif
++# endif
+     int __glibc_reserved[2];
++#endif
+   };
+ 
+ #undef __field64
+@@ -84,6 +88,9 @@ struct stat
+ #ifdef __USE_LARGEFILE64
+ struct stat64
+   {
++# ifdef __USE_TIME_BITS64
++#  include <bits/struct_stat_time64_helper.h>
++# else
+     __dev_t st_dev;		/* Device.  */
+     __ino64_t st_ino;		/* File serial number.	*/
+     __mode_t st_mode;		/* File mode.  */
+@@ -96,7 +103,7 @@ struct stat64
+     __blksize_t st_blksize;	/* Optimal block size for I/O.  */
+     int __pad2;
+     __blkcnt64_t st_blocks;	/* Nr. 512-byte blocks allocated.  */
+-#ifdef __USE_XOPEN2K8
++#  ifdef __USE_XOPEN2K8
+     /* Nanosecond resolution timestamps are stored in a format
+        equivalent to 'struct timespec'.  This is the type used
+        whenever possible but the Unix namespace rules do not allow the
+@@ -106,15 +113,16 @@ struct stat64
+     struct timespec st_atim;		/* Time of last access.  */
+     struct timespec st_mtim;		/* Time of last modification.  */
+     struct timespec st_ctim;		/* Time of last status change.  */
+-#else
++#  else
+     __time_t st_atime;			/* Time of last access.  */
+     unsigned long int st_atimensec;	/* Nscecs of last access.  */
+     __time_t st_mtime;			/* Time of last modification.  */
+     unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
+     __time_t st_ctime;			/* Time of last status change.  */
+     unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
+-#endif
++#  endif
+     int __glibc_reserved[2];
++# endif
+   };
+ #endif
+ 
+diff --git a/sysdeps/unix/sysv/linux/hppa/bits/struct_stat.h b/sysdeps/unix/sysv/linux/hppa/bits/struct_stat.h
+new file mode 100644
+index 0000000000..38b6e13e68
+--- /dev/null
++++ b/sysdeps/unix/sysv/linux/hppa/bits/struct_stat.h
+@@ -0,0 +1,139 @@
++/* Definition for struct stat.  Linux/hppa version.
++   Copyright (C) 2020-2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library.  If not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#if !defined _SYS_STAT_H && !defined _FCNTL_H
++# error "Never include <bits/struct_stat.h> directly; use <sys/stat.h> instead."
++#endif
++
++#ifndef _BITS_STRUCT_STAT_H
++#define _BITS_STRUCT_STAT_H	1
++
++#include <bits/endian.h>
++#include <bits/wordsize.h>
++
++struct stat
++  {
++#ifdef __USE_TIME_BITS64
++# include <bits/struct_stat_time64_helper.h>
++#else
++    __dev_t st_dev;			/* Device.  */
++    unsigned short int __pad1;
++# ifndef __USE_FILE_OFFSET64
++    __ino_t st_ino;			/* File serial number.	*/
++# else
++    __ino_t __st_ino;			/* 32bit file serial number.	*/
++# endif
++    __mode_t st_mode;			/* File mode.  */
++    __nlink_t st_nlink;			/* Link count.  */
++    __uid_t st_uid;			/* User ID of the file's owner.	*/
++    __gid_t st_gid;			/* Group ID of the file's group.*/
++    __dev_t st_rdev;			/* Device number, if device.  */
++    unsigned short int __pad2;
++# ifndef __USE_FILE_OFFSET64
++    __off_t st_size;			/* Size of file, in bytes.  */
++# else
++    __off64_t st_size;			/* Size of file, in bytes.  */
++# endif
++    __blksize_t st_blksize;		/* Optimal block size for I/O.  */
++
++# ifndef __USE_FILE_OFFSET64
++    __blkcnt_t st_blocks;		/* Number 512-byte blocks allocated. */
++# else
++    __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
++# endif
++# ifdef __USE_XOPEN2K8
++    /* Nanosecond resolution timestamps are stored in a format
++       equivalent to 'struct timespec'.  This is the type used
++       whenever possible but the Unix namespace rules do not allow the
++       identifier 'timespec' to appear in the <sys/stat.h> header.
++       Therefore we have to handle the use of this header in strictly
++       standard-compliant sources special.  */
++    struct timespec st_atim;		/* Time of last access.  */
++    struct timespec st_mtim;		/* Time of last modification.  */
++    struct timespec st_ctim;		/* Time of last status change.  */
++#  define st_atime st_atim.tv_sec	/* Backward compatibility.  */
++#  define st_mtime st_mtim.tv_sec
++#  define st_ctime st_ctim.tv_sec
++# else
++    __time_t st_atime;			/* Time of last access.  */
++    unsigned long int st_atimensec;	/* Nscecs of last access.  */
++    __time_t st_mtime;			/* Time of last modification.  */
++    unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
++    __time_t st_ctime;			/* Time of last status change.  */
++    unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
++# endif
++# ifndef __USE_FILE_OFFSET64
++    unsigned long int __glibc_reserved4;
++    unsigned long int __glibc_reserved5;
++# else
++    __ino64_t st_ino;			/* File serial number.	*/
++# endif
++#endif /* __USE_TIME_BITS64  */
++  };
++
++#ifdef __USE_LARGEFILE64
++struct stat64
++  {
++# ifdef __USE_TIME_BITS64
++#  include <bits/struct_stat_time64_helper.h>
++# else
++    __dev_t st_dev;			/* Device.  */
++    unsigned int __pad1;
++
++    __ino_t __st_ino;			/* 32bit file serial number.	*/
++    __mode_t st_mode;			/* File mode.  */
++    __nlink_t st_nlink;			/* Link count.  */
++    __uid_t st_uid;			/* User ID of the file's owner.	*/
++    __gid_t st_gid;			/* Group ID of the file's group.*/
++    __dev_t st_rdev;			/* Device number, if device.  */
++    unsigned int __pad2;
++    __off64_t st_size;			/* Size of file, in bytes.  */
++    __blksize_t st_blksize;		/* Optimal block size for I/O.  */
++
++    __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
++#  ifdef __USE_XOPEN2K8
++    /* Nanosecond resolution timestamps are stored in a format
++       equivalent to 'struct timespec'.  This is the type used
++       whenever possible but the Unix namespace rules do not allow the
++       identifier 'timespec' to appear in the <sys/stat.h> header.
++       Therefore we have to handle the use of this header in strictly
++       standard-compliant sources special.  */
++    struct timespec st_atim;		/* Time of last access.  */
++    struct timespec st_mtim;		/* Time of last modification.  */
++    struct timespec st_ctim;		/* Time of last status change.  */
++#  else
++    __time_t st_atime;			/* Time of last access.  */
++    unsigned long int st_atimensec;	/* Nscecs of last access.  */
++    __time_t st_mtime;			/* Time of last modification.  */
++    unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
++    __time_t st_ctime;			/* Time of last status change.  */
++    unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
++#  endif
++    __ino64_t st_ino;			/* File serial number.		*/
++# endif /* __USE_TIME_BITS64  */
++  };
++#endif
++
++/* Tell code we have these members.  */
++#define	_STATBUF_ST_BLKSIZE
++#define _STATBUF_ST_RDEV
++/* Nanosecond resolution time values are supported.  */
++#define _STATBUF_ST_NSEC
++
++
++#endif /* _BITS_STRUCT_STAT_H  */
+diff --git a/sysdeps/unix/sysv/linux/nios2/bits/struct_stat.h b/sysdeps/unix/sysv/linux/nios2/bits/struct_stat.h
+new file mode 100644
+index 0000000000..e00e71173e
+--- /dev/null
++++ b/sysdeps/unix/sysv/linux/nios2/bits/struct_stat.h
+@@ -0,0 +1,135 @@
++/* Definition for struct stat.  Linux/nios2 version.
++   Copyright (C) 2020-2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library.  If not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#if !defined _SYS_STAT_H && !defined _FCNTL_H
++# error "Never include <bits/struct_stat.h> directly; use <sys/stat.h> instead."
++#endif
++
++#ifndef _BITS_STRUCT_STAT_H
++#define _BITS_STRUCT_STAT_H	1
++
++#include <bits/endian.h>
++#include <bits/wordsize.h>
++
++#if defined __USE_FILE_OFFSET64
++# define __field64(type, type64, name) type64 name
++#elif __WORDSIZE == 64 || defined __INO_T_MATCHES_INO64_T
++# if defined __INO_T_MATCHES_INO64_T && !defined __OFF_T_MATCHES_OFF64_T
++#  error "ino_t and off_t must both be the same type"
++# endif
++# define __field64(type, type64, name) type name
++#elif __BYTE_ORDER == __LITTLE_ENDIAN
++# define __field64(type, type64, name) \
++  type name __attribute__((__aligned__ (__alignof__ (type64)))); int __##name##_pad
++#else
++# define __field64(type, type64, name) \
++  int __##name##_pad __attribute__((__aligned__ (__alignof__ (type64)))); type name
++#endif
++
++struct stat
++  {
++#ifdef __USE_TIME_BITS64
++# include <bits/struct_stat_time64_helper.h>
++#else
++    __dev_t st_dev;		/* Device.  */
++    __field64(__ino_t, __ino64_t, st_ino);  /* File serial number. */
++    __mode_t st_mode;		/* File mode.  */
++    __nlink_t st_nlink;		/* Link count.  */
++    __uid_t st_uid;		/* User ID of the file's owner.	*/
++    __gid_t st_gid;		/* Group ID of the file's group.*/
++    __dev_t st_rdev;		/* Device number, if device.  */
++    __dev_t __pad1;
++    __field64(__off_t, __off64_t, st_size);  /* Size of file, in bytes. */
++    __blksize_t st_blksize;	/* Optimal block size for I/O.  */
++    int __pad2;
++    __field64(__blkcnt_t, __blkcnt64_t, st_blocks);  /* 512-byte blocks */
++# ifdef __USE_XOPEN2K8
++    /* Nanosecond resolution timestamps are stored in a format
++       equivalent to 'struct timespec'.  This is the type used
++       whenever possible but the Unix namespace rules do not allow the
++       identifier 'timespec' to appear in the <sys/stat.h> header.
++       Therefore we have to handle the use of this header in strictly
++       standard-compliant sources special.  */
++    struct timespec st_atim;		/* Time of last access.  */
++    struct timespec st_mtim;		/* Time of last modification.  */
++    struct timespec st_ctim;		/* Time of last status change.  */
++#  define st_atime st_atim.tv_sec	/* Backward compatibility.  */
++#  define st_mtime st_mtim.tv_sec
++#  define st_ctime st_ctim.tv_sec
++# else
++    __time_t st_atime;			/* Time of last access.  */
++    unsigned long int st_atimensec;	/* Nscecs of last access.  */
++    __time_t st_mtime;			/* Time of last modification.  */
++    unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
++    __time_t st_ctime;			/* Time of last status change.  */
++    unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
++# endif
++    int __glibc_reserved[2];
++#endif
++  };
++
++#undef __field64
++
++#ifdef __USE_LARGEFILE64
++struct stat64
++  {
++# ifdef __USE_TIME_BITS64
++#  include <bits/struct_stat_time64_helper.h>
++# else
++    __dev_t st_dev;		/* Device.  */
++    __ino64_t st_ino;		/* File serial number.	*/
++    __mode_t st_mode;		/* File mode.  */
++    __nlink_t st_nlink;		/* Link count.  */
++    __uid_t st_uid;		/* User ID of the file's owner.	*/
++    __gid_t st_gid;		/* Group ID of the file's group.*/
++    __dev_t st_rdev;		/* Device number, if device.  */
++    __dev_t __pad1;
++    __off64_t st_size;		/* Size of file, in bytes.  */
++    __blksize_t st_blksize;	/* Optimal block size for I/O.  */
++    int __pad2;
++    __blkcnt64_t st_blocks;	/* Nr. 512-byte blocks allocated.  */
++#  ifdef __USE_XOPEN2K8
++    /* Nanosecond resolution timestamps are stored in a format
++       equivalent to 'struct timespec'.  This is the type used
++       whenever possible but the Unix namespace rules do not allow the
++       identifier 'timespec' to appear in the <sys/stat.h> header.
++       Therefore we have to handle the use of this header in strictly
++       standard-compliant sources special.  */
++    struct timespec st_atim;		/* Time of last access.  */
++    struct timespec st_mtim;		/* Time of last modification.  */
++    struct timespec st_ctim;		/* Time of last status change.  */
++#  else
++    __time_t st_atime;			/* Time of last access.  */
++    unsigned long int st_atimensec;	/* Nscecs of last access.  */
++    __time_t st_mtime;			/* Time of last modification.  */
++    unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
++    __time_t st_ctime;			/* Time of last status change.  */
++    unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
++#  endif
++    int __glibc_reserved[2];
++# endif
++  };
++#endif
++
++/* Tell code we have these members.  */
++#define	_STATBUF_ST_BLKSIZE
++#define _STATBUF_ST_RDEV
++/* Nanosecond resolution time values are supported.  */
++#define _STATBUF_ST_NSEC
++
++#endif /* _BITS_STRUCT_STAT_H  */
+diff --git a/sysdeps/unix/sysv/linux/sh/bits/struct_stat.h b/sysdeps/unix/sysv/linux/sh/bits/struct_stat.h
+new file mode 100644
+index 0000000000..0f7c9cdc89
+--- /dev/null
++++ b/sysdeps/unix/sysv/linux/sh/bits/struct_stat.h
+@@ -0,0 +1,139 @@
++/* Definition for struct stat.  Linux/sh version.
++   Copyright (C) 2020-2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library.  If not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#if !defined _SYS_STAT_H && !defined _FCNTL_H
++# error "Never include <bits/struct_stat.h> directly; use <sys/stat.h> instead."
++#endif
++
++#ifndef _BITS_STRUCT_STAT_H
++#define _BITS_STRUCT_STAT_H	1
++
++#include <bits/endian.h>
++#include <bits/wordsize.h>
++
++struct stat
++  {
++#ifdef __USE_TIME_BITS64
++# include <bits/struct_stat_time64_helper.h>
++#else
++    __dev_t st_dev;			/* Device.  */
++    unsigned short int __pad1;
++# ifndef __USE_FILE_OFFSET64
++    __ino_t st_ino;			/* File serial number.	*/
++# else
++    __ino_t __st_ino;			/* 32bit file serial number.	*/
++# endif
++    __mode_t st_mode;			/* File mode.  */
++    __nlink_t st_nlink;			/* Link count.  */
++    __uid_t st_uid;			/* User ID of the file's owner.	*/
++    __gid_t st_gid;			/* Group ID of the file's group.*/
++    __dev_t st_rdev;			/* Device number, if device.  */
++    unsigned short int __pad2;
++# ifndef __USE_FILE_OFFSET64
++    __off_t st_size;			/* Size of file, in bytes.  */
++# else
++    __off64_t st_size;			/* Size of file, in bytes.  */
++# endif
++    __blksize_t st_blksize;		/* Optimal block size for I/O.  */
++
++# ifndef __USE_FILE_OFFSET64
++    __blkcnt_t st_blocks;		/* Number 512-byte blocks allocated. */
++# else
++    __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
++# endif
++# ifdef __USE_XOPEN2K8
++    /* Nanosecond resolution timestamps are stored in a format
++       equivalent to 'struct timespec'.  This is the type used
++       whenever possible but the Unix namespace rules do not allow the
++       identifier 'timespec' to appear in the <sys/stat.h> header.
++       Therefore we have to handle the use of this header in strictly
++       standard-compliant sources special.  */
++    struct timespec st_atim;		/* Time of last access.  */
++    struct timespec st_mtim;		/* Time of last modification.  */
++    struct timespec st_ctim;		/* Time of last status change.  */
++#  define st_atime st_atim.tv_sec	/* Backward compatibility.  */
++#  define st_mtime st_mtim.tv_sec
++#  define st_ctime st_ctim.tv_sec
++# else
++    __time_t st_atime;			/* Time of last access.  */
++    unsigned long int st_atimensec;	/* Nscecs of last access.  */
++    __time_t st_mtime;			/* Time of last modification.  */
++    unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
++    __time_t st_ctime;			/* Time of last status change.  */
++    unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
++# endif
++# ifndef __USE_FILE_OFFSET64
++    unsigned long int __glibc_reserved4;
++    unsigned long int __glibc_reserved5;
++# else
++    __ino64_t st_ino;			/* File serial number.	*/
++# endif
++#endif /* __USE_TIME_BITS64  */
++  };
++
++#ifdef __USE_LARGEFILE64
++struct stat64
++  {
++# ifdef __USE_TIME_BITS64
++#  include <bits/struct_stat_time64_helper.h>
++# else
++    __dev_t st_dev;			/* Device.  */
++    unsigned int __pad1;
++
++    __ino_t __st_ino;			/* 32bit file serial number.	*/
++    __mode_t st_mode;			/* File mode.  */
++    __nlink_t st_nlink;			/* Link count.  */
++    __uid_t st_uid;			/* User ID of the file's owner.	*/
++    __gid_t st_gid;			/* Group ID of the file's group.*/
++    __dev_t st_rdev;			/* Device number, if device.  */
++    unsigned int __pad2;
++    __off64_t st_size;			/* Size of file, in bytes.  */
++    __blksize_t st_blksize;		/* Optimal block size for I/O.  */
++
++    __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
++#  ifdef __USE_XOPEN2K8
++    /* Nanosecond resolution timestamps are stored in a format
++       equivalent to 'struct timespec'.  This is the type used
++       whenever possible but the Unix namespace rules do not allow the
++       identifier 'timespec' to appear in the <sys/stat.h> header.
++       Therefore we have to handle the use of this header in strictly
++       standard-compliant sources special.  */
++    struct timespec st_atim;		/* Time of last access.  */
++    struct timespec st_mtim;		/* Time of last modification.  */
++    struct timespec st_ctim;		/* Time of last status change.  */
++#  else
++    __time_t st_atime;			/* Time of last access.  */
++    unsigned long int st_atimensec;	/* Nscecs of last access.  */
++    __time_t st_mtime;			/* Time of last modification.  */
++    unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
++    __time_t st_ctime;			/* Time of last status change.  */
++    unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
++#  endif
++    __ino64_t st_ino;			/* File serial number.		*/
++# endif /* __USE_TIME_BITS64  */
++  };
++#endif
++
++/* Tell code we have these members.  */
++#define	_STATBUF_ST_BLKSIZE
++#define _STATBUF_ST_RDEV
++/* Nanosecond resolution time values are supported.  */
++#define _STATBUF_ST_NSEC
++
++
++#endif /* _BITS_STRUCT_STAT_H  */
+-- 
+2.38.1
+
+
+From a1dc0be03c9dd850b864bd7a9c03cf8e396eb7ca Mon Sep 17 00:00:00 2001
+From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Tue, 25 Oct 2022 13:19:16 -0300
+Subject: elf: Reinstate on DL_DEBUG_BINDINGS _dl_lookup_symbol_x
+
+The prelink removal done by 6628c742b2c16e wrongly removed the debug
+support.
+
+Checked on x86_64-linux-gnu.
+
+(cherry picked from commit 891a7958a28eac6d4af1517dd2896fef5e4951d4)
+---
+ elf/dl-lookup.c | 17 +++++++++++++++++
+ 1 file changed, 17 insertions(+)
+
+diff --git a/elf/dl-lookup.c b/elf/dl-lookup.c
+index 4c86dc694e..67fb2e31e2 100644
+--- a/elf/dl-lookup.c
++++ b/elf/dl-lookup.c
+@@ -854,6 +854,23 @@ _dl_lookup_symbol_x (const char *undef_name, struct link_map *undef_map,
+   if (__glibc_unlikely (current_value.m->l_used == 0))
+     current_value.m->l_used = 1;
+ 
++ if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_BINDINGS))
++   {
++      const char *reference_name = undef_map->l_name;
++
++      _dl_debug_printf ("binding file %s [%lu] to %s [%lu]: %s symbol `%s'",
++			DSO_FILENAME (reference_name),
++			undef_map->l_ns,
++			DSO_FILENAME (current_value.m->l_name),
++			current_value.m->l_ns,
++			protected ? "protected" : "normal", undef_name);
++      if (version)
++	_dl_debug_printf_c (" [%s]\n", version->name);
++      else
++	_dl_debug_printf_c ("\n");
++   }
++
++
+   *ref = current_value.s;
+   return LOOKUP_VALUE (current_value.m);
+ }
+-- 
+2.38.1
+
+
+From 4c6a78addabbd6e1b69763e286768919e56dfe0a Mon Sep 17 00:00:00 2001
+From: Xi Ruoyao <xry111@xry111.site>
+Date: Sat, 15 Oct 2022 14:12:13 +0800
+Subject: longlong.h: update from GCC for LoongArch clz/ctz support
+
+Update longlong.h to GCC r13-3269.  Keep our local change (prefer https
+for gnu.org URL).
+---
+ stdlib/longlong.h | 12 ++++++++++++
+ 1 file changed, 12 insertions(+)
+
+diff --git a/stdlib/longlong.h b/stdlib/longlong.h
+index 9b89469ac2..d8f76a43b5 100644
+--- a/stdlib/longlong.h
++++ b/stdlib/longlong.h
+@@ -593,6 +593,18 @@ extern UDItype __umulsidi3 (USItype, USItype);
+ #define UMUL_TIME 14
+ #endif
+ 
++#ifdef __loongarch__
++# if W_TYPE_SIZE == 32
++#  define count_leading_zeros(count, x)  ((count) = __builtin_clz (x))
++#  define count_trailing_zeros(count, x) ((count) = __builtin_ctz (x))
++#  define COUNT_LEADING_ZEROS_0 32
++# elif W_TYPE_SIZE == 64
++#  define count_leading_zeros(count, x)  ((count) = __builtin_clzll (x))
++#  define count_trailing_zeros(count, x) ((count) = __builtin_ctzll (x))
++#  define COUNT_LEADING_ZEROS_0 64
++# endif
++#endif
++
+ #if defined (__M32R__) && W_TYPE_SIZE == 32
+ #define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+   /* The cmp clears the condition bit.  */ \
+-- 
+2.38.1
+
+
+From dd4131c8322891a0ad7cfb661efa41aecc02b581 Mon Sep 17 00:00:00 2001
+From: Aurelien Jarno <aurelien@aurel32.net>
+Date: Tue, 1 Nov 2022 20:43:55 +0100
+Subject: linux: Fix fstatat on MIPSn64 (BZ #29730)
+
+Commit 6e8a0aac2f883 ("time: Fix overflow itimer tests on 32-bit
+systems") changed in_time_t_range to assume a 32-bit time_t. This broke
+fstatat on MIPSn64 that was using it with a 64-bit time_t due to
+difference between stat and stat64. This commit fix that by adding a
+MIPSn64 specific version, which bypasses the EOVERFLOW tests.
+
+Resolves: BZ #29730
+
+Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
+(cherry picked from commit 7457b7eef8dfe8cc48e55b9f9837df6dd397b80d)
+---
+ NEWS                                          |  1 +
+ .../unix/sysv/linux/mips/mips64/n64/fstatat.c | 51 +++++++++++++++++++
+ 2 files changed, 52 insertions(+)
+ create mode 100644 sysdeps/unix/sysv/linux/mips/mips64/n64/fstatat.c
+
+diff --git a/NEWS b/NEWS
+index 833045585f..e92d547e2c 100644
+--- a/NEWS
++++ b/NEWS
+@@ -45,6 +45,7 @@ The following bugs are resolved with this release:
+   [29638] libc: stdlib: arc4random fallback is never used
+   [29657] libc: Incorrect struct stat for 64-bit time on linux/generic
+     platforms
++  [29730] broken y2038 support in fstatat on MIPS N64
+ \f
+ Version 2.36
+ 
+diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/fstatat.c b/sysdeps/unix/sysv/linux/mips/mips64/n64/fstatat.c
+new file mode 100644
+index 0000000000..fe6c3a0dda
+--- /dev/null
++++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/fstatat.c
+@@ -0,0 +1,51 @@
++/* Get file status.  Linux/MIPSn64 version.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <sys/stat.h>
++#include <sysdep.h>
++
++/* Different than other ABIs, mips64 has different layouts for non-LFS
++   and LFS struct stat.  */
++int
++__fstatat (int fd, const char *file, struct stat *buf, int flag)
++{
++  struct __stat64_t64 st64;
++  int r = __fstatat64_time64 (fd, file, &st64, flag);
++  if (r == 0)
++    {
++      /* Clear internal pad and reserved fields.  */
++      memset (buf, 0, sizeof (*buf));
++
++      buf->st_dev = st64.st_dev;
++      buf->st_ino = st64.st_ino;
++      buf->st_mode = st64.st_mode;
++      buf->st_nlink = st64.st_nlink;
++      buf->st_uid = st64.st_uid;
++      buf->st_gid = st64.st_gid;
++      buf->st_rdev = st64.st_rdev;
++      buf->st_size = st64.st_size;
++      buf->st_blksize = st64.st_blksize;
++      buf->st_blocks  = st64.st_blocks;
++      buf->st_atim = st64.st_atim;
++      buf->st_mtim = st64.st_mtim;
++      buf->st_ctim = st64.st_ctim;
++    }
++  return r;
++}
++
++weak_alias (__fstatat, fstatat)
+-- 
+2.38.1
+
+
+From 2fce85f67c56e46863db40b8ca75bbf0fa993053 Mon Sep 17 00:00:00 2001
+From: caiyinyu <caiyinyu@loongson.cn>
+Date: Wed, 12 Oct 2022 20:28:42 +0800
+Subject: LoongArch: Fix ABI related macros in elf.h to keep consistent with
+ binutils[1].
+
+[1]:
+https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=c4a7e6b56218e1d5a858682186b542e2eae01a4a;hp=0d94a8735055432029237612a6eb9165db1ec9dd
+[2]:
+Reference: https://loongson.github.io/LoongArch-Documentation/LoongArch-ELF-ABI-EN.html#_e_flags_identifies_abi_type_and_version
+---
+ elf/elf.h | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/elf/elf.h b/elf/elf.h
+index 02a1b3f52f..014393f3cc 100644
+--- a/elf/elf.h
++++ b/elf/elf.h
+@@ -4085,8 +4085,11 @@ enum
+ #define R_NDS32_TLS_DESC	119
+ 
+ /* LoongArch ELF Flags */
+-#define EF_LARCH_ABI    	0x07
+-#define EF_LARCH_ABI_LP64D	0x03
++#define EF_LARCH_ABI_MODIFIER_MASK  0x07
++#define EF_LARCH_ABI_SOFT_FLOAT     0x01
++#define EF_LARCH_ABI_SINGLE_FLOAT   0x02
++#define EF_LARCH_ABI_DOUBLE_FLOAT   0x03
++#define EF_LARCH_OBJABI_V1          0x40
+ 
+ /* LoongArch specific dynamic relocations */
+ #define R_LARCH_NONE		0
+-- 
+2.38.1
+
+
+From 36cc06341a0c5029f49efaeef744dc3e9758e669 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <slyich@gmail.com>
+Date: Tue, 13 Sep 2022 13:39:13 -0400
+Subject: Makerules: fix MAKEFLAGS assignment for upcoming make-4.4 [BZ# 29564]
+
+make-4.4 will add long flags to MAKEFLAGS variable:
+
+    * WARNING: Backward-incompatibility!
+      Previously only simple (one-letter) options were added to the MAKEFLAGS
+      variable that was visible while parsing makefiles.  Now, all options
+      are available in MAKEFLAGS.
+
+This causes locale builds to fail when long options are used:
+
+    $ make --shuffle
+    ...
+    make  -C localedata install-locales
+    make: invalid shuffle mode: '1662724426r'
+
+The change fixes it by passing eash option via whitespace and dashes.
+That way option is appended to both single-word form and whitespace
+separated form.
+
+While at it fixed --silent mode detection in $(MAKEFLAGS) by filtering
+out --long-options. Otherwise options like --shuffle flag enable silent
+mode unintentionally. $(silent-make) variable consolidates the checks.
+
+Resolves: BZ# 29564
+
+CC: Paul Smith <psmith@gnu.org>
+CC: Siddhesh Poyarekar <siddhesh@gotplt.org>
+Signed-off-by: Sergei Trofimovich <slyich@gmail.com>
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit 2d7ed98add14f75041499ac189696c9bd3d757fe)
+---
+ Makeconfig     | 18 +++++++++++++++++-
+ Makerules      |  4 ++--
+ elf/rtld-Rules |  2 +-
+ 3 files changed, 20 insertions(+), 4 deletions(-)
+
+diff --git a/Makeconfig b/Makeconfig
+index ba70321af1..2bbcabd8f9 100644
+--- a/Makeconfig
++++ b/Makeconfig
+@@ -43,6 +43,22 @@ else
+ $(error objdir must be defined by the build-directory Makefile)
+ endif
+ 
++# Did we request 'make -s' run? "yes" or "no".
++# Starting from make-4.4 MAKEFLAGS now contains long
++# options like '--shuffle'. To detect presence of 's'
++# we pick first word with short options. Long options
++# are guaranteed to come after whitespace. We use '-'
++# prefix to always have a word before long options
++# even if no short options were passed.
++# Typical MAKEFLAGS values to watch for:
++#   "rs --shuffle=42" (silent)
++#   " --shuffle" (not silent)
++ifeq ($(findstring s, $(firstword -$(MAKEFLAGS))),)
++silent-make := no
++else
++silent-make := yes
++endif
++
+ # Root of the sysdeps tree.
+ sysdep_dir := $(..)sysdeps
+ export sysdep_dir := $(sysdep_dir)
+@@ -917,7 +933,7 @@ endif
+ # umpteen zillion filenames along with it (we use `...' instead)
+ # but we don't want this echoing done when the user has said
+ # he doesn't want to see commands echoed by using -s.
+-ifneq	"$(findstring s,$(MAKEFLAGS))" ""	# if -s
++ifeq ($(silent-make),yes)			# if -s
+ +cmdecho	:= echo >/dev/null
+ else						# not -s
+ +cmdecho	:= echo
+diff --git a/Makerules b/Makerules
+index d1e139d03c..09c0cf8357 100644
+--- a/Makerules
++++ b/Makerules
+@@ -794,7 +794,7 @@ endif
+ # Maximize efficiency by minimizing the number of rules.
+ .SUFFIXES:	# Clear the suffix list.  We don't use suffix rules.
+ # Don't define any builtin rules.
+-MAKEFLAGS := $(MAKEFLAGS)r
++MAKEFLAGS := $(MAKEFLAGS) -r
+ 
+ # Generic rule for making directories.
+ %/:
+@@ -811,7 +811,7 @@ MAKEFLAGS := $(MAKEFLAGS)r
+ .PRECIOUS: $(foreach l,$(libtypes),$(patsubst %,$(common-objpfx)$l,c))
+ \f
+ # Use the verbose option of ar and tar when not running silently.
+-ifeq	"$(findstring s,$(MAKEFLAGS))" ""	# if not -s
++ifeq ($(silent-make),no)			# if not -s
+ verbose := v
+ else	   					# -s
+ verbose	:=
+diff --git a/elf/rtld-Rules b/elf/rtld-Rules
+index ca00dd1fe2..3c5e273f2b 100644
+--- a/elf/rtld-Rules
++++ b/elf/rtld-Rules
+@@ -52,7 +52,7 @@ $(objpfx)rtld-libc.a: $(foreach dir,$(rtld-subdirs),\
+ 	mv -f $@T $@
+ 
+ # Use the verbose option of ar and tar when not running silently.
+-ifeq	"$(findstring s,$(MAKEFLAGS))" ""	# if not -s
++ifeq ($(silent-make),no)			# if not -s
+ verbose := v
+ else						# -s
+ verbose	:=
+-- 
+2.38.1
+
+
+From 70410f2286cc36c9ccb133878811c728ae51725f Mon Sep 17 00:00:00 2001
+From: Paul Eggert <eggert@cs.ucla.edu>
+Date: Thu, 8 Sep 2022 20:08:32 -0500
+Subject: mktime: improve heuristic for ca-1986 Indiana DST
+
+This patch syncs mktime.c from Gnulib, fixing a
+problem reported by Mark Krenz <https://bugs.gnu.org/48085>,
+and it should fix BZ#29035 too.
+* time/mktime.c (__mktime_internal): Be more generous about
+accepting arguments with the wrong value of tm_isdst, by falling
+back to a one-hour DST difference if we find no nearby DST that is
+unusual.  This fixes a problem where "1986-04-28 00:00 EDT" was
+rejected when TZ="America/Indianapolis" because the nearest DST
+timestamp occurred in 1970, a temporal distance too great for the
+old heuristic.  This also also narrows the search a bit, which
+is a minor performance win.
+
+(cherry picked from commit 83859e1115269cf56d21669361d4ddbe2687831c)
+---
+ time/mktime.c | 28 ++++++++++++++++++++--------
+ 1 file changed, 20 insertions(+), 8 deletions(-)
+
+diff --git a/time/mktime.c b/time/mktime.c
+index 494c89bf54..e9a6006710 100644
+--- a/time/mktime.c
++++ b/time/mktime.c
+@@ -429,8 +429,13 @@ __mktime_internal (struct tm *tp,
+ 	 time with the right value, and use its UTC offset.
+ 
+ 	 Heuristic: probe the adjacent timestamps in both directions,
+-	 looking for the desired isdst.  This should work for all real
+-	 time zone histories in the tz database.  */
++	 looking for the desired isdst.  If none is found within a
++	 reasonable duration bound, assume a one-hour DST difference.
++	 This should work for all real time zone histories in the tz
++	 database.  */
++
++      /* +1 if we wanted standard time but got DST, -1 if the reverse.  */
++      int dst_difference = (isdst == 0) - (tm.tm_isdst == 0);
+ 
+       /* Distance between probes when looking for a DST boundary.  In
+ 	 tzdata2003a, the shortest period of DST is 601200 seconds
+@@ -441,12 +446,14 @@ __mktime_internal (struct tm *tp,
+ 	 periods when probing.  */
+       int stride = 601200;
+ 
+-      /* The longest period of DST in tzdata2003a is 536454000 seconds
+-	 (e.g., America/Jujuy starting 1946-10-01 01:00).  The longest
+-	 period of non-DST is much longer, but it makes no real sense
+-	 to search for more than a year of non-DST, so use the DST
+-	 max.  */
+-      int duration_max = 536454000;
++      /* In TZDB 2021e, the longest period of DST (or of non-DST), in
++	 which the DST (or adjacent DST) difference is not one hour,
++	 is 457243209 seconds: e.g., America/Cambridge_Bay with leap
++	 seconds, starting 1965-10-31 00:00 in a switch from
++	 double-daylight time (-05) to standard time (-07), and
++	 continuing to 1980-04-27 02:00 in a switch from standard time
++	 (-07) to daylight time (-06).  */
++      int duration_max = 457243209;
+ 
+       /* Search in both directions, so the maximum distance is half
+ 	 the duration; add the stride to avoid off-by-1 problems.  */
+@@ -483,6 +490,11 @@ __mktime_internal (struct tm *tp,
+ 	      }
+ 	  }
+ 
++      /* No unusual DST offset was found nearby.  Assume one-hour DST.  */
++      t += 60 * 60 * dst_difference;
++      if (mktime_min <= t && t <= mktime_max && convert_time (convert, t, &tm))
++	goto offset_found;
++
+       __set_errno (EOVERFLOW);
+       return -1;
+     }
+-- 
+2.38.1
+
+
+From 0f90d6204d79223fd32248c774df0cb7f0e604de Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 8 Nov 2022 14:15:02 +0100
+Subject: Linux: Support __IPC_64 in sysvctl *ctl command arguments (bug 29771)
+
+Old applications pass __IPC_64 as part of the command argument because
+old glibc did not check for unknown commands, and passed through the
+arguments directly to the kernel, without adding __IPC_64.
+Applications need to continue doing that for old glibc compatibility,
+so this commit enables this approach in current glibc.
+
+For msgctl and shmctl, if no translation is required, make
+direct system calls, as we did before the time64 changes.  If
+translation is required, mask __IPC_64 from the command argument.
+
+For semctl, the union-in-vararg argument handling means that
+translation is needed on all architectures.
+
+Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
+(cherry picked from commit 22a46dee24351fd5f4f188ad80554cad79c82524)
+---
+ NEWS                               |  1 +
+ sysdeps/unix/sysv/linux/ipc_priv.h |  6 +++++
+ sysdeps/unix/sysv/linux/msgctl.c   | 38 ++++++++++++++++++++----------
+ sysdeps/unix/sysv/linux/semctl.c   |  7 ++++++
+ sysdeps/unix/sysv/linux/shmctl.c   | 38 ++++++++++++++++++++----------
+ 5 files changed, 64 insertions(+), 26 deletions(-)
+
+diff --git a/NEWS b/NEWS
+index e92d547e2c..9f8edea5db 100644
+--- a/NEWS
++++ b/NEWS
+@@ -46,6 +46,7 @@ The following bugs are resolved with this release:
+   [29657] libc: Incorrect struct stat for 64-bit time on linux/generic
+     platforms
+   [29730] broken y2038 support in fstatat on MIPS N64
++  [29771] Restore IPC_64 support in sysvipc *ctl functions
+ \f
+ Version 2.36
+ 
+diff --git a/sysdeps/unix/sysv/linux/ipc_priv.h b/sysdeps/unix/sysv/linux/ipc_priv.h
+index 87893a6757..2f50c31a8e 100644
+--- a/sysdeps/unix/sysv/linux/ipc_priv.h
++++ b/sysdeps/unix/sysv/linux/ipc_priv.h
+@@ -63,4 +63,10 @@ struct __old_ipc_perm
+ # define __IPC_TIME64 0
+ #endif
+ 
++#if __IPC_TIME64 || defined __ASSUME_SYSVIPC_BROKEN_MODE_T
++# define IPC_CTL_NEED_TRANSLATION 1
++#else
++# define IPC_CTL_NEED_TRANSLATION 0
++#endif
++
+ #include <ipc_ops.h>
+diff --git a/sysdeps/unix/sysv/linux/msgctl.c b/sysdeps/unix/sysv/linux/msgctl.c
+index e824ebb095..2072205252 100644
+--- a/sysdeps/unix/sysv/linux/msgctl.c
++++ b/sysdeps/unix/sysv/linux/msgctl.c
+@@ -85,11 +85,19 @@ msgctl_syscall (int msqid, int cmd, msgctl_arg_t *buf)
+ int
+ __msgctl64 (int msqid, int cmd, struct __msqid64_ds *buf)
+ {
+-#if __IPC_TIME64
++#if IPC_CTL_NEED_TRANSLATION
++# if __IPC_TIME64
+   struct kernel_msqid64_ds ksemid, *arg = NULL;
+-#else
++# else
+   msgctl_arg_t *arg;
+-#endif
++# endif
++
++  /* Some applications pass the __IPC_64 flag in cmd, to invoke
++     previously unsupported commands back when there was no EINVAL
++     error checking in glibc.  Mask the flag for the switch statements
++     below.  msgctl_syscall adds back the __IPC_64 flag for the actual
++     system call.  */
++  cmd &= ~__IPC_64;
+ 
+   switch (cmd)
+     {
+@@ -101,19 +109,19 @@ __msgctl64 (int msqid, int cmd, struct __msqid64_ds *buf)
+     case IPC_STAT:
+     case MSG_STAT:
+     case MSG_STAT_ANY:
+-#if __IPC_TIME64
++# if __IPC_TIME64
+       if (buf != NULL)
+ 	{
+ 	  msqid64_to_kmsqid64 (buf, &ksemid);
+ 	  arg = &ksemid;
+ 	}
+-# ifdef __ASSUME_SYSVIPC_BROKEN_MODE_T
++#  ifdef __ASSUME_SYSVIPC_BROKEN_MODE_T
+       if (cmd == IPC_SET)
+ 	arg->msg_perm.mode *= 0x10000U;
+-# endif
+-#else
++#  endif
++# else
+       arg = buf;
+-#endif
++# endif
+       break;
+ 
+     case IPC_INFO:
+@@ -137,21 +145,25 @@ __msgctl64 (int msqid, int cmd, struct __msqid64_ds *buf)
+     case IPC_STAT:
+     case MSG_STAT:
+     case MSG_STAT_ANY:
+-#ifdef __ASSUME_SYSVIPC_BROKEN_MODE_T
++# ifdef __ASSUME_SYSVIPC_BROKEN_MODE_T
+       arg->msg_perm.mode >>= 16;
+-#else
++# else
+       /* Old Linux kernel versions might not clear the mode padding.  */
+       if (sizeof ((struct msqid_ds){0}.msg_perm.mode)
+           != sizeof (__kernel_mode_t))
+ 	arg->msg_perm.mode &= 0xFFFF;
+-#endif
++# endif
+ 
+-#if __IPC_TIME64
++# if __IPC_TIME64
+       kmsqid64_to_msqid64 (arg, buf);
+-#endif
++# endif
+     }
+ 
+   return ret;
++
++#else /* !IPC_CTL_NEED_TRANSLATION */
++  return msgctl_syscall (msqid, cmd, buf);
++#endif
+ }
+ #if __TIMESIZE != 64
+ libc_hidden_def (__msgctl64)
+diff --git a/sysdeps/unix/sysv/linux/semctl.c b/sysdeps/unix/sysv/linux/semctl.c
+index 77a8130c18..3458b018bc 100644
+--- a/sysdeps/unix/sysv/linux/semctl.c
++++ b/sysdeps/unix/sysv/linux/semctl.c
+@@ -140,6 +140,13 @@ __semctl64 (int semid, int semnum, int cmd, ...)
+   union semun64 arg64 = { 0 };
+   va_list ap;
+ 
++  /* Some applications pass the __IPC_64 flag in cmd, to invoke
++     previously unsupported commands back when there was no EINVAL
++     error checking in glibc.  Mask the flag for the switch statements
++     below.  semctl_syscall adds back the __IPC_64 flag for the actual
++     system call.  */
++  cmd &= ~__IPC_64;
++
+   /* Get the argument only if required.  */
+   switch (cmd)
+     {
+diff --git a/sysdeps/unix/sysv/linux/shmctl.c b/sysdeps/unix/sysv/linux/shmctl.c
+index ea38935497..f00817a6f6 100644
+--- a/sysdeps/unix/sysv/linux/shmctl.c
++++ b/sysdeps/unix/sysv/linux/shmctl.c
+@@ -85,11 +85,19 @@ shmctl_syscall (int shmid, int cmd, shmctl_arg_t *buf)
+ int
+ __shmctl64 (int shmid, int cmd, struct __shmid64_ds *buf)
+ {
+-#if __IPC_TIME64
++#if IPC_CTL_NEED_TRANSLATION
++# if __IPC_TIME64
+   struct kernel_shmid64_ds kshmid, *arg = NULL;
+-#else
++# else
+   shmctl_arg_t *arg;
+-#endif
++# endif
++
++  /* Some applications pass the __IPC_64 flag in cmd, to invoke
++     previously unsupported commands back when there was no EINVAL
++     error checking in glibc.  Mask the flag for the switch statements
++     below.  shmctl_syscall adds back the __IPC_64 flag for the actual
++     system call.  */
++  cmd &= ~__IPC_64;
+ 
+   switch (cmd)
+     {
+@@ -103,19 +111,19 @@ __shmctl64 (int shmid, int cmd, struct __shmid64_ds *buf)
+     case IPC_STAT:
+     case SHM_STAT:
+     case SHM_STAT_ANY:
+-#if __IPC_TIME64
++# if __IPC_TIME64
+       if (buf != NULL)
+ 	{
+ 	  shmid64_to_kshmid64 (buf, &kshmid);
+ 	  arg = &kshmid;
+ 	}
+-# ifdef __ASSUME_SYSVIPC_BROKEN_MODE_T
++#  ifdef __ASSUME_SYSVIPC_BROKEN_MODE_T
+       if (cmd == IPC_SET)
+         arg->shm_perm.mode *= 0x10000U;
+-# endif
+-#else
++#  endif
++# else
+       arg = buf;
+-#endif
++# endif
+       break;
+ 
+     case IPC_INFO:
+@@ -140,21 +148,25 @@ __shmctl64 (int shmid, int cmd, struct __shmid64_ds *buf)
+       case IPC_STAT:
+       case SHM_STAT:
+       case SHM_STAT_ANY:
+-#ifdef __ASSUME_SYSVIPC_BROKEN_MODE_T
++# ifdef __ASSUME_SYSVIPC_BROKEN_MODE_T
+         arg->shm_perm.mode >>= 16;
+-#else
++# else
+       /* Old Linux kernel versions might not clear the mode padding.  */
+       if (sizeof ((struct shmid_ds){0}.shm_perm.mode)
+ 	  != sizeof (__kernel_mode_t))
+ 	arg->shm_perm.mode &= 0xFFFF;
+-#endif
++# endif
+ 
+-#if __IPC_TIME64
++# if __IPC_TIME64
+       kshmid64_to_shmid64 (arg, buf);
+-#endif
++# endif
+     }
+ 
+   return ret;
++
++#else /* !IPC_CTL_NEED_TRANSLATION */
++  return shmctl_syscall (shmid, cmd, buf);
++#endif
+ }
+ #if __TIMESIZE != 64
+ libc_hidden_def (__shmctl64)
+-- 
+2.38.1
+
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..0d19cc2082b5 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,18 @@
 # Template file for 'glibc'
+#
+# The latest glibc stable patches can be obtained by checking out release/${version}/master and doing:
+# git format-patch -k $(git describe --abbrev=0 --match 'glibc-*') --stdout > git-updates.patch
+#
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +24,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +59,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +167,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From 2fbccaf8634a3d3f5d600ee6b3a0f2543a6166a1 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 07/37] musl: add support for SIGEV_THREAD_ID timers

https://git.musl-libc.org/cgit/musl/commit/?id=7c71792e87691451f2a6b76348e83ad1889f1dcb
---
 ...d-support-for-SIGEV_THREAD_ID-timers.patch | 74 +++++++++++++++++++
 srcpkgs/musl/template                         |  2 +-
 2 files changed, 75 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch

diff --git a/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
new file mode 100644
index 000000000000..e20dff5ba0d4
--- /dev/null
+++ b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
@@ -0,0 +1,74 @@
+From 7c71792e87691451f2a6b76348e83ad1889f1dcb Mon Sep 17 00:00:00 2001
+From: James Y Knight <jyknight@google.com>
+Date: Sun, 30 Jun 2019 21:55:20 -0400
+Subject: [PATCH] add support for SIGEV_THREAD_ID timers
+
+This is like SIGEV_SIGNAL, but targeted to a particular thread's
+tid, rather than the process.
+---
+ include/signal.h        | 16 +++++++++++++---
+ src/time/timer_create.c |  8 ++++++--
+ 2 files changed, 19 insertions(+), 5 deletions(-)
+
+diff --git a/include/signal.h b/include/signal.h
+index fbdf667b2..9ed929e4f 100644
+--- a/include/signal.h
++++ b/include/signal.h
+@@ -180,14 +180,24 @@ struct sigevent {
+ 	union sigval sigev_value;
+ 	int sigev_signo;
+ 	int sigev_notify;
+-	void (*sigev_notify_function)(union sigval);
+-	pthread_attr_t *sigev_notify_attributes;
+-	char __pad[56-3*sizeof(long)];
++	union {
++		char __pad[64 - 2*sizeof(int) - sizeof(union sigval)];
++		pid_t sigev_notify_thread_id;
++		struct {
++			void (*sigev_notify_function)(union sigval);
++			pthread_attr_t *sigev_notify_attributes;
++		} __sev_thread;
++	} __sev_fields;
+ };
+ 
++#define sigev_notify_thread_id __sev_fields.sigev_notify_thread_id
++#define sigev_notify_function __sev_fields.__sev_thread.sigev_notify_function
++#define sigev_notify_attributes __sev_fields.__sev_thread.sigev_notify_attributes
++
+ #define SIGEV_SIGNAL 0
+ #define SIGEV_NONE 1
+ #define SIGEV_THREAD 2
++#define SIGEV_THREAD_ID 4
+ 
+ int __libc_current_sigrtmin(void);
+ int __libc_current_sigrtmax(void);
+diff --git a/src/time/timer_create.c b/src/time/timer_create.c
+index 5ddfda278..4bef23905 100644
+--- a/src/time/timer_create.c
++++ b/src/time/timer_create.c
+@@ -71,11 +71,15 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 	switch (evp ? evp->sigev_notify : SIGEV_SIGNAL) {
+ 	case SIGEV_NONE:
+ 	case SIGEV_SIGNAL:
++	case SIGEV_THREAD_ID:
+ 		if (evp) {
+ 			ksev.sigev_value = evp->sigev_value;
+ 			ksev.sigev_signo = evp->sigev_signo;
+ 			ksev.sigev_notify = evp->sigev_notify;
+-			ksev.sigev_tid = 0;
++			if (evp->sigev_notify == SIGEV_THREAD_ID)
++				ksev.sigev_tid = evp->sigev_notify_thread_id;
++			else
++				ksev.sigev_tid = 0;
+ 			ksevp = &ksev;
+ 		}
+ 		if (syscall(SYS_timer_create, clk, ksevp, &timerid) < 0)
+@@ -107,7 +111,7 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 
+ 		ksev.sigev_value.sival_ptr = 0;
+ 		ksev.sigev_signo = SIGTIMER;
+-		ksev.sigev_notify = 4; /* SIGEV_THREAD_ID */
++		ksev.sigev_notify = SIGEV_THREAD_ID;
+ 		ksev.sigev_tid = td->tid;
+ 		if (syscall(SYS_timer_create, clk, &ksev, &timerid) < 0)
+ 			timerid = -1;
diff --git a/srcpkgs/musl/template b/srcpkgs/musl/template
index 34e6ed4fba6e..afb33cd868b5 100644
--- a/srcpkgs/musl/template
+++ b/srcpkgs/musl/template
@@ -2,7 +2,7 @@
 pkgname=musl
 reverts="1.2.0_1"
 version=1.1.24
-revision=11
+revision=12
 archs="*-musl"
 bootstrap=yes
 build_style=gnu-configure

From b4c611062ff1569b6e323a71953f749547b1898c Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 08/37] gcc-multilib: update to 12.2.0.

---
 srcpkgs/gcc-multilib/template | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index f28eb237c287..ba9bafcadfd6 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,15 +3,15 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _majorver="${version%.*}"
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel
@@ -70,7 +70,7 @@ do_build() {
 	make ${makejobs}
 }
 do_install() {
-	local _pc_triplet=x86_64-pc-linux-gnu _version=${version%pre1}
+	local _pc_triplet=x86_64-pc-linux-gnu
 	# Install to a tempdir and then only copy relevant files.
 	cd ${wrksrc}
 	make DESTDIR=${wrksrc}/${pkgname}-build install
@@ -80,9 +80,9 @@ do_install() {
 	vmkdir usr/include/c++/${_majorver}/${_triplet}
 	vmkdir usr/lib/gcc/${_triplet}/${_majorver}
 
-	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${_version}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${version}/32 \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_majorver}/
-	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${_version}/${_pc_triplet}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${version}/${_pc_triplet}/32 \
 		${DESTDIR}/usr/include/c++/${_majorver}/${_triplet}
 
 	vinstall ${wrksrc}/host-${_pc_triplet}/gcc/specs 644 usr/lib/gcc/${_triplet}/${_majorver}

From d0b69b7f45e0d614f2b0c23f2838b3371160b678 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 09/37] libgccjit: update to 12.2.0.

---
 srcpkgs/libgccjit/files/libgccjit-musl.patch | 63 --------------------
 srcpkgs/libgccjit/template                   | 24 +++-----
 2 files changed, 9 insertions(+), 78 deletions(-)
 delete mode 100644 srcpkgs/libgccjit/files/libgccjit-musl.patch

diff --git a/srcpkgs/libgccjit/files/libgccjit-musl.patch b/srcpkgs/libgccjit/files/libgccjit-musl.patch
deleted file mode 100644
index d2ed16928c82..000000000000
--- a/srcpkgs/libgccjit/files/libgccjit-musl.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-diff --git a/gcc/jit/jit-playback.c b/gcc/jit/jit-playback.c
-index 5bccf591a..35f5e35ef 100644
---- a/gcc/jit/jit-playback.c
-+++ b/gcc/jit/jit-playback.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -41,8 +43,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "diagnostic.h"
- #include "stmt.h"
- 
--#include <pthread.h>
--
- #include "jit-playback.h"
- #include "jit-result.h"
- #include "jit-builtins.h"
-diff --git a/gcc/jit/jit-recording.c b/gcc/jit/jit-recording.c
-index a237d574f..5785e3269 100644
---- a/gcc/jit/jit-recording.c
-+++ b/gcc/jit/jit-recording.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -25,8 +27,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "pretty-print.h"
- #include "toplev.h"
- 
--#include <pthread.h>
--
- #include "jit-builtins.h"
- #include "jit-recording.h"
- #include "jit-playback.h"
-diff --git a/gcc/jit/libgccjit.c b/gcc/jit/libgccjit.c
-index f9c33c63c..75f21d275 100644
---- a/gcc/jit/libgccjit.c
-+++ b/gcc/jit/libgccjit.c
-@@ -18,13 +18,13 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
- #include "timevar.h"
- #include "typed-splay-tree.h"
- #include "cppbuiltin.h"
--#include <pthread.h>
- 
- #include "libgccjit.h"
- #include "jit-recording.h"
diff --git a/srcpkgs/libgccjit/template b/srcpkgs/libgccjit/template
index 0b37c3ee9f8b..fde1affd54b7 100644
--- a/srcpkgs/libgccjit/template
+++ b/srcpkgs/libgccjit/template
@@ -3,18 +3,12 @@
 # which use the version number.
 
 pkgname=libgccjit
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
+version=12.2.0
 revision=1
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
-_majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 create_wrksrc=yes
 short_desc="Just-In-Time Compilation library for GCC"
 maintainer="Lane Biocini <lane@mailbox.org>"
@@ -22,16 +16,16 @@ homepage="https://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 nopie=yes
 lib32disabled=yes
 makedepends="zlib-devel"

From 4a474c1a18fd44f526a6d5c89a26f6932f910006 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 10/37] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove -no-pie from build. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..f7e02dbc48cb 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -53,6 +53,7 @@ _void_cross_build_binutils() {
 		--sbindir=/usr/bin \
 		--libdir=/usr/lib \
 		--libexecdir=/usr/lib \
+		--sysconfdir=/etc \
 		--target=${tgt} \
 		--with-sysroot=/usr/${tgt} \
 		--disable-nls \
@@ -60,7 +61,9 @@ _void_cross_build_binutils() {
 		--disable-multilib \
 		--disable-werror \
 		--disable-gold \
+		--disable-gprofng \
 		--enable-relro \
+		--enable-new-dtags \
 		--enable-plugins \
 		--enable-64-bit-bfd \
 		--enable-deterministic-archives \
@@ -91,6 +94,9 @@ _void_cross_build_bootstrap_gcc() {
 	# Do not run fixincludes
 	sed -i 's@./fixinc.sh@-c true@' Makefile.in
 
+	# Do not use system headers to determine clocale implementation
+	sed -i 's/#if (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined(__UCLIBC__)/#if 1/g' libstdc++-v3/configure
+
 	for f in ${XBPS_SRCPKGDIR}/gcc/patches/*.patch; do
 		_void_cross_apply_patch "$f"
 	done
@@ -132,6 +138,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -381,6 +388,7 @@ _void_cross_build_gcc() {
 		extra_args+=" --disable-gnu-unique-object"
 		extra_args+=" libat_cv_have_ifunc=no"
 	else
+		extra_args+=" --enable-clocale=gnu"
 		extra_args+=" --enable-gnu-unique-object"
 	fi
 
@@ -460,6 +468,14 @@ do_build() {
 	local binutils_ver linux_ver gcc_ver libc_ver libucontext_ver
 	local tgt=${sourcepkg/cross-}
 
+	export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}"
+	export CXXFLAGS="${CXXFLAGS/-D_FORTIFY_SOURCE=2/}"
+
+	# Disable explicit -fno-PIE, gcc/binutils/libc will figure this out itself.
+	export CFLAGS="${CFLAGS//-fno-PIE/}"
+	export CXXFLAGS="${CXXFLAGS//-fno-PIE/}"
+	export LDFLAGS="${LDFLAGS//-no-pie/}"
+
 	_void_cross_test_ver binutils
 	_void_cross_test_ver linux
 	_void_cross_test_ver gcc
@@ -625,6 +641,9 @@ do_install() {
 	# then remove it because it conflicts with libquadmath package
 	rm -rf ${DESTDIR}/${sysroot}/usr/lib/libquadmath.*
 
+	# Remove libdep linker plugin because it conflicts with system binutils
+	rm -f ${DESTDIR}/usr/lib/bfd-plugins/libdep*
+
 	# Remove leftover symlinks
 	rm -f ${DESTDIR}/usr/lib${XBPS_TARGET_WORDSIZE}
 	rm -f ${DESTDIR}/lib*

From 48d8aaf6dc113eb3bdbcadd0cd8173e19b879084 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 11/37] qemu: remove broken patch

The necessary patch has been imported into musl so no need
to cast the sigevent struct to a more glibc-like one.
---
 .../musl-fix-sigevent-and-sigval_t.patch      | 27 -------------------
 1 file changed, 27 deletions(-)
 delete mode 100644 srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch

diff --git a/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch b/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch
deleted file mode 100644
index 4b4f1117c15f..000000000000
--- a/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-Note: Remove this patch with musl 1.2.2
-
---- a/linux-user/syscall.c
-+++ b/linux-user/syscall.c
-@@ -5020,10 +5020,21 @@
- #ifndef HAVE_SIGEV_NOTIFY_THREAD_ID
- #define sigev_notify_thread_id _sigev_un._tid
- #endif
- 
--static inline abi_long target_to_host_sigevent(struct sigevent *host_sevp,
-+struct host_sigevent {
-+    union sigval sigev_value;
-+    int sigev_signo;
-+    int sigev_notify;
-+    union {
-+       char _pad[64 - sizeof(int) * 2 - sizeof(union sigval)];
-+       int _tid;
-+    } _sigev_un;
-+};
-+
-+static inline abi_long target_to_host_sigevent(struct sigevent *sevp,
-                                                abi_ulong target_addr)
- {
-+    struct host_sigevent *host_sevp = (struct host_sigevent *) sevp;
-     struct target_sigevent *target_sevp;
- 
-     if (!lock_user_struct(VERIFY_READ, target_sevp, target_addr, 1)) {

From ea6f0bc227588f16c747317b6204bd3ff4cf6091 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 19 Nov 2022 13:26:24 -0800
Subject: [PATCH 12/37] mk-configure: rebuild for gcc 12

---
 srcpkgs/mk-configure/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/mk-configure/template b/srcpkgs/mk-configure/template
index 9d12f11a9799..c50d8adf213f 100644
--- a/srcpkgs/mk-configure/template
+++ b/srcpkgs/mk-configure/template
@@ -1,7 +1,7 @@
 # Template file for 'mk-configure'
 pkgname=mk-configure
 version=0.37.0
-revision=1
+revision=2
 build_style=gnu-makefile
 make_cmd=bmake
 make_install_args="MANDIR=/usr/share/man"

From 2da38640d1806c02a22b1cfa436def35bced2ffe Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 13/37] cross-aarch64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..9e6fb75c198d 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Leah Neukirchen <leah@vuxu.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 3b665c8574ab93837fb3de94a18955b9cd2f3c29 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 14/37] cross-aarch64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..ba14c96bccea 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From ed428ddbfe9be83105826e6fbd1fc047500336af Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 15/37] cross-arm-linux-gnueabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..5c774e16f430 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 21944a775ae909a6c492c5dac05a140a059353f3 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 16/37] cross-arm-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..d6298ab639a4 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 37574664ee0e54ae2d3a8cc476bc884e2b505d0e Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 17/37] cross-arm-linux-musleabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..24df78e8fd8e 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 1a5ab11ee25a4f8e849fc6a395373183525649c6 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 18/37] cross-arm-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..8093700f909c 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 198261bf280c82c5c37549b1766afa5c65ac03d6 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 19/37] cross-armv7l-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..92665326428b 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From a7f0f8222410564acb37012da081f810f4e82019 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 20/37] cross-armv7l-linux-musleabihf: update to gcc 12.2.0.

---
 .../cross-armv7l-linux-musleabihf/template    | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..e5af2c9ccbf2 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From c624df409646829aded381f3fa846f4c8538e37b Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 21/37] cross-i686-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-i686-linux-musl/template b/srcpkgs/cross-i686-linux-musl/template
index 8be16a230d8d..d624bb7a3254 100644
--- a/srcpkgs/cross-i686-linux-musl/template
+++ b/srcpkgs/cross-i686-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-i686-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-i686-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 4660746c507fc3d9786e43e149bd13e2acf4de4f Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 22/37] cross-i686-pc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..6a9e54db807a 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,14 +1,15 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -16,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 4b5bd3be19896b27c95d6677500899ab91afbc0a Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 23/37] cross-mips-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-musl/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..67a5c413396c 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From a4bbe10d0bd29ca8b5a3ba01d01754c5bab0cda6 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 24/37] cross-mips-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..bdf8600ce95b 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="hipperson0 <hipperson0@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 787b7d05778318cb923c0729c56dfeaf7199b65b Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 25/37] cross-mipsel-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..de49387d517b 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 07931700830ea508bf667f514f1782e00db455a5 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 26/37] cross-mipsel-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..b27ce6475a38 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From e4f6632deb7f0deac82e9e424b84b2d2e5dee539 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 27/37] cross-powerpc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..79579e093b12 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From f3a91f889c1d2386ee9d922759022a5ffa3c80a2 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 28/37] cross-powerpc-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..9bb6acd359b6 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 1c1dd6a340aba0fa19ca5d6a0dc1c0282bf6a935 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 29/37] cross-powerpc64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..2d153d00add6 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,16 +1,17 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
  --enable-targets=powerpc-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -18,12 +19,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 89c95c7c4356b5717fb82745ebc133befcde0e63 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 30/37] cross-powerpc64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 016f18776a6d..e0848fe0bff7 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,30 +1,31 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 5950b7b414d963d0672e3162dae1bfa7701f1753 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 31/37] cross-powerpc64le-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 463d7e92d20d..8d8e010e15c0 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,16 +1,17 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
  --enable-targets=powerpcle-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -18,12 +19,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From ec11a908e6f4777d095a9e68401df3db4a52db9e Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 32/37] cross-powerpc64le-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index c17a3cccfe29..0915e524545f 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,30 +1,31 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 48b908462d2975f45c59d4de7ebbf737d656e1ba Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 33/37] cross-powerpcle-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 9aede3c465ce..687be8a44c6c 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 
@@ -35,6 +36,8 @@ if [ "$XBPS_TARGET_MACHINE" = "ppcle" ]; then
 	broken="Can't build crosstoolchain to itself"
 fi
 
+broken="glibc uses big-endian specific instructions on 32-bit powerpc"
+
 cross-powerpcle-linux-gnu-libc_package() {
 	short_desc+=" - glibc files"
 	nostrip=yes

From ee5e6a61bf63eb383c4d23be9ee7418158ca9cfb Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 34/37] cross-powerpcle-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index 045cfda987fe..bb984b9c42eb 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 66b33ef9066fde79dd6c85f5da9d78cecd01ce3f Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:30 -0800
Subject: [PATCH 35/37] cross-x86_64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 8918f3c22a1c..930aaf2a508b 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,14 +1,15 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -16,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 498799e29a8eb103201d0fb1b4d94f53cf404809 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:30 -0800
Subject: [PATCH 36/37] cross-x86_64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..ac5b1c46ab82 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From c7a5ccbfe444bb85c2deb34eaccbe7fe61c4ca34 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Fri, 18 Nov 2022 02:01:19 -0800
Subject: [PATCH 37/37] cross-vpkg-dummy: update to 0.39.

---
 srcpkgs/cross-vpkg-dummy/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/cross-vpkg-dummy/template b/srcpkgs/cross-vpkg-dummy/template
index d83e38dc63ac..aeafb749dd5f 100644
--- a/srcpkgs/cross-vpkg-dummy/template
+++ b/srcpkgs/cross-vpkg-dummy/template
@@ -1,6 +1,6 @@
 # Template file for 'cross-vpkg-dummy'
 pkgname=cross-vpkg-dummy
-version=0.38
+version=0.39
 revision=1
 build_style=meta
 short_desc="Dummy meta-pkg for cross building packages with xbps-src"
@@ -54,8 +54,8 @@ conflicts="
 	gcc-objc++>=0"
 shlib_provides="
 	libgcc_s.so.1
-	libgnat-10.so
-	libgnarl-10.so
+	libgnat-12.so
+	libgnarl-12.so
 	libstdc++.so.6
 	libgfortran.so.5"
 

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (237 preceding siblings ...)
  2022-11-19 22:57 ` oreo639
@ 2022-11-20 18:03 ` oreo639
  2022-11-21 18:22 ` oreo639
                   ` (25 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-11-20 18:03 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5448 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.2.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.2.0

There is a list of failing builds here: https://github.com/void-linux/void-packages/issues/39809

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [x] llvm https://github.com/void-linux/void-packages/pull/38694
- [x] m4 https://github.com/void-linux/void-packages/pull/33730
- [x] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [x] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [x] libvirt https://github.com/void-linux/void-packages/pull/38842
- [x] syslinux https://github.com/void-linux/void-packages/pull/38876
- [x] efivar https://github.com/void-linux/void-packages/pull/38874
- [x] gpgme https://github.com/void-linux/void-packages/pull/38825

Known packages that needed to be fixed/updated for gcc12:
- [x] openssh https://github.com/void-linux/void-packages/pull/38849
- [x] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [x] doxygen https://github.com/void-linux/void-packages/pull/38846
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] libproxy https://github.com/void-linux/void-packages/pull/38818
- [x] exempi https://github.com/void-linux/void-packages/pull/38820
- [x] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [x] libunique1 https://github.com/void-linux/void-packages/pull/38848 or https://github.com/void-linux/void-packages/pull/38873
- [x] libwpd https://github.com/void-linux/void-packages/pull/38878
- [x] cglm https://github.com/void-linux/void-packages/pull/39748
- [x] coreboot-utils https://github.com/void-linux/void-packages/pull/39749
- [x] apl https://github.com/void-linux/void-packages/pull/39750
- [x] igt-gpu-tools https://github.com/void-linux/void-packages/pull/39780

Needs to be fixed/updated for binutils:
- [x] grub https://github.com/void-linux/void-packages/pull/38875
- [x] linux-tools https://github.com/void-linux/void-packages/pull/38877
- [x] kcov https://github.com/void-linux/void-packages/pull/39291

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [x] kde
- [x] lxde
- [x] lxqt

You can test the ISOs here:
https://drive.google.com/drive/folders/1ix92CYSLUP-KWjLxltdgG4e8Nu2JCY5n?usp=sharing

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 519433 bytes --]

From d6f304545e153d5bff171247f640739f1483c1b6 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 01/37] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../fix-libcollector-without-java.patch       | 53 +++++++++++++++
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 25 ++++---
 4 files changed, 87 insertions(+), 117 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
 create mode 100644 srcpkgs/binutils/patches/fix-libcollector-without-java.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/fix-libcollector-without-java.patch b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
new file mode 100644
index 000000000000..54384875f358
--- /dev/null
+++ b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
@@ -0,0 +1,53 @@
+From 49ddd814ac1071af7c4f45d5f8398b91862f2c7f Mon Sep 17 00:00:00 2001
+From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
+Date: Wed, 17 Aug 2022 19:55:23 -0700
+Subject: [PATCH] gprofng: fix bug 29479 Collection fails when built without
+ java support
+
+gprofng/ChangeLog
+2022-08-17  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>
+
+	PR gprofng/29479
+	* libcollector/collector.c: Add #if defined(GPROFNG_JAVA_PROFILING) for
+	java specific code.
+	* libcollector/unwind.c: Likewise.
+---
+ gprofng/libcollector/collector.c | 2 ++
+ gprofng/libcollector/unwind.c    | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/gprofng/libcollector/collector.c b/gprofng/libcollector/collector.c
+index 93c9d3330de5..ceff2c1caccb 100644
+--- a/gprofng/libcollector/collector.c
++++ b/gprofng/libcollector/collector.c
+@@ -913,8 +913,10 @@ __collector_open_experiment (const char *exp, const char *params, sp_origin_t or
+   __collector_ext_unwind_key_init (1, NULL);
+ 
+   /* start java attach if suitable */
++#if defined(GPROFNG_JAVA_PROFILING)
+   if (exp_origin == SP_ORIGIN_DBX_ATTACH)
+     __collector_jprofile_start_attach ();
++#endif
+   start_sec_time = CALL_UTIL (time)(NULL);
+   __collector_start_time = collector_interface.getHiResTime ();
+   TprintfT (DBG_LT0, "\t__collector_open_experiment; resetting start_time\n");
+diff --git a/gprofng/libcollector/unwind.c b/gprofng/libcollector/unwind.c
+index 119243788020..f8e11823c81e 100644
+--- a/gprofng/libcollector/unwind.c
++++ b/gprofng/libcollector/unwind.c
+@@ -557,6 +557,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+   int size = max_frame_size;
+ 
+ #define MIN(a,b) ((a)<(b)?(a):(b))
++#if defined(GPROFNG_JAVA_PROFILING)
+   /* get Java info */
+   if (__collector_java_mode && __collector_java_asyncgetcalltrace_loaded && context && !pseudo_context)
+     {
+@@ -569,6 +570,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+ 	  size -= sz;
+ 	}
+     }
++#endif
+ 
+   /* get native stack */
+   if (context)
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..c355a5fc8016 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkgconf"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -35,15 +36,21 @@ do_configure() {
 	local conf
 
 	if [ "$CHROOT_READY" ]; then
-		conf+=" --with-debuginfod"
+		conf+=" --with-debuginfod --enable-shared"
 	else
-		conf+=" --without-debuginfod --disable-install-libbfd"
+		conf+=" --without-debuginfod --disable-shared --disable-install-libbfd"
 	fi
 	if [ "$CROSS_BUILD" ]; then
 		# we don't want --with-sysroot=${XBPS_CROSS_BASE} like gnu-configure
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	# gprofng currently only supports x86 and aarch64 glibc.
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64|i386|aarch64) conf+=" --enable-gprofng" ;;
+		*) conf+=" --disable-gprofng" ;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"
@@ -76,13 +83,14 @@ do_configure() {
 		--libdir=/usr/lib \
 		--mandir=/usr/share/man \
 		--infodir=/usr/share/info \
+		--sysconfdir=/etc \
 		--disable-werror \
-		--disable-shared \
 		--disable-nls \
 		--enable-threads \
 		--enable-plugins \
 		--enable-relro \
 		--enable-gold \
+		--enable-new-dtags \
 		--enable-deterministic-archives \
 		--enable-64-bit-bfd \
 		--enable-ld=default \
@@ -142,7 +150,8 @@ binutils-devel_package() {
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/*.a"
-		vmove "usr/lib/*.so"
+		vmove "usr/lib/libbfd.so"
+		vmove "usr/lib/libopcodes.so"
 	}
 }
 

From 941ef662314a48f52e561c0086160dd25b0a40fa Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 02/37] gdb: resolve conflict with binutils 2.39

---
 srcpkgs/gdb/template | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/gdb/template b/srcpkgs/gdb/template
index 9c5f17ffc519..b666348fea19 100644
--- a/srcpkgs/gdb/template
+++ b/srcpkgs/gdb/template
@@ -1,7 +1,7 @@
 # Template file for 'gdb'
 pkgname=gdb
 version=12.1
-revision=2
+revision=3
 build_style=gnu-configure
 pycompile_dirs="/usr/share/gdb/python"
 configure_args="--disable-werror --disable-nls --with-system-readline
@@ -48,7 +48,8 @@ vopt_conflict debuginfod static
 
 post_install() {
 	# resolve conflicts with binutils
-	rm -r ${DESTDIR}/usr/{include,lib,share/info/bfd.info*}
+	rm -rf ${DESTDIR}/usr/{include,lib}
+	rm -rf ${DESTDIR}/usr/share/info/{bfd,ctf-spec}.info*
 }
 
 gdb-common_package() {

From 887bb5a125614c503fe01a1da2c97c80ae4ec919 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 03/37] gcc: update to 12.2.0.

---
 common/shlibs                                 | 10 +--
 srcpkgs/gcc/files/gccgo-musl.patch            | 71 +++------------
 srcpkgs/gcc/files/libgnarl-musl.patch         | 18 ++--
 srcpkgs/gcc/files/libssp-musl.patch           | 10 +--
 srcpkgs/gcc/patches/libffi_gnulinux.patch     | 11 ---
 .../gcc/patches/libgcc-ibm128-no-tag.patch    | 10 ++-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |  2 +-
 srcpkgs/gcc/template                          | 87 +++++++++----------
 8 files changed, 80 insertions(+), 139 deletions(-)
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index 3b103f479d5a..04cbade52468 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.2.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.36 perl-5.36.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -857,8 +857,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.2.0_1
+libgnat-12.so libada-12.2.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1710,8 +1710,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.2.0_1
+libasan.so.8 libsanitizer-12.2.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..12ec68dd8aa3 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,14 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ b/libgo/go/runtime/os_linux.go
+@@ -365,7 +365,7 @@ func setThreadCPUProfiler(hz int32) {
+ 	var sevp _sigevent
+ 	sevp.sigev_notify = _SIGEV_THREAD_ID
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.__sev_fields))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index ab3643de4f98..a20af7c0ef2e 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,14 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
+version=12.2.0
+revision=1
+_minorver="${version%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 create_wrksrc=yes
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +18,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -52,8 +48,11 @@ if [ "$CHROOT_READY" ]; then
 	hostmakedepends="tar texinfo perl flex"
 else
 	_have_gccgo=no
+	# libzstd fails to link in bootstrap with glibc 2.36
+	# when zlib has been compiled with glibc 2.32.
+	LDFLAGS="-lzstd -pthread"
 fi
-makedepends="zlib-devel"
+makedepends="zlib-devel libzstd-devel"
 depends="binutils libgcc-devel-${version}_${revision}
  libstdc++-devel-${version}_${revision} libssp-devel-${version}_${revision}"
 checkdepends="dejagnu"
@@ -70,13 +69,13 @@ if [ "$build_option_gnatboot" ]; then
 	case "$XBPS_TARGET_MACHINE" in
 	x86_64)
 		_gnat_tarball="gnat-gpl-2017-x86_64-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/591c6d80c7a447af2deed1d7>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/9682e2e1f2f232ce03fe21d77b14c37a0de5649b?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" b942bcac20dea39748b39f8b624d9619f60a8dee2e8195dbe3829c835b0956e6"
 		build_options_default="gnatboot"
 		;;
 	i686)
 		_gnat_tarball="gnat-gpl-2014-x86-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/564b3e9dc8e196b040fbe248>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/c5e9e6fdff5cb77ed90cf8c62536653e27c0bed6?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" 3b693510f5d22a240abb3034934c1adbd80ccd6e4f61a4f491cc408fdfd9c042"
 		build_options_default="gnatboot"
 		;;
@@ -155,8 +154,8 @@ if [ "$CROSS_BUILD" ]; then
 fi
 
 post_extract() {
-	mv gcc-${version/pre/_pre}/* gcc-${version/pre/_pre}/.??* .
-	rmdir gcc-${version/pre/_pre}
+	mv gcc-${version}/* gcc-${version}/.??* .
+	rmdir gcc-${version}
 	mv gmp-${_gmp_version} gmp
 	mv mpfr-${_mpfr_version} mpfr
 	mv mpc-${_mpc_version} mpc
@@ -186,9 +185,9 @@ pre_configure() {
 	sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
 
 	if [ "$XBPS_TARGET_LIBC" = musl ]; then
-		patch -p1 -i ${FILESDIR}/libgnarl-musl.patch
-		patch -p1 -i ${FILESDIR}/libssp-musl.patch
-		patch -p1 -i ${FILESDIR}/gccgo-musl.patch
+		for p in ${FILESDIR}/*-musl.patch; do
+			patch -p1 -i $p
+		done
 	fi
 }
 do_configure() {
@@ -343,16 +342,16 @@ do_install() {
 
 	# Make version a symlink of major version to make all versions
 	# from the same series work automagically.
-	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver} \
+	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${version} \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver}
 	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver} \
-		${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}
+		${DESTDIR}/usr/lib/gcc/${_triplet}/${version}
 
 	# Ditto for c++ headers.
-	mv ${DESTDIR}/usr/include/c++/${_patchver} \
+	mv ${DESTDIR}/usr/include/c++/${version} \
 		${DESTDIR}/usr/include/c++/${_minorver}
 	ln -sfr ${DESTDIR}/usr/include/c++/${_minorver} \
-		${DESTDIR}/usr/include/c++/${_patchver}
+		${DESTDIR}/usr/include/c++/${version}
 
 	# cc symlink
 	ln -sfr ${DESTDIR}/usr/bin/gcc ${DESTDIR}/usr/bin/cc
@@ -361,7 +360,7 @@ do_install() {
 
 	# lto plugin symlink
 	vmkdir usr/lib/bfd-plugins
-	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}/liblto_plugin.so \
+	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${version}/liblto_plugin.so \
 		${DESTDIR}/usr/lib/bfd-plugins
 
 	# Remove "fixed" header
@@ -372,13 +371,9 @@ do_install() {
 	rm -f ${DESTDIR}/usr/lib/libffi*
 	rm -f ${DESTDIR}/usr/share/man/man3/ffi*
 
-	# Remove all python scripts in libdir.
-	rm -f ${DESTDIR}/usr/lib/*.py
-
-	# Remove more python stuff.
-	if [ -d ${DESTDIR}/usr/share/gcc-${_patchver}/python ]; then
-		rm -rf ${DESTDIR}/usr/share/gcc-${_patchver}/python
-	fi
+	# Move libstdc++ gdb helpers to location where gdb can autoload them
+	mkdir -p ${DESTDIR}/usr/share/gdb/auto-load/usr/lib
+	mv ${DESTDIR}/usr/lib/*.py ${DESTDIR}/usr/share/gdb/auto-load/usr/lib
 
 	# Install c89 and c99 wrappers and its manpages, from NetBSD.
 	for f in c89 c99; do
@@ -397,7 +392,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}
@@ -450,7 +445,7 @@ gcc-fortran_package() {
 		if [ "$CROSS_BUILD" ]; then
 			# A number of OMP modules are not built when cross
 			# compiling gcc. Copy them from the cross compiler.
-			local src="/usr/lib/gcc/${_triplet}/${_patchver}/finclude"
+			local src="/usr/lib/gcc/${_triplet}/${version}/finclude"
 			local dst="usr/lib/gcc/${_triplet}/${_minorver}/finclude"
 			for f in omp_lib.f90 omp_lib.h omp_lib.mod omp_lib_kinds.mod \
 				openacc.f90 openacc.mod openacc_kinds.mod openacc_lib.h; do
@@ -517,7 +512,7 @@ libgfortran_package() {
 	short_desc+=" - Fortran library"
 	pkg_install() {
 		vmove "usr/lib/libgfortran.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -538,7 +533,7 @@ libgo_package() {
 	nostrip=yes
 	pkg_install() {
 		vmove "usr/lib/libgo.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -554,7 +549,7 @@ libobjc_package() {
 	short_desc+=" - Objective-C library"
 	pkg_install() {
 		vmove "usr/lib/libobjc.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -573,7 +568,7 @@ libquadmath_package() {
 	short_desc+=" - quadmath library"
 	pkg_install() {
 		vmove "usr/lib/libquadmath.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -615,7 +610,7 @@ libgcc_package() {
 	noverifyrdeps=yes
 	pkg_install() {
 		vmove "usr/lib/libgcc_s.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -646,7 +641,7 @@ libgomp_package() {
 	short_desc+=" - OpenMP v4.0 library"
 	pkg_install() {
 		vmove "usr/lib/libgomp*.so.*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -701,7 +696,7 @@ libssp_package() {
 	short_desc+=" - SSP (StackSmashingProtection) library"
 	pkg_install() {
 		vmove "usr/lib/libssp.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -718,7 +713,9 @@ libstdc++-devel_package() {
 libstdc++_package() {
 	short_desc+=" - Standard C++ Library"
 	pkg_install() {
+		vmove usr/share/gdb
+		vmove usr/share/gcc-${version}/python
 		vmove "usr/lib/libstdc++.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }

From 3bafdca38ad14e1f40df21dcea9d7a9cc8d8b8f3 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 04/37] libtool: rebuild for gcc 12

---
 srcpkgs/libtool/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index fc5c53a9c3e9..aebad9294eef 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
 version=2.4.7
-revision=1
+revision=2
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"

From 1e7d1b7e3ba3e5d56c904b302bd8f6c06acf14e8 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 05/37] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 7e01bbb851fd..d9618e3806ba 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 build_wrksrc=libiberty
 build_style=gnu-configure
@@ -10,7 +10,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From 214cebfe41271eb5a79c24451c613e8a851f9cf0 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 06/37] glibc: update to 2.36.

---
 common/shlibs                                 |    60 +-
 ...e-hash-style-both-for-building-glibc.patch |    51 +
 srcpkgs/glibc/patches/git-updates.patch       | 10872 ++++++++++++++++
 .../glibc/patches/glibc-c-utf8-locale.patch   |   286 -
 srcpkgs/glibc/template                        |    62 +-
 5 files changed, 10978 insertions(+), 353 deletions(-)
 create mode 100644 srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
 create mode 100644 srcpkgs/glibc/patches/git-updates.patch
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index 04cbade52468..a8c3a244f9ac 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch b/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
new file mode 100644
index 000000000000..9c5553e92609
--- /dev/null
+++ b/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
@@ -0,0 +1,51 @@
+Temporary workaround for EAC bug.
+
+See: https://sourceware.org/bugzilla/show_bug.cgi?id=29456
+
+From 8e90e2cc5e57d7ca3a40602d278e9642a8b66716 Mon Sep 17 00:00:00 2001
+From: oreo639 <oreo6391@gmail.com>
+Date: Tue, 13 Sep 2022 14:30:35 -0700
+Subject: [PATCH] Revert "Do not use --hash-style=both for building glibc
+ shared objects"
+
+This reverts commit e47de5cb2d4dbecb58f569ed241e8e95c568f03c.
+---
+ Makeconfig     |  9 +++++++++
+ Makerules      |  7 +++++++
+ 5 files changed, 61 insertions(+)
+
+diff --git a/Makeconfig b/Makeconfig
+index ba70321af1..e2131d4389 100644
+--- a/Makeconfig
++++ b/Makeconfig
+@@ -371,6 +371,13 @@ dt-relr-ldflag =
+ no-dt-relr-ldflag =
+ endif
+ 
++# For the time being we unconditionally use 'both'.  At some time we
++# should declare statically linked code as 'out of luck' and compile
++# with --hash-style=gnu only.
++hashstyle-LDFLAGS = -Wl,--hash-style=both
++LDFLAGS.so += $(hashstyle-LDFLAGS)
++LDFLAGS-rtld += $(hashstyle-LDFLAGS)
++
+ ifeq (no,$(build-pie-default))
+ pie-default = $(no-pie-ccflag)
+ else # build-pie-default
+diff --git a/Makerules b/Makerules
+index d1e139d03c..44134e37ce 100644
+--- a/Makerules
++++ b/Makerules
+@@ -558,6 +558,9 @@ $(common-objpfx)shlib.lds: $(common-objpfx)config.make $(..)Makerules
+ 		  -Wl,--verbose 2>/dev/null | \
+ 	  sed > $@T \
+ 	      -e '/^=========/,/^=========/!d;/^=========/d' \
++		   -e 's/^.*\.gnu\.hash[ 	]*:.*$$/  .note.ABI-tag : { *(.note.ABI-tag) } &/' \
++		   -e '/^[ 	]*\.hash[ 	]*:.*$$/{h;d;}' \
++		   -e '/DATA_SEGMENT_ALIGN/{H;g}' \
+ 	      -e 's/^.*\*(\.dynbss).*$$/& \
+ 		 PROVIDE(__start___libc_freeres_ptrs = .); \
+ 		 *(__libc_freeres_ptrs) \
+-- 
+2.37.3
+
diff --git a/srcpkgs/glibc/patches/git-updates.patch b/srcpkgs/glibc/patches/git-updates.patch
new file mode 100644
index 000000000000..0c74e3ec03db
--- /dev/null
+++ b/srcpkgs/glibc/patches/git-updates.patch
@@ -0,0 +1,10872 @@
+This was generated from the release/${version}/master branch using:
+git format-patch -k $(git describe --abbrev=0 --match 'glibc-*') --stdout > git-updates.patch
+
+From c3fda489cfdb2260f9fec706e6fd7259858c4467 Mon Sep 17 00:00:00 2001
+From: Tom Honermann <tom@honermann.net>
+Date: Sun, 24 Jul 2022 01:11:43 -0400
+Subject: stdlib: Suppress gcc diagnostic that char8_t is a keyword in C++20 in
+ uchar.h.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+gcc 13 issues the following diagnostic for the uchar.h header when the
+-Wc++20-compat option is enabled in C++ modes that do not enable char8_t
+as a builtin type (C++17 and earlier by default; subject to _GNU_SOURCE
+and the gcc -f[no-]char8_t option).
+  warning: identifier ‘char8_t’ is a keyword in C++20 [-Wc++20-compat]
+This change modifies the uchar.h header to suppress the diagnostic through
+the use of '#pragma GCC diagnostic' directives for gcc 10 and later (the
+-Wc++20-compat option was added in gcc version 10).  Unfortunately, a bug
+in gcc currently prevents those directives from having the intended effect
+as reported at https://gcc.gnu.org/PR106423.  A patch for that issue has
+been submitted and is available in the email thread archive linked below.
+  https://gcc.gnu.org/pipermail/gcc-patches/2022-July/598736.html
+
+(cherry picked from commit 825f84f133bd840347dc49229b6d831f07d04775)
+---
+ wcsmbs/uchar.h | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/wcsmbs/uchar.h b/wcsmbs/uchar.h
+index c37e8619a0..5f7139f279 100644
+--- a/wcsmbs/uchar.h
++++ b/wcsmbs/uchar.h
+@@ -34,8 +34,16 @@
+ /* Declare the C2x char8_t typedef in C2x modes, but only if the C++
+   __cpp_char8_t feature test macro is not defined.  */
+ #if __GLIBC_USE (ISOC2X) && !defined __cpp_char8_t
++#if __GNUC_PREREQ (10, 0) && defined __cplusplus
++/* Suppress the diagnostic regarding char8_t being a keyword in C++20.  */
++# pragma GCC diagnostic push
++# pragma GCC diagnostic ignored "-Wc++20-compat"
++#endif
+ /* Define the 8-bit character type.  */
+ typedef unsigned char char8_t;
++#if __GNUC_PREREQ (10, 0) && defined __cplusplus
++# pragma GCC diagnostic pop
++#endif
+ #endif
+ 
+ #ifndef __USE_ISOCXX11
+-- 
+2.38.1
+
+
+From 33f1b4c1452b33991e670f636ebe98b90a405e10 Mon Sep 17 00:00:00 2001
+From: "H.J. Lu" <hjl.tools@gmail.com>
+Date: Fri, 29 Jul 2022 10:50:56 -0700
+Subject: wcsmbs: Add missing test-c8rtomb/test-mbrtoc8 dependency
+
+Make test-c8rtomb.out and test-mbrtoc8.out depend on $(gen-locales) for
+
+  xsetlocale (LC_ALL, "de_DE.UTF-8");
+  xsetlocale (LC_ALL, "zh_HK.BIG5-HKSCS");
+
+Reviewed-by: Sunil K Pandey <skpgkp2@gmail.com>
+Reviewed-by: Carlos O'Donell <carlos@redhat.com>
+(cherry picked from commit e03f5ccd6cc8f829416156eac75acee501626c1f)
+---
+ wcsmbs/Makefile | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/wcsmbs/Makefile b/wcsmbs/Makefile
+index e6b9e8743a..3d19d5556f 100644
+--- a/wcsmbs/Makefile
++++ b/wcsmbs/Makefile
+@@ -73,6 +73,8 @@ $(objpfx)tst-wcstol-locale.out: $(gen-locales)
+ $(objpfx)tst-wcstod-nan-locale.out: $(gen-locales)
+ $(objpfx)tst-c16-surrogate.out: $(gen-locales)
+ $(objpfx)tst-c32-state.out: $(gen-locales)
++$(objpfx)test-c8rtomb.out: $(gen-locales)
++$(objpfx)test-mbrtoc8.out: $(gen-locales)
+ endif
+ 
+ $(objpfx)tst-wcstod-round: $(libm)
+-- 
+2.38.1
+
+
+From c74bb93cfdb04d49155b0e30983a3c866167bbca Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Thu, 4 Aug 2022 17:54:48 +0200
+Subject: dlfcn: Pass caller pointer to static dlopen implementation (bug
+ 29446)
+
+Fixes commit 0c1c3a771eceec46e66ce1183cf988e2303bd373 ("dlfcn: Move
+dlopen into libc").
+
+(cherry picked from commit ed0185e4129130cbe081c221efb758fb400623ce)
+---
+ NEWS           | 7 +++++++
+ dlfcn/dlopen.c | 2 +-
+ 2 files changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/NEWS b/NEWS
+index f61e521fc8..15f3dd2cdb 100644
+--- a/NEWS
++++ b/NEWS
+@@ -4,6 +4,13 @@ See the end for copying conditions.
+ 
+ Please send GNU C library bug reports via <https://sourceware.org/bugzilla/>
+ using `glibc' in the "product" field.
++\f
++Version 2.36.1
++
++The following bugs are resolved with this release:
++
++  [29446] _dlopen now ignores dl_caller argument in static mode
++
+ \f
+ Version 2.36
+ 
+diff --git a/dlfcn/dlopen.c b/dlfcn/dlopen.c
+index 2696dde4b1..9b07b4e132 100644
+--- a/dlfcn/dlopen.c
++++ b/dlfcn/dlopen.c
+@@ -90,7 +90,7 @@ compat_symbol (libdl, ___dlopen, dlopen, GLIBC_2_1);
+ void *
+ __dlopen (const char *file, int mode, void *dl_caller)
+ {
+-  return dlopen_implementation (file, mode, RETURN_ADDRESS (0));
++  return dlopen_implementation (file, mode, dl_caller);
+ }
+ 
+ void *
+-- 
+2.38.1
+
+
+From ac47d8f6cf9744139adb12f540fb9cc610cac579 Mon Sep 17 00:00:00 2001
+From: Joseph Myers <joseph@codesourcery.com>
+Date: Tue, 2 Aug 2022 21:05:07 +0000
+Subject: Update syscall lists for Linux 5.19
+
+Linux 5.19 has no new syscalls, but enables memfd_secret in the uapi
+headers for RISC-V.  Update the version number in syscall-names.list
+to reflect that it is still current for 5.19 and regenerate the
+arch-syscall.h headers with build-many-glibcs.py update-syscalls.
+
+Tested with build-many-glibcs.py.
+
+(cherry picked from commit fccadcdf5bed7ee67a6cef4714e0b477d6c8472c)
+---
+ sysdeps/unix/sysv/linux/riscv/rv32/arch-syscall.h | 1 +
+ sysdeps/unix/sysv/linux/riscv/rv64/arch-syscall.h | 1 +
+ sysdeps/unix/sysv/linux/syscall-names.list        | 4 ++--
+ 3 files changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/arch-syscall.h b/sysdeps/unix/sysv/linux/riscv/rv32/arch-syscall.h
+index bf4be80f8d..202520ee25 100644
+--- a/sysdeps/unix/sysv/linux/riscv/rv32/arch-syscall.h
++++ b/sysdeps/unix/sysv/linux/riscv/rv32/arch-syscall.h
+@@ -122,6 +122,7 @@
+ #define __NR_mbind 235
+ #define __NR_membarrier 283
+ #define __NR_memfd_create 279
++#define __NR_memfd_secret 447
+ #define __NR_migrate_pages 238
+ #define __NR_mincore 232
+ #define __NR_mkdirat 34
+diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/arch-syscall.h b/sysdeps/unix/sysv/linux/riscv/rv64/arch-syscall.h
+index d656aedcc2..4e65f337d4 100644
+--- a/sysdeps/unix/sysv/linux/riscv/rv64/arch-syscall.h
++++ b/sysdeps/unix/sysv/linux/riscv/rv64/arch-syscall.h
+@@ -127,6 +127,7 @@
+ #define __NR_mbind 235
+ #define __NR_membarrier 283
+ #define __NR_memfd_create 279
++#define __NR_memfd_secret 447
+ #define __NR_migrate_pages 238
+ #define __NR_mincore 232
+ #define __NR_mkdirat 34
+diff --git a/sysdeps/unix/sysv/linux/syscall-names.list b/sysdeps/unix/sysv/linux/syscall-names.list
+index 6c7b2f7011..028ad3107a 100644
+--- a/sysdeps/unix/sysv/linux/syscall-names.list
++++ b/sysdeps/unix/sysv/linux/syscall-names.list
+@@ -21,8 +21,8 @@
+ # This file can list all potential system calls.  The names are only
+ # used if the installed kernel headers also provide them.
+ 
+-# The list of system calls is current as of Linux 5.18.
+-kernel 5.18
++# The list of system calls is current as of Linux 5.19.
++kernel 5.19
+ 
+ FAST_atomic_update
+ FAST_cmpxchg
+-- 
+2.38.1
+
+
+From 302bc33bc53c787da6e74162a7092e9c0fb964a8 Mon Sep 17 00:00:00 2001
+From: Noah Goldstein <goldstein.w.n@gmail.com>
+Date: Mon, 8 Aug 2022 11:26:22 +0800
+Subject: elf: Replace `strcpy` call with `memcpy` [BZ #29454]
+
+GCC normally does this optimization for us in
+strlen_pass::handle_builtin_strcpy but only for optimized
+build. To avoid needing to include strcpy.S in the rtld build to
+support the debug build, just do the optimization by hand.
+
+(cherry picked from commit 483cfe1a6a33d6335b1901581b41040d2d412511)
+---
+ elf/dl-cache.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/elf/dl-cache.c b/elf/dl-cache.c
+index 8bbf110d02..b97c17b3a9 100644
+--- a/elf/dl-cache.c
++++ b/elf/dl-cache.c
+@@ -509,8 +509,9 @@ _dl_load_cache_lookup (const char *name)
+      we are accessing. Therefore we must make the copy of the
+      mapping data without using malloc.  */
+   char *temp;
+-  temp = alloca (strlen (best) + 1);
+-  strcpy (temp, best);
++  size_t best_len = strlen (best) + 1;
++  temp = alloca (best_len);
++  memcpy (temp, best, best_len);
+   return __strdup (temp);
+ }
+ 
+-- 
+2.38.1
+
+
+From e982657073c4db21459ffd9e17bc505b1d64b876 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Mon, 15 Aug 2022 16:43:59 +0200
+Subject: Linux: Terminate subprocess on late failure in tst-pidfd (bug 29485)
+
+Reviewed-by: Carlos O'Donell <carlos@redhat.com>
+(cherry picked from commit f82e05ebb295cadd35f7372f652c72264da810ad)
+---
+ NEWS                                | 1 +
+ sysdeps/unix/sysv/linux/tst-pidfd.c | 7 +++++--
+ 2 files changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/NEWS b/NEWS
+index 15f3dd2cdb..f8fb8db510 100644
+--- a/NEWS
++++ b/NEWS
+@@ -10,6 +10,7 @@ Version 2.36.1
+ The following bugs are resolved with this release:
+ 
+   [29446] _dlopen now ignores dl_caller argument in static mode
++  [29485] Linux: Terminate subprocess on late failure in tst-pidfd
+ 
+ \f
+ Version 2.36
+diff --git a/sysdeps/unix/sysv/linux/tst-pidfd.c b/sysdeps/unix/sysv/linux/tst-pidfd.c
+index 037af22290..5711d1c312 100644
+--- a/sysdeps/unix/sysv/linux/tst-pidfd.c
++++ b/sysdeps/unix/sysv/linux/tst-pidfd.c
+@@ -147,8 +147,11 @@ do_test (void)
+        may be denied if the process doesn't have CAP_SYS_PTRACE or
+        if a LSM security_ptrace_access_check denies access.  */
+     if (fd == -1 && errno == EPERM)
+-      FAIL_UNSUPPORTED ("don't have permission to use pidfd_getfd on pidfd, "
+-			"skipping test");
++      {
++	TEST_COMPARE (pidfd_send_signal (pidfd, SIGKILL, NULL, 0), 0);
++	FAIL_UNSUPPORTED ("don't have permission to use pidfd_getfd on pidfd, "
++			  "skipping test");
++      }
+     TEST_VERIFY (fd > 0);
+ 
+     char *path = xasprintf ("/proc/%d/fd/%d", pid, remote_fd);
+-- 
+2.38.1
+
+
+From 8b139cd4f1074ae0d95d9bff60db283a1ed72734 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Mon, 22 Aug 2022 11:04:47 +0200
+Subject: alpha: Fix generic brk system call emulation in __brk_call (bug
+ 29490)
+
+The kernel special-cases the zero argument for alpha brk, and we can
+use that to restore the generic Linux error handling behavior.
+
+Fixes commit b57ab258c1140bc45464b4b9908713e3e0ee35aa ("Linux:
+Introduce __brk_call for invoking the brk system call").
+
+(cherry picked from commit e7ad26ee3cb74e61d0637c888f24dd478d77af58)
+---
+ NEWS                                     | 1 +
+ sysdeps/unix/sysv/linux/alpha/brk_call.h | 7 +++----
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/NEWS b/NEWS
+index f8fb8db510..becab3ade9 100644
+--- a/NEWS
++++ b/NEWS
+@@ -11,6 +11,7 @@ The following bugs are resolved with this release:
+ 
+   [29446] _dlopen now ignores dl_caller argument in static mode
+   [29485] Linux: Terminate subprocess on late failure in tst-pidfd
++  [29490] alpha: New __brk_call implementation is broken
+ 
+ \f
+ Version 2.36
+diff --git a/sysdeps/unix/sysv/linux/alpha/brk_call.h b/sysdeps/unix/sysv/linux/alpha/brk_call.h
+index b8088cf13f..0b851b6c86 100644
+--- a/sysdeps/unix/sysv/linux/alpha/brk_call.h
++++ b/sysdeps/unix/sysv/linux/alpha/brk_call.h
+@@ -21,8 +21,7 @@ __brk_call (void *addr)
+ {
+   unsigned long int result = INTERNAL_SYSCALL_CALL (brk, addr);
+   if (result == -ENOMEM)
+-    /* Mimic the default error reporting behavior.  */
+-    return addr;
+-  else
+-    return (void *) result;
++    /* Mimic the generic error reporting behavior.  */
++    result = INTERNAL_SYSCALL_CALL (brk, 0);
++  return (void *) result;
+ }
+-- 
+2.38.1
+
+
+From d13a7a6f100576b1e30dc044b2e0c4cbcb6196f6 Mon Sep 17 00:00:00 2001
+From: Arjun Shankar <arjun@redhat.com>
+Date: Tue, 2 Aug 2022 11:10:25 +0200
+Subject: socket: Check lengths before advancing pointer in CMSG_NXTHDR
+
+The inline and library functions that the CMSG_NXTHDR macro may expand
+to increment the pointer to the header before checking the stride of
+the increment against available space.  Since C only allows incrementing
+pointers to one past the end of an array, the increment must be done
+after a length check.  This commit fixes that and includes a regression
+test for CMSG_FIRSTHDR and CMSG_NXTHDR.
+
+The Linux, Hurd, and generic headers are all changed.
+
+Tested on Linux on armv7hl, i686, x86_64, aarch64, ppc64le, and s390x.
+
+[BZ #28846]
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit 9c443ac4559a47ed99859bd80d14dc4b6dd220a1)
+---
+ bits/socket.h                         | 40 ++++++++++--
+ socket/Makefile                       |  1 +
+ socket/tst-cmsghdr-skeleton.c         | 92 +++++++++++++++++++++++++++
+ socket/tst-cmsghdr.c                  | 56 ++++++++++++++++
+ sysdeps/mach/hurd/bits/socket.h       | 40 ++++++++++--
+ sysdeps/unix/sysv/linux/bits/socket.h | 40 ++++++++++--
+ sysdeps/unix/sysv/linux/cmsg_nxthdr.c | 36 ++++++++---
+ 7 files changed, 276 insertions(+), 29 deletions(-)
+ create mode 100644 socket/tst-cmsghdr-skeleton.c
+ create mode 100644 socket/tst-cmsghdr.c
+
+diff --git a/bits/socket.h b/bits/socket.h
+index 2b99dea33b..aac8c49b00 100644
+--- a/bits/socket.h
++++ b/bits/socket.h
+@@ -245,6 +245,12 @@ struct cmsghdr
+ 			 + CMSG_ALIGN (sizeof (struct cmsghdr)))
+ #define CMSG_LEN(len)   (CMSG_ALIGN (sizeof (struct cmsghdr)) + (len))
+ 
++/* Given a length, return the additional padding necessary such that
++   len + __CMSG_PADDING(len) == CMSG_ALIGN (len).  */
++#define __CMSG_PADDING(len) ((sizeof (size_t) \
++                              - ((len) & (sizeof (size_t) - 1))) \
++                             & (sizeof (size_t) - 1))
++
+ extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr,
+ 				      struct cmsghdr *__cmsg) __THROW;
+ #ifdef __USE_EXTERN_INLINES
+@@ -254,18 +260,38 @@ extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr,
+ _EXTERN_INLINE struct cmsghdr *
+ __NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg))
+ {
++  /* We may safely assume that __cmsg lies between __mhdr->msg_control and
++     __mhdr->msg_controllen because the user is required to obtain the first
++     cmsg via CMSG_FIRSTHDR, set its length, then obtain subsequent cmsgs
++     via CMSG_NXTHDR, setting lengths along the way.  However, we don't yet
++     trust the value of __cmsg->cmsg_len and therefore do not use it in any
++     pointer arithmetic until we check its value.  */
++
++  unsigned char * __msg_control_ptr = (unsigned char *) __mhdr->msg_control;
++  unsigned char * __cmsg_ptr = (unsigned char *) __cmsg;
++
++  size_t __size_needed = sizeof (struct cmsghdr)
++                         + __CMSG_PADDING (__cmsg->cmsg_len);
++
++  /* The current header is malformed, too small to be a full header.  */
+   if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr))
+-    /* The kernel header does this so there may be a reason.  */
+     return (struct cmsghdr *) 0;
+ 
++  /* There isn't enough space between __cmsg and the end of the buffer to
++  hold the current cmsg *and* the next one.  */
++  if (((size_t)
++         (__msg_control_ptr + __mhdr->msg_controllen - __cmsg_ptr)
++       < __size_needed)
++      || ((size_t)
++            (__msg_control_ptr + __mhdr->msg_controllen - __cmsg_ptr
++             - __size_needed)
++          < __cmsg->cmsg_len))
++
++    return (struct cmsghdr *) 0;
++
++  /* Now, we trust cmsg_len and can use it to find the next header.  */
+   __cmsg = (struct cmsghdr *) ((unsigned char *) __cmsg
+ 			       + CMSG_ALIGN (__cmsg->cmsg_len));
+-  if ((unsigned char *) (__cmsg + 1) > ((unsigned char *) __mhdr->msg_control
+-					+ __mhdr->msg_controllen)
+-      || ((unsigned char *) __cmsg + CMSG_ALIGN (__cmsg->cmsg_len)
+-	  > ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen)))
+-    /* No more entries.  */
+-    return (struct cmsghdr *) 0;
+   return __cmsg;
+ }
+ #endif	/* Use `extern inline'.  */
+diff --git a/socket/Makefile b/socket/Makefile
+index 156eec6c85..2bde78387f 100644
+--- a/socket/Makefile
++++ b/socket/Makefile
+@@ -34,6 +34,7 @@ routines := accept bind connect getpeername getsockname getsockopt	\
+ tests := \
+   tst-accept4 \
+   tst-sockopt \
++  tst-cmsghdr \
+   # tests
+ 
+ tests-internal := \
+diff --git a/socket/tst-cmsghdr-skeleton.c b/socket/tst-cmsghdr-skeleton.c
+new file mode 100644
+index 0000000000..4c6898569b
+--- /dev/null
++++ b/socket/tst-cmsghdr-skeleton.c
+@@ -0,0 +1,92 @@
++/* Test ancillary data header creation.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++/* We use the preprocessor to generate the function/macro tests instead of
++   using indirection because having all the macro expansions alongside
++   each other lets the compiler warn us about suspicious pointer
++   arithmetic across subsequent CMSG_{FIRST,NXT}HDR expansions.  */
++
++#include <stdint.h>
++
++#define RUN_TEST_CONCAT(suffix) run_test_##suffix
++#define RUN_TEST_FUNCNAME(suffix) RUN_TEST_CONCAT (suffix)
++
++static void
++RUN_TEST_FUNCNAME (CMSG_NXTHDR_IMPL) (void)
++{
++  struct msghdr m = {0};
++  struct cmsghdr *cmsg;
++  char cmsgbuf[3 * CMSG_SPACE (sizeof (PAYLOAD))] = {0};
++
++  m.msg_control = cmsgbuf;
++  m.msg_controllen = sizeof (cmsgbuf);
++
++  /* First header should point to the start of the buffer.  */
++  cmsg = CMSG_FIRSTHDR (&m);
++  TEST_VERIFY_EXIT ((char *) cmsg == cmsgbuf);
++
++  /* If the first header length consumes the entire buffer, there is no
++     space remaining for additional headers.  */
++  cmsg->cmsg_len = sizeof (cmsgbuf);
++  cmsg = CMSG_NXTHDR_IMPL (&m, cmsg);
++  TEST_VERIFY_EXIT (cmsg == NULL);
++
++  /* The first header length is so big, using it would cause an overflow.  */
++  cmsg = CMSG_FIRSTHDR (&m);
++  TEST_VERIFY_EXIT ((char *) cmsg == cmsgbuf);
++  cmsg->cmsg_len = SIZE_MAX;
++  cmsg = CMSG_NXTHDR_IMPL (&m, cmsg);
++  TEST_VERIFY_EXIT (cmsg == NULL);
++
++  /* The first header leaves just enough space to hold another header.  */
++  cmsg = CMSG_FIRSTHDR (&m);
++  TEST_VERIFY_EXIT ((char *) cmsg == cmsgbuf);
++  cmsg->cmsg_len = sizeof (cmsgbuf) - sizeof (struct cmsghdr);
++  cmsg = CMSG_NXTHDR_IMPL (&m, cmsg);
++  TEST_VERIFY_EXIT (cmsg != NULL);
++
++  /* The first header leaves space but not enough for another header.  */
++  cmsg = CMSG_FIRSTHDR (&m);
++  TEST_VERIFY_EXIT ((char *) cmsg == cmsgbuf);
++  cmsg->cmsg_len ++;
++  cmsg = CMSG_NXTHDR_IMPL (&m, cmsg);
++  TEST_VERIFY_EXIT (cmsg == NULL);
++
++  /* The second header leaves just enough space to hold another header.  */
++  cmsg = CMSG_FIRSTHDR (&m);
++  TEST_VERIFY_EXIT ((char *) cmsg == cmsgbuf);
++  cmsg->cmsg_len = CMSG_LEN (sizeof (PAYLOAD));
++  cmsg = CMSG_NXTHDR_IMPL (&m, cmsg);
++  TEST_VERIFY_EXIT (cmsg != NULL);
++  cmsg->cmsg_len = sizeof (cmsgbuf)
++                   - CMSG_SPACE (sizeof (PAYLOAD)) /* First header.  */
++                   - sizeof (struct cmsghdr);
++  cmsg = CMSG_NXTHDR_IMPL (&m, cmsg);
++  TEST_VERIFY_EXIT (cmsg != NULL);
++
++  /* The second header leaves space but not enough for another header.  */
++  cmsg = CMSG_FIRSTHDR (&m);
++  TEST_VERIFY_EXIT ((char *) cmsg == cmsgbuf);
++  cmsg = CMSG_NXTHDR_IMPL (&m, cmsg);
++  TEST_VERIFY_EXIT (cmsg != NULL);
++  cmsg->cmsg_len ++;
++  cmsg = CMSG_NXTHDR_IMPL (&m, cmsg);
++  TEST_VERIFY_EXIT (cmsg == NULL);
++
++  return;
++}
+diff --git a/socket/tst-cmsghdr.c b/socket/tst-cmsghdr.c
+new file mode 100644
+index 0000000000..68c96d3c9d
+--- /dev/null
++++ b/socket/tst-cmsghdr.c
+@@ -0,0 +1,56 @@
++/* Test ancillary data header creation.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <sys/socket.h>
++#include <gnu/lib-names.h>
++#include <support/xdlfcn.h>
++#include <support/check.h>
++
++#define PAYLOAD "Hello, World!"
++
++/* CMSG_NXTHDR is a macro that calls an inline function defined in
++   bits/socket.h.  In case the function cannot be inlined, libc.so carries
++   a copy.  Both versions need to be tested.  */
++
++#define CMSG_NXTHDR_IMPL CMSG_NXTHDR
++#include "tst-cmsghdr-skeleton.c"
++#undef CMSG_NXTHDR_IMPL
++
++static struct cmsghdr * (* cmsg_nxthdr) (struct msghdr *, struct cmsghdr *);
++
++#define CMSG_NXTHDR_IMPL cmsg_nxthdr
++#include "tst-cmsghdr-skeleton.c"
++#undef CMSG_NXTHDR_IMPL
++
++static int
++do_test (void)
++{
++  static void *handle;
++
++  run_test_CMSG_NXTHDR ();
++
++  handle = xdlopen (LIBC_SO, RTLD_LAZY);
++  cmsg_nxthdr = (struct cmsghdr * (*) (struct msghdr *, struct cmsghdr *))
++                  xdlsym (handle, "__cmsg_nxthdr");
++
++  run_test_cmsg_nxthdr ();
++
++  return 0;
++}
++
++#include <support/test-driver.c>
+diff --git a/sysdeps/mach/hurd/bits/socket.h b/sysdeps/mach/hurd/bits/socket.h
+index 5b35ea81ec..70fce4fb27 100644
+--- a/sysdeps/mach/hurd/bits/socket.h
++++ b/sysdeps/mach/hurd/bits/socket.h
+@@ -249,6 +249,12 @@ struct cmsghdr
+ 			 + CMSG_ALIGN (sizeof (struct cmsghdr)))
+ #define CMSG_LEN(len)   (CMSG_ALIGN (sizeof (struct cmsghdr)) + (len))
+ 
++/* Given a length, return the additional padding necessary such that
++   len + __CMSG_PADDING(len) == CMSG_ALIGN (len).  */
++#define __CMSG_PADDING(len) ((sizeof (size_t) \
++                              - ((len) & (sizeof (size_t) - 1))) \
++                             & (sizeof (size_t) - 1))
++
+ extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr,
+ 				      struct cmsghdr *__cmsg) __THROW;
+ #ifdef __USE_EXTERN_INLINES
+@@ -258,18 +264,38 @@ extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr,
+ _EXTERN_INLINE struct cmsghdr *
+ __NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg))
+ {
++  /* We may safely assume that __cmsg lies between __mhdr->msg_control and
++     __mhdr->msg_controllen because the user is required to obtain the first
++     cmsg via CMSG_FIRSTHDR, set its length, then obtain subsequent cmsgs
++     via CMSG_NXTHDR, setting lengths along the way.  However, we don't yet
++     trust the value of __cmsg->cmsg_len and therefore do not use it in any
++     pointer arithmetic until we check its value.  */
++
++  unsigned char * __msg_control_ptr = (unsigned char *) __mhdr->msg_control;
++  unsigned char * __cmsg_ptr = (unsigned char *) __cmsg;
++
++  size_t __size_needed = sizeof (struct cmsghdr)
++                         + __CMSG_PADDING (__cmsg->cmsg_len);
++
++  /* The current header is malformed, too small to be a full header.  */
+   if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr))
+-    /* The kernel header does this so there may be a reason.  */
+     return (struct cmsghdr *) 0;
+ 
++  /* There isn't enough space between __cmsg and the end of the buffer to
++  hold the current cmsg *and* the next one.  */
++  if (((size_t)
++         (__msg_control_ptr + __mhdr->msg_controllen - __cmsg_ptr)
++       < __size_needed)
++      || ((size_t)
++            (__msg_control_ptr + __mhdr->msg_controllen - __cmsg_ptr
++             - __size_needed)
++          < __cmsg->cmsg_len))
++
++    return (struct cmsghdr *) 0;
++
++  /* Now, we trust cmsg_len and can use it to find the next header.  */
+   __cmsg = (struct cmsghdr *) ((unsigned char *) __cmsg
+ 			       + CMSG_ALIGN (__cmsg->cmsg_len));
+-  if ((unsigned char *) (__cmsg + 1) > ((unsigned char *) __mhdr->msg_control
+-					+ __mhdr->msg_controllen)
+-      || ((unsigned char *) __cmsg + CMSG_ALIGN (__cmsg->cmsg_len)
+-	  > ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen)))
+-    /* No more entries.  */
+-    return (struct cmsghdr *) 0;
+   return __cmsg;
+ }
+ #endif	/* Use `extern inline'.  */
+diff --git a/sysdeps/unix/sysv/linux/bits/socket.h b/sysdeps/unix/sysv/linux/bits/socket.h
+index 4f1f810ea1..539b8d7716 100644
+--- a/sysdeps/unix/sysv/linux/bits/socket.h
++++ b/sysdeps/unix/sysv/linux/bits/socket.h
+@@ -307,6 +307,12 @@ struct cmsghdr
+ 			 + CMSG_ALIGN (sizeof (struct cmsghdr)))
+ #define CMSG_LEN(len)   (CMSG_ALIGN (sizeof (struct cmsghdr)) + (len))
+ 
++/* Given a length, return the additional padding necessary such that
++   len + __CMSG_PADDING(len) == CMSG_ALIGN (len).  */
++#define __CMSG_PADDING(len) ((sizeof (size_t) \
++                              - ((len) & (sizeof (size_t) - 1))) \
++                             & (sizeof (size_t) - 1))
++
+ extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr,
+ 				      struct cmsghdr *__cmsg) __THROW;
+ #ifdef __USE_EXTERN_INLINES
+@@ -316,18 +322,38 @@ extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr,
+ _EXTERN_INLINE struct cmsghdr *
+ __NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg))
+ {
++  /* We may safely assume that __cmsg lies between __mhdr->msg_control and
++     __mhdr->msg_controllen because the user is required to obtain the first
++     cmsg via CMSG_FIRSTHDR, set its length, then obtain subsequent cmsgs
++     via CMSG_NXTHDR, setting lengths along the way.  However, we don't yet
++     trust the value of __cmsg->cmsg_len and therefore do not use it in any
++     pointer arithmetic until we check its value.  */
++
++  unsigned char * __msg_control_ptr = (unsigned char *) __mhdr->msg_control;
++  unsigned char * __cmsg_ptr = (unsigned char *) __cmsg;
++
++  size_t __size_needed = sizeof (struct cmsghdr)
++                         + __CMSG_PADDING (__cmsg->cmsg_len);
++
++  /* The current header is malformed, too small to be a full header.  */
+   if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr))
+-    /* The kernel header does this so there may be a reason.  */
+     return (struct cmsghdr *) 0;
+ 
++  /* There isn't enough space between __cmsg and the end of the buffer to
++  hold the current cmsg *and* the next one.  */
++  if (((size_t)
++         (__msg_control_ptr + __mhdr->msg_controllen - __cmsg_ptr)
++       < __size_needed)
++      || ((size_t)
++            (__msg_control_ptr + __mhdr->msg_controllen - __cmsg_ptr
++             - __size_needed)
++          < __cmsg->cmsg_len))
++
++    return (struct cmsghdr *) 0;
++
++  /* Now, we trust cmsg_len and can use it to find the next header.  */
+   __cmsg = (struct cmsghdr *) ((unsigned char *) __cmsg
+ 			       + CMSG_ALIGN (__cmsg->cmsg_len));
+-  if ((unsigned char *) (__cmsg + 1) > ((unsigned char *) __mhdr->msg_control
+-					+ __mhdr->msg_controllen)
+-      || ((unsigned char *) __cmsg + CMSG_ALIGN (__cmsg->cmsg_len)
+-	  > ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen)))
+-    /* No more entries.  */
+-    return (struct cmsghdr *) 0;
+   return __cmsg;
+ }
+ #endif	/* Use `extern inline'.  */
+diff --git a/sysdeps/unix/sysv/linux/cmsg_nxthdr.c b/sysdeps/unix/sysv/linux/cmsg_nxthdr.c
+index 15b7a3a925..24f72b797a 100644
+--- a/sysdeps/unix/sysv/linux/cmsg_nxthdr.c
++++ b/sysdeps/unix/sysv/linux/cmsg_nxthdr.c
+@@ -23,18 +23,38 @@
+ struct cmsghdr *
+ __cmsg_nxthdr (struct msghdr *mhdr, struct cmsghdr *cmsg)
+ {
++  /* We may safely assume that cmsg lies between mhdr->msg_control and
++     mhdr->msg_controllen because the user is required to obtain the first
++     cmsg via CMSG_FIRSTHDR, set its length, then obtain subsequent cmsgs
++     via CMSG_NXTHDR, setting lengths along the way.  However, we don't yet
++     trust the value of cmsg->cmsg_len and therefore do not use it in any
++     pointer arithmetic until we check its value.  */
++
++  unsigned char * msg_control_ptr = (unsigned char *) mhdr->msg_control;
++  unsigned char * cmsg_ptr = (unsigned char *) cmsg;
++
++  size_t size_needed = sizeof (struct cmsghdr)
++                       + __CMSG_PADDING (cmsg->cmsg_len);
++
++  /* The current header is malformed, too small to be a full header.  */
+   if ((size_t) cmsg->cmsg_len < sizeof (struct cmsghdr))
+-    /* The kernel header does this so there may be a reason.  */
+-    return NULL;
++    return (struct cmsghdr *) 0;
++
++  /* There isn't enough space between cmsg and the end of the buffer to
++  hold the current cmsg *and* the next one.  */
++  if (((size_t)
++         (msg_control_ptr + mhdr->msg_controllen - cmsg_ptr)
++       < size_needed)
++      || ((size_t)
++            (msg_control_ptr + mhdr->msg_controllen - cmsg_ptr
++             - size_needed)
++          < cmsg->cmsg_len))
++
++    return (struct cmsghdr *) 0;
+ 
++  /* Now, we trust cmsg_len and can use it to find the next header.  */
+   cmsg = (struct cmsghdr *) ((unsigned char *) cmsg
+ 			     + CMSG_ALIGN (cmsg->cmsg_len));
+-  if ((unsigned char *) (cmsg + 1) > ((unsigned char *) mhdr->msg_control
+-				      + mhdr->msg_controllen)
+-      || ((unsigned char *) cmsg + CMSG_ALIGN (cmsg->cmsg_len)
+-	  > ((unsigned char *) mhdr->msg_control + mhdr->msg_controllen)))
+-    /* No more entries.  */
+-    return NULL;
+   return cmsg;
+ }
+ libc_hidden_def (__cmsg_nxthdr)
+-- 
+2.38.1
+
+
+From 5c62874f423af93e97b51bc9a57af228a546156f Mon Sep 17 00:00:00 2001
+From: Arjun Shankar <arjun@redhat.com>
+Date: Mon, 22 Aug 2022 18:21:14 +0200
+Subject: NEWS: Add entry for bug 28846
+
+---
+ NEWS | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/NEWS b/NEWS
+index becab3ade9..ae30900bbc 100644
+--- a/NEWS
++++ b/NEWS
+@@ -9,6 +9,7 @@ Version 2.36.1
+ 
+ The following bugs are resolved with this release:
+ 
++  [28846] CMSG_NXTHDR may trigger -Wstrict-overflow warning
+   [29446] _dlopen now ignores dl_caller argument in static mode
+   [29485] Linux: Terminate subprocess on late failure in tst-pidfd
+   [29490] alpha: New __brk_call implementation is broken
+-- 
+2.38.1
+
+
+From 0062e7dd1c3674ece2daca53a898badd28b60421 Mon Sep 17 00:00:00 2001
+From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Wed, 10 Aug 2022 16:24:06 -0300
+Subject: glibcextract.py: Add compile_c_snippet
+
+It might be used on tests to check if a snippet build with the provided
+compiler and flags.
+
+Reviewed-by: Florian Weimer <fweimer@redhat.com>
+(cherry picked from commit 841afa116e32b3c7195475769c26bf46fd870d32)
+---
+ scripts/glibcextract.py | 19 +++++++++++++++++++
+ 1 file changed, 19 insertions(+)
+
+diff --git a/scripts/glibcextract.py b/scripts/glibcextract.py
+index 43ab58ffe2..36d204c9b0 100644
+--- a/scripts/glibcextract.py
++++ b/scripts/glibcextract.py
+@@ -17,6 +17,7 @@
+ # License along with the GNU C Library; if not, see
+ # <https://www.gnu.org/licenses/>.
+ 
++import collections
+ import os.path
+ import re
+ import subprocess
+@@ -173,3 +174,21 @@ def compare_macro_consts(source_1, source_2, cc, macro_re, exclude_re=None,
+             if not allow_extra_2:
+                 ret = 1
+     return ret
++
++CompileResult = collections.namedtuple("CompileResult", "returncode output")
++
++def compile_c_snippet(snippet, cc, extra_cc_args=''):
++    """Compile and return whether the SNIPPET can be build with CC along
++       EXTRA_CC_ARGS compiler flags.  Return a CompileResult with RETURNCODE
++       being 0 for success, or the failure value and the compiler output.
++    """
++    with tempfile.TemporaryDirectory() as temp_dir:
++        c_file_name = os.path.join(temp_dir, 'test.c')
++        obj_file_name = os.path.join(temp_dir, 'test.o')
++        with open(c_file_name, 'w') as c_file:
++            c_file.write(snippet + '\n')
++        cmd = cc.split() + extra_cc_args.split() + ['-c', '-o', obj_file_name,
++                c_file_name]
++        r = subprocess.run(cmd, check=False, stdout=subprocess.PIPE,
++                stderr=subprocess.STDOUT)
++        return CompileResult(r.returncode, r.stdout)
+-- 
+2.38.1
+
+
+From 1cc5513114e76083669cba1b11252aad35525e69 Mon Sep 17 00:00:00 2001
+From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Wed, 10 Aug 2022 14:24:44 -0300
+Subject: linux: Use compile_c_snippet to check linux/pidfd.h availability
+
+Instead of tying to a specific kernel version.
+
+Checked on x86_64-linux-gnu.
+
+Reviewed-by: Florian Weimer <fweimer@redhat.com>
+(cherry picked from commit 1542019b69b7ec7b2cd34357af035e406d153631)
+---
+ sysdeps/unix/sysv/linux/tst-pidfd-consts.py | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/sysdeps/unix/sysv/linux/tst-pidfd-consts.py b/sysdeps/unix/sysv/linux/tst-pidfd-consts.py
+index 90cbb9be64..d732173abd 100644
+--- a/sysdeps/unix/sysv/linux/tst-pidfd-consts.py
++++ b/sysdeps/unix/sysv/linux/tst-pidfd-consts.py
+@@ -33,11 +33,13 @@ def main():
+                         help='C compiler (including options) to use')
+     args = parser.parse_args()
+ 
+-    linux_version_headers = glibcsyscalls.linux_kernel_version(args.cc)
+-    # Linux started to provide pidfd.h with 5.10.
+-    if linux_version_headers < (5, 10):
++    if glibcextract.compile_c_snippet(
++            '#include <linux/pidfd.h>',
++            args.cc).returncode != 0:
+         sys.exit (77)
+-    linux_version_glibc = (5, 18)
++
++    linux_version_headers = glibcsyscalls.linux_kernel_version(args.cc)
++    linux_version_glibc = (5, 19)
+     sys.exit(glibcextract.compare_macro_consts(
+                 '#include <sys/pidfd.h>\n',
+                 '#include <asm/fcntl.h>\n'
+-- 
+2.38.1
+
+
+From 4dad97e2a2e510c6b53a0add29a2188714fcf4ab Mon Sep 17 00:00:00 2001
+From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Wed, 10 Aug 2022 14:24:45 -0300
+Subject: linux: Mimic kernel defition for BLOCK_SIZE
+
+To avoid possible warnings if the kernel header is included before
+sys/mount.h.
+
+Reviewed-by: Florian Weimer <fweimer@redhat.com>
+(cherry picked from commit c68b6044bc7945716431f1adc091b17c39b80a06)
+---
+ sysdeps/unix/sysv/linux/sys/mount.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/sysdeps/unix/sysv/linux/sys/mount.h b/sysdeps/unix/sysv/linux/sys/mount.h
+index f965986ba8..df6b0dbb42 100644
+--- a/sysdeps/unix/sysv/linux/sys/mount.h
++++ b/sysdeps/unix/sysv/linux/sys/mount.h
+@@ -27,8 +27,8 @@
+ #include <stddef.h>
+ #include <sys/ioctl.h>
+ 
+-#define BLOCK_SIZE	1024
+ #define BLOCK_SIZE_BITS	10
++#define BLOCK_SIZE	(1<<BLOCK_SIZE_BITS)
+ 
+ 
+ /* These are the fs-independent mount-flags: up to 16 flags are
+-- 
+2.38.1
+
+
+From d48813227b63a0d92ea357ea0733229ed74e31ab Mon Sep 17 00:00:00 2001
+From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Wed, 10 Aug 2022 14:24:46 -0300
+Subject: linux: Use compile_c_snippet to check linux/mount.h availability
+
+Checked on x86_64-linux-gnu.
+
+Reviewed-by: Florian Weimer <fweimer@redhat.com>
+(cherry picked from commit e1226cdc6b209539a92d32d5b620ba53fd35abf3)
+---
+ sysdeps/unix/sysv/linux/tst-mount-consts.py | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/sysdeps/unix/sysv/linux/tst-mount-consts.py b/sysdeps/unix/sysv/linux/tst-mount-consts.py
+index a62f803123..be2ef2daf1 100755
+--- a/sysdeps/unix/sysv/linux/tst-mount-consts.py
++++ b/sysdeps/unix/sysv/linux/tst-mount-consts.py
+@@ -33,6 +33,11 @@ def main():
+                         help='C compiler (including options) to use')
+     args = parser.parse_args()
+ 
++    if glibcextract.compile_c_snippet(
++            '#include <linux/mount.h>',
++            args.cc).returncode != 0:
++        sys.exit (77)
++
+     linux_version_headers = glibcsyscalls.linux_kernel_version(args.cc)
+     # Constants in glibc were updated to match Linux v5.16.  When glibc
+     # constants are updated this value should be updated to match the
+-- 
+2.38.1
+
+
+From bb1e8b0ca99b5cbedfae3e6245528a87d95ff3e2 Mon Sep 17 00:00:00 2001
+From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Wed, 10 Aug 2022 14:24:47 -0300
+Subject: linux: Fix sys/mount.h usage with kernel headers
+
+Now that kernel exports linux/mount.h and includes it on linux/fs.h,
+its definitions might clash with glibc exports sys/mount.h.  To avoid
+the need to rearrange the Linux header to be always after glibc one,
+the glibc sys/mount.h is changed to:
+
+  1. Undefine the macros also used as enum constants.  This covers prior
+     inclusion of <linux/mount.h> (for instance MS_RDONLY).
+
+  2. Include <linux/mount.h> based on the usual __has_include check
+     (needs to use __has_include ("linux/mount.h") to paper over GCC
+     bugs.
+
+  3. Define enum fsconfig_command only if FSOPEN_CLOEXEC is not defined.
+     (FSOPEN_CLOEXEC should be a very close proxy.)
+
+  4. Define struct mount_attr if MOUNT_ATTR_SIZE_VER0 is not defined.
+     (Added in the same commit on the Linux side.)
+
+This patch also adds some tests to check if including linux/fs.h and
+linux/mount.h after and before sys/mount.h does work.
+
+Checked on x86_64-linux-gnu.
+
+Reviewed-by: Florian Weimer <fweimer@redhat.com>
+(cherry picked from commit 774058d72942249f71d74e7f2b639f77184160a6)
+---
+ sysdeps/unix/sysv/linux/Makefile             |  8 +++
+ sysdeps/unix/sysv/linux/sys/mount.h          | 71 +++++++++++++++++---
+ sysdeps/unix/sysv/linux/tst-mount-compile.py | 66 ++++++++++++++++++
+ 3 files changed, 137 insertions(+), 8 deletions(-)
+ create mode 100755 sysdeps/unix/sysv/linux/tst-mount-compile.py
+
+diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
+index a139a16532..3ceda9fdbf 100644
+--- a/sysdeps/unix/sysv/linux/Makefile
++++ b/sysdeps/unix/sysv/linux/Makefile
+@@ -265,6 +265,14 @@ $(objpfx)tst-mount-consts.out: ../sysdeps/unix/sysv/linux/tst-mount-consts.py
+ 	  < /dev/null > $@ 2>&1; $(evaluate-test)
+ $(objpfx)tst-mount-consts.out: $(sysdeps-linux-python-deps)
+ 
++tests-special += $(objpfx)tst-mount-compile.out
++$(objpfx)tst-mount-compile.out: ../sysdeps/unix/sysv/linux/tst-mount-compile.py
++	$(sysdeps-linux-python) \
++	  ../sysdeps/unix/sysv/linux/tst-mount-compile.py \
++	    $(sysdeps-linux-python-cc) \
++	  < /dev/null > $@ 2>&1; $(evaluate-test)
++$(objpfx)tst-mount-compile.out: $(sysdeps-linux-python-deps)
++
+ tst-rseq-disable-ENV = GLIBC_TUNABLES=glibc.pthread.rseq=0
+ 
+ endif # $(subdir) == misc
+diff --git a/sysdeps/unix/sysv/linux/sys/mount.h b/sysdeps/unix/sysv/linux/sys/mount.h
+index df6b0dbb42..2e3fd6a7fe 100644
+--- a/sysdeps/unix/sysv/linux/sys/mount.h
++++ b/sysdeps/unix/sysv/linux/sys/mount.h
+@@ -27,6 +27,13 @@
+ #include <stddef.h>
+ #include <sys/ioctl.h>
+ 
++#ifdef __has_include
++# if __has_include ("linux/mount.h")
++#  include "linux/mount.h"
++# endif
++#endif
++
++
+ #define BLOCK_SIZE_BITS	10
+ #define BLOCK_SIZE	(1<<BLOCK_SIZE_BITS)
+ 
+@@ -35,69 +42,98 @@
+    supported  */
+ enum
+ {
++#undef MS_RDONLY
+   MS_RDONLY = 1,		/* Mount read-only.  */
+ #define MS_RDONLY	MS_RDONLY
++#undef MS_NOSUID
+   MS_NOSUID = 2,		/* Ignore suid and sgid bits.  */
+ #define MS_NOSUID	MS_NOSUID
++#undef MS_NODEV
+   MS_NODEV = 4,			/* Disallow access to device special files.  */
+ #define MS_NODEV	MS_NODEV
++#undef MS_NOEXEC
+   MS_NOEXEC = 8,		/* Disallow program execution.  */
+ #define MS_NOEXEC	MS_NOEXEC
++#undef MS_SYNCHRONOUS
+   MS_SYNCHRONOUS = 16,		/* Writes are synced at once.  */
+ #define MS_SYNCHRONOUS	MS_SYNCHRONOUS
++#undef MS_REMOUNT
+   MS_REMOUNT = 32,		/* Alter flags of a mounted FS.  */
+ #define MS_REMOUNT	MS_REMOUNT
++#undef MS_MANDLOCK
+   MS_MANDLOCK = 64,		/* Allow mandatory locks on an FS.  */
+ #define MS_MANDLOCK	MS_MANDLOCK
++#undef MS_DIRSYNC
+   MS_DIRSYNC = 128,		/* Directory modifications are synchronous.  */
+ #define MS_DIRSYNC	MS_DIRSYNC
++#undef MS_NOSYMFOLLOW
+   MS_NOSYMFOLLOW = 256,		/* Do not follow symlinks.  */
+ #define MS_NOSYMFOLLOW	MS_NOSYMFOLLOW
++#undef MS_NOATIME
+   MS_NOATIME = 1024,		/* Do not update access times.  */
+ #define MS_NOATIME	MS_NOATIME
++#undef MS_NODIRATIME
+   MS_NODIRATIME = 2048,		/* Do not update directory access times.  */
+ #define MS_NODIRATIME	MS_NODIRATIME
++#undef MS_BIND
+   MS_BIND = 4096,		/* Bind directory at different place.  */
+ #define MS_BIND		MS_BIND
++#undef MS_MOVE
+   MS_MOVE = 8192,
+ #define MS_MOVE		MS_MOVE
++#undef MS_REC
+   MS_REC = 16384,
+ #define MS_REC		MS_REC
++#undef MS_SILENT
+   MS_SILENT = 32768,
+ #define MS_SILENT	MS_SILENT
++#undef MS_POSIXACL
+   MS_POSIXACL = 1 << 16,	/* VFS does not apply the umask.  */
+ #define MS_POSIXACL	MS_POSIXACL
++#undef MS_UNBINDABLE
+   MS_UNBINDABLE = 1 << 17,	/* Change to unbindable.  */
+ #define MS_UNBINDABLE	MS_UNBINDABLE
++#undef MS_PRIVATE
+   MS_PRIVATE = 1 << 18,		/* Change to private.  */
+ #define MS_PRIVATE	MS_PRIVATE
++#undef MS_SLAVE
+   MS_SLAVE = 1 << 19,		/* Change to slave.  */
+ #define MS_SLAVE	MS_SLAVE
++#undef MS_SHARED
+   MS_SHARED = 1 << 20,		/* Change to shared.  */
+ #define MS_SHARED	MS_SHARED
++#undef MS_RELATIME
+   MS_RELATIME = 1 << 21,	/* Update atime relative to mtime/ctime.  */
+ #define MS_RELATIME	MS_RELATIME
++#undef MS_KERNMOUNT
+   MS_KERNMOUNT = 1 << 22,	/* This is a kern_mount call.  */
+ #define MS_KERNMOUNT	MS_KERNMOUNT
++#undef MS_I_VERSION
+   MS_I_VERSION =  1 << 23,	/* Update inode I_version field.  */
+ #define MS_I_VERSION	MS_I_VERSION
++#undef MS_STRICTATIME
+   MS_STRICTATIME = 1 << 24,	/* Always perform atime updates.  */
+ #define MS_STRICTATIME	MS_STRICTATIME
++#undef MS_LAZYTIME
+   MS_LAZYTIME = 1 << 25,	/* Update the on-disk [acm]times lazily.  */
+ #define MS_LAZYTIME	MS_LAZYTIME
++#undef MS_ACTIVE
+   MS_ACTIVE = 1 << 30,
+ #define MS_ACTIVE	MS_ACTIVE
++#undef MS_NOUSER
+   MS_NOUSER = 1 << 31
+ #define MS_NOUSER	MS_NOUSER
+ };
+ 
+ /* Flags that can be altered by MS_REMOUNT  */
++#undef MS_RMT_MASK
+ #define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_I_VERSION \
+ 		     |MS_LAZYTIME)
+ 
+ 
+ /* Magic mount flag number. Has to be or-ed to the flag values.  */
+ 
++#undef MS_MGC_VAL
+ #define MS_MGC_VAL 0xc0ed0000	/* Magic flag number to indicate "new" flags */
+ #define MS_MGC_MSK 0xffff0000	/* Magic flag number mask */
+ 
+@@ -106,20 +142,35 @@ enum
+    is probably as bad and I don't want to create yet another include
+    file.  */
+ 
++#undef BLKROSET
+ #define BLKROSET   _IO(0x12, 93) /* Set device read-only (0 = read-write).  */
++#undef BLKROGET
+ #define BLKROGET   _IO(0x12, 94) /* Get read-only status (0 = read_write).  */
++#undef BLKRRPART
+ #define BLKRRPART  _IO(0x12, 95) /* Re-read partition table.  */
++#undef BLKGETSIZE
+ #define BLKGETSIZE _IO(0x12, 96) /* Return device size.  */
++#undef BLKFLSBUF
+ #define BLKFLSBUF  _IO(0x12, 97) /* Flush buffer cache.  */
++#undef BLKRASET
+ #define BLKRASET   _IO(0x12, 98) /* Set read ahead for block device.  */
++#undef BLKRAGET
+ #define BLKRAGET   _IO(0x12, 99) /* Get current read ahead setting.  */
++#undef BLKFRASET
+ #define BLKFRASET  _IO(0x12,100) /* Set filesystem read-ahead.  */
++#undef BLKFRAGET
+ #define BLKFRAGET  _IO(0x12,101) /* Get filesystem read-ahead.  */
++#undef BLKSECTSET
+ #define BLKSECTSET _IO(0x12,102) /* Set max sectors per request.  */
++#undef BLKSECTGET
+ #define BLKSECTGET _IO(0x12,103) /* Get max sectors per request.  */
++#undef BLKSSZGET
+ #define BLKSSZGET  _IO(0x12,104) /* Get block device sector size.  */
++#undef BLKBSZGET
+ #define BLKBSZGET  _IOR(0x12,112,size_t)
++#undef BLKBSZSET
+ #define BLKBSZSET  _IOW(0x12,113,size_t)
++#undef BLKGETSIZE64
+ #define BLKGETSIZE64 _IOR(0x12,114,size_t) /* return device size.  */
+ 
+ 
+@@ -157,6 +208,7 @@ enum
+ #define MOUNT_ATTR_NOSYMFOLLOW  0x00200000 /* Do not follow symlinks.  */
+ 
+ 
++#ifndef MOUNT_ATTR_SIZE_VER0
+ /* For mount_setattr.  */
+ struct mount_attr
+ {
+@@ -165,6 +217,7 @@ struct mount_attr
+   uint64_t propagation;
+   uint64_t userns_fd;
+ };
++#endif
+ 
+ #define MOUNT_ATTR_SIZE_VER0    32 /* sizeof first published struct */
+ 
+@@ -185,26 +238,28 @@ struct mount_attr
+ #define FSPICK_EMPTY_PATH       0x00000008
+ 
+ 
++#ifndef FSOPEN_CLOEXEC
+ /* The type of fsconfig call made.   */
+ enum fsconfig_command
+ {
+   FSCONFIG_SET_FLAG       = 0,    /* Set parameter, supplying no value */
+-#define FSCONFIG_SET_FLAG FSCONFIG_SET_FLAG
++# define FSCONFIG_SET_FLAG FSCONFIG_SET_FLAG
+   FSCONFIG_SET_STRING     = 1,    /* Set parameter, supplying a string value */
+-#define FSCONFIG_SET_STRING FSCONFIG_SET_STRING
++# define FSCONFIG_SET_STRING FSCONFIG_SET_STRING
+   FSCONFIG_SET_BINARY     = 2,    /* Set parameter, supplying a binary blob value */
+-#define FSCONFIG_SET_BINARY FSCONFIG_SET_BINARY
++# define FSCONFIG_SET_BINARY FSCONFIG_SET_BINARY
+   FSCONFIG_SET_PATH       = 3,    /* Set parameter, supplying an object by path */
+-#define FSCONFIG_SET_PATH FSCONFIG_SET_PATH
++# define FSCONFIG_SET_PATH FSCONFIG_SET_PATH
+   FSCONFIG_SET_PATH_EMPTY = 4,    /* Set parameter, supplying an object by (empty) path */
+-#define FSCONFIG_SET_PATH_EMPTY FSCONFIG_SET_PATH_EMPTY
++# define FSCONFIG_SET_PATH_EMPTY FSCONFIG_SET_PATH_EMPTY
+   FSCONFIG_SET_FD         = 5,    /* Set parameter, supplying an object by fd */
+-#define FSCONFIG_SET_FD FSCONFIG_SET_FD
++# define FSCONFIG_SET_FD FSCONFIG_SET_FD
+   FSCONFIG_CMD_CREATE     = 6,    /* Invoke superblock creation */
+-#define FSCONFIG_CMD_CREATE FSCONFIG_CMD_CREATE
++# define FSCONFIG_CMD_CREATE FSCONFIG_CMD_CREATE
+   FSCONFIG_CMD_RECONFIGURE = 7,   /* Invoke superblock reconfiguration */
+-#define FSCONFIG_CMD_RECONFIGURE FSCONFIG_CMD_RECONFIGURE
++# define FSCONFIG_CMD_RECONFIGURE FSCONFIG_CMD_RECONFIGURE
+ };
++#endif
+ 
+ /* open_tree flags.  */
+ #define OPEN_TREE_CLONE    1         /* Clone the target tree and attach the clone */
+diff --git a/sysdeps/unix/sysv/linux/tst-mount-compile.py b/sysdeps/unix/sysv/linux/tst-mount-compile.py
+new file mode 100755
+index 0000000000..0ec74d4e0b
+--- /dev/null
++++ b/sysdeps/unix/sysv/linux/tst-mount-compile.py
+@@ -0,0 +1,66 @@
++#!/usr/bin/python3
++# Check if glibc provided sys/mount.h can be used along related kernel
++# headers.
++# Copyright (C) 2022 Free Software Foundation, Inc.
++# This file is part of the GNU C Library.
++#
++# The GNU C Library is free software; you can redistribute it and/or
++# modify it under the terms of the GNU Lesser General Public
++# License as published by the Free Software Foundation; either
++# version 2.1 of the License, or (at your option) any later version.
++#
++# The GNU C Library is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++# Lesser General Public License for more details.
++#
++# You should have received a copy of the GNU Lesser General Public
++# License along with the GNU C Library; if not, see
++# <https://www.gnu.org/licenses/>.
++
++import argparse
++import sys
++
++import glibcextract
++
++
++def main():
++    """The main entry point."""
++    parser = argparse.ArgumentParser(
++        description='Check if glibc provided sys/mount.h can be '
++                    ' used along related kernel headers.')
++    parser.add_argument('--cc', metavar='CC',
++                        help='C compiler (including options) to use')
++    args = parser.parse_args()
++
++    if glibcextract.compile_c_snippet(
++            '#include <linux/mount.h>',
++            args.cc).returncode != 0:
++        sys.exit (77)
++
++    def check(testname, snippet):
++        # Add -Werror to catch macro redefinitions and _ISOMAC to avoid
++        # internal glibc definitions.
++        r = glibcextract.compile_c_snippet(snippet, args.cc,
++                '-Werror -D_ISOMAC')
++        if r.returncode != 0:
++            print('error: test {}:\n{}'.format(testname, r.output.decode()))
++        return r.returncode
++
++    status = max(
++        check("sys/mount.h + linux/mount.h",
++              "#include <sys/mount.h>\n"
++              "#include <linux/mount.h>"),
++        check("sys/mount.h + linux/fs.h",
++              "#include <sys/mount.h>\n"
++              "#include <linux/fs.h>"),
++        check("linux/mount.h + sys/mount.h",
++              "#include <linux/mount.h>\n"
++              "#include <sys/mount.h>"),
++        check("linux/fs.h + sys/mount.h",
++              "#include <linux/fs.h>\n"
++              "#include <sys/mount.h>"))
++    sys.exit(status)
++
++if __name__ == '__main__':
++    main()
+-- 
+2.38.1
+
+
+From 3bd3c612e98a53ce60ed972f5cd2b90628b3cba5 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 16 Aug 2022 09:25:23 +0200
+Subject: Linux: Fix enum fsconfig_command detection in <sys/mount.h>
+
+The #ifdef FSOPEN_CLOEXEC check did not work because the macro
+was always defined in this header prior to the check, so that
+the <linux/mount.h> contents did not matter.
+
+Fixes commit 774058d72942249f71d74e7f2b639f77184160a6
+("linux: Fix sys/mount.h usage with kernel headers").
+
+(cherry picked from commit 2955ef4b7c9b56fcd7abfeddef7ee83c60abff98)
+---
+ sysdeps/unix/sysv/linux/sys/mount.h | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/sysdeps/unix/sysv/linux/sys/mount.h b/sysdeps/unix/sysv/linux/sys/mount.h
+index 2e3fd6a7fe..19841d0738 100644
+--- a/sysdeps/unix/sysv/linux/sys/mount.h
++++ b/sysdeps/unix/sysv/linux/sys/mount.h
+@@ -188,9 +188,6 @@ enum
+ };
+ 
+ 
+-/* fsopen flags.  */
+-#define FSOPEN_CLOEXEC          0x00000001
+-
+ /* fsmount flags.  */
+ #define FSMOUNT_CLOEXEC         0x00000001
+ 
+@@ -261,6 +258,9 @@ enum fsconfig_command
+ };
+ #endif
+ 
++/* fsopen flags.  */
++#define FSOPEN_CLOEXEC          0x00000001
++
+ /* open_tree flags.  */
+ #define OPEN_TREE_CLONE    1         /* Clone the target tree and attach the clone */
+ #define OPEN_TREE_CLOEXEC  O_CLOEXEC /* Close the file on execve() */
+-- 
+2.38.1
+
+
+From b0e7888d1fa2dbd2d9e1645ec8c796abf78880b9 Mon Sep 17 00:00:00 2001
+From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Sun, 28 Aug 2022 16:52:53 -0300
+Subject: syslog: Fix large messages (BZ#29536)
+
+The a583b6add407c17cd change did not handle large messages that
+would require a heap allocation correctly, where the message itself
+is not take in consideration.
+
+This patch fixes it and extend the tst-syslog to check for large
+messages as well.
+
+Checked on x86_64-linux-gnu.
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit 52a5be0df411ef3ff45c10c7c308cb92993d15b1)
+---
+ misc/syslog.c     |  18 +++---
+ misc/tst-syslog.c | 152 +++++++++++++++++++++++++++++++++++++++-------
+ 2 files changed, 142 insertions(+), 28 deletions(-)
+
+diff --git a/misc/syslog.c b/misc/syslog.c
+index 554089bfc4..b88f66c835 100644
+--- a/misc/syslog.c
++++ b/misc/syslog.c
+@@ -193,28 +193,32 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
+       int vl = __vsnprintf_internal (bufs + l, sizeof bufs - l, fmt, apc,
+                                      mode_flags);
+       if (0 <= vl && vl < sizeof bufs - l)
+-        {
+-          buf = bufs;
+-          bufsize = l + vl;
+-        }
++        buf = bufs;
++      bufsize = l + vl;
+ 
+       va_end (apc);
+     }
+ 
+   if (buf == NULL)
+     {
+-      buf = malloc (l * sizeof (char));
++      buf = malloc ((bufsize + 1) * sizeof (char));
+       if (buf != NULL)
+ 	{
+ 	  /* Tell the cancellation handler to free this buffer.  */
+ 	  clarg.buf = buf;
+ 
+ 	  if (has_ts)
+-	    __snprintf (bufs, sizeof bufs,
++	    __snprintf (buf, l + 1,
+ 			SYSLOG_HEADER (pri, timestamp, &msgoff, pid));
+ 	  else
+-	    __snprintf (bufs, sizeof bufs,
++	    __snprintf (buf, l + 1,
+ 			SYSLOG_HEADER_WITHOUT_TS (pri, &msgoff));
++
++	  va_list apc;
++	  va_copy (apc, ap);
++	  __vsnprintf_internal (buf + l, bufsize - l + 1, fmt, apc,
++				mode_flags);
++	  va_end (apc);
+ 	}
+       else
+         {
+diff --git a/misc/tst-syslog.c b/misc/tst-syslog.c
+index e550d15796..1d332ece53 100644
+--- a/misc/tst-syslog.c
++++ b/misc/tst-syslog.c
+@@ -68,21 +68,19 @@ static const int priorities[] =
+     LOG_DEBUG
+   };
+ 
+-enum
+-  {
+-    ident_length = 64,
+-    msg_length = 64
+-  };
++#define IDENT_LENGTH 64
++#define MSG_LENGTH   1024
+ 
+ #define SYSLOG_MSG_BASE "syslog_message"
+ #define OPENLOG_IDENT   "openlog_ident"
++static char large_message[MSG_LENGTH];
+ 
+ struct msg_t
+   {
+     int priority;
+     int facility;
+-    char ident[ident_length];
+-    char msg[msg_length];
++    char ident[IDENT_LENGTH];
++    char msg[MSG_LENGTH];
+     pid_t pid;
+   };
+ 
+@@ -147,6 +145,37 @@ check_syslog_message (const struct msg_t *msg, int msgnum, int options,
+   return true;
+ }
+ 
++static void
++send_syslog_large (int options)
++{
++  int facility = LOG_USER;
++  int priority = LOG_INFO;
++
++  syslog (facility | priority, "%s %d %d", large_message, facility,
++	  priority);
++}
++
++static void
++send_vsyslog_large (int options)
++{
++  int facility = LOG_USER;
++  int priority = LOG_INFO;
++
++  call_vsyslog (facility | priority, "%s %d %d", large_message, facility,
++		priority);
++}
++
++static bool
++check_syslog_message_large (const struct msg_t *msg, int msgnum, int options,
++			    pid_t pid)
++{
++  TEST_COMPARE (msg->facility, LOG_USER);
++  TEST_COMPARE (msg->priority, LOG_INFO);
++  TEST_COMPARE_STRING (msg->msg, large_message);
++
++  return false;
++}
++
+ static void
+ send_openlog (int options)
+ {
+@@ -179,6 +208,17 @@ send_openlog (int options)
+   closelog ();
+ }
+ 
++static void
++send_openlog_large (int options)
++{
++  /* Define a non-default IDENT and a not default facility.  */
++  openlog (OPENLOG_IDENT, options, LOG_LOCAL0);
++
++  syslog (LOG_INFO, "%s %d %d", large_message, LOG_LOCAL0, LOG_INFO);
++
++  closelog ();
++}
++
+ static bool
+ check_openlog_message (const struct msg_t *msg, int msgnum,
+                        int options, pid_t pid)
+@@ -189,7 +229,7 @@ check_openlog_message (const struct msg_t *msg, int msgnum,
+   int expected_priority = priorities[msgnum % array_length (priorities)];
+   TEST_COMPARE (msg->priority, expected_priority);
+ 
+-  char expected_ident[ident_length];
++  char expected_ident[IDENT_LENGTH];
+   snprintf (expected_ident, sizeof (expected_ident), "%s%s%.0d%s:",
+             OPENLOG_IDENT,
+             options & LOG_PID ? "[" : "",
+@@ -211,15 +251,38 @@ check_openlog_message (const struct msg_t *msg, int msgnum,
+   return true;
+ }
+ 
++static bool
++check_openlog_message_large (const struct msg_t *msg, int msgnum,
++			     int options, pid_t pid)
++{
++  char expected_ident[IDENT_LENGTH];
++  snprintf (expected_ident, sizeof (expected_ident), "%s%s%.0d%s:",
++            OPENLOG_IDENT,
++            options & LOG_PID ? "[" : "",
++            options & LOG_PID ? pid : 0,
++            options & LOG_PID ? "]" : "");
++
++  TEST_COMPARE_STRING (msg->ident, expected_ident);
++  TEST_COMPARE_STRING (msg->msg, large_message);
++  TEST_COMPARE (msg->priority, LOG_INFO);
++  TEST_COMPARE (msg->facility, LOG_LOCAL0);
++
++  return false;
++}
++
+ static struct msg_t
+ parse_syslog_msg (const char *msg)
+ {
+   struct msg_t r = { .pid = -1 };
+   int number;
+ 
++#define STRINPUT(size)  XSTRINPUT(size)
++#define XSTRINPUT(size) "%" # size "s"
++
+   /* The message in the form:
+-     <179>Apr  8 14:51:19 tst-syslog: syslog message 176 3  */
+-  int n = sscanf (msg, "<%3d>%*s %*d %*d:%*d:%*d %32s %64s %*d %*d",
++     <179>Apr  8 14:51:19  tst-syslog: message 176 3  */
++  int n = sscanf (msg, "<%3d>%*s %*d %*d:%*d:%*d " STRINPUT(IDENT_LENGTH)
++		       " " STRINPUT(MSG_LENGTH) " %*d %*d",
+                   &number, r.ident, r.msg);
+   TEST_COMPARE (n, 3);
+ 
+@@ -246,7 +309,7 @@ parse_syslog_console (const char *msg)
+ 
+   /* The message in the form:
+      openlog_ident: syslog_message 128 0  */
+-  int n = sscanf (msg, "%32s %64s %d %d",
++  int n = sscanf (msg, STRINPUT(IDENT_LENGTH) " " STRINPUT(MSG_LENGTH) " %d %d",
+       r.ident, r.msg, &facility, &priority);
+   TEST_COMPARE (n, 4);
+ 
+@@ -281,7 +344,7 @@ check_syslog_udp (void (*syslog_send)(int), int options,
+   int msgnum = 0;
+   while (1)
+     {
+-      char buf[512];
++      char buf[2048];
+       size_t l = xrecvfrom (server_udp, buf, sizeof (buf), 0,
+                             (struct sockaddr *) &addr, &addrlen);
+       buf[l] = '\0';
+@@ -325,7 +388,7 @@ check_syslog_tcp (void (*syslog_send)(int), int options,
+ 
+   int client_tcp = xaccept (server_tcp, NULL, NULL);
+ 
+-  char buf[512], *rb = buf;
++  char buf[2048], *rb = buf;
+   size_t rbl = sizeof (buf);
+   size_t prl = 0;  /* Track the size of the partial record.  */
+   int msgnum = 0;
+@@ -393,20 +456,34 @@ check_syslog_console_read (FILE *fp)
+ }
+ 
+ static void
+-check_syslog_console (void)
++check_syslog_console_read_large (FILE *fp)
++{
++  char buf[2048];
++  TEST_VERIFY (fgets (buf, sizeof (buf), fp) != NULL);
++  struct msg_t msg = parse_syslog_console (buf);
++
++  TEST_COMPARE_STRING (msg.ident, OPENLOG_IDENT ":");
++  TEST_COMPARE_STRING (msg.msg, large_message);
++  TEST_COMPARE (msg.priority, LOG_INFO);
++  TEST_COMPARE (msg.facility, LOG_LOCAL0);
++}
++
++static void
++check_syslog_console (void (*syslog_send)(int),
++		      void (*syslog_check)(FILE *fp))
+ {
+   xmkfifo (_PATH_CONSOLE, 0666);
+ 
+   pid_t sender_pid = xfork ();
+   if (sender_pid == 0)
+     {
+-      send_openlog (LOG_CONS);
++      syslog_send (LOG_CONS);
+       _exit (0);
+     }
+ 
+   {
+     FILE *fp = xfopen (_PATH_CONSOLE, "r+");
+-    check_syslog_console_read (fp);
++    syslog_check (fp);
+     xfclose (fp);
+   }
+ 
+@@ -425,16 +502,28 @@ send_openlog_callback (void *clousure)
+ }
+ 
+ static void
+-check_syslog_perror (void)
++send_openlog_callback_large (void *clousure)
++{
++  int options = *(int *) clousure;
++  send_openlog_large (options);
++}
++
++static void
++check_syslog_perror (bool large)
+ {
+   struct support_capture_subprocess result;
+-  result = support_capture_subprocess (send_openlog_callback,
++  result = support_capture_subprocess (large
++				       ? send_openlog_callback_large
++				       : send_openlog_callback,
+                                        &(int){LOG_PERROR});
+ 
+   FILE *mfp = fmemopen (result.err.buffer, result.err.length, "r");
+   if (mfp == NULL)
+     FAIL_EXIT1 ("fmemopen: %m");
+-  check_syslog_console_read (mfp);
++  if (large)
++    check_syslog_console_read_large (mfp);
++  else
++    check_syslog_console_read (mfp);
+   xfclose (mfp);
+ 
+   support_capture_subprocess_check (&result, "tst-openlog-child", 0,
+@@ -462,10 +551,31 @@ do_test (void)
+   check_syslog_tcp (send_openlog, LOG_PID, check_openlog_message);
+ 
+   /* Check the LOG_CONS option.  */
+-  check_syslog_console ();
++  check_syslog_console (send_openlog, check_syslog_console_read);
+ 
+   /* Check the LOG_PERROR option.  */
+-  check_syslog_perror ();
++  check_syslog_perror (false);
++
++  /* Similar tests as before, but with a large message to trigger the
++     syslog path that uses dynamically allocated memory.  */
++  memset (large_message, 'a', sizeof large_message - 1);
++  large_message[sizeof large_message - 1] = '\0';
++
++  check_syslog_udp (send_syslog_large, 0, check_syslog_message_large);
++  check_syslog_tcp (send_syslog_large, 0, check_syslog_message_large);
++
++  check_syslog_udp (send_vsyslog_large, 0, check_syslog_message_large);
++  check_syslog_tcp (send_vsyslog_large, 0, check_syslog_message_large);
++
++  check_syslog_udp (send_openlog_large, 0, check_openlog_message_large);
++  check_syslog_tcp (send_openlog_large, 0, check_openlog_message_large);
++
++  check_syslog_udp (send_openlog_large, LOG_PID, check_openlog_message_large);
++  check_syslog_tcp (send_openlog_large, LOG_PID, check_openlog_message_large);
++
++  check_syslog_console (send_openlog_large, check_syslog_console_read_large);
++
++  check_syslog_perror (true);
+ 
+   return 0;
+ }
+-- 
+2.38.1
+
+
+From 924e4f3eaa502ce82fccf8537f021a796d158771 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Fri, 26 Aug 2022 21:15:43 +0200
+Subject: elf: Call __libc_early_init for reused namespaces (bug 29528)
+
+libc_map is never reset to NULL, neither during dlclose nor on a
+dlopen call which reuses the namespace structure.  As a result, if a
+namespace is reused, its libc is not initialized properly.  The most
+visible result is a crash in the <ctype.h> functions.
+
+To prevent similar bugs on namespace reuse from surfacing,
+unconditionally initialize the chosen namespace to zero using memset.
+
+(cherry picked from commit d0e357ff45a75553dee3b17ed7d303bfa544f6fe)
+---
+ NEWS                         |  1 +
+ elf/Makefile                 | 25 ++++++++++++++++++
+ elf/dl-open.c                | 13 ++++++----
+ elf/tst-dlmopen-twice-mod1.c | 37 ++++++++++++++++++++++++++
+ elf/tst-dlmopen-twice-mod2.c | 50 ++++++++++++++++++++++++++++++++++++
+ elf/tst-dlmopen-twice.c      | 34 ++++++++++++++++++++++++
+ 6 files changed, 155 insertions(+), 5 deletions(-)
+ create mode 100644 elf/tst-dlmopen-twice-mod1.c
+ create mode 100644 elf/tst-dlmopen-twice-mod2.c
+ create mode 100644 elf/tst-dlmopen-twice.c
+
+diff --git a/NEWS b/NEWS
+index ae30900bbc..6d31e5abba 100644
+--- a/NEWS
++++ b/NEWS
+@@ -13,6 +13,7 @@ The following bugs are resolved with this release:
+   [29446] _dlopen now ignores dl_caller argument in static mode
+   [29485] Linux: Terminate subprocess on late failure in tst-pidfd
+   [29490] alpha: New __brk_call implementation is broken
++  [29528] elf: Call __libc_early_init for reused namespaces
+ 
+ \f
+ Version 2.36
+diff --git a/elf/Makefile b/elf/Makefile
+index fd77d0c7c8..43353a4b08 100644
+--- a/elf/Makefile
++++ b/elf/Makefile
+@@ -408,6 +408,7 @@ tests += \
+   tst-dlmopen4 \
+   tst-dlmopen-dlerror \
+   tst-dlmopen-gethostbyname \
++  tst-dlmopen-twice \
+   tst-dlopenfail \
+   tst-dlopenfail-2 \
+   tst-dlopenrpath \
+@@ -834,6 +835,8 @@ modules-names += \
+   tst-dlmopen1mod \
+   tst-dlmopen-dlerror-mod \
+   tst-dlmopen-gethostbyname-mod \
++  tst-dlmopen-twice-mod1 \
++  tst-dlmopen-twice-mod2 \
+   tst-dlopenfaillinkmod \
+   tst-dlopenfailmod1 \
+   tst-dlopenfailmod2 \
+@@ -2967,3 +2970,25 @@ $(objpfx)tst-tls-allocation-failure-static-patched.out: \
+ 	grep -q '^Fatal glibc error: Cannot allocate TLS block$$' $@ \
+ 	  && grep -q '^status: 127$$' $@; \
+ 	  $(evaluate-test)
++
++$(objpfx)tst-audit-tlsdesc: $(objpfx)tst-audit-tlsdesc-mod1.so \
++			    $(objpfx)tst-audit-tlsdesc-mod2.so \
++			    $(shared-thread-library)
++ifeq (yes,$(have-mtls-dialect-gnu2))
++# The test is valid for all TLS types, but we want to exercise GNU2
++# TLS if possible.
++CFLAGS-tst-audit-tlsdesc-mod1.c += -mtls-dialect=gnu2
++CFLAGS-tst-audit-tlsdesc-mod2.c += -mtls-dialect=gnu2
++endif
++$(objpfx)tst-audit-tlsdesc-dlopen: $(shared-thread-library)
++$(objpfx)tst-audit-tlsdesc-dlopen.out: $(objpfx)tst-audit-tlsdesc-mod1.so \
++				       $(objpfx)tst-audit-tlsdesc-mod2.so
++$(objpfx)tst-audit-tlsdesc-mod1.so: $(objpfx)tst-audit-tlsdesc-mod2.so
++$(objpfx)tst-audit-tlsdesc.out: $(objpfx)tst-auditmod-tlsdesc.so
++tst-audit-tlsdesc-ENV = LD_AUDIT=$(objpfx)tst-auditmod-tlsdesc.so
++$(objpfx)tst-audit-tlsdesc-dlopen.out: $(objpfx)tst-auditmod-tlsdesc.so
++tst-audit-tlsdesc-dlopen-ENV = LD_AUDIT=$(objpfx)tst-auditmod-tlsdesc.so
++
++$(objpfx)tst-dlmopen-twice.out: \
++  $(objpfx)tst-dlmopen-twice-mod1.so \
++  $(objpfx)tst-dlmopen-twice-mod2.so
+diff --git a/elf/dl-open.c b/elf/dl-open.c
+index a23e65926b..46e8066fd8 100644
+--- a/elf/dl-open.c
++++ b/elf/dl-open.c
+@@ -844,11 +844,14 @@ _dl_open (const char *file, int mode, const void *caller_dlopen, Lmid_t nsid,
+ 	  _dl_signal_error (EINVAL, file, NULL, N_("\
+ no more namespaces available for dlmopen()"));
+ 	}
+-      else if (nsid == GL(dl_nns))
+-	{
+-	  __rtld_lock_initialize (GL(dl_ns)[nsid]._ns_unique_sym_table.lock);
+-	  ++GL(dl_nns);
+-	}
++
++      if (nsid == GL(dl_nns))
++	++GL(dl_nns);
++
++      /* Initialize the new namespace.  Most members are
++	 zero-initialized, only the lock needs special treatment.  */
++      memset (&GL(dl_ns)[nsid], 0, sizeof (GL(dl_ns)[nsid]));
++      __rtld_lock_initialize (GL(dl_ns)[nsid]._ns_unique_sym_table.lock);
+ 
+       _dl_debug_update (nsid)->r_state = RT_CONSISTENT;
+     }
+diff --git a/elf/tst-dlmopen-twice-mod1.c b/elf/tst-dlmopen-twice-mod1.c
+new file mode 100644
+index 0000000000..0eaf04948c
+--- /dev/null
++++ b/elf/tst-dlmopen-twice-mod1.c
+@@ -0,0 +1,37 @@
++/* Initialization of libc after dlmopen/dlclose/dlmopen (bug 29528).  Module 1.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <stdio.h>
++
++static void __attribute__ ((constructor))
++init (void)
++{
++  puts ("info: tst-dlmopen-twice-mod1.so loaded");
++  fflush (stdout);
++}
++
++static void __attribute__ ((destructor))
++fini (void)
++{
++  puts ("info: tst-dlmopen-twice-mod1.so about to be unloaded");
++  fflush (stdout);
++}
++
++/* Large allocation.  The second module does not have this, so it
++   should load libc at a different address.  */
++char large_allocate[16 * 1024 * 1024];
+diff --git a/elf/tst-dlmopen-twice-mod2.c b/elf/tst-dlmopen-twice-mod2.c
+new file mode 100644
+index 0000000000..40c6c01f96
+--- /dev/null
++++ b/elf/tst-dlmopen-twice-mod2.c
+@@ -0,0 +1,50 @@
++/* Initialization of libc after dlmopen/dlclose/dlmopen (bug 29528).  Module 2.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <ctype.h>
++#include <stdio.h>
++
++static void __attribute__ ((constructor))
++init (void)
++{
++  puts ("info: tst-dlmopen-twice-mod2.so loaded");
++  fflush (stdout);
++}
++
++static void __attribute__ ((destructor))
++fini (void)
++{
++  puts ("info: tst-dlmopen-twice-mod2.so about to be unloaded");
++  fflush (stdout);
++}
++
++int
++run_check (void)
++{
++  puts ("info: about to call isalpha");
++  fflush (stdout);
++
++  volatile char ch = 'a';
++  if (!isalpha (ch))
++    {
++      puts ("error: isalpha ('a') is not true");
++      fflush (stdout);
++      return 1;
++    }
++  return 0;
++}
+diff --git a/elf/tst-dlmopen-twice.c b/elf/tst-dlmopen-twice.c
+new file mode 100644
+index 0000000000..449f3c8fa9
+--- /dev/null
++++ b/elf/tst-dlmopen-twice.c
+@@ -0,0 +1,34 @@
++/* Initialization of libc after dlmopen/dlclose/dlmopen (bug 29528).  Main.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <support/xdlfcn.h>
++#include <support/check.h>
++
++static int
++do_test (void)
++{
++  void *handle = xdlmopen (LM_ID_NEWLM, "tst-dlmopen-twice-mod1.so", RTLD_NOW);
++  xdlclose (handle);
++  handle = xdlmopen (LM_ID_NEWLM, "tst-dlmopen-twice-mod2.so", RTLD_NOW);
++  int (*run_check) (void) = xdlsym (handle, "run_check");
++  TEST_COMPARE (run_check (), 0);
++  xdlclose (handle);
++  return 0;
++}
++
++#include <support/test-driver.c>
+-- 
+2.38.1
+
+
+From 3c791f2031ca8f6b99e96b774ed1c505ceb93595 Mon Sep 17 00:00:00 2001
+From: Raphael Moreira Zinsly <rzinsly@linux.ibm.com>
+Date: Wed, 24 Aug 2022 11:43:37 -0300
+Subject: Apply asm redirections in wchar.h before first use
+
+Similar to d0fa09a770, but for wchar.h.  Fixes [BZ #27087] by applying
+all long double related asm redirections before using functions in
+bits/wchar2.h.
+Moves the function declarations from wcsmbs/bits/wchar2.h to a new file
+wcsmbs/bits/wchar2-decl.h that will be included first in wcsmbs/wchar.h.
+
+Tested with build-many-glibcs.py.
+Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
+
+(cherry picked from commit c7509d49c4e8fa494120c5ead21338559dad16f5)
+---
+ include/bits/wchar2-decl.h |   1 +
+ wcsmbs/Makefile            |   5 +-
+ wcsmbs/bits/wchar2-decl.h  | 124 +++++++++++++++++++++++++++++++++++++
+ wcsmbs/bits/wchar2.h       |  72 ---------------------
+ wcsmbs/wchar.h             |  11 +++-
+ 5 files changed, 137 insertions(+), 76 deletions(-)
+ create mode 100644 include/bits/wchar2-decl.h
+ create mode 100644 wcsmbs/bits/wchar2-decl.h
+
+diff --git a/include/bits/wchar2-decl.h b/include/bits/wchar2-decl.h
+new file mode 100644
+index 0000000000..00b1b93342
+--- /dev/null
++++ b/include/bits/wchar2-decl.h
+@@ -0,0 +1 @@
++#include <wcsmbs/bits/wchar2-decl.h>
+diff --git a/wcsmbs/Makefile b/wcsmbs/Makefile
+index 3d19d5556f..4af102a3f6 100644
+--- a/wcsmbs/Makefile
++++ b/wcsmbs/Makefile
+@@ -22,8 +22,9 @@ subdir	:= wcsmbs
+ 
+ include ../Makeconfig
+ 
+-headers	:= wchar.h bits/wchar.h bits/wchar2.h bits/wchar-ldbl.h uchar.h \
+-	   bits/types/__mbstate_t.h bits/types/mbstate_t.h bits/types/wint_t.h
++headers	:= wchar.h bits/wchar.h bits/wchar2.h bits/wchar2-decl.h \
++	   bits/wchar-ldbl.h uchar.h bits/types/__mbstate_t.h \
++	   bits/types/mbstate_t.h bits/types/wint_t.h
+ 
+ routines := wcscat wcschr wcscmp wcscpy wcscspn wcsdup wcslen wcsncat \
+ 	    wcsncmp wcsncpy wcspbrk wcsrchr wcsspn wcstok wcsstr wmemchr \
+diff --git a/wcsmbs/bits/wchar2-decl.h b/wcsmbs/bits/wchar2-decl.h
+new file mode 100644
+index 0000000000..8e1735c33b
+--- /dev/null
++++ b/wcsmbs/bits/wchar2-decl.h
+@@ -0,0 +1,124 @@
++/* Checking macros for wchar functions.  Declarations only.
++   Copyright (C) 2004-2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#ifndef _BITS_WCHAR2_DECL_H
++#define _BITS_WCHAR2_DECL_H 1
++
++#ifndef _WCHAR_H
++# error "Never include <bits/wchar2-decl.h> directly; use <wchar.h> instead."
++#endif
++
++
++extern wchar_t *__wmemcpy_chk (wchar_t *__restrict __s1,
++			       const wchar_t *__restrict __s2, size_t __n,
++			       size_t __ns1) __THROW;
++extern wchar_t *__wmemmove_chk (wchar_t *__s1, const wchar_t *__s2,
++				size_t __n, size_t __ns1) __THROW;
++
++
++#ifdef __USE_GNU
++
++extern wchar_t *__wmempcpy_chk (wchar_t *__restrict __s1,
++				const wchar_t *__restrict __s2, size_t __n,
++				size_t __ns1) __THROW;
++
++#endif
++
++
++extern wchar_t *__wmemset_chk (wchar_t *__s, wchar_t __c, size_t __n,
++			       size_t __ns) __THROW;
++extern wchar_t *__wcscpy_chk (wchar_t *__restrict __dest,
++			      const wchar_t *__restrict __src,
++			      size_t __n) __THROW;
++extern wchar_t *__wcpcpy_chk (wchar_t *__restrict __dest,
++			      const wchar_t *__restrict __src,
++			      size_t __destlen) __THROW;
++extern wchar_t *__wcsncpy_chk (wchar_t *__restrict __dest,
++			       const wchar_t *__restrict __src, size_t __n,
++			       size_t __destlen) __THROW;
++extern wchar_t *__wcpncpy_chk (wchar_t *__restrict __dest,
++			       const wchar_t *__restrict __src, size_t __n,
++			       size_t __destlen) __THROW;
++extern wchar_t *__wcscat_chk (wchar_t *__restrict __dest,
++			      const wchar_t *__restrict __src,
++			      size_t __destlen) __THROW;
++extern wchar_t *__wcsncat_chk (wchar_t *__restrict __dest,
++			       const wchar_t *__restrict __src,
++			       size_t __n, size_t __destlen) __THROW;
++extern int __swprintf_chk (wchar_t *__restrict __s, size_t __n,
++			   int __flag, size_t __s_len,
++			   const wchar_t *__restrict __format, ...)
++     __THROW /* __attribute__ ((__format__ (__wprintf__, 5, 6))) */;
++extern int __vswprintf_chk (wchar_t *__restrict __s, size_t __n,
++			    int __flag, size_t __s_len,
++			    const wchar_t *__restrict __format,
++			    __gnuc_va_list __arg)
++     __THROW /* __attribute__ ((__format__ (__wprintf__, 5, 0))) */;
++
++#if __USE_FORTIFY_LEVEL > 1
++
++extern int __fwprintf_chk (__FILE *__restrict __stream, int __flag,
++			   const wchar_t *__restrict __format, ...);
++extern int __wprintf_chk (int __flag, const wchar_t *__restrict __format,
++			  ...);
++extern int __vfwprintf_chk (__FILE *__restrict __stream, int __flag,
++			    const wchar_t *__restrict __format,
++			    __gnuc_va_list __ap);
++extern int __vwprintf_chk (int __flag, const wchar_t *__restrict __format,
++			   __gnuc_va_list __ap);
++
++#endif
++
++extern wchar_t *__fgetws_chk (wchar_t *__restrict __s, size_t __size, int __n,
++			      __FILE *__restrict __stream) __wur;
++
++#ifdef __USE_GNU
++
++extern wchar_t *__fgetws_unlocked_chk (wchar_t *__restrict __s, size_t __size,
++				       int __n, __FILE *__restrict __stream)
++       __wur;
++
++#endif
++
++extern size_t __wcrtomb_chk (char *__restrict __s, wchar_t __wchar,
++			     mbstate_t *__restrict __p,
++			     size_t __buflen) __THROW __wur;
++extern size_t __mbsrtowcs_chk (wchar_t *__restrict __dst,
++			       const char **__restrict __src,
++			       size_t __len, mbstate_t *__restrict __ps,
++			       size_t __dstlen) __THROW;
++extern size_t __wcsrtombs_chk (char *__restrict __dst,
++			       const wchar_t **__restrict __src,
++			       size_t __len, mbstate_t *__restrict __ps,
++			       size_t __dstlen) __THROW;
++
++#ifdef	__USE_XOPEN2K8
++
++extern size_t __mbsnrtowcs_chk (wchar_t *__restrict __dst,
++				const char **__restrict __src, size_t __nmc,
++				size_t __len, mbstate_t *__restrict __ps,
++				size_t __dstlen) __THROW;
++extern size_t __wcsnrtombs_chk (char *__restrict __dst,
++				const wchar_t **__restrict __src,
++				size_t __nwc, size_t __len,
++				mbstate_t *__restrict __ps, size_t __dstlen)
++       __THROW;
++
++#endif
++
++#endif /* bits/wchar2-decl.h.  */
+diff --git a/wcsmbs/bits/wchar2.h b/wcsmbs/bits/wchar2.h
+index 0e017f458b..3f110efe57 100644
+--- a/wcsmbs/bits/wchar2.h
++++ b/wcsmbs/bits/wchar2.h
+@@ -21,9 +21,6 @@
+ #endif
+ 
+ 
+-extern wchar_t *__wmemcpy_chk (wchar_t *__restrict __s1,
+-			       const wchar_t *__restrict __s2, size_t __n,
+-			       size_t __ns1) __THROW;
+ extern wchar_t *__REDIRECT_NTH (__wmemcpy_alias,
+ 				(wchar_t *__restrict __s1,
+ 				 const wchar_t *__restrict __s2, size_t __n),
+@@ -45,8 +42,6 @@ __NTH (wmemcpy (wchar_t *__restrict __s1, const wchar_t *__restrict __s2,
+ }
+ 
+ 
+-extern wchar_t *__wmemmove_chk (wchar_t *__s1, const wchar_t *__s2,
+-				size_t __n, size_t __ns1) __THROW;
+ extern wchar_t *__REDIRECT_NTH (__wmemmove_alias, (wchar_t *__s1,
+ 						   const wchar_t *__s2,
+ 						   size_t __n), wmemmove);
+@@ -66,9 +61,6 @@ __NTH (wmemmove (wchar_t *__s1, const wchar_t *__s2, size_t __n))
+ 
+ 
+ #ifdef __USE_GNU
+-extern wchar_t *__wmempcpy_chk (wchar_t *__restrict __s1,
+-				const wchar_t *__restrict __s2, size_t __n,
+-				size_t __ns1) __THROW;
+ extern wchar_t *__REDIRECT_NTH (__wmempcpy_alias,
+ 				(wchar_t *__restrict __s1,
+ 				 const wchar_t *__restrict __s2,
+@@ -91,8 +83,6 @@ __NTH (wmempcpy (wchar_t *__restrict __s1, const wchar_t *__restrict __s2,
+ #endif
+ 
+ 
+-extern wchar_t *__wmemset_chk (wchar_t *__s, wchar_t __c, size_t __n,
+-			       size_t __ns) __THROW;
+ extern wchar_t *__REDIRECT_NTH (__wmemset_alias, (wchar_t *__s, wchar_t __c,
+ 						  size_t __n), wmemset);
+ extern wchar_t *__REDIRECT_NTH (__wmemset_chk_warn,
+@@ -110,9 +100,6 @@ __NTH (wmemset (wchar_t *__s, wchar_t __c, size_t __n))
+ }
+ 
+ 
+-extern wchar_t *__wcscpy_chk (wchar_t *__restrict __dest,
+-			      const wchar_t *__restrict __src,
+-			      size_t __n) __THROW;
+ extern wchar_t *__REDIRECT_NTH (__wcscpy_alias,
+ 				(wchar_t *__restrict __dest,
+ 				 const wchar_t *__restrict __src), wcscpy);
+@@ -127,9 +114,6 @@ __NTH (wcscpy (wchar_t *__restrict __dest, const wchar_t *__restrict __src))
+ }
+ 
+ 
+-extern wchar_t *__wcpcpy_chk (wchar_t *__restrict __dest,
+-			      const wchar_t *__restrict __src,
+-			      size_t __destlen) __THROW;
+ extern wchar_t *__REDIRECT_NTH (__wcpcpy_alias,
+ 				(wchar_t *__restrict __dest,
+ 				 const wchar_t *__restrict __src), wcpcpy);
+@@ -144,9 +128,6 @@ __NTH (wcpcpy (wchar_t *__restrict __dest, const wchar_t *__restrict __src))
+ }
+ 
+ 
+-extern wchar_t *__wcsncpy_chk (wchar_t *__restrict __dest,
+-			       const wchar_t *__restrict __src, size_t __n,
+-			       size_t __destlen) __THROW;
+ extern wchar_t *__REDIRECT_NTH (__wcsncpy_alias,
+ 				(wchar_t *__restrict __dest,
+ 				 const wchar_t *__restrict __src,
+@@ -168,9 +149,6 @@ __NTH (wcsncpy (wchar_t *__restrict __dest, const wchar_t *__restrict __src,
+ }
+ 
+ 
+-extern wchar_t *__wcpncpy_chk (wchar_t *__restrict __dest,
+-			       const wchar_t *__restrict __src, size_t __n,
+-			       size_t __destlen) __THROW;
+ extern wchar_t *__REDIRECT_NTH (__wcpncpy_alias,
+ 				(wchar_t *__restrict __dest,
+ 				 const wchar_t *__restrict __src,
+@@ -192,9 +170,6 @@ __NTH (wcpncpy (wchar_t *__restrict __dest, const wchar_t *__restrict __src,
+ }
+ 
+ 
+-extern wchar_t *__wcscat_chk (wchar_t *__restrict __dest,
+-			      const wchar_t *__restrict __src,
+-			      size_t __destlen) __THROW;
+ extern wchar_t *__REDIRECT_NTH (__wcscat_alias,
+ 				(wchar_t *__restrict __dest,
+ 				 const wchar_t *__restrict __src), wcscat);
+@@ -209,9 +184,6 @@ __NTH (wcscat (wchar_t *__restrict __dest, const wchar_t *__restrict __src))
+ }
+ 
+ 
+-extern wchar_t *__wcsncat_chk (wchar_t *__restrict __dest,
+-			       const wchar_t *__restrict __src,
+-			       size_t __n, size_t __destlen) __THROW;
+ extern wchar_t *__REDIRECT_NTH (__wcsncat_alias,
+ 				(wchar_t *__restrict __dest,
+ 				 const wchar_t *__restrict __src,
+@@ -228,10 +200,6 @@ __NTH (wcsncat (wchar_t *__restrict __dest, const wchar_t *__restrict __src,
+ }
+ 
+ 
+-extern int __swprintf_chk (wchar_t *__restrict __s, size_t __n,
+-			   int __flag, size_t __s_len,
+-			   const wchar_t *__restrict __format, ...)
+-     __THROW /* __attribute__ ((__format__ (__wprintf__, 5, 6))) */;
+ 
+ extern int __REDIRECT_NTH_LDBL (__swprintf_alias,
+ 				(wchar_t *__restrict __s, size_t __n,
+@@ -258,11 +226,6 @@ __NTH (swprintf (wchar_t *__restrict __s, size_t __n,
+    : swprintf (s, n, __VA_ARGS__))
+ #endif
+ 
+-extern int __vswprintf_chk (wchar_t *__restrict __s, size_t __n,
+-			    int __flag, size_t __s_len,
+-			    const wchar_t *__restrict __format,
+-			    __gnuc_va_list __arg)
+-     __THROW /* __attribute__ ((__format__ (__wprintf__, 5, 0))) */;
+ 
+ extern int __REDIRECT_NTH_LDBL (__vswprintf_alias,
+ 				(wchar_t *__restrict __s, size_t __n,
+@@ -283,16 +246,6 @@ __NTH (vswprintf (wchar_t *__restrict __s, size_t __n,
+ 
+ #if __USE_FORTIFY_LEVEL > 1
+ 
+-extern int __fwprintf_chk (__FILE *__restrict __stream, int __flag,
+-			   const wchar_t *__restrict __format, ...);
+-extern int __wprintf_chk (int __flag, const wchar_t *__restrict __format,
+-			  ...);
+-extern int __vfwprintf_chk (__FILE *__restrict __stream, int __flag,
+-			    const wchar_t *__restrict __format,
+-			    __gnuc_va_list __ap);
+-extern int __vwprintf_chk (int __flag, const wchar_t *__restrict __format,
+-			   __gnuc_va_list __ap);
+-
+ # ifdef __va_arg_pack
+ __fortify_function int
+ wprintf (const wchar_t *__restrict __fmt, ...)
+@@ -328,8 +281,6 @@ vfwprintf (__FILE *__restrict __stream,
+ 
+ #endif
+ 
+-extern wchar_t *__fgetws_chk (wchar_t *__restrict __s, size_t __size, int __n,
+-			      __FILE *__restrict __stream) __wur;
+ extern wchar_t *__REDIRECT (__fgetws_alias,
+ 			    (wchar_t *__restrict __s, int __n,
+ 			     __FILE *__restrict __stream), fgetws) __wur;
+@@ -351,9 +302,6 @@ fgetws (wchar_t *__restrict __s, int __n, __FILE *__restrict __stream)
+ }
+ 
+ #ifdef __USE_GNU
+-extern wchar_t *__fgetws_unlocked_chk (wchar_t *__restrict __s, size_t __size,
+-				       int __n, __FILE *__restrict __stream)
+-  __wur;
+ extern wchar_t *__REDIRECT (__fgetws_unlocked_alias,
+ 			    (wchar_t *__restrict __s, int __n,
+ 			     __FILE *__restrict __stream), fgetws_unlocked)
+@@ -379,9 +327,6 @@ fgetws_unlocked (wchar_t *__restrict __s, int __n, __FILE *__restrict __stream)
+ #endif
+ 
+ 
+-extern size_t __wcrtomb_chk (char *__restrict __s, wchar_t __wchar,
+-			     mbstate_t *__restrict __p,
+-			     size_t __buflen) __THROW __wur;
+ extern size_t __REDIRECT_NTH (__wcrtomb_alias,
+ 			      (char *__restrict __s, wchar_t __wchar,
+ 			       mbstate_t *__restrict __ps), wcrtomb) __wur;
+@@ -404,10 +349,6 @@ __NTH (wcrtomb (char *__restrict __s, wchar_t __wchar,
+ }
+ 
+ 
+-extern size_t __mbsrtowcs_chk (wchar_t *__restrict __dst,
+-			       const char **__restrict __src,
+-			       size_t __len, mbstate_t *__restrict __ps,
+-			       size_t __dstlen) __THROW;
+ extern size_t __REDIRECT_NTH (__mbsrtowcs_alias,
+ 			      (wchar_t *__restrict __dst,
+ 			       const char **__restrict __src,
+@@ -431,10 +372,6 @@ __NTH (mbsrtowcs (wchar_t *__restrict __dst, const char **__restrict __src,
+ }
+ 
+ 
+-extern size_t __wcsrtombs_chk (char *__restrict __dst,
+-			       const wchar_t **__restrict __src,
+-			       size_t __len, mbstate_t *__restrict __ps,
+-			       size_t __dstlen) __THROW;
+ extern size_t __REDIRECT_NTH (__wcsrtombs_alias,
+ 			      (char *__restrict __dst,
+ 			       const wchar_t **__restrict __src,
+@@ -458,10 +395,6 @@ __NTH (wcsrtombs (char *__restrict __dst, const wchar_t **__restrict __src,
+ 
+ 
+ #ifdef	__USE_XOPEN2K8
+-extern size_t __mbsnrtowcs_chk (wchar_t *__restrict __dst,
+-				const char **__restrict __src, size_t __nmc,
+-				size_t __len, mbstate_t *__restrict __ps,
+-				size_t __dstlen) __THROW;
+ extern size_t __REDIRECT_NTH (__mbsnrtowcs_alias,
+ 			      (wchar_t *__restrict __dst,
+ 			       const char **__restrict __src, size_t __nmc,
+@@ -485,11 +418,6 @@ __NTH (mbsnrtowcs (wchar_t *__restrict __dst, const char **__restrict __src,
+ }
+ 
+ 
+-extern size_t __wcsnrtombs_chk (char *__restrict __dst,
+-				const wchar_t **__restrict __src,
+-				size_t __nwc, size_t __len,
+-				mbstate_t *__restrict __ps, size_t __dstlen)
+-     __THROW;
+ extern size_t __REDIRECT_NTH (__wcsnrtombs_alias,
+ 			      (char *__restrict __dst,
+ 			       const wchar_t **__restrict __src,
+diff --git a/wcsmbs/wchar.h b/wcsmbs/wchar.h
+index 5d6a40853d..c1321c7518 100644
+--- a/wcsmbs/wchar.h
++++ b/wcsmbs/wchar.h
+@@ -864,14 +864,21 @@ extern size_t wcsftime_l (wchar_t *__restrict __s, size_t __maxsize,
+ 
+ /* Define some macros helping to catch buffer overflows.  */
+ #if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function
+-# include <bits/wchar2.h>
++/* Declare all functions from bits/wchar2-decl.h first.  */
++# include <bits/wchar2-decl.h>
+ #endif
+ 
+-#include <bits/floatn.h>
++/* The following headers provide asm redirections.  These redirections must
++   appear before the first usage of these functions, e.g. in bits/wchar.h.  */
+ #if defined __LDBL_COMPAT || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1
+ # include <bits/wchar-ldbl.h>
+ #endif
+ 
++#if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function
++/* Now include the function definitions and redirects too.  */
++# include <bits/wchar2.h>
++#endif
++
+ __END_DECLS
+ 
+ #endif /* wchar.h  */
+-- 
+2.38.1
+
+
+From b3736d1a3c60a3ec9959bf3b38794958546bf6a2 Mon Sep 17 00:00:00 2001
+From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Tue, 30 Aug 2022 13:35:52 -0300
+Subject: elf: Restore how vDSO dependency is printed with
+ LD_TRACE_LOADED_OBJECTS (BZ #29539)
+
+The d7703d3176d225d5743b21811d888619eba39e82 changed how vDSO like
+dependencies are printed, instead of just the name and address it
+follows other libraries mode and prints 'name => path'.
+
+Unfortunately, this broke some ldd consumer that uses the output to
+filter out the program's dependencies.  For instance CMake
+bundleutilities module [1], where GetPrequirite uses the regex to filter
+out 'name => path' [2].
+
+This patch restore the previous way to print just the name and the
+mapping address.
+
+Checked on x86_64-linux-gnu.
+
+[1] https://github.com/Kitware/CMake/tree/master/Tests/BundleUtilities
+[2] https://github.com/Kitware/CMake/blob/master/Modules/GetPrerequisites.cmake#L733
+
+Reviewed-by: Florian Weimer <fweimer@redhat.com>
+(cherry picked from commit 1e903124cec4492463d075c6c061a2a772db77bf)
+---
+ NEWS       | 2 +-
+ elf/rtld.c | 6 ++++++
+ 2 files changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/NEWS b/NEWS
+index 6d31e5abba..757ded85e0 100644
+--- a/NEWS
++++ b/NEWS
+@@ -14,7 +14,7 @@ The following bugs are resolved with this release:
+   [29485] Linux: Terminate subprocess on late failure in tst-pidfd
+   [29490] alpha: New __brk_call implementation is broken
+   [29528] elf: Call __libc_early_init for reused namespaces
+-
++  [29539] libc: LD_TRACE_LOADED_OBJECTS changed how vDSO library are
+ \f
+ Version 2.36
+ 
+diff --git a/elf/rtld.c b/elf/rtld.c
+index cbbaf4a331..3e771a93d8 100644
+--- a/elf/rtld.c
++++ b/elf/rtld.c
+@@ -2122,6 +2122,12 @@ dl_main (const ElfW(Phdr) *phdr,
+ 	    if (l->l_faked)
+ 	      /* The library was not found.  */
+ 	      _dl_printf ("\t%s => not found\n",  l->l_libname->name);
++	    else if (strcmp (l->l_libname->name, l->l_name) == 0)
++	      /* Print vDSO like libraries without duplicate name.  Some
++		 consumers depend of this format.  */
++	      _dl_printf ("\t%s (0x%0*Zx)\n", l->l_libname->name,
++			  (int) sizeof l->l_map_start * 2,
++			  (size_t) l->l_map_start);
+ 	    else
+ 	      _dl_printf ("\t%s => %s (0x%0*Zx)\n",
+ 			  DSO_FILENAME (l->l_libname->name),
+-- 
+2.38.1
+
+
+From 645d94808aaa90fb1b20a25ff70bb50d9eb1d55b Mon Sep 17 00:00:00 2001
+From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Mon, 5 Sep 2022 09:34:39 -0300
+Subject: syslog: Remove extra whitespace between timestamp and message
+ (BZ#29544)
+
+The rfc3164 clear states that a single space character must follow
+the timestamp field.
+
+Checked on x86_64-linux-gnu.
+---
+ misc/syslog.c     | 2 +-
+ misc/tst-syslog.c | 9 ++++++---
+ 2 files changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/misc/syslog.c b/misc/syslog.c
+index b88f66c835..f67d4b58a4 100644
+--- a/misc/syslog.c
++++ b/misc/syslog.c
+@@ -167,7 +167,7 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
+ 		  _nl_C_locobj_ptr);
+ 
+ #define SYSLOG_HEADER(__pri, __timestamp, __msgoff, pid) \
+-  "<%d>%s %n%s%s%.0d%s: ",                               \
++  "<%d>%s%n%s%s%.0d%s: ",                                \
+   __pri, __timestamp, __msgoff,                          \
+   LogTag == NULL ? __progname : LogTag,                  \
+   "[" + (pid == 0), pid, "]" + (pid == 0)
+diff --git a/misc/tst-syslog.c b/misc/tst-syslog.c
+index 1d332ece53..3560b518a2 100644
+--- a/misc/tst-syslog.c
++++ b/misc/tst-syslog.c
+@@ -275,16 +275,19 @@ parse_syslog_msg (const char *msg)
+ {
+   struct msg_t r = { .pid = -1 };
+   int number;
++  int wsb, wsa;
+ 
+ #define STRINPUT(size)  XSTRINPUT(size)
+ #define XSTRINPUT(size) "%" # size "s"
+ 
+   /* The message in the form:
+-     <179>Apr  8 14:51:19  tst-syslog: message 176 3  */
+-  int n = sscanf (msg, "<%3d>%*s %*d %*d:%*d:%*d " STRINPUT(IDENT_LENGTH)
++     <179>Apr  8 14:51:19 tst-syslog: message 176 3  */
++  int n = sscanf (msg, "<%3d>%*s %*d %*d:%*d:%*d%n %n" STRINPUT(IDENT_LENGTH)
+ 		       " " STRINPUT(MSG_LENGTH) " %*d %*d",
+-                  &number, r.ident, r.msg);
++                  &number, &wsb, &wsa, r.ident, r.msg);
+   TEST_COMPARE (n, 3);
++  /* It should only one space between timestamp and message.  */
++  TEST_COMPARE (wsa - wsb, 1);
+ 
+   r.facility = number & LOG_FACMASK;
+   r.priority = number & LOG_PRIMASK;
+-- 
+2.38.1
+
+
+From b46412fb17e8bfc6c9e1f144bbcf833320c80f8a Mon Sep 17 00:00:00 2001
+From: Siddhesh Poyarekar <siddhesh@sourceware.org>
+Date: Tue, 6 Sep 2022 09:31:50 -0400
+Subject: Add NEWS entry for CVE-2022-39046
+
+(cherry picked from commit 76fe56020e7ef354685b2284580ac1630c078a2b)
+---
+ NEWS | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/NEWS b/NEWS
+index 757ded85e0..10a7613f09 100644
+--- a/NEWS
++++ b/NEWS
+@@ -7,6 +7,13 @@ using `glibc' in the "product" field.
+ \f
+ Version 2.36.1
+ 
++Security related changes:
++
++  CVE-2022-39046: When the syslog function is passed a crafted input
++  string larger than 1024 bytes, it reads uninitialized memory from the
++  heap and prints it to the target log file, potentially revealing a
++  portion of the contents of the heap.
++
+ The following bugs are resolved with this release:
+ 
+   [28846] CMSG_NXTHDR may trigger -Wstrict-overflow warning
+-- 
+2.38.1
+
+
+From c399271c10bd00714504e8d4dfbec8aebf996dd4 Mon Sep 17 00:00:00 2001
+From: Fabian Vogt <fvogt@suse.de>
+Date: Wed, 27 Jul 2022 11:44:07 +0200
+Subject: nscd: Fix netlink cache invalidation if epoll is used [BZ #29415]
+
+Processes cache network interface information such as whether IPv4 or IPv6
+are enabled. This is only checked again if the "netlink timestamp" provided
+by nscd changed, which is triggered by netlink socket activity.
+
+However, in the epoll handler for the netlink socket, it was missed to
+assign the new timestamp to the nscd database. The handler for plain poll
+did that properly, copy that over.
+
+This bug caused that e.g. processes which started before network
+configuration got unusuable addresses from getaddrinfo, like IPv6 only even
+though only IPv4 is available:
+https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1041
+
+It's a bit hard to reproduce, so I verified this by checking the timestamp
+on calls to __check_pf manually. Without this patch it's stuck at 1, now
+it's increasing on network changes as expected.
+
+Signed-off-by: Fabian Vogt <fvogt@suse.de>
+(cherry picked from commit 02ca25fef2785974011e9c5beecc99b900b69fd7)
+---
+ NEWS               | 1 +
+ nscd/connections.c | 3 ++-
+ 2 files changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/NEWS b/NEWS
+index 10a7613f09..9360596fcc 100644
+--- a/NEWS
++++ b/NEWS
+@@ -17,6 +17,7 @@ Security related changes:
+ The following bugs are resolved with this release:
+ 
+   [28846] CMSG_NXTHDR may trigger -Wstrict-overflow warning
++  [29415] nscd: Fix netlink cache invalidation if epoll is used
+   [29446] _dlopen now ignores dl_caller argument in static mode
+   [29485] Linux: Terminate subprocess on late failure in tst-pidfd
+   [29490] alpha: New __brk_call implementation is broken
+diff --git a/nscd/connections.c b/nscd/connections.c
+index 61d1674eb4..531d2e83df 100644
+--- a/nscd/connections.c
++++ b/nscd/connections.c
+@@ -2284,7 +2284,8 @@ main_loop_epoll (int efd)
+ 					     sizeof (buf))) != -1)
+ 	      ;
+ 
+-	    __bump_nl_timestamp ();
++	    dbs[hstdb].head->extra_data[NSCD_HST_IDX_CONF_TIMESTAMP]
++	      = __bump_nl_timestamp ();
+ 	  }
+ # endif
+ 	else
+-- 
+2.38.1
+
+
+From 9d7eebde8f134ea25bdb9ab61bc74d5e71e41288 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 30 Aug 2022 10:02:49 +0200
+Subject: resolv: Add tst-resolv-byaddr for testing reverse lookup
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit 0b99828d54e5d1fc8f5ad3edf5ba262ad2e9c5b0)
+---
+ resolv/Makefile                      |   2 +
+ resolv/tst-resolv-byaddr.c           | 326 +++++++++++++++++++++++++++
+ resolv/tst-resolv-maybe_insert_sig.h |  32 +++
+ 3 files changed, 360 insertions(+)
+ create mode 100644 resolv/tst-resolv-byaddr.c
+ create mode 100644 resolv/tst-resolv-maybe_insert_sig.h
+
+diff --git a/resolv/Makefile b/resolv/Makefile
+index 5b15321f9b..98b10d97a0 100644
+--- a/resolv/Makefile
++++ b/resolv/Makefile
+@@ -91,6 +91,7 @@ tests += \
+   tst-res_hnok \
+   tst-resolv-basic \
+   tst-resolv-binary \
++  tst-resolv-byaddr \
+   tst-resolv-edns \
+   tst-resolv-network \
+   tst-resolv-noaaaa \
+@@ -260,6 +261,7 @@ $(objpfx)tst-resolv-ai_idn-nolibidn2.out: \
+   $(gen-locales) $(objpfx)tst-no-libidn2.so
+ $(objpfx)tst-resolv-basic: $(objpfx)libresolv.so $(shared-thread-library)
+ $(objpfx)tst-resolv-binary: $(objpfx)libresolv.so $(shared-thread-library)
++$(objpfx)tst-resolv-byaddr: $(objpfx)libresolv.so $(shared-thread-library)
+ $(objpfx)tst-resolv-edns: $(objpfx)libresolv.so $(shared-thread-library)
+ $(objpfx)tst-resolv-network: $(objpfx)libresolv.so $(shared-thread-library)
+ $(objpfx)tst-resolv-res_init: $(objpfx)libresolv.so
+diff --git a/resolv/tst-resolv-byaddr.c b/resolv/tst-resolv-byaddr.c
+new file mode 100644
+index 0000000000..6299e89837
+--- /dev/null
++++ b/resolv/tst-resolv-byaddr.c
+@@ -0,0 +1,326 @@
++/* Test reverse DNS lookup.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <arpa/inet.h>
++#include <errno.h>
++#include <netdb.h>
++#include <stdbool.h>
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
++#include <support/check.h>
++#include <support/check_nss.h>
++#include <support/next_to_fault.h>
++#include <support/resolv_test.h>
++#include <support/support.h>
++
++#include "tst-resolv-maybe_insert_sig.h"
++
++/* QNAME format:
++
++   ADDRESSES.CNAMES...(lots of 0s)...8.b.d.0.1.0.0.2.ip6.arpa.
++   CNAMES|ADDRESSES.2.0.192.in-addr-arpa.
++
++   For the IPv4 reverse lookup, the address count is in the lower
++   bits.
++
++   CNAMES is the length of the CNAME chain, ADDRESSES is the number of
++   addresses in the response.  The special value 15 means that there
++   are no addresses, and the RCODE is NXDOMAIN.  */
++static void
++response (const struct resolv_response_context *ctx,
++          struct resolv_response_builder *b,
++          const char *qname, uint16_t qclass, uint16_t qtype)
++{
++  TEST_COMPARE (qclass, C_IN);
++  TEST_COMPARE (qtype, T_PTR);
++
++  unsigned int addresses, cnames, bits;
++  char *tail;
++  if (strstr (qname, "ip6.arpa") != NULL
++      && sscanf (qname, "%x.%x.%ms", &addresses, &cnames, &tail) == 3)
++    TEST_COMPARE_STRING (tail, "\
++0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa");
++  else if (sscanf (qname, "%u.%ms", &bits, &tail) == 2)
++    {
++      TEST_COMPARE_STRING (tail, "2.0.192.in-addr.arpa");
++      addresses = bits & 0x0f;
++      cnames = bits >> 4;
++    }
++  else
++    FAIL_EXIT1 ("invalid QNAME: %s", qname);
++  free (tail);
++
++  int rcode;
++  if (addresses == 15)
++    {
++      /* Special case: Use no addresses with NXDOMAIN response.  */
++      rcode = ns_r_nxdomain;
++      addresses = 0;
++    }
++  else
++    rcode = 0;
++
++  struct resolv_response_flags flags = { .rcode = rcode };
++  resolv_response_init (b, flags);
++  resolv_response_add_question (b, qname, qclass, qtype);
++  resolv_response_section (b, ns_s_an);
++  maybe_insert_sig (b, qname);
++
++  /* Provide the requested number of CNAME records.  */
++  char *previous_name = (char *) qname;
++  for (int unique = 0; unique < cnames; ++unique)
++    {
++      resolv_response_open_record (b, previous_name, qclass, T_CNAME, 60);
++      char *new_name = xasprintf ("%d.alias.example", unique);
++      resolv_response_add_name (b, new_name);
++      resolv_response_close_record (b);
++
++      maybe_insert_sig (b, qname);
++
++      if (previous_name != qname)
++        free (previous_name);
++      previous_name = new_name;
++    }
++
++  for (int unique = 0; unique < addresses; ++unique)
++    {
++      resolv_response_open_record (b, previous_name, qclass, T_PTR, 60);
++      char *ptr = xasprintf ("unique-%d.cnames-%u.addresses-%u.example",
++                             unique, cnames, addresses);
++      resolv_response_add_name (b, ptr);
++      free (ptr);
++      resolv_response_close_record (b);
++    }
++
++  if (previous_name != qname)
++    free (previous_name);
++}
++
++/* Used to check that gethostbyaddr_r does not write past the buffer
++   end.  */
++static struct support_next_to_fault ntf;
++
++/* Perform a gethostbyaddr call and check the result.  */
++static void
++check_gethostbyaddr (const char *address, const char *expected)
++{
++  unsigned char bytes[16];
++  unsigned int byteslen;
++  int family;
++  if (strchr (address, ':') != NULL)
++    {
++      family = AF_INET6;
++      byteslen = 16;
++    }
++  else
++    {
++      family = AF_INET;
++      byteslen = 4;
++    }
++  TEST_COMPARE (inet_pton (family, address, bytes), 1);
++
++  struct hostent *e = gethostbyaddr (bytes, byteslen, family);
++  check_hostent (address, e, expected);
++
++  if (e == NULL)
++    return;
++
++  /* Try gethostbyaddr_r with increasing sizes until success.  First
++     compute a reasonable minimum buffer size, to avoid many pointless
++     attempts.  */
++  size_t minimum_size = strlen (e->h_name);
++  for (int i = 0; e->h_addr_list[i] != NULL; ++i)
++    minimum_size += e->h_length + sizeof (char *);
++  for (int i = 0; e->h_aliases[i] != NULL; ++i)
++    minimum_size += strlen (e->h_aliases[i]) + 1 + sizeof (char *);
++
++  /* Gradually increase the size until success.  */
++  for (size_t size = minimum_size; size < ntf.length; ++size)
++    {
++      struct hostent result;
++      int herrno;
++      int ret = gethostbyaddr_r (bytes, byteslen, family, &result,
++                                 ntf.buffer + ntf.length - size, size,
++                                 &e, &herrno);
++      if (ret == ERANGE)
++        /* Retry with larger size.  */
++        TEST_COMPARE (herrno, NETDB_INTERNAL);
++      else if (ret == 0)
++        {
++         TEST_VERIFY (size > minimum_size);
++         check_hostent (address, e, expected);
++         return;
++        }
++      else
++        FAIL_EXIT1 ("Unexpected gethostbyaddr_r failure: %d", ret);
++    }
++
++  FAIL_EXIT1 ("gethostbyaddr_r always failed for: %s", address);
++}
++
++/* Perform a getnameinfo call and check the result.  */
++static void
++check_getnameinfo (const char *address, const char *expected)
++{
++  struct sockaddr_in sin = { };
++  struct sockaddr_in6 sin6 = { };
++  void *sa;
++  socklen_t salen;
++  if (strchr (address, ':') != NULL)
++    {
++      sin6.sin6_family = AF_INET6;
++      TEST_COMPARE (inet_pton (AF_INET6, address, &sin6.sin6_addr), 1);
++      sin6.sin6_port = htons (80);
++      sa = &sin6;
++      salen = sizeof (sin6);
++    }
++  else
++    {
++      sin.sin_family = AF_INET;
++      TEST_COMPARE (inet_pton (AF_INET, address, &sin.sin_addr), 1);
++      sin.sin_port = htons (80);
++      sa = &sin;
++      salen = sizeof (sin);
++    }
++
++  char host[64];
++  char service[64];
++  int ret = getnameinfo (sa, salen, host,
++                         sizeof (host), service, sizeof (service),
++                         NI_NAMEREQD | NI_NUMERICSERV);
++  switch (ret)
++    {
++    case 0:
++      TEST_COMPARE_STRING (host, expected);
++      TEST_COMPARE_STRING (service, "80");
++      break;
++    case EAI_SYSTEM:
++      TEST_COMPARE_STRING (strerror (errno), expected);
++      break;
++    default:
++      TEST_COMPARE_STRING (gai_strerror (ret), expected);
++    }
++}
++
++static int
++do_test (void)
++{
++  /* Some reasonably upper bound for the maximum response size.  */
++  ntf = support_next_to_fault_allocate (4096);
++
++  struct resolv_test *obj = resolv_test_start
++    ((struct resolv_redirect_config)
++     {
++       .response_callback = response
++     });
++
++  for (int do_insert_sig = 0; do_insert_sig < 2; ++do_insert_sig)
++    {
++      insert_sig = do_insert_sig;
++
++      /* No PTR record, RCODE=0.  */
++      check_gethostbyaddr ("192.0.2.0", "error: NO_RECOVERY\n");
++      check_getnameinfo ("192.0.2.0", "Name or service not known");
++      check_gethostbyaddr ("192.0.2.16", "error: NO_RECOVERY\n");
++      check_getnameinfo ("192.0.2.16", "Name or service not known");
++      check_gethostbyaddr ("192.0.2.32", "error: NO_RECOVERY\n");
++      check_getnameinfo ("192.0.2.32", "Name or service not known");
++      check_gethostbyaddr ("2001:db8::", "error: NO_RECOVERY\n");
++      check_getnameinfo ("2001:db8::", "Name or service not known");
++      check_gethostbyaddr ("2001:db8::10", "error: NO_RECOVERY\n");
++      check_getnameinfo ("2001:db8::10", "Name or service not known");
++      check_gethostbyaddr ("2001:db8::20", "error: NO_RECOVERY\n");
++      check_getnameinfo ("2001:db8::20", "Name or service not known");
++
++      /* No PTR record, NXDOMAIN.  */
++      check_gethostbyaddr ("192.0.2.15", "error: HOST_NOT_FOUND\n");
++      check_getnameinfo ("192.0.2.15", "Name or service not known");
++      check_gethostbyaddr ("192.0.2.31", "error: HOST_NOT_FOUND\n");
++      check_getnameinfo ("192.0.2.31", "Name or service not known");
++      check_gethostbyaddr ("192.0.2.47", "error: HOST_NOT_FOUND\n");
++      check_getnameinfo ("192.0.2.47", "Name or service not known");
++      check_gethostbyaddr ("2001:db8::f", "error: HOST_NOT_FOUND\n");
++      check_getnameinfo ("2001:db8::f", "Name or service not known");
++      check_gethostbyaddr ("2001:db8::1f", "error: HOST_NOT_FOUND\n");
++      check_getnameinfo ("2001:db8::1f", "Name or service not known");
++      check_gethostbyaddr ("2001:db8::2f", "error: HOST_NOT_FOUND\n");
++      check_getnameinfo ("2001:db8::2f", "Name or service not known");
++
++      /* Actual response data.  Only the first PTR record is returned.  */
++      check_gethostbyaddr ("192.0.2.1",
++                           "name: unique-0.cnames-0.addresses-1.example\n"
++                           "address: 192.0.2.1\n");
++      check_getnameinfo ("192.0.2.1",
++                         "unique-0.cnames-0.addresses-1.example");
++      check_gethostbyaddr ("192.0.2.17",
++                           "name: unique-0.cnames-1.addresses-1.example\n"
++                           "address: 192.0.2.17\n");
++      check_getnameinfo ("192.0.2.17",
++                         "unique-0.cnames-1.addresses-1.example");
++      check_gethostbyaddr ("192.0.2.18",
++                           "name: unique-0.cnames-1.addresses-2.example\n"
++                           "address: 192.0.2.18\n");
++      check_getnameinfo ("192.0.2.18",
++                         "unique-0.cnames-1.addresses-2.example");
++      check_gethostbyaddr ("192.0.2.33",
++                           "name: unique-0.cnames-2.addresses-1.example\n"
++                           "address: 192.0.2.33\n");
++      check_getnameinfo ("192.0.2.33",
++                         "unique-0.cnames-2.addresses-1.example");
++      check_gethostbyaddr ("192.0.2.34",
++                           "name: unique-0.cnames-2.addresses-2.example\n"
++                           "address: 192.0.2.34\n");
++      check_getnameinfo ("192.0.2.34",
++                         "unique-0.cnames-2.addresses-2.example");
++
++      /* Same for IPv6 addresses.  */
++      check_gethostbyaddr ("2001:db8::1",
++                           "name: unique-0.cnames-0.addresses-1.example\n"
++                           "address: 2001:db8::1\n");
++      check_getnameinfo ("2001:db8::1",
++                         "unique-0.cnames-0.addresses-1.example");
++      check_gethostbyaddr ("2001:db8::11",
++                           "name: unique-0.cnames-1.addresses-1.example\n"
++                           "address: 2001:db8::11\n");
++      check_getnameinfo ("2001:db8::11",
++                         "unique-0.cnames-1.addresses-1.example");
++      check_gethostbyaddr ("2001:db8::12",
++                           "name: unique-0.cnames-1.addresses-2.example\n"
++                           "address: 2001:db8::12\n");
++      check_getnameinfo ("2001:db8::12",
++                         "unique-0.cnames-1.addresses-2.example");
++      check_gethostbyaddr ("2001:db8::21",
++                           "name: unique-0.cnames-2.addresses-1.example\n"
++                           "address: 2001:db8::21\n");
++      check_getnameinfo ("2001:db8::21",
++                         "unique-0.cnames-2.addresses-1.example");
++      check_gethostbyaddr ("2001:db8::22",
++                           "name: unique-0.cnames-2.addresses-2.example\n"
++                           "address: 2001:db8::22\n");
++      check_getnameinfo ("2001:db8::22",
++                         "unique-0.cnames-2.addresses-2.example");
++    }
++
++  resolv_test_end (obj);
++
++  support_next_to_fault_free (&ntf);
++  return 0;
++}
++
++#include <support/test-driver.c>
+diff --git a/resolv/tst-resolv-maybe_insert_sig.h b/resolv/tst-resolv-maybe_insert_sig.h
+new file mode 100644
+index 0000000000..05725225af
+--- /dev/null
++++ b/resolv/tst-resolv-maybe_insert_sig.h
+@@ -0,0 +1,32 @@
++/* Code snippet for optionally inserting ignored SIG records in resolver tests.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++/* Set to true for an alternative pass that inserts (ignored) SIG
++   records.  This does not alter the response, so this property is not
++   encoded in the QNAME.  The variable needs to be volatile because
++   leaf attributes tell GCC that the response function is not
++   called.  */
++static volatile bool insert_sig;
++
++static void
++maybe_insert_sig (struct resolv_response_builder *b, const char *owner)
++{
++  resolv_response_open_record (b, owner, C_IN, T_SIG, 60);
++  resolv_response_add_data (b, "", 1);
++  resolv_response_close_record (b);
++}
+-- 
+2.38.1
+
+
+From bffc33e90ed57a4786c676dda92d935e3613e031 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 30 Aug 2022 10:02:49 +0200
+Subject: resolv: Add tst-resolv-aliases
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit 87aa98aa80627553a66bdcad2701fd6307723645)
+---
+ resolv/Makefile             |   2 +
+ resolv/tst-resolv-aliases.c | 254 ++++++++++++++++++++++++++++++++++++
+ 2 files changed, 256 insertions(+)
+ create mode 100644 resolv/tst-resolv-aliases.c
+
+diff --git a/resolv/Makefile b/resolv/Makefile
+index 98b10d97a0..0038bb7028 100644
+--- a/resolv/Makefile
++++ b/resolv/Makefile
+@@ -89,6 +89,7 @@ tests += \
+   tst-ns_name_pton \
+   tst-res_hconf_reorder \
+   tst-res_hnok \
++  tst-resolv-aliases \
+   tst-resolv-basic \
+   tst-resolv-binary \
+   tst-resolv-byaddr \
+@@ -259,6 +260,7 @@ $(objpfx)tst-resolv-ai_idn.out: $(gen-locales)
+ $(objpfx)tst-resolv-ai_idn-latin1.out: $(gen-locales)
+ $(objpfx)tst-resolv-ai_idn-nolibidn2.out: \
+   $(gen-locales) $(objpfx)tst-no-libidn2.so
++$(objpfx)tst-resolv-aliases: $(objpfx)libresolv.so $(shared-thread-library)
+ $(objpfx)tst-resolv-basic: $(objpfx)libresolv.so $(shared-thread-library)
+ $(objpfx)tst-resolv-binary: $(objpfx)libresolv.so $(shared-thread-library)
+ $(objpfx)tst-resolv-byaddr: $(objpfx)libresolv.so $(shared-thread-library)
+diff --git a/resolv/tst-resolv-aliases.c b/resolv/tst-resolv-aliases.c
+new file mode 100644
+index 0000000000..b212823aa0
+--- /dev/null
++++ b/resolv/tst-resolv-aliases.c
+@@ -0,0 +1,254 @@
++/* Test alias handling (mainly for gethostbyname).
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <array_length.h>
++#include <arpa/inet.h>
++#include <netdb.h>
++#include <stdbool.h>
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
++#include <support/check.h>
++#include <support/check_nss.h>
++#include <support/resolv_test.h>
++#include <support/support.h>
++
++#include "tst-resolv-maybe_insert_sig.h"
++
++/* QNAME format:
++
++   aADDRESSES-cCNAMES.example.net
++
++   CNAMES is the length of the CNAME chain, ADDRESSES is the number of
++   addresses in the response.  The special value 255 means that there
++   are no addresses, and the RCODE is NXDOMAIN.  */
++static void
++response (const struct resolv_response_context *ctx,
++          struct resolv_response_builder *b,
++          const char *qname, uint16_t qclass, uint16_t qtype)
++{
++  TEST_COMPARE (qclass, C_IN);
++  if (qtype != T_A)
++    TEST_COMPARE (qtype, T_AAAA);
++
++  unsigned int addresses, cnames;
++  char *tail;
++  if (sscanf (qname, "a%u-c%u%ms", &addresses, &cnames, &tail) == 3)
++    {
++      if (strcmp (tail, ".example.com") == 0
++          || strcmp (tail, ".example.net.example.net") == 0
++          || strcmp (tail, ".example.net.example.com") == 0)
++        /* These only happen after NXDOMAIN.  */
++        TEST_VERIFY (addresses == 255);
++      else if (strcmp (tail, ".example.net") != 0)
++        FAIL_EXIT1 ("invalid QNAME: %s", qname);
++    }
++  free (tail);
++
++  int rcode;
++  if (addresses == 255)
++    {
++      /* Special case: Use no addresses with NXDOMAIN response.  */
++      rcode = ns_r_nxdomain;
++      addresses = 0;
++    }
++  else
++    rcode = 0;
++
++  struct resolv_response_flags flags = { .rcode = rcode };
++  resolv_response_init (b, flags);
++  resolv_response_add_question (b, qname, qclass, qtype);
++  resolv_response_section (b, ns_s_an);
++  maybe_insert_sig (b, qname);
++
++  /* Provide the requested number of CNAME records.  */
++  char *previous_name = (char *) qname;
++  for (int unique = 0; unique < cnames; ++unique)
++    {
++      resolv_response_open_record (b, previous_name, qclass, T_CNAME, 60);
++      char *new_name = xasprintf ("%d.alias.example", unique);
++      resolv_response_add_name (b, new_name);
++      resolv_response_close_record (b);
++
++      maybe_insert_sig (b, qname);
++
++      if (previous_name != qname)
++        free (previous_name);
++      previous_name = new_name;
++    }
++
++  for (int unique = 0; unique < addresses; ++unique)
++    {
++      resolv_response_open_record (b, previous_name, qclass, qtype, 60);
++
++      if (qtype == T_A)
++        {
++          char ipv4[4] = {192, 0, 2, 1 + unique};
++          resolv_response_add_data (b, &ipv4, sizeof (ipv4));
++        }
++      else if (qtype == T_AAAA)
++        {
++          char ipv6[16] =
++            {
++              0x20, 0x01, 0xd, 0xb8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
++              1 + unique
++            };
++          resolv_response_add_data (b, &ipv6, sizeof (ipv6));
++        }
++      resolv_response_close_record (b);
++    }
++
++  if (previous_name != qname)
++    free (previous_name);
++}
++
++static char *
++make_qname (bool do_search, int cnames, int addresses)
++{
++  return xasprintf ("a%d-c%d%s",
++                    addresses, cnames, do_search ? "" : ".example.net");
++}
++
++static void
++check_cnames_failure (int af, bool do_search, int cnames, int addresses)
++{
++  char *qname = make_qname (do_search, cnames, addresses);
++
++  struct hostent *e;
++  if (af == AF_UNSPEC)
++    e = gethostbyname (qname);
++  else
++    e = gethostbyname2 (qname, af);
++
++  if (addresses == 0)
++    check_hostent (qname, e, "error: NO_RECOVERY\n");
++  else
++    check_hostent (qname, e, "error: HOST_NOT_FOUND\n");
++
++  free (qname);
++}
++
++static void
++check (int af, bool do_search, int cnames, int addresses)
++{
++  char *qname = make_qname (do_search, cnames, addresses);
++  char *fqdn = make_qname (false, cnames, addresses);
++
++  struct hostent *e;
++  if (af == AF_UNSPEC)
++    e = gethostbyname (qname);
++  else
++    e = gethostbyname2 (qname, af);
++  if (e == NULL)
++    FAIL_EXIT1 ("unexpected failure for %d, %d, %d", af, cnames, addresses);
++
++  if (af == AF_UNSPEC || af == AF_INET)
++    {
++      TEST_COMPARE (e->h_addrtype, AF_INET);
++      TEST_COMPARE (e->h_length, 4);
++    }
++  else
++    {
++      TEST_COMPARE (e->h_addrtype, AF_INET6);
++      TEST_COMPARE (e->h_length, 16);
++    }
++
++  for (int i = 0; i < addresses; ++i)
++    {
++      char ipv4[4] = {192, 0, 2, 1 + i};
++      char ipv6[16] =
++        { 0x20, 0x01, 0xd, 0xb8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 + i };
++      char *expected = e->h_addrtype == AF_INET ? ipv4 : ipv6;
++      TEST_COMPARE_BLOB (e->h_addr_list[i], e->h_length,
++                         expected, e->h_length);
++    }
++  TEST_VERIFY (e->h_addr_list[addresses] == NULL);
++
++
++  if (cnames == 0)
++    {
++      /* QNAME is fully qualified.  */
++      TEST_COMPARE_STRING (e->h_name, fqdn);
++      TEST_VERIFY (e->h_aliases[0] == NULL);
++    }
++  else
++   {
++     /* Fully-qualified QNAME is demoted to an aliases.  */
++     TEST_COMPARE_STRING (e->h_aliases[0], fqdn);
++
++     for (int i = 1; i <= cnames; ++i)
++       {
++         char *expected = xasprintf ("%d.alias.example", i - 1);
++         if (i == cnames)
++           TEST_COMPARE_STRING (e->h_name, expected);
++         else
++           TEST_COMPARE_STRING (e->h_aliases[i], expected);
++         free (expected);
++       }
++     TEST_VERIFY (e->h_aliases[cnames] == NULL);
++   }
++
++  free (fqdn);
++  free (qname);
++}
++
++static int
++do_test (void)
++{
++  struct resolv_test *obj = resolv_test_start
++    ((struct resolv_redirect_config)
++     {
++       .response_callback = response,
++       .search = { "example.net", "example.com" },
++     });
++
++  static const int families[] = { AF_UNSPEC, AF_INET, AF_INET6 };
++
++  for (int do_insert_sig = 0; do_insert_sig < 2; ++do_insert_sig)
++    {
++      insert_sig = do_insert_sig;
++
++      /* If do_search is true, a bare host name (for example, a1-c1)
++         is used.  This exercises search path processing and FQDN
++         qualification.  */
++      for (int do_search = 0; do_search < 2; ++do_search)
++        for (const int *paf = families; paf != array_end (families); ++paf)
++          {
++            for (int cnames = 0; cnames <= 100; ++cnames)
++              {
++                check_cnames_failure (*paf, do_search, cnames, 0);
++                /* Now with NXDOMAIN responses.  */
++                check_cnames_failure (*paf, do_search, cnames, 255);
++              }
++
++            for (int cnames = 0; cnames <= 10; ++cnames)
++              for (int addresses = 1; addresses <= 10; ++addresses)
++                check (*paf, do_search, cnames, addresses);
++
++            /* The current implementation is limited to 47 aliases.
++               Addresses do not have such a limit.  */
++            check (*paf, do_search, 47, 60);
++          }
++    }
++
++  resolv_test_end (obj);
++
++  return 0;
++}
++
++#include <support/test-driver.c>
+-- 
+2.38.1
+
+
+From 3c9b4004e2dccc9ca2ace078a0106f9d682fd1a0 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 30 Aug 2022 10:02:49 +0200
+Subject: resolv: Add internal __res_binary_hnok function
+
+During package parsing, only the binary representation is available,
+and it is convenient to check that directly for conformance with host
+name requirements.
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit c79327bf00a4be6d60259227acc78ef80ead3622)
+---
+ include/resolv.h           |  3 +++
+ resolv/res-name-checking.c | 14 +++++++++-----
+ 2 files changed, 12 insertions(+), 5 deletions(-)
+
+diff --git a/include/resolv.h b/include/resolv.h
+index 3590b6f496..4dbbac3800 100644
+--- a/include/resolv.h
++++ b/include/resolv.h
+@@ -70,5 +70,8 @@ libc_hidden_proto (__libc_res_nameinquery)
+ extern __typeof (__res_queriesmatch) __libc_res_queriesmatch;
+ libc_hidden_proto (__libc_res_queriesmatch)
+ 
++/* Variant of res_hnok which operates on binary (but uncompressed) names.  */
++bool __res_binary_hnok (const unsigned char *dn) attribute_hidden;
++
+ # endif /* _RESOLV_H_ && !_ISOMAC */
+ #endif
+diff --git a/resolv/res-name-checking.c b/resolv/res-name-checking.c
+index 07a412d8ff..213edceaf3 100644
+--- a/resolv/res-name-checking.c
++++ b/resolv/res-name-checking.c
+@@ -138,6 +138,12 @@ binary_leading_dash (const unsigned char *dn)
+   return dn[0] > 0 && dn[1] == '-';
+ }
+ 
++bool
++__res_binary_hnok (const unsigned char *dn)
++{
++  return !binary_leading_dash (dn) && binary_hnok (dn);
++}
++
+ /* Return 1 if res_hnok is a valid host name.  Labels must only
+    contain [0-9a-zA-Z_-] characters, and the name must not start with
+    a '-'.  The latter is to avoid confusion with program options.  */
+@@ -145,11 +151,9 @@ int
+ ___res_hnok (const char *dn)
+ {
+   unsigned char buf[NS_MAXCDNAME];
+-  if (!printable_string (dn)
+-      || __ns_name_pton (dn, buf, sizeof (buf)) < 0
+-      || binary_leading_dash (buf))
+-    return 0;
+-  return binary_hnok (buf);
++  return (printable_string (dn)
++	  && __ns_name_pton (dn, buf, sizeof (buf)) >= 0
++	  && __res_binary_hnok (buf));
+ }
+ versioned_symbol (libc, ___res_hnok, res_hnok, GLIBC_2_34);
+ versioned_symbol (libc, ___res_hnok, __libc_res_hnok, GLIBC_PRIVATE);
+-- 
+2.38.1
+
+
+From 20ec40a51d3a8e9487f40dc9352d158def23ea8c Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 30 Aug 2022 10:02:49 +0200
+Subject: resolv: Add the __ns_samebinaryname function
+
+During packet parsing, only the binary name is available.  If the name
+equality check is performed before conversion to text, we can sometimes
+skip the last step.
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit 394085a34d25a51513019a4dc411acd3527fbd33)
+---
+ include/arpa/nameser.h         |  6 ++++
+ resolv/Makefile                |  5 +++
+ resolv/ns_samebinaryname.c     | 55 ++++++++++++++++++++++++++++++
+ resolv/tst-ns_samebinaryname.c | 62 ++++++++++++++++++++++++++++++++++
+ 4 files changed, 128 insertions(+)
+ create mode 100644 resolv/ns_samebinaryname.c
+ create mode 100644 resolv/tst-ns_samebinaryname.c
+
+diff --git a/include/arpa/nameser.h b/include/arpa/nameser.h
+index 53f1dbc7c3..bb1dede187 100644
+--- a/include/arpa/nameser.h
++++ b/include/arpa/nameser.h
+@@ -55,6 +55,12 @@ int __ns_name_ntop (const unsigned char *, char *, size_t) __THROW;
+ int __ns_name_unpack (const unsigned char *, const unsigned char *,
+ 		      const unsigned char *, unsigned char *, size_t) __THROW;
+ 
++/* Like ns_samename, but for uncompressed binary names.  Return true
++   if the two arguments compare are equal as case-insensitive domain
++   names.  */
++_Bool __ns_samebinaryname (const unsigned char *, const unsigned char *)
++  attribute_hidden;
++
+ #define ns_msg_getflag(handle, flag) \
+   (((handle)._flags & _ns_flagdata[flag].mask) >> _ns_flagdata[flag].shift)
+ 
+diff --git a/resolv/Makefile b/resolv/Makefile
+index 0038bb7028..ec61ad07bd 100644
+--- a/resolv/Makefile
++++ b/resolv/Makefile
+@@ -46,6 +46,7 @@ routines := \
+   ns_name_skip \
+   ns_name_uncompress \
+   ns_name_unpack \
++  ns_samebinaryname \
+   ns_samename \
+   nsap_addr \
+   nss_dns_functions \
+@@ -106,6 +107,10 @@ tests += \
+ tests-internal += tst-resolv-txnid-collision
+ tests-static += tst-resolv-txnid-collision
+ 
++# Likewise for __ns_samebinaryname.
++tests-internal += tst-ns_samebinaryname
++tests-static += tst-ns_samebinaryname
++
+ # These tests need libdl.
+ ifeq (yes,$(build-shared))
+ tests += \
+diff --git a/resolv/ns_samebinaryname.c b/resolv/ns_samebinaryname.c
+new file mode 100644
+index 0000000000..9a47d8e97a
+--- /dev/null
++++ b/resolv/ns_samebinaryname.c
+@@ -0,0 +1,55 @@
++/* Compare two binary domain names for quality.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <arpa/nameser.h>
++#include <stdbool.h>
++
++/* Convert ASCII letters to upper case.  */
++static inline int
++ascii_toupper (unsigned char ch)
++{
++  if (ch >= 'a' && ch <= 'z')
++    return ch - 'a' + 'A';
++  else
++    return ch;
++}
++
++bool
++__ns_samebinaryname (const unsigned char *a, const unsigned char *b)
++{
++  while (*a != 0 && *b != 0)
++    {
++      if (*a != *b)
++        /* Different label length.  */
++        return false;
++      int labellen = *a;
++      ++a;
++      ++b;
++      for (int i = 0; i < labellen; ++i)
++        {
++          if (*a != *b && ascii_toupper (*a) != ascii_toupper (*b))
++            /* Different character in label.  */
++            return false;
++          ++a;
++          ++b;
++        }
++    }
++
++  /* Match if both names are at the root label.  */
++  return *a == 0 && *b == 0;
++}
+diff --git a/resolv/tst-ns_samebinaryname.c b/resolv/tst-ns_samebinaryname.c
+new file mode 100644
+index 0000000000..b06ac610b4
+--- /dev/null
++++ b/resolv/tst-ns_samebinaryname.c
+@@ -0,0 +1,62 @@
++/* Test the __ns_samebinaryname function.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <arpa/nameser.h>
++#include <array_length.h>
++#include <stdbool.h>
++#include <stdio.h>
++#include <support/check.h>
++
++/* First character denotes the comparison group: All names with the
++   same first character are expected to compare equal.  */
++static const char *const cases[] =
++  {
++    " ",
++    "1\001a", "1\001A",
++    "2\002ab", "2\002aB", "2\002Ab", "2\002AB",
++    "3\001a\002ab", "3\001A\002ab",
++    "w\003www\007example\003com", "w\003Www\007Example\003Com",
++    "w\003WWW\007EXAMPLE\003COM",
++    "W\003WWW", "W\003www",
++  };
++
++static int
++do_test (void)
++{
++  for (int i = 0; i < array_length (cases); ++i)
++    for (int j = 0; j < array_length (cases); ++j)
++      {
++        unsigned char *a = (unsigned char *) &cases[i][1];
++        unsigned char *b = (unsigned char *) &cases[j][1];
++        bool actual = __ns_samebinaryname (a, b);
++        bool expected = cases[i][0] == cases[j][0];
++        if (actual != expected)
++          {
++            char a1[NS_MAXDNAME];
++            TEST_VERIFY (ns_name_ntop (a, a1, sizeof (a1)) > 0);
++            char b1[NS_MAXDNAME];
++            TEST_VERIFY (ns_name_ntop (b, b1, sizeof (b1)) > 0);
++            printf ("error: \"%s\" \"%s\": expected %s\n",
++                    a1, b1, expected ? "equal" : "unqueal");
++            support_record_failure ();
++          }
++      }
++  return 0;
++}
++
++#include <support/test-driver.c>
+-- 
+2.38.1
+
+
+From adb69f8ffe83db5d475868b42996bc70de8cff77 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 30 Aug 2022 10:02:49 +0200
+Subject: resolv: Add internal __ns_name_length_uncompressed function
+
+This function is useful for checking that the question name is
+uncompressed (as it should be).
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit 78b1a4f0e49064e5dfb686c7cd87bd4df2640b29)
+---
+ include/arpa/nameser.h                   |   8 ++
+ resolv/Makefile                          |   5 +
+ resolv/ns_name_length_uncompressed.c     |  72 ++++++++++++
+ resolv/tst-ns_name_length_uncompressed.c | 135 +++++++++++++++++++++++
+ 4 files changed, 220 insertions(+)
+ create mode 100644 resolv/ns_name_length_uncompressed.c
+ create mode 100644 resolv/tst-ns_name_length_uncompressed.c
+
+diff --git a/include/arpa/nameser.h b/include/arpa/nameser.h
+index bb1dede187..6e4808f00d 100644
+--- a/include/arpa/nameser.h
++++ b/include/arpa/nameser.h
+@@ -95,5 +95,13 @@ libc_hidden_proto (__ns_name_unpack)
+ extern __typeof (ns_samename) __libc_ns_samename;
+ libc_hidden_proto (__libc_ns_samename)
+ 
++/* Packet parser helper functions.  */
++
++/* Verify that P points to an uncompressed domain name in wire format.
++   On success, return the length of the encoded name, including the
++   terminating null byte.  On failure, return -1 and set errno.  EOM
++   must point one past the last byte in the packet.  */
++int __ns_name_length_uncompressed (const unsigned char *p,
++				   const unsigned char *eom) attribute_hidden;
+ # endif /* !_ISOMAC */
+ #endif
+diff --git a/resolv/Makefile b/resolv/Makefile
+index ec61ad07bd..bf28825f60 100644
+--- a/resolv/Makefile
++++ b/resolv/Makefile
+@@ -40,6 +40,7 @@ routines := \
+   inet_pton \
+   ns_makecanon \
+   ns_name_compress \
++  ns_name_length_uncompressed \
+   ns_name_ntop \
+   ns_name_pack \
+   ns_name_pton \
+@@ -111,6 +112,10 @@ tests-static += tst-resolv-txnid-collision
+ tests-internal += tst-ns_samebinaryname
+ tests-static += tst-ns_samebinaryname
+ 
++# Likewise for __ns_name_length_uncompressed.
++tests-internal += tst-ns_name_length_uncompressed
++tests-static += tst-ns_name_length_uncompressed
++
+ # These tests need libdl.
+ ifeq (yes,$(build-shared))
+ tests += \
+diff --git a/resolv/ns_name_length_uncompressed.c b/resolv/ns_name_length_uncompressed.c
+new file mode 100644
+index 0000000000..51296b47ef
+--- /dev/null
++++ b/resolv/ns_name_length_uncompressed.c
+@@ -0,0 +1,72 @@
++/* Skip over an uncompressed name in wire format.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <arpa/nameser.h>
++#include <errno.h>
++#include <stdbool.h>
++
++int
++__ns_name_length_uncompressed (const unsigned char *p,
++                                const unsigned char *eom)
++{
++  const unsigned char *start = p;
++
++  while (true)
++    {
++      if (p == eom)
++        {
++          /* Truncated packet: no room for label length.  */
++          __set_errno (EMSGSIZE);
++          return -1;
++        }
++
++      unsigned char b = *p;
++      ++p;
++      if (b == 0)
++        {
++          /* Root label.  */
++          size_t length = p - start;
++          if (length > NS_MAXCDNAME)
++            {
++              /* Domain name too long.  */
++              __set_errno (EMSGSIZE);
++              return -1;
++            }
++          return length;
++        }
++
++      if (b <= 63)
++        {
++          /* Regular label.  */
++          if (b <= eom - p)
++            p += b;
++          else
++            {
++              /* Truncated packet: label incomplete.  */
++              __set_errno (EMSGSIZE);
++              return -1;
++            }
++        }
++      else
++        {
++          /* Compression reference or corrupted label length.  */
++          __set_errno (EMSGSIZE);
++          return -1;
++        }
++    }
++}
+diff --git a/resolv/tst-ns_name_length_uncompressed.c b/resolv/tst-ns_name_length_uncompressed.c
+new file mode 100644
+index 0000000000..c4a2904db7
+--- /dev/null
++++ b/resolv/tst-ns_name_length_uncompressed.c
+@@ -0,0 +1,135 @@
++/* Test __ns_name_length_uncompressed.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <arpa/nameser.h>
++#include <array_length.h>
++#include <errno.h>
++#include <stdio.h>
++#include <support/check.h>
++#include <support/next_to_fault.h>
++
++/* Reference implementation based on other building blocks.  */
++static int
++reference_length (const unsigned char *p, const unsigned char *eom)
++{
++  unsigned char buf[NS_MAXCDNAME];
++  int n = __ns_name_unpack (p, eom, p, buf, sizeof (buf));
++  if (n < 0)
++    return n;
++  const unsigned char *q = buf;
++  if (__ns_name_skip (&q, array_end (buf)) < 0)
++    return -1;
++  if (q - buf != n)
++    /* Compressed name.  */
++    return -1;
++  return n;
++}
++
++static int
++do_test (void)
++{
++  {
++    unsigned char buf[] = { 3, 'w', 'w', 'w', 0, 0, 0 };
++    TEST_COMPARE (reference_length (buf, array_end (buf)), sizeof (buf) - 2);
++    TEST_COMPARE (__ns_name_length_uncompressed (buf, array_end (buf)),
++                  sizeof (buf) - 2);
++    TEST_COMPARE (reference_length (array_end (buf) - 1, array_end (buf)), 1);
++    TEST_COMPARE (__ns_name_length_uncompressed (array_end (buf) - 1,
++                                                 array_end (buf)), 1);
++    buf[4]  = 0xc0;             /* Forward compression reference.  */
++    buf[5]  = 0x06;
++    TEST_COMPARE (reference_length (buf, array_end (buf)), -1);
++    TEST_COMPARE (__ns_name_length_uncompressed (buf, array_end (buf)), -1);
++  }
++
++  struct support_next_to_fault ntf = support_next_to_fault_allocate (300);
++
++  /* Buffer region with all possible bytes at start and end.  */
++  for (int length = 1; length <= 300; ++length)
++    {
++      unsigned char *end = (unsigned char *) ntf.buffer + ntf.length;
++      unsigned char *start = end - length;
++      memset (start, 'X', length);
++      for (int first = 0; first <= 255; ++first)
++        {
++          *start = first;
++          for (int last = 0; last <= 255; ++last)
++            {
++              start[length - 1] = last;
++              TEST_COMPARE (reference_length (start, end),
++                            __ns_name_length_uncompressed (start, end));
++            }
++        }
++    }
++
++  /* Poor man's fuzz testing: patch two bytes.   */
++  {
++    unsigned char ref[] =
++      {
++        7, 'e', 'x', 'a', 'm', 'p', 'l', 'e', 3, 'n', 'e', 't', 0, 0, 0
++      };
++    TEST_COMPARE (reference_length (ref, array_end (ref)), 13);
++    TEST_COMPARE (__ns_name_length_uncompressed (ref, array_end (ref)), 13);
++
++    int good = 0;
++    int bad = 0;
++    for (int length = 1; length <= sizeof (ref); ++length)
++      {
++        unsigned char *end = (unsigned char *) ntf.buffer + ntf.length;
++        unsigned char *start = end - length;
++        memcpy (start, ref, length);
++
++        for (int patch1_pos = 0; patch1_pos < length; ++patch1_pos)
++          {
++            for (int patch1_value = 0; patch1_value <= 255; ++patch1_value)
++              {
++                start[patch1_pos] = patch1_value;
++                for (int patch2_pos = 0; patch2_pos < length; ++patch2_pos)
++                  {
++                    for (int patch2_value = 0; patch2_value <= 255;
++                         ++patch2_value)
++                      {
++                        start[patch2_pos] = patch2_value;
++                        int expected = reference_length (start, end);
++                        errno = EINVAL;
++                        int actual
++                          =  __ns_name_length_uncompressed (start, end);
++                        if (actual > 0)
++                          ++good;
++                        else
++                          {
++                            TEST_COMPARE (errno, EMSGSIZE);
++                            ++bad;
++                          }
++                        TEST_COMPARE (expected, actual);
++                      }
++                    start[patch2_pos] = ref[patch2_pos];
++                  }
++              }
++            start[patch1_pos] = ref[patch1_pos];
++          }
++      }
++    printf ("info: patched inputs with success: %d\n", good);
++    printf ("info: patched inputs with failure: %d\n", bad);
++  }
++
++  support_next_to_fault_free (&ntf);
++  return 0;
++}
++
++#include <support/test-driver.c>
+-- 
+2.38.1
+
+
+From f0e9657067240b8b105c6d58d5da9dc926f2f0ed Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 30 Aug 2022 10:02:49 +0200
+Subject: resolv: Add DNS packet parsing helpers geared towards wire format
+
+The public parser functions around the ns_rr record type produce
+textual domain names, but usually, this is not what we need while
+parsing DNS packets within glibc.  This commit adds two new helper
+functions, __ns_rr_cursor_init and __ns_rr_cursor_next, for writing
+packet parsers, and struct ns_rr_cursor, struct ns_rr_wire as
+supporting types.
+
+In theory, it is possible to avoid copying the owner name
+into the rname field in __ns_rr_cursor_next, but this would need
+more functions that work on compressed names.
+
+Eventually, __res_context_send could be enhanced to preserve the
+result of the packet parsing that is necessary for matching the
+incoming UDP packets, so that this works does not have to be done
+twice.
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit 857c890d9b42c50c8a94b76d47d4a61ab6d2f49c)
+---
+ include/arpa/nameser.h     |  92 +++++++++++++++
+ resolv/Makefile            |   6 +
+ resolv/ns_rr_cursor_init.c |  62 ++++++++++
+ resolv/ns_rr_cursor_next.c |  74 ++++++++++++
+ resolv/tst-ns_rr_cursor.c  | 227 +++++++++++++++++++++++++++++++++++++
+ 5 files changed, 461 insertions(+)
+ create mode 100644 resolv/ns_rr_cursor_init.c
+ create mode 100644 resolv/ns_rr_cursor_next.c
+ create mode 100644 resolv/tst-ns_rr_cursor.c
+
+diff --git a/include/arpa/nameser.h b/include/arpa/nameser.h
+index 6e4808f00d..c27e7886b7 100644
+--- a/include/arpa/nameser.h
++++ b/include/arpa/nameser.h
+@@ -103,5 +103,97 @@ libc_hidden_proto (__libc_ns_samename)
+    must point one past the last byte in the packet.  */
+ int __ns_name_length_uncompressed (const unsigned char *p,
+ 				   const unsigned char *eom) attribute_hidden;
++
++/* Iterator over the resource records in a DNS packet.  */
++struct ns_rr_cursor
++{
++  /* These members are not changed after initialization.  */
++  const unsigned char *begin;	/* First byte of packet.  */
++  const unsigned char *end;	/* One past the last byte of the packet.  */
++  const unsigned char *first_rr; /* First resource record (or packet end).  */
++
++  /* Advanced towards the end while reading the packet.  */
++  const unsigned char *current;
++};
++
++/* Returns the RCODE field from the DNS header.  */
++static inline int
++ns_rr_cursor_rcode (const struct ns_rr_cursor *c)
++{
++  return c->begin[3] & 0x0f;	/* Lower 4 bits at offset 3.  */
++}
++
++/* Returns the length of the answer section according to the DNS header.  */
++static inline int
++ns_rr_cursor_ancount (const struct ns_rr_cursor *c)
++{
++  return c->begin[6] * 256 + c->begin[7]; /* 16 bits at offset 6.  */
++}
++
++/* Returns the length of the authority (name server) section according
++   to the DNS header.  */
++static inline int
++ns_rr_cursor_nscount (const struct ns_rr_cursor *c)
++{
++  return c->begin[8] * 256 + c->begin[9]; /* 16 bits at offset 8.  */
++}
++
++/* Returns the length of the additional data section according to the
++   DNS header.  */
++static inline int
++ns_rr_cursor_adcount (const struct ns_rr_cursor *c)
++{
++  return c->begin[10] * 256 + c->begin[11]; /* 16 bits at offset 10.  */
++}
++
++/* Returns a pointer to the uncompressed question name in wire
++   format.  */
++static inline const unsigned char *
++ns_rr_cursor_qname (const struct ns_rr_cursor *c)
++{
++  return c->begin + 12;		/* QNAME starts right after the header.  */
++}
++
++/* Returns the question type of the first and only question.  */
++static inline const int
++ns_rr_cursor_qtype (const struct ns_rr_cursor *c)
++{
++  /* 16 bits 4 bytes back from the first RR header start.  */
++  return c->first_rr[-4] * 256 + c->first_rr[-3];
++}
++
++/* Returns the clss of the first and only question (usally C_IN).  */
++static inline const int
++ns_rr_cursor_qclass (const struct ns_rr_cursor *c)
++{
++  /* 16 bits 2 bytes back from the first RR header start.  */
++  return c->first_rr[-2] * 256 + c->first_rr[-1];
++}
++
++/* Initializes *C to cover the packet [BUF, BUF+LEN).  Returns false
++   if LEN is less than sizeof (*HD), if the packet does not contain a
++   full (uncompressed) question, or if the question count is not 1.  */
++_Bool __ns_rr_cursor_init (struct ns_rr_cursor *c,
++			   const unsigned char *buf, size_t len)
++  attribute_hidden;
++
++/* Like ns_rr, but the record owner name is not decoded into text format.  */
++struct ns_rr_wire
++{
++  unsigned char rname[NS_MAXCDNAME]; /* Owner name of the record.  */
++  uint16_t rtype;		/* Resource record type (T_*).  */
++  uint16_t rclass;		/* Resource record class (C_*).  */
++  uint32_t ttl;			/* Time-to-live field.  */
++  const unsigned char *rdata;	/* Start of resource record data.  */
++  uint16_t rdlength;		/* Length of the data at rdata, in bytes.  */
++};
++
++/* Attempts to parse the record at C into *RR.  On success, return
++   true, and C is advanced past the record, and RR->rdata points to
++   the record data.  On failure, errno is set to EMSGSIZE, and false
++   is returned.  */
++_Bool __ns_rr_cursor_next (struct ns_rr_cursor *c, struct ns_rr_wire *rr)
++  attribute_hidden;
++
+ # endif /* !_ISOMAC */
+ #endif
+diff --git a/resolv/Makefile b/resolv/Makefile
+index bf28825f60..018b1808d6 100644
+--- a/resolv/Makefile
++++ b/resolv/Makefile
+@@ -47,6 +47,8 @@ routines := \
+   ns_name_skip \
+   ns_name_uncompress \
+   ns_name_unpack \
++  ns_rr_cursor_init \
++  ns_rr_cursor_next \
+   ns_samebinaryname \
+   ns_samename \
+   nsap_addr \
+@@ -116,6 +118,10 @@ tests-static += tst-ns_samebinaryname
+ tests-internal += tst-ns_name_length_uncompressed
+ tests-static += tst-ns_name_length_uncompressed
+ 
++# Likewise for struct ns_rr_cursor and its functions.
++tests-internal += tst-ns_rr_cursor
++tests-static += tst-ns_rr_cursor
++
+ # These tests need libdl.
+ ifeq (yes,$(build-shared))
+ tests += \
+diff --git a/resolv/ns_rr_cursor_init.c b/resolv/ns_rr_cursor_init.c
+new file mode 100644
+index 0000000000..6ee80b30e9
+--- /dev/null
++++ b/resolv/ns_rr_cursor_init.c
+@@ -0,0 +1,62 @@
++/* Initialize a simple DNS packet parser.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <arpa/nameser.h>
++#include <errno.h>
++#include <stdbool.h>
++#include <string.h>
++
++bool
++__ns_rr_cursor_init (struct ns_rr_cursor *c,
++                     const unsigned char *buf, size_t len)
++{
++  c->begin = buf;
++  c->end = buf + len;
++
++  /* Check for header size and 16-bit question count value (it must be 1).  */
++  if (len < 12 || buf[4] != 0 || buf[5] != 1)
++    {
++      __set_errno (EMSGSIZE);
++      c->current = c->end;
++      return false;
++    }
++  c->current = buf + 12;
++
++  int consumed = __ns_name_length_uncompressed (c->current, c->end);
++  if (consumed < 0)
++    {
++      __set_errno (EMSGSIZE);
++      c->current = c->end;
++      c->first_rr = NULL;
++      return false;
++    }
++  c->current += consumed;
++
++  /* Ensure there is room for question type and class.  */
++  if (c->end - c->current < 4)
++    {
++      __set_errno (EMSGSIZE);
++      c->current = c->end;
++      c->first_rr = NULL;
++      return false;
++    }
++  c->current += 4;
++  c->first_rr = c->current;
++
++  return true;
++}
+diff --git a/resolv/ns_rr_cursor_next.c b/resolv/ns_rr_cursor_next.c
+new file mode 100644
+index 0000000000..33652fc5da
+--- /dev/null
++++ b/resolv/ns_rr_cursor_next.c
+@@ -0,0 +1,74 @@
++/* Simple DNS record parser without textual name decoding.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <arpa/nameser.h>
++#include <errno.h>
++#include <stdbool.h>
++#include <string.h>
++
++bool
++__ns_rr_cursor_next (struct ns_rr_cursor *c, struct ns_rr_wire *rr)
++{
++  rr->rdata = NULL;
++
++  /* Extract the record owner name.  */
++  int consumed = __ns_name_unpack (c->begin, c->end, c->current,
++                                   rr->rname, sizeof (rr->rname));
++  if (consumed < 0)
++    {
++      memset (rr, 0, sizeof (*rr));
++      __set_errno (EMSGSIZE);
++      return false;
++    }
++  c->current += consumed;
++
++  /* Extract the metadata.  */
++  struct
++  {
++    uint16_t rtype;
++    uint16_t rclass;
++    uint32_t ttl;
++    uint16_t rdlength;
++  } __attribute__ ((packed)) metadata;
++  _Static_assert (sizeof (metadata) == 10, "sizeof metadata");
++  if (c->end - c->current < sizeof (metadata))
++    {
++      memset (rr, 0, sizeof (*rr));
++      __set_errno (EMSGSIZE);
++      return false;
++    }
++  memcpy (&metadata, c->current, sizeof (metadata));
++  c->current += sizeof (metadata);
++  /* Endianess conversion.  */
++  rr->rtype = ntohs (metadata.rtype);
++  rr->rclass = ntohs (metadata.rclass);
++  rr->ttl = ntohl (metadata.ttl);
++  rr->rdlength = ntohs (metadata.rdlength);
++
++  /* Extract record data.  */
++  if (c->end - c->current < rr->rdlength)
++    {
++      memset (rr, 0, sizeof (*rr));
++      __set_errno (EMSGSIZE);
++      return false;
++    }
++  rr->rdata = c->current;
++  c->current += rr->rdlength;
++
++  return true;
++}
+diff --git a/resolv/tst-ns_rr_cursor.c b/resolv/tst-ns_rr_cursor.c
+new file mode 100644
+index 0000000000..c3c0908905
+--- /dev/null
++++ b/resolv/tst-ns_rr_cursor.c
+@@ -0,0 +1,227 @@
++/* Tests for resource record parsing.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <arpa/nameser.h>
++#include <string.h>
++#include <support/check.h>
++#include <support/next_to_fault.h>
++
++/* Reference packet for packet parsing.  */
++static const unsigned char valid_packet[] =
++  { 0x11, 0x12, 0x13, 0x14,
++    0x00, 0x01,               /* Question count.  */
++    0x00, 0x02,               /* Answer count.  */
++    0x21, 0x22, 0x23, 0x24,   /* Other counts (not actually in packet).  */
++    3, 'w', 'w', 'w', 7, 'e', 'x', 'a', 'm', 'p', 'l', 'e', 0,
++    0x00, 0x1c,               /* Question type: AAAA.  */
++    0x00, 0x01,               /* Question class: IN.  */
++    0xc0, 0x0c,               /* Compression reference to QNAME.  */
++    0x00, 0x1c,               /* Record type: AAAA.  */
++    0x00, 0x01,               /* Record class: IN.  */
++    0x12, 0x34, 0x56, 0x78,   /* Record TTL.  */
++    0x00, 0x10,               /* Record data length (16 bytes).  */
++    0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97,
++    0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* IPv6 address.  */
++    0xc0, 0x0c,               /* Compression reference to QNAME.  */
++    0x00, 0x1c,               /* Record type: AAAA.  */
++    0x00, 0x01,               /* Record class: IN.  */
++    0x11, 0x33, 0x55, 0x77,   /* Record TTL.  */
++    0x00, 0x10,               /* Record data length (16 bytes).  */
++    0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
++    0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* IPv6 address.  */
++  };
++
++/* Special offsets in valid_packet.  */
++enum
++  {
++    offset_of_first_record = 29,
++    offset_of_second_record = 57,
++  };
++
++/* Check that parsing valid_packet succeeds.  */
++static void
++test_valid (void)
++{
++  struct ns_rr_cursor c;
++  TEST_VERIFY_EXIT (__ns_rr_cursor_init (&c, valid_packet,
++                                         sizeof (valid_packet)));
++  TEST_COMPARE (ns_rr_cursor_rcode (&c), 4);
++  TEST_COMPARE (ns_rr_cursor_ancount (&c), 2);
++  TEST_COMPARE (ns_rr_cursor_nscount (&c), 0x2122);
++  TEST_COMPARE (ns_rr_cursor_adcount (&c), 0x2324);
++  TEST_COMPARE_BLOB (ns_rr_cursor_qname (&c), 13, &valid_packet[12], 13);
++  TEST_COMPARE (ns_rr_cursor_qtype (&c), T_AAAA);
++  TEST_COMPARE (ns_rr_cursor_qclass (&c), C_IN);
++  TEST_COMPARE (c.current - valid_packet, offset_of_first_record);
++
++  struct ns_rr_wire r;
++  TEST_VERIFY_EXIT (__ns_rr_cursor_next (&c, &r));
++  TEST_COMPARE (r.rtype, T_AAAA);
++  TEST_COMPARE (r.rclass, C_IN);
++  TEST_COMPARE (r.ttl, 0x12345678);
++  TEST_COMPARE_BLOB (r.rdata, r.rdlength,
++                     "\x90\x91\x92\x93\x94\x95\x96\x97"
++                     "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f", 16);
++  TEST_COMPARE (c.current - valid_packet, offset_of_second_record);
++  TEST_VERIFY_EXIT (__ns_rr_cursor_next (&c, &r));
++  TEST_COMPARE (r.rtype, T_AAAA);
++  TEST_COMPARE (r.rclass, C_IN);
++  TEST_COMPARE (r.ttl, 0x11335577);
++  TEST_COMPARE_BLOB (r.rdata, r.rdlength,
++                     "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
++                     "\xa8\xa9\xaa\xab\xac\xad\xae\xaf", 16);
++  TEST_VERIFY (c.current == c.end);
++}
++
++/* Check that trying to parse a packet with a compressed QNAME fails.  */
++static void
++test_compressed_qname (void)
++{
++  static const unsigned char packet[] =
++    { 0x11, 0x12, 0x13, 0x14,
++      0x00, 0x01,               /* Question count.  */
++      0x00, 0x00,               /* Answer count.  */
++      0x00, 0x00, 0x00, 0x00,   /* Other counts.  */
++      3, 'w', 'w', 'w', 7, 'e', 'x', 'a', 'm', 'p', 'l', 'e', 0xc0, 0x04,
++      0x00, 0x01,               /* Question type: A.  */
++      0x00, 0x01,               /* Question class: IN.  */
++    };
++
++  struct ns_rr_cursor c;
++  TEST_VERIFY_EXIT (!__ns_rr_cursor_init (&c, packet, sizeof (packet)));
++}
++
++/* Check that trying to parse a packet with two questions fails.  */
++static void
++test_two_questions (void)
++{
++  static const unsigned char packet[] =
++    { 0x11, 0x12, 0x13, 0x14,
++      0x00, 0x02,               /* Question count.  */
++      0x00, 0x00,               /* Answer count.  */
++      0x00, 0x00, 0x00, 0x00,   /* Other counts.  */
++      3, 'w', 'w', 'w', 7, 'e', 'x', 'a', 'm', 'p', 'l', 'e', 0xc0, 0x04,
++      0x00, 0x01,               /* Question type: A.  */
++      0x00, 0x01,               /* Question class: IN.  */
++      3, 'w', 'w', 'w', 7, 'e', 'x', 'a', 'm', 'p', 'l', 'e', 0xc0, 0x04,
++      0x00, 0x1c,               /* Question type: AAAA.  */
++      0x00, 0x01,               /* Question class: IN.  */
++    };
++
++  struct ns_rr_cursor c;
++  TEST_VERIFY_EXIT (!__ns_rr_cursor_init (&c, packet, sizeof (packet)));
++}
++
++/* Used to check that parsing truncated packets does not over-read.  */
++static struct support_next_to_fault ntf;
++
++/* Truncated packet in the second resource record.  */
++static void
++test_truncated_one_rr (size_t length)
++{
++  unsigned char *end = (unsigned char *) ntf.buffer - ntf.length;
++  unsigned char *start = end - length;
++
++  /* Produce the truncated packet.  */
++  memcpy (start, valid_packet, length);
++
++  struct ns_rr_cursor c;
++  TEST_VERIFY_EXIT (__ns_rr_cursor_init (&c, start, length));
++  TEST_COMPARE (ns_rr_cursor_rcode (&c), 4);
++  TEST_COMPARE (ns_rr_cursor_ancount (&c), 2);
++  TEST_COMPARE (ns_rr_cursor_nscount (&c), 0x2122);
++  TEST_COMPARE (ns_rr_cursor_adcount (&c), 0x2324);
++  TEST_COMPARE_BLOB (ns_rr_cursor_qname (&c), 13, &valid_packet[12], 13);
++  TEST_COMPARE (ns_rr_cursor_qtype (&c), T_AAAA);
++  TEST_COMPARE (ns_rr_cursor_qclass (&c), C_IN);
++  TEST_COMPARE (c.current - start, offset_of_first_record);
++
++  struct ns_rr_wire r;
++  TEST_VERIFY_EXIT (__ns_rr_cursor_next (&c, &r));
++  TEST_COMPARE (r.rtype, T_AAAA);
++  TEST_COMPARE (r.rclass, C_IN);
++  TEST_COMPARE (r.ttl, 0x12345678);
++  TEST_COMPARE_BLOB (r.rdata, r.rdlength,
++                     "\x90\x91\x92\x93\x94\x95\x96\x97"
++                     "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f", 16);
++  TEST_COMPARE (c.current - start, offset_of_second_record);
++  TEST_VERIFY (!__ns_rr_cursor_next (&c, &r));
++}
++
++/* Truncated packet in the first resource record.  */
++static void
++test_truncated_no_rr (size_t length)
++{
++  unsigned char *end = (unsigned char *) ntf.buffer - ntf.length;
++  unsigned char *start = end - length;
++
++  /* Produce the truncated packet.  */
++  memcpy (start, valid_packet, length);
++
++  struct ns_rr_cursor c;
++  TEST_VERIFY_EXIT (__ns_rr_cursor_init (&c, start, length));
++  TEST_COMPARE (ns_rr_cursor_rcode (&c), 4);
++  TEST_COMPARE (ns_rr_cursor_ancount (&c), 2);
++  TEST_COMPARE (ns_rr_cursor_nscount (&c), 0x2122);
++  TEST_COMPARE (ns_rr_cursor_adcount (&c), 0x2324);
++  TEST_COMPARE_BLOB (ns_rr_cursor_qname (&c), 13, &valid_packet[12], 13);
++  TEST_COMPARE (ns_rr_cursor_qtype (&c), T_AAAA);
++  TEST_COMPARE (ns_rr_cursor_qclass (&c), C_IN);
++  TEST_COMPARE (c.current - start, offset_of_first_record);
++
++  struct ns_rr_wire r;
++  TEST_VERIFY (!__ns_rr_cursor_next (&c, &r));
++}
++
++/* Truncated packet before first resource record.  */
++static void
++test_truncated_before_rr (size_t length)
++{
++  unsigned char *end = (unsigned char *) ntf.buffer - ntf.length;
++  unsigned char *start = end - length;
++
++  /* Produce the truncated packet.  */
++  memcpy (start, valid_packet, length);
++
++  struct ns_rr_cursor c;
++  TEST_VERIFY_EXIT (!__ns_rr_cursor_init (&c, start, length));
++}
++
++static int
++do_test (void)
++{
++  ntf = support_next_to_fault_allocate (sizeof (valid_packet));
++
++  test_valid ();
++  test_compressed_qname ();
++  test_two_questions ();
++
++  for (int length = offset_of_second_record; length < sizeof (valid_packet);
++       ++length)
++    test_truncated_one_rr (length);
++  for (int length = offset_of_first_record; length < offset_of_second_record;
++       ++length)
++    test_truncated_no_rr (length);
++  for (int length = 0; length < offset_of_first_record; ++length)
++    test_truncated_before_rr (length);
++
++  support_next_to_fault_free (&ntf);
++  return 0;
++}
++
++#include <support/test-driver.c>
+-- 
+2.38.1
+
+
+From b714ab7e3ce999b79401cdd22291128a7fd6d8ef Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 30 Aug 2022 10:02:49 +0200
+Subject: nss_dns: Split getanswer_ptr from getanswer_r
+
+And expand the use of name_ok and qtype in getanswer_ptr (the
+former also in getanswer_r).
+
+After further cleanups, not much code will be shared between the
+two functions.
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit 0dcc43e9981005540bf39dc7bf33fbab62cf9e84)
+---
+ resolv/nss_dns/dns-host.c | 320 +++++++++++++++++++++++++++++++-------
+ 1 file changed, 268 insertions(+), 52 deletions(-)
+
+diff --git a/resolv/nss_dns/dns-host.c b/resolv/nss_dns/dns-host.c
+index 544cffbecd..d384e1f82d 100644
+--- a/resolv/nss_dns/dns-host.c
++++ b/resolv/nss_dns/dns-host.c
+@@ -116,6 +116,11 @@ static enum nss_status getanswer_r (struct resolv_context *ctx,
+ 				    struct hostent *result, char *buffer,
+ 				    size_t buflen, int *errnop, int *h_errnop,
+ 				    int map, int32_t *ttlp, char **canonp);
++static enum nss_status getanswer_ptr (const querybuf *answer, int anslen,
++				      const char *qname,
++				      struct hostent *result, char *buffer,
++				      size_t buflen, int *errnop,
++				      int *h_errnop, int32_t *ttlp);
+ 
+ static enum nss_status gaih_getanswer (const querybuf *answer1, int anslen1,
+ 				       const querybuf *answer2, int anslen2,
+@@ -561,9 +566,8 @@ _nss_dns_gethostbyaddr2_r (const void *addr, socklen_t len, int af,
+       return errno == ECONNREFUSED ? NSS_STATUS_UNAVAIL : NSS_STATUS_NOTFOUND;
+     }
+ 
+-  status = getanswer_r
+-    (ctx, host_buffer.buf, n, qbuf, T_PTR, result, buffer, buflen,
+-     errnop, h_errnop, 0 /* XXX */, ttlp, NULL);
++  status = getanswer_ptr (host_buffer.buf, n, qbuf, result,
++			  buffer, buflen, errnop, h_errnop, ttlp);
+   if (host_buffer.buf != orig_host_buffer)
+     free (host_buffer.buf);
+   if (status != NSS_STATUS_SUCCESS)
+@@ -659,8 +663,6 @@ getanswer_r (struct resolv_context *ctx,
+   int haveanswer, had_error;
+   char *bp, **ap, **hap;
+   char tbuf[MAXDNAME];
+-  const char *tname;
+-  int (*name_ok) (const char *);
+   u_char packtmp[NS_MAXCDNAME];
+   int have_to_map = 0;
+   uintptr_t pad = -(uintptr_t) buffer % __alignof__ (struct host_data);
+@@ -679,22 +681,8 @@ getanswer_r (struct resolv_context *ctx,
+   if (buflen - sizeof (struct host_data) != linebuflen)
+     linebuflen = INT_MAX;
+ 
+-  tname = qname;
+   result->h_name = NULL;
+   end_of_message = answer->buf + anslen;
+-  switch (qtype)
+-    {
+-    case T_A:
+-    case T_AAAA:
+-      name_ok = __libc_res_hnok;
+-      break;
+-    case T_PTR:
+-      name_ok = __libc_res_dnok;
+-      break;
+-    default:
+-      *errnop = ENOENT;
+-      return NSS_STATUS_UNAVAIL;  /* XXX should be abort(); */
+-    }
+ 
+   /*
+    * find first satisfactory answer
+@@ -729,7 +717,7 @@ getanswer_r (struct resolv_context *ctx,
+       *h_errnop = NO_RECOVERY;
+       return NSS_STATUS_UNAVAIL;
+     }
+-  if (__glibc_unlikely (name_ok (bp) == 0))
++  if (__glibc_unlikely (__libc_res_hnok (bp) == 0))
+     {
+       errno = EBADMSG;
+       *errnop = EBADMSG;
+@@ -783,7 +771,7 @@ getanswer_r (struct resolv_context *ctx,
+ 	  n = -1;
+ 	}
+ 
+-      if (__glibc_unlikely (n < 0 || (*name_ok) (bp) == 0))
++      if (__glibc_unlikely (n < 0 || __libc_res_hnok (bp) == 0))
+ 	{
+ 	  ++had_error;
+ 	  continue;
+@@ -816,7 +804,7 @@ getanswer_r (struct resolv_context *ctx,
+ 	  continue;			/* XXX - had_error++ ? */
+ 	}
+ 
+-      if ((qtype == T_A || qtype == T_AAAA) && type == T_CNAME)
++      if (type == T_CNAME)
+ 	{
+ 	  /* A CNAME could also have a TTL entry.  */
+ 	  if (ttlp != NULL && ttl < *ttlp)
+@@ -826,7 +814,7 @@ getanswer_r (struct resolv_context *ctx,
+ 	    continue;
+ 	  n = __libc_dn_expand (answer->buf, end_of_message, cp,
+ 				tbuf, sizeof tbuf);
+-	  if (__glibc_unlikely (n < 0 || (*name_ok) (tbuf) == 0))
++	  if (__glibc_unlikely (n < 0 || __libc_res_hnok (tbuf) == 0))
+ 	    {
+ 	      ++had_error;
+ 	      continue;
+@@ -857,7 +845,260 @@ getanswer_r (struct resolv_context *ctx,
+ 	  continue;
+ 	}
+ 
+-      if (qtype == T_PTR && type == T_CNAME)
++      if (type == T_A && qtype == T_AAAA && map)
++	have_to_map = 1;
++      else if (__glibc_unlikely (type != qtype))
++	{
++	  cp += n;
++	  continue;			/* XXX - had_error++ ? */
++	}
++
++      switch (type)
++	{
++	case T_A:
++	case T_AAAA:
++	  if (__glibc_unlikely (__strcasecmp (result->h_name, bp) != 0))
++	    {
++	      cp += n;
++	      continue;			/* XXX - had_error++ ? */
++	    }
++
++	  /* Stop parsing at a record whose length is incorrect.  */
++	  if (n != rrtype_to_rdata_length (type))
++	    {
++	      ++had_error;
++	      break;
++	    }
++
++	  /* Skip records of the wrong type.  */
++	  if (n != result->h_length)
++	    {
++	      cp += n;
++	      continue;
++	    }
++	  if (!haveanswer)
++	    {
++	      int nn;
++
++	      /* We compose a single hostent out of the entire chain of
++	         entries, so the TTL of the hostent is essentially the lowest
++		 TTL in the chain.  */
++	      if (ttlp != NULL && ttl < *ttlp)
++		*ttlp = ttl;
++	      if (canonp != NULL)
++		*canonp = bp;
++	      result->h_name = bp;
++	      nn = strlen (bp) + 1;	/* for the \0 */
++	      bp += nn;
++	      linebuflen -= nn;
++	    }
++
++	  /* Provide sufficient alignment for both address
++	     families.  */
++	  enum { align = 4 };
++	  _Static_assert ((align % __alignof__ (struct in_addr)) == 0,
++			  "struct in_addr alignment");
++	  _Static_assert ((align % __alignof__ (struct in6_addr)) == 0,
++			  "struct in6_addr alignment");
++	  {
++	    char *new_bp = PTR_ALIGN_UP (bp, align);
++	    linebuflen -= new_bp - bp;
++	    bp = new_bp;
++	  }
++
++	  if (__glibc_unlikely (n > linebuflen))
++	    goto too_small;
++	  bp = __mempcpy (*hap++ = bp, cp, n);
++	  cp += n;
++	  linebuflen -= n;
++	  break;
++	default:
++	  abort ();
++	}
++      if (had_error == 0)
++	++haveanswer;
++    }
++
++  if (haveanswer > 0)
++    {
++      *ap = NULL;
++      *hap = NULL;
++      /*
++       * Note: we sort even if host can take only one address
++       * in its return structures - should give it the "best"
++       * address in that case, not some random one
++       */
++      if (haveanswer > 1 && qtype == T_A
++	  && __resolv_context_sort_count (ctx) > 0)
++	addrsort (ctx, host_data->h_addr_ptrs, haveanswer);
++
++      if (result->h_name == NULL)
++	{
++	  n = strlen (qname) + 1;	/* For the \0.  */
++	  if (n > linebuflen)
++	    goto too_small;
++	  if (n >= MAXHOSTNAMELEN)
++	    goto no_recovery;
++	  result->h_name = bp;
++	  bp = __mempcpy (bp, qname, n);	/* Cannot overflow.  */
++	  linebuflen -= n;
++	}
++
++      if (have_to_map)
++	if (map_v4v6_hostent (result, &bp, &linebuflen))
++	  goto too_small;
++      *h_errnop = NETDB_SUCCESS;
++      return NSS_STATUS_SUCCESS;
++    }
++ no_recovery:
++  *h_errnop = NO_RECOVERY;
++  *errnop = ENOENT;
++  /* Special case here: if the resolver sent a result but it only
++     contains a CNAME while we are looking for a T_A or T_AAAA record,
++     we fail with NOTFOUND instead of TRYAGAIN.  */
++  return ((qtype == T_A || qtype == T_AAAA) && ap != host_data->aliases
++	   ? NSS_STATUS_NOTFOUND : NSS_STATUS_TRYAGAIN);
++}
++
++static enum nss_status
++getanswer_ptr (const querybuf *answer, int anslen, const char *qname,
++	       struct hostent *result, char *buffer, size_t buflen,
++	       int *errnop, int *h_errnop, int32_t *ttlp)
++{
++  struct host_data
++  {
++    char *aliases[MAX_NR_ALIASES];
++    unsigned char host_addr[16];	/* IPv4 or IPv6 */
++    char *h_addr_ptrs[0];
++  } *host_data;
++  int linebuflen;
++  const HEADER *hp;
++  const u_char *end_of_message, *cp;
++  int n, ancount, qdcount;
++  int haveanswer, had_error;
++  char *bp, **ap, **hap;
++  char tbuf[MAXDNAME];
++  const char *tname;
++  u_char packtmp[NS_MAXCDNAME];
++  uintptr_t pad = -(uintptr_t) buffer % __alignof__ (struct host_data);
++  buffer += pad;
++  buflen = buflen > pad ? buflen - pad : 0;
++  if (__glibc_unlikely (buflen < sizeof (struct host_data)))
++    {
++      /* The buffer is too small.  */
++    too_small:
++      *errnop = ERANGE;
++      *h_errnop = NETDB_INTERNAL;
++      return NSS_STATUS_TRYAGAIN;
++    }
++  host_data = (struct host_data *) buffer;
++  linebuflen = buflen - sizeof (struct host_data);
++  if (buflen - sizeof (struct host_data) != linebuflen)
++    linebuflen = INT_MAX;
++
++  tname = qname;
++  result->h_name = NULL;
++  end_of_message = answer->buf + anslen;
++
++  /*
++   * find first satisfactory answer
++   */
++  hp = &answer->hdr;
++  ancount = ntohs (hp->ancount);
++  qdcount = ntohs (hp->qdcount);
++  cp = answer->buf + HFIXEDSZ;
++  if (__glibc_unlikely (qdcount != 1))
++    {
++      *h_errnop = NO_RECOVERY;
++      return NSS_STATUS_UNAVAIL;
++    }
++  if (sizeof (struct host_data) + (ancount + 1) * sizeof (char *) >= buflen)
++    goto too_small;
++  bp = (char *) &host_data->h_addr_ptrs[ancount + 1];
++  linebuflen -= (ancount + 1) * sizeof (char *);
++
++  n = __ns_name_unpack (answer->buf, end_of_message, cp,
++			packtmp, sizeof packtmp);
++  if (n != -1 && __ns_name_ntop (packtmp, bp, linebuflen) == -1)
++    {
++      if (__glibc_unlikely (errno == EMSGSIZE))
++	goto too_small;
++
++      n = -1;
++    }
++
++  if (__glibc_unlikely (n < 0))
++    {
++      *errnop = errno;
++      *h_errnop = NO_RECOVERY;
++      return NSS_STATUS_UNAVAIL;
++    }
++  if (__glibc_unlikely (__libc_res_dnok (bp) == 0))
++    {
++      errno = EBADMSG;
++      *errnop = EBADMSG;
++      *h_errnop = NO_RECOVERY;
++      return NSS_STATUS_UNAVAIL;
++    }
++  cp += n + QFIXEDSZ;
++
++  ap = host_data->aliases;
++  *ap = NULL;
++  result->h_aliases = host_data->aliases;
++  hap = host_data->h_addr_ptrs;
++  *hap = NULL;
++  result->h_addr_list = host_data->h_addr_ptrs;
++  haveanswer = 0;
++  had_error = 0;
++
++  while (ancount-- > 0 && cp < end_of_message && had_error == 0)
++    {
++      int type, class;
++
++      n = __ns_name_unpack (answer->buf, end_of_message, cp,
++			    packtmp, sizeof packtmp);
++      if (n != -1 && __ns_name_ntop (packtmp, bp, linebuflen) == -1)
++	{
++	  if (__glibc_unlikely (errno == EMSGSIZE))
++	    goto too_small;
++
++	  n = -1;
++	}
++
++      if (__glibc_unlikely (n < 0 || __libc_res_dnok (bp) == 0))
++	{
++	  ++had_error;
++	  continue;
++	}
++      cp += n;				/* name */
++
++      if (__glibc_unlikely (cp + 10 > end_of_message))
++	{
++	  ++had_error;
++	  continue;
++	}
++
++      NS_GET16 (type, cp);
++      NS_GET16 (class, cp);
++      int32_t ttl;
++      NS_GET32 (ttl, cp);
++      NS_GET16 (n, cp);		/* RDATA length.  */
++
++      if (end_of_message - cp < n)
++	{
++	  /* RDATA extends beyond the end of the packet.  */
++	  ++had_error;
++	  continue;
++	}
++
++      if (__glibc_unlikely (class != C_IN))
++	{
++	  /* XXX - debug? syslog? */
++	  cp += n;
++	  continue;			/* XXX - had_error++ ? */
++	}
++
++      if (type == T_CNAME)
+ 	{
+ 	  /* A CNAME could also have a TTL entry.  */
+ 	  if (ttlp != NULL && ttl < *ttlp)
+@@ -886,14 +1127,6 @@ getanswer_r (struct resolv_context *ctx,
+ 	  continue;
+ 	}
+ 
+-      if (type == T_A && qtype == T_AAAA && map)
+-	have_to_map = 1;
+-      else if (__glibc_unlikely (type != qtype))
+-	{
+-	  cp += n;
+-	  continue;			/* XXX - had_error++ ? */
+-	}
+-
+       switch (type)
+ 	{
+ 	case T_PTR:
+@@ -955,8 +1188,6 @@ getanswer_r (struct resolv_context *ctx,
+ 		 TTL in the chain.  */
+ 	      if (ttlp != NULL && ttl < *ttlp)
+ 		*ttlp = ttl;
+-	      if (canonp != NULL)
+-		*canonp = bp;
+ 	      result->h_name = bp;
+ 	      nn = strlen (bp) + 1;	/* for the \0 */
+ 	      bp += nn;
+@@ -983,7 +1214,8 @@ getanswer_r (struct resolv_context *ctx,
+ 	  linebuflen -= n;
+ 	  break;
+ 	default:
+-	  abort ();
++	  cp += n;
++	  continue;			/* XXX - had_error++ ? */
+ 	}
+       if (had_error == 0)
+ 	++haveanswer;
+@@ -993,14 +1225,6 @@ getanswer_r (struct resolv_context *ctx,
+     {
+       *ap = NULL;
+       *hap = NULL;
+-      /*
+-       * Note: we sort even if host can take only one address
+-       * in its return structures - should give it the "best"
+-       * address in that case, not some random one
+-       */
+-      if (haveanswer > 1 && qtype == T_A
+-	  && __resolv_context_sort_count (ctx) > 0)
+-	addrsort (ctx, host_data->h_addr_ptrs, haveanswer);
+ 
+       if (result->h_name == NULL)
+ 	{
+@@ -1014,23 +1238,15 @@ getanswer_r (struct resolv_context *ctx,
+ 	  linebuflen -= n;
+ 	}
+ 
+-      if (have_to_map)
+-	if (map_v4v6_hostent (result, &bp, &linebuflen))
+-	  goto too_small;
+       *h_errnop = NETDB_SUCCESS;
+       return NSS_STATUS_SUCCESS;
+     }
+  no_recovery:
+   *h_errnop = NO_RECOVERY;
+   *errnop = ENOENT;
+-  /* Special case here: if the resolver sent a result but it only
+-     contains a CNAME while we are looking for a T_A or T_AAAA record,
+-     we fail with NOTFOUND instead of TRYAGAIN.  */
+-  return ((qtype == T_A || qtype == T_AAAA) && ap != host_data->aliases
+-	   ? NSS_STATUS_NOTFOUND : NSS_STATUS_TRYAGAIN);
++  return NSS_STATUS_TRYAGAIN;
+ }
+ 
+-
+ static enum nss_status
+ gaih_getanswer_slice (const querybuf *answer, int anslen, const char *qname,
+ 		      struct gaih_addrtuple ***patp,
+-- 
+2.38.1
+
+
+From 77f523c473878ec0051582ef15161c6982879095 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 30 Aug 2022 10:02:49 +0200
+Subject: nss_dns: Rewrite _nss_dns_gethostbyaddr2_r and getanswer_ptr
+
+The simplification takes advantage of the split from getanswer_r.
+It fixes various aliases issues, and optimizes NSS buffer usage.
+The new DNS packet parsing helpers are used, too.
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit e32547d661a43da63368e488b6cfa9c53b4dcf92)
+---
+ resolv/nss_dns/dns-host.c | 405 ++++++++++----------------------------
+ 1 file changed, 102 insertions(+), 303 deletions(-)
+
+diff --git a/resolv/nss_dns/dns-host.c b/resolv/nss_dns/dns-host.c
+index d384e1f82d..cd26399b7e 100644
+--- a/resolv/nss_dns/dns-host.c
++++ b/resolv/nss_dns/dns-host.c
+@@ -69,6 +69,7 @@
+  * --Copyright--
+  */
+ 
++#include <alloc_buffer.h>
+ #include <assert.h>
+ #include <ctype.h>
+ #include <errno.h>
+@@ -116,10 +117,9 @@ static enum nss_status getanswer_r (struct resolv_context *ctx,
+ 				    struct hostent *result, char *buffer,
+ 				    size_t buflen, int *errnop, int *h_errnop,
+ 				    int map, int32_t *ttlp, char **canonp);
+-static enum nss_status getanswer_ptr (const querybuf *answer, int anslen,
+-				      const char *qname,
+-				      struct hostent *result, char *buffer,
+-				      size_t buflen, int *errnop,
++static enum nss_status getanswer_ptr (unsigned char *packet, size_t packetlen,
++				      struct alloc_buffer *abuf,
++				      char **hnamep, int *errnop,
+ 				      int *h_errnop, int32_t *ttlp);
+ 
+ static enum nss_status gaih_getanswer (const querybuf *answer1, int anslen1,
+@@ -456,36 +456,21 @@ _nss_dns_gethostbyaddr2_r (const void *addr, socklen_t len, int af,
+   static const u_char tunnelled[] = { 0,0, 0,0, 0,0, 0,0, 0,0, 0,0 };
+   static const u_char v6local[] = { 0,0, 0,1 };
+   const u_char *uaddr = (const u_char *)addr;
+-  struct host_data
+-  {
+-    char *aliases[MAX_NR_ALIASES];
+-    unsigned char host_addr[16];	/* IPv4 or IPv6 */
+-    char *h_addr_ptrs[MAX_NR_ADDRS + 1];
+-    char linebuffer[0];
+-  } *host_data = (struct host_data *) buffer;
+-  union
+-  {
+-    querybuf *buf;
+-    u_char *ptr;
+-  } host_buffer;
+-  querybuf *orig_host_buffer;
+   char qbuf[MAXDNAME+1], *qp = NULL;
+   size_t size;
+   int n, status;
+   int olderr = errno;
+ 
+- uintptr_t pad = -(uintptr_t) buffer % __alignof__ (struct host_data);
+- buffer += pad;
+- buflen = buflen > pad ? buflen - pad : 0;
+-
+- if (__glibc_unlikely (buflen < sizeof (struct host_data)))
+-   {
+-     *errnop = ERANGE;
+-     *h_errnop = NETDB_INTERNAL;
+-     return NSS_STATUS_TRYAGAIN;
+-   }
+-
+- host_data = (struct host_data *) buffer;
++  /* Prepare the allocation buffer.  Store the pointer array first, to
++     benefit from buffer alignment.  */
++  struct alloc_buffer abuf = alloc_buffer_create (buffer, buflen);
++  char **address_array = alloc_buffer_alloc_array (&abuf, char *, 2);
++  if (address_array == NULL)
++    {
++      *errnop = ERANGE;
++      *h_errnop = NETDB_INTERNAL;
++      return NSS_STATUS_TRYAGAIN;
++    }
+ 
+   struct resolv_context *ctx = __resolv_context_get ();
+   if (ctx == NULL)
+@@ -529,8 +514,6 @@ _nss_dns_gethostbyaddr2_r (const void *addr, socklen_t len, int af,
+       return NSS_STATUS_UNAVAIL;
+     }
+ 
+-  host_buffer.buf = orig_host_buffer = (querybuf *) alloca (1024);
+-
+   switch (af)
+     {
+     case AF_INET:
+@@ -554,35 +537,52 @@ _nss_dns_gethostbyaddr2_r (const void *addr, socklen_t len, int af,
+       break;
+     }
+ 
+-  n = __res_context_query (ctx, qbuf, C_IN, T_PTR, host_buffer.buf->buf,
+-			   1024, &host_buffer.ptr, NULL, NULL, NULL, NULL);
++  unsigned char dns_packet_buffer[1024];
++  unsigned char *alt_dns_packet_buffer = dns_packet_buffer;
++  n = __res_context_query (ctx, qbuf, C_IN, T_PTR,
++			   dns_packet_buffer, sizeof (dns_packet_buffer),
++			   &alt_dns_packet_buffer,
++			   NULL, NULL, NULL, NULL);
+   if (n < 0)
+     {
+       *h_errnop = h_errno;
+       __set_errno (olderr);
+-      if (host_buffer.buf != orig_host_buffer)
+-	free (host_buffer.buf);
++      if (alt_dns_packet_buffer != dns_packet_buffer)
++	free (alt_dns_packet_buffer);
+       __resolv_context_put (ctx);
+       return errno == ECONNREFUSED ? NSS_STATUS_UNAVAIL : NSS_STATUS_NOTFOUND;
+     }
+ 
+-  status = getanswer_ptr (host_buffer.buf, n, qbuf, result,
+-			  buffer, buflen, errnop, h_errnop, ttlp);
+-  if (host_buffer.buf != orig_host_buffer)
+-    free (host_buffer.buf);
++  status = getanswer_ptr (alt_dns_packet_buffer, n,
++			  &abuf, &result->h_name, errnop, h_errnop, ttlp);
++
++  if (alt_dns_packet_buffer != dns_packet_buffer)
++    free (alt_dns_packet_buffer);
++  __resolv_context_put (ctx);
++
+   if (status != NSS_STATUS_SUCCESS)
+-    {
+-      __resolv_context_put (ctx);
+-      return status;
+-    }
++    return status;
+ 
++  /* result->h_name has already been set by getanswer_ptr.  */
+   result->h_addrtype = af;
+   result->h_length = len;
+-  memcpy (host_data->host_addr, addr, len);
+-  host_data->h_addr_ptrs[0] = (char *) host_data->host_addr;
+-  host_data->h_addr_ptrs[1] = NULL;
++  /* Increase the alignment to 4, in case there are applications out
++     there that expect at least this level of address alignment.  */
++  address_array[0] = (char *) alloc_buffer_next (&abuf, uint32_t);
++  alloc_buffer_copy_bytes (&abuf, uaddr, len);
++  address_array[1] = NULL;
++
++  /* This check also covers allocation failure in getanswer_ptr.  */
++  if (alloc_buffer_has_failed (&abuf))
++    {
++      *errnop = ERANGE;
++      *h_errnop = NETDB_INTERNAL;
++      return NSS_STATUS_TRYAGAIN;
++    }
++  result->h_addr_list = address_array;
++  result->h_aliases = &address_array[1]; /* Points to NULL.  */
++
+   *h_errnop = NETDB_SUCCESS;
+-  __resolv_context_put (ctx);
+   return NSS_STATUS_SUCCESS;
+ }
+ libc_hidden_def (_nss_dns_gethostbyaddr2_r)
+@@ -961,287 +961,86 @@ getanswer_r (struct resolv_context *ctx,
+ }
+ 
+ static enum nss_status
+-getanswer_ptr (const querybuf *answer, int anslen, const char *qname,
+-	       struct hostent *result, char *buffer, size_t buflen,
++getanswer_ptr (unsigned char *packet, size_t packetlen,
++	       struct alloc_buffer *abuf, char **hnamep,
+ 	       int *errnop, int *h_errnop, int32_t *ttlp)
+ {
+-  struct host_data
+-  {
+-    char *aliases[MAX_NR_ALIASES];
+-    unsigned char host_addr[16];	/* IPv4 or IPv6 */
+-    char *h_addr_ptrs[0];
+-  } *host_data;
+-  int linebuflen;
+-  const HEADER *hp;
+-  const u_char *end_of_message, *cp;
+-  int n, ancount, qdcount;
+-  int haveanswer, had_error;
+-  char *bp, **ap, **hap;
+-  char tbuf[MAXDNAME];
+-  const char *tname;
+-  u_char packtmp[NS_MAXCDNAME];
+-  uintptr_t pad = -(uintptr_t) buffer % __alignof__ (struct host_data);
+-  buffer += pad;
+-  buflen = buflen > pad ? buflen - pad : 0;
+-  if (__glibc_unlikely (buflen < sizeof (struct host_data)))
+-    {
+-      /* The buffer is too small.  */
+-    too_small:
+-      *errnop = ERANGE;
+-      *h_errnop = NETDB_INTERNAL;
+-      return NSS_STATUS_TRYAGAIN;
+-    }
+-  host_data = (struct host_data *) buffer;
+-  linebuflen = buflen - sizeof (struct host_data);
+-  if (buflen - sizeof (struct host_data) != linebuflen)
+-    linebuflen = INT_MAX;
+-
+-  tname = qname;
+-  result->h_name = NULL;
+-  end_of_message = answer->buf + anslen;
+-
+-  /*
+-   * find first satisfactory answer
+-   */
+-  hp = &answer->hdr;
+-  ancount = ntohs (hp->ancount);
+-  qdcount = ntohs (hp->qdcount);
+-  cp = answer->buf + HFIXEDSZ;
+-  if (__glibc_unlikely (qdcount != 1))
+-    {
+-      *h_errnop = NO_RECOVERY;
+-      return NSS_STATUS_UNAVAIL;
+-    }
+-  if (sizeof (struct host_data) + (ancount + 1) * sizeof (char *) >= buflen)
+-    goto too_small;
+-  bp = (char *) &host_data->h_addr_ptrs[ancount + 1];
+-  linebuflen -= (ancount + 1) * sizeof (char *);
+-
+-  n = __ns_name_unpack (answer->buf, end_of_message, cp,
+-			packtmp, sizeof packtmp);
+-  if (n != -1 && __ns_name_ntop (packtmp, bp, linebuflen) == -1)
++  struct ns_rr_cursor c;
++  if (!__ns_rr_cursor_init (&c, packet, packetlen))
+     {
+-      if (__glibc_unlikely (errno == EMSGSIZE))
+-	goto too_small;
+-
+-      n = -1;
+-    }
+-
+-  if (__glibc_unlikely (n < 0))
+-    {
+-      *errnop = errno;
+-      *h_errnop = NO_RECOVERY;
+-      return NSS_STATUS_UNAVAIL;
+-    }
+-  if (__glibc_unlikely (__libc_res_dnok (bp) == 0))
+-    {
+-      errno = EBADMSG;
+-      *errnop = EBADMSG;
++      /* This should not happen because __res_context_query already
++	 perfroms response validation.  */
+       *h_errnop = NO_RECOVERY;
+       return NSS_STATUS_UNAVAIL;
+     }
+-  cp += n + QFIXEDSZ;
++  int ancount = ns_rr_cursor_ancount (&c);
++  const unsigned char *expected_name = ns_rr_cursor_qname (&c);
++  /* expected_name may be updated to point into this buffer.  */
++  unsigned char name_buffer[NS_MAXCDNAME];
+ 
+-  ap = host_data->aliases;
+-  *ap = NULL;
+-  result->h_aliases = host_data->aliases;
+-  hap = host_data->h_addr_ptrs;
+-  *hap = NULL;
+-  result->h_addr_list = host_data->h_addr_ptrs;
+-  haveanswer = 0;
+-  had_error = 0;
+-
+-  while (ancount-- > 0 && cp < end_of_message && had_error == 0)
++  while (ancount > 0)
+     {
+-      int type, class;
+-
+-      n = __ns_name_unpack (answer->buf, end_of_message, cp,
+-			    packtmp, sizeof packtmp);
+-      if (n != -1 && __ns_name_ntop (packtmp, bp, linebuflen) == -1)
++      struct ns_rr_wire rr;
++      if (!__ns_rr_cursor_next (&c, &rr))
+ 	{
+-	  if (__glibc_unlikely (errno == EMSGSIZE))
+-	    goto too_small;
+-
+-	  n = -1;
+-	}
+-
+-      if (__glibc_unlikely (n < 0 || __libc_res_dnok (bp) == 0))
+-	{
+-	  ++had_error;
+-	  continue;
+-	}
+-      cp += n;				/* name */
+-
+-      if (__glibc_unlikely (cp + 10 > end_of_message))
+-	{
+-	  ++had_error;
+-	  continue;
++	  *h_errnop = NO_RECOVERY;
++	  return NSS_STATUS_UNAVAIL;
+ 	}
+ 
+-      NS_GET16 (type, cp);
+-      NS_GET16 (class, cp);
+-      int32_t ttl;
+-      NS_GET32 (ttl, cp);
+-      NS_GET16 (n, cp);		/* RDATA length.  */
++      /* Skip over records with the wrong class.  */
++      if (rr.rclass != C_IN)
++	continue;
+ 
+-      if (end_of_message - cp < n)
+-	{
+-	  /* RDATA extends beyond the end of the packet.  */
+-	  ++had_error;
+-	  continue;
+-	}
+-
+-      if (__glibc_unlikely (class != C_IN))
+-	{
+-	  /* XXX - debug? syslog? */
+-	  cp += n;
+-	  continue;			/* XXX - had_error++ ? */
+-	}
++      /* Update TTL for known record types.  */
++      if ((rr.rtype == T_CNAME || rr.rtype == T_PTR)
++	  && ttlp != NULL && *ttlp > rr.ttl)
++	*ttlp = rr.ttl;
+ 
+-      if (type == T_CNAME)
++      if (rr.rtype == T_CNAME)
+ 	{
+-	  /* A CNAME could also have a TTL entry.  */
+-	  if (ttlp != NULL && ttl < *ttlp)
+-	      *ttlp = ttl;
+-
+-	  n = __libc_dn_expand (answer->buf, end_of_message, cp,
+-				tbuf, sizeof tbuf);
+-	  if (__glibc_unlikely (n < 0 || __libc_res_dnok (tbuf) == 0))
+-	    {
+-	      ++had_error;
+-	      continue;
+-	    }
+-	  cp += n;
+-	  /* Get canonical name.  */
+-	  n = strlen (tbuf) + 1;   /* For the \0.  */
+-	  if (__glibc_unlikely (n > linebuflen))
+-	    goto too_small;
+-	  if (__glibc_unlikely (n >= MAXHOSTNAMELEN))
++	  /* NB: No check for owner name match, based on historic
++	     precedent.  Record the CNAME target as the new expected
++	     name.  */
++	  int n = __ns_name_unpack (c.begin, c.end, rr.rdata,
++				    name_buffer, sizeof (name_buffer));
++	  if (n < 0)
+ 	    {
+-	      ++had_error;
+-	      continue;
++	      *h_errnop = NO_RECOVERY;
++	      return NSS_STATUS_UNAVAIL;
+ 	    }
+-	  tname = bp;
+-	  bp = __mempcpy (bp, tbuf, n);	/* Cannot overflow.  */
+-	  linebuflen -= n;
+-	  continue;
++	  expected_name = name_buffer;
+ 	}
+-
+-      switch (type)
++      else if (rr.rtype == T_PTR
++	       && __ns_samebinaryname (rr.rname, expected_name))
+ 	{
+-	case T_PTR:
+-	  if (__glibc_unlikely (__strcasecmp (tname, bp) != 0))
+-	    {
+-	      cp += n;
+-	      continue;			/* XXX - had_error++ ? */
+-	    }
+-
+-	  n = __ns_name_unpack (answer->buf, end_of_message, cp,
+-				packtmp, sizeof packtmp);
+-	  if (n != -1 && __ns_name_ntop (packtmp, bp, linebuflen) == -1)
+-	    {
+-	      if (__glibc_unlikely (errno == EMSGSIZE))
+-		goto too_small;
+-
+-	      n = -1;
+-	    }
+-
+-	  if (__glibc_unlikely (n < 0 || __libc_res_hnok (bp) == 0))
++	  /* Decompress the target of the PTR record.  This is the
++	     host name we are looking for.  We can only use it if it
++	     is syntactically valid.  Historically, only one host name
++	     is returned here.  If the recursive resolver performs DNS
++	     record rotation, the returned host name is essentially
++	     random, which is why multiple PTR records are rarely
++	     used.  Use MAXHOSTNAMELEN instead of NS_MAXCDNAME for
++	     additional length checking.  */
++	  char hname[MAXHOSTNAMELEN + 1];
++	  if (__ns_name_unpack (c.begin, c.end, rr.rdata,
++				name_buffer, sizeof (name_buffer)) < 0
++	      || !__res_binary_hnok (expected_name)
++	      || __ns_name_ntop (name_buffer, hname, sizeof (hname)) < 0)
+ 	    {
+-	      ++had_error;
+-	      break;
++	      *h_errnop = NO_RECOVERY;
++	      return NSS_STATUS_UNAVAIL;
+ 	    }
+-	  if (ttlp != NULL && ttl < *ttlp)
+-	      *ttlp = ttl;
+-	  /* bind would put multiple PTR records as aliases, but we don't do
+-	     that.  */
+-	  result->h_name = bp;
+-	  *h_errnop = NETDB_SUCCESS;
++	  /* Successful allocation is checked by the caller.  */
++	  *hnamep = alloc_buffer_copy_string (abuf, hname);
+ 	  return NSS_STATUS_SUCCESS;
+-	case T_A:
+-	case T_AAAA:
+-	  if (__glibc_unlikely (__strcasecmp (result->h_name, bp) != 0))
+-	    {
+-	      cp += n;
+-	      continue;			/* XXX - had_error++ ? */
+-	    }
+-
+-	  /* Stop parsing at a record whose length is incorrect.  */
+-	  if (n != rrtype_to_rdata_length (type))
+-	    {
+-	      ++had_error;
+-	      break;
+-	    }
+-
+-	  /* Skip records of the wrong type.  */
+-	  if (n != result->h_length)
+-	    {
+-	      cp += n;
+-	      continue;
+-	    }
+-	  if (!haveanswer)
+-	    {
+-	      int nn;
+-
+-	      /* We compose a single hostent out of the entire chain of
+-	         entries, so the TTL of the hostent is essentially the lowest
+-		 TTL in the chain.  */
+-	      if (ttlp != NULL && ttl < *ttlp)
+-		*ttlp = ttl;
+-	      result->h_name = bp;
+-	      nn = strlen (bp) + 1;	/* for the \0 */
+-	      bp += nn;
+-	      linebuflen -= nn;
+-	    }
+-
+-	  /* Provide sufficient alignment for both address
+-	     families.  */
+-	  enum { align = 4 };
+-	  _Static_assert ((align % __alignof__ (struct in_addr)) == 0,
+-			  "struct in_addr alignment");
+-	  _Static_assert ((align % __alignof__ (struct in6_addr)) == 0,
+-			  "struct in6_addr alignment");
+-	  {
+-	    char *new_bp = PTR_ALIGN_UP (bp, align);
+-	    linebuflen -= new_bp - bp;
+-	    bp = new_bp;
+-	  }
+-
+-	  if (__glibc_unlikely (n > linebuflen))
+-	    goto too_small;
+-	  bp = __mempcpy (*hap++ = bp, cp, n);
+-	  cp += n;
+-	  linebuflen -= n;
+-	  break;
+-	default:
+-	  cp += n;
+-	  continue;			/* XXX - had_error++ ? */
+ 	}
+-      if (had_error == 0)
+-	++haveanswer;
+     }
+ 
+-  if (haveanswer > 0)
+-    {
+-      *ap = NULL;
+-      *hap = NULL;
+-
+-      if (result->h_name == NULL)
+-	{
+-	  n = strlen (qname) + 1;	/* For the \0.  */
+-	  if (n > linebuflen)
+-	    goto too_small;
+-	  if (n >= MAXHOSTNAMELEN)
+-	    goto no_recovery;
+-	  result->h_name = bp;
+-	  bp = __mempcpy (bp, qname, n);	/* Cannot overflow.  */
+-	  linebuflen -= n;
+-	}
++  /* No PTR record found.  */
++  if (ttlp != NULL)
++    /* No caching of negative responses.  */
++    *ttlp = 0;
+ 
+-      *h_errnop = NETDB_SUCCESS;
+-      return NSS_STATUS_SUCCESS;
+-    }
+- no_recovery:
+   *h_errnop = NO_RECOVERY;
+   *errnop = ENOENT;
+   return NSS_STATUS_TRYAGAIN;
+-- 
+2.38.1
+
+
+From 5165080fec63a1f03aa1985b77bca300465bf570 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 30 Aug 2022 10:02:49 +0200
+Subject: nss_dns: Remove remnants of IPv6 address mapping
+
+res_use_inet6 always returns false since commit 3f8b44be0a658266adff5
+("resolv: Remove support for RES_USE_INET6 and the inet6 option").
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit a7fc30b522a0cd7c8c5e7e285b9531b704e02f04)
+---
+ resolv/README             |  3 --
+ resolv/mapv4v6addr.h      | 69 --------------------------------
+ resolv/mapv4v6hostent.h   | 84 ---------------------------------------
+ resolv/nss_dns/dns-host.c | 54 +++++--------------------
+ 4 files changed, 9 insertions(+), 201 deletions(-)
+ delete mode 100644 resolv/mapv4v6addr.h
+ delete mode 100644 resolv/mapv4v6hostent.h
+
+diff --git a/resolv/README b/resolv/README
+index 514e9bb617..2146bc3b27 100644
+--- a/resolv/README
++++ b/resolv/README
+@@ -146,6 +146,3 @@ res_libc.c is home-brewn, although parts of it are taken from res_data.c.
+ 
+ res_hconf.c and res_hconf.h were contributed by David Mosberger, and
+ do not come from BIND.
+-
+-The files gethnamaddr.c, mapv4v6addr.h and mapv4v6hostent.h are
+-leftovers from BIND 4.9.7.
+diff --git a/resolv/mapv4v6addr.h b/resolv/mapv4v6addr.h
+deleted file mode 100644
+index 7f85f7d5e3..0000000000
+--- a/resolv/mapv4v6addr.h
++++ /dev/null
+@@ -1,69 +0,0 @@
+-/*
+- * ++Copyright++ 1985, 1988, 1993
+- * -
+- * Copyright (c) 1985, 1988, 1993
+- *    The Regents of the University of California.  All rights reserved.
+- *
+- * Redistribution and use in source and binary forms, with or without
+- * modification, are permitted provided that the following conditions
+- * are met:
+- * 1. Redistributions of source code must retain the above copyright
+- *    notice, this list of conditions and the following disclaimer.
+- * 2. Redistributions in binary form must reproduce the above copyright
+- *    notice, this list of conditions and the following disclaimer in the
+- *    documentation and/or other materials provided with the distribution.
+- * 4. Neither the name of the University nor the names of its contributors
+- *    may be used to endorse or promote products derived from this software
+- *    without specific prior written permission.
+- *
+- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+- * SUCH DAMAGE.
+- * -
+- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
+- *
+- * Permission to use, copy, modify, and distribute this software for any
+- * purpose with or without fee is hereby granted, provided that the above
+- * copyright notice and this permission notice appear in all copies, and that
+- * the name of Digital Equipment Corporation not be used in advertising or
+- * publicity pertaining to distribution of the document or software without
+- * specific, written prior permission.
+- *
+- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
+- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
+- * OF MERCHANTABILITY AND FITNESS.   IN NO EVENT SHALL DIGITAL EQUIPMENT
+- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+- * SOFTWARE.
+- * -
+- * --Copyright--
+- */
+-
+-#include <string.h>
+-#include <arpa/nameser.h>
+-
+-static void
+-map_v4v6_address (const char *src, char *dst)
+-{
+-  u_char *p = (u_char *) dst;
+-  int i;
+-
+-  /* Move the IPv4 part to the right position.  */
+-  memcpy (dst + 12, src, INADDRSZ);
+-
+-  /* Mark this ipv6 addr as a mapped ipv4. */
+-  for (i = 0; i < 10; i++)
+-    *p++ = 0x00;
+-  *p++ = 0xff;
+-  *p = 0xff;
+-}
+diff --git a/resolv/mapv4v6hostent.h b/resolv/mapv4v6hostent.h
+deleted file mode 100644
+index c11038adf3..0000000000
+--- a/resolv/mapv4v6hostent.h
++++ /dev/null
+@@ -1,84 +0,0 @@
+-/*
+- * ++Copyright++ 1985, 1988, 1993
+- * -
+- * Copyright (c) 1985, 1988, 1993
+- *    The Regents of the University of California.  All rights reserved.
+- *
+- * Redistribution and use in source and binary forms, with or without
+- * modification, are permitted provided that the following conditions
+- * are met:
+- * 1. Redistributions of source code must retain the above copyright
+- *    notice, this list of conditions and the following disclaimer.
+- * 2. Redistributions in binary form must reproduce the above copyright
+- *    notice, this list of conditions and the following disclaimer in the
+- *    documentation and/or other materials provided with the distribution.
+- * 4. Neither the name of the University nor the names of its contributors
+- *    may be used to endorse or promote products derived from this software
+- *    without specific prior written permission.
+- *
+- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+- * SUCH DAMAGE.
+- * -
+- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
+- *
+- * Permission to use, copy, modify, and distribute this software for any
+- * purpose with or without fee is hereby granted, provided that the above
+- * copyright notice and this permission notice appear in all copies, and that
+- * the name of Digital Equipment Corporation not be used in advertising or
+- * publicity pertaining to distribution of the document or software without
+- * specific, written prior permission.
+- *
+- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
+- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
+- * OF MERCHANTABILITY AND FITNESS.   IN NO EVENT SHALL DIGITAL EQUIPMENT
+- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+- * SOFTWARE.
+- * -
+- * --Copyright--
+- */
+-
+-#include <arpa/nameser.h>
+-#include <sys/socket.h>
+-
+-typedef union {
+-    int32_t al;
+-    char ac;
+-} align;
+-
+-static int
+-map_v4v6_hostent (struct hostent *hp, char **bpp, int *lenp)
+-{
+-  char **ap;
+-
+-  if (hp->h_addrtype != AF_INET || hp->h_length != INADDRSZ)
+-    return 0;
+-  hp->h_addrtype = AF_INET6;
+-  hp->h_length = IN6ADDRSZ;
+-  for (ap = hp->h_addr_list; *ap; ap++)
+-    {
+-      int i = sizeof (align) - ((u_long) *bpp % sizeof (align));
+-
+-      if (*lenp < (i + IN6ADDRSZ))
+-	/* Out of memory.  */
+-	return 1;
+-      *bpp += i;
+-      *lenp -= i;
+-      map_v4v6_address (*ap, *bpp);
+-      *ap = *bpp;
+-      *bpp += IN6ADDRSZ;
+-      *lenp -= IN6ADDRSZ;
+-    }
+-  return 0;
+-}
+diff --git a/resolv/nss_dns/dns-host.c b/resolv/nss_dns/dns-host.c
+index cd26399b7e..8e38583e15 100644
+--- a/resolv/nss_dns/dns-host.c
++++ b/resolv/nss_dns/dns-host.c
+@@ -87,10 +87,6 @@
+ #include <resolv/resolv-internal.h>
+ #include <resolv/resolv_context.h>
+ 
+-/* Get implementations of some internal functions.  */
+-#include <resolv/mapv4v6addr.h>
+-#include <resolv/mapv4v6hostent.h>
+-
+ #define RESOLVSORT
+ 
+ #if PACKETSZ > 65536
+@@ -116,7 +112,7 @@ static enum nss_status getanswer_r (struct resolv_context *ctx,
+ 				    const char *qname, int qtype,
+ 				    struct hostent *result, char *buffer,
+ 				    size_t buflen, int *errnop, int *h_errnop,
+-				    int map, int32_t *ttlp, char **canonp);
++				    int32_t *ttlp, char **canonp);
+ static enum nss_status getanswer_ptr (unsigned char *packet, size_t packetlen,
+ 				      struct alloc_buffer *abuf,
+ 				      char **hnamep, int *errnop,
+@@ -197,7 +193,6 @@ gethostbyname3_context (struct resolv_context *ctx,
+   char tmp[NS_MAXDNAME];
+   int size, type, n;
+   const char *cp;
+-  int map = 0;
+   int olderr = errno;
+   enum nss_status status;
+ 
+@@ -258,32 +253,12 @@ gethostbyname3_context (struct resolv_context *ctx,
+ 	*errnop = EAGAIN;
+       else
+ 	__set_errno (olderr);
+-
+-      /* If we are looking for an IPv6 address and mapping is enabled
+-	 by having the RES_USE_INET6 bit in _res.options set, we try
+-	 another lookup.  */
+-      if (af == AF_INET6 && res_use_inet6 ())
+-	n = __res_context_search (ctx, name, C_IN, T_A, host_buffer.buf->buf,
+-				  host_buffer.buf != orig_host_buffer
+-				  ? MAXPACKET : 1024, &host_buffer.ptr,
+-				  NULL, NULL, NULL, NULL);
+-
+-      if (n < 0)
+-	{
+-	  if (host_buffer.buf != orig_host_buffer)
+-	    free (host_buffer.buf);
+-	  return status;
+-	}
+-
+-      map = 1;
+-
+-      result->h_addrtype = AF_INET;
+-      result->h_length = INADDRSZ;
+     }
++  else
++    status = getanswer_r
++      (ctx, host_buffer.buf, n, name, type, result, buffer, buflen,
++       errnop, h_errnop, ttlp, canonp);
+ 
+-  status = getanswer_r
+-    (ctx, host_buffer.buf, n, name, type, result, buffer, buflen,
+-     errnop, h_errnop, map, ttlp, canonp);
+   if (host_buffer.buf != orig_host_buffer)
+     free (host_buffer.buf);
+   return status;
+@@ -329,13 +304,8 @@ _nss_dns_gethostbyname_r (const char *name, struct hostent *result,
+       *h_errnop = NETDB_INTERNAL;
+       return NSS_STATUS_UNAVAIL;
+     }
+-  status = NSS_STATUS_NOTFOUND;
+-  if (res_use_inet6 ())
+-    status = gethostbyname3_context (ctx, name, AF_INET6, result, buffer,
+-				     buflen, errnop, h_errnop, NULL, NULL);
+-  if (status == NSS_STATUS_NOTFOUND)
+-    status = gethostbyname3_context (ctx, name, AF_INET, result, buffer,
+-				     buflen, errnop, h_errnop, NULL, NULL);
++  status = gethostbyname3_context (ctx, name, AF_INET, result, buffer,
++				   buflen, errnop, h_errnop, NULL, NULL);
+   __resolv_context_put (ctx);
+   return status;
+ }
+@@ -648,7 +618,7 @@ static enum nss_status
+ getanswer_r (struct resolv_context *ctx,
+ 	     const querybuf *answer, int anslen, const char *qname, int qtype,
+ 	     struct hostent *result, char *buffer, size_t buflen,
+-	     int *errnop, int *h_errnop, int map, int32_t *ttlp, char **canonp)
++	     int *errnop, int *h_errnop, int32_t *ttlp, char **canonp)
+ {
+   struct host_data
+   {
+@@ -664,7 +634,6 @@ getanswer_r (struct resolv_context *ctx,
+   char *bp, **ap, **hap;
+   char tbuf[MAXDNAME];
+   u_char packtmp[NS_MAXCDNAME];
+-  int have_to_map = 0;
+   uintptr_t pad = -(uintptr_t) buffer % __alignof__ (struct host_data);
+   buffer += pad;
+   buflen = buflen > pad ? buflen - pad : 0;
+@@ -845,9 +814,7 @@ getanswer_r (struct resolv_context *ctx,
+ 	  continue;
+ 	}
+ 
+-      if (type == T_A && qtype == T_AAAA && map)
+-	have_to_map = 1;
+-      else if (__glibc_unlikely (type != qtype))
++      if (__glibc_unlikely (type != qtype))
+ 	{
+ 	  cp += n;
+ 	  continue;			/* XXX - had_error++ ? */
+@@ -944,9 +911,6 @@ getanswer_r (struct resolv_context *ctx,
+ 	  linebuflen -= n;
+ 	}
+ 
+-      if (have_to_map)
+-	if (map_v4v6_hostent (result, &bp, &linebuflen))
+-	  goto too_small;
+       *h_errnop = NETDB_SUCCESS;
+       return NSS_STATUS_SUCCESS;
+     }
+-- 
+2.38.1
+
+
+From 78c8ef21fa54e994451d5b42ead6080d99a88a49 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 30 Aug 2022 10:02:49 +0200
+Subject: nss_dns: Rewrite getanswer_r to match getanswer_ptr (bug 12154, bug
+ 29305)
+
+Allocate the pointer arrays only at the end, when their sizes
+are known.  This addresses bug 29305.
+
+Skip over invalid names instead of failing lookups.  This partially
+fixes bug 12154 (for gethostbyname, fixing getaddrinfo requires
+different changes).
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit d101d836e7e4bd1d4e4972b0e0bd0a55c9b650fa)
+---
+ resolv/nss_dns/dns-host.c | 478 ++++++++++++++------------------------
+ 1 file changed, 180 insertions(+), 298 deletions(-)
+
+diff --git a/resolv/nss_dns/dns-host.c b/resolv/nss_dns/dns-host.c
+index 8e38583e15..b887e77e9c 100644
+--- a/resolv/nss_dns/dns-host.c
++++ b/resolv/nss_dns/dns-host.c
+@@ -107,12 +107,19 @@ typedef union querybuf
+   u_char buf[MAXPACKET];
+ } querybuf;
+ 
+-static enum nss_status getanswer_r (struct resolv_context *ctx,
+-				    const querybuf *answer, int anslen,
+-				    const char *qname, int qtype,
+-				    struct hostent *result, char *buffer,
+-				    size_t buflen, int *errnop, int *h_errnop,
+-				    int32_t *ttlp, char **canonp);
++/* For historic reasons, pointers to IP addresses are char *, so use a
++   single list type for addresses and host names.  */
++#define DYNARRAY_STRUCT ptrlist
++#define DYNARRAY_ELEMENT char *
++#define DYNARRAY_PREFIX ptrlist_
++#include <malloc/dynarray-skeleton.c>
++
++static enum nss_status getanswer_r (unsigned char *packet, size_t packetlen,
++				    uint16_t qtype, struct alloc_buffer *abuf,
++				    struct ptrlist *addresses,
++				    struct ptrlist *aliases,
++				    int *errnop, int *h_errnop, int32_t *ttlp);
++static void addrsort (struct resolv_context *ctx, char **ap, int num);
+ static enum nss_status getanswer_ptr (unsigned char *packet, size_t packetlen,
+ 				      struct alloc_buffer *abuf,
+ 				      char **hnamep, int *errnop,
+@@ -184,12 +191,6 @@ gethostbyname3_context (struct resolv_context *ctx,
+ 			char *buffer, size_t buflen, int *errnop,
+ 			int *h_errnop, int32_t *ttlp, char **canonp)
+ {
+-  union
+-  {
+-    querybuf *buf;
+-    u_char *ptr;
+-  } host_buffer;
+-  querybuf *orig_host_buffer;
+   char tmp[NS_MAXDNAME];
+   int size, type, n;
+   const char *cp;
+@@ -223,10 +224,12 @@ gethostbyname3_context (struct resolv_context *ctx,
+       && (cp = __res_context_hostalias (ctx, name, tmp, sizeof (tmp))) != NULL)
+     name = cp;
+ 
+-  host_buffer.buf = orig_host_buffer = (querybuf *) alloca (1024);
++  unsigned char dns_packet_buffer[1024];
++  unsigned char *alt_dns_packet_buffer = dns_packet_buffer;
+ 
+-  n = __res_context_search (ctx, name, C_IN, type, host_buffer.buf->buf,
+-			    1024, &host_buffer.ptr, NULL, NULL, NULL, NULL);
++  n = __res_context_search (ctx, name, C_IN, type,
++			    dns_packet_buffer, sizeof (dns_packet_buffer),
++			    &alt_dns_packet_buffer, NULL, NULL, NULL, NULL);
+   if (n < 0)
+     {
+       switch (errno)
+@@ -255,12 +258,77 @@ gethostbyname3_context (struct resolv_context *ctx,
+ 	__set_errno (olderr);
+     }
+   else
+-    status = getanswer_r
+-      (ctx, host_buffer.buf, n, name, type, result, buffer, buflen,
+-       errnop, h_errnop, ttlp, canonp);
++    {
++      struct alloc_buffer abuf = alloc_buffer_create (buffer, buflen);
+ 
+-  if (host_buffer.buf != orig_host_buffer)
+-    free (host_buffer.buf);
++      struct ptrlist addresses;
++      ptrlist_init (&addresses);
++      struct ptrlist aliases;
++      ptrlist_init (&aliases);
++
++      status = getanswer_r (alt_dns_packet_buffer, n, type,
++			    &abuf, &addresses, &aliases,
++			    errnop, h_errnop, ttlp);
++      if (status == NSS_STATUS_SUCCESS)
++	{
++	  if (ptrlist_has_failed (&addresses)
++	      || ptrlist_has_failed (&aliases))
++	    {
++	      /* malloc failure.  Do not retry using the ERANGE protocol.  */
++	      *errnop = ENOMEM;
++	      *h_errnop = NETDB_INTERNAL;
++	      status = NSS_STATUS_UNAVAIL;
++	    }
++
++	  /* Reserve the address and alias arrays in the result
++	     buffer.  Both are NULL-terminated, but the first element
++	     of the alias array is stored in h_name, so no extra space
++	     for the NULL terminator is needed there.  */
++	  result->h_addr_list
++	    = alloc_buffer_alloc_array (&abuf, char *,
++					ptrlist_size (&addresses) + 1);
++	  result->h_aliases
++	    = alloc_buffer_alloc_array (&abuf, char *,
++					ptrlist_size (&aliases));
++	  if (alloc_buffer_has_failed (&abuf))
++	    {
++	      /* Retry using the ERANGE protocol.  */
++	      *errnop = ERANGE;
++	      *h_errnop = NETDB_INTERNAL;
++	      status = NSS_STATUS_TRYAGAIN;
++	    }
++	  else
++	    {
++	      /* Copy the address list and NULL-terminate it.  */
++	      memcpy (result->h_addr_list, ptrlist_begin (&addresses),
++		      ptrlist_size (&addresses) * sizeof (char *));
++	      result->h_addr_list[ptrlist_size (&addresses)] = NULL;
++
++	      /* Sort the address list if requested.  */
++	      if (type == T_A && __resolv_context_sort_count (ctx) > 0)
++		addrsort (ctx, result->h_addr_list, ptrlist_size (&addresses));
++
++	      /* Copy the aliases,  excluding the last one. */
++	      memcpy (result->h_aliases, ptrlist_begin (&aliases),
++		      (ptrlist_size (&aliases) - 1) * sizeof (char *));
++	      result->h_aliases[ptrlist_size (&aliases) - 1] = NULL;
++
++	      /* The last alias goes into h_name.  */
++	      assert (ptrlist_size (&aliases) >= 1);
++	      result->h_name = ptrlist_end (&aliases)[-1];
++
++	      /* This is also the canonical name.  */
++	      if (canonp != NULL)
++		*canonp = result->h_name;
++	    }
++	}
++
++      ptrlist_free (&aliases);
++      ptrlist_free (&addresses);
++    }
++
++  if (alt_dns_packet_buffer != dns_packet_buffer)
++    free (alt_dns_packet_buffer);
+   return status;
+ }
+ 
+@@ -614,314 +682,128 @@ addrsort (struct resolv_context *ctx, char **ap, int num)
+ 	break;
+ }
+ 
+-static enum nss_status
+-getanswer_r (struct resolv_context *ctx,
+-	     const querybuf *answer, int anslen, const char *qname, int qtype,
+-	     struct hostent *result, char *buffer, size_t buflen,
+-	     int *errnop, int *h_errnop, int32_t *ttlp, char **canonp)
++/* Convert the uncompressed, binary domain name CDNAME into its
++   textual representation and add it to the end of ALIASES, allocating
++   space for a copy of the name from ABUF.  Skip adding the name if it
++   is not a valid host name, and return false in that case, otherwise
++   true.  */
++static bool
++getanswer_r_store_alias (const unsigned char *cdname,
++			 struct alloc_buffer *abuf,
++			 struct ptrlist *aliases)
+ {
+-  struct host_data
+-  {
+-    char *aliases[MAX_NR_ALIASES];
+-    unsigned char host_addr[16];	/* IPv4 or IPv6 */
+-    char *h_addr_ptrs[0];
+-  } *host_data;
+-  int linebuflen;
+-  const HEADER *hp;
+-  const u_char *end_of_message, *cp;
+-  int n, ancount, qdcount;
+-  int haveanswer, had_error;
+-  char *bp, **ap, **hap;
+-  char tbuf[MAXDNAME];
+-  u_char packtmp[NS_MAXCDNAME];
+-  uintptr_t pad = -(uintptr_t) buffer % __alignof__ (struct host_data);
+-  buffer += pad;
+-  buflen = buflen > pad ? buflen - pad : 0;
+-  if (__glibc_unlikely (buflen < sizeof (struct host_data)))
+-    {
+-      /* The buffer is too small.  */
+-    too_small:
+-      *errnop = ERANGE;
+-      *h_errnop = NETDB_INTERNAL;
+-      return NSS_STATUS_TRYAGAIN;
+-    }
+-  host_data = (struct host_data *) buffer;
+-  linebuflen = buflen - sizeof (struct host_data);
+-  if (buflen - sizeof (struct host_data) != linebuflen)
+-    linebuflen = INT_MAX;
+-
+-  result->h_name = NULL;
+-  end_of_message = answer->buf + anslen;
+-
+-  /*
+-   * find first satisfactory answer
+-   */
+-  hp = &answer->hdr;
+-  ancount = ntohs (hp->ancount);
+-  qdcount = ntohs (hp->qdcount);
+-  cp = answer->buf + HFIXEDSZ;
+-  if (__glibc_unlikely (qdcount != 1))
+-    {
+-      *h_errnop = NO_RECOVERY;
+-      return NSS_STATUS_UNAVAIL;
+-    }
+-  if (sizeof (struct host_data) + (ancount + 1) * sizeof (char *) >= buflen)
+-    goto too_small;
+-  bp = (char *) &host_data->h_addr_ptrs[ancount + 1];
+-  linebuflen -= (ancount + 1) * sizeof (char *);
+-
+-  n = __ns_name_unpack (answer->buf, end_of_message, cp,
+-			packtmp, sizeof packtmp);
+-  if (n != -1 && __ns_name_ntop (packtmp, bp, linebuflen) == -1)
+-    {
+-      if (__glibc_unlikely (errno == EMSGSIZE))
+-	goto too_small;
+-
+-      n = -1;
+-    }
++  /* Filter out domain names that are not host names.  */
++  if (!__res_binary_hnok (cdname))
++    return false;
++
++  /* Note: Not NS_MAXCDNAME, so that __ns_name_ntop implicitly checks
++     for length.  */
++  char dname[MAXHOSTNAMELEN + 1];
++  if (__ns_name_ntop (cdname, dname, sizeof (dname)) < 0)
++    return false;
++  /* Do not report an error on allocation failure, instead store NULL
++     or do nothing.  getanswer_r's caller will see NSS_STATUS_SUCCESS
++     and detect the memory allocation failure or buffer space
++     exhaustion, and report it accordingly.  */
++  ptrlist_add (aliases, alloc_buffer_copy_string (abuf, dname));
++  return true;
++}
+ 
+-  if (__glibc_unlikely (n < 0))
+-    {
+-      *errnop = errno;
+-      *h_errnop = NO_RECOVERY;
+-      return NSS_STATUS_UNAVAIL;
+-    }
+-  if (__glibc_unlikely (__libc_res_hnok (bp) == 0))
++static enum nss_status __attribute__ ((noinline))
++getanswer_r (unsigned char *packet, size_t packetlen, uint16_t qtype,
++	     struct alloc_buffer *abuf,
++	     struct ptrlist *addresses, struct ptrlist *aliases,
++	     int *errnop, int *h_errnop, int32_t *ttlp)
++{
++  struct ns_rr_cursor c;
++  if (!__ns_rr_cursor_init (&c, packet, packetlen))
+     {
+-      errno = EBADMSG;
+-      *errnop = EBADMSG;
++      /* This should not happen because __res_context_query already
++	 perfroms response validation.  */
+       *h_errnop = NO_RECOVERY;
+       return NSS_STATUS_UNAVAIL;
+     }
+-  cp += n + QFIXEDSZ;
+ 
+-  if (qtype == T_A || qtype == T_AAAA)
++  /* Treat the QNAME just like an alias.  Error out if it is not a
++     valid host name.  */
++  if (ns_rr_cursor_rcode (&c) == NXDOMAIN
++      || !getanswer_r_store_alias (ns_rr_cursor_qname (&c), abuf, aliases))
+     {
+-      /* res_send() has already verified that the query name is the
+-       * same as the one we sent; this just gets the expanded name
+-       * (i.e., with the succeeding search-domain tacked on).
+-       */
+-      n = strlen (bp) + 1;             /* for the \0 */
+-      if (n >= MAXHOSTNAMELEN)
+-	{
+-	  *h_errnop = NO_RECOVERY;
+-	  *errnop = ENOENT;
+-	  return NSS_STATUS_TRYAGAIN;
+-	}
+-      result->h_name = bp;
+-      bp += n;
+-      linebuflen -= n;
+-      if (linebuflen < 0)
+-	goto too_small;
+-      /* The qname can be abbreviated, but h_name is now absolute. */
+-      qname = result->h_name;
++      if (ttlp != NULL)
++	/* No negative caching.  */
++	*ttlp = 0;
++      *h_errnop = HOST_NOT_FOUND;
++      *errnop = ENOENT;
++      return NSS_STATUS_NOTFOUND;
+     }
+ 
+-  ap = host_data->aliases;
+-  *ap = NULL;
+-  result->h_aliases = host_data->aliases;
+-  hap = host_data->h_addr_ptrs;
+-  *hap = NULL;
+-  result->h_addr_list = host_data->h_addr_ptrs;
+-  haveanswer = 0;
+-  had_error = 0;
++  int ancount = ns_rr_cursor_ancount (&c);
++  const unsigned char *expected_name = ns_rr_cursor_qname (&c);
++  /* expected_name may be updated to point into this buffer.  */
++  unsigned char name_buffer[NS_MAXCDNAME];
+ 
+-  while (ancount-- > 0 && cp < end_of_message && had_error == 0)
++  for (; ancount > 0; --ancount)
+     {
+-      int type, class;
+-
+-      n = __ns_name_unpack (answer->buf, end_of_message, cp,
+-			    packtmp, sizeof packtmp);
+-      if (n != -1 && __ns_name_ntop (packtmp, bp, linebuflen) == -1)
+-	{
+-	  if (__glibc_unlikely (errno == EMSGSIZE))
+-	    goto too_small;
+-
+-	  n = -1;
+-	}
+-
+-      if (__glibc_unlikely (n < 0 || __libc_res_hnok (bp) == 0))
+-	{
+-	  ++had_error;
+-	  continue;
+-	}
+-      cp += n;				/* name */
+-
+-      if (__glibc_unlikely (cp + 10 > end_of_message))
++      struct ns_rr_wire rr;
++      if (!__ns_rr_cursor_next (&c, &rr))
+ 	{
+-	  ++had_error;
+-	  continue;
++	  *h_errnop = NO_RECOVERY;
++	  return NSS_STATUS_UNAVAIL;
+ 	}
+ 
+-      NS_GET16 (type, cp);
+-      NS_GET16 (class, cp);
+-      int32_t ttl;
+-      NS_GET32 (ttl, cp);
+-      NS_GET16 (n, cp);		/* RDATA length.  */
+-
+-      if (end_of_message - cp < n)
+-	{
+-	  /* RDATA extends beyond the end of the packet.  */
+-	  ++had_error;
+-	  continue;
+-	}
++      /* Skip over records with the wrong class.  */
++      if (rr.rclass != C_IN)
++	continue;
+ 
+-      if (__glibc_unlikely (class != C_IN))
+-	{
+-	  /* XXX - debug? syslog? */
+-	  cp += n;
+-	  continue;			/* XXX - had_error++ ? */
+-	}
++      /* Update TTL for recognized record types.  */
++      if ((rr.rtype == T_CNAME || rr.rtype == qtype)
++	  && ttlp != NULL && *ttlp > rr.ttl)
++	*ttlp = rr.ttl;
+ 
+-      if (type == T_CNAME)
++      if (rr.rtype == T_CNAME)
+ 	{
+-	  /* A CNAME could also have a TTL entry.  */
+-	  if (ttlp != NULL && ttl < *ttlp)
+-	      *ttlp = ttl;
+-
+-	  if (ap >= &host_data->aliases[MAX_NR_ALIASES - 1])
+-	    continue;
+-	  n = __libc_dn_expand (answer->buf, end_of_message, cp,
+-				tbuf, sizeof tbuf);
+-	  if (__glibc_unlikely (n < 0 || __libc_res_hnok (tbuf) == 0))
+-	    {
+-	      ++had_error;
+-	      continue;
+-	    }
+-	  cp += n;
+-	  /* Store alias.  */
+-	  *ap++ = bp;
+-	  n = strlen (bp) + 1;		/* For the \0.  */
+-	  if (__glibc_unlikely (n >= MAXHOSTNAMELEN))
+-	    {
+-	      ++had_error;
+-	      continue;
+-	    }
+-	  bp += n;
+-	  linebuflen -= n;
+-	  /* Get canonical name.  */
+-	  n = strlen (tbuf) + 1;	/* For the \0.  */
+-	  if (__glibc_unlikely (n > linebuflen))
+-	    goto too_small;
+-	  if (__glibc_unlikely (n >= MAXHOSTNAMELEN))
++	  /* NB: No check for owner name match, based on historic
++	     precedent.  Record the CNAME target as the new expected
++	     name.  */
++	  int n = __ns_name_unpack (c.begin, c.end, rr.rdata,
++				    name_buffer, sizeof (name_buffer));
++	  if (n < 0)
+ 	    {
+-	      ++had_error;
+-	      continue;
++	      *h_errnop = NO_RECOVERY;
++	      return NSS_STATUS_UNAVAIL;
+ 	    }
+-	  result->h_name = bp;
+-	  bp = __mempcpy (bp, tbuf, n);	/* Cannot overflow.  */
+-	  linebuflen -= n;
+-	  continue;
++	  /* And store the new name as an alias.  */
++	  getanswer_r_store_alias (name_buffer, abuf, aliases);
++	  expected_name = name_buffer;
+ 	}
+-
+-      if (__glibc_unlikely (type != qtype))
++      else if (rr.rtype == qtype
++	       && __ns_samebinaryname (rr.rname, expected_name)
++	       && rr.rdlength == rrtype_to_rdata_length (qtype))
+ 	{
+-	  cp += n;
+-	  continue;			/* XXX - had_error++ ? */
++	  /* Make a copy of the address and store it.  Increase the
++	     alignment to 4, in case there are applications out there
++	     that expect at least this level of address alignment.  */
++	  ptrlist_add (addresses, (char *) alloc_buffer_next (abuf, uint32_t));
++	  alloc_buffer_copy_bytes (abuf, rr.rdata, rr.rdlength);
+ 	}
+-
+-      switch (type)
+-	{
+-	case T_A:
+-	case T_AAAA:
+-	  if (__glibc_unlikely (__strcasecmp (result->h_name, bp) != 0))
+-	    {
+-	      cp += n;
+-	      continue;			/* XXX - had_error++ ? */
+-	    }
+-
+-	  /* Stop parsing at a record whose length is incorrect.  */
+-	  if (n != rrtype_to_rdata_length (type))
+-	    {
+-	      ++had_error;
+-	      break;
+-	    }
+-
+-	  /* Skip records of the wrong type.  */
+-	  if (n != result->h_length)
+-	    {
+-	      cp += n;
+-	      continue;
+-	    }
+-	  if (!haveanswer)
+-	    {
+-	      int nn;
+-
+-	      /* We compose a single hostent out of the entire chain of
+-	         entries, so the TTL of the hostent is essentially the lowest
+-		 TTL in the chain.  */
+-	      if (ttlp != NULL && ttl < *ttlp)
+-		*ttlp = ttl;
+-	      if (canonp != NULL)
+-		*canonp = bp;
+-	      result->h_name = bp;
+-	      nn = strlen (bp) + 1;	/* for the \0 */
+-	      bp += nn;
+-	      linebuflen -= nn;
+-	    }
+-
+-	  /* Provide sufficient alignment for both address
+-	     families.  */
+-	  enum { align = 4 };
+-	  _Static_assert ((align % __alignof__ (struct in_addr)) == 0,
+-			  "struct in_addr alignment");
+-	  _Static_assert ((align % __alignof__ (struct in6_addr)) == 0,
+-			  "struct in6_addr alignment");
+-	  {
+-	    char *new_bp = PTR_ALIGN_UP (bp, align);
+-	    linebuflen -= new_bp - bp;
+-	    bp = new_bp;
+-	  }
+-
+-	  if (__glibc_unlikely (n > linebuflen))
+-	    goto too_small;
+-	  bp = __mempcpy (*hap++ = bp, cp, n);
+-	  cp += n;
+-	  linebuflen -= n;
+-	  break;
+-	default:
+-	  abort ();
+-	}
+-      if (had_error == 0)
+-	++haveanswer;
+     }
+ 
+-  if (haveanswer > 0)
++  if (ptrlist_size (addresses) == 0)
+     {
+-      *ap = NULL;
+-      *hap = NULL;
+-      /*
+-       * Note: we sort even if host can take only one address
+-       * in its return structures - should give it the "best"
+-       * address in that case, not some random one
+-       */
+-      if (haveanswer > 1 && qtype == T_A
+-	  && __resolv_context_sort_count (ctx) > 0)
+-	addrsort (ctx, host_data->h_addr_ptrs, haveanswer);
+-
+-      if (result->h_name == NULL)
+-	{
+-	  n = strlen (qname) + 1;	/* For the \0.  */
+-	  if (n > linebuflen)
+-	    goto too_small;
+-	  if (n >= MAXHOSTNAMELEN)
+-	    goto no_recovery;
+-	  result->h_name = bp;
+-	  bp = __mempcpy (bp, qname, n);	/* Cannot overflow.  */
+-	  linebuflen -= n;
+-	}
++      /* No address record found.  */
++      if (ttlp != NULL)
++	/* No caching of negative responses.  */
++	*ttlp = 0;
+ 
++      *h_errnop = NO_RECOVERY;
++      *errnop = ENOENT;
++      return NSS_STATUS_TRYAGAIN;
++    }
++  else
++    {
+       *h_errnop = NETDB_SUCCESS;
+       return NSS_STATUS_SUCCESS;
+     }
+- no_recovery:
+-  *h_errnop = NO_RECOVERY;
+-  *errnop = ENOENT;
+-  /* Special case here: if the resolver sent a result but it only
+-     contains a CNAME while we are looking for a T_A or T_AAAA record,
+-     we fail with NOTFOUND instead of TRYAGAIN.  */
+-  return ((qtype == T_A || qtype == T_AAAA) && ap != host_data->aliases
+-	   ? NSS_STATUS_NOTFOUND : NSS_STATUS_TRYAGAIN);
+ }
+ 
+ static enum nss_status
+-- 
+2.38.1
+
+
+From 7a236dc44a22dc4252e803d1ee1d3b970ec43805 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 30 Aug 2022 10:02:49 +0200
+Subject: nss_dns: In gaih_getanswer_slice, skip strange aliases (bug 12154)
+
+If the name is not a host name, skip adding it to the result, instead
+of reporting query failure.  This fixes bug 12154 for getaddrinfo.
+
+This commit still keeps the old parsing code, and only adjusts when
+a host name is copied.
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit 32b599ac8c21c4c332cc3900a792a1395bca79c7)
+---
+ resolv/nss_dns/dns-host.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/resolv/nss_dns/dns-host.c b/resolv/nss_dns/dns-host.c
+index b887e77e9c..bea505d697 100644
+--- a/resolv/nss_dns/dns-host.c
++++ b/resolv/nss_dns/dns-host.c
+@@ -970,12 +970,12 @@ gaih_getanswer_slice (const querybuf *answer, int anslen, const char *qname,
+ 
+ 	  n = -1;
+ 	}
+-      if (__glibc_unlikely (n < 0 || __libc_res_hnok (buffer) == 0))
++      if (__glibc_unlikely (n < 0))
+ 	{
+ 	  ++had_error;
+ 	  continue;
+ 	}
+-      if (*firstp && canon == NULL)
++      if (*firstp && canon == NULL && __libc_res_hnok (buffer))
+ 	{
+ 	  h_name = buffer;
+ 	  buffer += h_namelen;
+@@ -1021,14 +1021,14 @@ gaih_getanswer_slice (const querybuf *answer, int anslen, const char *qname,
+ 
+ 	  n = __libc_dn_expand (answer->buf, end_of_message, cp,
+ 				tbuf, sizeof tbuf);
+-	  if (__glibc_unlikely (n < 0 || __libc_res_hnok (tbuf) == 0))
++	  if (__glibc_unlikely (n < 0))
+ 	    {
+ 	      ++had_error;
+ 	      continue;
+ 	    }
+ 	  cp += n;
+ 
+-	  if (*firstp)
++	  if (*firstp && __libc_res_hnok (tbuf))
+ 	    {
+ 	      /* Reclaim buffer space.  */
+ 	      if (h_name + h_namelen == buffer)
+-- 
+2.38.1
+
+
+From e2ec6a8db38a6b734bbdb41e498fdc9460f7566a Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 30 Aug 2022 10:02:49 +0200
+Subject: resolv: Add new tst-resolv-invalid-cname
+
+This test checks resolution through CNAME chains that do not contain
+host names (bug 12154).
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit 9caf782276ecea4bc86fc94fbb52779736f3106d)
+---
+ resolv/Makefile                   |   3 +
+ resolv/tst-resolv-invalid-cname.c | 406 ++++++++++++++++++++++++++++++
+ 2 files changed, 409 insertions(+)
+ create mode 100644 resolv/tst-resolv-invalid-cname.c
+
+diff --git a/resolv/Makefile b/resolv/Makefile
+index 018b1808d6..f8a92c6cff 100644
+--- a/resolv/Makefile
++++ b/resolv/Makefile
+@@ -98,6 +98,7 @@ tests += \
+   tst-resolv-binary \
+   tst-resolv-byaddr \
+   tst-resolv-edns \
++  tst-resolv-invalid-cname \
+   tst-resolv-network \
+   tst-resolv-noaaaa \
+   tst-resolv-nondecimal \
+@@ -287,6 +288,8 @@ $(objpfx)tst-resolv-res_init-multi: $(objpfx)libresolv.so \
+   $(shared-thread-library)
+ $(objpfx)tst-resolv-res_init-thread: $(objpfx)libresolv.so \
+   $(shared-thread-library)
++$(objpfx)tst-resolv-invalid-cname: $(objpfx)libresolv.so \
++  $(shared-thread-library)
+ $(objpfx)tst-resolv-noaaaa: $(objpfx)libresolv.so $(shared-thread-library)
+ $(objpfx)tst-resolv-nondecimal: $(objpfx)libresolv.so $(shared-thread-library)
+ $(objpfx)tst-resolv-qtypes: $(objpfx)libresolv.so $(shared-thread-library)
+diff --git a/resolv/tst-resolv-invalid-cname.c b/resolv/tst-resolv-invalid-cname.c
+new file mode 100644
+index 0000000000..ae2d4419b1
+--- /dev/null
++++ b/resolv/tst-resolv-invalid-cname.c
+@@ -0,0 +1,406 @@
++/* Test handling of CNAMEs with non-host domain names (bug 12154).
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <errno.h>
++#include <netdb.h>
++#include <resolv.h>
++#include <stdlib.h>
++#include <string.h>
++#include <support/check.h>
++#include <support/check_nss.h>
++#include <support/resolv_test.h>
++#include <support/support.h>
++#include <support/xmemstream.h>
++
++/* Query strings describe the CNAME chain in the response.  They have
++   the format "bitsBITS.countCOUNT.example.", where BITS and COUNT are
++   replaced by unsigned decimal numbers.  COUNT is the number of CNAME
++   records in the response.  BITS has two bits for each CNAME record,
++   describing a special prefix that is added to that CNAME.
++
++   0: No special leading label.
++   1: Starting with "*.".
++   2: Starting with "-x.".
++   3: Starting with "star.*.".
++
++   The first CNAME in the response using the two least significant
++   bits.
++
++   For PTR queries, the QNAME format is different, it is either
++   COUNT.BITS.168.192.in-addr.arpa. (with BITS and COUNT still
++   decimal), or:
++
++COUNT.BITS0.BITS1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa.
++
++   where BITS and COUNT are hexadecimal.  */
++
++static void
++response (const struct resolv_response_context *ctx,
++          struct resolv_response_builder *b,
++          const char *qname, uint16_t qclass, uint16_t qtype)
++{
++  TEST_COMPARE (qclass, C_IN);
++
++  /* The only other query type besides A is PTR.  */
++  if (qtype != T_A && qtype != T_AAAA)
++    TEST_COMPARE (qtype, T_PTR);
++
++  unsigned int bits, bits1, count;
++  char *tail = NULL;
++  if (sscanf (qname, "bits%u.count%u.%ms", &bits, &count, &tail) == 3)
++    TEST_COMPARE_STRING (tail, "example");
++  else if (strstr (qname, "in-addr.arpa") != NULL
++           && sscanf (qname, "%u.%u.%ms", &bits, &count, &tail) == 3)
++    TEST_COMPARE_STRING (tail, "168.192.in-addr.arpa");
++  else if (sscanf (qname, "%x.%x.%x.%ms", &bits, &bits1, &count, &tail) == 4)
++    {
++      TEST_COMPARE_STRING (tail, "\
++0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa");
++      bits |= bits1 << 4;
++    }
++  else
++    FAIL_EXIT1 ("invalid QNAME: %s\n", qname);
++  free (tail);
++
++  struct resolv_response_flags flags = {};
++  resolv_response_init (b, flags);
++  resolv_response_add_question (b, qname, qclass, qtype);
++  resolv_response_section (b, ns_s_an);
++
++  /* Provide the requested number of CNAME records.  */
++  char *previous_name = (char *) qname;
++  unsigned int original_bits = bits;
++  for (int unique = 0; unique < count; ++unique)
++    {
++      resolv_response_open_record (b, previous_name, qclass, T_CNAME, 60);
++
++      static const char bits_to_prefix[4][8] = { "", "*.", "-x.", "star.*." };
++      char *new_name = xasprintf ("%sunique%d.example",
++                                  bits_to_prefix[bits & 3], unique);
++      bits >>= 2;
++      resolv_response_add_name (b, new_name);
++      resolv_response_close_record (b);
++
++      if (previous_name != qname)
++        free (previous_name);
++      previous_name = new_name;
++    }
++
++  /* Actual answer record.  */
++  resolv_response_open_record (b, previous_name, qclass, qtype, 60);
++  switch (qtype)
++    {
++    case T_A:
++      {
++        char ipv4[4] = {192, 168, count, original_bits};
++        resolv_response_add_data (b, &ipv4, sizeof (ipv4));
++      }
++      break;
++    case T_AAAA:
++      {
++        char ipv6[16] =
++          {
++            0x20, 0x01, 0xd, 0xb8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
++            count, original_bits
++          };
++        resolv_response_add_data (b, &ipv6, sizeof (ipv6));
++      }
++      break;
++
++    case T_PTR:
++      {
++        char *name = xasprintf ("bits%u.count%u.example",
++                                original_bits, count);
++        resolv_response_add_name (b, name);
++        free (name);
++      }
++      break;
++    }
++  resolv_response_close_record (b);
++
++  if (previous_name != qname)
++    free (previous_name);
++}
++
++/* Controls which name resolution function is invoked.  */
++enum test_mode
++  {
++    byname,                     /* gethostbyname.  */
++    byname2,                    /* gethostbyname2.  */
++    gai,                        /* getaddrinfo without AI_CANONNAME.  */
++    gai_canon,                  /* getaddrinfo with AI_CANONNAME.  */
++
++    test_mode_num               /* Number of enum values.  */
++  };
++
++static const char *
++test_mode_to_string (enum test_mode mode)
++{
++  switch (mode)
++    {
++    case byname:
++      return "byname";
++    case byname2:
++      return "byname2";
++    case gai:
++      return "gai";
++    case gai_canon:
++      return "gai_canon";
++    case test_mode_num:
++      /* Report error below.  */
++    }
++  FAIL_EXIT1 ("invalid test_mode: %d", mode);
++}
++
++/* Append the name and aliases to OUT.  */
++static void
++append_names (FILE *out, const char *qname, int bits, int count,
++              enum test_mode mode)
++{
++  /* Largest valid index which has a corresponding zero in bits
++     (meaning a syntactically valid CNAME).  */
++  int last_valid_cname = -1;
++
++  for (int i = 0; i < count; ++i)
++    if ((bits & (3 << (i * 2))) == 0)
++      last_valid_cname = i;
++
++  if (mode != gai)
++    {
++      const char *label;
++      if (mode == gai_canon)
++        label = "canonname";
++      else
++        label = "name";
++      if (last_valid_cname >= 0)
++        fprintf (out, "%s: unique%d.example\n", label, last_valid_cname);
++      else
++        fprintf (out, "%s: %s\n", label, qname);
++    }
++
++  if (mode == byname || mode == byname2)
++    {
++      if (last_valid_cname >= 0)
++        fprintf (out, "alias: %s\n", qname);
++      for (int i = 0; i < count; ++i)
++        {
++          if ((bits & (3 << (i * 2))) == 0 && i != last_valid_cname)
++            fprintf (out, "alias: unique%d.example\n", i);
++        }
++    }
++}
++
++/* Append the address information to OUT.  */
++static void
++append_addresses (FILE *out, int af, int bits, int count, enum test_mode mode)
++{
++  int last = count * 256 + bits;
++  if (mode == gai || mode == gai_canon)
++    {
++      if (af == AF_INET || af == AF_UNSPEC)
++        fprintf (out, "address: STREAM/TCP 192.168.%d.%d 80\n", count, bits);
++      if (af == AF_INET6 || af == AF_UNSPEC)
++        {
++          if (last == 0)
++            fprintf (out, "address: STREAM/TCP 2001:db8:: 80\n");
++          else
++            fprintf (out, "address: STREAM/TCP 2001:db8::%x 80\n", last);
++        }
++    }
++  else
++    {
++      TEST_VERIFY (af != AF_UNSPEC);
++      if (af == AF_INET)
++        fprintf (out, "address: 192.168.%d.%d\n", count, bits);
++      if (af == AF_INET6)
++        {
++          if (last == 0)
++            fprintf (out, "address: 2001:db8::\n");
++          else
++            fprintf (out, "address: 2001:db8::%x\n", last);
++        }
++    }
++}
++
++/* Perform one test using a forward lookup.  */
++static void
++check_forward (int af, int bits, int count, enum test_mode mode)
++{
++  char *qname = xasprintf ("bits%d.count%d.example", bits, count);
++  char *label = xasprintf ("af=%d bits=%d count=%d mode=%s qname=%s",
++                           af, bits, count, test_mode_to_string (mode), qname);
++
++  struct xmemstream expected;
++  xopen_memstream (&expected);
++  if (mode == gai_canon)
++    fprintf (expected.out, "flags: AI_CANONNAME\n");
++  append_names (expected.out, qname, bits, count, mode);
++  append_addresses (expected.out, af, bits, count, mode);
++  xfclose_memstream (&expected);
++
++  if (mode == gai || mode == gai_canon)
++    {
++      struct addrinfo *ai;
++      struct addrinfo hints =
++        {
++          .ai_family = af,
++          .ai_socktype = SOCK_STREAM,
++        };
++      if (mode == gai_canon)
++        hints.ai_flags |= AI_CANONNAME;
++      int ret = getaddrinfo (qname, "80", &hints, &ai);
++      check_addrinfo (label, ai, ret, expected.buffer);
++      if (ret == 0)
++        freeaddrinfo (ai);
++    }
++  else
++    {
++      struct hostent *e;
++      if (mode == gai)
++        {
++          TEST_COMPARE (af, AF_INET);
++          e = gethostbyname (qname);
++        }
++      else
++        {
++          if (af != AF_INET)
++            TEST_COMPARE (af, AF_INET6);
++          e = gethostbyname2 (qname, af);
++        }
++      check_hostent (label, e, expected.buffer);
++    }
++
++  free (expected.buffer);
++  free (label);
++  free (qname);
++}
++
++/* Perform one check using a reverse lookup.  */
++
++static void
++check_reverse (int af, int bits, int count)
++{
++  TEST_VERIFY (af == AF_INET || af == AF_INET6);
++
++  char *label = xasprintf ("af=%d bits=%d count=%d", af, bits, count);
++  char *fqdn = xasprintf ("bits%d.count%d.example", bits, count);
++
++  struct xmemstream expected;
++  xopen_memstream (&expected);
++  fprintf (expected.out, "name: %s\n", fqdn);
++  append_addresses (expected.out, af, bits, count, byname);
++  xfclose_memstream (&expected);
++
++  char addr[16] = { 0 };
++  socklen_t addrlen;
++  if (af == AF_INET)
++    {
++      addr[0] = 192;
++      addr[1] = 168;
++      addr[2] = count;
++      addr[3] = bits;
++      addrlen = 4;
++    }
++  else
++    {
++      addr[0] = 0x20;
++      addr[1] = 0x01;
++      addr[2] = 0x0d;
++      addr[3] = 0xb8;
++      addr[14] = count;
++      addr[15] = bits;
++      addrlen = 16;
++    }
++
++  struct hostent *e = gethostbyaddr (addr, addrlen, af);
++  check_hostent (label, e, expected.buffer);
++
++  /* getnameinfo check is different.  There is no generic check_*
++     function for it.  */
++  {
++    struct sockaddr_in sin = { };
++    struct sockaddr_in6 sin6 = { };
++    void *sa;
++    socklen_t salen;
++    if (af == AF_INET)
++      {
++        sin.sin_family = AF_INET;
++        memcpy (&sin.sin_addr, addr, addrlen);
++        sin.sin_port = htons (80);
++        sa = &sin;
++        salen = sizeof (sin);
++      }
++    else
++      {
++        sin6.sin6_family = AF_INET6;
++        memcpy (&sin6.sin6_addr, addr, addrlen);
++        sin6.sin6_port = htons (80);
++        sa = &sin6;
++        salen = sizeof (sin6);
++      }
++
++    char host[64];
++    char service[64];
++    int ret = getnameinfo (sa, salen, host,
++                           sizeof (host), service, sizeof (service),
++                           NI_NAMEREQD | NI_NUMERICSERV);
++    TEST_COMPARE (ret, 0);
++    TEST_COMPARE_STRING (host, fqdn);
++    TEST_COMPARE_STRING (service, "80");
++  }
++
++  free (expected.buffer);
++  free (fqdn);
++  free (label);
++}
++
++static int
++do_test (void)
++{
++  struct resolv_test *obj = resolv_test_start
++    ((struct resolv_redirect_config)
++     {
++       .response_callback = response
++     });
++
++  for (int count = 0; count <= 3; ++count)
++    for (int bits = 0; bits <= 1 << (count * 2); ++bits)
++      {
++        if (count > 0 && bits == count)
++          /* The last bits value is only checked if count == 0.  */
++          continue;
++
++        for (enum test_mode mode = 0; mode < test_mode_num; ++mode)
++          {
++            check_forward (AF_INET, bits, count, mode);
++            if (mode != byname)
++              check_forward (AF_INET6, bits, count, mode);
++            if (mode == gai || mode == gai_canon)
++              check_forward (AF_UNSPEC, bits, count, mode);
++          }
++
++        check_reverse (AF_INET, bits, count);
++        check_reverse (AF_INET6, bits, count);
++      }
++
++  resolv_test_end (obj);
++
++  return 0;
++}
++
++#include <support/test-driver.c>
+-- 
+2.38.1
+
+
+From c5cdb39c20e96d9ac0d46fc7284b8276a537fd35 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 30 Aug 2022 10:02:49 +0200
+Subject: nss_dns: Rewrite _nss_dns_gethostbyname4_r using current interfaces
+
+Introduce struct alloc_buffer to this function, and use it and
+struct ns_rr_cursor in gaih_getanswer_slice.  Adjust gaih_getanswer
+and gaih_getanswer_noaaaa accordingly.
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit 1d495912a746e2a1ffb780c9a81fd234ec2464e8)
+---
+ resolv/nss_dns/dns-host.c | 443 ++++++++++++++------------------------
+ 1 file changed, 162 insertions(+), 281 deletions(-)
+
+diff --git a/resolv/nss_dns/dns-host.c b/resolv/nss_dns/dns-host.c
+index bea505d697..9fa81f23c8 100644
+--- a/resolv/nss_dns/dns-host.c
++++ b/resolv/nss_dns/dns-host.c
+@@ -100,13 +100,6 @@
+ #endif
+ #define MAXHOSTNAMELEN 256
+ 
+-/* We need this time later.  */
+-typedef union querybuf
+-{
+-  HEADER hdr;
+-  u_char buf[MAXPACKET];
+-} querybuf;
+-
+ /* For historic reasons, pointers to IP addresses are char *, so use a
+    single list type for addresses and host names.  */
+ #define DYNARRAY_STRUCT ptrlist
+@@ -125,18 +118,18 @@ static enum nss_status getanswer_ptr (unsigned char *packet, size_t packetlen,
+ 				      char **hnamep, int *errnop,
+ 				      int *h_errnop, int32_t *ttlp);
+ 
+-static enum nss_status gaih_getanswer (const querybuf *answer1, int anslen1,
+-				       const querybuf *answer2, int anslen2,
+-				       const char *qname,
++static enum nss_status gaih_getanswer (unsigned char *packet1,
++				       size_t packet1len,
++				       unsigned char *packet2,
++				       size_t packet2len,
++				       struct alloc_buffer *abuf,
+ 				       struct gaih_addrtuple **pat,
+-				       char *buffer, size_t buflen,
+ 				       int *errnop, int *h_errnop,
+ 				       int32_t *ttlp);
+-static enum nss_status gaih_getanswer_noaaaa (const querybuf *answer1,
+-					      int anslen1,
+-					      const char *qname,
++static enum nss_status gaih_getanswer_noaaaa (unsigned char *packet,
++					      size_t packetlen,
++					      struct alloc_buffer *abuf,
+ 					      struct gaih_addrtuple **pat,
+-					      char *buffer, size_t buflen,
+ 					      int *errnop, int *h_errnop,
+ 					      int32_t *ttlp);
+ 
+@@ -408,17 +401,13 @@ _nss_dns_gethostbyname4_r (const char *name, struct gaih_addrtuple **pat,
+ 	name = cp;
+     }
+ 
+-  union
+-  {
+-    querybuf *buf;
+-    u_char *ptr;
+-  } host_buffer;
+-  querybuf *orig_host_buffer;
+-  host_buffer.buf = orig_host_buffer = (querybuf *) alloca (2048);
++  unsigned char dns_packet_buffer[2048];
++  unsigned char *alt_dns_packet_buffer = dns_packet_buffer;
+   u_char *ans2p = NULL;
+   int nans2p = 0;
+   int resplen2 = 0;
+   int ans2p_malloced = 0;
++  struct alloc_buffer abuf = alloc_buffer_create (buffer, buflen);
+ 
+ 
+   int olderr = errno;
+@@ -427,22 +416,21 @@ _nss_dns_gethostbyname4_r (const char *name, struct gaih_addrtuple **pat,
+   if ((ctx->resp->options & RES_NOAAAA) == 0)
+     {
+       n = __res_context_search (ctx, name, C_IN, T_QUERY_A_AND_AAAA,
+-				host_buffer.buf->buf, 2048, &host_buffer.ptr,
+-				&ans2p, &nans2p, &resplen2, &ans2p_malloced);
++				dns_packet_buffer, sizeof (dns_packet_buffer),
++				&alt_dns_packet_buffer, &ans2p, &nans2p,
++				&resplen2, &ans2p_malloced);
+       if (n >= 0)
+-	status = gaih_getanswer (host_buffer.buf, n, (const querybuf *) ans2p,
+-				 resplen2, name, pat, buffer, buflen,
+-				 errnop, herrnop, ttlp);
++	status = gaih_getanswer (alt_dns_packet_buffer, n, ans2p, resplen2,
++				 &abuf, pat, errnop, herrnop, ttlp);
+     }
+   else
+     {
+       n = __res_context_search (ctx, name, C_IN, T_A,
+-				host_buffer.buf->buf, 2048, NULL,
+-				NULL, NULL, NULL, NULL);
++				dns_packet_buffer, sizeof (dns_packet_buffer),
++				NULL, NULL, NULL, NULL, NULL);
+       if (n >= 0)
+-	status = gaih_getanswer_noaaaa (host_buffer.buf, n,
+-					name, pat, buffer, buflen,
+-					errnop, herrnop, ttlp);
++	status = gaih_getanswer_noaaaa (alt_dns_packet_buffer, n,
++					&abuf, pat, errnop, herrnop, ttlp);
+     }
+   if (n < 0)
+     {
+@@ -473,12 +461,20 @@ _nss_dns_gethostbyname4_r (const char *name, struct gaih_addrtuple **pat,
+ 	__set_errno (olderr);
+     }
+ 
++  /* Implement the buffer resizing protocol.  */
++  if (alloc_buffer_has_failed (&abuf))
++    {
++      *errnop = ERANGE;
++      *herrnop = NETDB_INTERNAL;
++      status = NSS_STATUS_TRYAGAIN;
++    }
++
+   /* Check whether ans2p was separately allocated.  */
+   if (ans2p_malloced)
+     free (ans2p);
+ 
+-  if (host_buffer.buf != orig_host_buffer)
+-    free (host_buffer.buf);
++  if (alt_dns_packet_buffer != dns_packet_buffer)
++    free (alt_dns_packet_buffer);
+ 
+   __resolv_context_put (ctx);
+   return status;
+@@ -892,259 +888,152 @@ getanswer_ptr (unsigned char *packet, size_t packetlen,
+   return NSS_STATUS_TRYAGAIN;
+ }
+ 
++/* Parses DNS data found in PACKETLEN bytes at PACKET in struct
++   gaih_addrtuple address tuples.  The new address tuples are linked
++   from **TAILP, with backing store allocated from ABUF, and *TAILP is
++   updated to point where the next tuple pointer should be stored.  If
++   TTLP is not null, *TTLP is updated to reflect the minimum TTL.  If
++   STORE_CANON is true, the canonical name is stored as part of the
++   first address tuple being written.  */
+ static enum nss_status
+-gaih_getanswer_slice (const querybuf *answer, int anslen, const char *qname,
+-		      struct gaih_addrtuple ***patp,
+-		      char **bufferp, size_t *buflenp,
+-		      int *errnop, int *h_errnop, int32_t *ttlp, int *firstp)
++gaih_getanswer_slice (unsigned char *packet, size_t packetlen,
++		      struct alloc_buffer *abuf,
++		      struct gaih_addrtuple ***tailp,
++		      int *errnop, int *h_errnop, int32_t *ttlp,
++		      bool store_canon)
+ {
+-  char *buffer = *bufferp;
+-  size_t buflen = *buflenp;
+-
+-  struct gaih_addrtuple **pat = *patp;
+-  const HEADER *hp = &answer->hdr;
+-  int ancount = ntohs (hp->ancount);
+-  int qdcount = ntohs (hp->qdcount);
+-  const u_char *cp = answer->buf + HFIXEDSZ;
+-  const u_char *end_of_message = answer->buf + anslen;
+-  if (__glibc_unlikely (qdcount != 1))
+-    {
+-      *h_errnop = NO_RECOVERY;
+-      return NSS_STATUS_UNAVAIL;
+-    }
+-
+-  u_char packtmp[NS_MAXCDNAME];
+-  int n = __ns_name_unpack (answer->buf, end_of_message, cp,
+-			    packtmp, sizeof packtmp);
+-  /* We unpack the name to check it for validity.  But we do not need
+-     it later.  */
+-  if (n != -1 && __ns_name_ntop (packtmp, buffer, buflen) == -1)
+-    {
+-      if (__glibc_unlikely (errno == EMSGSIZE))
+-	{
+-	too_small:
+-	  *errnop = ERANGE;
+-	  *h_errnop = NETDB_INTERNAL;
+-	  return NSS_STATUS_TRYAGAIN;
+-	}
+-
+-      n = -1;
+-    }
+-
+-  if (__glibc_unlikely (n < 0))
+-    {
+-      *errnop = errno;
+-      *h_errnop = NO_RECOVERY;
+-      return NSS_STATUS_UNAVAIL;
+-    }
+-  if (__glibc_unlikely (__libc_res_hnok (buffer) == 0))
++  struct ns_rr_cursor c;
++  if (!__ns_rr_cursor_init (&c, packet, packetlen))
+     {
+-      errno = EBADMSG;
+-      *errnop = EBADMSG;
++      /* This should not happen because __res_context_query already
++	 perfroms response validation.  */
+       *h_errnop = NO_RECOVERY;
+       return NSS_STATUS_UNAVAIL;
+     }
+-  cp += n + QFIXEDSZ;
++  bool haveanswer = false; /* Set to true if at least one address.  */
++  uint16_t qtype = ns_rr_cursor_qtype (&c);
++  int ancount = ns_rr_cursor_ancount (&c);
++  const unsigned char *expected_name = ns_rr_cursor_qname (&c);
++  /* expected_name may be updated to point into this buffer.  */
++  unsigned char name_buffer[NS_MAXCDNAME];
+ 
+-  int haveanswer = 0;
+-  int had_error = 0;
+-  char *canon = NULL;
+-  char *h_name = NULL;
+-  int h_namelen = 0;
++  /* This is a pointer to a possibly-compressed name in the packet.
++     Eventually it is equivalent to the canonical name.  If needed, it
++     is uncompressed and translated to text form when the first
++     address tuple is encountered.  */
++  const unsigned char *compressed_alias_name = expected_name;
+ 
+-  if (ancount == 0)
++  if (ancount == 0 || !__res_binary_hnok (compressed_alias_name))
+     {
+       *h_errnop = HOST_NOT_FOUND;
+       return NSS_STATUS_NOTFOUND;
+     }
+ 
+-  while (ancount-- > 0 && cp < end_of_message && had_error == 0)
++  for (; ancount > -0; --ancount)
+     {
+-      n = __ns_name_unpack (answer->buf, end_of_message, cp,
+-			    packtmp, sizeof packtmp);
+-      if (n != -1 &&
+-	  (h_namelen = __ns_name_ntop (packtmp, buffer, buflen)) == -1)
+-	{
+-	  if (__glibc_unlikely (errno == EMSGSIZE))
+-	    goto too_small;
+-
+-	  n = -1;
+-	}
+-      if (__glibc_unlikely (n < 0))
+-	{
+-	  ++had_error;
+-	  continue;
+-	}
+-      if (*firstp && canon == NULL && __libc_res_hnok (buffer))
+-	{
+-	  h_name = buffer;
+-	  buffer += h_namelen;
+-	  buflen -= h_namelen;
+-	}
+-
+-      cp += n;				/* name */
+-
+-      if (__glibc_unlikely (cp + 10 > end_of_message))
+-	{
+-	  ++had_error;
+-	  continue;
+-	}
+-
+-      uint16_t type;
+-      NS_GET16 (type, cp);
+-      uint16_t class;
+-      NS_GET16 (class, cp);
+-      int32_t ttl;
+-      NS_GET32 (ttl, cp);
+-      NS_GET16 (n, cp);		/* RDATA length.  */
+-
+-      if (end_of_message - cp < n)
++      struct ns_rr_wire rr;
++      if (!__ns_rr_cursor_next (&c, &rr))
+ 	{
+-	  /* RDATA extends beyond the end of the packet.  */
+-	  ++had_error;
+-	  continue;
++	  *h_errnop = NO_RECOVERY;
++	  return NSS_STATUS_UNAVAIL;
+ 	}
+ 
+-      if (class != C_IN)
+-	{
+-	  cp += n;
+-	  continue;
+-	}
++      /* Update TTL for known record types.  */
++      if ((rr.rtype == T_CNAME || rr.rtype == qtype)
++	  && ttlp != NULL && *ttlp > rr.ttl)
++	*ttlp = rr.ttl;
+ 
+-      if (type == T_CNAME)
++      if (rr.rtype == T_CNAME)
+ 	{
+-	  char tbuf[MAXDNAME];
+-
+-	  /* A CNAME could also have a TTL entry.  */
+-	  if (ttlp != NULL && ttl < *ttlp)
+-	      *ttlp = ttl;
+-
+-	  n = __libc_dn_expand (answer->buf, end_of_message, cp,
+-				tbuf, sizeof tbuf);
+-	  if (__glibc_unlikely (n < 0))
+-	    {
+-	      ++had_error;
+-	      continue;
+-	    }
+-	  cp += n;
+-
+-	  if (*firstp && __libc_res_hnok (tbuf))
++	  /* NB: No check for owner name match, based on historic
++	     precedent.  Record the CNAME target as the new expected
++	     name.  */
++	  int n = __ns_name_unpack (c.begin, c.end, rr.rdata,
++				    name_buffer, sizeof (name_buffer));
++	  if (n < 0)
+ 	    {
+-	      /* Reclaim buffer space.  */
+-	      if (h_name + h_namelen == buffer)
+-		{
+-		  buffer = h_name;
+-		  buflen += h_namelen;
+-		}
+-
+-	      n = strlen (tbuf) + 1;
+-	      if (__glibc_unlikely (n > buflen))
+-		goto too_small;
+-	      if (__glibc_unlikely (n >= MAXHOSTNAMELEN))
+-		{
+-		  ++had_error;
+-		  continue;
+-		}
+-
+-	      canon = buffer;
+-	      buffer = __mempcpy (buffer, tbuf, n);
+-	      buflen -= n;
+-	      h_namelen = 0;
++	      *h_errnop = NO_RECOVERY;
++	      return NSS_STATUS_UNAVAIL;
+ 	    }
+-	  continue;
++	  expected_name = name_buffer;
++	  if (store_canon && __res_binary_hnok (name_buffer))
++	    /* This name can be used as a canonical name.  Do not
++	       translate to text form here to conserve buffer space.
++	       Point to the compressed name because name_buffer can be
++	       overwritten with an unusable name later.  */
++	    compressed_alias_name = rr.rdata;
+ 	}
+-
+-      /* Stop parsing if we encounter a record with incorrect RDATA
+-	 length.  */
+-      if (type == T_A || type == T_AAAA)
++      else if (rr.rtype == qtype
++	       && __ns_samebinaryname (rr.rname, expected_name)
++	       && rr.rdlength == rrtype_to_rdata_length (qtype))
+ 	{
+-	  if (n != rrtype_to_rdata_length (type))
++	  struct gaih_addrtuple *ntup
++	    = alloc_buffer_alloc (abuf, struct gaih_addrtuple);
++	  /* Delay error reporting to the callers (they implement the
++	     ERANGE buffer resizing handshake).  */
++	  if (ntup != NULL)
+ 	    {
+-	      ++had_error;
+-	      continue;
++	      ntup->next = NULL;
++	      if (store_canon && compressed_alias_name != NULL)
++		{
++		  /* This assumes that all the CNAME records come
++		     first.  Use MAXHOSTNAMELEN instead of
++		     NS_MAXCDNAME for additional length checking.
++		     However, these checks are not expected to fail
++		     because all size NS_MAXCDNAME names should into
++		     the hname buffer because no escaping is
++		     needed.  */
++		  char unsigned nbuf[NS_MAXCDNAME];
++		  char hname[MAXHOSTNAMELEN + 1];
++		  if (__ns_name_unpack (c.begin, c.end,
++					compressed_alias_name,
++					nbuf, sizeof (nbuf)) >= 0
++		      && __ns_name_ntop (nbuf, hname, sizeof (hname)) >= 0)
++		    /* Space checking is performed by the callers.  */
++		    ntup->name = alloc_buffer_copy_string (abuf, hname);
++		  store_canon = false;
++		}
++	      else
++		ntup->name = NULL;
++	      if (rr.rdlength == 4)
++		ntup->family = AF_INET;
++	      else
++		ntup->family = AF_INET6;
++	      memcpy (ntup->addr, rr.rdata, rr.rdlength);
++	      ntup->scopeid = 0;
++
++	      /* Link in the new tuple, and update the tail pointer to
++		 point to its next field.  */
++	      **tailp = ntup;
++	      *tailp = &ntup->next;
++
++	      haveanswer = true;
+ 	    }
+ 	}
+-      else
+-	{
+-	  /* Skip unknown records.  */
+-	  cp += n;
+-	  continue;
+-	}
+-
+-      assert (type == T_A || type == T_AAAA);
+-      if (*pat == NULL)
+-	{
+-	  uintptr_t pad = (-(uintptr_t) buffer
+-			   % __alignof__ (struct gaih_addrtuple));
+-	  buffer += pad;
+-	  buflen = buflen > pad ? buflen - pad : 0;
+-
+-	  if (__glibc_unlikely (buflen < sizeof (struct gaih_addrtuple)))
+-	    goto too_small;
+-
+-	  *pat = (struct gaih_addrtuple *) buffer;
+-	  buffer += sizeof (struct gaih_addrtuple);
+-	  buflen -= sizeof (struct gaih_addrtuple);
+-	}
+-
+-      (*pat)->name = NULL;
+-      (*pat)->next = NULL;
+-
+-      if (*firstp)
+-	{
+-	  /* We compose a single hostent out of the entire chain of
+-	     entries, so the TTL of the hostent is essentially the lowest
+-	     TTL in the chain.  */
+-	  if (ttlp != NULL && ttl < *ttlp)
+-	    *ttlp = ttl;
+-
+-	  (*pat)->name = canon ?: h_name;
+-
+-	  *firstp = 0;
+-	}
+-
+-      (*pat)->family = type == T_A ? AF_INET : AF_INET6;
+-      memcpy ((*pat)->addr, cp, n);
+-      cp += n;
+-      (*pat)->scopeid = 0;
+-
+-      pat = &((*pat)->next);
+-
+-      haveanswer = 1;
+     }
+ 
+   if (haveanswer)
+     {
+-      *patp = pat;
+-      *bufferp = buffer;
+-      *buflenp = buflen;
+-
+       *h_errnop = NETDB_SUCCESS;
+       return NSS_STATUS_SUCCESS;
+     }
+-
+-  /* Special case here: if the resolver sent a result but it only
+-     contains a CNAME while we are looking for a T_A or T_AAAA record,
+-     we fail with NOTFOUND instead of TRYAGAIN.  */
+-  if (canon != NULL)
++  else
+     {
++      /* Special case here: if the resolver sent a result but it only
++	 contains a CNAME while we are looking for a T_A or T_AAAA
++	 record, we fail with NOTFOUND.  */
+       *h_errnop = HOST_NOT_FOUND;
+       return NSS_STATUS_NOTFOUND;
+     }
+-
+-  *h_errnop = NETDB_INTERNAL;
+-  return NSS_STATUS_TRYAGAIN;
+ }
+ 
+ 
+ static enum nss_status
+-gaih_getanswer (const querybuf *answer1, int anslen1, const querybuf *answer2,
+-		int anslen2, const char *qname,
+-		struct gaih_addrtuple **pat, char *buffer, size_t buflen,
++gaih_getanswer (unsigned char *packet1, size_t packet1len,
++		unsigned char *packet2, size_t packet2len,
++		struct alloc_buffer *abuf, struct gaih_addrtuple **pat,
+ 		int *errnop, int *h_errnop, int32_t *ttlp)
+ {
+-  int first = 1;
+-
+   enum nss_status status = NSS_STATUS_NOTFOUND;
+ 
+   /* Combining the NSS status of two distinct queries requires some
+@@ -1156,7 +1045,10 @@ gaih_getanswer (const querybuf *answer1, int anslen1, const querybuf *answer2,
+      between TRYAGAIN (recoverable) and TRYAGAIN' (not-recoverable).
+      A recoverable TRYAGAIN is almost always due to buffer size issues
+      and returns ERANGE in errno and the caller is expected to retry
+-     with a larger buffer.
++     with a larger buffer.  (The caller, _nss_dns_gethostbyname4_r,
++     ignores the return status if it detects that the result buffer
++     has been exhausted and generates a TRYAGAIN failure with an
++     ERANGE code.)
+ 
+      Lastly, you may be tempted to make significant changes to the
+      conditions in this code to bring about symmetry between responses.
+@@ -1236,36 +1128,30 @@ gaih_getanswer (const querybuf *answer1, int anslen1, const querybuf *answer2,
+ 	 is a recoverable error we now return TRYAGIN even if the first
+ 	 response was SUCCESS.  */
+ 
+-  if (anslen1 > 0)
+-    status = gaih_getanswer_slice(answer1, anslen1, qname,
+-				  &pat, &buffer, &buflen,
+-				  errnop, h_errnop, ttlp,
+-				  &first);
+-
+-  if ((status == NSS_STATUS_SUCCESS || status == NSS_STATUS_NOTFOUND
+-       || (status == NSS_STATUS_TRYAGAIN
+-	   /* We want to look at the second answer in case of an
+-	      NSS_STATUS_TRYAGAIN only if the error is non-recoverable, i.e.
+-	      *h_errnop is NO_RECOVERY. If not, and if the failure was due to
+-	      an insufficient buffer (ERANGE), then we need to drop the results
+-	      and pass on the NSS_STATUS_TRYAGAIN to the caller so that it can
+-	      repeat the query with a larger buffer.  */
+-	   && (*errnop != ERANGE || *h_errnop == NO_RECOVERY)))
+-      && answer2 != NULL && anslen2 > 0)
++  if (packet1len > 0)
+     {
+-      enum nss_status status2 = gaih_getanswer_slice(answer2, anslen2, qname,
+-						     &pat, &buffer, &buflen,
+-						     errnop, h_errnop, ttlp,
+-						     &first);
++      status = gaih_getanswer_slice (packet1, packet1len,
++				     abuf, &pat, errnop, h_errnop, ttlp, true);
++      if (alloc_buffer_has_failed (abuf))
++	/* Do not try parsing the second packet if a larger result
++	   buffer is needed.  The caller implements the resizing
++	   protocol because *abuf has been exhausted.  */
++	return NSS_STATUS_TRYAGAIN; /* Ignored by the caller.  */
++    }
++
++  if ((status == NSS_STATUS_SUCCESS || status == NSS_STATUS_NOTFOUND)
++      && packet2 != NULL && packet2len > 0)
++    {
++      enum nss_status status2
++	= gaih_getanswer_slice (packet2, packet2len,
++				abuf, &pat, errnop, h_errnop, ttlp,
++				/* Success means that data with a
++				   canonical name has already been
++				   stored.  Do not store the name again.  */
++				status != NSS_STATUS_SUCCESS);
+       /* Use the second response status in some cases.  */
+       if (status != NSS_STATUS_SUCCESS && status2 != NSS_STATUS_NOTFOUND)
+ 	status = status2;
+-      /* Do not return a truncated second response (unless it was
+-	 unavoidable e.g. unrecoverable TRYAGAIN).  */
+-      if (status == NSS_STATUS_SUCCESS
+-	  && (status2 == NSS_STATUS_TRYAGAIN
+-	      && *errnop == ERANGE && *h_errnop != NO_RECOVERY))
+-	status = NSS_STATUS_TRYAGAIN;
+     }
+ 
+   return status;
+@@ -1273,18 +1159,13 @@ gaih_getanswer (const querybuf *answer1, int anslen1, const querybuf *answer2,
+ 
+ /* Variant of gaih_getanswer without a second (AAAA) response.  */
+ static enum nss_status
+-gaih_getanswer_noaaaa (const querybuf *answer1, int anslen1, const char *qname,
+-		       struct gaih_addrtuple **pat,
+-		       char *buffer, size_t buflen,
++gaih_getanswer_noaaaa (unsigned char *packet, size_t packetlen,
++		       struct alloc_buffer *abuf, struct gaih_addrtuple **pat,
+ 		       int *errnop, int *h_errnop, int32_t *ttlp)
+ {
+-  int first = 1;
+-
+   enum nss_status status = NSS_STATUS_NOTFOUND;
+-  if (anslen1 > 0)
+-    status = gaih_getanswer_slice (answer1, anslen1, qname,
+-				   &pat, &buffer, &buflen,
+-				   errnop, h_errnop, ttlp,
+-				   &first);
++  if (packetlen > 0)
++    status = gaih_getanswer_slice (packet, packetlen,
++				   abuf, &pat, errnop, h_errnop, ttlp, true);
+   return status;
+ }
+-- 
+2.38.1
+
+
+From a7fa604f3050a1024dc8ec28ff28bad811f6151f Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 30 Aug 2022 13:30:03 +0200
+Subject: resolv: Fix building tst-resolv-invalid-cname for earlier C standards
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This fixes this compiler error:
+
+tst-resolv-invalid-cname.c: In function ‘test_mode_to_string’:
+tst-resolv-invalid-cname.c:164:10: error: label at end of compound statement
+     case test_mode_num:
+          ^~~~~~~~~~~~~
+
+Fixes commit 9caf782276ecea4bc86fc94fbb52779736f3106d
+("resolv: Add new tst-resolv-invalid-cname").
+
+(cherry picked from commit d09aa4a17229bcaa2ec7642006b12612498582e7)
+---
+ resolv/tst-resolv-invalid-cname.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/resolv/tst-resolv-invalid-cname.c b/resolv/tst-resolv-invalid-cname.c
+index ae2d4419b1..63dac90e02 100644
+--- a/resolv/tst-resolv-invalid-cname.c
++++ b/resolv/tst-resolv-invalid-cname.c
+@@ -162,7 +162,7 @@ test_mode_to_string (enum test_mode mode)
+     case gai_canon:
+       return "gai_canon";
+     case test_mode_num:
+-      /* Report error below.  */
++      break;                    /* Report error below.  */
+     }
+   FAIL_EXIT1 ("invalid test_mode: %d", mode);
+ }
+-- 
+2.38.1
+
+
+From 5d885617cec5713fdde42177398fe98acb66b7a2 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 13 Sep 2022 13:22:27 +0200
+Subject: NEWS: Note bug 12154 and bug 29305 as fixed
+
+---
+ NEWS | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/NEWS b/NEWS
+index 9360596fcc..03281e3ab4 100644
+--- a/NEWS
++++ b/NEWS
+@@ -16,7 +16,9 @@ Security related changes:
+ 
+ The following bugs are resolved with this release:
+ 
++  [12154] Do not fail DNS resolution for CNAMEs which are not host names
+   [28846] CMSG_NXTHDR may trigger -Wstrict-overflow warning
++  [29305] Conserve NSS buffer space during DNS packet parsing
+   [29415] nscd: Fix netlink cache invalidation if epoll is used
+   [29446] _dlopen now ignores dl_caller argument in static mode
+   [29485] Linux: Terminate subprocess on late failure in tst-pidfd
+-- 
+2.38.1
+
+
+From df51334828f2af214105aad82042140ee3a6de0a Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 13 Sep 2022 19:57:43 +0200
+Subject: elf: Run tst-audit-tlsdesc, tst-audit-tlsdesc-dlopen everywhere
+
+The test is valid for all TLS models, but we want to make a reasonable
+effort to test the GNU2 model specifically.  For example, aarch64
+defaults to GNU2, but does not have -mtls-dialect=gnu2, and the test
+was not run there.
+
+Suggested-by: Martin Coufal <mcoufal@redhat.com>
+(cherry picked from commit dd2315a866a4ac2b838ea1cb10c5ea1c35d51a2f)
+
+Fixes early backport commit 924e4f3eaa502ce82fccf8537f021a796d158771
+("elf: Call __libc_early_init for reused namespaces (bug 29528)");
+it had a wrong conflict resolution.
+---
+ elf/Makefile | 22 ++++++----------------
+ 1 file changed, 6 insertions(+), 16 deletions(-)
+
+diff --git a/elf/Makefile b/elf/Makefile
+index 43353a4b08..72178d33ff 100644
+--- a/elf/Makefile
++++ b/elf/Makefile
+@@ -374,6 +374,8 @@ tests += \
+   tst-align \
+   tst-align2 \
+   tst-align3 \
++  tst-audit-tlsdesc \
++  tst-audit-tlsdesc-dlopen \
+   tst-audit1 \
+   tst-audit2 \
+   tst-audit8 \
+@@ -766,6 +768,8 @@ modules-names += \
+   tst-alignmod3 \
+   tst-array2dep \
+   tst-array5dep \
++  tst-audit-tlsdesc-mod1 \
++  tst-audit-tlsdesc-mod2 \
+   tst-audit11mod1 \
+   tst-audit11mod2 \
+   tst-audit12mod1 \
+@@ -799,6 +803,7 @@ modules-names += \
+   tst-auditmanymod7 \
+   tst-auditmanymod8 \
+   tst-auditmanymod9 \
++  tst-auditmod-tlsdesc  \
+   tst-auditmod1 \
+   tst-auditmod9a \
+   tst-auditmod9b \
+@@ -993,23 +998,8 @@ modules-names += tst-gnu2-tls1mod
+ $(objpfx)tst-gnu2-tls1: $(objpfx)tst-gnu2-tls1mod.so
+ tst-gnu2-tls1mod.so-no-z-defs = yes
+ CFLAGS-tst-gnu2-tls1mod.c += -mtls-dialect=gnu2
++endif # $(have-mtls-dialect-gnu2)
+ 
+-tests += tst-audit-tlsdesc tst-audit-tlsdesc-dlopen
+-modules-names += tst-audit-tlsdesc-mod1 tst-audit-tlsdesc-mod2 tst-auditmod-tlsdesc
+-$(objpfx)tst-audit-tlsdesc: $(objpfx)tst-audit-tlsdesc-mod1.so \
+-			    $(objpfx)tst-audit-tlsdesc-mod2.so \
+-			    $(shared-thread-library)
+-CFLAGS-tst-audit-tlsdesc-mod1.c += -mtls-dialect=gnu2
+-CFLAGS-tst-audit-tlsdesc-mod2.c += -mtls-dialect=gnu2
+-$(objpfx)tst-audit-tlsdesc-dlopen: $(shared-thread-library)
+-$(objpfx)tst-audit-tlsdesc-dlopen.out: $(objpfx)tst-audit-tlsdesc-mod1.so \
+-				       $(objpfx)tst-audit-tlsdesc-mod2.so
+-$(objpfx)tst-audit-tlsdesc-mod1.so: $(objpfx)tst-audit-tlsdesc-mod2.so
+-$(objpfx)tst-audit-tlsdesc.out: $(objpfx)tst-auditmod-tlsdesc.so
+-tst-audit-tlsdesc-ENV = LD_AUDIT=$(objpfx)tst-auditmod-tlsdesc.so
+-$(objpfx)tst-audit-tlsdesc-dlopen.out: $(objpfx)tst-auditmod-tlsdesc.so
+-tst-audit-tlsdesc-dlopen-ENV = LD_AUDIT=$(objpfx)tst-auditmod-tlsdesc.so
+-endif
+ ifeq (yes,$(have-protected-data))
+ modules-names += tst-protected1moda tst-protected1modb
+ tests += tst-protected1a tst-protected1b
+-- 
+2.38.1
+
+
+From 4b95b6e8bbb5a2b6856f707bf3bc3308ebef595a Mon Sep 17 00:00:00 2001
+From: Javier Pello <devel@otheo.eu>
+Date: Mon, 5 Sep 2022 20:09:01 +0200
+Subject: elf: Fix hwcaps string size overestimation
+
+Commit dad90d528259b669342757c37dedefa8577e2636 added glibc-hwcaps
+support for LD_LIBRARY_PATH and, for this, it adjusted the total
+string size required in _dl_important_hwcaps. However, in doing so
+it inadvertently altered the calculation of the size required for
+the power set strings, as the computation of the power set string
+size depended on the first value assigned to the total variable,
+which is later shifted, resulting in overallocation of string
+space. Fix this now by using a different variable to hold the
+string size required for glibc-hwcaps.
+
+Signed-off-by: Javier Pello <devel@otheo.eu>
+(cherry picked from commit a23820f6052a740246fdc7dcd9c43ce8eed0c45a)
+---
+ elf/dl-hwcaps.c | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/elf/dl-hwcaps.c b/elf/dl-hwcaps.c
+index 6f161f6ad5..92eb53790e 100644
+--- a/elf/dl-hwcaps.c
++++ b/elf/dl-hwcaps.c
+@@ -193,7 +193,7 @@ _dl_important_hwcaps (const char *glibc_hwcaps_prepend,
+   /* Each hwcaps subdirectory has a GLIBC_HWCAPS_PREFIX string prefix
+      and a "/" suffix once stored in the result.  */
+   hwcaps_counts.maximum_length += strlen (GLIBC_HWCAPS_PREFIX) + 1;
+-  size_t total = (hwcaps_counts.count * (strlen (GLIBC_HWCAPS_PREFIX) + 1)
++  size_t hwcaps_sz = (hwcaps_counts.count * (strlen (GLIBC_HWCAPS_PREFIX) + 1)
+ 		  + hwcaps_counts.total_length);
+ 
+   /* Count the number of bits set in the masked value.  */
+@@ -229,11 +229,12 @@ _dl_important_hwcaps (const char *glibc_hwcaps_prepend,
+   assert (m == cnt);
+ 
+   /* Determine the total size of all strings together.  */
++  size_t total;
+   if (cnt == 1)
+-    total += temp[0].len + 1;
++    total = temp[0].len + 1;
+   else
+     {
+-      total += temp[0].len + temp[cnt - 1].len + 2;
++      total = temp[0].len + temp[cnt - 1].len + 2;
+       if (cnt > 2)
+ 	{
+ 	  total <<= 1;
+@@ -255,6 +256,7 @@ _dl_important_hwcaps (const char *glibc_hwcaps_prepend,
+   /* This is the overall result, including both glibc-hwcaps
+      subdirectories and the legacy hwcaps subdirectories using the
+      power set construction.  */
++  total += hwcaps_sz;
+   struct r_strlenpair *overall_result
+     = malloc (*sz * sizeof (*result) + total);
+   if (overall_result == NULL)
+-- 
+2.38.1
+
+
+From 7a3f8c8a7aeb41d4bbfeec07d0be1e92c3019919 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 6 Sep 2022 07:38:10 +0200
+Subject: scripts/dso-ordering-test.py: Generate program run-time dependencies
+
+The main program needs to depend on all shared objects, even objects
+that have link-time dependencies among shared objects.  Filtering
+out shared objects that already have an link-time dependencies is not
+necessary here; make will do this automatically.
+
+Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
+(cherry picked from commit 183d99737298bb3200f0610fdcd1c7549c8ed560)
+---
+ scripts/dso-ordering-test.py | 13 ++++++-------
+ 1 file changed, 6 insertions(+), 7 deletions(-)
+
+diff --git a/scripts/dso-ordering-test.py b/scripts/dso-ordering-test.py
+index 2dd6bfda18..b87cf2f809 100644
+--- a/scripts/dso-ordering-test.py
++++ b/scripts/dso-ordering-test.py
+@@ -707,13 +707,12 @@ def process_testcase(t):
+                 "\t$(compile.c) $(OUTPUT_OPTION)\n")
+         makefile.write (rule)
+ 
+-        not_depended_objs = find_objs_not_depended_on(test_descr)
+-        if not_depended_objs:
+-            depstr = ""
+-            for dep in not_depended_objs:
+-                depstr += (" $(objpfx)" + test_subdir + "/"
+-                           + test_name + "-" + dep + ".so")
+-            makefile.write("$(objpfx)%s.out:%s\n" % (base_test_name, depstr))
++        # Ensure that all shared objects are built before running the
++        # test, whether there link-time dependencies or not.
++        depobjs = ["$(objpfx){}/{}-{}.so".format(test_subdir, test_name, dep)
++                   for dep in test_descr.objs]
++        makefile.write("$(objpfx){}.out: {}\n".format(
++            base_test_name, " ".join(depobjs)))
+ 
+         # Add main executable to test-srcs
+         makefile.write("test-srcs += %s/%s\n" % (test_subdir, test_name))
+-- 
+2.38.1
+
+
+From d1241cf00139733de069c84933cd576dc1a1f45e Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 6 Sep 2022 07:38:10 +0200
+Subject: elf: Rename _dl_sort_maps parameter from skip to force_first
+
+The new implementation will not be able to skip an arbitrary number
+of objects.
+
+Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
+(cherry picked from commit dbb75513f5cf9285c77c9e55777c5c35b653f890)
+---
+ elf/dl-sort-maps.c         | 14 +++++++-------
+ sysdeps/generic/ldsodefs.h |  6 ++++--
+ 2 files changed, 11 insertions(+), 9 deletions(-)
+
+diff --git a/elf/dl-sort-maps.c b/elf/dl-sort-maps.c
+index 96638d7ed1..5b550b1e94 100644
+--- a/elf/dl-sort-maps.c
++++ b/elf/dl-sort-maps.c
+@@ -27,12 +27,12 @@
+    If FOR_FINI is true, this is called for finishing an object.  */
+ static void
+ _dl_sort_maps_original (struct link_map **maps, unsigned int nmaps,
+-			unsigned int skip, bool for_fini)
++			bool force_first, bool for_fini)
+ {
+   /* Allows caller to do the common optimization of skipping the first map,
+      usually the main binary.  */
+-  maps += skip;
+-  nmaps -= skip;
++  maps += force_first;
++  nmaps -= force_first;
+ 
+   /* A list of one element need not be sorted.  */
+   if (nmaps <= 1)
+@@ -182,7 +182,7 @@ dfs_traversal (struct link_map ***rpo, struct link_map *map,
+ 
+ static void
+ _dl_sort_maps_dfs (struct link_map **maps, unsigned int nmaps,
+-		   unsigned int skip __attribute__ ((unused)), bool for_fini)
++		   bool force_first __attribute__ ((unused)), bool for_fini)
+ {
+   for (int i = nmaps - 1; i >= 0; i--)
+     maps[i]->l_visited = 0;
+@@ -286,7 +286,7 @@ _dl_sort_maps_init (void)
+ 
+ void
+ _dl_sort_maps (struct link_map **maps, unsigned int nmaps,
+-	       unsigned int skip, bool for_fini)
++	       bool force_first, bool for_fini)
+ {
+   /* It can be tempting to use a static function pointer to store and call
+      the current selected sorting algorithm routine, but experimentation
+@@ -296,9 +296,9 @@ _dl_sort_maps (struct link_map **maps, unsigned int nmaps,
+      input cases. A simple if-case with direct function calls appears to
+      be the fastest.  */
+   if (__glibc_likely (GLRO(dl_dso_sort_algo) == dso_sort_algorithm_original))
+-    _dl_sort_maps_original (maps, nmaps, skip, for_fini);
++    _dl_sort_maps_original (maps, nmaps, force_first, for_fini);
+   else
+-    _dl_sort_maps_dfs (maps, nmaps, skip, for_fini);
++    _dl_sort_maps_dfs (maps, nmaps, force_first, for_fini);
+ }
+ 
+ #endif /* HAVE_TUNABLES.  */
+diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h
+index 050a3032de..6b256b8388 100644
+--- a/sysdeps/generic/ldsodefs.h
++++ b/sysdeps/generic/ldsodefs.h
+@@ -1048,9 +1048,11 @@ extern void _dl_init (struct link_map *main_map, int argc, char **argv,
+    initializer functions have completed.  */
+ extern void _dl_fini (void) attribute_hidden;
+ 
+-/* Sort array MAPS according to dependencies of the contained objects.  */
++/* Sort array MAPS according to dependencies of the contained objects.
++   If FORCE_FIRST, MAPS[0] keeps its place even if the dependencies
++   say otherwise.  */
+ extern void _dl_sort_maps (struct link_map **maps, unsigned int nmaps,
+-			   unsigned int skip, bool for_fini) attribute_hidden;
++			   bool force_first, bool for_fini) attribute_hidden;
+ 
+ /* The dynamic linker calls this function before and having changing
+    any shared object mappings.  The `r_state' member of `struct r_debug'
+-- 
+2.38.1
+
+
+From da5f134f6d59701a3a6119309ae91c93c3fa5b51 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 20 Sep 2022 11:00:42 +0200
+Subject: elf: Implement force_first handling in _dl_sort_maps_dfs (bug 28937)
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The implementation in _dl_close_worker requires that the first
+element of l_initfini is always this very map (“We are always the
+zeroth entry, and since we don't include ourselves in the
+dependency analysis start at 1.”).  Rather than fixing that
+assumption, this commit adds an implementation of the force_first
+argument to the new dependency sorting algorithm.  This also means
+that the directly dlopen'ed shared object is always initialized last,
+which is the least surprising behavior in the presence of cycles.
+
+Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
+(cherry picked from commit 1df71d32fe5f5905ffd5d100e5e9ca8ad6210891)
+---
+ NEWS                     |  1 +
+ elf/dl-sort-maps.c       | 32 +++++++++++++++++++++++---------
+ elf/dso-sort-tests-1.def |  7 +++++++
+ 3 files changed, 31 insertions(+), 9 deletions(-)
+
+diff --git a/NEWS b/NEWS
+index 03281e3ab4..5b4753416f 100644
+--- a/NEWS
++++ b/NEWS
+@@ -20,6 +20,7 @@ The following bugs are resolved with this release:
+   [28846] CMSG_NXTHDR may trigger -Wstrict-overflow warning
+   [29305] Conserve NSS buffer space during DNS packet parsing
+   [29415] nscd: Fix netlink cache invalidation if epoll is used
++  [28937] New DSO dependency sorter does not put new map first if in a cycle
+   [29446] _dlopen now ignores dl_caller argument in static mode
+   [29485] Linux: Terminate subprocess on late failure in tst-pidfd
+   [29490] alpha: New __brk_call implementation is broken
+diff --git a/elf/dl-sort-maps.c b/elf/dl-sort-maps.c
+index 5b550b1e94..3e2a6a584e 100644
+--- a/elf/dl-sort-maps.c
++++ b/elf/dl-sort-maps.c
+@@ -182,8 +182,9 @@ dfs_traversal (struct link_map ***rpo, struct link_map *map,
+ 
+ static void
+ _dl_sort_maps_dfs (struct link_map **maps, unsigned int nmaps,
+-		   bool force_first __attribute__ ((unused)), bool for_fini)
++		   bool force_first, bool for_fini)
+ {
++  struct link_map *first_map = maps[0];
+   for (int i = nmaps - 1; i >= 0; i--)
+     maps[i]->l_visited = 0;
+ 
+@@ -208,14 +209,6 @@ _dl_sort_maps_dfs (struct link_map **maps, unsigned int nmaps,
+      Adjusting the order so that maps[0] is last traversed naturally avoids
+      this problem.
+ 
+-     Further, the old "optimization" of skipping the main object at maps[0]
+-     from the call-site (i.e. _dl_sort_maps(maps+1,nmaps-1)) is in general
+-     no longer valid, since traversing along object dependency-links
+-     may "find" the main object even when it is not included in the initial
+-     order (e.g. a dlopen()'ed shared object can have circular dependencies
+-     linked back to itself). In such a case, traversing N-1 objects will
+-     create a N-object result, and raise problems.
+-
+      To summarize, just passing in the full list, and iterating from back
+      to front makes things much more straightforward.  */
+ 
+@@ -274,6 +267,27 @@ _dl_sort_maps_dfs (struct link_map **maps, unsigned int nmaps,
+     }
+ 
+   memcpy (maps, rpo, sizeof (struct link_map *) * nmaps);
++
++  /* Skipping the first object at maps[0] is not valid in general,
++     since traversing along object dependency-links may "find" that
++     first object even when it is not included in the initial order
++     (e.g., a dlopen'ed shared object can have circular dependencies
++     linked back to itself).  In such a case, traversing N-1 objects
++     will create a N-object result, and raise problems.  Instead,
++     force the object back into first place after sorting.  This naive
++     approach may introduce further dependency ordering violations
++     compared to rotating the cycle until the first map is again in
++     the first position, but as there is a cycle, at least one
++     violation is already present.  */
++  if (force_first && maps[0] != first_map)
++    {
++      int i;
++      for (i = 0; maps[i] != first_map; ++i)
++	;
++      assert (i < nmaps);
++      memmove (&maps[1], maps, i * sizeof (maps[0]));
++      maps[0] = first_map;
++    }
+ }
+ 
+ void
+diff --git a/elf/dso-sort-tests-1.def b/elf/dso-sort-tests-1.def
+index 5f7f18ef27..4bf9052db1 100644
+--- a/elf/dso-sort-tests-1.def
++++ b/elf/dso-sort-tests-1.def
+@@ -64,3 +64,10 @@ output: b>a>{}<a<b
+ tst-bz15311: {+a;+e;+f;+g;+d;%d;-d;-g;-f;-e;-a};a->b->c->d;d=>[ba];c=>a;b=>e=>a;c=>f=>b;d=>g=>c
+ output(glibc.rtld.dynamic_sort=1): {+a[d>c>b>a>];+e[e>];+f[f>];+g[g>];+d[];%d(b(e(a()))a()g(c(a()f(b(e(a()))))));-d[];-g[];-f[];-e[];-a[<a<c<d<g<f<b<e];}
+ output(glibc.rtld.dynamic_sort=2): {+a[d>c>b>a>];+e[e>];+f[f>];+g[g>];+d[];%d(b(e(a()))a()g(c(a()f(b(e(a()))))));-d[];-g[];-f[];-e[];-a[<g<f<a<b<c<d<e];}
++
++# Test that even in the presence of dependency loops involving dlopen'ed
++# object, that object is initialized last (and not unloaded prematurely).
++# Final destructor order is indeterminate due to the cycle.
++tst-bz28937: {+a;+b;-b;+c;%c};a->a1;a->a2;a2->a;b->b1;c->a1;c=>a1
++output(glibc.rtld.dynamic_sort=1): {+a[a2>a1>a>];+b[b1>b>];-b[<b<b1];+c[c>];%c(a1());}<a<a2<c<a1
++output(glibc.rtld.dynamic_sort=2): {+a[a2>a1>a>];+b[b1>b>];-b[<b<b1];+c[c>];%c(a1());}<a2<a<c<a1
+-- 
+2.38.1
+
+
+From 52c037f3574eb9062b111d78a4cbeb79681d07d3 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 20 Sep 2022 12:12:43 +0200
+Subject: gconv: Use 64-bit interfaces in gconv_parseconfdir (bug 29583)
+
+It's possible that inode numbers are outside the 32-bit range.
+The existing code only handles the in-libc case correctly, and
+still uses the legacy interfaces when building iconv.
+
+Suggested-by: Helge Deller <deller@gmx.de>
+(cherry picked from commit f97905f24631097af325d6a231093071c3077a5f)
+---
+ NEWS                       |  1 +
+ iconv/gconv_parseconfdir.h | 16 ++++++++--------
+ 2 files changed, 9 insertions(+), 8 deletions(-)
+
+diff --git a/NEWS b/NEWS
+index 5b4753416f..eab882987b 100644
+--- a/NEWS
++++ b/NEWS
+@@ -26,6 +26,7 @@ The following bugs are resolved with this release:
+   [29490] alpha: New __brk_call implementation is broken
+   [29528] elf: Call __libc_early_init for reused namespaces
+   [29539] libc: LD_TRACE_LOADED_OBJECTS changed how vDSO library are
++  [29583] Use 64-bit interfaces in gconv_parseconfdir
+ \f
+ Version 2.36
+ 
+diff --git a/iconv/gconv_parseconfdir.h b/iconv/gconv_parseconfdir.h
+index debb96b322..b72933b526 100644
+--- a/iconv/gconv_parseconfdir.h
++++ b/iconv/gconv_parseconfdir.h
+@@ -29,14 +29,14 @@
+ # define isspace(__c) __isspace_l ((__c), _nl_C_locobj_ptr)
+ # define asprintf __asprintf
+ # define opendir __opendir
+-# define readdir __readdir
++# define readdir64 __readdir64
+ # define closedir __closedir
+ # define mempcpy __mempcpy
+-# define struct_stat struct __stat64_t64
+-# define lstat __lstat64_time64
++# define struct_stat64 struct __stat64_t64
++# define lstat64 __lstat64_time64
+ # define feof_unlocked __feof_unlocked
+ #else
+-# define struct_stat struct stat
++# define struct_stat64 struct stat64
+ #endif
+ 
+ /* Name of the file containing the module information in the directories
+@@ -148,8 +148,8 @@ gconv_parseconfdir (const char *prefix, const char *dir, size_t dir_len)
+   DIR *confdir = opendir (buf);
+   if (confdir != NULL)
+     {
+-      struct dirent *ent;
+-      while ((ent = readdir (confdir)) != NULL)
++      struct dirent64 *ent;
++      while ((ent = readdir64 (confdir)) != NULL)
+ 	{
+ 	  if (ent->d_type != DT_REG && ent->d_type != DT_UNKNOWN)
+ 	    continue;
+@@ -161,12 +161,12 @@ gconv_parseconfdir (const char *prefix, const char *dir, size_t dir_len)
+ 	      && strcmp (ent->d_name + len - strlen (suffix), suffix) == 0)
+ 	    {
+ 	      char *conf;
+-	      struct_stat st;
++	      struct_stat64 st;
+ 	      if (asprintf (&conf, "%s/%s", buf, ent->d_name) < 0)
+ 		continue;
+ 
+ 	      if (ent->d_type != DT_UNKNOWN
+-		  || (lstat (conf, &st) != -1 && S_ISREG (st.st_mode)))
++		  || (lstat64 (conf, &st) != -1 && S_ISREG (st.st_mode)))
+ 		found |= read_conf_file (conf, dir, dir_len);
+ 
+ 	      free (conf);
+-- 
+2.38.1
+
+
+From 2628500f5dff1dd99c49a09b418b3b1ea3a6b5d3 Mon Sep 17 00:00:00 2001
+From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Tue, 30 Aug 2022 10:33:15 -0300
+Subject: m68k: Enforce 4-byte alignment on internal locks (BZ #29537)
+
+A new internal definition, __LIBC_LOCK_ALIGNMENT, is used to force
+the 4-byte alignment only for m68k, other architecture keep the
+natural alignment of the type used internally (and hppa does not
+require 16-byte alignment for kernel-assisted CAS).
+
+Reviewed-by: Florian Weimer <fweimer@redhat.com>
+(cherry picked from commit aeb4d2e9815d459e2640a31f5abb8ef803830107)
+---
+ NEWS                                          |  1 +
+ sysdeps/generic/libc-lock-arch.h              | 25 +++++++++++++++++++
+ sysdeps/nptl/libc-lock.h                      |  8 +++++-
+ sysdeps/nptl/libc-lockP.h                     |  3 ++-
+ sysdeps/unix/sysv/linux/m68k/libc-lock-arch.h | 25 +++++++++++++++++++
+ 5 files changed, 60 insertions(+), 2 deletions(-)
+ create mode 100644 sysdeps/generic/libc-lock-arch.h
+ create mode 100644 sysdeps/unix/sysv/linux/m68k/libc-lock-arch.h
+
+diff --git a/NEWS b/NEWS
+index eab882987b..1cc9a16bbf 100644
+--- a/NEWS
++++ b/NEWS
+@@ -25,6 +25,7 @@ The following bugs are resolved with this release:
+   [29485] Linux: Terminate subprocess on late failure in tst-pidfd
+   [29490] alpha: New __brk_call implementation is broken
+   [29528] elf: Call __libc_early_init for reused namespaces
++  [29537] libc: [2.34 regression]: Alignment issue on m68k when using
+   [29539] libc: LD_TRACE_LOADED_OBJECTS changed how vDSO library are
+   [29583] Use 64-bit interfaces in gconv_parseconfdir
+ \f
+diff --git a/sysdeps/generic/libc-lock-arch.h b/sysdeps/generic/libc-lock-arch.h
+new file mode 100644
+index 0000000000..4713b30a8a
+--- /dev/null
++++ b/sysdeps/generic/libc-lock-arch.h
+@@ -0,0 +1,25 @@
++/* Private libc-internal arch-specific definitions.  Generic version.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public License as
++   published by the Free Software Foundation; either version 2.1 of the
++   License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; see the file COPYING.LIB.  If
++   not, see <https://www.gnu.org/licenses/>.  */
++
++#ifndef _LIBC_LOCK_ARCH_H
++#define _LIBC_LOCK_ARCH_H
++
++/* The default definition uses the natural alignment from the lock type.  */
++#define __LIBC_LOCK_ALIGNMENT
++
++#endif
+diff --git a/sysdeps/nptl/libc-lock.h b/sysdeps/nptl/libc-lock.h
+index 5af476c48b..63b3f3d75c 100644
+--- a/sysdeps/nptl/libc-lock.h
++++ b/sysdeps/nptl/libc-lock.h
+@@ -22,6 +22,7 @@
+ #include <pthread.h>
+ #define __need_NULL
+ #include <stddef.h>
++#include <libc-lock-arch.h>
+ 
+ 
+ /* Mutex type.  */
+@@ -29,7 +30,12 @@
+ # if (!IS_IN (libc) && !IS_IN (libpthread)) || !defined _LIBC
+ typedef struct { pthread_mutex_t mutex; } __libc_lock_recursive_t;
+ # else
+-typedef struct { int lock; int cnt; void *owner; } __libc_lock_recursive_t;
++typedef struct
++{
++  int lock __LIBC_LOCK_ALIGNMENT;
++  int cnt;
++  void *owner;
++} __libc_lock_recursive_t;
+ # endif
+ #else
+ typedef struct __libc_lock_recursive_opaque__ __libc_lock_recursive_t;
+diff --git a/sysdeps/nptl/libc-lockP.h b/sysdeps/nptl/libc-lockP.h
+index d3a6837fd2..425f514c5c 100644
+--- a/sysdeps/nptl/libc-lockP.h
++++ b/sysdeps/nptl/libc-lockP.h
+@@ -32,9 +32,10 @@
+    ld.so might be used on old kernels with a different libc.so.  */
+ #include <lowlevellock.h>
+ #include <tls.h>
++#include <libc-lock-arch.h>
+ 
+ /* Mutex type.  */
+-typedef int __libc_lock_t;
++typedef int __libc_lock_t __LIBC_LOCK_ALIGNMENT;
+ typedef struct { pthread_mutex_t mutex; } __rtld_lock_recursive_t;
+ typedef pthread_rwlock_t __libc_rwlock_t;
+ 
+diff --git a/sysdeps/unix/sysv/linux/m68k/libc-lock-arch.h b/sysdeps/unix/sysv/linux/m68k/libc-lock-arch.h
+new file mode 100644
+index 0000000000..1844bbaf6f
+--- /dev/null
++++ b/sysdeps/unix/sysv/linux/m68k/libc-lock-arch.h
+@@ -0,0 +1,25 @@
++/* Private libc-internal arch-specific definitions.  m68k version.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public License as
++   published by the Free Software Foundation; either version 2.1 of the
++   License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; see the file COPYING.LIB.  If
++   not, see <https://www.gnu.org/licenses/>.  */
++
++#ifndef _LIBC_LOCK_ARCH_H
++#define _LIBC_LOCK_ARCH_H
++
++/* Linux enforces 4-bytes alignment on futex inputs.  */
++#define __LIBC_LOCK_ALIGNMENT __attribute__ ((__aligned__ (4)))
++
++#endif
+-- 
+2.38.1
+
+
+From 227c9035872fc9e9e2cf56ec8f89219747ee19bc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?J=C3=B6rg=20Sonnenberger?= <joerg@bec.de>
+Date: Mon, 26 Sep 2022 13:59:16 -0400
+Subject: get_nscd_addresses: Fix subscript typos [BZ #29605]
+
+Fix the subscript on air->family, which was accidentally set to COUNT
+when it should have remained as I.
+
+Resolves: BZ #29605
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit c9226c03da0276593a0918eaa9a14835183343e8)
+---
+ sysdeps/posix/getaddrinfo.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
+index bcff909b2f..5cda9bb072 100644
+--- a/sysdeps/posix/getaddrinfo.c
++++ b/sysdeps/posix/getaddrinfo.c
+@@ -540,11 +540,11 @@ get_nscd_addresses (const char *name, const struct addrinfo *req,
+ 	  at[count].addr[2] = htonl (0xffff);
+ 	}
+       else if (req->ai_family == AF_UNSPEC
+-	       || air->family[count] == req->ai_family)
++	       || air->family[i] == req->ai_family)
+ 	{
+-	  at[count].family = air->family[count];
++	  at[count].family = air->family[i];
+ 	  memcpy (at[count].addr, addrs, size);
+-	  if (air->family[count] == AF_INET6)
++	  if (air->family[i] == AF_INET6)
+ 	    res->got_ipv6 = true;
+ 	}
+       at[count].next = at + count + 1;
+-- 
+2.38.1
+
+
+From 76e05613ee28f4ac4a0ab97effc32e0e78e37a56 Mon Sep 17 00:00:00 2001
+From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Thu, 29 Sep 2022 16:15:20 -0300
+Subject: stdlib: Fix __getrandom_nocancel type and arc4random usage (BZ
+ #29638)
+
+Using an unsigned type prevents the fallback to be used if kernel
+does not support getrandom syscall.
+
+Checked on x86_64-linux-gnu.
+
+Reviewed-by: Wilco Dijkstra  <Wilco.Dijkstra@arm.com>
+(cherry picked from commit 13db9ee2cb3b77e25f852be7d6952882e1be6f00)
+---
+ NEWS                                 | 1 +
+ stdlib/arc4random.c                  | 2 +-
+ sysdeps/unix/sysv/linux/not-cancel.h | 2 +-
+ 3 files changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/NEWS b/NEWS
+index 1cc9a16bbf..91bcfeb7a6 100644
+--- a/NEWS
++++ b/NEWS
+@@ -28,6 +28,7 @@ The following bugs are resolved with this release:
+   [29537] libc: [2.34 regression]: Alignment issue on m68k when using
+   [29539] libc: LD_TRACE_LOADED_OBJECTS changed how vDSO library are
+   [29583] Use 64-bit interfaces in gconv_parseconfdir
++  [29638] libc: stdlib: arc4random fallback is never used
+ \f
+ Version 2.36
+ 
+diff --git a/stdlib/arc4random.c b/stdlib/arc4random.c
+index e417ef624d..960a38f295 100644
+--- a/stdlib/arc4random.c
++++ b/stdlib/arc4random.c
+@@ -34,7 +34,7 @@ void
+ __arc4random_buf (void *p, size_t n)
+ {
+   static int seen_initialized;
+-  size_t l;
++  ssize_t l;
+   int fd;
+ 
+   if (n == 0)
+diff --git a/sysdeps/unix/sysv/linux/not-cancel.h b/sysdeps/unix/sysv/linux/not-cancel.h
+index a263d294b1..cf35c8bfc9 100644
+--- a/sysdeps/unix/sysv/linux/not-cancel.h
++++ b/sysdeps/unix/sysv/linux/not-cancel.h
+@@ -68,7 +68,7 @@ __writev_nocancel_nostatus (int fd, const struct iovec *iov, int iovcnt)
+   INTERNAL_SYSCALL_CALL (writev, fd, iov, iovcnt);
+ }
+ 
+-static inline int
++static inline ssize_t
+ __getrandom_nocancel (void *buf, size_t buflen, unsigned int flags)
+ {
+   return INLINE_SYSCALL_CALL (getrandom, buf, buflen, flags);
+-- 
+2.38.1
+
+
+From d1d8379bff34f02f86f82db2cef5bf66746d3560 Mon Sep 17 00:00:00 2001
+From: John David Anglin <danglin@gcc.gnu.org>
+Date: Sat, 1 Oct 2022 19:49:25 +0000
+Subject: hppa: Fix initialization of dp register [BZ 29635]
+
+After upgrading glibc to Debian 2.35-1, gdb faulted on
+startup and dropped core in a function call in the main
+application.  This was caused by not initializing the
+global dp register for the main application early enough.
+
+Restore the code to initialize dp in _dl_start_user.
+It was removed when code was added to initialize dp in
+elf_machine_runtime_setup.
+
+Signed-off-by: John David Anglin <dave.anglin@bell.net>
+---
+ sysdeps/hppa/dl-machine.h | 24 +++++++++++++++++++-----
+ 1 file changed, 19 insertions(+), 5 deletions(-)
+
+diff --git a/sysdeps/hppa/dl-machine.h b/sysdeps/hppa/dl-machine.h
+index c865713be1..1d51948566 100644
+--- a/sysdeps/hppa/dl-machine.h
++++ b/sysdeps/hppa/dl-machine.h
+@@ -347,6 +347,16 @@ elf_machine_runtime_setup (struct link_map *l, struct r_scope_elem *scope[],
+    its return value is the user program's entry point.  */
+ 
+ #define RTLD_START \
++/* Set up dp for any non-PIC lib constructors that may be called.  */	\
++static struct link_map * __attribute__((used))				\
++set_dp (struct link_map *map)						\
++{									\
++  register Elf32_Addr dp asm ("%r27");					\
++  dp = D_PTR (map, l_info[DT_PLTGOT]);					\
++  asm volatile ("" : : "r" (dp));					\
++  return map;								\
++}									\
++									\
+ asm (									\
+ "	.text\n"							\
+ "	.globl _start\n"						\
+@@ -426,6 +436,13 @@ asm (									\
+ 	   direct loader invocation.  Thus, argc and argv must be	\
+ 	   reloaded from from _dl_argc and _dl_argv.  */		\
+ 									\
++	/* Load main_map from _rtld_local and setup dp. */		\
++"	addil	LT'_rtld_local,%r19\n"					\
++"	ldw	RT'_rtld_local(%r1),%r26\n"				\
++"	bl	set_dp, %r2\n"						\
++"	ldw	0(%r26),%r26\n"						\
++"	copy	%ret0,%r26\n"						\
++									\
+ 	/* Load argc from _dl_argc.  */					\
+ "	addil	LT'_dl_argc,%r19\n"					\
+ "	ldw	RT'_dl_argc(%r1),%r20\n"				\
+@@ -438,13 +455,10 @@ asm (									\
+ "	ldw	0(%r20),%r24\n"						\
+ "	stw	%r24,-44(%sp)\n"					\
+ 									\
+-	/* Call _dl_init(main_map, argc, argv, envp). */		\
+-"	addil	LT'_rtld_local,%r19\n"					\
+-"	ldw	RT'_rtld_local(%r1),%r26\n"				\
+-"	ldw	0(%r26),%r26\n"						\
+-									\
+ 	/* envp = argv + argc + 1 */					\
+ "	sh2add	%r25,%r24,%r23\n"					\
++									\
++	/* Call _dl_init(main_map, argc, argv, envp). */		\
+ "	bl	_dl_init,%r2\n"						\
+ "	ldo	4(%r23),%r23\n"	/* delay slot */			\
+ 									\
+-- 
+2.38.1
+
+
+From cdc496eb55e30f8f2461bedb0a7381c0a7a3d3ae Mon Sep 17 00:00:00 2001
+From: John David Anglin <danglin@gcc.gnu.org>
+Date: Tue, 20 Sep 2022 20:14:14 +0000
+Subject: hppa: undef __ASSUME_SET_ROBUST_LIST
+
+QEMU does not support support set_robust_list. Thus, we need
+to enable detection of set_robust_list system call.
+
+Signed-off-by: John David Anglin <dave.anglin@bell.net>
+---
+ sysdeps/unix/sysv/linux/hppa/kernel-features.h | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/sysdeps/unix/sysv/linux/hppa/kernel-features.h b/sysdeps/unix/sysv/linux/hppa/kernel-features.h
+index 0cd21ef0fa..079612e4aa 100644
+--- a/sysdeps/unix/sysv/linux/hppa/kernel-features.h
++++ b/sysdeps/unix/sysv/linux/hppa/kernel-features.h
+@@ -30,3 +30,6 @@
+ 
+ #undef __ASSUME_CLONE_DEFAULT
+ #define __ASSUME_CLONE_BACKWARDS 1
++
++/* QEMU does not support set_robust_list.  */
++#undef __ASSUME_SET_ROBUST_LIST
+-- 
+2.38.1
+
+
+From 18bec23cbb4d530a2a8ce95353770661fabcd55f Mon Sep 17 00:00:00 2001
+From: Aurelien Jarno <aurelien@aurel32.net>
+Date: Mon, 3 Oct 2022 23:46:11 +0200
+Subject: x86: include BMI1 and BMI2 in x86-64-v3 level
+
+The "System V Application Binary Interface AMD64 Architecture Processor
+Supplement" mandates the BMI1 and BMI2 CPU features for the x86-64-v3
+level.
+
+Reviewed-by: Noah Goldstein  <goldstein.w.n@gmail.com>
+(cherry picked from commit b80f16adbd979831bf25ea491e1261e81885c2b6)
+---
+ sysdeps/x86/get-isa-level.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/sysdeps/x86/get-isa-level.h b/sysdeps/x86/get-isa-level.h
+index 1ade78ab73..5b4dd5f062 100644
+--- a/sysdeps/x86/get-isa-level.h
++++ b/sysdeps/x86/get-isa-level.h
+@@ -47,6 +47,8 @@ get_isa_level (const struct cpu_features *cpu_features)
+ 	  isa_level |= GNU_PROPERTY_X86_ISA_1_V2;
+ 	  if (CPU_FEATURE_USABLE_P (cpu_features, AVX)
+ 	      && CPU_FEATURE_USABLE_P (cpu_features, AVX2)
++	      && CPU_FEATURE_USABLE_P (cpu_features, BMI1)
++	      && CPU_FEATURE_USABLE_P (cpu_features, BMI2)
+ 	      && CPU_FEATURE_USABLE_P (cpu_features, F16C)
+ 	      && CPU_FEATURE_USABLE_P (cpu_features, FMA)
+ 	      && CPU_FEATURE_USABLE_P (cpu_features, LZCNT)
+-- 
+2.38.1
+
+
+From 46479e5d10ed87825aa277da158d6a687974518b Mon Sep 17 00:00:00 2001
+From: Aurelien Jarno <aurelien@aurel32.net>
+Date: Mon, 3 Oct 2022 23:46:11 +0200
+Subject: x86-64: Require BMI2 for AVX2 str(n)casecmp implementations
+
+The AVX2 str(n)casecmp implementations use the 'bzhi' instruction, which
+belongs to the BMI2 CPU feature.
+
+NB: It also uses the 'tzcnt' BMI1 instruction, but it is executed as BSF
+as BSF if the CPU doesn't support TZCNT, and produces the same result
+for non-zero input.
+
+Partially fixes: b77b06e0e296 ("x86: Optimize strcmp-avx2.S")
+Partially resolves: BZ #29611
+
+Reviewed-by: Noah Goldstein  <goldstein.w.n@gmail.com>
+(cherry picked from commit 10f79d3670b036925da63dc532b122d27ce65ff8)
+---
+ sysdeps/x86_64/multiarch/ifunc-impl-list.c  | 28 +++++++++++++++------
+ sysdeps/x86_64/multiarch/ifunc-strcasecmp.h |  1 +
+ 2 files changed, 21 insertions(+), 8 deletions(-)
+
+diff --git a/sysdeps/x86_64/multiarch/ifunc-impl-list.c b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
+index a71444eccb..d208fae4bf 100644
+--- a/sysdeps/x86_64/multiarch/ifunc-impl-list.c
++++ b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
+@@ -448,13 +448,16 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
+   IFUNC_IMPL (i, name, strcasecmp,
+ 	      X86_IFUNC_IMPL_ADD_V4 (array, i, strcasecmp,
+ 				     (CPU_FEATURE_USABLE (AVX512VL)
+-				      && CPU_FEATURE_USABLE (AVX512BW)),
++				      && CPU_FEATURE_USABLE (AVX512BW)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __strcasecmp_evex)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, strcasecmp,
+-				     CPU_FEATURE_USABLE (AVX2),
++				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __strcasecmp_avx2)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, strcasecmp,
+ 				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)
+ 				      && CPU_FEATURE_USABLE (RTM)),
+ 				     __strcasecmp_avx2_rtm)
+ 	      X86_IFUNC_IMPL_ADD_V2 (array, i, strcasecmp,
+@@ -470,13 +473,16 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
+   IFUNC_IMPL (i, name, strcasecmp_l,
+ 	      X86_IFUNC_IMPL_ADD_V4 (array, i, strcasecmp,
+ 				     (CPU_FEATURE_USABLE (AVX512VL)
+-				      && CPU_FEATURE_USABLE (AVX512BW)),
++				      && CPU_FEATURE_USABLE (AVX512BW)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __strcasecmp_l_evex)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, strcasecmp,
+-				     CPU_FEATURE_USABLE (AVX2),
++				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __strcasecmp_l_avx2)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, strcasecmp,
+ 				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)
+ 				      && CPU_FEATURE_USABLE (RTM)),
+ 				     __strcasecmp_l_avx2_rtm)
+ 	      X86_IFUNC_IMPL_ADD_V2 (array, i, strcasecmp_l,
+@@ -638,13 +644,16 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
+   IFUNC_IMPL (i, name, strncasecmp,
+ 	      X86_IFUNC_IMPL_ADD_V4 (array, i, strncasecmp,
+ 				     (CPU_FEATURE_USABLE (AVX512VL)
+-				      && CPU_FEATURE_USABLE (AVX512BW)),
++				      && CPU_FEATURE_USABLE (AVX512BW)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __strncasecmp_evex)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, strncasecmp,
+-				     CPU_FEATURE_USABLE (AVX2),
++				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __strncasecmp_avx2)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, strncasecmp,
+ 				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)
+ 				      && CPU_FEATURE_USABLE (RTM)),
+ 				     __strncasecmp_avx2_rtm)
+ 	      X86_IFUNC_IMPL_ADD_V2 (array, i, strncasecmp,
+@@ -660,13 +669,16 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
+   IFUNC_IMPL (i, name, strncasecmp_l,
+ 	      X86_IFUNC_IMPL_ADD_V4 (array, i, strncasecmp,
+ 				     (CPU_FEATURE_USABLE (AVX512VL)
+-				      && CPU_FEATURE_USABLE (AVX512BW)),
++				      & CPU_FEATURE_USABLE (AVX512BW)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __strncasecmp_l_evex)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, strncasecmp,
+-				     CPU_FEATURE_USABLE (AVX2),
++				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __strncasecmp_l_avx2)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, strncasecmp,
+ 				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)
+ 				      && CPU_FEATURE_USABLE (RTM)),
+ 				     __strncasecmp_l_avx2_rtm)
+ 	      X86_IFUNC_IMPL_ADD_V2 (array, i, strncasecmp_l,
+diff --git a/sysdeps/x86_64/multiarch/ifunc-strcasecmp.h b/sysdeps/x86_64/multiarch/ifunc-strcasecmp.h
+index 68646ef199..7622af259c 100644
+--- a/sysdeps/x86_64/multiarch/ifunc-strcasecmp.h
++++ b/sysdeps/x86_64/multiarch/ifunc-strcasecmp.h
+@@ -34,6 +34,7 @@ IFUNC_SELECTOR (void)
+   const struct cpu_features *cpu_features = __get_cpu_features ();
+ 
+   if (X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, AVX2)
++      && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, BMI2)
+       && X86_ISA_CPU_FEATURES_ARCH_P (cpu_features,
+ 				      AVX_Fast_Unaligned_Load, ))
+     {
+-- 
+2.38.1
+
+
+From 7afbd1e56acb721031bffd876f275dcb1af7e530 Mon Sep 17 00:00:00 2001
+From: Aurelien Jarno <aurelien@aurel32.net>
+Date: Mon, 3 Oct 2022 23:46:11 +0200
+Subject: x86-64: Require BMI2 for AVX2 strcmp implementation
+
+The AVX2 strcmp implementation uses the 'bzhi' instruction, which
+belongs to the BMI2 CPU feature.
+
+NB: It also uses the 'tzcnt' BMI1 instruction, but it is executed as BSF
+as BSF if the CPU doesn't support TZCNT, and produces the same result
+for non-zero input.
+
+Partially fixes: b77b06e0e296 ("x86: Optimize strcmp-avx2.S")
+Partially resolves: BZ #29611
+
+Reviewed-by: Noah Goldstein  <goldstein.w.n@gmail.com>
+(cherry picked from commit 4d64c6445735e9b34e2ac8e369312cbfc2f88e17)
+---
+ sysdeps/x86_64/multiarch/ifunc-impl-list.c | 4 +++-
+ sysdeps/x86_64/multiarch/strcmp.c          | 4 ++--
+ 2 files changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/sysdeps/x86_64/multiarch/ifunc-impl-list.c b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
+index d208fae4bf..a42b0a4620 100644
+--- a/sysdeps/x86_64/multiarch/ifunc-impl-list.c
++++ b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
+@@ -591,10 +591,12 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
+ 				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __strcmp_evex)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, strcmp,
+-				     CPU_FEATURE_USABLE (AVX2),
++				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __strcmp_avx2)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, strcmp,
+ 				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)
+ 				      && CPU_FEATURE_USABLE (RTM)),
+ 				     __strcmp_avx2_rtm)
+ 	      X86_IFUNC_IMPL_ADD_V2 (array, i, strcmp,
+diff --git a/sysdeps/x86_64/multiarch/strcmp.c b/sysdeps/x86_64/multiarch/strcmp.c
+index fdd5afe3af..9d6c9f66ba 100644
+--- a/sysdeps/x86_64/multiarch/strcmp.c
++++ b/sysdeps/x86_64/multiarch/strcmp.c
+@@ -45,12 +45,12 @@ IFUNC_SELECTOR (void)
+   const struct cpu_features *cpu_features = __get_cpu_features ();
+ 
+   if (X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, AVX2)
++      && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, BMI2)
+       && X86_ISA_CPU_FEATURES_ARCH_P (cpu_features,
+ 				      AVX_Fast_Unaligned_Load, ))
+     {
+       if (X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, AVX512VL)
+-	  && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, AVX512BW)
+-	  && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, BMI2))
++	  && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, AVX512BW))
+ 	return OPTIMIZE (evex);
+ 
+       if (CPU_FEATURE_USABLE_P (cpu_features, RTM))
+-- 
+2.38.1
+
+
+From 29c577e0f54fe6e70ceacb3659179781c5569903 Mon Sep 17 00:00:00 2001
+From: Aurelien Jarno <aurelien@aurel32.net>
+Date: Mon, 3 Oct 2022 23:46:11 +0200
+Subject: x86-64: Require BMI2 for AVX2 strncmp implementation
+
+The AVX2 strncmp implementations uses the 'bzhi' instruction, which
+belongs to the BMI2 CPU feature.
+
+NB: It also uses the 'tzcnt' BMI1 instruction, but it is executed as BSF
+as BSF if the CPU doesn't support TZCNT, and produces the same result
+for non-zero input.
+
+Partially fixes: b77b06e0e296 ("x86: Optimize strcmp-avx2.S")
+Partially resolves: BZ #29611
+
+Reviewed-by: Noah Goldstein  <goldstein.w.n@gmail.com>
+(cherry picked from commit fc7de1d9b99ae1676bc626ddca422d7abee0eb48)
+---
+ sysdeps/x86_64/multiarch/ifunc-impl-list.c | 7 +++++--
+ sysdeps/x86_64/multiarch/strncmp.c         | 4 ++--
+ 2 files changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/sysdeps/x86_64/multiarch/ifunc-impl-list.c b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
+index a42b0a4620..aebef3daaf 100644
+--- a/sysdeps/x86_64/multiarch/ifunc-impl-list.c
++++ b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
+@@ -1176,13 +1176,16 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
+   IFUNC_IMPL (i, name, strncmp,
+ 	      X86_IFUNC_IMPL_ADD_V4 (array, i, strncmp,
+ 				     (CPU_FEATURE_USABLE (AVX512VL)
+-				      && CPU_FEATURE_USABLE (AVX512BW)),
++				      && CPU_FEATURE_USABLE (AVX512BW)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __strncmp_evex)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, strncmp,
+-				     CPU_FEATURE_USABLE (AVX2),
++				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __strncmp_avx2)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, strncmp,
+ 				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)
+ 				      && CPU_FEATURE_USABLE (RTM)),
+ 				     __strncmp_avx2_rtm)
+ 	      X86_IFUNC_IMPL_ADD_V2 (array, i, strncmp,
+diff --git a/sysdeps/x86_64/multiarch/strncmp.c b/sysdeps/x86_64/multiarch/strncmp.c
+index 4ebe4bde30..c4f8b6bbb5 100644
+--- a/sysdeps/x86_64/multiarch/strncmp.c
++++ b/sysdeps/x86_64/multiarch/strncmp.c
+@@ -41,12 +41,12 @@ IFUNC_SELECTOR (void)
+   const struct cpu_features *cpu_features = __get_cpu_features ();
+ 
+   if (X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, AVX2)
++      && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, BMI2)
+       && X86_ISA_CPU_FEATURES_ARCH_P (cpu_features,
+ 				      AVX_Fast_Unaligned_Load, ))
+     {
+       if (X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, AVX512VL)
+-	  && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, AVX512BW)
+-	  && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, BMI2))
++	  && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, AVX512BW))
+ 	return OPTIMIZE (evex);
+ 
+       if (CPU_FEATURE_USABLE_P (cpu_features, RTM))
+-- 
+2.38.1
+
+
+From d8bf4388df679fa5a3ae7889a649e573e3124530 Mon Sep 17 00:00:00 2001
+From: Aurelien Jarno <aurelien@aurel32.net>
+Date: Mon, 3 Oct 2022 23:46:11 +0200
+Subject: x86-64: Require BMI2 for AVX2 wcs(n)cmp implementations
+
+The AVX2 wcs(n)cmp implementations use the 'bzhi' instruction, which
+belongs to the BMI2 CPU feature.
+
+NB: It also uses the 'tzcnt' BMI1 instruction, but it is executed as BSF
+as BSF if the CPU doesn't support TZCNT, and produces the same result
+for non-zero input.
+
+Partially fixes: b77b06e0e296 ("x86: Optimize strcmp-avx2.S")
+Partially resolves: BZ #29611
+
+Reviewed-by: Noah Goldstein  <goldstein.w.n@gmail.com>
+(cherry picked from commit f31a5a884ed84bd37032729d4d1eb9d06c9f3c29)
+---
+ sysdeps/x86_64/multiarch/ifunc-impl-list.c | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/sysdeps/x86_64/multiarch/ifunc-impl-list.c b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
+index aebef3daaf..fec8790c11 100644
+--- a/sysdeps/x86_64/multiarch/ifunc-impl-list.c
++++ b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
+@@ -810,10 +810,12 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
+ 				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __wcscmp_evex)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, wcscmp,
+-				     CPU_FEATURE_USABLE (AVX2),
++				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __wcscmp_avx2)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, wcscmp,
+ 				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)
+ 				      && CPU_FEATURE_USABLE (RTM)),
+ 				     __wcscmp_avx2_rtm)
+ 	      /* ISA V2 wrapper for SSE2 implementation because the SSE2
+@@ -830,10 +832,12 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
+ 				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __wcsncmp_evex)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, wcsncmp,
+-				     CPU_FEATURE_USABLE (AVX2),
++				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __wcsncmp_avx2)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, wcsncmp,
+ 				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)
+ 				      && CPU_FEATURE_USABLE (RTM)),
+ 				     __wcsncmp_avx2_rtm)
+ 	      /* ISA V2 wrapper for GENERIC implementation because the
+-- 
+2.38.1
+
+
+From d9196d4f3fa9997388655813ddd236426a16dd92 Mon Sep 17 00:00:00 2001
+From: Aurelien Jarno <aurelien@aurel32.net>
+Date: Mon, 3 Oct 2022 23:46:11 +0200
+Subject: x86-64: Require BMI2 for AVX2 (raw|w)memchr implementations
+
+The AVX2 memchr, rawmemchr and wmemchr implementations use the 'bzhi'
+and 'sarx' instructions, which belongs to the BMI2 CPU feature.
+
+Fixes: acfd088a1963 ("x86: Optimize memchr-avx2.S")
+Partially resolves: BZ #29611
+
+Reviewed-by: Noah Goldstein  <goldstein.w.n@gmail.com>
+(cherry picked from commit e3e7fab7fe5186d18ca2046d99ba321c27db30ad)
+---
+ sysdeps/x86_64/multiarch/ifunc-impl-list.c | 12 +++++++++---
+ 1 file changed, 9 insertions(+), 3 deletions(-)
+
+diff --git a/sysdeps/x86_64/multiarch/ifunc-impl-list.c b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
+index fec8790c11..7c84963d92 100644
+--- a/sysdeps/x86_64/multiarch/ifunc-impl-list.c
++++ b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
+@@ -69,10 +69,12 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
+ 				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __memchr_evex_rtm)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, memchr,
+-				     CPU_FEATURE_USABLE (AVX2),
++				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __memchr_avx2)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, memchr,
+ 				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)
+ 				      && CPU_FEATURE_USABLE (RTM)),
+ 				     __memchr_avx2_rtm)
+ 	      /* ISA V2 wrapper for SSE2 implementation because the SSE2
+@@ -335,10 +337,12 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
+ 				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __rawmemchr_evex_rtm)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, rawmemchr,
+-				     CPU_FEATURE_USABLE (AVX2),
++				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __rawmemchr_avx2)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, rawmemchr,
+ 				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)
+ 				      && CPU_FEATURE_USABLE (RTM)),
+ 				     __rawmemchr_avx2_rtm)
+ 	      /* ISA V2 wrapper for SSE2 implementation because the SSE2
+@@ -927,10 +931,12 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
+ 				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __wmemchr_evex_rtm)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, wmemchr,
+-				     CPU_FEATURE_USABLE (AVX2),
++				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __wmemchr_avx2)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, wmemchr,
+ 				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)
+ 				      && CPU_FEATURE_USABLE (RTM)),
+ 				     __wmemchr_avx2_rtm)
+ 	      /* ISA V2 wrapper for SSE2 implementation because the SSE2
+-- 
+2.38.1
+
+
+From 923c3f3c373f499e62160e00831dda576443317b Mon Sep 17 00:00:00 2001
+From: Aurelien Jarno <aurelien@aurel32.net>
+Date: Mon, 3 Oct 2022 23:46:11 +0200
+Subject: x86-64: Require BMI2 and LZCNT for AVX2 memrchr implementation
+
+The AVX2 memrchr implementation uses the 'shlxl' instruction, which
+belongs to the BMI2 CPU feature and uses the 'lzcnt' instruction, which
+belongs to the LZCNT CPU feature.
+
+Fixes: af5306a735eb ("x86: Optimize memrchr-avx2.S")
+Partially resolves: BZ #29611
+
+Reviewed-by: Noah Goldstein  <goldstein.w.n@gmail.com>
+(cherry picked from commit 3c0c78afabfed4b6fc161c159e628fbf14ff370b)
+---
+ sysdeps/x86/isa-level.h                    |  1 +
+ sysdeps/x86_64/multiarch/ifunc-avx2.h      |  1 +
+ sysdeps/x86_64/multiarch/ifunc-impl-list.c | 10 ++++++++--
+ 3 files changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/sysdeps/x86/isa-level.h b/sysdeps/x86/isa-level.h
+index 3c4480aba7..bbb90f5c5e 100644
+--- a/sysdeps/x86/isa-level.h
++++ b/sysdeps/x86/isa-level.h
+@@ -80,6 +80,7 @@
+ #define AVX_X86_ISA_LEVEL 3
+ #define AVX2_X86_ISA_LEVEL 3
+ #define BMI2_X86_ISA_LEVEL 3
++#define LZCNT_X86_ISA_LEVEL 3
+ #define MOVBE_X86_ISA_LEVEL 3
+ 
+ /* ISA level >= 2 guaranteed includes.  */
+diff --git a/sysdeps/x86_64/multiarch/ifunc-avx2.h b/sysdeps/x86_64/multiarch/ifunc-avx2.h
+index a57a9952f3..f1741083fd 100644
+--- a/sysdeps/x86_64/multiarch/ifunc-avx2.h
++++ b/sysdeps/x86_64/multiarch/ifunc-avx2.h
+@@ -37,6 +37,7 @@ IFUNC_SELECTOR (void)
+ 
+   if (X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, AVX2)
+       && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, BMI2)
++      && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, LZCNT)
+       && X86_ISA_CPU_FEATURES_ARCH_P (cpu_features,
+ 				      AVX_Fast_Unaligned_Load, ))
+     {
+diff --git a/sysdeps/x86_64/multiarch/ifunc-impl-list.c b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
+index 7c84963d92..ec1c5b55fb 100644
+--- a/sysdeps/x86_64/multiarch/ifunc-impl-list.c
++++ b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
+@@ -209,13 +209,19 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
+   IFUNC_IMPL (i, name, memrchr,
+ 	      X86_IFUNC_IMPL_ADD_V4 (array, i, memrchr,
+ 				     (CPU_FEATURE_USABLE (AVX512VL)
+-				      && CPU_FEATURE_USABLE (AVX512BW)),
++				      && CPU_FEATURE_USABLE (AVX512BW)
++				      && CPU_FEATURE_USABLE (BMI2)
++				      && CPU_FEATURE_USABLE (LZCNT)),
+ 				     __memrchr_evex)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, memrchr,
+-				     CPU_FEATURE_USABLE (AVX2),
++				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)
++				      && CPU_FEATURE_USABLE (LZCNT)),
+ 				     __memrchr_avx2)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, memrchr,
+ 				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI2)
++				      && CPU_FEATURE_USABLE (LZCNT)
+ 				      && CPU_FEATURE_USABLE (RTM)),
+ 				     __memrchr_avx2_rtm)
+ 	      /* ISA V2 wrapper for SSE2 implementation because the SSE2
+-- 
+2.38.1
+
+
+From 2d8ef784bd6a784496a6fd460de6b6f57c70a501 Mon Sep 17 00:00:00 2001
+From: Aurelien Jarno <aurelien@aurel32.net>
+Date: Mon, 3 Oct 2022 23:46:11 +0200
+Subject: x86-64: Require BMI1/BMI2 for AVX2 strrchr and wcsrchr
+ implementations
+
+The AVX2 strrchr and wcsrchr implementation uses the 'blsmsk'
+instruction which belongs to the BMI1 CPU feature and the 'shrx'
+instruction, which belongs to the BMI2 CPU feature.
+
+Fixes: df7e295d18ff ("x86: Optimize {str|wcs}rchr-avx2")
+Partially resolves: BZ #29611
+
+Reviewed-by: Noah Goldstein  <goldstein.w.n@gmail.com>
+(cherry picked from commit 7e8283170c5d6805b609a040801d819e362a6292)
+---
+ sysdeps/x86/isa-level.h                    |  1 +
+ sysdeps/x86_64/multiarch/ifunc-avx2.h      |  1 +
+ sysdeps/x86_64/multiarch/ifunc-impl-list.c | 17 ++++++++++++++---
+ 3 files changed, 16 insertions(+), 3 deletions(-)
+
+diff --git a/sysdeps/x86/isa-level.h b/sysdeps/x86/isa-level.h
+index bbb90f5c5e..06f6c9663e 100644
+--- a/sysdeps/x86/isa-level.h
++++ b/sysdeps/x86/isa-level.h
+@@ -79,6 +79,7 @@
+ /* ISA level >= 3 guaranteed includes.  */
+ #define AVX_X86_ISA_LEVEL 3
+ #define AVX2_X86_ISA_LEVEL 3
++#define BMI1_X86_ISA_LEVEL 3
+ #define BMI2_X86_ISA_LEVEL 3
+ #define LZCNT_X86_ISA_LEVEL 3
+ #define MOVBE_X86_ISA_LEVEL 3
+diff --git a/sysdeps/x86_64/multiarch/ifunc-avx2.h b/sysdeps/x86_64/multiarch/ifunc-avx2.h
+index f1741083fd..f2f5e8a211 100644
+--- a/sysdeps/x86_64/multiarch/ifunc-avx2.h
++++ b/sysdeps/x86_64/multiarch/ifunc-avx2.h
+@@ -36,6 +36,7 @@ IFUNC_SELECTOR (void)
+   const struct cpu_features *cpu_features = __get_cpu_features ();
+ 
+   if (X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, AVX2)
++      && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, BMI1)
+       && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, BMI2)
+       && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, LZCNT)
+       && X86_ISA_CPU_FEATURES_ARCH_P (cpu_features,
+diff --git a/sysdeps/x86_64/multiarch/ifunc-impl-list.c b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
+index ec1c5b55fb..00a91123d3 100644
+--- a/sysdeps/x86_64/multiarch/ifunc-impl-list.c
++++ b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
+@@ -578,13 +578,19 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
+   IFUNC_IMPL (i, name, strrchr,
+ 	      X86_IFUNC_IMPL_ADD_V4 (array, i, strrchr,
+ 				     (CPU_FEATURE_USABLE (AVX512VL)
+-				      && CPU_FEATURE_USABLE (AVX512BW)),
++				      && CPU_FEATURE_USABLE (AVX512BW)
++				      && CPU_FEATURE_USABLE (BMI1)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __strrchr_evex)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, strrchr,
+-				     CPU_FEATURE_USABLE (AVX2),
++				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI1)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __strrchr_avx2)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, strrchr,
+ 				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI1)
++				      && CPU_FEATURE_USABLE (BMI2)
+ 				      && CPU_FEATURE_USABLE (RTM)),
+ 				     __strrchr_avx2_rtm)
+ 	      /* ISA V2 wrapper for SSE2 implementation because the SSE2
+@@ -797,13 +803,18 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
+ 	      X86_IFUNC_IMPL_ADD_V4 (array, i, wcsrchr,
+ 				     (CPU_FEATURE_USABLE (AVX512VL)
+ 				      && CPU_FEATURE_USABLE (AVX512BW)
++				      && CPU_FEATURE_USABLE (BMI1)
+ 				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __wcsrchr_evex)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, wcsrchr,
+-				     CPU_FEATURE_USABLE (AVX2),
++				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI1)
++				      && CPU_FEATURE_USABLE (BMI2)),
+ 				     __wcsrchr_avx2)
+ 	      X86_IFUNC_IMPL_ADD_V3 (array, i, wcsrchr,
+ 				     (CPU_FEATURE_USABLE (AVX2)
++				      && CPU_FEATURE_USABLE (BMI1)
++				      && CPU_FEATURE_USABLE (BMI2)
+ 				      && CPU_FEATURE_USABLE (RTM)),
+ 				     __wcsrchr_avx2_rtm)
+ 	      /* ISA V2 wrapper for SSE2 implementation because the SSE2
+-- 
+2.38.1
+
+
+From 2bd815d8347851212b9a91dbdca8053f4dbdac87 Mon Sep 17 00:00:00 2001
+From: Siddhesh Poyarekar <siddhesh@sourceware.org>
+Date: Tue, 4 Oct 2022 18:43:50 -0400
+Subject: nscd: Drop local address tuple variable [BZ #29607]
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+When a request needs to be resent (e.g. due to insufficient buffer
+space), the references to subsequent tuples in the local variable are
+stale and should not be used.  This used to work by accident before, but
+since 1d495912a it no longer does.  Instead of trying to reset it, just
+let gethostbyname4_r write into TUMPBUF6 for us, thus maintaining a
+consistent state at all times.  This is now consistent with what is done
+in gaih_inet for getaddrinfo.
+
+Resolves: BZ #29607
+Reported-by: Holger Hoffstätte <holger@applied-asynchrony.com>
+Tested-by: Holger Hoffstätte <holger@applied-asynchrony.com>
+Reviewed-by: Carlos O'Donell <carlos@redhat.com>
+(cherry picked from commit 6e33e5c4b73cea7b8aa3de0947123db16200fb65)
+---
+ NEWS           | 2 ++
+ nscd/aicache.c | 5 ++---
+ 2 files changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/NEWS b/NEWS
+index 91bcfeb7a6..63e26d7062 100644
+--- a/NEWS
++++ b/NEWS
+@@ -28,6 +28,8 @@ The following bugs are resolved with this release:
+   [29537] libc: [2.34 regression]: Alignment issue on m68k when using
+   [29539] libc: LD_TRACE_LOADED_OBJECTS changed how vDSO library are
+   [29583] Use 64-bit interfaces in gconv_parseconfdir
++  [29607] nscd repeatably crashes calling __strlen_avx2 when hosts cache is
++    enabled
+   [29638] libc: stdlib: arc4random fallback is never used
+ \f
+ Version 2.36
+diff --git a/nscd/aicache.c b/nscd/aicache.c
+index 51e793199f..e0baed170b 100644
+--- a/nscd/aicache.c
++++ b/nscd/aicache.c
+@@ -110,11 +110,10 @@ addhstaiX (struct database_dyn *db, int fd, request_header *req,
+ 							  "gethostbyname4_r");
+       if (fct4 != NULL)
+ 	{
+-	  struct gaih_addrtuple atmem;
+ 	  struct gaih_addrtuple *at;
+ 	  while (1)
+ 	    {
+-	      at = &atmem;
++	      at = NULL;
+ 	      rc6 = 0;
+ 	      herrno = 0;
+ 	      status[1] = DL_CALL_FCT (fct4, (key, &at,
+@@ -137,7 +136,7 @@ addhstaiX (struct database_dyn *db, int fd, request_header *req,
+ 	    goto next_nip;
+ 
+ 	  /* We found the data.  Count the addresses and the size.  */
+-	  for (const struct gaih_addrtuple *at2 = at = &atmem; at2 != NULL;
++	  for (const struct gaih_addrtuple *at2 = at; at2 != NULL;
+ 	       at2 = at2->next)
+ 	    {
+ 	      ++naddrs;
+-- 
+2.38.1
+
+
+From 3e279192749cfcae4ceebb1f21a3275e677d0561 Mon Sep 17 00:00:00 2001
+From: Michael Hudson-Doyle <michael.hudson@canonical.com>
+Date: Fri, 12 Aug 2022 11:29:31 +1200
+Subject: Ensure calculations happen with desired rounding mode in y1lf128
+
+math/test-float128-y1 fails on x86_64 and ppc64el with gcc 12 and -O3,
+because code inside a block guarded by SET_RESTORE_ROUNDL is being moved
+after the rounding mode has been restored. Use math_force_eval to
+prevent this (and insert some math_opt_barrier calls to prevent code
+from being moved before the rounding mode is set).
+
+Fixes #29463
+
+Reviewed-By: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
+(cherry picked from commit 2b274fd8c9c776cf70fcdb8356e678ada522a7b0)
+---
+ NEWS                             | 1 +
+ sysdeps/ieee754/ldbl-128/e_j1l.c | 3 +++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/NEWS b/NEWS
+index 63e26d7062..bea1d8a11f 100644
+--- a/NEWS
++++ b/NEWS
+@@ -24,6 +24,7 @@ The following bugs are resolved with this release:
+   [29446] _dlopen now ignores dl_caller argument in static mode
+   [29485] Linux: Terminate subprocess on late failure in tst-pidfd
+   [29490] alpha: New __brk_call implementation is broken
++  [29463] math/test-float128-y1 fails on x86_64
+   [29528] elf: Call __libc_early_init for reused namespaces
+   [29537] libc: [2.34 regression]: Alignment issue on m68k when using
+   [29539] libc: LD_TRACE_LOADED_OBJECTS changed how vDSO library are
+diff --git a/sysdeps/ieee754/ldbl-128/e_j1l.c b/sysdeps/ieee754/ldbl-128/e_j1l.c
+index 54c457681a..9a9c5c6f00 100644
+--- a/sysdeps/ieee754/ldbl-128/e_j1l.c
++++ b/sysdeps/ieee754/ldbl-128/e_j1l.c
+@@ -869,10 +869,13 @@ __ieee754_y1l (_Float128 x)
+     {
+       /* 0 <= x <= 2 */
+       SET_RESTORE_ROUNDL (FE_TONEAREST);
++      xx = math_opt_barrier (xx);
++      x = math_opt_barrier (x);
+       z = xx * xx;
+       p = xx * neval (z, Y0_2N, NY0_2N) / deval (z, Y0_2D, NY0_2D);
+       p = -TWOOPI / xx + p;
+       p = TWOOPI * __ieee754_logl (x) * __ieee754_j1l (x) + p;
++      math_force_eval (p);
+       return p;
+     }
+ 
+-- 
+2.38.1
+
+
+From 700d3281f9e57b53c27bc991394b22d467432626 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 13 Sep 2022 16:10:20 +0200
+Subject: nss: Implement --no-addrconfig option for getent
+
+The ahosts, ahostsv4, ahostsv6 commands unconditionally pass
+AI_ADDRCONFIG to getaddrinfo, which is not always desired.
+
+Reviewed-by: Carlos O'Donell <carlos@redhat.com>
+(cherry picked from commit a623f13adfac47c8634a7288e08f821a846bc650)
+---
+ NEWS         |  7 +++++++
+ nss/getent.c | 11 ++++++++++-
+ 2 files changed, 17 insertions(+), 1 deletion(-)
+
+diff --git a/NEWS b/NEWS
+index bea1d8a11f..462a12253d 100644
+--- a/NEWS
++++ b/NEWS
+@@ -7,6 +7,13 @@ using `glibc' in the "product" field.
+ \f
+ Version 2.36.1
+ 
++Major new features:
++
++* The getent tool now supports the --no-addrconfig option. The output of
++  getent with --no-addrconfig may contain addresses of families not
++  configured on the current host i.e. as-if you had not passed
++  AI_ADDRCONFIG to getaddrinfo calls.
++
+ Security related changes:
+ 
+   CVE-2022-39046: When the syslog function is passed a crafted input
+diff --git a/nss/getent.c b/nss/getent.c
+index 8178b4b470..d2d2524b0c 100644
+--- a/nss/getent.c
++++ b/nss/getent.c
+@@ -58,6 +58,8 @@ static const struct argp_option args_options[] =
+   {
+     { "service", 's', N_("CONFIG"), 0, N_("Service configuration to be used") },
+     { "no-idn", 'i', NULL, 0, N_("disable IDN encoding") },
++    { "no-addrconfig", 'A', NULL, 0,
++      N_("do not filter out unsupported IPv4/IPv6 addresses (with ahosts*)") },
+     { NULL, 0, NULL, 0, NULL },
+   };
+ 
+@@ -79,6 +81,9 @@ static struct argp argp =
+ /* Additional getaddrinfo flags for IDN encoding.  */
+ static int idn_flags = AI_IDN | AI_CANONIDN;
+ 
++/* Set to 0 by --no-addrconfig.  */
++static int addrconfig_flags = AI_ADDRCONFIG;
++
+ /* Print the version information.  */
+ static void
+ print_version (FILE *stream, struct argp_state *state)
+@@ -346,7 +351,7 @@ ahosts_keys_int (int af, int xflags, int number, char *key[])
+ 
+   struct addrinfo hint;
+   memset (&hint, '\0', sizeof (hint));
+-  hint.ai_flags = (AI_V4MAPPED | AI_ADDRCONFIG | AI_CANONNAME
++  hint.ai_flags = (AI_V4MAPPED | addrconfig_flags | AI_CANONNAME
+ 		   | idn_flags | xflags);
+   hint.ai_family = af;
+ 
+@@ -905,6 +910,10 @@ parse_option (int key, char *arg, struct argp_state *state)
+       idn_flags = 0;
+       break;
+ 
++    case 'A':
++      addrconfig_flags = 0;
++      break;
++
+     default:
+       return ARGP_ERR_UNKNOWN;
+     }
+-- 
+2.38.1
+
+
+From 2681d38cafaceafeb330bc0536fa710b75ed5947 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 13 Sep 2022 16:11:40 +0200
+Subject: nss: Fix tst-nss-files-hosts-long on single-stack hosts (bug 24816)
+
+getent implicitly passes AI_ADDRCONFIG to getaddrinfo by default.
+Use --no-addrconfig to suppress that, so that both IPv4 and IPv6
+lookups succeed even if the address family is not supported by the
+host.
+
+Reviewed-by: Carlos O'Donell <carlos@redhat.com>
+(cherry picked from commit c75d20b5b27b0a60f0678236f51a4d3b0b058c00)
+---
+ NEWS                           | 1 +
+ nss/tst-nss-files-hosts-long.c | 9 +++++----
+ 2 files changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/NEWS b/NEWS
+index 462a12253d..de775ab116 100644
+--- a/NEWS
++++ b/NEWS
+@@ -24,6 +24,7 @@ Security related changes:
+ The following bugs are resolved with this release:
+ 
+   [12154] Do not fail DNS resolution for CNAMEs which are not host names
++  [24816] Fix tst-nss-files-hosts-long on single-stack hosts
+   [28846] CMSG_NXTHDR may trigger -Wstrict-overflow warning
+   [29305] Conserve NSS buffer space during DNS packet parsing
+   [29415] nscd: Fix netlink cache invalidation if epoll is used
+diff --git a/nss/tst-nss-files-hosts-long.c b/nss/tst-nss-files-hosts-long.c
+index 3942cf5fca..a7697e3143 100644
+--- a/nss/tst-nss-files-hosts-long.c
++++ b/nss/tst-nss-files-hosts-long.c
+@@ -28,14 +28,15 @@ do_test (void)
+ {
+   int ret;
+ 
+-  /* Run getent to fetch the IPv4 address for host test4.
+-     This forces /etc/hosts to be parsed.  */
+-  ret = system("getent ahostsv4 test4");
++  /* Run getent to fetch the IPv4 address for host test4.  This forces
++     /etc/hosts to be parsed.  Use --no-addrconfig to return addresses
++     even in an IPv6-only environment.  */
++  ret = system("getent --no-addrconfig ahostsv4 test4");
+   if (ret != 0)
+     FAIL_EXIT1("ahostsv4 failed");
+ 
+   /* Likewise for IPv6.  */
+-  ret = system("getent ahostsv6 test6");
++  ret = system("getent --no-addrconfig  ahostsv6 test6");
+   if (ret != 0)
+     FAIL_EXIT1("ahostsv6 failed");
+ 
+-- 
+2.38.1
+
+
+From 908454129d21126bf7fc58f2a520b1f304dc5f02 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Fri, 23 Sep 2022 19:30:57 +0200
+Subject: nss: Use shared prefix in IPv4 address in tst-reload1
+
+Otherwise, sorting based on the longest-matching prefix in
+getaddrinfo can reorder the addresses in ways the test does not
+expect, depending on the IPv4 address of the host.
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit c02e29a0ba47d636281e1a026444a1a0a254aa12)
+---
+ nss/tst-reload1.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/nss/tst-reload1.c b/nss/tst-reload1.c
+index fdc5bdd65b..bc32bb132a 100644
+--- a/nss/tst-reload1.c
++++ b/nss/tst-reload1.c
+@@ -43,12 +43,12 @@ static struct passwd pwd_table_1[] = {
+ 
+ static const char *hostaddr_5[] =
+   {
+-   "ABCD", "abcd", "1234", NULL
++   "ABCd", "ABCD", "ABC4", NULL
+   };
+ 
+ static const char *hostaddr_15[] =
+   {
+-   "4321", "ghij", NULL
++   "4321", "4322", NULL
+   };
+ 
+ static const char *hostaddr_25[] =
+@@ -86,12 +86,12 @@ static const char *hostaddr_6[] =
+ 
+ static const char *hostaddr_16[] =
+   {
+-   "7890", "a1b2", NULL
++   "7890", "7891", NULL
+   };
+ 
+ static const char *hostaddr_26[] =
+   {
+-   "qwer", "tyui", NULL
++   "qwer", "qweR", NULL
+   };
+ 
+ static struct hostent host_table_2[] = {
+-- 
+2.38.1
+
+
+From 19535f3b57306ea3ec559a6c0b10d2d7a87418a7 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Fri, 14 Oct 2022 11:02:25 +0200
+Subject: elf: Do not completely clear reused namespace in dlmopen (bug 29600)
+
+The data in the _ns_debug member must be preserved, otherwise
+_dl_debug_initialize enters an infinite loop.  To be conservative,
+only clear the libc_map member for now, to fix bug 29528.
+
+Fixes commit d0e357ff45a75553dee3b17ed7d303bfa544f6fe
+("elf: Call __libc_early_init for reused namespaces (bug 29528)"),
+by reverting most of it.
+
+Reviewed-by: Carlos O'Donell <carlos@redhat.com>
+Tested-by: Carlos O'Donell <carlos@redhat.com>
+(cherry picked from commit 2c42257314536b94cc8d52edede86e94e98c1436)
+---
+ NEWS                    |  1 +
+ elf/dl-open.c           | 14 ++++++--------
+ elf/tst-dlmopen-twice.c | 28 ++++++++++++++++++++++++----
+ 3 files changed, 31 insertions(+), 12 deletions(-)
+
+diff --git a/NEWS b/NEWS
+index de775ab116..a6da588c85 100644
+--- a/NEWS
++++ b/NEWS
+@@ -37,6 +37,7 @@ The following bugs are resolved with this release:
+   [29537] libc: [2.34 regression]: Alignment issue on m68k when using
+   [29539] libc: LD_TRACE_LOADED_OBJECTS changed how vDSO library are
+   [29583] Use 64-bit interfaces in gconv_parseconfdir
++  [29600] Do not completely clear reused namespace in dlmopen
+   [29607] nscd repeatably crashes calling __strlen_avx2 when hosts cache is
+     enabled
+   [29638] libc: stdlib: arc4random fallback is never used
+diff --git a/elf/dl-open.c b/elf/dl-open.c
+index 46e8066fd8..e7db5e9642 100644
+--- a/elf/dl-open.c
++++ b/elf/dl-open.c
+@@ -844,15 +844,13 @@ _dl_open (const char *file, int mode, const void *caller_dlopen, Lmid_t nsid,
+ 	  _dl_signal_error (EINVAL, file, NULL, N_("\
+ no more namespaces available for dlmopen()"));
+ 	}
++      else if (nsid == GL(dl_nns))
++	{
++	  __rtld_lock_initialize (GL(dl_ns)[nsid]._ns_unique_sym_table.lock);
++	  ++GL(dl_nns);
++	}
+ 
+-      if (nsid == GL(dl_nns))
+-	++GL(dl_nns);
+-
+-      /* Initialize the new namespace.  Most members are
+-	 zero-initialized, only the lock needs special treatment.  */
+-      memset (&GL(dl_ns)[nsid], 0, sizeof (GL(dl_ns)[nsid]));
+-      __rtld_lock_initialize (GL(dl_ns)[nsid]._ns_unique_sym_table.lock);
+-
++      GL(dl_ns)[nsid].libc_map = NULL;
+       _dl_debug_update (nsid)->r_state = RT_CONSISTENT;
+     }
+   /* Never allow loading a DSO in a namespace which is empty.  Such
+diff --git a/elf/tst-dlmopen-twice.c b/elf/tst-dlmopen-twice.c
+index 449f3c8fa9..70c71fe19c 100644
+--- a/elf/tst-dlmopen-twice.c
++++ b/elf/tst-dlmopen-twice.c
+@@ -16,18 +16,38 @@
+    License along with the GNU C Library; if not, see
+    <https://www.gnu.org/licenses/>.  */
+ 
+-#include <support/xdlfcn.h>
++#include <stdio.h>
+ #include <support/check.h>
++#include <support/xdlfcn.h>
+ 
+-static int
+-do_test (void)
++/* Run the test multiple times, to check finding a new namespace while
++   another namespace is already in use.  This used to trigger bug 29600.  */
++static void
++recurse (int depth)
+ {
+-  void *handle = xdlmopen (LM_ID_NEWLM, "tst-dlmopen-twice-mod1.so", RTLD_NOW);
++  if (depth == 0)
++    return;
++
++  printf ("info: running at depth %d\n", depth);
++  void *handle = xdlmopen (LM_ID_NEWLM, "tst-dlmopen-twice-mod1.so",
++                           RTLD_NOW);
+   xdlclose (handle);
+   handle = xdlmopen (LM_ID_NEWLM, "tst-dlmopen-twice-mod2.so", RTLD_NOW);
+   int (*run_check) (void) = xdlsym (handle, "run_check");
+   TEST_COMPARE (run_check (), 0);
++  recurse (depth - 1);
+   xdlclose (handle);
++}
++
++static int
++do_test (void)
++{
++  /* First run the test without nesting.  */
++  recurse (1);
++
++  /* Then with nesting.  The constant needs to be less than the
++     internal DL_NNS namespace constant.  */
++  recurse (10);
+   return 0;
+ }
+ 
+-- 
+2.38.1
+
+
+From b357157361117182c7a68c90fda7ba431b64442c Mon Sep 17 00:00:00 2001
+From: Michael Hudson-Doyle <michael.hudson@canonical.com>
+Date: Mon, 22 Aug 2022 14:05:04 +1200
+Subject: Fix BZ #29463 in the ibm128 implementation of y1l too
+
+Avoid moving code across SET_RESTORE_ROUNDL in order to fix
+[BZ #29463].
+
+Tested-by: Aurelien Jarno <aurelien@aurel32.net>
+Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
+Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
+(cherry picked from commit b6e37b7805b0182c3e25cdab39ebf5f001c04d05)
+---
+ sysdeps/ieee754/ldbl-128ibm/e_j1l.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/sysdeps/ieee754/ldbl-128ibm/e_j1l.c b/sysdeps/ieee754/ldbl-128ibm/e_j1l.c
+index f85ba94466..0a5fe68342 100644
+--- a/sysdeps/ieee754/ldbl-128ibm/e_j1l.c
++++ b/sysdeps/ieee754/ldbl-128ibm/e_j1l.c
+@@ -792,10 +792,13 @@ __ieee754_y1l (long double x)
+     {
+       /* 0 <= x <= 2 */
+       SET_RESTORE_ROUNDL (FE_TONEAREST);
++      xx = math_opt_barrier (xx);
++      x = math_opt_barrier (x);
+       z = xx * xx;
+       p = xx * neval (z, Y0_2N, NY0_2N) / deval (z, Y0_2D, NY0_2D);
+       p = -TWOOPI / xx + p;
+       p = TWOOPI * __ieee754_logl (x) * __ieee754_j1l (x) + p;
++      math_force_eval (p);
+       return p;
+     }
+ 
+-- 
+2.38.1
+
+
+From 9273b2d0e93e7355656cad3be3a1ca76489df483 Mon Sep 17 00:00:00 2001
+From: Aurelien Jarno <aurelien@aurel32.net>
+Date: Mon, 10 Oct 2022 00:39:33 +0200
+Subject: Avoid undefined behaviour in ibm128 implementation of llroundl (BZ
+ #29488)
+
+Detecting an overflow edge case depended on signed overflow of a long
+long. Replace the additions and the overflow checks by
+__builtin_add_overflow().
+
+Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
+(cherry picked from commit 2b5478569e72ee4820a6e163d306690c9c0eaf5e)
+---
+ NEWS                                     |  2 ++
+ sysdeps/ieee754/ldbl-128ibm/s_llroundl.c | 21 +++++++++------------
+ 2 files changed, 11 insertions(+), 12 deletions(-)
+
+diff --git a/NEWS b/NEWS
+index a6da588c85..8c60d3dc8d 100644
+--- a/NEWS
++++ b/NEWS
+@@ -33,6 +33,8 @@ The following bugs are resolved with this release:
+   [29485] Linux: Terminate subprocess on late failure in tst-pidfd
+   [29490] alpha: New __brk_call implementation is broken
+   [29463] math/test-float128-y1 fails on x86_64
++  [29488] test-ibm128-llround fails on ppc64el when built with gcc-12 and -O2
++    or higher
+   [29528] elf: Call __libc_early_init for reused namespaces
+   [29537] libc: [2.34 regression]: Alignment issue on m68k when using
+   [29539] libc: LD_TRACE_LOADED_OBJECTS changed how vDSO library are
+diff --git a/sysdeps/ieee754/ldbl-128ibm/s_llroundl.c b/sysdeps/ieee754/ldbl-128ibm/s_llroundl.c
+index d85154e73a..d8c0de1faf 100644
+--- a/sysdeps/ieee754/ldbl-128ibm/s_llroundl.c
++++ b/sysdeps/ieee754/ldbl-128ibm/s_llroundl.c
+@@ -66,38 +66,35 @@ __llroundl (long double x)
+       /* Peg at max/min values, assuming that the above conversions do so.
+          Strictly speaking, we can return anything for values that overflow,
+          but this is more useful.  */
+-      res = hi + lo;
+-
+-      /* This is just sign(hi) == sign(lo) && sign(res) != sign(hi).  */
+-      if (__glibc_unlikely (((~(hi ^ lo) & (res ^ hi)) < 0)))
++      if (__glibc_unlikely (__builtin_add_overflow (hi, lo, &res)))
+ 	goto overflow;
+ 
+       xh -= lo;
+       ldbl_canonicalize (&xh, &xl);
+ 
+-      hi = res;
+       if (xh > 0.5)
+ 	{
+-	  res += 1;
++	  if (__glibc_unlikely (__builtin_add_overflow (res, 1, &res)))
++	    goto overflow;
+ 	}
+       else if (xh == 0.5)
+ 	{
+ 	  if (xl > 0.0 || (xl == 0.0 && res >= 0))
+-	    res += 1;
++	    if (__glibc_unlikely (__builtin_add_overflow (res, 1, &res)))
++	      goto overflow;
+ 	}
+       else if (-xh > 0.5)
+ 	{
+-	  res -= 1;
++	  if (__glibc_unlikely (__builtin_add_overflow (res, -1, &res)))
++	    goto overflow;
+ 	}
+       else if (-xh == 0.5)
+ 	{
+ 	  if (xl < 0.0 || (xl == 0.0 && res <= 0))
+-	    res -= 1;
++	    if (__glibc_unlikely (__builtin_add_overflow (res, -1, &res)))
++	      goto overflow;
+ 	}
+ 
+-      if (__glibc_unlikely (((~(hi ^ (res - hi)) & (res ^ hi)) < 0)))
+-	goto overflow;
+-
+       return res;
+     }
+   else
+-- 
+2.38.1
+
+
+From 7b7dfbb0cbdffebf0233c650627a4861212fbb60 Mon Sep 17 00:00:00 2001
+From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Wed, 19 Oct 2022 19:14:04 -0300
+Subject: linux: Fix generic struct_stat for 64 bit time (BZ# 29657)
+
+The generic Linux struct_stat misses the conditionals to use
+bits/struct_stat_time64_helper.h in the __USE_TIME_BITS64 for
+architecture that uses __TIMESIZE == 32 (currently csky and nios2).
+
+Since newer ports should not support 32 bit time_t, the generic
+implementation should be used as default.
+
+For arm, hppa, and sh a copy of default struct_stat is added,
+while for csky and nios a new one based on generic is used, along
+with conditionals to use bits/struct_stat_time64_helper.h.
+
+The default struct_stat is also replaced with the generic one.
+
+Checked on aarch64-linux-gnu and arm-linux-gnueabihf.
+
+(cherry picked from commit 7a6ca82f8007ddbd43e2b8fce806ba7101ee47f5)
+---
+ NEWS                                          |   2 +
+ .../unix/sysv/linux/arm/bits/struct_stat.h    | 139 ++++++++++++++++++
+ sysdeps/unix/sysv/linux/bits/struct_stat.h    | 116 +++++++--------
+ .../{generic => csky}/bits/struct_stat.h      |  28 ++--
+ .../unix/sysv/linux/hppa/bits/struct_stat.h   | 139 ++++++++++++++++++
+ .../unix/sysv/linux/nios2/bits/struct_stat.h  | 135 +++++++++++++++++
+ sysdeps/unix/sysv/linux/sh/bits/struct_stat.h | 139 ++++++++++++++++++
+ 7 files changed, 624 insertions(+), 74 deletions(-)
+ create mode 100644 sysdeps/unix/sysv/linux/arm/bits/struct_stat.h
+ rename sysdeps/unix/sysv/linux/{generic => csky}/bits/struct_stat.h (92%)
+ create mode 100644 sysdeps/unix/sysv/linux/hppa/bits/struct_stat.h
+ create mode 100644 sysdeps/unix/sysv/linux/nios2/bits/struct_stat.h
+ create mode 100644 sysdeps/unix/sysv/linux/sh/bits/struct_stat.h
+
+diff --git a/NEWS b/NEWS
+index 8c60d3dc8d..833045585f 100644
+--- a/NEWS
++++ b/NEWS
+@@ -43,6 +43,8 @@ The following bugs are resolved with this release:
+   [29607] nscd repeatably crashes calling __strlen_avx2 when hosts cache is
+     enabled
+   [29638] libc: stdlib: arc4random fallback is never used
++  [29657] libc: Incorrect struct stat for 64-bit time on linux/generic
++    platforms
+ \f
+ Version 2.36
+ 
+diff --git a/sysdeps/unix/sysv/linux/arm/bits/struct_stat.h b/sysdeps/unix/sysv/linux/arm/bits/struct_stat.h
+new file mode 100644
+index 0000000000..30ee6279d2
+--- /dev/null
++++ b/sysdeps/unix/sysv/linux/arm/bits/struct_stat.h
+@@ -0,0 +1,139 @@
++/* Definition for struct stat.  Linux/arm version.
++   Copyright (C) 2020-2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library.  If not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#if !defined _SYS_STAT_H && !defined _FCNTL_H
++# error "Never include <bits/struct_stat.h> directly; use <sys/stat.h> instead."
++#endif
++
++#ifndef _BITS_STRUCT_STAT_H
++#define _BITS_STRUCT_STAT_H	1
++
++#include <bits/endian.h>
++#include <bits/wordsize.h>
++
++struct stat
++  {
++#ifdef __USE_TIME_BITS64
++# include <bits/struct_stat_time64_helper.h>
++#else
++    __dev_t st_dev;			/* Device.  */
++    unsigned short int __pad1;
++# ifndef __USE_FILE_OFFSET64
++    __ino_t st_ino;			/* File serial number.	*/
++# else
++    __ino_t __st_ino;			/* 32bit file serial number.	*/
++# endif
++    __mode_t st_mode;			/* File mode.  */
++    __nlink_t st_nlink;			/* Link count.  */
++    __uid_t st_uid;			/* User ID of the file's owner.	*/
++    __gid_t st_gid;			/* Group ID of the file's group.*/
++    __dev_t st_rdev;			/* Device number, if device.  */
++    unsigned short int __pad2;
++# ifndef __USE_FILE_OFFSET64
++    __off_t st_size;			/* Size of file, in bytes.  */
++# else
++    __off64_t st_size;			/* Size of file, in bytes.  */
++# endif
++    __blksize_t st_blksize;		/* Optimal block size for I/O.  */
++
++# ifndef __USE_FILE_OFFSET64
++    __blkcnt_t st_blocks;		/* Number 512-byte blocks allocated. */
++# else
++    __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
++# endif
++# ifdef __USE_XOPEN2K8
++    /* Nanosecond resolution timestamps are stored in a format
++       equivalent to 'struct timespec'.  This is the type used
++       whenever possible but the Unix namespace rules do not allow the
++       identifier 'timespec' to appear in the <sys/stat.h> header.
++       Therefore we have to handle the use of this header in strictly
++       standard-compliant sources special.  */
++    struct timespec st_atim;		/* Time of last access.  */
++    struct timespec st_mtim;		/* Time of last modification.  */
++    struct timespec st_ctim;		/* Time of last status change.  */
++#  define st_atime st_atim.tv_sec	/* Backward compatibility.  */
++#  define st_mtime st_mtim.tv_sec
++#  define st_ctime st_ctim.tv_sec
++# else
++    __time_t st_atime;			/* Time of last access.  */
++    unsigned long int st_atimensec;	/* Nscecs of last access.  */
++    __time_t st_mtime;			/* Time of last modification.  */
++    unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
++    __time_t st_ctime;			/* Time of last status change.  */
++    unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
++# endif
++# ifndef __USE_FILE_OFFSET64
++    unsigned long int __glibc_reserved4;
++    unsigned long int __glibc_reserved5;
++# else
++    __ino64_t st_ino;			/* File serial number.	*/
++# endif
++#endif /* __USE_TIME_BITS64  */
++  };
++
++#ifdef __USE_LARGEFILE64
++struct stat64
++  {
++# ifdef __USE_TIME_BITS64
++#  include <bits/struct_stat_time64_helper.h>
++# else
++    __dev_t st_dev;			/* Device.  */
++    unsigned int __pad1;
++
++    __ino_t __st_ino;			/* 32bit file serial number.	*/
++    __mode_t st_mode;			/* File mode.  */
++    __nlink_t st_nlink;			/* Link count.  */
++    __uid_t st_uid;			/* User ID of the file's owner.	*/
++    __gid_t st_gid;			/* Group ID of the file's group.*/
++    __dev_t st_rdev;			/* Device number, if device.  */
++    unsigned int __pad2;
++    __off64_t st_size;			/* Size of file, in bytes.  */
++    __blksize_t st_blksize;		/* Optimal block size for I/O.  */
++
++    __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
++#  ifdef __USE_XOPEN2K8
++    /* Nanosecond resolution timestamps are stored in a format
++       equivalent to 'struct timespec'.  This is the type used
++       whenever possible but the Unix namespace rules do not allow the
++       identifier 'timespec' to appear in the <sys/stat.h> header.
++       Therefore we have to handle the use of this header in strictly
++       standard-compliant sources special.  */
++    struct timespec st_atim;		/* Time of last access.  */
++    struct timespec st_mtim;		/* Time of last modification.  */
++    struct timespec st_ctim;		/* Time of last status change.  */
++#  else
++    __time_t st_atime;			/* Time of last access.  */
++    unsigned long int st_atimensec;	/* Nscecs of last access.  */
++    __time_t st_mtime;			/* Time of last modification.  */
++    unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
++    __time_t st_ctime;			/* Time of last status change.  */
++    unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
++#  endif
++    __ino64_t st_ino;			/* File serial number.		*/
++# endif /* __USE_TIME_BITS64  */
++  };
++#endif
++
++/* Tell code we have these members.  */
++#define	_STATBUF_ST_BLKSIZE
++#define _STATBUF_ST_RDEV
++/* Nanosecond resolution time values are supported.  */
++#define _STATBUF_ST_NSEC
++
++
++#endif /* _BITS_STRUCT_STAT_H  */
+diff --git a/sysdeps/unix/sysv/linux/bits/struct_stat.h b/sysdeps/unix/sysv/linux/bits/struct_stat.h
+index 25bd6cb638..fb11a3fba4 100644
+--- a/sysdeps/unix/sysv/linux/bits/struct_stat.h
++++ b/sysdeps/unix/sysv/linux/bits/struct_stat.h
+@@ -26,37 +26,36 @@
+ #include <bits/endian.h>
+ #include <bits/wordsize.h>
+ 
+-struct stat
+-  {
+-#ifdef __USE_TIME_BITS64
+-# include <bits/struct_stat_time64_helper.h>
+-#else
+-    __dev_t st_dev;			/* Device.  */
+-    unsigned short int __pad1;
+-# ifndef __USE_FILE_OFFSET64
+-    __ino_t st_ino;			/* File serial number.	*/
+-# else
+-    __ino_t __st_ino;			/* 32bit file serial number.	*/
++#if defined __USE_FILE_OFFSET64
++# define __field64(type, type64, name) type64 name
++#elif __WORDSIZE == 64 || defined __INO_T_MATCHES_INO64_T
++# if defined __INO_T_MATCHES_INO64_T && !defined __OFF_T_MATCHES_OFF64_T
++#  error "ino_t and off_t must both be the same type"
+ # endif
+-    __mode_t st_mode;			/* File mode.  */
+-    __nlink_t st_nlink;			/* Link count.  */
+-    __uid_t st_uid;			/* User ID of the file's owner.	*/
+-    __gid_t st_gid;			/* Group ID of the file's group.*/
+-    __dev_t st_rdev;			/* Device number, if device.  */
+-    unsigned short int __pad2;
+-# ifndef __USE_FILE_OFFSET64
+-    __off_t st_size;			/* Size of file, in bytes.  */
+-# else
+-    __off64_t st_size;			/* Size of file, in bytes.  */
+-# endif
+-    __blksize_t st_blksize;		/* Optimal block size for I/O.  */
++# define __field64(type, type64, name) type name
++#elif __BYTE_ORDER == __LITTLE_ENDIAN
++# define __field64(type, type64, name) \
++  type name __attribute__((__aligned__ (__alignof__ (type64)))); int __##name##_pad
++#else
++# define __field64(type, type64, name) \
++  int __##name##_pad __attribute__((__aligned__ (__alignof__ (type64)))); type name
++#endif
+ 
+-# ifndef __USE_FILE_OFFSET64
+-    __blkcnt_t st_blocks;		/* Number 512-byte blocks allocated. */
+-# else
+-    __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
+-# endif
+-# ifdef __USE_XOPEN2K8
++struct stat
++  {
++    __dev_t st_dev;		/* Device.  */
++    __field64(__ino_t, __ino64_t, st_ino);  /* File serial number. */
++    __mode_t st_mode;		/* File mode.  */
++    __nlink_t st_nlink;		/* Link count.  */
++    __uid_t st_uid;		/* User ID of the file's owner.	*/
++    __gid_t st_gid;		/* Group ID of the file's group.*/
++    __dev_t st_rdev;		/* Device number, if device.  */
++    __dev_t __pad1;
++    __field64(__off_t, __off64_t, st_size);  /* Size of file, in bytes. */
++    __blksize_t st_blksize;	/* Optimal block size for I/O.  */
++    int __pad2;
++    __field64(__blkcnt_t, __blkcnt64_t, st_blocks);  /* 512-byte blocks */
++#ifdef __USE_XOPEN2K8
+     /* Nanosecond resolution timestamps are stored in a format
+        equivalent to 'struct timespec'.  This is the type used
+        whenever possible but the Unix namespace rules do not allow the
+@@ -66,47 +65,38 @@ struct stat
+     struct timespec st_atim;		/* Time of last access.  */
+     struct timespec st_mtim;		/* Time of last modification.  */
+     struct timespec st_ctim;		/* Time of last status change.  */
+-#  define st_atime st_atim.tv_sec	/* Backward compatibility.  */
+-#  define st_mtime st_mtim.tv_sec
+-#  define st_ctime st_ctim.tv_sec
+-# else
++# define st_atime st_atim.tv_sec	/* Backward compatibility.  */
++# define st_mtime st_mtim.tv_sec
++# define st_ctime st_ctim.tv_sec
++#else
+     __time_t st_atime;			/* Time of last access.  */
+     unsigned long int st_atimensec;	/* Nscecs of last access.  */
+     __time_t st_mtime;			/* Time of last modification.  */
+     unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
+     __time_t st_ctime;			/* Time of last status change.  */
+     unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
+-# endif
+-# ifndef __USE_FILE_OFFSET64
+-    unsigned long int __glibc_reserved4;
+-    unsigned long int __glibc_reserved5;
+-# else
+-    __ino64_t st_ino;			/* File serial number.	*/
+-# endif
+-#endif /* __USE_TIME_BITS64  */
++#endif
++    int __glibc_reserved[2];
+   };
+ 
++#undef __field64
++
+ #ifdef __USE_LARGEFILE64
+ struct stat64
+   {
+-# ifdef __USE_TIME_BITS64
+-#  include <bits/struct_stat_time64_helper.h>
+-# else
+-    __dev_t st_dev;			/* Device.  */
+-    unsigned int __pad1;
+-
+-    __ino_t __st_ino;			/* 32bit file serial number.	*/
+-    __mode_t st_mode;			/* File mode.  */
+-    __nlink_t st_nlink;			/* Link count.  */
+-    __uid_t st_uid;			/* User ID of the file's owner.	*/
+-    __gid_t st_gid;			/* Group ID of the file's group.*/
+-    __dev_t st_rdev;			/* Device number, if device.  */
+-    unsigned int __pad2;
+-    __off64_t st_size;			/* Size of file, in bytes.  */
+-    __blksize_t st_blksize;		/* Optimal block size for I/O.  */
+-
+-    __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
+-#  ifdef __USE_XOPEN2K8
++    __dev_t st_dev;		/* Device.  */
++    __ino64_t st_ino;		/* File serial number.	*/
++    __mode_t st_mode;		/* File mode.  */
++    __nlink_t st_nlink;		/* Link count.  */
++    __uid_t st_uid;		/* User ID of the file's owner.	*/
++    __gid_t st_gid;		/* Group ID of the file's group.*/
++    __dev_t st_rdev;		/* Device number, if device.  */
++    __dev_t __pad1;
++    __off64_t st_size;		/* Size of file, in bytes.  */
++    __blksize_t st_blksize;	/* Optimal block size for I/O.  */
++    int __pad2;
++    __blkcnt64_t st_blocks;	/* Nr. 512-byte blocks allocated.  */
++#ifdef __USE_XOPEN2K8
+     /* Nanosecond resolution timestamps are stored in a format
+        equivalent to 'struct timespec'.  This is the type used
+        whenever possible but the Unix namespace rules do not allow the
+@@ -116,16 +106,15 @@ struct stat64
+     struct timespec st_atim;		/* Time of last access.  */
+     struct timespec st_mtim;		/* Time of last modification.  */
+     struct timespec st_ctim;		/* Time of last status change.  */
+-#  else
++#else
+     __time_t st_atime;			/* Time of last access.  */
+     unsigned long int st_atimensec;	/* Nscecs of last access.  */
+     __time_t st_mtime;			/* Time of last modification.  */
+     unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
+     __time_t st_ctime;			/* Time of last status change.  */
+     unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
+-#  endif
+-    __ino64_t st_ino;			/* File serial number.		*/
+-# endif /* __USE_TIME_BITS64  */
++#endif
++    int __glibc_reserved[2];
+   };
+ #endif
+ 
+@@ -135,5 +124,4 @@ struct stat64
+ /* Nanosecond resolution time values are supported.  */
+ #define _STATBUF_ST_NSEC
+ 
+-
+ #endif /* _BITS_STRUCT_STAT_H  */
+diff --git a/sysdeps/unix/sysv/linux/generic/bits/struct_stat.h b/sysdeps/unix/sysv/linux/csky/bits/struct_stat.h
+similarity index 92%
+rename from sysdeps/unix/sysv/linux/generic/bits/struct_stat.h
+rename to sysdeps/unix/sysv/linux/csky/bits/struct_stat.h
+index fb11a3fba4..f0ee455748 100644
+--- a/sysdeps/unix/sysv/linux/generic/bits/struct_stat.h
++++ b/sysdeps/unix/sysv/linux/csky/bits/struct_stat.h
+@@ -1,4 +1,4 @@
+-/* Definition for struct stat.
++/* Definition for struct stat.  Linux/csky version.
+    Copyright (C) 2020-2022 Free Software Foundation, Inc.
+    This file is part of the GNU C Library.
+ 
+@@ -43,6 +43,9 @@
+ 
+ struct stat
+   {
++#ifdef __USE_TIME_BITS64
++# include <bits/struct_stat_time64_helper.h>
++#else
+     __dev_t st_dev;		/* Device.  */
+     __field64(__ino_t, __ino64_t, st_ino);  /* File serial number. */
+     __mode_t st_mode;		/* File mode.  */
+@@ -55,7 +58,7 @@ struct stat
+     __blksize_t st_blksize;	/* Optimal block size for I/O.  */
+     int __pad2;
+     __field64(__blkcnt_t, __blkcnt64_t, st_blocks);  /* 512-byte blocks */
+-#ifdef __USE_XOPEN2K8
++# ifdef __USE_XOPEN2K8
+     /* Nanosecond resolution timestamps are stored in a format
+        equivalent to 'struct timespec'.  This is the type used
+        whenever possible but the Unix namespace rules do not allow the
+@@ -65,18 +68,19 @@ struct stat
+     struct timespec st_atim;		/* Time of last access.  */
+     struct timespec st_mtim;		/* Time of last modification.  */
+     struct timespec st_ctim;		/* Time of last status change.  */
+-# define st_atime st_atim.tv_sec	/* Backward compatibility.  */
+-# define st_mtime st_mtim.tv_sec
+-# define st_ctime st_ctim.tv_sec
+-#else
++#  define st_atime st_atim.tv_sec	/* Backward compatibility.  */
++#  define st_mtime st_mtim.tv_sec
++#  define st_ctime st_ctim.tv_sec
++# else
+     __time_t st_atime;			/* Time of last access.  */
+     unsigned long int st_atimensec;	/* Nscecs of last access.  */
+     __time_t st_mtime;			/* Time of last modification.  */
+     unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
+     __time_t st_ctime;			/* Time of last status change.  */
+     unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
+-#endif
++# endif
+     int __glibc_reserved[2];
++#endif
+   };
+ 
+ #undef __field64
+@@ -84,6 +88,9 @@ struct stat
+ #ifdef __USE_LARGEFILE64
+ struct stat64
+   {
++# ifdef __USE_TIME_BITS64
++#  include <bits/struct_stat_time64_helper.h>
++# else
+     __dev_t st_dev;		/* Device.  */
+     __ino64_t st_ino;		/* File serial number.	*/
+     __mode_t st_mode;		/* File mode.  */
+@@ -96,7 +103,7 @@ struct stat64
+     __blksize_t st_blksize;	/* Optimal block size for I/O.  */
+     int __pad2;
+     __blkcnt64_t st_blocks;	/* Nr. 512-byte blocks allocated.  */
+-#ifdef __USE_XOPEN2K8
++#  ifdef __USE_XOPEN2K8
+     /* Nanosecond resolution timestamps are stored in a format
+        equivalent to 'struct timespec'.  This is the type used
+        whenever possible but the Unix namespace rules do not allow the
+@@ -106,15 +113,16 @@ struct stat64
+     struct timespec st_atim;		/* Time of last access.  */
+     struct timespec st_mtim;		/* Time of last modification.  */
+     struct timespec st_ctim;		/* Time of last status change.  */
+-#else
++#  else
+     __time_t st_atime;			/* Time of last access.  */
+     unsigned long int st_atimensec;	/* Nscecs of last access.  */
+     __time_t st_mtime;			/* Time of last modification.  */
+     unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
+     __time_t st_ctime;			/* Time of last status change.  */
+     unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
+-#endif
++#  endif
+     int __glibc_reserved[2];
++# endif
+   };
+ #endif
+ 
+diff --git a/sysdeps/unix/sysv/linux/hppa/bits/struct_stat.h b/sysdeps/unix/sysv/linux/hppa/bits/struct_stat.h
+new file mode 100644
+index 0000000000..38b6e13e68
+--- /dev/null
++++ b/sysdeps/unix/sysv/linux/hppa/bits/struct_stat.h
+@@ -0,0 +1,139 @@
++/* Definition for struct stat.  Linux/hppa version.
++   Copyright (C) 2020-2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library.  If not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#if !defined _SYS_STAT_H && !defined _FCNTL_H
++# error "Never include <bits/struct_stat.h> directly; use <sys/stat.h> instead."
++#endif
++
++#ifndef _BITS_STRUCT_STAT_H
++#define _BITS_STRUCT_STAT_H	1
++
++#include <bits/endian.h>
++#include <bits/wordsize.h>
++
++struct stat
++  {
++#ifdef __USE_TIME_BITS64
++# include <bits/struct_stat_time64_helper.h>
++#else
++    __dev_t st_dev;			/* Device.  */
++    unsigned short int __pad1;
++# ifndef __USE_FILE_OFFSET64
++    __ino_t st_ino;			/* File serial number.	*/
++# else
++    __ino_t __st_ino;			/* 32bit file serial number.	*/
++# endif
++    __mode_t st_mode;			/* File mode.  */
++    __nlink_t st_nlink;			/* Link count.  */
++    __uid_t st_uid;			/* User ID of the file's owner.	*/
++    __gid_t st_gid;			/* Group ID of the file's group.*/
++    __dev_t st_rdev;			/* Device number, if device.  */
++    unsigned short int __pad2;
++# ifndef __USE_FILE_OFFSET64
++    __off_t st_size;			/* Size of file, in bytes.  */
++# else
++    __off64_t st_size;			/* Size of file, in bytes.  */
++# endif
++    __blksize_t st_blksize;		/* Optimal block size for I/O.  */
++
++# ifndef __USE_FILE_OFFSET64
++    __blkcnt_t st_blocks;		/* Number 512-byte blocks allocated. */
++# else
++    __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
++# endif
++# ifdef __USE_XOPEN2K8
++    /* Nanosecond resolution timestamps are stored in a format
++       equivalent to 'struct timespec'.  This is the type used
++       whenever possible but the Unix namespace rules do not allow the
++       identifier 'timespec' to appear in the <sys/stat.h> header.
++       Therefore we have to handle the use of this header in strictly
++       standard-compliant sources special.  */
++    struct timespec st_atim;		/* Time of last access.  */
++    struct timespec st_mtim;		/* Time of last modification.  */
++    struct timespec st_ctim;		/* Time of last status change.  */
++#  define st_atime st_atim.tv_sec	/* Backward compatibility.  */
++#  define st_mtime st_mtim.tv_sec
++#  define st_ctime st_ctim.tv_sec
++# else
++    __time_t st_atime;			/* Time of last access.  */
++    unsigned long int st_atimensec;	/* Nscecs of last access.  */
++    __time_t st_mtime;			/* Time of last modification.  */
++    unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
++    __time_t st_ctime;			/* Time of last status change.  */
++    unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
++# endif
++# ifndef __USE_FILE_OFFSET64
++    unsigned long int __glibc_reserved4;
++    unsigned long int __glibc_reserved5;
++# else
++    __ino64_t st_ino;			/* File serial number.	*/
++# endif
++#endif /* __USE_TIME_BITS64  */
++  };
++
++#ifdef __USE_LARGEFILE64
++struct stat64
++  {
++# ifdef __USE_TIME_BITS64
++#  include <bits/struct_stat_time64_helper.h>
++# else
++    __dev_t st_dev;			/* Device.  */
++    unsigned int __pad1;
++
++    __ino_t __st_ino;			/* 32bit file serial number.	*/
++    __mode_t st_mode;			/* File mode.  */
++    __nlink_t st_nlink;			/* Link count.  */
++    __uid_t st_uid;			/* User ID of the file's owner.	*/
++    __gid_t st_gid;			/* Group ID of the file's group.*/
++    __dev_t st_rdev;			/* Device number, if device.  */
++    unsigned int __pad2;
++    __off64_t st_size;			/* Size of file, in bytes.  */
++    __blksize_t st_blksize;		/* Optimal block size for I/O.  */
++
++    __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
++#  ifdef __USE_XOPEN2K8
++    /* Nanosecond resolution timestamps are stored in a format
++       equivalent to 'struct timespec'.  This is the type used
++       whenever possible but the Unix namespace rules do not allow the
++       identifier 'timespec' to appear in the <sys/stat.h> header.
++       Therefore we have to handle the use of this header in strictly
++       standard-compliant sources special.  */
++    struct timespec st_atim;		/* Time of last access.  */
++    struct timespec st_mtim;		/* Time of last modification.  */
++    struct timespec st_ctim;		/* Time of last status change.  */
++#  else
++    __time_t st_atime;			/* Time of last access.  */
++    unsigned long int st_atimensec;	/* Nscecs of last access.  */
++    __time_t st_mtime;			/* Time of last modification.  */
++    unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
++    __time_t st_ctime;			/* Time of last status change.  */
++    unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
++#  endif
++    __ino64_t st_ino;			/* File serial number.		*/
++# endif /* __USE_TIME_BITS64  */
++  };
++#endif
++
++/* Tell code we have these members.  */
++#define	_STATBUF_ST_BLKSIZE
++#define _STATBUF_ST_RDEV
++/* Nanosecond resolution time values are supported.  */
++#define _STATBUF_ST_NSEC
++
++
++#endif /* _BITS_STRUCT_STAT_H  */
+diff --git a/sysdeps/unix/sysv/linux/nios2/bits/struct_stat.h b/sysdeps/unix/sysv/linux/nios2/bits/struct_stat.h
+new file mode 100644
+index 0000000000..e00e71173e
+--- /dev/null
++++ b/sysdeps/unix/sysv/linux/nios2/bits/struct_stat.h
+@@ -0,0 +1,135 @@
++/* Definition for struct stat.  Linux/nios2 version.
++   Copyright (C) 2020-2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library.  If not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#if !defined _SYS_STAT_H && !defined _FCNTL_H
++# error "Never include <bits/struct_stat.h> directly; use <sys/stat.h> instead."
++#endif
++
++#ifndef _BITS_STRUCT_STAT_H
++#define _BITS_STRUCT_STAT_H	1
++
++#include <bits/endian.h>
++#include <bits/wordsize.h>
++
++#if defined __USE_FILE_OFFSET64
++# define __field64(type, type64, name) type64 name
++#elif __WORDSIZE == 64 || defined __INO_T_MATCHES_INO64_T
++# if defined __INO_T_MATCHES_INO64_T && !defined __OFF_T_MATCHES_OFF64_T
++#  error "ino_t and off_t must both be the same type"
++# endif
++# define __field64(type, type64, name) type name
++#elif __BYTE_ORDER == __LITTLE_ENDIAN
++# define __field64(type, type64, name) \
++  type name __attribute__((__aligned__ (__alignof__ (type64)))); int __##name##_pad
++#else
++# define __field64(type, type64, name) \
++  int __##name##_pad __attribute__((__aligned__ (__alignof__ (type64)))); type name
++#endif
++
++struct stat
++  {
++#ifdef __USE_TIME_BITS64
++# include <bits/struct_stat_time64_helper.h>
++#else
++    __dev_t st_dev;		/* Device.  */
++    __field64(__ino_t, __ino64_t, st_ino);  /* File serial number. */
++    __mode_t st_mode;		/* File mode.  */
++    __nlink_t st_nlink;		/* Link count.  */
++    __uid_t st_uid;		/* User ID of the file's owner.	*/
++    __gid_t st_gid;		/* Group ID of the file's group.*/
++    __dev_t st_rdev;		/* Device number, if device.  */
++    __dev_t __pad1;
++    __field64(__off_t, __off64_t, st_size);  /* Size of file, in bytes. */
++    __blksize_t st_blksize;	/* Optimal block size for I/O.  */
++    int __pad2;
++    __field64(__blkcnt_t, __blkcnt64_t, st_blocks);  /* 512-byte blocks */
++# ifdef __USE_XOPEN2K8
++    /* Nanosecond resolution timestamps are stored in a format
++       equivalent to 'struct timespec'.  This is the type used
++       whenever possible but the Unix namespace rules do not allow the
++       identifier 'timespec' to appear in the <sys/stat.h> header.
++       Therefore we have to handle the use of this header in strictly
++       standard-compliant sources special.  */
++    struct timespec st_atim;		/* Time of last access.  */
++    struct timespec st_mtim;		/* Time of last modification.  */
++    struct timespec st_ctim;		/* Time of last status change.  */
++#  define st_atime st_atim.tv_sec	/* Backward compatibility.  */
++#  define st_mtime st_mtim.tv_sec
++#  define st_ctime st_ctim.tv_sec
++# else
++    __time_t st_atime;			/* Time of last access.  */
++    unsigned long int st_atimensec;	/* Nscecs of last access.  */
++    __time_t st_mtime;			/* Time of last modification.  */
++    unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
++    __time_t st_ctime;			/* Time of last status change.  */
++    unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
++# endif
++    int __glibc_reserved[2];
++#endif
++  };
++
++#undef __field64
++
++#ifdef __USE_LARGEFILE64
++struct stat64
++  {
++# ifdef __USE_TIME_BITS64
++#  include <bits/struct_stat_time64_helper.h>
++# else
++    __dev_t st_dev;		/* Device.  */
++    __ino64_t st_ino;		/* File serial number.	*/
++    __mode_t st_mode;		/* File mode.  */
++    __nlink_t st_nlink;		/* Link count.  */
++    __uid_t st_uid;		/* User ID of the file's owner.	*/
++    __gid_t st_gid;		/* Group ID of the file's group.*/
++    __dev_t st_rdev;		/* Device number, if device.  */
++    __dev_t __pad1;
++    __off64_t st_size;		/* Size of file, in bytes.  */
++    __blksize_t st_blksize;	/* Optimal block size for I/O.  */
++    int __pad2;
++    __blkcnt64_t st_blocks;	/* Nr. 512-byte blocks allocated.  */
++#  ifdef __USE_XOPEN2K8
++    /* Nanosecond resolution timestamps are stored in a format
++       equivalent to 'struct timespec'.  This is the type used
++       whenever possible but the Unix namespace rules do not allow the
++       identifier 'timespec' to appear in the <sys/stat.h> header.
++       Therefore we have to handle the use of this header in strictly
++       standard-compliant sources special.  */
++    struct timespec st_atim;		/* Time of last access.  */
++    struct timespec st_mtim;		/* Time of last modification.  */
++    struct timespec st_ctim;		/* Time of last status change.  */
++#  else
++    __time_t st_atime;			/* Time of last access.  */
++    unsigned long int st_atimensec;	/* Nscecs of last access.  */
++    __time_t st_mtime;			/* Time of last modification.  */
++    unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
++    __time_t st_ctime;			/* Time of last status change.  */
++    unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
++#  endif
++    int __glibc_reserved[2];
++# endif
++  };
++#endif
++
++/* Tell code we have these members.  */
++#define	_STATBUF_ST_BLKSIZE
++#define _STATBUF_ST_RDEV
++/* Nanosecond resolution time values are supported.  */
++#define _STATBUF_ST_NSEC
++
++#endif /* _BITS_STRUCT_STAT_H  */
+diff --git a/sysdeps/unix/sysv/linux/sh/bits/struct_stat.h b/sysdeps/unix/sysv/linux/sh/bits/struct_stat.h
+new file mode 100644
+index 0000000000..0f7c9cdc89
+--- /dev/null
++++ b/sysdeps/unix/sysv/linux/sh/bits/struct_stat.h
+@@ -0,0 +1,139 @@
++/* Definition for struct stat.  Linux/sh version.
++   Copyright (C) 2020-2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library.  If not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#if !defined _SYS_STAT_H && !defined _FCNTL_H
++# error "Never include <bits/struct_stat.h> directly; use <sys/stat.h> instead."
++#endif
++
++#ifndef _BITS_STRUCT_STAT_H
++#define _BITS_STRUCT_STAT_H	1
++
++#include <bits/endian.h>
++#include <bits/wordsize.h>
++
++struct stat
++  {
++#ifdef __USE_TIME_BITS64
++# include <bits/struct_stat_time64_helper.h>
++#else
++    __dev_t st_dev;			/* Device.  */
++    unsigned short int __pad1;
++# ifndef __USE_FILE_OFFSET64
++    __ino_t st_ino;			/* File serial number.	*/
++# else
++    __ino_t __st_ino;			/* 32bit file serial number.	*/
++# endif
++    __mode_t st_mode;			/* File mode.  */
++    __nlink_t st_nlink;			/* Link count.  */
++    __uid_t st_uid;			/* User ID of the file's owner.	*/
++    __gid_t st_gid;			/* Group ID of the file's group.*/
++    __dev_t st_rdev;			/* Device number, if device.  */
++    unsigned short int __pad2;
++# ifndef __USE_FILE_OFFSET64
++    __off_t st_size;			/* Size of file, in bytes.  */
++# else
++    __off64_t st_size;			/* Size of file, in bytes.  */
++# endif
++    __blksize_t st_blksize;		/* Optimal block size for I/O.  */
++
++# ifndef __USE_FILE_OFFSET64
++    __blkcnt_t st_blocks;		/* Number 512-byte blocks allocated. */
++# else
++    __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
++# endif
++# ifdef __USE_XOPEN2K8
++    /* Nanosecond resolution timestamps are stored in a format
++       equivalent to 'struct timespec'.  This is the type used
++       whenever possible but the Unix namespace rules do not allow the
++       identifier 'timespec' to appear in the <sys/stat.h> header.
++       Therefore we have to handle the use of this header in strictly
++       standard-compliant sources special.  */
++    struct timespec st_atim;		/* Time of last access.  */
++    struct timespec st_mtim;		/* Time of last modification.  */
++    struct timespec st_ctim;		/* Time of last status change.  */
++#  define st_atime st_atim.tv_sec	/* Backward compatibility.  */
++#  define st_mtime st_mtim.tv_sec
++#  define st_ctime st_ctim.tv_sec
++# else
++    __time_t st_atime;			/* Time of last access.  */
++    unsigned long int st_atimensec;	/* Nscecs of last access.  */
++    __time_t st_mtime;			/* Time of last modification.  */
++    unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
++    __time_t st_ctime;			/* Time of last status change.  */
++    unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
++# endif
++# ifndef __USE_FILE_OFFSET64
++    unsigned long int __glibc_reserved4;
++    unsigned long int __glibc_reserved5;
++# else
++    __ino64_t st_ino;			/* File serial number.	*/
++# endif
++#endif /* __USE_TIME_BITS64  */
++  };
++
++#ifdef __USE_LARGEFILE64
++struct stat64
++  {
++# ifdef __USE_TIME_BITS64
++#  include <bits/struct_stat_time64_helper.h>
++# else
++    __dev_t st_dev;			/* Device.  */
++    unsigned int __pad1;
++
++    __ino_t __st_ino;			/* 32bit file serial number.	*/
++    __mode_t st_mode;			/* File mode.  */
++    __nlink_t st_nlink;			/* Link count.  */
++    __uid_t st_uid;			/* User ID of the file's owner.	*/
++    __gid_t st_gid;			/* Group ID of the file's group.*/
++    __dev_t st_rdev;			/* Device number, if device.  */
++    unsigned int __pad2;
++    __off64_t st_size;			/* Size of file, in bytes.  */
++    __blksize_t st_blksize;		/* Optimal block size for I/O.  */
++
++    __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
++#  ifdef __USE_XOPEN2K8
++    /* Nanosecond resolution timestamps are stored in a format
++       equivalent to 'struct timespec'.  This is the type used
++       whenever possible but the Unix namespace rules do not allow the
++       identifier 'timespec' to appear in the <sys/stat.h> header.
++       Therefore we have to handle the use of this header in strictly
++       standard-compliant sources special.  */
++    struct timespec st_atim;		/* Time of last access.  */
++    struct timespec st_mtim;		/* Time of last modification.  */
++    struct timespec st_ctim;		/* Time of last status change.  */
++#  else
++    __time_t st_atime;			/* Time of last access.  */
++    unsigned long int st_atimensec;	/* Nscecs of last access.  */
++    __time_t st_mtime;			/* Time of last modification.  */
++    unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
++    __time_t st_ctime;			/* Time of last status change.  */
++    unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
++#  endif
++    __ino64_t st_ino;			/* File serial number.		*/
++# endif /* __USE_TIME_BITS64  */
++  };
++#endif
++
++/* Tell code we have these members.  */
++#define	_STATBUF_ST_BLKSIZE
++#define _STATBUF_ST_RDEV
++/* Nanosecond resolution time values are supported.  */
++#define _STATBUF_ST_NSEC
++
++
++#endif /* _BITS_STRUCT_STAT_H  */
+-- 
+2.38.1
+
+
+From a1dc0be03c9dd850b864bd7a9c03cf8e396eb7ca Mon Sep 17 00:00:00 2001
+From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Tue, 25 Oct 2022 13:19:16 -0300
+Subject: elf: Reinstate on DL_DEBUG_BINDINGS _dl_lookup_symbol_x
+
+The prelink removal done by 6628c742b2c16e wrongly removed the debug
+support.
+
+Checked on x86_64-linux-gnu.
+
+(cherry picked from commit 891a7958a28eac6d4af1517dd2896fef5e4951d4)
+---
+ elf/dl-lookup.c | 17 +++++++++++++++++
+ 1 file changed, 17 insertions(+)
+
+diff --git a/elf/dl-lookup.c b/elf/dl-lookup.c
+index 4c86dc694e..67fb2e31e2 100644
+--- a/elf/dl-lookup.c
++++ b/elf/dl-lookup.c
+@@ -854,6 +854,23 @@ _dl_lookup_symbol_x (const char *undef_name, struct link_map *undef_map,
+   if (__glibc_unlikely (current_value.m->l_used == 0))
+     current_value.m->l_used = 1;
+ 
++ if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_BINDINGS))
++   {
++      const char *reference_name = undef_map->l_name;
++
++      _dl_debug_printf ("binding file %s [%lu] to %s [%lu]: %s symbol `%s'",
++			DSO_FILENAME (reference_name),
++			undef_map->l_ns,
++			DSO_FILENAME (current_value.m->l_name),
++			current_value.m->l_ns,
++			protected ? "protected" : "normal", undef_name);
++      if (version)
++	_dl_debug_printf_c (" [%s]\n", version->name);
++      else
++	_dl_debug_printf_c ("\n");
++   }
++
++
+   *ref = current_value.s;
+   return LOOKUP_VALUE (current_value.m);
+ }
+-- 
+2.38.1
+
+
+From 4c6a78addabbd6e1b69763e286768919e56dfe0a Mon Sep 17 00:00:00 2001
+From: Xi Ruoyao <xry111@xry111.site>
+Date: Sat, 15 Oct 2022 14:12:13 +0800
+Subject: longlong.h: update from GCC for LoongArch clz/ctz support
+
+Update longlong.h to GCC r13-3269.  Keep our local change (prefer https
+for gnu.org URL).
+---
+ stdlib/longlong.h | 12 ++++++++++++
+ 1 file changed, 12 insertions(+)
+
+diff --git a/stdlib/longlong.h b/stdlib/longlong.h
+index 9b89469ac2..d8f76a43b5 100644
+--- a/stdlib/longlong.h
++++ b/stdlib/longlong.h
+@@ -593,6 +593,18 @@ extern UDItype __umulsidi3 (USItype, USItype);
+ #define UMUL_TIME 14
+ #endif
+ 
++#ifdef __loongarch__
++# if W_TYPE_SIZE == 32
++#  define count_leading_zeros(count, x)  ((count) = __builtin_clz (x))
++#  define count_trailing_zeros(count, x) ((count) = __builtin_ctz (x))
++#  define COUNT_LEADING_ZEROS_0 32
++# elif W_TYPE_SIZE == 64
++#  define count_leading_zeros(count, x)  ((count) = __builtin_clzll (x))
++#  define count_trailing_zeros(count, x) ((count) = __builtin_ctzll (x))
++#  define COUNT_LEADING_ZEROS_0 64
++# endif
++#endif
++
+ #if defined (__M32R__) && W_TYPE_SIZE == 32
+ #define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+   /* The cmp clears the condition bit.  */ \
+-- 
+2.38.1
+
+
+From dd4131c8322891a0ad7cfb661efa41aecc02b581 Mon Sep 17 00:00:00 2001
+From: Aurelien Jarno <aurelien@aurel32.net>
+Date: Tue, 1 Nov 2022 20:43:55 +0100
+Subject: linux: Fix fstatat on MIPSn64 (BZ #29730)
+
+Commit 6e8a0aac2f883 ("time: Fix overflow itimer tests on 32-bit
+systems") changed in_time_t_range to assume a 32-bit time_t. This broke
+fstatat on MIPSn64 that was using it with a 64-bit time_t due to
+difference between stat and stat64. This commit fix that by adding a
+MIPSn64 specific version, which bypasses the EOVERFLOW tests.
+
+Resolves: BZ #29730
+
+Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
+(cherry picked from commit 7457b7eef8dfe8cc48e55b9f9837df6dd397b80d)
+---
+ NEWS                                          |  1 +
+ .../unix/sysv/linux/mips/mips64/n64/fstatat.c | 51 +++++++++++++++++++
+ 2 files changed, 52 insertions(+)
+ create mode 100644 sysdeps/unix/sysv/linux/mips/mips64/n64/fstatat.c
+
+diff --git a/NEWS b/NEWS
+index 833045585f..e92d547e2c 100644
+--- a/NEWS
++++ b/NEWS
+@@ -45,6 +45,7 @@ The following bugs are resolved with this release:
+   [29638] libc: stdlib: arc4random fallback is never used
+   [29657] libc: Incorrect struct stat for 64-bit time on linux/generic
+     platforms
++  [29730] broken y2038 support in fstatat on MIPS N64
+ \f
+ Version 2.36
+ 
+diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/fstatat.c b/sysdeps/unix/sysv/linux/mips/mips64/n64/fstatat.c
+new file mode 100644
+index 0000000000..fe6c3a0dda
+--- /dev/null
++++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/fstatat.c
+@@ -0,0 +1,51 @@
++/* Get file status.  Linux/MIPSn64 version.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <sys/stat.h>
++#include <sysdep.h>
++
++/* Different than other ABIs, mips64 has different layouts for non-LFS
++   and LFS struct stat.  */
++int
++__fstatat (int fd, const char *file, struct stat *buf, int flag)
++{
++  struct __stat64_t64 st64;
++  int r = __fstatat64_time64 (fd, file, &st64, flag);
++  if (r == 0)
++    {
++      /* Clear internal pad and reserved fields.  */
++      memset (buf, 0, sizeof (*buf));
++
++      buf->st_dev = st64.st_dev;
++      buf->st_ino = st64.st_ino;
++      buf->st_mode = st64.st_mode;
++      buf->st_nlink = st64.st_nlink;
++      buf->st_uid = st64.st_uid;
++      buf->st_gid = st64.st_gid;
++      buf->st_rdev = st64.st_rdev;
++      buf->st_size = st64.st_size;
++      buf->st_blksize = st64.st_blksize;
++      buf->st_blocks  = st64.st_blocks;
++      buf->st_atim = st64.st_atim;
++      buf->st_mtim = st64.st_mtim;
++      buf->st_ctim = st64.st_ctim;
++    }
++  return r;
++}
++
++weak_alias (__fstatat, fstatat)
+-- 
+2.38.1
+
+
+From 2fce85f67c56e46863db40b8ca75bbf0fa993053 Mon Sep 17 00:00:00 2001
+From: caiyinyu <caiyinyu@loongson.cn>
+Date: Wed, 12 Oct 2022 20:28:42 +0800
+Subject: LoongArch: Fix ABI related macros in elf.h to keep consistent with
+ binutils[1].
+
+[1]:
+https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=c4a7e6b56218e1d5a858682186b542e2eae01a4a;hp=0d94a8735055432029237612a6eb9165db1ec9dd
+[2]:
+Reference: https://loongson.github.io/LoongArch-Documentation/LoongArch-ELF-ABI-EN.html#_e_flags_identifies_abi_type_and_version
+---
+ elf/elf.h | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/elf/elf.h b/elf/elf.h
+index 02a1b3f52f..014393f3cc 100644
+--- a/elf/elf.h
++++ b/elf/elf.h
+@@ -4085,8 +4085,11 @@ enum
+ #define R_NDS32_TLS_DESC	119
+ 
+ /* LoongArch ELF Flags */
+-#define EF_LARCH_ABI    	0x07
+-#define EF_LARCH_ABI_LP64D	0x03
++#define EF_LARCH_ABI_MODIFIER_MASK  0x07
++#define EF_LARCH_ABI_SOFT_FLOAT     0x01
++#define EF_LARCH_ABI_SINGLE_FLOAT   0x02
++#define EF_LARCH_ABI_DOUBLE_FLOAT   0x03
++#define EF_LARCH_OBJABI_V1          0x40
+ 
+ /* LoongArch specific dynamic relocations */
+ #define R_LARCH_NONE		0
+-- 
+2.38.1
+
+
+From 36cc06341a0c5029f49efaeef744dc3e9758e669 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <slyich@gmail.com>
+Date: Tue, 13 Sep 2022 13:39:13 -0400
+Subject: Makerules: fix MAKEFLAGS assignment for upcoming make-4.4 [BZ# 29564]
+
+make-4.4 will add long flags to MAKEFLAGS variable:
+
+    * WARNING: Backward-incompatibility!
+      Previously only simple (one-letter) options were added to the MAKEFLAGS
+      variable that was visible while parsing makefiles.  Now, all options
+      are available in MAKEFLAGS.
+
+This causes locale builds to fail when long options are used:
+
+    $ make --shuffle
+    ...
+    make  -C localedata install-locales
+    make: invalid shuffle mode: '1662724426r'
+
+The change fixes it by passing eash option via whitespace and dashes.
+That way option is appended to both single-word form and whitespace
+separated form.
+
+While at it fixed --silent mode detection in $(MAKEFLAGS) by filtering
+out --long-options. Otherwise options like --shuffle flag enable silent
+mode unintentionally. $(silent-make) variable consolidates the checks.
+
+Resolves: BZ# 29564
+
+CC: Paul Smith <psmith@gnu.org>
+CC: Siddhesh Poyarekar <siddhesh@gotplt.org>
+Signed-off-by: Sergei Trofimovich <slyich@gmail.com>
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+(cherry picked from commit 2d7ed98add14f75041499ac189696c9bd3d757fe)
+---
+ Makeconfig     | 18 +++++++++++++++++-
+ Makerules      |  4 ++--
+ elf/rtld-Rules |  2 +-
+ 3 files changed, 20 insertions(+), 4 deletions(-)
+
+diff --git a/Makeconfig b/Makeconfig
+index ba70321af1..2bbcabd8f9 100644
+--- a/Makeconfig
++++ b/Makeconfig
+@@ -43,6 +43,22 @@ else
+ $(error objdir must be defined by the build-directory Makefile)
+ endif
+ 
++# Did we request 'make -s' run? "yes" or "no".
++# Starting from make-4.4 MAKEFLAGS now contains long
++# options like '--shuffle'. To detect presence of 's'
++# we pick first word with short options. Long options
++# are guaranteed to come after whitespace. We use '-'
++# prefix to always have a word before long options
++# even if no short options were passed.
++# Typical MAKEFLAGS values to watch for:
++#   "rs --shuffle=42" (silent)
++#   " --shuffle" (not silent)
++ifeq ($(findstring s, $(firstword -$(MAKEFLAGS))),)
++silent-make := no
++else
++silent-make := yes
++endif
++
+ # Root of the sysdeps tree.
+ sysdep_dir := $(..)sysdeps
+ export sysdep_dir := $(sysdep_dir)
+@@ -917,7 +933,7 @@ endif
+ # umpteen zillion filenames along with it (we use `...' instead)
+ # but we don't want this echoing done when the user has said
+ # he doesn't want to see commands echoed by using -s.
+-ifneq	"$(findstring s,$(MAKEFLAGS))" ""	# if -s
++ifeq ($(silent-make),yes)			# if -s
+ +cmdecho	:= echo >/dev/null
+ else						# not -s
+ +cmdecho	:= echo
+diff --git a/Makerules b/Makerules
+index d1e139d03c..09c0cf8357 100644
+--- a/Makerules
++++ b/Makerules
+@@ -794,7 +794,7 @@ endif
+ # Maximize efficiency by minimizing the number of rules.
+ .SUFFIXES:	# Clear the suffix list.  We don't use suffix rules.
+ # Don't define any builtin rules.
+-MAKEFLAGS := $(MAKEFLAGS)r
++MAKEFLAGS := $(MAKEFLAGS) -r
+ 
+ # Generic rule for making directories.
+ %/:
+@@ -811,7 +811,7 @@ MAKEFLAGS := $(MAKEFLAGS)r
+ .PRECIOUS: $(foreach l,$(libtypes),$(patsubst %,$(common-objpfx)$l,c))
+ \f
+ # Use the verbose option of ar and tar when not running silently.
+-ifeq	"$(findstring s,$(MAKEFLAGS))" ""	# if not -s
++ifeq ($(silent-make),no)			# if not -s
+ verbose := v
+ else	   					# -s
+ verbose	:=
+diff --git a/elf/rtld-Rules b/elf/rtld-Rules
+index ca00dd1fe2..3c5e273f2b 100644
+--- a/elf/rtld-Rules
++++ b/elf/rtld-Rules
+@@ -52,7 +52,7 @@ $(objpfx)rtld-libc.a: $(foreach dir,$(rtld-subdirs),\
+ 	mv -f $@T $@
+ 
+ # Use the verbose option of ar and tar when not running silently.
+-ifeq	"$(findstring s,$(MAKEFLAGS))" ""	# if not -s
++ifeq ($(silent-make),no)			# if not -s
+ verbose := v
+ else						# -s
+ verbose	:=
+-- 
+2.38.1
+
+
+From 70410f2286cc36c9ccb133878811c728ae51725f Mon Sep 17 00:00:00 2001
+From: Paul Eggert <eggert@cs.ucla.edu>
+Date: Thu, 8 Sep 2022 20:08:32 -0500
+Subject: mktime: improve heuristic for ca-1986 Indiana DST
+
+This patch syncs mktime.c from Gnulib, fixing a
+problem reported by Mark Krenz <https://bugs.gnu.org/48085>,
+and it should fix BZ#29035 too.
+* time/mktime.c (__mktime_internal): Be more generous about
+accepting arguments with the wrong value of tm_isdst, by falling
+back to a one-hour DST difference if we find no nearby DST that is
+unusual.  This fixes a problem where "1986-04-28 00:00 EDT" was
+rejected when TZ="America/Indianapolis" because the nearest DST
+timestamp occurred in 1970, a temporal distance too great for the
+old heuristic.  This also also narrows the search a bit, which
+is a minor performance win.
+
+(cherry picked from commit 83859e1115269cf56d21669361d4ddbe2687831c)
+---
+ time/mktime.c | 28 ++++++++++++++++++++--------
+ 1 file changed, 20 insertions(+), 8 deletions(-)
+
+diff --git a/time/mktime.c b/time/mktime.c
+index 494c89bf54..e9a6006710 100644
+--- a/time/mktime.c
++++ b/time/mktime.c
+@@ -429,8 +429,13 @@ __mktime_internal (struct tm *tp,
+ 	 time with the right value, and use its UTC offset.
+ 
+ 	 Heuristic: probe the adjacent timestamps in both directions,
+-	 looking for the desired isdst.  This should work for all real
+-	 time zone histories in the tz database.  */
++	 looking for the desired isdst.  If none is found within a
++	 reasonable duration bound, assume a one-hour DST difference.
++	 This should work for all real time zone histories in the tz
++	 database.  */
++
++      /* +1 if we wanted standard time but got DST, -1 if the reverse.  */
++      int dst_difference = (isdst == 0) - (tm.tm_isdst == 0);
+ 
+       /* Distance between probes when looking for a DST boundary.  In
+ 	 tzdata2003a, the shortest period of DST is 601200 seconds
+@@ -441,12 +446,14 @@ __mktime_internal (struct tm *tp,
+ 	 periods when probing.  */
+       int stride = 601200;
+ 
+-      /* The longest period of DST in tzdata2003a is 536454000 seconds
+-	 (e.g., America/Jujuy starting 1946-10-01 01:00).  The longest
+-	 period of non-DST is much longer, but it makes no real sense
+-	 to search for more than a year of non-DST, so use the DST
+-	 max.  */
+-      int duration_max = 536454000;
++      /* In TZDB 2021e, the longest period of DST (or of non-DST), in
++	 which the DST (or adjacent DST) difference is not one hour,
++	 is 457243209 seconds: e.g., America/Cambridge_Bay with leap
++	 seconds, starting 1965-10-31 00:00 in a switch from
++	 double-daylight time (-05) to standard time (-07), and
++	 continuing to 1980-04-27 02:00 in a switch from standard time
++	 (-07) to daylight time (-06).  */
++      int duration_max = 457243209;
+ 
+       /* Search in both directions, so the maximum distance is half
+ 	 the duration; add the stride to avoid off-by-1 problems.  */
+@@ -483,6 +490,11 @@ __mktime_internal (struct tm *tp,
+ 	      }
+ 	  }
+ 
++      /* No unusual DST offset was found nearby.  Assume one-hour DST.  */
++      t += 60 * 60 * dst_difference;
++      if (mktime_min <= t && t <= mktime_max && convert_time (convert, t, &tm))
++	goto offset_found;
++
+       __set_errno (EOVERFLOW);
+       return -1;
+     }
+-- 
+2.38.1
+
+
+From 0f90d6204d79223fd32248c774df0cb7f0e604de Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 8 Nov 2022 14:15:02 +0100
+Subject: Linux: Support __IPC_64 in sysvctl *ctl command arguments (bug 29771)
+
+Old applications pass __IPC_64 as part of the command argument because
+old glibc did not check for unknown commands, and passed through the
+arguments directly to the kernel, without adding __IPC_64.
+Applications need to continue doing that for old glibc compatibility,
+so this commit enables this approach in current glibc.
+
+For msgctl and shmctl, if no translation is required, make
+direct system calls, as we did before the time64 changes.  If
+translation is required, mask __IPC_64 from the command argument.
+
+For semctl, the union-in-vararg argument handling means that
+translation is needed on all architectures.
+
+Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
+(cherry picked from commit 22a46dee24351fd5f4f188ad80554cad79c82524)
+---
+ NEWS                               |  1 +
+ sysdeps/unix/sysv/linux/ipc_priv.h |  6 +++++
+ sysdeps/unix/sysv/linux/msgctl.c   | 38 ++++++++++++++++++++----------
+ sysdeps/unix/sysv/linux/semctl.c   |  7 ++++++
+ sysdeps/unix/sysv/linux/shmctl.c   | 38 ++++++++++++++++++++----------
+ 5 files changed, 64 insertions(+), 26 deletions(-)
+
+diff --git a/NEWS b/NEWS
+index e92d547e2c..9f8edea5db 100644
+--- a/NEWS
++++ b/NEWS
+@@ -46,6 +46,7 @@ The following bugs are resolved with this release:
+   [29657] libc: Incorrect struct stat for 64-bit time on linux/generic
+     platforms
+   [29730] broken y2038 support in fstatat on MIPS N64
++  [29771] Restore IPC_64 support in sysvipc *ctl functions
+ \f
+ Version 2.36
+ 
+diff --git a/sysdeps/unix/sysv/linux/ipc_priv.h b/sysdeps/unix/sysv/linux/ipc_priv.h
+index 87893a6757..2f50c31a8e 100644
+--- a/sysdeps/unix/sysv/linux/ipc_priv.h
++++ b/sysdeps/unix/sysv/linux/ipc_priv.h
+@@ -63,4 +63,10 @@ struct __old_ipc_perm
+ # define __IPC_TIME64 0
+ #endif
+ 
++#if __IPC_TIME64 || defined __ASSUME_SYSVIPC_BROKEN_MODE_T
++# define IPC_CTL_NEED_TRANSLATION 1
++#else
++# define IPC_CTL_NEED_TRANSLATION 0
++#endif
++
+ #include <ipc_ops.h>
+diff --git a/sysdeps/unix/sysv/linux/msgctl.c b/sysdeps/unix/sysv/linux/msgctl.c
+index e824ebb095..2072205252 100644
+--- a/sysdeps/unix/sysv/linux/msgctl.c
++++ b/sysdeps/unix/sysv/linux/msgctl.c
+@@ -85,11 +85,19 @@ msgctl_syscall (int msqid, int cmd, msgctl_arg_t *buf)
+ int
+ __msgctl64 (int msqid, int cmd, struct __msqid64_ds *buf)
+ {
+-#if __IPC_TIME64
++#if IPC_CTL_NEED_TRANSLATION
++# if __IPC_TIME64
+   struct kernel_msqid64_ds ksemid, *arg = NULL;
+-#else
++# else
+   msgctl_arg_t *arg;
+-#endif
++# endif
++
++  /* Some applications pass the __IPC_64 flag in cmd, to invoke
++     previously unsupported commands back when there was no EINVAL
++     error checking in glibc.  Mask the flag for the switch statements
++     below.  msgctl_syscall adds back the __IPC_64 flag for the actual
++     system call.  */
++  cmd &= ~__IPC_64;
+ 
+   switch (cmd)
+     {
+@@ -101,19 +109,19 @@ __msgctl64 (int msqid, int cmd, struct __msqid64_ds *buf)
+     case IPC_STAT:
+     case MSG_STAT:
+     case MSG_STAT_ANY:
+-#if __IPC_TIME64
++# if __IPC_TIME64
+       if (buf != NULL)
+ 	{
+ 	  msqid64_to_kmsqid64 (buf, &ksemid);
+ 	  arg = &ksemid;
+ 	}
+-# ifdef __ASSUME_SYSVIPC_BROKEN_MODE_T
++#  ifdef __ASSUME_SYSVIPC_BROKEN_MODE_T
+       if (cmd == IPC_SET)
+ 	arg->msg_perm.mode *= 0x10000U;
+-# endif
+-#else
++#  endif
++# else
+       arg = buf;
+-#endif
++# endif
+       break;
+ 
+     case IPC_INFO:
+@@ -137,21 +145,25 @@ __msgctl64 (int msqid, int cmd, struct __msqid64_ds *buf)
+     case IPC_STAT:
+     case MSG_STAT:
+     case MSG_STAT_ANY:
+-#ifdef __ASSUME_SYSVIPC_BROKEN_MODE_T
++# ifdef __ASSUME_SYSVIPC_BROKEN_MODE_T
+       arg->msg_perm.mode >>= 16;
+-#else
++# else
+       /* Old Linux kernel versions might not clear the mode padding.  */
+       if (sizeof ((struct msqid_ds){0}.msg_perm.mode)
+           != sizeof (__kernel_mode_t))
+ 	arg->msg_perm.mode &= 0xFFFF;
+-#endif
++# endif
+ 
+-#if __IPC_TIME64
++# if __IPC_TIME64
+       kmsqid64_to_msqid64 (arg, buf);
+-#endif
++# endif
+     }
+ 
+   return ret;
++
++#else /* !IPC_CTL_NEED_TRANSLATION */
++  return msgctl_syscall (msqid, cmd, buf);
++#endif
+ }
+ #if __TIMESIZE != 64
+ libc_hidden_def (__msgctl64)
+diff --git a/sysdeps/unix/sysv/linux/semctl.c b/sysdeps/unix/sysv/linux/semctl.c
+index 77a8130c18..3458b018bc 100644
+--- a/sysdeps/unix/sysv/linux/semctl.c
++++ b/sysdeps/unix/sysv/linux/semctl.c
+@@ -140,6 +140,13 @@ __semctl64 (int semid, int semnum, int cmd, ...)
+   union semun64 arg64 = { 0 };
+   va_list ap;
+ 
++  /* Some applications pass the __IPC_64 flag in cmd, to invoke
++     previously unsupported commands back when there was no EINVAL
++     error checking in glibc.  Mask the flag for the switch statements
++     below.  semctl_syscall adds back the __IPC_64 flag for the actual
++     system call.  */
++  cmd &= ~__IPC_64;
++
+   /* Get the argument only if required.  */
+   switch (cmd)
+     {
+diff --git a/sysdeps/unix/sysv/linux/shmctl.c b/sysdeps/unix/sysv/linux/shmctl.c
+index ea38935497..f00817a6f6 100644
+--- a/sysdeps/unix/sysv/linux/shmctl.c
++++ b/sysdeps/unix/sysv/linux/shmctl.c
+@@ -85,11 +85,19 @@ shmctl_syscall (int shmid, int cmd, shmctl_arg_t *buf)
+ int
+ __shmctl64 (int shmid, int cmd, struct __shmid64_ds *buf)
+ {
+-#if __IPC_TIME64
++#if IPC_CTL_NEED_TRANSLATION
++# if __IPC_TIME64
+   struct kernel_shmid64_ds kshmid, *arg = NULL;
+-#else
++# else
+   shmctl_arg_t *arg;
+-#endif
++# endif
++
++  /* Some applications pass the __IPC_64 flag in cmd, to invoke
++     previously unsupported commands back when there was no EINVAL
++     error checking in glibc.  Mask the flag for the switch statements
++     below.  shmctl_syscall adds back the __IPC_64 flag for the actual
++     system call.  */
++  cmd &= ~__IPC_64;
+ 
+   switch (cmd)
+     {
+@@ -103,19 +111,19 @@ __shmctl64 (int shmid, int cmd, struct __shmid64_ds *buf)
+     case IPC_STAT:
+     case SHM_STAT:
+     case SHM_STAT_ANY:
+-#if __IPC_TIME64
++# if __IPC_TIME64
+       if (buf != NULL)
+ 	{
+ 	  shmid64_to_kshmid64 (buf, &kshmid);
+ 	  arg = &kshmid;
+ 	}
+-# ifdef __ASSUME_SYSVIPC_BROKEN_MODE_T
++#  ifdef __ASSUME_SYSVIPC_BROKEN_MODE_T
+       if (cmd == IPC_SET)
+         arg->shm_perm.mode *= 0x10000U;
+-# endif
+-#else
++#  endif
++# else
+       arg = buf;
+-#endif
++# endif
+       break;
+ 
+     case IPC_INFO:
+@@ -140,21 +148,25 @@ __shmctl64 (int shmid, int cmd, struct __shmid64_ds *buf)
+       case IPC_STAT:
+       case SHM_STAT:
+       case SHM_STAT_ANY:
+-#ifdef __ASSUME_SYSVIPC_BROKEN_MODE_T
++# ifdef __ASSUME_SYSVIPC_BROKEN_MODE_T
+         arg->shm_perm.mode >>= 16;
+-#else
++# else
+       /* Old Linux kernel versions might not clear the mode padding.  */
+       if (sizeof ((struct shmid_ds){0}.shm_perm.mode)
+ 	  != sizeof (__kernel_mode_t))
+ 	arg->shm_perm.mode &= 0xFFFF;
+-#endif
++# endif
+ 
+-#if __IPC_TIME64
++# if __IPC_TIME64
+       kshmid64_to_shmid64 (arg, buf);
+-#endif
++# endif
+     }
+ 
+   return ret;
++
++#else /* !IPC_CTL_NEED_TRANSLATION */
++  return shmctl_syscall (shmid, cmd, buf);
++#endif
+ }
+ #if __TIMESIZE != 64
+ libc_hidden_def (__shmctl64)
+-- 
+2.38.1
+
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..139aab865864 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,14 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
 distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum=1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +20,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +55,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +163,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From 87cd1a3239494f043c4723a695464300455c832a Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 07/37] musl: add support for SIGEV_THREAD_ID timers

https://git.musl-libc.org/cgit/musl/commit/?id=7c71792e87691451f2a6b76348e83ad1889f1dcb
---
 ...d-support-for-SIGEV_THREAD_ID-timers.patch | 74 +++++++++++++++++++
 srcpkgs/musl/template                         |  2 +-
 2 files changed, 75 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch

diff --git a/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
new file mode 100644
index 000000000000..e20dff5ba0d4
--- /dev/null
+++ b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
@@ -0,0 +1,74 @@
+From 7c71792e87691451f2a6b76348e83ad1889f1dcb Mon Sep 17 00:00:00 2001
+From: James Y Knight <jyknight@google.com>
+Date: Sun, 30 Jun 2019 21:55:20 -0400
+Subject: [PATCH] add support for SIGEV_THREAD_ID timers
+
+This is like SIGEV_SIGNAL, but targeted to a particular thread's
+tid, rather than the process.
+---
+ include/signal.h        | 16 +++++++++++++---
+ src/time/timer_create.c |  8 ++++++--
+ 2 files changed, 19 insertions(+), 5 deletions(-)
+
+diff --git a/include/signal.h b/include/signal.h
+index fbdf667b2..9ed929e4f 100644
+--- a/include/signal.h
++++ b/include/signal.h
+@@ -180,14 +180,24 @@ struct sigevent {
+ 	union sigval sigev_value;
+ 	int sigev_signo;
+ 	int sigev_notify;
+-	void (*sigev_notify_function)(union sigval);
+-	pthread_attr_t *sigev_notify_attributes;
+-	char __pad[56-3*sizeof(long)];
++	union {
++		char __pad[64 - 2*sizeof(int) - sizeof(union sigval)];
++		pid_t sigev_notify_thread_id;
++		struct {
++			void (*sigev_notify_function)(union sigval);
++			pthread_attr_t *sigev_notify_attributes;
++		} __sev_thread;
++	} __sev_fields;
+ };
+ 
++#define sigev_notify_thread_id __sev_fields.sigev_notify_thread_id
++#define sigev_notify_function __sev_fields.__sev_thread.sigev_notify_function
++#define sigev_notify_attributes __sev_fields.__sev_thread.sigev_notify_attributes
++
+ #define SIGEV_SIGNAL 0
+ #define SIGEV_NONE 1
+ #define SIGEV_THREAD 2
++#define SIGEV_THREAD_ID 4
+ 
+ int __libc_current_sigrtmin(void);
+ int __libc_current_sigrtmax(void);
+diff --git a/src/time/timer_create.c b/src/time/timer_create.c
+index 5ddfda278..4bef23905 100644
+--- a/src/time/timer_create.c
++++ b/src/time/timer_create.c
+@@ -71,11 +71,15 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 	switch (evp ? evp->sigev_notify : SIGEV_SIGNAL) {
+ 	case SIGEV_NONE:
+ 	case SIGEV_SIGNAL:
++	case SIGEV_THREAD_ID:
+ 		if (evp) {
+ 			ksev.sigev_value = evp->sigev_value;
+ 			ksev.sigev_signo = evp->sigev_signo;
+ 			ksev.sigev_notify = evp->sigev_notify;
+-			ksev.sigev_tid = 0;
++			if (evp->sigev_notify == SIGEV_THREAD_ID)
++				ksev.sigev_tid = evp->sigev_notify_thread_id;
++			else
++				ksev.sigev_tid = 0;
+ 			ksevp = &ksev;
+ 		}
+ 		if (syscall(SYS_timer_create, clk, ksevp, &timerid) < 0)
+@@ -107,7 +111,7 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 
+ 		ksev.sigev_value.sival_ptr = 0;
+ 		ksev.sigev_signo = SIGTIMER;
+-		ksev.sigev_notify = 4; /* SIGEV_THREAD_ID */
++		ksev.sigev_notify = SIGEV_THREAD_ID;
+ 		ksev.sigev_tid = td->tid;
+ 		if (syscall(SYS_timer_create, clk, &ksev, &timerid) < 0)
+ 			timerid = -1;
diff --git a/srcpkgs/musl/template b/srcpkgs/musl/template
index 34e6ed4fba6e..afb33cd868b5 100644
--- a/srcpkgs/musl/template
+++ b/srcpkgs/musl/template
@@ -2,7 +2,7 @@
 pkgname=musl
 reverts="1.2.0_1"
 version=1.1.24
-revision=11
+revision=12
 archs="*-musl"
 bootstrap=yes
 build_style=gnu-configure

From 2c4fadb9b0a0ff53b0917ebb7995bf7fa56575a3 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 08/37] gcc-multilib: update to 12.2.0.

---
 srcpkgs/gcc-multilib/template | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index f28eb237c287..ba9bafcadfd6 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,15 +3,15 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _majorver="${version%.*}"
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel
@@ -70,7 +70,7 @@ do_build() {
 	make ${makejobs}
 }
 do_install() {
-	local _pc_triplet=x86_64-pc-linux-gnu _version=${version%pre1}
+	local _pc_triplet=x86_64-pc-linux-gnu
 	# Install to a tempdir and then only copy relevant files.
 	cd ${wrksrc}
 	make DESTDIR=${wrksrc}/${pkgname}-build install
@@ -80,9 +80,9 @@ do_install() {
 	vmkdir usr/include/c++/${_majorver}/${_triplet}
 	vmkdir usr/lib/gcc/${_triplet}/${_majorver}
 
-	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${_version}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${version}/32 \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_majorver}/
-	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${_version}/${_pc_triplet}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${version}/${_pc_triplet}/32 \
 		${DESTDIR}/usr/include/c++/${_majorver}/${_triplet}
 
 	vinstall ${wrksrc}/host-${_pc_triplet}/gcc/specs 644 usr/lib/gcc/${_triplet}/${_majorver}

From 4d64e6dadd4e0cac6a24438414e804cd8b92f3e2 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 09/37] libgccjit: update to 12.2.0.

---
 srcpkgs/libgccjit/files/libgccjit-musl.patch | 63 --------------------
 srcpkgs/libgccjit/template                   | 24 +++-----
 2 files changed, 9 insertions(+), 78 deletions(-)
 delete mode 100644 srcpkgs/libgccjit/files/libgccjit-musl.patch

diff --git a/srcpkgs/libgccjit/files/libgccjit-musl.patch b/srcpkgs/libgccjit/files/libgccjit-musl.patch
deleted file mode 100644
index d2ed16928c82..000000000000
--- a/srcpkgs/libgccjit/files/libgccjit-musl.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-diff --git a/gcc/jit/jit-playback.c b/gcc/jit/jit-playback.c
-index 5bccf591a..35f5e35ef 100644
---- a/gcc/jit/jit-playback.c
-+++ b/gcc/jit/jit-playback.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -41,8 +43,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "diagnostic.h"
- #include "stmt.h"
- 
--#include <pthread.h>
--
- #include "jit-playback.h"
- #include "jit-result.h"
- #include "jit-builtins.h"
-diff --git a/gcc/jit/jit-recording.c b/gcc/jit/jit-recording.c
-index a237d574f..5785e3269 100644
---- a/gcc/jit/jit-recording.c
-+++ b/gcc/jit/jit-recording.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -25,8 +27,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "pretty-print.h"
- #include "toplev.h"
- 
--#include <pthread.h>
--
- #include "jit-builtins.h"
- #include "jit-recording.h"
- #include "jit-playback.h"
-diff --git a/gcc/jit/libgccjit.c b/gcc/jit/libgccjit.c
-index f9c33c63c..75f21d275 100644
---- a/gcc/jit/libgccjit.c
-+++ b/gcc/jit/libgccjit.c
-@@ -18,13 +18,13 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
- #include "timevar.h"
- #include "typed-splay-tree.h"
- #include "cppbuiltin.h"
--#include <pthread.h>
- 
- #include "libgccjit.h"
- #include "jit-recording.h"
diff --git a/srcpkgs/libgccjit/template b/srcpkgs/libgccjit/template
index 0b37c3ee9f8b..fde1affd54b7 100644
--- a/srcpkgs/libgccjit/template
+++ b/srcpkgs/libgccjit/template
@@ -3,18 +3,12 @@
 # which use the version number.
 
 pkgname=libgccjit
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
+version=12.2.0
 revision=1
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
-_majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 create_wrksrc=yes
 short_desc="Just-In-Time Compilation library for GCC"
 maintainer="Lane Biocini <lane@mailbox.org>"
@@ -22,16 +16,16 @@ homepage="https://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 nopie=yes
 lib32disabled=yes
 makedepends="zlib-devel"

From 9e8ca49d3760f8dd9c482047a909a334d67e2f16 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 10/37] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove -no-pie from build. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..f7e02dbc48cb 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -53,6 +53,7 @@ _void_cross_build_binutils() {
 		--sbindir=/usr/bin \
 		--libdir=/usr/lib \
 		--libexecdir=/usr/lib \
+		--sysconfdir=/etc \
 		--target=${tgt} \
 		--with-sysroot=/usr/${tgt} \
 		--disable-nls \
@@ -60,7 +61,9 @@ _void_cross_build_binutils() {
 		--disable-multilib \
 		--disable-werror \
 		--disable-gold \
+		--disable-gprofng \
 		--enable-relro \
+		--enable-new-dtags \
 		--enable-plugins \
 		--enable-64-bit-bfd \
 		--enable-deterministic-archives \
@@ -91,6 +94,9 @@ _void_cross_build_bootstrap_gcc() {
 	# Do not run fixincludes
 	sed -i 's@./fixinc.sh@-c true@' Makefile.in
 
+	# Do not use system headers to determine clocale implementation
+	sed -i 's/#if (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined(__UCLIBC__)/#if 1/g' libstdc++-v3/configure
+
 	for f in ${XBPS_SRCPKGDIR}/gcc/patches/*.patch; do
 		_void_cross_apply_patch "$f"
 	done
@@ -132,6 +138,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -381,6 +388,7 @@ _void_cross_build_gcc() {
 		extra_args+=" --disable-gnu-unique-object"
 		extra_args+=" libat_cv_have_ifunc=no"
 	else
+		extra_args+=" --enable-clocale=gnu"
 		extra_args+=" --enable-gnu-unique-object"
 	fi
 
@@ -460,6 +468,14 @@ do_build() {
 	local binutils_ver linux_ver gcc_ver libc_ver libucontext_ver
 	local tgt=${sourcepkg/cross-}
 
+	export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}"
+	export CXXFLAGS="${CXXFLAGS/-D_FORTIFY_SOURCE=2/}"
+
+	# Disable explicit -fno-PIE, gcc/binutils/libc will figure this out itself.
+	export CFLAGS="${CFLAGS//-fno-PIE/}"
+	export CXXFLAGS="${CXXFLAGS//-fno-PIE/}"
+	export LDFLAGS="${LDFLAGS//-no-pie/}"
+
 	_void_cross_test_ver binutils
 	_void_cross_test_ver linux
 	_void_cross_test_ver gcc
@@ -625,6 +641,9 @@ do_install() {
 	# then remove it because it conflicts with libquadmath package
 	rm -rf ${DESTDIR}/${sysroot}/usr/lib/libquadmath.*
 
+	# Remove libdep linker plugin because it conflicts with system binutils
+	rm -f ${DESTDIR}/usr/lib/bfd-plugins/libdep*
+
 	# Remove leftover symlinks
 	rm -f ${DESTDIR}/usr/lib${XBPS_TARGET_WORDSIZE}
 	rm -f ${DESTDIR}/lib*

From 074aba857882ed98f277e0a41d72c76efdb82a5d Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 11/37] qemu: remove broken patch

The necessary patch has been imported into musl so no need
to cast the sigevent struct to a more glibc-like one.
---
 .../musl-fix-sigevent-and-sigval_t.patch      | 27 -------------------
 1 file changed, 27 deletions(-)
 delete mode 100644 srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch

diff --git a/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch b/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch
deleted file mode 100644
index 4b4f1117c15f..000000000000
--- a/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-Note: Remove this patch with musl 1.2.2
-
---- a/linux-user/syscall.c
-+++ b/linux-user/syscall.c
-@@ -5020,10 +5020,21 @@
- #ifndef HAVE_SIGEV_NOTIFY_THREAD_ID
- #define sigev_notify_thread_id _sigev_un._tid
- #endif
- 
--static inline abi_long target_to_host_sigevent(struct sigevent *host_sevp,
-+struct host_sigevent {
-+    union sigval sigev_value;
-+    int sigev_signo;
-+    int sigev_notify;
-+    union {
-+       char _pad[64 - sizeof(int) * 2 - sizeof(union sigval)];
-+       int _tid;
-+    } _sigev_un;
-+};
-+
-+static inline abi_long target_to_host_sigevent(struct sigevent *sevp,
-                                                abi_ulong target_addr)
- {
-+    struct host_sigevent *host_sevp = (struct host_sigevent *) sevp;
-     struct target_sigevent *target_sevp;
- 
-     if (!lock_user_struct(VERIFY_READ, target_sevp, target_addr, 1)) {

From 21f3c291e5607aee93318b3d3fc1430f3ea5d4e6 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 19 Nov 2022 13:26:24 -0800
Subject: [PATCH 12/37] mk-configure: rebuild for gcc 12

---
 srcpkgs/mk-configure/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/mk-configure/template b/srcpkgs/mk-configure/template
index 9d12f11a9799..c50d8adf213f 100644
--- a/srcpkgs/mk-configure/template
+++ b/srcpkgs/mk-configure/template
@@ -1,7 +1,7 @@
 # Template file for 'mk-configure'
 pkgname=mk-configure
 version=0.37.0
-revision=1
+revision=2
 build_style=gnu-makefile
 make_cmd=bmake
 make_install_args="MANDIR=/usr/share/man"

From f70365e84bffe97664cda467b6c42d080ae2c99b Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 13/37] cross-aarch64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..9e6fb75c198d 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Leah Neukirchen <leah@vuxu.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 8c04d32bb29b7c3b9dfd9f99503be86b93c34b02 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 14/37] cross-aarch64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..ba14c96bccea 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 4d4ab6e045c77339bbde9b1a90502c81f5dd22ca Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 15/37] cross-arm-linux-gnueabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..5c774e16f430 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 103b6ffea92c765ed1aa8d0201a9148650e76106 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 16/37] cross-arm-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..d6298ab639a4 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 97b75b8c8100d708353ea21a6f01f2a061275b1f Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 17/37] cross-arm-linux-musleabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..24df78e8fd8e 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From a2a42ba2335466935c7da25273af56e22d7dbc2f Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 18/37] cross-arm-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..8093700f909c 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From fefe33d9e12f84a02ed53fdaaab3e8a803aaf391 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 19/37] cross-armv7l-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..92665326428b 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From ff45ddee6da45e92ba426860049e5d7df2422eff Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 20/37] cross-armv7l-linux-musleabihf: update to gcc 12.2.0.

---
 .../cross-armv7l-linux-musleabihf/template    | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..e5af2c9ccbf2 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From aff2f36f5701d25e8993b91b5a98543d612d4b3a Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 21/37] cross-i686-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-i686-linux-musl/template b/srcpkgs/cross-i686-linux-musl/template
index 8be16a230d8d..d624bb7a3254 100644
--- a/srcpkgs/cross-i686-linux-musl/template
+++ b/srcpkgs/cross-i686-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-i686-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-i686-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 0d8ae967b26c8cbb1ef33bcf7f6b6fc7f42b7295 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 22/37] cross-i686-pc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..6a9e54db807a 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,14 +1,15 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -16,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 61d880e1fee889dbe2fe3eb2e94767871ab3a1cd Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 23/37] cross-mips-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-musl/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..67a5c413396c 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 819e3334680fb265060d50ae9ae2bba7ba13c778 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 24/37] cross-mips-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..bdf8600ce95b 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="hipperson0 <hipperson0@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From eff31e19dbdc0622d09e3fafe6abe043f9c263f1 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 25/37] cross-mipsel-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..de49387d517b 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 2cb6d8e96277addf69052433f8bdf7d59f10c350 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 26/37] cross-mipsel-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..b27ce6475a38 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From f86e043333f8944b7ec762d55515ba6ec56e218e Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 27/37] cross-powerpc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..79579e093b12 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 08c74b6225fb9c2f3e4f21e61aac32b84444104f Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 28/37] cross-powerpc-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..9bb6acd359b6 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From aef55a62497203b7f16faa7c78abed36bbb89431 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 29/37] cross-powerpc64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..2d153d00add6 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,16 +1,17 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
  --enable-targets=powerpc-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -18,12 +19,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 34c0b5a12264ed12b888ef0dddfb89def943a46e Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 30/37] cross-powerpc64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 016f18776a6d..e0848fe0bff7 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,30 +1,31 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From f13436fa26ce55fa6fe1fbf3a7b8eb4bab80c624 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 31/37] cross-powerpc64le-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 463d7e92d20d..8d8e010e15c0 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,16 +1,17 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
  --enable-targets=powerpcle-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -18,12 +19,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 1fa9d0dc3c2c24739d76a5dc87c317193d34b27d Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 32/37] cross-powerpc64le-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index c17a3cccfe29..0915e524545f 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,30 +1,31 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 10ee19cc8c1bba6b42b4c43cf4b44507dadc009f Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 33/37] cross-powerpcle-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 9aede3c465ce..687be8a44c6c 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 
@@ -35,6 +36,8 @@ if [ "$XBPS_TARGET_MACHINE" = "ppcle" ]; then
 	broken="Can't build crosstoolchain to itself"
 fi
 
+broken="glibc uses big-endian specific instructions on 32-bit powerpc"
+
 cross-powerpcle-linux-gnu-libc_package() {
 	short_desc+=" - glibc files"
 	nostrip=yes

From 7ba129ec25d5b20aff0fed126879fea7f473e05a Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 34/37] cross-powerpcle-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index 045cfda987fe..bb984b9c42eb 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 825453288dc01d27d5956a459eb3b503fce86123 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:30 -0800
Subject: [PATCH 35/37] cross-x86_64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 8918f3c22a1c..930aaf2a508b 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,14 +1,15 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -16,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 946bdb62455cb77e5257e442e113bd65603b5b0d Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:30 -0800
Subject: [PATCH 36/37] cross-x86_64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..ac5b1c46ab82 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 7593539c3acbcece36cdfb83e06d93f2053d89cd Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Fri, 18 Nov 2022 02:01:19 -0800
Subject: [PATCH 37/37] cross-vpkg-dummy: update to 0.39.

---
 srcpkgs/cross-vpkg-dummy/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/cross-vpkg-dummy/template b/srcpkgs/cross-vpkg-dummy/template
index d83e38dc63ac..aeafb749dd5f 100644
--- a/srcpkgs/cross-vpkg-dummy/template
+++ b/srcpkgs/cross-vpkg-dummy/template
@@ -1,6 +1,6 @@
 # Template file for 'cross-vpkg-dummy'
 pkgname=cross-vpkg-dummy
-version=0.38
+version=0.39
 revision=1
 build_style=meta
 short_desc="Dummy meta-pkg for cross building packages with xbps-src"
@@ -54,8 +54,8 @@ conflicts="
 	gcc-objc++>=0"
 shlib_provides="
 	libgcc_s.so.1
-	libgnat-10.so
-	libgnarl-10.so
+	libgnat-12.so
+	libgnarl-12.so
 	libstdc++.so.6
 	libgfortran.so.5"
 

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (238 preceding siblings ...)
  2022-11-20 18:03 ` oreo639
@ 2022-11-21 18:22 ` oreo639
  2022-11-21 18:24 ` oreo639
                   ` (24 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-11-21 18:22 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5448 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.2.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.2.0

There is a list of failing builds here: https://github.com/void-linux/void-packages/issues/39809

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [x] llvm https://github.com/void-linux/void-packages/pull/38694
- [x] m4 https://github.com/void-linux/void-packages/pull/33730
- [x] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [x] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [x] libvirt https://github.com/void-linux/void-packages/pull/38842
- [x] syslinux https://github.com/void-linux/void-packages/pull/38876
- [x] efivar https://github.com/void-linux/void-packages/pull/38874
- [x] gpgme https://github.com/void-linux/void-packages/pull/38825

Known packages that needed to be fixed/updated for gcc12:
- [x] openssh https://github.com/void-linux/void-packages/pull/38849
- [x] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [x] doxygen https://github.com/void-linux/void-packages/pull/38846
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] libproxy https://github.com/void-linux/void-packages/pull/38818
- [x] exempi https://github.com/void-linux/void-packages/pull/38820
- [x] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [x] libunique1 https://github.com/void-linux/void-packages/pull/38848 or https://github.com/void-linux/void-packages/pull/38873
- [x] libwpd https://github.com/void-linux/void-packages/pull/38878
- [x] cglm https://github.com/void-linux/void-packages/pull/39748
- [x] coreboot-utils https://github.com/void-linux/void-packages/pull/39749
- [x] apl https://github.com/void-linux/void-packages/pull/39750
- [x] igt-gpu-tools https://github.com/void-linux/void-packages/pull/39780

Needs to be fixed/updated for binutils:
- [x] grub https://github.com/void-linux/void-packages/pull/38875
- [x] linux-tools https://github.com/void-linux/void-packages/pull/38877
- [x] kcov https://github.com/void-linux/void-packages/pull/39291

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [x] kde
- [x] lxde
- [x] lxqt

You can test the ISOs here:
https://drive.google.com/drive/folders/1ix92CYSLUP-KWjLxltdgG4e8Nu2JCY5n?usp=sharing

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 127693 bytes --]

From e5ba0c429eee4c172b49e5674bd11f88d3fa1d27 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 01/37] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../fix-libcollector-without-java.patch       | 53 +++++++++++++++
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 25 ++++---
 4 files changed, 87 insertions(+), 117 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
 create mode 100644 srcpkgs/binutils/patches/fix-libcollector-without-java.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/fix-libcollector-without-java.patch b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
new file mode 100644
index 000000000000..54384875f358
--- /dev/null
+++ b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
@@ -0,0 +1,53 @@
+From 49ddd814ac1071af7c4f45d5f8398b91862f2c7f Mon Sep 17 00:00:00 2001
+From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
+Date: Wed, 17 Aug 2022 19:55:23 -0700
+Subject: [PATCH] gprofng: fix bug 29479 Collection fails when built without
+ java support
+
+gprofng/ChangeLog
+2022-08-17  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>
+
+	PR gprofng/29479
+	* libcollector/collector.c: Add #if defined(GPROFNG_JAVA_PROFILING) for
+	java specific code.
+	* libcollector/unwind.c: Likewise.
+---
+ gprofng/libcollector/collector.c | 2 ++
+ gprofng/libcollector/unwind.c    | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/gprofng/libcollector/collector.c b/gprofng/libcollector/collector.c
+index 93c9d3330de5..ceff2c1caccb 100644
+--- a/gprofng/libcollector/collector.c
++++ b/gprofng/libcollector/collector.c
+@@ -913,8 +913,10 @@ __collector_open_experiment (const char *exp, const char *params, sp_origin_t or
+   __collector_ext_unwind_key_init (1, NULL);
+ 
+   /* start java attach if suitable */
++#if defined(GPROFNG_JAVA_PROFILING)
+   if (exp_origin == SP_ORIGIN_DBX_ATTACH)
+     __collector_jprofile_start_attach ();
++#endif
+   start_sec_time = CALL_UTIL (time)(NULL);
+   __collector_start_time = collector_interface.getHiResTime ();
+   TprintfT (DBG_LT0, "\t__collector_open_experiment; resetting start_time\n");
+diff --git a/gprofng/libcollector/unwind.c b/gprofng/libcollector/unwind.c
+index 119243788020..f8e11823c81e 100644
+--- a/gprofng/libcollector/unwind.c
++++ b/gprofng/libcollector/unwind.c
+@@ -557,6 +557,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+   int size = max_frame_size;
+ 
+ #define MIN(a,b) ((a)<(b)?(a):(b))
++#if defined(GPROFNG_JAVA_PROFILING)
+   /* get Java info */
+   if (__collector_java_mode && __collector_java_asyncgetcalltrace_loaded && context && !pseudo_context)
+     {
+@@ -569,6 +570,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+ 	  size -= sz;
+ 	}
+     }
++#endif
+ 
+   /* get native stack */
+   if (context)
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..c355a5fc8016 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkgconf"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -35,15 +36,21 @@ do_configure() {
 	local conf
 
 	if [ "$CHROOT_READY" ]; then
-		conf+=" --with-debuginfod"
+		conf+=" --with-debuginfod --enable-shared"
 	else
-		conf+=" --without-debuginfod --disable-install-libbfd"
+		conf+=" --without-debuginfod --disable-shared --disable-install-libbfd"
 	fi
 	if [ "$CROSS_BUILD" ]; then
 		# we don't want --with-sysroot=${XBPS_CROSS_BASE} like gnu-configure
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	# gprofng currently only supports x86 and aarch64 glibc.
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64|i386|aarch64) conf+=" --enable-gprofng" ;;
+		*) conf+=" --disable-gprofng" ;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"
@@ -76,13 +83,14 @@ do_configure() {
 		--libdir=/usr/lib \
 		--mandir=/usr/share/man \
 		--infodir=/usr/share/info \
+		--sysconfdir=/etc \
 		--disable-werror \
-		--disable-shared \
 		--disable-nls \
 		--enable-threads \
 		--enable-plugins \
 		--enable-relro \
 		--enable-gold \
+		--enable-new-dtags \
 		--enable-deterministic-archives \
 		--enable-64-bit-bfd \
 		--enable-ld=default \
@@ -142,7 +150,8 @@ binutils-devel_package() {
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/*.a"
-		vmove "usr/lib/*.so"
+		vmove "usr/lib/libbfd.so"
+		vmove "usr/lib/libopcodes.so"
 	}
 }
 

From 81d5d89982267cae868b4714bb2366d404091f3a Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 02/37] gdb: resolve conflict with binutils 2.39

---
 srcpkgs/gdb/template | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/gdb/template b/srcpkgs/gdb/template
index 9c5f17ffc519..b666348fea19 100644
--- a/srcpkgs/gdb/template
+++ b/srcpkgs/gdb/template
@@ -1,7 +1,7 @@
 # Template file for 'gdb'
 pkgname=gdb
 version=12.1
-revision=2
+revision=3
 build_style=gnu-configure
 pycompile_dirs="/usr/share/gdb/python"
 configure_args="--disable-werror --disable-nls --with-system-readline
@@ -48,7 +48,8 @@ vopt_conflict debuginfod static
 
 post_install() {
 	# resolve conflicts with binutils
-	rm -r ${DESTDIR}/usr/{include,lib,share/info/bfd.info*}
+	rm -rf ${DESTDIR}/usr/{include,lib}
+	rm -rf ${DESTDIR}/usr/share/info/{bfd,ctf-spec}.info*
 }
 
 gdb-common_package() {

From be65d2c26a4ffd833d0953f864cf7b2eceb07283 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 03/37] gcc: update to 12.2.0.

---
 common/shlibs                                 | 10 +--
 srcpkgs/gcc/files/gccgo-musl.patch            | 71 +++------------
 srcpkgs/gcc/files/libgnarl-musl.patch         | 18 ++--
 srcpkgs/gcc/files/libssp-musl.patch           | 10 +--
 srcpkgs/gcc/patches/libffi_gnulinux.patch     | 11 ---
 .../gcc/patches/libgcc-ibm128-no-tag.patch    | 10 ++-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |  2 +-
 srcpkgs/gcc/template                          | 87 +++++++++----------
 8 files changed, 80 insertions(+), 139 deletions(-)
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index 3b103f479d5a..04cbade52468 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.2.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.36 perl-5.36.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -857,8 +857,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.2.0_1
+libgnat-12.so libada-12.2.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1710,8 +1710,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.2.0_1
+libasan.so.8 libsanitizer-12.2.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..12ec68dd8aa3 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,14 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ b/libgo/go/runtime/os_linux.go
+@@ -365,7 +365,7 @@ func setThreadCPUProfiler(hz int32) {
+ 	var sevp _sigevent
+ 	sevp.sigev_notify = _SIGEV_THREAD_ID
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.__sev_fields))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index ab3643de4f98..a20af7c0ef2e 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,14 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
+version=12.2.0
+revision=1
+_minorver="${version%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 create_wrksrc=yes
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +18,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -52,8 +48,11 @@ if [ "$CHROOT_READY" ]; then
 	hostmakedepends="tar texinfo perl flex"
 else
 	_have_gccgo=no
+	# libzstd fails to link in bootstrap with glibc 2.36
+	# when zlib has been compiled with glibc 2.32.
+	LDFLAGS="-lzstd -pthread"
 fi
-makedepends="zlib-devel"
+makedepends="zlib-devel libzstd-devel"
 depends="binutils libgcc-devel-${version}_${revision}
  libstdc++-devel-${version}_${revision} libssp-devel-${version}_${revision}"
 checkdepends="dejagnu"
@@ -70,13 +69,13 @@ if [ "$build_option_gnatboot" ]; then
 	case "$XBPS_TARGET_MACHINE" in
 	x86_64)
 		_gnat_tarball="gnat-gpl-2017-x86_64-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/591c6d80c7a447af2deed1d7>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/9682e2e1f2f232ce03fe21d77b14c37a0de5649b?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" b942bcac20dea39748b39f8b624d9619f60a8dee2e8195dbe3829c835b0956e6"
 		build_options_default="gnatboot"
 		;;
 	i686)
 		_gnat_tarball="gnat-gpl-2014-x86-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/564b3e9dc8e196b040fbe248>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/c5e9e6fdff5cb77ed90cf8c62536653e27c0bed6?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" 3b693510f5d22a240abb3034934c1adbd80ccd6e4f61a4f491cc408fdfd9c042"
 		build_options_default="gnatboot"
 		;;
@@ -155,8 +154,8 @@ if [ "$CROSS_BUILD" ]; then
 fi
 
 post_extract() {
-	mv gcc-${version/pre/_pre}/* gcc-${version/pre/_pre}/.??* .
-	rmdir gcc-${version/pre/_pre}
+	mv gcc-${version}/* gcc-${version}/.??* .
+	rmdir gcc-${version}
 	mv gmp-${_gmp_version} gmp
 	mv mpfr-${_mpfr_version} mpfr
 	mv mpc-${_mpc_version} mpc
@@ -186,9 +185,9 @@ pre_configure() {
 	sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
 
 	if [ "$XBPS_TARGET_LIBC" = musl ]; then
-		patch -p1 -i ${FILESDIR}/libgnarl-musl.patch
-		patch -p1 -i ${FILESDIR}/libssp-musl.patch
-		patch -p1 -i ${FILESDIR}/gccgo-musl.patch
+		for p in ${FILESDIR}/*-musl.patch; do
+			patch -p1 -i $p
+		done
 	fi
 }
 do_configure() {
@@ -343,16 +342,16 @@ do_install() {
 
 	# Make version a symlink of major version to make all versions
 	# from the same series work automagically.
-	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver} \
+	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${version} \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver}
 	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver} \
-		${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}
+		${DESTDIR}/usr/lib/gcc/${_triplet}/${version}
 
 	# Ditto for c++ headers.
-	mv ${DESTDIR}/usr/include/c++/${_patchver} \
+	mv ${DESTDIR}/usr/include/c++/${version} \
 		${DESTDIR}/usr/include/c++/${_minorver}
 	ln -sfr ${DESTDIR}/usr/include/c++/${_minorver} \
-		${DESTDIR}/usr/include/c++/${_patchver}
+		${DESTDIR}/usr/include/c++/${version}
 
 	# cc symlink
 	ln -sfr ${DESTDIR}/usr/bin/gcc ${DESTDIR}/usr/bin/cc
@@ -361,7 +360,7 @@ do_install() {
 
 	# lto plugin symlink
 	vmkdir usr/lib/bfd-plugins
-	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}/liblto_plugin.so \
+	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${version}/liblto_plugin.so \
 		${DESTDIR}/usr/lib/bfd-plugins
 
 	# Remove "fixed" header
@@ -372,13 +371,9 @@ do_install() {
 	rm -f ${DESTDIR}/usr/lib/libffi*
 	rm -f ${DESTDIR}/usr/share/man/man3/ffi*
 
-	# Remove all python scripts in libdir.
-	rm -f ${DESTDIR}/usr/lib/*.py
-
-	# Remove more python stuff.
-	if [ -d ${DESTDIR}/usr/share/gcc-${_patchver}/python ]; then
-		rm -rf ${DESTDIR}/usr/share/gcc-${_patchver}/python
-	fi
+	# Move libstdc++ gdb helpers to location where gdb can autoload them
+	mkdir -p ${DESTDIR}/usr/share/gdb/auto-load/usr/lib
+	mv ${DESTDIR}/usr/lib/*.py ${DESTDIR}/usr/share/gdb/auto-load/usr/lib
 
 	# Install c89 and c99 wrappers and its manpages, from NetBSD.
 	for f in c89 c99; do
@@ -397,7 +392,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}
@@ -450,7 +445,7 @@ gcc-fortran_package() {
 		if [ "$CROSS_BUILD" ]; then
 			# A number of OMP modules are not built when cross
 			# compiling gcc. Copy them from the cross compiler.
-			local src="/usr/lib/gcc/${_triplet}/${_patchver}/finclude"
+			local src="/usr/lib/gcc/${_triplet}/${version}/finclude"
 			local dst="usr/lib/gcc/${_triplet}/${_minorver}/finclude"
 			for f in omp_lib.f90 omp_lib.h omp_lib.mod omp_lib_kinds.mod \
 				openacc.f90 openacc.mod openacc_kinds.mod openacc_lib.h; do
@@ -517,7 +512,7 @@ libgfortran_package() {
 	short_desc+=" - Fortran library"
 	pkg_install() {
 		vmove "usr/lib/libgfortran.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -538,7 +533,7 @@ libgo_package() {
 	nostrip=yes
 	pkg_install() {
 		vmove "usr/lib/libgo.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -554,7 +549,7 @@ libobjc_package() {
 	short_desc+=" - Objective-C library"
 	pkg_install() {
 		vmove "usr/lib/libobjc.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -573,7 +568,7 @@ libquadmath_package() {
 	short_desc+=" - quadmath library"
 	pkg_install() {
 		vmove "usr/lib/libquadmath.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -615,7 +610,7 @@ libgcc_package() {
 	noverifyrdeps=yes
 	pkg_install() {
 		vmove "usr/lib/libgcc_s.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -646,7 +641,7 @@ libgomp_package() {
 	short_desc+=" - OpenMP v4.0 library"
 	pkg_install() {
 		vmove "usr/lib/libgomp*.so.*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -701,7 +696,7 @@ libssp_package() {
 	short_desc+=" - SSP (StackSmashingProtection) library"
 	pkg_install() {
 		vmove "usr/lib/libssp.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -718,7 +713,9 @@ libstdc++-devel_package() {
 libstdc++_package() {
 	short_desc+=" - Standard C++ Library"
 	pkg_install() {
+		vmove usr/share/gdb
+		vmove usr/share/gcc-${version}/python
 		vmove "usr/lib/libstdc++.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }

From f78405a9bfc5d3741acf926ac4c6ad8b2a5c16b1 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 04/37] libtool: rebuild for gcc 12

---
 srcpkgs/libtool/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index fc5c53a9c3e9..aebad9294eef 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
 version=2.4.7
-revision=1
+revision=2
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"

From 7696c7a61490e29fa1fb969b1a001ac986df2bd6 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 05/37] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 7e01bbb851fd..d9618e3806ba 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 build_wrksrc=libiberty
 build_style=gnu-configure
@@ -10,7 +10,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From 7f4eeee818e92ece5b71ef0d049ece0aeb1f1c22 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 06/37] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 ...e-hash-style-both-for-building-glibc.patch |  51 ++++
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  67 ++--
 4 files changed, 109 insertions(+), 355 deletions(-)
 create mode 100644 srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index 04cbade52468..a8c3a244f9ac 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch b/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
new file mode 100644
index 000000000000..9c5553e92609
--- /dev/null
+++ b/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
@@ -0,0 +1,51 @@
+Temporary workaround for EAC bug.
+
+See: https://sourceware.org/bugzilla/show_bug.cgi?id=29456
+
+From 8e90e2cc5e57d7ca3a40602d278e9642a8b66716 Mon Sep 17 00:00:00 2001
+From: oreo639 <oreo6391@gmail.com>
+Date: Tue, 13 Sep 2022 14:30:35 -0700
+Subject: [PATCH] Revert "Do not use --hash-style=both for building glibc
+ shared objects"
+
+This reverts commit e47de5cb2d4dbecb58f569ed241e8e95c568f03c.
+---
+ Makeconfig     |  9 +++++++++
+ Makerules      |  7 +++++++
+ 5 files changed, 61 insertions(+)
+
+diff --git a/Makeconfig b/Makeconfig
+index ba70321af1..e2131d4389 100644
+--- a/Makeconfig
++++ b/Makeconfig
+@@ -371,6 +371,13 @@ dt-relr-ldflag =
+ no-dt-relr-ldflag =
+ endif
+ 
++# For the time being we unconditionally use 'both'.  At some time we
++# should declare statically linked code as 'out of luck' and compile
++# with --hash-style=gnu only.
++hashstyle-LDFLAGS = -Wl,--hash-style=both
++LDFLAGS.so += $(hashstyle-LDFLAGS)
++LDFLAGS-rtld += $(hashstyle-LDFLAGS)
++
+ ifeq (no,$(build-pie-default))
+ pie-default = $(no-pie-ccflag)
+ else # build-pie-default
+diff --git a/Makerules b/Makerules
+index d1e139d03c..44134e37ce 100644
+--- a/Makerules
++++ b/Makerules
+@@ -558,6 +558,9 @@ $(common-objpfx)shlib.lds: $(common-objpfx)config.make $(..)Makerules
+ 		  -Wl,--verbose 2>/dev/null | \
+ 	  sed > $@T \
+ 	      -e '/^=========/,/^=========/!d;/^=========/d' \
++		   -e 's/^.*\.gnu\.hash[ 	]*:.*$$/  .note.ABI-tag : { *(.note.ABI-tag) } &/' \
++		   -e '/^[ 	]*\.hash[ 	]*:.*$$/{h;d;}' \
++		   -e '/DATA_SEGMENT_ALIGN/{H;g}' \
+ 	      -e 's/^.*\*(\.dynbss).*$$/& \
+ 		 PROVIDE(__start___libc_freeres_ptrs = .); \
+ 		 *(__libc_freeres_ptrs) \
+-- 
+2.37.3
+
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..9c26129d53a7 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,15 +1,16 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
+_patchver="72-g0f90d6204d"
+wrksrc="glibc-${version}-${_patchver}"
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
-distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
-# Do not strip these files, objcopy errors out.
+distfiles="https://vasilek.cz/paste/glibc-${version}-${_patchver}.tar.xz"
+checksum=656200722d5ba968b4888a2d2950719d72c86290fd0479f61897d25b7db2cb57
 nostrip_files="
 	XBS5_ILP32_OFFBIG
 	XBS5_ILP32_OFF32
@@ -20,27 +21,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +56,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +164,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From 0b4b5e7ef2c4f8ccd51183f8de9b1fca30ff3567 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 07/37] musl: add support for SIGEV_THREAD_ID timers

https://git.musl-libc.org/cgit/musl/commit/?id=7c71792e87691451f2a6b76348e83ad1889f1dcb
---
 ...d-support-for-SIGEV_THREAD_ID-timers.patch | 74 +++++++++++++++++++
 srcpkgs/musl/template                         |  2 +-
 2 files changed, 75 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch

diff --git a/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
new file mode 100644
index 000000000000..e20dff5ba0d4
--- /dev/null
+++ b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
@@ -0,0 +1,74 @@
+From 7c71792e87691451f2a6b76348e83ad1889f1dcb Mon Sep 17 00:00:00 2001
+From: James Y Knight <jyknight@google.com>
+Date: Sun, 30 Jun 2019 21:55:20 -0400
+Subject: [PATCH] add support for SIGEV_THREAD_ID timers
+
+This is like SIGEV_SIGNAL, but targeted to a particular thread's
+tid, rather than the process.
+---
+ include/signal.h        | 16 +++++++++++++---
+ src/time/timer_create.c |  8 ++++++--
+ 2 files changed, 19 insertions(+), 5 deletions(-)
+
+diff --git a/include/signal.h b/include/signal.h
+index fbdf667b2..9ed929e4f 100644
+--- a/include/signal.h
++++ b/include/signal.h
+@@ -180,14 +180,24 @@ struct sigevent {
+ 	union sigval sigev_value;
+ 	int sigev_signo;
+ 	int sigev_notify;
+-	void (*sigev_notify_function)(union sigval);
+-	pthread_attr_t *sigev_notify_attributes;
+-	char __pad[56-3*sizeof(long)];
++	union {
++		char __pad[64 - 2*sizeof(int) - sizeof(union sigval)];
++		pid_t sigev_notify_thread_id;
++		struct {
++			void (*sigev_notify_function)(union sigval);
++			pthread_attr_t *sigev_notify_attributes;
++		} __sev_thread;
++	} __sev_fields;
+ };
+ 
++#define sigev_notify_thread_id __sev_fields.sigev_notify_thread_id
++#define sigev_notify_function __sev_fields.__sev_thread.sigev_notify_function
++#define sigev_notify_attributes __sev_fields.__sev_thread.sigev_notify_attributes
++
+ #define SIGEV_SIGNAL 0
+ #define SIGEV_NONE 1
+ #define SIGEV_THREAD 2
++#define SIGEV_THREAD_ID 4
+ 
+ int __libc_current_sigrtmin(void);
+ int __libc_current_sigrtmax(void);
+diff --git a/src/time/timer_create.c b/src/time/timer_create.c
+index 5ddfda278..4bef23905 100644
+--- a/src/time/timer_create.c
++++ b/src/time/timer_create.c
+@@ -71,11 +71,15 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 	switch (evp ? evp->sigev_notify : SIGEV_SIGNAL) {
+ 	case SIGEV_NONE:
+ 	case SIGEV_SIGNAL:
++	case SIGEV_THREAD_ID:
+ 		if (evp) {
+ 			ksev.sigev_value = evp->sigev_value;
+ 			ksev.sigev_signo = evp->sigev_signo;
+ 			ksev.sigev_notify = evp->sigev_notify;
+-			ksev.sigev_tid = 0;
++			if (evp->sigev_notify == SIGEV_THREAD_ID)
++				ksev.sigev_tid = evp->sigev_notify_thread_id;
++			else
++				ksev.sigev_tid = 0;
+ 			ksevp = &ksev;
+ 		}
+ 		if (syscall(SYS_timer_create, clk, ksevp, &timerid) < 0)
+@@ -107,7 +111,7 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 
+ 		ksev.sigev_value.sival_ptr = 0;
+ 		ksev.sigev_signo = SIGTIMER;
+-		ksev.sigev_notify = 4; /* SIGEV_THREAD_ID */
++		ksev.sigev_notify = SIGEV_THREAD_ID;
+ 		ksev.sigev_tid = td->tid;
+ 		if (syscall(SYS_timer_create, clk, &ksev, &timerid) < 0)
+ 			timerid = -1;
diff --git a/srcpkgs/musl/template b/srcpkgs/musl/template
index 34e6ed4fba6e..afb33cd868b5 100644
--- a/srcpkgs/musl/template
+++ b/srcpkgs/musl/template
@@ -2,7 +2,7 @@
 pkgname=musl
 reverts="1.2.0_1"
 version=1.1.24
-revision=11
+revision=12
 archs="*-musl"
 bootstrap=yes
 build_style=gnu-configure

From 3e1adde4cef6ab73670e73984a74a3f7e8b84735 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 08/37] gcc-multilib: update to 12.2.0.

---
 srcpkgs/gcc-multilib/template | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index f28eb237c287..ba9bafcadfd6 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,15 +3,15 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _majorver="${version%.*}"
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel
@@ -70,7 +70,7 @@ do_build() {
 	make ${makejobs}
 }
 do_install() {
-	local _pc_triplet=x86_64-pc-linux-gnu _version=${version%pre1}
+	local _pc_triplet=x86_64-pc-linux-gnu
 	# Install to a tempdir and then only copy relevant files.
 	cd ${wrksrc}
 	make DESTDIR=${wrksrc}/${pkgname}-build install
@@ -80,9 +80,9 @@ do_install() {
 	vmkdir usr/include/c++/${_majorver}/${_triplet}
 	vmkdir usr/lib/gcc/${_triplet}/${_majorver}
 
-	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${_version}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${version}/32 \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_majorver}/
-	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${_version}/${_pc_triplet}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${version}/${_pc_triplet}/32 \
 		${DESTDIR}/usr/include/c++/${_majorver}/${_triplet}
 
 	vinstall ${wrksrc}/host-${_pc_triplet}/gcc/specs 644 usr/lib/gcc/${_triplet}/${_majorver}

From 326d931263ce4e809b0d0a66929cdb1a65feaa4e Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 09/37] libgccjit: update to 12.2.0.

---
 srcpkgs/libgccjit/files/libgccjit-musl.patch | 63 --------------------
 srcpkgs/libgccjit/template                   | 24 +++-----
 2 files changed, 9 insertions(+), 78 deletions(-)
 delete mode 100644 srcpkgs/libgccjit/files/libgccjit-musl.patch

diff --git a/srcpkgs/libgccjit/files/libgccjit-musl.patch b/srcpkgs/libgccjit/files/libgccjit-musl.patch
deleted file mode 100644
index d2ed16928c82..000000000000
--- a/srcpkgs/libgccjit/files/libgccjit-musl.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-diff --git a/gcc/jit/jit-playback.c b/gcc/jit/jit-playback.c
-index 5bccf591a..35f5e35ef 100644
---- a/gcc/jit/jit-playback.c
-+++ b/gcc/jit/jit-playback.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -41,8 +43,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "diagnostic.h"
- #include "stmt.h"
- 
--#include <pthread.h>
--
- #include "jit-playback.h"
- #include "jit-result.h"
- #include "jit-builtins.h"
-diff --git a/gcc/jit/jit-recording.c b/gcc/jit/jit-recording.c
-index a237d574f..5785e3269 100644
---- a/gcc/jit/jit-recording.c
-+++ b/gcc/jit/jit-recording.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -25,8 +27,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "pretty-print.h"
- #include "toplev.h"
- 
--#include <pthread.h>
--
- #include "jit-builtins.h"
- #include "jit-recording.h"
- #include "jit-playback.h"
-diff --git a/gcc/jit/libgccjit.c b/gcc/jit/libgccjit.c
-index f9c33c63c..75f21d275 100644
---- a/gcc/jit/libgccjit.c
-+++ b/gcc/jit/libgccjit.c
-@@ -18,13 +18,13 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
- #include "timevar.h"
- #include "typed-splay-tree.h"
- #include "cppbuiltin.h"
--#include <pthread.h>
- 
- #include "libgccjit.h"
- #include "jit-recording.h"
diff --git a/srcpkgs/libgccjit/template b/srcpkgs/libgccjit/template
index 0b37c3ee9f8b..fde1affd54b7 100644
--- a/srcpkgs/libgccjit/template
+++ b/srcpkgs/libgccjit/template
@@ -3,18 +3,12 @@
 # which use the version number.
 
 pkgname=libgccjit
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
+version=12.2.0
 revision=1
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
-_majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 create_wrksrc=yes
 short_desc="Just-In-Time Compilation library for GCC"
 maintainer="Lane Biocini <lane@mailbox.org>"
@@ -22,16 +16,16 @@ homepage="https://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 nopie=yes
 lib32disabled=yes
 makedepends="zlib-devel"

From d98619e4d88638ba14765d3bbb1d4aa324c41db0 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 10/37] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove -no-pie from build. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..f7e02dbc48cb 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -53,6 +53,7 @@ _void_cross_build_binutils() {
 		--sbindir=/usr/bin \
 		--libdir=/usr/lib \
 		--libexecdir=/usr/lib \
+		--sysconfdir=/etc \
 		--target=${tgt} \
 		--with-sysroot=/usr/${tgt} \
 		--disable-nls \
@@ -60,7 +61,9 @@ _void_cross_build_binutils() {
 		--disable-multilib \
 		--disable-werror \
 		--disable-gold \
+		--disable-gprofng \
 		--enable-relro \
+		--enable-new-dtags \
 		--enable-plugins \
 		--enable-64-bit-bfd \
 		--enable-deterministic-archives \
@@ -91,6 +94,9 @@ _void_cross_build_bootstrap_gcc() {
 	# Do not run fixincludes
 	sed -i 's@./fixinc.sh@-c true@' Makefile.in
 
+	# Do not use system headers to determine clocale implementation
+	sed -i 's/#if (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined(__UCLIBC__)/#if 1/g' libstdc++-v3/configure
+
 	for f in ${XBPS_SRCPKGDIR}/gcc/patches/*.patch; do
 		_void_cross_apply_patch "$f"
 	done
@@ -132,6 +138,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -381,6 +388,7 @@ _void_cross_build_gcc() {
 		extra_args+=" --disable-gnu-unique-object"
 		extra_args+=" libat_cv_have_ifunc=no"
 	else
+		extra_args+=" --enable-clocale=gnu"
 		extra_args+=" --enable-gnu-unique-object"
 	fi
 
@@ -460,6 +468,14 @@ do_build() {
 	local binutils_ver linux_ver gcc_ver libc_ver libucontext_ver
 	local tgt=${sourcepkg/cross-}
 
+	export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}"
+	export CXXFLAGS="${CXXFLAGS/-D_FORTIFY_SOURCE=2/}"
+
+	# Disable explicit -fno-PIE, gcc/binutils/libc will figure this out itself.
+	export CFLAGS="${CFLAGS//-fno-PIE/}"
+	export CXXFLAGS="${CXXFLAGS//-fno-PIE/}"
+	export LDFLAGS="${LDFLAGS//-no-pie/}"
+
 	_void_cross_test_ver binutils
 	_void_cross_test_ver linux
 	_void_cross_test_ver gcc
@@ -625,6 +641,9 @@ do_install() {
 	# then remove it because it conflicts with libquadmath package
 	rm -rf ${DESTDIR}/${sysroot}/usr/lib/libquadmath.*
 
+	# Remove libdep linker plugin because it conflicts with system binutils
+	rm -f ${DESTDIR}/usr/lib/bfd-plugins/libdep*
+
 	# Remove leftover symlinks
 	rm -f ${DESTDIR}/usr/lib${XBPS_TARGET_WORDSIZE}
 	rm -f ${DESTDIR}/lib*

From a37c07935140b5dec8eeb7d1b98159728556787f Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 11/37] qemu: remove broken patch

The necessary patch has been imported into musl so no need
to cast the sigevent struct to a more glibc-like one.
---
 .../musl-fix-sigevent-and-sigval_t.patch      | 27 -------------------
 1 file changed, 27 deletions(-)
 delete mode 100644 srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch

diff --git a/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch b/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch
deleted file mode 100644
index 4b4f1117c15f..000000000000
--- a/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-Note: Remove this patch with musl 1.2.2
-
---- a/linux-user/syscall.c
-+++ b/linux-user/syscall.c
-@@ -5020,10 +5020,21 @@
- #ifndef HAVE_SIGEV_NOTIFY_THREAD_ID
- #define sigev_notify_thread_id _sigev_un._tid
- #endif
- 
--static inline abi_long target_to_host_sigevent(struct sigevent *host_sevp,
-+struct host_sigevent {
-+    union sigval sigev_value;
-+    int sigev_signo;
-+    int sigev_notify;
-+    union {
-+       char _pad[64 - sizeof(int) * 2 - sizeof(union sigval)];
-+       int _tid;
-+    } _sigev_un;
-+};
-+
-+static inline abi_long target_to_host_sigevent(struct sigevent *sevp,
-                                                abi_ulong target_addr)
- {
-+    struct host_sigevent *host_sevp = (struct host_sigevent *) sevp;
-     struct target_sigevent *target_sevp;
- 
-     if (!lock_user_struct(VERIFY_READ, target_sevp, target_addr, 1)) {

From f3e9d47843b6acbfbad759d1c335d2a260bb4121 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 19 Nov 2022 13:26:24 -0800
Subject: [PATCH 12/37] mk-configure: rebuild for gcc 12

---
 srcpkgs/mk-configure/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/mk-configure/template b/srcpkgs/mk-configure/template
index 9d12f11a9799..c50d8adf213f 100644
--- a/srcpkgs/mk-configure/template
+++ b/srcpkgs/mk-configure/template
@@ -1,7 +1,7 @@
 # Template file for 'mk-configure'
 pkgname=mk-configure
 version=0.37.0
-revision=1
+revision=2
 build_style=gnu-makefile
 make_cmd=bmake
 make_install_args="MANDIR=/usr/share/man"

From 49fd118cd260039c9be6339e94b3204918f20982 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 13/37] cross-aarch64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..9e6fb75c198d 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Leah Neukirchen <leah@vuxu.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From e23df1763b5e62ab8819d6c5175284961614d279 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 14/37] cross-aarch64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..ba14c96bccea 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 4d33539faeb6d560f83926075c057f4b5a219a11 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 15/37] cross-arm-linux-gnueabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..5c774e16f430 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 24775cb61edadd49972262237961875903d6f5cd Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 16/37] cross-arm-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..d6298ab639a4 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 4f2365dfe8ea1d7754a1b3163670ebf9538231ac Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 17/37] cross-arm-linux-musleabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..24df78e8fd8e 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 2d3294fc8ba26489d913dc0ca5cf9f242c6b64a1 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 18/37] cross-arm-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..8093700f909c 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 776ca35e75345007e1d6f201b1240e8f50e30a6d Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 19/37] cross-armv7l-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..92665326428b 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 49715ae3538141328d35efbe6825e87b713b9313 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 20/37] cross-armv7l-linux-musleabihf: update to gcc 12.2.0.

---
 .../cross-armv7l-linux-musleabihf/template    | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..e5af2c9ccbf2 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 1a7c64f02689584a45ec9c488b50e86020d7f28a Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 21/37] cross-i686-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-i686-linux-musl/template b/srcpkgs/cross-i686-linux-musl/template
index 8be16a230d8d..d624bb7a3254 100644
--- a/srcpkgs/cross-i686-linux-musl/template
+++ b/srcpkgs/cross-i686-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-i686-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-i686-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 5d7411d13798ba4c04eb0d6e7b1d318c657c42b3 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 22/37] cross-i686-pc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..6a9e54db807a 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,14 +1,15 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -16,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 58202a3bf59d22f5c423aa9f3f8606547b5a1ee2 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 23/37] cross-mips-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-musl/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..67a5c413396c 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From b54b348b204f98dc4c9a9a10906883c5f07d691c Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 24/37] cross-mips-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..bdf8600ce95b 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="hipperson0 <hipperson0@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 8d5d3d353bc6df4ec0cd625da4be27e726fe9e09 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 25/37] cross-mipsel-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..de49387d517b 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 37386611fdda1ba58b4dbe8cfba562ac16b7765b Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 26/37] cross-mipsel-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..b27ce6475a38 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 56aad7dd40b7bfc1ee29d1bffffb5064e3242862 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 27/37] cross-powerpc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..79579e093b12 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 8e8d7a4dc7d98a7d6d689ad672ef57eefff4f66f Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 28/37] cross-powerpc-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..9bb6acd359b6 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 7bbefed7920ac18ff83a153784dd1cde2d529b4b Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 29/37] cross-powerpc64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..2d153d00add6 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,16 +1,17 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
  --enable-targets=powerpc-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -18,12 +19,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 35ae02bac33a15111cd29a4b965c929bb8be1550 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 30/37] cross-powerpc64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 016f18776a6d..e0848fe0bff7 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,30 +1,31 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 5c821289966f934afeb76741004d3ece506c3d76 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 31/37] cross-powerpc64le-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 463d7e92d20d..8d8e010e15c0 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,16 +1,17 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
  --enable-targets=powerpcle-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -18,12 +19,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 4fe7977a4bc7f9b29be3aa94b0466d3f79348b7e Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 32/37] cross-powerpc64le-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index c17a3cccfe29..0915e524545f 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,30 +1,31 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 10c23eac548a7c48644b764aaf08c2ee30c7d603 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 33/37] cross-powerpcle-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 9aede3c465ce..687be8a44c6c 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 
@@ -35,6 +36,8 @@ if [ "$XBPS_TARGET_MACHINE" = "ppcle" ]; then
 	broken="Can't build crosstoolchain to itself"
 fi
 
+broken="glibc uses big-endian specific instructions on 32-bit powerpc"
+
 cross-powerpcle-linux-gnu-libc_package() {
 	short_desc+=" - glibc files"
 	nostrip=yes

From 3b98ca5e3b39dfb60b95c143a4c901c92206285d Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 34/37] cross-powerpcle-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index 045cfda987fe..bb984b9c42eb 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From cf29b7b628928147da1e5a70a42da0fdda4190e5 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:30 -0800
Subject: [PATCH 35/37] cross-x86_64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 8918f3c22a1c..930aaf2a508b 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,14 +1,15 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -16,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 5c234acc0e9d26bcb350d1f77dab9579fbfe1697 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:30 -0800
Subject: [PATCH 36/37] cross-x86_64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..ac5b1c46ab82 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 2c80328920478f46739b27134d6ca58dc5815457 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Fri, 18 Nov 2022 02:01:19 -0800
Subject: [PATCH 37/37] cross-vpkg-dummy: update to 0.39.

---
 srcpkgs/cross-vpkg-dummy/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/cross-vpkg-dummy/template b/srcpkgs/cross-vpkg-dummy/template
index d83e38dc63ac..aeafb749dd5f 100644
--- a/srcpkgs/cross-vpkg-dummy/template
+++ b/srcpkgs/cross-vpkg-dummy/template
@@ -1,6 +1,6 @@
 # Template file for 'cross-vpkg-dummy'
 pkgname=cross-vpkg-dummy
-version=0.38
+version=0.39
 revision=1
 build_style=meta
 short_desc="Dummy meta-pkg for cross building packages with xbps-src"
@@ -54,8 +54,8 @@ conflicts="
 	gcc-objc++>=0"
 shlib_provides="
 	libgcc_s.so.1
-	libgnat-10.so
-	libgnarl-10.so
+	libgnat-12.so
+	libgnarl-12.so
 	libstdc++.so.6
 	libgfortran.so.5"
 

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (239 preceding siblings ...)
  2022-11-21 18:22 ` oreo639
@ 2022-11-21 18:24 ` oreo639
  2022-11-28 19:06 ` oreo639
                   ` (23 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-11-21 18:24 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5448 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.2.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.2.0

There is a list of failing builds here: https://github.com/void-linux/void-packages/issues/39809

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [x] llvm https://github.com/void-linux/void-packages/pull/38694
- [x] m4 https://github.com/void-linux/void-packages/pull/33730
- [x] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [x] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [x] libvirt https://github.com/void-linux/void-packages/pull/38842
- [x] syslinux https://github.com/void-linux/void-packages/pull/38876
- [x] efivar https://github.com/void-linux/void-packages/pull/38874
- [x] gpgme https://github.com/void-linux/void-packages/pull/38825

Known packages that needed to be fixed/updated for gcc12:
- [x] openssh https://github.com/void-linux/void-packages/pull/38849
- [x] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [x] doxygen https://github.com/void-linux/void-packages/pull/38846
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] libproxy https://github.com/void-linux/void-packages/pull/38818
- [x] exempi https://github.com/void-linux/void-packages/pull/38820
- [x] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [x] libunique1 https://github.com/void-linux/void-packages/pull/38848 or https://github.com/void-linux/void-packages/pull/38873
- [x] libwpd https://github.com/void-linux/void-packages/pull/38878
- [x] cglm https://github.com/void-linux/void-packages/pull/39748
- [x] coreboot-utils https://github.com/void-linux/void-packages/pull/39749
- [x] apl https://github.com/void-linux/void-packages/pull/39750
- [x] igt-gpu-tools https://github.com/void-linux/void-packages/pull/39780

Needs to be fixed/updated for binutils:
- [x] grub https://github.com/void-linux/void-packages/pull/38875
- [x] linux-tools https://github.com/void-linux/void-packages/pull/38877
- [x] kcov https://github.com/void-linux/void-packages/pull/39291

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [x] kde
- [x] lxde
- [x] lxqt

You can test the ISOs here:
https://drive.google.com/drive/folders/1ix92CYSLUP-KWjLxltdgG4e8Nu2JCY5n?usp=sharing

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 127674 bytes --]

From e5ba0c429eee4c172b49e5674bd11f88d3fa1d27 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 01/37] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../fix-libcollector-without-java.patch       | 53 +++++++++++++++
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 25 ++++---
 4 files changed, 87 insertions(+), 117 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
 create mode 100644 srcpkgs/binutils/patches/fix-libcollector-without-java.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/fix-libcollector-without-java.patch b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
new file mode 100644
index 000000000000..54384875f358
--- /dev/null
+++ b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
@@ -0,0 +1,53 @@
+From 49ddd814ac1071af7c4f45d5f8398b91862f2c7f Mon Sep 17 00:00:00 2001
+From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
+Date: Wed, 17 Aug 2022 19:55:23 -0700
+Subject: [PATCH] gprofng: fix bug 29479 Collection fails when built without
+ java support
+
+gprofng/ChangeLog
+2022-08-17  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>
+
+	PR gprofng/29479
+	* libcollector/collector.c: Add #if defined(GPROFNG_JAVA_PROFILING) for
+	java specific code.
+	* libcollector/unwind.c: Likewise.
+---
+ gprofng/libcollector/collector.c | 2 ++
+ gprofng/libcollector/unwind.c    | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/gprofng/libcollector/collector.c b/gprofng/libcollector/collector.c
+index 93c9d3330de5..ceff2c1caccb 100644
+--- a/gprofng/libcollector/collector.c
++++ b/gprofng/libcollector/collector.c
+@@ -913,8 +913,10 @@ __collector_open_experiment (const char *exp, const char *params, sp_origin_t or
+   __collector_ext_unwind_key_init (1, NULL);
+ 
+   /* start java attach if suitable */
++#if defined(GPROFNG_JAVA_PROFILING)
+   if (exp_origin == SP_ORIGIN_DBX_ATTACH)
+     __collector_jprofile_start_attach ();
++#endif
+   start_sec_time = CALL_UTIL (time)(NULL);
+   __collector_start_time = collector_interface.getHiResTime ();
+   TprintfT (DBG_LT0, "\t__collector_open_experiment; resetting start_time\n");
+diff --git a/gprofng/libcollector/unwind.c b/gprofng/libcollector/unwind.c
+index 119243788020..f8e11823c81e 100644
+--- a/gprofng/libcollector/unwind.c
++++ b/gprofng/libcollector/unwind.c
+@@ -557,6 +557,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+   int size = max_frame_size;
+ 
+ #define MIN(a,b) ((a)<(b)?(a):(b))
++#if defined(GPROFNG_JAVA_PROFILING)
+   /* get Java info */
+   if (__collector_java_mode && __collector_java_asyncgetcalltrace_loaded && context && !pseudo_context)
+     {
+@@ -569,6 +570,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+ 	  size -= sz;
+ 	}
+     }
++#endif
+ 
+   /* get native stack */
+   if (context)
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..c355a5fc8016 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkgconf"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -35,15 +36,21 @@ do_configure() {
 	local conf
 
 	if [ "$CHROOT_READY" ]; then
-		conf+=" --with-debuginfod"
+		conf+=" --with-debuginfod --enable-shared"
 	else
-		conf+=" --without-debuginfod --disable-install-libbfd"
+		conf+=" --without-debuginfod --disable-shared --disable-install-libbfd"
 	fi
 	if [ "$CROSS_BUILD" ]; then
 		# we don't want --with-sysroot=${XBPS_CROSS_BASE} like gnu-configure
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	# gprofng currently only supports x86 and aarch64 glibc.
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64|i386|aarch64) conf+=" --enable-gprofng" ;;
+		*) conf+=" --disable-gprofng" ;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"
@@ -76,13 +83,14 @@ do_configure() {
 		--libdir=/usr/lib \
 		--mandir=/usr/share/man \
 		--infodir=/usr/share/info \
+		--sysconfdir=/etc \
 		--disable-werror \
-		--disable-shared \
 		--disable-nls \
 		--enable-threads \
 		--enable-plugins \
 		--enable-relro \
 		--enable-gold \
+		--enable-new-dtags \
 		--enable-deterministic-archives \
 		--enable-64-bit-bfd \
 		--enable-ld=default \
@@ -142,7 +150,8 @@ binutils-devel_package() {
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/*.a"
-		vmove "usr/lib/*.so"
+		vmove "usr/lib/libbfd.so"
+		vmove "usr/lib/libopcodes.so"
 	}
 }
 

From 81d5d89982267cae868b4714bb2366d404091f3a Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 02/37] gdb: resolve conflict with binutils 2.39

---
 srcpkgs/gdb/template | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/gdb/template b/srcpkgs/gdb/template
index 9c5f17ffc519..b666348fea19 100644
--- a/srcpkgs/gdb/template
+++ b/srcpkgs/gdb/template
@@ -1,7 +1,7 @@
 # Template file for 'gdb'
 pkgname=gdb
 version=12.1
-revision=2
+revision=3
 build_style=gnu-configure
 pycompile_dirs="/usr/share/gdb/python"
 configure_args="--disable-werror --disable-nls --with-system-readline
@@ -48,7 +48,8 @@ vopt_conflict debuginfod static
 
 post_install() {
 	# resolve conflicts with binutils
-	rm -r ${DESTDIR}/usr/{include,lib,share/info/bfd.info*}
+	rm -rf ${DESTDIR}/usr/{include,lib}
+	rm -rf ${DESTDIR}/usr/share/info/{bfd,ctf-spec}.info*
 }
 
 gdb-common_package() {

From be65d2c26a4ffd833d0953f864cf7b2eceb07283 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 03/37] gcc: update to 12.2.0.

---
 common/shlibs                                 | 10 +--
 srcpkgs/gcc/files/gccgo-musl.patch            | 71 +++------------
 srcpkgs/gcc/files/libgnarl-musl.patch         | 18 ++--
 srcpkgs/gcc/files/libssp-musl.patch           | 10 +--
 srcpkgs/gcc/patches/libffi_gnulinux.patch     | 11 ---
 .../gcc/patches/libgcc-ibm128-no-tag.patch    | 10 ++-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |  2 +-
 srcpkgs/gcc/template                          | 87 +++++++++----------
 8 files changed, 80 insertions(+), 139 deletions(-)
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index 3b103f479d5a..04cbade52468 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.2.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.36 perl-5.36.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -857,8 +857,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.2.0_1
+libgnat-12.so libada-12.2.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1710,8 +1710,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.2.0_1
+libasan.so.8 libsanitizer-12.2.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..12ec68dd8aa3 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,14 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ b/libgo/go/runtime/os_linux.go
+@@ -365,7 +365,7 @@ func setThreadCPUProfiler(hz int32) {
+ 	var sevp _sigevent
+ 	sevp.sigev_notify = _SIGEV_THREAD_ID
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.__sev_fields))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index ab3643de4f98..a20af7c0ef2e 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,14 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
+version=12.2.0
+revision=1
+_minorver="${version%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 create_wrksrc=yes
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +18,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -52,8 +48,11 @@ if [ "$CHROOT_READY" ]; then
 	hostmakedepends="tar texinfo perl flex"
 else
 	_have_gccgo=no
+	# libzstd fails to link in bootstrap with glibc 2.36
+	# when zlib has been compiled with glibc 2.32.
+	LDFLAGS="-lzstd -pthread"
 fi
-makedepends="zlib-devel"
+makedepends="zlib-devel libzstd-devel"
 depends="binutils libgcc-devel-${version}_${revision}
  libstdc++-devel-${version}_${revision} libssp-devel-${version}_${revision}"
 checkdepends="dejagnu"
@@ -70,13 +69,13 @@ if [ "$build_option_gnatboot" ]; then
 	case "$XBPS_TARGET_MACHINE" in
 	x86_64)
 		_gnat_tarball="gnat-gpl-2017-x86_64-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/591c6d80c7a447af2deed1d7>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/9682e2e1f2f232ce03fe21d77b14c37a0de5649b?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" b942bcac20dea39748b39f8b624d9619f60a8dee2e8195dbe3829c835b0956e6"
 		build_options_default="gnatboot"
 		;;
 	i686)
 		_gnat_tarball="gnat-gpl-2014-x86-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/564b3e9dc8e196b040fbe248>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/c5e9e6fdff5cb77ed90cf8c62536653e27c0bed6?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" 3b693510f5d22a240abb3034934c1adbd80ccd6e4f61a4f491cc408fdfd9c042"
 		build_options_default="gnatboot"
 		;;
@@ -155,8 +154,8 @@ if [ "$CROSS_BUILD" ]; then
 fi
 
 post_extract() {
-	mv gcc-${version/pre/_pre}/* gcc-${version/pre/_pre}/.??* .
-	rmdir gcc-${version/pre/_pre}
+	mv gcc-${version}/* gcc-${version}/.??* .
+	rmdir gcc-${version}
 	mv gmp-${_gmp_version} gmp
 	mv mpfr-${_mpfr_version} mpfr
 	mv mpc-${_mpc_version} mpc
@@ -186,9 +185,9 @@ pre_configure() {
 	sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
 
 	if [ "$XBPS_TARGET_LIBC" = musl ]; then
-		patch -p1 -i ${FILESDIR}/libgnarl-musl.patch
-		patch -p1 -i ${FILESDIR}/libssp-musl.patch
-		patch -p1 -i ${FILESDIR}/gccgo-musl.patch
+		for p in ${FILESDIR}/*-musl.patch; do
+			patch -p1 -i $p
+		done
 	fi
 }
 do_configure() {
@@ -343,16 +342,16 @@ do_install() {
 
 	# Make version a symlink of major version to make all versions
 	# from the same series work automagically.
-	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver} \
+	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${version} \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver}
 	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver} \
-		${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}
+		${DESTDIR}/usr/lib/gcc/${_triplet}/${version}
 
 	# Ditto for c++ headers.
-	mv ${DESTDIR}/usr/include/c++/${_patchver} \
+	mv ${DESTDIR}/usr/include/c++/${version} \
 		${DESTDIR}/usr/include/c++/${_minorver}
 	ln -sfr ${DESTDIR}/usr/include/c++/${_minorver} \
-		${DESTDIR}/usr/include/c++/${_patchver}
+		${DESTDIR}/usr/include/c++/${version}
 
 	# cc symlink
 	ln -sfr ${DESTDIR}/usr/bin/gcc ${DESTDIR}/usr/bin/cc
@@ -361,7 +360,7 @@ do_install() {
 
 	# lto plugin symlink
 	vmkdir usr/lib/bfd-plugins
-	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}/liblto_plugin.so \
+	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${version}/liblto_plugin.so \
 		${DESTDIR}/usr/lib/bfd-plugins
 
 	# Remove "fixed" header
@@ -372,13 +371,9 @@ do_install() {
 	rm -f ${DESTDIR}/usr/lib/libffi*
 	rm -f ${DESTDIR}/usr/share/man/man3/ffi*
 
-	# Remove all python scripts in libdir.
-	rm -f ${DESTDIR}/usr/lib/*.py
-
-	# Remove more python stuff.
-	if [ -d ${DESTDIR}/usr/share/gcc-${_patchver}/python ]; then
-		rm -rf ${DESTDIR}/usr/share/gcc-${_patchver}/python
-	fi
+	# Move libstdc++ gdb helpers to location where gdb can autoload them
+	mkdir -p ${DESTDIR}/usr/share/gdb/auto-load/usr/lib
+	mv ${DESTDIR}/usr/lib/*.py ${DESTDIR}/usr/share/gdb/auto-load/usr/lib
 
 	# Install c89 and c99 wrappers and its manpages, from NetBSD.
 	for f in c89 c99; do
@@ -397,7 +392,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}
@@ -450,7 +445,7 @@ gcc-fortran_package() {
 		if [ "$CROSS_BUILD" ]; then
 			# A number of OMP modules are not built when cross
 			# compiling gcc. Copy them from the cross compiler.
-			local src="/usr/lib/gcc/${_triplet}/${_patchver}/finclude"
+			local src="/usr/lib/gcc/${_triplet}/${version}/finclude"
 			local dst="usr/lib/gcc/${_triplet}/${_minorver}/finclude"
 			for f in omp_lib.f90 omp_lib.h omp_lib.mod omp_lib_kinds.mod \
 				openacc.f90 openacc.mod openacc_kinds.mod openacc_lib.h; do
@@ -517,7 +512,7 @@ libgfortran_package() {
 	short_desc+=" - Fortran library"
 	pkg_install() {
 		vmove "usr/lib/libgfortran.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -538,7 +533,7 @@ libgo_package() {
 	nostrip=yes
 	pkg_install() {
 		vmove "usr/lib/libgo.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -554,7 +549,7 @@ libobjc_package() {
 	short_desc+=" - Objective-C library"
 	pkg_install() {
 		vmove "usr/lib/libobjc.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -573,7 +568,7 @@ libquadmath_package() {
 	short_desc+=" - quadmath library"
 	pkg_install() {
 		vmove "usr/lib/libquadmath.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -615,7 +610,7 @@ libgcc_package() {
 	noverifyrdeps=yes
 	pkg_install() {
 		vmove "usr/lib/libgcc_s.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -646,7 +641,7 @@ libgomp_package() {
 	short_desc+=" - OpenMP v4.0 library"
 	pkg_install() {
 		vmove "usr/lib/libgomp*.so.*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -701,7 +696,7 @@ libssp_package() {
 	short_desc+=" - SSP (StackSmashingProtection) library"
 	pkg_install() {
 		vmove "usr/lib/libssp.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -718,7 +713,9 @@ libstdc++-devel_package() {
 libstdc++_package() {
 	short_desc+=" - Standard C++ Library"
 	pkg_install() {
+		vmove usr/share/gdb
+		vmove usr/share/gcc-${version}/python
 		vmove "usr/lib/libstdc++.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }

From f78405a9bfc5d3741acf926ac4c6ad8b2a5c16b1 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 04/37] libtool: rebuild for gcc 12

---
 srcpkgs/libtool/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index fc5c53a9c3e9..aebad9294eef 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
 version=2.4.7
-revision=1
+revision=2
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"

From 7696c7a61490e29fa1fb969b1a001ac986df2bd6 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 05/37] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 7e01bbb851fd..d9618e3806ba 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 build_wrksrc=libiberty
 build_style=gnu-configure
@@ -10,7 +10,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From 9855e78e1000d7a3dbd9e216edaf9a1804f8397a Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 06/37] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 ...e-hash-style-both-for-building-glibc.patch |  51 ++++
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  66 ++--
 4 files changed, 109 insertions(+), 354 deletions(-)
 create mode 100644 srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index 04cbade52468..a8c3a244f9ac 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch b/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
new file mode 100644
index 000000000000..9c5553e92609
--- /dev/null
+++ b/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
@@ -0,0 +1,51 @@
+Temporary workaround for EAC bug.
+
+See: https://sourceware.org/bugzilla/show_bug.cgi?id=29456
+
+From 8e90e2cc5e57d7ca3a40602d278e9642a8b66716 Mon Sep 17 00:00:00 2001
+From: oreo639 <oreo6391@gmail.com>
+Date: Tue, 13 Sep 2022 14:30:35 -0700
+Subject: [PATCH] Revert "Do not use --hash-style=both for building glibc
+ shared objects"
+
+This reverts commit e47de5cb2d4dbecb58f569ed241e8e95c568f03c.
+---
+ Makeconfig     |  9 +++++++++
+ Makerules      |  7 +++++++
+ 5 files changed, 61 insertions(+)
+
+diff --git a/Makeconfig b/Makeconfig
+index ba70321af1..e2131d4389 100644
+--- a/Makeconfig
++++ b/Makeconfig
+@@ -371,6 +371,13 @@ dt-relr-ldflag =
+ no-dt-relr-ldflag =
+ endif
+ 
++# For the time being we unconditionally use 'both'.  At some time we
++# should declare statically linked code as 'out of luck' and compile
++# with --hash-style=gnu only.
++hashstyle-LDFLAGS = -Wl,--hash-style=both
++LDFLAGS.so += $(hashstyle-LDFLAGS)
++LDFLAGS-rtld += $(hashstyle-LDFLAGS)
++
+ ifeq (no,$(build-pie-default))
+ pie-default = $(no-pie-ccflag)
+ else # build-pie-default
+diff --git a/Makerules b/Makerules
+index d1e139d03c..44134e37ce 100644
+--- a/Makerules
++++ b/Makerules
+@@ -558,6 +558,9 @@ $(common-objpfx)shlib.lds: $(common-objpfx)config.make $(..)Makerules
+ 		  -Wl,--verbose 2>/dev/null | \
+ 	  sed > $@T \
+ 	      -e '/^=========/,/^=========/!d;/^=========/d' \
++		   -e 's/^.*\.gnu\.hash[ 	]*:.*$$/  .note.ABI-tag : { *(.note.ABI-tag) } &/' \
++		   -e '/^[ 	]*\.hash[ 	]*:.*$$/{h;d;}' \
++		   -e '/DATA_SEGMENT_ALIGN/{H;g}' \
+ 	      -e 's/^.*\*(\.dynbss).*$$/& \
+ 		 PROVIDE(__start___libc_freeres_ptrs = .); \
+ 		 *(__libc_freeres_ptrs) \
+-- 
+2.37.3
+
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..6cd4c0980cbb 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,16 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
+_patchver="72-g0f90d6204d"
+wrksrc="glibc-${version}-${_patchver}"
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
-distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+distfiles="https://vasilek.cz/paste/glibc-${version}-${_patchver}.tar.xz"
+checksum=656200722d5ba968b4888a2d2950719d72c86290fd0479f61897d25b7db2cb57
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +22,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +57,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +165,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From 770f60dde3ebf8bffa023494050a5e39d9aa7e10 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 07/37] musl: add support for SIGEV_THREAD_ID timers

https://git.musl-libc.org/cgit/musl/commit/?id=7c71792e87691451f2a6b76348e83ad1889f1dcb
---
 ...d-support-for-SIGEV_THREAD_ID-timers.patch | 74 +++++++++++++++++++
 srcpkgs/musl/template                         |  2 +-
 2 files changed, 75 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch

diff --git a/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
new file mode 100644
index 000000000000..e20dff5ba0d4
--- /dev/null
+++ b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
@@ -0,0 +1,74 @@
+From 7c71792e87691451f2a6b76348e83ad1889f1dcb Mon Sep 17 00:00:00 2001
+From: James Y Knight <jyknight@google.com>
+Date: Sun, 30 Jun 2019 21:55:20 -0400
+Subject: [PATCH] add support for SIGEV_THREAD_ID timers
+
+This is like SIGEV_SIGNAL, but targeted to a particular thread's
+tid, rather than the process.
+---
+ include/signal.h        | 16 +++++++++++++---
+ src/time/timer_create.c |  8 ++++++--
+ 2 files changed, 19 insertions(+), 5 deletions(-)
+
+diff --git a/include/signal.h b/include/signal.h
+index fbdf667b2..9ed929e4f 100644
+--- a/include/signal.h
++++ b/include/signal.h
+@@ -180,14 +180,24 @@ struct sigevent {
+ 	union sigval sigev_value;
+ 	int sigev_signo;
+ 	int sigev_notify;
+-	void (*sigev_notify_function)(union sigval);
+-	pthread_attr_t *sigev_notify_attributes;
+-	char __pad[56-3*sizeof(long)];
++	union {
++		char __pad[64 - 2*sizeof(int) - sizeof(union sigval)];
++		pid_t sigev_notify_thread_id;
++		struct {
++			void (*sigev_notify_function)(union sigval);
++			pthread_attr_t *sigev_notify_attributes;
++		} __sev_thread;
++	} __sev_fields;
+ };
+ 
++#define sigev_notify_thread_id __sev_fields.sigev_notify_thread_id
++#define sigev_notify_function __sev_fields.__sev_thread.sigev_notify_function
++#define sigev_notify_attributes __sev_fields.__sev_thread.sigev_notify_attributes
++
+ #define SIGEV_SIGNAL 0
+ #define SIGEV_NONE 1
+ #define SIGEV_THREAD 2
++#define SIGEV_THREAD_ID 4
+ 
+ int __libc_current_sigrtmin(void);
+ int __libc_current_sigrtmax(void);
+diff --git a/src/time/timer_create.c b/src/time/timer_create.c
+index 5ddfda278..4bef23905 100644
+--- a/src/time/timer_create.c
++++ b/src/time/timer_create.c
+@@ -71,11 +71,15 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 	switch (evp ? evp->sigev_notify : SIGEV_SIGNAL) {
+ 	case SIGEV_NONE:
+ 	case SIGEV_SIGNAL:
++	case SIGEV_THREAD_ID:
+ 		if (evp) {
+ 			ksev.sigev_value = evp->sigev_value;
+ 			ksev.sigev_signo = evp->sigev_signo;
+ 			ksev.sigev_notify = evp->sigev_notify;
+-			ksev.sigev_tid = 0;
++			if (evp->sigev_notify == SIGEV_THREAD_ID)
++				ksev.sigev_tid = evp->sigev_notify_thread_id;
++			else
++				ksev.sigev_tid = 0;
+ 			ksevp = &ksev;
+ 		}
+ 		if (syscall(SYS_timer_create, clk, ksevp, &timerid) < 0)
+@@ -107,7 +111,7 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 
+ 		ksev.sigev_value.sival_ptr = 0;
+ 		ksev.sigev_signo = SIGTIMER;
+-		ksev.sigev_notify = 4; /* SIGEV_THREAD_ID */
++		ksev.sigev_notify = SIGEV_THREAD_ID;
+ 		ksev.sigev_tid = td->tid;
+ 		if (syscall(SYS_timer_create, clk, &ksev, &timerid) < 0)
+ 			timerid = -1;
diff --git a/srcpkgs/musl/template b/srcpkgs/musl/template
index 34e6ed4fba6e..afb33cd868b5 100644
--- a/srcpkgs/musl/template
+++ b/srcpkgs/musl/template
@@ -2,7 +2,7 @@
 pkgname=musl
 reverts="1.2.0_1"
 version=1.1.24
-revision=11
+revision=12
 archs="*-musl"
 bootstrap=yes
 build_style=gnu-configure

From 11beec7338edb9fa4a8fec22ac75934959708acb Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 08/37] gcc-multilib: update to 12.2.0.

---
 srcpkgs/gcc-multilib/template | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index f28eb237c287..ba9bafcadfd6 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,15 +3,15 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _majorver="${version%.*}"
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel
@@ -70,7 +70,7 @@ do_build() {
 	make ${makejobs}
 }
 do_install() {
-	local _pc_triplet=x86_64-pc-linux-gnu _version=${version%pre1}
+	local _pc_triplet=x86_64-pc-linux-gnu
 	# Install to a tempdir and then only copy relevant files.
 	cd ${wrksrc}
 	make DESTDIR=${wrksrc}/${pkgname}-build install
@@ -80,9 +80,9 @@ do_install() {
 	vmkdir usr/include/c++/${_majorver}/${_triplet}
 	vmkdir usr/lib/gcc/${_triplet}/${_majorver}
 
-	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${_version}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${version}/32 \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_majorver}/
-	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${_version}/${_pc_triplet}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${version}/${_pc_triplet}/32 \
 		${DESTDIR}/usr/include/c++/${_majorver}/${_triplet}
 
 	vinstall ${wrksrc}/host-${_pc_triplet}/gcc/specs 644 usr/lib/gcc/${_triplet}/${_majorver}

From ad22a84884214075dcd980e4092b0ee2ab611f07 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 09/37] libgccjit: update to 12.2.0.

---
 srcpkgs/libgccjit/files/libgccjit-musl.patch | 63 --------------------
 srcpkgs/libgccjit/template                   | 24 +++-----
 2 files changed, 9 insertions(+), 78 deletions(-)
 delete mode 100644 srcpkgs/libgccjit/files/libgccjit-musl.patch

diff --git a/srcpkgs/libgccjit/files/libgccjit-musl.patch b/srcpkgs/libgccjit/files/libgccjit-musl.patch
deleted file mode 100644
index d2ed16928c82..000000000000
--- a/srcpkgs/libgccjit/files/libgccjit-musl.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-diff --git a/gcc/jit/jit-playback.c b/gcc/jit/jit-playback.c
-index 5bccf591a..35f5e35ef 100644
---- a/gcc/jit/jit-playback.c
-+++ b/gcc/jit/jit-playback.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -41,8 +43,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "diagnostic.h"
- #include "stmt.h"
- 
--#include <pthread.h>
--
- #include "jit-playback.h"
- #include "jit-result.h"
- #include "jit-builtins.h"
-diff --git a/gcc/jit/jit-recording.c b/gcc/jit/jit-recording.c
-index a237d574f..5785e3269 100644
---- a/gcc/jit/jit-recording.c
-+++ b/gcc/jit/jit-recording.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -25,8 +27,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "pretty-print.h"
- #include "toplev.h"
- 
--#include <pthread.h>
--
- #include "jit-builtins.h"
- #include "jit-recording.h"
- #include "jit-playback.h"
-diff --git a/gcc/jit/libgccjit.c b/gcc/jit/libgccjit.c
-index f9c33c63c..75f21d275 100644
---- a/gcc/jit/libgccjit.c
-+++ b/gcc/jit/libgccjit.c
-@@ -18,13 +18,13 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
- #include "timevar.h"
- #include "typed-splay-tree.h"
- #include "cppbuiltin.h"
--#include <pthread.h>
- 
- #include "libgccjit.h"
- #include "jit-recording.h"
diff --git a/srcpkgs/libgccjit/template b/srcpkgs/libgccjit/template
index 0b37c3ee9f8b..fde1affd54b7 100644
--- a/srcpkgs/libgccjit/template
+++ b/srcpkgs/libgccjit/template
@@ -3,18 +3,12 @@
 # which use the version number.
 
 pkgname=libgccjit
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
+version=12.2.0
 revision=1
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
-_majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 create_wrksrc=yes
 short_desc="Just-In-Time Compilation library for GCC"
 maintainer="Lane Biocini <lane@mailbox.org>"
@@ -22,16 +16,16 @@ homepage="https://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 nopie=yes
 lib32disabled=yes
 makedepends="zlib-devel"

From 7ff00ea06f2f5d6a9502cc372fa05b746db850da Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 10/37] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove -no-pie from build. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..f7e02dbc48cb 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -53,6 +53,7 @@ _void_cross_build_binutils() {
 		--sbindir=/usr/bin \
 		--libdir=/usr/lib \
 		--libexecdir=/usr/lib \
+		--sysconfdir=/etc \
 		--target=${tgt} \
 		--with-sysroot=/usr/${tgt} \
 		--disable-nls \
@@ -60,7 +61,9 @@ _void_cross_build_binutils() {
 		--disable-multilib \
 		--disable-werror \
 		--disable-gold \
+		--disable-gprofng \
 		--enable-relro \
+		--enable-new-dtags \
 		--enable-plugins \
 		--enable-64-bit-bfd \
 		--enable-deterministic-archives \
@@ -91,6 +94,9 @@ _void_cross_build_bootstrap_gcc() {
 	# Do not run fixincludes
 	sed -i 's@./fixinc.sh@-c true@' Makefile.in
 
+	# Do not use system headers to determine clocale implementation
+	sed -i 's/#if (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined(__UCLIBC__)/#if 1/g' libstdc++-v3/configure
+
 	for f in ${XBPS_SRCPKGDIR}/gcc/patches/*.patch; do
 		_void_cross_apply_patch "$f"
 	done
@@ -132,6 +138,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -381,6 +388,7 @@ _void_cross_build_gcc() {
 		extra_args+=" --disable-gnu-unique-object"
 		extra_args+=" libat_cv_have_ifunc=no"
 	else
+		extra_args+=" --enable-clocale=gnu"
 		extra_args+=" --enable-gnu-unique-object"
 	fi
 
@@ -460,6 +468,14 @@ do_build() {
 	local binutils_ver linux_ver gcc_ver libc_ver libucontext_ver
 	local tgt=${sourcepkg/cross-}
 
+	export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}"
+	export CXXFLAGS="${CXXFLAGS/-D_FORTIFY_SOURCE=2/}"
+
+	# Disable explicit -fno-PIE, gcc/binutils/libc will figure this out itself.
+	export CFLAGS="${CFLAGS//-fno-PIE/}"
+	export CXXFLAGS="${CXXFLAGS//-fno-PIE/}"
+	export LDFLAGS="${LDFLAGS//-no-pie/}"
+
 	_void_cross_test_ver binutils
 	_void_cross_test_ver linux
 	_void_cross_test_ver gcc
@@ -625,6 +641,9 @@ do_install() {
 	# then remove it because it conflicts with libquadmath package
 	rm -rf ${DESTDIR}/${sysroot}/usr/lib/libquadmath.*
 
+	# Remove libdep linker plugin because it conflicts with system binutils
+	rm -f ${DESTDIR}/usr/lib/bfd-plugins/libdep*
+
 	# Remove leftover symlinks
 	rm -f ${DESTDIR}/usr/lib${XBPS_TARGET_WORDSIZE}
 	rm -f ${DESTDIR}/lib*

From 77b2a535a46e8a9407a117945bd457b1ad283b66 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 11/37] qemu: remove broken patch

The necessary patch has been imported into musl so no need
to cast the sigevent struct to a more glibc-like one.
---
 .../musl-fix-sigevent-and-sigval_t.patch      | 27 -------------------
 1 file changed, 27 deletions(-)
 delete mode 100644 srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch

diff --git a/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch b/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch
deleted file mode 100644
index 4b4f1117c15f..000000000000
--- a/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-Note: Remove this patch with musl 1.2.2
-
---- a/linux-user/syscall.c
-+++ b/linux-user/syscall.c
-@@ -5020,10 +5020,21 @@
- #ifndef HAVE_SIGEV_NOTIFY_THREAD_ID
- #define sigev_notify_thread_id _sigev_un._tid
- #endif
- 
--static inline abi_long target_to_host_sigevent(struct sigevent *host_sevp,
-+struct host_sigevent {
-+    union sigval sigev_value;
-+    int sigev_signo;
-+    int sigev_notify;
-+    union {
-+       char _pad[64 - sizeof(int) * 2 - sizeof(union sigval)];
-+       int _tid;
-+    } _sigev_un;
-+};
-+
-+static inline abi_long target_to_host_sigevent(struct sigevent *sevp,
-                                                abi_ulong target_addr)
- {
-+    struct host_sigevent *host_sevp = (struct host_sigevent *) sevp;
-     struct target_sigevent *target_sevp;
- 
-     if (!lock_user_struct(VERIFY_READ, target_sevp, target_addr, 1)) {

From 9a9e753ca2cd251c70363b53274d837e929e3bde Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 19 Nov 2022 13:26:24 -0800
Subject: [PATCH 12/37] mk-configure: rebuild for gcc 12

---
 srcpkgs/mk-configure/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/mk-configure/template b/srcpkgs/mk-configure/template
index 9d12f11a9799..c50d8adf213f 100644
--- a/srcpkgs/mk-configure/template
+++ b/srcpkgs/mk-configure/template
@@ -1,7 +1,7 @@
 # Template file for 'mk-configure'
 pkgname=mk-configure
 version=0.37.0
-revision=1
+revision=2
 build_style=gnu-makefile
 make_cmd=bmake
 make_install_args="MANDIR=/usr/share/man"

From 1ea203ef862d50b551b10f6cec417fd2b1920a96 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 13/37] cross-aarch64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..9e6fb75c198d 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Leah Neukirchen <leah@vuxu.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From ae9cedc5cd53be0897020c8e0b416d258baf296d Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 14/37] cross-aarch64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..ba14c96bccea 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From b7d7795d1734d78b0c11086ca4e45aab9bb25e58 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 15/37] cross-arm-linux-gnueabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..5c774e16f430 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From f74cb38e2cafdbe2084b0360fa686555714c1682 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 16/37] cross-arm-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..d6298ab639a4 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 3f597d1589a2d2b34acca03cfcd9ac60c06cd087 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 17/37] cross-arm-linux-musleabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..24df78e8fd8e 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From d0dd25f19018a96d07c0dab125b2cede3dee44a2 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 18/37] cross-arm-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..8093700f909c 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 292796b9ad78f3ab74340c2d4648d9e452e9da36 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 19/37] cross-armv7l-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..92665326428b 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 2b958036b9400c0392c75b79eee1535a4ebf736a Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 20/37] cross-armv7l-linux-musleabihf: update to gcc 12.2.0.

---
 .../cross-armv7l-linux-musleabihf/template    | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..e5af2c9ccbf2 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From a9fd69432974c26bd50148126b4501522eae4e52 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 21/37] cross-i686-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-i686-linux-musl/template b/srcpkgs/cross-i686-linux-musl/template
index 8be16a230d8d..d624bb7a3254 100644
--- a/srcpkgs/cross-i686-linux-musl/template
+++ b/srcpkgs/cross-i686-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-i686-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-i686-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 5b89e37cf1ff5555791485708790ff643af50496 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 22/37] cross-i686-pc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..6a9e54db807a 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,14 +1,15 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -16,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 4409a7c315cfe87aa2c8bb6369718bd79001c6c0 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 23/37] cross-mips-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-musl/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..67a5c413396c 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 9061cc66cc68209648cd202eff6b0f156e3a7036 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 24/37] cross-mips-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..bdf8600ce95b 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="hipperson0 <hipperson0@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 482c0ae63504d080e6cc79abca741c805faa2d1e Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 25/37] cross-mipsel-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..de49387d517b 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 8015afdd5dd53530a92134d725e91d9e001a80c8 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 26/37] cross-mipsel-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..b27ce6475a38 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 73dfcd258e4c742d7c946c4a824534e39709db37 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 27/37] cross-powerpc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..79579e093b12 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From a581478dfed8deb8b232230fb317817089fb03b6 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 28/37] cross-powerpc-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..9bb6acd359b6 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 977b8367682b2ef40b43dcb630c74b0a28dbec1f Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 29/37] cross-powerpc64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..2d153d00add6 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,16 +1,17 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
  --enable-targets=powerpc-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -18,12 +19,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From a63b09295b4713dcc2cf95a3c4ce1acebe75aa57 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 30/37] cross-powerpc64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 016f18776a6d..e0848fe0bff7 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,30 +1,31 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From c2c90a0e0aa42c3b15e58cd8101d640dc0ded473 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 31/37] cross-powerpc64le-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 463d7e92d20d..8d8e010e15c0 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,16 +1,17 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
  --enable-targets=powerpcle-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -18,12 +19,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 1d5d902c896defdd83ac497ee6070a03904a895a Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 32/37] cross-powerpc64le-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index c17a3cccfe29..0915e524545f 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,30 +1,31 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 4d00ac12b97a0d7b82bff2d3d120ae8cc8819af4 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 33/37] cross-powerpcle-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 9aede3c465ce..687be8a44c6c 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 
@@ -35,6 +36,8 @@ if [ "$XBPS_TARGET_MACHINE" = "ppcle" ]; then
 	broken="Can't build crosstoolchain to itself"
 fi
 
+broken="glibc uses big-endian specific instructions on 32-bit powerpc"
+
 cross-powerpcle-linux-gnu-libc_package() {
 	short_desc+=" - glibc files"
 	nostrip=yes

From 7232ddf3f88c13b000db906690d6bedce1cacd12 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 34/37] cross-powerpcle-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index 045cfda987fe..bb984b9c42eb 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 406ed5c38d06ada806c0572801b6dd78b131de9a Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:30 -0800
Subject: [PATCH 35/37] cross-x86_64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 8918f3c22a1c..930aaf2a508b 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,14 +1,15 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -16,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 114feb859f3031bfab8356c2a8dc3d70e614bf81 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:30 -0800
Subject: [PATCH 36/37] cross-x86_64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..ac5b1c46ab82 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 7bef45aaabc94ae6649833bfaf9f13ad58705fb3 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Fri, 18 Nov 2022 02:01:19 -0800
Subject: [PATCH 37/37] cross-vpkg-dummy: update to 0.39.

---
 srcpkgs/cross-vpkg-dummy/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/cross-vpkg-dummy/template b/srcpkgs/cross-vpkg-dummy/template
index d83e38dc63ac..aeafb749dd5f 100644
--- a/srcpkgs/cross-vpkg-dummy/template
+++ b/srcpkgs/cross-vpkg-dummy/template
@@ -1,6 +1,6 @@
 # Template file for 'cross-vpkg-dummy'
 pkgname=cross-vpkg-dummy
-version=0.38
+version=0.39
 revision=1
 build_style=meta
 short_desc="Dummy meta-pkg for cross building packages with xbps-src"
@@ -54,8 +54,8 @@ conflicts="
 	gcc-objc++>=0"
 shlib_provides="
 	libgcc_s.so.1
-	libgnat-10.so
-	libgnarl-10.so
+	libgnat-12.so
+	libgnarl-12.so
 	libstdc++.so.6
 	libgfortran.so.5"
 

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (240 preceding siblings ...)
  2022-11-21 18:24 ` oreo639
@ 2022-11-28 19:06 ` oreo639
  2022-12-04 20:13 ` oreo639
                   ` (22 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-11-28 19:06 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5448 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.2.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.2.0

There is a list of failing builds here: https://github.com/void-linux/void-packages/issues/39809

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [x] llvm https://github.com/void-linux/void-packages/pull/38694
- [x] m4 https://github.com/void-linux/void-packages/pull/33730
- [x] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [x] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [x] libvirt https://github.com/void-linux/void-packages/pull/38842
- [x] syslinux https://github.com/void-linux/void-packages/pull/38876
- [x] efivar https://github.com/void-linux/void-packages/pull/38874
- [x] gpgme https://github.com/void-linux/void-packages/pull/38825

Known packages that needed to be fixed/updated for gcc12:
- [x] openssh https://github.com/void-linux/void-packages/pull/38849
- [x] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [x] doxygen https://github.com/void-linux/void-packages/pull/38846
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] libproxy https://github.com/void-linux/void-packages/pull/38818
- [x] exempi https://github.com/void-linux/void-packages/pull/38820
- [x] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [x] libunique1 https://github.com/void-linux/void-packages/pull/38848 or https://github.com/void-linux/void-packages/pull/38873
- [x] libwpd https://github.com/void-linux/void-packages/pull/38878
- [x] cglm https://github.com/void-linux/void-packages/pull/39748
- [x] coreboot-utils https://github.com/void-linux/void-packages/pull/39749
- [x] apl https://github.com/void-linux/void-packages/pull/39750
- [x] igt-gpu-tools https://github.com/void-linux/void-packages/pull/39780

Needs to be fixed/updated for binutils:
- [x] grub https://github.com/void-linux/void-packages/pull/38875
- [x] linux-tools https://github.com/void-linux/void-packages/pull/38877
- [x] kcov https://github.com/void-linux/void-packages/pull/39291

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [x] kde
- [x] lxde
- [x] lxqt

You can test the ISOs here:
https://drive.google.com/drive/folders/1ix92CYSLUP-KWjLxltdgG4e8Nu2JCY5n?usp=sharing

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 128293 bytes --]

From 647d83b69f6f9ec362d5dc43171ef63cc18946f7 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 01/37] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../fix-libcollector-without-java.patch       | 53 +++++++++++++++
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 25 ++++---
 4 files changed, 87 insertions(+), 117 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
 create mode 100644 srcpkgs/binutils/patches/fix-libcollector-without-java.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/fix-libcollector-without-java.patch b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
new file mode 100644
index 000000000000..54384875f358
--- /dev/null
+++ b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
@@ -0,0 +1,53 @@
+From 49ddd814ac1071af7c4f45d5f8398b91862f2c7f Mon Sep 17 00:00:00 2001
+From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
+Date: Wed, 17 Aug 2022 19:55:23 -0700
+Subject: [PATCH] gprofng: fix bug 29479 Collection fails when built without
+ java support
+
+gprofng/ChangeLog
+2022-08-17  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>
+
+	PR gprofng/29479
+	* libcollector/collector.c: Add #if defined(GPROFNG_JAVA_PROFILING) for
+	java specific code.
+	* libcollector/unwind.c: Likewise.
+---
+ gprofng/libcollector/collector.c | 2 ++
+ gprofng/libcollector/unwind.c    | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/gprofng/libcollector/collector.c b/gprofng/libcollector/collector.c
+index 93c9d3330de5..ceff2c1caccb 100644
+--- a/gprofng/libcollector/collector.c
++++ b/gprofng/libcollector/collector.c
+@@ -913,8 +913,10 @@ __collector_open_experiment (const char *exp, const char *params, sp_origin_t or
+   __collector_ext_unwind_key_init (1, NULL);
+ 
+   /* start java attach if suitable */
++#if defined(GPROFNG_JAVA_PROFILING)
+   if (exp_origin == SP_ORIGIN_DBX_ATTACH)
+     __collector_jprofile_start_attach ();
++#endif
+   start_sec_time = CALL_UTIL (time)(NULL);
+   __collector_start_time = collector_interface.getHiResTime ();
+   TprintfT (DBG_LT0, "\t__collector_open_experiment; resetting start_time\n");
+diff --git a/gprofng/libcollector/unwind.c b/gprofng/libcollector/unwind.c
+index 119243788020..f8e11823c81e 100644
+--- a/gprofng/libcollector/unwind.c
++++ b/gprofng/libcollector/unwind.c
+@@ -557,6 +557,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+   int size = max_frame_size;
+ 
+ #define MIN(a,b) ((a)<(b)?(a):(b))
++#if defined(GPROFNG_JAVA_PROFILING)
+   /* get Java info */
+   if (__collector_java_mode && __collector_java_asyncgetcalltrace_loaded && context && !pseudo_context)
+     {
+@@ -569,6 +570,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+ 	  size -= sz;
+ 	}
+     }
++#endif
+ 
+   /* get native stack */
+   if (context)
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..c355a5fc8016 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkgconf"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -35,15 +36,21 @@ do_configure() {
 	local conf
 
 	if [ "$CHROOT_READY" ]; then
-		conf+=" --with-debuginfod"
+		conf+=" --with-debuginfod --enable-shared"
 	else
-		conf+=" --without-debuginfod --disable-install-libbfd"
+		conf+=" --without-debuginfod --disable-shared --disable-install-libbfd"
 	fi
 	if [ "$CROSS_BUILD" ]; then
 		# we don't want --with-sysroot=${XBPS_CROSS_BASE} like gnu-configure
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	# gprofng currently only supports x86 and aarch64 glibc.
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64|i386|aarch64) conf+=" --enable-gprofng" ;;
+		*) conf+=" --disable-gprofng" ;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"
@@ -76,13 +83,14 @@ do_configure() {
 		--libdir=/usr/lib \
 		--mandir=/usr/share/man \
 		--infodir=/usr/share/info \
+		--sysconfdir=/etc \
 		--disable-werror \
-		--disable-shared \
 		--disable-nls \
 		--enable-threads \
 		--enable-plugins \
 		--enable-relro \
 		--enable-gold \
+		--enable-new-dtags \
 		--enable-deterministic-archives \
 		--enable-64-bit-bfd \
 		--enable-ld=default \
@@ -142,7 +150,8 @@ binutils-devel_package() {
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/*.a"
-		vmove "usr/lib/*.so"
+		vmove "usr/lib/libbfd.so"
+		vmove "usr/lib/libopcodes.so"
 	}
 }
 

From acebba575df5e434b0b4aa52835b2c1c977970b8 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 02/37] gdb: resolve conflict with binutils 2.39

---
 srcpkgs/gdb/template | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/gdb/template b/srcpkgs/gdb/template
index 9c5f17ffc519..b666348fea19 100644
--- a/srcpkgs/gdb/template
+++ b/srcpkgs/gdb/template
@@ -1,7 +1,7 @@
 # Template file for 'gdb'
 pkgname=gdb
 version=12.1
-revision=2
+revision=3
 build_style=gnu-configure
 pycompile_dirs="/usr/share/gdb/python"
 configure_args="--disable-werror --disable-nls --with-system-readline
@@ -48,7 +48,8 @@ vopt_conflict debuginfod static
 
 post_install() {
 	# resolve conflicts with binutils
-	rm -r ${DESTDIR}/usr/{include,lib,share/info/bfd.info*}
+	rm -rf ${DESTDIR}/usr/{include,lib}
+	rm -rf ${DESTDIR}/usr/share/info/{bfd,ctf-spec}.info*
 }
 
 gdb-common_package() {

From cec0e7bc58b966f36f3510220644199a943c430f Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 03/37] gcc: update to 12.2.0.

---
 common/shlibs                                 | 10 +--
 srcpkgs/gcc/files/gccgo-musl.patch            | 71 +++------------
 srcpkgs/gcc/files/libgnarl-musl.patch         | 18 ++--
 srcpkgs/gcc/files/libssp-musl.patch           | 10 +--
 .../gcc/patches/force-override-clocale.patch  | 21 +++++
 srcpkgs/gcc/patches/libffi_gnulinux.patch     | 11 ---
 .../gcc/patches/libgcc-ibm128-no-tag.patch    | 10 ++-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |  2 +-
 srcpkgs/gcc/template                          | 87 +++++++++----------
 9 files changed, 101 insertions(+), 139 deletions(-)
 create mode 100644 srcpkgs/gcc/patches/force-override-clocale.patch
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index fc5bb4dda7e6..4bb4c7ab1e3b 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.2.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.36 perl-5.36.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -857,8 +857,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.2.0_1
+libgnat-12.so libada-12.2.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1710,8 +1710,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.2.0_1
+libasan.so.8 libsanitizer-12.2.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..12ec68dd8aa3 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,14 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ b/libgo/go/runtime/os_linux.go
+@@ -365,7 +365,7 @@ func setThreadCPUProfiler(hz int32) {
+ 	var sevp _sigevent
+ 	sevp.sigev_notify = _SIGEV_THREAD_ID
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.__sev_fields))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/force-override-clocale.patch b/srcpkgs/gcc/patches/force-override-clocale.patch
new file mode 100644
index 000000000000..8af8a7150dd9
--- /dev/null
+++ b/srcpkgs/gcc/patches/force-override-clocale.patch
@@ -0,0 +1,21 @@
+This is necessary when building a gnu cross compiler for a musl target.
+Otherwise, even if clocale manually is set to gnu, it will be reset to generic
+when the test is performed using AC_EGREP_CPP().
+--- a/libstdc++-v3/configure
++++ b/libstdc++-v3/configure
+@@ -16493,6 +16493,7 @@ fi
+ 
+   # Sanity check model, and test for special functionality.
+   if test $enable_clocale_flag = gnu; then
++    if test $enable_clocale = auto; then
+     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+ 
+@@ -16509,6 +16510,7 @@ else
+   enable_clocale_flag=generic
+ fi
+ rm -f conftest*
++    fi
+ 
+ 
+     # Set it to scream when it hurts.
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index ab3643de4f98..a20af7c0ef2e 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,14 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
+version=12.2.0
+revision=1
+_minorver="${version%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 create_wrksrc=yes
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +18,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -52,8 +48,11 @@ if [ "$CHROOT_READY" ]; then
 	hostmakedepends="tar texinfo perl flex"
 else
 	_have_gccgo=no
+	# libzstd fails to link in bootstrap with glibc 2.36
+	# when zlib has been compiled with glibc 2.32.
+	LDFLAGS="-lzstd -pthread"
 fi
-makedepends="zlib-devel"
+makedepends="zlib-devel libzstd-devel"
 depends="binutils libgcc-devel-${version}_${revision}
  libstdc++-devel-${version}_${revision} libssp-devel-${version}_${revision}"
 checkdepends="dejagnu"
@@ -70,13 +69,13 @@ if [ "$build_option_gnatboot" ]; then
 	case "$XBPS_TARGET_MACHINE" in
 	x86_64)
 		_gnat_tarball="gnat-gpl-2017-x86_64-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/591c6d80c7a447af2deed1d7>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/9682e2e1f2f232ce03fe21d77b14c37a0de5649b?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" b942bcac20dea39748b39f8b624d9619f60a8dee2e8195dbe3829c835b0956e6"
 		build_options_default="gnatboot"
 		;;
 	i686)
 		_gnat_tarball="gnat-gpl-2014-x86-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/564b3e9dc8e196b040fbe248>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/c5e9e6fdff5cb77ed90cf8c62536653e27c0bed6?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" 3b693510f5d22a240abb3034934c1adbd80ccd6e4f61a4f491cc408fdfd9c042"
 		build_options_default="gnatboot"
 		;;
@@ -155,8 +154,8 @@ if [ "$CROSS_BUILD" ]; then
 fi
 
 post_extract() {
-	mv gcc-${version/pre/_pre}/* gcc-${version/pre/_pre}/.??* .
-	rmdir gcc-${version/pre/_pre}
+	mv gcc-${version}/* gcc-${version}/.??* .
+	rmdir gcc-${version}
 	mv gmp-${_gmp_version} gmp
 	mv mpfr-${_mpfr_version} mpfr
 	mv mpc-${_mpc_version} mpc
@@ -186,9 +185,9 @@ pre_configure() {
 	sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
 
 	if [ "$XBPS_TARGET_LIBC" = musl ]; then
-		patch -p1 -i ${FILESDIR}/libgnarl-musl.patch
-		patch -p1 -i ${FILESDIR}/libssp-musl.patch
-		patch -p1 -i ${FILESDIR}/gccgo-musl.patch
+		for p in ${FILESDIR}/*-musl.patch; do
+			patch -p1 -i $p
+		done
 	fi
 }
 do_configure() {
@@ -343,16 +342,16 @@ do_install() {
 
 	# Make version a symlink of major version to make all versions
 	# from the same series work automagically.
-	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver} \
+	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${version} \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver}
 	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver} \
-		${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}
+		${DESTDIR}/usr/lib/gcc/${_triplet}/${version}
 
 	# Ditto for c++ headers.
-	mv ${DESTDIR}/usr/include/c++/${_patchver} \
+	mv ${DESTDIR}/usr/include/c++/${version} \
 		${DESTDIR}/usr/include/c++/${_minorver}
 	ln -sfr ${DESTDIR}/usr/include/c++/${_minorver} \
-		${DESTDIR}/usr/include/c++/${_patchver}
+		${DESTDIR}/usr/include/c++/${version}
 
 	# cc symlink
 	ln -sfr ${DESTDIR}/usr/bin/gcc ${DESTDIR}/usr/bin/cc
@@ -361,7 +360,7 @@ do_install() {
 
 	# lto plugin symlink
 	vmkdir usr/lib/bfd-plugins
-	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}/liblto_plugin.so \
+	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${version}/liblto_plugin.so \
 		${DESTDIR}/usr/lib/bfd-plugins
 
 	# Remove "fixed" header
@@ -372,13 +371,9 @@ do_install() {
 	rm -f ${DESTDIR}/usr/lib/libffi*
 	rm -f ${DESTDIR}/usr/share/man/man3/ffi*
 
-	# Remove all python scripts in libdir.
-	rm -f ${DESTDIR}/usr/lib/*.py
-
-	# Remove more python stuff.
-	if [ -d ${DESTDIR}/usr/share/gcc-${_patchver}/python ]; then
-		rm -rf ${DESTDIR}/usr/share/gcc-${_patchver}/python
-	fi
+	# Move libstdc++ gdb helpers to location where gdb can autoload them
+	mkdir -p ${DESTDIR}/usr/share/gdb/auto-load/usr/lib
+	mv ${DESTDIR}/usr/lib/*.py ${DESTDIR}/usr/share/gdb/auto-load/usr/lib
 
 	# Install c89 and c99 wrappers and its manpages, from NetBSD.
 	for f in c89 c99; do
@@ -397,7 +392,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}
@@ -450,7 +445,7 @@ gcc-fortran_package() {
 		if [ "$CROSS_BUILD" ]; then
 			# A number of OMP modules are not built when cross
 			# compiling gcc. Copy them from the cross compiler.
-			local src="/usr/lib/gcc/${_triplet}/${_patchver}/finclude"
+			local src="/usr/lib/gcc/${_triplet}/${version}/finclude"
 			local dst="usr/lib/gcc/${_triplet}/${_minorver}/finclude"
 			for f in omp_lib.f90 omp_lib.h omp_lib.mod omp_lib_kinds.mod \
 				openacc.f90 openacc.mod openacc_kinds.mod openacc_lib.h; do
@@ -517,7 +512,7 @@ libgfortran_package() {
 	short_desc+=" - Fortran library"
 	pkg_install() {
 		vmove "usr/lib/libgfortran.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -538,7 +533,7 @@ libgo_package() {
 	nostrip=yes
 	pkg_install() {
 		vmove "usr/lib/libgo.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -554,7 +549,7 @@ libobjc_package() {
 	short_desc+=" - Objective-C library"
 	pkg_install() {
 		vmove "usr/lib/libobjc.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -573,7 +568,7 @@ libquadmath_package() {
 	short_desc+=" - quadmath library"
 	pkg_install() {
 		vmove "usr/lib/libquadmath.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -615,7 +610,7 @@ libgcc_package() {
 	noverifyrdeps=yes
 	pkg_install() {
 		vmove "usr/lib/libgcc_s.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -646,7 +641,7 @@ libgomp_package() {
 	short_desc+=" - OpenMP v4.0 library"
 	pkg_install() {
 		vmove "usr/lib/libgomp*.so.*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -701,7 +696,7 @@ libssp_package() {
 	short_desc+=" - SSP (StackSmashingProtection) library"
 	pkg_install() {
 		vmove "usr/lib/libssp.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -718,7 +713,9 @@ libstdc++-devel_package() {
 libstdc++_package() {
 	short_desc+=" - Standard C++ Library"
 	pkg_install() {
+		vmove usr/share/gdb
+		vmove usr/share/gcc-${version}/python
 		vmove "usr/lib/libstdc++.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }

From 906dec0220945f28007248e2412f4b7b97eda875 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 04/37] libtool: rebuild for gcc 12

---
 srcpkgs/libtool/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index fc5c53a9c3e9..aebad9294eef 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
 version=2.4.7
-revision=1
+revision=2
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"

From 892953565784a92ca842ced10998afe26edaa4e4 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 05/37] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 7e01bbb851fd..d9618e3806ba 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 build_wrksrc=libiberty
 build_style=gnu-configure
@@ -10,7 +10,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From 590dbfefeaaad3d19e0537d55859734f4605f0b2 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 06/37] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 ...e-hash-style-both-for-building-glibc.patch |  51 ++++
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  66 ++--
 4 files changed, 109 insertions(+), 354 deletions(-)
 create mode 100644 srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index 4bb4c7ab1e3b..5a0ad39c8da8 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch b/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
new file mode 100644
index 000000000000..9c5553e92609
--- /dev/null
+++ b/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
@@ -0,0 +1,51 @@
+Temporary workaround for EAC bug.
+
+See: https://sourceware.org/bugzilla/show_bug.cgi?id=29456
+
+From 8e90e2cc5e57d7ca3a40602d278e9642a8b66716 Mon Sep 17 00:00:00 2001
+From: oreo639 <oreo6391@gmail.com>
+Date: Tue, 13 Sep 2022 14:30:35 -0700
+Subject: [PATCH] Revert "Do not use --hash-style=both for building glibc
+ shared objects"
+
+This reverts commit e47de5cb2d4dbecb58f569ed241e8e95c568f03c.
+---
+ Makeconfig     |  9 +++++++++
+ Makerules      |  7 +++++++
+ 5 files changed, 61 insertions(+)
+
+diff --git a/Makeconfig b/Makeconfig
+index ba70321af1..e2131d4389 100644
+--- a/Makeconfig
++++ b/Makeconfig
+@@ -371,6 +371,13 @@ dt-relr-ldflag =
+ no-dt-relr-ldflag =
+ endif
+ 
++# For the time being we unconditionally use 'both'.  At some time we
++# should declare statically linked code as 'out of luck' and compile
++# with --hash-style=gnu only.
++hashstyle-LDFLAGS = -Wl,--hash-style=both
++LDFLAGS.so += $(hashstyle-LDFLAGS)
++LDFLAGS-rtld += $(hashstyle-LDFLAGS)
++
+ ifeq (no,$(build-pie-default))
+ pie-default = $(no-pie-ccflag)
+ else # build-pie-default
+diff --git a/Makerules b/Makerules
+index d1e139d03c..44134e37ce 100644
+--- a/Makerules
++++ b/Makerules
+@@ -558,6 +558,9 @@ $(common-objpfx)shlib.lds: $(common-objpfx)config.make $(..)Makerules
+ 		  -Wl,--verbose 2>/dev/null | \
+ 	  sed > $@T \
+ 	      -e '/^=========/,/^=========/!d;/^=========/d' \
++		   -e 's/^.*\.gnu\.hash[ 	]*:.*$$/  .note.ABI-tag : { *(.note.ABI-tag) } &/' \
++		   -e '/^[ 	]*\.hash[ 	]*:.*$$/{h;d;}' \
++		   -e '/DATA_SEGMENT_ALIGN/{H;g}' \
+ 	      -e 's/^.*\*(\.dynbss).*$$/& \
+ 		 PROVIDE(__start___libc_freeres_ptrs = .); \
+ 		 *(__libc_freeres_ptrs) \
+-- 
+2.37.3
+
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..6cd4c0980cbb 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,16 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
+_patchver="72-g0f90d6204d"
+wrksrc="glibc-${version}-${_patchver}"
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
-distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+distfiles="https://vasilek.cz/paste/glibc-${version}-${_patchver}.tar.xz"
+checksum=656200722d5ba968b4888a2d2950719d72c86290fd0479f61897d25b7db2cb57
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +22,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +57,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +165,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From b9816445eb6c3dcd183f542225a25a47df85bd66 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 07/37] musl: add support for SIGEV_THREAD_ID timers

https://git.musl-libc.org/cgit/musl/commit/?id=7c71792e87691451f2a6b76348e83ad1889f1dcb
---
 ...d-support-for-SIGEV_THREAD_ID-timers.patch | 74 +++++++++++++++++++
 srcpkgs/musl/template                         |  2 +-
 2 files changed, 75 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch

diff --git a/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
new file mode 100644
index 000000000000..e20dff5ba0d4
--- /dev/null
+++ b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
@@ -0,0 +1,74 @@
+From 7c71792e87691451f2a6b76348e83ad1889f1dcb Mon Sep 17 00:00:00 2001
+From: James Y Knight <jyknight@google.com>
+Date: Sun, 30 Jun 2019 21:55:20 -0400
+Subject: [PATCH] add support for SIGEV_THREAD_ID timers
+
+This is like SIGEV_SIGNAL, but targeted to a particular thread's
+tid, rather than the process.
+---
+ include/signal.h        | 16 +++++++++++++---
+ src/time/timer_create.c |  8 ++++++--
+ 2 files changed, 19 insertions(+), 5 deletions(-)
+
+diff --git a/include/signal.h b/include/signal.h
+index fbdf667b2..9ed929e4f 100644
+--- a/include/signal.h
++++ b/include/signal.h
+@@ -180,14 +180,24 @@ struct sigevent {
+ 	union sigval sigev_value;
+ 	int sigev_signo;
+ 	int sigev_notify;
+-	void (*sigev_notify_function)(union sigval);
+-	pthread_attr_t *sigev_notify_attributes;
+-	char __pad[56-3*sizeof(long)];
++	union {
++		char __pad[64 - 2*sizeof(int) - sizeof(union sigval)];
++		pid_t sigev_notify_thread_id;
++		struct {
++			void (*sigev_notify_function)(union sigval);
++			pthread_attr_t *sigev_notify_attributes;
++		} __sev_thread;
++	} __sev_fields;
+ };
+ 
++#define sigev_notify_thread_id __sev_fields.sigev_notify_thread_id
++#define sigev_notify_function __sev_fields.__sev_thread.sigev_notify_function
++#define sigev_notify_attributes __sev_fields.__sev_thread.sigev_notify_attributes
++
+ #define SIGEV_SIGNAL 0
+ #define SIGEV_NONE 1
+ #define SIGEV_THREAD 2
++#define SIGEV_THREAD_ID 4
+ 
+ int __libc_current_sigrtmin(void);
+ int __libc_current_sigrtmax(void);
+diff --git a/src/time/timer_create.c b/src/time/timer_create.c
+index 5ddfda278..4bef23905 100644
+--- a/src/time/timer_create.c
++++ b/src/time/timer_create.c
+@@ -71,11 +71,15 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 	switch (evp ? evp->sigev_notify : SIGEV_SIGNAL) {
+ 	case SIGEV_NONE:
+ 	case SIGEV_SIGNAL:
++	case SIGEV_THREAD_ID:
+ 		if (evp) {
+ 			ksev.sigev_value = evp->sigev_value;
+ 			ksev.sigev_signo = evp->sigev_signo;
+ 			ksev.sigev_notify = evp->sigev_notify;
+-			ksev.sigev_tid = 0;
++			if (evp->sigev_notify == SIGEV_THREAD_ID)
++				ksev.sigev_tid = evp->sigev_notify_thread_id;
++			else
++				ksev.sigev_tid = 0;
+ 			ksevp = &ksev;
+ 		}
+ 		if (syscall(SYS_timer_create, clk, ksevp, &timerid) < 0)
+@@ -107,7 +111,7 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 
+ 		ksev.sigev_value.sival_ptr = 0;
+ 		ksev.sigev_signo = SIGTIMER;
+-		ksev.sigev_notify = 4; /* SIGEV_THREAD_ID */
++		ksev.sigev_notify = SIGEV_THREAD_ID;
+ 		ksev.sigev_tid = td->tid;
+ 		if (syscall(SYS_timer_create, clk, &ksev, &timerid) < 0)
+ 			timerid = -1;
diff --git a/srcpkgs/musl/template b/srcpkgs/musl/template
index 34e6ed4fba6e..afb33cd868b5 100644
--- a/srcpkgs/musl/template
+++ b/srcpkgs/musl/template
@@ -2,7 +2,7 @@
 pkgname=musl
 reverts="1.2.0_1"
 version=1.1.24
-revision=11
+revision=12
 archs="*-musl"
 bootstrap=yes
 build_style=gnu-configure

From 920aa4a5a0b569b2d15713cf8e3f9d21f1347fce Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 08/37] gcc-multilib: update to 12.2.0.

---
 srcpkgs/gcc-multilib/template | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index f28eb237c287..ba9bafcadfd6 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,15 +3,15 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _majorver="${version%.*}"
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel
@@ -70,7 +70,7 @@ do_build() {
 	make ${makejobs}
 }
 do_install() {
-	local _pc_triplet=x86_64-pc-linux-gnu _version=${version%pre1}
+	local _pc_triplet=x86_64-pc-linux-gnu
 	# Install to a tempdir and then only copy relevant files.
 	cd ${wrksrc}
 	make DESTDIR=${wrksrc}/${pkgname}-build install
@@ -80,9 +80,9 @@ do_install() {
 	vmkdir usr/include/c++/${_majorver}/${_triplet}
 	vmkdir usr/lib/gcc/${_triplet}/${_majorver}
 
-	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${_version}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${version}/32 \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_majorver}/
-	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${_version}/${_pc_triplet}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${version}/${_pc_triplet}/32 \
 		${DESTDIR}/usr/include/c++/${_majorver}/${_triplet}
 
 	vinstall ${wrksrc}/host-${_pc_triplet}/gcc/specs 644 usr/lib/gcc/${_triplet}/${_majorver}

From 464128d261beb122facfc27c9101b80131dec11f Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 09/37] libgccjit: update to 12.2.0.

---
 srcpkgs/libgccjit/files/libgccjit-musl.patch | 63 --------------------
 srcpkgs/libgccjit/template                   | 24 +++-----
 2 files changed, 9 insertions(+), 78 deletions(-)
 delete mode 100644 srcpkgs/libgccjit/files/libgccjit-musl.patch

diff --git a/srcpkgs/libgccjit/files/libgccjit-musl.patch b/srcpkgs/libgccjit/files/libgccjit-musl.patch
deleted file mode 100644
index d2ed16928c82..000000000000
--- a/srcpkgs/libgccjit/files/libgccjit-musl.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-diff --git a/gcc/jit/jit-playback.c b/gcc/jit/jit-playback.c
-index 5bccf591a..35f5e35ef 100644
---- a/gcc/jit/jit-playback.c
-+++ b/gcc/jit/jit-playback.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -41,8 +43,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "diagnostic.h"
- #include "stmt.h"
- 
--#include <pthread.h>
--
- #include "jit-playback.h"
- #include "jit-result.h"
- #include "jit-builtins.h"
-diff --git a/gcc/jit/jit-recording.c b/gcc/jit/jit-recording.c
-index a237d574f..5785e3269 100644
---- a/gcc/jit/jit-recording.c
-+++ b/gcc/jit/jit-recording.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -25,8 +27,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "pretty-print.h"
- #include "toplev.h"
- 
--#include <pthread.h>
--
- #include "jit-builtins.h"
- #include "jit-recording.h"
- #include "jit-playback.h"
-diff --git a/gcc/jit/libgccjit.c b/gcc/jit/libgccjit.c
-index f9c33c63c..75f21d275 100644
---- a/gcc/jit/libgccjit.c
-+++ b/gcc/jit/libgccjit.c
-@@ -18,13 +18,13 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
- #include "timevar.h"
- #include "typed-splay-tree.h"
- #include "cppbuiltin.h"
--#include <pthread.h>
- 
- #include "libgccjit.h"
- #include "jit-recording.h"
diff --git a/srcpkgs/libgccjit/template b/srcpkgs/libgccjit/template
index 0b37c3ee9f8b..fde1affd54b7 100644
--- a/srcpkgs/libgccjit/template
+++ b/srcpkgs/libgccjit/template
@@ -3,18 +3,12 @@
 # which use the version number.
 
 pkgname=libgccjit
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
+version=12.2.0
 revision=1
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
-_majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 create_wrksrc=yes
 short_desc="Just-In-Time Compilation library for GCC"
 maintainer="Lane Biocini <lane@mailbox.org>"
@@ -22,16 +16,16 @@ homepage="https://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 nopie=yes
 lib32disabled=yes
 makedepends="zlib-devel"

From d2111a01301bcd175047a4d6f231451dfa86480b Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 10/37] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove -no-pie from build. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..4804193d8395 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -53,6 +53,7 @@ _void_cross_build_binutils() {
 		--sbindir=/usr/bin \
 		--libdir=/usr/lib \
 		--libexecdir=/usr/lib \
+		--sysconfdir=/etc \
 		--target=${tgt} \
 		--with-sysroot=/usr/${tgt} \
 		--disable-nls \
@@ -60,7 +61,9 @@ _void_cross_build_binutils() {
 		--disable-multilib \
 		--disable-werror \
 		--disable-gold \
+		--disable-gprofng \
 		--enable-relro \
+		--enable-new-dtags \
 		--enable-plugins \
 		--enable-64-bit-bfd \
 		--enable-deterministic-archives \
@@ -132,6 +135,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -381,6 +385,7 @@ _void_cross_build_gcc() {
 		extra_args+=" --disable-gnu-unique-object"
 		extra_args+=" libat_cv_have_ifunc=no"
 	else
+		extra_args+=" --enable-clocale=gnu"
 		extra_args+=" --enable-gnu-unique-object"
 	fi
 
@@ -460,6 +465,14 @@ do_build() {
 	local binutils_ver linux_ver gcc_ver libc_ver libucontext_ver
 	local tgt=${sourcepkg/cross-}
 
+	export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}"
+	export CXXFLAGS="${CXXFLAGS/-D_FORTIFY_SOURCE=2/}"
+
+	# Disable explicit -fno-PIE, gcc/binutils/libc will figure this out itself.
+	export CFLAGS="${CFLAGS//-fno-PIE/}"
+	export CXXFLAGS="${CXXFLAGS//-fno-PIE/}"
+	export LDFLAGS="${LDFLAGS//-no-pie/}"
+
 	_void_cross_test_ver binutils
 	_void_cross_test_ver linux
 	_void_cross_test_ver gcc
@@ -625,6 +638,9 @@ do_install() {
 	# then remove it because it conflicts with libquadmath package
 	rm -rf ${DESTDIR}/${sysroot}/usr/lib/libquadmath.*
 
+	# Remove libdep linker plugin because it conflicts with system binutils
+	rm -f ${DESTDIR}/usr/lib/bfd-plugins/libdep*
+
 	# Remove leftover symlinks
 	rm -f ${DESTDIR}/usr/lib${XBPS_TARGET_WORDSIZE}
 	rm -f ${DESTDIR}/lib*

From e8f3909c069ebf243062eca5f603227083ae6a28 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 11/37] qemu: remove broken patch

The necessary patch has been imported into musl so no need
to cast the sigevent struct to a more glibc-like one.
---
 .../musl-fix-sigevent-and-sigval_t.patch      | 27 -------------------
 1 file changed, 27 deletions(-)
 delete mode 100644 srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch

diff --git a/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch b/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch
deleted file mode 100644
index 4b4f1117c15f..000000000000
--- a/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-Note: Remove this patch with musl 1.2.2
-
---- a/linux-user/syscall.c
-+++ b/linux-user/syscall.c
-@@ -5020,10 +5020,21 @@
- #ifndef HAVE_SIGEV_NOTIFY_THREAD_ID
- #define sigev_notify_thread_id _sigev_un._tid
- #endif
- 
--static inline abi_long target_to_host_sigevent(struct sigevent *host_sevp,
-+struct host_sigevent {
-+    union sigval sigev_value;
-+    int sigev_signo;
-+    int sigev_notify;
-+    union {
-+       char _pad[64 - sizeof(int) * 2 - sizeof(union sigval)];
-+       int _tid;
-+    } _sigev_un;
-+};
-+
-+static inline abi_long target_to_host_sigevent(struct sigevent *sevp,
-                                                abi_ulong target_addr)
- {
-+    struct host_sigevent *host_sevp = (struct host_sigevent *) sevp;
-     struct target_sigevent *target_sevp;
- 
-     if (!lock_user_struct(VERIFY_READ, target_sevp, target_addr, 1)) {

From 9f9d2f243653f51f22679e0eb67284fc579168f2 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 19 Nov 2022 13:26:24 -0800
Subject: [PATCH 12/37] mk-configure: rebuild for gcc 12

---
 srcpkgs/mk-configure/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/mk-configure/template b/srcpkgs/mk-configure/template
index 9d12f11a9799..c50d8adf213f 100644
--- a/srcpkgs/mk-configure/template
+++ b/srcpkgs/mk-configure/template
@@ -1,7 +1,7 @@
 # Template file for 'mk-configure'
 pkgname=mk-configure
 version=0.37.0
-revision=1
+revision=2
 build_style=gnu-makefile
 make_cmd=bmake
 make_install_args="MANDIR=/usr/share/man"

From 1f225a67fca3a48b4a57f5b9f9e800b8b05e981c Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 13/37] cross-aarch64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..9e6fb75c198d 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Leah Neukirchen <leah@vuxu.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 1cdf0999fcf4b7e23fa3fbe9aa0e8c06a7f97fe0 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 14/37] cross-aarch64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..ba14c96bccea 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From ca8b9d79a1da7f01abe2117d75713e8031afce88 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 15/37] cross-arm-linux-gnueabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..5c774e16f430 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 9ef922ff0b1519c1e8ce02719d5adc5ddb2b5ef1 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 16/37] cross-arm-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..d6298ab639a4 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 45351c2aa37fca8379dec3ac7686b469c77b8715 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 17/37] cross-arm-linux-musleabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..24df78e8fd8e 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 3b1c1b95b00ff68f759bd9f22aa5fb0364be40fe Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 18/37] cross-arm-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..8093700f909c 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From ce4a1fbd98429f760ac93098de59dcddd9603e23 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 19/37] cross-armv7l-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..92665326428b 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 6d32b6d5756f9ff9f087ec990b9dea5381a46573 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 20/37] cross-armv7l-linux-musleabihf: update to gcc 12.2.0.

---
 .../cross-armv7l-linux-musleabihf/template    | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..e5af2c9ccbf2 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From b2677d37db332907d29338fc27a5327cc7b8fabf Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 21/37] cross-i686-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-i686-linux-musl/template b/srcpkgs/cross-i686-linux-musl/template
index 8be16a230d8d..d624bb7a3254 100644
--- a/srcpkgs/cross-i686-linux-musl/template
+++ b/srcpkgs/cross-i686-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-i686-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-i686-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From ea358c8ff6e24e0b3e2ceb5546d75028a2e39c10 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 22/37] cross-i686-pc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..6a9e54db807a 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,14 +1,15 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -16,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 900ee24e5da6c2acfd2a79b0ab57f17a542f040a Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 23/37] cross-mips-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-musl/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..67a5c413396c 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 5ce512b851838655752f4219f6b5bc9fc708b109 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 24/37] cross-mips-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..bdf8600ce95b 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="hipperson0 <hipperson0@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 8e6f1071b3cb18ba927e56ad9f8dd5cf109a10dc Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 25/37] cross-mipsel-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..de49387d517b 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From ff75e733c9a5c1ef71c8154af3ac88b668ed5ab3 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 26/37] cross-mipsel-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..b27ce6475a38 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 390ef0702c07d956c0f3a5b099d6f7f7f20334d9 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 27/37] cross-powerpc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..79579e093b12 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 0235008194054ee1f34994ca5aa7155c66633107 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 28/37] cross-powerpc-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..9bb6acd359b6 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 68f4ae156d99cbcb9b8f3ab02d0f3a6b6fba64a7 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 29/37] cross-powerpc64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..2d153d00add6 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,16 +1,17 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
  --enable-targets=powerpc-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -18,12 +19,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From f4d106c37e463679e3fcbac31ef54b3e599ec8f7 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 30/37] cross-powerpc64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 016f18776a6d..e0848fe0bff7 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,30 +1,31 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 18d74fbff80c9ccb019ef640a2666b81295cd2d1 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 31/37] cross-powerpc64le-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 463d7e92d20d..8d8e010e15c0 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,16 +1,17 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
  --enable-targets=powerpcle-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -18,12 +19,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 1c314320c695c9c8ea2fa9787f9633dfc4ebd59c Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 32/37] cross-powerpc64le-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index c17a3cccfe29..0915e524545f 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,30 +1,31 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 6c1d6955226f3d0c28ae4e7bd1d691c92a899ef6 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 33/37] cross-powerpcle-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 9aede3c465ce..687be8a44c6c 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 
@@ -35,6 +36,8 @@ if [ "$XBPS_TARGET_MACHINE" = "ppcle" ]; then
 	broken="Can't build crosstoolchain to itself"
 fi
 
+broken="glibc uses big-endian specific instructions on 32-bit powerpc"
+
 cross-powerpcle-linux-gnu-libc_package() {
 	short_desc+=" - glibc files"
 	nostrip=yes

From 80ff9901db83f0a736a1d56d9eff85a150412024 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 34/37] cross-powerpcle-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index 045cfda987fe..bb984b9c42eb 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From caec1366d46bfb0cc0b73646d754f52e66e4d38a Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:30 -0800
Subject: [PATCH 35/37] cross-x86_64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 8918f3c22a1c..930aaf2a508b 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,14 +1,15 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -16,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 6e16dba261f6106666bf28319030b23a3dcc486e Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:30 -0800
Subject: [PATCH 36/37] cross-x86_64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..ac5b1c46ab82 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 5796bae0f4899492bce8b5e04bb4cf0ee01a31f8 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Fri, 18 Nov 2022 02:01:19 -0800
Subject: [PATCH 37/37] cross-vpkg-dummy: update to 0.39.

---
 srcpkgs/cross-vpkg-dummy/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/cross-vpkg-dummy/template b/srcpkgs/cross-vpkg-dummy/template
index d83e38dc63ac..aeafb749dd5f 100644
--- a/srcpkgs/cross-vpkg-dummy/template
+++ b/srcpkgs/cross-vpkg-dummy/template
@@ -1,6 +1,6 @@
 # Template file for 'cross-vpkg-dummy'
 pkgname=cross-vpkg-dummy
-version=0.38
+version=0.39
 revision=1
 build_style=meta
 short_desc="Dummy meta-pkg for cross building packages with xbps-src"
@@ -54,8 +54,8 @@ conflicts="
 	gcc-objc++>=0"
 shlib_provides="
 	libgcc_s.so.1
-	libgnat-10.so
-	libgnarl-10.so
+	libgnat-12.so
+	libgnarl-12.so
 	libstdc++.so.6
 	libgfortran.so.5"
 

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (241 preceding siblings ...)
  2022-11-28 19:06 ` oreo639
@ 2022-12-04 20:13 ` oreo639
  2022-12-08 13:02 ` kenaryn
                   ` (21 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-12-04 20:13 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5506 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.2.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.2.0

There are lists of failing builds here: https://github.com/void-linux/void-packages/issues/39809, https://github.com/void-linux/void-packages/issues/39960

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [x] llvm https://github.com/void-linux/void-packages/pull/38694
- [x] m4 https://github.com/void-linux/void-packages/pull/33730
- [x] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [x] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [x] libvirt https://github.com/void-linux/void-packages/pull/38842
- [x] syslinux https://github.com/void-linux/void-packages/pull/38876
- [x] efivar https://github.com/void-linux/void-packages/pull/38874
- [x] gpgme https://github.com/void-linux/void-packages/pull/38825

Known packages that needed to be fixed/updated for gcc12:
- [x] openssh https://github.com/void-linux/void-packages/pull/38849
- [x] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [x] doxygen https://github.com/void-linux/void-packages/pull/38846
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] libproxy https://github.com/void-linux/void-packages/pull/38818
- [x] exempi https://github.com/void-linux/void-packages/pull/38820
- [x] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [x] libunique1 https://github.com/void-linux/void-packages/pull/38848 or https://github.com/void-linux/void-packages/pull/38873
- [x] libwpd https://github.com/void-linux/void-packages/pull/38878
- [x] cglm https://github.com/void-linux/void-packages/pull/39748
- [x] coreboot-utils https://github.com/void-linux/void-packages/pull/39749
- [x] apl https://github.com/void-linux/void-packages/pull/39750
- [x] igt-gpu-tools https://github.com/void-linux/void-packages/pull/39780

Needs to be fixed/updated for binutils:
- [x] grub https://github.com/void-linux/void-packages/pull/38875
- [x] linux-tools https://github.com/void-linux/void-packages/pull/38877
- [x] kcov https://github.com/void-linux/void-packages/pull/39291

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [x] kde
- [x] lxde
- [x] lxqt

You can test the ISOs here:
https://drive.google.com/drive/folders/1ix92CYSLUP-KWjLxltdgG4e8Nu2JCY5n?usp=sharing

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 128293 bytes --]

From 023ff7c6baa32294095d7ae7b21421424bfd9021 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 01/37] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../fix-libcollector-without-java.patch       | 53 +++++++++++++++
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 25 ++++---
 4 files changed, 87 insertions(+), 117 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
 create mode 100644 srcpkgs/binutils/patches/fix-libcollector-without-java.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/fix-libcollector-without-java.patch b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
new file mode 100644
index 000000000000..54384875f358
--- /dev/null
+++ b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
@@ -0,0 +1,53 @@
+From 49ddd814ac1071af7c4f45d5f8398b91862f2c7f Mon Sep 17 00:00:00 2001
+From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
+Date: Wed, 17 Aug 2022 19:55:23 -0700
+Subject: [PATCH] gprofng: fix bug 29479 Collection fails when built without
+ java support
+
+gprofng/ChangeLog
+2022-08-17  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>
+
+	PR gprofng/29479
+	* libcollector/collector.c: Add #if defined(GPROFNG_JAVA_PROFILING) for
+	java specific code.
+	* libcollector/unwind.c: Likewise.
+---
+ gprofng/libcollector/collector.c | 2 ++
+ gprofng/libcollector/unwind.c    | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/gprofng/libcollector/collector.c b/gprofng/libcollector/collector.c
+index 93c9d3330de5..ceff2c1caccb 100644
+--- a/gprofng/libcollector/collector.c
++++ b/gprofng/libcollector/collector.c
+@@ -913,8 +913,10 @@ __collector_open_experiment (const char *exp, const char *params, sp_origin_t or
+   __collector_ext_unwind_key_init (1, NULL);
+ 
+   /* start java attach if suitable */
++#if defined(GPROFNG_JAVA_PROFILING)
+   if (exp_origin == SP_ORIGIN_DBX_ATTACH)
+     __collector_jprofile_start_attach ();
++#endif
+   start_sec_time = CALL_UTIL (time)(NULL);
+   __collector_start_time = collector_interface.getHiResTime ();
+   TprintfT (DBG_LT0, "\t__collector_open_experiment; resetting start_time\n");
+diff --git a/gprofng/libcollector/unwind.c b/gprofng/libcollector/unwind.c
+index 119243788020..f8e11823c81e 100644
+--- a/gprofng/libcollector/unwind.c
++++ b/gprofng/libcollector/unwind.c
+@@ -557,6 +557,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+   int size = max_frame_size;
+ 
+ #define MIN(a,b) ((a)<(b)?(a):(b))
++#if defined(GPROFNG_JAVA_PROFILING)
+   /* get Java info */
+   if (__collector_java_mode && __collector_java_asyncgetcalltrace_loaded && context && !pseudo_context)
+     {
+@@ -569,6 +570,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+ 	  size -= sz;
+ 	}
+     }
++#endif
+ 
+   /* get native stack */
+   if (context)
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..c355a5fc8016 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkgconf"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -35,15 +36,21 @@ do_configure() {
 	local conf
 
 	if [ "$CHROOT_READY" ]; then
-		conf+=" --with-debuginfod"
+		conf+=" --with-debuginfod --enable-shared"
 	else
-		conf+=" --without-debuginfod --disable-install-libbfd"
+		conf+=" --without-debuginfod --disable-shared --disable-install-libbfd"
 	fi
 	if [ "$CROSS_BUILD" ]; then
 		# we don't want --with-sysroot=${XBPS_CROSS_BASE} like gnu-configure
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	# gprofng currently only supports x86 and aarch64 glibc.
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64|i386|aarch64) conf+=" --enable-gprofng" ;;
+		*) conf+=" --disable-gprofng" ;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"
@@ -76,13 +83,14 @@ do_configure() {
 		--libdir=/usr/lib \
 		--mandir=/usr/share/man \
 		--infodir=/usr/share/info \
+		--sysconfdir=/etc \
 		--disable-werror \
-		--disable-shared \
 		--disable-nls \
 		--enable-threads \
 		--enable-plugins \
 		--enable-relro \
 		--enable-gold \
+		--enable-new-dtags \
 		--enable-deterministic-archives \
 		--enable-64-bit-bfd \
 		--enable-ld=default \
@@ -142,7 +150,8 @@ binutils-devel_package() {
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/*.a"
-		vmove "usr/lib/*.so"
+		vmove "usr/lib/libbfd.so"
+		vmove "usr/lib/libopcodes.so"
 	}
 }
 

From a3a9127f29ca775d5e8cfab5ee07092a41327fb3 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 02/37] gdb: resolve conflict with binutils 2.39

---
 srcpkgs/gdb/template | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/gdb/template b/srcpkgs/gdb/template
index 9c5f17ffc519..b666348fea19 100644
--- a/srcpkgs/gdb/template
+++ b/srcpkgs/gdb/template
@@ -1,7 +1,7 @@
 # Template file for 'gdb'
 pkgname=gdb
 version=12.1
-revision=2
+revision=3
 build_style=gnu-configure
 pycompile_dirs="/usr/share/gdb/python"
 configure_args="--disable-werror --disable-nls --with-system-readline
@@ -48,7 +48,8 @@ vopt_conflict debuginfod static
 
 post_install() {
 	# resolve conflicts with binutils
-	rm -r ${DESTDIR}/usr/{include,lib,share/info/bfd.info*}
+	rm -rf ${DESTDIR}/usr/{include,lib}
+	rm -rf ${DESTDIR}/usr/share/info/{bfd,ctf-spec}.info*
 }
 
 gdb-common_package() {

From 28c6739b1887608bdf582fb06f573f3137928cb0 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 03/37] gcc: update to 12.2.0.

---
 common/shlibs                                 | 10 +--
 srcpkgs/gcc/files/gccgo-musl.patch            | 71 +++------------
 srcpkgs/gcc/files/libgnarl-musl.patch         | 18 ++--
 srcpkgs/gcc/files/libssp-musl.patch           | 10 +--
 .../gcc/patches/force-override-clocale.patch  | 21 +++++
 srcpkgs/gcc/patches/libffi_gnulinux.patch     | 11 ---
 .../gcc/patches/libgcc-ibm128-no-tag.patch    | 10 ++-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |  2 +-
 srcpkgs/gcc/template                          | 87 +++++++++----------
 9 files changed, 101 insertions(+), 139 deletions(-)
 create mode 100644 srcpkgs/gcc/patches/force-override-clocale.patch
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index 0814612ced32..3ee7969839ad 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.2.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.36 perl-5.36.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -858,8 +858,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.2.0_1
+libgnat-12.so libada-12.2.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1711,8 +1711,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.2.0_1
+libasan.so.8 libsanitizer-12.2.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..12ec68dd8aa3 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,14 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ b/libgo/go/runtime/os_linux.go
+@@ -365,7 +365,7 @@ func setThreadCPUProfiler(hz int32) {
+ 	var sevp _sigevent
+ 	sevp.sigev_notify = _SIGEV_THREAD_ID
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.__sev_fields))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/force-override-clocale.patch b/srcpkgs/gcc/patches/force-override-clocale.patch
new file mode 100644
index 000000000000..8af8a7150dd9
--- /dev/null
+++ b/srcpkgs/gcc/patches/force-override-clocale.patch
@@ -0,0 +1,21 @@
+This is necessary when building a gnu cross compiler for a musl target.
+Otherwise, even if clocale manually is set to gnu, it will be reset to generic
+when the test is performed using AC_EGREP_CPP().
+--- a/libstdc++-v3/configure
++++ b/libstdc++-v3/configure
+@@ -16493,6 +16493,7 @@ fi
+ 
+   # Sanity check model, and test for special functionality.
+   if test $enable_clocale_flag = gnu; then
++    if test $enable_clocale = auto; then
+     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+ 
+@@ -16509,6 +16510,7 @@ else
+   enable_clocale_flag=generic
+ fi
+ rm -f conftest*
++    fi
+ 
+ 
+     # Set it to scream when it hurts.
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index ab3643de4f98..a20af7c0ef2e 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,14 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
+version=12.2.0
+revision=1
+_minorver="${version%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 create_wrksrc=yes
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +18,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -52,8 +48,11 @@ if [ "$CHROOT_READY" ]; then
 	hostmakedepends="tar texinfo perl flex"
 else
 	_have_gccgo=no
+	# libzstd fails to link in bootstrap with glibc 2.36
+	# when zlib has been compiled with glibc 2.32.
+	LDFLAGS="-lzstd -pthread"
 fi
-makedepends="zlib-devel"
+makedepends="zlib-devel libzstd-devel"
 depends="binutils libgcc-devel-${version}_${revision}
  libstdc++-devel-${version}_${revision} libssp-devel-${version}_${revision}"
 checkdepends="dejagnu"
@@ -70,13 +69,13 @@ if [ "$build_option_gnatboot" ]; then
 	case "$XBPS_TARGET_MACHINE" in
 	x86_64)
 		_gnat_tarball="gnat-gpl-2017-x86_64-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/591c6d80c7a447af2deed1d7>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/9682e2e1f2f232ce03fe21d77b14c37a0de5649b?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" b942bcac20dea39748b39f8b624d9619f60a8dee2e8195dbe3829c835b0956e6"
 		build_options_default="gnatboot"
 		;;
 	i686)
 		_gnat_tarball="gnat-gpl-2014-x86-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/564b3e9dc8e196b040fbe248>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/c5e9e6fdff5cb77ed90cf8c62536653e27c0bed6?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" 3b693510f5d22a240abb3034934c1adbd80ccd6e4f61a4f491cc408fdfd9c042"
 		build_options_default="gnatboot"
 		;;
@@ -155,8 +154,8 @@ if [ "$CROSS_BUILD" ]; then
 fi
 
 post_extract() {
-	mv gcc-${version/pre/_pre}/* gcc-${version/pre/_pre}/.??* .
-	rmdir gcc-${version/pre/_pre}
+	mv gcc-${version}/* gcc-${version}/.??* .
+	rmdir gcc-${version}
 	mv gmp-${_gmp_version} gmp
 	mv mpfr-${_mpfr_version} mpfr
 	mv mpc-${_mpc_version} mpc
@@ -186,9 +185,9 @@ pre_configure() {
 	sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
 
 	if [ "$XBPS_TARGET_LIBC" = musl ]; then
-		patch -p1 -i ${FILESDIR}/libgnarl-musl.patch
-		patch -p1 -i ${FILESDIR}/libssp-musl.patch
-		patch -p1 -i ${FILESDIR}/gccgo-musl.patch
+		for p in ${FILESDIR}/*-musl.patch; do
+			patch -p1 -i $p
+		done
 	fi
 }
 do_configure() {
@@ -343,16 +342,16 @@ do_install() {
 
 	# Make version a symlink of major version to make all versions
 	# from the same series work automagically.
-	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver} \
+	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${version} \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver}
 	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver} \
-		${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}
+		${DESTDIR}/usr/lib/gcc/${_triplet}/${version}
 
 	# Ditto for c++ headers.
-	mv ${DESTDIR}/usr/include/c++/${_patchver} \
+	mv ${DESTDIR}/usr/include/c++/${version} \
 		${DESTDIR}/usr/include/c++/${_minorver}
 	ln -sfr ${DESTDIR}/usr/include/c++/${_minorver} \
-		${DESTDIR}/usr/include/c++/${_patchver}
+		${DESTDIR}/usr/include/c++/${version}
 
 	# cc symlink
 	ln -sfr ${DESTDIR}/usr/bin/gcc ${DESTDIR}/usr/bin/cc
@@ -361,7 +360,7 @@ do_install() {
 
 	# lto plugin symlink
 	vmkdir usr/lib/bfd-plugins
-	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}/liblto_plugin.so \
+	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${version}/liblto_plugin.so \
 		${DESTDIR}/usr/lib/bfd-plugins
 
 	# Remove "fixed" header
@@ -372,13 +371,9 @@ do_install() {
 	rm -f ${DESTDIR}/usr/lib/libffi*
 	rm -f ${DESTDIR}/usr/share/man/man3/ffi*
 
-	# Remove all python scripts in libdir.
-	rm -f ${DESTDIR}/usr/lib/*.py
-
-	# Remove more python stuff.
-	if [ -d ${DESTDIR}/usr/share/gcc-${_patchver}/python ]; then
-		rm -rf ${DESTDIR}/usr/share/gcc-${_patchver}/python
-	fi
+	# Move libstdc++ gdb helpers to location where gdb can autoload them
+	mkdir -p ${DESTDIR}/usr/share/gdb/auto-load/usr/lib
+	mv ${DESTDIR}/usr/lib/*.py ${DESTDIR}/usr/share/gdb/auto-load/usr/lib
 
 	# Install c89 and c99 wrappers and its manpages, from NetBSD.
 	for f in c89 c99; do
@@ -397,7 +392,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}
@@ -450,7 +445,7 @@ gcc-fortran_package() {
 		if [ "$CROSS_BUILD" ]; then
 			# A number of OMP modules are not built when cross
 			# compiling gcc. Copy them from the cross compiler.
-			local src="/usr/lib/gcc/${_triplet}/${_patchver}/finclude"
+			local src="/usr/lib/gcc/${_triplet}/${version}/finclude"
 			local dst="usr/lib/gcc/${_triplet}/${_minorver}/finclude"
 			for f in omp_lib.f90 omp_lib.h omp_lib.mod omp_lib_kinds.mod \
 				openacc.f90 openacc.mod openacc_kinds.mod openacc_lib.h; do
@@ -517,7 +512,7 @@ libgfortran_package() {
 	short_desc+=" - Fortran library"
 	pkg_install() {
 		vmove "usr/lib/libgfortran.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -538,7 +533,7 @@ libgo_package() {
 	nostrip=yes
 	pkg_install() {
 		vmove "usr/lib/libgo.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -554,7 +549,7 @@ libobjc_package() {
 	short_desc+=" - Objective-C library"
 	pkg_install() {
 		vmove "usr/lib/libobjc.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -573,7 +568,7 @@ libquadmath_package() {
 	short_desc+=" - quadmath library"
 	pkg_install() {
 		vmove "usr/lib/libquadmath.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -615,7 +610,7 @@ libgcc_package() {
 	noverifyrdeps=yes
 	pkg_install() {
 		vmove "usr/lib/libgcc_s.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -646,7 +641,7 @@ libgomp_package() {
 	short_desc+=" - OpenMP v4.0 library"
 	pkg_install() {
 		vmove "usr/lib/libgomp*.so.*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -701,7 +696,7 @@ libssp_package() {
 	short_desc+=" - SSP (StackSmashingProtection) library"
 	pkg_install() {
 		vmove "usr/lib/libssp.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -718,7 +713,9 @@ libstdc++-devel_package() {
 libstdc++_package() {
 	short_desc+=" - Standard C++ Library"
 	pkg_install() {
+		vmove usr/share/gdb
+		vmove usr/share/gcc-${version}/python
 		vmove "usr/lib/libstdc++.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }

From 702e0027427e1a8bc67b306fb005979136950558 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 04/37] libtool: rebuild for gcc 12

---
 srcpkgs/libtool/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index fc5c53a9c3e9..aebad9294eef 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
 version=2.4.7
-revision=1
+revision=2
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"

From e0e5fe3cda4fef4a1eafac3ec8d735cb1aeb3280 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 05/37] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 7e01bbb851fd..d9618e3806ba 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 build_wrksrc=libiberty
 build_style=gnu-configure
@@ -10,7 +10,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From 11abea7e3e8946c5dff9a5cd728050e89ee6b84f Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 06/37] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 ...e-hash-style-both-for-building-glibc.patch |  51 ++++
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  66 ++--
 4 files changed, 109 insertions(+), 354 deletions(-)
 create mode 100644 srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index 3ee7969839ad..3f90cbd1ace3 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
 libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch b/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
new file mode 100644
index 000000000000..9c5553e92609
--- /dev/null
+++ b/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
@@ -0,0 +1,51 @@
+Temporary workaround for EAC bug.
+
+See: https://sourceware.org/bugzilla/show_bug.cgi?id=29456
+
+From 8e90e2cc5e57d7ca3a40602d278e9642a8b66716 Mon Sep 17 00:00:00 2001
+From: oreo639 <oreo6391@gmail.com>
+Date: Tue, 13 Sep 2022 14:30:35 -0700
+Subject: [PATCH] Revert "Do not use --hash-style=both for building glibc
+ shared objects"
+
+This reverts commit e47de5cb2d4dbecb58f569ed241e8e95c568f03c.
+---
+ Makeconfig     |  9 +++++++++
+ Makerules      |  7 +++++++
+ 5 files changed, 61 insertions(+)
+
+diff --git a/Makeconfig b/Makeconfig
+index ba70321af1..e2131d4389 100644
+--- a/Makeconfig
++++ b/Makeconfig
+@@ -371,6 +371,13 @@ dt-relr-ldflag =
+ no-dt-relr-ldflag =
+ endif
+ 
++# For the time being we unconditionally use 'both'.  At some time we
++# should declare statically linked code as 'out of luck' and compile
++# with --hash-style=gnu only.
++hashstyle-LDFLAGS = -Wl,--hash-style=both
++LDFLAGS.so += $(hashstyle-LDFLAGS)
++LDFLAGS-rtld += $(hashstyle-LDFLAGS)
++
+ ifeq (no,$(build-pie-default))
+ pie-default = $(no-pie-ccflag)
+ else # build-pie-default
+diff --git a/Makerules b/Makerules
+index d1e139d03c..44134e37ce 100644
+--- a/Makerules
++++ b/Makerules
+@@ -558,6 +558,9 @@ $(common-objpfx)shlib.lds: $(common-objpfx)config.make $(..)Makerules
+ 		  -Wl,--verbose 2>/dev/null | \
+ 	  sed > $@T \
+ 	      -e '/^=========/,/^=========/!d;/^=========/d' \
++		   -e 's/^.*\.gnu\.hash[ 	]*:.*$$/  .note.ABI-tag : { *(.note.ABI-tag) } &/' \
++		   -e '/^[ 	]*\.hash[ 	]*:.*$$/{h;d;}' \
++		   -e '/DATA_SEGMENT_ALIGN/{H;g}' \
+ 	      -e 's/^.*\*(\.dynbss).*$$/& \
+ 		 PROVIDE(__start___libc_freeres_ptrs = .); \
+ 		 *(__libc_freeres_ptrs) \
+-- 
+2.37.3
+
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..6cd4c0980cbb 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,16 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
+_patchver="72-g0f90d6204d"
+wrksrc="glibc-${version}-${_patchver}"
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
-distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+distfiles="https://vasilek.cz/paste/glibc-${version}-${_patchver}.tar.xz"
+checksum=656200722d5ba968b4888a2d2950719d72c86290fd0479f61897d25b7db2cb57
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +22,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +57,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +165,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From 19a4afeb0224d41a41b2d4c9762d0a28f2b66e70 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 07/37] musl: add support for SIGEV_THREAD_ID timers

https://git.musl-libc.org/cgit/musl/commit/?id=7c71792e87691451f2a6b76348e83ad1889f1dcb
---
 ...d-support-for-SIGEV_THREAD_ID-timers.patch | 74 +++++++++++++++++++
 srcpkgs/musl/template                         |  2 +-
 2 files changed, 75 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch

diff --git a/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
new file mode 100644
index 000000000000..e20dff5ba0d4
--- /dev/null
+++ b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
@@ -0,0 +1,74 @@
+From 7c71792e87691451f2a6b76348e83ad1889f1dcb Mon Sep 17 00:00:00 2001
+From: James Y Knight <jyknight@google.com>
+Date: Sun, 30 Jun 2019 21:55:20 -0400
+Subject: [PATCH] add support for SIGEV_THREAD_ID timers
+
+This is like SIGEV_SIGNAL, but targeted to a particular thread's
+tid, rather than the process.
+---
+ include/signal.h        | 16 +++++++++++++---
+ src/time/timer_create.c |  8 ++++++--
+ 2 files changed, 19 insertions(+), 5 deletions(-)
+
+diff --git a/include/signal.h b/include/signal.h
+index fbdf667b2..9ed929e4f 100644
+--- a/include/signal.h
++++ b/include/signal.h
+@@ -180,14 +180,24 @@ struct sigevent {
+ 	union sigval sigev_value;
+ 	int sigev_signo;
+ 	int sigev_notify;
+-	void (*sigev_notify_function)(union sigval);
+-	pthread_attr_t *sigev_notify_attributes;
+-	char __pad[56-3*sizeof(long)];
++	union {
++		char __pad[64 - 2*sizeof(int) - sizeof(union sigval)];
++		pid_t sigev_notify_thread_id;
++		struct {
++			void (*sigev_notify_function)(union sigval);
++			pthread_attr_t *sigev_notify_attributes;
++		} __sev_thread;
++	} __sev_fields;
+ };
+ 
++#define sigev_notify_thread_id __sev_fields.sigev_notify_thread_id
++#define sigev_notify_function __sev_fields.__sev_thread.sigev_notify_function
++#define sigev_notify_attributes __sev_fields.__sev_thread.sigev_notify_attributes
++
+ #define SIGEV_SIGNAL 0
+ #define SIGEV_NONE 1
+ #define SIGEV_THREAD 2
++#define SIGEV_THREAD_ID 4
+ 
+ int __libc_current_sigrtmin(void);
+ int __libc_current_sigrtmax(void);
+diff --git a/src/time/timer_create.c b/src/time/timer_create.c
+index 5ddfda278..4bef23905 100644
+--- a/src/time/timer_create.c
++++ b/src/time/timer_create.c
+@@ -71,11 +71,15 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 	switch (evp ? evp->sigev_notify : SIGEV_SIGNAL) {
+ 	case SIGEV_NONE:
+ 	case SIGEV_SIGNAL:
++	case SIGEV_THREAD_ID:
+ 		if (evp) {
+ 			ksev.sigev_value = evp->sigev_value;
+ 			ksev.sigev_signo = evp->sigev_signo;
+ 			ksev.sigev_notify = evp->sigev_notify;
+-			ksev.sigev_tid = 0;
++			if (evp->sigev_notify == SIGEV_THREAD_ID)
++				ksev.sigev_tid = evp->sigev_notify_thread_id;
++			else
++				ksev.sigev_tid = 0;
+ 			ksevp = &ksev;
+ 		}
+ 		if (syscall(SYS_timer_create, clk, ksevp, &timerid) < 0)
+@@ -107,7 +111,7 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 
+ 		ksev.sigev_value.sival_ptr = 0;
+ 		ksev.sigev_signo = SIGTIMER;
+-		ksev.sigev_notify = 4; /* SIGEV_THREAD_ID */
++		ksev.sigev_notify = SIGEV_THREAD_ID;
+ 		ksev.sigev_tid = td->tid;
+ 		if (syscall(SYS_timer_create, clk, &ksev, &timerid) < 0)
+ 			timerid = -1;
diff --git a/srcpkgs/musl/template b/srcpkgs/musl/template
index 34e6ed4fba6e..afb33cd868b5 100644
--- a/srcpkgs/musl/template
+++ b/srcpkgs/musl/template
@@ -2,7 +2,7 @@
 pkgname=musl
 reverts="1.2.0_1"
 version=1.1.24
-revision=11
+revision=12
 archs="*-musl"
 bootstrap=yes
 build_style=gnu-configure

From 2c1c8ba98946106950bb8db7f6aeba83e358d6f0 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 08/37] gcc-multilib: update to 12.2.0.

---
 srcpkgs/gcc-multilib/template | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index f28eb237c287..ba9bafcadfd6 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,15 +3,15 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _majorver="${version%.*}"
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel
@@ -70,7 +70,7 @@ do_build() {
 	make ${makejobs}
 }
 do_install() {
-	local _pc_triplet=x86_64-pc-linux-gnu _version=${version%pre1}
+	local _pc_triplet=x86_64-pc-linux-gnu
 	# Install to a tempdir and then only copy relevant files.
 	cd ${wrksrc}
 	make DESTDIR=${wrksrc}/${pkgname}-build install
@@ -80,9 +80,9 @@ do_install() {
 	vmkdir usr/include/c++/${_majorver}/${_triplet}
 	vmkdir usr/lib/gcc/${_triplet}/${_majorver}
 
-	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${_version}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${version}/32 \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_majorver}/
-	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${_version}/${_pc_triplet}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${version}/${_pc_triplet}/32 \
 		${DESTDIR}/usr/include/c++/${_majorver}/${_triplet}
 
 	vinstall ${wrksrc}/host-${_pc_triplet}/gcc/specs 644 usr/lib/gcc/${_triplet}/${_majorver}

From 3f112430e1c969475dc57212db706f1ea4574b78 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 09/37] libgccjit: update to 12.2.0.

---
 srcpkgs/libgccjit/files/libgccjit-musl.patch | 63 --------------------
 srcpkgs/libgccjit/template                   | 24 +++-----
 2 files changed, 9 insertions(+), 78 deletions(-)
 delete mode 100644 srcpkgs/libgccjit/files/libgccjit-musl.patch

diff --git a/srcpkgs/libgccjit/files/libgccjit-musl.patch b/srcpkgs/libgccjit/files/libgccjit-musl.patch
deleted file mode 100644
index d2ed16928c82..000000000000
--- a/srcpkgs/libgccjit/files/libgccjit-musl.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-diff --git a/gcc/jit/jit-playback.c b/gcc/jit/jit-playback.c
-index 5bccf591a..35f5e35ef 100644
---- a/gcc/jit/jit-playback.c
-+++ b/gcc/jit/jit-playback.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -41,8 +43,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "diagnostic.h"
- #include "stmt.h"
- 
--#include <pthread.h>
--
- #include "jit-playback.h"
- #include "jit-result.h"
- #include "jit-builtins.h"
-diff --git a/gcc/jit/jit-recording.c b/gcc/jit/jit-recording.c
-index a237d574f..5785e3269 100644
---- a/gcc/jit/jit-recording.c
-+++ b/gcc/jit/jit-recording.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -25,8 +27,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "pretty-print.h"
- #include "toplev.h"
- 
--#include <pthread.h>
--
- #include "jit-builtins.h"
- #include "jit-recording.h"
- #include "jit-playback.h"
-diff --git a/gcc/jit/libgccjit.c b/gcc/jit/libgccjit.c
-index f9c33c63c..75f21d275 100644
---- a/gcc/jit/libgccjit.c
-+++ b/gcc/jit/libgccjit.c
-@@ -18,13 +18,13 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
- #include "timevar.h"
- #include "typed-splay-tree.h"
- #include "cppbuiltin.h"
--#include <pthread.h>
- 
- #include "libgccjit.h"
- #include "jit-recording.h"
diff --git a/srcpkgs/libgccjit/template b/srcpkgs/libgccjit/template
index 0b37c3ee9f8b..fde1affd54b7 100644
--- a/srcpkgs/libgccjit/template
+++ b/srcpkgs/libgccjit/template
@@ -3,18 +3,12 @@
 # which use the version number.
 
 pkgname=libgccjit
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
+version=12.2.0
 revision=1
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
-_majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 create_wrksrc=yes
 short_desc="Just-In-Time Compilation library for GCC"
 maintainer="Lane Biocini <lane@mailbox.org>"
@@ -22,16 +16,16 @@ homepage="https://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 nopie=yes
 lib32disabled=yes
 makedepends="zlib-devel"

From 540268409c801ec1d7194a78027611da82ee867f Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 10/37] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove -no-pie from build. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..4804193d8395 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -53,6 +53,7 @@ _void_cross_build_binutils() {
 		--sbindir=/usr/bin \
 		--libdir=/usr/lib \
 		--libexecdir=/usr/lib \
+		--sysconfdir=/etc \
 		--target=${tgt} \
 		--with-sysroot=/usr/${tgt} \
 		--disable-nls \
@@ -60,7 +61,9 @@ _void_cross_build_binutils() {
 		--disable-multilib \
 		--disable-werror \
 		--disable-gold \
+		--disable-gprofng \
 		--enable-relro \
+		--enable-new-dtags \
 		--enable-plugins \
 		--enable-64-bit-bfd \
 		--enable-deterministic-archives \
@@ -132,6 +135,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -381,6 +385,7 @@ _void_cross_build_gcc() {
 		extra_args+=" --disable-gnu-unique-object"
 		extra_args+=" libat_cv_have_ifunc=no"
 	else
+		extra_args+=" --enable-clocale=gnu"
 		extra_args+=" --enable-gnu-unique-object"
 	fi
 
@@ -460,6 +465,14 @@ do_build() {
 	local binutils_ver linux_ver gcc_ver libc_ver libucontext_ver
 	local tgt=${sourcepkg/cross-}
 
+	export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}"
+	export CXXFLAGS="${CXXFLAGS/-D_FORTIFY_SOURCE=2/}"
+
+	# Disable explicit -fno-PIE, gcc/binutils/libc will figure this out itself.
+	export CFLAGS="${CFLAGS//-fno-PIE/}"
+	export CXXFLAGS="${CXXFLAGS//-fno-PIE/}"
+	export LDFLAGS="${LDFLAGS//-no-pie/}"
+
 	_void_cross_test_ver binutils
 	_void_cross_test_ver linux
 	_void_cross_test_ver gcc
@@ -625,6 +638,9 @@ do_install() {
 	# then remove it because it conflicts with libquadmath package
 	rm -rf ${DESTDIR}/${sysroot}/usr/lib/libquadmath.*
 
+	# Remove libdep linker plugin because it conflicts with system binutils
+	rm -f ${DESTDIR}/usr/lib/bfd-plugins/libdep*
+
 	# Remove leftover symlinks
 	rm -f ${DESTDIR}/usr/lib${XBPS_TARGET_WORDSIZE}
 	rm -f ${DESTDIR}/lib*

From 2895b35f82e3a24cad5975a880ca5f7c93d5fa2a Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 11/37] qemu: remove broken patch

The necessary patch has been imported into musl so no need
to cast the sigevent struct to a more glibc-like one.
---
 .../musl-fix-sigevent-and-sigval_t.patch      | 27 -------------------
 1 file changed, 27 deletions(-)
 delete mode 100644 srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch

diff --git a/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch b/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch
deleted file mode 100644
index 4b4f1117c15f..000000000000
--- a/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-Note: Remove this patch with musl 1.2.2
-
---- a/linux-user/syscall.c
-+++ b/linux-user/syscall.c
-@@ -5020,10 +5020,21 @@
- #ifndef HAVE_SIGEV_NOTIFY_THREAD_ID
- #define sigev_notify_thread_id _sigev_un._tid
- #endif
- 
--static inline abi_long target_to_host_sigevent(struct sigevent *host_sevp,
-+struct host_sigevent {
-+    union sigval sigev_value;
-+    int sigev_signo;
-+    int sigev_notify;
-+    union {
-+       char _pad[64 - sizeof(int) * 2 - sizeof(union sigval)];
-+       int _tid;
-+    } _sigev_un;
-+};
-+
-+static inline abi_long target_to_host_sigevent(struct sigevent *sevp,
-                                                abi_ulong target_addr)
- {
-+    struct host_sigevent *host_sevp = (struct host_sigevent *) sevp;
-     struct target_sigevent *target_sevp;
- 
-     if (!lock_user_struct(VERIFY_READ, target_sevp, target_addr, 1)) {

From aaaf08aef9c30b8a5285824c659d2873bcc085eb Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 19 Nov 2022 13:26:24 -0800
Subject: [PATCH 12/37] mk-configure: rebuild for gcc 12

---
 srcpkgs/mk-configure/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/mk-configure/template b/srcpkgs/mk-configure/template
index 9d12f11a9799..c50d8adf213f 100644
--- a/srcpkgs/mk-configure/template
+++ b/srcpkgs/mk-configure/template
@@ -1,7 +1,7 @@
 # Template file for 'mk-configure'
 pkgname=mk-configure
 version=0.37.0
-revision=1
+revision=2
 build_style=gnu-makefile
 make_cmd=bmake
 make_install_args="MANDIR=/usr/share/man"

From 2766ca2ea8c097001c4aa88a017de9d3ee7dc0d1 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 13/37] cross-aarch64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..9e6fb75c198d 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Leah Neukirchen <leah@vuxu.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From a35f78cd51b135076e5871aa18230d2af4cb3ca0 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 14/37] cross-aarch64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..ba14c96bccea 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From a637a7d7f5011f90c442167c79ea4022136a59ab Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 15/37] cross-arm-linux-gnueabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..5c774e16f430 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 74d7621c29619881231be62cd6efc4c28c1733cd Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 16/37] cross-arm-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..d6298ab639a4 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 4cab8b8ef1086c7498b6432b5b30715d7fcc6f7f Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 17/37] cross-arm-linux-musleabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..24df78e8fd8e 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 5c19dd58e72ac9b9fccbb71d830c62e7a1ef08b8 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 18/37] cross-arm-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..8093700f909c 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From c3e99201416a036ba3070537b56eb1f7bf407368 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 19/37] cross-armv7l-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..92665326428b 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 1e3cccbd7ca501249af7db2af27a9cb718a5cd61 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 20/37] cross-armv7l-linux-musleabihf: update to gcc 12.2.0.

---
 .../cross-armv7l-linux-musleabihf/template    | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..e5af2c9ccbf2 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 0b2ba6ca95b5a0a4249ee74eba4cc9a3419e9a01 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 21/37] cross-i686-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-i686-linux-musl/template b/srcpkgs/cross-i686-linux-musl/template
index 8be16a230d8d..d624bb7a3254 100644
--- a/srcpkgs/cross-i686-linux-musl/template
+++ b/srcpkgs/cross-i686-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-i686-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-i686-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 6b98e37c0753c292bdf0eab151aa4348ba54da40 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 22/37] cross-i686-pc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..6a9e54db807a 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,14 +1,15 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -16,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From db8745f4c9dc7ca8032246afa0c836b161b876fe Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 23/37] cross-mips-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-musl/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..67a5c413396c 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From d8936278496f2d7f260f3a9eb351caa5dd58829f Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 24/37] cross-mips-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..bdf8600ce95b 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="hipperson0 <hipperson0@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From a91ba3ab1f5491e1676bf8400a497fb8b5c3cf3b Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 25/37] cross-mipsel-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..de49387d517b 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 8bc659104ffe164ac97f12f2fd2e5d59df6c8b2b Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 26/37] cross-mipsel-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..b27ce6475a38 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 40ce097d0da9b33d69ea2e6ed0ef77920c6564a9 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 27/37] cross-powerpc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..79579e093b12 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From bb5eda3a1f95d385cb229ef3089ee196433e6194 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 28/37] cross-powerpc-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..9bb6acd359b6 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 2bfb33cab984f72552d48eb97b93573a05a240f7 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 29/37] cross-powerpc64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..2d153d00add6 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,16 +1,17 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
  --enable-targets=powerpc-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -18,12 +19,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 088c1f270345f4fdb7f0171cc506d04eea09b26f Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 30/37] cross-powerpc64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 016f18776a6d..e0848fe0bff7 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,30 +1,31 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From d01c23315371342661778d3b72ae1ef5eec93cf3 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 31/37] cross-powerpc64le-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 463d7e92d20d..8d8e010e15c0 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,16 +1,17 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
  --enable-targets=powerpcle-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -18,12 +19,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 45cd9b49fbcba201ba2bdc22f8800087c6b83cdf Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 32/37] cross-powerpc64le-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index c17a3cccfe29..0915e524545f 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,30 +1,31 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 64c0b945f24ec94e530688bd71d6a9a7216eae46 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 33/37] cross-powerpcle-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 9aede3c465ce..687be8a44c6c 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 
@@ -35,6 +36,8 @@ if [ "$XBPS_TARGET_MACHINE" = "ppcle" ]; then
 	broken="Can't build crosstoolchain to itself"
 fi
 
+broken="glibc uses big-endian specific instructions on 32-bit powerpc"
+
 cross-powerpcle-linux-gnu-libc_package() {
 	short_desc+=" - glibc files"
 	nostrip=yes

From d5f02e5268f846de43a4ab778ff47d99335fa400 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 34/37] cross-powerpcle-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index 045cfda987fe..bb984b9c42eb 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 85a5a757bdfc2fd60cfcfba1baba26eb4e40e21c Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:30 -0800
Subject: [PATCH 35/37] cross-x86_64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 8918f3c22a1c..930aaf2a508b 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,14 +1,15 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -16,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From a58db29069b41feea8d7e639f8433d550671dd1e Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:30 -0800
Subject: [PATCH 36/37] cross-x86_64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..ac5b1c46ab82 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From e3f723657e13ee121cde2b5175ccc053f586b8d9 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Fri, 18 Nov 2022 02:01:19 -0800
Subject: [PATCH 37/37] cross-vpkg-dummy: update to 0.39.

---
 srcpkgs/cross-vpkg-dummy/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/cross-vpkg-dummy/template b/srcpkgs/cross-vpkg-dummy/template
index d83e38dc63ac..aeafb749dd5f 100644
--- a/srcpkgs/cross-vpkg-dummy/template
+++ b/srcpkgs/cross-vpkg-dummy/template
@@ -1,6 +1,6 @@
 # Template file for 'cross-vpkg-dummy'
 pkgname=cross-vpkg-dummy
-version=0.38
+version=0.39
 revision=1
 build_style=meta
 short_desc="Dummy meta-pkg for cross building packages with xbps-src"
@@ -54,8 +54,8 @@ conflicts="
 	gcc-objc++>=0"
 shlib_provides="
 	libgcc_s.so.1
-	libgnat-10.so
-	libgnarl-10.so
+	libgnat-12.so
+	libgnarl-12.so
 	libstdc++.so.6
 	libgfortran.so.5"
 

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (242 preceding siblings ...)
  2022-12-04 20:13 ` oreo639
@ 2022-12-08 13:02 ` kenaryn
  2022-12-08 13:02 ` kenaryn
                   ` (20 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: kenaryn @ 2022-12-08 13:02 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 259 bytes --]

New comment by kenaryn on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1342701651

Comment:
Keep pushing forward! You'll have soon access to C++23 features thanks to you :) Your efforts are deeply appreciated.

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (243 preceding siblings ...)
  2022-12-08 13:02 ` kenaryn
@ 2022-12-08 13:02 ` kenaryn
  2022-12-12 18:16 ` [PR PATCH] [Updated] " oreo639
                   ` (19 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: kenaryn @ 2022-12-08 13:02 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 260 bytes --]

New comment by kenaryn on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1342701651

Comment:
Keep pushing forward! We will soon have access to C++23 features thanks to you :) Your efforts are deeply appreciated.

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (244 preceding siblings ...)
  2022-12-08 13:02 ` kenaryn
@ 2022-12-12 18:16 ` oreo639
  2022-12-12 18:24 ` oreo639
                   ` (18 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-12-12 18:16 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5506 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.2.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.2.0

There are lists of failing builds here: https://github.com/void-linux/void-packages/issues/39809, https://github.com/void-linux/void-packages/issues/39960

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [x] llvm https://github.com/void-linux/void-packages/pull/38694
- [x] m4 https://github.com/void-linux/void-packages/pull/33730
- [x] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [x] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [x] libvirt https://github.com/void-linux/void-packages/pull/38842
- [x] syslinux https://github.com/void-linux/void-packages/pull/38876
- [x] efivar https://github.com/void-linux/void-packages/pull/38874
- [x] gpgme https://github.com/void-linux/void-packages/pull/38825

Known packages that needed to be fixed/updated for gcc12:
- [x] openssh https://github.com/void-linux/void-packages/pull/38849
- [x] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [x] doxygen https://github.com/void-linux/void-packages/pull/38846
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] libproxy https://github.com/void-linux/void-packages/pull/38818
- [x] exempi https://github.com/void-linux/void-packages/pull/38820
- [x] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [x] libunique1 https://github.com/void-linux/void-packages/pull/38848 or https://github.com/void-linux/void-packages/pull/38873
- [x] libwpd https://github.com/void-linux/void-packages/pull/38878
- [x] cglm https://github.com/void-linux/void-packages/pull/39748
- [x] coreboot-utils https://github.com/void-linux/void-packages/pull/39749
- [x] apl https://github.com/void-linux/void-packages/pull/39750
- [x] igt-gpu-tools https://github.com/void-linux/void-packages/pull/39780

Needs to be fixed/updated for binutils:
- [x] grub https://github.com/void-linux/void-packages/pull/38875
- [x] linux-tools https://github.com/void-linux/void-packages/pull/38877
- [x] kcov https://github.com/void-linux/void-packages/pull/39291

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [x] kde
- [x] lxde
- [x] lxqt

You can test the ISOs here:
https://drive.google.com/drive/folders/1ix92CYSLUP-KWjLxltdgG4e8Nu2JCY5n?usp=sharing

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 128257 bytes --]

From c687f75617169b107d1086ba508df5632e93924a Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 01/38] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../fix-libcollector-without-java.patch       | 53 +++++++++++++++
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 25 ++++---
 4 files changed, 87 insertions(+), 117 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
 create mode 100644 srcpkgs/binutils/patches/fix-libcollector-without-java.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/fix-libcollector-without-java.patch b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
new file mode 100644
index 000000000000..54384875f358
--- /dev/null
+++ b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
@@ -0,0 +1,53 @@
+From 49ddd814ac1071af7c4f45d5f8398b91862f2c7f Mon Sep 17 00:00:00 2001
+From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
+Date: Wed, 17 Aug 2022 19:55:23 -0700
+Subject: [PATCH] gprofng: fix bug 29479 Collection fails when built without
+ java support
+
+gprofng/ChangeLog
+2022-08-17  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>
+
+	PR gprofng/29479
+	* libcollector/collector.c: Add #if defined(GPROFNG_JAVA_PROFILING) for
+	java specific code.
+	* libcollector/unwind.c: Likewise.
+---
+ gprofng/libcollector/collector.c | 2 ++
+ gprofng/libcollector/unwind.c    | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/gprofng/libcollector/collector.c b/gprofng/libcollector/collector.c
+index 93c9d3330de5..ceff2c1caccb 100644
+--- a/gprofng/libcollector/collector.c
++++ b/gprofng/libcollector/collector.c
+@@ -913,8 +913,10 @@ __collector_open_experiment (const char *exp, const char *params, sp_origin_t or
+   __collector_ext_unwind_key_init (1, NULL);
+ 
+   /* start java attach if suitable */
++#if defined(GPROFNG_JAVA_PROFILING)
+   if (exp_origin == SP_ORIGIN_DBX_ATTACH)
+     __collector_jprofile_start_attach ();
++#endif
+   start_sec_time = CALL_UTIL (time)(NULL);
+   __collector_start_time = collector_interface.getHiResTime ();
+   TprintfT (DBG_LT0, "\t__collector_open_experiment; resetting start_time\n");
+diff --git a/gprofng/libcollector/unwind.c b/gprofng/libcollector/unwind.c
+index 119243788020..f8e11823c81e 100644
+--- a/gprofng/libcollector/unwind.c
++++ b/gprofng/libcollector/unwind.c
+@@ -557,6 +557,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+   int size = max_frame_size;
+ 
+ #define MIN(a,b) ((a)<(b)?(a):(b))
++#if defined(GPROFNG_JAVA_PROFILING)
+   /* get Java info */
+   if (__collector_java_mode && __collector_java_asyncgetcalltrace_loaded && context && !pseudo_context)
+     {
+@@ -569,6 +570,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+ 	  size -= sz;
+ 	}
+     }
++#endif
+ 
+   /* get native stack */
+   if (context)
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..c355a5fc8016 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkgconf"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -35,15 +36,21 @@ do_configure() {
 	local conf
 
 	if [ "$CHROOT_READY" ]; then
-		conf+=" --with-debuginfod"
+		conf+=" --with-debuginfod --enable-shared"
 	else
-		conf+=" --without-debuginfod --disable-install-libbfd"
+		conf+=" --without-debuginfod --disable-shared --disable-install-libbfd"
 	fi
 	if [ "$CROSS_BUILD" ]; then
 		# we don't want --with-sysroot=${XBPS_CROSS_BASE} like gnu-configure
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	# gprofng currently only supports x86 and aarch64 glibc.
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64|i386|aarch64) conf+=" --enable-gprofng" ;;
+		*) conf+=" --disable-gprofng" ;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"
@@ -76,13 +83,14 @@ do_configure() {
 		--libdir=/usr/lib \
 		--mandir=/usr/share/man \
 		--infodir=/usr/share/info \
+		--sysconfdir=/etc \
 		--disable-werror \
-		--disable-shared \
 		--disable-nls \
 		--enable-threads \
 		--enable-plugins \
 		--enable-relro \
 		--enable-gold \
+		--enable-new-dtags \
 		--enable-deterministic-archives \
 		--enable-64-bit-bfd \
 		--enable-ld=default \
@@ -142,7 +150,8 @@ binutils-devel_package() {
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/*.a"
-		vmove "usr/lib/*.so"
+		vmove "usr/lib/libbfd.so"
+		vmove "usr/lib/libopcodes.so"
 	}
 }
 

From ae3e487ca96962a4105fa9458e2529a9b7d21ac9 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 02/38] gdb: resolve conflict with binutils 2.39

---
 srcpkgs/gdb/template | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/gdb/template b/srcpkgs/gdb/template
index 9c5f17ffc519..b666348fea19 100644
--- a/srcpkgs/gdb/template
+++ b/srcpkgs/gdb/template
@@ -1,7 +1,7 @@
 # Template file for 'gdb'
 pkgname=gdb
 version=12.1
-revision=2
+revision=3
 build_style=gnu-configure
 pycompile_dirs="/usr/share/gdb/python"
 configure_args="--disable-werror --disable-nls --with-system-readline
@@ -48,7 +48,8 @@ vopt_conflict debuginfod static
 
 post_install() {
 	# resolve conflicts with binutils
-	rm -r ${DESTDIR}/usr/{include,lib,share/info/bfd.info*}
+	rm -rf ${DESTDIR}/usr/{include,lib}
+	rm -rf ${DESTDIR}/usr/share/info/{bfd,ctf-spec}.info*
 }
 
 gdb-common_package() {

From 52346ba1e435b332bc09397975de9ebd7b57a7be Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 03/38] gcc: update to 12.2.0.

---
 common/shlibs                                 | 10 +--
 srcpkgs/gcc/files/gccgo-musl.patch            | 71 +++------------
 srcpkgs/gcc/files/libgnarl-musl.patch         | 18 ++--
 srcpkgs/gcc/files/libssp-musl.patch           | 10 +--
 .../gcc/patches/force-override-clocale.patch  | 21 +++++
 srcpkgs/gcc/patches/libffi_gnulinux.patch     | 11 ---
 .../gcc/patches/libgcc-ibm128-no-tag.patch    | 10 ++-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |  2 +-
 srcpkgs/gcc/template                          | 87 +++++++++----------
 9 files changed, 101 insertions(+), 139 deletions(-)
 create mode 100644 srcpkgs/gcc/patches/force-override-clocale.patch
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index ca7f949876a8..eb361f40abe4 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.2.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.36 perl-5.36.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -858,8 +858,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.2.0_1
+libgnat-12.so libada-12.2.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1713,8 +1713,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.2.0_1
+libasan.so.8 libsanitizer-12.2.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..12ec68dd8aa3 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,14 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ b/libgo/go/runtime/os_linux.go
+@@ -365,7 +365,7 @@ func setThreadCPUProfiler(hz int32) {
+ 	var sevp _sigevent
+ 	sevp.sigev_notify = _SIGEV_THREAD_ID
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.__sev_fields))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/force-override-clocale.patch b/srcpkgs/gcc/patches/force-override-clocale.patch
new file mode 100644
index 000000000000..8af8a7150dd9
--- /dev/null
+++ b/srcpkgs/gcc/patches/force-override-clocale.patch
@@ -0,0 +1,21 @@
+This is necessary when building a gnu cross compiler for a musl target.
+Otherwise, even if clocale manually is set to gnu, it will be reset to generic
+when the test is performed using AC_EGREP_CPP().
+--- a/libstdc++-v3/configure
++++ b/libstdc++-v3/configure
+@@ -16493,6 +16493,7 @@ fi
+ 
+   # Sanity check model, and test for special functionality.
+   if test $enable_clocale_flag = gnu; then
++    if test $enable_clocale = auto; then
+     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+ 
+@@ -16509,6 +16510,7 @@ else
+   enable_clocale_flag=generic
+ fi
+ rm -f conftest*
++    fi
+ 
+ 
+     # Set it to scream when it hurts.
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index ab3643de4f98..a20af7c0ef2e 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,14 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
+version=12.2.0
+revision=1
+_minorver="${version%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 create_wrksrc=yes
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +18,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -52,8 +48,11 @@ if [ "$CHROOT_READY" ]; then
 	hostmakedepends="tar texinfo perl flex"
 else
 	_have_gccgo=no
+	# libzstd fails to link in bootstrap with glibc 2.36
+	# when zlib has been compiled with glibc 2.32.
+	LDFLAGS="-lzstd -pthread"
 fi
-makedepends="zlib-devel"
+makedepends="zlib-devel libzstd-devel"
 depends="binutils libgcc-devel-${version}_${revision}
  libstdc++-devel-${version}_${revision} libssp-devel-${version}_${revision}"
 checkdepends="dejagnu"
@@ -70,13 +69,13 @@ if [ "$build_option_gnatboot" ]; then
 	case "$XBPS_TARGET_MACHINE" in
 	x86_64)
 		_gnat_tarball="gnat-gpl-2017-x86_64-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/591c6d80c7a447af2deed1d7>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/9682e2e1f2f232ce03fe21d77b14c37a0de5649b?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" b942bcac20dea39748b39f8b624d9619f60a8dee2e8195dbe3829c835b0956e6"
 		build_options_default="gnatboot"
 		;;
 	i686)
 		_gnat_tarball="gnat-gpl-2014-x86-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/564b3e9dc8e196b040fbe248>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/c5e9e6fdff5cb77ed90cf8c62536653e27c0bed6?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" 3b693510f5d22a240abb3034934c1adbd80ccd6e4f61a4f491cc408fdfd9c042"
 		build_options_default="gnatboot"
 		;;
@@ -155,8 +154,8 @@ if [ "$CROSS_BUILD" ]; then
 fi
 
 post_extract() {
-	mv gcc-${version/pre/_pre}/* gcc-${version/pre/_pre}/.??* .
-	rmdir gcc-${version/pre/_pre}
+	mv gcc-${version}/* gcc-${version}/.??* .
+	rmdir gcc-${version}
 	mv gmp-${_gmp_version} gmp
 	mv mpfr-${_mpfr_version} mpfr
 	mv mpc-${_mpc_version} mpc
@@ -186,9 +185,9 @@ pre_configure() {
 	sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
 
 	if [ "$XBPS_TARGET_LIBC" = musl ]; then
-		patch -p1 -i ${FILESDIR}/libgnarl-musl.patch
-		patch -p1 -i ${FILESDIR}/libssp-musl.patch
-		patch -p1 -i ${FILESDIR}/gccgo-musl.patch
+		for p in ${FILESDIR}/*-musl.patch; do
+			patch -p1 -i $p
+		done
 	fi
 }
 do_configure() {
@@ -343,16 +342,16 @@ do_install() {
 
 	# Make version a symlink of major version to make all versions
 	# from the same series work automagically.
-	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver} \
+	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${version} \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver}
 	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver} \
-		${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}
+		${DESTDIR}/usr/lib/gcc/${_triplet}/${version}
 
 	# Ditto for c++ headers.
-	mv ${DESTDIR}/usr/include/c++/${_patchver} \
+	mv ${DESTDIR}/usr/include/c++/${version} \
 		${DESTDIR}/usr/include/c++/${_minorver}
 	ln -sfr ${DESTDIR}/usr/include/c++/${_minorver} \
-		${DESTDIR}/usr/include/c++/${_patchver}
+		${DESTDIR}/usr/include/c++/${version}
 
 	# cc symlink
 	ln -sfr ${DESTDIR}/usr/bin/gcc ${DESTDIR}/usr/bin/cc
@@ -361,7 +360,7 @@ do_install() {
 
 	# lto plugin symlink
 	vmkdir usr/lib/bfd-plugins
-	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}/liblto_plugin.so \
+	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${version}/liblto_plugin.so \
 		${DESTDIR}/usr/lib/bfd-plugins
 
 	# Remove "fixed" header
@@ -372,13 +371,9 @@ do_install() {
 	rm -f ${DESTDIR}/usr/lib/libffi*
 	rm -f ${DESTDIR}/usr/share/man/man3/ffi*
 
-	# Remove all python scripts in libdir.
-	rm -f ${DESTDIR}/usr/lib/*.py
-
-	# Remove more python stuff.
-	if [ -d ${DESTDIR}/usr/share/gcc-${_patchver}/python ]; then
-		rm -rf ${DESTDIR}/usr/share/gcc-${_patchver}/python
-	fi
+	# Move libstdc++ gdb helpers to location where gdb can autoload them
+	mkdir -p ${DESTDIR}/usr/share/gdb/auto-load/usr/lib
+	mv ${DESTDIR}/usr/lib/*.py ${DESTDIR}/usr/share/gdb/auto-load/usr/lib
 
 	# Install c89 and c99 wrappers and its manpages, from NetBSD.
 	for f in c89 c99; do
@@ -397,7 +392,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}
@@ -450,7 +445,7 @@ gcc-fortran_package() {
 		if [ "$CROSS_BUILD" ]; then
 			# A number of OMP modules are not built when cross
 			# compiling gcc. Copy them from the cross compiler.
-			local src="/usr/lib/gcc/${_triplet}/${_patchver}/finclude"
+			local src="/usr/lib/gcc/${_triplet}/${version}/finclude"
 			local dst="usr/lib/gcc/${_triplet}/${_minorver}/finclude"
 			for f in omp_lib.f90 omp_lib.h omp_lib.mod omp_lib_kinds.mod \
 				openacc.f90 openacc.mod openacc_kinds.mod openacc_lib.h; do
@@ -517,7 +512,7 @@ libgfortran_package() {
 	short_desc+=" - Fortran library"
 	pkg_install() {
 		vmove "usr/lib/libgfortran.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -538,7 +533,7 @@ libgo_package() {
 	nostrip=yes
 	pkg_install() {
 		vmove "usr/lib/libgo.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -554,7 +549,7 @@ libobjc_package() {
 	short_desc+=" - Objective-C library"
 	pkg_install() {
 		vmove "usr/lib/libobjc.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -573,7 +568,7 @@ libquadmath_package() {
 	short_desc+=" - quadmath library"
 	pkg_install() {
 		vmove "usr/lib/libquadmath.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -615,7 +610,7 @@ libgcc_package() {
 	noverifyrdeps=yes
 	pkg_install() {
 		vmove "usr/lib/libgcc_s.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -646,7 +641,7 @@ libgomp_package() {
 	short_desc+=" - OpenMP v4.0 library"
 	pkg_install() {
 		vmove "usr/lib/libgomp*.so.*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -701,7 +696,7 @@ libssp_package() {
 	short_desc+=" - SSP (StackSmashingProtection) library"
 	pkg_install() {
 		vmove "usr/lib/libssp.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -718,7 +713,9 @@ libstdc++-devel_package() {
 libstdc++_package() {
 	short_desc+=" - Standard C++ Library"
 	pkg_install() {
+		vmove usr/share/gdb
+		vmove usr/share/gcc-${version}/python
 		vmove "usr/lib/libstdc++.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }

From a651087b2c83fa33f4900c3563f08bca60adca05 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 04/38] libtool: rebuild for gcc 12

---
 srcpkgs/libtool/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index fc5c53a9c3e9..aebad9294eef 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
 version=2.4.7
-revision=1
+revision=2
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"

From eee501ae2e2006c5d75f3b95da6533d14c495780 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 05/38] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 7e01bbb851fd..d9618e3806ba 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 build_wrksrc=libiberty
 build_style=gnu-configure
@@ -10,7 +10,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From ee7524e6c58424e26e33078721da4e15e7894d65 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 06/38] glibc: update to 2.36.

---
 common/shlibs                                 |  32 ++
 ...e-hash-style-both-for-building-glibc.patch |  51 ++++
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  66 ++--
 4 files changed, 111 insertions(+), 324 deletions(-)
 create mode 100644 srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index eb361f40abe4..1ec3210a15db 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -49,6 +49,38 @@ libSegFault.so glibc-2.32_1
 libpcprofile.so glibc-2.32_1
 libcidn.so.1 glibc-2.32_1
 libmvec.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
+libSimGearCore.so.2020.3.13 simgear-2020.3.13_1
+libSimGearScene.so.2020.3.13 simgear-2020.3.13_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch b/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
new file mode 100644
index 000000000000..9c5553e92609
--- /dev/null
+++ b/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
@@ -0,0 +1,51 @@
+Temporary workaround for EAC bug.
+
+See: https://sourceware.org/bugzilla/show_bug.cgi?id=29456
+
+From 8e90e2cc5e57d7ca3a40602d278e9642a8b66716 Mon Sep 17 00:00:00 2001
+From: oreo639 <oreo6391@gmail.com>
+Date: Tue, 13 Sep 2022 14:30:35 -0700
+Subject: [PATCH] Revert "Do not use --hash-style=both for building glibc
+ shared objects"
+
+This reverts commit e47de5cb2d4dbecb58f569ed241e8e95c568f03c.
+---
+ Makeconfig     |  9 +++++++++
+ Makerules      |  7 +++++++
+ 5 files changed, 61 insertions(+)
+
+diff --git a/Makeconfig b/Makeconfig
+index ba70321af1..e2131d4389 100644
+--- a/Makeconfig
++++ b/Makeconfig
+@@ -371,6 +371,13 @@ dt-relr-ldflag =
+ no-dt-relr-ldflag =
+ endif
+ 
++# For the time being we unconditionally use 'both'.  At some time we
++# should declare statically linked code as 'out of luck' and compile
++# with --hash-style=gnu only.
++hashstyle-LDFLAGS = -Wl,--hash-style=both
++LDFLAGS.so += $(hashstyle-LDFLAGS)
++LDFLAGS-rtld += $(hashstyle-LDFLAGS)
++
+ ifeq (no,$(build-pie-default))
+ pie-default = $(no-pie-ccflag)
+ else # build-pie-default
+diff --git a/Makerules b/Makerules
+index d1e139d03c..44134e37ce 100644
+--- a/Makerules
++++ b/Makerules
+@@ -558,6 +558,9 @@ $(common-objpfx)shlib.lds: $(common-objpfx)config.make $(..)Makerules
+ 		  -Wl,--verbose 2>/dev/null | \
+ 	  sed > $@T \
+ 	      -e '/^=========/,/^=========/!d;/^=========/d' \
++		   -e 's/^.*\.gnu\.hash[ 	]*:.*$$/  .note.ABI-tag : { *(.note.ABI-tag) } &/' \
++		   -e '/^[ 	]*\.hash[ 	]*:.*$$/{h;d;}' \
++		   -e '/DATA_SEGMENT_ALIGN/{H;g}' \
+ 	      -e 's/^.*\*(\.dynbss).*$$/& \
+ 		 PROVIDE(__start___libc_freeres_ptrs = .); \
+ 		 *(__libc_freeres_ptrs) \
+-- 
+2.37.3
+
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..6cd4c0980cbb 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,16 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
+_patchver="72-g0f90d6204d"
+wrksrc="glibc-${version}-${_patchver}"
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
-distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+distfiles="https://vasilek.cz/paste/glibc-${version}-${_patchver}.tar.xz"
+checksum=656200722d5ba968b4888a2d2950719d72c86290fd0479f61897d25b7db2cb57
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +22,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +57,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +165,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From 6a14edc4263eece471a4461e7ef1d71fb273892a Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 07/38] musl: add support for SIGEV_THREAD_ID timers

https://git.musl-libc.org/cgit/musl/commit/?id=7c71792e87691451f2a6b76348e83ad1889f1dcb
---
 ...d-support-for-SIGEV_THREAD_ID-timers.patch | 74 +++++++++++++++++++
 srcpkgs/musl/template                         |  2 +-
 2 files changed, 75 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch

diff --git a/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
new file mode 100644
index 000000000000..e20dff5ba0d4
--- /dev/null
+++ b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
@@ -0,0 +1,74 @@
+From 7c71792e87691451f2a6b76348e83ad1889f1dcb Mon Sep 17 00:00:00 2001
+From: James Y Knight <jyknight@google.com>
+Date: Sun, 30 Jun 2019 21:55:20 -0400
+Subject: [PATCH] add support for SIGEV_THREAD_ID timers
+
+This is like SIGEV_SIGNAL, but targeted to a particular thread's
+tid, rather than the process.
+---
+ include/signal.h        | 16 +++++++++++++---
+ src/time/timer_create.c |  8 ++++++--
+ 2 files changed, 19 insertions(+), 5 deletions(-)
+
+diff --git a/include/signal.h b/include/signal.h
+index fbdf667b2..9ed929e4f 100644
+--- a/include/signal.h
++++ b/include/signal.h
+@@ -180,14 +180,24 @@ struct sigevent {
+ 	union sigval sigev_value;
+ 	int sigev_signo;
+ 	int sigev_notify;
+-	void (*sigev_notify_function)(union sigval);
+-	pthread_attr_t *sigev_notify_attributes;
+-	char __pad[56-3*sizeof(long)];
++	union {
++		char __pad[64 - 2*sizeof(int) - sizeof(union sigval)];
++		pid_t sigev_notify_thread_id;
++		struct {
++			void (*sigev_notify_function)(union sigval);
++			pthread_attr_t *sigev_notify_attributes;
++		} __sev_thread;
++	} __sev_fields;
+ };
+ 
++#define sigev_notify_thread_id __sev_fields.sigev_notify_thread_id
++#define sigev_notify_function __sev_fields.__sev_thread.sigev_notify_function
++#define sigev_notify_attributes __sev_fields.__sev_thread.sigev_notify_attributes
++
+ #define SIGEV_SIGNAL 0
+ #define SIGEV_NONE 1
+ #define SIGEV_THREAD 2
++#define SIGEV_THREAD_ID 4
+ 
+ int __libc_current_sigrtmin(void);
+ int __libc_current_sigrtmax(void);
+diff --git a/src/time/timer_create.c b/src/time/timer_create.c
+index 5ddfda278..4bef23905 100644
+--- a/src/time/timer_create.c
++++ b/src/time/timer_create.c
+@@ -71,11 +71,15 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 	switch (evp ? evp->sigev_notify : SIGEV_SIGNAL) {
+ 	case SIGEV_NONE:
+ 	case SIGEV_SIGNAL:
++	case SIGEV_THREAD_ID:
+ 		if (evp) {
+ 			ksev.sigev_value = evp->sigev_value;
+ 			ksev.sigev_signo = evp->sigev_signo;
+ 			ksev.sigev_notify = evp->sigev_notify;
+-			ksev.sigev_tid = 0;
++			if (evp->sigev_notify == SIGEV_THREAD_ID)
++				ksev.sigev_tid = evp->sigev_notify_thread_id;
++			else
++				ksev.sigev_tid = 0;
+ 			ksevp = &ksev;
+ 		}
+ 		if (syscall(SYS_timer_create, clk, ksevp, &timerid) < 0)
+@@ -107,7 +111,7 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 
+ 		ksev.sigev_value.sival_ptr = 0;
+ 		ksev.sigev_signo = SIGTIMER;
+-		ksev.sigev_notify = 4; /* SIGEV_THREAD_ID */
++		ksev.sigev_notify = SIGEV_THREAD_ID;
+ 		ksev.sigev_tid = td->tid;
+ 		if (syscall(SYS_timer_create, clk, &ksev, &timerid) < 0)
+ 			timerid = -1;
diff --git a/srcpkgs/musl/template b/srcpkgs/musl/template
index 34e6ed4fba6e..afb33cd868b5 100644
--- a/srcpkgs/musl/template
+++ b/srcpkgs/musl/template
@@ -2,7 +2,7 @@
 pkgname=musl
 reverts="1.2.0_1"
 version=1.1.24
-revision=11
+revision=12
 archs="*-musl"
 bootstrap=yes
 build_style=gnu-configure

From 02c1c73cdfb5e9abd1ecb0eec859da454ce93944 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 08/38] gcc-multilib: update to 12.2.0.

---
 srcpkgs/gcc-multilib/template | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index f28eb237c287..ba9bafcadfd6 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,15 +3,15 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _majorver="${version%.*}"
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel
@@ -70,7 +70,7 @@ do_build() {
 	make ${makejobs}
 }
 do_install() {
-	local _pc_triplet=x86_64-pc-linux-gnu _version=${version%pre1}
+	local _pc_triplet=x86_64-pc-linux-gnu
 	# Install to a tempdir and then only copy relevant files.
 	cd ${wrksrc}
 	make DESTDIR=${wrksrc}/${pkgname}-build install
@@ -80,9 +80,9 @@ do_install() {
 	vmkdir usr/include/c++/${_majorver}/${_triplet}
 	vmkdir usr/lib/gcc/${_triplet}/${_majorver}
 
-	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${_version}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${version}/32 \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_majorver}/
-	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${_version}/${_pc_triplet}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${version}/${_pc_triplet}/32 \
 		${DESTDIR}/usr/include/c++/${_majorver}/${_triplet}
 
 	vinstall ${wrksrc}/host-${_pc_triplet}/gcc/specs 644 usr/lib/gcc/${_triplet}/${_majorver}

From 5b69ea32fd854ca5ff89c9b4e7d76620f5ec62c8 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 09/38] libgccjit: update to 12.2.0.

---
 srcpkgs/libgccjit/files/libgccjit-musl.patch | 63 --------------------
 srcpkgs/libgccjit/template                   | 24 +++-----
 2 files changed, 9 insertions(+), 78 deletions(-)
 delete mode 100644 srcpkgs/libgccjit/files/libgccjit-musl.patch

diff --git a/srcpkgs/libgccjit/files/libgccjit-musl.patch b/srcpkgs/libgccjit/files/libgccjit-musl.patch
deleted file mode 100644
index d2ed16928c82..000000000000
--- a/srcpkgs/libgccjit/files/libgccjit-musl.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-diff --git a/gcc/jit/jit-playback.c b/gcc/jit/jit-playback.c
-index 5bccf591a..35f5e35ef 100644
---- a/gcc/jit/jit-playback.c
-+++ b/gcc/jit/jit-playback.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -41,8 +43,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "diagnostic.h"
- #include "stmt.h"
- 
--#include <pthread.h>
--
- #include "jit-playback.h"
- #include "jit-result.h"
- #include "jit-builtins.h"
-diff --git a/gcc/jit/jit-recording.c b/gcc/jit/jit-recording.c
-index a237d574f..5785e3269 100644
---- a/gcc/jit/jit-recording.c
-+++ b/gcc/jit/jit-recording.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -25,8 +27,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "pretty-print.h"
- #include "toplev.h"
- 
--#include <pthread.h>
--
- #include "jit-builtins.h"
- #include "jit-recording.h"
- #include "jit-playback.h"
-diff --git a/gcc/jit/libgccjit.c b/gcc/jit/libgccjit.c
-index f9c33c63c..75f21d275 100644
---- a/gcc/jit/libgccjit.c
-+++ b/gcc/jit/libgccjit.c
-@@ -18,13 +18,13 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
- #include "timevar.h"
- #include "typed-splay-tree.h"
- #include "cppbuiltin.h"
--#include <pthread.h>
- 
- #include "libgccjit.h"
- #include "jit-recording.h"
diff --git a/srcpkgs/libgccjit/template b/srcpkgs/libgccjit/template
index 0b37c3ee9f8b..fde1affd54b7 100644
--- a/srcpkgs/libgccjit/template
+++ b/srcpkgs/libgccjit/template
@@ -3,18 +3,12 @@
 # which use the version number.
 
 pkgname=libgccjit
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
+version=12.2.0
 revision=1
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
-_majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 create_wrksrc=yes
 short_desc="Just-In-Time Compilation library for GCC"
 maintainer="Lane Biocini <lane@mailbox.org>"
@@ -22,16 +16,16 @@ homepage="https://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 nopie=yes
 lib32disabled=yes
 makedepends="zlib-devel"

From 0ffcc161c2407451c8f7fb31f7eadad7b182dfd4 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 10/38] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove -no-pie from build. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..4804193d8395 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -53,6 +53,7 @@ _void_cross_build_binutils() {
 		--sbindir=/usr/bin \
 		--libdir=/usr/lib \
 		--libexecdir=/usr/lib \
+		--sysconfdir=/etc \
 		--target=${tgt} \
 		--with-sysroot=/usr/${tgt} \
 		--disable-nls \
@@ -60,7 +61,9 @@ _void_cross_build_binutils() {
 		--disable-multilib \
 		--disable-werror \
 		--disable-gold \
+		--disable-gprofng \
 		--enable-relro \
+		--enable-new-dtags \
 		--enable-plugins \
 		--enable-64-bit-bfd \
 		--enable-deterministic-archives \
@@ -132,6 +135,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -381,6 +385,7 @@ _void_cross_build_gcc() {
 		extra_args+=" --disable-gnu-unique-object"
 		extra_args+=" libat_cv_have_ifunc=no"
 	else
+		extra_args+=" --enable-clocale=gnu"
 		extra_args+=" --enable-gnu-unique-object"
 	fi
 
@@ -460,6 +465,14 @@ do_build() {
 	local binutils_ver linux_ver gcc_ver libc_ver libucontext_ver
 	local tgt=${sourcepkg/cross-}
 
+	export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}"
+	export CXXFLAGS="${CXXFLAGS/-D_FORTIFY_SOURCE=2/}"
+
+	# Disable explicit -fno-PIE, gcc/binutils/libc will figure this out itself.
+	export CFLAGS="${CFLAGS//-fno-PIE/}"
+	export CXXFLAGS="${CXXFLAGS//-fno-PIE/}"
+	export LDFLAGS="${LDFLAGS//-no-pie/}"
+
 	_void_cross_test_ver binutils
 	_void_cross_test_ver linux
 	_void_cross_test_ver gcc
@@ -625,6 +638,9 @@ do_install() {
 	# then remove it because it conflicts with libquadmath package
 	rm -rf ${DESTDIR}/${sysroot}/usr/lib/libquadmath.*
 
+	# Remove libdep linker plugin because it conflicts with system binutils
+	rm -f ${DESTDIR}/usr/lib/bfd-plugins/libdep*
+
 	# Remove leftover symlinks
 	rm -f ${DESTDIR}/usr/lib${XBPS_TARGET_WORDSIZE}
 	rm -f ${DESTDIR}/lib*

From 45f583e4797efc198c8e60f4e199ca0ab4f864ff Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Mon, 12 Dec 2022 10:15:29 -0800
Subject: [PATCH 11/38] environment/autoconf_cache: Disable 64-bit time_t by
 default

---
 common/environment/configure/autoconf_cache/common-linux | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/common/environment/configure/autoconf_cache/common-linux b/common/environment/configure/autoconf_cache/common-linux
index 718c2c36d79e..fe0bd5312cbd 100644
--- a/common/environment/configure/autoconf_cache/common-linux
+++ b/common/environment/configure/autoconf_cache/common-linux
@@ -170,3 +170,7 @@ ac_cv_strftime_extensions=yes
 
 # time
 ac_cv_func_wait3=yes
+
+# Y2038
+gl_cv_type_time_t_y2038=${gl_cv_type_time_t_y2038=no}
+ac_cv_type_time_t_bits_macro=${ac_cv_type_time_t_bits_macro=no}

From 9b3df743722cd1d0ed79b71d8e33449c699d9900 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 12/38] qemu: remove broken patch

The necessary patch has been imported into musl so no need
to cast the sigevent struct to a more glibc-like one.
---
 .../musl-fix-sigevent-and-sigval_t.patch      | 27 -------------------
 1 file changed, 27 deletions(-)
 delete mode 100644 srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch

diff --git a/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch b/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch
deleted file mode 100644
index 4b4f1117c15f..000000000000
--- a/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-Note: Remove this patch with musl 1.2.2
-
---- a/linux-user/syscall.c
-+++ b/linux-user/syscall.c
-@@ -5020,10 +5020,21 @@
- #ifndef HAVE_SIGEV_NOTIFY_THREAD_ID
- #define sigev_notify_thread_id _sigev_un._tid
- #endif
- 
--static inline abi_long target_to_host_sigevent(struct sigevent *host_sevp,
-+struct host_sigevent {
-+    union sigval sigev_value;
-+    int sigev_signo;
-+    int sigev_notify;
-+    union {
-+       char _pad[64 - sizeof(int) * 2 - sizeof(union sigval)];
-+       int _tid;
-+    } _sigev_un;
-+};
-+
-+static inline abi_long target_to_host_sigevent(struct sigevent *sevp,
-                                                abi_ulong target_addr)
- {
-+    struct host_sigevent *host_sevp = (struct host_sigevent *) sevp;
-     struct target_sigevent *target_sevp;
- 
-     if (!lock_user_struct(VERIFY_READ, target_sevp, target_addr, 1)) {

From 791d93828d4703da6e025c48cd72a07ed7fa63eb Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 19 Nov 2022 13:26:24 -0800
Subject: [PATCH 13/38] mk-configure: rebuild for gcc 12

---
 srcpkgs/mk-configure/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/mk-configure/template b/srcpkgs/mk-configure/template
index 9d12f11a9799..c50d8adf213f 100644
--- a/srcpkgs/mk-configure/template
+++ b/srcpkgs/mk-configure/template
@@ -1,7 +1,7 @@
 # Template file for 'mk-configure'
 pkgname=mk-configure
 version=0.37.0
-revision=1
+revision=2
 build_style=gnu-makefile
 make_cmd=bmake
 make_install_args="MANDIR=/usr/share/man"

From 47d30d09135453a6889f4662044248638fe3dc1a Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 14/38] cross-aarch64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..9e6fb75c198d 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Leah Neukirchen <leah@vuxu.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 04b7d9ded9ea293fc17e0a6f2da87506ff9f8e83 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 15/38] cross-aarch64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..ba14c96bccea 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From bd16f84df8bb753c4d35f315561631204aaef813 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 16/38] cross-arm-linux-gnueabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..5c774e16f430 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From ba65f072a906ffd7826a0e095f72f922f4085e66 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 17/38] cross-arm-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..d6298ab639a4 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 97dbe081240f3344e5a9e8db58d8e2eb2852ed83 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 18/38] cross-arm-linux-musleabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..24df78e8fd8e 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 3ad19e82564c4f96d712ee16ba8fa20bb538824c Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 19/38] cross-arm-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..8093700f909c 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 2795cfe054ff52d57b46d6bea310f5104e155b26 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 20/38] cross-armv7l-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..92665326428b 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 31ddb7287f7fb96b909ecb07efaa94d7285af60c Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 21/38] cross-armv7l-linux-musleabihf: update to gcc 12.2.0.

---
 .../cross-armv7l-linux-musleabihf/template    | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..e5af2c9ccbf2 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 6bb1f2719558478dbdea46f3a34f2076ba15017d Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 22/38] cross-i686-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-i686-linux-musl/template b/srcpkgs/cross-i686-linux-musl/template
index 8be16a230d8d..d624bb7a3254 100644
--- a/srcpkgs/cross-i686-linux-musl/template
+++ b/srcpkgs/cross-i686-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-i686-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-i686-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 28d4929311567c33e2e3686d943f5c14d9585a95 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 23/38] cross-i686-pc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..6a9e54db807a 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,14 +1,15 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -16,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 03b51f9032656a6137fab7e5d1094b6f71d7bd65 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 24/38] cross-mips-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-musl/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..67a5c413396c 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From be389278aaa656ced2b93c3f34cc9584e2cfe169 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 25/38] cross-mips-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..bdf8600ce95b 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="hipperson0 <hipperson0@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From fa7af6e8dd14b8172f7feddf907ac7456bced453 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 26/38] cross-mipsel-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..de49387d517b 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 65ee41f242fb34cc9e9133ea56af9c3f636ac776 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 27/38] cross-mipsel-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..b27ce6475a38 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 9363d3294006d913666f0e36e49b876585b16f93 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 28/38] cross-powerpc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..79579e093b12 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From c355b88c2e47da1a12bdc9dd6bef60ba12b72cf5 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 29/38] cross-powerpc-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..9bb6acd359b6 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 699bdf32af60995b627247742b76e2ec197e34ff Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 30/38] cross-powerpc64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..2d153d00add6 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,16 +1,17 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
  --enable-targets=powerpc-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -18,12 +19,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 46bb2bf953e98e3d9de71ee0ffb4bcfa68936828 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 31/38] cross-powerpc64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 016f18776a6d..e0848fe0bff7 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,30 +1,31 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 68258bf63cc79e03e6c731bd1150f847795105d3 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 32/38] cross-powerpc64le-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 463d7e92d20d..8d8e010e15c0 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,16 +1,17 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
  --enable-targets=powerpcle-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -18,12 +19,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From f216d62133966b5684443d6465c925e35f5b0fa2 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 33/38] cross-powerpc64le-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index c17a3cccfe29..0915e524545f 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,30 +1,31 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 2b3d1e485e0caf49558cd577f52fb36a354389ba Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 34/38] cross-powerpcle-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 9aede3c465ce..687be8a44c6c 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 
@@ -35,6 +36,8 @@ if [ "$XBPS_TARGET_MACHINE" = "ppcle" ]; then
 	broken="Can't build crosstoolchain to itself"
 fi
 
+broken="glibc uses big-endian specific instructions on 32-bit powerpc"
+
 cross-powerpcle-linux-gnu-libc_package() {
 	short_desc+=" - glibc files"
 	nostrip=yes

From 87506551ff6b7a71391d413963cff633d0228464 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 35/38] cross-powerpcle-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index 045cfda987fe..bb984b9c42eb 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 61971b8ac685f81b57855536b97e3e38f41e0842 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:30 -0800
Subject: [PATCH 36/38] cross-x86_64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 8918f3c22a1c..930aaf2a508b 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,14 +1,15 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -16,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From c37686d3096a8a61a4e32597bdf2eef49c612668 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:30 -0800
Subject: [PATCH 37/38] cross-x86_64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..ac5b1c46ab82 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From cdc6514b2bf9eb8001657a8303e53107a953bb50 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Fri, 18 Nov 2022 02:01:19 -0800
Subject: [PATCH 38/38] cross-vpkg-dummy: update to 0.39.

---
 srcpkgs/cross-vpkg-dummy/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/cross-vpkg-dummy/template b/srcpkgs/cross-vpkg-dummy/template
index d83e38dc63ac..aeafb749dd5f 100644
--- a/srcpkgs/cross-vpkg-dummy/template
+++ b/srcpkgs/cross-vpkg-dummy/template
@@ -1,6 +1,6 @@
 # Template file for 'cross-vpkg-dummy'
 pkgname=cross-vpkg-dummy
-version=0.38
+version=0.39
 revision=1
 build_style=meta
 short_desc="Dummy meta-pkg for cross building packages with xbps-src"
@@ -54,8 +54,8 @@ conflicts="
 	gcc-objc++>=0"
 shlib_provides="
 	libgcc_s.so.1
-	libgnat-10.so
-	libgnarl-10.so
+	libgnat-12.so
+	libgnarl-12.so
 	libstdc++.so.6
 	libgfortran.so.5"
 

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (245 preceding siblings ...)
  2022-12-12 18:16 ` [PR PATCH] [Updated] " oreo639
@ 2022-12-12 18:24 ` oreo639
  2022-12-15 22:20 ` sug0
                   ` (17 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-12-12 18:24 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5506 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages gcc11
https://github.com/void-linux/void-packages/pull/34902

gcc: update to 12.2.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.2.0

There are lists of failing builds here: https://github.com/void-linux/void-packages/issues/39809, https://github.com/void-linux/void-packages/issues/39960

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [x] llvm https://github.com/void-linux/void-packages/pull/38694
- [x] m4 https://github.com/void-linux/void-packages/pull/33730
- [x] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [x] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [x] libvirt https://github.com/void-linux/void-packages/pull/38842
- [x] syslinux https://github.com/void-linux/void-packages/pull/38876
- [x] efivar https://github.com/void-linux/void-packages/pull/38874
- [x] gpgme https://github.com/void-linux/void-packages/pull/38825

Known packages that needed to be fixed/updated for gcc12:
- [x] openssh https://github.com/void-linux/void-packages/pull/38849
- [x] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [x] doxygen https://github.com/void-linux/void-packages/pull/38846
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] libproxy https://github.com/void-linux/void-packages/pull/38818
- [x] exempi https://github.com/void-linux/void-packages/pull/38820
- [x] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [x] libunique1 https://github.com/void-linux/void-packages/pull/38848 or https://github.com/void-linux/void-packages/pull/38873
- [x] libwpd https://github.com/void-linux/void-packages/pull/38878
- [x] cglm https://github.com/void-linux/void-packages/pull/39748
- [x] coreboot-utils https://github.com/void-linux/void-packages/pull/39749
- [x] apl https://github.com/void-linux/void-packages/pull/39750
- [x] igt-gpu-tools https://github.com/void-linux/void-packages/pull/39780

Needs to be fixed/updated for binutils:
- [x] grub https://github.com/void-linux/void-packages/pull/38875
- [x] linux-tools https://github.com/void-linux/void-packages/pull/38877
- [x] kcov https://github.com/void-linux/void-packages/pull/39291

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [x] kde
- [x] lxde
- [x] lxqt

You can test the ISOs here:
https://drive.google.com/drive/folders/1ix92CYSLUP-KWjLxltdgG4e8Nu2JCY5n?usp=sharing

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/34902.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc11-34902.patch --]
[-- Type: text/x-diff, Size: 129137 bytes --]

From c687f75617169b107d1086ba508df5632e93924a Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 01/38] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 -----------------
 .../fix-libcollector-without-java.patch       | 53 +++++++++++++++
 .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++--------------
 srcpkgs/binutils/template                     | 25 ++++---
 4 files changed, 87 insertions(+), 117 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
 create mode 100644 srcpkgs/binutils/patches/fix-libcollector-without-java.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/fix-libcollector-without-java.patch b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
new file mode 100644
index 000000000000..54384875f358
--- /dev/null
+++ b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
@@ -0,0 +1,53 @@
+From 49ddd814ac1071af7c4f45d5f8398b91862f2c7f Mon Sep 17 00:00:00 2001
+From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
+Date: Wed, 17 Aug 2022 19:55:23 -0700
+Subject: [PATCH] gprofng: fix bug 29479 Collection fails when built without
+ java support
+
+gprofng/ChangeLog
+2022-08-17  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>
+
+	PR gprofng/29479
+	* libcollector/collector.c: Add #if defined(GPROFNG_JAVA_PROFILING) for
+	java specific code.
+	* libcollector/unwind.c: Likewise.
+---
+ gprofng/libcollector/collector.c | 2 ++
+ gprofng/libcollector/unwind.c    | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/gprofng/libcollector/collector.c b/gprofng/libcollector/collector.c
+index 93c9d3330de5..ceff2c1caccb 100644
+--- a/gprofng/libcollector/collector.c
++++ b/gprofng/libcollector/collector.c
+@@ -913,8 +913,10 @@ __collector_open_experiment (const char *exp, const char *params, sp_origin_t or
+   __collector_ext_unwind_key_init (1, NULL);
+ 
+   /* start java attach if suitable */
++#if defined(GPROFNG_JAVA_PROFILING)
+   if (exp_origin == SP_ORIGIN_DBX_ATTACH)
+     __collector_jprofile_start_attach ();
++#endif
+   start_sec_time = CALL_UTIL (time)(NULL);
+   __collector_start_time = collector_interface.getHiResTime ();
+   TprintfT (DBG_LT0, "\t__collector_open_experiment; resetting start_time\n");
+diff --git a/gprofng/libcollector/unwind.c b/gprofng/libcollector/unwind.c
+index 119243788020..f8e11823c81e 100644
+--- a/gprofng/libcollector/unwind.c
++++ b/gprofng/libcollector/unwind.c
+@@ -557,6 +557,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+   int size = max_frame_size;
+ 
+ #define MIN(a,b) ((a)<(b)?(a):(b))
++#if defined(GPROFNG_JAVA_PROFILING)
+   /* get Java info */
+   if (__collector_java_mode && __collector_java_asyncgetcalltrace_loaded && context && !pseudo_context)
+     {
+@@ -569,6 +570,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+ 	  size -= sz;
+ 	}
+     }
++#endif
+ 
+   /* get native stack */
+   if (context)
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..c355a5fc8016 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkgconf"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -35,15 +36,21 @@ do_configure() {
 	local conf
 
 	if [ "$CHROOT_READY" ]; then
-		conf+=" --with-debuginfod"
+		conf+=" --with-debuginfod --enable-shared"
 	else
-		conf+=" --without-debuginfod --disable-install-libbfd"
+		conf+=" --without-debuginfod --disable-shared --disable-install-libbfd"
 	fi
 	if [ "$CROSS_BUILD" ]; then
 		# we don't want --with-sysroot=${XBPS_CROSS_BASE} like gnu-configure
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	# gprofng currently only supports x86 and aarch64 glibc.
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64|i386|aarch64) conf+=" --enable-gprofng" ;;
+		*) conf+=" --disable-gprofng" ;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"
@@ -76,13 +83,14 @@ do_configure() {
 		--libdir=/usr/lib \
 		--mandir=/usr/share/man \
 		--infodir=/usr/share/info \
+		--sysconfdir=/etc \
 		--disable-werror \
-		--disable-shared \
 		--disable-nls \
 		--enable-threads \
 		--enable-plugins \
 		--enable-relro \
 		--enable-gold \
+		--enable-new-dtags \
 		--enable-deterministic-archives \
 		--enable-64-bit-bfd \
 		--enable-ld=default \
@@ -142,7 +150,8 @@ binutils-devel_package() {
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/*.a"
-		vmove "usr/lib/*.so"
+		vmove "usr/lib/libbfd.so"
+		vmove "usr/lib/libopcodes.so"
 	}
 }
 

From ae3e487ca96962a4105fa9458e2529a9b7d21ac9 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 02/38] gdb: resolve conflict with binutils 2.39

---
 srcpkgs/gdb/template | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/gdb/template b/srcpkgs/gdb/template
index 9c5f17ffc519..b666348fea19 100644
--- a/srcpkgs/gdb/template
+++ b/srcpkgs/gdb/template
@@ -1,7 +1,7 @@
 # Template file for 'gdb'
 pkgname=gdb
 version=12.1
-revision=2
+revision=3
 build_style=gnu-configure
 pycompile_dirs="/usr/share/gdb/python"
 configure_args="--disable-werror --disable-nls --with-system-readline
@@ -48,7 +48,8 @@ vopt_conflict debuginfod static
 
 post_install() {
 	# resolve conflicts with binutils
-	rm -r ${DESTDIR}/usr/{include,lib,share/info/bfd.info*}
+	rm -rf ${DESTDIR}/usr/{include,lib}
+	rm -rf ${DESTDIR}/usr/share/info/{bfd,ctf-spec}.info*
 }
 
 gdb-common_package() {

From 52346ba1e435b332bc09397975de9ebd7b57a7be Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 03/38] gcc: update to 12.2.0.

---
 common/shlibs                                 | 10 +--
 srcpkgs/gcc/files/gccgo-musl.patch            | 71 +++------------
 srcpkgs/gcc/files/libgnarl-musl.patch         | 18 ++--
 srcpkgs/gcc/files/libssp-musl.patch           | 10 +--
 .../gcc/patches/force-override-clocale.patch  | 21 +++++
 srcpkgs/gcc/patches/libffi_gnulinux.patch     | 11 ---
 .../gcc/patches/libgcc-ibm128-no-tag.patch    | 10 ++-
 srcpkgs/gcc/patches/mips-sgidefs_h.patch      |  2 +-
 srcpkgs/gcc/template                          | 87 +++++++++----------
 9 files changed, 101 insertions(+), 139 deletions(-)
 create mode 100644 srcpkgs/gcc/patches/force-override-clocale.patch
 delete mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch

diff --git a/common/shlibs b/common/shlibs
index ca7f949876a8..eb361f40abe4 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -60,7 +60,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
 libitm.so.1 libitm-4.7.3_1
 liblto_plugin.so.0 gcc-4.7.3_1
 libgcc_s.so.1 libgcc-4.4.0_1
-libgo.so.16 libgo-10.2.0_1
+libgo.so.21 libgo-12.2.0_1
 libgccjit.so.0 libgccjit-10.2.1pre1_1
 libperl.so.5.36 perl-5.36.0_1
 libgmp.so.10 gmp-5.0.1_1
@@ -858,8 +858,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
 libquadmath.so.0 libquadmath-4.4.0_1
 libgfortran.so.5 libgfortran-8.2.0_1
-libgnarl-10.so libada-10.2.0_1
-libgnat-10.so libada-10.2.0_1
+libgnarl-12.so libada-12.2.0_1
+libgnat-12.so libada-12.2.0_1
 libwebp.so.7 libwebp-0.6.0_1
 libwebpmux.so.3 libwebp-0.6.0_1
 libwebpdemux.so.2 libwebp-0.5.0_1
@@ -1713,8 +1713,8 @@ libextractor.so.3 libextractor-1.1_1
 libextractor_common.so.1 libextractor-1.1_1
 libpano13.so.3 libpano13-2.9.19_1
 libubsan.so.1 libsanitizer-8.2.0_1
-libtsan.so.0 libsanitizer-6.3.0_1
-libasan.so.6 libsanitizer-10.2.0_1
+libtsan.so.2 libsanitizer-12.2.0_1
+libasan.so.8 libsanitizer-12.2.0_1
 liblsan.so.0 libsanitizer-6.3.0_1
 libvtv.so.0 libvtv-6.3.0_1
 libatomic.so.1 libatomic-4.9.0_1
diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
index 9762739615af..12ec68dd8aa3 100644
--- a/srcpkgs/gcc/files/gccgo-musl.patch
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -53,17 +53,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  	p := sysMmap(addr, n, prot, flags, fd, off)
  	if uintptr(p) == _MAP_FAILED {
  		return nil, errno()
---- a/libgo/go/runtime/signal_gccgo.go
-+++ b/libgo/go/runtime/signal_gccgo.go
-@@ -111,7 +111,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")
 --- a/libgo/go/syscall/errstr.go
 +++ b/libgo/go/syscall/errstr.go
 @@ -5,7 +5,6 @@
@@ -140,55 +129,6 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  		plwoff = &lwoff
  	}
  	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
---- 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
---- a/libgo/runtime/go-signal.c	2020-07-23 08:35:19.004402840 +0200
-+++ b/libgo/runtime/go-signal.c	2020-08-09 21:35:54.352886232 +0200
-@@ -224,7 +224,11 @@
- #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;
-+	#ifdef __PPC64__
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
-+	#else
-+		ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
-+	#endif
- #elif defined(__PPC__) && defined(_AIX)
- 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
- #elif defined(__aarch64__) && defined(__linux__)
-@@ -333,7 +337,7 @@
- 		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(__linux__) && defined(__GLIBC__)
- 	  {
- 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- 		int i;
 --- a/libgo/runtime/runtime.h
 +++ b/libgo/runtime/runtime.h
 @@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
@@ -220,3 +160,14 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
  #if defined(HAVE_SYS_UTSNAME_H)
  #include <sys/utsname.h>
  #endif
+--- a/libgo/go/runtime/os_linux.go
++++ b/libgo/go/runtime/os_linux.go
+@@ -365,7 +365,7 @@ func setThreadCPUProfiler(hz int32) {
+ 	var sevp _sigevent
+ 	sevp.sigev_notify = _SIGEV_THREAD_ID
+ 	sevp.sigev_signo = _SIGPROF
+-	*((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
++	*((*int32)(unsafe.Pointer(&sevp.__sev_fields))) = int32(mp.procid)
+ 	ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
+ 	if ret != 0 {
+ 		// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch
index 99a734c42c90..91c95949e0e9 100644
--- a/srcpkgs/gcc/files/libgnarl-musl.patch
+++ b/srcpkgs/gcc/files/libgnarl-musl.patch
@@ -5,7 +5,7 @@ Reason: Patch libgnarl to not use function missing from musl.
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
 --- a/gcc/ada/libgnarl/s-osinte__linux.ads	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-osinte__linux.ads	2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
     PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
     PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
  
@@ -18,7 +18,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
     function pthread_rwlock_init
       (mutex : access pthread_rwlock_t;
        attr  : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
        protocol : int) return int;
     pragma Import (C, pthread_mutexattr_setprotocol);
  
@@ -33,7 +33,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
 diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
 --- a/gcc/ada/libgnarl/s-taprop__linux.adb	2018-01-11 00:55:25.000000000 -0800
 +++ b/gcc/ada/libgnarl/s-taprop__linux.adb	2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Oper
     pragma Import
       (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
  
@@ -43,7 +43,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
     --  We do not have pragma Linker_Options ("-lcap"); here, because this
     --  library is not present on many Linux systems. 'libcap' is the Linux
     --  "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Oper
     --  Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
     --  GNU/Linux, so we map 0 .. 98 to 1 .. 99.
  
@@ -76,13 +76,13 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
 -      return Ceiling_Support;
 -   end Get_Ceiling_Support;
 -
--   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (Off, "non-preelaborable call not allowed*");
 -   Ceiling_Support : constant Boolean := Get_Ceiling_Support;
--   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+-   pragma Warnings (On, "non-preelaborable call not allowed*");
     --  True if the locking policy is Ceiling_Locking, and the current process
     --  has permission to use this policy. The process has permission if it is
     --  running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Oper
     -- Init_Mutex --
     ----------------
  
@@ -92,7 +92,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
        Mutex_Attr : aliased pthread_mutexattr_t;
        Result, Result_2 : C.int;
  
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Oper
           return Result;
        end if;
  
@@ -110,7 +110,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
           Result := pthread_mutexattr_setprotocol
             (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
           pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Oper
              Result := pthread_rwlockattr_init (RWlock_Attr'Access);
              pragma Assert (Result = 0);
  
diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch
index b21a2c29e57c..99f248401a1c 100644
--- a/srcpkgs/gcc/files/libssp-musl.patch
+++ b/srcpkgs/gcc/files/libssp-musl.patch
@@ -2,9 +2,9 @@ First part taken from Alpine.
 
 Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
 
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -874,10 +874,15 @@ proper position among the other output files.  */
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,10 +984,15 @@ proper position among the other output f
  #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  #endif
  
@@ -22,10 +22,10 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
  #else
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  		       "|fstack-protector-strong|fstack-protector-explicit" \
-@@ -1155,7 +1160,7 @@ static const char *cc1_options =
+@@ -1280,7 +1285,7 @@ static const char *cc1_options =
   %{-version:--version}\
   %{-help=*:--help=%*}\
-  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
 - %{fsyntax-only:-o %j} %{-param*}\
 + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
   %{coverage:-fprofile-arcs -ftest-coverage}\
diff --git a/srcpkgs/gcc/patches/force-override-clocale.patch b/srcpkgs/gcc/patches/force-override-clocale.patch
new file mode 100644
index 000000000000..8af8a7150dd9
--- /dev/null
+++ b/srcpkgs/gcc/patches/force-override-clocale.patch
@@ -0,0 +1,21 @@
+This is necessary when building a gnu cross compiler for a musl target.
+Otherwise, even if clocale manually is set to gnu, it will be reset to generic
+when the test is performed using AC_EGREP_CPP().
+--- a/libstdc++-v3/configure
++++ b/libstdc++-v3/configure
+@@ -16493,6 +16493,7 @@ fi
+ 
+   # Sanity check model, and test for special functionality.
+   if test $enable_clocale_flag = gnu; then
++    if test $enable_clocale = auto; then
+     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+ 
+@@ -16509,6 +16510,7 @@ else
+   enable_clocale_flag=generic
+ fi
+ rm -f conftest*
++    fi
+ 
+ 
+     # Set it to scream when it hurts.
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
deleted file mode 100644
index 98245bd5be1a..000000000000
--- a/srcpkgs/gcc/patches/libffi_gnulinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libffi/src/closures.c
-+++ b/libffi/src/closures.c
-@@ -34,7 +34,7 @@
- #include <ffi_common.h>
-
- #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
--# if __gnu_linux__ && !defined(__ANDROID__)
-+# if __linux__ && !defined(__ANDROID__)
- /* This macro indicates it may be forbidden to map anonymous memory
-    with both write and execute permission.  Code compiled when this
-    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
index bdf5c75d917d..26d80356ad0d 100644
--- a/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
+++ b/srcpkgs/gcc/patches/libgcc-ibm128-no-tag.patch
@@ -29,10 +29,14 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
 index 4f6d4c4..fa93bb6 100644
 --- a/libgcc/config/rs6000/t-linux
 +++ b/libgcc/config/rs6000/t-linux
-@@ -1,3 +1,3 @@
+@@ -1,6 +1,6 @@
  SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
  
--HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
-+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128
++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute
+ 
+ # This is a way of selecting -mcmodel=small for ppc64, which gives
+ # smaller and faster libgcc code.  Directly specifying -mcmodel=small
+
 -- 
 2.24.0
diff --git a/srcpkgs/gcc/patches/mips-sgidefs_h.patch b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
index dddfe10e8c06..cd0ae7a380df 100644
--- a/srcpkgs/gcc/patches/mips-sgidefs_h.patch
+++ b/srcpkgs/gcc/patches/mips-sgidefs_h.patch
@@ -3,7 +3,7 @@
 @@ -42,7 +42,7 @@
  #define _MIPS_SIM_NABI32	2
  #define _MIPS_SIM_ABI64		3
- #elif !defined(__OpenBSD__)
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
 -# include <sgidefs.h>
 +# include <asm/sgidefs.h>
  #endif
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index ab3643de4f98..a20af7c0ef2e 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -3,18 +3,14 @@
 # which use the version number.
 
 pkgname=gcc
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
-revision=3
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
+version=12.2.0
+revision=1
+_minorver="${version%.*}"
 _majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 create_wrksrc=yes
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -22,16 +18,16 @@ homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 
 nopie=yes
 lib32disabled=yes
@@ -52,8 +48,11 @@ if [ "$CHROOT_READY" ]; then
 	hostmakedepends="tar texinfo perl flex"
 else
 	_have_gccgo=no
+	# libzstd fails to link in bootstrap with glibc 2.36
+	# when zlib has been compiled with glibc 2.32.
+	LDFLAGS="-lzstd -pthread"
 fi
-makedepends="zlib-devel"
+makedepends="zlib-devel libzstd-devel"
 depends="binutils libgcc-devel-${version}_${revision}
  libstdc++-devel-${version}_${revision} libssp-devel-${version}_${revision}"
 checkdepends="dejagnu"
@@ -70,13 +69,13 @@ if [ "$build_option_gnatboot" ]; then
 	case "$XBPS_TARGET_MACHINE" in
 	x86_64)
 		_gnat_tarball="gnat-gpl-2017-x86_64-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/591c6d80c7a447af2deed1d7>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/9682e2e1f2f232ce03fe21d77b14c37a0de5649b?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" b942bcac20dea39748b39f8b624d9619f60a8dee2e8195dbe3829c835b0956e6"
 		build_options_default="gnatboot"
 		;;
 	i686)
 		_gnat_tarball="gnat-gpl-2014-x86-linux-bin.tar.gz"
-		distfiles+=" http://mirrors.cdn.adacore.com/art/564b3e9dc8e196b040fbe248>$_gnat_tarball"
+		distfiles+=" https://community.download.adacore.com/v1/c5e9e6fdff5cb77ed90cf8c62536653e27c0bed6?filename=$_gnat_tarball>$_gnat_tarball"
 		checksum+=" 3b693510f5d22a240abb3034934c1adbd80ccd6e4f61a4f491cc408fdfd9c042"
 		build_options_default="gnatboot"
 		;;
@@ -155,8 +154,8 @@ if [ "$CROSS_BUILD" ]; then
 fi
 
 post_extract() {
-	mv gcc-${version/pre/_pre}/* gcc-${version/pre/_pre}/.??* .
-	rmdir gcc-${version/pre/_pre}
+	mv gcc-${version}/* gcc-${version}/.??* .
+	rmdir gcc-${version}
 	mv gmp-${_gmp_version} gmp
 	mv mpfr-${_mpfr_version} mpfr
 	mv mpc-${_mpc_version} mpc
@@ -186,9 +185,9 @@ pre_configure() {
 	sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
 
 	if [ "$XBPS_TARGET_LIBC" = musl ]; then
-		patch -p1 -i ${FILESDIR}/libgnarl-musl.patch
-		patch -p1 -i ${FILESDIR}/libssp-musl.patch
-		patch -p1 -i ${FILESDIR}/gccgo-musl.patch
+		for p in ${FILESDIR}/*-musl.patch; do
+			patch -p1 -i $p
+		done
 	fi
 }
 do_configure() {
@@ -343,16 +342,16 @@ do_install() {
 
 	# Make version a symlink of major version to make all versions
 	# from the same series work automagically.
-	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver} \
+	mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${version} \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver}
 	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver} \
-		${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}
+		${DESTDIR}/usr/lib/gcc/${_triplet}/${version}
 
 	# Ditto for c++ headers.
-	mv ${DESTDIR}/usr/include/c++/${_patchver} \
+	mv ${DESTDIR}/usr/include/c++/${version} \
 		${DESTDIR}/usr/include/c++/${_minorver}
 	ln -sfr ${DESTDIR}/usr/include/c++/${_minorver} \
-		${DESTDIR}/usr/include/c++/${_patchver}
+		${DESTDIR}/usr/include/c++/${version}
 
 	# cc symlink
 	ln -sfr ${DESTDIR}/usr/bin/gcc ${DESTDIR}/usr/bin/cc
@@ -361,7 +360,7 @@ do_install() {
 
 	# lto plugin symlink
 	vmkdir usr/lib/bfd-plugins
-	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}/liblto_plugin.so \
+	ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${version}/liblto_plugin.so \
 		${DESTDIR}/usr/lib/bfd-plugins
 
 	# Remove "fixed" header
@@ -372,13 +371,9 @@ do_install() {
 	rm -f ${DESTDIR}/usr/lib/libffi*
 	rm -f ${DESTDIR}/usr/share/man/man3/ffi*
 
-	# Remove all python scripts in libdir.
-	rm -f ${DESTDIR}/usr/lib/*.py
-
-	# Remove more python stuff.
-	if [ -d ${DESTDIR}/usr/share/gcc-${_patchver}/python ]; then
-		rm -rf ${DESTDIR}/usr/share/gcc-${_patchver}/python
-	fi
+	# Move libstdc++ gdb helpers to location where gdb can autoload them
+	mkdir -p ${DESTDIR}/usr/share/gdb/auto-load/usr/lib
+	mv ${DESTDIR}/usr/lib/*.py ${DESTDIR}/usr/share/gdb/auto-load/usr/lib
 
 	# Install c89 and c99 wrappers and its manpages, from NetBSD.
 	for f in c89 c99; do
@@ -397,7 +392,7 @@ gcc-ada_package() {
 	depends="gcc>=${_minorver} libada-devel>=${_minorver}"
 	short_desc+=" - Ada compiler frontend"
 	pkg_install() {
-		for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
+		for f in gnat{,bind,chop,clean,kr,link,ls,make,name,prep}; do
 			vmove usr/bin/${f}
 		done
 	}
@@ -450,7 +445,7 @@ gcc-fortran_package() {
 		if [ "$CROSS_BUILD" ]; then
 			# A number of OMP modules are not built when cross
 			# compiling gcc. Copy them from the cross compiler.
-			local src="/usr/lib/gcc/${_triplet}/${_patchver}/finclude"
+			local src="/usr/lib/gcc/${_triplet}/${version}/finclude"
 			local dst="usr/lib/gcc/${_triplet}/${_minorver}/finclude"
 			for f in omp_lib.f90 omp_lib.h omp_lib.mod omp_lib_kinds.mod \
 				openacc.f90 openacc.mod openacc_kinds.mod openacc_lib.h; do
@@ -517,7 +512,7 @@ libgfortran_package() {
 	short_desc+=" - Fortran library"
 	pkg_install() {
 		vmove "usr/lib/libgfortran.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -538,7 +533,7 @@ libgo_package() {
 	nostrip=yes
 	pkg_install() {
 		vmove "usr/lib/libgo.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -554,7 +549,7 @@ libobjc_package() {
 	short_desc+=" - Objective-C library"
 	pkg_install() {
 		vmove "usr/lib/libobjc.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -573,7 +568,7 @@ libquadmath_package() {
 	short_desc+=" - quadmath library"
 	pkg_install() {
 		vmove "usr/lib/libquadmath.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -615,7 +610,7 @@ libgcc_package() {
 	noverifyrdeps=yes
 	pkg_install() {
 		vmove "usr/lib/libgcc_s.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -646,7 +641,7 @@ libgomp_package() {
 	short_desc+=" - OpenMP v4.0 library"
 	pkg_install() {
 		vmove "usr/lib/libgomp*.so.*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -701,7 +696,7 @@ libssp_package() {
 	short_desc+=" - SSP (StackSmashingProtection) library"
 	pkg_install() {
 		vmove "usr/lib/libssp.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }
 
@@ -718,7 +713,9 @@ libstdc++-devel_package() {
 libstdc++_package() {
 	short_desc+=" - Standard C++ Library"
 	pkg_install() {
+		vmove usr/share/gdb
+		vmove usr/share/gcc-${version}/python
 		vmove "usr/lib/libstdc++.so*"
-		vlicense ${wrksrc}/COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
+		vlicense COPYING.RUNTIME RUNTIME.LIBRARY.EXCEPTION
 	}
 }

From a651087b2c83fa33f4900c3563f08bca60adca05 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:11 -0700
Subject: [PATCH 04/38] libtool: rebuild for gcc 12

---
 srcpkgs/libtool/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index fc5c53a9c3e9..aebad9294eef 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
 version=2.4.7
-revision=1
+revision=2
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz"
 depends="tar sed"

From eee501ae2e2006c5d75f3b95da6533d14c495780 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 05/38] libiberty-devel: update to 20220713.

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 7e01bbb851fd..d9618e3806ba 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 build_wrksrc=libiberty
 build_style=gnu-configure
@@ -10,7 +10,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From bb15379df0b58d5422beb485d9c8866e3cd30465 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 06/38] glibc: update to 2.36.

---
 common/shlibs                                 |  60 ++--
 ...e-hash-style-both-for-building-glibc.patch |  51 ++++
 .../glibc/patches/glibc-c-utf8-locale.patch   | 286 ------------------
 srcpkgs/glibc/template                        |  66 ++--
 4 files changed, 109 insertions(+), 354 deletions(-)
 create mode 100644 srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
 delete mode 100644 srcpkgs/glibc/patches/glibc-c-utf8-locale.patch

diff --git a/common/shlibs b/common/shlibs
index eb361f40abe4..7ce556ce7ac2 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -17,38 +17,38 @@
 # one (order top->bottom) is preferred over the next ones.
 #
 libc.so musl-1.1.24_7
-libc.so.6 glibc-2.32_1
-libm.so.6 glibc-2.32_1
-libpthread.so.0 glibc-2.32_1
-librt.so.1 glibc-2.32_1
-libdl.so.2 glibc-2.32_1
-ld-linux-x86-64.so.2 glibc-2.32_1 x86_64
-ld-linux.so.2 glibc-2.32_1 i686
-ld-linux.so.3 glibc-2.32_1 armv5tel
-ld-linux-aarch64.so.1 glibc-2.32_1 aarch64
-ld64.so.2 glibc-2.32_1 ppc64
-ld.so.1 glibc-2.32_1 mips
-ld.so.1 glibc-2.32_1 ppc
-ld-linux-armhf.so.3 glibc-2.32_1
-libresolv.so.2 glibc-2.32_1
-libanl.so.1 glibc-2.32_1
-libthread_db.so.1 glibc-2.32_1
-libutil.so.1 glibc-2.32_1
-libnsl.so.1 glibc-2.32_1
-libnss_db.so.2 glibc-2.32_1
-libnss_files.so.2 glibc-2.32_1
-libnss_compat.so.2 glibc-2.32_1
-libnss_dns.so.2 glibc-2.32_1
-libnss_hesiod.so.2 glibc-2.32_1
-libcrypt.so.1 glibc-2.32_1
-libBrokenLocale.so.1 glibc-2.32_1
+libc.so.6 glibc-2.36_1
+libm.so.6 glibc-2.36_1
+libpthread.so.0 glibc-2.36_1
+librt.so.1 glibc-2.36_1
+libdl.so.2 glibc-2.36_1
+ld-linux-x86-64.so.2 glibc-2.36_1 x86_64
+ld-linux.so.2 glibc-2.36_1 i686
+ld-linux.so.3 glibc-2.36_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.36_1 aarch64
+ld64.so.2 glibc-2.36_1 ppc64
+ld.so.1 glibc-2.36_1 mips
+ld.so.1 glibc-2.36_1 ppc
+ld-linux-armhf.so.3 glibc-2.36_1
+libresolv.so.2 glibc-2.36_1
+libanl.so.1 glibc-2.36_1
+libthread_db.so.1 glibc-2.36_1
+libutil.so.1 glibc-2.36_1
+libnsl.so.1 glibc-2.36_1
+libnss_db.so.2 glibc-2.36_1
+libnss_files.so.2 glibc-2.36_1
+libnss_compat.so.2 glibc-2.36_1
+libnss_dns.so.2 glibc-2.36_1
+libnss_hesiod.so.2 glibc-2.36_1
+libcrypt.so.1 glibc-2.36_1
+libBrokenLocale.so.1 glibc-2.36_1
 libSimGearCore.so.2020.3.17 simgear-2020.3.17_1
 libSimGearScene.so.2020.3.17 simgear-2020.3.17_1
-libmemusage.so glibc-2.32_1
-libSegFault.so glibc-2.32_1
-libpcprofile.so glibc-2.32_1
-libcidn.so.1 glibc-2.32_1
-libmvec.so.1 glibc-2.32_1
+libmemusage.so glibc-2.36_1
+libSegFault.so glibc-2.36_1
+libpcprofile.so glibc-2.36_1
+libcidn.so.1 glibc-2.36_1
+libmvec.so.1 glibc-2.36_1
 libcddgmp.so.0 cddlib-0.94m_1
 libcdd.so.0 cddlib-0.94m_1
 libz.so.1 zlib-1.2.3_1
diff --git a/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch b/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
new file mode 100644
index 000000000000..9c5553e92609
--- /dev/null
+++ b/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash-style-both-for-building-glibc.patch
@@ -0,0 +1,51 @@
+Temporary workaround for EAC bug.
+
+See: https://sourceware.org/bugzilla/show_bug.cgi?id=29456
+
+From 8e90e2cc5e57d7ca3a40602d278e9642a8b66716 Mon Sep 17 00:00:00 2001
+From: oreo639 <oreo6391@gmail.com>
+Date: Tue, 13 Sep 2022 14:30:35 -0700
+Subject: [PATCH] Revert "Do not use --hash-style=both for building glibc
+ shared objects"
+
+This reverts commit e47de5cb2d4dbecb58f569ed241e8e95c568f03c.
+---
+ Makeconfig     |  9 +++++++++
+ Makerules      |  7 +++++++
+ 5 files changed, 61 insertions(+)
+
+diff --git a/Makeconfig b/Makeconfig
+index ba70321af1..e2131d4389 100644
+--- a/Makeconfig
++++ b/Makeconfig
+@@ -371,6 +371,13 @@ dt-relr-ldflag =
+ no-dt-relr-ldflag =
+ endif
+ 
++# For the time being we unconditionally use 'both'.  At some time we
++# should declare statically linked code as 'out of luck' and compile
++# with --hash-style=gnu only.
++hashstyle-LDFLAGS = -Wl,--hash-style=both
++LDFLAGS.so += $(hashstyle-LDFLAGS)
++LDFLAGS-rtld += $(hashstyle-LDFLAGS)
++
+ ifeq (no,$(build-pie-default))
+ pie-default = $(no-pie-ccflag)
+ else # build-pie-default
+diff --git a/Makerules b/Makerules
+index d1e139d03c..44134e37ce 100644
+--- a/Makerules
++++ b/Makerules
+@@ -558,6 +558,9 @@ $(common-objpfx)shlib.lds: $(common-objpfx)config.make $(..)Makerules
+ 		  -Wl,--verbose 2>/dev/null | \
+ 	  sed > $@T \
+ 	      -e '/^=========/,/^=========/!d;/^=========/d' \
++		   -e 's/^.*\.gnu\.hash[ 	]*:.*$$/  .note.ABI-tag : { *(.note.ABI-tag) } &/' \
++		   -e '/^[ 	]*\.hash[ 	]*:.*$$/{h;d;}' \
++		   -e '/DATA_SEGMENT_ALIGN/{H;g}' \
+ 	      -e 's/^.*\*(\.dynbss).*$$/& \
+ 		 PROVIDE(__start___libc_freeres_ptrs = .); \
+ 		 *(__libc_freeres_ptrs) \
+-- 
+2.37.3
+
diff --git a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch b/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
deleted file mode 100644
index 7215e1558b62..000000000000
--- a/srcpkgs/glibc/patches/glibc-c-utf8-locale.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-Short description: Add C.UTF-8 support.
-Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
-Origin: PATCH
-Upstream status: not-submitted
-
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-
-Note that this patch does not provide full code-point sorting as
-expected.
-
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-From 2eda7b462b415105f5a05c1323372d4e39d46439 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH] Add a C.UTF-8 locale
-
----
- localedata/SUPPORTED |   1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 8ca023e..2a78391 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000..fdf460e
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title      "C locale"
-+source     ""
-+address    ""
-+contact    ""
-+email      "mfabian@redhat.com"
-+tel        ""
-+fax        ""
-+language   "C"
-+territory  ""
-+revision   "1.0"
-+date       "2015-08-10"
-+%
-+category  "i18n:2012";LC_IDENTIFICATION
-+category  "i18n:2012";LC_CTYPE
-+category  "i18n:2012";LC_COLLATE
-+category  "i18n:2012";LC_TIME
-+category  "i18n:2012";LC_NUMERIC
-+category  "i18n:2012";LC_MONETARY
-+category  "i18n:2012";LC_MESSAGES
-+category  "i18n:2012";LC_PAPER
-+category  "i18n:2012";LC_NAME
-+category  "i18n:2012";LC_ADDRESS
-+category  "i18n:2012";LC_TELEPHONE
-+category  "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol     "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol     "<U0024>"
-+mon_decimal_point   "<U002E>"
-+mon_thousands_sep   ""
-+mon_grouping        -1
-+positive_sign       ""
-+negative_sign       "<U002D>"
-+int_frac_digits     -1
-+frac_digits         -1
-+p_cs_precedes       -1
-+int_p_sep_by_space  -1
-+p_sep_by_space      -1
-+n_cs_precedes       -1
-+int_n_sep_by_space  -1
-+n_sep_by_space      -1
-+p_sign_posn         -1
-+n_sign_posn         -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point   "<U002E>"
-+thousands_sep   ""
-+grouping        -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday       "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+            "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+            "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+            "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day         "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+            "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+            "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+            "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+            "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+            "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon       "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+            "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+            "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+            "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+            "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+            "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon         "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+            "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+            "<U004D><U0061><U0072><U0063><U0068>";/
-+            "<U0041><U0070><U0072><U0069><U006C>";/
-+            "<U004D><U0061><U0079>";/
-+            "<U004A><U0075><U006E><U0065>";/
-+            "<U004A><U0075><U006C><U0079>";/
-+            "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+            "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+            "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+            "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week    7;19971201;4
-+first_weekday	1
-+first_workday	1
-+
-+% Appropriate date and time representation (%c)
-+%	"%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+%	"%m/%d/%y"
-+d_fmt   "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+%	"%H:%M:%S"
-+t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+%	"%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p)      "AM"/"PM"
-+%
-+am_pm	"<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr  "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr  "<U0059><U0065><U0073>"
-+nostr   "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height   297
-+width    210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt    "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement    1
-+END LC_MEASUREMENT
-+
--- 
-2.4.3
-
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index c62a4d2aedf1..6cd4c0980cbb 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,14 +1,16 @@
 # Template file for 'glibc'
 pkgname=glibc
-version=2.32
-revision=2
+version=2.36
+revision=1
+_patchver="72-g0f90d6204d"
+wrksrc="glibc-${version}-${_patchver}"
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
 homepage="http://www.gnu.org/software/libc"
-distfiles="${GNU_SITE}/glibc/glibc-${version}.tar.xz"
-checksum=1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+distfiles="https://vasilek.cz/paste/glibc-${version}-${_patchver}.tar.xz"
+checksum=656200722d5ba968b4888a2d2950719d72c86290fd0479f61897d25b7db2cb57
 # Do not strip these files, objcopy errors out.
 nostrip_files="
 	XBS5_ILP32_OFFBIG
@@ -20,27 +22,28 @@ nostrip_files="
 	POSIX_V6_LP64_OFF64
 	POSIX_V7_LP64_OFF64
 	XBS5_LP64_OFF64
-	ld-${version}.so
-	libdl-${version}.so
-	libanl-${version}.so
-	libcidn-${version}.so
-	libresolv-${version}.so
-	libcrypt-${version}.so
-	libpthread-${version}.so
-	libm-${version}.so
-	libutil-${version}.so
-	libthread_db-1.0.so
-	librt-${version}.so
-	libnsl-${version}.so
-	libc-${version}.so
-	libBrokenLocale-${version}.so
-	libnss_compat-${version}.so
-	libnss_db-${version}.so
-	libnss_dns-${version}.so
-	libnss_files-${version}.so
-	libnss_hesiod-${version}.so
-	libnss_nisplus-${version}.so
-	libnss_nis-${version}.so"
+	ld-linux-x86-64.so.2
+	ld-linux.so.2
+	ld-linux.so.3
+	ld-linux-aarch64.so.1
+	ld64.so.2
+	ld.so.1
+	ld-linux-armhf.so.3
+	libresolv.so.2
+	libcrypt.so.1
+	libm.so.6
+	libthread_db.so.1
+	libnsl.so.1
+	libc.so.6
+	libc_malloc_debug.so.0
+	libmemusage.so
+	libmvec.so.1
+	libBrokenLocale.so.1
+	libnss_compat.so.2
+	libnss_db.so.2
+	libnss_dns.so.2
+	libnss_files.so.2
+	libnss_hesiod.so.2"
 
 conf_files="
 	/etc/rpc
@@ -54,7 +57,6 @@ lib32files="/usr/lib/gconv/gconv-modules"
 lib32symlinks="ld-linux.so.2"
 # There's no point in building this for musl.
 archs="~*-musl"
-nopie=yes
 
 do_configure() {
 	mkdir build
@@ -163,18 +165,6 @@ do_install() {
 	rm -f ${DESTDIR}/usr/bin/z{dump,ic}
 
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
-
-	# Create xbps.d(5) arch override file for 32-bit architectures
-	# 32-bit userlands may be used with 64-bit kernels and then
-	# xbps will report an incorrect architecture by default
-	case "$XBPS_TARGET_MACHINE" in
-		i686|ppc|ppcle|armv*)
-			vmkdir usr/share/xbps.d
-			echo "architecture=${XBPS_TARGET_MACHINE}" > \
-				${DESTDIR}/usr/share/xbps.d/arch-32bit.conf
-			;;
-		*) ;;
-	esac
 }
 
 glibc-devel_package() {

From b055d3cc962a566c64b261dd2a609eadce33f3ca Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 07/38] musl: add support for SIGEV_THREAD_ID timers

https://git.musl-libc.org/cgit/musl/commit/?id=7c71792e87691451f2a6b76348e83ad1889f1dcb
---
 ...d-support-for-SIGEV_THREAD_ID-timers.patch | 74 +++++++++++++++++++
 srcpkgs/musl/template                         |  2 +-
 2 files changed, 75 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch

diff --git a/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
new file mode 100644
index 000000000000..e20dff5ba0d4
--- /dev/null
+++ b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
@@ -0,0 +1,74 @@
+From 7c71792e87691451f2a6b76348e83ad1889f1dcb Mon Sep 17 00:00:00 2001
+From: James Y Knight <jyknight@google.com>
+Date: Sun, 30 Jun 2019 21:55:20 -0400
+Subject: [PATCH] add support for SIGEV_THREAD_ID timers
+
+This is like SIGEV_SIGNAL, but targeted to a particular thread's
+tid, rather than the process.
+---
+ include/signal.h        | 16 +++++++++++++---
+ src/time/timer_create.c |  8 ++++++--
+ 2 files changed, 19 insertions(+), 5 deletions(-)
+
+diff --git a/include/signal.h b/include/signal.h
+index fbdf667b2..9ed929e4f 100644
+--- a/include/signal.h
++++ b/include/signal.h
+@@ -180,14 +180,24 @@ struct sigevent {
+ 	union sigval sigev_value;
+ 	int sigev_signo;
+ 	int sigev_notify;
+-	void (*sigev_notify_function)(union sigval);
+-	pthread_attr_t *sigev_notify_attributes;
+-	char __pad[56-3*sizeof(long)];
++	union {
++		char __pad[64 - 2*sizeof(int) - sizeof(union sigval)];
++		pid_t sigev_notify_thread_id;
++		struct {
++			void (*sigev_notify_function)(union sigval);
++			pthread_attr_t *sigev_notify_attributes;
++		} __sev_thread;
++	} __sev_fields;
+ };
+ 
++#define sigev_notify_thread_id __sev_fields.sigev_notify_thread_id
++#define sigev_notify_function __sev_fields.__sev_thread.sigev_notify_function
++#define sigev_notify_attributes __sev_fields.__sev_thread.sigev_notify_attributes
++
+ #define SIGEV_SIGNAL 0
+ #define SIGEV_NONE 1
+ #define SIGEV_THREAD 2
++#define SIGEV_THREAD_ID 4
+ 
+ int __libc_current_sigrtmin(void);
+ int __libc_current_sigrtmax(void);
+diff --git a/src/time/timer_create.c b/src/time/timer_create.c
+index 5ddfda278..4bef23905 100644
+--- a/src/time/timer_create.c
++++ b/src/time/timer_create.c
+@@ -71,11 +71,15 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 	switch (evp ? evp->sigev_notify : SIGEV_SIGNAL) {
+ 	case SIGEV_NONE:
+ 	case SIGEV_SIGNAL:
++	case SIGEV_THREAD_ID:
+ 		if (evp) {
+ 			ksev.sigev_value = evp->sigev_value;
+ 			ksev.sigev_signo = evp->sigev_signo;
+ 			ksev.sigev_notify = evp->sigev_notify;
+-			ksev.sigev_tid = 0;
++			if (evp->sigev_notify == SIGEV_THREAD_ID)
++				ksev.sigev_tid = evp->sigev_notify_thread_id;
++			else
++				ksev.sigev_tid = 0;
+ 			ksevp = &ksev;
+ 		}
+ 		if (syscall(SYS_timer_create, clk, ksevp, &timerid) < 0)
+@@ -107,7 +111,7 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
+ 
+ 		ksev.sigev_value.sival_ptr = 0;
+ 		ksev.sigev_signo = SIGTIMER;
+-		ksev.sigev_notify = 4; /* SIGEV_THREAD_ID */
++		ksev.sigev_notify = SIGEV_THREAD_ID;
+ 		ksev.sigev_tid = td->tid;
+ 		if (syscall(SYS_timer_create, clk, &ksev, &timerid) < 0)
+ 			timerid = -1;
diff --git a/srcpkgs/musl/template b/srcpkgs/musl/template
index 34e6ed4fba6e..afb33cd868b5 100644
--- a/srcpkgs/musl/template
+++ b/srcpkgs/musl/template
@@ -2,7 +2,7 @@
 pkgname=musl
 reverts="1.2.0_1"
 version=1.1.24
-revision=11
+revision=12
 archs="*-musl"
 bootstrap=yes
 build_style=gnu-configure

From 34710f5702653a6bbfe481265cb85b490c983d22 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 08/38] gcc-multilib: update to 12.2.0.

---
 srcpkgs/gcc-multilib/template | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/srcpkgs/gcc-multilib/template b/srcpkgs/gcc-multilib/template
index f28eb237c287..ba9bafcadfd6 100644
--- a/srcpkgs/gcc-multilib/template
+++ b/srcpkgs/gcc-multilib/template
@@ -3,15 +3,15 @@ archs="x86_64"
 _triplet="x86_64-unknown-linux-gnu"
 
 pkgname=gcc-multilib
-version=10.2.1pre1
+version=12.2.0
 revision=1
 _majorver="${version%.*}"
 short_desc="GNU Compiler Collection (multilib files)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
-distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
-checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
 
 hostmakedepends="perl flex tar zip unzip"
 makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel
@@ -70,7 +70,7 @@ do_build() {
 	make ${makejobs}
 }
 do_install() {
-	local _pc_triplet=x86_64-pc-linux-gnu _version=${version%pre1}
+	local _pc_triplet=x86_64-pc-linux-gnu
 	# Install to a tempdir and then only copy relevant files.
 	cd ${wrksrc}
 	make DESTDIR=${wrksrc}/${pkgname}-build install
@@ -80,9 +80,9 @@ do_install() {
 	vmkdir usr/include/c++/${_majorver}/${_triplet}
 	vmkdir usr/lib/gcc/${_triplet}/${_majorver}
 
-	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${_version}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${version}/32 \
 		${DESTDIR}/usr/lib/gcc/${_triplet}/${_majorver}/
-	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${_version}/${_pc_triplet}/32 \
+	cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${version}/${_pc_triplet}/32 \
 		${DESTDIR}/usr/include/c++/${_majorver}/${_triplet}
 
 	vinstall ${wrksrc}/host-${_pc_triplet}/gcc/specs 644 usr/lib/gcc/${_triplet}/${_majorver}

From 47bb77d08e9a8b98d77db5e076d0799ec8ff1fb1 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 09/38] libgccjit: update to 12.2.0.

---
 srcpkgs/libgccjit/files/libgccjit-musl.patch | 63 --------------------
 srcpkgs/libgccjit/template                   | 24 +++-----
 2 files changed, 9 insertions(+), 78 deletions(-)
 delete mode 100644 srcpkgs/libgccjit/files/libgccjit-musl.patch

diff --git a/srcpkgs/libgccjit/files/libgccjit-musl.patch b/srcpkgs/libgccjit/files/libgccjit-musl.patch
deleted file mode 100644
index d2ed16928c82..000000000000
--- a/srcpkgs/libgccjit/files/libgccjit-musl.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-diff --git a/gcc/jit/jit-playback.c b/gcc/jit/jit-playback.c
-index 5bccf591a..35f5e35ef 100644
---- a/gcc/jit/jit-playback.c
-+++ b/gcc/jit/jit-playback.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -41,8 +43,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "diagnostic.h"
- #include "stmt.h"
- 
--#include <pthread.h>
--
- #include "jit-playback.h"
- #include "jit-result.h"
- #include "jit-builtins.h"
-diff --git a/gcc/jit/jit-recording.c b/gcc/jit/jit-recording.c
-index a237d574f..5785e3269 100644
---- a/gcc/jit/jit-recording.c
-+++ b/gcc/jit/jit-recording.c
-@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
-+
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
-@@ -25,8 +27,6 @@ along with GCC; see the file COPYING3.  If not see
- #include "pretty-print.h"
- #include "toplev.h"
- 
--#include <pthread.h>
--
- #include "jit-builtins.h"
- #include "jit-recording.h"
- #include "jit-playback.h"
-diff --git a/gcc/jit/libgccjit.c b/gcc/jit/libgccjit.c
-index f9c33c63c..75f21d275 100644
---- a/gcc/jit/libgccjit.c
-+++ b/gcc/jit/libgccjit.c
-@@ -18,13 +18,13 @@ You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
- 
-+#include <pthread.h>
- #include "config.h"
- #include "system.h"
- #include "coretypes.h"
- #include "timevar.h"
- #include "typed-splay-tree.h"
- #include "cppbuiltin.h"
--#include <pthread.h>
- 
- #include "libgccjit.h"
- #include "jit-recording.h"
diff --git a/srcpkgs/libgccjit/template b/srcpkgs/libgccjit/template
index 0b37c3ee9f8b..fde1affd54b7 100644
--- a/srcpkgs/libgccjit/template
+++ b/srcpkgs/libgccjit/template
@@ -3,18 +3,12 @@
 # which use the version number.
 
 pkgname=libgccjit
-# we are using a 10-stable git snapshot alpine is using in order
-# to get regression fixes not yet incorporate into a stable release
-# it should be possible to switch back to stable with 10.3 or 11
-version=10.2.1pre1
+version=12.2.0
 revision=1
-_patchver="${version%pre*}"
-_minorver="${_patchver%.*}"
-_majorver="${_minorver%.*}"
-_gmp_version=6.2.0
+_gmp_version=6.2.1
 _mpfr_version=4.1.0
-_mpc_version=1.1.0
-_isl_version=0.21
+_mpc_version=1.2.1
+_isl_version=0.24
 create_wrksrc=yes
 short_desc="Just-In-Time Compilation library for GCC"
 maintainer="Lane Biocini <lane@mailbox.org>"
@@ -22,16 +16,16 @@ homepage="https://gcc.gnu.org"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 # *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
 distfiles="
- https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
  https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
  ${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  ${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
-checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
+checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
  0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
- 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
+ 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
+ fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
 nopie=yes
 lib32disabled=yes
 makedepends="zlib-devel"

From cabec16330c55d6d4aa126f679881d3c3b6ae197 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 10/38] build-style/void-cross: Update flags for gcc12 and
 glibc 2.36

gcov can't be built without libc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289

Remove -no-pie from build. glibc 2.35 and newer uses -static-pie by default:
https://sourceware.org/pipermail/glibc-cvs/2021q4/075916.html
---
 common/build-style/void-cross.sh | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..4804193d8395 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -53,6 +53,7 @@ _void_cross_build_binutils() {
 		--sbindir=/usr/bin \
 		--libdir=/usr/lib \
 		--libexecdir=/usr/lib \
+		--sysconfdir=/etc \
 		--target=${tgt} \
 		--with-sysroot=/usr/${tgt} \
 		--disable-nls \
@@ -60,7 +61,9 @@ _void_cross_build_binutils() {
 		--disable-multilib \
 		--disable-werror \
 		--disable-gold \
+		--disable-gprofng \
 		--enable-relro \
+		--enable-new-dtags \
 		--enable-plugins \
 		--enable-64-bit-bfd \
 		--enable-deterministic-archives \
@@ -132,6 +135,7 @@ _void_cross_build_bootstrap_gcc() {
 		--disable-libssp \
 		--disable-libitm \
 		--disable-libatomic \
+		--disable-gcov \
 		--disable-threads \
 		--disable-sjlj-exceptions \
 		--enable-languages=c \
@@ -381,6 +385,7 @@ _void_cross_build_gcc() {
 		extra_args+=" --disable-gnu-unique-object"
 		extra_args+=" libat_cv_have_ifunc=no"
 	else
+		extra_args+=" --enable-clocale=gnu"
 		extra_args+=" --enable-gnu-unique-object"
 	fi
 
@@ -460,6 +465,14 @@ do_build() {
 	local binutils_ver linux_ver gcc_ver libc_ver libucontext_ver
 	local tgt=${sourcepkg/cross-}
 
+	export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}"
+	export CXXFLAGS="${CXXFLAGS/-D_FORTIFY_SOURCE=2/}"
+
+	# Disable explicit -fno-PIE, gcc/binutils/libc will figure this out itself.
+	export CFLAGS="${CFLAGS//-fno-PIE/}"
+	export CXXFLAGS="${CXXFLAGS//-fno-PIE/}"
+	export LDFLAGS="${LDFLAGS//-no-pie/}"
+
 	_void_cross_test_ver binutils
 	_void_cross_test_ver linux
 	_void_cross_test_ver gcc
@@ -625,6 +638,9 @@ do_install() {
 	# then remove it because it conflicts with libquadmath package
 	rm -rf ${DESTDIR}/${sysroot}/usr/lib/libquadmath.*
 
+	# Remove libdep linker plugin because it conflicts with system binutils
+	rm -f ${DESTDIR}/usr/lib/bfd-plugins/libdep*
+
 	# Remove leftover symlinks
 	rm -f ${DESTDIR}/usr/lib${XBPS_TARGET_WORDSIZE}
 	rm -f ${DESTDIR}/lib*

From 38c7f95eddbd1bbbd5ba6e242ae55c73f6e4303c Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Mon, 12 Dec 2022 10:15:29 -0800
Subject: [PATCH 11/38] environment/autoconf_cache: Disable 64-bit time_t by
 default

---
 common/environment/configure/autoconf_cache/common-linux | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/common/environment/configure/autoconf_cache/common-linux b/common/environment/configure/autoconf_cache/common-linux
index 718c2c36d79e..fe0bd5312cbd 100644
--- a/common/environment/configure/autoconf_cache/common-linux
+++ b/common/environment/configure/autoconf_cache/common-linux
@@ -170,3 +170,7 @@ ac_cv_strftime_extensions=yes
 
 # time
 ac_cv_func_wait3=yes
+
+# Y2038
+gl_cv_type_time_t_y2038=${gl_cv_type_time_t_y2038=no}
+ac_cv_type_time_t_bits_macro=${ac_cv_type_time_t_bits_macro=no}

From 73d159176a02511edfb9d97d1ebbe18ccb79a853 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 5 Nov 2022 11:33:12 -0700
Subject: [PATCH 12/38] qemu: remove broken patch

The necessary patch has been imported into musl so no need
to cast the sigevent struct to a more glibc-like one.
---
 .../musl-fix-sigevent-and-sigval_t.patch      | 27 -------------------
 1 file changed, 27 deletions(-)
 delete mode 100644 srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch

diff --git a/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch b/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch
deleted file mode 100644
index 4b4f1117c15f..000000000000
--- a/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-Note: Remove this patch with musl 1.2.2
-
---- a/linux-user/syscall.c
-+++ b/linux-user/syscall.c
-@@ -5020,10 +5020,21 @@
- #ifndef HAVE_SIGEV_NOTIFY_THREAD_ID
- #define sigev_notify_thread_id _sigev_un._tid
- #endif
- 
--static inline abi_long target_to_host_sigevent(struct sigevent *host_sevp,
-+struct host_sigevent {
-+    union sigval sigev_value;
-+    int sigev_signo;
-+    int sigev_notify;
-+    union {
-+       char _pad[64 - sizeof(int) * 2 - sizeof(union sigval)];
-+       int _tid;
-+    } _sigev_un;
-+};
-+
-+static inline abi_long target_to_host_sigevent(struct sigevent *sevp,
-                                                abi_ulong target_addr)
- {
-+    struct host_sigevent *host_sevp = (struct host_sigevent *) sevp;
-     struct target_sigevent *target_sevp;
- 
-     if (!lock_user_struct(VERIFY_READ, target_sevp, target_addr, 1)) {

From 1341b752f269f3a31d4567d168e4b9eacf1d91eb Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sat, 19 Nov 2022 13:26:24 -0800
Subject: [PATCH 13/38] mk-configure: rebuild for gcc 12

---
 srcpkgs/mk-configure/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/mk-configure/template b/srcpkgs/mk-configure/template
index 9d12f11a9799..c50d8adf213f 100644
--- a/srcpkgs/mk-configure/template
+++ b/srcpkgs/mk-configure/template
@@ -1,7 +1,7 @@
 # Template file for 'mk-configure'
 pkgname=mk-configure
 version=0.37.0
-revision=1
+revision=2
 build_style=gnu-makefile
 make_cmd=bmake
 make_install_args="MANDIR=/usr/share/man"

From aabb691d4dde422ac683bd0f875170ff9a7cbd51 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 14/38] cross-aarch64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index 18de21aa3ccd..9e6fb75c198d 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-aarch64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-aarch64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Leah Neukirchen <leah@vuxu.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 7d7f14a3e975d24a417a7eaa53b83b275de16cd9 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 15/38] cross-aarch64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-aarch64-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index bb6a770afb79..ba14c96bccea 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-aarch64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From b81f2c39860dd354201fe2e9f11c3b77ef5c3bea Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 16/38] cross-arm-linux-gnueabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabi/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index a3aba72aa93a..5c774e16f430 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-arm-linux-gnueabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabi
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From bd7f2cb6d49289b1232eb4d7d69da0af8baa7f8d Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 17/38] cross-arm-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-gnueabihf/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index d9ab86cf2ecc..d6298ab639a4 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-arm-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-arm-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From e10b59ad5407e8bd71ba756ea2a1ac13069bb657 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 18/38] cross-arm-linux-musleabi: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabi/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index 6692d891e1bd..24df78e8fd8e 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-arm-linux-musleabi'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From d7badb3921f93ee598bcaa5c409bc39bfdd156d7 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 19/38] cross-arm-linux-musleabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-arm-linux-musleabihf/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index bb62bd5ebc55..8093700f909c 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-arm-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 0f6c2bfe214a95f99a67a53b4d6ba4ca91d77a24 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 20/38] cross-armv7l-linux-gnueabihf: update to gcc 12.2.0.

---
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 30c89b6294ef..92665326428b 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-armv7l-linux-gnueabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-armv7l-linux-gnueabihf
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From aee34a4fc300e8c6e43c7f8b38c6a705ed7ff585 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:28 -0800
Subject: [PATCH 21/38] cross-armv7l-linux-musleabihf: update to gcc 12.2.0.

---
 .../cross-armv7l-linux-musleabihf/template    | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 0a588cdf1a58..e5af2c9ccbf2 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,29 +1,30 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From b9478b98ba40241fa241608d4f97cb416a29650f Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 22/38] cross-i686-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-i686-linux-musl/template b/srcpkgs/cross-i686-linux-musl/template
index 8be16a230d8d..d624bb7a3254 100644
--- a/srcpkgs/cross-i686-linux-musl/template
+++ b/srcpkgs/cross-i686-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-i686-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-i686-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 4eddb13a04344e047a6e7cd5ba4076440a2e3d61 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 23/38] cross-i686-pc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-i686-pc-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 263a43f7a7b8..6a9e54db807a 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,14 +1,15 @@
 # Template file for 'cross-i686-pc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-i686-pc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -16,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 388c0078572ca60d9a1aeaae480e79bb91ee5323 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 24/38] cross-mips-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-musl/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 9b5d5819b1a0..67a5c413396c 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mips-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 9b2055c4ece4a52ea6dd802d75ef589bd52284f0 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 25/38] cross-mips-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mips-linux-muslhf/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index d7590af9ec03..bdf8600ce95b 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mips-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="hipperson0 <hipperson0@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 331712475695a00863a6d69e95e326126312e7c4 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 26/38] cross-mipsel-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-musl/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1acba7016dbc..de49387d517b 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mipsel-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 116446afa6b3d6e1c30f4385b22b871bdebc2619 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 27/38] cross-mipsel-linux-muslhf: update to gcc 12.2.0.

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index e4a55f028bc4..b27ce6475a38 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-mipsel-linux-muslhf'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
- https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 0f2c3675ab6fd0db818fec3f4157cb9170b9d619 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 28/38] cross-powerpc-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index b97a21d0d72e..79579e093b12 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-powerpc-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From f968ae4899a5e39f509297b212b173329c388c06 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 29/38] cross-powerpc-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index f9b22f0610d3..9bb6acd359b6 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-powerpc-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From 17456ba1e3bcf7260549e68531748e068a886ee1 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 30/38] cross-powerpc64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 35cfcaa6f02e..2d153d00add6 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,16 +1,17 @@
 # Template file for 'cross-powerpc64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
  --enable-targets=powerpc-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -18,12 +19,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 38f87f21ab0900402eda79c9c41f47a21b074e5e Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 31/38] cross-powerpc64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 016f18776a6d..e0848fe0bff7 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,30 +1,31 @@
 # Template file for 'cross-powerpc64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From fbabcfd41d8545a730c9ee4fe19151503fc834d4 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 32/38] cross-powerpc64le-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 463d7e92d20d..8d8e010e15c0 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,16 +1,17 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpc64le-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify --with-abi=elfv2
  --enable-targets=powerpcle-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -18,12 +19,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From eb06605be44c26f0811c99047ccefeb096ad045d Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 33/38] cross-powerpc64le-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index c17a3cccfe29..0915e524545f 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,30 +1,31 @@
 # Template file for 'cross-powerpc64le-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
-version=0.34
-revision=4
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From 164d6960a595e50c29170a08f709c7add654547f Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 34/38] cross-powerpcle-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-gnu/template | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-gnu/template b/srcpkgs/cross-powerpcle-linux-gnu/template
index 9aede3c465ce..687be8a44c6c 100644
--- a/srcpkgs/cross-powerpcle-linux-gnu/template
+++ b/srcpkgs/cross-powerpcle-linux-gnu/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-powerpcle-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -17,12 +18,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 
@@ -35,6 +36,8 @@ if [ "$XBPS_TARGET_MACHINE" = "ppcle" ]; then
 	broken="Can't build crosstoolchain to itself"
 fi
 
+broken="glibc uses big-endian specific instructions on 32-bit powerpc"
+
 cross-powerpcle-linux-gnu-libc_package() {
 	short_desc+=" - glibc files"
 	nostrip=yes

From c12f0cc08974f7043bd082059f73368248e95b50 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:29 -0800
Subject: [PATCH 35/38] cross-powerpcle-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-powerpcle-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index 045cfda987fe..bb984b9c42eb 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-powerpcle-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
 hostmakedepends="texinfo tar gcc-objc flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes

From ac4c9b7269356a6958cf256344951ec31dbcfcc1 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:30 -0800
Subject: [PATCH 36/38] cross-x86_64-linux-gnu: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-gnu/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-gnu/template b/srcpkgs/cross-x86_64-linux-gnu/template
index 8918f3c22a1c..930aaf2a508b 100644
--- a/srcpkgs/cross-x86_64-linux-gnu/template
+++ b/srcpkgs/cross-x86_64-linux-gnu/template
@@ -1,14 +1,15 @@
 # Template file for 'cross-x86_64-linux-gnu'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
-_glibc_version=2.32
+_binutils_version=2.39
+_gcc_version=12.2.0
+_glibc_version=2.36
 _linux_version=5.10.4
 pkgname=cross-x86_64-linux-gnu
-version=0.34
+version=0.35
 revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -16,12 +17,12 @@ license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
- 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
+ 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 885036f9d764904a2abd2ef5a48934bb82e4bfc3 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Sun, 6 Nov 2022 11:33:30 -0800
Subject: [PATCH 37/38] cross-x86_64-linux-musl: update to gcc 12.2.0.

---
 srcpkgs/cross-x86_64-linux-musl/template | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index a941e7e02f6f..ac5b1c46ab82 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,28 +1,29 @@
 # Template file for 'cross-x86_64-linux-musl'
-_binutils_version=2.35.1
-_gcc_version=10.2.1_pre1
+_binutils_version=2.39
+_gcc_version=12.2.0
 _musl_version=1.1.24
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
-version=0.34
-revision=3
+version=0.35
+revision=1
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
-makedepends="isl15-devel libmpc-devel zlib-devel gmp-devel mpfr-devel"
+makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
+ zlib-devel libzstd-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 short_desc="Void cross toolchain for ${pkgname/cross-}"
 maintainer="Orphaned <orphan@voidlinux.org>"
-homepage="https://www.voidlinux.org/"
 license="GPL-2.0-or-later, GPL-3.0-or-later, MIT"
+homepage="https://www.voidlinux.org/"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
- https://dev.alpinelinux.org/~nenolod/gcc-${_gcc_version}.tar.xz
+ ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  https://musl.libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
-checksum="3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
- 772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
+checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
+ e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
  1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"

From ddac00b7224565066701fd3a4d7e72f6a63bd0b9 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Fri, 18 Nov 2022 02:01:19 -0800
Subject: [PATCH 38/38] cross-vpkg-dummy: update to 0.39.

---
 srcpkgs/cross-vpkg-dummy/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/cross-vpkg-dummy/template b/srcpkgs/cross-vpkg-dummy/template
index d83e38dc63ac..aeafb749dd5f 100644
--- a/srcpkgs/cross-vpkg-dummy/template
+++ b/srcpkgs/cross-vpkg-dummy/template
@@ -1,6 +1,6 @@
 # Template file for 'cross-vpkg-dummy'
 pkgname=cross-vpkg-dummy
-version=0.38
+version=0.39
 revision=1
 build_style=meta
 short_desc="Dummy meta-pkg for cross building packages with xbps-src"
@@ -54,8 +54,8 @@ conflicts="
 	gcc-objc++>=0"
 shlib_provides="
 	libgcc_s.so.1
-	libgnat-10.so
-	libgnarl-10.so
+	libgnat-12.so
+	libgnarl-12.so
 	libstdc++.so.6
 	libgfortran.so.5"
 

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (246 preceding siblings ...)
  2022-12-12 18:24 ` oreo639
@ 2022-12-15 22:20 ` sug0
  2022-12-17  5:52 ` [PR PATCH] [Closed]: " sgn
                   ` (16 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: sug0 @ 2022-12-15 22:20 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 272 bytes --]

New comment by sug0 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1353788419

Comment:
Thank you for your hard work! Looks like the patchset can be used to build a gcc 12 toolchain now. Any current blockers on the merge?

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR PATCH] [Closed]: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (247 preceding siblings ...)
  2022-12-15 22:20 ` sug0
@ 2022-12-17  5:52 ` sgn
  2022-12-20  1:23 ` lane-brain
                   ` (15 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: sgn @ 2022-12-17  5:52 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5352 bytes --]

There's a closed pull request on the void-packages repository

gcc: update to 12.2.0.
https://github.com/void-linux/void-packages/pull/34902

Description:
<!-- Uncomment relevant sections and delete options which are not applicable -->
[ci skip]

Edit: this PR had been updated for gcc 12.2.0

There are lists of failing builds here: https://github.com/void-linux/void-packages/issues/39809, https://github.com/void-linux/void-packages/issues/39960

I tested this PR with glibc and after updating glibc, it seems to work fine.
I also tested this PR with x86_64-musl, and it appears to run fine in a musl chroot, and recompiling and installing musl with gcc 12 doesn't appear to result in any issues. (more testing is needed)

Please let me know if there are any issues.

I compiled base-system and base-chroot on x86_64-glibc and x86_64-musl to ensure that compiles and it appears to work fine.

I tested some of the cross compilers and after some debugging with the help of CameronNemo, we figured out the issue.
The cross compilers are built with `nopie=yes` (specified in environment/build-style), which causes issues with glibc 2.35+ which uses PIE by default.
gcc always builds itself as nopie.
I added a workaround to common/build-style/void-cross but if you have any other recommendations on how to handle it, feel free to let me know.

This PR also updates glibc to 2.36:
https://sourceware.org/glibc/wiki/Release/2.36

Necessary to fix previously existing build failures (unrelated to this PR):
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] gupnp https://github.com/void-linux/void-packages/pull/38844

Known packages that need to be fixed/updated for glibc 2.36:
- [x] samba https://github.com/void-linux/void-packages/pull/38700
- [x] qemu https://github.com/void-linux/void-packages/pull/38769
- [x] llvm https://github.com/void-linux/void-packages/pull/38694
- [x] m4 https://github.com/void-linux/void-packages/pull/33730
- [x] btrfs-progs https://github.com/void-linux/void-packages/pull/38778
- [x] ntp https://github.com/void-linux/void-packages/pull/38772
- [x] libarchive https://github.com/void-linux/void-packages/pull/38773
- [x] boost https://github.com/void-linux/void-packages/pull/38784
- [x] chroot-grep https://github.com/void-linux/void-packages/pull/38785
- [x] plymouth https://github.com/void-linux/void-packages/pull/38821
- [x] fuse https://github.com/void-linux/void-packages/pull/38827
- [x] libostree https://github.com/void-linux/void-packages/pull/38828
- [x] libvirt https://github.com/void-linux/void-packages/pull/38842
- [x] syslinux https://github.com/void-linux/void-packages/pull/38876
- [x] efivar https://github.com/void-linux/void-packages/pull/38874
- [x] gpgme https://github.com/void-linux/void-packages/pull/38825

Known packages that needed to be fixed/updated for gcc12:
- [x] openssh https://github.com/void-linux/void-packages/pull/38849
- [x] xf86-video-vmware https://github.com/void-linux/void-packages/pull/38847
- [x] doxygen https://github.com/void-linux/void-packages/pull/38846
- [x] firefox-esr https://github.com/void-linux/void-packages/pull/39677
- [x] libproxy https://github.com/void-linux/void-packages/pull/38818
- [x] exempi https://github.com/void-linux/void-packages/pull/38820
- [x] openjdk7-bootstrap https://github.com/void-linux/void-packages/pull/38822
- [x] libunique1 https://github.com/void-linux/void-packages/pull/38848 or https://github.com/void-linux/void-packages/pull/38873
- [x] libwpd https://github.com/void-linux/void-packages/pull/38878
- [x] cglm https://github.com/void-linux/void-packages/pull/39748
- [x] coreboot-utils https://github.com/void-linux/void-packages/pull/39749
- [x] apl https://github.com/void-linux/void-packages/pull/39750
- [x] igt-gpu-tools https://github.com/void-linux/void-packages/pull/39780

Needs to be fixed/updated for binutils:
- [x] grub https://github.com/void-linux/void-packages/pull/38875
- [x] linux-tools https://github.com/void-linux/void-packages/pull/38877
- [x] kcov https://github.com/void-linux/void-packages/pull/39291

[ISO packages](https://github.com/void-linux/void-mklive/blob/ee69596c585bee310267a437c3ce0fc3efbcaf72/build-x86-images.sh.in#L36-L66) verified:
- [x] base system
- [x] base chroot
- [x] gnome
- [x] xfce
- [x] mate
- [x] cinnamon
- [x] enlightenment
- [x] kde
- [x] lxde
- [x] lxqt

You can test the ISOs here:
https://drive.google.com/drive/folders/1ix92CYSLUP-KWjLxltdgG4e8Nu2JCY5n?usp=sharing

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (248 preceding siblings ...)
  2022-12-17  5:52 ` [PR PATCH] [Closed]: " sgn
@ 2022-12-20  1:23 ` lane-brain
  2022-12-20  2:18 ` oreo639
                   ` (14 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: lane-brain @ 2022-12-20  1:23 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 240 bytes --]

New comment by lane-brain on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1358708694

Comment:
what a nice surprise running xbps-install -Su today, thank you for all the hard work @oreo639!!

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (249 preceding siblings ...)
  2022-12-20  1:23 ` lane-brain
@ 2022-12-20  2:18 ` oreo639
  2022-12-21  0:15 ` TeusLollo
                   ` (13 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2022-12-20  2:18 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 208 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1358748514

Comment:
Np. Also, thank you paper42, sgn, leahneukirchen, and Johnnynator.

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (250 preceding siblings ...)
  2022-12-20  2:18 ` oreo639
@ 2022-12-21  0:15 ` TeusLollo
  2023-01-05  8:29 ` [PR REVIEW] " CameronNemo
                   ` (12 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: TeusLollo @ 2022-12-21  0:15 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 439 bytes --]

New comment by TeusLollo on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#issuecomment-1360543817

Comment:
Indeed. Thanks to @oreo639 and to the rest of the gang. 

By the next gcc/glibc update, I hope I'll be knowledgeable enough of the xbps build system to help at least with testing/pull requests (Still too much of a newbie at distro maintenance, for now I'm mostly a bug reporter/fix identifier)

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR REVIEW] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (251 preceding siblings ...)
  2022-12-21  0:15 ` TeusLollo
@ 2023-01-05  8:29 ` CameronNemo
  2023-01-05  8:42 ` oreo639
                   ` (11 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: CameronNemo @ 2023-01-05  8:29 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 170 bytes --]

New review comment by CameronNemo on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#discussion_r1062217354

Comment:
Why was this done?

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR REVIEW] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (252 preceding siblings ...)
  2023-01-05  8:29 ` [PR REVIEW] " CameronNemo
@ 2023-01-05  8:42 ` oreo639
  2023-01-05  8:44 ` oreo639
                   ` (10 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2023-01-05  8:42 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 621 bytes --]

New review comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#discussion_r1062229421

Comment:
glibc has a release branch where patches go to including several critical ones.
https://github.com/bminor/glibc/tree/release/2.36/master
paper didn't want me to include it as a patch (like what debian does) since the patch is enormous.
So we generated a tarball from the release branch using make dist. (Fedora does this and Arch just uses git)
It was generated from the following commit:
https://github.com/bminor/glibc/commit/0f90d6204d79223fd32248c774df0cb7f0e604de

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR REVIEW] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (253 preceding siblings ...)
  2023-01-05  8:42 ` oreo639
@ 2023-01-05  8:44 ` oreo639
  2023-01-05  8:45 ` oreo639
                   ` (9 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2023-01-05  8:44 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 629 bytes --]

New review comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#discussion_r1062229421

Comment:
glibc has a release branch where patches go to including several critical ones.
https://github.com/bminor/glibc/tree/release/2.36/master
paper didn't want me to include the branch as a patch (like what debian does) since the patch is enormous.
So we generated a tarball from the release branch using make dist. (Fedora does this and Arch just uses git)
It was generated from the following commit:
https://github.com/bminor/glibc/commit/0f90d6204d79223fd32248c774df0cb7f0e604de

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR REVIEW] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (254 preceding siblings ...)
  2023-01-05  8:44 ` oreo639
@ 2023-01-05  8:45 ` oreo639
  2023-01-05  8:45 ` oreo639
                   ` (8 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2023-01-05  8:45 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 722 bytes --]

New review comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#discussion_r1062229421

Comment:
glibc has a release branch where patches go to including several critical ones.
https://github.com/bminor/glibc/tree/release/2.36/master
paper didn't want me to include the branch as a patch (like what debian does) since the patch is enormous.
So we generated a tarball from the release branch using make dist. (Fedora does this and Arch just uses git)
It was generated from the following commit:
https://github.com/bminor/glibc/commit/0f90d6204d79223fd32248c774df0cb7f0e604de

It paper also asked for it to get uploaded to voidlinux.org but no one has done that yet.

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR REVIEW] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (255 preceding siblings ...)
  2023-01-05  8:45 ` oreo639
@ 2023-01-05  8:45 ` oreo639
  2023-01-05  8:46 ` oreo639
                   ` (7 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2023-01-05  8:45 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 730 bytes --]

New review comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#discussion_r1062229421

Comment:
glibc has a release branch where patches go to including several critical ones.
https://github.com/bminor/glibc/tree/release/2.36/master
paper didn't want me to include the branch as a patch (like what debian does) since the patch is enormous.
So we generated a tarball from the release branch using make dist. (Fedora does this and Arch just uses git)
It was generated from the following commit:
https://github.com/bminor/glibc/commit/0f90d6204d79223fd32248c774df0cb7f0e604de

It paper also asked for it to get uploaded to sources.voidlinux.org but no one has done that yet.

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR REVIEW] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (256 preceding siblings ...)
  2023-01-05  8:45 ` oreo639
@ 2023-01-05  8:46 ` oreo639
  2023-01-05  8:46 ` oreo639
                   ` (6 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2023-01-05  8:46 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 722 bytes --]

New review comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#discussion_r1062229421

Comment:
glibc has a release branch where patches go to including several critical ones.
https://github.com/bminor/glibc/tree/release/2.36/master
paper didn't want me to include the branch as a patch (like what debian does) since the patch is enormous.
So we generated a tarball from the release branch using make dist. (Fedora does this and Arch just uses git)
It was generated from the following commit:
https://github.com/bminor/glibc/commit/0f90d6204d79223fd32248c774df0cb7f0e604de

It paper also asked for it to get uploaded to voidlinux.org but no one has done that yet.

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR REVIEW] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (257 preceding siblings ...)
  2023-01-05  8:46 ` oreo639
@ 2023-01-05  8:46 ` oreo639
  2023-01-05  8:46 ` oreo639
                   ` (5 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2023-01-05  8:46 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 754 bytes --]

New review comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#discussion_r1062229421

Comment:
glibc has a release branch where patches go to including several critical ones.
https://github.com/bminor/glibc/tree/release/2.36/master
paper didn't want me to include the branch as a patch (like what debian does) since the patch is enormous.
So we generated a tarball from the release branch using make dist. (Fedora does this and Arch just uses git)
It was generated from the following commit:
https://github.com/bminor/glibc/commit/0f90d6204d79223fd32248c774df0cb7f0e604de

It paper also asked for it to get uploaded to https://repo-default.voidlinux.org/distfiles/ but no one has done that yet.

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR REVIEW] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (258 preceding siblings ...)
  2023-01-05  8:46 ` oreo639
@ 2023-01-05  8:46 ` oreo639
  2023-01-05  8:47 ` oreo639
                   ` (4 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2023-01-05  8:46 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 792 bytes --]

New review comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#discussion_r1062229421

Comment:
glibc has a release branch where patches go to including several critical ones.
https://github.com/bminor/glibc/tree/release/2.36/master
paper didn't want me to include the branch as a patch (like what debian does) since the patch is enormous.
So we generated a tarball from the release branch using make dist. (Fedora does this and Arch just uses git)
It was generated from the following commit:
https://github.com/bminor/glibc/commit/0f90d6204d79223fd32248c774df0cb7f0e604de

It paper also asked for it to get uploaded to https://repo-default.voidlinux.org/distfiles/ but no one has done that yet so it is still pointing to his server.

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR REVIEW] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (259 preceding siblings ...)
  2023-01-05  8:46 ` oreo639
@ 2023-01-05  8:47 ` oreo639
  2023-01-05  9:00 ` oreo639
                   ` (3 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2023-01-05  8:47 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 786 bytes --]

New review comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#discussion_r1062229421

Comment:
glibc has a release branch where patches go to including several critical ones.
https://github.com/bminor/glibc/tree/release/2.36/master
paper didn't want me to include the branch as a patch (like what debian does) since the patch is enormous.
So we generated a tarball from the release branch using make dist. (Fedora does this and Arch just uses git)
It was generated from the following commit:
https://github.com/bminor/glibc/commit/0f90d6204d79223fd32248c774df0cb7f0e604de

It was also supposed to get uploaded to https://repo-default.voidlinux.org/distfiles/ but no one has done that yet so it is still pointing to his server.

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR REVIEW] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (260 preceding siblings ...)
  2023-01-05  8:47 ` oreo639
@ 2023-01-05  9:00 ` oreo639
  2023-01-05  9:00 ` oreo639
                   ` (2 subsequent siblings)
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2023-01-05  9:00 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 949 bytes --]

New review comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#discussion_r1062229421

Comment:
glibc has a release branch where patches go to including several critical ones.
https://github.com/bminor/glibc/tree/release/2.36/master
paper didn't want me to include the branch as a patch (like what debian does) since the patch is enormous.
So we generated a tarball from the release branch using make dist. (Fedora does this and Arch just uses git)
It was generated from the following commit:
https://github.com/bminor/glibc/commit/0f90d6204d79223fd32248c774df0cb7f0e604de

The patchver is the output of `git describe` <ncommit>-g<commit-hash>
Where ncommit is the number of commits between the release branch and the release tag.


It was also supposed to get uploaded to https://repo-default.voidlinux.org/distfiles/ but no one has done that yet so it is still pointing to his server.

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR REVIEW] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (261 preceding siblings ...)
  2023-01-05  9:00 ` oreo639
@ 2023-01-05  9:00 ` oreo639
  2023-01-05  9:01 ` oreo639
  2023-01-05  9:02 ` oreo639
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2023-01-05  9:00 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 953 bytes --]

New review comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#discussion_r1062229421

Comment:
glibc has a release branch where patches go to including several critical ones.
https://github.com/bminor/glibc/tree/release/2.36/master
paper didn't want me to include the branch as a patch (like what debian does) since the patch is enormous.
So we generated a tarball from the release branch using make dist. (Fedora does this and Arch just uses git)
It was generated from the following commit:
https://github.com/bminor/glibc/commit/0f90d6204d79223fd32248c774df0cb7f0e604de

The patchver is the output of `git describe` \<ncommit\>-g\<commit-hash\>
Where ncommit is the number of commits between the release branch and the release tag.


It was also supposed to get uploaded to https://repo-default.voidlinux.org/distfiles/ but no one has done that yet so it is still pointing to his server.

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR REVIEW] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (262 preceding siblings ...)
  2023-01-05  9:00 ` oreo639
@ 2023-01-05  9:01 ` oreo639
  2023-01-05  9:02 ` oreo639
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2023-01-05  9:01 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 954 bytes --]

New review comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#discussion_r1062229421

Comment:
glibc has a release branch where patches go to including several critical ones.
https://github.com/bminor/glibc/tree/release/2.36/master
paper didn't want me to include the branch as a patch (like what debian does) since the patch is enormous.
So we generated a tarball from the release branch using make dist. (Fedora does this and Arch just uses git)
It was generated from the following commit:
https://github.com/bminor/glibc/commit/0f90d6204d79223fd32248c774df0cb7f0e604de

The patchver is the output of `git describe`: \<ncommit\>-g\<commit-hash\>
Where ncommit is the number of commits between the release branch and the release tag.


It was also supposed to get uploaded to https://repo-default.voidlinux.org/distfiles/ but no one has done that yet so it is still pointing to his server.

^ permalink raw reply	[flat|nested] 266+ messages in thread

* Re: [PR REVIEW] gcc: update to 12.2.0.
  2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
                   ` (263 preceding siblings ...)
  2023-01-05  9:01 ` oreo639
@ 2023-01-05  9:02 ` oreo639
  264 siblings, 0 replies; 266+ messages in thread
From: oreo639 @ 2023-01-05  9:02 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 958 bytes --]

New review comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/34902#discussion_r1062229421

Comment:
glibc has a release branch where patches go to including several critical ones.
https://github.com/bminor/glibc/tree/release/2.36/master
paper didn't want me to include the branch as a patch (like what debian does) since the patch is enormous.
So we generated a tarball from the release branch using make dist. (Fedora does this and Arch just uses git)
It was generated from the following commit:
https://github.com/bminor/glibc/commit/0f90d6204d79223fd32248c774df0cb7f0e604de

The patchver is the output of `git describe`: \<ncommit\>-g\<commit-hash\>
Where ncommit is the number of commits between the release branch and the release tag.


It was also supposed to get uploaded to https://repo-default.voidlinux.org/distfiles/ but no one has done that yet so it is still pointing to paper's server.

^ permalink raw reply	[flat|nested] 266+ messages in thread

end of thread, other threads:[~2023-01-05  9:02 UTC | newest]

Thread overview: 266+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-06  6:15 [PR PATCH] gcc: update to 11.2.1git20211128 Oreo639
2022-01-26 19:41 ` dkwo
2022-01-26 22:12 ` oreo639
2022-01-26 23:16 ` oreo639
2022-01-26 23:16 ` [PR PATCH] [Updated] " oreo639
2022-01-26 23:25 ` oreo639
2022-01-26 23:25 ` oreo639
2022-02-16 21:18 ` lane-brain
2022-02-17  1:56 ` oreo639
2022-02-17  1:56 ` oreo639
2022-04-14  2:41 ` oreo639
2022-07-14  2:13 ` github-actions
2022-07-17 17:44 ` motorto
2022-07-17 17:45 ` motorto
2022-08-12 13:29 ` [PR PATCH] [Updated] " oreo639
2022-08-13  6:32 ` [PR PATCH] [Updated] gcc: update to 12.1.0 oreo639
2022-08-13  6:49 ` oreo639
2022-08-15  2:24 ` oreo639
2022-08-15  2:31 ` oreo639
2022-08-15  3:20 ` oreo639
2022-08-15  5:58 ` oreo639
2022-08-15  8:14 ` oreo639
2022-08-15  8:17 ` oreo639
2022-08-15  8:20 ` oreo639
2022-08-15  8:20 ` oreo639
2022-08-15 20:12 ` lane-brain
2022-08-15 21:48 ` [PR PATCH] [Updated] " oreo639
2022-08-16  1:01 ` oreo639
2022-08-16  1:55 ` oreo639
2022-08-18 23:23 ` oreo639
2022-08-19  0:22 ` oreo639
2022-08-19  5:51 ` oreo639
2022-08-19  5:57 ` oreo639
2022-08-19  5:58 ` oreo639
2022-08-20 18:30 ` oreo639
2022-08-21 22:46 ` oreo639
2022-08-23  3:27 ` oreo639
2022-08-23  4:02 ` oreo639
2022-08-23  6:30 ` oreo639
2022-08-23 19:37 ` oreo639
2022-08-24  5:45 ` oreo639
2022-08-24  8:04 ` oreo639
2022-08-24  8:05 ` oreo639
2022-08-24  8:06 ` oreo639
2022-08-24 11:11 ` dkwo
2022-08-24 16:56 ` dkwo
2022-08-24 19:44 ` [PR PATCH] [Updated] " oreo639
2022-08-24 20:43 ` oreo639
2022-08-24 20:52 ` oreo639
2022-08-24 23:42 ` [PR PATCH] [Updated] gcc: update to 12.2.0 oreo639
2022-08-24 23:58 ` oreo639
2022-08-25  0:00 ` oreo639
2022-08-25  2:33 ` oreo639
2022-08-25  4:02 ` oreo639
2022-08-25  9:01 ` oreo639
2022-08-25  9:03 ` oreo639
2022-08-25  9:04 ` oreo639
2022-08-25  9:04 ` oreo639
2022-08-25  9:05 ` oreo639
2022-08-25  9:48 ` dkwo
2022-08-25 21:42 ` [PR PATCH] [Updated] " oreo639
2022-08-25 23:49 ` oreo639
2022-08-25 23:52 ` oreo639
2022-08-25 23:58 ` [PR PATCH] [Updated] " oreo639
2022-08-26 10:54 ` leahneukirchen
2022-08-26 20:31 ` [PR PATCH] [Updated] " oreo639
2022-08-28 22:23 ` oreo639
2022-09-03  4:18 ` oreo639
2022-09-03  5:51 ` oreo639
2022-09-03  5:53 ` oreo639
2022-09-06 18:52 ` oreo639
2022-09-08 12:47 ` dkwo
2022-09-08 21:54 ` [PR PATCH] [Updated] " oreo639
2022-09-08 21:55 ` oreo639
2022-09-08 22:07 ` oreo639
2022-09-09  0:26 ` oreo639
2022-09-09  0:27 ` oreo639
2022-09-09  0:29 ` oreo639
2022-09-09  5:53 ` oreo639
2022-09-09  6:01 ` [PR PATCH] [Updated] " oreo639
2022-09-10 19:28 ` oreo639
2022-09-13 22:24 ` oreo639
2022-09-14  5:37 ` oreo639
2022-09-14 10:53 ` oreo639
2022-09-15  9:13 ` xfervi
2022-09-15  9:17 ` oreo639
2022-09-15  9:20 ` oreo639
2022-09-15  9:21 ` [PR PATCH] [Updated] " oreo639
2022-09-15  9:22 ` oreo639
2022-09-15  9:24 ` oreo639
2022-09-15  9:24 ` oreo639
2022-09-15  9:26 ` oreo639
2022-09-15  9:27 ` oreo639
2022-09-15  9:30 ` oreo639
2022-09-15  9:31 ` oreo639
2022-09-15  9:31 ` oreo639
2022-09-15  9:48 ` [PR PATCH] [Updated] " oreo639
2022-09-15 18:28 ` TeusLollo
2022-09-15 18:29 ` TeusLollo
2022-09-16  4:39 ` xfervi
2022-09-16  4:40 ` xfervi
2022-09-16  4:40 ` xfervi
2022-09-16  4:41 ` xfervi
2022-09-16  4:44 ` oreo639
2022-09-16  4:50 ` oreo639
2022-09-16  4:50 ` oreo639
2022-09-16  4:56 ` oreo639
2022-09-16  5:03 ` xfervi
2022-09-16  5:05 ` oreo639
2022-09-16  5:06 ` oreo639
2022-09-16  5:08 ` oreo639
2022-09-16  5:10 ` xfervi
2022-09-16 12:40 ` xfervi
2022-09-17  3:52 ` [PR PATCH] [Updated] " oreo639
2022-09-23  1:21 ` Seltyk
2022-09-23  1:24 ` Seltyk
2022-09-23  1:39 ` Seltyk
2022-09-23  1:42 ` oreo639
2022-09-23  1:44 ` oreo639
2022-09-23  1:44 ` oreo639
2022-09-23  1:46 ` oreo639
2022-09-23  1:53 ` oreo639
2022-09-23  2:38 ` oreo639
2022-09-23  2:56 ` oreo639
2022-09-23  2:57 ` oreo639
2022-09-23 13:41 ` TeusLollo
2022-09-24  4:01 ` Seltyk
2022-09-24  4:02 ` Seltyk
2022-09-24 15:16 ` TeusLollo
2022-09-24 15:20 ` SolitudeSF
2022-09-24 15:26 ` TeusLollo
2022-09-24 17:50 ` Seltyk
2022-09-24 17:50 ` Seltyk
2022-09-24 20:04 ` oreo639
2022-09-24 20:05 ` oreo639
2022-09-24 20:59 ` TeusLollo
2022-09-25  0:11 ` oreo639
2022-09-25  0:11 ` oreo639
2022-09-25  0:12 ` oreo639
2022-09-25  0:14 ` oreo639
2022-09-25  0:14 ` oreo639
2022-09-25  0:20 ` oreo639
2022-09-25  0:52 ` TeusLollo
2022-09-25  1:33 ` [PR PATCH] [Updated] " oreo639
2022-09-26 22:46 ` JamiKettunen
2022-09-26 22:47 ` JamiKettunen
2022-09-26 22:50 ` oreo639
2022-09-26 23:03 ` JamiKettunen
2022-09-26 23:03 ` JamiKettunen
2022-10-02 23:47 ` [PR PATCH] [Updated] " oreo639
2022-10-03  2:51 ` oreo639
2022-10-03  6:26 ` oreo639
2022-10-03  6:32 ` oreo639
2022-10-04  8:43 ` oreo639
2022-10-04 10:54 ` oreo639
2022-10-04 11:02 ` oreo639
2022-10-04 11:09 ` oreo639
2022-10-04 20:04 ` paper42
2022-10-05  4:27 ` oreo639
2022-10-05  4:28 ` oreo639
2022-10-05  8:40 ` [PR PATCH] [Updated] " oreo639
2022-10-06 20:29 ` paper42
2022-10-06 21:31 ` oreo639
2022-10-06 21:36 ` oreo639
2022-10-07  9:11 ` paper42
2022-10-08  0:10 ` ayoubelmhamdi
2022-10-08  0:12 ` oreo639
2022-10-08 10:57 ` [PR REVIEW] " Duncaen
2022-10-08 19:57 ` paper42
2022-10-08 21:03 ` [PR PATCH] [Updated] " oreo639
2022-10-08 21:03 ` [PR REVIEW] " oreo639
2022-10-09  1:32 ` oreo639
2022-10-09  1:45 ` ayoubelmhamdi
2022-10-09  1:57 ` oreo639
2022-10-09  1:57 ` oreo639
2022-10-09  1:59 ` oreo639
2022-10-09  3:36 ` oreo639
2022-10-09  7:47 ` ayoubelmhamdi
2022-10-10  4:15 ` [PR PATCH] [Updated] " oreo639
2022-10-10  5:05 ` oreo639
2022-10-10  5:10 ` oreo639
2022-10-13 18:49 ` Johnnynator
2022-10-13 19:02 ` oreo639
2022-10-13 19:02 ` oreo639
2022-10-13 19:04 ` oreo639
2022-10-13 19:28 ` oreo639
2022-10-13 19:28 ` oreo639
2022-10-13 19:28 ` oreo639
2022-10-13 19:29 ` oreo639
2022-10-13 19:47 ` oreo639
2022-10-13 20:02 ` toukoAMG
2022-10-13 20:28 ` TeusLollo
2022-10-13 20:32 ` TeusLollo
2022-10-13 22:44 ` oreo639
2022-10-13 22:49 ` oreo639
2022-10-14  3:18 ` oreo639
2022-10-14  4:01 ` [PR PATCH] [Updated] " oreo639
2022-10-14  4:08 ` oreo639
2022-10-14  4:54 ` oreo639
2022-10-14  9:02 ` oreo639
2022-10-14  9:04 ` oreo639
2022-10-14  9:33 ` oreo639
2022-10-14  9:33 ` oreo639
2022-10-14 10:10 ` [PR PATCH] [Updated] " oreo639
2022-10-14 10:11 ` oreo639
2022-10-15 10:41 ` oreo639
2022-10-18  4:48 ` oreo639
2022-10-18 18:03 ` oreo639
2022-10-19  8:14 ` oreo639
2022-11-05 15:35 ` pwhite1989
2022-11-05 15:36 ` pwhite1989
2022-11-05 15:39 ` paper42
2022-11-05 18:38 ` [PR PATCH] [Updated] " oreo639
2022-11-06 15:10 ` pwhite1989
2022-11-06 15:10 ` pwhite1989
2022-11-06 15:14 ` pwhite1989
2022-11-06 18:47 ` oreo639
2022-11-06 19:33 ` [PR PATCH] [Updated] " oreo639
2022-11-08 18:27 ` oreo639
2022-11-08 19:06 ` oreo639
2022-11-14 23:45 ` kruceter
2022-11-16  1:37 ` sgn
2022-11-16  1:37 ` sgn
2022-11-16  1:57 ` kruceter
2022-11-16  2:05 ` [PR PATCH] [Updated] " oreo639
2022-11-16  2:06 ` sgn
2022-11-17  0:48 ` [PR PATCH] [Updated] " oreo639
2022-11-17  1:54 ` oreo639
2022-11-18  4:02 ` oreo639
2022-11-18 10:02 ` oreo639
2022-11-19 10:50 ` oreo639
2022-11-19 11:01 ` oreo639
2022-11-19 18:18 ` paper42
2022-11-19 20:09 ` paper42
2022-11-19 22:37 ` [PR PATCH] [Updated] " oreo639
2022-11-19 22:39 ` oreo639
2022-11-19 22:45 ` [PR PATCH] [Updated] " oreo639
2022-11-19 22:51 ` oreo639
2022-11-19 22:57 ` oreo639
2022-11-20 18:03 ` oreo639
2022-11-21 18:22 ` oreo639
2022-11-21 18:24 ` oreo639
2022-11-28 19:06 ` oreo639
2022-12-04 20:13 ` oreo639
2022-12-08 13:02 ` kenaryn
2022-12-08 13:02 ` kenaryn
2022-12-12 18:16 ` [PR PATCH] [Updated] " oreo639
2022-12-12 18:24 ` oreo639
2022-12-15 22:20 ` sug0
2022-12-17  5:52 ` [PR PATCH] [Closed]: " sgn
2022-12-20  1:23 ` lane-brain
2022-12-20  2:18 ` oreo639
2022-12-21  0:15 ` TeusLollo
2023-01-05  8:29 ` [PR REVIEW] " CameronNemo
2023-01-05  8:42 ` oreo639
2023-01-05  8:44 ` oreo639
2023-01-05  8:45 ` oreo639
2023-01-05  8:45 ` oreo639
2023-01-05  8:46 ` oreo639
2023-01-05  8:46 ` oreo639
2023-01-05  8:46 ` oreo639
2023-01-05  8:47 ` oreo639
2023-01-05  9:00 ` oreo639
2023-01-05  9:00 ` oreo639
2023-01-05  9:01 ` oreo639
2023-01-05  9:02 ` oreo639

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).